Factor PseudoElement creation calls into a single Element::ensurePseudoElement(pseudoId) method
Created attachment 396414 [details] Patch
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 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.
Created attachment 396428 [details] Patch
(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!
(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.
Created attachment 396432 [details] Patch
Committed r260088: <https://trac.webkit.org/changeset/260088>
<rdar://problem/61784398>