Bug 204053 - Stack allocate StyleResolver state
Summary: Stack allocate StyleResolver state
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-11-09 15:10 PST by Antti Koivisto
Modified: 2019-11-12 09:04 PST (History)
12 users (show)

See Also:


Attachments
patch (38.18 KB, patch)
2019-11-09 15:27 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (39.76 KB, patch)
2019-11-09 15:37 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (40.08 KB, patch)
2019-11-09 16:26 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2019-11-09 15:10:48 PST
Get rid of the awkward State member.
Comment 1 Antti Koivisto 2019-11-09 15:27:02 PST
Created attachment 383228 [details]
patch
Comment 2 Antti Koivisto 2019-11-09 15:37:08 PST
Created attachment 383231 [details]
patch
Comment 3 Antti Koivisto 2019-11-09 16:26:23 PST
Created attachment 383232 [details]
patch
Comment 4 zalan 2019-11-09 19:47:26 PST
Comment on attachment 383232 [details]
patch

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

> Source/WebCore/css/StyleResolver.cpp:465
> +std::unique_ptr<RenderStyle> StyleResolver::defaultStyleForElement(const Element* element)

It's sad that we need to pass in a raw pointer just to figure out if it is an svg element.
Comment 5 Antti Koivisto 2019-11-09 23:16:14 PST
> It's sad that we need to pass in a raw pointer just to figure out if it is
> an svg element.

Bit silly yes. There is still lots of room for improvement here.
Comment 6 WebKit Commit Bot 2019-11-10 00:01:58 PST
Comment on attachment 383232 [details]
patch

Clearing flags on attachment: 383232

Committed r252313: <https://trac.webkit.org/changeset/252313>
Comment 7 WebKit Commit Bot 2019-11-10 00:02:00 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2019-11-11 17:00:33 PST
<rdar://problem/57099412>
Comment 9 Darin Adler 2019-11-12 09:04:18 PST
Comment on attachment 383232 [details]
patch

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

> Source/WebCore/style/StyleBuilderState.h:48
> +    RefPtr<const Element> element = nullptr;

I think the "= nullptr" here is a no-op since any RefPtr starts out as nullptr.