Unreviewed, rolling out r209299.
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Dec 2016 22:08:30 +0000 (22:08 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Dec 2016 22:08:30 +0000 (22:08 +0000)
This change appears to have caused LayoutTest failures on
Sierra WK1.

Reverted changeset:

"Improve the behavior of scroll-into-view when the target is
inside position:fixed"
https://bugs.webkit.org/show_bug.cgi?id=165354
http://trac.webkit.org/changeset/209299

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

27 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/overflow/scroll-anchor-in-position-fixed-expected.txt [deleted file]
LayoutTests/fast/overflow/scroll-anchor-in-position-fixed.html [deleted file]
LayoutTests/fast/transforms/selection-bounds-in-transformed-view.html
LayoutTests/fast/visual-viewport/zoomed-scroll-into-view-fixed-expected.txt [deleted file]
LayoutTests/fast/visual-viewport/zoomed-scroll-into-view-fixed.html [deleted file]
LayoutTests/fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed-expected.txt [deleted file]
LayoutTests/fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html [deleted file]
LayoutTests/platform/ios-simulator/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/editing/VisiblePosition.cpp
Source/WebCore/editing/VisiblePosition.h
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/editing/htmlediting.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/PrintContext.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrame.mm

index 10d76b9..165e137 100644 (file)
@@ -1,3 +1,17 @@
+2016-12-05  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r209299.
+
+        This change appears to have caused LayoutTest failures on
+        Sierra WK1.
+
+        Reverted changeset:
+
+        "Improve the behavior of scroll-into-view when the target is
+        inside position:fixed"
+        https://bugs.webkit.org/show_bug.cgi?id=165354
+        http://trac.webkit.org/changeset/209299
+
 2016-12-05  Dave Hyatt  <hyatt@apple.com>
 
         [CSS Parser] Fix column tests with illegal syntax
diff --git a/LayoutTests/fast/overflow/scroll-anchor-in-position-fixed-expected.txt b/LayoutTests/fast/overflow/scroll-anchor-in-position-fixed-expected.txt
deleted file mode 100644 (file)
index d040084..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Tests scrolling to an anchor inside position:fixed doesn't try to scroll the page
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.scrollingElement.scrollTop is 800
-PASS document.scrollingElement.scrollLeft is 100
-PASS successfullyParsed is true
-
-TEST COMPLETE
-Anchor is here
diff --git a/LayoutTests/fast/overflow/scroll-anchor-in-position-fixed.html b/LayoutTests/fast/overflow/scroll-anchor-in-position-fixed.html
deleted file mode 100644 (file)
index d4aa9db..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <style>
-        body {
-            height: 2000px;
-            width: 2000px;
-        }
-        
-        .fixed {
-            position: fixed;
-            top: 50px;
-            left: 40px;
-            border: 1px solid black;
-        }
-    </style>
-    <script src="../../resources/js-test-pre.js"></script>
-    <script>
-    description("Tests scrolling to an anchor inside position:fixed doesn't try to scroll the page");
-    window.jsTestIsAsync = true;
-
-    function runTest()
-    {
-        window.scrollTo(100, 800);
-        setTimeout(function() {
-            window.location='#anchor';
-            setTimeout(finishTest, 0);
-        }, 0);
-    }
-
-    function finishTest()
-    {
-        if (window.location.toString().indexOf("#") == -1) {
-            setTimeout(finishTest, 0);
-            return;
-        }
-        
-        shouldBe('document.scrollingElement.scrollTop', '800');
-        shouldBe('document.scrollingElement.scrollLeft', '100');
-
-        finishJSTest();
-    }
-    </script>
-</head>
-<body onload="runTest()">
-
-<div class="fixed">
-    <a name="anchor">Anchor is here</a>
-</div>
-
-<script src="../../resources/js-test-post.js"></script>
-
-</body></html>
index 01d9c39..c6e0f6f 100644 (file)
@@ -10,6 +10,6 @@
         }
 
         document.execCommand("FindString", false, "target");
-        document.getElementById("result").innerText = document.body.scrollTop === 937 ? "PASS" : "FAIL";
+        document.getElementById("result").innerText = document.body.scrollTop === 864 ? "PASS" : "FAIL";
     </script>
 </body>
