<!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>[166839] trunk/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/166839">166839</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2014-04-05 14:33:19 -0700 (Sat, 05 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Devirtualize isHTMLUnknownElement().
&lt;https://webkit.org/b/131269&gt;

We were hitting isHTMLUnknownElement() pretty hard when marking
out-of-document Nodes. (The check is part of isHTMLAudioElement()
which is called by JSNodeOwner::isReachableFromOpaqueRoots().)

This patch uses a Node flag for the unknown element instead.
I'm also adding HTMLUnknownElement.{h,idl} to the Xcode project
since they were suspiciously missing.

Reviewed by Benjamin Poulain.

* WebCore.xcodeproj/project.pbxproj:
* dom/Node.h:
* html/HTMLElement.h:
(WebCore::HTMLElement::isHTMLUnknownElement):
* html/HTMLUnknownElement.h:
(WebCore::toHTMLUnknownElement): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementh">trunk/Source/WebCore/html/HTMLElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLUnknownElementh">trunk/Source/WebCore/html/HTMLUnknownElement.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166838 => 166839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-05 20:06:57 UTC (rev 166838)
+++ trunk/Source/WebCore/ChangeLog        2014-04-05 21:33:19 UTC (rev 166839)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2014-04-05  Andreas Kling  &lt;akling@apple.com&gt;
+
+        Devirtualize isHTMLUnknownElement().
+        &lt;https://webkit.org/b/131269&gt;
+
+        We were hitting isHTMLUnknownElement() pretty hard when marking
+        out-of-document Nodes. (The check is part of isHTMLAudioElement()
+        which is called by JSNodeOwner::isReachableFromOpaqueRoots().)
+
+        This patch uses a Node flag for the unknown element instead.
+        I'm also adding HTMLUnknownElement.{h,idl} to the Xcode project
+        since they were suspiciously missing.
+
+        Reviewed by Benjamin Poulain.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/Node.h:
+        * html/HTMLElement.h:
+        (WebCore::HTMLElement::isHTMLUnknownElement):
+        * html/HTMLUnknownElement.h:
+        (WebCore::toHTMLUnknownElement): Deleted.
+
</ins><span class="cx"> 2014-04-05  Dirk Schulze  &lt;krit@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Canvas stroke and strokeRect with SourceIn, DestinationIn, SourceOut, DestinationAtop and Copy have errors
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (166838 => 166839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-04-05 20:06:57 UTC (rev 166838)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-04-05 21:33:19 UTC (rev 166839)
</span><span class="lines">@@ -4230,6 +4230,7 @@
</span><span class="cx">                 AD20B18D18E9D237005A8083 /* JSNodeListCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AD20B18C18E9D216005A8083 /* JSNodeListCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 AD4495F3141FC08900541EDF /* EventListenerMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD4495F1141FC08900541EDF /* EventListenerMap.cpp */; };
</span><span class="cx">                 AD4495F4141FC08900541EDF /* EventListenerMap.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4495F2141FC08900541EDF /* EventListenerMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                AD49914318F0815100BF0092 /* HTMLUnknownElement.h in Headers */ = {isa = PBXBuildFile; fileRef = AD49914118F0815100BF0092 /* HTMLUnknownElement.h */; };
</ins><span class="cx">                 AD6E71AC1668899D00320C13 /* DocumentSharedObjectPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD6E71AA1668899D00320C13 /* DocumentSharedObjectPool.cpp */; };
</span><span class="cx">                 AD6E71AD1668899D00320C13 /* DocumentSharedObjectPool.h in Headers */ = {isa = PBXBuildFile; fileRef = AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */; };
</span><span class="cx">                 AD726FED16DA1171003A4E6D /* JSCSSStyleDeclarationCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AD726FEA16D9F40B003A4E6D /* JSCSSStyleDeclarationCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -11337,6 +11338,8 @@
</span><span class="cx">                 AD20B18C18E9D216005A8083 /* JSNodeListCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNodeListCustom.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD4495F1141FC08900541EDF /* EventListenerMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventListenerMap.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD4495F2141FC08900541EDF /* EventListenerMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventListenerMap.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                AD49914118F0815100BF0092 /* HTMLUnknownElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLUnknownElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                AD49914218F0815100BF0092 /* HTMLUnknownElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLUnknownElement.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 AD6E71AA1668899D00320C13 /* DocumentSharedObjectPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentSharedObjectPool.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentSharedObjectPool.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD726FE716D9F204003A4E6D /* JSMediaListCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaListCustom.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -17547,6 +17550,8 @@
</span><span class="cx">                                 A8EA79E70A1916DF00A8EF5F /* HTMLUListElement.cpp */,
</span><span class="cx">                                 A8EA79E60A1916DF00A8EF5F /* HTMLUListElement.h */,
</span><span class="cx">                                 1A85B1D50A1B236C00D8C87C /* HTMLUListElement.idl */,
</span><ins>+                                AD49914118F0815100BF0092 /* HTMLUnknownElement.h */,
+                                AD49914218F0815100BF0092 /* HTMLUnknownElement.idl */,
</ins><span class="cx">                                 E44613980CD6331000FADA75 /* HTMLVideoElement.cpp */,
</span><span class="cx">                                 E44613990CD6331000FADA75 /* HTMLVideoElement.h */,
</span><span class="cx">                                 E446139A0CD6331000FADA75 /* HTMLVideoElement.idl */,
</span><span class="lines">@@ -25910,6 +25915,7 @@
</span><span class="cx">                                 0F54DCE61881051D003EEDBB /* TextAutoSizing.h in Headers */,
</span><span class="cx">                                 B2C3DA340D006C1D00EF6F26 /* TextBoundaries.h in Headers */,
</span><span class="cx">                                 B2C3DA360D006C1D00EF6F26 /* TextBreakIterator.h in Headers */,
</span><ins>+                                AD49914318F0815100BF0092 /* HTMLUnknownElement.h in Headers */,
</ins><span class="cx">                                 B2C3DA380D006C1D00EF6F26 /* TextBreakIteratorInternalICU.h in Headers */,
</span><span class="cx">                                 A7151BD812F1558F005A0F64 /* TextCheckerClient.h in Headers */,
</span><span class="cx">                                 A77D0012133B0AEB00D6658C /* TextChecking.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (166838 => 166839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2014-04-05 20:06:57 UTC (rev 166838)
+++ trunk/Source/WebCore/dom/Node.h        2014-04-05 21:33:19 UTC (rev 166839)
</span><span class="lines">@@ -611,6 +611,8 @@
</span><span class="cx"> 
</span><span class="cx">         SelfOrAncestorHasDirAutoFlag = 1 &lt;&lt; 29,
</span><span class="cx"> 
</span><ins>+        IsHTMLUnknownElementFlag = 1 &lt;&lt; 30,
+
</ins><span class="cx">         DefaultNodeFlags = IsParsingChildrenFinishedFlag
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="lines">@@ -634,6 +636,7 @@
</span><span class="cx">         CreateInsertionPoint = CreateHTMLElement | NeedsNodeRenderingTraversalSlowPathFlag,
</span><span class="cx">         CreateEditingText = CreateText | IsEditingTextFlag,
</span><span class="cx">         CreateMathMLElement = CreateStyledElement | IsMathMLFlag,
</span><ins>+        CreateHTMLUnknownElement = CreateHTMLElement | IsHTMLUnknownElementFlag,
</ins><span class="cx">     };
</span><span class="cx">     Node(Document&amp;, ConstructionType);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.h (166838 => 166839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.h        2014-04-05 20:06:57 UTC (rev 166838)
+++ trunk/Source/WebCore/html/HTMLElement.h        2014-04-05 21:33:19 UTC (rev 166839)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">     bool hasDirectionAuto() const;
</span><span class="cx">     TextDirection directionalityIfhasDirAutoAttribute(bool&amp; isAuto) const;
</span><span class="cx"> 
</span><del>-    virtual bool isHTMLUnknownElement() const { return false; }
</del><ins>+    bool isHTMLUnknownElement() const { return getFlag(IsHTMLUnknownElementFlag); }
</ins><span class="cx">     virtual bool isTextControlInnerTextElement() const { return false; }
</span><span class="cx"> 
</span><span class="cx">     virtual bool willRespondToMouseMoveEvents() override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLUnknownElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLUnknownElement.h (166838 => 166839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLUnknownElement.h        2014-04-05 20:06:57 UTC (rev 166838)
+++ trunk/Source/WebCore/html/HTMLUnknownElement.h        2014-04-05 21:33:19 UTC (rev 166839)
</span><span class="lines">@@ -41,20 +41,14 @@
</span><span class="cx">         return adoptRef(new HTMLUnknownElement(tagName, document));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual bool isHTMLUnknownElement() const override { return true; }
-
</del><span class="cx"> private:
</span><span class="cx">     HTMLUnknownElement(const QualifiedName&amp; tagName, Document&amp; document)
</span><del>-        : HTMLElement(tagName, document)
</del><ins>+        : HTMLElement(tagName, document, CreateHTMLUnknownElement)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline HTMLUnknownElement* toHTMLUnknownElement(HTMLElement* element)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!element || element-&gt;isHTMLUnknownElement());
-    return static_cast&lt;HTMLUnknownElement*&gt;(element);
-}
</del><ins>+NODE_TYPE_CASTS(HTMLUnknownElement)
</ins><span class="cx"> 
</span><span class="cx"> } // namespace
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>