<!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  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r159489.
+
+    2013-11-19  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+            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  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r165145.
</span><span class="cx"> 
</span><span class="cx">     2014-03-05  Daniel Bates  &lt;dabates@apple.com&gt;
</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-&gt;isInTreeScope());
+    ASSERT_WITH_SECURITY_IMPLICATION(treeScope-&gt;rootNode()-&gt;containsIncludingShadowDOM(element));
+    if (!element-&gt;isInTreeScope() || element-&gt;document() != treeScope-&gt;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&amp; entry = addResult.iterator-&gt;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&amp; entry = it-&gt;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&amp; entry = it-&gt;value;
</span><span class="cx">     ASSERT(entry.count);
</span><del>-    if (entry.element)
</del><ins>+    if (entry.element) {
+        ASSERT_WITH_SECURITY_IMPLICATION(entry.element-&gt;isInTreeScope());
+        ASSERT_WITH_SECURITY_IMPLICATION(entry.element-&gt;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-&gt;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-&gt;isInTreeScope());
+        ASSERT_WITH_SECURITY_IMPLICATION(element-&gt;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&amp; entry = it-&gt;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() &amp;&amp; oldName != id)
</span><span class="cx">             document-&gt;windowNamedItemMap().remove(oldName.impl(), this);
</span><span class="cx">         if (!newName.isEmpty() &amp;&amp; newName != id)
</span><del>-            document-&gt;windowNamedItemMap().add(newName.impl(), this);
</del><ins>+            document-&gt;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() &amp;&amp; oldName != id)
</span><span class="cx">             document-&gt;documentNamedItemMap().remove(oldName.impl(), this);
</span><span class="cx">         if (!newName.isEmpty() &amp;&amp; newName != id)
</span><del>-            document-&gt;documentNamedItemMap().add(newName.impl(), this);
</del><ins>+            document-&gt;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() &amp;&amp; oldId != name)
</span><span class="cx">             document-&gt;windowNamedItemMap().remove(oldId.impl(), this);
</span><span class="cx">         if (!newId.isEmpty() &amp;&amp; newId != name)
</span><del>-            document-&gt;windowNamedItemMap().add(newId.impl(), this);
</del><ins>+            document-&gt;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() &amp;&amp; oldId != name)
</span><span class="cx">             document-&gt;documentNamedItemMap().remove(oldId.impl(), this);
</span><span class="cx">         if (!newId.isEmpty() &amp;&amp; newId != name)
</span><del>-            document-&gt;documentNamedItemMap().add(newId.impl(), this);
</del><ins>+            document-&gt;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-&gt;add(elementId.impl(), element);
</del><ins>+    m_elementsById-&gt;add(elementId.impl(), element, this);
</ins><span class="cx">     m_idTargetObserverRegistry-&gt;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-&gt;add(name.impl(), element);
</del><ins>+    m_elementsByName-&gt;add(name.impl(), element, this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TreeScope::removeElementByName(const AtomicString&amp; 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-&gt;add(name, imageMap);
</del><ins>+    m_imageMapsByName-&gt;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&amp; forAttributeValue, HTMLLabelElement* element)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_labelsByForAttribute);
</span><del>-    m_labelsByForAttribute-&gt;add(forAttributeValue.impl(), element);
</del><ins>+    m_labelsByForAttribute-&gt;add(forAttributeValue.impl(), element, this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TreeScope::removeLabel(const AtomicString&amp; 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&amp; id = getIdAttribute();
</span><span class="cx">                 if (!id.isEmpty() &amp;&amp; id != getNameAttribute()) {
</span><span class="cx">                     if (willHaveName)
</span><del>-                        document-&gt;documentNamedItemMap().add(id.impl(), this);
</del><ins>+                        document-&gt;documentNamedItemMap().add(id.impl(), this, treeScope());
</ins><span class="cx">                     else
</span><span class="cx">                         document-&gt;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-&gt;inDocument())
</span><span class="cx">         treeScope()-&gt;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&amp; id = getIdAttribute();
</span><span class="cx">         if (!id.isEmpty()) {
</span><span class="cx">             if (isNamedItem)
</span><del>-                document-&gt;documentNamedItemMap().add(id.impl(), this);
</del><ins>+                document-&gt;documentNamedItemMap().add(id.impl(), this, treeScope());
</ins><span class="cx">             else
</span><span class="cx">                 document-&gt;documentNamedItemMap().remove(id.impl(), this);
</span><span class="cx">         }
</span><span class="lines">@@ -453,7 +453,7 @@
</span><span class="cx">         const AtomicString&amp; name = getNameAttribute();
</span><span class="cx">         if (!name.isEmpty() &amp;&amp; id != name) {
</span><span class="cx">             if (isNamedItem)
</span><del>-                document-&gt;documentNamedItemMap().add(name.impl(), this);
</del><ins>+                document-&gt;documentNamedItemMap().add(name.impl(), this, treeScope());
</ins><span class="cx">             else
</span><span class="cx">                 document-&gt;documentNamedItemMap().remove(name.impl(), this);
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>