Changeset 260335 in webkit


Ignore:
Timestamp:
Apr 19, 2020 6:46:15 AM (4 years ago)
Author:
emilio
Message:

Fix the logic to decide whether a property is enumerated in a computed style declaration.
https://bugs.webkit.org/show_bug.cgi?id=210695

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Import the test from
https://github.com/web-platform-tests/wpt/pull/23088. One subtest is
failing, separate bug.

  • web-platform-tests/css/cssom/getComputedStyle-logical-enumeration-expected.txt: Added.
  • web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html: Added.

Source/WebCore:

Fix the logic to decide whether a property is enumerated in a computed
style declaration.

Logical properties don't need stylebuilder code, but still should be
generated. Using the specification->category for this seems a bit
hacky, but unclear if it's worse than adding a new flag.

Tests: fast/css/getComputedStyle/computed-style-enumeration.html

imported/w3c/web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html

  • css/makeprop.pl:

(skippedFromComputedStyle):
(isLogical):
(sortWithPrefixedPropertiesLast):

Location:
trunk
Files:
2 added
5 edited

Legend:

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

    r260319 r260335  
     12020-04-19  Emilio Cobos Álvarez  <emilio@crisal.io>
     2
     3        Fix the logic to decide whether a property is enumerated in a computed style declaration.
     4        https://bugs.webkit.org/show_bug.cgi?id=210695
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Import the test from
     9        https://github.com/web-platform-tests/wpt/pull/23088. One subtest is
     10        failing, separate bug.
     11
     12        * web-platform-tests/css/cssom/getComputedStyle-logical-enumeration-expected.txt: Added.
     13        * web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html: Added.
     14
    1152020-04-18  Antti Koivisto  <antti@apple.com>
    216
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt

    r259006 r260335  
    2828PASS background-size
    2929PASS baseline-shift
    30 PASS border-block
    31 PASS border-block-color
    32 PASS border-block-end
    33 PASS border-block-start
    34 PASS border-block-style
    35 PASS border-block-width
     30PASS block-size
     31PASS border-block-end-color
     32PASS border-block-end-style
     33PASS border-block-end-width
     34PASS border-block-start-color
     35PASS border-block-start-style
     36PASS border-block-start-width
    3637PASS border-bottom-color
    3738PASS border-bottom-left-radius
     
    4546PASS border-image-source
    4647PASS border-image-width
    47 PASS border-inline
    48 PASS border-inline-color
    49 PASS border-inline-end
    50 PASS border-inline-start
    51 PASS border-inline-style
    52 PASS border-inline-width
     48PASS border-inline-end-color
     49PASS border-inline-end-style
     50PASS border-inline-end-width
     51PASS border-inline-start-color
     52PASS border-inline-start-style
     53PASS border-inline-start-width
    5354PASS border-left-color
    5455PASS border-left-style
     
    141142PASS image-orientation
    142143PASS image-rendering
    143 PASS inset-block
    144 PASS inset-inline
     144PASS inline-size
     145PASS inset-block-end
     146PASS inset-block-start
     147PASS inset-inline-end
     148PASS inset-inline-start
    145149PASS isolation
    146150PASS justify-content
     
    156160PASS list-style-position
    157161PASS list-style-type
    158 PASS margin-block
     162PASS margin-block-end
     163PASS margin-block-start
    159164PASS margin-bottom
    160 PASS margin-inline
     165PASS margin-inline-end
     166PASS margin-inline-start
    161167PASS margin-left
    162168PASS margin-right
     
    167173PASS mask
    168174PASS mask-type
     175PASS max-block-size
    169176PASS max-height
     177PASS max-inline-size
    170178PASS max-width
     179PASS min-block-size
    171180PASS min-height
     181PASS min-inline-size
    172182PASS min-width
    173183PASS mix-blend-mode
     
    184194PASS overflow-x
    185195PASS overflow-y
    186 PASS padding-block
     196PASS padding-block-end
     197PASS padding-block-start
    187198PASS padding-bottom
    188 PASS padding-inline
     199PASS padding-inline-end
     200PASS padding-inline-start
    189201PASS padding-left
    190202PASS padding-right
  • trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt

    r259006 r260335  
    2828PASS background-size
    2929PASS baseline-shift
    30 PASS border-block
    31 PASS border-block-color
    32 PASS border-block-end
    33 PASS border-block-start
    34 PASS border-block-style
    35 PASS border-block-width
     30PASS block-size
     31PASS border-block-end-color
     32PASS border-block-end-style
     33PASS border-block-end-width
     34PASS border-block-start-color
     35PASS border-block-start-style
     36PASS border-block-start-width
    3637PASS border-bottom-color
    3738PASS border-bottom-left-radius
     
    4546PASS border-image-source
    4647PASS border-image-width
    47 PASS border-inline
    48 PASS border-inline-color
    49 PASS border-inline-end
    50 PASS border-inline-start
    51 PASS border-inline-style
    52 PASS border-inline-width
     48PASS border-inline-end-color
     49PASS border-inline-end-style
     50PASS border-inline-end-width
     51PASS border-inline-start-color
     52PASS border-inline-start-style
     53PASS border-inline-start-width
    5354PASS border-left-color
    5455PASS border-left-style
     
    141142PASS image-orientation
    142143PASS image-rendering
    143 PASS inset-block
    144 PASS inset-inline
     144PASS inline-size
     145PASS inset-block-end
     146PASS inset-block-start
     147PASS inset-inline-end
     148PASS inset-inline-start
    145149PASS isolation
    146150PASS justify-content
     
    156160PASS list-style-position
    157161PASS list-style-type
    158 PASS margin-block
     162PASS margin-block-end
     163PASS margin-block-start
    159164PASS margin-bottom
    160 PASS margin-inline
     165PASS margin-inline-end
     166PASS margin-inline-start
    161167PASS margin-left
    162168PASS margin-right
     
    167173PASS mask
    168174PASS mask-type
     175PASS max-block-size
    169176PASS max-height
     177PASS max-inline-size
    170178PASS max-width
     179PASS min-block-size
    171180PASS min-height
     181PASS min-inline-size
    172182PASS min-width
    173183PASS mix-blend-mode
     
    184194PASS overflow-x
    185195PASS overflow-y
    186 PASS padding-block
     196PASS padding-block-end
     197PASS padding-block-start
    187198PASS padding-bottom
    188 PASS padding-inline
     199PASS padding-inline-end
     200PASS padding-inline-start
    189201PASS padding-left
    190202PASS padding-right
  • trunk/Source/WebCore/ChangeLog

    r260319 r260335  
     12020-04-19  Emilio Cobos Álvarez  <emilio@crisal.io>
     2
     3        Fix the logic to decide whether a property is enumerated in a computed style declaration.
     4        https://bugs.webkit.org/show_bug.cgi?id=210695
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Fix the logic to decide whether a property is enumerated in a computed
     9        style declaration.
     10
     11        Logical properties don't need stylebuilder code, but still should be
     12        generated. Using the specification->category for this seems a bit
     13        hacky, but unclear if it's worse than adding a new flag.
     14
     15        Tests: fast/css/getComputedStyle/computed-style-enumeration.html
     16               imported/w3c/web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html
     17
     18        * css/makeprop.pl:
     19        (skippedFromComputedStyle):
     20        (isLogical):
     21        (sortWithPrefixedPropertiesLast):
     22
    1232020-04-18  Antti Koivisto  <antti@apple.com>
    224
  • trunk/Source/WebCore/css/makeprop.pl

    r259720 r260335  
    3232use JSON::PP;
    3333
     34sub isLogical;
     35sub skippedFromComputedStyle;
     36sub isPropertyEnabled($$);
    3437sub addProperty($$);
    35 sub isPropertyEnabled($$);
    3638sub removeInactiveCodegenProperties($$);
    3739
     
    150152   
    151153    $propertyValue->{"codegen-properties"} = $matching_codegen_options;
     154}
     155
     156sub skippedFromComputedStyle
     157{
     158  my $name = shift;
     159
     160  if (exists($propertiesWithStyleBuilderOptions{$name}{"skip-builder"}) and not isLogical($name)) {
     161    return 1;
     162  }
     163
     164  if (grep { $_ eq $name } @internalProprerties) {
     165    return 1;
     166  }
     167
     168  if (exists($propertiesWithStyleBuilderOptions{$name}{"longhands"})) {
     169    my @longhands = @{$propertiesWithStyleBuilderOptions{$name}{"longhands"}};
     170    if (scalar @longhands != 1) {
     171      # Skip properties if they have a non-internal longhand property.
     172      foreach my $longhand (@longhands) {
     173        if (!skippedFromComputedStyle($longhand)) {
     174          return 1;
     175        }
     176      }
     177    }
     178  }
     179
     180  return 0;
     181}
     182
     183
     184sub isLogical
     185{
     186    my $name = shift;
     187    my $value = $propertiesHashRef->{$name};
     188
     189    if (!exists($value->{"specification"})) {
     190        return 0;
     191    }
     192
     193    my $spec_properties = $value->{"specification"};
     194    if (!exists($spec_properties->{"category"})) {
     195        return 0;
     196    }
     197
     198    return $spec_properties->{"category"} eq "css-logical-props"
    152199}
    153200
     
    517564    return $a cmp $b;
    518565}
     566
    519567foreach my $name (sort sortWithPrefixedPropertiesLast @names) {
    520   next if (exists($propertiesWithStyleBuilderOptions{$name}{"skip-builder"}));
    521   next if (grep { $_ eq $name } @internalProprerties);
    522 
    523   # Skip properties if they have a non-internal longhand property.
    524   if (exists($propertiesWithStyleBuilderOptions{$name}{"longhands"})) {
    525     my @longhands = @{$propertiesWithStyleBuilderOptions{$name}{"longhands"}};
    526     if (scalar @longhands != 1) {
    527       my $hasNonInternalLonghand = 0;
    528       foreach my $longhand (@longhands) {
    529         if (!exists($propertiesWithStyleBuilderOptions{$longhand}{"skip-builder"}) && !grep { $_ eq $longhand } @internalProprerties) {
    530           $hasNonInternalLonghand = 1;
    531           last;
    532         }
    533       }
    534       if ($hasNonInternalLonghand) {
    535         next;
    536       }
    537     }
    538   }
    539 
     568  next if skippedFromComputedStyle($name);
    540569  print HEADER "    CSSProperty" . $nameToId{$name} . ",\n";
    541570  $numComputedPropertyIDs += 1;
Note: See TracChangeset for help on using the changeset viewer.