REGRESSION (r220112): reCAPTCHA images render off screen on Twitch.tv app Log In...
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Apr 2018 00:13:16 +0000 (00:13 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Apr 2018 00:13:16 +0000 (00:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182859
<rdar://problem/37595065>

Source/WebCore:

Reviewed by Zalan Bujtas.

Roll out this change from the trunk as the issue it fixed no longer occurs.

* css/MediaQueryEvaluator.cpp:
(WebCore::orientationEvaluate):
(WebCore::aspectRatioEvaluate):
(WebCore::heightEvaluate):
(WebCore::widthEvaluate):
* page/FrameView.cpp:
(WebCore::FrameView::layoutSizeForMediaQuery const): Deleted.
* page/FrameView.h:
* page/LayoutContext.cpp:
(WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):

LayoutTests:

Reviewed by Zalan Bujtas

* fast/frames/flattening/media-query-growing-content-expected.txt: Removed.
* fast/frames/flattening/media-query-growing-content.html: Removed.
* fast/frames/flattening/resources/media-query-min-height-with-flattening.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230933 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/frames/flattening/media-query-growing-content-expected.txt [deleted file]
LayoutTests/fast/frames/flattening/media-query-growing-content.html [deleted file]
LayoutTests/fast/frames/flattening/resources/media-query-min-height-with-flattening.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/css/MediaQueryEvaluator.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/LayoutContext.cpp

index 646db36..ac18f5e 100644 (file)
@@ -1,3 +1,15 @@
+2018-04-23  Antti Koivisto  <antti@apple.com>
+
+        REGRESSION (r220112): reCAPTCHA images render off screen on Twitch.tv app Log In or Sign Up
+        https://bugs.webkit.org/show_bug.cgi?id=182859
+        <rdar://problem/37595065>
+
+        Reviewed by Zalan Bujtas
+
+        * fast/frames/flattening/media-query-growing-content-expected.txt: Removed.
+        * fast/frames/flattening/media-query-growing-content.html: Removed.
+        * fast/frames/flattening/resources/media-query-min-height-with-flattening.html: Removed.
+
 2018-04-23  Daniel Bates  <dabates@apple.com>
 
         Implement Same-Site cookies
diff --git a/LayoutTests/fast/frames/flattening/media-query-growing-content-expected.txt b/LayoutTests/fast/frames/flattening/media-query-growing-content-expected.txt
deleted file mode 100644 (file)
index 139597f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/LayoutTests/fast/frames/flattening/media-query-growing-content.html b/LayoutTests/fast/frames/flattening/media-query-growing-content.html
deleted file mode 100644 (file)
index 26b4e4f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>This tests that media query can't get into an ever-growing cycle.</title>
-<script>
-if (window.testRunner)
-    testRunner.dumpAsText();
-if (window.internals)
-    internals.settings.setFrameFlattening("FullyEnabled");
-
-function runTest() {
-    if (window.testRunner) {
-        testRunner.waitUntilDone();
-        setTimeout(function() {
-            testRunner.notifyDone();
-        }, 50);
-    }
-}
-</script>
-</head>
-<body>
-<iframe onload="runTest()" src="./resources/media-query-min-height-with-flattening.html"></iframe>
-<div id=testResult></div>
-</body>
-</html>
diff --git a/LayoutTests/fast/frames/flattening/resources/media-query-min-height-with-flattening.html b/LayoutTests/fast/frames/flattening/resources/media-query-min-height-with-flattening.html
deleted file mode 100644 (file)
index 94a8da0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<style>
-    div {
-        width: 200px;
-        height: 600px;
-    }
-</style>
-<div id=growingDiv></div>
-<script>
-var counter = 0;
-window.matchMedia('(min-height: 200px)').addListener(function(changed) {
-    ++counter;
-    setTimeout(function() {
-        growingDiv.innerText = growingDiv.innerText + ' media query callback ';
-        parent.document.getElementById("testResult").innerText = counter;
-    }, 0);
-});
-
-window.matchMedia('(min-width: 600px)').addListener(function(changed) {
-    ++counter;
-    setTimeout(function() {
-        growingDiv.innerText = growingDiv.innerText + ' media query callback ';
-        parent.document.getElementById("testResult").innerText = counter;
-    }, 0);
-});
-
-window.matchMedia('(min-aspect-ratio: 1/1)').addListener(function(changed) {
-    ++counter;
-    setTimeout(function() {
-        growingDiv.innerText = growingDiv.innerText + ' media query callback ';
-        parent.document.getElementById("testResult").innerText = counter;
-    }, 0);
-});
-
-</script>
\ No newline at end of file
index 2a7c446..74df252 100644 (file)
@@ -1,3 +1,24 @@
+2018-04-23  Antti Koivisto  <antti@apple.com>
+
+        REGRESSION (r220112): reCAPTCHA images render off screen on Twitch.tv app Log In or Sign Up
+        https://bugs.webkit.org/show_bug.cgi?id=182859
+        <rdar://problem/37595065>
+
+        Reviewed by Zalan Bujtas.
+
+        Roll out this change from the trunk as the issue it fixed no longer occurs.
+
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::orientationEvaluate):
+        (WebCore::aspectRatioEvaluate):
+        (WebCore::heightEvaluate):
+        (WebCore::widthEvaluate):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layoutSizeForMediaQuery const): Deleted.
+        * page/FrameView.h:
+        * page/LayoutContext.cpp:
+        (WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
+
 2018-04-23  Daniel Bates  <dabates@apple.com>
 
         Another attempt to fix the Windows build following r230921
index e00f681..5b7cb06 100644 (file)
@@ -335,20 +335,22 @@ static bool orientationEvaluate(CSSValue* value, const CSSToLengthConversionData
     if (!view)
         return false;
 
-    auto viewSize = view->layoutSizeForMediaQuery();
+    auto width = view->layoutWidth();
+    auto height = view->layoutHeight();
+
     if (!is<CSSPrimitiveValue>(value)) {
         // Expression (orientation) evaluates to true if width and height >= 0.
-        return viewSize.height() >= 0 && viewSize.width() >= 0;
+        return height >= 0 && width >= 0;
     }
 
     auto keyword = downcast<CSSPrimitiveValue>(*value).valueID();
     bool result;
-    if (viewSize.width() > viewSize.height()) // Square viewport is portrait.
+    if (width > height) // Square viewport is portrait.
         result = keyword == CSSValueLandscape;
     else
         result = keyword == CSSValuePortrait;
 
-    LOG_WITH_STREAM(MediaQueries, stream << "  orientationEvaluate: view size " << viewSize.width() << "x" << viewSize.height() << " is " << value->cssText() << ": " << result);
+    LOG_WITH_STREAM(MediaQueries, stream << "  orientationEvaluate: view size " << width << "x" << height << " is " << value->cssText() << ": " << result);
     return result;
 }
 
@@ -361,9 +363,8 @@ static bool aspectRatioEvaluate(CSSValue* value, const CSSToLengthConversionData
     FrameView* view = frame.view();
     if (!view)
         return true;
-    auto viewSize = view->layoutSizeForMediaQuery();
-    bool result = compareAspectRatioValue(value, viewSize.width(), viewSize.height(), op);
-    LOG_WITH_STREAM(MediaQueries, stream << "  aspectRatioEvaluate: " << op << " " << aspectRatioValueAsString(value) << " actual view size " << viewSize << ": " << result);
+    bool result = compareAspectRatioValue(value, view->layoutWidth(), view->layoutHeight(), op);
+    LOG_WITH_STREAM(MediaQueries, stream << "  aspectRatioEvaluate: " << op << " " << aspectRatioValueAsString(value) << " actual view size " << view->layoutWidth() << "x" << view->layoutHeight() << " : " << result);
     return result;
 }
 
@@ -495,7 +496,7 @@ static bool heightEvaluate(CSSValue* value, const CSSToLengthConversionData& con
     FrameView* view = frame.view();
     if (!view)
         return false;
-    int height = view->layoutSizeForMediaQuery().height();
+    int height = view->layoutHeight();
     if (!value)
         return height;
     if (auto* renderView = frame.document()->renderView())
@@ -515,7 +516,7 @@ static bool widthEvaluate(CSSValue* value, const CSSToLengthConversionData& conv
     FrameView* view = frame.view();
     if (!view)
         return false;
-    int width = view->layoutSizeForMediaQuery().width();
+    int width = view->layoutWidth();
     if (!value)
         return width;
     if (auto* renderView = frame.document()->renderView())
index 662f64c..e5c6a3c 100644 (file)
@@ -5092,10 +5092,5 @@ bool FrameView::shouldPlaceBlockDirectionScrollbarOnLeft() const
 {
     return renderView() && renderView()->shouldPlaceBlockDirectionScrollbarOnLeft();
 }
-
-IntSize FrameView::layoutSizeForMediaQuery() const
-{
-    return m_frameFlatteningViewSizeForMediaQuery.value_or(ScrollView::layoutSize());
-}
-
+    
 } // namespace WebCore
index 3d1b57e..ec9c902 100644 (file)
@@ -209,7 +209,6 @@ public:
     bool shouldUpdate() const;
 
     WEBCORE_EXPORT void adjustViewSize();
-    IntSize layoutSizeForMediaQuery() const;
 
     WEBCORE_EXPORT void setViewportSizeForCSSViewportUnits(IntSize);
     IntSize viewportSizeForCSSViewportUnits() const;
@@ -779,8 +778,6 @@ private:
     void removeFromAXObjectCache();
     void notifyWidgets(WidgetNotification);
 
-    void setFrameFlatteningViewSizeForMediaQuery() { m_frameFlatteningViewSizeForMediaQuery = layoutSize(); }
-    bool frameFlatteningViewSizeForMediaQueryIsSet() const { return m_frameFlatteningViewSizeForMediaQuery.has_value(); }
     RenderElement* viewportRenderer() const;
     
     void willDoLayout(WeakPtr<RenderElement> layoutRoot);
@@ -888,8 +885,6 @@ private:
     int m_autoSizeFixedMinimumHeight;
     // The intrinsic content size decided by autosizing.
     IntSize m_autoSizeContentSize;
-    // Report the first computed frame view size to media queries.
-    std::optional<IntSize> m_frameFlatteningViewSizeForMediaQuery;
 
     std::unique_ptr<ScrollableAreaSet> m_scrollableAreas;
     std::unique_ptr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects;
index 563d1cb..0d681df 100644 (file)
@@ -509,10 +509,6 @@ bool LayoutContext::handleLayoutWithFrameFlatteningIfNeeded()
     if (!view().isInChildFrameWithFrameFlattening())
         return false;
     
-    if (!view().frameFlatteningViewSizeForMediaQueryIsSet()) {
-        LOG_WITH_STREAM(MediaQueries, stream << "FrameView " << this << " snapshotting size " <<  view().layoutSize() << " for media queries");
-        view().setFrameFlatteningViewSizeForMediaQuery();
-    }
     startLayoutAtMainFrameViewIfNeeded();
     auto* layoutRoot = subtreeLayoutRoot() ? subtreeLayoutRoot() : frame().document()->renderView();
     return !layoutRoot || !layoutRoot->needsLayout();