Title: [219915] branches/safari-604-branch

Diff

Modified: branches/safari-604-branch/LayoutTests/ChangeLog (219914 => 219915)


--- branches/safari-604-branch/LayoutTests/ChangeLog	2017-07-26 09:48:37 UTC (rev 219914)
+++ branches/safari-604-branch/LayoutTests/ChangeLog	2017-07-26 09:51:15 UTC (rev 219915)
@@ -1,3 +1,7 @@
+2017-07-26  Jason Marcell  <[email protected]>
+
+        Revert r219342. rdar://problem/33523803
+
 2017-07-24  Jason Marcell  <[email protected]>
 
         Cherry-pick r219665.

Modified: branches/safari-604-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-expected.txt (219914 => 219915)


--- branches/safari-604-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-expected.txt	2017-07-26 09:48:37 UTC (rev 219914)
+++ branches/safari-604-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-expected.txt	2017-07-26 09:51:15 UTC (rev 219915)
@@ -1,20 +1,3 @@
-This test applies page scale and scrolls the page, and checks that elementFromPoint returns the correct element.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-PASS document.elementFromPoint(225, 125) is b1
-PASS document.elementFromPoint(525, 425) is b2
-PASS document.elementFromPoint(225, 125) is b1
-PASS document.elementFromPoint(525, 425) is b2
-PASS document.elementFromPoint(115, 15) is b1
-PASS document.elementFromPoint(415, 315) is b2
-PASS document.elementFromPoint(-85, 15) is null
-PASS document.elementFromPoint(215, 315) is b2
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+B1B2B3
+This test is successful if elementFromPoint returns the correct element.
+B3

Modified: branches/safari-604-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled.html (219914 => 219915)


--- branches/safari-604-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled.html	2017-07-26 09:48:37 UTC (rev 219914)
+++ branches/safari-604-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled.html	2017-07-26 09:51:15 UTC (rev 219915)
@@ -1,60 +1,24 @@
 <!DOCTYPE html>
 <html>
 <head>
-<style>
-    body {
-        width: 2000px;
-        height: 2000px;
-    }
-    button {
-        position: absolute;
-        width: 50px;
-        height: 50px;
-    }
-    #b1 {
-        left: 200px;
-        top: 100px;
-    }
-    #b2 {
-        left: 500px;
-        top: 400px;
-    }
-</style>
-<script src=""
+<script src=""
 </head>
 <body _onload_="runTest();" style="width:2000px;height:2000px;margin:0px;padding:100px">
-<button id="b1"></button>
-<button id="b2"></button>
+<button style="width:50px;height:50px;">B1</button><button style="width:50px;height:50px;">B2</button><button style="width:50px;height:50px;">B3</button>
+<div>This test is successful if elementFromPoint returns the correct element.</div>
+<div id="result"></div>
 <script>
 function runTest() {
-    description("This test applies page scale and scrolls the page, and checks that elementFromPoint returns the correct element.");
-    if (window.internals) {
-        window.internals.settings.setVisualViewportEnabled(true);
+    if (window.internals)
         window.internals.setPageScaleFactor(2, 0, 0);
-    }
-    window.scrollTo(100, 100);
+    window.scrollTo(100,100);
 
-    // The layout viewport hasn't been scrolled.
-    shouldBe("document.elementFromPoint(225, 125)", "b1");
-    shouldBe("document.elementFromPoint(525, 425)", "b2");
+    if (window.testRunner)
+        testRunner.dumpAsText();
 
-    window.scrollTo(200, 200);
-
-    // b1 is now offscreen, but still within the layout viewport.
-    shouldBe("document.elementFromPoint(225, 125)", "b1");
-    shouldBe("document.elementFromPoint(525, 425)", "b2");
-
-    window.scrollTo(500, 400);
-    shouldBe("document.elementFromPoint(115, 15)", "b1");
-    shouldBe("document.elementFromPoint(415, 315)", "b2");
-
-    window.scrollTo(700, 400);
-    shouldBeNull("document.elementFromPoint(-85, 15)");
-    shouldBe("document.elementFromPoint(215, 315)", "b2");
-
-    finishJSTest();
+    document.getElementById("result").innerText = document.elementFromPoint(125, 25).innerText;
 }
 </script>
-<script src=""
+</script>
 </body>
 </html>

Modified: branches/safari-604-branch/LayoutTests/platform/ios/TestExpectations (219914 => 219915)


--- branches/safari-604-branch/LayoutTests/platform/ios/TestExpectations	2017-07-26 09:48:37 UTC (rev 219914)
+++ branches/safari-604-branch/LayoutTests/platform/ios/TestExpectations	2017-07-26 09:51:15 UTC (rev 219915)
@@ -2720,7 +2720,6 @@
 webkit.org/b/163046 js/regress-141098.html [ Pass Failure ]
 
 # Test relies on window.scrollTo
