Changeset 100604 in webkit


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

CSS Exclusions: parse the wrap-margin and wrap-padding properties
https://bugs.webkit.org/show_bug.cgi?id=71900

Reviewed by Dean Jackson.

Source/WebCore:

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

fast/exclusions/wrap-padding-parsing.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

  • css/CSSParser.cpp:

(WebCore::isSimpleLengthPropertyID):
(WebCore::CSSParser::parseValue):

  • css/CSSProperty.cpp:

(WebCore::CSSProperty::isInheritedProperty):

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

(WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):

  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::applyProperty):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::diff):

  • rendering/style/RenderStyle.h:

(WebCore::InheritedFlags::wrapPadding):
(WebCore::InheritedFlags::setWrapPadding):
(WebCore::InheritedFlags::initialWrapPadding):
(WebCore::InheritedFlags::wrapMargin):
(WebCore::InheritedFlags::setWrapMargin):
(WebCore::InheritedFlags::initialWrapMargin):

  • 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-margin-parsing.js: Added.
  • fast/exclusions/script-tests/wrap-padding-parsing.js: Added.
  • fast/exclusions/wrap-margin-parsing-expected.txt: Added.
  • fast/exclusions/wrap-margin-parsing.html: Added.
  • fast/exclusions/wrap-padding-parsing-expected.txt: Added.
  • fast/exclusions/wrap-padding-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
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r100600 r100604  
     12011-11-17  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        CSS Exclusions: parse the wrap-margin and wrap-padding properties
     4        https://bugs.webkit.org/show_bug.cgi?id=71900
     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-margin-parsing.js: Added.
     11        * fast/exclusions/script-tests/wrap-padding-parsing.js: Added.
     12        * fast/exclusions/wrap-margin-parsing-expected.txt: Added.
     13        * fast/exclusions/wrap-margin-parsing.html: Added.
     14        * fast/exclusions/wrap-padding-parsing-expected.txt: Added.
     15        * fast/exclusions/wrap-padding-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-17  Steve Block  <steveblock@google.com>
    222
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt

    r100570 r100604  
    213213-webkit-region-break-inside: auto;
    214214-webkit-wrap-flow: auto;
     215-webkit-wrap-margin: 0px;
     216-webkit-wrap-padding: 0px;
    215217-webkit-wrap-through: wrap;
    216218clip-path: none;
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt

    r100570 r100604  
    212212    -webkit-region-break-inside: auto
    213213    -webkit-wrap-flow: auto
     214    -webkit-wrap-margin: 0px
     215    -webkit-wrap-padding: 0px
    214216    -webkit-wrap-through: wrap
    215217    clip-path: none
  • trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt

    r100570 r100604  
    213213-webkit-region-break-inside: auto;
    214214-webkit-wrap-flow: auto;
     215-webkit-wrap-margin: 0px;
     216-webkit-wrap-padding: 0px;
    215217-webkit-wrap-through: wrap;
    216218clip-path: none;
  • trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt

    r100570 r100604  
    212212    -webkit-region-break-inside: auto
    213213    -webkit-wrap-flow: auto
     214    -webkit-wrap-margin: 0px
     215    -webkit-wrap-padding: 0px
    214216    -webkit-wrap-through: wrap
    215217    clip-path: none
  • trunk/LayoutTests/platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt

    r100570 r100604  
    423423rect: style.getPropertyValue(-webkit-wrap-flow) : auto
    424424rect: style.getPropertyCSSValue(-webkit-wrap-flow) : [object CSSPrimitiveValue]
     425rect: style.getPropertyValue(-webkit-wrap-margin) : 0px
     426rect: style.getPropertyCSSValue(-webkit-wrap-margin) : [object CSSPrimitiveValue]
     427rect: style.getPropertyValue(-webkit-wrap-padding) : 0px
     428rect: style.getPropertyCSSValue(-webkit-wrap-padding) : [object CSSPrimitiveValue]
    425429rect: style.getPropertyValue(-webkit-wrap-through) : wrap
    426430rect: style.getPropertyCSSValue(-webkit-wrap-through) : [object CSSPrimitiveValue]
     
    923927g: style.getPropertyValue(-webkit-wrap-flow) : auto
    924928g: style.getPropertyCSSValue(-webkit-wrap-flow) : [object CSSPrimitiveValue]
     929g: style.getPropertyValue(-webkit-wrap-margin) : 0px
     930g: style.getPropertyCSSValue(-webkit-wrap-margin) : [object CSSPrimitiveValue]
     931g: style.getPropertyValue(-webkit-wrap-padding) : 0px
     932g: style.getPropertyCSSValue(-webkit-wrap-padding) : [object CSSPrimitiveValue]
    925933g: style.getPropertyValue(-webkit-wrap-through) : wrap
    926934g: style.getPropertyCSSValue(-webkit-wrap-through) : [object CSSPrimitiveValue]
  • trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt

    r100570 r100604  
    423423rect: style.getPropertyValue(-webkit-wrap-flow) : auto
    424424rect: style.getPropertyCSSValue(-webkit-wrap-flow) : [object CSSPrimitiveValue]
     425rect: style.getPropertyValue(-webkit-wrap-margin) : 0px
     426rect: style.getPropertyCSSValue(-webkit-wrap-margin) : [object CSSPrimitiveValue]
     427rect: style.getPropertyValue(-webkit-wrap-padding) : 0px
     428rect: style.getPropertyCSSValue(-webkit-wrap-padding) : [object CSSPrimitiveValue]
    425429rect: style.getPropertyValue(-webkit-wrap-through) : wrap
    426430rect: style.getPropertyCSSValue(-webkit-wrap-through) : [object CSSPrimitiveValue]
     
    923927g: style.getPropertyValue(-webkit-wrap-flow) : auto
    924928g: style.getPropertyCSSValue(-webkit-wrap-flow) : [object CSSPrimitiveValue]
     929g: style.getPropertyValue(-webkit-wrap-margin) : 0px
     930g: style.getPropertyCSSValue(-webkit-wrap-margin) : [object CSSPrimitiveValue]
     931g: style.getPropertyValue(-webkit-wrap-padding) : 0px
     932g: style.getPropertyCSSValue(-webkit-wrap-padding) : [object CSSPrimitiveValue]
    925933g: style.getPropertyValue(-webkit-wrap-through) : wrap
    926934g: style.getPropertyCSSValue(-webkit-wrap-through) : [object CSSPrimitiveValue]
  • trunk/Source/WebCore/ChangeLog

    r100601 r100604  
     12011-11-17  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        CSS Exclusions: parse the wrap-margin and wrap-padding properties
     4        https://bugs.webkit.org/show_bug.cgi?id=71900
     5
     6        Reviewed by Dean Jackson.
     7
     8        Tests: fast/exclusions/wrap-margin-parsing.html
     9               fast/exclusions/wrap-padding-parsing.html
     10
     11        * css/CSSComputedStyleDeclaration.cpp:
     12        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     13        * css/CSSParser.cpp:
     14        (WebCore::isSimpleLengthPropertyID):
     15        (WebCore::CSSParser::parseValue):
     16        * css/CSSProperty.cpp:
     17        (WebCore::CSSProperty::isInheritedProperty):
     18        * css/CSSPropertyNames.in:
     19        * css/CSSStyleApplyProperty.cpp:
     20        (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
     21        * css/CSSStyleSelector.cpp:
     22        (WebCore::CSSStyleSelector::applyProperty):
     23        * rendering/style/RenderStyle.cpp:
     24        (WebCore::RenderStyle::diff):
     25        * rendering/style/RenderStyle.h:
     26        (WebCore::InheritedFlags::wrapPadding):
     27        (WebCore::InheritedFlags::setWrapPadding):
     28        (WebCore::InheritedFlags::initialWrapPadding):
     29        (WebCore::InheritedFlags::wrapMargin):
     30        (WebCore::InheritedFlags::setWrapMargin):
     31        (WebCore::InheritedFlags::initialWrapMargin):
     32        * rendering/style/StyleRareNonInheritedData.cpp:
     33        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
     34        (WebCore::StyleRareNonInheritedData::operator==):
     35        * rendering/style/StyleRareNonInheritedData.h:
     36
    1372011-11-17  Kenichi Ishibashi  <bashi@chromium.org>
    238
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r100570 r100604  
    287287    CSSPropertyWebkitRegionBreakInside,
    288288    CSSPropertyWebkitWrapFlow,
     289    CSSPropertyWebkitWrapMargin,
     290    CSSPropertyWebkitWrapPadding,
    289291    CSSPropertyWebkitWrapThrough
    290292#if ENABLE(SVG)
     
    20372039        case CSSPropertyWebkitRegionOverflow:
    20382040            return primitiveValueCache->createValue(style->regionOverflow());
     2041        case CSSPropertyWebkitWrapMargin:
     2042            return primitiveValueCache->createValue(style->wrapMargin());
     2043        case CSSPropertyWebkitWrapPadding:
     2044            return primitiveValueCache->createValue(style->wrapPadding());
    20392045#if ENABLE(CSS_FILTERS)
    20402046        case CSSPropertyWebkitFilter:
  • trunk/Source/WebCore/css/CSSParser.cpp

    r100570 r100604  
    385385    case CSSPropertyWebkitPaddingEnd:
    386386    case CSSPropertyWebkitPaddingStart:
     387    case CSSPropertyWebkitWrapMargin:
     388    case CSSPropertyWebkitWrapPadding:
    387389        acceptsNegativeNumbers = false;
    388390        return true;
     
    22002202            return parseWrapShape(important);
    22012203        break;
    2202 
    22032204    case CSSPropertyWebkitWrapFlow:
    22042205        if (id == CSSValueAuto || id == CSSValueBoth || id == CSSValueLeft || id == CSSValueRight || id == CSSValueMaximum || id == CSSValueClear)
     
    22102211            validPrimitive = true;
    22112212        break;
    2212 
     2213    case CSSPropertyWebkitWrapMargin:
     2214    case CSSPropertyWebkitWrapPadding:
     2215        validPrimitive = (!id && validUnit(value, FLength | FNonNeg, m_strict));
     2216        break;
    22132217#if ENABLE(SVG)
    22142218    default:
  • trunk/Source/WebCore/css/CSSProperty.cpp

    r100570 r100604  
    633633    case CSSPropertyWebkitRegionOverflow:
    634634    case CSSPropertyWebkitWrapShape:
     635    case CSSPropertyWebkitWrapMargin:
     636    case CSSPropertyWebkitWrapPadding:
    635637    case CSSPropertyWebkitRegionBreakAfter:
    636638    case CSSPropertyWebkitRegionBreakBefore:
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r100570 r100604  
    356356-webkit-region-overflow
    357357-webkit-wrap-shape
     358-webkit-wrap-margin
     359-webkit-wrap-padding
    358360-webkit-region-break-after
    359361-webkit-region-break-before
  • trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp

    r100198 r100604  
    10481048    setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
    10491049
     1050    setPropertyHandler(CSSPropertyWebkitWrapMargin, ApplyPropertyLength<&RenderStyle::wrapMargin, &RenderStyle::setWrapMargin, &RenderStyle::initialWrapMargin>::createHandler());
     1051    setPropertyHandler(CSSPropertyWebkitWrapPadding, ApplyPropertyLength<&RenderStyle::wrapPadding, &RenderStyle::setWrapPadding, &RenderStyle::initialWrapPadding>::createHandler());
     1052
    10501053    setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
    10511054}
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r100570 r100604  
    40564056    case CSSPropertyWebkitTextEmphasisPosition:
    40574057    case CSSPropertyWebkitTextEmphasisStyle:
     4058    case CSSPropertyWebkitWrapMargin:
     4059    case CSSPropertyWebkitWrapPadding:
    40584060    case CSSPropertyZIndex:
    40594061        ASSERT_NOT_REACHED();
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r100570 r100604  
    387387
    388388        if (rareNonInheritedData->m_wrapFlow != other->rareNonInheritedData->m_wrapFlow
    389             || rareNonInheritedData->m_wrapThrough != other->rareNonInheritedData->m_wrapThrough)
     389            || rareNonInheritedData->m_wrapThrough != other->rareNonInheritedData->m_wrapThrough
     390            || rareNonInheritedData->m_wrapMargin != other->rareNonInheritedData->m_wrapMargin
     391            || rareNonInheritedData->m_wrapPadding != other->rareNonInheritedData->m_wrapPadding)
    390392            return StyleDifferenceLayout;
    391393
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r100570 r100604  
    12861286    CSSWrapShape* wrapShape() const { return rareNonInheritedData->m_wrapShape.get(); }
    12871287    static CSSWrapShape* initialWrapShape() { return 0; }
     1288
     1289    Length wrapPadding() const { return rareNonInheritedData->m_wrapPadding; }
     1290    void setWrapPadding(Length wrapPadding) { SET_VAR(rareNonInheritedData, m_wrapPadding, wrapPadding); }
     1291    static Length initialWrapPadding() { return Length(0, Fixed); }
     1292
     1293    Length wrapMargin() const { return rareNonInheritedData->m_wrapMargin; }
     1294    void setWrapMargin(Length wrapMargin) { SET_VAR(rareNonInheritedData, m_wrapMargin, wrapMargin); }
     1295    static Length initialWrapMargin() { return Length(0, Fixed); }
    12881296
    12891297    bool hasContent() const { return contentData(); }
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r100570 r100604  
    4545    , m_pageSize()
    4646    , m_wrapShape(RenderStyle::initialWrapShape())
     47    , m_wrapMargin(RenderStyle::initialWrapMargin())
     48    , m_wrapPadding(RenderStyle::initialWrapPadding())
    4749    , m_visitedLinkBackgroundColor(RenderStyle::initialBackgroundColor())
    4850    , m_flowThread(RenderStyle::initialFlowThread())
     
    99101    , m_pageSize(o.m_pageSize)
    100102    , m_wrapShape(o.m_wrapShape)
     103    , m_wrapMargin(o.m_wrapMargin)
     104    , m_wrapPadding(o.m_wrapPadding)
    101105    , m_visitedLinkBackgroundColor(o.m_visitedLinkBackgroundColor)
    102106    , m_visitedLinkOutlineColor(o.m_visitedLinkBackgroundColor)
     
    183187        && (m_wrapFlow == o.m_wrapFlow)
    184188        && (m_wrapThrough == o.m_wrapThrough)
     189        && (m_wrapMargin == o.m_wrapMargin)
     190        && (m_wrapPadding == o.m_wrapPadding)
    185191        && m_visitedLinkBackgroundColor == o.m_visitedLinkBackgroundColor
    186192        && m_visitedLinkOutlineColor == o.m_visitedLinkOutlineColor
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r100570 r100604  
    128128
    129129    RefPtr<CSSWrapShape> m_wrapShape;
     130    Length m_wrapMargin;
     131    Length m_wrapPadding;
    130132   
    131133    Color m_visitedLinkBackgroundColor;
Note: See TracChangeset for help on using the changeset viewer.