Changeset 208111 in webkit


Ignore:
Timestamp:
Oct 29, 2016 12:14:10 PM (7 years ago)
Author:
hyatt@apple.com
Message:

[CSS Parser] Support -webkit-aspect-ratio
https://bugs.webkit.org/show_bug.cgi?id=164187

Reviewed by Simon Fraser.

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeWebkitAspectRatio):
(WebCore::CSSPropertyParser::parseSingleValue):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r208110 r208111  
     12016-10-29  Dave Hyatt  <hyatt@apple.com>
     2
     3        [CSS Parser] Support -webkit-aspect-ratio
     4        https://bugs.webkit.org/show_bug.cgi?id=164187
     5
     6        Reviewed by Simon Fraser.
     7
     8        * css/parser/CSSPropertyParser.cpp:
     9        (WebCore::consumeWebkitAspectRatio):
     10        (WebCore::CSSPropertyParser::parseSingleValue):
     11
    1122016-10-29  Dave Hyatt  <hyatt@apple.com>
    213
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r208109 r208111  
    3131#include "CSSPropertyParser.h"
    3232
     33#include "CSSAspectRatioValue.h"
    3334#include "CSSBasicShapes.h"
    3435#include "CSSBorderImage.h"
     
    32453246   
    32463247    return consumeAttr(consumeFunction(range), context);
     3248}
     3249
     3250static RefPtr<CSSValue> consumeWebkitAspectRatio(CSSParserTokenRange& range)
     3251{
     3252    if (range.peek().type() == IdentToken)
     3253        return consumeIdent<CSSValueAuto, CSSValueFromDimensions, CSSValueFromIntrinsic>(range);
     3254   
     3255    RefPtr<CSSPrimitiveValue> leftValue = consumeNumber(range, ValueRangeNonNegative);
     3256    if (!leftValue || range.atEnd() || !consumeSlashIncludingWhitespace(range))
     3257        return nullptr;
     3258    RefPtr<CSSPrimitiveValue> rightValue = consumeNumber(range, ValueRangeNonNegative);
     3259    if (!rightValue)
     3260        return nullptr;
     3261   
     3262    return CSSAspectRatioValue::create(leftValue->floatValue(), rightValue->floatValue());
    32473263}
    32483264
     
    36323648    case CSSPropertyAlt:
    36333649        return consumeAlt(m_range, m_context);
     3650    case CSSPropertyWebkitAspectRatio:
     3651        return consumeWebkitAspectRatio(m_range);
    36343652    default:
    36353653        return nullptr;
Note: See TracChangeset for help on using the changeset viewer.