~ubuntu-branches/ubuntu/jaunty/kde4libs/jaunty

« back to all changes in this revision

Viewing changes to khtml/xml/dom_docimpl.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Wenning, Jonathan Thomas, Andreas Wenning
  • Date: 2009-04-01 05:55:52 UTC
  • mfrom: (1.1.29 upstream)
  • Revision ID: james.westby@ubuntu.com-20090401055552-uel5di5f3xiftax3
Tags: 4:4.2.2-0ubuntu1
[ Jonathan Thomas ]
* New upstream release (LP: #344709, #348823):
  - Bump upstreamversion and runtimedeps in debian/rules
  - Remove kubuntu_65_kcmdlineargs_decoding_svn934640.diff, applied upstream

[ Andreas Wenning ]
* Remove patch kubuntu_69_do_not_show_plasma_popups_over_screensaver.diff,
  applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
318
318
    qDeleteAll( m_dict );
319
319
}
320
320
 
321
 
void ElementMappingCache::add(const QString& id, ElementImpl* nd)
 
321
void ElementMappingCache::add(const DOMString& id, ElementImpl* nd)
322
322
{
323
323
    if (id.isEmpty()) return;
324
324
 
337
337
    }
338
338
}
339
339
 
340
 
void ElementMappingCache::set(const QString& id, ElementImpl* nd)
 
340
void ElementMappingCache::set(const DOMString& id, ElementImpl* nd)
341
341
{
342
342
    if (id.isEmpty()) return;
343
343
 
346
346
    info->nd = nd;
347
347
}
348
348
 
349
 
void ElementMappingCache::remove(const QString& id, ElementImpl* nd)
 
349
void ElementMappingCache::remove(const DOMString& id, ElementImpl* nd)
350
350
{
351
351
    if (id.isEmpty()) return;
352
352
 
365
365
    }
366
366
}
367
367
 
368
 
bool ElementMappingCache::contains(const QString& id)
 
368
bool ElementMappingCache::contains(const DOMString& id)
369
369
{
370
370
    if (id.isEmpty()) return false;
371
371
    return m_dict.contains(id);
372
372
}
373
373
 
374
 
ElementMappingCache::ItemInfo* ElementMappingCache::get(const QString& id)
 
374
ElementMappingCache::ItemInfo* ElementMappingCache::get(const DOMString& id)
375
375
{
376
376
    if (id.isEmpty()) return 0;
377
377
    return m_dict.value(id);
597
597
        *pExceptioncode = DOMException::INVALID_CHARACTER_ERR;
598
598
        return 0;
599
599
    }
600
 
    DOMString prefix, localName;
601
 
    splitPrefixLocalName(name.implementation(), prefix, localName);
602
 
    bool htmlCompat = (htmlMode() != XHtml);
603
 
    if (htmlCompat) {
604
 
        localName = localName.lower();
605
 
        prefix = prefix.lower();
606
 
    }
607
 
    XMLElementImpl* e = new XMLElementImpl(document(), emptyNamespaceName, LocalName::fromString(localName), PrefixName::fromString(prefix));
 
600
 
 
601
    PrefixName prefix;
 
602
    LocalName  localName;
 
603
    bool htmlCompat = htmlMode() != XHtml;
 
604
    splitPrefixLocalName(name, prefix, localName, htmlCompat);
 
605
    XMLElementImpl* e = new XMLElementImpl(document(), emptyNamespaceName, localName, prefix);
608
606
    e->setHTMLCompat(htmlCompat); // Not a real HTML element, but inside an html-compat doc all tags are uppercase.
609
607
    return e;
610
608
}
615
613
        *pExceptioncode = DOMException::INVALID_CHARACTER_ERR;
616
614
        return 0;
617
615
    }
618
 
    DOMString prefix, localName;
619
 
    splitPrefixLocalName(tagName.implementation(), prefix, localName);
 
616
 
 
617
    PrefixName prefix;
 
618
    LocalName  localName;
620
619
    bool htmlCompat = (htmlMode() != XHtml);
621
 
    if (htmlCompat) {
622
 
        localName = localName.lower();
623
 
        prefix = prefix.lower();
624
 
    }
625
 
    AttrImpl* attr = new AttrImpl(0, document(), NamespaceName::fromId(emptyNamespace), LocalName::fromString(localName),
626
 
            PrefixName::fromString(prefix), DOMString("").implementation());
 
620
    splitPrefixLocalName(tagName, prefix, localName, htmlCompat);
 
621
 
 
622
    AttrImpl* attr = new AttrImpl(0, document(), NamespaceName::fromId(emptyNamespace),
 
623
            localName, prefix, DOMString("").implementation());
627
624
    attr->setHTMLCompat(htmlCompat);
628
625
    return attr;
629
626
}
797
794
                                              false/*nameCanBeNull*/, false/*nameCanBeEmpty*/,
798
795
                                              pExceptioncode))
799
796
        return 0;
800
 
    DOMString prefix, localName;
801
 
    splitPrefixLocalName(_qualifiedName.implementation(), prefix, localName, colonPos);
802
 
    AttrImpl* attr = new AttrImpl(0, document(), NamespaceName::fromString(_namespaceURI), LocalName::fromString(localName),
803
 
            PrefixName::fromString(prefix), DOMString("").implementation());
804
 
    attr->setHTMLCompat( _namespaceURI.isNull() && htmlMode() != XHtml );
 
797
    PrefixName prefix;
 
798
    LocalName  localName;
 
799
    bool htmlCompat =  _namespaceURI.isNull() && htmlMode() != XHtml;
 
800
    splitPrefixLocalName(_qualifiedName, prefix, localName, false, colonPos);
 
801
    AttrImpl* attr = new AttrImpl(0, document(), NamespaceName::fromString(_namespaceURI),
 
802
            localName, prefix, DOMString("").implementation());
 
803
    attr->setHTMLCompat( htmlCompat );
805
804
    return attr;
806
805
}
807
806
 
808
807
ElementImpl *DocumentImpl::getElementById( const DOMString &elementId ) const
809
808
{
810
 
    QString stringKey = elementId.string();
811
 
 
812
 
    ElementMappingCache::ItemInfo* info = m_getElementByIdCache.get(stringKey);
 
809
    ElementMappingCache::ItemInfo* info = m_getElementByIdCache.get(elementId);
813
810
 
814
811
    if (!info)
815
812
        return 0;
2828
2825
 
2829
2826
    m_imageLoadEventDispatchingList = m_imageLoadEventDispatchSoonList;
2830
2827
    m_imageLoadEventDispatchSoonList.clear();
2831
 
    for (QLinkedListIterator<HTMLImageElementImpl*> it(m_imageLoadEventDispatchingList); it.hasNext(); )
2832
 
        it.next()->dispatchLoadEvent();
 
2828
    while (!m_imageLoadEventDispatchingList.isEmpty())
 
2829
        m_imageLoadEventDispatchingList.takeFirst()->dispatchLoadEvent();
2833
2830
    m_imageLoadEventDispatchingList.clear();
2834
2831
}
2835
2832