[webkit-reviews] review granted: [Bug 173841] getBoundingClientRect returns wrong value for combination of page zoom and scroll : [Attachment 314105] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 29 17:00:52 PDT 2017


Dean Jackson <dino at apple.com> has granted Simon Fraser (smfr)
<simon.fraser at apple.com>'s request for review:
Bug 173841: getBoundingClientRect returns wrong value for combination of page
zoom and scroll
https://bugs.webkit.org/show_bug.cgi?id=173841

Attachment 314105: Patch

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




--- Comment #11 from Dean Jackson <dino at apple.com> ---
Comment on attachment 314105
  --> https://bugs.webkit.org/attachment.cgi?id=314105
Patch

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

> Source/WebCore/dom/SimulatedClick.cpp:77
> +	       auto rect = target.getBoundingClientRect();
> +	       LayoutRect clientRect = { rect->x(), rect->y(), rect->width(),
rect->height() };

Maybe LayoutRect should take DOMRect in a constructor.

> Source/WebCore/dom/SimulatedClick.cpp:78
> +	       initCoordinates(clientRect.center());

Although it seems pointless to create a LayoutRect, just to get the center
point. Why not initCoordinates(LayoutPoint((rect->x() + rect->width) / 2, ....
?


More information about the webkit-reviews mailing list