Changeset 180683 in webkit
- Timestamp:
- Feb 26, 2015 10:34:51 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r180678 r180683 1 2015-02-26 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Setting any of the <object> element plugin controlling attributes does not have any affect. 4 https://bugs.webkit.org/show_bug.cgi?id=141936. 5 6 Reviewed by Zalan Bujtas. 7 8 * svg/as-object/resources/lime100x100.html: Added. 9 * svg/as-object/resources/lime100x100.png: Added. 10 * svg/as-object/resources/lime100x100.svg: Added. 11 * svg/as-object/resources/red100x100.svg: Added. 12 * svg/as-object/svg-in-object-dynamic-attribute-change-expected.html: Added. 13 * svg/as-object/svg-in-object-dynamic-attribute-change.html: Added. 14 Ensure that changing the 'type' and the 'data' attributes of the <object> 15 element will have the expected outcome. Also make sure that the <object> 16 element renderer falls back correctly when setting any of the attributes 17 to some unexpected value. 18 1 19 2015-02-26 Brent Fulgham <bfulgham@apple.com> 2 20 -
trunk/Source/WebCore/ChangeLog
r180676 r180683 1 2015-02-26 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Setting any of the <object> element plugin controlling attributes does not have any affect. 4 https://bugs.webkit.org/show_bug.cgi?id=141936. 5 6 Reviewed by Zalan Bujtas. 7 8 When setting any of the <object> element plugin controlling attributes 9 dynamically we need to mark the the element to be dirty by calling 10 setNeedsStyleRecalc(), so it has to recreate its renderer when needed. 11 12 Test: svg/as-object/svg-in-object-dynamic-attribute-change.html 13 14 * dom/Element.h: Delete unimplemented function. 15 16 * html/HTMLObjectElement.cpp: 17 (WebCore::HTMLObjectElement::parseAttribute): Dirty the element by calling 18 setNeedsStyleRecalc() when one of the plugin controlling attributes gets 19 changed. We have to clear the m_useFallbackContent because the attribute's 20 new value might fix the object rendering. 21 22 * html/HTMLObjectElement.h: Add a function to clear m_useFallbackContent. 23 24 * html/HTMLPlugInImageElement.cpp: 25 (WebCore::HTMLPlugInImageElement::willRecalcStyle): We might need to 26 reconstruct the object renderer in the image case. This can happen if the 27 image was rendering fallback content and the attribute's new value fixes 28 the object rendering. 29 1 30 2015-02-26 Brent Fulgham <bfulgham@apple.com> 2 31 -
trunk/Source/WebCore/dom/Element.h
r179770 r180683 311 311 virtual void copyNonAttributePropertiesFromElement(const Element&) { } 312 312 313 void lazyReattach();314 315 313 virtual RenderPtr<RenderElement> createElementRenderer(Ref<RenderStyle>&&); 316 314 virtual bool rendererIsNeeded(const RenderStyle&); -
trunk/Source/WebCore/html/HTMLObjectElement.cpp
r177996 r180683 108 108 void HTMLObjectElement::parseAttribute(const QualifiedName& name, const AtomicString& value) 109 109 { 110 bool invalidateRenderer = false; 111 110 112 if (name == formAttr) 111 113 formAttributeChanged(); 112 114 else if (name == typeAttr) { 113 115 m_serviceType = value.string().left(value.find(';')).lower(); 116 invalidateRenderer = !fastHasAttribute(classidAttr); 114 117 setNeedsWidgetUpdate(true); 115 118 } else if (name == dataAttr) { 116 119 m_url = stripLeadingAndTrailingHTMLSpaces(value); 120 document().updateStyleIfNeeded(); 121 if (isImageType() && renderer()) { 122 if (!m_imageLoader) 123 m_imageLoader = std::make_unique<HTMLImageLoader>(*this); 124 m_imageLoader->updateFromElementIgnoringPreviousError(); 125 } 126 invalidateRenderer = !fastHasAttribute(classidAttr); 117 127 setNeedsWidgetUpdate(true); 118 document().updateStyleIfNeeded(); 119 if (renderer()) { 120 if (isImageType()) { 121 if (!m_imageLoader) 122 m_imageLoader = std::make_unique<HTMLImageLoader>(*this); 123 m_imageLoader->updateFromElementIgnoringPreviousError(); 124 } 125 } 126 } else if (name == classidAttr) 128 } else if (name == classidAttr) { 129 invalidateRenderer = true; 127 130 setNeedsWidgetUpdate(true); 128 else if (name == onbeforeloadAttr)131 } else if (name == onbeforeloadAttr) 129 132 setAttributeEventListener(eventNames().beforeloadEvent, name, value); 130 133 else 131 134 HTMLPlugInImageElement::parseAttribute(name, value); 135 136 if (!invalidateRenderer || !inDocument() || !renderer()) 137 return; 138 139 clearUseFallbackContent(); 140 setNeedsStyleRecalc(SyntheticStyleChange); 132 141 } 133 142 -
trunk/Source/WebCore/html/HTMLObjectElement.h
r177996 r180683 86 86 bool shouldAllowQuickTimeClassIdQuirk(); 87 87 bool hasValidClassId(); 88 void clearUseFallbackContent() { m_useFallbackContent = false; } 88 89 89 90 virtual void refFormAssociatedElement() override { ref(); } -
trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp
r179597 r180683 238 238 // FIXME: There shoudn't be need to force render tree reconstruction here. 239 239 // It is only done because loading and load event dispatching is tied to render tree construction. 240 if (!useFallbackContent() && needsWidgetUpdate() && renderer() && !isImageType() &&(displayState() != DisplayingSnapshot))240 if (!useFallbackContent() && needsWidgetUpdate() && renderer() && (displayState() != DisplayingSnapshot)) 241 241 setNeedsStyleRecalc(ReconstructRenderTree); 242 242 return true;
Note: See TracChangeset
for help on using the changeset viewer.