-fast/dom/elementFromPoint-scaled-scrolled.html [ Skip ]
 fast/zooming/client-rect-in-fixed-zoomed.html [ Skip ]
 fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html [ Skip ]
 fast/visual-viewport/zoomed-scroll-into-view-fixed.html [ Skip ]
@@ -2819,6 +2818,8 @@
 webkit.org/b/171760 imported/w3c/i18n/bidi/bidi-plaintext-011.html [ ImageOnlyFailure ]
 webkit.org/b/171760 imported/w3c/i18n/bidi/block-plaintext-005.html [ ImageOnlyFailure ]
 
+webkit.org/b/172019 imported/w3c/web-platform-tests/cssom-view/elementFromPoint.html [ Failure ]
+
 webkit.org/b/172547 http/tests/xmlhttprequest/xmlhttprequest-50ms-download-dispatch.html [ Failure ]
 
 webkit.org/b/172610 media/ios/autoplay-only-in-main-document.html [ Skip ]

Modified: branches/safari-604-branch/Source/WebCore/ChangeLog (219914 => 219915)


--- branches/safari-604-branch/Source/WebCore/ChangeLog	2017-07-26 09:48:37 UTC (rev 219914)
+++ branches/safari-604-branch/Source/WebCore/ChangeLog	2017-07-26 09:51:15 UTC (rev 219915)
@@ -1,3 +1,7 @@
+2017-07-26  Jason Marcell  <[email protected]>
+
+        Revert r219342. rdar://problem/33523803
+
 2017-07-24  Jason Marcell  <[email protected]>
 
         Cherry-pick r219665.

Modified: branches/safari-604-branch/Source/WebCore/dom/TreeScope.cpp (219914 => 219915)


--- branches/safari-604-branch/Source/WebCore/dom/TreeScope.cpp	2017-07-26 09:48:37 UTC (rev 219914)
+++ branches/safari-604-branch/Source/WebCore/dom/TreeScope.cpp	2017-07-26 09:51:15 UTC (rev 219915)
@@ -44,7 +44,6 @@
 #include "PointerLockController.h"
 #include "RenderView.h"
 #include "RuntimeEnabledFeatures.h"
-#include "Settings.h"
 #include "ShadowRoot.h"
 #include <wtf/text/CString.h>
 
@@ -302,32 +301,22 @@
     if (!frame || !view)
         return nullptr;
 
-    LayoutPoint absolutePoint;
-    if (frame->settings().visualViewportEnabled()) {
-        documentScope().updateLayout();
-        FloatPoint layoutViewportPoint = view->clientToLayoutViewportPoint(clientPoint);
-        FloatRect layoutViewportBounds({ }, view->layoutViewportRect().size());
-        if (!layoutViewportBounds.contains(layoutViewportPoint))
-            return nullptr;
-        absolutePoint = LayoutPoint(view->layoutViewportToAbsolutePoint(layoutViewportPoint));
-    } else {
-        float scaleFactor = frame->pageZoomFactor() * frame->frameScaleFactor();
+    float scaleFactor = frame->pageZoomFactor() * frame->frameScaleFactor();
 
-        absolutePoint = clientPoint;
-        absolutePoint.scale(scaleFactor);
-        absolutePoint.moveBy(view->contentsScrollPosition());
+    LayoutPoint contentsPoint = clientPoint;
+    contentsPoint.scale(scaleFactor);
+    contentsPoint.moveBy(view->contentsScrollPosition());
 
-        LayoutRect visibleRect;
+    LayoutRect visibleRect;
 #if PLATFORM(IOS)
-        visibleRect = view->unobscuredContentRect();
+    visibleRect = view->unobscuredContentRect();
 #else
-        visibleRect = view->visibleContentRect();
+    visibleRect = view->visibleContentRect();
 #endif
-        if (!visibleRect.contains(absolutePoint))
-            return nullptr;
-    }
+    if (!visibleRect.contains(contentsPoint))
+        return nullptr;
 
-    HitTestResult result(absolutePoint);
+    HitTestResult result(contentsPoint);
     documentScope().renderView()->hitTest(HitTestRequest(), result);
 
     if (localPoint)

Modified: branches/safari-604-branch/Source/WebCore/page/FrameView.cpp (219914 => 219915)