diff --git a/LayoutTests/fast/visual-viewport/zoomed-scroll-into-view-fixed-expected.txt b/LayoutTests/fast/visual-viewport/zoomed-scroll-into-view-fixed-expected.txt
deleted file mode 100644 (file)
index 8095534..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-Tests revealing elements inside position:fixed after zooming.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Reveal "left-target"
-PASS document.scrollingElement.scrollTop is 838
-PASS document.scrollingElement.scrollLeft is 40
-
-Reveal "bottom-target"
-PASS document.scrollingElement.scrollTop is 1048
-PASS document.scrollingElement.scrollLeft is 40
-
-Reveal "right-target"
-PASS document.scrollingElement.scrollTop is 1086
-PASS document.scrollingElement.scrollLeft is 333
-
-Reveal "top-target"
-PASS document.scrollingElement.scrollTop is 834
-PASS document.scrollingElement.scrollLeft is 230
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/visual-viewport/zoomed-scroll-into-view-fixed.html b/LayoutTests/fast/visual-viewport/zoomed-scroll-into-view-fixed.html
deleted file mode 100644 (file)
index a6cb54b..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <style>
-        body {
-            height: 2000px;
-            width: 2000px;
-        }
-        
-        .fixed {
-            position: fixed;
-            top: 50px;
-            left: 40px;
-            height: 200px;
-            width: 200px;
-            background-color: rgba(0, 0, 0, 0.3);
-        }
-        
-        .fixed > div {
-            background-color: blue;
-            width: 20px;
-            height: 10px;
-            margin: 30px;
-        }
-        
-        .left, .right {
-            top: 500px;
-            width: 100px;
-        }
-
-        .top, .bottom {
-            left: 200px;
-            height: 100px;
-        }
-        
-        .left {
-            top: 300px;
-            left: 10px;
-        }
-
-        .right {
-            top: 300px;
-            left: auto;
-            right: 10px;
-        }
-
-        .top {
-            top: 11px;
-        }
-
-        .bottom {
-            top: auto;
-            bottom: 12px;
-        }
-    </style>
-    <script src="../../resources/js-test-pre.js"></script>
-    <script>
-
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
-    description("Tests revealing elements inside position:fixed after zooming.");
-
-    window.jsTestIsAsync = true;
-
-    function runTest()
-    {
-        if (window.eventSender)
-            eventSender.scalePageBy(2);
-
-        window.scrollTo(300, 800);
-
-        debug('Reveal "left-target"');
-        document.getElementById('left-target').scrollIntoView();
-        shouldBe('document.scrollingElement.scrollTop', '838');
-        shouldBe('document.scrollingElement.scrollLeft', '40');
-
-        debug('');
-        debug('Reveal "bottom-target"');
-        document.getElementById('bottom-target').scrollIntoView();
-        shouldBe('document.scrollingElement.scrollTop', '1048');
-        shouldBe('document.scrollingElement.scrollLeft', '40');
-
-        debug('');
-        debug('Reveal "right-target"');
-        document.getElementById('right-target').scrollIntoView();
-        shouldBe('document.scrollingElement.scrollTop', '1086');
-        shouldBe('document.scrollingElement.scrollLeft', '333');
-
-        debug('');
-        debug('Reveal "top-target"');
-        document.getElementById('top-target').scrollIntoView();
-        shouldBe('document.scrollingElement.scrollTop', '834');
-        shouldBe('document.scrollingElement.scrollLeft', '230');
-        
-        finishJSTest();
-    }
-    </script>
-</head>
-<body onload="runTest()">
-
-<div class="left fixed">
-    <div id="left-target"></div>
-</div>
-
-<div class="right fixed">
-    <div id="right-target"></div>
-</div>
-
-<div class="top fixed">
-    <div id="top-target"></div>
-</div>
-
-<div class="bottom fixed">
-    <div id="bottom-target"></div>
-</div>
-
-<script src="../../resources/js-test-post.js"></script>
-
-</body></html>
diff --git a/LayoutTests/fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed-expected.txt b/LayoutTests/fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed-expected.txt
deleted file mode 100644 (file)
index 48670cb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Tests scrolling to an anchor inside position:fixed after zooming doesn't try to scroll the page
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.scrollingElement.scrollTop is 559
-PASS document.scrollingElement.scrollLeft is 41
-PASS successfullyParsed is true
-
-TEST COMPLETE
-Anchor is here
diff --git a/LayoutTests/fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html b/LayoutTests/fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html
deleted file mode 100644 (file)
index ba24b91..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <style>
-        body {
-            height: 2000px;
-            width: 2000px;
-        }
-        
-        .fixed {
-            position: fixed;
-            top: 50px;
-            left: 40px;
-            border: 1px solid black;
-        }
-    </style>
-    <script src="../../resources/js-test-pre.js"></script>
-    <script>
-
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
-    description("Tests scrolling to an anchor inside position:fixed after zooming doesn't try to scroll the page");
-
-    window.jsTestIsAsync = true;
-
-    function runTest()
-    {
-        if (window.eventSender)
-            eventSender.scalePageBy(2);
-
-        window.scrollTo(300, 800);
-
-        setTimeout(function() {
-            window.location='#anchor';
-            setTimeout(finishTest, 0);
-        }, 0);
-    }
-
-    function finishTest()
-    {
-        if (window.location.toString().indexOf("#") == -1) {
-            setTimeout(finishTest, 0);
-            return;
-        }
-        
-        shouldBe('document.scrollingElement.scrollTop', '559');
-        shouldBe('document.scrollingElement.scrollLeft', '41');
-
-        finishJSTest();
-    }
-    </script>
-</head>
-<body onload="runTest()">
-
-<div class="fixed">
-    <a name="anchor">Anchor is here</a>
-</div>
-
-<script src="../../resources/js-test-post.js"></script>
-
-</body></html>
index f51ada4..f1bf501 100644 (file)
@@ -2767,5 +2767,3 @@ webkit.org/b/163046 js/regress-141098.html [ Pass Failure ]
 
 # Test relies on window.scrollTo
 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 ]
index ce4b47d..396a3a3 100644 (file)
@@ -1,3 +1,17 @@
+2016-12-05  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r209299.
+
+        This change appears to have caused LayoutTest failures on
+        Sierra WK1.
+
+        Reverted changeset:
+
+        "Improve the behavior of scroll-into-view when the target is
+        inside position:fixed"
+        https://bugs.webkit.org/show_bug.cgi?id=165354
+        http://trac.webkit.org/changeset/209299
+
 2016-12-05  Andreas Kling  <akling@apple.com>
 
         [Cocoa] Add some memory usage related information to sysdiagnose state dumps
