Bug 210495 - Factor PseudoElement creation calls into a single Element::ensurePseudoElement(pseudoId) method
Summary: Factor PseudoElement creation calls into a single Element::ensurePseudoElemen...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-14 07:24 PDT by Antoine Quint
Modified: 2020-04-14 12:13 PDT (History)
11 users (show)

See Also:


Attachments
Patch (5.52 KB, patch)
2020-04-14 07:28 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (5.49 KB, patch)
2020-04-14 09:23 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (6.38 KB, patch)
2020-04-14 10:06 PDT, Antoine Quint
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2020-04-14 07:24:38 PDT
Factor PseudoElement creation calls into a single Element::ensurePseudoElement(pseudoId) method
Comment 1 Antoine Quint 2020-04-14 07:28:53 PDT
Created attachment 396414 [details]
Patch
Comment 2 Antti Koivisto 2020-04-14 07:53:15 PDT
Comment on attachment 396414 [details]
Patch

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

> Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:-123
> -            current.setBeforePseudoElement(newPseudoElement.releaseNonNull());
> -        else
> -            current.setAfterPseudoElement(newPseudoElement.releaseNonNull());

You can probably make these private now.

> Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:113
> +    current.ensurePseudoElement(pseudoId);

pseudoElement =
Comment 3 Antti Koivisto 2020-04-14 07:59:51 PDT
Comment on attachment 396414 [details]
Patch

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

> Source/WebCore/dom/Element.cpp:3484
> +PseudoElement* Element::ensurePseudoElement(PseudoId pseudoId)

I think this should return a reference. The assert could be a  release assert.
Comment 4 Antoine Quint 2020-04-14 09:23:37 PDT
Created attachment 396428 [details]
Patch
Comment 5 Antoine Quint 2020-04-14 09:44:45 PDT
(In reply to Antti Koivisto from comment #2)
> Comment on attachment 396414 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=396414&action=review
> 
> > Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:-123
> > -            current.setBeforePseudoElement(newPseudoElement.releaseNonNull());
> > -        else
> > -            current.setAfterPseudoElement(newPseudoElement.releaseNonNull());
> 
> You can probably make these private now.

I think we can remove them altogether.

> > Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:113
> > +    current.ensurePseudoElement(pseudoId);
> 
> pseudoElement =

Err… yeah!
Comment 6 Antoine Quint 2020-04-14 09:44:53 PDT
(In reply to Antti Koivisto from comment #3)
> Comment on attachment 396414 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=396414&action=review
> 
> > Source/WebCore/dom/Element.cpp:3484
> > +PseudoElement* Element::ensurePseudoElement(PseudoId pseudoId)
> 
> I think this should return a reference. The assert could be a  release
> assert.

Will do.
Comment 7 Antoine Quint 2020-04-14 10:06:55 PDT
Created attachment 396432 [details]
Patch
Comment 8 Antoine Quint 2020-04-14 12:12:59 PDT
Committed r260088: <https://trac.webkit.org/changeset/260088>
Comment 9 Radar WebKit Bug Importer 2020-04-14 12:13:15 PDT
<rdar://problem/61784398>