Changeset 112629 in webkit


Ignore:
Timestamp:
Mar 29, 2012 6:17:38 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Update shape-inside/shape-outside CSS Exclusion properties
https://bugs.webkit.org/show_bug.cgi?id=82365

Patch by Bear Travis <betravis@adobe.com> on 2012-03-29
Reviewed by Ryosuke Niwa.

Source/WebCore:

Updating CSS property names for wrap-shape-inside and wrap-shape-outside
to shape-inside and shape-outside, per the current exclusions spec.
Renaming some parsing functions in CSSParser for clarity.
No new functionality.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseClipShape):
(WebCore::CSSParser::parseExclusionShapeRect):
(WebCore::CSSParser::parseExclusionShapeCircle):
(WebCore::CSSParser::parseExclusionShapeEllipse):
(WebCore::CSSParser::parseExclusionShapePolygon):
(WebCore::CSSParser::parseExclusionShape):

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

(WebCore::CSSProperty::isInheritedProperty):

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

(WebCore::CSSStyleSelector::collectMatchingRulesForList):

LayoutTests:

Renaming prefixed wrap-shape-inside and wrap-shape-outside
to prefixed shape-inside and shape-outside. Updating the
tests to reflect the change.

  • fast/exclusions/parsing-wrap-shape-inside-expected.txt:
  • fast/exclusions/parsing-wrap-shape-outside-expected.txt:
  • fast/exclusions/script-tests/parsing-wrap-shape-inside.js:

(testCSSText):
(testComputedStyle):
(testNotInherited):

  • fast/exclusions/script-tests/parsing-wrap-shape-outside.js:

