| Differences between
and this patch
- a/Source/WebCore/ChangeLog +38 lines
Lines 1-5 a/Source/WebCore/ChangeLog_sec1
1
2014-02-09  Zan Dobersek  <zdobersek@igalia.com>
1
2014-02-09  Zan Dobersek  <zdobersek@igalia.com>
2
2
3
        Manage ShadowData through std::unique_ptr
4
        https://bugs.webkit.org/show_bug.cgi?id=128466
5
6
        Reviewed by Andreas Kling.
7
8
        Use std::unique_ptr instead of OwnPtr to manage ShadowData objects.
9
10
        * css/SVGCSSStyleSelector.cpp:
11
        (WebCore::StyleResolver::applySVGProperty):
12
        * css/StyleResolver.cpp:
13
        (WebCore::StyleResolver::applyProperty):
14
        * page/animation/CSSPropertyAnimation.cpp:
15
        (WebCore::blendFunc):
16
        (WebCore::PropertyWrapperShadow::PropertyWrapperShadow):
17
        (WebCore::PropertyWrapperShadow::blendSimpleOrMatchedShadowLists):
18
        (WebCore::PropertyWrapperShadow::blendMismatchedShadowLists):
19
        * rendering/style/RenderStyle.cpp:
20
        (WebCore::RenderStyle::setTextShadow):
21
        (WebCore::RenderStyle::setBoxShadow):
22
        * rendering/style/RenderStyle.h:
23
        * rendering/style/SVGRenderStyle.h:
24
        (WebCore::SVGRenderStyle::setShadow):
25
        * rendering/style/SVGRenderStyleDefs.cpp:
26
        (WebCore::StyleShadowSVGData::StyleShadowSVGData):
27
        * rendering/style/SVGRenderStyleDefs.h:
28
        * rendering/style/ShadowData.cpp:
29
        (WebCore::ShadowData::ShadowData):
30
        * rendering/style/ShadowData.h:
31
        (WebCore::ShadowData::setNext):
32
        * rendering/style/StyleRareInheritedData.cpp:
33
        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
34
        * rendering/style/StyleRareInheritedData.h:
35
        * rendering/style/StyleRareNonInheritedData.cpp:
36
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
37
        * rendering/style/StyleRareNonInheritedData.h:
38
39
2014-02-09  Zan Dobersek  <zdobersek@igalia.com>
40
3
        Switch the rest of CSS code from OwnPtr over to std::unique_ptr
41
        Switch the rest of CSS code from OwnPtr over to std::unique_ptr
4
        https://bugs.webkit.org/show_bug.cgi?id=128471
42
        https://bugs.webkit.org/show_bug.cgi?id=128471
5
43
- a/Source/WebCore/css/SVGCSSStyleSelector.cpp -3 / +3 lines
Lines 548-554 void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value) a/Source/WebCore/css/SVGCSSStyleSelector.cpp_sec1
548
            break;
548
            break;
549
        case CSSPropertyWebkitSvgShadow: {
549
        case CSSPropertyWebkitSvgShadow: {
550
            if (isInherit)
550
            if (isInherit)
551
                return svgStyle.setShadow(adoptPtr(state.parentStyle()->svgStyle().shadow() ? new ShadowData(*state.parentStyle()->svgStyle().shadow()) : 0));
551
                return svgStyle.setShadow(state.parentStyle()->svgStyle().shadow() ? std::make_unique<ShadowData>(*state.parentStyle()->svgStyle().shadow()) : nullptr);
552
            if (isInitial || primitiveValue) // initial | none
552
            if (isInitial || primitiveValue) // initial | none
553
                return svgStyle.setShadow(nullptr);
553
                return svgStyle.setShadow(nullptr);
554
554
Lines 574-581 void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value) a/Source/WebCore/css/SVGCSSStyleSelector.cpp_sec2
574
            ASSERT(!item->spread);
574
            ASSERT(!item->spread);
575
            ASSERT(!item->style);
575
            ASSERT(!item->style);
576
576
577
            OwnPtr<ShadowData> shadowData = adoptPtr(new ShadowData(location, blur, 0, Normal, false, color.isValid() ? color : Color::transparent));
577
            auto shadowData = std::make_unique<ShadowData>(location, blur, 0, Normal, false, color.isValid() ? color : Color::transparent);
578
            svgStyle.setShadow(shadowData.release());
578
            svgStyle.setShadow(std::move(shadowData));
579
            return;
579
            return;
580
        }
