Changeset 276837 in webkit


Ignore:
Timestamp:
Apr 30, 2021 7:24:32 AM (15 months ago)
Author:
Oriol Brufau
Message:

[css-logical] Fix logical shorthands with var()
https://bugs.webkit.org/show_bug.cgi?id=224594

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Add a new test.
Some cases still fail because of bug 225206 and bug 225209.

  • web-platform-tests/css/css-logical/logicalprops-with-variables-expected.txt: Added.
  • web-platform-tests/css/css-logical/logicalprops-with-variables.html: Added.

Source/WebCore:

Logical shorthands with var() were not working because when resolving
the pending-substitution value of the equivalent physical longhand,
parseValueWithVariableReferences would parse the logical shorthand into
the logical longhands, which would be different properties than the
physical longhand being resolved.

So this patch compares with the equivalent physical property instead.

Test: imported/w3c/web-platform-tests/css/css-logical/logicalprops-with-variables.html

  • css/parser/CSSParser.cpp:

(WebCore::CSSParser::parseValueWithVariableReferences):

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r276835 r276837  
     12021-04-30  Oriol Brufau  <obrufau@igalia.com>
     2
     3        [css-logical] Fix logical shorthands with var()
     4        https://bugs.webkit.org/show_bug.cgi?id=224594
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        Add a new test.
     9        Some cases still fail because of bug 225206 and bug 225209.
     10
     11        * web-platform-tests/css/css-logical/logicalprops-with-variables-expected.txt: Added.
     12        * web-platform-tests/css/css-logical/logicalprops-with-variables.html: Added.
     13
    1142021-04-30  Sergio Villar Senin  <svillar@igalia.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r276836 r276837  
     12021-04-30  Oriol Brufau  <obrufau@igalia.com>
     2
     3        [css-logical] Fix logical shorthands with var()
     4        https://bugs.webkit.org/show_bug.cgi?id=224594
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        Logical shorthands with var() were not working because when resolving
     9        the pending-substitution value of the equivalent physical longhand,
     10        parseValueWithVariableReferences would parse the logical shorthand into
     11        the logical longhands, which would be different properties than the
     12        physical longhand being resolved.
     13
     14        So this patch compares with the equivalent physical property instead.
     15
     16        Test: imported/w3c/web-platform-tests/css/css-logical/logicalprops-with-variables.html
     17
     18        * css/parser/CSSParser.cpp:
     19        (WebCore::CSSParser::parseValueWithVariableReferences):
     20
    1212021-04-30  Antti Koivisto  <antti@apple.com>
    222
  • trunk/Source/WebCore/css/parser/CSSParser.cpp

    r276017 r276837  
    200200
    201201        for (auto& property : parsedProperties) {
    202             if (property.id() == propID)
     202            CSSPropertyID currentId = property.id();
     203            if (CSSProperty::isDirectionAwareProperty(currentId))
     204                currentId = CSSProperty::resolveDirectionAwareProperty(currentId, direction, writingMode);
     205            if (currentId == propID)
    203206                return property.value();
    204207        }
Note: See TracChangeset for help on using the changeset viewer.