Changeset 209000 in webkit


Ignore:
Timestamp:
Nov 28, 2016 10:28:50 AM (7 years ago)
Author:
hyatt@apple.com
Message:

[CSS Parser] Support -webkit-animation-trigger
https://bugs.webkit.org/show_bug.cgi?id=165095

Reviewed by Zalan Bujtas.

  • css/CSSValueKeywords.in:
  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeWebkitAnimationTrigger):
(WebCore::consumeAnimationValue):
(WebCore::CSSPropertyParser::parseSingleValue):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r208998 r209000  
     12016-11-28  Dave Hyatt  <hyatt@apple.com>
     2
     3        [CSS Parser] Support -webkit-animation-trigger
     4        https://bugs.webkit.org/show_bug.cgi?id=165095
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        * css/CSSValueKeywords.in:
     9        * css/parser/CSSPropertyParser.cpp:
     10        (WebCore::consumeWebkitAnimationTrigger):
     11        (WebCore::consumeAnimationValue):
     12        (WebCore::CSSPropertyParser::parseSingleValue):
     13
    1142016-11-28  Antti Koivisto  <antti@apple.com>
    215
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r208914 r209000  
    11511151
    11521152// background-image, etc.
     1153container-scroll
    11531154cross-fade
    11541155image-set
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r208991 r209000  
    3131#include "CSSPropertyParser.h"
    3232
     33#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
     34#include "CSSAnimationTriggerScrollValue.h"
     35#endif
    3336#include "CSSAspectRatioValue.h"
    3437#include "CSSBasicShapes.h"
     
    13161319}
    13171320
     1321#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
     1322static RefPtr<CSSValue> consumeWebkitAnimationTrigger(CSSParserTokenRange& range, CSSParserMode mode)
     1323{
     1324    if (range.peek().id() == CSSValueAuto)
     1325        return consumeIdent(range);
     1326   
     1327    if (range.peek().functionId() != CSSValueContainerScroll)
     1328        return nullptr;
     1329   
     1330    CSSParserTokenRange rangeCopy = range;
     1331    CSSParserTokenRange args = consumeFunction(rangeCopy);
     1332
     1333    RefPtr<CSSPrimitiveValue> startValue = consumeLength(args, mode, ValueRangeAll, UnitlessQuirk::Forbid);
     1334    if (!startValue)
     1335        return nullptr;
     1336   
     1337    if (args.atEnd()) {
     1338        range = rangeCopy;
     1339        return CSSAnimationTriggerScrollValue::create(startValue.releaseNonNull());
     1340    }
     1341
     1342    if (!consumeCommaIncludingWhitespace(args))
     1343        return nullptr;
     1344
     1345    RefPtr<CSSPrimitiveValue> endValue = consumeLength(args, mode, ValueRangeAll, UnitlessQuirk::Forbid);
     1346    if (!endValue || !args.atEnd())
     1347        return nullptr;
     1348
     1349    range = rangeCopy;
     1350
     1351    return CSSAnimationTriggerScrollValue::create(startValue.releaseNonNull(), endValue.releaseNonNull());
     1352}
     1353#endif
     1354   
    13181355static RefPtr<CSSValue> consumeAnimationValue(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context)
    13191356{
     
    13401377    case CSSPropertyTransitionTimingFunction:
    13411378        return consumeAnimationTimingFunction(range, context);
     1379#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
     1380    case CSSPropertyWebkitAnimationTrigger:
     1381        return consumeWebkitAnimationTrigger(range, context.mode);
     1382#endif
    13421383    default:
    13431384        ASSERT_NOT_REACHED();
     
    35643605    case CSSPropertyAnimationTimingFunction:
    35653606    case CSSPropertyTransitionTimingFunction:
     3607#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
     3608    case CSSPropertyWebkitAnimationTrigger:
     3609#endif
    35663610        return consumeAnimationPropertyList(property, m_range, m_context);
    35673611#if ENABLE(CSS_GRID_LAYOUT)
Note: See TracChangeset for help on using the changeset viewer.