580
        }
581
        case CSSPropertyVectorEffect: {
581
        case CSSPropertyVectorEffect: {
- a/Source/WebCore/css/StyleResolver.cpp -5 / +5 lines
Lines 2307-2314 void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value) a/Source/WebCore/css/StyleResolver.cpp_sec1
2307
    case CSSPropertyWebkitBoxShadow: {
2307
    case CSSPropertyWebkitBoxShadow: {
2308
        if (isInherit) {
2308
        if (isInherit) {
2309
            if (id == CSSPropertyTextShadow)
2309
            if (id == CSSPropertyTextShadow)
2310
                return state.style()->setTextShadow(state.parentStyle()->textShadow() ? adoptPtr(new ShadowData(*state.parentStyle()->textShadow())) : nullptr);
2310
                return state.style()->setTextShadow(state.parentStyle()->textShadow() ? std::make_unique<ShadowData>(*state.parentStyle()->textShadow()) : nullptr);
2311
            return state.style()->setBoxShadow(state.parentStyle()->boxShadow() ? adoptPtr(new ShadowData(*state.parentStyle()->boxShadow())) : nullptr);
2311
            return state.style()->setBoxShadow(state.parentStyle()->boxShadow() ? std::make_unique<ShadowData>(*state.parentStyle()->boxShadow()) : nullptr);
2312
        }
2312
        }
2313
        if (isInitial || primitiveValue) // initial | none
2313
        if (isInitial || primitiveValue) // initial | none
2314
            return id == CSSPropertyTextShadow ? state.style()->setTextShadow(nullptr) : state.style()->setBoxShadow(nullptr);
2314
            return id == CSSPropertyTextShadow ? state.style()->setTextShadow(nullptr) : state.style()->setBoxShadow(nullptr);
Lines 2340-2350 void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value) a/Source/WebCore/css/StyleResolver.cpp_sec2
2340
            else if (state.style())
2340
            else if (state.style())
2341
                color = state.style()->color();
2341
                color = state.style()->color();
2342
2342
2343
            OwnPtr<ShadowData> shadowData = adoptPtr(new ShadowData(IntPoint(x, y), blur, spread, shadowStyle, id == CSSPropertyWebkitBoxShadow, color.isValid() ? color : Color::transparent));
2343
            auto shadowData = std::make_unique<ShadowData>(IntPoint(x, y), blur, spread, shadowStyle, id == CSSPropertyWebkitBoxShadow, color.isValid() ? color : Color::transparent);
2344
            if (id == CSSPropertyTextShadow)
2344
            if (id == CSSPropertyTextShadow)
2345
                state.style()->setTextShadow(shadowData.release(), i.index()); // add to the list if this is not the first entry
2345
                state.style()->setTextShadow(std::move(shadowData), i.index()); // add to the list if this is not the first entry
2346
            else
2346
            else
2347
                state.style()->setBoxShadow(shadowData.release(), i.index()); // add to the list if this is not the first entry
2347
                state.style()->setBoxShadow(std::move(shadowData), i.index()); // add to the list if this is not the first entry
2348
        }
2348
        }
2349
        return;
2349
        return;
2350
    }
2350
    }
