Changeset 191178 in webkit


Ignore:
Timestamp:
Oct 16, 2015 9:12:03 AM (9 years ago)
Author:
hyatt@apple.com
Message:

Implement the "all" CSS property.
https://bugs.webkit.org/show_bug.cgi?id=116966

Reviewed by Zalan Bujtas.

Source/WebCore:

Added new tests in fast/css.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::propertyValue):
Don't support "all" from computed style for now.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):
Make sure to bail after checking inherit/unset/initial for all, since you can't actually
accept longhand values in the shorthand declarations.

(WebCore::CSSParser::parseAnimationProperty):
"all" for animations is a special value and should not be confused with the property. It
animates everything and does not omit unicode-bidi/direction the way the "all" property does.

  • css/CSSPropertyNames.in:

Add the "all" property to the list and use a special keyword in the Longhands value, "all",
that makeprop.pl will look for. This way we don't have to dump every single CSS property
into the Longhands expression, since that would be nuts.

  • css/StyleProperties.cpp:

(WebCore::StyleProperties::getPropertyValue):
Look for a common value across all properties supported by "all". That way you can get
back inherit/initial/unset from it.

  • css/makeprop.pl:

Make the perl script look for "all" in the longhand list, and if it sees it, put every
single CSS property into the list for the all shorthand.

LayoutTests:

Added tests for the "all property, including a variables test!

  • fast/css/all-keyword-direction-expected.html: Added.
  • fast/css/all-keyword-direction.html: Added.
  • fast/css/all-keyword-inherit-expected.html: Added.
  • fast/css/all-keyword-inherit.html: Added.
  • fast/css/all-keyword-initial-expected.html: Added.
  • fast/css/all-keyword-initial.html: Added.
  • fast/css/all-keyword-unset-expected.html: Added.
  • fast/css/all-keyword-unset.html: Added.
  • fast/css/variables/all-keyword-unset-expected.html: Added.
  • fast/css/variables/all-keyword-unset.html: Added.
