Changeset 217267 in webkit


Ignore:
Timestamp:
May 22, 2017 11:03:24 PM (7 years ago)
Author:
mmaxfield@apple.com
Message:

Support calc() in font-variation-settings and font-feature-settings
https://bugs.webkit.org/show_bug.cgi?id=171032

Reviewed by David Hyatt.

Source/WebCore:

Tests: css3/font-feature-settings-calc.html

fast/text/variations/calc.html

We can use the convenience functions in CSSPropertyParserHelpers.cpp.

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeFontFeatureTag):
(WebCore::consumeFontVariationTag):

LayoutTests:

  • css3/font-feature-settings-calc-expected.html: Added.
  • css3/font-feature-settings-calc.html: Added.
  • fast/text/variations/calc-expected.html: Added.
  • fast/text/variations/calc.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r217257 r217267  
     12017-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Support calc() in font-variation-settings and font-feature-settings
     4        https://bugs.webkit.org/show_bug.cgi?id=171032
     5
     6        Reviewed by David Hyatt.
     7
     8        * css3/font-feature-settings-calc-expected.html: Added.
     9        * css3/font-feature-settings-calc.html: Added.
     10        * fast/text/variations/calc-expected.html: Added.
     11        * fast/text/variations/calc.html: Added.
     12
    1132017-05-22  Ryan Haddad  <ryanhaddad@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r217263 r217267  
     12017-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Support calc() in font-variation-settings and font-feature-settings
     4        https://bugs.webkit.org/show_bug.cgi?id=171032
     5
     6        Reviewed by David Hyatt.
     7
     8        Tests: css3/font-feature-settings-calc.html
     9               fast/text/variations/calc.html
     10
     11        We can use the convenience functions in CSSPropertyParserHelpers.cpp.
     12
     13        * css/parser/CSSPropertyParser.cpp:
     14        (WebCore::consumeFontFeatureTag):
     15        (WebCore::consumeFontVariationTag):
     16
    1172017-05-22  Michael Catanzaro  <mcatanzaro@igalia.com>
    218
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r217236 r217267  
    480480
    481481    int tagValue = 1;
    482     // Feature tag values could follow: <integer> | on | off
    483     if (range.peek().type() == NumberToken && range.peek().numericValueType() == IntegerValueType && range.peek().numericValue() >= 0) {
    484         tagValue = clampTo<int>(range.consumeIncludingWhitespace().numericValue());
    485         if (tagValue < 0)
    486             return nullptr;
    487     } else if (range.peek().id() == CSSValueOn || range.peek().id() == CSSValueOff) {
    488         tagValue = range.consumeIncludingWhitespace().id() == CSSValueOn;
     482    if (!range.atEnd() && range.peek().type() != CommaToken) {
     483        // Feature tag values could follow: <integer> | on | off
     484        if (auto primitiveValue = consumeInteger(range, 0))
     485            tagValue = primitiveValue->intValue();
     486        else if (range.peek().id() == CSSValueOn || range.peek().id() == CSSValueOff)
     487            tagValue = range.consumeIncludingWhitespace().id() == CSSValueOn;
     488        else
     489            return nullptr;
    489490    }
    490491    return CSSFontFeatureValue::create(WTFMove(tag), tagValue);
     
    524525    }
    525526   
    526     if (range.atEnd() || range.peek().type() != NumberToken)
    527         return nullptr;
    528 
    529     float tagValue = range.consumeIncludingWhitespace().numericValue();
     527    if (range.atEnd())
     528        return nullptr;
     529
     530    double tagValue = 0;
     531    auto success = consumeNumberRaw(range, tagValue);
     532    if (!success)
     533        return nullptr;
    530534   
    531535    return CSSFontVariationValue::create(tag, tagValue);
Note: See TracChangeset for help on using the changeset viewer.