Make "overflow: overlay" a synonym for "overflow: auto"
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Sep 2018 18:42:25 +0000 (18:42 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Sep 2018 18:42:25 +0000 (18:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189811

Source/WebCore:

Reviewed by Zalan Bujtas.

The "overlay" value for overflow was added for an internal Safari feature, and only has
an effect (allow the scrollbar to overlap the content) with legacy scrollbars on macOS.
It's little used on the web.

To simplify code in rendering, just make "overflow: overlay" behave like "overflow: auto".
It's still parsed, but turns into an "auto" value internally, and will be returned from getComputedStyle
as "auto".

Test: fast/css/getComputedStyle/getComputedStyle-overflow.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Overflow const):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleResolver.cpp:
(WebCore::isScrollableOverflow):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* page/ios/FrameIOS.mm:
(WebCore::Frame::nodeRespondingToScrollWheelEvents):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
(WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
* rendering/RenderLayer.cpp:
(WebCore::styleDefinesAutomaticScrollbar):
* rendering/RenderLayerCompositor.cpp:
(WebCore::isScrollableOverflow):
* rendering/style/RenderStyleConstants.h:

Source/WebInspectorUI:

Reviewed by Zalan Bujtas.

Remove "overlay" from the overflow values.

* UserInterface/Models/CSSKeywordCompletions.js:
* UserInterface/Views/VisualStyleDetailsPanel.js:
(WI.VisualStyleDetailsPanel.prototype._populateDisplaySection):

LayoutTests:

Reviewed by Zalan Bujtas.

Add a modern CSS parsing/computed style test for overflow, superseding
fast/css/overflow-property.html.

* fast/css/getComputedStyle/getComputedStyle-overflow-expected.txt: Added.
* fast/css/getComputedStyle/getComputedStyle-overflow.html: Added.
* fast/css/overflow-property-expected.txt: Removed.
* fast/css/overflow-property.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236341 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/getComputedStyle/getComputedStyle-overflow-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/getComputedStyle/getComputedStyle-overflow.html [new file with mode: 0644]
LayoutTests/fast/css/overflow-property-expected.txt [deleted file]
LayoutTests/fast/css/overflow-property.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSProperties.json
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/parser/CSSParserFastPaths.cpp
Source/WebCore/page/ios/FrameIOS.mm
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js

index 27ae71f..de55e14 100644 (file)
@@ -1,3 +1,18 @@
+2018-09-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Make "overflow: overlay" a synonym for "overflow: auto"
+        https://bugs.webkit.org/show_bug.cgi?id=189811
+
+        Reviewed by Zalan Bujtas.
+        
+        Add a modern CSS parsing/computed style test for overflow, superseding
+        fast/css/overflow-property.html.
+
+        * fast/css/getComputedStyle/getComputedStyle-overflow-expected.txt: Added.
+        * fast/css/getComputedStyle/getComputedStyle-overflow.html: Added.
+        * fast/css/overflow-property-expected.txt: Removed.
+        * fast/css/overflow-property.html: Removed.
+
 2018-09-21  Ryan Haddad  <ryanhaddad@apple.com>
 
         Tests checking document GC in case of ActiveDOMObjects are flaky
diff --git a/LayoutTests/fast/css/getComputedStyle/getComputedStyle-overflow-expected.txt b/LayoutTests/fast/css/getComputedStyle/getComputedStyle-overflow-expected.txt
new file mode 100644 (file)
index 0000000..0bf156a
--- /dev/null
@@ -0,0 +1,113 @@
+Test computed style on the overflow property.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Shorthand tests
+
+PASS computedStyle.getPropertyValue('overflow-x') is "scroll"
+PASS computedStyle.getPropertyValue('overflow-y') is "scroll"
+PASS computedStyle.getPropertyValue('overflow') is "scroll"
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "auto"
+PASS computedStyle.getPropertyValue('overflow') is "auto"
+
+PASS computedStyle.getPropertyValue('overflow-x') is "visible"
+PASS computedStyle.getPropertyValue('overflow-y') is "visible"
+PASS computedStyle.getPropertyValue('overflow') is "visible"
+
+PASS computedStyle.getPropertyValue('overflow-x') is "hidden"
+PASS computedStyle.getPropertyValue('overflow-y') is "hidden"
+PASS computedStyle.getPropertyValue('overflow') is "hidden"
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "auto"
+PASS computedStyle.getPropertyValue('overflow') is "auto"
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "auto"
+PASS computedStyle.getPropertyValue('overflow') is "auto"
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "auto"
+PASS computedStyle.getPropertyValue('overflow') is "auto"
+
+Paged tests
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "-webkit-paged-x"
+PASS computedStyle.getPropertyValue('overflow') is "-webkit-paged-x"
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "-webkit-paged-y"
+PASS computedStyle.getPropertyValue('overflow') is "-webkit-paged-y"
+
+Longhand tests
+
+PASS computedStyle.getPropertyValue('overflow-x') is "scroll"
+PASS computedStyle.getPropertyValue('overflow-y') is "scroll"
+PASS computedStyle.getPropertyValue('overflow') is "scroll"
+PASS e.style.overflowX is "scroll"
+PASS e.style.overflowY is "scroll"
+PASS e.style.overflow is "scroll"
+
+PASS computedStyle.getPropertyValue('overflow-x') is "scroll"
+PASS computedStyle.getPropertyValue('overflow-y') is "auto"
+PASS computedStyle.getPropertyValue('overflow') is "auto"
+PASS e.style.overflowX is "scroll"
+PASS e.style.overflowY is "auto"
+PASS e.style.overflow is ""
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "scroll"
+PASS computedStyle.getPropertyValue('overflow') is "auto"
+PASS e.style.overflowX is "auto"
+PASS e.style.overflowY is "scroll"
+PASS e.style.overflow is ""
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "hidden"
+PASS computedStyle.getPropertyValue('overflow') is "auto"
+PASS e.style.overflowX is "visible"
+PASS e.style.overflowY is "hidden"
+PASS e.style.overflow is ""
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "hidden"
+PASS computedStyle.getPropertyValue('overflow') is "auto"
+PASS e.style.overflowX is "overlay"
+PASS e.style.overflowY is "hidden"
+PASS e.style.overflow is ""
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "-webkit-paged-y"
+PASS computedStyle.getPropertyValue('overflow') is "-webkit-paged-y"
+PASS e.style.overflowX is "visible"
+PASS e.style.overflowY is "-webkit-paged-y"
+PASS e.style.overflow is ""
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "-webkit-paged-x"
+PASS computedStyle.getPropertyValue('overflow') is "-webkit-paged-x"
+PASS e.style.overflowX is "auto"
+PASS e.style.overflowY is "-webkit-paged-x"
+PASS e.style.overflow is ""
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "-webkit-paged-x"
+PASS computedStyle.getPropertyValue('overflow') is "-webkit-paged-x"
+PASS e.style.overflowX is "auto"
+PASS e.style.overflowY is "-webkit-paged-x"
+PASS e.style.overflow is ""
+
+PASS computedStyle.getPropertyValue('overflow-x') is "auto"
+PASS computedStyle.getPropertyValue('overflow-y') is "-webkit-paged-x"
+PASS computedStyle.getPropertyValue('overflow') is "-webkit-paged-x"
+PASS e.style.overflowX is "auto"
+PASS e.style.overflowY is "-webkit-paged-x"
+PASS e.style.overflow is ""
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/getComputedStyle/getComputedStyle-overflow.html b/LayoutTests/fast/css/getComputedStyle/getComputedStyle-overflow.html
new file mode 100644 (file)
index 0000000..1f85b8d
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+
+description("Test computed style on the overflow property.")
+
+var testContainer = document.createElement("div");
+testContainer.contentEditable = true;
+document.body.appendChild(testContainer);
+
+testContainer.innerHTML = '<div id="test">hello</div>';
+
+e = document.getElementById('test');
+computedStyle = window.getComputedStyle(e, null);
+
+debug('Shorthand tests');
+
+const tests = [
+    // value, expected
+    [ 'scroll', 'scroll'],
+    [ 'auto', 'auto' ],
+    [ 'visible', 'visible' ],
+    [ 'hidden', 'hidden' ],
+    [ 'overlay', 'auto' ],
+
+    [ 'hidden visible', 'auto' ], // WebKit doesn't support different values of overflow on different axes.
+    [ 'hidden hidden', 'auto' ], // WebKit doesn't support different values of overflow on different axes, and thus only accepts a single value for overflow.
+];
+
+for (let test of tests) {
+    e.style.overflow = 'auto';
+    e.style.overflow = test[0];
+    debug('');
+    shouldBeEqualToString("computedStyle.getPropertyValue('overflow-x')", test[1]);
+    shouldBeEqualToString("computedStyle.getPropertyValue('overflow-y')", test[1]);
+    shouldBeEqualToString("computedStyle.getPropertyValue('overflow')", test[1]);
+}
+
+debug('');
+debug('Paged tests');
+
+const pagedTests = [
+    // shorthand, expected-x, expected-y, expected-shorthand
+    [ '-webkit-paged-x', 'auto', '-webkit-paged-x', '-webkit-paged-x' ],
+    [ '-webkit-paged-y', 'auto', '-webkit-paged-y', '-webkit-paged-y' ],
+];
+
+for (let test of pagedTests) {
+    e.style.overflow = 'auto';
+    e.style.overflow = test[0];
+    debug('');
+    shouldBeEqualToString("computedStyle.getPropertyValue('overflow-x')", test[1]);
+    shouldBeEqualToString("computedStyle.getPropertyValue('overflow-y')", test[2]);
+    shouldBeEqualToString("computedStyle.getPropertyValue('overflow')", test[3]);
+}
+
+debug('');
+debug('Longhand tests');
+
+const longhandTests = [
+    // x-value, y-value, computed-x-expected, computed-y-expected, computed-shorthand-expected, inline-x-expected, inline-y-expected, inline-shorthand-expected
+    [ 'scroll', 'scroll',
+        'scroll', 'scroll', 'scroll',
+        'scroll', 'scroll', 'scroll'],
+
+    [ 'scroll', 'auto',
+        'scroll', 'auto', 'auto',
+        'scroll', 'auto', ''],
+
+    [ 'auto', 'scroll',
+        'auto', 'scroll', 'auto',
+        'auto', 'scroll', ''],
+
+    [ 'visible', 'hidden',
+        'auto', 'hidden', 'auto',
+        'visible', 'hidden', ''],
+
+    [ 'overlay', 'hidden',
+        'auto','hidden', 'auto',
+        'overlay', 'hidden', ''],
+
+    [ 'visible', '-webkit-paged-y',
+        'auto', '-webkit-paged-y', '-webkit-paged-y',
+        'visible', '-webkit-paged-y', ''],
+
+    [ 'auto', '-webkit-paged-x',
+        'auto', '-webkit-paged-x', '-webkit-paged-x',
+        'auto', '-webkit-paged-x', ''],
+
+    [ '-webkit-paged-x', '-webkit-paged-x',
+        'auto', '-webkit-paged-x', '-webkit-paged-x',
+        'auto', '-webkit-paged-x', ''],
+
+    [ '-webkit-paged-y', '-webkit-paged-x',
+        'auto', '-webkit-paged-x', '-webkit-paged-x',
+        'auto', '-webkit-paged-x', ''],
+];
+
+for (let test of longhandTests) {
+    e.style.overflow = 'auto';
+    e.style.overflowX = test[0];
+    e.style.overflowY = test[1];
+    debug('');
+    shouldBeEqualToString("computedStyle.getPropertyValue('overflow-x')", test[2]);
+    shouldBeEqualToString("computedStyle.getPropertyValue('overflow-y')", test[3]);
+    shouldBeEqualToString("computedStyle.getPropertyValue('overflow')", test[4]);
+
+    shouldBeEqualToString("e.style.overflowX", test[5]);
+    shouldBeEqualToString("e.style.overflowY", test[6]);
+    shouldBeEqualToString("e.style.overflow", test[7]);
+}
+
+document.body.removeChild(testContainer);
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/css/overflow-property-expected.txt b/LayoutTests/fast/css/overflow-property-expected.txt
deleted file mode 100644 (file)
index 77099d8..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-This tests the parsing and retrieval of the overflow, overflow-x and overflow-y properties.
-
-PASS test0.style.overflow is "auto"
-PASS test0.style.overflowX is "auto"
-PASS test0.style.overflowY is "auto"
-PASS test0.style.getPropertyShorthand('overflow-x') is "overflow"
-PASS test0.style.getPropertyShorthand('overflow-y') is "overflow"
-PASS test1.style.overflow is ""
-PASS test1.style.overflowX is ""
-PASS test1.style.overflowY is ""
-PASS test2.style.overflow is "scroll"
-PASS test2.style.overflowX is "scroll"
-PASS test2.style.overflowY is "scroll"
-PASS test3.style.overflow is ""
-PASS test3.style.overflowX is "overlay"
-PASS test3.style.overflowY is "hidden"
-PASS test4.style.overflow is ""
-PASS test4.style.overflowX is "auto"
-PASS test4.style.overflowY is ""
-PASS test5.style.overflow is ""
-PASS test5.style.overflowX is ""
-PASS test5.style.overflowY is "auto"
-PASS test6.style.overflow is ""
-PASS test6.style.overflowX is ""
-PASS test6.style.overflowY is ""
-PASS test7.style.overflow is ""
-PASS test7.style.overflowX is ""
-PASS test7.style.overflowY is ""
-PASS test8.style.overflowX is ""
-PASS test8.style.overflowY is "-webkit-paged-x"
-PASS test9.style.overflowX is "auto"
-PASS test9.style.overflowY is "-webkit-paged-y"
-PASS test10.style.overflowX is "visible"
-PASS test10.style.overflowY is "-webkit-paged-y"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/css/overflow-property.html b/LayoutTests/fast/css/overflow-property.html
deleted file mode 100644 (file)
index e267947..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description">This tests the parsing and retrieval of the overflow, overflow-x and overflow-y properties.</p>
-<div id="console"></div>
-
-<div id="tests_container">
-
-<div id="test0" style="overflow: auto"></div>
-<div id="test1" style="overflow: auto auto"></div>
-<div id="test2" style="overflow-x: scroll; overflow-y: scroll"></div>
-<div id="test3" style="overflow-x: overlay; overflow-y: hidden"></div>
-<div id="test4" style="overflow-x: auto"></div>
-<div id="test5" style="overflow-y: auto"></div>
-<div id="test6" style="overflow: invalid"></div>
-<div id="test7"></div>
-<div id="test8" style="overflow-y: -webkit-paged-x;"></div>
-<div id="test9" style="overflow: -webkit-paged-y;"></div>
-<div id="test10" style="overflow-x: visible; overflow-y: -webkit-paged-y;"></div>
-
-</div>
-
-<script>
-    var test0 = document.getElementById("test0");
-    var test1 = document.getElementById("test1");
-    var test2 = document.getElementById("test2");
-    var test3 = document.getElementById("test3");
-    var test4 = document.getElementById("test4");
-    var test5 = document.getElementById("test5");
-    var test6 = document.getElementById("test6");
-    var test7 = document.getElementById("test6");
-    var test8 = document.getElementById("test8");
-    var test9 = document.getElementById("test9");
-    var test10 = document.getElementById("test10");
-
-    shouldBeEqualToString("test0.style.overflow", "auto");
-    shouldBeEqualToString("test0.style.overflowX", "auto");
-    shouldBeEqualToString("test0.style.overflowY", "auto");
-    shouldBeEqualToString("test0.style.getPropertyShorthand('overflow-x')", "overflow");
-    shouldBeEqualToString("test0.style.getPropertyShorthand('overflow-y')", "overflow");
-    shouldBeEqualToString("test1.style.overflow", "");
-    shouldBeEqualToString("test1.style.overflowX", "");
-    shouldBeEqualToString("test1.style.overflowY", "");
-    shouldBeEqualToString("test2.style.overflow", "scroll");
-    shouldBeEqualToString("test2.style.overflowX", "scroll");
-    shouldBeEqualToString("test2.style.overflowY", "scroll");
-    shouldBeEqualToString("test3.style.overflow", "");
-    shouldBeEqualToString("test3.style.overflowX", "overlay");
-    shouldBeEqualToString("test3.style.overflowY", "hidden");
-    shouldBeEqualToString("test4.style.overflow", "");
-    shouldBeEqualToString("test4.style.overflowX", "auto");
-    shouldBeEqualToString("test4.style.overflowY", "");
-    shouldBeEqualToString("test5.style.overflow", "");
-    shouldBeEqualToString("test5.style.overflowX", "");
-    shouldBeEqualToString("test5.style.overflowY", "auto");
-    shouldBeEqualToString("test6.style.overflow", "");
-    shouldBeEqualToString("test6.style.overflowX", "");
-    shouldBeEqualToString("test6.style.overflowY", "");
-    shouldBeEqualToString("test7.style.overflow", "");
-    shouldBeEqualToString("test7.style.overflowX", "");
-    shouldBeEqualToString("test7.style.overflowY", "");
-    shouldBeEqualToString("test8.style.overflowX", "");
-    shouldBeEqualToString("test8.style.overflowY", "-webkit-paged-x");
-    shouldBeEqualToString("test9.style.overflowX", "auto");
-    shouldBeEqualToString("test9.style.overflowY", "-webkit-paged-y");
-    shouldBeEqualToString("test10.style.overflowX", "visible");
-    shouldBeEqualToString("test10.style.overflowY", "-webkit-paged-y");
-
-    // clean up after ourselves
-    var tests_container = document.getElementById("tests_container");
-    tests_container.parentNode.removeChild(tests_container);
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
index 8b6e6c2..d8bf1ab 100644 (file)
@@ -1,3 +1,40 @@
+2018-09-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Make "overflow: overlay" a synonym for "overflow: auto"
+        https://bugs.webkit.org/show_bug.cgi?id=189811
+
+        Reviewed by Zalan Bujtas.
+        
+        The "overlay" value for overflow was added for an internal Safari feature, and only has
+        an effect (allow the scrollbar to overlap the content) with legacy scrollbars on macOS.
+        It's little used on the web.
+
+        To simplify code in rendering, just make "overflow: overlay" behave like "overflow: auto".
+        It's still parsed, but turns into an "auto" value internally, and will be returned from getComputedStyle
+        as "auto".
+
+        Test: fast/css/getComputedStyle/getComputedStyle-overflow.html
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator Overflow const):
+        * css/CSSProperties.json:
+        * css/CSSValueKeywords.in:
+        * css/StyleResolver.cpp:
+        (WebCore::isScrollableOverflow):
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+        * page/ios/FrameIOS.mm:
+        (WebCore::Frame::nodeRespondingToScrollWheelEvents):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
+        (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
+        * rendering/RenderLayer.cpp:
+        (WebCore::styleDefinesAutomaticScrollbar):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::isScrollableOverflow):
+        * rendering/style/RenderStyleConstants.h:
+
 2018-09-21  Youenn Fablet  <youenn@apple.com>
 
         Centralize which CVPixelBuffer format is being used
index 5ee6f63..c344e75 100644 (file)
@@ -2169,9 +2169,6 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Overflow e)
     case Overflow::Auto:
         m_value.valueID = CSSValueAuto;
         break;
