<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[165231] branches/safari-537.75-branch/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/165231">165231</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2014-03-06 16:49:52 -0800 (Thu, 06 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge Merge <a href="http://trac.webkit.org/projects/webkit/changeset/159489">r159489</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari53775branchSourceWebCoreChangeLog">branches/safari-537.75-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari53775branchSourceWebCoredomDocumentOrderedMapcpp">branches/safari-537.75-branch/Source/WebCore/dom/DocumentOrderedMap.cpp</a></li>
<li><a href="#branchessafari53775branchSourceWebCoredomDocumentOrderedMaph">branches/safari-537.75-branch/Source/WebCore/dom/DocumentOrderedMap.h</a></li>
<li><a href="#branchessafari53775branchSourceWebCoredomElementcpp">branches/safari-537.75-branch/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#branchessafari53775branchSourceWebCoredomTreeScopecpp">branches/safari-537.75-branch/Source/WebCore/dom/TreeScope.cpp</a></li>
<li><a href="#branchessafari53775branchSourceWebCorehtmlHTMLImageElementcpp">branches/safari-537.75-branch/Source/WebCore/html/HTMLImageElement.cpp</a></li>
<li><a href="#branchessafari53775branchSourceWebCorehtmlHTMLMapElementcpp">branches/safari-537.75-branch/Source/WebCore/html/HTMLMapElement.cpp</a></li>
<li><a href="#branchessafari53775branchSourceWebCorehtmlHTMLObjectElementcpp">branches/safari-537.75-branch/Source/WebCore/html/HTMLObjectElement.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari53775branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/ChangeLog (165230 => 165231)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/ChangeLog        2014-03-07 00:47:18 UTC (rev 165230)
+++ branches/safari-537.75-branch/Source/WebCore/ChangeLog        2014-03-07 00:49:52 UTC (rev 165231)
</span><span class="lines">@@ -22,6 +22,47 @@
</span><span class="cx">
</span><span class="cx"> 2014-03-06 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r159489.
+
+ 2013-11-19 Ryosuke Niwa <rniwa@webkit.org>
+
+ Add more assertions with security implications in DocumentOrderedMap
+ https://bugs.webkit.org/show_bug.cgi?id=124559
+
+ Reviewed by Antti Koivisto.
+
+ Assert that newly added elements and existing elements in the document ordered map are in the same tree scope
+ as the document ordered map. Also exit early if we're about to add an element in a wrong document to the map.
+ We don't exit early in get() because the damage has already been done at that point (the element may have been
+ deleted already).
+
+ * dom/Document.cpp:
+ (WebCore::Document::addImageElementByLowercasedUsemap):
+ * dom/DocumentOrderedMap.cpp:
+ (WebCore::DocumentOrderedMap::add): Assert that the newly added element is in the current tree scope.
+ Also exit early if either the element is not in the tree scope or not in the right document.
+ While this doesn't make the function completely fault safe, it'll catch when we try to add a detached node.
+ (WebCore::DocumentOrderedMap::remove): Convert existing assertions to ones with security implication.
+ (WebCore::DocumentOrderedMap::get): Assert with security implication that the element we're about to return
+ is in the current tree scope. The element may have already been deleted if we ever hit these assertions.
+ (WebCore::DocumentOrderedMap::getAllElementsById): Convert an existing assertion to an assertion with security
+ implication.
+ * dom/DocumentOrderedMap.h:
+ * dom/TreeScope.cpp:
+ (WebCore::TreeScope::addElementById):
+ (WebCore::TreeScope::addElementByName):
+ (WebCore::TreeScope::addImageMap):
+ (WebCore::TreeScope::addLabel):
+ * html/HTMLDocument.cpp:
+ (WebCore::HTMLDocument::addDocumentNamedItem):
+ (WebCore::HTMLDocument::addWindowNamedItem):
+ * html/HTMLImageElement.cpp:
+ (WebCore::HTMLImageElement::insertedInto): Set InTreeScope flag before calling addImageElementByLowercasedUsemap.
+ * html/HTMLMapElement.cpp:
+ (WebCore::HTMLMapElement::insertedInto): Ditto for addImageMap.
+
+2014-03-06 Matthew Hanson <matthew_hanson@apple.com>
+
</ins><span class="cx"> Merge r165145.
</span><span class="cx">
</span><span class="cx"> 2014-03-05 Daniel Bates <dabates@apple.com>
</span></span></pre></div>
<a id="branchessafari53775branchSourceWebCoredomDocumentOrderedMapcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/dom/DocumentOrderedMap.cpp (165230 => 165231)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/dom/DocumentOrderedMap.cpp        2014-03-07 00:47:18 UTC (rev 165230)
+++ branches/safari-537.75-branch/Source/WebCore/dom/DocumentOrderedMap.cpp        2014-03-07 00:49:52 UTC (rev 165231)
</span><span class="lines">@@ -82,17 +82,18 @@
</span><span class="cx"> m_map.clear();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DocumentOrderedMap::add(AtomicStringImpl* key, Element* element)
</del><ins>+void DocumentOrderedMap::add(AtomicStringImpl* key, Element* element, const TreeScope* treeScope)
</ins><span class="cx"> {
</span><del>- ASSERT(key);
- ASSERT(element);
-
</del><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(element->isInTreeScope());
+ ASSERT_WITH_SECURITY_IMPLICATION(treeScope->rootNode()->containsIncludingShadowDOM(element));
+ if (!element->isInTreeScope() || element->document() != treeScope->documentScope())
+ return;
</ins><span class="cx"> Map::AddResult addResult = m_map.add(key, MapEntry(element));
</span><span class="cx"> if (addResult.isNewEntry)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> MapEntry& entry = addResult.iterator->value;
</span><del>- ASSERT(entry.count);
</del><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(entry.count);
</ins><span class="cx"> entry.element = 0;
</span><span class="cx"> entry.count++;
</span><span class="cx"> entry.orderedList.clear();
</span><span class="lines">@@ -105,15 +106,14 @@
</span><span class="cx">
</span><span class="cx"> m_map.checkConsistency();
</span><span class="cx"> Map::iterator it = m_map.find(key);
</span><del>- ASSERT(it != m_map.end());
</del><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(it != m_map.end());
</ins><span class="cx"> if (it == m_map.end())
</span><span class="cx"> return;
</span><del>-
</del><span class="cx"> MapEntry& entry = it->value;
</span><span class="cx">
</span><del>- ASSERT(entry.count);
</del><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(entry.count);
</ins><span class="cx"> if (entry.count == 1) {
</span><del>- ASSERT(!entry.element || entry.element == element);
</del><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(!entry.element || entry.element == element);
</ins><span class="cx"> m_map.remove(it);
</span><span class="cx"> } else {
</span><span class="cx"> if (entry.element == element)
</span><span class="lines">@@ -137,14 +137,19 @@
</span><span class="cx">
</span><span class="cx"> MapEntry& entry = it->value;
</span><span class="cx"> ASSERT(entry.count);
</span><del>- if (entry.element)
</del><ins>+ if (entry.element) {
+ ASSERT_WITH_SECURITY_IMPLICATION(entry.element->isInTreeScope());
+ ASSERT_WITH_SECURITY_IMPLICATION(entry.element->treeScope() == scope);
</ins><span class="cx"> return entry.element;
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> // We know there's at least one node that matches; iterate to find the first one.
</span><span class="cx"> for (Element* element = ElementTraversal::firstWithin(scope->rootNode()); element; element = ElementTraversal::next(element)) {
</span><span class="cx"> if (!keyMatches(key, element))
</span><span class="cx"> continue;
</span><span class="cx"> entry.element = element;
</span><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(element->isInTreeScope());
+ ASSERT_WITH_SECURITY_IMPLICATION(element->treeScope() == scope);
</ins><span class="cx"> return element;
</span><span class="cx"> }
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="lines">@@ -198,7 +203,7 @@
</span><span class="cx"> return 0;
</span><span class="cx">
</span><span class="cx"> MapEntry& entry = it->value;
</span><del>- ASSERT(entry.count);
</del><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(entry.count);
</ins><span class="cx"> if (!entry.count)
</span><span class="cx"> return 0;
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari53775branchSourceWebCoredomDocumentOrderedMaph"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/dom/DocumentOrderedMap.h (165230 => 165231)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/dom/DocumentOrderedMap.h        2014-03-07 00:47:18 UTC (rev 165230)
+++ branches/safari-537.75-branch/Source/WebCore/dom/DocumentOrderedMap.h        2014-03-07 00:49:52 UTC (rev 165231)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">
</span><span class="cx"> class DocumentOrderedMap {
</span><span class="cx"> public:
</span><del>- void add(AtomicStringImpl*, Element*);
</del><ins>+ void add(AtomicStringImpl*, Element*, const TreeScope*);
</ins><span class="cx"> void remove(AtomicStringImpl*, Element*);
</span><span class="cx"> void clear();
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari53775branchSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/dom/Element.cpp (165230 => 165231)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/dom/Element.cpp        2014-03-07 00:47:18 UTC (rev 165230)
+++ branches/safari-537.75-branch/Source/WebCore/dom/Element.cpp        2014-03-07 00:49:52 UTC (rev 165231)
</span><span class="lines">@@ -2895,7 +2895,7 @@
</span><span class="cx"> if (!oldName.isEmpty() && oldName != id)
</span><span class="cx"> document->windowNamedItemMap().remove(oldName.impl(), this);
</span><span class="cx"> if (!newName.isEmpty() && newName != id)
</span><del>- document->windowNamedItemMap().add(newName.impl(), this);
</del><ins>+ document->windowNamedItemMap().add(newName.impl(), this, treeScope());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (DocumentNameCollection::nodeMatchesIfNameAttributeMatch(this)) {
</span><span class="lines">@@ -2903,7 +2903,7 @@
</span><span class="cx"> if (!oldName.isEmpty() && oldName != id)
</span><span class="cx"> document->documentNamedItemMap().remove(oldName.impl(), this);
</span><span class="cx"> if (!newName.isEmpty() && newName != id)
</span><del>- document->documentNamedItemMap().add(newName.impl(), this);
</del><ins>+ document->documentNamedItemMap().add(newName.impl(), this, treeScope());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2946,7 +2946,7 @@
</span><span class="cx"> if (!oldId.isEmpty() && oldId != name)
</span><span class="cx"> document->windowNamedItemMap().remove(oldId.impl(), this);
</span><span class="cx"> if (!newId.isEmpty() && newId != name)
</span><del>- document->windowNamedItemMap().add(newId.impl(), this);
</del><ins>+ document->windowNamedItemMap().add(newId.impl(), this, treeScope());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (DocumentNameCollection::nodeMatchesIfIdAttributeMatch(this)) {
</span><span class="lines">@@ -2954,7 +2954,7 @@
</span><span class="cx"> if (!oldId.isEmpty() && oldId != name)
</span><span class="cx"> document->documentNamedItemMap().remove(oldId.impl(), this);
</span><span class="cx"> if (!newId.isEmpty() && newId != name)
</span><del>- document->documentNamedItemMap().add(newId.impl(), this);
</del><ins>+ document->documentNamedItemMap().add(newId.impl(), this, treeScope());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari53775branchSourceWebCoredomTreeScopecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/dom/TreeScope.cpp (165230 => 165231)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/dom/TreeScope.cpp        2014-03-07 00:47:18 UTC (rev 165230)
+++ branches/safari-537.75-branch/Source/WebCore/dom/TreeScope.cpp        2014-03-07 00:49:52 UTC (rev 165231)
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_elementsById)
</span><span class="cx"> m_elementsById = adoptPtr(new DocumentOrderedMap);
</span><del>- m_elementsById->add(elementId.impl(), element);
</del><ins>+ m_elementsById->add(elementId.impl(), element, this);
</ins><span class="cx"> m_idTargetObserverRegistry->notifyObservers(elementId);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_elementsByName)
</span><span class="cx"> m_elementsByName = adoptPtr(new DocumentOrderedMap);
</span><del>- m_elementsByName->add(name.impl(), element);
</del><ins>+ m_elementsByName->add(name.impl(), element, this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void TreeScope::removeElementByName(const AtomicString& name, Element* element)
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx"> return;
</span><span class="cx"> if (!m_imageMapsByName)
</span><span class="cx"> m_imageMapsByName = adoptPtr(new DocumentOrderedMap);
</span><del>- m_imageMapsByName->add(name, imageMap);
</del><ins>+ m_imageMapsByName->add(name, imageMap, this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void TreeScope::removeImageMap(HTMLMapElement* imageMap)
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx"> void TreeScope::addLabel(const AtomicString& forAttributeValue, HTMLLabelElement* element)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_labelsByForAttribute);
</span><del>- m_labelsByForAttribute->add(forAttributeValue.impl(), element);
</del><ins>+ m_labelsByForAttribute->add(forAttributeValue.impl(), element, this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void TreeScope::removeLabel(const AtomicString& forAttributeValue, HTMLLabelElement* element)
</span></span></pre></div>
<a id="branchessafari53775branchSourceWebCorehtmlHTMLImageElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/html/HTMLImageElement.cpp (165230 => 165231)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/html/HTMLImageElement.cpp        2014-03-07 00:47:18 UTC (rev 165230)
+++ branches/safari-537.75-branch/Source/WebCore/html/HTMLImageElement.cpp        2014-03-07 00:49:52 UTC (rev 165231)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx"> const AtomicString& id = getIdAttribute();
</span><span class="cx"> if (!id.isEmpty() && id != getNameAttribute()) {
</span><span class="cx"> if (willHaveName)
</span><del>- document->documentNamedItemMap().add(id.impl(), this);
</del><ins>+ document->documentNamedItemMap().add(id.impl(), this, treeScope());
</ins><span class="cx"> else
</span><span class="cx"> document->documentNamedItemMap().remove(id.impl(), this);
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari53775branchSourceWebCorehtmlHTMLMapElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/html/HTMLMapElement.cpp (165230 => 165231)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/html/HTMLMapElement.cpp        2014-03-07 00:47:18 UTC (rev 165230)
+++ branches/safari-537.75-branch/Source/WebCore/html/HTMLMapElement.cpp        2014-03-07 00:49:52 UTC (rev 165231)
</span><span class="lines">@@ -133,9 +133,10 @@
</span><span class="cx">
</span><span class="cx"> Node::InsertionNotificationRequest HTMLMapElement::insertedInto(ContainerNode* insertionPoint)
</span><span class="cx"> {
</span><ins>+ Node::InsertionNotificationRequest request = HTMLElement::insertedInto(insertionPoint);
</ins><span class="cx"> if (insertionPoint->inDocument())
</span><span class="cx"> treeScope()->addImageMap(this);
</span><del>- return HTMLElement::insertedInto(insertionPoint);
</del><ins>+ return request;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLMapElement::removedFrom(ContainerNode* insertionPoint)
</span></span></pre></div>
<a id="branchessafari53775branchSourceWebCorehtmlHTMLObjectElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.75-branch/Source/WebCore/html/HTMLObjectElement.cpp (165230 => 165231)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.75-branch/Source/WebCore/html/HTMLObjectElement.cpp        2014-03-07 00:47:18 UTC (rev 165230)
+++ branches/safari-537.75-branch/Source/WebCore/html/HTMLObjectElement.cpp        2014-03-07 00:49:52 UTC (rev 165231)
</span><span class="lines">@@ -445,7 +445,7 @@
</span><span class="cx"> const AtomicString& id = getIdAttribute();
</span><span class="cx"> if (!id.isEmpty()) {
</span><span class="cx"> if (isNamedItem)
</span><del>- document->documentNamedItemMap().add(id.impl(), this);
</del><ins>+ document->documentNamedItemMap().add(id.impl(), this, treeScope());
</ins><span class="cx"> else
</span><span class="cx"> document->documentNamedItemMap().remove(id.impl(), this);
</span><span class="cx"> }
</span><span class="lines">@@ -453,7 +453,7 @@
</span><span class="cx"> const AtomicString& name = getNameAttribute();
</span><span class="cx"> if (!name.isEmpty() && id != name) {
</span><span class="cx"> if (isNamedItem)
</span><del>- document->documentNamedItemMap().add(name.impl(), this);
</del><ins>+ document->documentNamedItemMap().add(name.impl(), this, treeScope());
</ins><span class="cx"> else
</span><span class="cx"> document->documentNamedItemMap().remove(name.impl(), this);
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>