Changeset 236341 in webkit


Ignore:
Timestamp:
Sep 21, 2018 11:42:25 AM (6 years ago)
Author:
Simon Fraser
Message:

Make "overflow: overlay" a synonym for "overflow: auto"
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.
Location:
trunk
Files:
2 added
2 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r236340 r236341  
     12018-09-20  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Make "overflow: overlay" a synonym for "overflow: auto"
     4        https://bugs.webkit.org/show_bug.cgi?id=189811
     5
     6        Reviewed by Zalan Bujtas.
     7       
     8        Add a modern CSS parsing/computed style test for overflow, superseding
     9        fast/css/overflow-property.html.
     10
     11        * fast/css/getComputedStyle/getComputedStyle-overflow-expected.txt: Added.
     12        * fast/css/getComputedStyle/getComputedStyle-overflow.html: Added.
     13        * fast/css/overflow-property-expected.txt: Removed.
     14        * fast/css/overflow-property.html: Removed.
     15
    1162018-09-21  Ryan Haddad  <ryanhaddad@apple.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r236339 r236341  
     12018-09-20  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Make "overflow: overlay" a synonym for "overflow: auto"
     4        https://bugs.webkit.org/show_bug.cgi?id=189811
     5
     6        Reviewed by Zalan Bujtas.
     7       
     8        The "overlay" value for overflow was added for an internal Safari feature, and only has
     9        an effect (allow the scrollbar to overlap the content) with legacy scrollbars on macOS.
     10        It's little used on the web.
     11
     12        To simplify code in rendering, just make "overflow: overlay" behave like "overflow: auto".
     13        It's still parsed, but turns into an "auto" value internally, and will be returned from getComputedStyle
     14        as "auto".
     15
     16        Test: fast/css/getComputedStyle/getComputedStyle-overflow.html
     17
     18        * css/CSSPrimitiveValueMappings.h:
     19        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     20        (WebCore::CSSPrimitiveValue::operator Overflow const):
     21        * css/CSSProperties.json:
     22        * css/CSSValueKeywords.in:
     23        * css/StyleResolver.cpp:
     24        (WebCore::isScrollableOverflow):
     25        * css/parser/CSSParserFastPaths.cpp:
     26        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
     27        * page/ios/FrameIOS.mm:
     28        (WebCore::Frame::nodeRespondingToScrollWheelEvents):
     29        * rendering/RenderBox.cpp:
     30        (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
     31        (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
     32        * rendering/RenderLayer.cpp:
     33        (WebCore::styleDefinesAutomaticScrollbar):
     34        * rendering/RenderLayerCompositor.cpp:
     35        (WebCore::isScrollableOverflow):
     36        * rendering/style/RenderStyleConstants.h:
     37
    1382018-09-21  Youenn Fablet  <youenn@apple.com>
    239
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r235754 r236341  
    21702170        m_value.valueID = CSSValueAuto;
    21712171        break;
    2172     case Overflow::Overlay:
    2173         m_value.valueID = CSSValueOverlay;
    2174         break;
    21752172    case Overflow::PagedX:
    21762173        m_value.valueID = CSSValueWebkitPagedX;
     
    21932190    case CSSValueScroll:
    21942191        return Overflow::Scroll;
     2192    case CSSValueOverlay:
    21952193    case CSSValueAuto:
    21962194        return Overflow::Auto;
    2197     case CSSValueOverlay:
    2198         return Overflow::Overlay;
    21992195    case CSSValueWebkitPagedX:
    22002196        return Overflow::PagedX;
  • trunk/Source/WebCore/css/CSSProperties.json

    r234898 r236341  
    30333033                "hidden",
    30343034                "scroll",
    3035                 "auto",
    3036                 "overlay"
     3035                "auto"
    30373036            ],
    30383037            "specification": {
     
    30473046                "scroll",
    30483047                "auto",
    3049                 "overlay",
    30503048                "-webkit-paged-x",
    30513049                "-webkit-paged-y"
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r235866 r236341  
    552552nowrap
    553553open-quote
    554 overlay
    555554overline
    556555portrait
     
    11541153multiply
    11551154screen
    1156 // overlay
     1155overlay
    11571156darken
    11581157lighten
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r234017 r236341  
    745745static bool isScrollableOverflow(Overflow overflow)
    746746{
    747     return overflow == Overflow::Scroll || overflow == Overflow::Auto || overflow == Overflow::Overlay;
     747    return overflow == Overflow::Scroll || overflow == Overflow::Auto;
    748748}
    749749#endif
  • trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp

    r235754 r236341  
    605605    case CSSPropertyWordWrap:
    606606        return valueID == CSSValueNormal || valueID == CSSValueBreakWord;
    607     case CSSPropertyOverflowX: // visible | hidden | scroll | auto | overlay
     607    case CSSPropertyOverflowX: // visible | hidden | scroll | auto | overlay (overlay is a synonym for auto)
    608608        return valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay;
    609     case CSSPropertyOverflowY: // visible | hidden | scroll | auto | overlay | -webkit-paged-x | -webkit-paged-y
     609    case CSSPropertyOverflowY: // visible | hidden | scroll | auto | overlay | -webkit-paged-x | -webkit-paged-y (overlay is a synonym for auto)
    610610        return valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitPagedX || valueID == CSSValueWebkitPagedY;
    611611    case CSSPropertyBreakAfter:
  • trunk/Source/WebCore/page/ios/FrameIOS.mm

    r232178 r236341  
    469469
    470470            if (renderer->hasOverflowClip()
    471                 && (style.overflowY() == Overflow::Auto || style.overflowY() == Overflow::Scroll || style.overflowY() == Overflow::Overlay
    472                 || style.overflowX() == Overflow::Auto || style.overflowX() == Overflow::Scroll || style.overflowX() == Overflow::Overlay)) {
     471                && (style.overflowY() == Overflow::Auto || style.overflowY() == Overflow::Scroll
     472                || style.overflowX() == Overflow::Auto || style.overflowX() == Overflow::Scroll)) {
    473473                scrollingAncestor = node;
    474474            }
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r234808 r236341  
    938938{
    939939    bool overflowScrollActsLikeAuto = style().overflowY() == Overflow::Scroll && !style().hasPseudoStyle(PseudoId::Scrollbar) && ScrollbarTheme::theme().usesOverlayScrollbars();
    940     return hasOverflowClip() && (style().overflowY() == Overflow::Auto || style().overflowY() == Overflow::Overlay || overflowScrollActsLikeAuto);
     940    return hasOverflowClip() && (style().overflowY() == Overflow::Auto || overflowScrollActsLikeAuto);
    941941}
    942942
     
    944944{
    945945    bool overflowScrollActsLikeAuto = style().overflowX() == Overflow::Scroll && !style().hasPseudoStyle(PseudoId::Scrollbar) && ScrollbarTheme::theme().usesOverlayScrollbars();
    946     return hasOverflowClip() && (style().overflowX() == Overflow::Auto || style().overflowX() == Overflow::Overlay || overflowScrollActsLikeAuto);
     946    return hasOverflowClip() && (style().overflowX() == Overflow::Auto || overflowScrollActsLikeAuto);
    947947}
    948948
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r235749 r236341  
    34733473    Overflow overflow = axis == ScrollbarOrientation::HorizontalScrollbar ? style.overflowX() : style.overflowY();
    34743474    bool overflowScrollActsLikeAuto = overflow == Overflow::Scroll && !style.hasPseudoStyle(PseudoId::Scrollbar) && ScrollbarTheme::theme().usesOverlayScrollbars();
    3475     return overflow == Overflow::Auto || overflow == Overflow::Overlay || overflowScrollActsLikeAuto;
     3475    return overflow == Overflow::Auto || overflowScrollActsLikeAuto;
    34763476}
    34773477
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r236149 r236341  
    903903static bool isScrollableOverflow(Overflow overflow)
    904904{
    905     return overflow == Overflow::Scroll || overflow == Overflow::Auto || overflow == Overflow::Overlay;
     905    return overflow == Overflow::Scroll || overflow == Overflow::Auto;
    906906}
    907907
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r235754 r236341  
    257257    Scroll,
    258258    Auto,
    259     Overlay,
    260259    PagedX,
    261260    PagedY
  • trunk/Source/WebInspectorUI/ChangeLog

    r236338 r236341  
     12018-09-20  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Make "overflow: overlay" a synonym for "overflow: auto"
     4        https://bugs.webkit.org/show_bug.cgi?id=189811
     5
     6        Reviewed by Zalan Bujtas.
     7       
     8        Remove "overlay" from the overflow values.
     9
     10        * UserInterface/Models/CSSKeywordCompletions.js:
     11        * UserInterface/Views/VisualStyleDetailsPanel.js:
     12        (WI.VisualStyleDetailsPanel.prototype._populateDisplaySection):
     13
    1142018-09-21  Devin Rousso  <drousso@apple.com>
    215
  • trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js

    r236091 r236341  
    384384    ],
    385385    "overflow": [
    386         "hidden", "auto", "visible", "overlay", "scroll", "marquee", "-webkit-paged-x", "-webkit-paged-y"
     386        "hidden", "auto", "visible", "scroll", "marquee", "-webkit-paged-x", "-webkit-paged-y"
    387387    ],
    388388    "-webkit-box-reflect": [
     
    11171117    ],
    11181118    "overflow-x": [
    1119         "hidden", "auto", "visible", "overlay", "scroll",
     1119        "hidden", "auto", "visible", "scroll",
    11201120    ],
    11211121    "overflow-y": [
    1122         "hidden", "auto", "visible", "overlay", "scroll", "-webkit-paged-x", "-webkit-paged-y",
     1122        "hidden", "auto", "visible", "scroll", "-webkit-paged-x", "-webkit-paged-y",
    11231123    ],
    11241124    "pointer-events": [
Note: See TracChangeset for help on using the changeset viewer.