WebKit Bugzilla
Attachment 349174 Details for
Bug 182230
: [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-182230-20180907211119.patch (text/plain), 55.40 KB, created by
Frédéric Wang (:fredw)
on 2018-09-07 12:11:21 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-09-07 12:11:21 PDT
Size:
55.40 KB
patch
obsolete
>Subversion Revision: 235789 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 71e1bdc3c7c5212cca4a0c8818675762a298ad36..e0fb0bd52eb896f4407ae6f4aef408553272739c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,46 @@ >+2018-09-07 Frederic Wang <fwang@igalia.com> >+ >+ [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To) >+ https://bugs.webkit.org/show_bug.cgi?id=182230 >+ >+ Reviewed by Simon Fraser. >+ >+ This commit moves the special logic for "scrolling element" body from the >+ HtmlBodyElement::scroll(Left/Top/Width/Height/To) functions to the Element class. The code >+ is executed when the element is the scrolling element which includes the case of body >+ in Quirks mode and of documentElement in standard mode. This makes the behavior closer to >+ the CSSOM View spec (bug 5991) while not deviating too much from the current implementation. >+ Finally, CSSOMViewScrollingAPI is now enabled for running tests and some adjustments are made >+ to existing tests. Further improvements will be performed in dependencies of bug 5991. >+ >+ No new tests, already covered by existing tests. >+ >+ * dom/Document.cpp: Split scrollingElement into two functions so that one can be called >+ internally without updating the layout. >+ (WebCore::Document::scrollingElement): >+ (WebCore::Document::scrollingElementForAPI): >+ * dom/Document.h: Ditto. >+ * dom/Document.idl: Use the version updating the layout for API calls. >+ * dom/Element.cpp: Add include to call DOMWindow::ScrollTo >+ (WebCore::Element::scrollTo): Moved some logic from HtmlBodyElement to handle the case of >+ the scrolling element. Also skip special handling of documentElement() when >+ CSSOMViewScrollingAPI is disabled. >+ (WebCore::adjustContentsScrollPositionOrSizeForZoom): Moved some logic from HtmlBodyElement >+ to handle the case of the scrolling element. Also add a FIXME for improving these kinds of >+ helper functions. Renamed to make more explicit the semantic of the value argument. >+ (WebCore::Element::scrollLeft): Moved some logic from HtmlBodyElement to handle the case of >+ the scrolling element. Use the new documentFrameWithNonNullView() helper function. >+ (WebCore::Element::scrollTop): Ditto. >+ (WebCore::Element::setScrollLeft): Ditto >+ (WebCore::Element::setScrollTop): Ditto. >+ (WebCore::Element::scrollWidth): Ditto. >+ (WebCore::Element::scrollHeight): Ditto. >+ * dom/Element.h: >+ (WebCore::Document::documentFrameWithNonNullView): New helper function to retrieve the >+ frame and ensure a view is available. >+ * html/HTMLBodyElement.cpp: Remove code that is now in Element. >+ * html/HTMLBodyElement.h: Ditto. >+ > 2018-09-07 Zalan Bujtas <zalan@apple.com> > > [LFC] Replace "computed" value with "used" value to match spec language >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 2e7970798f52fb263dd52780960ede9f58c80c5d..c51813e322ec83214a7de1a5e6a7bf749d1f3fa0 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2018-09-07 Frederic Wang <fwang@igalia.com> >+ >+ [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To) >+ https://bugs.webkit.org/show_bug.cgi?id=182230 >+ >+ Reviewed by Simon Fraser. >+ >+ * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: >+ (webkit_dom_document_get_scrolling_element): Use the new name. >+ > 2018-09-07 Brent Fulgham <bfulgham@apple.com> > > Unreviewed syntax fix after r235781 >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 0ebf8f87270adc1d805e5d7e219749a10862c970..cea5ca9837137de9eeff2855956836378c369022 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,13 @@ >+2018-09-07 Frederic Wang <fwang@igalia.com> >+ >+ [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To) >+ https://bugs.webkit.org/show_bug.cgi?id=182230 >+ >+ Reviewed by Simon Fraser. >+ >+ * DOM/DOMDocument.mm: >+ (-[DOMDocument scrollingElement]): Use the new name. >+ > 2018-09-06 Wenson Hsieh <wenson_hsieh@apple.com> > > Refactor WebCore::EditAction to be an 8-bit enum class >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 12cbbe7add1043534ed3ab47308485582d98a65c..a9ab459d47023e08dfd6ad1f8169f8efe9a5ab36 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -1461,6 +1461,13 @@ bool Document::isBodyPotentiallyScrollable(HTMLBodyElement& body) > && !body.computedStyle()->isOverflowVisible(); > } > >+Element* Document::scrollingElementForAPI() >+{ >+ if (inQuirksMode() && settings().CSSOMViewScrollingAPIEnabled()) >+ updateLayoutIgnorePendingStylesheets(); >+ return scrollingElement(); >+} >+ > Element* Document::scrollingElement() > { > if (settings().CSSOMViewScrollingAPIEnabled()) { >@@ -1468,7 +1475,6 @@ Element* Document::scrollingElement() > // The scrollingElement attribute, on getting, must run these steps: > // 1. If the Document is in quirks mode, follow these substeps: > if (inQuirksMode()) { >- updateLayoutIgnorePendingStylesheets(); > auto* firstBody = body(); > // 1. If the HTML body element exists, and it is not potentially scrollable, return the > // HTML body element and abort these steps. >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index d6e24f5bc812b3cbff7b04c66ade8184568faccc..b64973d3d5fcb308ba5b81939367db9b83689887 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -448,7 +448,8 @@ public: > WEBCORE_EXPORT RefPtr<Range> caretRangeFromPoint(int x, int y); > RefPtr<Range> caretRangeFromPoint(const LayoutPoint& clientPoint); > >- WEBCORE_EXPORT Element* scrollingElement(); >+ WEBCORE_EXPORT Element* scrollingElementForAPI(); >+ Element* scrollingElement(); > > enum ReadyState { > Loading, >diff --git a/Source/WebCore/dom/Document.idl b/Source/WebCore/dom/Document.idl >index 35ff9c057c3e473ff0fe97485ec0dc48cc848b28..d54d8c7afda220770809e7c406abcf4faec8a272 100644 >--- a/Source/WebCore/dom/Document.idl >+++ b/Source/WebCore/dom/Document.idl >@@ -132,7 +132,7 @@ typedef ( > readonly attribute StyleSheetList styleSheets; // FIXME: Should be [SameObject]. > > // Extensions from the CSSOM-View specification (https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface). >- readonly attribute Element? scrollingElement; >+ [ImplementedAs=scrollingElementForAPI] readonly attribute Element? scrollingElement; > > // Extensions from Selection API (https://www.w3.org/TR/selection-api/#extensions-to-document-interface). > // FIXME: Should likely be moved to DocumentOrShadowRoot. >diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp >index 1b3bcac9550455f16c0b87b489e79681c10bbca8..14e3c076391e87504caf2d6d6187ef4f61d03797 100644 >--- a/Source/WebCore/dom/Element.cpp >+++ b/Source/WebCore/dom/Element.cpp >@@ -41,6 +41,7 @@ > #include "DOMRect.h" > #include "DOMRectList.h" > #include "DOMTokenList.h" >+#include "DOMWindow.h" > #include "DocumentSharedObjectPool.h" > #include "DocumentTimeline.h" > #include "Editing.h" >@@ -756,13 +757,27 @@ void Element::scrollBy(double x, double y) > > void Element::scrollTo(const ScrollToOptions& options, ScrollClamping clamping) > { >- // If the element is the root element and document is in quirks mode, terminate these steps. >- // Note that WebKit always uses quirks mode document scrolling behavior. See Document::scrollingElement(). >- if (this == document().documentElement()) >- return; >+ if (!document().settings().CSSOMViewScrollingAPIEnabled()) { >+ // If the element is the root element and document is in quirks mode, terminate these steps. >+ // Note that WebKit always uses quirks mode document scrolling behavior. See Document::scrollingElement(). >+ if (this == document().documentElement()) >+ return; >+ } > > document().updateLayoutIgnorePendingStylesheets(); > >+ if (document().scrollingElement() == this) { >+ // If the element is the scrolling element and is not potentially scrollable, >+ // invoke scroll() on window with options as the only argument, and terminate these steps. >+ // FIXME: Scrolling an independently scrollable body is broken: webkit.org/b/161612. >+ auto window = makeRefPtr(document().domWindow()); >+ if (!window) >+ return; >+ >+ window->scrollTo(options); >+ return; >+ } >+ > // If the element does not have any associated CSS layout box, the element has no associated scrolling box, > // or the element has no overflow, terminate these steps. > RenderBox* renderer = renderBox(); >@@ -843,6 +858,18 @@ static double adjustForLocalZoom(LayoutUnit value, const RenderElement& renderer > return value.toDouble() / zoomFactor; > } > >+static int adjustContentsScrollPositionOrSizeForZoom(int value, const Frame& frame) >+{ >+ double zoomFactor = frame.pageZoomFactor() * frame.frameScaleFactor(); >+ if (zoomFactor == 1) >+ return value; >+ // FIXME (webkit.org/b/189397): Why can't we just ceil/floor? >+ // Needed because of truncation (rather than rounding) when scaling up. >+ if (zoomFactor > 1) >+ value++; >+ return static_cast<int>(value / zoomFactor); >+} >+ > enum LegacyCSSOMElementMetricsRoundingStrategy { Round, Floor }; > > static bool subpixelMetricsEnabled(const Document& document) >@@ -984,10 +1011,22 @@ double Element::clientHeight() > return 0; > } > >+ALWAYS_INLINE Frame* Element::documentFrameWithNonNullView() const >+{ >+ auto* frame = document().frame(); >+ return frame && frame->view() ? frame : nullptr; >+} >+ > int Element::scrollLeft() > { > document().updateLayoutIgnorePendingStylesheets(); > >+ if (document().scrollingElement() == this) { >+ if (auto* frame = documentFrameWithNonNullView()) >+ return adjustContentsScrollPositionOrSizeForZoom(frame->view()->contentsScrollPosition().x(), *frame); >+ return 0; >+ } >+ > if (auto* renderer = renderBox()) > return adjustForAbsoluteZoom(renderer->scrollLeft(), *renderer); > return 0; >@@ -997,6 +1036,12 @@ int Element::scrollTop() > { > document().updateLayoutIgnorePendingStylesheets(); > >+ if (document().scrollingElement() == this) { >+ if (auto* frame = documentFrameWithNonNullView()) >+ return adjustContentsScrollPositionOrSizeForZoom(frame->view()->contentsScrollPosition().y(), *frame); >+ return 0; >+ } >+ > if (RenderBox* renderer = renderBox()) > return adjustForAbsoluteZoom(renderer->scrollTop(), *renderer); > return 0; >@@ -1006,6 +1051,12 @@ void Element::setScrollLeft(int newLeft) > { > document().updateLayoutIgnorePendingStylesheets(); > >+ if (document().scrollingElement() == this) { >+ if (auto* frame = documentFrameWithNonNullView()) >+ frame->view()->setScrollPosition(IntPoint(static_cast<int>(newLeft * frame->pageZoomFactor() * frame->frameScaleFactor()), frame->view()->scrollY())); >+ return; >+ } >+ > if (auto* renderer = renderBox()) { > renderer->setScrollLeft(static_cast<int>(newLeft * renderer->style().effectiveZoom())); > if (auto* scrollableArea = renderer->layer()) >@@ -1017,6 +1068,12 @@ void Element::setScrollTop(int newTop) > { > document().updateLayoutIgnorePendingStylesheets(); > >+ if (document().scrollingElement() == this) { >+ if (auto* frame = documentFrameWithNonNullView()) >+ frame->view()->setScrollPosition(IntPoint(frame->view()->scrollX(), static_cast<int>(newTop * frame->pageZoomFactor() * frame->frameScaleFactor()))); >+ return; >+ } >+ > if (auto* renderer = renderBox()) { > renderer->setScrollTop(static_cast<int>(newTop * renderer->style().effectiveZoom())); > if (auto* scrollableArea = renderer->layer()) >@@ -1027,6 +1084,15 @@ void Element::setScrollTop(int newTop) > int Element::scrollWidth() > { > document().updateLayoutIfDimensionsOutOfDate(*this, WidthDimensionsCheck); >+ >+ if (document().scrollingElement() == this) { >+ // FIXME (webkit.org/b/182289): updateLayoutIfDimensionsOutOfDate seems to ignore zoom level change. >+ document().updateLayoutIgnorePendingStylesheets(); >+ if (auto* frame = documentFrameWithNonNullView()) >+ return adjustContentsScrollPositionOrSizeForZoom(frame->view()->contentsWidth(), *frame); >+ return 0; >+ } >+ > if (auto* renderer = renderBox()) > return adjustForAbsoluteZoom(renderer->scrollWidth(), *renderer); > return 0; >@@ -1035,6 +1101,15 @@ int Element::scrollWidth() > int Element::scrollHeight() > { > document().updateLayoutIfDimensionsOutOfDate(*this, HeightDimensionsCheck); >+ >+ if (document().scrollingElement() == this) { >+ // FIXME (webkit.org/b/182289): updateLayoutIfDimensionsOutOfDate seems to ignore zoom level change. >+ document().updateLayoutIgnorePendingStylesheets(); >+ if (auto* frame = documentFrameWithNonNullView()) >+ return adjustContentsScrollPositionOrSizeForZoom(frame->view()->contentsHeight(), *frame); >+ return 0; >+ } >+ > if (auto* renderer = renderBox()) > return adjustForAbsoluteZoom(renderer->scrollHeight(), *renderer); > return 0; >diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h >index c83f508e5e78ac50ba7ad41ef50c26560f579312..8321393b61003972de1bf6440a8bb8ab0ded94ef 100644 >--- a/Source/WebCore/dom/Element.h >+++ b/Source/WebCore/dom/Element.h >@@ -43,6 +43,7 @@ class DOMRect; > class DOMRectList; > class DOMTokenList; > class ElementRareData; >+class Frame; > class HTMLDocument; > class IntSize; > class JSCustomElementInterface; >@@ -605,6 +606,8 @@ protected: > static ExceptionOr<void> mergeWithNextTextNode(Text&); > > private: >+ Frame* documentFrameWithNonNullView() const; >+ > bool isTextNode() const; > > bool isUserActionElementInActiveChain() const; >diff --git a/Source/WebCore/html/HTMLBodyElement.cpp b/Source/WebCore/html/HTMLBodyElement.cpp >index 8442ac92428fa2ae35a1417655149040a2b2bd89..bbaf073083c780489254e0a39d53964c45ccc86c 100644 >--- a/Source/WebCore/html/HTMLBodyElement.cpp >+++ b/Source/WebCore/html/HTMLBodyElement.cpp >@@ -30,8 +30,6 @@ > #include "DOMWindow.h" > #include "DOMWrapperWorld.h" > #include "EventNames.h" >-#include "Frame.h" >-#include "FrameView.h" > #include "HTMLFrameElement.h" > #include "HTMLIFrameElement.h" > #include "HTMLNames.h" >@@ -52,13 +50,6 @@ HTMLBodyElement::HTMLBodyElement(const QualifiedName& tagName, Document& documen > ASSERT(hasTagName(bodyTag)); > } > >-bool HTMLBodyElement::isFirstBodyElementOfDocument() const >-{ >- // By spec http://dev.w3.org/csswg/cssom-view/#the-html-body-element >- // "The HTML body element is the first body HTML element child of the root HTML element html." >- return document().body() == this; >-} >- > Ref<HTMLBodyElement> HTMLBodyElement::create(Document& document) > { > return adoptRef(*new HTMLBodyElement(bodyTag, document)); >@@ -231,126 +222,6 @@ bool HTMLBodyElement::supportsFocus() const > return hasEditableStyle() || HTMLElement::supportsFocus(); > } > >-static int adjustForZoom(int value, const Frame& frame) >-{ >- double zoomFactor = frame.pageZoomFactor() * frame.frameScaleFactor(); >- if (zoomFactor == 1) >- return value; >- // Needed because of truncation (rather than rounding) when scaling up. >- if (zoomFactor > 1) >- value++; >- return static_cast<int>(value / zoomFactor); >-} >- >-int HTMLBodyElement::scrollLeft() >-{ >- if (isFirstBodyElementOfDocument()) { >- document().updateLayoutIgnorePendingStylesheets(); >- RefPtr<Frame> frame = document().frame(); >- if (!frame) >- return 0; >- RefPtr<FrameView> view = frame->view(); >- if (!view) >- return 0; >- return adjustForZoom(view->contentsScrollPosition().x(), *frame); >- } >- return HTMLElement::scrollLeft(); >-} >- >-void HTMLBodyElement::setScrollLeft(int scrollLeft) >-{ >- if (isFirstBodyElementOfDocument()) { >- document().updateLayoutIgnorePendingStylesheets(); >- RefPtr<Frame> frame = document().frame(); >- if (!frame) >- return; >- RefPtr<FrameView> view = frame->view(); >- if (!view) >- return; >- view->setScrollPosition(IntPoint(static_cast<int>(scrollLeft * frame->pageZoomFactor() * frame->frameScaleFactor()), view->scrollY())); >- } >- HTMLElement::setScrollLeft(scrollLeft); >-} >- >-int HTMLBodyElement::scrollTop() >-{ >- if (isFirstBodyElementOfDocument()) { >- document().updateLayoutIgnorePendingStylesheets(); >- RefPtr<Frame> frame = document().frame(); >- if (!frame) >- return 0; >- RefPtr<FrameView> view = frame->view(); >- if (!view) >- return 0; >- return adjustForZoom(view->contentsScrollPosition().y(), *frame); >- } >- return HTMLElement::scrollTop(); >-} >- >-void HTMLBodyElement::setScrollTop(int scrollTop) >-{ >- if (isFirstBodyElementOfDocument()) { >- document().updateLayoutIgnorePendingStylesheets(); >- RefPtr<Frame> frame = document().frame(); >- if (!frame) >- return; >- RefPtr<FrameView> view = frame->view(); >- if (!view) >- return; >- view->setScrollPosition(IntPoint(view->scrollX(), static_cast<int>(scrollTop * frame->pageZoomFactor() * frame->frameScaleFactor()))); >- } >- return HTMLElement::setScrollTop(scrollTop); >-} >- >-void HTMLBodyElement::scrollTo(const ScrollToOptions& options, ScrollClamping clamping) >-{ >- if (isFirstBodyElementOfDocument()) { >- // If the element is the HTML body element, document is in quirks mode, and the element is not potentially scrollable, >- // invoke scroll() on window with options as the only argument, and terminate these steps. >- // Note that WebKit always uses quirks mode document scrolling behavior. See Document::scrollingElement(). >- // FIXME: Scrolling an independently scrollable body is broken: webkit.org/b/161612. >- auto window = makeRefPtr(document().domWindow()); >- if (!window) >- return; >- >- window->scrollTo(options); >- return; >- } >- return HTMLElement::scrollTo(options, clamping); >-} >- >-int HTMLBodyElement::scrollHeight() >-{ >- if (isFirstBodyElementOfDocument()) { >- // Update the document's layout. >- document().updateLayoutIgnorePendingStylesheets(); >- RefPtr<Frame> frame = document().frame(); >- if (!frame) >- return 0; >- RefPtr<FrameView> view = frame->view(); >- if (!view) >- return 0; >- return adjustForZoom(view->contentsHeight(), *frame); >- } >- return HTMLElement::scrollHeight(); >-} >- >-int HTMLBodyElement::scrollWidth() >-{ >- if (isFirstBodyElementOfDocument()) { >- // Update the document's layout. >- document().updateLayoutIgnorePendingStylesheets(); >- RefPtr<Frame> frame = document().frame(); >- if (!frame) >- return 0; >- RefPtr<FrameView> view = frame->view(); >- if (!view) >- return 0; >- return adjustForZoom(view->contentsWidth(), *frame); >- } >- return HTMLElement::scrollWidth(); >-} >- > void HTMLBodyElement::addSubresourceAttributeURLs(ListHashSet<URL>& urls) const > { > HTMLElement::addSubresourceAttributeURLs(urls); >diff --git a/Source/WebCore/html/HTMLBodyElement.h b/Source/WebCore/html/HTMLBodyElement.h >index 9197ecc0a308d36d8192dc9136397d05df654a4a..45b0fbc53cb0c1d7e32e139adac698693d104048 100644 >--- a/Source/WebCore/html/HTMLBodyElement.h >+++ b/Source/WebCore/html/HTMLBodyElement.h >@@ -39,8 +39,6 @@ public: > private: > HTMLBodyElement(const QualifiedName&, Document&); > >- bool isFirstBodyElementOfDocument() const; >- > void parseAttribute(const QualifiedName&, const AtomicString&) final; > bool isPresentationAttribute(const QualifiedName&) const final; > void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final; >@@ -52,17 +50,6 @@ private: > > bool supportsFocus() const final; > >- int scrollLeft() final; >- void setScrollLeft(int) final; >- >- int scrollTop() final; >- void setScrollTop(int) final; >- >- void scrollTo(const ScrollToOptions&, ScrollClamping) final; >- >- int scrollHeight() final; >- int scrollWidth() final; >- > void addSubresourceAttributeURLs(ListHashSet<URL>&) const final; > > static EventHandlerNameMap createWindowEventHandlerNameMap(); >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp >index f6997ef01a3f267c49ddd4ee9973c6a7b4156942..1b7e0dc496f698b1cd638da22199b59db792369e 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp >@@ -1929,7 +1929,7 @@ WebKitDOMElement* webkit_dom_document_get_scrolling_element(WebKitDOMDocument* s > WebCore::JSMainThreadNullState state; > g_return_val_if_fail(WEBKIT_DOM_IS_DOCUMENT(self), 0); > WebCore::Document* item = WebKit::core(self); >- RefPtr<WebCore::Element> gobjectResult = WTF::getPtr(item->scrollingElement()); >+ RefPtr<WebCore::Element> gobjectResult = WTF::getPtr(item->scrollingElementForAPI()); > return WebKit::kit(gobjectResult.get()); > } > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMDocument.mm b/Source/WebKitLegacy/mac/DOM/DOMDocument.mm >index cf3056102bd9ebdb13b2008296cad479cab4eae8..ad558529abb783a81d3f9832fc43f9abc3a23a50 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMDocument.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMDocument.mm >@@ -418,7 +418,7 @@ > - (DOMElement *)scrollingElement > { > WebCore::JSMainThreadNullState state; >- return kit(WTF::getPtr(IMPL->scrollingElement())); >+ return kit(WTF::getPtr(IMPL->scrollingElementForAPI())); > } > > - (DOMHTMLCollection *)children >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index f32b77fd07fcc5664fbae70c693faf4447f894e1..483fb83fc3270b79213ef04b35095a65c7d9a1a3 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,20 @@ >+2018-09-07 Frederic Wang <fwang@igalia.com> >+ >+ [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To) >+ https://bugs.webkit.org/show_bug.cgi?id=182230 >+ >+ Reviewed by Simon Fraser. >+ >+ This patch enables CSSOMViewScrollingAPI during test execution. >+ >+ * DumpRenderTree/mac/DumpRenderTree.mm: >+ (enableExperimentalFeatures): >+ (resetWebPreferencesToConsistentValues): >+ * DumpRenderTree/win/DumpRenderTree.cpp: >+ (enableExperimentalFeatures): >+ * WebKitTestRunner/TestController.cpp: >+ (WTR::TestController::resetPreferencesToConsistentValues): >+ > 2018-09-07 Aakash Jain <aakash_jain@apple.com> > > [ews-build] API tests should output result summary in json >diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >index 4341388c74241302cdd6d25a5335a779d2b41d2e..efb43c169292b9f130855e4bd6b967080b385df4 100644 >--- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm >+++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >@@ -869,7 +869,7 @@ static void enableExperimentalFeatures(WebPreferences* preferences) > [preferences setServerTimingEnabled:YES]; > [preferences setIntersectionObserverEnabled:YES]; > preferences.sourceBufferChangeTypeEnabled = YES; >- // FIXME: CSSOMViewScrollingAPIEnabled >+ [preferences setCSSOMViewScrollingAPIEnabled:YES]; > } > > // Called before each test. >@@ -922,7 +922,6 @@ static void resetWebPreferencesToConsistentValues() > [preferences setLoadsSiteIconsIgnoringImageLoadingPreference:NO]; > [preferences setFrameFlattening:WebKitFrameFlatteningDisabled]; > [preferences setAsyncFrameScrollingEnabled:NO]; >- [preferences setCSSOMViewScrollingAPIEnabled:NO]; > [preferences setSpatialNavigationEnabled:NO]; > [preferences setMetaRefreshEnabled:YES]; > >diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.cpp b/Tools/DumpRenderTree/win/DumpRenderTree.cpp >index 6c530515a0be5cc2d524d5c5d9bd5dbb7b6bf394..52f788b471d2062cc6a3d2a5b4e45d25868e1c16 100644 >--- a/Tools/DumpRenderTree/win/DumpRenderTree.cpp >+++ b/Tools/DumpRenderTree/win/DumpRenderTree.cpp >@@ -785,7 +785,7 @@ static void enableExperimentalFeatures(IWebPreferences* preferences) > // FIXME: InputEvents > // FIXME: SubtleCrypto > prefsPrivate->setVisualViewportAPIEnabled(TRUE); >- // FIXME: CSSOMViewScrollingAPI >+ prefsPrivate->setCSSOMViewScrollingAPIEnabled(TRUE); > prefsPrivate->setWebAnimationsEnabled(TRUE); > prefsPrivate->setServerTimingEnabled(TRUE); > // FIXME: WebGL2 >diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp >index 9ee06be3ee6602097653a006b58e0d49385b5b87..00cc0ea097223317d9b802290f7de26cbf3ce40a 100644 >--- a/Tools/WebKitTestRunner/TestController.cpp >+++ b/Tools/WebKitTestRunner/TestController.cpp >@@ -791,7 +791,7 @@ void TestController::resetPreferencesToConsistentValues(const TestOptions& optio > > WKPreferencesSetAccessibilityObjectModelEnabled(preferences, true); > WKPreferencesSetAriaReflectionEnabled(preferences, true); >- WKPreferencesSetCSSOMViewScrollingAPIEnabled(preferences, false); >+ WKPreferencesSetCSSOMViewScrollingAPIEnabled(preferences, true); > WKPreferencesSetMediaCapabilitiesEnabled(preferences, true); > > WKPreferencesSetCrossOriginWindowPolicyEnabled(preferences, true); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 08bc975fdb9c5f43e3d8622c200d3033302b3c80..e77b3bfcb250b2b72811745e8c6a0747d7a8a79f 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,39 @@ >+2018-09-07 Frederic Wang <fwang@igalia.com> >+ >+ [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To) >+ https://bugs.webkit.org/show_bug.cgi?id=182230 >+ >+ Reviewed by Simon Fraser. >+ >+ This commit updates some tests to work when CSSOMViewScrollingAPI is enabled. >+ >+ * TestExpectations: Enable web-platform-tests/cssom-view/scrollingElement.html. >+ * fast/dom/Document/scrollingElement-quirks-mode.html: Do not enable explictly enable >+ CSSOMViewScrollingAPI. >+ * fast/dom/Document/scrollingElement-standards-mode.html: Ditto. >+ * fast/dom/Element/body-scrollLeft-expected.txt: Updated to follow the CSSOMView spec. >+ * fast/dom/Element/body-scrollLeft.html: Ditto. >+ * fast/dom/Element/body-scrollTop-expected.txt: Ditto. >+ * fast/dom/Element/body-scrollTop.html: Ditto. >+ * fast/dom/Element/documentElement-scrollLeft-expected.txt: Ditto. >+ * fast/dom/Element/documentElement-scrollLeft.html: Ditto. >+ * fast/dom/Element/documentElement-scrollTop-expected.txt: Ditto. >+ * fast/dom/Element/documentElement-scrollTop.html: Ditto. >+ * fast/dom/Element/scrollLeft-expected.txt: Ditto. >+ * fast/dom/Element/scrollLeft.html: Ditto. >+ * fast/dom/Element/scrollTop-expected.txt: Ditto. >+ * fast/dom/Element/scrollTop.html: Ditto. >+ * fast/dom/Element/scrolling-funtions-on-body-expected.txt: Ditto. >+ * fast/dom/Element/scrolling-funtions-on-body.html: Ditto. >+ * platform/ios/TestExpectations: Add expectation for one WPT test that was already failing >+ on iOS. >+ * platform/ios/ios/fast/coordinates/page-offsets-expected.txt: Use documentElement instead >+ of body for this test when running in standard mode. >+ * platform/ios/ios/fast/coordinates/resources/helpers.js: Ditto. >+ (verifyScrollOffsets): >+ * tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html: Use >+ document.scrollingElement instead of document.body to access viewport scroll offset. >+ > 2018-09-07 Zalan Bujtas <zalan@apple.com> > > [iOS] Unreviewed test gardening. >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 2eccbd80bdcc792388aa0c50434cdb73b8e80a27..7d844217c23a962a546d3d57c367223418c8c7fe 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,17 @@ >+2018-09-07 Frederic Wang <fwang@igalia.com> >+ >+ [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To) >+ https://bugs.webkit.org/show_bug.cgi?id=182230 >+ >+ Reviewed by Simon Fraser. >+ >+ This commit updates expectations for some WPT tests so that they have only PASS results. >+ Note that css/cssom-view/scrollingElement-quirks-dynamic-*.html still fail for now (bug 182292). >+ >+ * web-platform-tests/css/cssom-view/HTMLBody-ScrollArea_quirksmode-expected.txt: >+ * web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks-expected.txt: >+ * web-platform-tests/css/cssom-view/scrollingElement-expected.txt: Added. >+ > 2018-09-05 Youenn Fablet <youenn@apple.com> > > Expose RTCRtpSender.setParameters >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 05e29488e92884528fbcdb9402ed7e75096e3a21..cb40aa5c31dbc51b4c83369fa00cd24f5e418cc5 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -1892,9 +1892,6 @@ fast/table/colspanMinWidth-vertical.html [ Skip ] > # Test only works on iOS WK2. webkit.org/b/165535 > fast/forms/range/range-remove-on-drag.html [ Skip ] > >-# CSSOM View module >-webkit.org/b/5991 imported/w3c/web-platform-tests/css/cssom-view/scrollingElement.html [ Skip ] >- > # FileAPI > webkit.org/b/172099 imported/w3c/web-platform-tests/FileAPI/url/url_xmlhttprequest_img.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe.html [ Failure ] >diff --git a/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode.html b/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode.html >index 56492a05b8d88a3651a472c65f62572cc892414f..8cfc3e99bbe2297bf6fd6a65d154eb238ec50681 100644 >--- a/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode.html >+++ b/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode.html >@@ -5,8 +5,6 @@ > </head> > <body> > <script> >-if (window.internals) >- internals.settings.setCSSOMViewScrollingAPIEnabled(true); > > description("Tests the behavior of document.scrollingElement in quirks mode."); > >diff --git a/LayoutTests/fast/dom/Document/scrollingElement-standards-mode.html b/LayoutTests/fast/dom/Document/scrollingElement-standards-mode.html >index 89012f7bec28e13a2f3f464419cc802ea3eb3378..bf8bff3121097e341c0225df1a602da95f9a6e54 100644 >--- a/LayoutTests/fast/dom/Document/scrollingElement-standards-mode.html >+++ b/LayoutTests/fast/dom/Document/scrollingElement-standards-mode.html >@@ -6,8 +6,6 @@ > </head> > <body> > <script> >-if (window.internals) >- internals.settings.setCSSOMViewScrollingAPIEnabled(true); > > description("Tests the behavior of document.scrollingElement in standards mode."); > >diff --git a/LayoutTests/fast/dom/Element/body-scrollLeft-expected.txt b/LayoutTests/fast/dom/Element/body-scrollLeft-expected.txt >index cfae951e0e7be80c5ab06bbeb482662596e6c542..98e6898c6ea8ff383a7b19a147510ac6462dc060 100644 >--- a/LayoutTests/fast/dom/Element/body-scrollLeft-expected.txt >+++ b/LayoutTests/fast/dom/Element/body-scrollLeft-expected.txt >@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > PASS successfullyParsed is true > > TEST COMPLETE >-PASS document.body.scrollLeft is 500 >+PASS document.body.scrollLeft is 0 > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/dom/Element/body-scrollLeft.html b/LayoutTests/fast/dom/Element/body-scrollLeft.html >index a7174bbe4693da0fcc2f0505e1e9d271074ca7fc..ad0018e66dc840f7aa2b721dc7a94b4238d86452 100644 >--- a/LayoutTests/fast/dom/Element/body-scrollLeft.html >+++ b/LayoutTests/fast/dom/Element/body-scrollLeft.html >@@ -12,8 +12,8 @@ > function runTest() { > description('Tests that for non-standard mode document.body.scrollLeft returns the scroll left value as 0'); > >- document.body.scrollLeft = 500; >- shouldBe("document.body.scrollLeft","500"); >+ document.body.scrollLeft = 0; >+ shouldBe("document.body.scrollLeft","0"); > isSuccessfullyParsed(); > } > </script> >diff --git a/LayoutTests/fast/dom/Element/body-scrollTop-expected.txt b/LayoutTests/fast/dom/Element/body-scrollTop-expected.txt >index 3b23a4b0e5691046bfdefe8185c4d822e3100102..9849308d3278924df1da47f1c0b775c3c61161c7 100644 >--- a/LayoutTests/fast/dom/Element/body-scrollTop-expected.txt >+++ b/LayoutTests/fast/dom/Element/body-scrollTop-expected.txt >@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > PASS successfullyParsed is true > > TEST COMPLETE >-PASS document.body.scrollTop is 500 >+PASS document.body.scrollTop is 0 > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/dom/Element/body-scrollTop.html b/LayoutTests/fast/dom/Element/body-scrollTop.html >index aa35737066b0ae97662a6fff9797f3ea0a14ff0c..d1a194d118c8aae44f0e4e7d3cef0749b084f438 100644 >--- a/LayoutTests/fast/dom/Element/body-scrollTop.html >+++ b/LayoutTests/fast/dom/Element/body-scrollTop.html >@@ -13,7 +13,7 @@ > description('Tests that for non-standard mode document.body.scrollTop returns the scroll top value as 0'); > > document.body.scrollTop = 500; >- shouldBe("document.body.scrollTop","500"); >+ shouldBe("document.body.scrollTop","0"); > isSuccessfullyParsed(); > } > </script> >diff --git a/LayoutTests/fast/dom/Element/documentElement-scrollLeft-expected.txt b/LayoutTests/fast/dom/Element/documentElement-scrollLeft-expected.txt >index 1dacc16a6fd813ad61fdd8afddd5722889299f61..8fcd8f716f57cea3939daf2a4de570ca310dc6e3 100644 >--- a/LayoutTests/fast/dom/Element/documentElement-scrollLeft-expected.txt >+++ b/LayoutTests/fast/dom/Element/documentElement-scrollLeft-expected.txt >@@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > PASS successfullyParsed is true > > TEST COMPLETE >-PASS document.documentElement.scrollLeft is 0 >+PASS document.documentElement.scrollLeft is 500 > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/dom/Element/documentElement-scrollLeft.html b/LayoutTests/fast/dom/Element/documentElement-scrollLeft.html >index 12396926ea4ad228c99eba143404e552ebd8a793..40f8dc129f4c258e569453c4b23da138f58e8571 100644 >--- a/LayoutTests/fast/dom/Element/documentElement-scrollLeft.html >+++ b/LayoutTests/fast/dom/Element/documentElement-scrollLeft.html >@@ -13,7 +13,7 @@ > description('Tests that for standard mode document.documentElement.scrollLeft returns the scroll left value'); > > document.documentElement.scrollLeft = 500; >- shouldBe("document.documentElement.scrollLeft","0"); >+ shouldBe("document.documentElement.scrollLeft","500"); > isSuccessfullyParsed(); > } > </script> >diff --git a/LayoutTests/fast/dom/Element/documentElement-scrollTop-expected.txt b/LayoutTests/fast/dom/Element/documentElement-scrollTop-expected.txt >index 664e7ae65e0dbdcf23b73b376f0d3a6cb2c5cccf..671d84bdbb7394e5454cdc39a4d058f4923b5d56 100644 >--- a/LayoutTests/fast/dom/Element/documentElement-scrollTop-expected.txt >+++ b/LayoutTests/fast/dom/Element/documentElement-scrollTop-expected.txt >@@ -3,7 +3,7 @@ Tests that for standard mode document.documentElement.scrollTop returns the scro > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > > >-PASS document.documentElement.scrollTop is 0 >+PASS document.documentElement.scrollTop is 500 > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/dom/Element/documentElement-scrollTop.html b/LayoutTests/fast/dom/Element/documentElement-scrollTop.html >index fcfeadec9bfc1f70f9797add100ec7883de120bc..03adca5ccacf38940b26bdc00234143cd29b24f6 100644 >--- a/LayoutTests/fast/dom/Element/documentElement-scrollTop.html >+++ b/LayoutTests/fast/dom/Element/documentElement-scrollTop.html >@@ -13,7 +13,7 @@ > description('Tests that for standard mode document.documentElement.scrollTop returns the scroll top value'); > > document.documentElement.scrollTop = 500; >- shouldBe("document.documentElement.scrollTop","0"); >+ shouldBe("document.documentElement.scrollTop","500"); > isSuccessfullyParsed(); > } > </script> >diff --git a/LayoutTests/fast/dom/Element/scrollLeft-expected.txt b/LayoutTests/fast/dom/Element/scrollLeft-expected.txt >index 99bc52c8329edc40679182ad6f8e1d29ec5767ae..0a23454140be440bf263a6a61fd5ee8671abef0d 100644 >--- a/LayoutTests/fast/dom/Element/scrollLeft-expected.txt >+++ b/LayoutTests/fast/dom/Element/scrollLeft-expected.txt >@@ -4,8 +4,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > > > PASS window.pageXOffset is 500 >-PASS document.body.scrollLeft is 500 >-PASS document.documentElement.scrollLeft is 0 >+PASS document.body.scrollLeft is 0 >+PASS document.documentElement.scrollLeft is 500 > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/dom/Element/scrollLeft.html b/LayoutTests/fast/dom/Element/scrollLeft.html >index f8d39bd9eaae268a392e38ff009b3b637476a8cd..4d9d68e2dc2769ebed5b526a173983c2e9cae1b8 100644 >--- a/LayoutTests/fast/dom/Element/scrollLeft.html >+++ b/LayoutTests/fast/dom/Element/scrollLeft.html >@@ -15,8 +15,8 @@ > setTimeout(function() { > window.scrollTo(500,0); > shouldBe("window.pageXOffset","500"); >- shouldBe("document.body.scrollLeft","500"); >- shouldBe("document.documentElement.scrollLeft","0"); >+ shouldBe("document.body.scrollLeft","0"); >+ shouldBe("document.documentElement.scrollLeft","500"); > finishJSTest(); > }, 0); > } >diff --git a/LayoutTests/fast/dom/Element/scrollTop-expected.txt b/LayoutTests/fast/dom/Element/scrollTop-expected.txt >index 0f7716c5ba420689e62b0000287310ef13a5c272..405aed5b71d755ebd685a89dd99442413a12882f 100644 >--- a/LayoutTests/fast/dom/Element/scrollTop-expected.txt >+++ b/LayoutTests/fast/dom/Element/scrollTop-expected.txt >@@ -4,8 +4,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > > > PASS window.pageYOffset is 500 >-PASS document.body.scrollTop is 500 >-PASS document.documentElement.scrollTop is 0 >+PASS document.body.scrollTop is 0 >+PASS document.documentElement.scrollTop is 500 > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/dom/Element/scrollTop.html b/LayoutTests/fast/dom/Element/scrollTop.html >index 0a5631a78f92e409fe6a9afd4b33771b028b0b94..f0e5c373115578c49fa1f93d32514680115e1221 100644 >--- a/LayoutTests/fast/dom/Element/scrollTop.html >+++ b/LayoutTests/fast/dom/Element/scrollTop.html >@@ -15,8 +15,8 @@ > setTimeout(function() { > window.scrollTo(0,500); > shouldBe("window.pageYOffset","500"); >- shouldBe("document.body.scrollTop","500"); >- shouldBe("document.documentElement.scrollTop","0"); >+ shouldBe("document.body.scrollTop","0"); >+ shouldBe("document.documentElement.scrollTop","500"); > finishJSTest(); > }, 0); > } >diff --git a/LayoutTests/fast/dom/Element/scrolling-funtions-on-body-expected.txt b/LayoutTests/fast/dom/Element/scrolling-funtions-on-body-expected.txt >index 077fb9af42e8ba92c5bf25adbdbd7cb02100945e..4a1dcbb934db8fcc547206eb3cf827de475ac258 100644 >--- a/LayoutTests/fast/dom/Element/scrolling-funtions-on-body-expected.txt >+++ b/LayoutTests/fast/dom/Element/scrolling-funtions-on-body-expected.txt >@@ -1,20 +1,20 @@ >-Tests scrollTo/By(x,y) and scrollTo/By(scrollOptions) on the body. WebKit always uses quirks mode for body scrolling behavior, so this scrolls the window. >+Tests scrollTo/By(x,y) and scrollTo/By(scrollOptions) on the body in standard mode. > > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > > >-PASS scroller.scrollLeft is 20 >-PASS scroller.scrollTop is 500 >-PASS window.scrollX is 20 >-PASS window.scrollY is 500 >-PASS scroller.scrollLeft is 70 >-PASS scroller.scrollTop is 560 >-PASS window.scrollX is 70 >-PASS window.scrollY is 560 >-PASS scroller.scrollLeft is 100 >-PASS scroller.scrollTop is 400 >-PASS window.scrollX is 100 >-PASS window.scrollY is 400 >+PASS scroller.scrollLeft is 0 >+PASS scroller.scrollTop is 0 >+PASS window.scrollX is 0 >+PASS window.scrollY is 0 >+PASS scroller.scrollLeft is 0 >+PASS scroller.scrollTop is 0 >+PASS window.scrollX is 0 >+PASS window.scrollY is 0 >+PASS scroller.scrollLeft is 0 >+PASS scroller.scrollTop is 0 >+PASS window.scrollX is 0 >+PASS window.scrollY is 0 > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/dom/Element/scrolling-funtions-on-body.html b/LayoutTests/fast/dom/Element/scrolling-funtions-on-body.html >index 3191d0e36cf45aa2c855e4c98c6dd0a680097a4d..3f23eb28e6447cabc603e20fdd43db488a26d169 100644 >--- a/LayoutTests/fast/dom/Element/scrolling-funtions-on-body.html >+++ b/LayoutTests/fast/dom/Element/scrolling-funtions-on-body.html >@@ -11,27 +11,27 @@ > <script> > var scroller; > function runTest() { >- description('Tests scrollTo/By(x,y) and scrollTo/By(scrollOptions) on the body. WebKit always uses quirks mode for body scrolling behavior, so this scrolls the window.'); >+ description('Tests scrollTo/By(x,y) and scrollTo/By(scrollOptions) on the body in standard mode.'); > > scroller = document.body; > setTimeout(function() { > scroller.scrollTo(20, 500); >- shouldBe("scroller.scrollLeft", "20"); >- shouldBe("scroller.scrollTop", "500"); >- shouldBe("window.scrollX", "20"); >- shouldBe("window.scrollY", "500"); >+ shouldBe("scroller.scrollLeft", "0"); >+ shouldBe("scroller.scrollTop", "0"); >+ shouldBe("window.scrollX", "0"); >+ shouldBe("window.scrollY", "0"); > > scroller.scrollBy(50, 60); >- shouldBe("scroller.scrollLeft", "70"); >- shouldBe("scroller.scrollTop", "560"); >- shouldBe("window.scrollX", "70"); >- shouldBe("window.scrollY", "560"); >+ shouldBe("scroller.scrollLeft", "0"); >+ shouldBe("scroller.scrollTop", "0"); >+ shouldBe("window.scrollX", "0"); >+ shouldBe("window.scrollY", "0"); > > scroller.scrollTo({ 'left' : 100, 'top' : 400 }); >- shouldBe("scroller.scrollLeft", "100"); >- shouldBe("scroller.scrollTop", "400"); >- shouldBe("window.scrollX", "100"); >- shouldBe("window.scrollY", "400"); >+ shouldBe("scroller.scrollLeft", "0"); >+ shouldBe("scroller.scrollTop", "0"); >+ shouldBe("window.scrollX", "0"); >+ shouldBe("window.scrollY", "0"); > > scroller.scrollTo(0, 0); > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/HTMLBody-ScrollArea_quirksmode-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/HTMLBody-ScrollArea_quirksmode-expected.txt >index 45e53bb0b4c2b5519ba3773c083013ba6ab47410..402333d60a2b0bc6594503c327b009bc5824b722 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/HTMLBody-ScrollArea_quirksmode-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/HTMLBody-ScrollArea_quirksmode-expected.txt >@@ -3,10 +3,9 @@ PASS Ensure that body element is loaded. > PASS Ensure that style.overflowY can be set properly. > PASS document.compatMode should be BackCompat in quirks. > PASS document.scrollingElement should be body element in quirks. >-FAIL scrollingElement in quirks should be null when body is potentially scrollable. assert_equals: In quirks, we would expect null here (because of potentially scrollable body) expected null but got Element node <body id="thebody" style="overflow-y: scroll;"> >- <div ... >+PASS scrollingElement in quirks should be null when body is potentially scrollable. > PASS scrollingElement in quirks should be body if any of document and body has a visible overflow. >-FAIL When body potentially scrollable, document.body.scrollHeight changes when changing the height of the body content in quirks. assert_not_equals: got disallowed value 600 >+PASS When body potentially scrollable, document.body.scrollHeight changes when changing the height of the body content in quirks. > PASS When body not potentially scrollable, document.body.scrollHeight always equals window.innerHeight in quirks. (cond. visible, scroll) > PASS When body not potentially scrollable, document.body.scrollHeight always equals window.innerHeight in quirks. (cond. scroll, visible) > PASS When body not potentially scrollable, document.body.scrollHeight always equals window.innerHeight in quirks. (cond. visible, visible) >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks-expected.txt >index 284af1f94d411ecf825bae148ef3fb56f4ec0714..8f5148df5362162b7b85e8cfca336deeb3d0af49 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks-expected.txt >@@ -16,16 +16,16 @@ PASS clientWidth/clientHeight on the HTML body element in quirks mode > PASS scrollLeft/scrollRight of the content in quirks mode > PASS scrollWidth/scrollHeight of the content in quirks mode > PASS clientWidth/clientHeight of the content in quirks mode >-FAIL scrollingElement in non-quirks mode assert_equals: scrollingElement should be documentElement expected Element node <html><head></head><body style="overflow: hidden; margin:... but got Element node <body style="overflow: hidden; margin: 0px; border-width:... >-FAIL scroll() on the root element in non-quirks mode assert_equals: scrollLeft should be 50 expected 50 but got 0 >-FAIL scrollBy() on the root element in non-quirks mode assert_equals: scrollLeft should be 60 expected 60 but got 0 >-FAIL scrollLeft/scrollTop on the root element in non-quirks mode assert_equals: scrollLeft should be 70 expected 70 but got 0 >+PASS scrollingElement in non-quirks mode >+PASS scroll() on the root element in non-quirks mode >+PASS scrollBy() on the root element in non-quirks mode >+PASS scrollLeft/scrollTop on the root element in non-quirks mode > PASS scrollWidth/scrollHeight on the root element in non-quirks mode > PASS clientWidth/clientHeight on the root element in non-quirks mode >-FAIL scroll() on the HTML body element in non-quirks mode assert_equals: scrollLeft should be 0 expected 0 but got 90 >-FAIL scrollBy() on the HTML body element in non-quirks mode assert_equals: scrollLeft should be 0 expected 0 but got 100 >-FAIL scrollLeft/scrollTop on the HTML body element in non-quirks mode assert_equals: scrollLeft should be 0 expected 0 but got 120 >-FAIL scrollWidth/scrollHeight on the HTML body element in non-quirks mode assert_equals: scrollWidth should be 700 expected 700 but got 720 >+PASS scroll() on the HTML body element in non-quirks mode >+PASS scrollBy() on the HTML body element in non-quirks mode >+PASS scrollLeft/scrollTop on the HTML body element in non-quirks mode >+PASS scrollWidth/scrollHeight on the HTML body element in non-quirks mode > PASS clientWidth/clientHeight on the HTML body element in non-quirks mode > PASS scrollLeft/scrollRight of the content in non-quirks mode > PASS scrollWidth/scrollHeight of the content in non-quirks mode >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollingElement-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollingElement-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..627259a39e39b64b3d10a9fc75cfab8d5b702d78 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scrollingElement-expected.txt >@@ -0,0 +1,5 @@ >+ >+ >+PASS scrollingElement in quirks mode >+PASS scrollingElement in no-quirks mode >+ >diff --git a/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks-expected.txt b/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks-expected.txt >deleted file mode 100644 >index 605dd36ae31b7aa08882ccdbe2d7ab852de4d26a..0000000000000000000000000000000000000000 >--- a/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks-expected.txt >+++ /dev/null >@@ -1,33 +0,0 @@ >- >- >-PASS Execution of tests in quirks mode >-PASS Execution of tests in non-quirks mode >-PASS scrollingElement in quirks mode >-PASS scroll() on the root element in quirks mode >-PASS scrollBy() on the root element in quirks mode >-PASS scrollLeft/scrollTop on the root element in quirks mode >-PASS scrollWidth/scrollHeight on the root element in quirks mode >-PASS clientWidth/clientHeight on the root element in quirks mode >-FAIL scroll() on the HTML body element in quirks mode assert_equals: scrollLeft should be 90 expected 90 but got 0 >-FAIL scrollBy() on the HTML body element in quirks mode assert_equals: scrollLeft should be 100 expected 100 but got 0 >-FAIL scrollLeft/scrollTop on the HTML body element in quirks mode assert_equals: scrollLeft should be 120 expected 120 but got 0 >-PASS scrollWidth/scrollHeight on the HTML body element in quirks mode >-PASS clientWidth/clientHeight on the HTML body element in quirks mode >-PASS scrollLeft/scrollRight of the content in quirks mode >-PASS scrollWidth/scrollHeight of the content in quirks mode >-PASS clientWidth/clientHeight of the content in quirks mode >-FAIL scrollingElement in non-quirks mode assert_equals: scrollingElement should be documentElement expected Element node <html><head></head><body style="overflow: hidden; margin:... but got Element node <body style="overflow: hidden; margin: 0px; border-width:... >-FAIL scroll() on the root element in non-quirks mode assert_equals: scrollLeft should be 50 expected 50 but got 0 >-FAIL scrollBy() on the root element in non-quirks mode assert_equals: scrollLeft should be 60 expected 60 but got 0 >-FAIL scrollLeft/scrollTop on the root element in non-quirks mode assert_equals: scrollLeft should be 70 expected 70 but got 0 >-PASS scrollWidth/scrollHeight on the root element in non-quirks mode >-PASS clientWidth/clientHeight on the root element in non-quirks mode >-PASS scroll() on the HTML body element in non-quirks mode >-PASS scrollBy() on the HTML body element in non-quirks mode >-PASS scrollLeft/scrollTop on the HTML body element in non-quirks mode >-FAIL scrollWidth/scrollHeight on the HTML body element in non-quirks mode assert_equals: scrollWidth should be 700 expected 700 but got 720 >-PASS clientWidth/clientHeight on the HTML body element in non-quirks mode >-PASS scrollLeft/scrollRight of the content in non-quirks mode >-PASS scrollWidth/scrollHeight of the content in non-quirks mode >-PASS clientWidth/clientHeight of the content in non-quirks mode >- >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index 2e0b41f180b7df4f9e61939c96a1f1e4fddbaddb..2b39100e93c47677f391970c3041b7d06ad1ffda 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -2648,6 +2648,8 @@ webkit.org/b/163291 media/video-play-require-user-gesture.html > > webkit.org/b/163755 imported/w3c/web-platform-tests/css/css-shapes [ Skip ] > >+webkit.org/b/5991 imported/w3c/web-platform-tests/css/cssom-view/scrolling-quirks-vs-nonquirks.html [ Failure ] >+ > # Variation fonts are not implemented earlier than iOS 11. > fast/text/variations [ Pass Failure ImageOnlyFailure ] > animations/font-variations [ Pass Failure ImageOnlyFailure Timeout ] >diff --git a/LayoutTests/platform/ios/ios/fast/coordinates/page-offsets-expected.txt b/LayoutTests/platform/ios/ios/fast/coordinates/page-offsets-expected.txt >index 898303483ab7c52faf0f7660e9c3a3eefdeee4b3..7daee5ef8c5b9da64a73cfb65f56fc48721a673d 100644 >--- a/LayoutTests/platform/ios/ios/fast/coordinates/page-offsets-expected.txt >+++ b/LayoutTests/platform/ios/ios/fast/coordinates/page-offsets-expected.txt >@@ -3,18 +3,18 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > unscaled > PASS window.scrollX is 0 > PASS window.pageXOffset is 0 >-PASS document.body.scrollLeft is 0 >+PASS document.documentElement.scrollLeft is 0 > PASS window.scrollY is 0 > PASS window.pageYOffset is 0 >-PASS document.body.scrollTop is 0 >+PASS document.documentElement.scrollTop is 0 > > scaled and panned > PASS window.scrollX is 10 > PASS window.pageXOffset is 10 >-PASS document.body.scrollLeft is 10 >+PASS document.documentElement.scrollLeft is 10 > PASS window.scrollY is 10 > PASS window.pageYOffset is 10 >-PASS document.body.scrollTop is 10 >+PASS document.documentElement.scrollTop is 10 > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/platform/ios/ios/fast/coordinates/resources/helpers.js b/LayoutTests/platform/ios/ios/fast/coordinates/resources/helpers.js >index cdd75b9508ea137eca7b561966fc62584924b2a0..d1b96957b58f1535e910d446f36ddb0991653155 100644 >--- a/LayoutTests/platform/ios/ios/fast/coordinates/resources/helpers.js >+++ b/LayoutTests/platform/ios/ios/fast/coordinates/resources/helpers.js >@@ -51,10 +51,10 @@ function setExpectedScrollOffsets(x, y) { > function verifyScrollOffsets() { > shouldBe('window.scrollX', expectedScrollX.toString()); > shouldBe('window.pageXOffset', expectedScrollX.toString()); >- shouldBe('document.body.scrollLeft', expectedScrollX.toString()); >+ shouldBe('document.documentElement.scrollLeft', expectedScrollX.toString()); > shouldBe('window.scrollY', expectedScrollY.toString()); > shouldBe('window.pageYOffset', expectedScrollY.toString()); >- shouldBe('document.body.scrollTop', expectedScrollY.toString()); >+ shouldBe('document.documentElement.scrollTop', expectedScrollY.toString()); > } > > // To verify visible window sizes. >diff --git a/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html b/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html >index 5783f7ae16a72ced259b5b8711bef4323b02f693..1b3dfe0e5238cc0afd53fd4de7c6d0a9c96758e4 100644 >--- a/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html >+++ b/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html >@@ -43,14 +43,14 @@ var continueCount = 5; > > function onPageScroll() > { >- if (document.body.scrollTop >= 70) >+ if (document.scrollingElement.scrollTop >= 70) > checkForScroll(); > } > > function checkForScroll() > { > // The div should not have scrolled at all. >- var pageScrollPositionAfter = document.body.scrollTop; >+ var pageScrollPositionAfter = document.scrollingElement.scrollTop; > var divScrollPositionAfter = divTarget.scrollTop; > > if (divScrollPositionBefore != divScrollPositionAfter) >@@ -68,7 +68,7 @@ function checkForScroll() > > function scrollTest() > { >- pageScrollPositionBefore = document.body.scrollTop; >+ pageScrollPositionBefore = document.scrollingElement.scrollTop; > > divTarget = document.getElementById('target'); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 182230
:
332512
|
332513
|
332516
|
332519
|
332520
|
332529
|
332645
|
332650
|
332653
|
332857
|
332864
|
332874
|
340079
|
344695
|
348498
|
348619
|
348621
|
348623
|
348625
|
348627
|
348634
|
348769
|
348772
|
349118
|
349170
| 349174 |
349311