WebKit Bugzilla
Attachment 348615 Details for
Bug 182053
: [CSSOM View] Implement standard behavior for scrollingElement
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-182053-20180831091148.patch (text/plain), 31.41 KB, created by
Frédéric Wang (:fredw)
on 2018-08-31 00:11:50 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-08-31 00:11:50 PDT
Size:
31.41 KB
patch
obsolete
>Subversion Revision: 235537 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6940e6ebfcb0f6172e6952af5c507b634b8e7b9a..442b41546fba8e20ddbc988326d46a60e03ddd09 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,40 @@ >+2018-08-31 Frederic Wang <fwang@igalia.com> >+ >+ Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement >+ https://bugs.webkit.org/show_bug.cgi?id=182053 >+ >+ Reviewed by Simon Fraser. >+ >+ This commit introduces a new CSSOMViewScrollingAPIEnabled flag that will be used to implement >+ the standard behavior of DOM scroll* API as specified by the CSSOM View spec (see bug 5991). >+ It changes the behavior of document.scrollingElement so that it follows the spec when the >+ flag is enabled. This will allow to pass the WPT test cssom-view/scrollingElement.html when >+ it becomes the default behavior. WPT tests cssom-view/scrollingElement-quirks-dynamic*.html >+ still fail; comparing with Chromium's code, we might need to propagate the style of <html> >+ and <body> to the viewport element. Behaviors for other scrolling attributes will be changed >+ in follow-up bugs. >+ >+ Tests: fast/dom/Document/scrollingElement-quirks-mode.html >+ fast/dom/Document/scrollingElement-standard-mode.html >+ >+ * dom/Document.cpp: >+ (WebCore::Document::isBodyPotentiallyScrollable): Helper function to verify whether the body >+ is potentially scrollable, as defined by the CSSOM View spec. It seems that >+ RenderObject::hasOverflowClip() may return incorrect value at this point and we might need >+ to do something similar to Chromium's style propagation to make it work. For now, we just >+ use the computed style. See bug 182292. >+ (WebCore::Document::scrollingElement): When CSSOMViewScrollingAPIEnabled is enabled, we >+ implement the algorithm of the CSSOM View spec. >+ (WebCore::Document::body const): Verify that the root is actually a <html> element or >+ otherwise return null. This is required by the CSSOM View spec and for WPT test >+ scrollingElement.html. It is consistent with bodyOrFrameset(). >+ * dom/Document.h: Add spec references for body() and bodyOrFrameset() and declare >+ isBodyPotentiallyScrollable(). >+ * page/Settings.yaml: Add developer option for enabling the CSSOM View behavior. >+ * rendering/style/RenderStyle.h: >+ (WebCore::RenderStyle::isOverflowVisible const): Add helper function to check whether the >+ style implies visible overflow. >+ > 2018-08-30 Zalan Bujtas <zalan@apple.com> > > CounterMaps should hold a unique_ptr of CounterMap. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 0b00503cf0c7462a3277a4a2e9ced2e9a81f35e1..f82d9f4ee2f863a2c363f6ea5b9317b85a465f73 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2018-08-31 Frederic Wang <fwang@igalia.com> >+ >+ Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement >+ https://bugs.webkit.org/show_bug.cgi?id=182053 >+ >+ Reviewed by Simon Fraser. >+ >+ Add developer flag to use standard behavior for scrolling* attributes. >+ >+ * Shared/WebPreferences.yaml: >+ * UIProcess/API/C/WKPreferences.cpp: >+ (WKPreferencesSetCSSOMViewScrollingAPIEnabled): >+ (WKPreferencesGetCSSOMViewScrollingAPIEnabled): >+ * UIProcess/API/C/WKPreferencesRefPrivate.h: >+ > 2018-08-30 Tim Horton <timothy_horton@apple.com> > > One more build fix >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 99b64c09886fc42c52d9dbb6cf989d7df41db1f1..685ecf2b90e4e5328b4d4631c62e341201068f7f 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,21 @@ >+2018-08-31 Frederic Wang <fwang@igalia.com> >+ >+ Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement >+ https://bugs.webkit.org/show_bug.cgi?id=182053 >+ >+ Reviewed by Simon Fraser. >+ >+ Add developer flag to use standard behavior for scrolling* attributes. >+ >+ * WebView/WebPreferenceKeysPrivate.h: >+ * WebView/WebPreferences.mm: >+ (+[WebPreferences initialize]): >+ (-[WebPreferences CSSOMViewScrollingAPIEnabled]): >+ (-[WebPreferences setCSSOMViewScrollingAPIEnabled:]): >+ * WebView/WebPreferencesPrivate.h: >+ * WebView/WebView.mm: >+ (-[WebView _preferencesChanged:]): >+ > 2018-08-29 Olivia Barnett <obarnett@apple.com> > > Implement the Web Share API >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 225470221498387e77c42d51eb8f33c2732668c5..c2b9b1a824c7a57a4c69d03626486ab9434c7703 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,22 @@ >+2018-08-31 Frederic Wang <fwang@igalia.com> >+ >+ Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement >+ https://bugs.webkit.org/show_bug.cgi?id=182053 >+ >+ Reviewed by Simon Fraser. >+ >+ Add developer flag to use standard behavior for scrolling* attributes. >+ >+ * Interfaces/IWebPreferencesPrivate.idl: >+ * WebPreferenceKeysPrivate.h: >+ * WebPreferences.cpp: >+ (WebPreferences::initializeDefaultSettings): >+ (WebPreferences::CSSOMViewScrollingAPIEnabled): >+ (WebPreferences::setCSSOMViewScrollingAPIEnabled): >+ * WebPreferences.h: >+ * WebView.cpp: >+ (WebView::notifyPreferencesChanged): >+ > 2018-08-30 Don Olmstead <don.olmstead@sony.com> > > [CMake] Replace AVFoundationSupport.py using CMake >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index e723591a9133ca518ba0a4e512ed17fc4d74ce8e..928fe7deee2248f0a39f8889ef52090d6da7a444 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -1443,10 +1443,46 @@ RefPtr<Range> Document::caretRangeFromPoint(const LayoutPoint& clientPoint) > return Range::create(*this, node, offset, node, offset); > } > >+bool Document::isBodyPotentiallyScrollable(HTMLBodyElement& body) >+{ >+ // See https://www.w3.org/TR/cssom-view-1/#potentially-scrollable. >+ // An element is potentially scrollable if all of the following conditions are true: >+ // - The element has an associated CSS layout box. >+ // - The element is not the HTML body element, or it is and the root element's used value of the >+ // overflow-x or overflow-y properties is not visible. >+ // - The element's used value of the overflow-x or overflow-y properties is not visible. >+ // >+ // FIXME: We should use RenderObject::hasOverflowClip() instead of Element::computedStyle() but >+ // the used values are currently not correctly updated. See https://webkit.org/b/182292. >+ return body.renderer() >+ && documentElement()->computedStyle() >+ && !documentElement()->computedStyle()->isOverflowVisible() >+ && body.computedStyle() >+ && !body.computedStyle()->isOverflowVisible(); >+} >+ > Element* Document::scrollingElement() > { >- // FIXME: When we fix https://bugs.webkit.org/show_bug.cgi?id=106133, this should be replaced with the full implementation >- // of Document.scrollingElement() as specified at http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement. >+ if (settings().CSSOMViewScrollingAPIEnabled()) { >+ // See https://drafts.csswg.org/cssom-view/#dom-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. >+ if (firstBody && !isBodyPotentiallyScrollable(*firstBody)) >+ return firstBody; >+ >+ // 2. Return null and abort these steps. >+ return nullptr; >+ } >+ >+ // 2. If there is a root element, return the root element and abort these steps. >+ // 3. Return null. >+ return documentElement(); >+ } > > return body(); > } >@@ -2704,7 +2740,7 @@ void Document::implicitOpen() > HTMLBodyElement* Document::body() const > { > auto* element = documentElement(); >- if (!element) >+ if (!is<HTMLHtmlElement>(element)) > return nullptr; > return childrenOfType<HTMLBodyElement>(*element).first(); > } >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index d39938660998862e78dc0e7bd25871a50b6af1a3..22769442f0c55dd28c9a387b75719a158c5a5919 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -960,7 +960,12 @@ public: > static bool hasValidNamespaceForElements(const QualifiedName&); > static bool hasValidNamespaceForAttributes(const QualifiedName&); > >+ // This is the "HTML body element" as defined by CSSOM View spec, the first body child of the >+ // document element. See http://dev.w3.org/csswg/cssom-view/#the-html-body-element. > WEBCORE_EXPORT HTMLBodyElement* body() const; >+ >+ // This is the "body element" as defined by HTML5, the first body or frameset child of the >+ // document element. See https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2. > WEBCORE_EXPORT HTMLElement* bodyOrFrameset() const; > WEBCORE_EXPORT ExceptionOr<void> setBodyOrFrameset(RefPtr<HTMLElement>&&); > >@@ -1604,6 +1609,8 @@ private: > > void enableTemporaryTimeUserGesture(); > >+ bool isBodyPotentiallyScrollable(HTMLBodyElement&); >+ > const Ref<Settings> m_settings; > > std::unique_ptr<StyleResolver> m_userAgentShadowTreeStyleResolver; >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index 2122e909135c2b1f7fe84d6a2d089bd72a7a044a..24514295a5e63d841691cc07f1398dfed42d41ad 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -554,6 +554,9 @@ visualViewportEnabled: > visualViewportAPIEnabled: > initial: false > >+CSSOMViewScrollingAPIEnabled: >+ initial: false >+ > inputEventsEnabled: > initial: true > >diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h >index 42c8b452c606ba56ddcc9749ef2435ec46d581ee..a208500f07bfede7c2c8c7beaf27088a05577237 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.h >+++ b/Source/WebCore/rendering/style/RenderStyle.h >@@ -331,6 +331,7 @@ public: > Overflow overflowY() const { return static_cast<Overflow>(m_nonInheritedFlags.overflowY); } > Overflow overflowInlineDirection() const { return isHorizontalWritingMode() ? overflowX() : overflowY(); } > Overflow overflowBlockDirection() const { return isHorizontalWritingMode() ? overflowY() : overflowX(); } >+ bool isOverflowVisible() const { return overflowX() == Overflow::Visible || overflowY() == Overflow::Visible; } > > Visibility visibility() const { return static_cast<Visibility>(m_inheritedFlags.visibility); } > VerticalAlign verticalAlign() const { return static_cast<VerticalAlign>(m_nonInheritedFlags.verticalAlign); } >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index 10f49ba460902e87d89851f639000d680dbe60af..94a01eb260e6fe47118818c6c077d9c1b7bf9efc 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1198,6 +1198,13 @@ VisualViewportAPIEnabled: > humanReadableDescription: "Enable Visual Viewport API" > category: experimental > >+CSSOMViewScrollingAPIEnabled: >+ type: bool >+ defaultValue: false >+ humanReadableName: "CSSOM View Scrolling API" >+ humanReadableDescription: "Implement standard behavior for scrollLeft, scrollTop, scrollWidth, scrollHeight, scrollTo, scrollBy and scrollingElement." >+ category: experimental >+ > WebAnimationsEnabled: > type: bool > defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED >diff --git a/Source/WebKit/UIProcess/API/C/WKPreferences.cpp b/Source/WebKit/UIProcess/API/C/WKPreferences.cpp >index cf73032327ab44fbefe7051e1a85c11d165198d9..2e1ce2206bb50aa58b698be768f3d624d0ef18ad 100644 >--- a/Source/WebKit/UIProcess/API/C/WKPreferences.cpp >+++ b/Source/WebKit/UIProcess/API/C/WKPreferences.cpp >@@ -1978,6 +1978,16 @@ bool WKPreferencesGetAriaReflectionEnabled(WKPreferencesRef preferencesRef) > return toImpl(preferencesRef)->ariaReflectionEnabled(); > } > >+void WKPreferencesSetCSSOMViewScrollingAPIEnabled(WKPreferencesRef preferencesRef, bool flag) >+{ >+ toImpl(preferencesRef)->setCSSOMViewScrollingAPIEnabled(flag); >+} >+ >+bool WKPreferencesGetCSSOMViewScrollingAPIEnabled(WKPreferencesRef preferencesRef) >+{ >+ return toImpl(preferencesRef)->cssOMViewScrollingAPIEnabled(); >+} >+ > void WKPreferencesSetShouldAllowUserInstalledFonts(WKPreferencesRef preferencesRef, bool flag) > { > toImpl(preferencesRef)->setShouldAllowUserInstalledFonts(flag); >diff --git a/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h b/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h >index 862a045737c6fd92c5854731ff19007e8066d50c..a90ad3c12fc0e20d663d5033887bb34ba88b10a1 100644 >--- a/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h >+++ b/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h >@@ -569,6 +569,10 @@ WK_EXPORT bool WKPreferencesGetAccessibilityObjectModelEnabled(WKPreferencesRef) > WK_EXPORT void WKPreferencesSetAriaReflectionEnabled(WKPreferencesRef, bool flag); > WK_EXPORT bool WKPreferencesGetAriaReflectionEnabled(WKPreferencesRef); > >+// Defaults to false. >+WK_EXPORT void WKPreferencesSetCSSOMViewScrollingAPIEnabled(WKPreferencesRef, bool); >+WK_EXPORT bool WKPreferencesGetCSSOMViewScrollingAPIEnabled(WKPreferencesRef); >+ > // Defaults to false. > WK_EXPORT void WKPreferencesSetShouldAllowUserInstalledFonts(WKPreferencesRef, bool flag); > WK_EXPORT bool WKPreferencesGetShouldAllowUserInstalledFonts(WKPreferencesRef); >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h b/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >index d774691c817a48bcd7d3ffafd604ef29158d226f..2e022e658c1ffdc3774d5762d295d7a9f949b5ec 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >@@ -182,6 +182,7 @@ > #define WebKitDirectoryUploadEnabledPreferenceKey @"WebKitDirectoryUploadEnabled" > #define WebKitVisualViewportEnabledPreferenceKey @"WebKitVisualViewportEnabled" > #define WebKitVisualViewportAPIEnabledPreferenceKey @"WebKitVisualViewportAPIEnabled" >+#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey @"WebKitCSSOMViewScrollingAPIEnabled" > #define WebKitModernMediaControlsEnabledPreferenceKey @"WebKitModernMediaControlsEnabled" > #define WebKitSubtleCryptoEnabledPreferenceKey @"WebKitSubtleCryptoEnabled" > #define WebKitMediaDevicesEnabledPreferenceKey @"WebKitMediaDevicesEnabled" >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >index be6eb0b632205d2ff16f80ec3538806fde46e8fd..2d1a9d73e8d70fb5204897584dec3907a78877e3 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >@@ -654,6 +654,7 @@ public: > #endif > [NSNumber numberWithBool:NO], WebKitVisualViewportAPIEnabledPreferenceKey, > >+ [NSNumber numberWithBool:NO], WebKitCSSOMViewScrollingAPIEnabledPreferenceKey, > [NSNumber numberWithBool:YES], WebKitNeedsStorageAccessFromFileURLsQuirkKey, > [NSNumber numberWithBool:NO], WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey, > #if ENABLE(MEDIA_STREAM) >@@ -3092,6 +3093,16 @@ static NSString *classIBCreatorID = nil; > [self _setBoolValue:flag forKey:WebKitVisualViewportAPIEnabledPreferenceKey]; > } > >+- (BOOL)CSSOMViewScrollingAPIEnabled >+{ >+ return [self _boolValueForKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey]; >+} >+ >+- (void)setCSSOMViewScrollingAPIEnabled:(BOOL)flag >+{ >+ [self _setBoolValue:flag forKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey]; >+} >+ > - (BOOL)webAnimationsEnabled > { > return [self _boolValueForKey:WebKitWebAnimationsEnabledPreferenceKey]; >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h b/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h >index 894011833fa83b4115ba5e6cc430b06dee336c6e..3076ad24137c64059453e1c1377276fd244b3d5c 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h >@@ -584,6 +584,7 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR > > @property (nonatomic) BOOL visualViewportEnabled; > @property (nonatomic) BOOL visualViewportAPIEnabled; >+@property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled; > @property (nonatomic) BOOL largeImageAsyncDecodingEnabled; > @property (nonatomic) BOOL animatedImageAsyncDecodingEnabled; > @property (nonatomic) BOOL javaScriptMarkupEnabled; >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index 0121b084f634b8faeecdf8ec2521e85d03b7ea5b..e6218431be6023908dacb5672f84499937aff437 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -2938,6 +2938,7 @@ static bool needsSelfRetainWhileLoadingQuirk() > > settings.setVisualViewportEnabled([preferences visualViewportEnabled]); > settings.setVisualViewportAPIEnabled([preferences visualViewportAPIEnabled]); >+ settings.setCSSOMViewScrollingAPIEnabled([preferences CSSOMViewScrollingAPIEnabled]); > settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]); > > switch ([preferences storageBlockingPolicy]) { >diff --git a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl b/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl >index d1643f3facd336bbe50f4d83f5a2f0c74805a49b..19882cdd0f0c6d74e5bd27a72507e9dc7567e8f1 100644 >--- a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl >+++ b/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl >@@ -221,6 +221,8 @@ interface IWebPreferencesPrivate6 : IWebPreferencesPrivate5 > HRESULT setInspectorAdditionsEnabled([in] BOOL enabled); > HRESULT visualViewportAPIEnabled([out, retval] BOOL*); > HRESULT setVisualViewportAPIEnabled([in] BOOL enabled); >+ HRESULT CSSOMViewScrollingAPIEnabled([out, retval] BOOL*); >+ HRESULT setCSSOMViewScrollingAPIEnabled([in] BOOL enabled); > HRESULT fetchAPIKeepAliveEnabled([out, retval] BOOL* enabled); > HRESULT setFetchAPIKeepAliveEnabled([in] BOOL enabled); > HRESULT spatialNavigationEnabled([out, retval] BOOL *enabled); >diff --git a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h b/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >index 3c48fb078dc92d7b947d17695a1640039751be29..2ffe49ca8b95657914fecc9f9b58dcfefbecb379 100644 >--- a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >+++ b/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >@@ -205,3 +205,6 @@ > #define WebKitVisualViewportAPIEnabledPreferenceKey "WebKitVisualViewportAPIEnabled" > > #define WebKitServerTimingEnabledPreferenceKey "WebKitServerTimingEnabled" >+ >+#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey "WebKitCSSOMViewScrollingAPIEnabled" >+ >diff --git a/Source/WebKitLegacy/win/WebPreferences.cpp b/Source/WebKitLegacy/win/WebPreferences.cpp >index c08f2f72720a26ac67e69e923617ad7616531af9..f1d81d83dccf755ee747dcef34a7a18dda6ad7c4 100644 >--- a/Source/WebKitLegacy/win/WebPreferences.cpp >+++ b/Source/WebKitLegacy/win/WebPreferences.cpp >@@ -328,6 +328,8 @@ void WebPreferences::initializeDefaultSettings() > > CFDictionaryAddValue(defaults, CFSTR(WebKitVisualViewportAPIEnabledPreferenceKey), kCFBooleanFalse); > >+ CFDictionaryAddValue(defaults, CFSTR(WebKitCSSOMViewScrollingAPIEnabledPreferenceKey), kCFBooleanFalse); >+ > defaultSettings = defaults; > } > >@@ -2185,6 +2187,20 @@ HRESULT WebPreferences::setVisualViewportAPIEnabled(BOOL enabled) > return S_OK; > } > >+HRESULT WebPreferences::CSSOMViewScrollingAPIEnabled(_Out_ BOOL* enabled) >+{ >+ if (!enabled) >+ return E_POINTER; >+ *enabled = boolValueForKey(WebKitCSSOMViewScrollingAPIEnabledPreferenceKey); >+ return S_OK; >+} >+ >+HRESULT WebPreferences::setCSSOMViewScrollingAPIEnabled(BOOL enabled) >+{ >+ setBoolValue(WebKitCSSOMViewScrollingAPIEnabledPreferenceKey, enabled); >+ return S_OK; >+} >+ > HRESULT WebPreferences::setApplicationId(BSTR applicationId) > { > m_applicationId = String(applicationId).createCFString(); >diff --git a/Source/WebKitLegacy/win/WebPreferences.h b/Source/WebKitLegacy/win/WebPreferences.h >index ae76f99bbe348f56864318e4f796ac65f769b217..3ce4485b8a0170f5efed7982fbdf58608a162a4b 100644 >--- a/Source/WebKitLegacy/win/WebPreferences.h >+++ b/Source/WebKitLegacy/win/WebPreferences.h >@@ -269,6 +269,8 @@ public: > virtual HRESULT STDMETHODCALLTYPE setInspectorAdditionsEnabled(BOOL); > virtual HRESULT STDMETHODCALLTYPE visualViewportAPIEnabled(_Out_ BOOL*); > virtual HRESULT STDMETHODCALLTYPE setVisualViewportAPIEnabled(BOOL); >+ virtual HRESULT STDMETHODCALLTYPE CSSOMViewScrollingAPIEnabled(_Out_ BOOL*); >+ virtual HRESULT STDMETHODCALLTYPE setCSSOMViewScrollingAPIEnabled(BOOL); > virtual HRESULT STDMETHODCALLTYPE fetchAPIKeepAliveEnabled(_Out_ BOOL*); > virtual HRESULT STDMETHODCALLTYPE setFetchAPIKeepAliveEnabled(BOOL); > virtual HRESULT STDMETHODCALLTYPE spatialNavigationEnabled(_Out_ BOOL*); >diff --git a/Source/WebKitLegacy/win/WebView.cpp b/Source/WebKitLegacy/win/WebView.cpp >index c9e52137df1f2c5d99215f702afbc69872fd419f..f543a032d2dbc118a2a72aa99471b3f2a17837f5 100644 >--- a/Source/WebKitLegacy/win/WebView.cpp >+++ b/Source/WebKitLegacy/win/WebView.cpp >@@ -5284,6 +5284,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) > return hr; > settings.setCrossOriginWindowPolicySupportEnabled(!!enabled); > >+ hr = prefsPrivate->CSSOMViewScrollingAPIEnabled(&enabled); >+ if (FAILED(hr)) >+ return hr; >+ settings.setCSSOMViewScrollingAPIEnabled(!!enabled); >+ > hr = preferences->privateBrowsingEnabled(&enabled); > if (FAILED(hr)) > return hr; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index e2b377bb8a506163753a41ab6227bfd5e17f599c..21752b38ad79f61ebafef5a30d5f35b20bb2a091 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,20 @@ >+2018-08-31 Frederic Wang <fwang@igalia.com> >+ >+ Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement >+ https://bugs.webkit.org/show_bug.cgi?id=182053 >+ >+ Reviewed by Simon Fraser. >+ >+ Add FIXMEs comments to add the new developer flag in the future and disable it for now. >+ >+ * DumpRenderTree/mac/DumpRenderTree.mm: >+ (enableExperimentalFeatures): >+ (resetWebPreferencesToConsistentValues): >+ * DumpRenderTree/win/DumpRenderTree.cpp: >+ (enableExperimentalFeatures): >+ * WebKitTestRunner/TestController.cpp: >+ (WTR::TestController::resetPreferencesToConsistentValues): >+ > 2018-08-30 Thomas Denney <tdenney@apple.com> > > [WHLSL] Fix array indexing behavior >diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >index 15c68786014fffaafadb36d291a65df22d2c0438..4341388c74241302cdd6d25a5335a779d2b41d2e 100644 >--- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm >+++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >@@ -869,6 +869,7 @@ static void enableExperimentalFeatures(WebPreferences* preferences) > [preferences setServerTimingEnabled:YES]; > [preferences setIntersectionObserverEnabled:YES]; > preferences.sourceBufferChangeTypeEnabled = YES; >+ // FIXME: CSSOMViewScrollingAPIEnabled > } > > // Called before each test. >@@ -921,6 +922,7 @@ 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 70465cf031bd4635e331695bb38850a0df550b22..6c530515a0be5cc2d524d5c5d9bd5dbb7b6bf394 100644 >--- a/Tools/DumpRenderTree/win/DumpRenderTree.cpp >+++ b/Tools/DumpRenderTree/win/DumpRenderTree.cpp >@@ -785,6 +785,7 @@ static void enableExperimentalFeatures(IWebPreferences* preferences) > // FIXME: InputEvents > // FIXME: SubtleCrypto > prefsPrivate->setVisualViewportAPIEnabled(TRUE); >+ // FIXME: CSSOMViewScrollingAPI > prefsPrivate->setWebAnimationsEnabled(TRUE); > prefsPrivate->setServerTimingEnabled(TRUE); > // FIXME: WebGL2 >diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp >index 41b95051202107b1ac6d8367fd72fb3b155b41cb..7cdaaf0a869abac2ba66d57fbfeea2d732791a4f 100644 >--- a/Tools/WebKitTestRunner/TestController.cpp >+++ b/Tools/WebKitTestRunner/TestController.cpp >@@ -791,6 +791,7 @@ void TestController::resetPreferencesToConsistentValues(const TestOptions& optio > > WKPreferencesSetAccessibilityObjectModelEnabled(preferences, true); > WKPreferencesSetAriaReflectionEnabled(preferences, true); >+ WKPreferencesSetCSSOMViewScrollingAPIEnabled(preferences, false); > WKPreferencesSetMediaCapabilitiesEnabled(preferences, true); > > WKPreferencesSetCrossOriginWindowPolicyEnabled(preferences, true); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 0b7089a597efb39b71b67697d1005ba164b7566e..ae85e65c694d0fff00bfe3bceb90d2e83dbeebc0 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,20 @@ >+2018-08-31 Frederic Wang <fwang@igalia.com> >+ >+ Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement >+ https://bugs.webkit.org/show_bug.cgi?id=182053 >+ >+ Reviewed by Simon Fraser. >+ >+ Add a test to check that in Quirks mode, the <body> element returned by >+ document.scrollingElement is indeed a child of a <html> root (i.e. in the HTML namespace). >+ Adjust scrollingElement*.html tests so that they are executed with the flag >+ CSSOMViewScrollingAPI enabled and update expectations now that these tests pass. >+ >+ * fast/dom/Document/scrollingElement-quirks-mode.html: >+ * fast/dom/Document/scrollingElement-quirks-mode-expected.txt: >+ * fast/dom/Document/scrollingElement-standards-mode.html: >+ * fast/dom/Document/scrollingElement-standards-mode-expected.txt: >+ > 2018-08-30 Zalan Bujtas <zalan@apple.com> > > CounterMaps should hold a unique_ptr of CounterMap. >diff --git a/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode-expected.txt b/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode-expected.txt >index 518696ba35e73e4afc37351f709efcb226bbcaa0..50aa684f704ea3979be45af31a06b6062dfc44b3 100644 >--- a/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode-expected.txt >+++ b/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode-expected.txt >@@ -8,10 +8,11 @@ PASS document.scrollingElement is document.body > PASS document.scrollingElement is document.body > PASS document.scrollingElement is document.body > In quirks mode, if the `BODY` is scrollable, the scrolling element is `null` >-INTENTIONAL FAILURE. This can be fixed once https://bugs.webkit.org/show_bug.cgi?id=106133 is fixed. >-FAIL document.scrollingElement.scrollingElement should be null (of type object). Was undefined (of type undefined). >+PASS document.scrollingElement is null > In quirks mode, if the `BODY` is `display: none`, the scrolling element is `BODY` > PASS document.scrollingElement is document.body >+In quirks mode, the document.scrollingElement is null if there is no `HTML` root. >+PASS scrollingElement is null > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode.html b/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode.html >index 16c8ca4331f97e13a3a9e5e76896672dde6f76ac..56492a05b8d88a3651a472c65f62572cc892414f 100644 >--- a/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode.html >+++ b/LayoutTests/fast/dom/Document/scrollingElement-quirks-mode.html >@@ -5,6 +5,8 @@ > </head> > <body> > <script> >+if (window.internals) >+ internals.settings.setCSSOMViewScrollingAPIEnabled(true); > > description("Tests the behavior of document.scrollingElement in quirks mode."); > >@@ -20,10 +22,9 @@ document.body.setAttribute('style', 'overflow: scroll'); > shouldBe("document.scrollingElement", "document.body"); > > debug("In quirks mode, if the `BODY` is scrollable, the scrolling element is `null`"); >-debug("INTENTIONAL FAILURE. This can be fixed once https://bugs.webkit.org/show_bug.cgi?id=106133 is fixed."); > document.documentElement.setAttribute('style', 'overflow: scroll'); > document.body.setAttribute('style', 'overflow: scroll'); >-shouldBeNull("document.scrollingElement.scrollingElement"); >+shouldBeNull("document.scrollingElement"); > > debug("In quirks mode, if the `BODY` is `display: none`, the scrolling element is `BODY`"); > document.documentElement.setAttribute('style', 'overflow: scroll'); >@@ -32,6 +33,16 @@ shouldBe("document.scrollingElement", "document.body"); > > document.body.setAttribute('style', ''); > >+debug("In quirks mode, the document.scrollingElement is null if there is no `HTML` root."); >+// We save and restore the root before testing so that the result can be printed. >+var oldRoot = document.removeChild(document.documentElement); >+document.appendChild(document.createElementNS("foobarNS", "html")); >+document.documentElement.appendChild(document.createElement("body")); >+var scrollingElement = document.scrollingElement; >+document.removeChild(document.documentElement); >+document.appendChild(oldRoot); >+shouldBeNull("scrollingElement"); >+ > </script> > <script src="../../../resources/js-test-post.js"></script> > </body> >diff --git a/LayoutTests/fast/dom/Document/scrollingElement-standards-mode-expected.txt b/LayoutTests/fast/dom/Document/scrollingElement-standards-mode-expected.txt >index 5bf5a1c39a44410ba7831188cdb1f89ad93f7ec3..eb55f90727c025f06ff113aa1382a7b2c10473b3 100644 >--- a/LayoutTests/fast/dom/Document/scrollingElement-standards-mode-expected.txt >+++ b/LayoutTests/fast/dom/Document/scrollingElement-standards-mode-expected.txt >@@ -4,8 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > > > In standards mode the scrolling element is supposed to be `HTML` >-INTENTIONAL FAILURE. This can be fixed once https://bugs.webkit.org/show_bug.cgi?id=106133 is fixed. >-FAIL document.scrollingElement should be [object HTMLHtmlElement]. Was [object HTMLBodyElement]. >+PASS document.scrollingElement is document.documentElement > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/dom/Document/scrollingElement-standards-mode.html b/LayoutTests/fast/dom/Document/scrollingElement-standards-mode.html >index 05029565d5bed017c524eb89a3e412f5ba0e401b..89012f7bec28e13a2f3f464419cc802ea3eb3378 100644 >--- a/LayoutTests/fast/dom/Document/scrollingElement-standards-mode.html >+++ b/LayoutTests/fast/dom/Document/scrollingElement-standards-mode.html >@@ -6,11 +6,12 @@ > </head> > <body> > <script> >+if (window.internals) >+ internals.settings.setCSSOMViewScrollingAPIEnabled(true); > > description("Tests the behavior of document.scrollingElement in standards mode."); > > debug("In standards mode the scrolling element is supposed to be `HTML`"); >-debug("INTENTIONAL FAILURE. This can be fixed once https://bugs.webkit.org/show_bug.cgi?id=106133 is fixed."); > shouldBe("document.scrollingElement", "document.documentElement"); > > </script>
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 182053
:
332173
|
332362
|
332363
|
332364
|
332365
|
332371
|
332402
|
332412
|
332413
|
332465
|
332466
|
332471
|
332510
|
333273
|
340078
|
344694
|
348497
| 348615