index 4f46916..d8eaa22 100644 (file)
@@ -649,13 +649,12 @@ void Element::scrollIntoView(bool alignToTop)
     if (!renderer())
         return;
 
-    bool insideFixed;
-    LayoutRect absoluteBounds = renderer()->absoluteAnchorRect(&insideFixed);
+    LayoutRect bounds = renderer()->anchorRect();
     // Align to the top / bottom and to the closest edge.
     if (alignToTop)
-        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, absoluteBounds, insideFixed, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);
+        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);
     else
-        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, absoluteBounds, insideFixed, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignBottomAlways);
+        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignBottomAlways);
 }
 
 void Element::scrollIntoViewIfNeeded(bool centerIfNeeded)
@@ -665,12 +664,11 @@ void Element::scrollIntoViewIfNeeded(bool centerIfNeeded)
     if (!renderer())
         return;
 
-    bool insideFixed;
-    LayoutRect absoluteBounds = renderer()->absoluteAnchorRect(&insideFixed);
+    LayoutRect bounds = renderer()->anchorRect();
     if (centerIfNeeded)
-        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, absoluteBounds, insideFixed, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded);
+        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded);
     else
-        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, absoluteBounds, insideFixed, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
+        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
 }
 
 void Element::scrollIntoViewIfNotVisible(bool centerIfNotVisible)
@@ -680,12 +678,11 @@ void Element::scrollIntoViewIfNotVisible(bool centerIfNotVisible)
     if (!renderer())
         return;
     
-    bool insideFixed;
-    LayoutRect absoluteBounds = renderer()->absoluteAnchorRect(&insideFixed);
+    LayoutRect bounds = renderer()->anchorRect();
     if (centerIfNotVisible)
-        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, absoluteBounds, insideFixed, ScrollAlignment::alignCenterIfNotVisible, ScrollAlignment::alignCenterIfNotVisible);
+        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignCenterIfNotVisible, ScrollAlignment::alignCenterIfNotVisible);
     else
-        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, absoluteBounds, insideFixed, ScrollAlignment::alignToEdgeIfNotVisible, ScrollAlignment::alignToEdgeIfNotVisible);
+        renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, bounds, ScrollAlignment::alignToEdgeIfNotVisible, ScrollAlignment::alignToEdgeIfNotVisible);
 }
 
 void Element::scrollBy(const ScrollToOptions& options)
@@ -2429,11 +2426,8 @@ void Element::updateFocusAppearance(SelectionRestorationMode, SelectionRevealMod
             frame->selection().setSelection(newSelection, FrameSelection::defaultSetSelectionOptions(), Element::defaultFocusTextStateChangeIntent());
             frame->selection().revealSelection(revealMode);
         }
-    } else if (renderer() && !renderer()->isWidget()) {
-        bool insideFixed;
-        LayoutRect absoluteBounds = renderer()->absoluteAnchorRect(&insideFixed);
-        renderer()->scrollRectToVisible(revealMode, absoluteBounds, insideFixed);
-    }
+    } else if (renderer() && !renderer()->isWidget())
+        renderer()->scrollRectToVisible(revealMode, renderer()->anchorRect());
 }
 
 void Element::blur()
index 6759ff1..3561749 100644 (file)
@@ -112,7 +112,6 @@ FrameSelection::FrameSelection(Frame* frame)
     , m_xPosForVerticalArrowNavigation(NoXPosForVerticalArrowNavigation())
     , m_granularity(CharacterGranularity)
     , m_caretBlinkTimer(*this, &FrameSelection::caretBlinkTimerFired)
-    , m_caretInsidePositionFixed(false)
     , m_absCaretBoundsDirty(true)
     , m_caretPaint(true)
     , m_isCaretBlinkingSuspended(false)
@@ -1578,14 +1577,12 @@ static bool isNonOrphanedCaret(const VisibleSelection& selection)
     return selection.isCaret() && !selection.start().isOrphan() && !selection.end().isOrphan();
 }
 
-IntRect FrameSelection::absoluteCaretBounds(bool* insideFixed)
+IntRect FrameSelection::absoluteCaretBounds()
 {
     if (!m_frame)
         return IntRect();
     updateSelectionByUpdatingLayoutOrStyle(*m_frame);
     recomputeCaretRect();
-    if (insideFixed)
-        *insideFixed = m_caretInsidePositionFixed;
     return m_absCaretBounds;
 }
 
@@ -1627,9 +1624,7 @@ bool FrameSelection::recomputeCaretRect()
         return false;
 
     IntRect oldAbsCaretBounds = m_absCaretBounds;
-    bool isInsideFixed;
-    m_absCaretBounds = absoluteBoundsForLocalCaretRect(rendererForCaretPainting(caretNode.get()), newRect, &isInsideFixed);
-    m_caretInsidePositionFixed = isInsideFixed;
+    m_absCaretBounds = absoluteBoundsForLocalCaretRect(rendererForCaretPainting(caretNode.get()), newRect);
 
     if (m_absCaretBoundsDirty && m_selection.isCaret()) // We should be able to always assert this condition.
         ASSERT(m_absCaretBounds == m_selection.visibleStart().absoluteCaretBounds());