--- branches/safari-604-branch/Source/WebCore/page/FrameView.cpp	2017-07-26 09:48:37 UTC (rev 219914)
+++ branches/safari-604-branch/Source/WebCore/page/FrameView.cpp	2017-07-26 09:51:15 UTC (rev 219915)
@@ -4949,27 +4949,6 @@
     return p;
 }
 
-FloatRect FrameView::layoutViewportToAbsoluteRect(FloatRect rect) const
-{
-    ASSERT(frame().settings().visualViewportEnabled());
-    rect.moveBy(layoutViewportRect().location());
-    rect.scale(frame().frameScaleFactor());
-    return rect;
-}
-
-FloatPoint FrameView::layoutViewportToAbsolutePoint(FloatPoint p) const
-{
-    ASSERT(frame().settings().visualViewportEnabled());
-    p.moveBy(layoutViewportRect().location());
-    return p.scaled(frame().frameScaleFactor());
-}
-
-FloatPoint FrameView::clientToLayoutViewportPoint(FloatPoint p) const
-{
-    ASSERT(frame().settings().visualViewportEnabled());
-    return p.scaled(frame().pageZoomFactor());
-}
-
 void FrameView::setTracksRepaints(bool trackRepaints)
 {
     if (trackRepaints == m_isTrackingRepaints)

Modified: branches/safari-604-branch/Source/WebCore/page/FrameView.h (219914 => 219915)


--- branches/safari-604-branch/Source/WebCore/page/FrameView.h	2017-07-26 09:48:37 UTC (rev 219914)
+++ branches/safari-604-branch/Source/WebCore/page/FrameView.h	2017-07-26 09:51:15 UTC (rev 219915)
@@ -450,10 +450,7 @@
     // "Client"
     //    Relative to the visible part of the document (or, more strictly, the layout viewport rect), and with the same scaling
     //    as Document coordinates, i.e. matching CSS pixels. Affected by scroll origin.
-    //
-    // "LayoutViewport"
-    //    Similar to client coordinates, but affected by page zoom (but not page scale).
-    //
+    //    
 
     // Methods to convert points and rects between the coordinate space of the renderer, and this view.
     WEBCORE_EXPORT IntRect convertFromRendererToContainingView(const RenderElement*, const IntRect&) const;
@@ -477,12 +474,6 @@
     FloatRect documentToClientRect(FloatRect) const;
     FloatPoint documentToClientPoint(FloatPoint) const;
 
-    FloatRect layoutViewportToAbsoluteRect(FloatRect) const;
-    FloatPoint layoutViewportToAbsolutePoint(FloatPoint) const;
-
-    // Unlike client coordinates, layout viewport coordinates are affected by page zoom.
-    FloatPoint clientToLayoutViewportPoint(FloatPoint) const;
-
     bool isFrameViewScrollCorner(const RenderScrollbarPart& scrollCorner) const { return m_scrollCorner == &scrollCorner; }
 
     // isScrollable() takes an optional Scrollability parameter that allows the caller to define what they mean by 'scrollable.'

Modified: branches/safari-604-branch/Source/WebCore/rendering/RenderLayer.cpp (219914 => 219915)


--- branches/safari-604-branch/Source/WebCore/rendering/RenderLayer.cpp	2017-07-26 09:48:37 UTC (rev 219914)
+++ branches/safari-604-branch/Source/WebCore/rendering/RenderLayer.cpp	2017-07-26 09:51:15 UTC (rev 219915)
@@ -4924,17 +4924,9 @@
     
     updateLayerListsIfNeeded();
 
-    ASSERT(!isRenderFlowThread());
-    LayoutRect hitTestArea = renderer().view().documentRect();
-    if (!request.ignoreClipping()) {
-        if (renderer().settings().visualViewportEnabled()) {
-            auto& frameView = renderer().view().frameView();
-            LayoutRect layoutViewportBounds({ }, frameView.layoutViewportRect().size());
-            LayoutRect absoluteLayoutViewportRect = LayoutRect(frameView.layoutViewportToAbsoluteRect(layoutViewportBounds));
-            hitTestArea.intersect(absoluteLayoutViewportRect);
-        } else
-            hitTestArea.intersect(renderer().view().frameView().visibleContentRect(LegacyIOSDocumentVisibleRect));
-    }
+    LayoutRect hitTestArea = isOutOfFlowRenderFlowThread() ? downcast<RenderFlowThread>(renderer()).visualOverflowRect() : renderer().view().documentRect();
+    if (!request.ignoreClipping())
+        hitTestArea.intersect(renderer().view().frameView().visibleContentRect(LegacyIOSDocumentVisibleRect));
 
     RenderLayer* insideLayer = hitTestLayer(this, nullptr, request, result, hitTestArea, hitTestLocation, false);
     if (!insideLayer) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to