[Coordinated Graphics] Lots of flaky tests
https://bugs.webkit.org/show_bug.cgi?id=160118
Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2016-07-23
Reviewed by Michael Catanzaro.
Source/WebCore:
Since the GTK+ ported to threaded compositor (coordinated graphics) there are a lot of flaky tests in the
bots. In manu of the cases the diff shows a different size in the FrameView layer.
This happens for tests run in the same WTR after fast/fixed-layout/fixed-layout.html. This is what happens:
1.- Test fast/fixed-layout/fixed-layout.html runs and sets fixed layout to true and fixed layout size to 400x400
2.- When it finishes TestController::resetStateToConsistentValues() is called.
3.- Blank URL is loaded after state has been updated
4.- Then Reset message is handled in the web process and Internals::resetToConsistentState() resets the fixed
layout state and size.
5.- onresize happens and the handler set in fast/fixed-layout/fixed-layout.html is invoked setting the fixed
layout to true and size to 400x400 again.
6.- about_blank is then loaded with the fixed layout enabled, as well as other tests after this one.
In addition to this, coordinated graphics uses a fixedVisibleContentRect in ScrollView that is never reset.
* platform/ScrollView.cpp:
(WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea): Only use m_fixedVisibleContentRect when
fixed layout is enabled.
(WebCore::ScrollView::unscaledUnobscuredVisibleContentSize): Ditto.
(WebCore::ScrollView::visibleContentRectInternal): Ditto.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Reset also the m_fixedVisibleContentRect.
LayoutTests:
* fast/fixed-layout/fixed-layout.html: Remove the onresize handler when the test finishes to ensure it can't be
called later affecting other tests.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@203644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp
index 93d2485..c1ab2ce 100644
--- a/Source/WebCore/platform/ScrollView.cpp
+++ b/Source/WebCore/platform/ScrollView.cpp
@@ -258,7 +258,7 @@
return platformVisibleContentSizeIncludingObscuredArea(scrollbarInclusion == IncludeScrollbars);
#if USE(COORDINATED_GRAPHICS)
- if (!m_fixedVisibleContentRect.isEmpty())
+ if (m_useFixedLayout && !m_fixedVisibleContentRect.isEmpty())
return m_fixedVisibleContentRect.size();
#endif
@@ -277,7 +277,7 @@
return platformVisibleContentSize(scrollbarInclusion == IncludeScrollbars);
#if USE(COORDINATED_GRAPHICS)
- if (!m_fixedVisibleContentRect.isEmpty())
+ if (m_useFixedLayout && !m_fixedVisibleContentRect.isEmpty())
return visibleContentSize;
#endif
@@ -303,7 +303,7 @@
return platformVisibleContentRect(scrollbarInclusion == IncludeScrollbars);
#if USE(COORDINATED_GRAPHICS)
- if (!m_fixedVisibleContentRect.isEmpty())
+ if (m_useFixedLayout && !m_fixedVisibleContentRect.isEmpty())
return m_fixedVisibleContentRect;
#endif