@@ -2305,12 +2300,12 @@ void FrameSelection::revealSelection(SelectionRevealMode revealMode, const Scrol
         return;
 
     LayoutRect rect;
-    bool insideFixed = false;
+
     switch (m_selection.selectionType()) {
     case VisibleSelection::NoSelection:
         return;
     case VisibleSelection::CaretSelection:
-        rect = absoluteCaretBounds(&insideFixed);
+        rect = absoluteCaretBounds();
         break;
     case VisibleSelection::RangeSelection:
         rect = revealExtentOption == RevealExtent ? VisiblePosition(m_selection.extent()).absoluteCaretBounds() : enclosingIntRect(selectionBounds(false));
@@ -2324,7 +2319,7 @@ void FrameSelection::revealSelection(SelectionRevealMode revealMode, const Scrol
         if (RenderLayer* layer = start.deprecatedNode()->renderer()->enclosingLayer()) {
             if (!m_scrollingSuppressCount) {
                 layer->setAdjustForIOSCaretWhenScrolling(true);
-                layer->scrollRectToVisible(revealMode, rect, insideFixed, alignment, alignment);
+                layer->scrollRectToVisible(revealMode, rect, alignment, alignment);
                 layer->setAdjustForIOSCaretWhenScrolling(false);
                 updateAppearance();
                 if (m_frame->page())
@@ -2335,7 +2330,7 @@ void FrameSelection::revealSelection(SelectionRevealMode revealMode, const Scrol
         // FIXME: This code only handles scrolling the startContainer's layer, but
         // the selection rect could intersect more than just that.
         // See <rdar://problem/4799899>.
-        if (start.deprecatedNode()->renderer()->scrollRectToVisible(revealMode, rect, insideFixed, alignment, alignment))
+        if (start.deprecatedNode()->renderer()->scrollRectToVisible(revealMode, rect, alignment, alignment))
             updateAppearance();
 #endif
     }
index db28ce6..150473a 100644 (file)
@@ -173,7 +173,7 @@ public:
     RenderBlock* caretRendererWithoutUpdatingLayout() const;
 
     // Bounds of (possibly transformed) caret in absolute coords
-    WEBCORE_EXPORT IntRect absoluteCaretBounds(bool* insideFixed = nullptr);
+    WEBCORE_EXPORT IntRect absoluteCaretBounds();
     void setCaretRectNeedsUpdate() { CaretBase::setCaretRectNeedsUpdate(); }
 
     void willBeModified(EAlteration, SelectionDirection);
@@ -336,7 +336,6 @@ private:
     Timer m_caretBlinkTimer;
     // The painted bounds of the caret in absolute coordinates
     IntRect m_absCaretBounds;
-    bool m_caretInsidePositionFixed : 1;
     bool m_absCaretBoundsDirty : 1;
     bool m_caretPaint : 1;
     bool m_isCaretBlinkingSuspended : 1;
index bda4a14..819a6d3 100644 (file)
@@ -660,11 +660,11 @@ LayoutRect VisiblePosition::localCaretRect(RenderObject*& renderer) const
     return renderer->localCaretRect(inlineBox, caretOffset);
 }
 
-IntRect VisiblePosition::absoluteCaretBounds(bool* insideFixed) const
+IntRect VisiblePosition::absoluteCaretBounds() const
 {
     RenderBlock* renderer = nullptr;
     LayoutRect localRect = localCaretRectInRendererForCaretPainting(*this, renderer);
-    return absoluteBoundsForLocalCaretRect(renderer, localRect, insideFixed);
+    return absoluteBoundsForLocalCaretRect(renderer, localRect);
 }
 
 int VisiblePosition::lineDirectionPointForBlockDirectionNavigation() const
index 3b92735..4094d84 100644 (file)
@@ -95,7 +95,7 @@ public:
     // Rect is local to the returned renderer
     WEBCORE_EXPORT LayoutRect localCaretRect(RenderObject*&) const;
     // Bounds of (possibly transformed) caret in absolute coords
-    WEBCORE_EXPORT IntRect absoluteCaretBounds(bool* insideFixed = nullptr) const;
+    WEBCORE_EXPORT IntRect absoluteCaretBounds() const;
     // Abs x/y position of the caret ignoring transforms.
     // FIXME: navigation with transforms should be smarter.
     WEBCORE_EXPORT int lineDirectionPointForBlockDirectionNavigation() const;
index a7befcd..5d85573 100644 (file)
@@ -1290,14 +1290,14 @@ LayoutRect localCaretRectInRendererForRect(LayoutRect& localRect, Node* node, Re
     return localRect;
 }
 
-IntRect absoluteBoundsForLocalCaretRect(RenderBlock* rendererForCaretPainting, const LayoutRect& rect, bool* insideFixed)
+IntRect absoluteBoundsForLocalCaretRect(RenderBlock* rendererForCaretPainting, const LayoutRect& rect)
 {
     if (!rendererForCaretPainting || rect.isEmpty())
         return IntRect();
 
     LayoutRect localRect(rect);
     rendererForCaretPainting->flipForWritingMode(localRect);
-    return rendererForCaretPainting->localToAbsoluteQuad(FloatRect(localRect), UseTransforms, insideFixed).enclosingBoundingBox();
+    return rendererForCaretPainting->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
 }
 
 } // namespace WebCore
index 5bf936a..d8a23dd 100644 (file)
@@ -200,7 +200,7 @@ const String& nonBreakingSpaceString();
 RenderBlock* rendererForCaretPainting(Node*);
 LayoutRect localCaretRectInRendererForCaretPainting(const VisiblePosition&, RenderBlock*&);
 LayoutRect localCaretRectInRendererForRect(LayoutRect&, Node*, RenderObject*, RenderBlock*&);
-IntRect absoluteBoundsForLocalCaretRect(RenderBlock* rendererForCaretPainting, const LayoutRect&, bool* insideFixed = nullptr);
+IntRect absoluteBoundsForLocalCaretRect(RenderBlock* rendererForCaretPainting, const LayoutRect&);
 
 // -------------------------------------------------------------------------
 
index 8061b75..59096dd 100644 (file)
@@ -2351,7 +2351,7 @@ void FrameView::scrollElementToRect(const Element& element, const IntRect& rect)
 
     LayoutRect bounds;
     if (RenderElement* renderer = element.renderer())
-        bounds = renderer->absoluteAnchorRect();
+        bounds = renderer->anchorRect();
     int centeringOffsetX = (rect.width() - bounds.width()) / 2;
     int centeringOffsetY = (rect.height() - bounds.height()) / 2;
     setScrollPosition(IntPoint(bounds.x() - centeringOffsetX - rect.x(), bounds.y() - centeringOffsetY - rect.y()));
@@ -3271,18 +3271,17 @@ void FrameView::scrollToAnchor()
         return;
 
     LayoutRect rect;
-    bool insideFixed = false;
     if (anchorNode != frame().document() && anchorNode->renderer())
-        rect = anchorNode->renderer()->absoluteAnchorRect(&insideFixed);
+        rect = anchorNode->renderer()->anchorRect();
 
     // Scroll nested layers and frames to reveal the anchor.
     // Align to the top and to the closest side (this matches other browsers).
     if (anchorNode->renderer()->style().isHorizontalWritingMode())
-        anchorNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, rect, insideFixed, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);
+        anchorNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, rect, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);
     else if (anchorNode->renderer()->style().isFlippedBlocksWritingMode())
-        anchorNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, rect, insideFixed, ScrollAlignment::alignRightAlways, ScrollAlignment::alignToEdgeIfNeeded);
+        anchorNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, rect, ScrollAlignment::alignRightAlways, ScrollAlignment::alignToEdgeIfNeeded);
     else
