Bug 204053

Summary: Stack allocate StyleResolver state
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: allan.jensen, cdumez, commit-queue, darin, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, macpherson, menard, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
patch
none
patch none

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.