⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 169904 in webkit


Ignore:
Timestamp:
Jun 12, 2014, 11:50:18 AM (12 years ago)
Author:
andersca@apple.com
Message:

Add ShapeValue.cpp and move ShapeValue::isImageValid() there
​https://bugs.webkit.org/show_bug.cgi?id=133809

Reviewed by Antti Koivisto.

This gets rid of CachedImage.h (and ResourceRequest and friends) from RenderStyle.h.

  • CMakeLists.txt:
  • WebCore.vcxproj/WebCore.vcxproj:
  • WebCore.vcxproj/WebCore.vcxproj.filters:
  • WebCore.xcodeproj/project.pbxproj:
  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::shapePropertyValue):

  • css/CSSCrossfadeValue.cpp:
  • css/CSSFilterImageValue.cpp:
  • css/StyleResolver.h:
  • page/animation/CSSPropertyAnimation.cpp:

(WebCore::blendFunc):

  • rendering/ShapeValue.cpp: Added.

(WebCore::ShapeValue::isImageValid):

  • rendering/shapes/ShapeOutsideInfo.cpp:

(WebCore::referenceBox):
(WebCore::ShapeOutsideInfo::computedShape):
(WebCore::ShapeOutsideInfo::isEnabledFor):

  • rendering/style/ShapeValue.h:

(WebCore::ShapeValue::type):
(WebCore::ShapeValue::setImage):
(WebCore::ShapeValue::ShapeValue):
(WebCore::ShapeValue::isImageValid): Deleted.

