[webkit-reviews] review granted: [Bug 178513] Support ::before/::after pseudo elements on elements with display:contents : [Attachment 324366] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 20 01:16:44 PDT 2017


Ryosuke Niwa <rniwa at webkit.org> has granted Antti Koivisto <koivisto at iki.fi>'s
request for review:
Bug 178513: Support ::before/::after pseudo elements on elements with
display:contents
https://bugs.webkit.org/show_bug.cgi?id=178513

Attachment 324366: patch

https://bugs.webkit.org/attachment.cgi?id=324366&action=review




--- Comment #19 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 324366
  --> https://bugs.webkit.org/attachment.cgi?id=324366
patch

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

> Source/WebCore/style/RenderTreePosition.cpp:89
> +    auto initializeStack = [&] {

I think it's cleaner to just have to code instead of creating a closure &
calling it immediately.
I thought you were trying to call this lazily or something.

> Source/WebCore/style/RenderTreePosition.cpp:105
> +    auto begin = [&] {

I think begin() doesn't really covey the semantics. Please give it a more
descriptive name.
findFirstRendererConsideringBeforePseudoElement?

> Source/WebCore/style/RenderTreePosition.cpp:109
> +		   if (host != parentElement)

It's not clear what host != parentElement means.
Maybe you can define a local boolean with a descriptive name or add a one line
comment to clarify what it means?

> Source/WebCore/style/RenderTreePosition.cpp:122
> +    auto push = [&] (Element& element) -> RenderElement* {

Can we give this a more descriptive name like pushIfBeforePseudoElementExists?

> Source/WebCore/style/RenderTreePosition.cpp:132
> +    auto pop = [&] (unsigned depth) -> RenderElement* {

Can we call this popUntilAfterPseudoElement or something to make the semantics
clear?
pop(it.depth()) looks rather mysterious.


More information about the webkit-reviews mailing list