Bug 215942 - Make StyleRareNonInheritedData::mask and StyleBackgroundData::background DataRefs
Summary: Make StyleRareNonInheritedData::mask and StyleBackgroundData::background Data...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-28 12:14 PDT by Wenson Hsieh
Modified: 2020-08-30 21:52 PDT (History)
15 users (show)

See Also:


Attachments
For EWS (23.79 KB, patch)
2020-08-28 12:35 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
For EWS (and fix GTK build) (23.95 KB, patch)
2020-08-28 12:58 PDT, Wenson Hsieh
darin: review+
Details | Formatted Diff | Diff
Patch for landing (24.17 KB, patch)
2020-08-30 21:09 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2020-08-28 12:14:10 PDT
Potential progression on the Multiply subtest in MotionMark.
Comment 1 Wenson Hsieh 2020-08-28 12:35:08 PDT Comment hidden (obsolete)
Comment 2 Wenson Hsieh 2020-08-28 12:58:34 PDT
Created attachment 407497 [details]
For EWS (and fix GTK build)
Comment 3 Darin Adler 2020-08-28 14:37:24 PDT
Comment on attachment 407497 [details]
For EWS (and fix GTK build)

View in context: https://bugs.webkit.org/attachment.cgi?id=407497&action=review

> Source/WebCore/rendering/style/FillLayer.cpp:30
> +struct SameSizeAsFillLayer : public RefCounted<SameSizeAsFillLayer> {

No need for "public" here.

> Source/WebCore/rendering/style/FillLayer.cpp:31
> +    RefPtr<FillLayer> next;

SameSize structures don’t really need to use smart pointers instead of raw pointers.

> Source/WebCore/rendering/style/FillLayer.cpp:110
> +        m_next = FillLayer::create(*o.m_next);

Should just call create here, not FillLayer::create.

> Source/WebCore/rendering/style/FillLayer.h:74
> +    static Ref<FillLayer> create(FillLayerType type)
> +    {
> +        return adoptRef(*new FillLayer(type));
> +    }
> +
> +    static Ref<FillLayer> create(const FillLayer& layer)
> +    {
> +        return adoptRef(*new FillLayer(layer));
> +    }

I suggest not inlining these. We’d rather inline the constructor inside the create function rather than inlining the allocation and then paying function call overhead to call the constructor.

> Source/WebCore/rendering/style/FillLayer.h:79
> +    Ref<FillLayer> copy() const
> +    {
> +        return FillLayer::create(*this);
> +    }

Should call just "create" and should write as a one-liner:

    Ref<FillLayer> copy() const { return create(*this); }
Comment 4 Wenson Hsieh 2020-08-29 16:46:52 PDT
Comment on attachment 407497 [details]
For EWS (and fix GTK build)

View in context: https://bugs.webkit.org/attachment.cgi?id=407497&action=review

Thanks for the review!

>> Source/WebCore/rendering/style/FillLayer.cpp:30
>> +struct SameSizeAsFillLayer : public RefCounted<SameSizeAsFillLayer> {
> 
> No need for "public" here.

Removed the public!

>> Source/WebCore/rendering/style/FillLayer.cpp:31
>> +    RefPtr<FillLayer> next;
> 
> SameSize structures don’t really need to use smart pointers instead of raw pointers.

Changed back to a raw pointer.

>> Source/WebCore/rendering/style/FillLayer.cpp:110
>> +        m_next = FillLayer::create(*o.m_next);
> 
> Should just call create here, not FillLayer::create.

Removed the FillLayer::

>> Source/WebCore/rendering/style/FillLayer.h:74
>> +    }
> 
> I suggest not inlining these. We’d rather inline the constructor inside the create function rather than inlining the allocation and then paying function call overhead to call the constructor.

Sounds good — moved the definition out of the header.

>> Source/WebCore/rendering/style/FillLayer.h:79
>> +    }
> 
> Should call just "create" and should write as a one-liner:
> 
>     Ref<FillLayer> copy() const { return create(*this); }

Done!
Comment 5 Wenson Hsieh 2020-08-30 21:09:00 PDT
Created attachment 407586 [details]
Patch for landing
Comment 6 EWS 2020-08-30 21:51:24 PDT
Committed r266344: <https://trac.webkit.org/changeset/266344>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407586 [details].
Comment 7 Radar WebKit Bug Importer 2020-08-30 21:52:14 PDT
<rdar://problem/68052423>