Location:
trunk
Files:
10 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r191175 r191178  
     12015-10-16  David Hyatt  <hyatt@apple.com>
     2
     3        Implement the "all" CSS property.
     4        https://bugs.webkit.org/show_bug.cgi?id=116966
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Added tests for the "all property, including a variables test!
     9
     10        * fast/css/all-keyword-direction-expected.html: Added.
     11        * fast/css/all-keyword-direction.html: Added.
     12        * fast/css/all-keyword-inherit-expected.html: Added.
     13        * fast/css/all-keyword-inherit.html: Added.
     14        * fast/css/all-keyword-initial-expected.html: Added.
     15        * fast/css/all-keyword-initial.html: Added.
     16        * fast/css/all-keyword-unset-expected.html: Added.
     17        * fast/css/all-keyword-unset.html: Added.
     18        * fast/css/variables/all-keyword-unset-expected.html: Added.
     19        * fast/css/variables/all-keyword-unset.html: Added.
     20
    1212015-10-15  Michael Saboff  <msaboff@apple.com>
    222
  • trunk/Source/WebCore/ChangeLog

    r191176 r191178  
     12015-10-16  David Hyatt  <hyatt@apple.com>
     2
     3        Implement the "all" CSS property.
     4        https://bugs.webkit.org/show_bug.cgi?id=116966
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Added new tests in fast/css.
     9
     10        * css/CSSComputedStyleDeclaration.cpp:
     11        (WebCore::ComputedStyleExtractor::propertyValue):
     12        Don't support "all" from computed style for now.
     13
     14        * css/CSSParser.cpp:
     15        (WebCore::CSSParser::parseValue):
     16        Make sure to bail after checking inherit/unset/initial for all, since you can't actually
     17        accept longhand values in the shorthand declarations.
     18
     19        (WebCore::CSSParser::parseAnimationProperty):
     20        "all" for animations is a special value and should not be confused with the property. It
     21        animates everything and does not omit unicode-bidi/direction the way the "all" property does.
     22
     23        * css/CSSPropertyNames.in:
     24        Add the "all" property to the list and use a special keyword in the Longhands value, "all",
     25        that makeprop.pl will look for. This way we don't have to dump every single CSS property
     26        into the Longhands expression, since that would be nuts.
     27
     28        * css/StyleProperties.cpp:
     29        (WebCore::StyleProperties::getPropertyValue):
     30        Look for a common value across all properties supported by "all". That way you can get
     31        back inherit/initial/unset from it.
     32
     33        * css/makeprop.pl:
     34        Make the perl script look for "all" in the longhand list, and if it sees it, put every
     35        single CSS property into the list for the all shorthand.
     36
    1372015-10-16  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    238
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r191128 r191178  
    34623462
    34633463        /* Unimplemented CSS 3 properties (including CSS3 shorthand properties) */
     3464        case CSSPropertyAll:
    34643465        case CSSPropertyAnimation:
    34653466        case CSSPropertyWebkitTextEmphasis:
  • trunk/Source/WebCore/css/CSSParser.cpp

    r191155 r191178  
    19671967        return true;
    19681968    }
     1969   
     1970    if (propId == CSSPropertyAll)
     1971        return false; // "all" doesn't allow you to specify anything other than inherit/initial/unset.
    19691972
    19701973    if (isKeywordPropertyID(propId)) {
     
    50965099        return nullptr;
    50975100    CSSPropertyID result = cssPropertyID(value.string);
    5098     if (result)
     5101    if (result && result != CSSPropertyAll) // "all" value in animation is not equivalent to the all property.
    50995102        return CSSValuePool::singleton().createIdentifierValue(result);
    51005103    if (equalIgnoringCase(value, "all")) {
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r190999 r191178  
    133133// The remaining properties are listed in alphabetical order
    134134alignment-baseline [SVG]
     135all [Longhands=all]
    135136animation [Longhands=animation-name|animation-duration|animation-timing-function|animation-delay|animation-iteration-count|animation-direction|animation-fill-mode]
    136137animation-delay [AnimationProperty, NameForMethods=Delay]
  • trunk/Source/WebCore/css/StyleProperties.cpp

    r191128 r191178  
    128128    // Shorthand and 4-values properties
    129129    switch (propertyID) {
     130    case CSSPropertyAll:
     131        return getCommonValue(allShorthand());
    130132    case CSSPropertyAnimation:
    131133        return getLayeredShorthandValue(animationShorthand());
  • trunk/Source/WebCore/css/makeprop.pl

    r191128 r191178  
    961961  print SHORTHANDS_CPP "    static const CSSPropertyID " . $lowercaseId . "Properties[] = {\n";
    962962  foreach (@longhands) {
    963     die "Unknown CSS property used in Longhands: " . $nameToId{$_} if !exists($nameToId{$_});
    964     push(@{$longhandToShorthands{$_}}, $name);
    965     print SHORTHANDS_CPP "        CSSProperty" . $nameToId{$_} . ",\n";
     963    if ($_ eq "all") {
     964        foreach my $propname (@names) {
     965            next if (exists $propertiesWithStyleBuilderOptions{$propname}{"Longhands"});
     966            next if ($propname eq "direction" || $propname eq "unicode-bidi");
     967            die "Unknown CSS property used in all shorthand: " . $nameToId{$propname} if !exists($nameToId{$propname});
     968            push(@{$longhandToShorthands{$propname}}, $name);
     969            print SHORTHANDS_CPP "        CSSProperty" . $nameToId{$propname} . ",\n";
     970        }
     971    } else {
     972        die "Unknown CSS property used in Longhands: " . $nameToId{$_} if !exists($nameToId{$_});
     973        push(@{$longhandToShorthands{$_}}, $name);
     974        print SHORTHANDS_CPP "        CSSProperty" . $nameToId{$_} . ",\n";
     975    }
    966976  }
    967977  print SHORTHANDS_CPP "    };\n";
Note: See TracChangeset for help on using the changeset viewer.