RESOLVED FIXED 210495
Factor PseudoElement creation calls into a single Element::ensurePseudoElement(pseudoId) method
https://bugs.webkit.org/show_bug.cgi?id=210495
Summary Factor PseudoElement creation calls into a single Element::ensurePseudoElemen...
Antoine Quint
Reported 2020-04-14 07:24:38 PDT
Factor PseudoElement creation calls into a single Element::ensurePseudoElement(pseudoId) method
Attachments
Patch (5.52 KB, patch)
2020-04-14 07:28 PDT, Antoine Quint
no flags
Patch (5.49 KB, patch)
2020-04-14 09:23 PDT, Antoine Quint
no flags
Patch (6.38 KB, patch)
2020-04-14 10:06 PDT, Antoine Quint
koivisto: review+
Antoine Quint
Comment 1 2020-04-14 07:28:53 PDT
Antti Koivisto
Comment 2 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 =
Antti Koivisto
Comment 3 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.
Antoine Quint
Comment 4 2020-04-14 09:23:37 PDT
Antoine Quint
Comment 5 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!
Antoine Quint
Comment 6 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.
Antoine Quint
Comment 7 2020-04-14 10:06:55 PDT
Antoine Quint
Comment 8 2020-04-14 12:12:59 PDT
Radar WebKit Bug Importer
Comment 9 2020-04-14 12:13:15 PDT
Note You need to log in before you can comment on or make changes to this bug.