Changeset 207679 in webkit


Ignore:
Timestamp:
Oct 21, 2016 10:03:10 AM (7 years ago)
Author:
hyatt@apple.com
Message:

[CSS Parser] Add support for -webkit-line-box-contain
https://bugs.webkit.org/show_bug.cgi?id=163794

Reviewed by Zalan Bujtas.

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeLineBoxContain):
(WebCore::CSSPropertyParser::parseSingleValue):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r207677 r207679  
     12016-10-21  Dave Hyatt  <hyatt@apple.com>
     2
     3        [CSS Parser] Add support for -webkit-line-box-contain
     4        https://bugs.webkit.org/show_bug.cgi?id=163794
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        * css/parser/CSSPropertyParser.cpp:
     9        (WebCore::consumeLineBoxContain):
     10        (WebCore::CSSPropertyParser::parseSingleValue):
     11
    1122016-10-21  Dave Hyatt  <hyatt@apple.com>
    213
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r207636 r207679  
    4545#include "CSSInheritedValue.h"
    4646#include "CSSInitialValue.h"
     47#include "CSSLineBoxContainValue.h"
    4748#include "CSSParserFastPaths.h"
    4849#include "CSSParserIdioms.h"
     
    30453046}
    30463047#endif
     3048
     3049static RefPtr<CSSValue> consumeLineBoxContain(CSSParserTokenRange& range)
     3050{
     3051    if (range.peek().id() == CSSValueNone)
     3052        return consumeIdent(range);
     3053
     3054    LineBoxContain lineBoxContain = LineBoxContainNone;
     3055   
     3056    while (range.peek().type() == IdentToken) {
     3057        auto id = range.peek().id();
     3058        if (id == CSSValueBlock) {
     3059            if (lineBoxContain & LineBoxContainBlock)
     3060                return nullptr;
     3061            lineBoxContain |= LineBoxContainBlock;
     3062        } else if (id == CSSValueInline) {
     3063            if (lineBoxContain & LineBoxContainInline)
     3064                return nullptr;
     3065            lineBoxContain |= LineBoxContainInline;
     3066        } else if (id == CSSValueFont) {
     3067            if (lineBoxContain & LineBoxContainFont)
     3068                return nullptr;
     3069            lineBoxContain |= LineBoxContainFont;
     3070        } else if (id == CSSValueGlyphs) {
     3071            if (lineBoxContain & LineBoxContainGlyphs)
     3072                return nullptr;
     3073            lineBoxContain |= LineBoxContainGlyphs;
     3074        } else if (id == CSSValueReplaced) {
     3075            if (lineBoxContain & LineBoxContainReplaced)
     3076                return nullptr;
     3077            lineBoxContain |= LineBoxContainReplaced;
     3078        } else if (id == CSSValueInlineBox) {
     3079            if (lineBoxContain & LineBoxContainInlineBox)
     3080                return nullptr;
     3081            lineBoxContain |= LineBoxContainInlineBox;
     3082        } else if (id == CSSValueInitialLetter) {
     3083            if (lineBoxContain & LineBoxContainInitialLetter)
     3084                return nullptr;
     3085            lineBoxContain |= LineBoxContainInitialLetter;
     3086        } else
     3087            return nullptr;
     3088        range.consumeIncludingWhitespace();
     3089    }
     3090   
     3091    if (!lineBoxContain)
     3092        return nullptr;
     3093   
     3094    return CSSLineBoxContainValue::create(lineBoxContain);
     3095}
    30473096
    30483097RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSSPropertyID currentShorthand)
     
    33603409    case CSSPropertyWebkitBoxReflect:
    33613410        return consumeReflect(m_range, m_context);
     3411    case CSSPropertyWebkitLineBoxContain:
     3412        return consumeLineBoxContain(m_range);
    33623413#if ENABLE(CSS_IMAGE_ORIENTATION)
    33633414    case CSSPropertyImageOrientation:
Note: See TracChangeset for help on using the changeset viewer.