Changeset 101048 in webkit


Ignore:
Timestamp:
Nov 23, 2011 12:42:10 AM (12 years ago)
Author:
mihnea@adobe.com
Message:

CSS Exclusions: update the name of the shape CSS properties
https://bugs.webkit.org/show_bug.cgi?id=71898
Instead of a single wrap-shape property, we have wrap-shape-inside and wrap-shape-outside.

Reviewed by Dean Jackson.

Source/WebCore:

Tests: fast/exclusions/parsing-wrap-shape-inside.html

fast/exclusions/parsing-wrap-shape-outside.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseWrapShape):

  • css/CSSParser.h:
  • css/CSSProperty.cpp:

(WebCore::CSSProperty::isInheritedProperty):

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

(WebCore::CSSStyleSelector::applyProperty):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::diff):

  • rendering/style/RenderStyle.h:

(WebCore::InheritedFlags::setWrapShapeInside):
(WebCore::InheritedFlags::wrapShapeInside):
(WebCore::InheritedFlags::setWrapShapeOutside):
(WebCore::InheritedFlags::wrapShapeOutside):
(WebCore::InheritedFlags::initialWrapShapeInside):
(WebCore::InheritedFlags::initialWrapShapeOutside):

  • rendering/style/StyleRareNonInheritedData.cpp:

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

  • rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

  • fast/exclusions/parsing-wrap-shape-inside-expected.txt: Copied from LayoutTests/fast/exclusions/parsing-wrap-shape-expected.txt.
  • fast/exclusions/parsing-wrap-shape-inside.html: Copied from LayoutTests/fast/exclusions/parsing-wrap-shape.html.
  • fast/exclusions/parsing-wrap-shape-outside-expected.txt: Renamed from LayoutTests/fast/exclusions/parsing-wrap-shape-expected.txt.
  • fast/exclusions/parsing-wrap-shape-outside.html: Renamed from LayoutTests/fast/exclusions/parsing-wrap-shape.html.
  • fast/exclusions/script-tests/parsing-wrap-shape-inside.js: Copied from LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape.js.
  • fast/exclusions/script-tests/parsing-wrap-shape-outside.js: Renamed from LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape.js.
