Changeset 101078 in webkit


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

CSS Exclusions: parse the shorthand "wrap" property
https://bugs.webkit.org/show_bug.cgi?id=71905

Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/exclusions/wrap-parsing.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

  • css/CSSMutableStyleDeclaration.cpp:

(WebCore::CSSMutableStyleDeclaration::getPropertyValue):

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):

  • css/CSSProperty.cpp:

(WebCore::CSSProperty::isInheritedProperty):

  • css/CSSPropertyLonghand.cpp:

(WebCore::initShorthandMap):

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

(WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):

  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::applyProperty):

LayoutTests:

  • fast/exclusions/script-tests/wrap-parsing.js: Added.
  • fast/exclusions/wrap-parsing-expected.txt: Added.
  • fast/exclusions/wrap-parsing.html: Added.
Location:
trunk
Files:
3 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101077 r101078  
     12011-11-23  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        CSS Exclusions: parse the shorthand "wrap" property
     4        https://bugs.webkit.org/show_bug.cgi?id=71905
     5
     6        Reviewed by Dean Jackson.
     7
     8        * fast/exclusions/script-tests/wrap-parsing.js: Added.
     9        * fast/exclusions/wrap-parsing-expected.txt: Added.
     10        * fast/exclusions/wrap-parsing.html: Added.
     11
    1122011-11-23  Alexandru Chiculita  <achicu@adobe.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r101077 r101078  
     12011-11-23  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        CSS Exclusions: parse the shorthand "wrap" property
     4        https://bugs.webkit.org/show_bug.cgi?id=71905
     5
     6        Reviewed by Dean Jackson.
     7
     8        Test: fast/exclusions/wrap-parsing.html
     9
     10        * css/CSSComputedStyleDeclaration.cpp:
     11        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     12        * css/CSSMutableStyleDeclaration.cpp:
     13        (WebCore::CSSMutableStyleDeclaration::getPropertyValue):
     14        * css/CSSParser.cpp:
     15        (WebCore::CSSParser::parseValue):
     16        * css/CSSProperty.cpp:
     17        (WebCore::CSSProperty::isInheritedProperty):
     18        * css/CSSPropertyLonghand.cpp:
     19        (WebCore::initShorthandMap):
     20        * css/CSSPropertyNames.in:
     21        * css/CSSStyleApplyProperty.cpp:
     22        (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
     23        * css/CSSStyleSelector.cpp:
     24        (WebCore::CSSStyleSelector::applyProperty):
     25
    1262011-11-23  Alexandru Chiculita  <achicu@adobe.com>
    227
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r101048 r101078  
    20592059        case CSSPropertyWebkitRegionOverflow:
    20602060            return primitiveValueCache->createValue(style->regionOverflow());
     2061        case CSSPropertyWebkitWrapFlow:
     2062            return primitiveValueCache->createValue(style->wrapFlow());
    20612063        case CSSPropertyWebkitWrapMargin:
    20622064            return primitiveValueCache->createValue(style->wrapMargin());
    20632065        case CSSPropertyWebkitWrapPadding:
    20642066            return primitiveValueCache->createValue(style->wrapPadding());
     2067        case CSSPropertyWebkitWrapShapeInside:
     2068            if (!style->wrapShapeInside())
     2069                return primitiveValueCache->createIdentifierValue(CSSValueAuto);
     2070            return primitiveValueCache->createValue(style->wrapShapeInside());
     2071        case CSSPropertyWebkitWrapShapeOutside:
     2072            if (!style->wrapShapeOutside())
     2073                return primitiveValueCache->createIdentifierValue(CSSValueAuto);
     2074            return primitiveValueCache->createValue(style->wrapShapeOutside());
     2075        case CSSPropertyWebkitWrapThrough:
     2076            return primitiveValueCache->createValue(style->wrapThrough());
    20652077#if ENABLE(CSS_FILTERS)
    20662078        case CSSPropertyWebkitFilter:
     
    21732185        case CSSPropertyWebkitTransformOriginZ:
    21742186        case CSSPropertyWebkitTransition:
    2175             break;
    2176 
    2177         case CSSPropertyWebkitWrapShapeInside:
    2178             if (!style->wrapShapeInside())
    2179                 return primitiveValueCache->createIdentifierValue(CSSValueAuto);
    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());
    2186 
    2187         case CSSPropertyWebkitWrapFlow:
    2188             return primitiveValueCache->createValue(style->wrapFlow());
    2189         case CSSPropertyWebkitWrapThrough:
    2190             return primitiveValueCache->createValue(style->wrapThrough());
     2187        case CSSPropertyWebkitWrap:
     2188            break;
     2189
    21912190#if ENABLE(SVG)
    21922191        case CSSPropertyClipPath:
  • trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp

    r101066 r101078  
    248248                                        CSSPropertyWebkitAnimationFillMode };
    249249            return getLayeredShorthandValue(properties);
     250        }
     251        case CSSPropertyWebkitWrap: {
     252            const int properties[3] = { CSSPropertyWebkitWrapFlow, CSSPropertyWebkitWrapMargin,
     253                CSSPropertyWebkitWrapPadding };
     254            return getShorthandValue(properties);
    250255        }
    251256#if ENABLE(SVG)
  • trunk/Source/WebCore/css/CSSParser.cpp

    r101048 r101078  
    22162216        validPrimitive = (!id && validUnit(value, FLength | FNonNeg, m_strict));
    22172217        break;
     2218    case CSSPropertyWebkitWrap: {
     2219        const int properties[] = { CSSPropertyWebkitWrapFlow, CSSPropertyWebkitWrapMargin, CSSPropertyWebkitWrapPadding };
     2220        return parseShorthand(propId, properties, WTF_ARRAY_LENGTH(properties), important);
     2221    }
    22182222#if ENABLE(SVG)
    22192223    default:
  • trunk/Source/WebCore/css/CSSProperty.cpp

    r101048 r101078  
    627627    case CSSPropertyWebkitFlowFrom:
    628628    case CSSPropertyWebkitRegionOverflow:
    629     case CSSPropertyWebkitWrapShapeInside:
    630     case CSSPropertyWebkitWrapShapeOutside:
    631     case CSSPropertyWebkitWrapMargin:
    632     case CSSPropertyWebkitWrapPadding:
    633629    case CSSPropertyWebkitRegionBreakAfter:
    634630    case CSSPropertyWebkitRegionBreakBefore:
    635631    case CSSPropertyWebkitRegionBreakInside:
     632    case CSSPropertyWebkitWrap:
    636633    case CSSPropertyWebkitWrapFlow:
     634    case CSSPropertyWebkitWrapMargin:
     635    case CSSPropertyWebkitWrapPadding:
     636    case CSSPropertyWebkitWrapShapeInside:
     637    case CSSPropertyWebkitWrapShapeOutside:
    637638    case CSSPropertyWebkitWrapThrough:
    638639#if ENABLE(SVG)
  • trunk/Source/WebCore/css/CSSPropertyLonghand.cpp

    r100273 r101078  
    135135    SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyPadding, paddingProperties);
    136136
     137    static const int webkitWrapProperties[] = {
     138        CSSPropertyWebkitWrapFlow,
     139        CSSPropertyWebkitWrapMargin,
     140        CSSPropertyWebkitWrapPadding
     141    };
     142    SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyWebkitWrap, webkitWrapProperties);
     143
    137144    static const int textStrokeProperties[] = { CSSPropertyWebkitTextStrokeColor, CSSPropertyWebkitTextStrokeWidth };
    138145    SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyWebkitTextStroke, textStrokeProperties);
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r101048 r101078  
    364364-webkit-wrap-flow
    365365-webkit-wrap-through
     366-webkit-wrap
    366367#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
    367368-webkit-tap-highlight-color
  • trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp

    r100656 r101078  
    10881088    setPropertyHandler(CSSPropertyWebkitWrapMargin, ApplyPropertyLength<&RenderStyle::wrapMargin, &RenderStyle::setWrapMargin, &RenderStyle::initialWrapMargin>::createHandler());
    10891089    setPropertyHandler(CSSPropertyWebkitWrapPadding, ApplyPropertyLength<&RenderStyle::wrapPadding, &RenderStyle::setWrapPadding, &RenderStyle::initialWrapPadding>::createHandler());
     1090    setPropertyHandler(CSSPropertyWebkitWrapFlow, ApplyPropertyDefault<WrapFlow, &RenderStyle::wrapFlow, WrapFlow, &RenderStyle::setWrapFlow, WrapFlow, &RenderStyle::initialWrapFlow>::createHandler());
     1091    setPropertyHandler(CSSPropertyWebkitWrapThrough, ApplyPropertyDefault<WrapThrough, &RenderStyle::wrapThrough, WrapThrough, &RenderStyle::setWrapThrough, WrapThrough, &RenderStyle::initialWrapThrough>::createHandler());
     1092    setPropertyHandler(CSSPropertyWebkitWrap, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitWrapFlow, CSSPropertyWebkitWrapMargin, CSSPropertyWebkitWrapPadding>::createHandler());
    10901093
    10911094    setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r101066 r101078  
    38793879        else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_SHAPE)
    38803880            m_style->setWrapShapeOutside(primitiveValue->getShapeValue());
    3881         return;
    3882 
    3883     case CSSPropertyWebkitWrapFlow:
    3884         HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(wrapFlow, WrapFlow);
    3885         return;
    3886 
    3887     case CSSPropertyWebkitWrapThrough:
    3888         HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(wrapThrough, WrapThrough);
    38893881        return;
    38903882
     
    40684060    case CSSPropertyWebkitWrapMargin:
    40694061    case CSSPropertyWebkitWrapPadding:
     4062    case CSSPropertyWebkitWrapFlow:
     4063    case CSSPropertyWebkitWrapThrough:
     4064    case CSSPropertyWebkitWrap:
    40704065    case CSSPropertyZIndex:
    40714066        ASSERT_NOT_REACHED();
Note: See TracChangeset for help on using the changeset viewer.