- a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp -23 / +23 lines
Lines 99-116 static inline ShadowStyle blendFunc(const AnimationBase* anim, ShadowStyle from, a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp_sec1
99
    return result > 0 ? Normal : Inset;
99
    return result > 0 ? Normal : Inset;
100
}
100
}
101
101
102
static inline PassOwnPtr<ShadowData> blendFunc(const AnimationBase* anim, const ShadowData* from, const ShadowData* to, double progress)
102
static inline std::unique_ptr<ShadowData> blendFunc(const AnimationBase* anim, const ShadowData* from, const ShadowData* to, double progress)
103
{
103
{
104
    ASSERT(from && to);
104
    ASSERT(from && to);
105
    if (from->style() != to->style())
105
    if (from->style() != to->style())
106
        return adoptPtr(new ShadowData(*to));
106
        return std::make_unique<ShadowData>(*to);
107
107
108
    return adoptPtr(new ShadowData(blend(from->location(), to->location(), progress),
108
    return std::make_unique<ShadowData>(blend(from->location(), to->location(), progress),
109
                                   blend(from->radius(), to->radius(), progress),
109
        blend(from->radius(), to->radius(), progress),
110
                                   blend(from->spread(), to->spread(), progress),
110
        blend(from->spread(), to->spread(), progress),
111
                                   blendFunc(anim, from->style(), to->style(), progress),
111
        blendFunc(anim, from->style(), to->style(), progress),
112
                                   from->isWebkitBoxShadow(),
112
        from->isWebkitBoxShadow(),
113
                                   blend(from->color(), to->color(), progress)));
113
        blend(from->color(), to->color(), progress));
114
}
114
}
115
115
116
static inline TransformOperations blendFunc(const AnimationBase* anim, const TransformOperations& from, const TransformOperations& to, double progress)
116
static inline TransformOperations blendFunc(const AnimationBase* anim, const TransformOperations& from, const TransformOperations& to, double progress)
Lines 601-607 static inline const ShadowData* shadowForBlending(const ShadowData* srcShadow, c a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp_sec2
601
601
602
class PropertyWrapperShadow : public AnimationPropertyWrapperBase {
602
class PropertyWrapperShadow : public AnimationPropertyWrapperBase {
603
public:
603
public:
604
    PropertyWrapperShadow(CSSPropertyID prop, const ShadowData* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(PassOwnPtr<ShadowData>, bool))
604
    PropertyWrapperShadow(CSSPropertyID prop, const ShadowData* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(std::unique_ptr<ShadowData>, bool))
605
        : AnimationPropertyWrapperBase(prop)
605
        : AnimationPropertyWrapperBase(prop)
606
        , m_getter(getter)
606
        , m_getter(getter)
607
        , m_setter(setter)
607
        , m_setter(setter)
Lines 649-670 public: a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp_sec3
649
    }
649
    }
650
650
651
private:
651
private:
652
    PassOwnPtr<ShadowData> blendSimpleOrMatchedShadowLists(const AnimationBase* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB) const
652
    std::unique_ptr<ShadowData> blendSimpleOrMatchedShadowLists(const AnimationBase* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB) const
653
    {
653
    {
654
        OwnPtr<ShadowData> newShadowData;
654
        std::unique_ptr<ShadowData> newShadowData;
655
        ShadowData* lastShadow = 0;
655
        ShadowData* lastShadow = 0;
656
656
657
        while (shadowA || shadowB) {
657
        while (shadowA || shadowB) {
658
            const ShadowData* srcShadow = shadowForBlending(shadowA, shadowB);
658
            const ShadowData* srcShadow = shadowForBlending(shadowA, shadowB);
659
            const ShadowData* dstShadow = shadowForBlending(shadowB, shadowA);
659
            const ShadowData* dstShadow = shadowForBlending(shadowB, shadowA);
660
660
661
            OwnPtr<ShadowData> blendedShadow = blendFunc(anim, srcShadow, dstShadow, progress);
661
            std::unique_ptr<ShadowData> blendedShadow = blendFunc(anim, srcShadow, dstShadow, progress);
662
            ShadowData* blendedShadowPtr = blendedShadow.get();
662
            ShadowData* blendedShadowPtr = blendedShadow.get();
663
663
664
            if (!lastShadow)
664
            if (!lastShadow)
665
                newShadowData = blendedShadow.release();
665
                newShadowData = std::move(blendedShadow);
666
            else
666
            else
667
                lastShadow->setNext(blendedShadow.release());
667
                lastShadow->setNext(std::move(blendedShadow));
668
668
669
            lastShadow = blendedShadowPtr;
669
            lastShadow = blendedShadowPtr;
670
670
Lines 672-681 private: a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp_sec4
672
            shadowB = shadowB ? shadowB->next() : 0;
672
            shadowB = shadowB ? shadowB->next() : 0;
673
        }
673
        }
674
674
675
        return newShadowData.release();
675
        return newShadowData;
676
    }
676
    }
677
677
678
    PassOwnPtr<ShadowData> blendMismatchedShadowLists(const AnimationBase* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB, int fromLength, int toLength) const
678
    std::unique_ptr<ShadowData> blendMismatchedShadowLists(const AnimationBase* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB, int fromLength, int toLength) const
679
    {
679
    {
680
        // The shadows in ShadowData are stored in reverse order, so when animating mismatched lists,
680
        // The shadows in ShadowData are stored in reverse order, so when animating mismatched lists,
681
        // reverse them and match from the end.
681
        // reverse them and match from the end.
Lines 691-697 private: a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp_sec5
691
            shadowB = shadowB->next();
691
            shadowB = shadowB->next();
692
        }
692
        }
693
693
694
        OwnPtr<ShadowData> newShadowData;
694
        std::unique_ptr<ShadowData> newShadowData;
695
695
696
        int maxLength = std::max(fromLength, toLength);
696
        int maxLength = std::max(fromLength, toLength);
697
        for (int i = 0; i < maxLength; ++i) {
697
        for (int i = 0; i < maxLength; ++i) {
Lines 701-717 private: a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp_sec6
701
            const ShadowData* srcShadow = shadowForBlending(fromShadow, toShadow);
701
            const ShadowData* srcShadow = shadowForBlending(fromShadow, toShadow);
702
            const ShadowData* dstShadow = shadowForBlending(toShadow, fromShadow);
702
            const ShadowData* dstShadow = shadowForBlending(toShadow, fromShadow);
703
703
704
            OwnPtr<ShadowData> blendedShadow = blendFunc(anim, srcShadow, dstShadow, progress);
704
            std::unique_ptr<ShadowData> blendedShadow = blendFunc(anim, srcShadow, dstShadow, progress);
705
            // Insert at the start of the list to preserve the order.
705
            // Insert at the start of the list to preserve the order.
706
            blendedShadow->setNext(newShadowData.release());
706
            blendedShadow->setNext(std::move(newShadowData));
707
            newShadowData = blendedShadow.release();
707
            newShadowData = std::move(blendedShadow);
708
        }
708
        }
709
709
710
        return newShadowData.release();
710
        return newShadowData;
711
    }
