diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
commit | 3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch) | |
tree | 73dc228333948738bbe02976cacca8cd382bc978 /Source/WebCore/html/HTMLPropertiesCollection.cpp | |
parent | b32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff) | |
download | qtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz |
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/WebCore/html/HTMLPropertiesCollection.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLPropertiesCollection.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/WebCore/html/HTMLPropertiesCollection.cpp b/Source/WebCore/html/HTMLPropertiesCollection.cpp index b67c4c16a..7e81766db 100644 --- a/Source/WebCore/html/HTMLPropertiesCollection.cpp +++ b/Source/WebCore/html/HTMLPropertiesCollection.cpp @@ -69,14 +69,14 @@ void HTMLPropertiesCollection::updateRefElements() const toHTMLElement(base())->getItemRefElements(m_itemRefElements); } -static Node* nextNodeWithProperty(Node* base, Node* node) +static Node* nextNodeWithProperty(Node* rootNode, Node* previous, Node* ownerNode) { // An Microdata item may contain properties which in turn are items themselves. Properties can // also themselves be groups of name-value pairs, by putting the itemscope attribute on the element // that declares the property. If the property has an itemscope attribute specified then we need // to traverse the next sibling. - return node == base || (node->isHTMLElement() && !toHTMLElement(node)->fastHasAttribute(itemscopeAttr)) - ? node->traverseNextNode(base) : node->traverseNextSibling(base); + return previous == ownerNode || (previous->isHTMLElement() && !toHTMLElement(previous)->fastHasAttribute(itemscopeAttr)) + ? previous->traverseNextNode(rootNode) : previous->traverseNextSibling(rootNode); } Element* HTMLPropertiesCollection::virtualItemAfter(unsigned& offsetInArray, Element* previousItem) const @@ -90,13 +90,14 @@ Element* HTMLPropertiesCollection::virtualItemAfter(unsigned& offsetInArray, Ele return 0; } -HTMLElement* HTMLPropertiesCollection::virtualItemAfter(HTMLElement* base, Element* previous) const +HTMLElement* HTMLPropertiesCollection::virtualItemAfter(HTMLElement* rootNode, Element* previous) const { Node* current; - current = previous ? nextNodeWithProperty(base, previous) : base; + Node* ownerNode = this->ownerNode(); + current = previous ? nextNodeWithProperty(rootNode, previous, ownerNode) : rootNode; - for (; current; current = nextNodeWithProperty(base, current)) { - if (!current->isHTMLElement()) + for (; current; current = nextNodeWithProperty(rootNode, current, ownerNode)) { + if (current == ownerNode || !current->isHTMLElement()) continue; HTMLElement* element = toHTMLElement(current); if (element->fastHasAttribute(itempropAttr) && element->itemProp()->length()) { |