[webkit-reviews] review requested: [Bug 77998] getBoundingClientRect() returns the incorrect value on elements with the CSS zoom property : [Attachment 126527] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 10 09:44:23 PST 2012


Max Vujovic <mvujovic at adobe.com> has asked  for review:
Bug 77998: getBoundingClientRect() returns the incorrect value on elements with
the CSS zoom property
https://bugs.webkit.org/show_bug.cgi?id=77998

Attachment 126527: Patch
https://bugs.webkit.org/attachment.cgi?id=126527&action=review

------- Additional Comments from Max Vujovic <mvujovic at adobe.com>
Thanks for looking at this, Dirk.

I've put up a patch that fixes the issue, and described the change in the
ChangeLog like so:

"""
	* dom/Element.cpp:
	(WebCore::Element::getBoundingClientRect):

	    After the element's absoluteQuads are united into a single bounding
rect, they need to
	    be transformed from screen coordinates to viewport coordinates.

	    Before, we were using adjustFloatRectForAbsoluteZoom in the
transformation, which
	    divided screen coordinates by effectiveZoom. However, effectiveZoom
includes both page
	    zoom and the CSS zoom property. The CSS zoom property affects
elements but does not
	    affect the viewport, so it should not be involved in the
transformation.

	    Now, we are using adjustFloatRectForPageZoom and the pageZoomFactor
to transform from
	    screen coordinates to viewport coordinates, which does not involve
CSS zoom.

	* rendering/RenderObject.h:
	(WebCore::adjustFloatRectForPageZoom):

	    This is a new function, defined underneath similar functions like 
	    adjustFloatRectForAbsoluteZoom and adjustFloatRectForPageScale.
"""


More information about the webkit-reviews mailing list