Changeset 161208 in webkit
- Timestamp:
- Jan 2, 2014, 7:51:59 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r161207 r161208 1 2014-01-02 Antti Koivisto <antti@apple.com> 2 3 Always resolve style from root 4 https://bugs.webkit.org/show_bug.cgi?id=126380 5 6 Reviewed by Andreas Kling. 7 8 Forced style resolve that does not start from the root is never really correct. 9 Remove the few remaining instances. 10 11 * dom/ShadowRoot.cpp: 12 (WebCore::ShadowRoot::setResetStyleInheritance): 13 14 Update style asynchronously. 15 16 * dom/ShadowRoot.h: 17 * dom/Text.h: 18 * html/HTMLPlugInImageElement.cpp: 19 (WebCore::HTMLPlugInImageElement::createElementRenderer): 20 (WebCore::HTMLPlugInImageElement::documentWillSuspendForPageCache): 21 (WebCore::HTMLPlugInImageElement::documentDidResumeFromPageCache): 22 23 Delete the render tree synchronously on suspend and rebuild it asynchronously on resume. 24 No need for m_customStyleForPageCache hack. 25 26 * html/HTMLPlugInImageElement.h: 27 28 Remove m_customStyleForPageCache. 29 30 * style/StyleResolveTree.cpp: 31 * style/StyleResolveTree.h: 32 33 Remove Element version of resolveTree from the interface. 34 35 * svg/SVGUseElement.h: 36 1 37 2014-01-02 Antti Koivisto <antti@apple.com> 2 38 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r161127 r161208 141 141 if (value != m_resetStyleInheritance) { 142 142 m_resetStyleInheritance = value; 143 if ( renderer() &&hostElement())144 Style::resolveTree(*hostElement(), Style::Force);143 if (hostElement()) 144 setNeedsStyleRecalc(); 145 145 } 146 146 } -
trunk/Source/WebCore/dom/ShadowRoot.h
r159036 r161208 34 34 #include "Element.h" 35 35 #include "ExceptionCode.h" 36 #include "StyleResolveTree.h"37 36 #include "TreeScope.h" 38 37 -
trunk/Source/WebCore/dom/Text.h
r161143 r161208 26 26 #include "CharacterData.h" 27 27 #include "RenderPtr.h" 28 #include "StyleResolveTree.h"29 28 30 29 namespace WebCore { -
trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp
r161195 r161208 199 199 RenderPtr<RenderElement> HTMLPlugInImageElement::createElementRenderer(PassRef<RenderStyle> style) 200 200 { 201 ASSERT(!document().inPageCache()); 202 201 203 if (displayState() >= PreparingPluginReplacement) 202 204 return HTMLPlugInElement::createElementRenderer(std::move(style)); … … 310 312 void HTMLPlugInImageElement::documentWillSuspendForPageCache() 311 313 { 312 if (RenderStyle* renderStyle = this->renderStyle()) { 313 m_customStyleForPageCache = RenderStyle::clone(renderStyle); 314 m_customStyleForPageCache->setDisplay(NONE); 315 Style::resolveTree(*this, Style::Force); 316 } 314 if (renderer()) 315 Style::detachRenderTree(*this); 317 316 318 317 HTMLPlugInElement::documentWillSuspendForPageCache(); … … 321 320 void HTMLPlugInImageElement::documentDidResumeFromPageCache() 322 321 { 323 if (m_customStyleForPageCache) { 324 m_customStyleForPageCache = 0; 325 Style::resolveTree(*this, Style::Force); 326 } 322 setNeedsStyleRecalc(ReconstructRenderTree); 327 323 328 324 HTMLPlugInElement::documentDidResumeFromPageCache(); 329 }330 331 PassRefPtr<RenderStyle> HTMLPlugInImageElement::customStyleForRenderer()332 {333 if (!m_customStyleForPageCache)334 return document().ensureStyleResolver().styleForElement(this);335 return m_customStyleForPageCache;336 325 } 337 326 -
trunk/Source/WebCore/html/HTMLPlugInImageElement.h
r161181 r161208 128 128 virtual void documentDidResumeFromPageCache() OVERRIDE; 129 129 130 virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;131 132 130 virtual bool isRestartedPlugin() const OVERRIDE { return m_isRestartedPlugin; } 133 131 virtual bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues) OVERRIDE; … … 159 157 bool m_shouldPreferPlugInsForImages; 160 158 bool m_needsDocumentActivationCallbacks; 161 RefPtr<RenderStyle> m_customStyleForPageCache;162 159 RefPtr<MouseEvent> m_pendingClickEventFromSnapshot; 163 160 DeferrableOneShotTimer<HTMLPlugInImageElement> m_simulatedMouseClickTimer; -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r161205 r161208 65 65 static void attachTextRenderer(Text&); 66 66 static void detachRenderTree(Element&, DetachType); 67 static void resolveTree(Element&, Change); 67 68 68 69 Change determineChange(const RenderStyle* s1, const RenderStyle* s2, Settings* settings) -
trunk/Source/WebCore/style/StyleResolveTree.h
r161205 r161208 39 39 enum Change { NoChange, NoInherit, Inherit, Detach, Force }; 40 40 41 void resolveTree(Element&, Change);42 41 void resolveTree(Document&, Change); 43 42 44 43 void detachRenderTree(Element&); 44 void detachTextRenderer(Text&); 45 45 46 void detachTextRenderer(Text&);47 46 void updateTextRendererAfterContentChange(Text&, unsigned offsetOfReplacedData, unsigned lengthOfReplacedData); 48 47 -
trunk/Source/WebCore/svg/SVGUseElement.h
r161181 r161208 31 31 #include "SVGNames.h" 32 32 #include "SVGURIReference.h" 33 #include "StyleResolveTree.h"34 33 35 34 namespace WebCore {
Note:
See TracChangeset
for help on using the changeset viewer.