Changeset 100570 in webkit


Ignore:
Timestamp:
Nov 17, 2011 12:08:31 AM (12 years ago)
Author:
mihnea@adobe.com
Message:

CSS exclusions: parse the wrap-flow and wrap-through properties
https://bugs.webkit.org/show_bug.cgi?id=71904

Reviewed by Dean Jackson.

Source/WebCore:

Tests: fast/exclusions/wrap-flow-parsing.html

fast/exclusions/wrap-through-parsing.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator WrapFlow):
(WebCore::CSSPrimitiveValue::operator WrapThrough):

  • css/CSSProperty.cpp:

(WebCore::CSSProperty::isInheritedProperty):

  • css/CSSPropertyNames.in:
  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::applyProperty):

  • css/CSSValueKeywords.in:
  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::diff):

  • rendering/style/RenderStyle.h:

(WebCore::InheritedFlags::wrapFlow):
(WebCore::InheritedFlags::wrapThrough):
(WebCore::InheritedFlags::setWrapFlow):
(WebCore::InheritedFlags::setWrapThrough):
(WebCore::InheritedFlags::initialWrapFlow):
(WebCore::InheritedFlags::initialWrapThrough):

  • rendering/style/RenderStyleConstants.h:
  • rendering/style/StyleRareNonInheritedData.cpp:

(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):

  • rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

  • fast/css/getComputedStyle/computed-style-expected.txt:
  • fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
  • fast/exclusions/script-tests/wrap-flow-parsing.js: Added.
  • fast/exclusions/script-tests/wrap-through-parsing.js: Added.
  • fast/exclusions/wrap-flow-parsing-expected.txt: Added.
  • fast/exclusions/wrap-flow-parsing.html: Added.
  • fast/exclusions/wrap-through-parsing-expected.txt: Added.
  • fast/exclusions/wrap-through-parsing.html: Added.
  • platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt:
  • platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
  • platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt:
  • svg/css/getComputedStyle-basic-expected.txt:
