WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-182053-20180127113657.patch (text/plain), 33.81 KB, created by
Frédéric Wang (:fredw)
on 2018-01-27 02:36:59 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-01-27 02:36:59 PST
Size:
33.81 KB
patch
obsolete
>Subversion Revision: 227714 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d59b5afe62ecd3e11807e197667cbb16353e93af..9e4dd8bf08f3908e4e72c38caedb64b08ce959a3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,41 @@ >+2018-01-26 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 NOBODY (OOPS!). >+ >+ 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::isPotentiallyScrollable): 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 (see also >+ discussions on https://bugs.chromium.org/p/chromium/issues/detail?id=665927). For now, we >+ just use the computed style. >+ (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 >+ isPotentiallyScrollable(). >+ * 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-01-26 Antoine Quint <graouts@apple.com> > > [Web Animations] Distinguish between an omitted and a null timeline argument to the Animation constructor >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 2287815f752413b0461d2d08b07d002a5e29b55f..8886242255e2960d1c0d1af07002d0eea84bf3b0 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2018-01-26 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 NOBODY (OOPS!). >+ >+ Add developer flag to use standard behavior for scrolling* attributes and disable it for now. >+ >+ * Shared/WebPreferences.yaml: >+ * WebProcess/InjectedBundle/API/c/WKBundle.cpp: >+ (WKBundleSetCSSOMViewScrollingAPIEnabled): >+ * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: >+ * WebProcess/InjectedBundle/InjectedBundle.cpp: >+ (WebKit::InjectedBundle::setCSSOMViewScrollingAPIEnabled): >+ * WebProcess/InjectedBundle/InjectedBundle.h: >+ > 2018-01-26 Megan Gardner <megan_gardner@apple.com> > > Don't retain focus for input peripheral views >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 6b7192e88793786eb6bda8c25368459acebc0ab9..cf97dc7f2cd8dd730be31bd0678480eaaf0be704 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,21 @@ >+2018-01-26 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 NOBODY (OOPS!). >+ >+ 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-01-24 Alex Christensen <achristensen@webkit.org> > > Remove unused QTKit preference >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 3eeab648917736cb6e3ab31e2cfd2c9ca376dde1..c970f44873c2322186303faa514dfb347cde0900 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,22 @@ >+2018-01-26 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 NOBODY (OOPS!). >+ >+ Add developer flag to use standard behavior for scrolling* attributes. >+ >+ * Interfaces/IWebPreferencesPrivate.idl: >+ * WebPreferenceKeysPrivate.h: >+ * WebPreferences.cpp: >+ (WebPreferences::initializeDefaultSettings): >+ (WebPreferences::CSSOMViewScrollingAPIEnabled): >+ (WebPreferences::setCSSOMViewScrollingAPIViewEnabled): >+ * WebPreferences.h: >+ * WebView.cpp: >+ (WebView::notifyPreferencesChanged): >+ > 2018-01-24 Wenson Hsieh <wenson_hsieh@apple.com> > > Unreviewed, another attempt to fix the Windows build after r227479. >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index b14db7a45ce7012d41bd2e625f0fd802b96ca416..e00ab0535fbe22ba62ed2123e3e8b4d14ecad574 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -1436,10 +1436,45 @@ RefPtr<Range> Document::caretRangeFromPoint(const LayoutPoint& clientPoint) > return Range::create(*this, node, offset, node, offset); > } > >+bool Document::isPotentiallyScrollable(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: Use RenderObject::hasOverflowClip() instead of Element::computedStyle()? >+ 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()) { >+ updateLayout(); >+ 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 && !isPotentiallyScrollable(*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(); > } >@@ -2660,7 +2695,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 1e22868a365f2cbfef57155962d634f935bf26bf..c85e50c0e5ef3c7a20ed747494c176f7a1dfc850 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -927,8 +927,14 @@ 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>&&); > > Location* location() const; >@@ -1520,6 +1526,8 @@ private: > > bool domainIsRegisterable(const String&) const; > >+ bool isPotentiallyScrollable(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 4feac480c048e09d1ca491ae1c32ea533f27869e..3a7526264d4c2218ef89340f48f0aea3bc0ee704 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -531,6 +531,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 9479e8aea3322fb7d8c68502aadaad1fb7d78090..46c1b5bde935c6f1fe31ed3498de89ad3e58f148 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.h >+++ b/Source/WebCore/rendering/style/RenderStyle.h >@@ -330,6 +330,7 @@ public: > EOverflow overflowY() const { return static_cast<EOverflow>(m_nonInheritedFlags.overflowY); } > EOverflow overflowInlineDirection() const { return isHorizontalWritingMode() ? overflowX() : overflowY(); } > EOverflow overflowBlockDirection() const { return isHorizontalWritingMode() ? overflowY() : overflowX(); } >+ bool isOverflowVisible() const { return overflowX() == OVISIBLE || overflowY() == OVISIBLE; } > > EVisibility visibility() const { return static_cast<EVisibility>(m_inheritedFlags.visibility); } > EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(m_nonInheritedFlags.verticalAlign); } >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index 43d5063a3b24852756f24a3e3730a074195616df..40a46dad0ae6d14eda5d84453ec36f4edcf6ea06 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1152,6 +1152,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: false >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >index 7b51504ae577f047f0754164ff56f85ff385b3ec..9c36fabd209b42680c0b5f11dfd740b1b8584637 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >@@ -163,6 +163,11 @@ void WKBundleSetAsyncFrameScrollingEnabled(WKBundleRef bundleRef, WKBundlePageGr > toImpl(bundleRef)->setAsyncFrameScrollingEnabled(toImpl(pageGroupRef), enabled); > } > >+void WKBundleSetCSSOMViewScrollingAPIEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled) >+{ >+ toImpl(bundleRef)->setCSSOMViewScrollingAPIEnabled(toImpl(pageGroupRef), enabled); >+} >+ > void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled) > { > toImpl(bundleRef)->setJavaScriptCanAccessClipboard(toImpl(pageGroupRef), enabled); >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h >index e42422890c0e16e1480deddc66d4b72e17f320f1..cf2cc98daed6f0052c109dc4802801b2ef528798 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h >@@ -49,6 +49,7 @@ WK_EXPORT void WKBundleSetAllowStorageAccessFromFileURLS(WKBundleRef bundle, WKB > WK_EXPORT void WKBundleSetMinimumLogicalFontSize(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, int size); > WK_EXPORT void WKBundleSetFrameFlatteningEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); > WK_EXPORT void WKBundleSetAsyncFrameScrollingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); >+WK_EXPORT void WKBundleSetCSSOMViewScrollingAPIEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); > WK_EXPORT void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); > WK_EXPORT void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); > WK_EXPORT void WKBundleSetUseDashboardCompatibilityMode(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); >diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >index 9d827d5aeadaef3c6e6093a6036d5b878757d5da..4333fd85fd4792dfabbaba6450f308d0466c4e24 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >@@ -319,6 +319,13 @@ void InjectedBundle::setAsyncFrameScrollingEnabled(WebPageGroupProxy* pageGroup, > (*iter)->settings().setAsyncFrameScrollingEnabled(enabled); > } > >+void InjectedBundle::setCSSOMViewScrollingAPIEnabled(WebPageGroupProxy* pageGroup, bool enabled) >+{ >+ const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages(); >+ for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter) >+ (*iter)->settings().setCSSOMViewScrollingAPIEnabled(enabled); >+} >+ > void InjectedBundle::setJavaScriptCanAccessClipboard(WebPageGroupProxy* pageGroup, bool enabled) > { > const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages(); >diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h >index fc1534f656febb0afb46df33109f74fee3d85820..e6a3505a0c174f795605879f9b1f389e4813930f 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h >@@ -99,6 +99,7 @@ public: > void setMinimumLogicalFontSize(WebPageGroupProxy*, int size); > void setFrameFlatteningEnabled(WebPageGroupProxy*, bool); > void setAsyncFrameScrollingEnabled(WebPageGroupProxy*, bool); >+ void setCSSOMViewScrollingAPIEnabled(WebPageGroupProxy*, bool); > void setPluginsEnabled(WebPageGroupProxy*, bool); > void setJavaScriptCanAccessClipboard(WebPageGroupProxy*, bool); > void setPrivateBrowsingEnabled(WebPageGroupProxy*, bool); >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h b/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >index 75e71b5e7fc1d2395d1ea1bc777a52361f825459..435a2d5288937ab91434c90c50486bed89e12171 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >@@ -180,6 +180,7 @@ > #define WebKitCSSGridLayoutEnabledPreferenceKey @"WebKitCSSGridLayoutEnabled" > #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 a983c8cbf9fa2cc9aa32c41cebddb3ba4204d818..0b171da6d22e87afd25a2b17d1f6fd76ddf8ea24 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >@@ -649,6 +649,7 @@ public: > #endif > [NSNumber numberWithBool:NO], WebKitVisualViewportAPIEnabledPreferenceKey, > >+ [NSNumber numberWithBool:NO], WebKitCSSOMViewScrollingAPIEnabledPreferenceKey, > [NSNumber numberWithBool:YES], WebKitNeedsStorageAccessFromFileURLsQuirkKey, > #if ENABLE(MEDIA_STREAM) > [NSNumber numberWithBool:NO], WebKitMediaDevicesEnabledPreferenceKey, >@@ -3074,6 +3075,15 @@ 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 2958b40b280eb3bbb4c3315028fb8b822f0176e2..e2061ffaf5a03bb84aabb4ef4ab70a2b4e6fd7e8 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h >@@ -575,6 +575,7 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification; > > @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 c7043d295402fa565b23132d4c55b497c5ccf033..a3a39a21606b2350dc1799f2ba7ac3c8fe902096 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -2862,6 +2862,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 12ecec0c5dab02dbbb5da5fffeb3d4525c074d57..585c54d28f3b9e232c8e01f8baa619585fae90e7 100644 >--- a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl >+++ b/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl >@@ -219,6 +219,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); > } >diff --git a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h b/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >index 3d947967967a50bf59f82403da28df6f5bca34ca..b66428d6db59660e85ee76e8b9606fa5f18eae41 100644 >--- a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >+++ b/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >@@ -195,3 +195,5 @@ > #define WebKitInspectorAdditionsEnabledPreferenceKey "WebKitInspectorAdditionsEnabled" > > #define WebKitVisualViewportAPIEnabledPreferenceKey "WebKitVisualViewportAPIEnabled" >+ >+#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey "WebKitCSSOMViewScrollingAPIEnabled" >diff --git a/Source/WebKitLegacy/win/WebPreferences.cpp b/Source/WebKitLegacy/win/WebPreferences.cpp >index be3eb31191834057e5c34688b13ff5e157f8d603..8b4c5abb3211133beeeb0456e79bcccba8487d27 100644 >--- a/Source/WebKitLegacy/win/WebPreferences.cpp >+++ b/Source/WebKitLegacy/win/WebPreferences.cpp >@@ -324,6 +324,8 @@ void WebPreferences::initializeDefaultSettings() > > CFDictionaryAddValue(defaults, CFSTR(WebKitVisualViewportAPIEnabledPreferenceKey), kCFBooleanFalse); > >+ CFDictionaryAddValue(defaults, CFSTR(WebKitCSSOMViewScrollingAPIEnabledPreferenceKey), kCFBooleanFalse); >+ > defaultSettings = defaults; > } > >@@ -2123,6 +2125,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(WebKitCSSOMViewScrollingAPIPreferenceKey, 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 59a5025a9db250a0ffc89539b3ad57c46821de6d..884437a92c81732b1bf378f5e252c5086df8092e 100644 >--- a/Source/WebKitLegacy/win/WebPreferences.h >+++ b/Source/WebKitLegacy/win/WebPreferences.h >@@ -267,6 +267,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); > >diff --git a/Source/WebKitLegacy/win/WebView.cpp b/Source/WebKitLegacy/win/WebView.cpp >index c190f931e83b6959b54acb9f417fa46f3dc13786..73deeca3bb31107533e33eb6f32cd92f22de05c2 100644 >--- a/Source/WebKitLegacy/win/WebView.cpp >+++ b/Source/WebKitLegacy/win/WebView.cpp >@@ -5263,6 +5263,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) > return hr; > settings.setVisualViewportAPIEnabled(!!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 5b94117b440ee883dbc660166665142fc8d3279a..c474781b8352c57753bec5cf83ae37f76579d24d 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,20 @@ >+2018-01-26 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 NOBODY (OOPS!). >+ >+ Add FIXMEs comments to add the new developer flag in the future and disable it for now. >+ >+ * DumpRenderTree/mac/DumpRenderTree.mm: >+ (enableExperimentalFeatures): >+ * DumpRenderTree/win/DumpRenderTree.cpp: >+ (enableExperimentalFeatures): >+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: >+ (WTR::InjectedBundle::beginTesting): >+ >+ > 2018-01-26 Chris Dumez <cdumez@apple.com> > > Make sure service worker code does not launch a StorageProcess unnecessarily >diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >index fec0194cd8036d84aac285928c0b5c10c47aa518..b7535d02fa60ab41995e1adafd8895fcb418626e 100644 >--- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm >+++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >@@ -859,6 +859,7 @@ static void enableExperimentalFeatures(WebPreferences* preferences) > preferences.encryptedMediaAPIEnabled = YES; > [preferences setAccessibilityObjectModelEnabled:YES]; > [preferences setVisualViewportAPIEnabled:YES]; >+ // FIXME: CSSOMViewScrollingAPIEnabled > } > > // Called before each test. >@@ -911,6 +912,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 8cc9cb7cdf79fac18fcc3085c4cd7339e6a47620..ea821641ddc58dd7057700e6261fd7fdafa504c1 100644 >--- a/Tools/DumpRenderTree/win/DumpRenderTree.cpp >+++ b/Tools/DumpRenderTree/win/DumpRenderTree.cpp >@@ -784,6 +784,7 @@ static void enableExperimentalFeatures(IWebPreferences* preferences) > // FIXME: InputEvents > // FIXME: SubtleCrypto > prefsPrivate->setVisualViewportAPIEnabled(TRUE); >+ // FIXME: CSSOMViewScrollingAPI > prefsPrivate->setWebAnimationsEnabled(TRUE); > // FIXME: WebGL2 > // FIXME: WebRTC >diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >index 3de38c313c461f746a30daf9f9837d49e317a840..8171cc2af63587287d44df1d5501a2e47ad16243 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >@@ -341,6 +341,7 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings) > WKBundleSetAuthorAndUserStylesEnabled(m_bundle, m_pageGroup, true); > WKBundleSetFrameFlatteningEnabled(m_bundle, m_pageGroup, false); > WKBundleSetAsyncFrameScrollingEnabled(m_bundle, m_pageGroup, false); >+ WKBundleSetCSSOMViewScrollingAPIEnabled(m_bundle, m_pageGroup, false); > WKBundleSetMinimumLogicalFontSize(m_bundle, m_pageGroup, 9); > WKBundleSetSpatialNavigationEnabled(m_bundle, m_pageGroup, false); > WKBundleSetAllowFileAccessFromFileURLs(m_bundle, m_pageGroup, true); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 10798e4f18544e0ee651afbde1528194482ad0a3..4cf7104ff833bf7008bec56690f34df1c62dd3ba 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,20 @@ >+2018-01-26 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 NOBODY (OOPS!). >+ >+ 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*.thml 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-01-26 Ryosuke Niwa <rniwa@webkit.org> > > Make accessibility/mac/selection-notification-focus-change.html more reliable and re-enable it >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