Location:
trunk
Files:
12 edited
3 copied
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101043 r101048  
     12011-11-23  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        CSS Exclusions: update the name of the shape CSS properties
     4        https://bugs.webkit.org/show_bug.cgi?id=71898
     5        Instead of a single wrap-shape property, we have wrap-shape-inside and wrap-shape-outside.
     6
     7        Reviewed by Dean Jackson.
     8
     9        * fast/exclusions/parsing-wrap-shape-inside-expected.txt: Copied from LayoutTests/fast/exclusions/parsing-wrap-shape-expected.txt.
     10        * fast/exclusions/parsing-wrap-shape-inside.html: Copied from LayoutTests/fast/exclusions/parsing-wrap-shape.html.
     11        * fast/exclusions/parsing-wrap-shape-outside-expected.txt: Renamed from LayoutTests/fast/exclusions/parsing-wrap-shape-expected.txt.
     12        * fast/exclusions/parsing-wrap-shape-outside.html: Renamed from LayoutTests/fast/exclusions/parsing-wrap-shape.html.
     13        * fast/exclusions/script-tests/parsing-wrap-shape-inside.js: Copied from LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape.js.
     14        * fast/exclusions/script-tests/parsing-wrap-shape-outside.js: Renamed from LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape.js.
     15
    1162011-11-22  Csaba Osztrogonác  <ossy@webkit.org>
    217
  • trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-inside-expected.txt

    r101047 r101048  
    1 Testing the parsing of the -webkit-wrap-shape property.
     1Testing the parsing of the -webkit-wrap-shape-inside property.
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
  • trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-inside.html

    r101047 r101048  
    55</head>
    66<body>
    7 <script src="script-tests/parsing-wrap-shape.js"></script>
     7<script src="script-tests/parsing-wrap-shape-inside.js"></script>
    88<script src="../js/resources/js-test-post.js"></script>
    99</body>
  • trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-outside-expected.txt

    r101047 r101048  
    1 Testing the parsing of the -webkit-wrap-shape property.
     1Testing the parsing of the -webkit-wrap-shape-outside property.
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
  • trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-outside.html

    r101047 r101048  
    55</head>
    66<body>
    7 <script src="script-tests/parsing-wrap-shape.js"></script>
     7<script src="script-tests/parsing-wrap-shape-outside.js"></script>
    88<script src="../js/resources/js-test-post.js"></script>
    99</body>
  • trunk/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js

    r101047 r101048  
    1 description('Testing the parsing of the -webkit-wrap-shape property.');
     1description('Testing the parsing of the -webkit-wrap-shape-inside property.');
    22
    33function testCSSText(declaration, expected)
    44{
    55    var element = document.createElement("div");
    6     element.style.cssText = "-webkit-wrap-shape: " + declaration;
    7     return element.style.webkitWrapShape;
     6    element.style.cssText = "-webkit-wrap-shape-inside: " + declaration;
     7    return element.style.webkitWrapShapeInside;
    88}
    99
     
    1111    var element = document.createElement("div");
    1212    document.body.appendChild(element);
    13     element.style.setProperty("-webkit-wrap-shape", value);
    14    
     13    element.style.setProperty("-webkit-wrap-shape-inside", value);
     14
    1515    var computedStyle = getComputedStyle(element);
    16     var actualValue = computedStyle.getPropertyValue("-webkit-wrap-shape");
     16    var actualValue = computedStyle.getPropertyValue("-webkit-wrap-shape-inside");
    1717    document.body.removeChild(element);
    1818
     
    2323   var parentElement = document.createElement("div");
    2424   document.body.appendChild(parentElement);
    25    parentElement.style.setProperty("-webkit-wrap-shape", parentValue);
     25   parentElement.style.setProperty("-webkit-wrap-shape-inside", parentValue);
    2626
    2727   var childElement = document.createElement("div");
    2828   parentElement.appendChild(childElement);
    29    childElement.style.setProperty("-webkit-wrap-shape", childValue);
     29   childElement.style.setProperty("-webkit-wrap-shape-inside", childValue);
    3030
    3131   var parentComputedStyle = getComputedStyle(parentElement);
    32    var parentActual = parentComputedStyle.getPropertyValue('-webkit-wrap-shape')
    33    
     32   var parentActual = parentComputedStyle.getPropertyValue('-webkit-wrap-shape-inside')
     33
    3434   var childComputedStyle = getComputedStyle(childElement);
    35    var childActual = childComputedStyle.getPropertyValue('-webkit-wrap-shape')
    36    
     35   var childActual = childComputedStyle.getPropertyValue('-webkit-wrap-shape-inside')
     36
    3737   parentElement.removeChild(childElement);
    3838   document.body.removeChild(parentElement);
    39    
     39
    4040   return "parent: " + parentActual + ", child: " + childActual;
    4141}
  • trunk/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-outside.js

    r101047 r101048  
    1 description('Testing the parsing of the -webkit-wrap-shape property.');
     1description('Testing the parsing of the -webkit-wrap-shape-outside property.');
    22
    33function testCSSText(declaration, expected)
    44{
    55    var element = document.createElement("div");
    6     element.style.cssText = "-webkit-wrap-shape: " + declaration;
    7     return element.style.webkitWrapShape;
     6    element.style.cssText = "-webkit-wrap-shape-outside: " + declaration;
     7    return element.style.webkitWrapShapeOutside;
    88}
    99
     
    1111    var element = document.createElement("div");
    1212    document.body.appendChild(element);
    13     element.style.setProperty("-webkit-wrap-shape", value);
    14    
     13    element.style.setProperty("-webkit-wrap-shape-outside", value);
     14
    1515    var computedStyle = getComputedStyle(element);
    16     var actualValue = computedStyle.getPropertyValue("-webkit-wrap-shape");
     16    var actualValue = computedStyle.getPropertyValue("-webkit-wrap-shape-outside");
    1717    document.body.removeChild(element);
    1818
     
    2323   var parentElement = document.createElement("div");
    2424   document.body.appendChild(parentElement);
    25    parentElement.style.setProperty("-webkit-wrap-shape", parentValue);
     25   parentElement.style.setProperty("-webkit-wrap-shape-outside", parentValue);
    2626
    2727   var childElement = document.createElement("div");
    2828   parentElement.appendChild(childElement);
    29    childElement.style.setProperty("-webkit-wrap-shape", childValue);
     29   childElement.style.setProperty("-webkit-wrap-shape-outside", childValue);
    3030
    3131   var parentComputedStyle = getComputedStyle(parentElement);
    32    var parentActual = parentComputedStyle.getPropertyValue('-webkit-wrap-shape')
    33    
     32   var parentActual = parentComputedStyle.getPropertyValue('-webkit-wrap-shape-outside')
     33
    3434   var childComputedStyle = getComputedStyle(childElement);
    35    var childActual = childComputedStyle.getPropertyValue('-webkit-wrap-shape')
    36    
     35   var childActual = childComputedStyle.getPropertyValue('-webkit-wrap-shape-outside')
     36
    3737   parentElement.removeChild(childElement);
    3838   document.body.removeChild(parentElement);
    39    
     39
    4040   return "parent: " + parentActual + ", child: " + childActual;
    4141}
  • trunk/Source/WebCore/ChangeLog

    r101047 r101048  
     12011-11-23  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        CSS Exclusions: update the name of the shape CSS properties
     4        https://bugs.webkit.org/show_bug.cgi?id=71898
     5        Instead of a single wrap-shape property, we have wrap-shape-inside and wrap-shape-outside.
     6
     7        Reviewed by Dean Jackson.
     8
     9        Tests: fast/exclusions/parsing-wrap-shape-inside.html
     10               fast/exclusions/parsing-wrap-shape-outside.html
     11
     12        * css/CSSComputedStyleDeclaration.cpp:
     13        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     14        * css/CSSParser.cpp:
     15        (WebCore::CSSParser::parseValue):
     16        (WebCore::CSSParser::parseWrapShape):
     17        * css/CSSParser.h:
     18        * css/CSSProperty.cpp:
     19        (WebCore::CSSProperty::isInheritedProperty):
     20        * css/CSSPropertyNames.in:
     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::setWrapShapeInside):
     27        (WebCore::InheritedFlags::wrapShapeInside):
     28        (WebCore::InheritedFlags::setWrapShapeOutside):
     29        (WebCore::InheritedFlags::wrapShapeOutside):
     30        (WebCore::InheritedFlags::initialWrapShapeInside):
     31        (WebCore::InheritedFlags::initialWrapShapeOutside):
     32        * rendering/style/StyleRareNonInheritedData.cpp:
     33        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
     34        (WebCore::StyleRareNonInheritedData::operator==):
     35        * rendering/style/StyleRareNonInheritedData.h:
     36
    1372011-11-23  Andrey Kosyakov  <caseq@chromium.org>
    238
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r100749 r101048  
    21752175            break;
    21762176
    2177         case CSSPropertyWebkitWrapShape:
    2178             if (!style->wrapShape())
     2177        case CSSPropertyWebkitWrapShapeInside:
     2178            if (!style->wrapShapeInside())
    21792179                return primitiveValueCache->createIdentifierValue(CSSValueAuto);
    2180 
    2181             return primitiveValueCache->createValue(style->wrapShape());
     2180            return primitiveValueCache->createValue(style->wrapShapeInside());
     2181
     2182        case CSSPropertyWebkitWrapShapeOutside:
     2183            if (!style->wrapShapeOutside())
     2184                return primitiveValueCache->createIdentifierValue(CSSValueAuto);
     2185            return primitiveValueCache->createValue(style->wrapShapeOutside());
    21822186
    21832187        case CSSPropertyWebkitWrapFlow:
  • trunk/Source/WebCore/css/CSSParser.cpp

    r100749 r101048  
    21962196        break;
    21972197
    2198     case CSSPropertyWebkitWrapShape:
     2198    case CSSPropertyWebkitWrapShapeInside:
     2199    case CSSPropertyWebkitWrapShapeOutside:
    21992200        if (id == CSSValueAuto)
    22002201            validPrimitive = true;
    22012202        else if (value->unit == CSSParserValue::Function)
    2202             return parseWrapShape(important);
     2203            return parseWrapShape((propId == CSSPropertyWebkitWrapShapeInside), important);
    22032204        break;
    22042205    case CSSPropertyWebkitWrapFlow:
     
    39493950}
    39503951
    3951 bool CSSParser::parseWrapShape(bool important)
     3952bool CSSParser::parseWrapShape(bool shapeInside, bool important)
    39523953{
    39533954    CSSParserValue* value = m_valueList->current();
     
    39693970
    39703971    if (shape) {
    3971         addProperty(CSSPropertyWebkitWrapShape, primitiveValueCache()->createValue(shape.release()), important);
     3972        addProperty(shapeInside ? CSSPropertyWebkitWrapShapeInside : CSSPropertyWebkitWrapShapeOutside, primitiveValueCache()->createValue(shape.release()), important);
    39723973        m_valueList->next();
    39733974        return true;
  • trunk/Source/WebCore/css/CSSParser.h

    r100273 r101048  
    130130    bool parseShape(int propId, bool important);
    131131
    132     bool parseWrapShape(bool important);
     132    bool parseWrapShape(bool shapeInside, bool important);
    133133    PassRefPtr<CSSWrapShape> parseWrapShapeRect(CSSParserValueList* args);
    134134    PassRefPtr<CSSWrapShape> parseWrapShapeCircle(CSSParserValueList* args);
  • trunk/Source/WebCore/css/CSSProperty.cpp

    r101008 r101048  
    627627    case CSSPropertyWebkitFlowFrom:
    628628    case CSSPropertyWebkitRegionOverflow:
    629     case CSSPropertyWebkitWrapShape:
     629    case CSSPropertyWebkitWrapShapeInside:
     630    case CSSPropertyWebkitWrapShapeOutside:
    630631    case CSSPropertyWebkitWrapMargin:
    631632    case CSSPropertyWebkitWrapPadding:
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r100604 r101048  
    355355-webkit-flow-from
    356356-webkit-region-overflow
    357 -webkit-wrap-shape
     357-webkit-wrap-shape-inside
     358-webkit-wrap-shape-outside
    358359-webkit-wrap-margin
    359360-webkit-wrap-padding
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r100976 r101048  
    38613861        return;
    38623862
    3863     case CSSPropertyWebkitWrapShape:
    3864         HANDLE_INHERIT_AND_INITIAL(wrapShape, WrapShape);
     3863    case CSSPropertyWebkitWrapShapeInside:
     3864        HANDLE_INHERIT_AND_INITIAL(wrapShapeInside, WrapShapeInside);
    38653865        if (!primitiveValue)
    38663866            return;
    3867 
    38683867        if (primitiveValue->getIdent() == CSSValueAuto)
    3869             m_style->setWrapShape(0);
     3868            m_style->setWrapShapeInside(0);
    38703869        else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_SHAPE)
    3871             m_style->setWrapShape(primitiveValue->getShapeValue());
    3872 
     3870            m_style->setWrapShapeInside(primitiveValue->getShapeValue());
     3871        return;
     3872
     3873    case CSSPropertyWebkitWrapShapeOutside:
     3874        HANDLE_INHERIT_AND_INITIAL(wrapShapeOutside, WrapShapeOutside);
     3875        if (!primitiveValue)
     3876            return;
     3877        if (primitiveValue->getIdent() == CSSValueAuto)
     3878            m_style->setWrapShapeOutside(0);
     3879        else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_SHAPE)
     3880            m_style->setWrapShapeOutside(primitiveValue->getShapeValue());
    38733881        return;
    38743882
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r100832 r101048  
    630630        // to avoid having diff() == StyleDifferenceEqual where wrap-shapes actually differ.
    631631        // Tracking bug: https://bugs.webkit.org/show_bug.cgi?id=62991
    632         if (rareNonInheritedData->m_wrapShape != other->rareNonInheritedData->m_wrapShape)
     632        if (rareNonInheritedData->m_wrapShapeInside != other->rareNonInheritedData->m_wrapShapeInside
     633            || rareNonInheritedData->m_wrapShapeOutside != other->rareNonInheritedData->m_wrapShapeOutside)
    633634            return StyleDifferenceRepaint;
    634635
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r100656 r101048  
    12871287#endif
    12881288
    1289     void setWrapShape(PassRefPtr<CSSWrapShape> shape)
    1290     {
    1291         if (rareNonInheritedData->m_wrapShape != shape)
    1292             rareNonInheritedData.access()->m_wrapShape = shape;
    1293     }
    1294     CSSWrapShape* wrapShape() const { return rareNonInheritedData->m_wrapShape.get(); }
    1295     static CSSWrapShape* initialWrapShape() { return 0; }
     1289    void setWrapShapeInside(PassRefPtr<CSSWrapShape> shape)
     1290    {
     1291        if (rareNonInheritedData->m_wrapShapeInside != shape)
     1292            rareNonInheritedData.access()->m_wrapShapeInside = shape;
     1293    }
     1294    CSSWrapShape* wrapShapeInside() const { return rareNonInheritedData->m_wrapShapeInside.get(); }
     1295
     1296    void setWrapShapeOutside(PassRefPtr<CSSWrapShape> shape)
     1297    {
     1298        if (rareNonInheritedData->m_wrapShapeOutside != shape)
     1299            rareNonInheritedData.access()->m_wrapShapeOutside = shape;
     1300    }
     1301    CSSWrapShape* wrapShapeOutside() const { return rareNonInheritedData->m_wrapShapeOutside.get(); }
     1302
     1303    static CSSWrapShape* initialWrapShapeInside() { return 0; }
     1304    static CSSWrapShape* initialWrapShapeOutside() { return 0; }
    12961305
    12971306    Length wrapPadding() const { return rareNonInheritedData->m_wrapPadding; }
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r100656 r101048  
    4646    , m_mask(FillLayer(MaskFillLayer))
    4747    , m_pageSize()
    48     , m_wrapShape(RenderStyle::initialWrapShape())
     48    , m_wrapShapeInside(RenderStyle::initialWrapShapeInside())
     49    , m_wrapShapeOutside(RenderStyle::initialWrapShapeOutside())
    4950    , m_wrapMargin(RenderStyle::initialWrapMargin())
    5051    , m_wrapPadding(RenderStyle::initialWrapPadding())
     
    105106    , m_maskBoxImage(o.m_maskBoxImage)
    106107    , m_pageSize(o.m_pageSize)
    107     , m_wrapShape(o.m_wrapShape)
     108    , m_wrapShapeInside(o.m_wrapShapeInside)
     109    , m_wrapShapeOutside(o.m_wrapShapeOutside)
    108110    , m_wrapMargin(o.m_wrapMargin)
    109111    , m_wrapPadding(o.m_wrapPadding)
     
    193195        && (m_regionThread == o.m_regionThread)
    194196        && (m_regionOverflow == o.m_regionOverflow)
    195         && (m_wrapShape == o.m_wrapShape)
     197        && (m_wrapShapeInside == o.m_wrapShapeInside)
     198        && (m_wrapShapeOutside == o.m_wrapShapeOutside)
    196199        && (m_wrapFlow == o.m_wrapFlow)
    197200        && (m_wrapThrough == o.m_wrapThrough)
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r100656 r101048  
    130130    LengthSize m_pageSize;
    131131
    132     RefPtr<CSSWrapShape> m_wrapShape;
     132    RefPtr<CSSWrapShape> m_wrapShapeInside;
     133    RefPtr<CSSWrapShape> m_wrapShapeOutside;
    133134    Length m_wrapMargin;
    134135    Length m_wrapPadding;
Note: See TracChangeset for help on using the changeset viewer.