711
    }
712
712
713
    const ShadowData* (RenderStyle::*m_getter)() const;
713
    const ShadowData* (RenderStyle::*m_getter)() const;
714
    void (RenderStyle::*m_setter)(PassOwnPtr<ShadowData>, bool);
714
    void (RenderStyle::*m_setter)(std::unique_ptr<ShadowData>, bool);
715
};
715
};
716
716
717
class PropertyWrapperMaybeInvalidColor : public AnimationPropertyWrapperBase {
717
class PropertyWrapperMaybeInvalidColor : public AnimationPropertyWrapperBase {
- a/Source/WebCore/rendering/style/RenderStyle.cpp -8 / +8 lines
Lines 1022-1051 void RenderStyle::setPageScaleTransform(float scale) a/Source/WebCore/rendering/style/RenderStyle.cpp_sec1
1022
    setTransformOriginY(Length(0, Fixed));
1022
    setTransformOriginY(Length(0, Fixed));
1023
}
1023
}
1024
1024
1025
void RenderStyle::setTextShadow(PassOwnPtr<ShadowData> shadowData, bool add)
1025
void RenderStyle::setTextShadow(std::unique_ptr<ShadowData> shadowData, bool add)
1026
{
1026
{
1027
    ASSERT(!shadowData || (!shadowData->spread() && shadowData->style() == Normal));
1027
    ASSERT(!shadowData || (!shadowData->spread() && shadowData->style() == Normal));
1028
1028
1029
    StyleRareInheritedData* rareData = rareInheritedData.access();
1029
    StyleRareInheritedData* rareData = rareInheritedData.access();
1030
    if (!add) {
1030
    if (!add) {
1031
        rareData->textShadow = shadowData;
1031
        rareData->textShadow = std::move(shadowData);
1032
        return;
1032
        return;
1033
    }
1033
    }
1034
1034
1035
    shadowData->setNext(rareData->textShadow.release());
1035
    shadowData->setNext(std::move(rareData->textShadow));
1036
    rareData->textShadow = shadowData;
1036
    rareData->textShadow = std::move(shadowData);
1037
}
1037
}
1038
1038
1039
void RenderStyle::setBoxShadow(PassOwnPtr<ShadowData> shadowData, bool add)
1039
void RenderStyle::setBoxShadow(std::unique_ptr<ShadowData> shadowData, bool add)
1040
{
1040
{
1041
    StyleRareNonInheritedData* rareData = rareNonInheritedData.access();
1041
    StyleRareNonInheritedData* rareData = rareNonInheritedData.access();
1042
    if (!add) {
1042
    if (!add) {
1043
        rareData->m_boxShadow = shadowData;
1043
        rareData->m_boxShadow = std::move(shadowData);
1044
        return;
1044
        return;
1045
    }
1045
    }
1046
1046
1047
    shadowData->setNext(rareData->m_boxShadow.release());
1047
    shadowData->setNext(std::move(rareData->m_boxShadow));
1048
    rareData->m_boxShadow = shadowData;
1048
    rareData->m_boxShadow = std::move(shadowData);
1049
}
1049
}
1050
1050
1051
static RoundedRect::Radii calcRadiiFor(const BorderData& border, const LayoutSize& size, RenderView* renderView)
1051
static RoundedRect::Radii calcRadiiFor(const BorderData& border, const LayoutSize& size, RenderView* renderView)
- a/Source/WebCore/rendering/style/RenderStyle.h -2 / +2 lines
Lines 1270-1276 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec1
1270
1270
1271
    // CSS3 Setters