Location:
trunk
Files:
6 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r100565 r100570  
     12011-11-17  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        CSS exclusions: parse the wrap-flow and wrap-through properties
     4        https://bugs.webkit.org/show_bug.cgi?id=71904
     5
     6        Reviewed by Dean Jackson.
     7
     8        * fast/css/getComputedStyle/computed-style-expected.txt:
     9        * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
     10        * fast/exclusions/script-tests/wrap-flow-parsing.js: Added.
     11        * fast/exclusions/script-tests/wrap-through-parsing.js: Added.
     12        * fast/exclusions/wrap-flow-parsing-expected.txt: Added.
     13        * fast/exclusions/wrap-flow-parsing.html: Added.
     14        * fast/exclusions/wrap-through-parsing-expected.txt: Added.
     15        * fast/exclusions/wrap-through-parsing.html: Added.
     16        * platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt:
     17        * platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
     18        * platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt:
     19        * svg/css/getComputedStyle-basic-expected.txt:
     20
    1212011-11-16  Dean Jackson  <dino@apple.com>
    222
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt

    r100198 r100570  
    212212-webkit-region-break-before: auto;
    213213-webkit-region-break-inside: auto;
     214-webkit-wrap-flow: auto;
     215-webkit-wrap-through: wrap;
    214216clip-path: none;
    215217clip-rule: nonzero;
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt

    r100198 r100570  
    211211    -webkit-region-break-before: auto
    212212    -webkit-region-break-inside: auto
     213    -webkit-wrap-flow: auto
     214    -webkit-wrap-through: wrap
    213215    clip-path: none
    214216    clip-rule: nonzero
  • trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt

    r100198 r100570  
    212212-webkit-region-break-before: auto;
    213213-webkit-region-break-inside: auto;
     214-webkit-wrap-flow: auto;
     215-webkit-wrap-through: wrap;
    214216clip-path: none;
    215217clip-rule: nonzero;
  • trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt

    r100198 r100570  
    211211    -webkit-region-break-before: auto
    212212    -webkit-region-break-inside: auto
     213    -webkit-wrap-flow: auto
     214    -webkit-wrap-through: wrap
    213215    clip-path: none
    214216    clip-rule: nonzero
  • trunk/LayoutTests/platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt

    r100198 r100570  
    421421rect: style.getPropertyValue(-webkit-region-break-inside) : auto
    422422rect: style.getPropertyCSSValue(-webkit-region-break-inside) : [object CSSPrimitiveValue]
     423rect: style.getPropertyValue(-webkit-wrap-flow) : auto
     424rect: style.getPropertyCSSValue(-webkit-wrap-flow) : [object CSSPrimitiveValue]
     425rect: style.getPropertyValue(-webkit-wrap-through) : wrap
     426rect: style.getPropertyCSSValue(-webkit-wrap-through) : [object CSSPrimitiveValue]
    423427rect: style.getPropertyValue(clip-path) : none
    424428rect: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue]
     
    917921g: style.getPropertyValue(-webkit-region-break-inside) : auto
    918922g: style.getPropertyCSSValue(-webkit-region-break-inside) : [object CSSPrimitiveValue]
     923g: style.getPropertyValue(-webkit-wrap-flow) : auto
     924g: style.getPropertyCSSValue(-webkit-wrap-flow) : [object CSSPrimitiveValue]
     925g: style.getPropertyValue(-webkit-wrap-through) : wrap
     926g: style.getPropertyCSSValue(-webkit-wrap-through) : [object CSSPrimitiveValue]
    919927g: style.getPropertyValue(clip-path) : none
    920928g: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue]
  • trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt

    r100198 r100570  
    421421rect: style.getPropertyValue(-webkit-region-break-inside) : auto
    422422rect: style.getPropertyCSSValue(-webkit-region-break-inside) : [object CSSPrimitiveValue]
     423rect: style.getPropertyValue(-webkit-wrap-flow) : auto
     424rect: style.getPropertyCSSValue(-webkit-wrap-flow) : [object CSSPrimitiveValue]
     425rect: style.getPropertyValue(-webkit-wrap-through) : wrap
     426rect: style.getPropertyCSSValue(-webkit-wrap-through) : [object CSSPrimitiveValue]
    423427rect: style.getPropertyValue(clip-path) : none
    424428rect: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue]
     
    917921g: style.getPropertyValue(-webkit-region-break-inside) : auto
    918922g: style.getPropertyCSSValue(-webkit-region-break-inside) : [object CSSPrimitiveValue]
     923g: style.getPropertyValue(-webkit-wrap-flow) : auto
     924g: style.getPropertyCSSValue(-webkit-wrap-flow) : [object CSSPrimitiveValue]
     925g: style.getPropertyValue(-webkit-wrap-through) : wrap
     926g: style.getPropertyCSSValue(-webkit-wrap-through) : [object CSSPrimitiveValue]
    919927g: style.getPropertyValue(clip-path) : none
    920928g: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue]
  • trunk/Source/WebCore/ChangeLog

    r100565 r100570  
     12011-11-17  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        CSS exclusions: parse the wrap-flow and wrap-through properties
     4        https://bugs.webkit.org/show_bug.cgi?id=71904
     5
     6        Reviewed by Dean Jackson.
     7
     8        Tests: fast/exclusions/wrap-flow-parsing.html
     9               fast/exclusions/wrap-through-parsing.html
     10
     11        * css/CSSComputedStyleDeclaration.cpp:
     12        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     13        * css/CSSParser.cpp:
     14        (WebCore::CSSParser::parseValue):
     15        * css/CSSPrimitiveValueMappings.h:
     16        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     17        (WebCore::CSSPrimitiveValue::operator WrapFlow):
     18        (WebCore::CSSPrimitiveValue::operator WrapThrough):
     19        * css/CSSProperty.cpp:
     20        (WebCore::CSSProperty::isInheritedProperty):
     21        * css/CSSPropertyNames.in:
     22        * css/CSSStyleSelector.cpp:
     23        (WebCore::CSSStyleSelector::applyProperty):
     24        * css/CSSValueKeywords.in:
     25        * rendering/style/RenderStyle.cpp:
     26        (WebCore::RenderStyle::diff):
     27        * rendering/style/RenderStyle.h:
     28        (WebCore::InheritedFlags::wrapFlow):
     29        (WebCore::InheritedFlags::wrapThrough):
     30        (WebCore::InheritedFlags::setWrapFlow):
     31        (WebCore::InheritedFlags::setWrapThrough):
     32        (WebCore::InheritedFlags::initialWrapFlow):
     33        (WebCore::InheritedFlags::initialWrapThrough):
     34        * rendering/style/RenderStyleConstants.h:
     35        * rendering/style/StyleRareNonInheritedData.cpp:
     36        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
     37        (WebCore::StyleRareNonInheritedData::operator==):
     38        * rendering/style/StyleRareNonInheritedData.h:
     39
    1402011-11-16  Dean Jackson  <dino@apple.com>
    241
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r100560 r100570  
    285285    CSSPropertyWebkitRegionBreakAfter,
    286286    CSSPropertyWebkitRegionBreakBefore,
    287     CSSPropertyWebkitRegionBreakInside
     287    CSSPropertyWebkitRegionBreakInside,
     288    CSSPropertyWebkitWrapFlow,
     289    CSSPropertyWebkitWrapThrough
    288290#if ENABLE(SVG)
    289291    ,
     
    21542156            return primitiveValueCache->createValue(style->wrapShape());
    21552157
     2158        case CSSPropertyWebkitWrapFlow:
     2159            return primitiveValueCache->createValue(style->wrapFlow());
     2160        case CSSPropertyWebkitWrapThrough:
     2161            return primitiveValueCache->createValue(style->wrapThrough());
    21562162#if ENABLE(SVG)
    21572163        case CSSPropertyClipPath:
  • trunk/Source/WebCore/css/CSSParser.cpp

    r100565 r100570  
    21992199        else if (value->unit == CSSParserValue::Function)
    22002200            return parseWrapShape(important);
     2201        break;
     2202
     2203    case CSSPropertyWebkitWrapFlow:
     2204        if (id == CSSValueAuto || id == CSSValueBoth || id == CSSValueLeft || id == CSSValueRight || id == CSSValueMaximum || id == CSSValueClear)
     2205            validPrimitive = true;
     2206        break;
     2207
     2208    case CSSPropertyWebkitWrapThrough:
     2209        if (id == CSSValueWrap || id == CSSValueNone)
     2210            validPrimitive = true;
    22012211        break;
    22022212
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r100389 r100570  
    34533453}
    34543454
     3455template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WrapFlow wrapFlow)
     3456: CSSValue(PrimitiveClass)
     3457{
     3458    m_primitiveUnitType = CSS_IDENT;
     3459    switch (wrapFlow) {
     3460    case WrapFlowAuto:
     3461        m_value.ident = CSSValueAuto;
     3462        break;
     3463    case WrapFlowBoth:
     3464        m_value.ident = CSSValueBoth;
     3465        break;
     3466    case WrapFlowLeft:
     3467        m_value.ident = CSSValueLeft;
     3468        break;
     3469    case WrapFlowRight:
     3470        m_value.ident = CSSValueRight;
     3471        break;
     3472    case WrapFlowMaximum:
     3473        m_value.ident = CSSValueMaximum;
     3474        break;
     3475    case WrapFlowClear:
     3476        m_value.ident = CSSValueClear;
     3477        break;
     3478    }
     3479}
     3480
     3481template<> inline CSSPrimitiveValue::operator WrapFlow() const
     3482{
     3483    switch (m_value.ident) {
     3484    case CSSValueAuto:
     3485        return WrapFlowAuto;
     3486    case CSSValueBoth:
     3487        return WrapFlowBoth;
     3488    case CSSValueLeft:
     3489        return WrapFlowLeft;
     3490    case CSSValueRight:
     3491        return WrapFlowRight;
     3492    case CSSValueMaximum:
     3493        return WrapFlowMaximum;
     3494    case CSSValueClear:
     3495        return WrapFlowClear;
     3496    default:
     3497        ASSERT_NOT_REACHED();
     3498        return WrapFlowAuto;
     3499    }
     3500}
     3501
     3502template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WrapThrough wrapThrough)
     3503: CSSValue(PrimitiveClass)
     3504{
     3505    m_primitiveUnitType = CSS_IDENT;
     3506    switch (wrapThrough) {
     3507    case WrapThroughWrap:
     3508        m_value.ident = CSSValueWrap;
     3509        break;
     3510    case WrapThroughNone:
     3511        m_value.ident = CSSValueNone;
     3512        break;
     3513    }
     3514}
     3515
     3516template<> inline CSSPrimitiveValue::operator WrapThrough() const
     3517{
     3518    switch (m_value.ident) {
     3519    case CSSValueWrap:
     3520        return WrapThroughWrap;
     3521    case CSSValueNone:
     3522        return WrapThroughNone;
     3523    default:
     3524        ASSERT_NOT_REACHED();
     3525        return WrapThroughWrap;
     3526    }
     3527}
     3528
    34553529#if ENABLE(SVG)
    34563530
  • trunk/Source/WebCore/css/CSSProperty.cpp

    r100198 r100570  
    636636    case CSSPropertyWebkitRegionBreakBefore:
    637637    case CSSPropertyWebkitRegionBreakInside:
     638    case CSSPropertyWebkitWrapFlow:
     639    case CSSPropertyWebkitWrapThrough:
    638640#if ENABLE(SVG)
    639641    case CSSPropertyClipPath:
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r100198 r100570  
    359359-webkit-region-break-before
    360360-webkit-region-break-inside
     361-webkit-wrap-flow
     362-webkit-wrap-through
    361363#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
    362364-webkit-tap-highlight-color
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r100560 r100570  
    38703870            m_style->setWrapShape(primitiveValue->getShapeValue());
    38713871
     3872        return;
     3873
     3874    case CSSPropertyWebkitWrapFlow:
     3875        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(wrapFlow, WrapFlow);
     3876        return;
     3877
     3878    case CSSPropertyWebkitWrapThrough:
     3879        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(wrapThrough, WrapThrough);
    38723880        return;
    38733881
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r100389 r100570  
    857857break
    858858
     859// -webkit-wrap-flow
     860// auto
     861// both
     862// left
     863// right
     864maximum
     865// clear
     866
     867// -webkit-wrap-through
     868wrap
     869// none
     870
    859871#if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS
    860872// -webkit-filter
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r100198 r100570  
    384384
    385385        if (rareNonInheritedData->m_regionOverflow != other->rareNonInheritedData->m_regionOverflow)
     386            return StyleDifferenceLayout;
     387
     388        if (rareNonInheritedData->m_wrapFlow != other->rareNonInheritedData->m_wrapFlow
     389            || rareNonInheritedData->m_wrapThrough != other->rareNonInheritedData->m_wrapThrough)
    386390            return StyleDifferenceLayout;
    387391
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r100416 r100570  
    808808    const AtomicString& lineGrid() const { return rareInheritedData->m_lineGrid; }
    809809    LineGridSnap lineGridSnap() const { return static_cast<LineGridSnap>(rareInheritedData->m_lineGridSnap); }
     810
     811    WrapFlow wrapFlow() const { return static_cast<WrapFlow>(rareNonInheritedData->m_wrapFlow); }
     812    WrapThrough wrapThrough() const { return static_cast<WrapThrough>(rareNonInheritedData->m_wrapThrough); }
    810813
    811814    // Apple-specific property getter methods
     
    11951198    void setRegionThread(const AtomicString& regionThread) { SET_VAR(rareNonInheritedData, m_regionThread, regionThread); }
    11961199    void setRegionOverflow(RegionOverflow regionOverflow) { SET_VAR(rareNonInheritedData, m_regionOverflow, regionOverflow); }
     1200
     1201    void setWrapFlow(WrapFlow wrapFlow) { SET_VAR(rareNonInheritedData, m_wrapFlow, wrapFlow); }
     1202    void setWrapThrough(WrapThrough wrapThrough) { SET_VAR(rareNonInheritedData, m_wrapThrough, wrapThrough); }
    11971203
    11981204    // Apple-specific property setters
     
    14831489    static RegionOverflow initialRegionOverflow() { return AutoRegionOverflow; }
    14841490
     1491    static WrapFlow initialWrapFlow() { return WrapFlowAuto; }
     1492    static WrapThrough initialWrapThrough() { return WrapThroughWrap; }
     1493
    14851494    // Keep these at the end.
    14861495    static LineClampValue initialLineClamp() { return LineClampValue(); }
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r100389 r100570  
    461461enum LineGridSnap { LineGridSnapNone, LineGridSnapBaseline, LineGridSnapBounds };
    462462
     463enum WrapFlow { WrapFlowAuto, WrapFlowBoth, WrapFlowLeft, WrapFlowRight, WrapFlowMaximum, WrapFlowClear };
     464
     465enum WrapThrough { WrapThroughWrap, WrapThroughNone };
     466
    463467} // namespace WebCore
    464468
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r100198 r100570  
    6363    , m_borderFit(RenderStyle::initialBorderFit())
    6464    , m_textCombine(RenderStyle::initialTextCombine())
     65    , m_wrapFlow(RenderStyle::initialWrapFlow())
     66    , m_wrapThrough(RenderStyle::initialWrapThrough())
    6567#if USE(ACCELERATED_COMPOSITING)
    6668    , m_runningAcceleratedAnimation(false)
     
    120122    , m_borderFit(o.m_borderFit)
    121123    , m_textCombine(o.m_textCombine)
     124    , m_wrapFlow(o.m_wrapFlow)
     125    , m_wrapThrough(o.m_wrapThrough)
    122126#if USE(ACCELERATED_COMPOSITING)
    123127    , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation)
     
    177181        && (m_regionOverflow == o.m_regionOverflow)
    178182        && (m_wrapShape == o.m_wrapShape)
     183        && (m_wrapFlow == o.m_wrapFlow)
     184        && (m_wrapThrough == o.m_wrapThrough)
    179185        && m_visitedLinkBackgroundColor == o.m_visitedLinkBackgroundColor
    180186        && m_visitedLinkOutlineColor == o.m_visitedLinkOutlineColor
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r100198 r100570  
    157157    unsigned m_textCombine : 1; // CSS3 text-combine properties
    158158
     159    unsigned m_wrapFlow: 3; // WrapFlow
     160    unsigned m_wrapThrough: 1; // WrapThrough
     161
    159162#if USE(ACCELERATED_COMPOSITING)
    160163    bool m_runningAcceleratedAnimation : 1;
Note: See TracChangeset for help on using the changeset viewer.