Changeset 135314 in webkit


Ignore:
Timestamp:
Nov 20, 2012 2:39:38 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Exclusions] Support outside-shape value on shape-inside
https://bugs.webkit.org/show_bug.cgi?id=101108

Patch by Bear Travis <betravis@adobe.com> on 2012-11-20
Reviewed by Dirk Schulze.

Source/WebCore:

Shape-inside can potentially be: 'auto' | 'outside-shape' | <shape> | <url>.
Webkit currently supports the value 'auto' (null) and <shape> (a BasicShape*).
This patch adds support for the value 'outside-shape.' It adds the ExclusionShapeValue
class, which may be any of the three values: 'auto', 'outside-shape', or <shape>.
Bug 102738 tracks adding <url> support.

Modifying existing tests:
LayoutTests/fast/exclusions/parsing-wrap-shape-inside.html
LayoutTests/fast/exclusions/parsing-wrap-shape-outside.html

  • GNUmakefile.list.am: Adding ExclusionShapeValue.h to the build files.
  • Target.pri: Ditto.
  • WebCore.gypi: Ditto.
  • WebCore.vcproj/WebCore.vcproj: Ditto.
  • WebCore.xcodeproj/project.pbxproj: Ditto.

(WebCore):

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Modifying code to use
ExclusionShapeValue* rather than the previous BasicShape* values.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue): Handle the outside-shape value.

  • css/CSSValueKeywords.in: Adding outside-shape value.
  • css/StyleBuilder.cpp:

(WebCore):
(WebCore::ApplyPropertyExclusionShape::setValue): Modify code to use
ExclusionShapeValue* rather than BasicShape*.
(WebCore::ApplyPropertyExclusionShape::applyValue): Ditto.
(WebCore::ApplyPropertyExclusionShape::createHandler): Ditto.

  • page/animation/CSSPropertyAnimation.cpp: Ditto.

(WebCore::blendFunc): Ditto.
(WebCore::PropertyWrapperExclusionShape::PropertyWrapperExclusionShape): Ditto.
(WebCore::CSSPropertyAnimation::ensurePropertyMap): Ditto.

  • rendering/ExclusionShapeInsideInfo.cpp:

(WebCore::ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock):
Ditto.
(WebCore::ExclusionShapeInsideInfo::computeShapeSize): Ditto.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange): Ditto.

  • rendering/RenderBlock.h:

(RenderBlock):

  • rendering/style/ExclusionShapeValue.h: Added.

(WebCore):
(ExclusionShapeValue): New type to represent the possible values of shape-inside
and shape-outside. Only shape-inside can have a value of 'outside-shape.'
(WebCore::ExclusionShapeValue::~ExclusionShapeValue):
(WebCore::ExclusionShapeValue::type): Returns the value type.
(WebCore::ExclusionShapeValue::shape): Returns <shape> value's BasicShape*.
(WebCore::ExclusionShapeValue::operator==):
(WebCore::ExclusionShapeInfo::createShapeValue):
(WebCore::ExclusionShapeInfo::createOutsideValue):
(WebCore::ExclusionShapeValue::ExclusionShapeValue):

  • rendering/style/RenderStyle.h:
  • rendering/style/StyleRareNonInheritedData.h:

(StyleRareNonInheritedData):

LayoutTests:

Adding tests to make sure the 'outside-shape' value properly applies only to the
shape-inside property.

  • 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:
  • fast/exclusions/script-tests/parsing-wrap-shape-outside.js:
