Changeset 106001 in webkit
- Timestamp:
- Jan 26, 2012 7:04:55 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r105998 r106001 1 2012-01-26 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 SVG + <object> tests are flakey 4 https://bugs.webkit.org/show_bug.cgi?id=77099 5 6 Reviewed by Andreas Kling. 7 8 Introduce a testcase that fails reproducibly w/o needed guard malloc, if we ever regress <object> sizing again. 9 10 * platform/mac/svg/wicd/sizing-flakiness-expected.png: 11 * platform/mac/svg/wicd/sizing-flakiness-expected.txt: 12 * svg/wicd/sizing-flakiness.html: Adjusted version of the rightsizing test, made to fail with trunk w/o this patch. 13 1 14 2012-01-26 Anton Muhin <antonm@chromium.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r105999 r106001 1 2012-01-26 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 SVG + <object> tests are flakey 4 https://bugs.webkit.org/show_bug.cgi?id=77099 5 6 Reviewed by Andreas Kling. 7 8 Bug 76447 changed the way RenderSVGRoot figures out its size. Previously RenderSVGRoot directly called out to the 9 ownerRenderer (RenderEmbeddedObject) to compute its replaced size when embedded through eg. <object> element, 10 which was quite hacky. It now relies on the ownerRenderers availableLogicalWidth/Height to be correctly set, 11 which requires that the ownerRenderer is always laid out before the RenderSVGRoot and not the other way round. 12 13 This is the source of current flakiness bugs. 14 15 In trunk FrameView contains several special hacks, to layout the ownerRenderers view, after the RenderSVGRoots view 16 finished layout. This worked without flakiness as RenderSVGRoot used to directly call computeReplacedLogicalWidth/Height 17 on the ownerRenderer, which is now gone. Fortunately we can keep the new design, and can remove all hacks out of 18 RenderSVGRoot/FrameView, if we can guarantee that the ownerRenderer FrameView is laid out before the RenderSVGRoot FrameView. 19 20 This is a much less error-prone approach as the previous one. This lets us run nrwt --tolerance 0 -p svg -g again, 21 without 100% reproducable failing svg/wicd tests. (There's still one unrelated error, before guard malloc mode passes fully). 22 23 Test: svg/wicd/sizing-flakiness.html (Adjusted version of the rightsizing test, made to fail with trunk w/o this patch.) 24 25 * page/FrameView.cpp: Remove m_inLayoutParentView. 26 (WebCore::FrameView::FrameView): Remove no longer needed m_inLayoutParentView. 27 (WebCore::FrameView::forceLayoutParentViewIfNeeded): Simplify, no need to call updateWidgetPositions anymore, nor to clear/query flags in RenderSVGRoot. 28 (WebCore::FrameView::layout): Call forceLayoutParentViewIfNeeded() before laying out the embedded document, to guarantee the correct order. 29 * page/FrameView.h: 30 (FrameView): Remove m_inLayoutParentView. 31 * rendering/svg/RenderSVGRoot.cpp: 32 (WebCore::RenderSVGRoot::RenderSVGRoot): Remove m_needsSizeNegotiationWithHostDocument. 33 (WebCore::resolveLengthAttributeForSVG): Remove outcommented code, that went in by accident. 34 (WebCore::RenderSVGRoot::layout): Remove m_needsSizeNegotiationWithHostDocument handling which is now incorrect and no longer needed. 35 * rendering/svg/RenderSVGRoot.h: 36 (RenderSVGRoot): Remove m_needsSizeNegotiationWithHostDocument + accessors. 37 1 38 2012-01-23 Andreas Kling <awesomekling@apple.com> 2 39 -
trunk/Source/WebCore/page/FrameView.cpp
r105250 r106001 132 132 , m_layoutTimer(this, &FrameView::layoutTimerFired) 133 133 , m_layoutRoot(0) 134 #if ENABLE(SVG)135 , m_inLayoutParentView(false)136 #endif137 134 , m_inSynchronousPostLayout(false) 138 135 , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) … … 901 898 { 902 899 #if ENABLE(SVG) 903 if (m_inLayoutParentView)904 return;905 906 900 RenderPart* ownerRenderer = m_frame->ownerRenderer(); 907 901 if (!ownerRenderer || !ownerRenderer->frame()) … … 913 907 914 908 RenderSVGRoot* svgRoot = toRenderSVGRoot(contentBox); 915 if (!svgRoot->needsSizeNegotiationWithHostDocument()) 916 return; 917 909 if (svgRoot->everHadLayout() && !svgRoot->needsLayout()) 910 return; 911 912 // If the embedded SVG document appears the first time, the ownerRenderer has already finished 913 // layout without knowing about the existence of the embedded SVG document, because RenderReplaced 914 // embeddedContentBox() returns 0, as long as the embedded document isn't loaded yet. Before 915 // bothering to lay out the SVG document, mark the ownerRenderer needing layout and ask its 916 // FrameView for a layout. After that the RenderEmbeddedObject (ownerRenderer) carries the 917 // correct size, which RenderSVGRoot::computeReplacedLogicalWidth/Height rely on, when laying 918 // out for the first time, or when the RenderSVGRoot size has changed dynamically (eg. via <script>). 918 919 RefPtr<FrameView> frameView = ownerRenderer->frame()->view(); 919 920 ASSERT(!m_inLayoutParentView);921 TemporaryChange<bool> resetInLayoutParentView(m_inLayoutParentView, true);922 923 // Clear needs-size-negotiation flag in RenderSVGRoot, so the next call to our924 // layout() method won't fire the size negotiation logic again.925 svgRoot->scheduledSizeNegotiationWithHostDocument();926 ASSERT(!svgRoot->needsSizeNegotiationWithHostDocument());927 920 928 921 // Mark the owner renderer as needing layout. 929 922 ownerRenderer->setNeedsLayoutAndPrefWidthsRecalc(); 930 931 // Immediately relayout the child widgets, which can now calculate the SVG documents932 // intrinsic size, negotiating with the parent object/embed/iframe.933 RenderView* rootView = ownerRenderer->frame()->contentRenderer();934 ASSERT(rootView);935 rootView->updateWidgetPositions();936 923 937 924 // Synchronously enter layout, to layout the view containing the host object/embed/iframe. … … 1122 1109 m_inLayout = true; 1123 1110 beginDeferredRepaints(); 1111 forceLayoutParentViewIfNeeded(); 1124 1112 root->layout(); 1125 1113 endDeferredRepaints(); … … 1209 1197 1210 1198 page->chrome()->client()->layoutUpdated(frame()); 1211 forceLayoutParentViewIfNeeded();1212 1199 } 1213 1200 -
trunk/Source/WebCore/page/FrameView.h
r104879 r106001 423 423 bool m_layoutSchedulingEnabled; 424 424 bool m_inLayout; 425 #if ENABLE(SVG)426 bool m_inLayoutParentView;427 #endif428 425 bool m_inSynchronousPostLayout; 429 426 int m_layoutCount; -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r105513 r106001 59 59 , m_isLayoutSizeChanged(false) 60 60 , m_needsBoundariesOrTransformUpdate(true) 61 , m_needsSizeNegotiationWithHostDocument(false)62 61 { 63 62 } … … 156 155 { 157 156 return static_cast<LayoutUnit>(length.calcValue(maxSize) * (length.isFixed() ? scale : 1)); 158 /*159 if (length.isFixed())160 return static_cast<LayoutUnit>(length.calcFloatValue(maxSize) * scale);161 return static_cast<LayoutUnit>(length.calcFloatValue(maxSize));162 */163 157 } 164 158 … … 220 214 SVGSVGElement* svg = static_cast<SVGSVGElement*>(node()); 221 215 m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size()); 222 223 if (view() && view()->frameView() && view()->frameView()->embeddedContentBox()) {224 if (!m_needsSizeNegotiationWithHostDocument)225 m_needsSizeNegotiationWithHostDocument = !everHadLayout() || oldSize != size();226 } else227 ASSERT(!m_needsSizeNegotiationWithHostDocument);228 229 216 SVGRenderSupport::layoutChildren(this, needsLayout || SVGRenderSupport::filtersForceContainerLayout(this)); 230 217 m_isLayoutSizeChanged = false; -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h
r105513 r106001 46 46 const RenderObjectChildList* children() const { return &m_children; } 47 47 RenderObjectChildList* children() { return &m_children; } 48 49 bool needsSizeNegotiationWithHostDocument() const { return m_needsSizeNegotiationWithHostDocument; }50 51 void scheduledSizeNegotiationWithHostDocument()52 {53 ASSERT(m_needsSizeNegotiationWithHostDocument);54 m_needsSizeNegotiationWithHostDocument = false;55 }56 48 57 49 bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; } … … 109 101 bool m_isLayoutSizeChanged : 1; 110 102 bool m_needsBoundariesOrTransformUpdate : 1; 111 bool m_needsSizeNegotiationWithHostDocument : 1;112 103 }; 113 104
Note: See TracChangeset
for help on using the changeset viewer.