-        anchorNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, rect, insideFixed, ScrollAlignment::alignLeftAlways, ScrollAlignment::alignToEdgeIfNeeded);
+        anchorNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, rect, ScrollAlignment::alignLeftAlways, ScrollAlignment::alignToEdgeIfNeeded);
 
     if (AXObjectCache* cache = frame().document()->existingAXObjectCache())
         cache->handleScrolledToAnchor(anchorNode.get());
index 3176ebd..38ca683 100644 (file)
@@ -274,7 +274,7 @@ void PrintContext::outputLinkedDestinations(GraphicsContext& graphicsContext, Do
         if (!renderer)
             continue;
 
-        FloatPoint point = renderer->absoluteAnchorRect().minXMinYCorner();
+        FloatPoint point = renderer->anchorRect().minXMinYCorner();
         point.expandedTo(FloatPoint());
 
         if (!pageRect.contains(roundedIntPoint(point)))
index 9144810..fc37d77 100644 (file)
@@ -1625,10 +1625,10 @@ Color RenderElement::selectionBackgroundColor() const
     return theme().inactiveSelectionBackgroundColor();
 }
 
-bool RenderElement::getLeadingCorner(FloatPoint& point, bool& insideFixed) const
+bool RenderElement::getLeadingCorner(FloatPoint& point) const
 {
     if (!isInline() || isReplaced()) {
-        point = localToAbsolute(FloatPoint(), UseTransforms, &insideFixed);
+        point = localToAbsolute(FloatPoint(), UseTransforms);
         return true;
     }
 
@@ -1654,7 +1654,7 @@ bool RenderElement::getLeadingCorner(FloatPoint& point, bool& insideFixed) const
         ASSERT(o);
 
         if (!o->isInline() || o->isReplaced()) {
-            point = o->localToAbsolute(FloatPoint(), UseTransforms, &insideFixed);
+            point = o->localToAbsolute(FloatPoint(), UseTransforms);
             return true;
         }
 
@@ -1666,7 +1666,7 @@ bool RenderElement::getLeadingCorner(FloatPoint& point, bool& insideFixed) const
                 point.move(downcast<RenderText>(*o).linesBoundingBox().x(), downcast<RenderText>(*o).topOfFirstText());
             else if (is<RenderBox>(*o))
                 point.moveBy(downcast<RenderBox>(*o).location());
-            point = o->container()->localToAbsolute(point, UseTransforms, &insideFixed);
+            point = o->container()->localToAbsolute(point, UseTransforms);
             return true;
         }
     }
@@ -1680,10 +1680,10 @@ bool RenderElement::getLeadingCorner(FloatPoint& point, bool& insideFixed) const
     return false;
 }
 
-bool RenderElement::getTrailingCorner(FloatPoint& point, bool& insideFixed) const
+bool RenderElement::getTrailingCorner(FloatPoint& point) const
 {
     if (!isInline() || isReplaced()) {
-        point = localToAbsolute(LayoutPoint(downcast<RenderBox>(*this).size()), UseTransforms, &insideFixed);
+        point = localToAbsolute(LayoutPoint(downcast<RenderBox>(*this).size()), UseTransforms);
         return true;
     }
 
@@ -1714,20 +1714,18 @@ bool RenderElement::getTrailingCorner(FloatPoint& point, bool& insideFixed) cons
                 point.moveBy(linesBox.maxXMaxYCorner());
             } else
                 point.moveBy(downcast<RenderBox>(*o).frameRect().maxXMaxYCorner());
