~ubuntu-branches/ubuntu/natty/kde4libs/natty-proposed

« back to all changes in this revision

Viewing changes to khtml/xml/dom_docimpl.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell, Scott Kitterman, Jonathan Riddell
  • Date: 2010-11-22 17:59:02 UTC
  • mfrom: (1.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101122175902-yubxubd0pg6hn11z
Tags: 4:4.5.80a-0ubuntu1
[ Scott Kitterman ]
* New upstream beta release
  - Refreshed all patches
  - Updated debian/patches/10_make_libkdeinit4_private.diff to use Qfile
    instead of Qstring in kdecore/kernel/kstandarddirs_unix.cpp
  - Updated debian/patches/kubuntu_01_kubuntu_useragent.diff to provide
    Kubuntu in the Konqueror user agen string with the changes in
    kio/kio/kprotocolmanager.cpp
  - Partially updated debian/patches/kubuntu_05_langpack_desktop_files.diff
    and left the balance in kdecore/localization/klocale.cpp.rej for later
    revision
  - Update debian/patches/kubuntu_06_user_disk_mounting.diff for changes in
    solid/solid/backends/hal/halstorageaccess.cpp
  - Remove debian/patches/kubuntu_71_backport_plasma_webview_changes.diff
    (backported from upstream, so already present now)
  - Add minimum version for libattica-dev of 0.1.90 to build-depends
  - Bump minimum version for libsoprano-dev build-depend to 2.5.60
  - Add minimum version for shared-desktop-ontologies of 0.5 in build-dep

[ Jonathan Riddell ]
* Add build-depends on grantlee, libudev-dev, hupnp (FIXME needs packaging fixes)
* Update kubuntu_04_add_langpack_path.diff 28_find_old_kde4_html_documentation.diff
  22_hack_in_etc_kde4_in_kstandarddirs.diff for QT_NO_CAST_FROM_ASCII
* Update kubuntu_05_langpack_desktop_files.diff for new upstream code
* Add kubuntu_78_solid_trunk.diff to fix solid linking
* Add libnepomukutils4 package for new library
* Don't install kcm_ssl for now, e-mailed upstream to suggest moving to kdebase
* Add kubuntu_79_knewstuff_fix.diff to fix compile broken by non-trunk commit
  http://websvn.kde.org/?view=revision&revision=1199825
* kdelibs5-data replaces old kdebase-runtime-data due to moved file
* Add kubuntu_80_find_hupnp.diff to find hupnp include files, committed upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
2841
2841
    ChildFrame *childFrame = childPart->d->m_frame;
2842
2842
    if (!childFrame)
2843
2843
        return 0;
2844
 
    return childFrame->m_partContainerElement;
2845
 
}
2846
 
 
 
2844
    return childFrame->m_partContainerElement.data();
 
2845
}
 
2846
 
 
2847
khtml::SecurityOrigin* DocumentImpl::origin() const
 
2848
{
 
2849
    if (!m_origin)
 
2850
        m_origin = SecurityOrigin::create(URL());
 
2851
    return m_origin.get();
 
2852
}
 
2853
 
 
2854
void DocumentImpl::setOrigin(khtml::SecurityOrigin* newOrigin)
 
2855
{
 
2856
    assert(origin()->isEmpty());
 
2857
    m_origin = newOrigin;
 
2858
}
 
2859
    
2847
2860
DOMString DocumentImpl::domain() const
2848
2861
{
2849
 
    if ( m_domain.isEmpty() ) // not set yet (we set it on demand to save time and space)
2850
 
        m_domain = URL().host(); // Initially set to the host
2851
 
    return m_domain;
 
2862
    return origin()->domain();
2852
2863
}
2853
2864
 
2854
2865
void DocumentImpl::setDomain(const DOMString &newDomain)
2855
2866
{
2856
 
    if ( m_domain.isEmpty() ) // not set yet (we set it on demand to save time and space)
2857
 
        m_domain = URL().host().toLower(); // Initially set to the host
2858
 
 
2859
 
    if ( m_domain.isEmpty() /*&& part() && part()->openedByJS()*/ )
2860
 
        m_domain = newDomain.lower();
 
2867
    // ### this test really should move to SecurityOrigin..
 
2868
    DOMString oldDomain = origin()->domain();
2861
2869
 
2862
2870
    // Both NS and IE specify that changing the domain is only allowed when
2863
2871
    // the new domain is a suffix of the old domain.
2864
 
    int oldLength = m_domain.length();
 
2872
    int oldLength = oldDomain.length();
2865
2873
    int newLength = newDomain.length();
2866
2874
    if ( newLength < oldLength ) // e.g. newDomain=kde.org (7) and m_domain=www.kde.org (11)
2867
2875
    {
2868
 
        DOMString test = m_domain.copy();
 
2876
        DOMString test = oldDomain.copy();
2869
2877
        DOMString reference = newDomain.lower();
2870
2878
        if ( test[oldLength - newLength - 1] == '.' ) // Check that it's a subdomain, not e.g. "de.org"
2871
2879
        {
2872
2880
            test.remove( 0, oldLength - newLength ); // now test is "kde.org" from m_domain
2873
2881
            if ( test == reference )                 // and we check that it's the same thing as newDomain
2874
 
                m_domain = reference;
 
2882
                m_origin->setDomainFromDOM( reference.string() );
2875
2883
        }
2876
2884
    }
2877
2885
}