[webkit-reviews] review granted: [Bug 176279] Fix a few minor problems found while working toward removing unneeded calls to updateStyle : [Attachment 319820] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 4 13:23:35 PDT 2017


Antti Koivisto <koivisto at iki.fi> has granted Darin Adler <darin at apple.com>'s
request for review:
Bug 176279: Fix a few minor problems found while working toward removing
unneeded calls to updateStyle
https://bugs.webkit.org/show_bug.cgi?id=176279

Attachment 319820: Patch

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




--- Comment #12 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 319820
  --> https://bugs.webkit.org/attachment.cgi?id=319820
Patch

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

> Source/WebCore/dom/Document.cpp:1574
> +    auto* newTitleElement = m_titleElement.get();
> +    if (is<SVGSVGElement>(documentElement)) {
> +	   if (is<SVGTitleElement>(changingTitleElement)) {
> +	       if (m_titleElement)
> +		   newTitleElement =
childrenOfType<SVGTitleElement>(*documentElement).first();
> +	       else if (changingTitleElement.parentNode() == documentElement)
> +		   newTitleElement = &changingTitleElement;
> +	       else
> +		   newTitleElement = nullptr;
> +	   }
> +	   ASSERT(newTitleElement ==
childrenOfType<SVGTitleElement>(*documentElement).first());
> +    } else {
> +	   if (is<HTMLTitleElement>(changingTitleElement)) {
> +	       if (m_titleElement)
> +		   newTitleElement =
descendantsOfType<HTMLTitleElement>(*this).first();
> +	       else if (changingTitleElement.isConnected() &&
!changingTitleElement.isInShadowTree())
> +		   newTitleElement = &changingTitleElement;
> +	       else
> +		   newTitleElement = nullptr;
> +	   }
> +	   ASSERT(newTitleElement ==
descendantsOfType<HTMLTitleElement>(*this).first());
>      }

I find this logic somewhat difficult to follow. Maybe having
computeNewTitleElementForHTML/SVG helper lambdas would make this cleaner?

> Source/WebCore/rendering/RenderTreeAsText.cpp:964
> +    ASSERT(element); // FIXME: Take a reference instead of a pointer.

Not sure if this sort FIXMEs achieve anything. It is pretty obvious from the
code and we have tons of these still.


More information about the webkit-reviews mailing list