diff --git a/engine/core/dom/Element.cpp b/engine/core/dom/Element.cpp index e2b45d437138f616b91e361fff749a9b4cbb5aaf..62197c5a0f5db6c71d23edc6ef3f818bbddf39b5 100644 --- a/engine/core/dom/Element.cpp +++ b/engine/core/dom/Element.cpp @@ -461,14 +461,6 @@ int Element::scrollLeft() if (document().documentElement() != this) { if (RenderBox* rend = renderBox()) return adjustDoubleForAbsoluteZoom(rend->scrollLeft(), *rend); - return 0; - } - - if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) { - if (FrameView* view = document().view()) { - if (RenderView* renderView = document().renderView()) - return adjustDoubleForAbsoluteZoom(view->scrollX(), *renderView); - } } return 0; @@ -481,14 +473,6 @@ int Element::scrollTop() if (document().documentElement() != this) { if (RenderBox* rend = renderBox()) return adjustLayoutUnitForAbsoluteZoom(rend->scrollTop(), *rend); - return 0; - } - - if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) { - if (FrameView* view = document().view()) { - if (RenderView* renderView = document().renderView()) - return adjustDoubleForAbsoluteZoom(view->scrollY(), *renderView); - } } return 0; @@ -501,18 +485,6 @@ void Element::setScrollLeft(int newLeft) if (document().documentElement() != this) { if (RenderBox* rend = renderBox()) rend->setScrollLeft(LayoutUnit::fromFloatRound(newLeft * rend->style()->effectiveZoom())); - return; - } - - if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) { - LocalFrame* frame = document().frame(); - if (!frame) - return; - FrameView* view = frame->view(); - if (!view) - return; - - view->setScrollPosition(IntPoint(roundf(newLeft * frame->pageZoomFactor()), view->scrollY())); } } @@ -544,18 +516,6 @@ void Element::setScrollTop(int newTop) if (document().documentElement() != this) { if (RenderBox* rend = renderBox()) rend->setScrollTop(LayoutUnit::fromFloatRound(newTop * rend->style()->effectiveZoom())); - return; - } - - if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) { - LocalFrame* frame = document().frame(); - if (!frame) - return; - FrameView* view = frame->view(); - if (!view) - return; - - view->setScrollPosition(IntPoint(view->scrollX(), roundf(newTop * frame->pageZoomFactor()))); } } diff --git a/engine/core/dom/TreeScope.cpp b/engine/core/dom/TreeScope.cpp index 73b62d795164d385d7f1ea0ae981af7fd9c749c8..4c4c3d8fb07c8b02f6213fe5fa825e14ac844e61 100644 --- a/engine/core/dom/TreeScope.cpp +++ b/engine/core/dom/TreeScope.cpp @@ -209,7 +209,7 @@ HitTestResult hitTestInDocument(const Document* document, int x, int y) return HitTestResult(); float scaleFactor = frame->pageZoomFactor(); - IntPoint point = roundedIntPoint(FloatPoint(x * scaleFactor + frameView->scrollX(), y * scaleFactor + frameView->scrollY())); + IntPoint point = roundedIntPoint(FloatPoint(x * scaleFactor, y * scaleFactor)); if (!frameView->visibleContentRect().contains(point)) return HitTestResult(); diff --git a/engine/core/events/MouseRelatedEvent.cpp b/engine/core/events/MouseRelatedEvent.cpp index 9b7f32ec3a37666eff6bb73e64b3b17a7e226d55..5a4fae3a9a3cbbe35b43200ba73f0d9bc49803b1 100644 --- a/engine/core/events/MouseRelatedEvent.cpp +++ b/engine/core/events/MouseRelatedEvent.cpp @@ -38,20 +38,6 @@ MouseRelatedEvent::MouseRelatedEvent() { } -static LayoutSize contentsScrollOffset(AbstractView* abstractView) -{ - if (!abstractView) - return LayoutSize(); - LocalFrame* frame = abstractView->frame(); - if (!frame) - return LayoutSize(); - FrameView* frameView = frame->view(); - if (!frameView) - return LayoutSize(); - float scaleFactor = frame->pageZoomFactor(); - return LayoutSize(frameView->scrollX() / scaleFactor, frameView->scrollY() / scaleFactor); -} - MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr abstractView, int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, const IntPoint& movementDelta, @@ -99,7 +85,8 @@ void MouseRelatedEvent::initCoordinates(const LayoutPoint& clientLocation) // Set up initial values for coordinates. // Correct values are computed lazily, see computeRelativePosition. m_clientLocation = clientLocation; - m_pageLocation = clientLocation + contentsScrollOffset(view()); + // FIXME(sky): We don't need this anymore? + m_pageLocation = clientLocation; m_layerLocation = m_pageLocation; m_offsetLocation = m_pageLocation; diff --git a/engine/core/frame/FrameView.cpp b/engine/core/frame/FrameView.cpp index 3f15fe02ab11c2efc4c46ea24d44514739eb06ee..853fd3577f0e9efca135a7c8f38f9c1bc896592b 100644 --- a/engine/core/frame/FrameView.cpp +++ b/engine/core/frame/FrameView.cpp @@ -1385,11 +1385,6 @@ bool FrameView::isActive() const return page && page->focusController().isActive(); } -void FrameView::scrollTo(const IntSize& newOffset) -{ - // FIXME(sky): remove -} - void FrameView::invalidateScrollbarRect(Scrollbar*, const IntRect&) { // FIXME(sky): remove @@ -1713,12 +1708,7 @@ IntPoint FrameView::convertFromRenderer(const RenderObject& renderer, const IntP IntPoint FrameView::convertToRenderer(const RenderObject& renderer, const IntPoint& viewPoint) const { - IntPoint point = viewPoint; - - // Convert from FrameView coords into page ("absolute") coordinates. - point += IntSize(scrollX(), scrollY()); - - return roundedIntPoint(renderer.absoluteToLocal(point, UseTransforms)); + return roundedIntPoint(renderer.absoluteToLocal(viewPoint, UseTransforms)); } IntRect FrameView::convertToContainingView(const IntRect& localRect) const diff --git a/engine/core/frame/FrameView.h b/engine/core/frame/FrameView.h index f2bbeb6212da0f1bd7ba74cf5c42d40d87fd95be..5cbf41f1690085715e8d734f22cca2581a78c660 100644 --- a/engine/core/frame/FrameView.h +++ b/engine/core/frame/FrameView.h @@ -277,7 +277,6 @@ public: // FIXME(sky): Remove void invalidateScrollbarRect(Scrollbar*, const IntRect&); void getTickmarks(Vector&) const; - void scrollTo(const IntSize&); IntRect scrollableAreaBoundingBox() const; bool scrollAnimatorEnabled() const; bool usesCompositedScrolling() const; @@ -301,12 +300,6 @@ public: IntPoint maximumScrollPosition() const { return IntPoint(); } IntPoint scrollPosition() const { return IntPoint(); } bool scheduleAnimation(); - int scrollX() const { return 0; } - int scrollY() const { return 0; } - void scrollBy(const IntSize& s, ScrollBehavior behavior = ScrollBehaviorInstant) {} - void setScrollOffset(const IntPoint&) {} - // Scrollbar* horizontalScrollbar() const { return 0; } - // Scrollbar* verticalScrollbar() const { return 0; } IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollbars) const { return IntRect(IntPoint(), expandedIntSize(frameRect().size())); } IntSize unscaledVisibleContentSize(IncludeScrollbarsInRect = ExcludeScrollbars) const { return frameRect().size(); } IntPoint clampScrollPosition(const IntPoint& scrollPosition) const { return scrollPosition; } diff --git a/engine/core/frame/LocalDOMWindow.cpp b/engine/core/frame/LocalDOMWindow.cpp index 8e5a1d7f35ced136eeaf84bc89bd77b34ae18e39..ba106535bf4fcb23aa5f7329203852f389fd0d35 100644 --- a/engine/core/frame/LocalDOMWindow.cpp +++ b/engine/core/frame/LocalDOMWindow.cpp @@ -74,7 +74,7 @@ #include "core/page/EventHandler.h" #include "core/page/Page.h" #include "core/page/WindowFocusAllowedIndicator.h" -#include "core/page/scrolling/ScrollingCoordinator.h" +#include "core/rendering/style/RenderStyle.h" #include "platform/EventDispatchForbiddenScope.h" #include "platform/PlatformScreen.h" #include "platform/RuntimeEnabledFeatures.h" @@ -573,34 +573,6 @@ int LocalDOMWindow::screenY() const return static_cast(host->chrome().windowRect().y()); } -int LocalDOMWindow::scrollX() const -{ - if (!m_frame) - return 0; - - FrameView* view = m_frame->view(); - if (!view) - return 0; - - m_frame->document()->updateLayoutIgnorePendingStylesheets(); - - return adjustForAbsoluteZoom(view->scrollX(), m_frame->pageZoomFactor()); -} - -int LocalDOMWindow::scrollY() const -{ - if (!m_frame) - return 0; - - FrameView* view = m_frame->view(); - if (!view) - return 0; - - m_frame->document()->updateLayoutIgnorePendingStylesheets(); - - return adjustForAbsoluteZoom(view->scrollY(), m_frame->pageZoomFactor()); -} - LocalDOMWindow* LocalDOMWindow::window() const { if (!m_frame) @@ -652,54 +624,6 @@ double LocalDOMWindow::devicePixelRatio() const return m_frame->devicePixelRatio(); } -static bool scrollBehaviorFromScrollOptions(const Dictionary& scrollOptions, ScrollBehavior& scrollBehavior, ExceptionState& exceptionState) -{ - String scrollBehaviorString; - if (!DictionaryHelper::get(scrollOptions, "behavior", scrollBehaviorString)) { - scrollBehavior = ScrollBehaviorAuto; - return true; - } - - if (ScrollableArea::scrollBehaviorFromString(scrollBehaviorString, scrollBehavior)) - return true; - - exceptionState.throwTypeError("The ScrollBehavior provided is invalid."); - return false; -} - -void LocalDOMWindow::scrollBy(int x, int y, ScrollBehavior scrollBehavior) const -{ - // FIXME(sky): Remove -} - -void LocalDOMWindow::scrollBy(int x, int y, const Dictionary& scrollOptions, ExceptionState &exceptionState) const -{ - ScrollBehavior scrollBehavior = ScrollBehaviorAuto; - if (!scrollBehaviorFromScrollOptions(scrollOptions, scrollBehavior, exceptionState)) - return; - scrollBy(x, y, scrollBehavior); -} - -void LocalDOMWindow::scrollTo(int x, int y, ScrollBehavior scrollBehavior) const -{ - document()->updateLayoutIgnorePendingStylesheets(); - - RefPtr view = m_frame->view(); - if (!view) - return; - - IntPoint layoutPos(x * m_frame->pageZoomFactor(), y * m_frame->pageZoomFactor()); - view->setScrollPosition(layoutPos, scrollBehavior); -} - -void LocalDOMWindow::scrollTo(int x, int y, const Dictionary& scrollOptions, ExceptionState& exceptionState) const -{ - ScrollBehavior scrollBehavior = ScrollBehaviorAuto; - if (!scrollBehaviorFromScrollOptions(scrollOptions, scrollBehavior, exceptionState)) - return; - scrollTo(x, y, scrollBehavior); -} - void LocalDOMWindow::moveBy(float x, float y) const { if (!m_frame) diff --git a/engine/core/frame/LocalDOMWindow.h b/engine/core/frame/LocalDOMWindow.h index 6f13ae2b47f2fb7c202ac0eefb75751c10fbf002..e5ade0de6949c35b430a2759da0cf86330774fbd 100644 --- a/engine/core/frame/LocalDOMWindow.h +++ b/engine/core/frame/LocalDOMWindow.h @@ -35,7 +35,6 @@ #include "platform/LifecycleContext.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h" -#include "platform/scroll/ScrollableArea.h" #include "wtf/Forward.h" @@ -133,10 +132,6 @@ public: int screenY() const; int screenLeft() const { return screenX(); } int screenTop() const { return screenY(); } - int scrollX() const; - int scrollY() const; - int pageXOffset() const { return scrollX(); } - int pageYOffset() const { return scrollY(); } // FIXME(sky): keeping self for now since js-test.html uses it. LocalDOMWindow* window() const; @@ -164,13 +159,6 @@ public: void printErrorMessage(const String&); - void scrollBy(int x, int y, ScrollBehavior = ScrollBehaviorAuto) const; - void scrollBy(int x, int y, const Dictionary& scrollOptions, ExceptionState&) const; - void scrollTo(int x, int y, ScrollBehavior = ScrollBehaviorAuto) const; - void scrollTo(int x, int y, const Dictionary& scrollOptions, ExceptionState&) const; - void scroll(int x, int y) const { scrollTo(x, y); } - void scroll(int x, int y, const Dictionary& scrollOptions, ExceptionState& exceptionState) const { scrollTo(x, y, scrollOptions, exceptionState); } - void moveBy(float x, float y) const; void moveTo(float x, float y) const; diff --git a/engine/core/frame/Window.idl b/engine/core/frame/Window.idl index 11e7964b002f013ed53f2e95292e018eb0531cf3..cac410bc1bf7c98fee9eb5b985e22c38ab291524 100644 --- a/engine/core/frame/Window.idl +++ b/engine/core/frame/Window.idl @@ -59,19 +59,7 @@ [Replaceable] readonly attribute long screenY; [Replaceable] readonly attribute long screenLeft; [Replaceable] readonly attribute long screenTop; - [Replaceable] readonly attribute long scrollX; - [Replaceable] readonly attribute long scrollY; - readonly attribute long pageXOffset; - readonly attribute long pageYOffset; - - // Overloading can be replaced by optional if RuntimeEnabled is removed, by - // changing the third argument to *optional* Dictionary scrollOptions - void scrollBy(long x, long y); - [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollBy(long x, long y, Dictionary scrollOptions); - void scrollTo(long x, long y); - [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollTo(long x, long y, Dictionary scrollOptions); - void scroll(long x, long y); - [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scroll(long x, long y, Dictionary scrollOptions); + void moveBy([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats. void moveTo([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats. void resizeBy([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats. diff --git a/engine/core/rendering/RenderBox.cpp b/engine/core/rendering/RenderBox.cpp index 2924c5795d6dd024b23b106f03bb0816c8842359..93c9ec88a7b4c83d5c3f3c34c7da05e0ef94b84e 100644 --- a/engine/core/rendering/RenderBox.cpp +++ b/engine/core/rendering/RenderBox.cpp @@ -668,13 +668,6 @@ void RenderBox::scrollByRecursively(const IntSize& delta, ScrollOffsetClamping c if (frame && frame->page()) frame->page()->autoscrollController().updateAutoscrollRenderer(); } - } else if (view()->frameView()) { - // If we are here, we were called on a renderer that can be programmatically scrolled, but doesn't - // have an overflow clip. Which means that it is a document node that can be scrolled. - view()->frameView()->scrollBy(delta); - - // FIXME: If we didn't scroll the whole way, do we want to try looking at the frames ownerElement? - // https://bugs.webkit.org/show_bug.cgi?id=28237 } } diff --git a/engine/public/web/WebFrame.h b/engine/public/web/WebFrame.h index 451c570530faf2627f13e960af4d2c0d76520642..cc16bbdab65f87d2ae05a561d0ea193a3d5f8875 100644 --- a/engine/public/web/WebFrame.h +++ b/engine/public/web/WebFrame.h @@ -109,7 +109,6 @@ public: // The scroll offset from the top-left corner of the frame in pixels. virtual WebSize scrollOffset() const = 0; - virtual void setScrollOffset(const WebSize&) = 0; // The minimum and maxium scroll positions in pixels. virtual WebSize minimumScrollOffset() const = 0; diff --git a/engine/web/WebLocalFrameImpl.cpp b/engine/web/WebLocalFrameImpl.cpp index 7dc57625dcfd0c60d90e015ae645fecfe120bfa0..a90cb3f2a2fda1721f7053846462948f452b4143 100644 --- a/engine/web/WebLocalFrameImpl.cpp +++ b/engine/web/WebLocalFrameImpl.cpp @@ -252,12 +252,6 @@ WebSize WebLocalFrameImpl::maximumScrollOffset() const return toIntSize(view->maximumScrollPosition()); } -void WebLocalFrameImpl::setScrollOffset(const WebSize& offset) -{ - if (FrameView* view = frameView()) - view->setScrollOffset(IntPoint(offset.width, offset.height)); -} - WebSize WebLocalFrameImpl::contentsSize() const { return frame()->view()->size(); diff --git a/engine/web/WebLocalFrameImpl.h b/engine/web/WebLocalFrameImpl.h index b2d0c678cec88a8803882b2f89ae2b7372d6b971..1c0970afed56bc1b5253ccf2f25a398de67c17a7 100644 --- a/engine/web/WebLocalFrameImpl.h +++ b/engine/web/WebLocalFrameImpl.h @@ -64,7 +64,6 @@ public: virtual WebLocalFrame* toWebLocalFrame() override; virtual void close() override; virtual WebSize scrollOffset() const override; - virtual void setScrollOffset(const WebSize&) override; virtual WebSize minimumScrollOffset() const override; virtual WebSize maximumScrollOffset() const override; virtual WebSize contentsSize() const override; diff --git a/engine/web/WebViewImpl.cpp b/engine/web/WebViewImpl.cpp index ee8a6bf4ba1475616c1bf9cfacac4a6662f48869..57c8ec6f960504f60914d3afdd31441c76673f4e 100644 --- a/engine/web/WebViewImpl.cpp +++ b/engine/web/WebViewImpl.cpp @@ -252,6 +252,7 @@ bool WebViewImpl::handleMouseWheel(LocalFrame& mainFrame, const WebMouseWheelEve return PageWidgetEventHandler::handleMouseWheel(mainFrame, event); } +// FIXME(sky): This appears to be unused. bool WebViewImpl::scrollBy(const WebFloatSize& delta, const WebFloatSize& velocity) { if (m_flingSourceDevice == WebGestureDeviceTouchpad) { diff --git a/engine/web/tests/data/select_range_iframe_scroll.html b/engine/web/tests/data/select_range_iframe_scroll.html deleted file mode 100644 index fcd1ee294ee42cec9a950db1b685e4537d4e2dc1..0000000000000000000000000000000000000000 --- a/engine/web/tests/data/select_range_iframe_scroll.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -This is a test case for selecting a range within an iframe. - - - - diff --git a/engine/web/tests/data/select_range_scroll.html b/engine/web/tests/data/select_range_scroll.html deleted file mode 100644 index efa98a9d6f3f3b6997927825a2918f989208c7b3..0000000000000000000000000000000000000000 --- a/engine/web/tests/data/select_range_scroll.html +++ /dev/null @@ -1,15 +0,0 @@ - - - -
- Some offscreen test text for testing. -
- - - -