WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-131282-20140406132638.patch (text/plain), 47.65 KB, created by
Darin Adler
on 2014-04-06 13:26:56 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2014-04-06 13:26:56 PDT
Size:
47.65 KB
patch
obsolete
>Subversion Revision: 166851 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 77cfc1fa89b4b873ff442d5177cd4f8fb6c3cf4c..3701739c0eb86fd0aaedb45d3b6c051f7bda53b3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,82 @@ >+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. >+ > 2014-04-04 Brian J. Burg <burg@cs.washington.edu> > > Enable WEB_REPLAY for PLATFORM(MAC) >diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog >index d9b5669b4c69f495a9d36408196ccccbdcd70134..ce8a221521aed748d33101c56c5b8e627ab49445 100644 >--- a/Source/WebKit/mac/ChangeLog >+++ b/Source/WebKit/mac/ChangeLog >@@ -1,3 +1,13 @@ >+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. >+ > 2014-04-04 Brian J. Burg <burg@cs.washington.edu> > > Enable WEB_REPLAY for PLATFORM(MAC) >diff --git a/Source/WebCore/dom/ContainerNode.cpp b/Source/WebCore/dom/ContainerNode.cpp >index f32aab4168a25730bb1560c8d6feaaef955c07f4..b84cc9a40660d39bec2c163ae99c21bd3cb37945 100644 >--- a/Source/WebCore/dom/ContainerNode.cpp >+++ b/Source/WebCore/dom/ContainerNode.cpp >@@ -37,13 +37,10 @@ > #include "JSLazyEventListener.h" > #include "JSNode.h" > #include "LabelsNodeList.h" >-#include "LoaderStrategy.h" >-#include "MemoryCache.h" > #include "MutationEvent.h" > #include "NameNodeList.h" > #include "NodeRareData.h" > #include "NodeRenderStyle.h" >-#include "PlatformStrategies.h" > #include "RadioNodeList.h" > #include "RenderBox.h" > #include "RenderTheme.h" >@@ -63,15 +60,6 @@ namespace WebCore { > static void dispatchChildInsertionEvents(Node&); > static void dispatchChildRemovalEvents(Node&); > >-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; >- > ChildNodesLazySnapshot* ChildNodesLazySnapshot::latestSnapshot = 0; > > #ifndef NDEBUG >@@ -758,67 +746,6 @@ void ContainerNode::parserAppendChild(PassRefPtr<Node> newChild) > newChild->setNeedsStyleRecalc(ReconstructRenderTree); > } > >-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(); >-} >- > void ContainerNode::childrenChanged(const ChildChange& change) > { > document().incDOMTreeVersion(); >diff --git a/Source/WebCore/dom/ContainerNode.h b/Source/WebCore/dom/ContainerNode.h >index 8c155622df92d3763fda4d968ae7901882365d11..321eda6ab3fa66a0eb3137f83e14a598898d6f04 100644 >--- a/Source/WebCore/dom/ContainerNode.h >+++ b/Source/WebCore/dom/ContainerNode.h >@@ -79,7 +79,6 @@ private: > }; > > class ContainerNode : public Node { >- friend class PostAttachCallbackDisabler; > public: > virtual ~ContainerNode(); > >@@ -140,9 +139,6 @@ public: > protected: > explicit ContainerNode(Document&, ConstructionType = CreateContainer); > >- static void queuePostAttachCallback(NodeCallback, Node&, unsigned = 0); >- static bool postAttachCallbacksAreSuspended(); >- > template<class GenericNode, class GenericNodeContainer> > friend void appendChildToContainer(GenericNode* child, GenericNodeContainer&); > >@@ -157,10 +153,6 @@ private: > void removeBetween(Node* previousChild, Node* nextChild, Node& oldChild); > void insertBeforeCommon(Node& nextChild, Node& oldChild); > >- static void dispatchPostAttachCallbacks(); >- static void suspendPostAttachCallbacks(Document&); >- static void resumePostAttachCallbacks(Document&); >- > bool getUpperLeftCorner(FloatPoint&) const; > bool getLowerRightCorner(FloatPoint&) const; > >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 1eb8092b6b2f336b972d19341b6f2ff0310a8e6d..c8ee8ba32562df4fc19ce503703f9c6645c6c31e 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -1754,7 +1754,7 @@ void Document::recalcStyle(Style::Change change) > > m_inStyleRecalc = true; > { >- PostAttachCallbackDisabler disabler(*this); >+ Style::PostResolutionCallbackDisabler disabler(*this); > WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; > > if (m_pendingStyleRecalcShouldForce) >diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h >index 5d949c003d5b39f386ca7c9f557c67c23ae1541b..f925a8d4cf23afd11c4a593632228cc0542dc500 100644 >--- a/Source/WebCore/dom/Element.h >+++ b/Source/WebCore/dom/Element.h >@@ -796,23 +796,6 @@ inline UniqueElementData& Element::ensureUniqueElementData() > return static_cast<UniqueElementData&>(*m_elementData); > } > >-class PostAttachCallbackDisabler { >-public: >- explicit PostAttachCallbackDisabler(Document& document) >- : m_document(document) >- { >- Element::suspendPostAttachCallbacks(m_document); >- } >- >- ~PostAttachCallbackDisabler() >- { >- Element::resumePostAttachCallbacks(m_document); >- } >- >-private: >- Document& m_document; >-}; >- > } // namespace WebCore > > #endif >diff --git a/Source/WebCore/html/HTMLEmbedElement.cpp b/Source/WebCore/html/HTMLEmbedElement.cpp >index 096f6fa3180d00d30f1f304e324db7ea721dcfa8..67b966e978134ef4ce8519a4434a03c0816a07c1 100644 >--- a/Source/WebCore/html/HTMLEmbedElement.cpp >+++ b/Source/WebCore/html/HTMLEmbedElement.cpp >@@ -97,20 +97,23 @@ void HTMLEmbedElement::collectStyleForPresentationAttribute(const QualifiedName& > void HTMLEmbedElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == typeAttr) { >- m_serviceType = value.string().lower(); >- size_t pos = m_serviceType.find(";"); >- if (pos != notFound) >- m_serviceType = m_serviceType.left(pos); >- } else if (name == codeAttr) >+ 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) { > m_url = stripLeadingAndTrailingHTMLSpaces(value); >- else if (name == srcAttr) { >+ // 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) { > m_url = stripLeadingAndTrailingHTMLSpaces(value); > document().updateStyleIfNeeded(); > if (renderer() && isImageType()) { > if (!m_imageLoader) >- m_imageLoader = adoptPtr(new HTMLImageLoader(*this)); >+ m_imageLoader = std::make_unique<HTMLImageLoader>(*this); > m_imageLoader->updateFromElementIgnoringPreviousError(); > } >+ // FIXME: If both code and src attributes are specified, last one parsed/changed wins. That can't be right! > } else > HTMLPlugInImageElement::parseAttribute(name, value); > } >diff --git a/Source/WebCore/html/HTMLFormControlElement.cpp b/Source/WebCore/html/HTMLFormControlElement.cpp >index 5041a3ed32957a3d1f1b7425a3ba03b4cc7e9ccf..e0b85d5970f88bd4c0512f574c2ab1d7f0ca7fdb 100644 >--- a/Source/WebCore/html/HTMLFormControlElement.cpp >+++ b/Source/WebCore/html/HTMLFormControlElement.cpp >@@ -208,12 +208,6 @@ static bool shouldAutofocus(HTMLFormControlElement* element) > return false; > } > >-static void focusPostAttach(Node& element, unsigned) >-{ >- toElement(element).focus(); >- element.deref(); >-} >- > void HTMLFormControlElement::didAttachRenderers() > { > // The call to updateFromElement() needs to go after the call through >@@ -224,8 +218,11 @@ void HTMLFormControlElement::didAttachRenderers() > > if (shouldAutofocus(this)) { > setAutofocused(); >- ref(); >- queuePostAttachCallback(focusPostAttach, *this); >+ >+ RefPtr<HTMLFormControlElement> element = this; >+ Style::queuePostResolutionCallback([element] { >+ element->focus(); >+ }); > } > } > >@@ -288,18 +285,17 @@ bool HTMLFormControlElement::isRequired() const > return m_isRequired; > } > >-static void updateFromElementCallback(Node& node, unsigned) >-{ >- if (auto renderer = toHTMLFormControlElement(node).renderer()) >- renderer->updateFromElement(); >-} >- > void HTMLFormControlElement::didRecalcStyle(Style::Change) > { > // updateFromElement() can cause the selection to change, and in turn > // trigger synchronous layout, so it must not be called during style recalc. >- if (renderer()) >- queuePostAttachCallback(updateFromElementCallback, *this); >+ if (renderer()) { >+ RefPtr<HTMLFormControlElement> element = this; >+ Style::queuePostResolutionCallback([element]{ >+ if (auto* renderer = element->renderer()) >+ renderer->updateFromElement(); >+ }); >+ } > } > > bool HTMLFormControlElement::supportsFocus() const >diff --git a/Source/WebCore/html/HTMLFrameOwnerElement.cpp b/Source/WebCore/html/HTMLFrameOwnerElement.cpp >index 8c18eab2f92ad7215e7f3ad5f8a7d3328711a7ad..8b7b739e1101b33ef5c7555b8bb3e413e927a44e 100644 >--- a/Source/WebCore/html/HTMLFrameOwnerElement.cpp >+++ b/Source/WebCore/html/HTMLFrameOwnerElement.cpp >@@ -121,16 +121,14 @@ SVGDocument* HTMLFrameOwnerElement::getSVGDocument(ExceptionCode& ec) const > return 0; > } > >-static void needsStyleRecalcCallback(Node& node, unsigned data) >-{ >- node.setNeedsStyleRecalc(static_cast<StyleChangeType>(data)); >-} >- > void HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc(StyleChangeType changeType) > { >- if (postAttachCallbacksAreSuspended()) >- queuePostAttachCallback(needsStyleRecalcCallback, *this, static_cast<unsigned>(changeType)); >- else >+ if (Style::postResolutionCallbacksAreSuspended()) { >+ RefPtr<HTMLFrameOwnerElement> element = this; >+ Style::queuePostResolutionCallback([element, changeType]{ >+ element->setNeedsStyleRecalc(changeType); >+ }); >+ } else > setNeedsStyleRecalc(changeType); > } > >diff --git a/Source/WebCore/html/HTMLObjectElement.cpp b/Source/WebCore/html/HTMLObjectElement.cpp >index aef11a844499fca77ce1d44210374d8a9a9f1e1c..b15845fcb9570edf7213e7f1dee891ace32effa1 100644 >--- a/Source/WebCore/html/HTMLObjectElement.cpp >+++ b/Source/WebCore/html/HTMLObjectElement.cpp >@@ -107,28 +107,22 @@ void HTMLObjectElement::parseAttribute(const QualifiedName& name, const AtomicSt > if (name == formAttr) > formAttributeChanged(); > else if (name == typeAttr) { >- m_serviceType = value.lower(); >- size_t pos = m_serviceType.find(";"); >- if (pos != notFound) >- m_serviceType = m_serviceType.left(pos); >- if (renderer()) >- setNeedsWidgetUpdate(true); >+ m_serviceType = value.string().left(value.find(';')).lower(); >+ setNeedsWidgetUpdate(true); > } else if (name == dataAttr) { > m_url = stripLeadingAndTrailingHTMLSpaces(value); >+ setNeedsWidgetUpdate(true); > document().updateStyleIfNeeded(); > if (renderer()) { >- setNeedsWidgetUpdate(true); > if (isImageType()) { > if (!m_imageLoader) >- m_imageLoader = adoptPtr(new HTMLImageLoader(*this)); >+ m_imageLoader = std::make_unique<HTMLImageLoader>(*this); > m_imageLoader->updateFromElementIgnoringPreviousError(); > } > } >- } else if (name == classidAttr) { >- m_classId = value; >- if (renderer()) >- setNeedsWidgetUpdate(true); >- } else if (name == onbeforeloadAttr) >+ } else if (name == classidAttr) >+ setNeedsWidgetUpdate(true); >+ else if (name == onbeforeloadAttr) > setAttributeEventListener(eventNames().beforeloadEvent, name, value); > else > HTMLPlugInImageElement::parseAttribute(name, value); >@@ -251,26 +245,24 @@ bool HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk() > // 'generator' meta tag is present. Only apply this quirk if there is no > // fallback content, which ensures the quirk will disable itself if Wiki > // Server is updated to generate an alternate embed tag as fallback content. >+ > if (!document().page() > || !document().page()->settings().needsSiteSpecificQuirks() > || hasFallbackContent() >- || !equalIgnoringCase(classId(), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B")) >+ || !equalIgnoringCase(fastGetAttribute(classidAttr), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B")) > return false; > >- 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)); >+ for (auto& metaElement : descendantsOfType<HTMLMetaElement>(document())) { > if (equalIgnoringCase(metaElement.name(), "generator") && metaElement.content().startsWith("Mac OS X Server Web Services Server", false)) > return true; > } >- >+ > return false; > } > > bool HTMLObjectElement::hasValidClassId() > { >- if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType()) && classId().startsWith("java:", false)) >+ if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType()) && fastGetAttribute(classidAttr).startsWith("java:", false)) > return true; > > if (shouldAllowQuickTimeClassIdQuirk()) >@@ -278,7 +270,7 @@ bool HTMLObjectElement::hasValidClassId() > > // HTML5 says that fallback content should be rendered if a non-empty > // classid is specified for which the UA can't find a suitable plug-in. >- return classId().isEmpty(); >+ return fastGetAttribute(classidAttr).isEmpty(); > } > > // FIXME: This should be unified with HTMLEmbedElement::updateWidget and >@@ -375,20 +367,22 @@ void HTMLObjectElement::renderFallbackContent() > setNeedsStyleRecalc(ReconstructRenderTree); > > // Before we give up and use fallback content, check to see if this is a MIME type issue. >- if (m_imageLoader && m_imageLoader->image() && m_imageLoader->image()->status() != CachedResource::LoadError) { >- m_serviceType = m_imageLoader->image()->response().mimeType(); >+ auto* loader = imageLoader(); >+ if (loader && loader->image() && loader->image()->status() != CachedResource::LoadError) { >+ m_serviceType = loader->image()->response().mimeType(); > if (!isImageType()) { > // If we don't think we have an image type anymore, then clear the image from the loader. >- m_imageLoader->setImage(0); >+ loader->setImage(nullptr); > return; > } > } > > m_useFallbackContent = true; > >- // 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. >+ // 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. > document().updateStyleIfNeeded(); > } > >diff --git a/Source/WebCore/html/HTMLObjectElement.h b/Source/WebCore/html/HTMLObjectElement.h >index 636f6d627020578d332167911e934e0aa3bb0442..87fe8415c11d105abe062f5e67841d82c0e947af 100644 >--- a/Source/WebCore/html/HTMLObjectElement.h >+++ b/Source/WebCore/html/HTMLObjectElement.h >@@ -36,34 +36,22 @@ public: > virtual ~HTMLObjectElement(); > > bool isDocNamedItem() const { return m_docNamedItem; } >- >- const String& classId() const { return m_classId; } >- > bool containsJavaApplet() const; > >+ bool hasFallbackContent() const; > virtual bool useFallbackContent() const override { return m_useFallbackContent; } > void renderFallbackContent(); > >- // 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. >+ // Implementation of constraint validation API. > // Note that the object elements are always barred from constraint validation. >- virtual String validationMessage() const override { return String(); } >- bool checkValidity() { return true; } >+ static bool checkValidity() { return true; } > virtual void setCustomValidity(const String&) override { } >+ virtual String validationMessage() const override { return String(); } > >- using Node::ref; >- using Node::deref; >- >- virtual bool canContainRangeEndPoint() const override { return useFallbackContent(); } >+ using HTMLPlugInImageElement::ref; >+ using HTMLPlugInImageElement::deref; > >- bool hasFallbackContent() const; >+ using FormAssociatedElement::form; > > private: > HTMLObjectElement(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser); >@@ -104,7 +92,13 @@ private: > virtual HTMLObjectElement& asHTMLElement() override final { return *this; } > virtual const HTMLObjectElement& asHTMLElement() const override final { return *this; } > >- String m_classId; >+ 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(); } >+ > bool m_docNamedItem : 1; > bool m_useFallbackContent : 1; > }; >diff --git a/Source/WebCore/html/HTMLPlugInImageElement.cpp b/Source/WebCore/html/HTMLPlugInImageElement.cpp >index d6b061550782e395ec6fdca3f0a8b436b3865804..f4dfd1f37a5ce42ca2f29826bda38a3e7c464ed5 100644 >--- a/Source/WebCore/html/HTMLPlugInImageElement.cpp >+++ b/Source/WebCore/html/HTMLPlugInImageElement.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2008, 2011, 2012 Apple Inc. All rights reserved. >+ * Copyright (C) 2008, 2011, 2012, 2014 Apple Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -227,11 +227,12 @@ RenderPtr<RenderElement> HTMLPlugInImageElement::createElementRenderer(PassRef<R > > #if PLATFORM(IOS) > if (ShadowRoot* shadowRoot = this->shadowRoot()) { >- Element* shadowElement = toElement(shadowRoot->firstChild()); >- if (shadowElement && shadowElement->shadowPseudoId() == "-apple-youtube-shadow-iframe") >+ Node* shadowNode = shadowRoot->firstChild(); >+ if (shadowNode && shadowNode->isElementNode() && toElement(*shadowNode).shadowPseudoId() == "-apple-youtube-shadow-iframe") > return createRenderer<RenderBlockFlow>(*this, std::move(style)); > } > #endif >+ > return HTMLPlugInElement::createElementRenderer(std::move(style)); > } > >@@ -247,25 +248,32 @@ bool HTMLPlugInImageElement::willRecalcStyle(Style::Change) > void HTMLPlugInImageElement::didAttachRenderers() > { > if (!isImageType()) { >- queuePostAttachCallback(&HTMLPlugInImageElement::updateWidgetCallback, *this); >+ RefPtr<HTMLPlugInImageElement> element = this; >+ Style::queuePostResolutionCallback([element]{ >+ element->updateWidgetIfNecessary(); >+ }); > return; > } > if (!renderer() || useFallbackContent()) > return; > >- // Image load might complete synchronously and cause us to re-enter attach. >- queuePostAttachCallback(&HTMLPlugInImageElement::startLoadingImageCallback, *this); >+ // Image load might complete synchronously and cause us to re-enter. >+ RefPtr<HTMLPlugInImageElement> element = this; >+ Style::queuePostResolutionCallback([element]{ >+ element->startLoadingImage(); >+ }); > } > > void HTMLPlugInImageElement::willDetachRenderers() > { > // FIXME: Because of the insanity that is HTMLPlugInImageElement::willRecalcStyle, > // we can end up detaching during an attach() call, before we even have a >- // renderer. In that case, don't mark the widget for update. >+ // renderer. In that case, don't mark the widget for update. > if (renderer() && !useFallbackContent()) { > // Update the widget the next time we attach (detaching destroys the plugin). > setNeedsWidgetUpdate(true); > } >+ > HTMLPlugInElement::willDetachRenderers(); > } > >@@ -296,13 +304,13 @@ void HTMLPlugInImageElement::finishParsingChildren() > void HTMLPlugInImageElement::didMoveToNewDocument(Document* oldDocument) > { > if (m_needsDocumentActivationCallbacks) { >- if (oldDocument) >- oldDocument->unregisterForPageCacheSuspensionCallbacks(this); >+ oldDocument->unregisterForPageCacheSuspensionCallbacks(this); > document().registerForPageCacheSuspensionCallbacks(this); > } > > if (m_imageLoader) > m_imageLoader->elementDidMoveToNewDocument(); >+ > HTMLPlugInElement::didMoveToNewDocument(oldDocument); > } > >@@ -321,23 +329,13 @@ void HTMLPlugInImageElement::documentDidResumeFromPageCache() > HTMLPlugInElement::documentDidResumeFromPageCache(); > } > >-void HTMLPlugInImageElement::updateWidgetCallback(Node& node, unsigned) >-{ >- toHTMLPlugInImageElement(node).updateWidgetIfNecessary(); >-} >- > void HTMLPlugInImageElement::startLoadingImage() > { > if (!m_imageLoader) >- m_imageLoader = adoptPtr(new HTMLImageLoader(*this)); >+ m_imageLoader = std::make_unique<HTMLImageLoader>(*this); > m_imageLoader->updateFromElement(); > } > >-void HTMLPlugInImageElement::startLoadingImageCallback(Node& node, unsigned) >-{ >- toHTMLPlugInImageElement(node).startLoadingImage(); >-} >- > void HTMLPlugInImageElement::updateSnapshot(PassRefPtr<Image> image) > { > if (displayState() > DisplayingSnapshot) >@@ -437,18 +435,18 @@ void HTMLPlugInImageElement::createShadowIFrameSubtree(const String& src) > ShadowRoot& root = this->ensureUserAgentShadowRoot(); > root.appendChild(shadowElement, ASSERT_NO_EXCEPTION); > >- 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)); >+ 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)); > } >- iframeElement->setAttribute(HTMLNames::srcAttr, src); >- iframeElement->setAttribute(HTMLNames::frameborderAttr, AtomicString("0", AtomicString::ConstructFromLiteral)); >+ iframeElement->setAttribute(srcAttr, src); >+ iframeElement->setAttribute(frameborderAttr, AtomicString("0", AtomicString::ConstructFromLiteral)); > > // Disable frame flattening for this iframe. >- iframeElement->setAttribute(HTMLNames::scrollingAttr, AtomicString("no", AtomicString::ConstructFromLiteral)); >+ iframeElement->setAttribute(scrollingAttr, AtomicString("no", AtomicString::ConstructFromLiteral)); > shadowElement->appendChild(iframeElement, ASSERT_NO_EXCEPTION); > } > #endif >@@ -610,6 +608,11 @@ void HTMLPlugInImageElement::checkSizeChangeForSnapshotting() > toPluginViewBase(widget)->beginSnapshottingRunningPlugin(); > } > >+static inline bool is100Percent(Length length) >+{ >+ return length.isPercent() && length.percent() == 100; >+} >+ > void HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn(const URL& url) > { > LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data()); >@@ -694,27 +697,27 @@ void HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn(const URL& url) > return; > } > >- 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(); >- >- 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; >+ auto& renderer = toRenderEmbeddedObject(*this->renderer()); >+ LayoutRect contentRect = renderer.contentBoxRect(); >+ int contentWidth = contentRect.width(); >+ int contentHeight = contentRect.height(); >+ >+ 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; >+ } > } > > if (contentWidth <= sizingTinyDimensionThreshold || contentHeight <= sizingTinyDimensionThreshold) { > LOG(Plugins, "%p Plug-in is very small %dx%d, set to play", this, contentWidth, contentHeight); >- m_sizeWhenSnapshotted = IntSize(contentBoxRect.width().toInt(), contentBoxRect.height().toInt()); >+ m_sizeWhenSnapshotted = IntSize(contentWidth, contentHeight); > m_snapshotDecision = MaySnapshotWhenResized; > return; > } >@@ -726,7 +729,7 @@ void HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn(const URL& url) > return; > } > >- 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); >+ 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); > m_snapshotDecision = Snapshotted; > setDisplayState(WaitingForSnapshot); > } >diff --git a/Source/WebCore/html/HTMLPlugInImageElement.h b/Source/WebCore/html/HTMLPlugInImageElement.h >index 651b1dce0b8e2a9ab6557a3d37ea68011d9ec3e4..bec1b2cbae6b68a66ec5b0814fbb1a2cfd21d5e7 100644 >--- a/Source/WebCore/html/HTMLPlugInImageElement.h >+++ b/Source/WebCore/html/HTMLPlugInImageElement.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2008, 2009, 2011, 2012 Apple Inc. All rights reserved. >+ * Copyright (C) 2008, 2009, 2011, 2012, 2014 Apple Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -23,16 +23,13 @@ > > #include "HTMLPlugInElement.h" > >-#include "RenderStyle.h" >-#include <wtf/OwnPtr.h> >- > namespace WebCore { > > class HTMLImageLoader; >-class HTMLVideoElement; > class FrameLoader; > class Image; > class MouseEvent; >+class RenderStyle; > class Widget; > > enum PluginCreationOption { >@@ -40,12 +37,8 @@ enum PluginCreationOption { > CreateOnlyNonNetscapePlugins, > }; > >-enum PreferPlugInsForImagesOption { >- ShouldPreferPlugInsForImages, >- ShouldNotPreferPlugInsForImages >-}; >- >-// Base class for HTMLObjectElement and HTMLEmbedElement >+// Base class for HTMLAppletElement, HTMLEmbedElement, and HTMLObjectElement. >+// FIXME: Should HTMLAppletElement inherit from HTMLPlugInElement directly instead? > class HTMLPlugInImageElement : public HTMLPlugInElement { > public: > virtual ~HTMLPlugInImageElement(); >@@ -104,55 +97,53 @@ public: > SnapshotDecision snapshotDecision() const { return m_snapshotDecision; } > > protected: >+ enum PreferPlugInsForImagesOption { ShouldPreferPlugInsForImages, ShouldNotPreferPlugInsForImages }; > HTMLPlugInImageElement(const QualifiedName& tagName, Document&, bool createdByParser, PreferPlugInsForImagesOption); > >- bool isImageType(); >- >- 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 didMoveToNewDocument(Document* oldDocument) override; >+ virtual bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues) override final; > >- virtual void didAttachRenderers() override; >- virtual void willDetachRenderers() override; >+ bool isImageType(); >+ HTMLImageLoader* imageLoader() { return m_imageLoader.get(); } > > bool allowedToLoadFrameURL(const String& url); > bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType); > >- virtual void didMoveToNewDocument(Document* oldDocument) override; >- >- virtual void documentWillSuspendForPageCache() override; >- virtual void documentDidResumeFromPageCache() override; >+ String m_serviceType; >+ String m_url; > >- 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; >+ std::unique_ptr<HTMLImageLoader> m_imageLoader; > > private: >+ 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; >+ > virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override; >- virtual bool willRecalcStyle(Style::Change) override; >+ virtual bool willRecalcStyle(Style::Change) override final; >+ virtual void didAttachRenderers() override final; >+ virtual void willDetachRenderers() override final; > >- virtual void didAddUserAgentShadowRoot(ShadowRoot*) override; >+ virtual void documentWillSuspendForPageCache() override final; >+ virtual void documentDidResumeFromPageCache() override final; > >- virtual void finishParsingChildren() override; >+ virtual void defaultEventHandler(Event*) override final; >+ virtual void dispatchPendingMouseClick() override final; >+ >+ virtual void updateSnapshot(PassRefPtr<Image>) override final; > >- void updateWidgetIfNecessary(); > void startLoadingImage(); >+ void updateWidgetIfNecessary(); > >- virtual void updateSnapshot(PassRefPtr<Image>) override; >- virtual void dispatchPendingMouseClick() override; > void simulatedMouseClickTimerFired(DeferrableOneShotTimer<HTMLPlugInImageElement>&); > > void restartSimilarPlugIns(); >- >- virtual bool isPlugInImageElement() const override { return true; } >- > void removeSnapshotTimerFired(Timer<HTMLPlugInImageElement>&); > >- virtual void defaultEventHandler(Event*) override; >- >+private: >+ URL m_loadedUrl; > bool m_needsWidgetUpdate; > bool m_shouldPreferPlugInsForImages; > bool m_needsDocumentActivationCallbacks; >diff --git a/Source/WebCore/style/StyleResolveTree.cpp b/Source/WebCore/style/StyleResolveTree.cpp >index 106c3845a3f61759a2bb1d54ddcbe1b6c3281d05..2b3ccf4faf69bba27e5ec711a674814b3054e5c0 100644 >--- a/Source/WebCore/style/StyleResolveTree.cpp >+++ b/Source/WebCore/style/StyleResolveTree.cpp >@@ -29,20 +29,21 @@ > #include "AXObjectCache.h" > #include "AnimationController.h" > #include "CSSFontSelector.h" >-#include "Element.h" > #include "ElementIterator.h" > #include "ElementRareData.h" > #include "FlowThreadController.h" > #include "InsertionPoint.h" >+#include "LoaderStrategy.h" > #include "NodeRenderStyle.h" > #include "NodeRenderingTraversal.h" > #include "NodeTraversal.h" >-#include "RenderElement.h" >+#include "PlatformStrategies.h" > #include "RenderFullScreen.h" > #include "RenderNamedFlowThread.h" > #include "RenderText.h" > #include "RenderView.h" > #include "RenderWidget.h" >+#include "ResourceLoadScheduler.h" > #include "Settings.h" > #include "ShadowRoot.h" > #include "StyleResolveForDocument.h" >@@ -575,7 +576,7 @@ static void attachBeforeOrAfterPseudoElementIfNeeded(Element& current, PseudoId > > static void attachRenderTree(Element& current, ContainerNode& renderingParentNode, RenderTreePosition& renderTreePosition, PassRefPtr<RenderStyle> resolvedStyle) > { >- PostAttachCallbackDisabler callbackDisabler(current.document()); >+ PostResolutionCallbackDisabler callbackDisabler(current.document()); > WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; > > if (current.hasCustomStyleResolveCallbacks()) >@@ -967,5 +968,66 @@ void detachRenderTree(Element& element) > detachRenderTree(element, NormalDetach); > } > >+static Vector<std::function<void ()>>& postResolutionCallbackQueue() >+{ >+ static NeverDestroyed<Vector<std::function<void ()>>> vector; >+ return vector; >+} >+ >+void queuePostResolutionCallback(std::function<void ()> callback) >+{ >+ postResolutionCallbackQueue().append(callback); >+} >+ >+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; >+} >+ > } > } >diff --git a/Source/WebCore/style/StyleResolveTree.h b/Source/WebCore/style/StyleResolveTree.h >index 55aad050570f15ede2c46ce05acac98e9776b0aa..7dd251b93756c87e73291125cd88bb34c06db7ef 100644 >--- a/Source/WebCore/style/StyleResolveTree.h >+++ b/Source/WebCore/style/StyleResolveTree.h >@@ -26,6 +26,8 @@ > #ifndef StyleResolveTree_h > #define StyleResolveTree_h > >+#include <functional> >+ > namespace WebCore { > > class Document; >@@ -47,6 +49,15 @@ void updateTextRendererAfterContentChange(Text&, unsigned offsetOfReplacedData, > > Change determineChange(const RenderStyle*, const RenderStyle*); > >+void queuePostResolutionCallback(std::function<void ()>); >+bool postResolutionCallbacksAreSuspended(); >+ >+class PostResolutionCallbackDisabler { >+public: >+ explicit PostResolutionCallbackDisabler(Document&); >+ ~PostResolutionCallbackDisabler(); >+}; >+ > } > > } >diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm >index f4fffd51b019516c455773f3752f00f73d693223..079068f580c7bdb9df00a6bac223bbf51b8e5d2c 100644 >--- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm >+++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm >@@ -2100,8 +2100,7 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLP > > if (element->hasTagName(HTMLNames::embedTag) || element->hasTagName(HTMLNames::objectTag)) { > // Create a shadow subtree for the plugin element, the iframe player is injected in the shadow tree. >- HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(element); >- pluginElement->createShadowIFrameSubtree(embedSrc); >+ toHTMLPlugInImageElement(*element).createShadowIFrameSubtree(embedSrc); > return nullptr; > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index eb0f7e67caded825a2296d9a75fdfbba7877ab41..7b4dcd3526db52099f4f3a148098e0fe06fb5d96 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+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. >+ > 2014-04-05 Dirk Schulze <krit@webkit.org> > > Canvas strokeText and fillText with SourceIn, DestinationIn, SourceOut, DestinationAtop and Copy have errors >diff --git a/LayoutTests/svg/custom/object-no-size-attributes-expected.txt b/LayoutTests/svg/custom/object-no-size-attributes-expected.txt >index 4c77f250674fd7f4e928fe583140701a01a0b6f8..e7ef625f1bdf72b546093b5fcf6e688d63646426 100644 >--- a/LayoutTests/svg/custom/object-no-size-attributes-expected.txt >+++ b/LayoutTests/svg/custom/object-no-size-attributes-expected.txt >@@ -9,4 +9,3 @@ layer at (0,0) size 800x120 > layer at (0,0) size 100x100 > RenderSVGRoot {svg} at (0,0) size 100x100 > RenderSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] >- RenderText {#text} at (0,0) size 0x0 >diff --git a/LayoutTests/svg/custom/object-no-size-attributes.xhtml b/LayoutTests/svg/custom/object-no-size-attributes.xhtml >index ce219752a0a531d1497b18d505193a871599d7be..61eaa97485840d7e017576c34b1274ff4b3d75a4 100644 >--- a/LayoutTests/svg/custom/object-no-size-attributes.xhtml >+++ b/LayoutTests/svg/custom/object-no-size-attributes.xhtml >@@ -1,9 +1,7 @@ > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> > <body> >-<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> >- >-<!-- >+<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><!-- > 100px x 100px SVG > > Code: >@@ -13,7 +11,5 @@ Code: > </svg> > > You should see a 100 x 100 green square above. No red should be visible. <object> 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. >---> >- >-</body> >+--></body> > </html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 131282
: 228702