Changeset 252076 in webkit


Ignore:
Timestamp:
Nov 5, 2019 1:41:48 PM (4 years ago)
Author:
Oriol Brufau
Message:

[css-lists] Implement list-style-type: <string>
https://bugs.webkit.org/show_bug.cgi?id=167729

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Some tests pass now.

  • web-platform-tests/css/css-lists/parsing/list-style-type-computed-expected.txt:
  • web-platform-tests/css/css-lists/parsing/list-style-type-valid-expected.txt:

Source/WebCore:

This patch extends the syntax of the list-style-type property to accept
arbitrary string values in order to customize the marker contents.

When a string is specified for list-style-type, the patch sets it to a
special ListStyleType::String, and the string value is stored in an
extra field.

Tests: imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001a.html

imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001b.html
imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html
imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-003.html
imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-004.html
imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005a.html
imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005b.html
imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-006.html
imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-007.html
imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-computed.html
imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-valid.html

Some tests fail because mixed-bidi is not supported in markers
(https://bugs.webkit.org/show_bug.cgi?id=202849).

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):

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

(WebCore::CSSParserFastPaths::isPartialKeywordPropertyID):

  • css/parser/CSSParserFastPaths.h:
  • css/parser/CSSPropertyParser.cpp:

(WebCore::CSSPropertyParser::parseSingleValue):

  • rendering/RenderListMarker.cpp:

(WebCore::effectiveListMarkerType):
(WebCore::listMarkerSuffix):
(WebCore::listMarkerText):
(WebCore::RenderListMarker::styleDidChange):
(WebCore::RenderListMarker::paint):
(WebCore::RenderListMarker::updateContent):
(WebCore::RenderListMarker::computePreferredLogicalWidths):
(WebCore::RenderListMarker::updateMargins):
(WebCore::RenderListMarker::suffix const):
(WebCore::RenderListMarker::getRelativeMarkerRect):

  • rendering/style/CounterContent.h:

(WebCore::CounterContent::CounterContent):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::listStyleStringValue const):
(WebCore::RenderStyle::setListStyleStringValue):
(WebCore::RenderStyle::initialListStyleStringValue):

  • rendering/style/RenderStyleConstants.cpp:

(WebCore::operator<<):

  • rendering/style/RenderStyleConstants.h:
  • rendering/style/StyleRareInheritedData.cpp:

(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):

  • rendering/style/StyleRareInheritedData.h:
  • style/StyleBuilderCustom.h:

(WebCore::Style::BuilderCustom::applyInheritListStyleType):
(WebCore::Style::BuilderCustom::applyInitialListStyleType):
(WebCore::Style::BuilderCustom::applyValueListStyleType):

LayoutTests:

