Changeset 292222 in webkit


Ignore:
Timestamp:
Apr 1, 2022 8:35:55 AM (4 months ago)
Author:
ntim@apple.com
Message:

[css-logical] Add support for block/inline CSS values for resize property
https://bugs.webkit.org/show_bug.cgi?id=218088

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Marked relevant WPT as passing.

  • web-platform-tests/css/css-logical/logical-values-resize-expected.txt:

Source/WebCore:

Tests:

  • Parsing: imported/w3c/web-platform-tests/css/css-logical/logical-values-resize.html
  • Functionality: fast/css/resize-single-axis.html
  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Resize const):

  • css/CSSProperties.json:
  • css/parser/CSSParserFastPaths.cpp:

(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::resize):

  • rendering/style/RenderStyleConstants.cpp:

(WebCore::operator<<):

  • rendering/style/RenderStyleConstants.h:
  • rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

Add tests for functionality.

  • fast/css/resize-single-axis-expected.txt:
  • fast/css/resize-single-axis.html:
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r292218 r292222  
     12022-04-01  Tim Nguyen  <ntim@apple.com>
     2
     3        [css-logical] Add support for block/inline CSS values for resize property
     4        https://bugs.webkit.org/show_bug.cgi?id=218088
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Add tests for functionality.
     9
     10        * fast/css/resize-single-axis-expected.txt:
     11        * fast/css/resize-single-axis.html:
     12
    1132022-04-01  Youenn Fablet  <youenn@apple.com>
    214
  • trunk/LayoutTests/fast/css/resize-single-axis-expected.txt

    r44914 r292222  
    22'horizontal' resized as expected to (100px, 50px).
    33'vertical' resized as expected to (50px, 100px).
     4'block-horizontal' resized as expected to (50px, 100px).
     5'inline-horizontal' resized as expected to (100px, 50px).
     6'block-vertical' resized as expected to (100px, 50px).
     7'inline-vertical' resized as expected to (50px, 100px).
    48
  • trunk/LayoutTests/fast/css/resize-single-axis.html

    r120683 r292222  
    2020        resize: vertical;
    2121    }
     22
     23    #block-horizontal,
     24    #block-vertical {
     25        resize: block;
     26    }
     27
     28    #inline-horizontal,
     29    #inline-vertical {
     30        resize: inline;
     31    }
    2232</style>
    2333
     
    2636<div id="horizontal"></div>
    2737<div id="vertical"></div>
     38<div id="block-horizontal"></div>
     39<div id="inline-horizontal"></div>
     40<section style="writing-mode: vertical-lr;">
     41    <div id="block-vertical"></div>
     42    <div id="inline-vertical"></div>
     43</section>
    2844
    2945<script type="text/javascript">
     
    6177        var horizontal = document.getElementById("horizontal");
    6278        var vertical = document.getElementById("vertical");
     79        var blockHorizontal = document.getElementById("block-horizontal");
     80        var inlineHorizontal = document.getElementById("inline-horizontal");
     81        var blockVertical = document.getElementById("block-vertical");
     82        var inlineVertical = document.getElementById("inline-vertical");
    6383
    6484        resize(both);
    6585        resize(horizontal);
    6686        resize(vertical);
     87        resize(blockHorizontal);
     88        resize(inlineHorizontal);
     89        resize(blockVertical);
     90        resize(inlineVertical);
    6791
    6892        assertSize(both, "100px", "100px");
    6993        assertSize(horizontal, "100px", "50px");
    7094        assertSize(vertical, "50px", "100px");
     95        assertSize(blockHorizontal, "50px", "100px");
     96        assertSize(inlineHorizontal, "100px", "50px");
     97        assertSize(blockVertical, "100px", "50px");
     98        assertSize(inlineVertical, "50px", "100px");
    7199    }
    72100</script>
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r292216 r292222  
     12022-04-01  Tim Nguyen  <ntim@apple.com>
     2
     3        [css-logical] Add support for block/inline CSS values for resize property
     4        https://bugs.webkit.org/show_bug.cgi?id=218088
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Marked relevant WPT as passing.
     9
     10        * web-platform-tests/css/css-logical/logical-values-resize-expected.txt:
     11
    1122022-04-01  Youenn Fablet  <youenn@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-resize-expected.txt

    r264522 r292222  
    11
    2 FAIL Test that 'resize: block' is supported. assert_equals: logical values in inline style, resize expected "block" but got ""
    3 FAIL Test that 'resize: inline' is supported. assert_equals: logical values in inline style, resize expected "inline" but got ""
     2PASS Test that 'resize: block' is supported.
     3PASS Test that 'resize: inline' is supported.
    44
  • trunk/Source/WebCore/ChangeLog

    r292221 r292222  
     12022-04-01  Tim Nguyen  <ntim@apple.com>
     2
     3        [css-logical] Add support for block/inline CSS values for resize property
     4        https://bugs.webkit.org/show_bug.cgi?id=218088
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Tests:
     9        - Parsing: imported/w3c/web-platform-tests/css/css-logical/logical-values-resize.html
     10        - Functionality: fast/css/resize-single-axis.html
     11
     12        * css/CSSPrimitiveValueMappings.h:
     13        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     14        (WebCore::CSSPrimitiveValue::operator Resize const):
     15        * css/CSSProperties.json:
     16        * css/parser/CSSParserFastPaths.cpp:
     17        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
     18        * rendering/RenderLayer.cpp:
     19        (WebCore::RenderLayer::resize):
     20        * rendering/style/RenderStyleConstants.cpp:
     21        (WebCore::operator<<):
     22        * rendering/style/RenderStyleConstants.h:
     23        * rendering/style/StyleRareNonInheritedData.h:
     24
    1252022-04-01  Rob Buis  <rbuis@igalia.com>
    226
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r290813 r292222  
    22032203        m_value.valueID = CSSValueVertical;
    22042204        break;
     2205    case Resize::Block:
     2206        m_value.valueID = CSSValueBlock;
     2207        break;
     2208    case Resize::Inline:
     2209        m_value.valueID = CSSValueInline;
     2210        break;
    22052211    case Resize::None:
    22062212        m_value.valueID = CSSValueNone;
     
    22202226    case CSSValueVertical:
    22212227        return Resize::Vertical;
     2228    case CSSValueBlock:
     2229        return Resize::Block;
     2230    case CSSValueInline:
     2231        return Resize::Inline;
    22222232    case CSSValueAuto:
    22232233        ASSERT_NOT_REACHED(); // Depends on settings, thus should be handled by the caller.
  • trunk/Source/WebCore/css/CSSProperties.json

    r291690 r292222  
    42654265        },
    42664266        "resize": {
    4267             "inherited": true,
    42684267            "values": [
    42694268                "none",
     
    42714270                "horizontal",
    42724271                "vertical",
    4273                 "auto"
     4272                "block",
     4273                "inline",
     4274                {
     4275                    "value": "auto",
     4276                    "status": "non-standard"
     4277                }
    42744278            ],
    42754279            "codegen-properties": {
  • trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp

    r292214 r292222  
    706706            || valueID == CSSValueFixed
    707707            || valueID == CSSValueSticky || valueID == CSSValueWebkitSticky;
    708     case CSSPropertyResize: // none | both | horizontal | vertical | auto
    709         return valueID == CSSValueNone || valueID == CSSValueBoth || valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueAuto;
     708    case CSSPropertyResize: // none | both | horizontal | vertical | block | inline | auto
     709        return valueID == CSSValueNone || valueID == CSSValueBoth || valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueBlock || valueID == CSSValueInline || valueID == CSSValueAuto;
    710710    case CSSPropertyShapeRendering:
    711711        return valueID == CSSValueAuto || valueID == CSSValueOptimizeSpeed || valueID == CSSValueCrispedges || valueID == CSSValueGeometricPrecision;
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r292155 r292222  
    27882788
    27892789    Resize resize = renderer->style().resize();
    2790     if (resize != Resize::Vertical && difference.width()) {
     2790    bool canResizeWidth = resize == Resize::Horizontal || resize == Resize::Both
     2791        || (renderer->isHorizontalWritingMode() ? resize == Resize::Inline : resize == Resize::Block);
     2792    if (canResizeWidth && difference.width()) {
    27912793        if (is<HTMLFormControlElement>(*element)) {
    27922794            // Make implicit margins from the theme explicit (see <http://bugs.webkit.org/show_bug.cgi?id=9547>).
     
    27992801    }
    28002802
    2801     if (resize != Resize::Horizontal && difference.height()) {
     2803    bool canResizeHeight = resize == Resize::Vertical || resize == Resize::Both
     2804        || (renderer->isHorizontalWritingMode() ? resize == Resize::Block : resize == Resize::Inline);
     2805    if (canResizeHeight && difference.height()) {
    28022806        if (is<HTMLFormControlElement>(*element)) {
    28032807            // Make implicit margins from the theme explicit (see <http://bugs.webkit.org/show_bug.cgi?id=9547>).
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp

    r291863 r292222  
    883883    case Resize::Horizontal: ts << "horizontal"; break;
    884884    case Resize::Vertical: ts << "vertical"; break;
     885    case Resize::Block: ts << "block"; break;
     886    case Resize::Inline: ts << "inline"; break;
    885887    }
    886888    return ts;
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r291257 r292222  
    576576    Both,
    577577    Horizontal,
    578     Vertical
     578    Vertical,
     579    Block,
     580    Inline,
    579581};
    580582
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r288556 r292222  
    226226    unsigned breakAfter : 4;
    227227    unsigned breakInside : 3; // BreakInside
    228     unsigned resize : 2; // Resize
     228    unsigned resize : 3; // Resize
    229229
    230230    unsigned inputSecurity : 1; // InputSecurity
Note: See TracChangeset for help on using the changeset viewer.