<!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>[166853] trunk</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/166853">166853</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2014-04-06 13:27:07 -0700 (Sun, 06 Apr 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Refactor post-attach and HTMLObjectElement-related code
https://bugs.webkit.org/show_bug.cgi?id=131282
Reviewed by Antti Koivisto.
Source/WebCore:
* dom/ContainerNode.cpp: Moved the post-attach callback code from here to
StyleResolveTree.h/cpp.
* dom/ContainerNode.h: Ditto.
* dom/Document.cpp:
(WebCore::Document::recalcStyle): Use Style::PostResolutionCallbackDisabler instead of
PostAttachCallbackDisabler.
* dom/Element.h: Moved the post-attach callback code from here to StyleResolveTree.h/cpp.
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::parseAttribute): Simplified the code for typeAttr, turning
it into a 1-liner. Added a FIXME in codeAttr about the fact that it does not have the
code to trigger image loads.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::didAttachRenderers): Updated to use
Style::queuePostResolutionCallback and use a lambda instead of a function.
(WebCore::HTMLFormControlElement::didRecalcStyle): Ditto. Also added RefPtr instead
of just using wishful thinking to keep the object alive.
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Ditto.
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseAttribute):: Simplified the code for typeAttr, turning
it into a 1-liner. Made dataAttr call setNeedsWidgetUpdate(true) unconditionally after
checking carefully to see that's harmless if there is no renderer. Changed classidAttr
to call setNeedsWidgetUpdate(true) unconditionally and not set m_classId.
(WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Use fastGetAttribute
instead of classId and descendantsOfType instead of getElementsByTagName.
(WebCore::HTMLObjectElement::hasValidClassId): Use fastGetAttribute instead of classId.
(WebCore::HTMLObjectElement::renderFallbackContent): Use imageLoader instead of m_imageLoader.
* html/HTMLObjectElement.h: Removed classId, since there is no reason to cache that
attribute in a data member. Rearranged header, making more private, and fixing some typos,
and doing a "using" instead of a function to disambiguate the inherited form functions.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::createElementRenderer): Fixed some code that assumed the
first child of the shadow root is guaranteed to be an element.
(WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Removed null check on oldDocument,
since m_needsDocumentActivationCallbacks can't be true if the old document was null.
(WebCore::is100Percent): Added helper to make function below more readable.
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Restructured the code a
bit. The part that attracted my attention was the local variable of type RenderBox, which
was named renderEmbeddedObject. Turns out the caller guarantees to only call this if there
is a renderer of type RenderEmbeddedObject, so depend on that.
* html/HTMLPlugInImageElement.h: Trimmed includes a bit. Made more members private.
Marked more function members final. Made a protected imageLoader function so that
m_imageLoader can be private eventually. Made m_imageLoader be std::unique_ptr.
* style/StyleResolveTree.cpp:
(WebCore::Style::needsPseudoElement): Fixed spelling error in the name of this function.
(WebCore::Style::attachBeforeOrAfterPseudoElementIfNeeded): Updated for name change.
(WebCore::Style::attachRenderTree): Update for new name of PostResolutionCallbackDisabler.
(WebCore::Style::updateBeforeOrAfterPseudoElement): Updated for name change.
(WebCore::Style::postResolutionCallbackQueue): Added.
(WebCore::Style::queuePostResolutionCallback): Added.
(WebCore::Style::suspendMemoryCacheClientCalls): Added. This is a side effect of the original
PostAttachCallbackDisabler that is now done in a cleaner way, using the callback queue, instead
of as a special case. It should not work for multiple documents across multiple pages instead of
only the outermost one.
(WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler): Added.
Calls suspendMemoryCacheClientCalls, but a FIXME tries to point out why that isn't so great.
(WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler): Added.
(WebCore::Style::postResolutionCallbacksAreSuspended): Added.
* style/StyleResolveTree.h: Added queuePostResolutionCallback and
postResolutionCallbacksAreSuspended. Also added PostResolutionCallbackDisabler, which should
eventually become a private implementation detail.
Source/WebKit/mac:
* WebCoreSupport/WebFrameLoaderClient.mm: Call toHTMLPlugInImageElement instead of
doing a static_cast.
LayoutTests:
* svg/custom/object-no-size-attributes-expected.txt: Removed expectation of an empty text
renderer from the render tree.
* svg/custom/object-no-size-attributes.xhtml: Restructured the source so there is no text
to render. Without this, we were seeing two text renderers due to the loading timing change.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestssvgcustomobjectnosizeattributesexpectedtxt">trunk/LayoutTests/svg/custom/object-no-size-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomobjectnosizeattributesxhtml">trunk/LayoutTests/svg/custom/object-no-size-attributes.xhtml</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodeh">trunk/Source/WebCore/dom/ContainerNode.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLEmbedElementcpp">trunk/Source/WebCore/html/HTMLEmbedElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormControlElementcpp">trunk/Source/WebCore/html/HTMLFormControlElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFrameOwnerElementcpp">trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementcpp">trunk/Source/WebCore/html/HTMLObjectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementh">trunk/Source/WebCore/html/HTMLObjectElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInImageElementcpp">trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInImageElementh">trunk/Source/WebCore/html/HTMLPlugInImageElement.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleResolveTreecpp">trunk/Source/WebCore/style/StyleResolveTree.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleResolveTreeh">trunk/Source/WebCore/style/StyleResolveTree.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/LayoutTests/ChangeLog        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-03-23 Darin Adler <darin@apple.com>
+
+ Refactor post-attach and HTMLObjectElement-related code
+ https://bugs.webkit.org/show_bug.cgi?id=131282
+
+ Reviewed by Antti Koivisto.
+
+ * svg/custom/object-no-size-attributes-expected.txt: Removed expectation of an empty text
+ renderer from the render tree.
+ * svg/custom/object-no-size-attributes.xhtml: Restructured the source so there is no text
+ to render. Without this, we were seeing two text renderers due to the loading timing change.
+
</ins><span class="cx"> 2014-04-05 Dirk Schulze <krit@webkit.org>
</span><span class="cx">
</span><span class="cx"> Canvas strokeText and fillText with SourceIn, DestinationIn, SourceOut, DestinationAtop and Copy have errors
</span></span></pre></div>
<a id="trunkLayoutTestssvgcustomobjectnosizeattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/custom/object-no-size-attributes-expected.txt (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/object-no-size-attributes-expected.txt        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/LayoutTests/svg/custom/object-no-size-attributes-expected.txt        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -9,4 +9,3 @@
</span><span class="cx"> layer at (0,0) size 100x100
</span><span class="cx"> RenderSVGRoot {svg} at (0,0) size 100x100
</span><span class="cx"> RenderSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
</span><del>- RenderText {#text} at (0,0) size 0x0
</del></span></pre></div>
<a id="trunkLayoutTestssvgcustomobjectnosizeattributesxhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/custom/object-no-size-attributes.xhtml (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/object-no-size-attributes.xhtml        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/LayoutTests/svg/custom/object-no-size-attributes.xhtml        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -1,9 +1,7 @@
</span><span class="cx"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
</span><span class="cx"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
</span><span class="cx"> <body>
</span><del>-<object type="image/svg+xml" data="data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100px%22%20height%3D%22100px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20fill%3D%22green%22%20width%3D%22100px%22%20height%3D%22100px%22%20%2F%3E%3C%2Fsvg%3E" style='background: red'></object>
-
-<!--
</del><ins>+<object type="image/svg+xml" data="data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100px%22%20height%3D%22100px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20fill%3D%22green%22%20width%3D%22100px%22%20height%3D%22100px%22%20%2F%3E%3C%2Fsvg%3E" style='background: red'></object><!--
</ins><span class="cx"> 100px x 100px SVG
</span><span class="cx">
</span><span class="cx"> Code:
</span><span class="lines">@@ -13,7 +11,5 @@
</span><span class="cx"> </svg>
</span><span class="cx">
</span><span class="cx"> You should see a 100 x 100 green square above. No red should be visible. &lt;object&gt; tags should treat the width/height attributes on an embeded SVG as the intrinsic size and not default to the CSS default of 300 x 150.
</span><del>--->
-
-</body>
</del><ins>+--></body>
</ins><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/ChangeLog        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -1,3 +1,82 @@
</span><ins>+2014-03-23 Darin Adler <darin@apple.com>
+
+ Refactor post-attach and HTMLObjectElement-related code
+ https://bugs.webkit.org/show_bug.cgi?id=131282
+
+ Reviewed by Antti Koivisto.
+
+ * dom/ContainerNode.cpp: Moved the post-attach callback code from here to
+ StyleResolveTree.h/cpp.
+ * dom/ContainerNode.h: Ditto.
+
+ * dom/Document.cpp:
+ (WebCore::Document::recalcStyle): Use Style::PostResolutionCallbackDisabler instead of
+ PostAttachCallbackDisabler.
+
+ * dom/Element.h: Moved the post-attach callback code from here to StyleResolveTree.h/cpp.
+
+ * html/HTMLEmbedElement.cpp:
+ (WebCore::HTMLEmbedElement::parseAttribute): Simplified the code for typeAttr, turning
+ it into a 1-liner. Added a FIXME in codeAttr about the fact that it does not have the
+ code to trigger image loads.
+
+ * html/HTMLFormControlElement.cpp:
+ (WebCore::HTMLFormControlElement::didAttachRenderers): Updated to use
+ Style::queuePostResolutionCallback and use a lambda instead of a function.
+ (WebCore::HTMLFormControlElement::didRecalcStyle): Ditto. Also added RefPtr instead
+ of just using wishful thinking to keep the object alive.
+ * html/HTMLFrameOwnerElement.cpp:
+ (WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Ditto.
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::parseAttribute):: Simplified the code for typeAttr, turning
+ it into a 1-liner. Made dataAttr call setNeedsWidgetUpdate(true) unconditionally after
+ checking carefully to see that's harmless if there is no renderer. Changed classidAttr
+ to call setNeedsWidgetUpdate(true) unconditionally and not set m_classId.
+ (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Use fastGetAttribute
+ instead of classId and descendantsOfType instead of getElementsByTagName.
+ (WebCore::HTMLObjectElement::hasValidClassId): Use fastGetAttribute instead of classId.
+ (WebCore::HTMLObjectElement::renderFallbackContent): Use imageLoader instead of m_imageLoader.
+
+ * html/HTMLObjectElement.h: Removed classId, since there is no reason to cache that
+ attribute in a data member. Rearranged header, making more private, and fixing some typos,
+ and doing a "using" instead of a function to disambiguate the inherited form functions.
+
+ * html/HTMLPlugInImageElement.cpp:
+ (WebCore::HTMLPlugInImageElement::createElementRenderer): Fixed some code that assumed the
+ first child of the shadow root is guaranteed to be an element.
+ (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Removed null check on oldDocument,
+ since m_needsDocumentActivationCallbacks can't be true if the old document was null.
+ (WebCore::is100Percent): Added helper to make function below more readable.
+ (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Restructured the code a
+ bit. The part that attracted my attention was the local variable of type RenderBox, which
+ was named renderEmbeddedObject. Turns out the caller guarantees to only call this if there
+ is a renderer of type RenderEmbeddedObject, so depend on that.
+
+ * html/HTMLPlugInImageElement.h: Trimmed includes a bit. Made more members private.
+ Marked more function members final. Made a protected imageLoader function so that
+ m_imageLoader can be private eventually. Made m_imageLoader be std::unique_ptr.
+
+ * style/StyleResolveTree.cpp:
+ (WebCore::Style::needsPseudoElement): Fixed spelling error in the name of this function.
+ (WebCore::Style::attachBeforeOrAfterPseudoElementIfNeeded): Updated for name change.
+ (WebCore::Style::attachRenderTree): Update for new name of PostResolutionCallbackDisabler.
+ (WebCore::Style::updateBeforeOrAfterPseudoElement): Updated for name change.
+ (WebCore::Style::postResolutionCallbackQueue): Added.
+ (WebCore::Style::queuePostResolutionCallback): Added.
+ (WebCore::Style::suspendMemoryCacheClientCalls): Added. This is a side effect of the original
+ PostAttachCallbackDisabler that is now done in a cleaner way, using the callback queue, instead
+ of as a special case. It should not work for multiple documents across multiple pages instead of
+ only the outermost one.
+ (WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler): Added.
+ Calls suspendMemoryCacheClientCalls, but a FIXME tries to point out why that isn't so great.
+ (WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler): Added.
+ (WebCore::Style::postResolutionCallbacksAreSuspended): Added.
+
+ * style/StyleResolveTree.h: Added queuePostResolutionCallback and
+ postResolutionCallbacksAreSuspended. Also added PostResolutionCallbackDisabler, which should
+ eventually become a private implementation detail.
+
</ins><span class="cx"> 2014-04-04 Brian J. Burg <burg@cs.washington.edu>
</span><span class="cx">
</span><span class="cx"> Enable WEB_REPLAY for PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -37,13 +37,10 @@
</span><span class="cx"> #include "JSLazyEventListener.h"
</span><span class="cx"> #include "JSNode.h"
</span><span class="cx"> #include "LabelsNodeList.h"
</span><del>-#include "LoaderStrategy.h"
-#include "MemoryCache.h"
</del><span class="cx"> #include "MutationEvent.h"
</span><span class="cx"> #include "NameNodeList.h"
</span><span class="cx"> #include "NodeRareData.h"
</span><span class="cx"> #include "NodeRenderStyle.h"
</span><del>-#include "PlatformStrategies.h"
</del><span class="cx"> #include "RadioNodeList.h"
</span><span class="cx"> #include "RenderBox.h"
</span><span class="cx"> #include "RenderTheme.h"
</span><span class="lines">@@ -63,15 +60,6 @@
</span><span class="cx"> static void dispatchChildInsertionEvents(Node&);
</span><span class="cx"> static void dispatchChildRemovalEvents(Node&);
</span><span class="cx">
</span><del>-typedef std::pair<RefPtr<Node>, unsigned> CallbackParameters;
-typedef std::pair<NodeCallback, CallbackParameters> CallbackInfo;
-typedef Vector<CallbackInfo> NodeCallbackQueue;
-
-static NodeCallbackQueue* s_postAttachCallbackQueue;
-
-static size_t s_attachDepth;
-static bool s_shouldReEnableMemoryCacheCallsAfterAttach;
-
</del><span class="cx"> ChildNodesLazySnapshot* ChildNodesLazySnapshot::latestSnapshot = 0;
</span><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><span class="lines">@@ -758,67 +746,6 @@
</span><span class="cx"> newChild->setNeedsStyleRecalc(ReconstructRenderTree);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void ContainerNode::suspendPostAttachCallbacks(Document& document)
-{
- if (!s_attachDepth) {
- ASSERT(!s_shouldReEnableMemoryCacheCallsAfterAttach);
- if (Page* page = document.page()) {
- // FIXME: How can this call be specific to one Page, while the
- // s_attachDepth is a global? Doesn't make sense.
- if (page->areMemoryCacheClientCallsEnabled()) {
- page->setMemoryCacheClientCallsEnabled(false);
- s_shouldReEnableMemoryCacheCallsAfterAttach = true;
- }
- }
- platformStrategies()->loaderStrategy()->resourceLoadScheduler()->suspendPendingRequests();
- }
- ++s_attachDepth;
-}
-
-void ContainerNode::resumePostAttachCallbacks(Document& document)
-{
- if (s_attachDepth == 1) {
- Ref<Document> protect(document);
-
- if (s_postAttachCallbackQueue)
- dispatchPostAttachCallbacks();
- if (s_shouldReEnableMemoryCacheCallsAfterAttach) {
- s_shouldReEnableMemoryCacheCallsAfterAttach = false;
- if (Page* page = document.page())
- page->setMemoryCacheClientCallsEnabled(true);
- }
- platformStrategies()->loaderStrategy()->resourceLoadScheduler()->resumePendingRequests();
- }
- --s_attachDepth;
-}
-
-void ContainerNode::queuePostAttachCallback(NodeCallback callback, Node& node, unsigned callbackData)
-{
- if (!s_postAttachCallbackQueue)
- s_postAttachCallbackQueue = new NodeCallbackQueue;
-
- s_postAttachCallbackQueue->append(CallbackInfo(callback, CallbackParameters(&node, callbackData)));
-}
-
-bool ContainerNode::postAttachCallbacksAreSuspended()
-{
- return s_attachDepth;
-}
-
-void ContainerNode::dispatchPostAttachCallbacks()
-{
- // We recalculate size() each time through the loop because a callback
- // can add more callbacks to the end of the queue.
- for (size_t i = 0; i < s_postAttachCallbackQueue->size(); ++i) {
- const CallbackInfo& info = (*s_postAttachCallbackQueue)[i];
- NodeCallback callback = info.first;
- CallbackParameters params = info.second;
-
- callback(*params.first, params.second);
- }
- s_postAttachCallbackQueue->clear();
-}
-
</del><span class="cx"> void ContainerNode::childrenChanged(const ChildChange& change)
</span><span class="cx"> {
</span><span class="cx"> document().incDOMTreeVersion();
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.h (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.h        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/dom/ContainerNode.h        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -79,7 +79,6 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class ContainerNode : public Node {
</span><del>- friend class PostAttachCallbackDisabler;
</del><span class="cx"> public:
</span><span class="cx"> virtual ~ContainerNode();
</span><span class="cx">
</span><span class="lines">@@ -140,9 +139,6 @@
</span><span class="cx"> protected:
</span><span class="cx"> explicit ContainerNode(Document&, ConstructionType = CreateContainer);
</span><span class="cx">
</span><del>- static void queuePostAttachCallback(NodeCallback, Node&, unsigned = 0);
- static bool postAttachCallbacksAreSuspended();
-
</del><span class="cx"> template<class GenericNode, class GenericNodeContainer>
</span><span class="cx"> friend void appendChildToContainer(GenericNode* child, GenericNodeContainer&);
</span><span class="cx">
</span><span class="lines">@@ -157,10 +153,6 @@
</span><span class="cx"> void removeBetween(Node* previousChild, Node* nextChild, Node& oldChild);
</span><span class="cx"> void insertBeforeCommon(Node& nextChild, Node& oldChild);
</span><span class="cx">
</span><del>- static void dispatchPostAttachCallbacks();
- static void suspendPostAttachCallbacks(Document&);
- static void resumePostAttachCallbacks(Document&);
-
</del><span class="cx"> bool getUpperLeftCorner(FloatPoint&) const;
</span><span class="cx"> bool getLowerRightCorner(FloatPoint&) const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/dom/Document.cpp        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -1754,7 +1754,7 @@
</span><span class="cx">
</span><span class="cx"> m_inStyleRecalc = true;
</span><span class="cx"> {
</span><del>- PostAttachCallbackDisabler disabler(*this);
</del><ins>+ Style::PostResolutionCallbackDisabler disabler(*this);
</ins><span class="cx"> WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
</span><span class="cx">
</span><span class="cx"> if (m_pendingStyleRecalcShouldForce)
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/dom/Element.h        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -796,23 +796,6 @@
</span><span class="cx"> return static_cast<UniqueElementData&>(*m_elementData);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-class PostAttachCallbackDisabler {
-public:
- explicit PostAttachCallbackDisabler(Document& document)
- : m_document(document)
- {
- Element::suspendPostAttachCallbacks(m_document);
- }
-
- ~PostAttachCallbackDisabler()
- {
- Element::resumePostAttachCallbacks(m_document);
- }
-
-private:
- Document& m_document;
-};
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLEmbedElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLEmbedElement.cpp (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLEmbedElement.cpp        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/html/HTMLEmbedElement.cpp        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -97,20 +97,23 @@
</span><span class="cx"> void HTMLEmbedElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
</span><span class="cx"> {
</span><span class="cx"> if (name == typeAttr) {
</span><del>- m_serviceType = value.string().lower();
- size_t pos = m_serviceType.find(";");
- if (pos != notFound)
- m_serviceType = m_serviceType.left(pos);
- } else if (name == codeAttr)
</del><ins>+ m_serviceType = value.string().left(value.find(";")).lower();
+ // FIXME: The only difference between this and HTMLObjectElement's corresponding
+ // code is that HTMLObjectElement does setNeedsWidgetUpdate(true). Consider moving
+ // this up to the HTMLPlugInImageElement to be shared.
+ } else if (name == codeAttr) {
</ins><span class="cx"> m_url = stripLeadingAndTrailingHTMLSpaces(value);
</span><del>- else if (name == srcAttr) {
</del><ins>+ // FIXME: Why no call to the image loader?
+ // FIXME: If both code and src attributes are specified, last one parsed/changed wins. That can't be right!
+ } else if (name == srcAttr) {
</ins><span class="cx"> m_url = stripLeadingAndTrailingHTMLSpaces(value);
</span><span class="cx"> document().updateStyleIfNeeded();
</span><span class="cx"> if (renderer() && isImageType()) {
</span><span class="cx"> if (!m_imageLoader)
</span><del>- m_imageLoader = adoptPtr(new HTMLImageLoader(*this));
</del><ins>+ m_imageLoader = std::make_unique<HTMLImageLoader>(*this);
</ins><span class="cx"> m_imageLoader->updateFromElementIgnoringPreviousError();
</span><span class="cx"> }
</span><ins>+ // FIXME: If both code and src attributes are specified, last one parsed/changed wins. That can't be right!
</ins><span class="cx"> } else
</span><span class="cx"> HTMLPlugInImageElement::parseAttribute(name, value);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.cpp (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -208,12 +208,6 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void focusPostAttach(Node& element, unsigned)
-{
- toElement(element).focus();
- element.deref();
-}
-
</del><span class="cx"> void HTMLFormControlElement::didAttachRenderers()
</span><span class="cx"> {
</span><span class="cx"> // The call to updateFromElement() needs to go after the call through
</span><span class="lines">@@ -224,8 +218,11 @@
</span><span class="cx">
</span><span class="cx"> if (shouldAutofocus(this)) {
</span><span class="cx"> setAutofocused();
</span><del>- ref();
- queuePostAttachCallback(focusPostAttach, *this);
</del><ins>+
+ RefPtr<HTMLFormControlElement> element = this;
+ Style::queuePostResolutionCallback([element] {
+ element->focus();
+ });
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -288,18 +285,17 @@
</span><span class="cx"> return m_isRequired;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void updateFromElementCallback(Node& node, unsigned)
-{
- if (auto renderer = toHTMLFormControlElement(node).renderer())
- renderer->updateFromElement();
-}
-
</del><span class="cx"> void HTMLFormControlElement::didRecalcStyle(Style::Change)
</span><span class="cx"> {
</span><span class="cx"> // updateFromElement() can cause the selection to change, and in turn
</span><span class="cx"> // trigger synchronous layout, so it must not be called during style recalc.
</span><del>- if (renderer())
- queuePostAttachCallback(updateFromElementCallback, *this);
</del><ins>+ if (renderer()) {
+ RefPtr<HTMLFormControlElement> element = this;
+ Style::queuePostResolutionCallback([element]{
+ if (auto* renderer = element->renderer())
+ renderer->updateFromElement();
+ });
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool HTMLFormControlElement::supportsFocus() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFrameOwnerElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -121,16 +121,14 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void needsStyleRecalcCallback(Node& node, unsigned data)
-{
- node.setNeedsStyleRecalc(static_cast<StyleChangeType>(data));
-}
-
</del><span class="cx"> void HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc(StyleChangeType changeType)
</span><span class="cx"> {
</span><del>- if (postAttachCallbacksAreSuspended())
- queuePostAttachCallback(needsStyleRecalcCallback, *this, static_cast<unsigned>(changeType));
- else
</del><ins>+ if (Style::postResolutionCallbacksAreSuspended()) {
+ RefPtr<HTMLFrameOwnerElement> element = this;
+ Style::queuePostResolutionCallback([element, changeType]{
+ element->setNeedsStyleRecalc(changeType);
+ });
+ } else
</ins><span class="cx"> setNeedsStyleRecalc(changeType);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.cpp        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -107,28 +107,22 @@
</span><span class="cx"> if (name == formAttr)
</span><span class="cx"> formAttributeChanged();
</span><span class="cx"> else if (name == typeAttr) {
</span><del>- m_serviceType = value.lower();
- size_t pos = m_serviceType.find(";");
- if (pos != notFound)
- m_serviceType = m_serviceType.left(pos);
- if (renderer())
- setNeedsWidgetUpdate(true);
</del><ins>+ m_serviceType = value.string().left(value.find(';')).lower();
+ setNeedsWidgetUpdate(true);
</ins><span class="cx"> } else if (name == dataAttr) {
</span><span class="cx"> m_url = stripLeadingAndTrailingHTMLSpaces(value);
</span><ins>+ setNeedsWidgetUpdate(true);
</ins><span class="cx"> document().updateStyleIfNeeded();
</span><span class="cx"> if (renderer()) {
</span><del>- setNeedsWidgetUpdate(true);
</del><span class="cx"> if (isImageType()) {
</span><span class="cx"> if (!m_imageLoader)
</span><del>- m_imageLoader = adoptPtr(new HTMLImageLoader(*this));
</del><ins>+ m_imageLoader = std::make_unique<HTMLImageLoader>(*this);
</ins><span class="cx"> m_imageLoader->updateFromElementIgnoringPreviousError();
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- } else if (name == classidAttr) {
- m_classId = value;
- if (renderer())
- setNeedsWidgetUpdate(true);
- } else if (name == onbeforeloadAttr)
</del><ins>+ } else if (name == classidAttr)
+ setNeedsWidgetUpdate(true);
+ else if (name == onbeforeloadAttr)
</ins><span class="cx"> setAttributeEventListener(eventNames().beforeloadEvent, name, value);
</span><span class="cx"> else
</span><span class="cx"> HTMLPlugInImageElement::parseAttribute(name, value);
</span><span class="lines">@@ -251,26 +245,24 @@
</span><span class="cx"> // 'generator' meta tag is present. Only apply this quirk if there is no
</span><span class="cx"> // fallback content, which ensures the quirk will disable itself if Wiki
</span><span class="cx"> // Server is updated to generate an alternate embed tag as fallback content.
</span><ins>+
</ins><span class="cx"> if (!document().page()
</span><span class="cx"> || !document().page()->settings().needsSiteSpecificQuirks()
</span><span class="cx"> || hasFallbackContent()
</span><del>- || !equalIgnoringCase(classId(), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"))
</del><ins>+ || !equalIgnoringCase(fastGetAttribute(classidAttr), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- RefPtr<NodeList> metaElements = document().getElementsByTagName(HTMLNames::metaTag.localName());
- unsigned length = metaElements->length();
- for (unsigned i = 0; i < length; ++i) {
- HTMLMetaElement& metaElement = toHTMLMetaElement(*metaElements->item(i));
</del><ins>+ for (auto& metaElement : descendantsOfType<HTMLMetaElement>(document())) {
</ins><span class="cx"> if (equalIgnoringCase(metaElement.name(), "generator") && metaElement.content().startsWith("Mac OS X Server Web Services Server", false))
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool HTMLObjectElement::hasValidClassId()
</span><span class="cx"> {
</span><del>- if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType()) && classId().startsWith("java:", false))
</del><ins>+ if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType()) && fastGetAttribute(classidAttr).startsWith("java:", false))
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> if (shouldAllowQuickTimeClassIdQuirk())
</span><span class="lines">@@ -278,7 +270,7 @@
</span><span class="cx">
</span><span class="cx"> // HTML5 says that fallback content should be rendered if a non-empty
</span><span class="cx"> // classid is specified for which the UA can't find a suitable plug-in.
</span><del>- return classId().isEmpty();
</del><ins>+ return fastGetAttribute(classidAttr).isEmpty();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // FIXME: This should be unified with HTMLEmbedElement::updateWidget and
</span><span class="lines">@@ -375,20 +367,22 @@
</span><span class="cx"> setNeedsStyleRecalc(ReconstructRenderTree);
</span><span class="cx">
</span><span class="cx"> // Before we give up and use fallback content, check to see if this is a MIME type issue.
</span><del>- if (m_imageLoader && m_imageLoader->image() && m_imageLoader->image()->status() != CachedResource::LoadError) {
- m_serviceType = m_imageLoader->image()->response().mimeType();
</del><ins>+ auto* loader = imageLoader();
+ if (loader && loader->image() && loader->image()->status() != CachedResource::LoadError) {
+ m_serviceType = loader->image()->response().mimeType();
</ins><span class="cx"> if (!isImageType()) {
</span><span class="cx"> // If we don't think we have an image type anymore, then clear the image from the loader.
</span><del>- m_imageLoader->setImage(0);
</del><ins>+ loader->setImage(nullptr);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_useFallbackContent = true;
</span><span class="cx">
</span><del>- // This is here mainly to keep acid2 non-flaky. A style recalc is required to make fallback resources to load. Without forcing
- // this may happen after all the other resources have been loaded and the document is already considered complete.
- // FIXME: Disentangle fallback content handling from style recalcs.
</del><ins>+ // This was added to keep Acid 2 non-flaky. A style recalc is required to make fallback resources load.
+ // Without forcing, this may happen after all the other resources have been loaded and the document is already
+ // considered complete. FIXME: Would be better to address this with incrementLoadEventDelayCount instead
+ // or disentangle loading from style entirely.
</ins><span class="cx"> document().updateStyleIfNeeded();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.h (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.h        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/html/HTMLObjectElement.h        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -36,35 +36,23 @@
</span><span class="cx"> virtual ~HTMLObjectElement();
</span><span class="cx">
</span><span class="cx"> bool isDocNamedItem() const { return m_docNamedItem; }
</span><del>-
- const String& classId() const { return m_classId; }
-
</del><span class="cx"> bool containsJavaApplet() const;
</span><span class="cx">
</span><ins>+ bool hasFallbackContent() const;
</ins><span class="cx"> virtual bool useFallbackContent() const override { return m_useFallbackContent; }
</span><span class="cx"> void renderFallbackContent();
</span><span class="cx">
</span><del>- // Implementations of FormAssociatedElement
- HTMLFormElement* form() const { return FormAssociatedElement::form(); }
-
- virtual bool isFormControlElement() const override { return false; }
-
- virtual bool isEnumeratable() const override { return true; }
- virtual bool appendFormData(FormDataList&, bool) override;
-
- // Implementations of constraint validation API.
</del><ins>+ // Implementation of constraint validation API.
</ins><span class="cx"> // Note that the object elements are always barred from constraint validation.
</span><del>- virtual String validationMessage() const override { return String(); }
- bool checkValidity() { return true; }
</del><ins>+ static bool checkValidity() { return true; }
</ins><span class="cx"> virtual void setCustomValidity(const String&) override { }
</span><ins>+ virtual String validationMessage() const override { return String(); }
</ins><span class="cx">
</span><del>- using Node::ref;
- using Node::deref;
</del><ins>+ using HTMLPlugInImageElement::ref;
+ using HTMLPlugInImageElement::deref;
</ins><span class="cx">
</span><del>- virtual bool canContainRangeEndPoint() const override { return useFallbackContent(); }
</del><ins>+ using FormAssociatedElement::form;
</ins><span class="cx">
</span><del>- bool hasFallbackContent() const;
-
</del><span class="cx"> private:
</span><span class="cx"> HTMLObjectElement(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
</span><span class="cx">
</span><span class="lines">@@ -104,7 +92,13 @@
</span><span class="cx"> virtual HTMLObjectElement& asHTMLElement() override final { return *this; }
</span><span class="cx"> virtual const HTMLObjectElement& asHTMLElement() const override final { return *this; }
</span><span class="cx">
</span><del>- String m_classId;
</del><ins>+ virtual bool isFormControlElement() const override { return false; }
+
+ virtual bool isEnumeratable() const override { return true; }
+ virtual bool appendFormData(FormDataList&, bool) override;
+
+ virtual bool canContainRangeEndPoint() const override { return useFallbackContent(); }
+
</ins><span class="cx"> bool m_docNamedItem : 1;
</span><span class="cx"> bool m_useFallbackContent : 1;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2011, 2012, 2014 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="cx"> * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -227,11 +227,12 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> if (ShadowRoot* shadowRoot = this->shadowRoot()) {
</span><del>- Element* shadowElement = toElement(shadowRoot->firstChild());
- if (shadowElement && shadowElement->shadowPseudoId() == "-apple-youtube-shadow-iframe")
</del><ins>+ Node* shadowNode = shadowRoot->firstChild();
+ if (shadowNode && shadowNode->isElementNode() && toElement(*shadowNode).shadowPseudoId() == "-apple-youtube-shadow-iframe")
</ins><span class="cx"> return createRenderer<RenderBlockFlow>(*this, std::move(style));
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> return HTMLPlugInElement::createElementRenderer(std::move(style));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -247,25 +248,32 @@
</span><span class="cx"> void HTMLPlugInImageElement::didAttachRenderers()
</span><span class="cx"> {
</span><span class="cx"> if (!isImageType()) {
</span><del>- queuePostAttachCallback(&HTMLPlugInImageElement::updateWidgetCallback, *this);
</del><ins>+ RefPtr<HTMLPlugInImageElement> element = this;
+ Style::queuePostResolutionCallback([element]{
+ element->updateWidgetIfNecessary();
+ });
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (!renderer() || useFallbackContent())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- // Image load might complete synchronously and cause us to re-enter attach.
- queuePostAttachCallback(&HTMLPlugInImageElement::startLoadingImageCallback, *this);
</del><ins>+ // Image load might complete synchronously and cause us to re-enter.
+ RefPtr<HTMLPlugInImageElement> element = this;
+ Style::queuePostResolutionCallback([element]{
+ element->startLoadingImage();
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLPlugInImageElement::willDetachRenderers()
</span><span class="cx"> {
</span><span class="cx"> // FIXME: Because of the insanity that is HTMLPlugInImageElement::willRecalcStyle,
</span><span class="cx"> // we can end up detaching during an attach() call, before we even have a
</span><del>- // renderer. In that case, don't mark the widget for update.
</del><ins>+ // renderer. In that case, don't mark the widget for update.
</ins><span class="cx"> if (renderer() && !useFallbackContent()) {
</span><span class="cx"> // Update the widget the next time we attach (detaching destroys the plugin).
</span><span class="cx"> setNeedsWidgetUpdate(true);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> HTMLPlugInElement::willDetachRenderers();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -296,13 +304,13 @@
</span><span class="cx"> void HTMLPlugInImageElement::didMoveToNewDocument(Document* oldDocument)
</span><span class="cx"> {
</span><span class="cx"> if (m_needsDocumentActivationCallbacks) {
</span><del>- if (oldDocument)
- oldDocument->unregisterForPageCacheSuspensionCallbacks(this);
</del><ins>+ oldDocument->unregisterForPageCacheSuspensionCallbacks(this);
</ins><span class="cx"> document().registerForPageCacheSuspensionCallbacks(this);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (m_imageLoader)
</span><span class="cx"> m_imageLoader->elementDidMoveToNewDocument();
</span><ins>+
</ins><span class="cx"> HTMLPlugInElement::didMoveToNewDocument(oldDocument);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -321,23 +329,13 @@
</span><span class="cx"> HTMLPlugInElement::documentDidResumeFromPageCache();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLPlugInImageElement::updateWidgetCallback(Node& node, unsigned)
-{
- toHTMLPlugInImageElement(node).updateWidgetIfNecessary();
-}
-
</del><span class="cx"> void HTMLPlugInImageElement::startLoadingImage()
</span><span class="cx"> {
</span><span class="cx"> if (!m_imageLoader)
</span><del>- m_imageLoader = adoptPtr(new HTMLImageLoader(*this));
</del><ins>+ m_imageLoader = std::make_unique<HTMLImageLoader>(*this);
</ins><span class="cx"> m_imageLoader->updateFromElement();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLPlugInImageElement::startLoadingImageCallback(Node& node, unsigned)
-{
- toHTMLPlugInImageElement(node).startLoadingImage();
-}
-
</del><span class="cx"> void HTMLPlugInImageElement::updateSnapshot(PassRefPtr<Image> image)
</span><span class="cx"> {
</span><span class="cx"> if (displayState() > DisplayingSnapshot)
</span><span class="lines">@@ -437,18 +435,18 @@
</span><span class="cx"> ShadowRoot& root = this->ensureUserAgentShadowRoot();
</span><span class="cx"> root.appendChild(shadowElement, ASSERT_NO_EXCEPTION);
</span><span class="cx">
</span><del>- RefPtr<HTMLIFrameElement> iframeElement = HTMLIFrameElement::create(HTMLNames::iframeTag, document());
- if (hasAttribute(HTMLNames::widthAttr))
- iframeElement->setAttribute(HTMLNames::widthAttr, AtomicString("100%", AtomicString::ConstructFromLiteral));
- if (hasAttribute(HTMLNames::heightAttr)) {
- iframeElement->setAttribute(HTMLNames::styleAttr, AtomicString("max-height: 100%", AtomicString::ConstructFromLiteral));
- iframeElement->setAttribute(HTMLNames::heightAttr, getAttribute(HTMLNames::heightAttr));
</del><ins>+ RefPtr<HTMLIFrameElement> iframeElement = HTMLIFrameElement::create(iframeTag, document());
+ if (hasAttribute(widthAttr))
+ iframeElement->setAttribute(widthAttr, AtomicString("100%", AtomicString::ConstructFromLiteral));
+ if (hasAttribute(heightAttr)) {
+ iframeElement->setAttribute(styleAttr, AtomicString("max-height: 100%", AtomicString::ConstructFromLiteral));
+ iframeElement->setAttribute(heightAttr, getAttribute(heightAttr));
</ins><span class="cx"> }
</span><del>- iframeElement->setAttribute(HTMLNames::srcAttr, src);
- iframeElement->setAttribute(HTMLNames::frameborderAttr, AtomicString("0", AtomicString::ConstructFromLiteral));
</del><ins>+ iframeElement->setAttribute(srcAttr, src);
+ iframeElement->setAttribute(frameborderAttr, AtomicString("0", AtomicString::ConstructFromLiteral));
</ins><span class="cx">
</span><span class="cx"> // Disable frame flattening for this iframe.
</span><del>- iframeElement->setAttribute(HTMLNames::scrollingAttr, AtomicString("no", AtomicString::ConstructFromLiteral));
</del><ins>+ iframeElement->setAttribute(scrollingAttr, AtomicString("no", AtomicString::ConstructFromLiteral));
</ins><span class="cx"> shadowElement->appendChild(iframeElement, ASSERT_NO_EXCEPTION);
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -610,6 +608,11 @@
</span><span class="cx"> toPluginViewBase(widget)->beginSnapshottingRunningPlugin();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline bool is100Percent(Length length)
+{
+ return length.isPercent() && length.percent() == 100;
+}
+
</ins><span class="cx"> void HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn(const URL& url)
</span><span class="cx"> {
</span><span class="cx"> LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data());
</span><span class="lines">@@ -694,27 +697,27 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RenderBox* renderEmbeddedObject = toRenderBox(renderer());
- Length styleWidth = renderEmbeddedObject->style().width();
- Length styleHeight = renderEmbeddedObject->style().height();
- LayoutRect contentBoxRect = renderEmbeddedObject->contentBoxRect();
- int contentWidth = contentBoxRect.width();
- int contentHeight = contentBoxRect.height();
- int contentArea = contentWidth * contentHeight;
- IntSize visibleViewSize = document().frame()->view()->visibleSize();
- int visibleArea = visibleViewSize.width() * visibleViewSize.height();
</del><ins>+ auto& renderer = toRenderEmbeddedObject(*this->renderer());
+ LayoutRect contentRect = renderer.contentBoxRect();
+ int contentWidth = contentRect.width();
+ int contentHeight = contentRect.height();
</ins><span class="cx">
</span><del>- if (inMainFrame && styleWidth.isPercent() && (styleWidth.percent() == 100)
- && styleHeight.isPercent() && (styleHeight.percent() == 100)
- && (static_cast<float>(contentArea) / visibleArea > sizingFullPageAreaRatioThreshold)) {
- LOG(Plugins, "%p Plug-in is top level full page, set to play", this);
- m_snapshotDecision = NeverSnapshot;
- return;
</del><ins>+ if (inMainFrame) {
+ auto& style = renderer.style();
+ bool isFullPage = is100Percent(style.width()) && is100Percent(style.height());
+ IntSize visibleViewSize = document().frame()->view()->visibleSize();
+ float contentArea = contentWidth * contentHeight;
+ float visibleArea = visibleViewSize.width() * visibleViewSize.height();
+ if (isFullPage && contentArea > visibleArea * sizingFullPageAreaRatioThreshold) {
+ LOG(Plugins, "%p Plug-in is top level full page, set to play", this);
+ m_snapshotDecision = NeverSnapshot;
+ return;
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (contentWidth <= sizingTinyDimensionThreshold || contentHeight <= sizingTinyDimensionThreshold) {
</span><span class="cx"> LOG(Plugins, "%p Plug-in is very small %dx%d, set to play", this, contentWidth, contentHeight);
</span><del>- m_sizeWhenSnapshotted = IntSize(contentBoxRect.width().toInt(), contentBoxRect.height().toInt());
</del><ins>+ m_sizeWhenSnapshotted = IntSize(contentWidth, contentHeight);
</ins><span class="cx"> m_snapshotDecision = MaySnapshotWhenResized;
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -726,7 +729,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- LOG(Plugins, "%p Plug-in from (%s, %s) is not auto-start, sized at %dx%d, set to wait for snapshot", this, document().page()->mainFrame().document()->baseURL().host().utf8().data(), url.host().utf8().data(), contentWidth, contentHeight);
</del><ins>+ LOG(Plugins, "%p Plug-in from (%s, %s) is not auto-start, sized at %dx%d, set to wait for snapshot", this, document().topDocument().baseURL().host().utf8().data(), url.host().utf8().data(), contentWidth, contentHeight);
</ins><span class="cx"> m_snapshotDecision = Snapshotted;
</span><span class="cx"> setDisplayState(WaitingForSnapshot);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.h (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2009, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2009, 2011, 2012, 2014 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="cx"> * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -23,16 +23,13 @@
</span><span class="cx">
</span><span class="cx"> #include "HTMLPlugInElement.h"
</span><span class="cx">
</span><del>-#include "RenderStyle.h"
-#include <wtf/OwnPtr.h>
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class HTMLImageLoader;
</span><del>-class HTMLVideoElement;
</del><span class="cx"> class FrameLoader;
</span><span class="cx"> class Image;
</span><span class="cx"> class MouseEvent;
</span><ins>+class RenderStyle;
</ins><span class="cx"> class Widget;
</span><span class="cx">
</span><span class="cx"> enum PluginCreationOption {
</span><span class="lines">@@ -40,12 +37,8 @@
</span><span class="cx"> CreateOnlyNonNetscapePlugins,
</span><span class="cx"> };
</span><span class="cx">
</span><del>-enum PreferPlugInsForImagesOption {
- ShouldPreferPlugInsForImages,
- ShouldNotPreferPlugInsForImages
-};
-
-// Base class for HTMLObjectElement and HTMLEmbedElement
</del><ins>+// Base class for HTMLAppletElement, HTMLEmbedElement, and HTMLObjectElement.
+// FIXME: Should HTMLAppletElement inherit from HTMLPlugInElement directly instead?
</ins><span class="cx"> class HTMLPlugInImageElement : public HTMLPlugInElement {
</span><span class="cx"> public:
</span><span class="cx"> virtual ~HTMLPlugInImageElement();
</span><span class="lines">@@ -104,55 +97,53 @@
</span><span class="cx"> SnapshotDecision snapshotDecision() const { return m_snapshotDecision; }
</span><span class="cx">
</span><span class="cx"> protected:
</span><ins>+ enum PreferPlugInsForImagesOption { ShouldPreferPlugInsForImages, ShouldNotPreferPlugInsForImages };
</ins><span class="cx"> HTMLPlugInImageElement(const QualifiedName& tagName, Document&, bool createdByParser, PreferPlugInsForImagesOption);
</span><span class="cx">
</span><ins>+ virtual void didMoveToNewDocument(Document* oldDocument) override;
+ virtual bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues) override final;
+
</ins><span class="cx"> bool isImageType();
</span><ins>+ HTMLImageLoader* imageLoader() { return m_imageLoader.get(); }
</ins><span class="cx">
</span><del>- OwnPtr<HTMLImageLoader> m_imageLoader;
- String m_serviceType;
- String m_url;
- URL m_loadedUrl;
-
- static void updateWidgetCallback(Node&, unsigned);
- static void startLoadingImageCallback(Node&, unsigned);
-
- virtual void didAttachRenderers() override;
- virtual void willDetachRenderers() override;
-
</del><span class="cx"> bool allowedToLoadFrameURL(const String& url);
</span><span class="cx"> bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType);
</span><span class="cx">
</span><del>- virtual void didMoveToNewDocument(Document* oldDocument) override;
</del><ins>+ String m_serviceType;
+ String m_url;
</ins><span class="cx">
</span><del>- virtual void documentWillSuspendForPageCache() override;
- virtual void documentDidResumeFromPageCache() override;
</del><ins>+ std::unique_ptr<HTMLImageLoader> m_imageLoader;
</ins><span class="cx">
</span><del>- virtual bool isRestartedPlugin() const override { return m_isRestartedPlugin; }
- virtual bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues) override;
-
</del><span class="cx"> private:
</span><ins>+ virtual bool isPlugInImageElement() const override final { return true; }
+ virtual bool isRestartedPlugin() const override final { return m_isRestartedPlugin; }
+
+ virtual void finishParsingChildren() override final;
+ virtual void didAddUserAgentShadowRoot(ShadowRoot*) override final;
+
</ins><span class="cx"> virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override;
</span><del>- virtual bool willRecalcStyle(Style::Change) override;
</del><ins>+ virtual bool willRecalcStyle(Style::Change) override final;
+ virtual void didAttachRenderers() override final;
+ virtual void willDetachRenderers() override final;
</ins><span class="cx">
</span><del>- virtual void didAddUserAgentShadowRoot(ShadowRoot*) override;
</del><ins>+ virtual void documentWillSuspendForPageCache() override final;
+ virtual void documentDidResumeFromPageCache() override final;
</ins><span class="cx">
</span><del>- virtual void finishParsingChildren() override;
</del><ins>+ virtual void defaultEventHandler(Event*) override final;
+ virtual void dispatchPendingMouseClick() override final;
</ins><span class="cx">
</span><del>- void updateWidgetIfNecessary();
</del><ins>+ virtual void updateSnapshot(PassRefPtr<Image>) override final;
+
</ins><span class="cx"> void startLoadingImage();
</span><ins>+ void updateWidgetIfNecessary();
</ins><span class="cx">
</span><del>- virtual void updateSnapshot(PassRefPtr<Image>) override;
- virtual void dispatchPendingMouseClick() override;
</del><span class="cx"> void simulatedMouseClickTimerFired(DeferrableOneShotTimer<HTMLPlugInImageElement>&);
</span><span class="cx">
</span><span class="cx"> void restartSimilarPlugIns();
</span><del>-
- virtual bool isPlugInImageElement() const override { return true; }
-
</del><span class="cx"> void removeSnapshotTimerFired(Timer<HTMLPlugInImageElement>&);
</span><span class="cx">
</span><del>- virtual void defaultEventHandler(Event*) override;
-
</del><ins>+private:
+ URL m_loadedUrl;
</ins><span class="cx"> bool m_needsWidgetUpdate;
</span><span class="cx"> bool m_shouldPreferPlugInsForImages;
</span><span class="cx"> bool m_needsDocumentActivationCallbacks;
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleResolveTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleResolveTree.cpp (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleResolveTree.cpp        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/style/StyleResolveTree.cpp        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -29,20 +29,21 @@
</span><span class="cx"> #include "AXObjectCache.h"
</span><span class="cx"> #include "AnimationController.h"
</span><span class="cx"> #include "CSSFontSelector.h"
</span><del>-#include "Element.h"
</del><span class="cx"> #include "ElementIterator.h"
</span><span class="cx"> #include "ElementRareData.h"
</span><span class="cx"> #include "FlowThreadController.h"
</span><span class="cx"> #include "InsertionPoint.h"
</span><ins>+#include "LoaderStrategy.h"
</ins><span class="cx"> #include "NodeRenderStyle.h"
</span><span class="cx"> #include "NodeRenderingTraversal.h"
</span><span class="cx"> #include "NodeTraversal.h"
</span><del>-#include "RenderElement.h"
</del><ins>+#include "PlatformStrategies.h"
</ins><span class="cx"> #include "RenderFullScreen.h"
</span><span class="cx"> #include "RenderNamedFlowThread.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "RenderWidget.h"
</span><ins>+#include "ResourceLoadScheduler.h"
</ins><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx"> #include "StyleResolveForDocument.h"
</span><span class="lines">@@ -575,7 +576,7 @@
</span><span class="cx">
</span><span class="cx"> static void attachRenderTree(Element& current, ContainerNode& renderingParentNode, RenderTreePosition& renderTreePosition, PassRefPtr<RenderStyle> resolvedStyle)
</span><span class="cx"> {
</span><del>- PostAttachCallbackDisabler callbackDisabler(current.document());
</del><ins>+ PostResolutionCallbackDisabler callbackDisabler(current.document());
</ins><span class="cx"> WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
</span><span class="cx">
</span><span class="cx"> if (current.hasCustomStyleResolveCallbacks())
</span><span class="lines">@@ -967,5 +968,66 @@
</span><span class="cx"> detachRenderTree(element, NormalDetach);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static Vector<std::function<void ()>>& postResolutionCallbackQueue()
+{
+ static NeverDestroyed<Vector<std::function<void ()>>> vector;
+ return vector;
</ins><span class="cx"> }
</span><ins>+
+void queuePostResolutionCallback(std::function<void ()> callback)
+{
+ postResolutionCallbackQueue().append(callback);
</ins><span class="cx"> }
</span><ins>+
+static void suspendMemoryCacheClientCalls(Document& document)
+{
+ Page* page = document.page();
+ if (!page || !page->areMemoryCacheClientCallsEnabled())
+ return;
+
+ page->setMemoryCacheClientCallsEnabled(false);
+
+ RefPtr<Document> protectedDocument = &document;
+ postResolutionCallbackQueue().append([protectedDocument]{
+ // FIXME: If the document becomes unassociated with the page during style resolution
+ // then this won't work and the memory cache client calls will be permanently disabled.
+ if (Page* page = protectedDocument->page())
+ page->setMemoryCacheClientCallsEnabled(true);
+ });
+}
+
+static unsigned resolutionNestingDepth;
+
+PostResolutionCallbackDisabler::PostResolutionCallbackDisabler(Document& document)
+{
+ ++resolutionNestingDepth;
+
+ if (resolutionNestingDepth == 1)
+ platformStrategies()->loaderStrategy()->resourceLoadScheduler()->suspendPendingRequests();
+
+ // FIXME: It's strange to build this into the disabler.
+ suspendMemoryCacheClientCalls(document);
+}
+
+PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler()
+{
+ if (resolutionNestingDepth == 1) {
+ // Get size each time through the loop because a callback can add more callbacks to the end of the queue.
+ auto& queue = postResolutionCallbackQueue();
+ for (size_t i = 0; i < queue.size(); ++i)
+ queue[i]();
+ queue.clear();
+
+ platformStrategies()->loaderStrategy()->resourceLoadScheduler()->resumePendingRequests();
+ }
+
+ --resolutionNestingDepth;
+}
+
+bool postResolutionCallbacksAreSuspended()
+{
+ return resolutionNestingDepth;
+}
+
+}
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorestyleStyleResolveTreeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleResolveTree.h (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleResolveTree.h        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebCore/style/StyleResolveTree.h        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #ifndef StyleResolveTree_h
</span><span class="cx"> #define StyleResolveTree_h
</span><span class="cx">
</span><ins>+#include <functional>
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class Document;
</span><span class="lines">@@ -47,6 +49,15 @@
</span><span class="cx">
</span><span class="cx"> Change determineChange(const RenderStyle*, const RenderStyle*);
</span><span class="cx">
</span><ins>+void queuePostResolutionCallback(std::function<void ()>);
+bool postResolutionCallbacksAreSuspended();
+
+class PostResolutionCallbackDisabler {
+public:
+ explicit PostResolutionCallbackDisabler(Document&);
+ ~PostResolutionCallbackDisabler();
+};
+
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-03-23 Darin Adler <darin@apple.com>
+
+ Refactor post-attach and HTMLObjectElement-related code
+ https://bugs.webkit.org/show_bug.cgi?id=131282
+
+ Reviewed by Antti Koivisto.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm: Call toHTMLPlugInImageElement instead of
+ doing a static_cast.
+
</ins><span class="cx"> 2014-04-04 Brian J. Burg <burg@cs.washington.edu>
</span><span class="cx">
</span><span class="cx"> Enable WEB_REPLAY for PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebFrameLoaderClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (166852 => 166853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2014-04-06 20:20:12 UTC (rev 166852)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2014-04-06 20:27:07 UTC (rev 166853)
</span><span class="lines">@@ -2100,8 +2100,7 @@
</span><span class="cx">
</span><span class="cx"> if (element->hasTagName(HTMLNames::embedTag) || element->hasTagName(HTMLNames::objectTag)) {
</span><span class="cx"> // Create a shadow subtree for the plugin element, the iframe player is injected in the shadow tree.
</span><del>- HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(element);
- pluginElement->createShadowIFrameSubtree(embedSrc);
</del><ins>+ toHTMLPlugInImageElement(*element).createShadowIFrameSubtree(embedSrc);
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>