Changeset 166144 in webkit
- Timestamp:
- Mar 23, 2014 2:37:56 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r166141 r166144 1 2014-03-23 Darin Adler <darin@apple.com> 2 3 Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout 4 https://bugs.webkit.org/show_bug.cgi?id=130653 5 6 Reviewed by Antti Koivisto. 7 8 * plugins/plugin-remove-readystatechange-expected.txt: Added a blank line; not what this 9 test is testing, but the different timing of loads results in this blank line. 10 * plugins/plugin-remove-readystatechange.html: Updated test to use waitUntilDone/notifyDone 11 rather than racing. Added a computation of offsetLeft to trigger layout and adding a long 12 comment explaining why this is needed and potentially insufficient in the long run. 13 14 * svg/custom/object-no-size-attributes-expected.txt: Removed expectation of an empty text 15 renderer from the render tree. 16 * svg/custom/object-no-size-attributes.xhtml: Restructured the source so there is no text 17 to render. Without this, we were seeing two text renderers due to the loading timing change. 18 1 19 2014-03-23 James Craig <jcraig@apple.com> 2 20 -
trunk/LayoutTests/plugins/plugin-remove-readystatechange-expected.txt
r160908 r166144 1 1 ALERT: PASS: element could not be re-appended 2 2 This test passes if it does not trip an assert in debug builds. It ensures a readystatechange event can't get dispatched until after a plugin is fully removed. 3 -
trunk/LayoutTests/plugins/plugin-remove-readystatechange.html
r128524 r166144 8 8 <embed id="viewer" src="resources/simple_blank.swf"></embed> 9 9 <script> 10 if (window.testRunner) 10 if (window.testRunner) { 11 11 testRunner.dumpAsText(); 12 testRunner.waitUntilDone(); 13 } 12 14 13 15 var i = 0; … … 19 21 catch (e) { 20 22 alert('PASS: element could not be re-appended'); 21 } 23 } 24 if (window.testRunner) 25 testRunner.notifyDone(); 22 26 } 23 27 i++; … … 25 29 26 30 window.addEventListener('DOMContentLoaded', function() { 31 // This test relies on removing the embed element while it is actively loading. 32 // There's no observable event that creates the exact right timing for that. 33 // As of this writing, after DOMContentLoaded, then next layout is the right time. 34 // Here we evaluate document.body.offsetLeft to trigger that layout. But really, 35 // this is a race condition, nothing guarantees that the load starts at that moment, 36 // and we might have to revise this test again in the future. 37 document.body.offsetLeft; 27 38 document.body.removeChild(document.getElementById('viewer')); 28 39 }); -
trunk/LayoutTests/svg/custom/object-no-size-attributes-expected.txt
r161140 r166144 10 10 RenderSVGRoot {svg} at (0,0) size 100x100 11 11 RenderSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] 12 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/svg/custom/object-no-size-attributes.xhtml
r87526 r166144 2 2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 3 3 <body> 4 <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> 5 6 <!-- 4 <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><!-- 7 5 100px x 100px SVG 8 6 … … 14 12 15 13 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. 16 --> 17 18 </body> 14 --></body> 19 15 </html> -
trunk/Source/WebCore/ChangeLog
r166143 r166144 1 2014-03-23 Darin Adler <darin@apple.com> 2 3 Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout 4 https://bugs.webkit.org/show_bug.cgi?id=130653 5 6 Reviewed by Antti Koivisto. 7 8 * dom/ContainerNode.cpp: Moved the post-attach callback code from here to 9 StyleResolveTree.h/cpp. 10 * dom/ContainerNode.h: Ditto. 11 12 * dom/Document.cpp: 13 (WebCore::Document::recalcStyle): Use Style::PostResolutionCallbackDisabler instead of 14 PostAttachCallbackDisabler. 15 16 * dom/Element.h: Moved the post-attach callback code from here to StyleResolveTree.h/cpp. 17 18 * html/HTMLEmbedElement.cpp: 19 (WebCore::HTMLEmbedElement::parseAttribute): Simplified the code for typeAttr, turning 20 it into a 1-liner. Added a FIXME in codeAttr about the fact that it does not have the 21 code to trigger image loads. Changed srcAttr to call updateImageLoaderWithNewURLSoon to 22 do the image loading logic. 23 24 * html/HTMLFormControlElement.cpp: 25 (WebCore::HTMLFormControlElement::didAttachRenderers): Updated to use 26 Style::queuePostResolutionCallback and use a lambda instead of a function. 27 (WebCore::HTMLFormControlElement::didRecalcStyle): Ditto. Also added RefPtr instead 28 of just using wishful thinking to keep the object alive. 29 * html/HTMLFrameOwnerElement.cpp: 30 (WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Ditto. 31 32 * html/HTMLObjectElement.cpp: 33 (WebCore::HTMLObjectElement::parseAttribute):: Simplified the code for typeAttr, turning 34 it into a 1-liner. Changed dataAttr to use updateImageLoaderWithNewURLSoon(). Also made 35 it call setNeedsWidgetUpdate(true) unconditionally after checking carefully to see that's 36 harmless if there is no renderer. Changed classidAttr to call setNeedsWidgetUpdate(true) 37 unconditionally and not set m_classId. 38 (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Use fastGetAttribute 39 instead of classId and descendantsOfType instead of getElementsByTagName. 40 (WebCore::HTMLObjectElement::hasValidClassId): Use fastGetAttribute instead of classId. 41 (WebCore::HTMLObjectElement::renderFallbackContent): Use imageLoader instead of m_imageLoader. 42 43 * html/HTMLObjectElement.h: Removed classId, since there is no reason to cache that 44 attribute in a data member. Rearranged header, making more private, and fixing some typos, 45 and doing a "using" instead of a function to disambiguate the inherited form functions. 46 47 * html/HTMLPlugInImageElement.cpp: 48 (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Initialize m_needsImageReload. 49 (WebCore::HTMLPlugInImageElement::createElementRenderer): Fixed some code that assumed the 50 first child of the shadow root is guaranteed to be an element. 51 (WebCore::HTMLPlugInImageElement::didRecalcStyle): Added. Calls the new 52 scheduleUpdateForAfterStyleResolution function. 53 (WebCore::HTMLPlugInImageElement::didAttachRenderers): Moved all the logic from this 54 function into scheduleUpdateForAfterStyleResolution. Also added a call through to the base 55 class; cleaner even though it's just an assertion. 56 (WebCore::HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution): Added. 57 Schedules a call to updateAfterStyleResolution when needed. 58 (WebCore::HTMLPlugInImageElement::updateAfterStyleResolution): Added. 59 Combines updateWidgetIfNecessary and startLoadingImage, and also deals with the new 60 m_needsImageReload boolean in cases where no actual loading is done. 61 (WebCore::HTMLPlugInImageElement::removedFrom): Added. Do not delay the load event of 62 document once this element is removed, clears m_needsImageReload. 63 (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Removed null check on oldDocument, 64 since m_needsDocumentActivationCallbacks can't be true if the old document was null. 65 (WebCore::is100Percent): Added helper to make function below more readable. 66 (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Restructured the code a 67 bit. The part that attracted my attention was the local variable of type RenderBox, which 68 was named renderEmbeddedObject. Turns out the caller guarantees to only call this if there 69 is a renderer of type RenderEmbeddedObject, so depend on that. 70 (WebCore::HTMLPlugInImageElement::setNeedsImageReload): Added. When called with true, sets 71 the flag and triggers a style recalculation, and lets updateAfterStyleResolution do the rest. 72 When called with false, reverses the effects and stops delaying the load event. 73 74 * html/HTMLPlugInImageElement.h: Trimmed includes a bit. Made more members private. 75 Marked more function members final. Made a protected imageLoader function so that 76 m_imageLoader can be private. Added new protected function updateImageLoaderWithNewURLSoon, 77 as well as other new private functions. Made m_imageLoader be std::unique_ptr instead of 78 OwnPtr, and added m_needsImageReload. 79 80 * style/StyleResolveTree.cpp: 81 (WebCore::Style::needsPseudoElement): Fixed spelling error in the name of this function. 82 (WebCore::Style::attachBeforeOrAfterPseudoElementIfNeeded): Updated for name change. 83 (WebCore::Style::attachRenderTree): Update for new name of PostResolutionCallbackDisabler. 84 (WebCore::Style::updateBeforeOrAfterPseudoElement): Updated for name change. 85 (WebCore::Style::postResolutionCallbackQueue): Added. 86 (WebCore::Style::queuePostResolutionCallback): Added. 87 (WebCore::Style::suspendMemoryCacheClientCalls): Added. This is a side effect of the original 88 PostAttachCallbackDisabler that is now done in a cleaner way, using the callback queue, instead 89 of as a special case. It should not work for multiple documents across multiple pages instead of 90 only the outermost one. 91 (WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler): Added. 92 Calls suspendMemoryCacheClientCalls, but a FIXME tries to point out why that isn't so great. 93 (WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler): Added. 94 (WebCore::Style::postResolutionCallbacksAreSuspended): Added. 95 96 * style/StyleResolveTree.h: Added queuePostResolutionCallback and 97 postResolutionCallbacksAreSuspended. Also added PostResolutionCallbackDisabler, which should 98 eventually become a private implementation detail. 99 1 100 2014-03-23 Sam Weinig <sam@webkit.org> 2 101 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r164854 r166144 38 38 #include "JSNode.h" 39 39 #include "LabelsNodeList.h" 40 #include "LoaderStrategy.h"41 #include "MemoryCache.h"42 40 #include "MutationEvent.h" 43 41 #include "NameNodeList.h" 44 42 #include "NodeRareData.h" 45 43 #include "NodeRenderStyle.h" 46 #include "PlatformStrategies.h"47 44 #include "RadioNodeList.h" 48 45 #include "RenderBox.h" … … 63 60 static void dispatchChildInsertionEvents(Node&); 64 61 static void dispatchChildRemovalEvents(Node&); 65 66 typedef std::pair<RefPtr<Node>, unsigned> CallbackParameters;67 typedef std::pair<NodeCallback, CallbackParameters> CallbackInfo;68 typedef Vector<CallbackInfo> NodeCallbackQueue;69 70 static NodeCallbackQueue* s_postAttachCallbackQueue;71 72 static size_t s_attachDepth;73 static bool s_shouldReEnableMemoryCacheCallsAfterAttach;74 62 75 63 ChildNodesLazySnapshot* ChildNodesLazySnapshot::latestSnapshot = 0; … … 757 745 758 746 newChild->setNeedsStyleRecalc(ReconstructRenderTree); 759 }760 761 void ContainerNode::suspendPostAttachCallbacks(Document& document)762 {763 if (!s_attachDepth) {764 ASSERT(!s_shouldReEnableMemoryCacheCallsAfterAttach);765 if (Page* page = document.page()) {766 // FIXME: How can this call be specific to one Page, while the767 // s_attachDepth is a global? Doesn't make sense.768 if (page->areMemoryCacheClientCallsEnabled()) {769 page->setMemoryCacheClientCallsEnabled(false);770 s_shouldReEnableMemoryCacheCallsAfterAttach = true;771 }772 }773 platformStrategies()->loaderStrategy()->resourceLoadScheduler()->suspendPendingRequests();774 }775 ++s_attachDepth;776 }777 778 void ContainerNode::resumePostAttachCallbacks(Document& document)779 {780 if (s_attachDepth == 1) {781 Ref<Document> protect(document);782 783 if (s_postAttachCallbackQueue)784 dispatchPostAttachCallbacks();785 if (s_shouldReEnableMemoryCacheCallsAfterAttach) {786 s_shouldReEnableMemoryCacheCallsAfterAttach = false;787 if (Page* page = document.page())788 page->setMemoryCacheClientCallsEnabled(true);789 }790 platformStrategies()->loaderStrategy()->resourceLoadScheduler()->resumePendingRequests();791 }792 --s_attachDepth;793 }794 795 void ContainerNode::queuePostAttachCallback(NodeCallback callback, Node& node, unsigned callbackData)796 {797 if (!s_postAttachCallbackQueue)798 s_postAttachCallbackQueue = new NodeCallbackQueue;799 800 s_postAttachCallbackQueue->append(CallbackInfo(callback, CallbackParameters(&node, callbackData)));801 }802 803 bool ContainerNode::postAttachCallbacksAreSuspended()804 {805 return s_attachDepth;806 }807 808 void ContainerNode::dispatchPostAttachCallbacks()809 {810 // We recalculate size() each time through the loop because a callback811 // can add more callbacks to the end of the queue.812 for (size_t i = 0; i < s_postAttachCallbackQueue->size(); ++i) {813 const CallbackInfo& info = (*s_postAttachCallbackQueue)[i];814 NodeCallback callback = info.first;815 CallbackParameters params = info.second;816 817 callback(*params.first, params.second);818 }819 s_postAttachCallbackQueue->clear();820 747 } 821 748 -
trunk/Source/WebCore/dom/ContainerNode.h
r164854 r166144 80 80 81 81 class ContainerNode : public Node { 82 friend class PostAttachCallbackDisabler;83 82 public: 84 83 virtual ~ContainerNode(); … … 141 140 explicit ContainerNode(Document&, ConstructionType = CreateContainer); 142 141 143 static void queuePostAttachCallback(NodeCallback, Node&, unsigned = 0);144 static bool postAttachCallbacksAreSuspended();145 146 142 template<class GenericNode, class GenericNodeContainer> 147 143 friend void appendChildToContainer(GenericNode* child, GenericNodeContainer&); … … 157 153 void removeBetween(Node* previousChild, Node* nextChild, Node& oldChild); 158 154 void insertBeforeCommon(Node& nextChild, Node& oldChild); 159 160 static void dispatchPostAttachCallbacks();161 static void suspendPostAttachCallbacks(Document&);162 static void resumePostAttachCallbacks(Document&);163 155 164 156 bool getUpperLeftCorner(FloatPoint&) const; -
trunk/Source/WebCore/dom/Document.cpp
r165848 r166144 1757 1757 m_inStyleRecalc = true; 1758 1758 { 1759 PostAttachCallbackDisabler disabler(*this);1759 Style::PostResolutionCallbackDisabler disabler(*this); 1760 1760 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; 1761 1761 -
trunk/Source/WebCore/dom/Element.h
r166124 r166144 799 799 } 800 800 801 class PostAttachCallbackDisabler {802 public:803 explicit PostAttachCallbackDisabler(Document& document)804 : m_document(document)805 {806 Element::suspendPostAttachCallbacks(m_document);807 }808 809 ~PostAttachCallbackDisabler()810 {811 Element::resumePostAttachCallbacks(m_document);812 }813 814 private:815 Document& m_document;816 };817 818 801 } // namespace WebCore 819 802 -
trunk/Source/WebCore/html/HTMLEmbedElement.cpp
r163457 r166144 98 98 { 99 99 if (name == typeAttr) { 100 m_serviceType = value.string().l ower();101 size_t pos = m_serviceType.find(";");102 if (pos != notFound)103 m_serviceType = m_serviceType.left(pos);104 } else if (name == codeAttr) 100 m_serviceType = value.string().left(value.find(";")).lower(); 101 // FIXME: The only difference between this and HTMLObjectElement's corresponding 102 // code is that HTMLObjectElement does setNeedsWidgetUpdate(true). Consider moving 103 // this up to the HTMLPlugInImageElement to be shared. 104 } else if (name == codeAttr) { 105 105 m_url = stripLeadingAndTrailingHTMLSpaces(value); 106 else if (name == srcAttr) { 106 // FIXME: Why no call to updateImageLoaderWithNewURLSoon? 107 // FIXME: If both code and src attributes are specified, last one parsed/changed wins. That can't be right! 108 } else if (name == srcAttr) { 107 109 m_url = stripLeadingAndTrailingHTMLSpaces(value); 108 document().updateStyleIfNeeded(); 109 if (renderer() && isImageType()) { 110 if (!m_imageLoader) 111 m_imageLoader = adoptPtr(new HTMLImageLoader(*this)); 112 m_imageLoader->updateFromElementIgnoringPreviousError(); 113 } 110 updateImageLoaderWithNewURLSoon(); 111 // FIXME: If both code and src attributes are specified, last one parsed/changed wins. That can't be right! 114 112 } else 115 113 HTMLPlugInImageElement::parseAttribute(name, value); -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r164822 r166144 208 208 } 209 209 210 static void focusPostAttach(Node& element, unsigned)211 {212 toElement(element).focus();213 element.deref();214 }215 216 210 void HTMLFormControlElement::didAttachRenderers() 217 211 { … … 224 218 if (shouldAutofocus(this)) { 225 219 setAutofocused(); 226 ref(); 227 queuePostAttachCallback(focusPostAttach, *this); 220 221 RefPtr<HTMLFormControlElement> element = this; 222 Style::queuePostResolutionCallback([element] { 223 element->focus(); 224 }); 228 225 } 229 226 } … … 288 285 } 289 286 290 static void updateFromElementCallback(Node& node, unsigned)291 {292 if (auto renderer = toHTMLFormControlElement(node).renderer())293 renderer->updateFromElement();294 }295 296 287 void HTMLFormControlElement::didRecalcStyle(Style::Change) 297 288 { 298 289 // updateFromElement() can cause the selection to change, and in turn 299 290 // trigger synchronous layout, so it must not be called during style recalc. 300 if (renderer()) 301 queuePostAttachCallback(updateFromElementCallback, *this); 291 if (renderer()) { 292 RefPtr<HTMLFormControlElement> element = this; 293 Style::queuePostResolutionCallback([element]{ 294 if (auto* renderer = element->renderer()) 295 renderer->updateFromElement(); 296 }); 297 } 302 298 } 303 299 -
trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp
r163440 r166144 122 122 } 123 123 124 static void needsStyleRecalcCallback(Node& node, unsigned data)125 {126 node.setNeedsStyleRecalc(static_cast<StyleChangeType>(data));127 }128 129 124 void HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc(StyleChangeType changeType) 130 125 { 131 if (postAttachCallbacksAreSuspended()) 132 queuePostAttachCallback(needsStyleRecalcCallback, *this, static_cast<unsigned>(changeType)); 133 else 126 if (Style::postResolutionCallbacksAreSuspended()) { 127 RefPtr<HTMLFrameOwnerElement> element = this; 128 Style::queuePostResolutionCallback([element, changeType]{ 129 element->setNeedsStyleRecalc(changeType); 130 }); 131 } else 134 132 setNeedsStyleRecalc(changeType); 135 133 } -
trunk/Source/WebCore/html/HTMLObjectElement.cpp
r165699 r166144 108 108 formAttributeChanged(); 109 109 else if (name == typeAttr) { 110 m_serviceType = value.lower(); 111 size_t pos = m_serviceType.find(";"); 112 if (pos != notFound) 113 m_serviceType = m_serviceType.left(pos); 114 if (renderer()) 115 setNeedsWidgetUpdate(true); 110 m_serviceType = value.string().left(value.find(';')).lower(); 111 setNeedsWidgetUpdate(true); 116 112 } else if (name == dataAttr) { 117 113 m_url = stripLeadingAndTrailingHTMLSpaces(value); 118 document().updateStyleIfNeeded(); 119 if (renderer()) { 120 setNeedsWidgetUpdate(true); 121 if (isImageType()) { 122 if (!m_imageLoader) 123 m_imageLoader = adoptPtr(new HTMLImageLoader(*this)); 124 m_imageLoader->updateFromElementIgnoringPreviousError(); 125 } 126 } 127 } else if (name == classidAttr) { 128 m_classId = value; 129 if (renderer()) 130 setNeedsWidgetUpdate(true); 131 } else if (name == onbeforeloadAttr) 114 setNeedsWidgetUpdate(true); 115 updateImageLoaderWithNewURLSoon(); 116 } else if (name == classidAttr) 117 setNeedsWidgetUpdate(true); 118 else if (name == onbeforeloadAttr) 132 119 setAttributeEventListener(eventNames().beforeloadEvent, name, value); 133 120 else … … 252 239 // fallback content, which ensures the quirk will disable itself if Wiki 253 240 // Server is updated to generate an alternate embed tag as fallback content. 241 254 242 if (!document().page() 255 243 || !document().page()->settings().needsSiteSpecificQuirks() 256 244 || hasFallbackContent() 257 || !equalIgnoringCase( classId(), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"))245 || !equalIgnoringCase(fastGetAttribute(classidAttr), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B")) 258 246 return false; 259 247 260 RefPtr<NodeList> metaElements = document().getElementsByTagName(HTMLNames::metaTag.localName()); 261 unsigned length = metaElements->length(); 262 for (unsigned i = 0; i < length; ++i) { 263 HTMLMetaElement& metaElement = toHTMLMetaElement(*metaElements->item(i)); 248 for (auto& metaElement : descendantsOfType<HTMLMetaElement>(document())) { 264 249 if (equalIgnoringCase(metaElement.name(), "generator") && metaElement.content().startsWith("Mac OS X Server Web Services Server", false)) 265 250 return true; 266 251 } 267 252 268 253 return false; 269 254 } … … 271 256 bool HTMLObjectElement::hasValidClassId() 272 257 { 273 if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType()) && classId().startsWith("java:", false))258 if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType()) && fastGetAttribute(classidAttr).startsWith("java:", false)) 274 259 return true; 275 260 … … 279 264 // HTML5 says that fallback content should be rendered if a non-empty 280 265 // classid is specified for which the UA can't find a suitable plug-in. 281 return classId().isEmpty();266 return fastGetAttribute(classidAttr).isEmpty(); 282 267 } 283 268 … … 376 361 377 362 // Before we give up and use fallback content, check to see if this is a MIME type issue. 378 if (m_imageLoader && m_imageLoader->image() && m_imageLoader->image()->status() != CachedResource::LoadError) { 379 m_serviceType = m_imageLoader->image()->response().mimeType(); 363 auto* loader = imageLoader(); 364 if (loader && loader->image() && loader->image()->status() != CachedResource::LoadError) { 365 m_serviceType = loader->image()->response().mimeType(); 380 366 if (!isImageType()) { 381 367 // If we don't think we have an image type anymore, then clear the image from the loader. 382 m_imageLoader->setImage(0);368 loader->setImage(nullptr); 383 369 return; 384 370 } … … 387 373 m_useFallbackContent = true; 388 374 389 // This is here mainly to keep acid2 non-flaky. A style recalc is required to make fallback resources to load. Without forcing 390 // this may happen after all the other resources have been loaded and the document is already considered complete. 391 // FIXME: Disentangle fallback content handling from style recalcs. 375 // This was added to keep Acid 2 non-flaky. A style recalc is required to make fallback resources load. 376 // Without forcing, this may happen after all the other resources have been loaded and the document is already 377 // considered complete. FIXME: Could address this with incrementLoadEventDelayCount instead, as we do with 378 // image loading in HTMLPlugInImageElement, or disentangle loading from style entirely. 392 379 document().updateStyleIfNeeded(); 393 380 } -
trunk/Source/WebCore/html/HTMLObjectElement.h
r162180 r166144 37 37 38 38 bool isDocNamedItem() const { return m_docNamedItem; } 39 40 const String& classId() const { return m_classId; }41 42 39 bool containsJavaApplet() const; 43 40 41 bool hasFallbackContent() const; 44 42 virtual bool useFallbackContent() const override { return m_useFallbackContent; } 45 43 void renderFallbackContent(); 46 44 47 // Implementations of FormAssociatedElement 48 HTMLFormElement* form() const { return FormAssociatedElement::form(); } 45 // Implementation of constraint validation API. 46 // Note that the object elements are always barred from constraint validation. 47 static bool checkValidity() { return true; } 48 virtual void setCustomValidity(const String&) override { } 49 virtual String validationMessage() const override { return String(); } 49 50 50 virtual bool isFormControlElement() const override { return false; } 51 using HTMLPlugInImageElement::ref; 52 using HTMLPlugInImageElement::deref; 51 53 52 virtual bool isEnumeratable() const override { return true; } 53 virtual bool appendFormData(FormDataList&, bool) override; 54 55 // Implementations of constraint validation API. 56 // Note that the object elements are always barred from constraint validation. 57 virtual String validationMessage() const override { return String(); } 58 bool checkValidity() { return true; } 59 virtual void setCustomValidity(const String&) override { } 60 61 using Node::ref; 62 using Node::deref; 63 64 virtual bool canContainRangeEndPoint() const override { return useFallbackContent(); } 65 66 bool hasFallbackContent() const; 54 using FormAssociatedElement::form; 67 55 68 56 private: … … 105 93 virtual const HTMLObjectElement& asHTMLElement() const override final { return *this; } 106 94 107 String m_classId; 95 virtual bool isFormControlElement() const override { return false; } 96 97 virtual bool isEnumeratable() const override { return true; } 98 virtual bool appendFormData(FormDataList&, bool) override; 99 100 virtual bool canContainRangeEndPoint() const override { return useFallbackContent(); } 101 108 102 bool m_docNamedItem : 1; 109 103 bool m_useFallbackContent : 1; -
trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp
r165607 r166144 1 1 /* 2 * Copyright (C) 2008, 2011, 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2011, 2012, 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 112 112 // the same codepath in this class. 113 113 , m_needsWidgetUpdate(!createdByParser) 114 , m_needsImageReload(false) 114 115 , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPreferPlugInsForImages) 115 116 , m_needsDocumentActivationCallbacks(false) … … 228 229 #if PLATFORM(IOS) 229 230 if (ShadowRoot* shadowRoot = this->shadowRoot()) { 230 Element* shadowElement = toElement(shadowRoot->firstChild());231 if (shadow Element && shadowElement->shadowPseudoId() == "-apple-youtube-shadow-iframe")231 Node* shadowNode = shadowRoot->firstChild(); 232 if (shadowNode && shadowNode->isElementNode() && toElement(*shadowNode).shadowPseudoId() == "-apple-youtube-shadow-iframe") 232 233 return createRenderer<RenderBlockFlow>(*this, std::move(style)); 233 234 } 234 235 #endif 236 235 237 return HTMLPlugInElement::createElementRenderer(std::move(style)); 236 238 } … … 245 247 } 246 248 249 void HTMLPlugInImageElement::didRecalcStyle(Style::Change styleChange) 250 { 251 scheduleUpdateForAfterStyleResolution(); 252 253 HTMLPlugInElement::didRecalcStyle(styleChange); 254 } 255 247 256 void HTMLPlugInImageElement::didAttachRenderers() 248 257 { 249 if (!isImageType()) { 250 queuePostAttachCallback(&HTMLPlugInImageElement::updateWidgetCallback, *this); 251 return; 252 } 253 if (!renderer() || useFallbackContent()) 254 return; 255 256 // Image load might complete synchronously and cause us to re-enter attach. 257 queuePostAttachCallback(&HTMLPlugInImageElement::startLoadingImageCallback, *this); 258 scheduleUpdateForAfterStyleResolution(); 259 260 HTMLPlugInElement::didAttachRenderers(); 258 261 } 259 262 … … 262 265 // FIXME: Because of the insanity that is HTMLPlugInImageElement::willRecalcStyle, 263 266 // we can end up detaching during an attach() call, before we even have a 264 // renderer. 267 // renderer. In that case, don't mark the widget for update. 265 268 if (renderer() && !useFallbackContent()) { 266 269 // Update the widget the next time we attach (detaching destroys the plugin). 267 270 setNeedsWidgetUpdate(true); 268 271 } 272 269 273 HTMLPlugInElement::willDetachRenderers(); 270 274 } 271 275 272 void HTMLPlugInImageElement::updateWidgetIfNecessary() 273 { 274 document().updateStyleIfNeeded(); 275 276 if (!needsWidgetUpdate() || useFallbackContent() || isImageType()) 277 return; 278 279 if (!renderEmbeddedObject() || renderEmbeddedObject()->isPluginUnavailable()) 280 return; 281 282 updateWidget(CreateOnlyNonNetscapePlugins); 276 void HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution() 277 { 278 if (m_needsImageReload || (renderer() && !useFallbackContent())) { 279 RefPtr<HTMLPlugInImageElement> element = this; 280 Style::queuePostResolutionCallback([element]{ 281 element->updateAfterStyleResolution(); 282 }); 283 } 284 } 285 286 void HTMLPlugInImageElement::updateAfterStyleResolution() 287 { 288 // Do this after style resolution, since the image or widget load might complete synchronously 289 // and cause us to re-enter otherwise. Also, we can't really answer the question "do I have a renderer" 290 // accurately until after style resolution. 291 292 if (renderer() && !useFallbackContent()) { 293 if (isImageType()) { 294 if (!m_imageLoader) 295 m_imageLoader = std::make_unique<HTMLImageLoader>(*this); 296 if (m_needsImageReload) 297 m_imageLoader->updateFromElementIgnoringPreviousError(); 298 else 299 m_imageLoader->updateFromElement(); 300 } else { 301 if (m_needsWidgetUpdate && renderEmbeddedObject() && !renderEmbeddedObject()->isPluginUnavailable()) 302 updateWidget(CreateOnlyNonNetscapePlugins); 303 } 304 } 305 306 // Either we reloaded the image just now, or we had some reason not to. 307 // Either way, clear the flag now, since we don't need to remember to try again. 308 setNeedsImageReload(false); 283 309 } 284 310 … … 294 320 } 295 321 322 void HTMLPlugInImageElement::removedFrom(ContainerNode& root) 323 { 324 // Important to do this when removed from a document to remove the possibility 325 // we might delay the document's load event indefinitely. 326 setNeedsImageReload(false); 327 328 HTMLPlugInElement::removedFrom(root); 329 } 330 296 331 void HTMLPlugInImageElement::didMoveToNewDocument(Document* oldDocument) 297 332 { 298 333 if (m_needsDocumentActivationCallbacks) { 299 if (oldDocument) 300 oldDocument->unregisterForPageCacheSuspensionCallbacks(this); 334 oldDocument->unregisterForPageCacheSuspensionCallbacks(this); 301 335 document().registerForPageCacheSuspensionCallbacks(this); 302 336 } … … 304 338 if (m_imageLoader) 305 339 m_imageLoader->elementDidMoveToNewDocument(); 340 306 341 HTMLPlugInElement::didMoveToNewDocument(oldDocument); 307 342 } … … 320 355 321 356 HTMLPlugInElement::documentDidResumeFromPageCache(); 322 }323 324 void HTMLPlugInImageElement::updateWidgetCallback(Node& node, unsigned)325 {326 toHTMLPlugInImageElement(node).updateWidgetIfNecessary();327 }328 329 void HTMLPlugInImageElement::startLoadingImage()330 {331 if (!m_imageLoader)332 m_imageLoader = adoptPtr(new HTMLImageLoader(*this));333 m_imageLoader->updateFromElement();334 }335 336 void HTMLPlugInImageElement::startLoadingImageCallback(Node& node, unsigned)337 {338 toHTMLPlugInImageElement(node).startLoadingImage();339 357 } 340 358 … … 438 456 root.appendChild(shadowElement, ASSERT_NO_EXCEPTION); 439 457 440 RefPtr<HTMLIFrameElement> iframeElement = HTMLIFrameElement::create( HTMLNames::iframeTag, document());441 if (hasAttribute( HTMLNames::widthAttr))442 iframeElement->setAttribute( HTMLNames::widthAttr, AtomicString("100%", AtomicString::ConstructFromLiteral));443 if (hasAttribute( HTMLNames::heightAttr)) {444 iframeElement->setAttribute( HTMLNames::styleAttr, AtomicString("max-height: 100%", AtomicString::ConstructFromLiteral));445 iframeElement->setAttribute( HTMLNames::heightAttr, getAttribute(HTMLNames::heightAttr));446 } 447 iframeElement->setAttribute( HTMLNames::srcAttr, src);448 iframeElement->setAttribute( HTMLNames::frameborderAttr, AtomicString("0", AtomicString::ConstructFromLiteral));458 RefPtr<HTMLIFrameElement> iframeElement = HTMLIFrameElement::create(iframeTag, document()); 459 if (hasAttribute(widthAttr)) 460 iframeElement->setAttribute(widthAttr, AtomicString("100%", AtomicString::ConstructFromLiteral)); 461 if (hasAttribute(heightAttr)) { 462 iframeElement->setAttribute(styleAttr, AtomicString("max-height: 100%", AtomicString::ConstructFromLiteral)); 463 iframeElement->setAttribute(heightAttr, getAttribute(heightAttr)); 464 } 465 iframeElement->setAttribute(srcAttr, src); 466 iframeElement->setAttribute(frameborderAttr, AtomicString("0", AtomicString::ConstructFromLiteral)); 449 467 450 468 // Disable frame flattening for this iframe. 451 iframeElement->setAttribute( HTMLNames::scrollingAttr, AtomicString("no", AtomicString::ConstructFromLiteral));469 iframeElement->setAttribute(scrollingAttr, AtomicString("no", AtomicString::ConstructFromLiteral)); 452 470 shadowElement->appendChild(iframeElement, ASSERT_NO_EXCEPTION); 453 471 } … … 611 629 } 612 630 631 static inline bool is100Percent(Length length) 632 { 633 return length.isPercent() && length.percent() == 100; 634 } 635 613 636 void HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn(const URL& url) 614 637 { … … 695 718 } 696 719 697 RenderBox* renderEmbeddedObject = toRenderBox(renderer());698 L ength styleWidth = renderEmbeddedObject->style().width();699 Length styleHeight = renderEmbeddedObject->style().height();700 LayoutRect contentBoxRect = renderEmbeddedObject->contentBoxRect();701 int contentWidth = contentBoxRect.width(); 702 i nt contentHeight = contentBoxRect.height();703 int contentArea = contentWidth * contentHeight;704 IntSize visibleViewSize = document().frame()->view()->visibleSize();705 int visibleArea = visibleViewSize.width() * visibleViewSize.height();706 707 if (inMainFrame && styleWidth.isPercent() && (styleWidth.percent() == 100)708 && styleHeight.isPercent() && (styleHeight.percent() == 100)709 && (static_cast<float>(contentArea) / visibleArea > sizingFullPageAreaRatioThreshold)) {710 LOG(Plugins, "%p Plug-in is top level full page, set to play", this);711 m_snapshotDecision = NeverSnapshot;712 return;720 auto& renderer = toRenderEmbeddedObject(*this->renderer()); 721 LayoutRect contentRect = renderer.contentBoxRect(); 722 int contentWidth = contentRect.width(); 723 int contentHeight = contentRect.height(); 724 725 if (inMainFrame) { 726 auto& style = renderer.style(); 727 bool isFullPage = is100Percent(style.width()) && is100Percent(style.height()); 728 IntSize visibleViewSize = document().frame()->view()->visibleSize(); 729 float contentArea = contentWidth * contentHeight; 730 float visibleArea = visibleViewSize.width() * visibleViewSize.height(); 731 if (isFullPage && contentArea > visibleArea * sizingFullPageAreaRatioThreshold) { 732 LOG(Plugins, "%p Plug-in is top level full page, set to play", this); 733 m_snapshotDecision = NeverSnapshot; 734 return; 735 } 713 736 } 714 737 715 738 if (contentWidth <= sizingTinyDimensionThreshold || contentHeight <= sizingTinyDimensionThreshold) { 716 739 LOG(Plugins, "%p Plug-in is very small %dx%d, set to play", this, contentWidth, contentHeight); 717 m_sizeWhenSnapshotted = IntSize(content BoxRect.width().toInt(), contentBoxRect.height().toInt());740 m_sizeWhenSnapshotted = IntSize(contentWidth, contentHeight); 718 741 m_snapshotDecision = MaySnapshotWhenResized; 719 742 return; … … 727 750 } 728 751 729 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);752 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); 730 753 m_snapshotDecision = Snapshotted; 731 754 setDisplayState(WaitingForSnapshot); … … 775 798 } 776 799 800 void HTMLPlugInImageElement::setNeedsImageReload(bool needsImageReload) 801 { 802 if (m_needsImageReload == needsImageReload) 803 return; 804 805 m_needsImageReload = needsImageReload; 806 807 if (!needsImageReload) 808 document().decrementLoadEventDelayCount(); 809 else { 810 // Called when a URL is set, triggering a new load. 811 // The actual load won't start until we recalculate style, which will tell us whether to load. 812 document().incrementLoadEventDelayCount(); 813 setNeedsStyleRecalc(SyntheticStyleChange); 814 } 815 } 816 777 817 } // namespace WebCore -
trunk/Source/WebCore/html/HTMLPlugInImageElement.h
r163082 r166144 1 1 /* 2 * Copyright (C) 2008, 2009, 2011, 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2009, 2011, 2012, 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 24 24 #include "HTMLPlugInElement.h" 25 25 26 #include "RenderStyle.h"27 #include <wtf/OwnPtr.h>28 29 26 namespace WebCore { 30 27 31 28 class HTMLImageLoader; 32 class HTMLVideoElement;33 29 class FrameLoader; 34 30 class Image; 35 31 class MouseEvent; 32 class RenderStyle; 36 33 class Widget; 37 34 … … 41 38 }; 42 39 43 enum PreferPlugInsForImagesOption { 44 ShouldPreferPlugInsForImages, 45 ShouldNotPreferPlugInsForImages 46 }; 47 48 // Base class for HTMLObjectElement and HTMLEmbedElement 40 // Base class for HTMLAppletElement, HTMLEmbedElement, and HTMLObjectElement. 41 // FIXME: Should HTMLAppletElement inherit from HTMLPlugInElement directly instead? 49 42 class HTMLPlugInImageElement : public HTMLPlugInElement { 50 43 public: … … 105 98 106 99 protected: 100 enum PreferPlugInsForImagesOption { ShouldPreferPlugInsForImages, ShouldNotPreferPlugInsForImages }; 107 101 HTMLPlugInImageElement(const QualifiedName& tagName, Document&, bool createdByParser, PreferPlugInsForImagesOption); 108 102 103 virtual void removedFrom(ContainerNode&) override; 104 virtual void didMoveToNewDocument(Document* oldDocument) override; 105 virtual bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues) override final; 106 109 107 bool isImageType(); 110 111 OwnPtr<HTMLImageLoader> m_imageLoader; 112 String m_serviceType; 113 String m_url; 114 URL m_loadedUrl; 115 116 static void updateWidgetCallback(Node&, unsigned); 117 static void startLoadingImageCallback(Node&, unsigned); 118 119 virtual void didAttachRenderers() override; 120 virtual void willDetachRenderers() override; 108 HTMLImageLoader* imageLoader() { return m_imageLoader.get(); } 109 void updateImageLoaderWithNewURLSoon() { setNeedsImageReload(true); } 121 110 122 111 bool allowedToLoadFrameURL(const String& url); 123 112 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType); 124 113 125 virtual void didMoveToNewDocument(Document* oldDocument) override; 126 127 virtual void documentWillSuspendForPageCache() override; 128 virtual void documentDidResumeFromPageCache() override; 129 130 virtual bool isRestartedPlugin() const override { return m_isRestartedPlugin; } 131 virtual bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues) override; 114 String m_serviceType; 115 String m_url; 132 116 133 117 private: 118 virtual bool isPlugInImageElement() const override final { return true; } 119 virtual bool isRestartedPlugin() const override final { return m_isRestartedPlugin; } 120 121 virtual void finishParsingChildren() override final; 122 virtual void didAddUserAgentShadowRoot(ShadowRoot*) override final; 123 134 124 virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override; 135 virtual bool willRecalcStyle(Style::Change) override; 125 virtual bool willRecalcStyle(Style::Change) override final; 126 virtual void didRecalcStyle(Style::Change styleChange) override final; 127 virtual void didAttachRenderers() override final; 128 virtual void willDetachRenderers() override final; 136 129 137 virtual void didAddUserAgentShadowRoot(ShadowRoot*) override; 130 virtual void documentWillSuspendForPageCache() override final; 131 virtual void documentDidResumeFromPageCache() override final; 138 132 139 virtual void finishParsingChildren() override; 133 virtual void defaultEventHandler(Event*) override final; 134 virtual void dispatchPendingMouseClick() override final; 140 135 141 void updateWidgetIfNecessary(); 142 void startLoadingImage(); 136 virtual void updateSnapshot(PassRefPtr<Image>) override final; 143 137 144 virtual void updateSnapshot(PassRefPtr<Image>) override; 145 virtual void dispatchPendingMouseClick() override; 138 void setNeedsImageReload(bool); 139 void scheduleUpdateForAfterStyleResolution(); 140 void updateAfterStyleResolution(); 141 146 142 void simulatedMouseClickTimerFired(DeferrableOneShotTimer<HTMLPlugInImageElement>&); 147 143 148 144 void restartSimilarPlugIns(); 149 150 virtual bool isPlugInImageElement() const override { return true; }151 152 145 void removeSnapshotTimerFired(Timer<HTMLPlugInImageElement>&); 153 146 154 virtual void defaultEventHandler(Event*) override;155 147 std::unique_ptr<HTMLImageLoader> m_imageLoader; 148 URL m_loadedUrl; 156 149 bool m_needsWidgetUpdate; 150 bool m_needsImageReload; 157 151 bool m_shouldPreferPlugInsForImages; 158 152 bool m_needsDocumentActivationCallbacks; -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r165542 r166144 30 30 #include "AnimationController.h" 31 31 #include "CSSFontSelector.h" 32 #include "Element.h"33 32 #include "ElementIterator.h" 34 33 #include "ElementRareData.h" 35 34 #include "FlowThreadController.h" 36 35 #include "InsertionPoint.h" 36 #include "LoaderStrategy.h" 37 37 #include "NodeRenderStyle.h" 38 38 #include "NodeRenderingTraversal.h" 39 39 #include "NodeTraversal.h" 40 #include " RenderElement.h"40 #include "PlatformStrategies.h" 41 41 #include "RenderFullScreen.h" 42 42 #include "RenderNamedFlowThread.h" … … 44 44 #include "RenderView.h" 45 45 #include "RenderWidget.h" 46 #include "ResourceLoadScheduler.h" 46 47 #include "Settings.h" 47 48 #include "ShadowRoot.h" … … 505 506 } 506 507 507 static bool needsPseud eElement(Element& current, PseudoId pseudoId)508 static bool needsPseudoElement(Element& current, PseudoId pseudoId) 508 509 { 509 510 if (!current.document().styleSheetCollection().usesBeforeAfterRules()) … … 520 521 static void attachBeforeOrAfterPseudoElementIfNeeded(Element& current, PseudoId pseudoId) 521 522 { 522 if (!needsPseud eElement(current, pseudoId))523 if (!needsPseudoElement(current, pseudoId)) 523 524 return; 524 525 RefPtr<PseudoElement> pseudoElement = PseudoElement::create(current, pseudoId); … … 529 530 static void attachRenderTree(Element& current, ContainerNode& renderingParentNode, PassRefPtr<RenderStyle> resolvedStyle) 530 531 { 531 Post AttachCallbackDisabler callbackDisabler(current.document());532 PostResolutionCallbackDisabler callbackDisabler(current.document()); 532 533 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; 533 534 … … 742 743 { 743 744 if (PseudoElement* existingPseudoElement = beforeOrAfterPseudoElement(current, pseudoId)) { 744 if (needsPseud eElement(current, pseudoId))745 if (needsPseudoElement(current, pseudoId)) 745 746 resolveTree(*existingPseudoElement, current, current.needsStyleRecalc() ? Force : change); 746 747 else … … 905 906 } 906 907 907 } 908 } 908 static Vector<std::function<void ()>>& postResolutionCallbackQueue() 909 { 910 static NeverDestroyed<Vector<std::function<void ()>>> vector; 911 return vector; 912 } 913 914 void queuePostResolutionCallback(std::function<void ()> callback) 915 { 916 postResolutionCallbackQueue().append(callback); 917 } 918 919 static void suspendMemoryCacheClientCalls(Document& document) 920 { 921 Page* page = document.page(); 922 if (!page || !page->areMemoryCacheClientCallsEnabled()) 923 return; 924 925 page->setMemoryCacheClientCallsEnabled(false); 926 927 RefPtr<Document> protectedDocument = &document; 928 postResolutionCallbackQueue().append([protectedDocument]{ 929 // FIXME: If the document becomes unassociated with the page during style resolution 930 // then this won't work and the memory cache client calls will be permanently disabled. 931 if (Page* page = protectedDocument->page()) 932 page->setMemoryCacheClientCallsEnabled(true); 933 }); 934 } 935 936 static unsigned resolutionNestingDepth; 937 938 PostResolutionCallbackDisabler::PostResolutionCallbackDisabler(Document& document) 939 { 940 ++resolutionNestingDepth; 941 942 if (resolutionNestingDepth == 1) 943 platformStrategies()->loaderStrategy()->resourceLoadScheduler()->suspendPendingRequests(); 944 945 // FIXME: It's strange to build this into the disabler. 946 suspendMemoryCacheClientCalls(document); 947 } 948 949 PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler() 950 { 951 if (resolutionNestingDepth == 1) { 952 // Get size each time through the loop because a callback can add more callbacks to the end of the queue. 953 auto& queue = postResolutionCallbackQueue(); 954 for (size_t i = 0; i < queue.size(); ++i) 955 queue[i](); 956 queue.clear(); 957 958 platformStrategies()->loaderStrategy()->resourceLoadScheduler()->resumePendingRequests(); 959 } 960 961 --resolutionNestingDepth; 962 } 963 964 bool postResolutionCallbacksAreSuspended() 965 { 966 return resolutionNestingDepth; 967 } 968 969 } 970 } -
trunk/Source/WebCore/style/StyleResolveTree.h
r162726 r166144 27 27 #define StyleResolveTree_h 28 28 29 #include <functional> 30 29 31 namespace WebCore { 30 32 … … 48 50 Change determineChange(const RenderStyle*, const RenderStyle*); 49 51 52 void queuePostResolutionCallback(std::function<void ()>); 53 bool postResolutionCallbacksAreSuspended(); 54 55 class PostResolutionCallbackDisabler { 56 public: 57 explicit PostResolutionCallbackDisabler(Document&); 58 ~PostResolutionCallbackDisabler(); 59 }; 60 50 61 } 51 62 -
trunk/Source/WebKit/mac/ChangeLog
r166117 r166144 1 2014-03-23 Darin Adler <darin@apple.com> 2 3 Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout 4 https://bugs.webkit.org/show_bug.cgi?id=130653 5 6 Reviewed by Antti Koivisto. 7 8 * WebCoreSupport/WebFrameLoaderClient.mm: Call toHTMLPlugInImageElement instead of 9 doing a static_cast. 10 1 11 2014-03-21 Simon Fraser <simon.fraser@apple.com> 2 12 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r165979 r166144 2107 2107 if (element->hasTagName(HTMLNames::embedTag) || element->hasTagName(HTMLNames::objectTag)) { 2108 2108 // Create a shadow subtree for the plugin element, the iframe player is injected in the shadow tree. 2109 HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(element); 2110 pluginElement->createShadowIFrameSubtree(embedSrc); 2109 toHTMLPlugInImageElement(*element).createShadowIFrameSubtree(embedSrc); 2111 2110 return nullptr; 2112 2111 }
Note: See TracChangeset
for help on using the changeset viewer.