-    case Overflow::Overlay:
-        m_value.valueID = CSSValueOverlay;
-        break;
     case Overflow::PagedX:
         m_value.valueID = CSSValueWebkitPagedX;
         break;
@@ -2192,10 +2189,9 @@ template<> inline CSSPrimitiveValue::operator Overflow() const
         return Overflow::Hidden;
     case CSSValueScroll:
         return Overflow::Scroll;
+    case CSSValueOverlay:
     case CSSValueAuto:
         return Overflow::Auto;
-    case CSSValueOverlay:
-        return Overflow::Overlay;
     case CSSValueWebkitPagedX:
         return Overflow::PagedX;
     case CSSValueWebkitPagedY:
index 537dd70..e999776 100644 (file)
                 "visible",
                 "hidden",
                 "scroll",
-                "auto",
-                "overlay"
+                "auto"
             ],
             "specification": {
                 "category": "css-overflow",
                 "hidden",
                 "scroll",
                 "auto",
-                "overlay",
                 "-webkit-paged-x",
                 "-webkit-paged-y"
             ],
index 73e72c9..7148a99 100644 (file)
@@ -551,7 +551,6 @@ no-close-quote
 no-open-quote
 nowrap
 open-quote
-overlay
 overline
 portrait
 pre
@@ -1153,7 +1152,7 @@ on-demand
 // normal
 multiply
 screen
