[webkit-reviews] review granted: [Bug 179600] More is<> and downcast<>, less static_cast<> : [Attachment 326738] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Nov 12 19:21:55 PST 2017


Chris Dumez <cdumez at apple.com> has granted Darin Adler <darin at apple.com>'s
request for review:
Bug 179600: More is<> and downcast<>, less static_cast<>
https://bugs.webkit.org/show_bug.cgi?id=179600

Attachment 326738: Patch

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




--- Comment #7 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 326738
  --> https://bugs.webkit.org/attachment.cgi?id=326738
Patch

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

r=me with comment. Please make sure GTK builds before landing.

> Source/WebCore/html/HTMLFormElement.cpp:671
> +    if (!event || !is<Element>(event->target()))

Doesn’t this change behavior? If the target is a Text node that is a descendant
of an HTMLFormControlElement, then we will return nullptr instead of the
control ancestor. Or I am missing something?

> Source/WebCore/html/HTMLFormElement.cpp:673
> +    return
lineageOfType<HTMLFormControlElement>(downcast<Element>(*event->target())).firs
t();

I discussed this Antti and he agreed with should have a lineageOfType overload
that takes in a Node.


More information about the webkit-reviews mailing list