SVG + <object> tests are flakey
authorzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 15:04:55 +0000 (15:04 +0000)
committerzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 15:04:55 +0000 (15:04 +0000)
commit038d77220201a5744ffb7825fca637b2ce2fd77c
tree0d0bef3895aa314ff68579bee8a25f2e4ef95675
parent033945f923739cd06a53612c0ee027e1ba5a5b5d
SVG + <object> tests are flakey
https://bugs.webkit.org/show_bug.cgi?id=77099

Reviewed by Andreas Kling.

Source/WebCore:

Bug 76447 changed the way RenderSVGRoot figures out its size. Previously RenderSVGRoot directly called out to the
ownerRenderer (RenderEmbeddedObject) to compute its replaced size when embedded through eg. <object> element,
which was quite hacky. It now relies on the ownerRenderers availableLogicalWidth/Height to be correctly set,
which requires that the ownerRenderer is always laid out before the RenderSVGRoot and not the other way round.

This is the source of current flakiness bugs.

In trunk FrameView contains several special hacks, to layout the ownerRenderers view, after the RenderSVGRoots view
finished layout. This worked without flakiness as RenderSVGRoot used to directly call computeReplacedLogicalWidth/Height
on the ownerRenderer, which is now gone. Fortunately we can keep the new design, and can remove all hacks out of
RenderSVGRoot/FrameView, if we can guarantee that the ownerRenderer FrameView is laid out before the RenderSVGRoot FrameView.

This is a much less error-prone approach as the previous one. This lets us run nrwt --tolerance 0 -p svg -g again,
without 100% reproducable failing svg/wicd tests. (There's still one unrelated error, before guard malloc mode passes fully).

Test: svg/wicd/sizing-flakiness.html (Adjusted version of the rightsizing test, made to fail with trunk w/o this patch.)

* page/FrameView.cpp: Remove m_inLayoutParentView.
(WebCore::FrameView::FrameView): Remove no longer needed m_inLayoutParentView.
(WebCore::FrameView::forceLayoutParentViewIfNeeded): Simplify, no need to call updateWidgetPositions anymore, nor to clear/query flags in RenderSVGRoot.
(WebCore::FrameView::layout): Call forceLayoutParentViewIfNeeded() before laying out the embedded document, to guarantee the correct order.
* page/FrameView.h:
(FrameView): Remove m_inLayoutParentView.
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::RenderSVGRoot): Remove m_needsSizeNegotiationWithHostDocument.
(WebCore::resolveLengthAttributeForSVG): Remove outcommented code, that went in by accident.
(WebCore::RenderSVGRoot::layout): Remove m_needsSizeNegotiationWithHostDocument handling which is now incorrect and no longer needed.
* rendering/svg/RenderSVGRoot.h:
(RenderSVGRoot): Remove m_needsSizeNegotiationWithHostDocument + accessors.

LayoutTests:

Introduce a testcase that fails reproducibly w/o needed guard malloc, if we ever regress <object> sizing again.

* platform/mac/svg/wicd/sizing-flakiness-expected.png:
* platform/mac/svg/wicd/sizing-flakiness-expected.txt:
* svg/wicd/sizing-flakiness.html: Adjusted version of the rightsizing test, made to fail with trunk w/o this patch.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/svg/wicd/sizing-flakiness-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/wicd/sizing-flakiness-expected.txt [new file with mode: 0644]
LayoutTests/svg/wicd/sizing-flakiness.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.h