Location:
trunk
Files:
1 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r135311 r135314  
     12012-11-20  Bear Travis  <betravis@adobe.com>
     2
     3        [CSS Exclusions] Support outside-shape value on shape-inside
     4        https://bugs.webkit.org/show_bug.cgi?id=101108
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Adding tests to make sure the 'outside-shape' value properly applies only to the
     9        shape-inside property.
     10
     11        * fast/exclusions/parsing-wrap-shape-inside-expected.txt:
     12        * fast/exclusions/parsing-wrap-shape-outside-expected.txt:
     13        * fast/exclusions/script-tests/parsing-wrap-shape-inside.js:
     14        * fast/exclusions/script-tests/parsing-wrap-shape-outside.js:
     15
    1162012-11-20  Jian Li  <jianli@chromium.org>
    217
  • trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-inside-expected.txt

    r113400 r135314  
    66PASS testCSSText("auto") is "auto"
    77PASS testComputedStyle("auto") is "auto"
     8PASS testCSSText("outside-shape") is "outside-shape"
     9PASS testComputedStyle("outside-shape") is "outside-shape"
    810PASS testCSSText("rectangle(10px, 20px, 30px, 40px)") is "rectangle(10px, 20px, 30px, 40px)"
    911PASS testComputedStyle("rectangle(10px, 20px, 30px, 40px)") is "rectangle(10px, 20px, 30px, 40px)"
     
    2325PASS testComputedStyle("polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
    2426PASS testNotInherited("auto", "rectangle(10px, 20px, 30px, 40px)") is "parent: auto, child: rectangle(10px, 20px, 30px, 40px)"
     27PASS testNotInherited("outside-shape", "rectangle(10px, 20px, 30px, 40px)") is "parent: outside-shape, child: rectangle(10px, 20px, 30px, 40px)"
    2528PASS testNotInherited("rectangle(10px, 20px, 30px, 40px)", "initial") is "parent: rectangle(10px, 20px, 30px, 40px), child: auto"
    2629PASS testNotInherited("rectangle(10px, 20px, 30px, 40px)", "") is "parent: rectangle(10px, 20px, 30px, 40px), child: auto"
  • trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-outside-expected.txt

    r113400 r135314  
    3232PASS testCSSText("none") is ""
    3333PASS testComputedStyle("none") is "auto"
     34PASS testCSSText("outside-shape") is ""
     35PASS testComputedStyle("outside-shape") is "auto"
    3436PASS testCSSText("rectangle()") is ""
    3537PASS testComputedStyle("rectangle()") is "auto"
  • trunk/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js

    r127241 r135314  
    5959
    6060test("auto", "auto");
     61test("outside-shape", "outside-shape");
    6162test("rectangle(10px, 20px, 30px, 40px)", "rectangle(10px, 20px, 30px, 40px)");
    6263test("rectangle(10px, 20px, 30px, 40px, 5px)", "rectangle(10px, 20px, 30px, 40px, 5px)");
     
    7273
    7374shouldBeEqualToString('testNotInherited("auto", "rectangle(10px, 20px, 30px, 40px)")', "parent: auto, child: rectangle(10px, 20px, 30px, 40px)");
     75shouldBeEqualToString('testNotInherited("outside-shape", "rectangle(10px, 20px, 30px, 40px)")', "parent: outside-shape, child: rectangle(10px, 20px, 30px, 40px)");
    7476shouldBeEqualToString('testNotInherited("rectangle(10px, 20px, 30px, 40px)", "initial")', "parent: rectangle(10px, 20px, 30px, 40px), child: auto");
    7577shouldBeEqualToString('testNotInherited("rectangle(10px, 20px, 30px, 40px)", "")', "parent: rectangle(10px, 20px, 30px, 40px), child: auto");
  • trunk/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-outside.js

    r127241 r135314  
    8282negative_test("calc()");
    8383negative_test("none");
     84negative_test("outside-shape");
    8485
    8586negative_test("rectangle()");
  • trunk/Source/WebCore/ChangeLog

    r135313 r135314  
     12012-11-20  Bear Travis  <betravis@adobe.com>
     2
     3        [CSS Exclusions] Support outside-shape value on shape-inside
     4        https://bugs.webkit.org/show_bug.cgi?id=101108
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Shape-inside can potentially be: 'auto' | 'outside-shape' | <shape> | <url>.
     9        Webkit currently supports the value 'auto' (null) and <shape> (a BasicShape*).
     10        This patch adds support for the value 'outside-shape.' It adds the ExclusionShapeValue
     11        class, which may be any of the three values: 'auto', 'outside-shape', or <shape>.
     12        Bug 102738 tracks adding <url> support.
     13
     14        Modifying existing tests:
     15        LayoutTests/fast/exclusions/parsing-wrap-shape-inside.html
     16        LayoutTests/fast/exclusions/parsing-wrap-shape-outside.html
     17
     18        * GNUmakefile.list.am: Adding ExclusionShapeValue.h to the build files.
     19        * Target.pri: Ditto.
     20        * WebCore.gypi: Ditto.
     21        * WebCore.vcproj/WebCore.vcproj: Ditto.
     22        * WebCore.xcodeproj/project.pbxproj: Ditto.
     23        (WebCore):
     24        * css/CSSComputedStyleDeclaration.cpp:
     25        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Modifying code to use
     26        ExclusionShapeValue* rather than the previous BasicShape* values.
     27        * css/CSSParser.cpp:
     28        (WebCore::CSSParser::parseValue): Handle the outside-shape value.
     29        * css/CSSValueKeywords.in: Adding outside-shape value.
     30        * css/StyleBuilder.cpp:
     31        (WebCore):
     32        (WebCore::ApplyPropertyExclusionShape::setValue): Modify code to use
     33        ExclusionShapeValue* rather than BasicShape*.
     34        (WebCore::ApplyPropertyExclusionShape::applyValue): Ditto.
     35        (WebCore::ApplyPropertyExclusionShape::createHandler): Ditto.
     36        * page/animation/CSSPropertyAnimation.cpp: Ditto.
     37        (WebCore::blendFunc): Ditto.
     38        (WebCore::PropertyWrapperExclusionShape::PropertyWrapperExclusionShape): Ditto.
     39        (WebCore::CSSPropertyAnimation::ensurePropertyMap): Ditto.
     40        * rendering/ExclusionShapeInsideInfo.cpp:
     41        (WebCore::ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock):
     42        Ditto.
     43        (WebCore::ExclusionShapeInsideInfo::computeShapeSize): Ditto.
     44        * rendering/RenderBlock.cpp:
     45        (WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange): Ditto.
     46        * rendering/RenderBlock.h:
     47        (RenderBlock):
     48        * rendering/style/ExclusionShapeValue.h: Added.
     49        (WebCore):
     50        (ExclusionShapeValue): New type to represent the possible values of shape-inside
     51        and shape-outside. Only shape-inside can have a value of 'outside-shape.'
     52        (WebCore::ExclusionShapeValue::~ExclusionShapeValue):
     53        (WebCore::ExclusionShapeValue::type): Returns the value type.
     54        (WebCore::ExclusionShapeValue::shape): Returns <shape> value's BasicShape*.
     55        (WebCore::ExclusionShapeValue::operator==):
     56        (WebCore::ExclusionShapeInfo::createShapeValue):
     57        (WebCore::ExclusionShapeInfo::createOutsideValue):
     58        (WebCore::ExclusionShapeValue::ExclusionShapeValue):
     59        * rendering/style/RenderStyle.h:
     60        * rendering/style/StyleRareNonInheritedData.h:
     61        (StyleRareNonInheritedData):
     62
    1632012-11-20  Alpha Lam  <hclam@chromium.org>
    264
  • trunk/Source/WebCore/GNUmakefile.list.am

    r135310 r135314  
    44384438        Source/WebCore/rendering/style/CursorList.h \
    44394439        Source/WebCore/rendering/style/DataRef.h \
     4440        Source/WebCore/rendering/style/ExclusionShapeValue.h \
    44404441        Source/WebCore/rendering/style/FillLayer.cpp \
    44414442        Source/WebCore/rendering/style/FillLayer.h \
  • trunk/Source/WebCore/Target.pri

    r135310 r135314  
    24472447    rendering/style/CursorData.h \
    24482448    rendering/style/CursorList.h \
     2449    rendering/style/ExclusionShapeValue.h \
    24492450    rendering/style/FillLayer.h \
    24502451    rendering/style/KeyframeList.h \
  • trunk/Source/WebCore/WebCore.gypi

    r135310 r135314  
    598598            'rendering/style/CursorList.h',
    599599            'rendering/style/DataRef.h',
     600            'rendering/style/ExclusionShapeValue.h',
    600601            'rendering/style/FillLayer.h',
    601602            'rendering/style/GridPosition.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r135310 r135314  
    4544445444                                </File>
    4544545445                                <File
     45446                                    RelativePath="..\rendering\style\ExclusionShapeValue.h"
     45447                                    >
     45448                                </File>
     45449                                <File
    4544645450                                        RelativePath="..\rendering\style\FillLayer.cpp"
    4544745451                                        >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r135310 r135314  
    63886388                FD06DFA6134A4DEF006F5D7D /* DefaultAudioDestinationNode.h in Headers */ = {isa = PBXBuildFile; fileRef = FD06DFA4134A4DEF006F5D7D /* DefaultAudioDestinationNode.h */; };
    63896389                FD1660A513787C6D001FFA7B /* DenormalDisabler.h in Headers */ = {isa = PBXBuildFile; fileRef = FD1660A413787C6D001FFA7B /* DenormalDisabler.h */; };
     6390                FD1AF1501656F15100C6D4F7 /* ExclusionShapeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = FD1AF14E1656F12100C6D4F7 /* ExclusionShapeValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
    63906391                FD23A12513F5FA5900F67001 /* JSMediaElementAudioSourceNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD23A12313F5FA5900F67001 /* JSMediaElementAudioSourceNode.cpp */; };
    63916392                FD23A12613F5FA5900F67001 /* JSMediaElementAudioSourceNode.h in Headers */ = {isa = PBXBuildFile; fileRef = FD23A12413F5FA5900F67001 /* JSMediaElementAudioSourceNode.h */; };
     
    1387613877                FD06DFA4134A4DEF006F5D7D /* DefaultAudioDestinationNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DefaultAudioDestinationNode.h; sourceTree = "<group>"; };
    1387713878                FD1660A413787C6D001FFA7B /* DenormalDisabler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DenormalDisabler.h; sourceTree = "<group>"; };
     13879                FD1AF14E1656F12100C6D4F7 /* ExclusionShapeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExclusionShapeValue.h; path = style/ExclusionShapeValue.h; sourceTree = "<group>"; };
    1387813880                FD23A12313F5FA5900F67001 /* JSMediaElementAudioSourceNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaElementAudioSourceNode.cpp; sourceTree = "<group>"; };
    1387913881                FD23A12413F5FA5900F67001 /* JSMediaElementAudioSourceNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaElementAudioSourceNode.h; sourceTree = "<group>"; };
     
    2063120633                                BC2272AC0E82E8F300E7F975 /* CursorList.h */,
    2063220634                                BC22746E0E83664500E7F975 /* DataRef.h */,
     20635                                FD1AF14E1656F12100C6D4F7 /* ExclusionShapeValue.h */,
    2063320636                                BC5EB69C0E81DAEB00B25965 /* FillLayer.cpp */,
    2063420637                                BC5EB69D0E81DAEB00B25965 /* FillLayer.h */,
     
    2245822461                        buildActionMask = 2147483647;
    2245922462                        files = (
     22463                                FD1AF1501656F15100C6D4F7 /* ExclusionShapeValue.h in Headers */,
    2246022464                                BC7FA6210D1F0CBD00DB22A9 /* DynamicNodeList.h in Headers */,
    2246122465                                A81369DA097374F600D74463 /* HTMLOptionsCollection.h in Headers */,
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r135164 r135314  
    6464#include "WebKitFontFamilyNames.h"
    6565#include <wtf/text/StringBuilder.h>
     66
     67#if ENABLE(CSS_EXCLUSIONS)
     68#include "ExclusionShapeValue.h"
     69#endif
    6670
    6771#if ENABLE(CSS_SHADERS)
     
    25052509            if (!style->shapeInside())
    25062510                return cssValuePool().createIdentifierValue(CSSValueAuto);
    2507             return valueForBasicShape(style->shapeInside());
     2511            else if (style->shapeInside()->type() == ExclusionShapeValue::OUTSIDE)
     2512                return cssValuePool().createIdentifierValue(CSSValueOutsideShape);
     2513            ASSERT(style->shapeInside()->type() == ExclusionShapeValue::SHAPE);
     2514            return valueForBasicShape(style->shapeInside()->shape());
    25082515        case CSSPropertyWebkitShapeOutside:
    25092516            if (!style->shapeOutside())
    25102517                return cssValuePool().createIdentifierValue(CSSValueAuto);
    2511             return valueForBasicShape(style->shapeOutside());
     2518            ASSERT(style->shapeOutside()->type() == ExclusionShapeValue::SHAPE);
     2519            return valueForBasicShape(style->shapeOutside()->shape());
    25122520        case CSSPropertyWebkitWrapThrough:
    25132521            return cssValuePool().createValue(style->wrapThrough());
  • trunk/Source/WebCore/css/CSSParser.cpp

    r135136 r135314  
    27352735            return false;
    27362736        if (id == CSSValueAuto)
     2737            validPrimitive = true;
     2738        else if (propId == CSSPropertyWebkitShapeInside && id == CSSValueOutsideShape)
    27372739            validPrimitive = true;
    27382740        else if (value->unit == CSSParserValue::Function)
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r133458 r135314  
    915915-webkit-optimize-contrast
    916916
    917 // -webkit-wrap-shape
     917// -webkit-shape-inside
     918// -webkit-shape-outside
    918919nonzero
    919920evenodd
     921outside-shape
    920922
    921923// -webkit-region-overflow
  • trunk/Source/WebCore/css/StyleBuilder.cpp

    r134433 r135314  
    4747#include <wtf/StdLibExtras.h>
    4848#include <wtf/UnusedParam.h>
     49
     50#if ENABLE(CSS_EXCLUSIONS)
     51#include "ExclusionShapeValue.h"
     52#endif
    4953
    5054using namespace std;
     
    17171721
    17181722#if ENABLE(CSS_EXCLUSIONS)
    1719 template <BasicShape* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<BasicShape>), BasicShape* (*initialFunction)()>
     1723template <ExclusionShapeValue* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<ExclusionShapeValue>), ExclusionShapeValue* (*initialFunction)()>
    17201724class ApplyPropertyExclusionShape {
    17211725public:
    1722     static void setValue(RenderStyle* style, PassRefPtr<BasicShape> value) { (style->*setterFunction)(value); }
     1726    static void setValue(RenderStyle* style, PassRefPtr<ExclusionShapeValue> value) { (style->*setterFunction)(value); }
    17231727    static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
    17241728    {
     
    17271731            if (primitiveValue->getIdent() == CSSValueAuto)
    17281732                setValue(styleResolver->style(), 0);
     1733            // FIXME Bug 102571: Layout for the value 'outside-shape' is not yet implemented
     1734            else if (primitiveValue->getIdent() == CSSValueOutsideShape)
     1735                setValue(styleResolver->style(), ExclusionShapeValue::createOutsideValue());
    17291736            else if (primitiveValue->isShape()) {
    1730                 RefPtr<BasicShape> shape = basicShapeForValue(styleResolver, primitiveValue->getShapeValue());
     1737                RefPtr<ExclusionShapeValue> shape = ExclusionShapeValue::createShapeValue(basicShapeForValue(styleResolver, primitiveValue->getShapeValue()));
    17311738                setValue(styleResolver->style(), shape.release());
    17321739            }
     
    17351742    static PropertyHandler createHandler()
    17361743    {
    1737         PropertyHandler handler = ApplyPropertyDefaultBase<BasicShape*, getterFunction, PassRefPtr<BasicShape>, setterFunction, BasicShape*, initialFunction>::createHandler();
     1744        PropertyHandler handler = ApplyPropertyDefaultBase<ExclusionShapeValue*, getterFunction, PassRefPtr<ExclusionShapeValue>, setterFunction, ExclusionShapeValue*, initialFunction>::createHandler();
    17381745        return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
    17391746    }
  • trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp

    r134736 r135314  
    144144
    145145#if ENABLE(CSS_EXCLUSIONS)
    146 static inline PassRefPtr<BasicShape> blendFunc(const AnimationBase*, BasicShape* from, BasicShape* to, double progress)
    147 {
    148     if (!from->canBlend(to))
     146static inline PassRefPtr<ExclusionShapeValue> blendFunc(const AnimationBase*, ExclusionShapeValue* from, ExclusionShapeValue* to, double progress)
     147{
     148    // FIXME Bug 102723: Shape-inside should be able to animate a value of 'outside-shape' when shape-outside is set to a BasicShape
     149    if (from->type() != ExclusionShapeValue::SHAPE || to->type() != ExclusionShapeValue::SHAPE)
    149150        return to;
    150151
    151     return to->blend(from, progress);
     152    const BasicShape* fromShape = from->shape();
     153    const BasicShape* toShape = to->shape();
     154
     155    if (!fromShape->canBlend(toShape))
     156        return to;
     157
     158    return ExclusionShapeValue::createShapeValue(toShape->blend(fromShape, progress));
    152159}
    153160#endif
     
    405412
    406413#if ENABLE(CSS_EXCLUSIONS)
    407 class PropertyWrapperBasicShape : public RefCountedPropertyWrapper<BasicShape> {
    408 public:
    409     PropertyWrapperBasicShape(CSSPropertyID prop, BasicShape* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(PassRefPtr<BasicShape>))
    410         : RefCountedPropertyWrapper<BasicShape>(prop, getter, setter)
     414class PropertyWrapperExclusionShape : public RefCountedPropertyWrapper<ExclusionShapeValue> {
     415public:
     416    PropertyWrapperExclusionShape(CSSPropertyID prop, ExclusionShapeValue* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(PassRefPtr<ExclusionShapeValue>))
     417        : RefCountedPropertyWrapper<ExclusionShapeValue>(prop, getter, setter)
    411418    {
    412419    }
     
    11631170
    11641171#if ENABLE(CSS_EXCLUSIONS)
    1165     gPropertyWrappers->append(new PropertyWrapperBasicShape(CSSPropertyWebkitShapeInside, &RenderStyle::shapeInside, &RenderStyle::setShapeInside));
     1172    gPropertyWrappers->append(new PropertyWrapperExclusionShape(CSSPropertyWebkitShapeInside, &RenderStyle::shapeInside, &RenderStyle::setShapeInside));
    11661173#endif
    11671174
  • trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.cpp

    r132127 r135314  
    7373{
    7474    // FIXME: Bug 89707: Enable shape inside for non-rectangular shapes
    75     BasicShape* shape = block->style()->shapeInside();
     75    ExclusionShapeValue* shapeValue = block->style()->shapeInside();
     76    BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue::SHAPE) ? shapeValue->shape() : 0;
    7677    return shape && (shape->type() == BasicShape::BASIC_SHAPE_RECTANGLE || shape->type() == BasicShape::BASIC_SHAPE_POLYGON);
    7778}
     
    9495
    9596    // FIXME: Bug 89993: The wrap shape may come from the parent object
    96     BasicShape* shape = m_block->style()->shapeInside();
     97    ExclusionShapeValue* shapeValue = m_block->style()->shapeInside();
     98    BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue::SHAPE) ? shapeValue->shape() : 0;
     99
    97100    ASSERT(shape);
    98101
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r134505 r135314  
    13991399
    14001400#if ENABLE(CSS_EXCLUSIONS)
    1401 void RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape* shapeInside, const BasicShape* oldShapeInside)
     1401void RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange(const ExclusionShapeValue* shapeInside, const ExclusionShapeValue* oldShapeInside)
    14021402{
    14031403    // FIXME: A future optimization would do a deep comparison for equality.
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r133845 r135314  
    3737#if ENABLE(CSS_EXCLUSIONS)
    3838#include "ExclusionShapeInsideInfo.h"
     39#include "ExclusionShapeValue.h"
    3940#endif
    4041
     
    522523#if ENABLE(CSS_EXCLUSIONS)
    523524    void computeExclusionShapeSize();
    524     void updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape*, const BasicShape* oldWrapShape);
     525    void updateExclusionShapeInsideInfoAfterStyleChange(const ExclusionShapeValue*, const ExclusionShapeValue* oldExclusionShape);
    525526#endif
    526527    virtual RenderObjectChildList* virtualChildren() { return children(); }
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r135164 r135314  
    3535#include "CounterDirectives.h"
    3636#include "DataRef.h"
     37#include "ExclusionShapeValue.h"
    3738#include "FontBaseline.h"
    3839#include "FontDescription.h"
     
    14561457#endif
    14571458
    1458     void setShapeInside(PassRefPtr<BasicShape> shape)
    1459     {
    1460         if (rareNonInheritedData->m_shapeInside != shape)
    1461             rareNonInheritedData.access()->m_shapeInside = shape;
    1462     }
    1463     BasicShape* shapeInside() const { return rareNonInheritedData->m_shapeInside.get(); }
    1464 
    1465     void setShapeOutside(PassRefPtr<BasicShape> shape)
    1466     {
    1467         if (rareNonInheritedData->m_shapeOutside != shape)
    1468             rareNonInheritedData.access()->m_shapeOutside = shape;
    1469     }
    1470     BasicShape* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
    1471 
    1472     static BasicShape* initialShapeInside() { return 0; }
    1473     static BasicShape* initialShapeOutside() { return 0; }
     1459    void setShapeInside(PassRefPtr<ExclusionShapeValue> value)
     1460    {
     1461        if (rareNonInheritedData->m_shapeInside == value)
     1462            return;
     1463        rareNonInheritedData.access()->m_shapeInside = value;
     1464    }
     1465    ExclusionShapeValue* shapeInside() const { return rareNonInheritedData->m_shapeInside.get(); }
     1466
     1467    void setShapeOutside(PassRefPtr<ExclusionShapeValue> value)
     1468    {
     1469        if (rareNonInheritedData->m_shapeOutside == value)
     1470            return;
     1471        rareNonInheritedData.access()->m_shapeOutside = value;
     1472    }
     1473    ExclusionShapeValue* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
     1474
     1475    static ExclusionShapeValue* initialShapeInside() { return 0; }
     1476    static ExclusionShapeValue* initialShapeOutside() { return 0; }
    14741477
    14751478    void setClipPath(PassRefPtr<ClipPathOperation> operation)
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r134433 r135314  
    3131#include "CursorData.h"
    3232#include "DataRef.h"
     33#include "ExclusionShapeValue.h"
    3334#include "FillLayer.h"
    3435#include "LineClampValue.h"
     
    138139    LengthSize m_pageSize;
    139140
    140     RefPtr<BasicShape> m_shapeInside;
    141     RefPtr<BasicShape> m_shapeOutside;
     141    RefPtr<ExclusionShapeValue> m_shapeInside;
     142    RefPtr<ExclusionShapeValue> m_shapeOutside;
    142143    Length m_shapeMargin;
    143144    Length m_shapePadding;
Note: See TracChangeset for help on using the changeset viewer.