-            point = o->container()->localToAbsolute(point, UseTransforms, &insideFixed);
+            point = o->container()->localToAbsolute(point, UseTransforms);
             return true;
         }
     }
     return true;
 }
 
-LayoutRect RenderElement::absoluteAnchorRect(bool* insideFixed) const
+LayoutRect RenderElement::anchorRect() const
 {
     FloatPoint leading, trailing;
-    bool leadingInFixed = false;
-    bool trailingInFixed = false;
-    getLeadingCorner(leading, leadingInFixed);
-    getTrailingCorner(trailing, trailingInFixed);
+    getLeadingCorner(leading);
+    getTrailingCorner(trailing);
 
     FloatPoint upperLeft = leading;
     FloatPoint lowerRight = trailing;
@@ -1738,11 +1736,6 @@ LayoutRect RenderElement::absoluteAnchorRect(bool* insideFixed) const
         lowerRight = FloatPoint(std::max(leading.x(), trailing.x()), std::max(leading.y(), trailing.y()));
     } // Otherwise, it's not obvious what to do.
 
-    if (insideFixed) {
-        // For now, just look at the leading corner. Handling one inside fixed and one not would be tricky.
-        *insideFixed = leadingInFixed;
-    }
-
     return enclosingLayoutRect(FloatRect(upperLeft, lowerRight.expandedTo(upperLeft) - upperLeft));
 }
 
index e1c693b..230c1c7 100644 (file)
@@ -164,7 +164,7 @@ public:
     // anchorRect() is conceptually similar to absoluteBoundingBoxRect(), but is intended for scrolling to an anchor.
     // For inline renderers, this gets the logical top left of the first leaf child and the logical bottom right of the
     // last leaf child, converts them to absolute coordinates, and makes a box out of them.
-    LayoutRect absoluteAnchorRect(bool* insideFixed = nullptr) const;
+    LayoutRect anchorRect() const;
 
     bool hasFilter() const { return style().hasFilter(); }
     bool hasBackdropFilter() const
@@ -307,8 +307,8 @@ private:
 
     void newImageAnimationFrameAvailable(CachedImage&) final;
 
-    bool getLeadingCorner(FloatPoint& output, bool& insideFixed) const;
-    bool getTrailingCorner(FloatPoint& output, bool& insideFixed) const;
+    bool getLeadingCorner(FloatPoint& output) const;
+    bool getTrailingCorner(FloatPoint& output) const;
 
     void clearLayoutRootIfNeeded() const;
     
index ef7075d..26a2e77 100644 (file)
@@ -2506,12 +2506,12 @@ bool RenderLayer::allowsCurrentScroll() const
     return box->hasHorizontalOverflow() || box->hasVerticalOverflow();
 }
 
