Diff
Modified: trunk/LayoutTests/ChangeLog (243317 => 243318)
--- trunk/LayoutTests/ChangeLog 2019-03-21 19:55:44 UTC (rev 243317)
+++ trunk/LayoutTests/ChangeLog 2019-03-21 20:20:14 UTC (rev 243318)
@@ -1,3 +1,19 @@
+2019-03-21 Simon Fraser <[email protected]>
+
+ Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
+ https://bugs.webkit.org/show_bug.cgi?id=196058
+ rdar://problem/49078202
+
+ Reviewed by Antti Koivisto.
+
+ Add tests testing that the stacking-context side-effects -webkit-overflow-scrolling:touch
+ go away when it's disabled.
+
+ * fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking-expected.html: Added.
+ * fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html: Added.
+ * fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking-expected.html: Added.
+ * fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html: Added.
+
2019-03-21 Devin Rousso <[email protected]>
Unreviewed, fix test failures after r243269.
Added: trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking-expected.html (0 => 243318)
--- trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking-expected.html (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking-expected.html 2019-03-21 20:20:14 UTC (rev 243318)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ .box {
+ position: absolute;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ }
+
+ .scroller {
+ margin: 60px;
+ overflow: scroll;
+ border: 1px solid black;
+ width: 220px;
+ height: 220px;
+ }
+
+ .scrolled-contents {
+ height: 1000px;
+ }
+
+ .outside {
+ z-index: 1;
+ top: 20px;
+ left: 20px;
+ background-color: green;
+ }
+
+ .back {
+ z-index: 0;
+ }
+
+ .front {
+ z-index: 2;
+ top: 120px;
+ left: 120px;
+ width: 160px;
+ height: 160px;
+ background-color: orange;
+ }
+ </style>
+</head>
+<body>
+ <div class="outside box"></div>
+ <div class="scroller">
+ <div class="scrolled-contents">
+ <div class="back box"></div>
+ <div class="front box"></div>
+ </div>
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html (0 => 243318)
--- trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html 2019-03-21 20:20:14 UTC (rev 243318)
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script>
+ if (window.internals)
+ internals.settings.setLegacyOverflowScrollingTouchEnabled(false);
+ </script>
+ <style>
+ .box {
+ position: absolute;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ }
+
+ .scroller {
+ margin: 60px;
+ overflow: scroll;
+ border: 1px solid black;
+ width: 220px;
+ height: 220px;
+ -webkit-overflow-scrolling: touch;
+ }
+
+ .scrolled-contents {
+ height: 1000px;
+ }
+
+ .outside {
+ z-index: 1;
+ top: 20px;
+ left: 20px;
+ background-color: green;
+ }
+
+ .back {
+ z-index: 0;
+ }
+
+ .front {
+ z-index: 2;
+ top: 120px;
+ left: 120px;
+ width: 160px;
+ height: 160px;
+ background-color: orange;
+ }
+ </style>
+</head>
+<body>
+ <div class="outside box"></div>
+ <div class="scroller">
+ <div class="scrolled-contents">
+ <div class="back box"></div>
+ <div class="front box"></div>
+ </div>
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking-expected.html (0 => 243318)
--- trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking-expected.html (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking-expected.html 2019-03-21 20:20:14 UTC (rev 243318)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ .box {
+ position: absolute;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ }
+
+ .scroller {
+ margin: 60px;
+ overflow: scroll;
+ border: 1px solid black;
+ width: 220px;
+ height: 220px;
+ -webkit-overflow-scrolling: touch;
+ will-change: z-index;
+ }
+
+ .scrolled-contents {
+ height: 1000px;
+ }
+
+ .outside {
+ z-index: 1;
+ top: 20px;
+ left: 20px;
+ background-color: green;
+ }
+
+ .back {
+ z-index: 0;
+ }
+
+ .front {
+ z-index: 2;
+ top: 120px;
+ left: 120px;
+ background-color: orange;
+ }
+ </style>
+</head>
+<body>
+ <div class="outside box"></div>
+ <div class="scroller">
+ <div class="scrolled-contents">
+ <div class="back box"></div>
+ <div class="front box"></div>
+ </div>
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html (0 => 243318)
--- trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html 2019-03-21 20:20:14 UTC (rev 243318)
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script>
+ if (window.internals)
+ internals.settings.setLegacyOverflowScrollingTouchEnabled(true);
+ </script>
+ <style>
+ .box {
+ position: absolute;
+ height: 200px;
+ width: 200px;
+ background-color: blue;
+ }
+
+ .scroller {
+ margin: 60px;
+ overflow: scroll;
+ border: 1px solid black;
+ width: 220px;
+ height: 220px;
+ -webkit-overflow-scrolling: touch;
+ }
+
+ .scrolled-contents {
+ height: 1000px;
+ }
+
+ .outside {
+ z-index: 1;
+ top: 20px;
+ left: 20px;
+ background-color: green;
+ }
+
+ .back {
+ z-index: 0;
+ }
+
+ .front {
+ z-index: 2;
+ top: 120px;
+ left: 120px;
+ background-color: orange;
+ }
+ </style>
+</head>
+<body>
+ <div class="outside box"></div>
+ <div class="scroller">
+ <div class="scrolled-contents">
+ <div class="back box"></div>
+ <div class="front box"></div>
+ </div>
+ </div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (243317 => 243318)
--- trunk/Source/WebCore/ChangeLog 2019-03-21 19:55:44 UTC (rev 243317)
+++ trunk/Source/WebCore/ChangeLog 2019-03-21 20:20:14 UTC (rev 243318)
@@ -1,3 +1,31 @@
+2019-03-21 Simon Fraser <[email protected]>
+
+ Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
+ https://bugs.webkit.org/show_bug.cgi?id=196058
+ rdar://problem/49078202
+
+ Reviewed by Antti Koivisto.
+
+ Add an internal setting called "legacyOverflowScrollingTouchEnabled", initially
+ on by default.
+
+ When disabled, it makes the -webkit-overflow-scrolling property be unsupported.
+
+ Tests: fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html
+ fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html
+
+ * css/parser/CSSParserContext.cpp:
+ (WebCore::CSSParserContext::CSSParserContext):
+ (WebCore::operator==):
+ * css/parser/CSSParserContext.h:
+ (WebCore::CSSParserContextHash::hash):
+ * css/parser/CSSParserFastPaths.cpp:
+ (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+ * css/parser/CSSParserFastPaths.h:
+ * css/parser/CSSPropertyParser.cpp:
+ (WebCore::CSSPropertyParser::parseSingleValue):
+ * page/Settings.yaml:
+
2019-03-21 Antti Koivisto <[email protected]>
UI-process hit-testing needs to know about containing block relationships
Modified: trunk/Source/WebCore/css/parser/CSSParserContext.cpp (243317 => 243318)
--- trunk/Source/WebCore/css/parser/CSSParserContext.cpp 2019-03-21 19:55:44 UTC (rev 243317)
+++ trunk/Source/WebCore/css/parser/CSSParserContext.cpp 2019-03-21 20:20:14 UTC (rev 243318)
@@ -58,6 +58,9 @@
#if ENABLE(TEXT_AUTOSIZING)
textAutosizingEnabled = document.settings().textAutosizingEnabled();
#endif
+#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
+ legacyOverflowScrollingTouchEnabled = document.settings().legacyOverflowScrollingTouchEnabled();
+#endif
springTimingFunctionEnabled = document.settings().springTimingFunctionEnabled();
constantPropertiesEnabled = document.settings().constantPropertiesEnabled();
colorFilterEnabled = document.settings().colorFilterEnabled();
@@ -77,6 +80,9 @@
#if ENABLE(TEXT_AUTOSIZING)
&& a.textAutosizingEnabled == b.textAutosizingEnabled
#endif
+#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
+ && a.legacyOverflowScrollingTouchEnabled == b.legacyOverflowScrollingTouchEnabled
+#endif
&& a.enforcesCSSMIMETypeInNoQuirksMode == b.enforcesCSSMIMETypeInNoQuirksMode
&& a.useLegacyBackgroundSizeShorthandBehavior == b.useLegacyBackgroundSizeShorthandBehavior
&& a.springTimingFunctionEnabled == b.springTimingFunctionEnabled
Modified: trunk/Source/WebCore/css/parser/CSSParserContext.h (243317 => 243318)
--- trunk/Source/WebCore/css/parser/CSSParserContext.h 2019-03-21 19:55:44 UTC (rev 243317)
+++ trunk/Source/WebCore/css/parser/CSSParserContext.h 2019-03-21 20:20:14 UTC (rev 243318)
@@ -49,6 +49,9 @@
#if ENABLE(TEXT_AUTOSIZING)
bool textAutosizingEnabled { false };
#endif
+#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
+ bool legacyOverflowScrollingTouchEnabled { false };
+#endif
bool enforcesCSSMIMETypeInNoQuirksMode { true };
bool useLegacyBackgroundSizeShorthandBehavior { false };
bool springTimingFunctionEnabled { false };
@@ -93,18 +96,21 @@
#if ENABLE(TEXT_AUTOSIZING)
& key.textAutosizingEnabled << 1
#endif
- & key.enforcesCSSMIMETypeInNoQuirksMode << 2
- & key.useLegacyBackgroundSizeShorthandBehavior << 3
- & key.springTimingFunctionEnabled << 4
- & key.constantPropertiesEnabled << 5
- & key.colorFilterEnabled << 6
- & key.deferredCSSParserEnabled << 7
- & key.hasDocumentSecurityOrigin << 8
- & key.useSystemAppearance << 9
+#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
+ & key.legacyOverflowScrollingTouchEnabled << 2
+#endif
+ & key.enforcesCSSMIMETypeInNoQuirksMode << 3
+ & key.useLegacyBackgroundSizeShorthandBehavior << 4
+ & key.springTimingFunctionEnabled << 5
+ & key.constantPropertiesEnabled << 6
+ & key.colorFilterEnabled << 7
+ & key.deferredCSSParserEnabled << 8
+ & key.hasDocumentSecurityOrigin << 9
+ & key.useSystemAppearance << 10
#if ENABLE(ATTACHMENT_ELEMENT)
- & key.attachmentEnabled << 10
+ & key.attachmentEnabled << 11
#endif
- & key.mode << 11; // Keep this last.
+ & key.mode << 12; // Keep this last.
hash ^= WTF::intHash(bits);
return hash;
}
Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp (243317 => 243318)
--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp 2019-03-21 19:55:44 UTC (rev 243317)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp 2019-03-21 20:20:14 UTC (rev 243318)
@@ -31,6 +31,7 @@
#include "CSSParserFastPaths.h"
#include "CSSFunctionValue.h"
+#include "CSSParserContext.h"
#include "CSSParserIdioms.h"
#include "CSSPrimitiveValue.h"
#include "CSSPropertyParser.h"
@@ -519,9 +520,13 @@
return CSSValuePool::singleton().createColorValue(color);
}
-bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID, CSSParserMode parserMode)
+bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID, const CSSParserContext& context)
{
- if (valueID == CSSValueInvalid || !isValueAllowedInMode(valueID, parserMode))
+#if !ENABLE(OVERFLOW_SCROLLING_TOUCH)
+ UNUSED_PARAM(context);
+#endif
+
+ if (valueID == CSSValueInvalid || !isValueAllowedInMode(valueID, context.mode))
return false;
switch (propertyId) {
@@ -802,6 +807,8 @@
return valueID == CSSValueNormal || valueID == CSSValueHistoricalForms;
#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
case CSSPropertyWebkitOverflowScrolling:
+ if (!context.legacyOverflowScrollingTouchEnabled)
+ return nullptr;
return valueID == CSSValueAuto || valueID == CSSValueTouch;
#endif
#if ENABLE(VARIATION_FONTS)
@@ -981,7 +988,7 @@
|| equalLettersIgnoringASCIICase(string, "revert");
}
-static RefPtr<CSSValue> parseKeywordValue(CSSPropertyID propertyId, const String& string, CSSParserMode parserMode)
+static RefPtr<CSSValue> parseKeywordValue(CSSPropertyID propertyId, const String& string, const CSSParserContext& context)
{
ASSERT(!string.isEmpty());
@@ -1013,7 +1020,7 @@
if (valueID == CSSValueRevert)
return CSSValuePool::singleton().createRevertValue();
- if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyId, valueID, parserMode))
+ if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyId, valueID, context))
return CSSPrimitiveValue::createIdentifier(valueID);
return nullptr;
}
@@ -1292,15 +1299,15 @@
return CSSParserFastPaths::parseColor(string, parserMode);
}
-RefPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, CSSParserMode parserMode)
+RefPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, const CSSParserContext& context)
{
- if (auto result = parseSimpleLengthValue(propertyID, string, parserMode))
+ if (auto result = parseSimpleLengthValue(propertyID, string, context.mode))
return result;
if (propertyID == CSSPropertyCaretColor)
- return parseCaretColor(string, parserMode);
+ return parseCaretColor(string, context.mode);
if (isColorPropertyID(propertyID))
- return parseColor(string, parserMode);
- if (auto result = parseKeywordValue(propertyID, string, parserMode))
+ return parseColor(string, context.mode);
+ if (auto result = parseKeywordValue(propertyID, string, context))
return result;
return parseSimpleTransform(propertyID, string);
}
Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.h (243317 => 243318)
--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.h 2019-03-21 19:55:44 UTC (rev 243317)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.h 2019-03-21 20:20:14 UTC (rev 243318)
@@ -38,16 +38,17 @@
class CSSValue;
class StyleSheetContents;
+struct CSSParserContext;
class CSSParserFastPaths {
public:
// Parses simple values like '10px' or 'green', but makes no guarantees
// about handling any property completely.
- static RefPtr<CSSValue> maybeParseValue(CSSPropertyID, const String&, CSSParserMode);
+ static RefPtr<CSSValue> maybeParseValue(CSSPropertyID, const String&, const CSSParserContext&);
// Properties handled here shouldn't be explicitly handled in CSSPropertyParser
static bool isKeywordPropertyID(CSSPropertyID);
- static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID, CSSParserMode);
+ static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID, const CSSParserContext&);
static RefPtr<CSSValue> parseColor(const String&, CSSParserMode);
};
Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (243317 => 243318)
--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2019-03-21 19:55:44 UTC (rev 243317)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2019-03-21 20:20:14 UTC (rev 243318)
@@ -3909,8 +3909,9 @@
RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSSPropertyID currentShorthand)
{
if (CSSParserFastPaths::isKeywordPropertyID(property)) {
- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context.mode))
+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context))
return nullptr;
+
return consumeIdent(m_range);
}
switch (property) {
@@ -5698,7 +5699,7 @@
switch (property) {
case CSSPropertyWebkitMarginCollapse: {
CSSValueID id = m_range.consumeIncludingWhitespace().id();
- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id, m_context.mode))
+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id, m_context))
return false;
addProperty(CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginCollapse, CSSValuePool::singleton().createIdentifierValue(id), important);
if (m_range.atEnd()) {
@@ -5706,7 +5707,7 @@
return true;
}
id = m_range.consumeIncludingWhitespace().id();
- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginAfterCollapse, id, m_context.mode))
+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginAfterCollapse, id, m_context))
return false;
addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, CSSValuePool::singleton().createIdentifierValue(id), important);
return true;
@@ -5713,7 +5714,7 @@
}
case CSSPropertyOverflow: {
CSSValueID id = m_range.consumeIncludingWhitespace().id();
- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyOverflowY, id, m_context.mode))
+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyOverflowY, id, m_context))
return false;
if (!m_range.atEnd())
return false;
Modified: trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp (243317 => 243318)
--- trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp 2019-03-21 19:55:44 UTC (rev 243317)
+++ trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp 2019-03-21 20:20:14 UTC (rev 243318)
@@ -811,7 +811,7 @@
auto values = JSON::ArrayOf<String>::create();
for (int j = firstCSSValueKeyword; j <= lastCSSValueKeyword; ++j) {
CSSValueID valueID = convertToCSSValueID(j);
- if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyID, valueID, HTMLStandardMode))
+ if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyID, valueID, strictCSSParserContext()))
values->addItem(getValueNameString(valueID));
}
if (values->length())
Modified: trunk/Source/WebCore/page/Settings.yaml (243317 => 243318)
--- trunk/Source/WebCore/page/Settings.yaml 2019-03-21 19:55:44 UTC (rev 243317)
+++ trunk/Source/WebCore/page/Settings.yaml 2019-03-21 20:20:14 UTC (rev 243318)
@@ -388,6 +388,11 @@
initial: false
onChange: setNeedsRelayoutAllFrames
+legacyOverflowScrollingTouchEnabled:
+ initial: true
+ onChange: setNeedsRelayoutAllFrames
+ conditional: OVERFLOW_SCROLLING_TOUCH
+
webSecurityEnabled:
initial: true
inspectorOverride: true
Modified: trunk/Source/WebKit/ChangeLog (243317 => 243318)
--- trunk/Source/WebKit/ChangeLog 2019-03-21 19:55:44 UTC (rev 243317)
+++ trunk/Source/WebKit/ChangeLog 2019-03-21 20:20:14 UTC (rev 243318)
@@ -1,3 +1,16 @@
+2019-03-21 Simon Fraser <[email protected]>
+
+ Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
+ https://bugs.webkit.org/show_bug.cgi?id=196058
+ rdar://problem/49078202
+
+ Reviewed by Antti Koivisto.
+
+ Add an internal feature flag called "LegacyOverflowScrollingTouchEnabled", initially
+ on by default.
+
+ * Shared/WebPreferences.yaml:
+
2019-03-21 Antti Koivisto <[email protected]>
UI-process hit-testing needs to know about containing block relationships
Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (243317 => 243318)
--- trunk/Source/WebKit/Shared/WebPreferences.yaml 2019-03-21 19:55:44 UTC (rev 243317)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml 2019-03-21 20:20:14 UTC (rev 243318)
@@ -1442,6 +1442,14 @@
humanReadableDescription: "Perform overflow scrolling off the main thread"
category: internal
+LegacyOverflowScrollingTouchEnabled:
+ type: bool
+ defaultValue: true
+ humanReadableName: "Legacy -webkit-overflow-scrolling property"
+ humanReadableDescription: "Support the legacy -webkit-overflow-scrolling CSS property"
+ condition: ENABLE(OVERFLOW_SCROLLING_TOUCH)
+ category: internal
+
FetchAPIKeepAliveEnabled:
type: bool
defaultValue: false