Most tests pass now, but some still fail because mixed-bidi is not
supported in markers (https://bugs.webkit.org/show_bug.cgi?id=202849).

iOS and Mac have some extra failures due to subpixel differences for the
marker position.

  • TestExpectations:
  • platform/ios/TestExpectations:
  • platform/mac/TestExpectations:
Location:
trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r252070 r252076  
     12019-11-05  Oriol Brufau  <obrufau@igalia.com>
     2
     3        [css-lists] Implement list-style-type: <string>
     4        https://bugs.webkit.org/show_bug.cgi?id=167729
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Most tests pass now, but some still fail because mixed-bidi is not
     9        supported in markers (https://bugs.webkit.org/show_bug.cgi?id=202849).
     10
     11        iOS and Mac have some extra failures due to subpixel differences for the
     12        marker position.
     13
     14        * TestExpectations:
     15        * platform/ios/TestExpectations:
     16        * platform/mac/TestExpectations:
     17
    1182019-11-05  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/LayoutTests/TestExpectations

    r252047 r252076  
    35863586imported/w3c/web-platform-tests/css/css-lists/counter-reset-inside-display-contents.html [ ImageOnlyFailure ]
    35873587imported/w3c/web-platform-tests/css/css-lists/list-marker-with-lineheight-and-overflow-hidden-001.html [ ImageOnlyFailure ]
    3588 webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001a.html [ ImageOnlyFailure ]
    3589 webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001b.html [ ImageOnlyFailure ]
    3590 webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html [ ImageOnlyFailure ]
    3591 webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-003.html [ ImageOnlyFailure ]
    3592 webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005a.html [ ImageOnlyFailure ]
    3593 webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005b.html [ ImageOnlyFailure ]
    3594 webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-006.html [ ImageOnlyFailure ]
    3595 webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-007.html [ ImageOnlyFailure ]
     3588webkit.org/b/202849 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005a.html [ ImageOnlyFailure ]
     3589webkit.org/b/202849 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005b.html [ ImageOnlyFailure ]
     3590webkit.org/b/202849 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-006.html [ ImageOnlyFailure ]
    35963591imported/w3c/web-platform-tests/css/css-lists/list-with-image-display-changed-001.html [ ImageOnlyFailure ]
    35973592
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r252069 r252076  
     12019-11-05  Oriol Brufau  <obrufau@igalia.com>
     2
     3        [css-lists] Implement list-style-type: <string>
     4        https://bugs.webkit.org/show_bug.cgi?id=167729
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Some tests pass now.
     9
     10        * web-platform-tests/css/css-lists/parsing/list-style-type-computed-expected.txt:
     11        * web-platform-tests/css/css-lists/parsing/list-style-type-valid-expected.txt:
     12
    1132019-11-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-computed-expected.txt

    r252009 r252076  
    1515PASS Property list-style-type value 'lower-alpha' computes to 'lower-alpha'
    1616PASS Property list-style-type value 'upper-alpha' computes to 'upper-alpha'
    17 FAIL Property list-style-type value '"marker string"' computes to '"marker string"' assert_true: '"marker string"' is a supported value for list-style-type. expected true got false
    18 FAIL Property list-style-type value '"Note: "' computes to '"Note: "' assert_true: '"Note: "' is a supported value for list-style-type. expected true got false
     17PASS Property list-style-type value '"marker string"' computes to '"marker string"'
     18PASS Property list-style-type value '"Note: "' computes to '"Note: "'
    1919FAIL Property list-style-type value 'counter-Style-Name' computes to 'counter-Style-Name' assert_true: 'counter-Style-Name' is a supported value for list-style-type. expected true got false
    2020FAIL Property list-style-type value 'CounterStyleName' computes to 'CounterStyleName' assert_true: 'CounterStyleName' is a supported value for list-style-type. expected true got false
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-valid-expected.txt

    r252009 r252076  
    1515PASS e.style['list-style-type'] = "lower-alpha" should set the property value
    1616PASS e.style['list-style-type'] = "upper-alpha" should set the property value
    17 FAIL e.style['list-style-type'] = "\"marker string\"" should set the property value assert_not_equals: property should be set got disallowed value ""
    18 FAIL e.style['list-style-type'] = "\"Note: \"" should set the property value assert_not_equals: property should be set got disallowed value ""
     17PASS e.style['list-style-type'] = "\"marker string\"" should set the property value
     18PASS e.style['list-style-type'] = "\"Note: \"" should set the property value
    1919FAIL e.style['list-style-type'] = "counter-Style-Name" should set the property value assert_not_equals: property should be set got disallowed value ""
    2020FAIL e.style['list-style-type'] = "CounterStyleName" should set the property value assert_not_equals: property should be set got disallowed value ""
  • trunk/LayoutTests/platform/ios/TestExpectations

    r252038 r252076  
    34693469webkit.org/b/203416 imported/w3c/web-platform-tests/css/css-transitions/before-load-001.html [ Pass Failure ]
    34703470webkit.org/b/203416 imported/w3c/web-platform-tests/css/css-transitions/properties-value-auto-001.html [ Pass Failure ]
     3471
     3472# This test fails in iOS due to subpixel differences for the marker position
     3473imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r252064 r252076  
    20282028# rdar://54275897 ([ macOS ] Add support for batched key requests)
    20292029platform/mac/media/encrypted-media/fps-multiple-pssh.html [ Skip ]
     2030
     2031# These tests fail in Mac due to subpixel differences for the marker position
     2032imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html [ ImageOnlyFailure ]
     2033imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-004.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r252070 r252076  
     12019-11-05  Oriol Brufau  <obrufau@igalia.com>
     2
     3        [css-lists] Implement list-style-type: <string>
     4        https://bugs.webkit.org/show_bug.cgi?id=167729
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This patch extends the syntax of the list-style-type property to accept
     9        arbitrary string values in order to customize the marker contents.
     10
     11        When a string is specified for list-style-type, the patch sets it to a
     12        special ListStyleType::String, and the string value is stored in an
     13        extra field.
     14
     15        Tests: imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001a.html
     16               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001b.html
     17               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html
     18               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-003.html
     19               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-004.html
     20               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005a.html
     21               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005b.html
     22               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-006.html
     23               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-007.html
     24               imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-computed.html
     25               imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-valid.html
     26
     27        Some tests fail because mixed-bidi is not supported in markers
     28        (https://bugs.webkit.org/show_bug.cgi?id=202849).
     29
     30        * css/CSSComputedStyleDeclaration.cpp:
     31        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
     32        * css/CSSPrimitiveValueMappings.h:
     33        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     34        * css/CSSProperties.json:
     35        * css/parser/CSSParserFastPaths.cpp:
     36        (WebCore::CSSParserFastPaths::isPartialKeywordPropertyID):
     37        * css/parser/CSSParserFastPaths.h:
     38        * css/parser/CSSPropertyParser.cpp:
     39        (WebCore::CSSPropertyParser::parseSingleValue):
     40        * rendering/RenderListMarker.cpp:
     41        (WebCore::effectiveListMarkerType):
     42        (WebCore::listMarkerSuffix):
     43        (WebCore::listMarkerText):
     44        (WebCore::RenderListMarker::styleDidChange):
     45        (WebCore::RenderListMarker::paint):
     46        (WebCore::RenderListMarker::updateContent):
     47        (WebCore::RenderListMarker::computePreferredLogicalWidths):
     48        (WebCore::RenderListMarker::updateMargins):
     49        (WebCore::RenderListMarker::suffix const):
     50        (WebCore::RenderListMarker::getRelativeMarkerRect):
     51        * rendering/style/CounterContent.h:
     52        (WebCore::CounterContent::CounterContent):
     53        * rendering/style/RenderStyle.h:
     54        (WebCore::RenderStyle::listStyleStringValue const):
     55        (WebCore::RenderStyle::setListStyleStringValue):
     56        (WebCore::RenderStyle::initialListStyleStringValue):
     57        * rendering/style/RenderStyleConstants.cpp:
     58        (WebCore::operator<<):
     59        * rendering/style/RenderStyleConstants.h:
     60        * rendering/style/StyleRareInheritedData.cpp:
     61        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
     62        (WebCore::StyleRareInheritedData::operator== const):
     63        * rendering/style/StyleRareInheritedData.h:
     64        * style/StyleBuilderCustom.h:
     65        (WebCore::Style::BuilderCustom::applyInheritListStyleType):
     66        (WebCore::Style::BuilderCustom::applyInitialListStyleType):
     67        (WebCore::Style::BuilderCustom::applyValueListStyleType):
     68
    1692019-11-05  Simon Fraser  <simon.fraser@apple.com>
    270
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r251965 r252076  
    29342934            return cssValuePool.createValue(style.listStylePosition());
    29352935        case CSSPropertyListStyleType:
     2936            if (style.listStyleType() == ListStyleType::String)
     2937                return cssValuePool.createValue(style.listStyleStringValue(), CSSPrimitiveValue::CSS_STRING);
    29362938            return cssValuePool.createValue(style.listStyleType());
    29372939        case CSSPropertyWebkitLocale:
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r251444 r252076  
    19311931    case ListStyleType::Square:
    19321932        m_value.valueID = CSSValueSquare;
     1933        break;
     1934    case ListStyleType::String:
     1935        ASSERT_NOT_REACHED();
     1936        m_value.valueID = CSSValueInvalid;
    19331937        break;
    19341938    case ListStyleType::Telugu:
  • trunk/Source/WebCore/css/CSSProperties.json

    r251776 r252076  
    28182818                "none"
    28192819            ],
     2820            "codegen-properties": {
     2821                "custom": "All"
     2822            },
    28202823            "specification": {
    28212824                "category": "css-lists",
  • trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp

    r251444 r252076  
    984984}
    985985
     986bool CSSParserFastPaths::isPartialKeywordPropertyID(CSSPropertyID propertyId)
     987{
     988    switch (propertyId) {
     989    case CSSPropertyListStyleType:
     990        return true;
     991    default:
     992        return false;
     993    }
     994}
     995
    986996static bool isUniversalKeyword(const String& string)
    987997{
  • trunk/Source/WebCore/css/parser/CSSParserFastPaths.h

    r243318 r252076  
    4949    // Properties handled here shouldn't be explicitly handled in CSSPropertyParser
    5050    static bool isKeywordPropertyID(CSSPropertyID);
     51
     52    // Returns whether a property may be handled by the fast path but has other
     53    // non-keyword values which should be handled by the CSSPropertyParser.
     54    static bool isPartialKeywordPropertyID(CSSPropertyID);
     55
    5156    static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID, const CSSParserContext&);
    5257
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r251864 r252076  
    37933793{
    37943794    if (CSSParserFastPaths::isKeywordPropertyID(property)) {
    3795         if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context))
    3796             return nullptr;
    3797 
    3798         return consumeIdent(m_range);
     3795        if (CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context))
     3796            return consumeIdent(m_range);
     3797
     3798        // Some properties need to fallback onto the regular parser.
     3799        if (!CSSParserFastPaths::isPartialKeywordPropertyID(property))
     3800            return nullptr;
    37993801    }
    38003802    switch (property) {
     
    42494251        return consumeColorScheme(m_range);
    42504252#endif
     4253    case CSSPropertyListStyleType:
     4254        // NOTE: All the keyword values for the list-style-type property are handled by the CSSParserFastPaths.
     4255        return consumeString(m_range);
    42514256    default:
    42524257        return nullptr;
  • trunk/Source/WebCore/rendering/RenderListMarker.cpp

    r246034 r252076  
    497497    case ListStyleType::UpperNorwegian:
    498498        return (value < 1) ? ListStyleType::Decimal : type;
     499    case ListStyleType::String:
     500        ASSERT_NOT_REACHED();
     501        break;
    499502    }
    500503
     
    596599    case ListStyleType::Urdu:
    597600        return '.';
     601    case ListStyleType::String:
     602        ASSERT_NOT_REACHED();
     603        break;
    598604    }
    599605
     
    10491055    case ListStyleType::Hebrew:
    10501056        return toHebrew(value);
     1057    case ListStyleType::String:
     1058        ASSERT_NOT_REACHED();
     1059        break;
    10511060    }
    10521061
     
    10791088{
    10801089    RenderBox::styleDidChange(diff, oldStyle);
    1081 
    10821090    if (oldStyle) {
    1083         if (style().listStylePosition() != oldStyle->listStylePosition() || style().listStyleType() != oldStyle->listStyleType())
     1091        if (style().listStylePosition() != oldStyle->listStylePosition() || style().listStyleType() != oldStyle->listStyleType() || (style().listStyleType() == ListStyleType::String && style().listStyleStringValue() != oldStyle->listStyleStringValue()))
    10841092            setNeedsLayoutAndPrefWidthsRecalc();
    10851093        if (oldStyle->isDisplayInlineType() && !style().isDisplayInlineType()) {
     
    12591267    case ListStyleType::Asterisks:
    12601268    case ListStyleType::Footnotes:
     1269    case ListStyleType::String:
    12611270        break;
    12621271    }
     
    12811290    textOrigin = roundPointToDevicePixels(LayoutPoint(textOrigin), document().deviceScaleFactor(), style().isLeftToRightDirection());
    12821291
    1283     if (type == ListStyleType::Asterisks || type == ListStyleType::Footnotes)
     1292    if (type == ListStyleType::Asterisks || type == ListStyleType::Footnotes || type == ListStyleType::String)
    12841293        context.drawText(font, textRun, textOrigin);
    12851294    else {
     
    13951404    switch (type) {
    13961405    case ListStyleType::None:
     1406        break;
     1407    case ListStyleType::String:
     1408        m_text = style().listStyleStringValue();
    13971409        break;
    13981410    case ListStyleType::Circle:
     
    15041516        break;
    15051517    case ListStyleType::Asterisks:
    1506     case ListStyleType::Footnotes: {
    1507         TextRun run = RenderBlock::constructTextRun(m_text, style());
    1508         logicalWidth = font.width(run); // no suffix for these types
     1518    case ListStyleType::Footnotes:
     1519    case ListStyleType::String: {
     1520        if (!m_text.isEmpty()) {
     1521            TextRun run = RenderBlock::constructTextRun(m_text, style());
     1522            logicalWidth = font.width(run); // no suffix for these types
     1523        }
    15091524        break;
    15101525    }
     
    16291644                break;
    16301645        }
     1646    } else if (isImage()) {
     1647        marginStart = -minPreferredLogicalWidth() - cMarkerPadding;
     1648        marginEnd = cMarkerPadding;
    16311649    } else {
    1632         if (style().isLeftToRightDirection()) {
    1633             if (isImage())
    1634                 marginStart = -minPreferredLogicalWidth() - cMarkerPadding;
    1635             else {
    1636                 int offset = fontMetrics.ascent() * 2 / 3;
    1637                 switch (style().listStyleType()) {
    1638                 case ListStyleType::Disc:
    1639                 case ListStyleType::Circle:
    1640                 case ListStyleType::Square:
    1641                     marginStart = -offset - cMarkerPadding - 1;
    1642                     break;
    1643                 case ListStyleType::None:
    1644                     break;
    1645                 default:
    1646                     marginStart = m_text.isEmpty() ? 0_lu : -minPreferredLogicalWidth() - offset / 2;
    1647                 }
     1650        int offset = fontMetrics.ascent() * 2 / 3;
     1651        switch (style().listStyleType()) {
     1652        case ListStyleType::Disc:
     1653        case ListStyleType::Circle:
     1654        case ListStyleType::Square:
     1655            marginStart = -offset - cMarkerPadding - 1;
     1656            marginEnd = offset + cMarkerPadding + 1 - minPreferredLogicalWidth();
     1657            break;
     1658        case ListStyleType::None:
     1659            break;
     1660        case ListStyleType::String:
     1661            if (!m_text.isEmpty())
     1662                marginStart = -minPreferredLogicalWidth();
     1663            break;
     1664        default:
     1665            if (!m_text.isEmpty()) {
     1666                marginStart = -minPreferredLogicalWidth() - offset / 2;
     1667                marginEnd = offset / 2;
    16481668            }
    1649             marginEnd = -marginStart - minPreferredLogicalWidth();
    1650         } else {
    1651             if (isImage())
    1652                 marginEnd = cMarkerPadding;
    1653             else {
    1654                 int offset = fontMetrics.ascent() * 2 / 3;
    1655                 switch (style().listStyleType()) {
    1656                 case ListStyleType::Disc:
    1657                 case ListStyleType::Circle:
    1658                 case ListStyleType::Square:
    1659                     marginEnd = offset + cMarkerPadding + 1 - minPreferredLogicalWidth();
    1660                     break;
    1661                 case ListStyleType::None:
    1662                     break;
    1663                 default:
    1664                     marginEnd = m_text.isEmpty() ? 0 : offset / 2;
    1665                 }
    1666             }
    1667             marginStart = -marginEnd - minPreferredLogicalWidth();
    16681669        }
    1669        
    16701670    }
    16711671
     
    16911691{
    16921692    ListStyleType type = style().listStyleType();
     1693    if (type == ListStyleType::String)
     1694        return ""_str;
     1695
    16931696    const UChar suffix = listMarkerSuffix(type, m_listItem->value());
    16941697
     
    17231726    switch (type) {
    17241727    case ListStyleType::Asterisks:
    1725     case ListStyleType::Footnotes: {
     1728    case ListStyleType::Footnotes:
     1729    case ListStyleType::String: {
     1730        if (m_text.isEmpty())
     1731            return FloatRect();
    17261732        const FontCascade& font = style().fontCascade();
    17271733        TextRun run = RenderBlock::constructTextRun(m_text, style());
  • trunk/Source/WebCore/rendering/style/CounterContent.h

    r246490 r252076  
    3838        , m_separator(separator)
    3939    {
     40        ASSERT(style != ListStyleType::String);
    4041    }
    4142
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r251119 r252076  
    447447    CaptionSide captionSide() const { return static_cast<CaptionSide>(m_inheritedFlags.captionSide); }
    448448
     449    const AtomString& listStyleStringValue() const { return m_rareInheritedData->listStyleStringValue; }
    449450    ListStyleType listStyleType() const { return static_cast<ListStyleType>(m_inheritedFlags.listStyleType); }
    450451    StyleImage* listStyleImage() const;
     
    995996    void setAspectRatioNumerator(float v) { SET_VAR(m_rareNonInheritedData, aspectRatioNumerator, v); }
    996997
     998    void setListStyleStringValue(const AtomString& s) { SET_VAR(m_rareInheritedData, listStyleStringValue, s); }
    997999    void setListStyleType(ListStyleType v) { m_inheritedFlags.listStyleType = static_cast<unsigned>(v); }
    9981000    void setListStyleImage(RefPtr<StyleImage>&&);
     
    14711473    static EmptyCell initialEmptyCells() { return EmptyCell::Show; }
    14721474    static ListStylePosition initialListStylePosition() { return ListStylePosition::Outside; }
     1475    static const AtomString& initialListStyleStringValue() { return nullAtom(); }
    14731476    static ListStyleType initialListStyleType() { return ListStyleType::Disc; }
    14741477    static TextTransform initialTextTransform() { return TextTransform::None; }
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp

    r251444 r252076  
    759759    case ListStyleType::KatakanaIroha: ts << "katakana-iroha"; break;
    760760    case ListStyleType::None: ts << "none"; break;
     761    case ListStyleType::String: ts << "string"; break;
    761762    }
    762763    return ts;
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r251444 r252076  
    632632    HiraganaIroha,
    633633    KatakanaIroha,
    634     None
     634    None,
     635    String
    635636};
    636637
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp

    r251058 r252076  
    4343    Color colors[9];
    4444    void* ownPtrs[1];
    45     AtomString atomStrings[5];
     45    AtomString atomStrings[6];
    4646    void* refPtrs[3];
    4747    Length lengths[2];
     
    7676StyleRareInheritedData::StyleRareInheritedData()
    7777    : listStyleImage(RenderStyle::initialListStyleImage())
     78    , listStyleStringValue(RenderStyle::initialListStyleStringValue())
    7879    , textStrokeWidth(RenderStyle::initialTextStrokeWidth())
    7980    , indent(RenderStyle::initialTextIndent())
     
    164165    : RefCounted<StyleRareInheritedData>()
    165166    , listStyleImage(o.listStyleImage)
     167    , listStyleStringValue(o.listStyleStringValue)
    166168    , textStrokeColor(o.textStrokeColor)
    167169    , textStrokeWidth(o.textStrokeWidth)
     
    365367        && miterLimit == o.miterLimit
    366368        && customProperties == o.customProperties
    367         && arePointingToEqualData(listStyleImage, o.listStyleImage);
     369        && arePointingToEqualData(listStyleImage, o.listStyleImage)
     370        && listStyleStringValue == o.listStyleStringValue;
    368371}
    369372
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h

    r251058 r252076  
    6969
    7070    RefPtr<StyleImage> listStyleImage;
     71    AtomString listStyleStringValue;
    7172
    7273    Color textStrokeColor;
  • trunk/Source/WebCore/style/StyleBuilderCustom.h

    r251916 r252076  
    9090    DECLARE_PROPERTY_CUSTOM_HANDLERS(LineHeight);
    9191#endif
     92    DECLARE_PROPERTY_CUSTOM_HANDLERS(ListStyleType);
    9293    DECLARE_PROPERTY_CUSTOM_HANDLERS(OutlineStyle);
    9394    DECLARE_PROPERTY_CUSTOM_HANDLERS(Size);
     
    679680
    680681#endif
     682
     683inline void BuilderCustom::applyInheritListStyleType(BuilderState& builderState)
     684{
     685    builderState.style().setListStyleType(builderState.parentStyle().listStyleType());
     686    builderState.style().setListStyleStringValue(builderState.parentStyle().listStyleStringValue());
     687}
     688
     689inline void BuilderCustom::applyInitialListStyleType(BuilderState& builderState)
     690{
     691    builderState.style().setListStyleType(RenderStyle::initialListStyleType());
     692    builderState.style().setListStyleStringValue(RenderStyle::initialListStyleStringValue());
     693}
     694
     695inline void BuilderCustom::applyValueListStyleType(BuilderState& builderState, CSSValue& value)
     696{
     697    auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
     698    if (primitiveValue.isValueID()) {
     699        builderState.style().setListStyleType(primitiveValue);
     700        builderState.style().setListStyleStringValue(RenderStyle::initialListStyleStringValue());
     701        return;
     702    }
     703    builderState.style().setListStyleType(ListStyleType::String);
     704    builderState.style().setListStyleStringValue(primitiveValue.stringValue());
     705}
    681706
    682707inline void BuilderCustom::applyInheritOutlineStyle(BuilderState& builderState)
Note: See TracChangeset for help on using the changeset viewer.