[webkit-reviews] review granted: [Bug 208047] [intersection-observer] Accept a Document as an explicit root : [Attachment 392546] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 5 15:47:44 PST 2020


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Frédéric Wang (:fredw)
<fred.wang at free.fr>'s request for review:
Bug 208047: [intersection-observer] Accept a Document as an explicit root
https://bugs.webkit.org/show_bug.cgi?id=208047

Attachment 392546: Patch

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




--- Comment #14 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 392546
  --> https://bugs.webkit.org/attachment.cgi?id=392546
Patch

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

> Source/WebCore/page/IntersectionObserver.cpp:126
> +	   auto& observerData =
downcast<Document>(m_root)->ensureIntersectionObserverData();

Nicer as:
  downcast<Document>(*m_root).ensureIntersectionObserverData();
since the is<> null-checks.

> Source/WebCore/page/IntersectionObserver.cpp:130
> +	   auto& observerData =
downcast<Element>(m_root)->ensureIntersectionObserverData();

Ditto.

> Source/WebCore/page/IntersectionObserver.cpp:142
> +	  
downcast<Document>(m_root)->intersectionObserverDataIfExists()->observers.remov
eFirst(this);

Ditto.

> Source/WebCore/page/IntersectionObserver.cpp:145
> +	  
downcast<Element>(m_root)->intersectionObserverDataIfExists()->observers.remove
First(this);

Ditto.


More information about the webkit-reviews mailing list