-void RenderLayer::scrollRectToVisible(SelectionRevealMode revealMode, const LayoutRect& absoluteRect, bool insideFixed, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
+void RenderLayer::scrollRectToVisible(SelectionRevealMode revealMode, const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
 {
-    LOG_WITH_STREAM(Scrolling, stream << "Layer " << this << " scrollRectToVisible " << absoluteRect);
+    LOG_WITH_STREAM(Scrolling, stream << "Layer " << this << " scrollRectToVisible " << rect);
 
     RenderLayer* parentLayer = nullptr;
-    LayoutRect newRect = absoluteRect;
+    LayoutRect newRect = rect;
 
     // We may end up propagating a scroll event. It is important that we suspend events until 
     // the end of the function since they could delete the layer or the layer's renderer().
@@ -2525,11 +2525,11 @@ void RenderLayer::scrollRectToVisible(SelectionRevealMode revealMode, const Layo
         // This will prevent us from revealing text hidden by the slider in Safari RSS.
         RenderBox* box = renderBox();
         ASSERT(box);
-        LayoutRect localExposeRect(box->absoluteToLocalQuad(FloatQuad(FloatRect(absoluteRect))).boundingBox());
+        LayoutRect localExposeRect(box->absoluteToLocalQuad(FloatQuad(FloatRect(rect))).boundingBox());
         LayoutRect layerBounds(0, 0, box->clientWidth(), box->clientHeight());
-        LayoutRect revealRect = getRectToExpose(layerBounds, layerBounds, localExposeRect, insideFixed, alignX, alignY);
+        LayoutRect r = getRectToExpose(layerBounds, layerBounds, localExposeRect, alignX, alignY);
 
-        ScrollOffset clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(revealRect).location()));
+        ScrollOffset clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(r).location()));
         if (clampedScrollOffset != scrollOffset()) {
             ScrollOffset oldScrollOffset = scrollOffset();
             scrollToOffset(clampedScrollOffset);
@@ -2551,7 +2551,7 @@ void RenderLayer::scrollRectToVisible(SelectionRevealMode revealMode, const Layo
                 NoEventDispatchAssertion assertNoEventDispatch;
 
                 LayoutRect viewRect = frameView.visibleContentRect(LegacyIOSDocumentVisibleRect);
-                LayoutRect exposeRect = getRectToExpose(viewRect, viewRect, absoluteRect, insideFixed, alignX, alignY);
+                LayoutRect exposeRect = getRectToExpose(viewRect, viewRect, rect, alignX, alignY);
 
                 IntPoint scrollOffset(roundedIntPoint(exposeRect.location()));
                 // Adjust offsets if they're outside of the allowable range.
@@ -2562,7 +2562,6 @@ void RenderLayer::scrollRectToVisible(SelectionRevealMode revealMode, const Layo
                     parentLayer = ownerElement->renderer()->enclosingLayer();
                     // Convert the rect into the coordinate space of the parent frame's document.
                     newRect = frameView.contentsToContainingViewContents(enclosingIntRect(newRect));
-                    insideFixed = false; // FIXME: ideally need to determine if this <iframe> is inside position:fixed.
                 } else
                     parentLayer = nullptr;
             }
@@ -2572,17 +2571,16 @@ void RenderLayer::scrollRectToVisible(SelectionRevealMode revealMode, const Layo
 
 #if !PLATFORM(IOS)
             LayoutRect viewRect = frameView.visibleContentRect();
-            viewRect.scale(1 / frameView.frameScaleFactor());
-
             LayoutRect visibleRectRelativeToDocument = viewRect;
             visibleRectRelativeToDocument.setLocation(frameView.documentScrollPositionRelativeToScrollableAreaOrigin());
 #else
             LayoutRect viewRect = frameView.unobscuredContentRect();
             LayoutRect visibleRectRelativeToDocument = viewRect;
 #endif
-            LayoutRect revealRect = getRectToExpose(viewRect, visibleRectRelativeToDocument, absoluteRect, insideFixed, alignX, alignY);
+
+            LayoutRect r = getRectToExpose(viewRect, visibleRectRelativeToDocument, rect, alignX, alignY);
                 
-            frameView.setScrollPosition(roundedIntPoint(revealRect.location()));
+            frameView.setScrollPosition(roundedIntPoint(r.location()));
 
             // This is the outermost view of a web page, so after scrolling this view we
             // scroll its container by calling Page::scrollRectIntoView.
@@ -2590,12 +2588,12 @@ void RenderLayer::scrollRectToVisible(SelectionRevealMode revealMode, const Layo
             // that put web views into scrolling containers, such as Mac OS X Mail.
             // The canAutoscroll function in EventHandler also knows about this.
             if (Page* page = frameView.frame().page())
-                page->chrome().scrollRectIntoView(snappedIntRect(absoluteRect));
+                page->chrome().scrollRectIntoView(snappedIntRect(rect));
         }
     }
     
     if (parentLayer)
-        parentLayer->scrollRectToVisible(revealMode, newRect, insideFixed, alignX, alignY);
+        parentLayer->scrollRectToVisible(revealMode, newRect, alignX, alignY);
 }
 
 void RenderLayer::updateCompositingLayersAfterScroll()
@@ -2612,35 +2610,8 @@ void RenderLayer::updateCompositingLayersAfterScroll()
     }
 }
 