-// overlay
+overlay
 darken
 lighten
 color-dodge
index 2dc5738..a42aa25 100644 (file)
@@ -744,7 +744,7 @@ static bool doesNotInheritTextDecoration(const RenderStyle& style, const Element
 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
 static bool isScrollableOverflow(Overflow overflow)
 {
-    return overflow == Overflow::Scroll || overflow == Overflow::Auto || overflow == Overflow::Overlay;
+    return overflow == Overflow::Scroll || overflow == Overflow::Auto;
 }
 #endif
 
index 54595d8..305947b 100644 (file)
@@ -604,9 +604,9 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
     case CSSPropertyOverflowWrap: // normal | break-word
     case CSSPropertyWordWrap:
         return valueID == CSSValueNormal || valueID == CSSValueBreakWord;
-    case CSSPropertyOverflowX: // visible | hidden | scroll | auto | overlay
+    case CSSPropertyOverflowX: // visible | hidden | scroll | auto | overlay (overlay is a synonym for auto)
         return valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay;
-    case CSSPropertyOverflowY: // visible | hidden | scroll | auto | overlay | -webkit-paged-x | -webkit-paged-y
+    case CSSPropertyOverflowY: // visible | hidden | scroll | auto | overlay | -webkit-paged-x | -webkit-paged-y (overlay is a synonym for auto)
         return valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitPagedX || valueID == CSSValueWebkitPagedY;
     case CSSPropertyBreakAfter:
     case CSSPropertyBreakBefore:
index aacad28..08fd390 100644 (file)
@@ -468,8 +468,8 @@ Node* Frame::nodeRespondingToScrollWheelEvents(const FloatPoint& viewportLocatio
             auto& style = renderer->style();
 
             if (renderer->hasOverflowClip()
-                && (style.overflowY() == Overflow::Auto || style.overflowY() == Overflow::Scroll || style.overflowY() == Overflow::Overlay
-                || style.overflowX() == Overflow::Auto || style.overflowX() == Overflow::Scroll || style.overflowX() == Overflow::Overlay)) {
+                && (style.overflowY() == Overflow::Auto || style.overflowY() == Overflow::Scroll
+                || style.overflowX() == Overflow::Auto || style.overflowX() == Overflow::Scroll)) {
                 scrollingAncestor = node;
             }
         }
index 5a2ef2f..4494df5 100644 (file)
@@ -937,13 +937,13 @@ void RenderBox::panScroll(const IntPoint& source)
 bool RenderBox::hasVerticalScrollbarWithAutoBehavior() const
 {
     bool overflowScrollActsLikeAuto = style().overflowY() == Overflow::Scroll && !style().hasPseudoStyle(PseudoId::Scrollbar) && ScrollbarTheme::theme().usesOverlayScrollbars();
-    return hasOverflowClip() && (style().overflowY() == Overflow::Auto || style().overflowY() == Overflow::Overlay || overflowScrollActsLikeAuto);
+    return hasOverflowClip() && (style().overflowY() == Overflow::Auto || overflowScrollActsLikeAuto);
 }
 
 bool RenderBox::hasHorizontalScrollbarWithAutoBehavior() const
 {
     bool overflowScrollActsLikeAuto = style().overflowX() == Overflow::Scroll && !style().hasPseudoStyle(PseudoId::Scrollbar) && ScrollbarTheme::theme().usesOverlayScrollbars();
-    return hasOverflowClip() && (style().overflowX() == Overflow::Auto || style().overflowX() == Overflow::Overlay || overflowScrollActsLikeAuto);
+    return hasOverflowClip() && (style().overflowX() == Overflow::Auto || overflowScrollActsLikeAuto);
 }
 
 bool RenderBox::needsPreferredWidthsRecalculation() const
index 46b3a46..4975c8e 100644 (file)
@@ -3472,7 +3472,7 @@ static bool styleDefinesAutomaticScrollbar(const RenderStyle& style, ScrollbarOr
 {
     Overflow overflow = axis == ScrollbarOrientation::HorizontalScrollbar ? style.overflowX() : style.overflowY();
     bool overflowScrollActsLikeAuto = overflow == Overflow::Scroll && !style.hasPseudoStyle(PseudoId::Scrollbar) && ScrollbarTheme::theme().usesOverlayScrollbars();
-    return overflow == Overflow::Auto || overflow == Overflow::Overlay || overflowScrollActsLikeAuto;
+    return overflow == Overflow::Auto || overflowScrollActsLikeAuto;
 }
 
 void RenderLayer::updateScrollbarsAfterLayout()
index f8b5cd6..c4f2708 100644 (file)
@@ -902,7 +902,7 @@ static bool checkIfDescendantClippingContextNeedsUpdate(const RenderLayer& layer
 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
 static bool isScrollableOverflow(Overflow overflow)
 {
-    return overflow == Overflow::Scroll || overflow == Overflow::Auto || overflow == Overflow::Overlay;
+    return overflow == Overflow::Scroll || overflow == Overflow::Auto;
 }
 
 static bool styleHasTouchScrolling(const RenderStyle& style)
index 283df64..40f4af4 100644 (file)
@@ -256,7 +256,6 @@ enum class Overflow : uint8_t {
     Hidden,
     Scroll,
     Auto,
-    Overlay,
     PagedX,
     PagedY
 };
index ed0b7d0..d09d2f7 100644 (file)
@@ -1,3 +1,16 @@
+2018-09-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Make "overflow: overlay" a synonym for "overflow: auto"
+        https://bugs.webkit.org/show_bug.cgi?id=189811
+
+        Reviewed by Zalan Bujtas.
+        
+        Remove "overlay" from the overflow values.
+
+        * UserInterface/Models/CSSKeywordCompletions.js:
+        * UserInterface/Views/VisualStyleDetailsPanel.js:
+        (WI.VisualStyleDetailsPanel.prototype._populateDisplaySection):
+
 2018-09-21  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: hide Accessibility Audit Tab setting
index b631adb..53536c5 100644 (file)
@@ -383,7 +383,7 @@ WI.CSSKeywordCompletions._propertyKeywordMap = {
         "none", "first", "last", "allow-end", "force-end"
     ],
     "overflow": [
-        "hidden", "auto", "visible", "overlay", "scroll", "marquee", "-webkit-paged-x", "-webkit-paged-y"
+        "hidden", "auto", "visible", "scroll", "marquee", "-webkit-paged-x", "-webkit-paged-y"
     ],
     "-webkit-box-reflect": [
         "none", "left", "right", "above", "below"
@@ -1116,10 +1116,10 @@ WI.CSSKeywordCompletions._propertyKeywordMap = {
         "normal", "break-word",
     ],
     "overflow-x": [
-        "hidden", "auto", "visible", "overlay", "scroll",
+        "hidden", "auto", "visible", "scroll",
     ],
     "overflow-y": [
-        "hidden", "auto", "visible", "overlay", "scroll", "-webkit-paged-x", "-webkit-paged-y",
+        "hidden", "auto", "visible", "scroll", "-webkit-paged-x", "-webkit-paged-y",
     ],
     "pointer-events": [
         "none", "all", "auto", "visible", "visiblePainted", "visibleFill", "visibleStroke", "painted", "fill", "stroke",