1271
    // CSS3 Setters
1272
    void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v); }
1272
    void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v); }
1273
    void setTextShadow(PassOwnPtr<ShadowData>, bool add = false);
1273
    void setTextShadow(std::unique_ptr<ShadowData>, bool add = false);
1274
    void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c); }
1274
    void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c); }
1275
    void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w); }
1275
    void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w); }
1276
    void setTextFillColor(const Color& c) { SET_VAR(rareInheritedData, textFillColor, c); }
1276
    void setTextFillColor(const Color& c) { SET_VAR(rareInheritedData, textFillColor, c); }
Lines 1289-1295 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec2
1289
    void setBoxOrdinalGroup(unsigned int og) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, ordinal_group, og); }
1289
    void setBoxOrdinalGroup(unsigned int og) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, ordinal_group, og); }
1290
    void setBoxOrient(EBoxOrient o) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, orient, o); }
1290
    void setBoxOrient(EBoxOrient o) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, orient, o); }
1291
    void setBoxPack(EBoxPack p) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, pack, p); }
1291
    void setBoxPack(EBoxPack p) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, pack, p); }
1292
    void setBoxShadow(PassOwnPtr<ShadowData>, bool add = false);
1292
    void setBoxShadow(std::unique_ptr<ShadowData>, bool add = false);
1293
    void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; }
1293
    void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; }
1294
    void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); }
1294
    void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); }
1295
    void setFlexGrow(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexGrow, f); }
1295
    void setFlexGrow(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexGrow, f); }
- a/Source/WebCore/rendering/style/SVGRenderStyle.h -1 / +1 lines
Lines 262-268 public: a/Source/WebCore/rendering/style/SVGRenderStyle.h_sec1
262
            misc.access()->baselineShiftValue = obj;
262
            misc.access()->baselineShiftValue = obj;
263
    }
263
    }
264
264
265
    void setShadow(PassOwnPtr<ShadowData> obj) { shadowSVG.access()->shadow = obj; }
265
    void setShadow(std::unique_ptr<ShadowData> obj) { shadowSVG.access()->shadow = std::move(obj); }
266
266
267
    // Setters for non-inherited resources
267
    // Setters for non-inherited resources
268
    void setClipperResource(const String& obj)
268
    void setClipperResource(const String& obj)
- a/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp -1 / +1 lines
Lines 204-210 StyleShadowSVGData::StyleShadowSVGData() a/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp_sec1
204
204
205
inline StyleShadowSVGData::StyleShadowSVGData(const StyleShadowSVGData& other)
205
inline StyleShadowSVGData::StyleShadowSVGData(const StyleShadowSVGData& other)
206
    : RefCounted<StyleShadowSVGData>()