Location:
trunk/Source/WebCore
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r169841 r169904  
    23952395    rendering/style/SVGRenderStyleDefs.cpp
    23962396    rendering/style/ShadowData.cpp
     2397    rendering/style/ShapeValue.cpp
    23972398    rendering/style/StyleBackgroundData.cpp
    23982399    rendering/style/StyleBoxData.cpp
  • trunk/Source/WebCore/ChangeLog

    r169898 r169904  
     12014-06-12  Anders Carlsson  <andersca@apple.com>
     2
     3        Add ShapeValue.cpp and move ShapeValue::isImageValid() there
     4        https://bugs.webkit.org/show_bug.cgi?id=133809
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This gets rid of CachedImage.h (and ResourceRequest and friends) from RenderStyle.h.
     9
     10        * CMakeLists.txt:
     11        * WebCore.vcxproj/WebCore.vcxproj:
     12        * WebCore.vcxproj/WebCore.vcxproj.filters:
     13        * WebCore.xcodeproj/project.pbxproj:
     14        * css/CSSComputedStyleDeclaration.cpp:
     15        (WebCore::shapePropertyValue):
     16        * css/CSSCrossfadeValue.cpp:
     17        * css/CSSFilterImageValue.cpp:
     18        * css/StyleResolver.h:
     19        * page/animation/CSSPropertyAnimation.cpp:
     20        (WebCore::blendFunc):
     21        * rendering/ShapeValue.cpp: Added.
     22        (WebCore::ShapeValue::isImageValid):
     23        * rendering/shapes/ShapeOutsideInfo.cpp:
     24        (WebCore::referenceBox):
     25        (WebCore::ShapeOutsideInfo::computedShape):
     26        (WebCore::ShapeOutsideInfo::isEnabledFor):
     27        * rendering/style/ShapeValue.h:
     28        (WebCore::ShapeValue::type):
     29        (WebCore::ShapeValue::setImage):
     30        (WebCore::ShapeValue::ShapeValue):
     31        (WebCore::ShapeValue::isImageValid): Deleted.
     32
    1332014-06-12  Zalan Bujtas  <zalan@apple.com>
    234
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r169826 r169904  
    1154311543      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
    1154411544    </ClCompile>
     11545    <ClCompile Include="..\rendering\style\ShapeValue.cpp" />
    1154511546    <ClCompile Include="..\rendering\style\StyleAllInOne.cpp" />
    1154611547    <ClCompile Include="..\rendering\style\StyleBackgroundData.cpp">
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

    r169637 r169904  
    27912791      <Filter>rendering\style</Filter>
    27922792    </ClCompile>
     2793    <ClCompile Include="..\rendering\style\ShapeValue.cpp">
     2794      <Filter>rendering\style</Filter>
     2795    </ClCompile>
    27932796    <ClCompile Include="..\rendering\style\StyleAllInOne.cpp">
    27942797      <Filter>rendering\style</Filter>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r169826 r169904  
    792792                1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AB1AE790C051FDE00139F4F /* zoomOutCursor.png */; };
    793793                1AB33DA512551E320024457A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AB33DA412551E320024457A /* IOKit.framework */; };
     794                1AB5EBD0194A1D170059AC70 /* ShapeValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB5EBCF194A1D170059AC70 /* ShapeValue.cpp */; };
    794795                1AB7FC680A8B92EC00D9D37B /* XPathEvaluator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7FC470A8B92EC00D9D37B /* XPathEvaluator.cpp */; };
    795796                1AB7FC690A8B92EC00D9D37B /* XPathEvaluator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC480A8B92EC00D9D37B /* XPathEvaluator.h */; };
    … …  
    77187719                1AB1AE790C051FDE00139F4F /* zoomOutCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomOutCursor.png; sourceTree = "<group>"; };
    77197720                1AB33DA412551E320024457A /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
     7721                1AB5EBCF194A1D170059AC70 /* ShapeValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ShapeValue.cpp; path = style/ShapeValue.cpp; sourceTree = "<group>"; };
    77207722                1AB7FC470A8B92EC00D9D37B /* XPathEvaluator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = XPathEvaluator.cpp; sourceTree = "<group>"; };
    77217723                1AB7FC480A8B92EC00D9D37B /* XPathEvaluator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XPathEvaluator.h; sourceTree = "<group>"; };
    … …  
    2086920871                                BC5EB8C10E82031B00B25965 /* ShadowData.cpp */,
    2087020872                                BC5EB8C20E82031B00B25965 /* ShadowData.h */,
     20873                                1AB5EBCF194A1D170059AC70 /* ShapeValue.cpp */,
    2087120874                                FD1AF14E1656F12100C6D4F7 /* ShapeValue.h */,
    2087220875                                BC5EB6A00E81DC4F00B25965 /* StyleBackgroundData.cpp */,
    … …  
    2970329706                                CD8203111395ACE700F956C6 /* WebWindowAnimation.mm in Sources */,
    2970429707                                F55B3DDF1251F12D003EF269 /* WeekInputType.cpp in Sources */,
     29708                                1AB5EBD0194A1D170059AC70 /* ShapeValue.cpp in Sources */,
    2970529709                                85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */,
    2970629710                                93EC44A1188F4BB800661DF1 /* WheelEventDeltaTracker.cpp in Sources */,
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r169407 r169904  
    16231623        return cssValuePool().createIdentifierValue(CSSValueNone);
    16241624
    1625     if (shapeValue->type() == ShapeValue::Box)
     1625    if (shapeValue->type() == ShapeValue::Type::Box)
    16261626        return cssValuePool().createValue(shapeValue->cssBox());
    16271627
    1628     if (shapeValue->type() == ShapeValue::Image)
     1628    if (shapeValue->type() == ShapeValue::Type::Image)
    16291629        return shapeValue->image() ? shapeValue->image()->cssValue() : cssValuePool().createIdentifierValue(CSSValueNone);
    16301630
    1631     ASSERT(shapeValue->type() == ShapeValue::Shape);
     1631    ASSERT(shapeValue->type() == ShapeValue::Type::Shape);
    16321632
    16331633    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
  • trunk/Source/WebCore/css/CSSCrossfadeValue.cpp

    r166642 r169904  
    3030#include "AnimationUtilities.h"
    3131#include "CSSImageValue.h"
     32#include "CachedImage.h"
    3233#include "CachedResourceLoader.h"
    3334#include "CrossfadeGeneratedImage.h"
  • trunk/Source/WebCore/css/CSSFilterImageValue.cpp

    r166642 r169904  
    3131
    3232#include "CSSImageValue.h"
     33#include "CachedImage.h"
    3334#include "CachedResourceLoader.h"
    3435#include "CrossfadeGeneratedImage.h"
  • trunk/Source/WebCore/css/StyleResolver.h

    r169547 r169904  
    9191class ViewportStyleResolver;
    9292class WebKitCSSFilterValue;
     93struct ResourceLoaderOptions;
    9394
    9495class MediaQueryResult {
  • trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp

    r169333 r169904  
    146146        return to;
    147147
    148     if (from->type() != ShapeValue::Shape || to->type() != ShapeValue::Shape)
     148    if (from->type() != ShapeValue::Type::Shape || to->type() != ShapeValue::Type::Shape)
    149149        return to;
    150150
  • trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp

    r169606 r169904  
    7676{
    7777    if (shapeValue.cssBox() == BoxMissing) {
    78         if (shapeValue.type() == ShapeValue::Image)
     78        if (shapeValue.type() == ShapeValue::Type::Image)
    7979            return ContentBox;
    8080        return MarginBox;
    … …  
    176176
    177177    switch (shapeValue.type()) {
    178     case ShapeValue::Shape:
     178    case ShapeValue::Type::Shape:
    179179        ASSERT(shapeValue.shape());
    180180        m_shape = Shape::createShape(shapeValue.shape(), m_referenceBoxLogicalSize, writingMode, margin);
    181181        break;
    182     case ShapeValue::Image:
     182    case ShapeValue::Type::Image:
    183183        ASSERT(shapeValue.isImageValid());
    184184        m_shape = createShapeForImage(shapeValue.image(), shapeImageThreshold, writingMode, margin);
    185185        break;
    186     case ShapeValue::Box: {
     186    case ShapeValue::Type::Box: {
    187187        RoundedRect shapeRect = computeRoundedRectForBoxShape(referenceBox(shapeValue), m_renderer);
    188188        if (!containingBlockStyle.isHorizontalWritingMode())
    … …  
    295295
    296296    switch (shapeValue->type()) {
    297     case ShapeValue::Shape: return shapeValue->shape();
    298     case ShapeValue::Image: return shapeValue->isImageValid() && checkShapeImageOrigin(box.document(), *(shapeValue->image()));
    299     case ShapeValue::Box: return true;
     297    case ShapeValue::Type::Shape: return shapeValue->shape();
     298    case ShapeValue::Type::Image: return shapeValue->isImageValid() && checkShapeImageOrigin(box.document(), *(shapeValue->image()));
     299    case ShapeValue::Type::Box: return true;
    300300    }
    301301
  • trunk/Source/WebCore/rendering/style/ShapeValue.h

    r167518 r169904  
    3333#include "BasicShapes.h"
    3434#include "CSSValueKeywords.h"
    35 #include "CachedImage.h"
    3635#include "StyleImage.h"
    3736#include <wtf/PassRefPtr.h>
    … …  
    4140class ShapeValue : public RefCounted<ShapeValue> {
    4241public:
    43     enum ShapeValueType {
     42    enum class Type {
    4443        // The None value is defined by a null ShapeValue*
    4544        Shape,
    … …  
    6362    }
    6463
    65     ShapeValueType type() const { return m_type; }
     64    Type type() const { return m_type; }
    6665    BasicShape* shape() const { return m_shape.get(); }
    6766    CSSBoxType cssBox() const { return m_cssBox; }
    … …  
    6968    StyleImage* image() const { return m_image.get(); }
    7069
    71     bool isImageValid() const
    72     {
    73         if (!image())
    74             return false;
    75         if (image()->isCachedImage() || image()->isCachedImageSet())
    76             return image()->cachedImage() && image()->cachedImage()->hasImage();
    77         return image()->isGeneratedImage();
    78     }
     70    bool isImageValid() const;
    7971
    8072    void setImage(PassRefPtr<StyleImage> image)
    8173    {
    82         ASSERT(type() == Image);
     74        ASSERT(type() == Type::Image);
    8375        if (m_image != image)
    8476            m_image = image;
    … …  
    8981private:
    9082    ShapeValue(PassRefPtr<BasicShape> shape, CSSBoxType cssBox)
    91         : m_type(Shape)
     83        : m_type(Type::Shape)
    9284        , m_shape(shape)
    9385        , m_cssBox(cssBox)
    9486    {
    9587    }
    96     ShapeValue(ShapeValueType type)
     88    ShapeValue(Type type)
    9789        : m_type(type)
    9890        , m_cssBox(BoxMissing)
    … …  
    10092    }
    10193    ShapeValue(PassRefPtr<StyleImage> image)
    102         : m_type(Image)
     94        : m_type(Type::Image)
    10395        , m_image(image)
    10496        , m_cssBox(BoxMissing)
    10597    {
    10698    }
     99
    107100    ShapeValue(CSSBoxType cssBox)
    108         : m_type(Box)
     101        : m_type(Type::Box)
    109102        , m_cssBox(cssBox)
    110103    {
    111104    }
    112105
    113     ShapeValueType m_type;
     106    Type m_type;
    114107    RefPtr<BasicShape> m_shape;
    115108    RefPtr<StyleImage> m_image;
Note: See TracChangeset for help on using the changeset viewer.