[webkit-reviews] review granted: [Bug 40753] Hit testing on margins of body and head elements doesn't recur : [Attachment 107943] fixes the bug

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 19 16:57:55 PDT 2011

Darin Adler <darin at apple.com> has granted Ryosuke Niwa <rniwa at webkit.org>'s
request for review:
Bug 40753: Hit testing on margins of body and head elements doesn't recur

Attachment 107943: fixes the bug

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=107943&action=review

> Source/WebCore/rendering/RenderBlock.cpp:4235
> +    if (!ancestor || ancestor->node()->hasTagName(htmlTag) ||
ancestor->node()->rendererIsEditable() == childNode->rendererIsEditable())

I’m not sure that htmlTag is the best way to check for the document element.
It’s probably neither the most efficient way nor the most reliable. The best
way I can think of would be to tie this as closely as possible to the code that
makes body and head elements have special margins. I was unable to quickly
research that because I don’t know what that code is.

Two other ways that come to mind that may be better:

    ancestor->node()->parent() && ancestor->node()->parent()->isDocumentNode()

More information about the webkit-reviews mailing list