206
    : RefCounted<StyleShadowSVGData>()
207
    , shadow(other.shadow ? adoptPtr(new ShadowData(*other.shadow)) : nullptr)
207
    , shadow(other.shadow ? std::make_unique<ShadowData>(*other.shadow) : nullptr)
208
{
208
{
209
}
209
}
210
210
- a/Source/WebCore/rendering/style/SVGRenderStyleDefs.h -3 / +1 lines
Lines 31-38 a/Source/WebCore/rendering/style/SVGRenderStyleDefs.h_sec1
31
#include "SVGLength.h"
31
#include "SVGLength.h"
32
#include "SVGPaint.h"
32
#include "SVGPaint.h"
33
#include "ShadowData.h"
33
#include "ShadowData.h"
34
#include <wtf/OwnPtr.h>
35
#include <wtf/PassOwnPtr.h>
36
#include <wtf/RefCounted.h>
34
#include <wtf/RefCounted.h>
37
#include <wtf/RefPtr.h>
35
#include <wtf/RefPtr.h>
38
36
Lines 224-230 namespace WebCore { a/Source/WebCore/rendering/style/SVGRenderStyleDefs.h_sec2
224
            return !(*this == other);
222
            return !(*this == other);
225
        }
223
        }
226
224
227
        OwnPtr<ShadowData> shadow;
225
        std::unique_ptr<ShadowData> shadow;
228
226
229
    private:
227
    private:
230
        StyleShadowSVGData();
228
        StyleShadowSVGData();
- a/Source/WebCore/rendering/style/ShadowData.cpp -1 / +1 lines
Lines 33-39 ShadowData::ShadowData(const ShadowData& o) a/Source/WebCore/rendering/style/ShadowData.cpp_sec1
33
    , m_color(o.m_color)
33
    , m_color(o.m_color)
34
    , m_style(o.m_style)
34
    , m_style(o.m_style)
35
    , m_isWebkitBoxShadow(o.m_isWebkitBoxShadow)
35
    , m_isWebkitBoxShadow(o.m_isWebkitBoxShadow)
36
    , m_next(o.m_next ? adoptPtr(new ShadowData(*o.m_next)) : nullptr)
36
    , m_next(o.m_next ? std::make_unique<ShadowData>(*o.m_next) : nullptr)
37
{
37
{
38
}
38
}
39
39
- a/Source/WebCore/rendering/style/ShadowData.h -4 / +2 lines
Lines 28-35 a/Source/WebCore/rendering/style/ShadowData.h_sec1
28
#include "Color.h"
28
#include "Color.h"
29
#include "FloatRect.h"
29
#include "FloatRect.h"
30
#include "LayoutRect.h"
30
#include "LayoutRect.h"
31
#include <wtf/OwnPtr.h>
32
#include <wtf/PassOwnPtr.h>
33
31
34
namespace WebCore {
32
namespace WebCore {
35
33
Lines 84-90 public: a/Source/WebCore/rendering/style/ShadowData.h_sec2
84
    bool isWebkitBoxShadow() const { return m_isWebkitBoxShadow; }
82
    bool isWebkitBoxShadow() const { return m_isWebkitBoxShadow; }
85
83
86
    const ShadowData* next() const { return m_next.get(); }
84
    const ShadowData* next() const { return m_next.get(); }
87
    void setNext(PassOwnPtr<ShadowData> shadow) { m_next = shadow; }
85
    void setNext(std::unique_ptr<ShadowData> shadow) { m_next = std::move(shadow); }
88
86
89
    void adjustRectForShadow(LayoutRect&, int additionalOutlineSize = 0) const;
87
    void adjustRectForShadow(LayoutRect&, int additionalOutlineSize = 0) const;
90
    void adjustRectForShadow(FloatRect&, int additionalOutlineSize = 0) const;
88
    void adjustRectForShadow(FloatRect&, int additionalOutlineSize = 0) const;
Lines 96-102 private: a/Source/WebCore/rendering/style/ShadowData.h_sec3
96
    Color m_color;
94
    Color m_color;
97
    ShadowStyle m_style;
95
    ShadowStyle m_style;
98
    bool m_isWebkitBoxShadow;
96
    bool m_isWebkitBoxShadow;
99
    OwnPtr<ShadowData> m_next;
97
    std::unique_ptr<ShadowData> m_next;
100
};
98
};
101
99
102
} // namespace WebCore
100
} // namespace WebCore
- a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp -1 / +1 lines
Lines 146-152 inline StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedDa a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp_sec1
146
    , visitedLinkTextStrokeColor(o.visitedLinkTextStrokeColor)