-LayoutRect RenderLayer::getRectToExpose(const LayoutRect &visibleRect, const LayoutRect &visibleRectRelativeToDocument, const LayoutRect &exposeRect, bool insideFixed, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
+LayoutRect RenderLayer::getRectToExpose(const LayoutRect &visibleRect, const LayoutRect &visibleRectRelativeToDocument, const LayoutRect &exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
 {
-    FrameView& frameView = renderer().view().frameView();
-    if (insideFixed) {
-        // If the element is inside position:fixed and we're not scaled, no amount of scrolling is going to move things around.
-        if (frameView.frameScaleFactor() == 1)
-            return visibleRect;
-
-        if (frameView.frame().settings().visualViewportEnabled()) {
-            // exposeRect is in absolute coords, affected by page scale. Unscale it.
-            LayoutRect unscaledExposeRect = exposeRect;
-            unscaledExposeRect.scale(1 / frameView.frameScaleFactor());
-            // These are both in unscaled coordinates.
-            LayoutRect layoutViewport = frameView.layoutViewportRect();
-            LayoutRect visualViewport = frameView.visualViewportRect();
-
-            // The rect to expose may be partially offscreen, which we can't do anything about with position:fixed.
-            unscaledExposeRect.intersect(layoutViewport);
-            // Make sure it's not larger than the visual viewport; if so, we'll just move to the top left.
-            unscaledExposeRect.setSize(unscaledExposeRect.size().shrunkTo(visualViewport.size()));
-
-            // Compute how much we have to move the visualViewport to reveal the part of the layoutViewport that contains exposeRect.
-            LayoutRect requiredVisualViewport = getRectToExpose(visualViewport, visualViewport, unscaledExposeRect, false, alignX, alignY);
-            // Scale it back up.
-            requiredVisualViewport.scale(frameView.frameScaleFactor());
-            return requiredVisualViewport;
-        }
-    }
-
     // Determine the appropriate X behavior.
     ScrollAlignment::Behavior scrollX;
     LayoutRect exposeRectX(exposeRect.x(), visibleRect.y(), exposeRect.width(), visibleRect.height());
@@ -2715,7 +2686,7 @@ LayoutRect RenderLayer::getRectToExpose(const LayoutRect &visibleRect, const Lay
 void RenderLayer::autoscroll(const IntPoint& position)
 {
     IntPoint currentDocumentPosition = renderer().view().frameView().windowToContents(position);
-    scrollRectToVisible(SelectionRevealMode::Reveal, LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), false, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
+    scrollRectToVisible(SelectionRevealMode::Reveal, LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
 }
 
 bool RenderLayer::canResize() const
index 159aef6..3bcb57a 100644 (file)
@@ -204,9 +204,9 @@ public:
 
     void availableContentSizeChanged(AvailableSizeChangeReason) override;
 
-    void scrollRectToVisible(SelectionRevealMode, const LayoutRect& absoluteRect, bool insideFixed, const ScrollAlignment& alignX, const ScrollAlignment& alignY);
+    void scrollRectToVisible(SelectionRevealMode, const LayoutRect&, const ScrollAlignment& alignX, const ScrollAlignment& alignY);
 
-    LayoutRect getRectToExpose(const LayoutRect& visibleRect, const LayoutRect& visibleRectRelativeToDocument, const LayoutRect& exposeRect, bool insideFixed, const ScrollAlignment& alignX, const ScrollAlignment& alignY);
+    LayoutRect getRectToExpose(const LayoutRect& visibleRect, const LayoutRect& visibleRectRelativeToDocument, const LayoutRect& exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY);
 
     bool scrollsOverflow() const;
     bool hasScrollbars() const { return m_hBar || m_vBar; }
index e3638a5..61efd14 100644 (file)
@@ -396,7 +396,7 @@ RenderLayer* RenderObject::enclosingLayer() const
     return nullptr;
 }
 
-bool RenderObject::scrollRectToVisible(SelectionRevealMode revealMode, const LayoutRect& absoluteRect, bool insideFixed, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
+bool RenderObject::scrollRectToVisible(SelectionRevealMode revealMode, const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
 {
     if (revealMode == SelectionRevealMode::DoNotReveal)
         return false;
@@ -405,7 +405,7 @@ bool RenderObject::scrollRectToVisible(SelectionRevealMode revealMode, const Lay
     if (!enclosingLayer)
         return false;
 
-    enclosingLayer->scrollRectToVisible(revealMode, absoluteRect, insideFixed, alignX, alignY);
+    enclosingLayer->scrollRectToVisible(revealMode, rect, alignX, alignY);
     return true;
 }
 
index 1a67271..88da92d 100644 (file)
@@ -154,7 +154,7 @@ public:
     WEBCORE_EXPORT RenderLayer* enclosingLayer() const;
 
     // Scrolling is a RenderBox concept, however some code just cares about recursively scrolling our enclosing ScrollableArea(s).
-    WEBCORE_EXPORT bool scrollRectToVisible(SelectionRevealMode, const LayoutRect& absoluteRect, bool insideFixed, const ScrollAlignment& alignX = ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlignment::alignCenterIfNeeded);
+    WEBCORE_EXPORT bool scrollRectToVisible(SelectionRevealMode, const LayoutRect&, const ScrollAlignment& alignX = ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlignment::alignCenterIfNeeded);
 
     // Convenience function for getting to the nearest enclosing box of a RenderObject.
     WEBCORE_EXPORT RenderBox& enclosingBox() const;
index ec1592c..4ded13c 100644 (file)
@@ -1,3 +1,17 @@
+2016-12-05  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r209299.
+
+        This change appears to have caused LayoutTest failures on
+        Sierra WK1.
+
+        Reverted changeset:
+
+        "Improve the behavior of scroll-into-view when the target is
+        inside position:fixed"
+        https://bugs.webkit.org/show_bug.cgi?id=165354
+        http://trac.webkit.org/changeset/209299
+
 2016-12-02  Simon Fraser  <simon.fraser@apple.com>
 
         Improve the behavior of scroll-into-view when the target is inside position:fixed
index 9a80950..9fab5d5 100644 (file)
@@ -711,18 +711,17 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
 
 - (void)_scrollDOMRangeToVisible:(DOMRange *)range
 {
-    bool insideFixed = false; // FIXME: get via firstRectForRange().
     NSRect rangeRect = [self _firstRectForDOMRange:range];    
     Node *startNode = core([range startContainer]);
         
     if (startNode && startNode->renderer()) {
 #if !PLATFORM(IOS)
-        startNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, enclosingIntRect(rangeRect), insideFixed, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
+        startNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, enclosingIntRect(rangeRect), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
 #else
         RenderLayer* layer = startNode->renderer()->enclosingLayer();
         if (layer) {
             layer->setAdjustForIOSCaretWhenScrolling(true);
-            startNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, enclosingIntRect(rangeRect), insideFixed, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
+            startNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, enclosingIntRect(rangeRect), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
             layer->setAdjustForIOSCaretWhenScrolling(false);
             _private->coreFrame->selection().setCaretRectNeedsUpdate();
             _private->coreFrame->selection().updateAppearance();
@@ -734,7 +733,6 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
 #if PLATFORM(IOS)
 - (void)_scrollDOMRangeToVisible:(DOMRange *)range withInset:(CGFloat)inset
 {
-    bool insideFixed = false; // FIXME: get via firstRectForRange().
     NSRect rangeRect = NSInsetRect([self _firstRectForDOMRange:range], inset, inset);
     Node *startNode = core([range startContainer]);
 
@@ -742,7 +740,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
         RenderLayer* layer = startNode->renderer()->enclosingLayer();
         if (layer) {
             layer->setAdjustForIOSCaretWhenScrolling(true);
-            startNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, enclosingIntRect(rangeRect), insideFixed, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
+            startNode->renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, enclosingIntRect(rangeRect), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
             layer->setAdjustForIOSCaretWhenScrolling(false);
 
             Frame *coreFrame = core(self);