(testCSSText):
(testComputedStyle):
(testNotInherited):

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r112625 r112629  
     12012-03-29  Bear Travis  <betravis@adobe.com>
     2
     3        Update shape-inside/shape-outside CSS Exclusion properties
     4        https://bugs.webkit.org/show_bug.cgi?id=82365
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Renaming prefixed wrap-shape-inside and wrap-shape-outside
     9        to prefixed shape-inside and shape-outside. Updating the
     10        tests to reflect the change.
     11
     12        * fast/exclusions/parsing-wrap-shape-inside-expected.txt:
     13        * fast/exclusions/parsing-wrap-shape-outside-expected.txt:
     14        * fast/exclusions/script-tests/parsing-wrap-shape-inside.js:
     15        (testCSSText):
     16        (testComputedStyle):
     17        (testNotInherited):
     18        * fast/exclusions/script-tests/parsing-wrap-shape-outside.js:
     19        (testCSSText):
     20        (testComputedStyle):
     21        (testNotInherited):
     22
    1232012-03-29  Dirk Pranke  <dpranke@chromium.org>
    224
  • trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-inside-expected.txt

    r101048 r112629  
    1 Testing the parsing of the -webkit-wrap-shape-inside property.
     1Testing the parsing of the -webkit-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-outside-expected.txt

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

    r101048 r112629  
    1 description('Testing the parsing of the -webkit-wrap-shape-inside property.');
     1description('Testing the parsing of the -webkit-shape-inside property.');
    22
    33function testCSSText(declaration, expected)
    44{
    55    var element = document.createElement("div");
    6     element.style.cssText = "-webkit-wrap-shape-inside: " + declaration;
    7     return element.style.webkitWrapShapeInside;
     6    element.style.cssText = "-webkit-shape-inside: " + declaration;
     7    return element.style.webkitShapeInside;
    88}
    99
     
    1111    var element = document.createElement("div");
    1212    document.body.appendChild(element);
    13     element.style.setProperty("-webkit-wrap-shape-inside", value);
     13    element.style.setProperty("-webkit-shape-inside", value);
    1414
    1515    var computedStyle = getComputedStyle(element);
    16     var actualValue = computedStyle.getPropertyValue("-webkit-wrap-shape-inside");
     16    var actualValue = computedStyle.getPropertyValue("-webkit-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-inside", parentValue);
     25   parentElement.style.setProperty("-webkit-shape-inside", parentValue);
    2626
    2727   var childElement = document.createElement("div");
    2828   parentElement.appendChild(childElement);
    29    childElement.style.setProperty("-webkit-wrap-shape-inside", childValue);
     29   childElement.style.setProperty("-webkit-shape-inside", childValue);
    3030
    3131   var parentComputedStyle = getComputedStyle(parentElement);
    32    var parentActual = parentComputedStyle.getPropertyValue('-webkit-wrap-shape-inside')
     32   var parentActual = parentComputedStyle.getPropertyValue('-webkit-shape-inside')
    3333
    3434   var childComputedStyle = getComputedStyle(childElement);
    35    var childActual = childComputedStyle.getPropertyValue('-webkit-wrap-shape-inside')
     35   var childActual = childComputedStyle.getPropertyValue('-webkit-shape-inside')
    3636
    3737   parentElement.removeChild(childElement);
  • trunk/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-outside.js

    r101048 r112629  
    1 description('Testing the parsing of the -webkit-wrap-shape-outside property.');
     1description('Testing the parsing of the -webkit-shape-outside property.');
    22
    33function testCSSText(declaration, expected)
    44{
    55    var element = document.createElement("div");
    6     element.style.cssText = "-webkit-wrap-shape-outside: " + declaration;
    7     return element.style.webkitWrapShapeOutside;
     6    element.style.cssText = "-webkit-shape-outside: " + declaration;
     7    return element.style.webkitShapeOutside;
    88}
    99
     
    1111    var element = document.createElement("div");
    1212    document.body.appendChild(element);
    13     element.style.setProperty("-webkit-wrap-shape-outside", value);
     13    element.style.setProperty("-webkit-shape-outside", value);
    1414
    1515    var computedStyle = getComputedStyle(element);
    16     var actualValue = computedStyle.getPropertyValue("-webkit-wrap-shape-outside");
     16    var actualValue = computedStyle.getPropertyValue("-webkit-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-outside", parentValue);
     25   parentElement.style.setProperty("-webkit-shape-outside", parentValue);
    2626
    2727   var childElement = document.createElement("div");
    2828   parentElement.appendChild(childElement);
    29    childElement.style.setProperty("-webkit-wrap-shape-outside", childValue);
     29   childElement.style.setProperty("-webkit-shape-outside", childValue);
    3030
    3131   var parentComputedStyle = getComputedStyle(parentElement);
    32    var parentActual = parentComputedStyle.getPropertyValue('-webkit-wrap-shape-outside')
     32   var parentActual = parentComputedStyle.getPropertyValue('-webkit-shape-outside')
    3333
    3434   var childComputedStyle = getComputedStyle(childElement);
    35    var childActual = childComputedStyle.getPropertyValue('-webkit-wrap-shape-outside')
     35   var childActual = childComputedStyle.getPropertyValue('-webkit-shape-outside')
    3636
    3737   parentElement.removeChild(childElement);
  • trunk/Source/WebCore/ChangeLog

    r112628 r112629  
     12012-03-29  Bear Travis  <betravis@adobe.com>
     2
     3        Update shape-inside/shape-outside CSS Exclusion properties
     4        https://bugs.webkit.org/show_bug.cgi?id=82365
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Updating CSS property names for wrap-shape-inside and wrap-shape-outside
     9        to shape-inside and shape-outside, per the current exclusions spec.
     10        Renaming some parsing functions in CSSParser for clarity.
     11        No new functionality.
     12
     13        * css/CSSComputedStyleDeclaration.cpp:
     14        (WebCore):
     15        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     16        * css/CSSParser.cpp:
     17        (WebCore::CSSParser::parseValue):
     18        (WebCore::CSSParser::parseClipShape):
     19        (WebCore::CSSParser::parseExclusionShapeRect):
     20        (WebCore::CSSParser::parseExclusionShapeCircle):
     21        (WebCore::CSSParser::parseExclusionShapeEllipse):
     22        (WebCore::CSSParser::parseExclusionShapePolygon):
     23        (WebCore::CSSParser::parseExclusionShape):
     24        * css/CSSParser.h:
     25        * css/CSSProperty.cpp:
     26        (WebCore::CSSProperty::isInheritedProperty):
     27        * css/CSSPropertyNames.in:
     28        * css/CSSStyleSelector.cpp:
     29        (WebCore::CSSStyleSelector::collectMatchingRulesForList):
     30
    1312012-03-29  Ryan Sleevi  <rsleevi@chromium.org>
    232
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r112555 r112629  
    23232323        case CSSPropertyWebkitWrapPadding:
    23242324            return cssValuePool->createValue(style->wrapPadding());
    2325         case CSSPropertyWebkitWrapShapeInside:
     2325        case CSSPropertyWebkitShapeInside:
    23262326            if (!style->wrapShapeInside())
    23272327                return cssValuePool->createIdentifierValue(CSSValueAuto);
    23282328            return cssValuePool->createValue(style->wrapShapeInside());
    2329         case CSSPropertyWebkitWrapShapeOutside:
     2329        case CSSPropertyWebkitShapeOutside:
    23302330            if (!style->wrapShapeOutside())
    23312331                return cssValuePool->createIdentifierValue(CSSValueAuto);
  • trunk/Source/WebCore/css/CSSParser.cpp

    r112587 r112629  
    14821482            validPrimitive = true;
    14831483        else if (value->unit == CSSParserValue::Function)
    1484             return parseShape(propId, important);
     1484            return parseClipShape(propId, important);
    14851485        break;
    14861486
     
    24002400        break;
    24012401
    2402     case CSSPropertyWebkitWrapShapeInside:
    2403     case CSSPropertyWebkitWrapShapeOutside:
     2402    case CSSPropertyWebkitShapeInside:
     2403    case CSSPropertyWebkitShapeOutside:
    24042404        if (id == CSSValueAuto)
    24052405            validPrimitive = true;
    24062406        else if (value->unit == CSSParserValue::Function)
    2407             return parseWrapShape((propId == CSSPropertyWebkitWrapShapeInside), important);
     2407            return parseExclusionShape((propId == CSSPropertyWebkitShapeInside), important);
    24082408        break;
    24092409    case CSSPropertyWebkitWrapMargin:
     
    40384038}
    40394039
    4040 bool CSSParser::parseShape(int propId, bool important)
     4040bool CSSParser::parseClipShape(int propId, bool important)
    40414041{
    40424042    CSSParserValue* value = m_valueList->current();
     
    40874087}
    40884088
    4089 PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeRect(CSSParserValueList* args)
     4089PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeRect(CSSParserValueList* args)
    40904090{
    40914091    ASSERT(args);
     
    41404140}
    41414141
    4142 PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeCircle(CSSParserValueList* args)
     4142PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeCircle(CSSParserValueList* args)
    41434143{
    41444144    ASSERT(args);
     
    41844184}
    41854185
    4186 PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeEllipse(CSSParserValueList* args)
     4186PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeEllipse(CSSParserValueList* args)
    41874187{
    41884188    ASSERT(args);
     
    42304230}
    42314231
    4232 PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapePolygon(CSSParserValueList* args)
     4232PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapePolygon(CSSParserValueList* args)
    42334233{
    42344234    ASSERT(args);
     
    42804280}
    42814281
    4282 bool CSSParser::parseWrapShape(bool shapeInside, bool important)
     4282bool CSSParser::parseExclusionShape(bool shapeInside, bool important)
    42834283{
    42844284    CSSParserValue* value = m_valueList->current();
     
    42914291
    42924292    if (equalIgnoringCase(value->function->name, "rect("))
    4293         shape = parseWrapShapeRect(args);
     4293        shape = parseExclusionShapeRect(args);
    42944294    else if (equalIgnoringCase(value->function->name, "circle("))
    4295         shape = parseWrapShapeCircle(args);
     4295        shape = parseExclusionShapeCircle(args);
    42964296    else if (equalIgnoringCase(value->function->name, "ellipse("))
    4297         shape = parseWrapShapeEllipse(args);
     4297        shape = parseExclusionShapeEllipse(args);
    42984298    else if (equalIgnoringCase(value->function->name, "polygon("))
    4299         shape = parseWrapShapePolygon(args);
     4299        shape = parseExclusionShapePolygon(args);
    43004300
    43014301    if (shape) {
    4302         addProperty(shapeInside ? CSSPropertyWebkitWrapShapeInside : CSSPropertyWebkitWrapShapeOutside, cssValuePool()->createValue(shape.release()), important);
     4302        addProperty(shapeInside ? CSSPropertyWebkitShapeInside : CSSPropertyWebkitShapeOutside, cssValuePool()->createValue(shape.release()), important);
    43034303        m_valueList->next();
    43044304        return true;
  • trunk/Source/WebCore/css/CSSParser.h

    r112537 r112629  
    139139    bool parseDashboardRegions(int propId, bool important);
    140140
    141     bool parseShape(int propId, bool important);
    142 
    143     bool parseWrapShape(bool shapeInside, bool important);
    144     PassRefPtr<CSSWrapShape> parseWrapShapeRect(CSSParserValueList* args);
    145     PassRefPtr<CSSWrapShape> parseWrapShapeCircle(CSSParserValueList* args);
    146     PassRefPtr<CSSWrapShape> parseWrapShapeEllipse(CSSParserValueList* args);
    147     PassRefPtr<CSSWrapShape> parseWrapShapePolygon(CSSParserValueList* args);
     141    bool parseClipShape(int propId, bool important);
     142
     143    bool parseExclusionShape(bool shapeInside, bool important);
     144    PassRefPtr<CSSWrapShape> parseExclusionShapeRect(CSSParserValueList* args);
     145    PassRefPtr<CSSWrapShape> parseExclusionShapeCircle(CSSParserValueList* args);
     146    PassRefPtr<CSSWrapShape> parseExclusionShapeEllipse(CSSParserValueList* args);
     147    PassRefPtr<CSSWrapShape> parseExclusionShapePolygon(CSSParserValueList* args);
    148148
    149149    bool parseFont(bool important);
  • trunk/Source/WebCore/css/CSSProperty.cpp

    r112418 r112629  
    611611    case CSSPropertyWebkitWrapMargin:
    612612    case CSSPropertyWebkitWrapPadding:
    613     case CSSPropertyWebkitWrapShapeInside:
    614     case CSSPropertyWebkitWrapShapeOutside:
     613    case CSSPropertyWebkitShapeInside:
     614    case CSSPropertyWebkitShapeOutside:
    615615    case CSSPropertyWebkitWrapThrough:
    616616#if ENABLE(SVG)
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r111342 r112629  
    362362-webkit-flow-from
    363363-webkit-region-overflow
    364 -webkit-wrap-shape-inside
    365 -webkit-wrap-shape-outside
     364-webkit-shape-inside
     365-webkit-shape-outside
    366366-webkit-wrap-margin
    367367-webkit-wrap-padding
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r112555 r112629  
    37403740    }
    37413741
    3742     case CSSPropertyWebkitWrapShapeInside:
     3742    case CSSPropertyWebkitShapeInside:
    37433743        HANDLE_INHERIT_AND_INITIAL(wrapShapeInside, WrapShapeInside);
    37443744        if (!primitiveValue)
     
    37503750        return;
    37513751
    3752     case CSSPropertyWebkitWrapShapeOutside:
     3752    case CSSPropertyWebkitShapeOutside:
    37533753        HANDLE_INHERIT_AND_INITIAL(wrapShapeOutside, WrapShapeOutside);
    37543754        if (!primitiveValue)
Note: See TracChangeset for help on using the changeset viewer.