146
    , visitedLinkTextStrokeColor(o.visitedLinkTextStrokeColor)
147
    , visitedLinkTextFillColor(o.visitedLinkTextFillColor)
147
    , visitedLinkTextFillColor(o.visitedLinkTextFillColor)
148
    , visitedLinkTextEmphasisColor(o.visitedLinkTextEmphasisColor)
148
    , visitedLinkTextEmphasisColor(o.visitedLinkTextEmphasisColor)
149
    , textShadow(o.textShadow ? adoptPtr(new ShadowData(*o.textShadow)) : nullptr)
149
    , textShadow(o.textShadow ? std::make_unique<ShadowData>(*o.textShadow) : nullptr)
150
    , cursorData(o.cursorData)
150
    , cursorData(o.cursorData)
151
    , indent(o.indent)
151
    , indent(o.indent)
152
    , m_effectiveZoom(o.m_effectiveZoom)
152
    , m_effectiveZoom(o.m_effectiveZoom)
- a/Source/WebCore/rendering/style/StyleRareInheritedData.h -1 / +1 lines
Lines 69-75 public: a/Source/WebCore/rendering/style/StyleRareInheritedData.h_sec1
69
    Color visitedLinkTextFillColor;
69
    Color visitedLinkTextFillColor;
70
    Color visitedLinkTextEmphasisColor;    
70
    Color visitedLinkTextEmphasisColor;    
71
71
72
    OwnPtr<ShadowData> textShadow; // Our text shadow information for shadowed text drawing.
72
    std::unique_ptr<ShadowData> textShadow; // Our text shadow information for shadowed text drawing.
73
    
73
    
74
    RefPtr<CursorList> cursorData;
74
    RefPtr<CursorList> cursorData;
75
    Length indent;
75
    Length indent;
- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp -1 / +1 lines
Lines 119-125 inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec1
119
    , m_gridItem(o.m_gridItem)
119
    , m_gridItem(o.m_gridItem)
120
    , m_content(o.m_content ? o.m_content->clone() : nullptr)
120
    , m_content(o.m_content ? o.m_content->clone() : nullptr)
121
    , m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) : nullptr)
121
    , m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) : nullptr)
122
    , m_boxShadow(o.m_boxShadow ? adoptPtr(new ShadowData(*o.m_boxShadow)) : nullptr)
122
    , m_boxShadow(o.m_boxShadow ? std::make_unique<ShadowData>(*o.m_boxShadow) : nullptr)
123
    , m_boxReflect(o.m_boxReflect)
123
    , m_boxReflect(o.m_boxReflect)
124
    , m_animations(o.m_animations ? adoptPtr(new AnimationList(*o.m_animations)) : nullptr)
124
    , m_animations(o.m_animations ? adoptPtr(new AnimationList(*o.m_animations)) : nullptr)
125
    , m_transitions(o.m_transitions ? adoptPtr(new AnimationList(*o.m_transitions)) : nullptr)
125
    , m_transitions(o.m_transitions ? adoptPtr(new AnimationList(*o.m_transitions)) : nullptr)
- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h -1 / +1 lines
Lines 124-130 public: a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h_sec1
124
    OwnPtr<CounterDirectiveMap> m_counterDirectives;
124
    OwnPtr<CounterDirectiveMap> m_counterDirectives;
125
    String m_altText;
125
    String m_altText;
126
126
127
    OwnPtr<ShadowData> m_boxShadow;  // For box-shadow decorations.
127
    std::unique_ptr<ShadowData> m_boxShadow; // For box-shadow decorations.
128
    
128
    
129
    RefPtr<StyleReflection> m_boxReflect;
129
    RefPtr<StyleReflection> m_boxReflect;
130
130

Return to Bug 128466