WebKit Bugzilla
Attachment 339444 Details for
Bug 185034
: getBoundingClientRect() x and y are divided by CSS zoom
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch v3
0001-WebCore-Document-convertAbsoluteToClientRect-dont-us.patch (text/plain), 3.47 KB, created by
Juan Pablo Ugarte
on 2018-05-03 12:46:43 PDT
(
hide
)
Description:
Proposed patch v3
Filename:
MIME Type:
Creator:
Juan Pablo Ugarte
Created:
2018-05-03 12:46:43 PDT
Size:
3.47 KB
patch
obsolete
>From c324dfdab6dc7db3c07dc8743568f5bb2b48e706 Mon Sep 17 00:00:00 2001 >From: Juan Pablo Ugarte <ugarte@endlessm.com> >Date: Thu, 3 May 2018 15:08:51 -0300 >Subject: [PATCH] WebCore::Document::convertAbsoluteToClientRect() dont use > effectiveZoom > >getBoundingClientRect() return wrong values when CSS zoom is set because zoom >is used as the effectiveZoom parameter to Document::convertAbsoluteToClientRects() > >Fix bug https://bugs.webkit.org/show_bug.cgi?id=185034 >--- > ...-rects-with-css-and-page-zoom-expected.txt | 6 ++++++ > .../client-rects-with-css-and-page-zoom.html | 21 +++++++++++++++++++ > Source/WebCore/dom/Document.cpp | 3 ++- > 3 files changed, 29 insertions(+), 1 deletion(-) > >diff --git a/LayoutTests/fast/zooming/client-rects-with-css-and-page-zoom-expected.txt b/LayoutTests/fast/zooming/client-rects-with-css-and-page-zoom-expected.txt >index 463001fba08..c8299c133e5 100644 >--- a/LayoutTests/fast/zooming/client-rects-with-css-and-page-zoom-expected.txt >+++ b/LayoutTests/fast/zooming/client-rects-with-css-and-page-zoom-expected.txt >@@ -7,6 +7,12 @@ PASS successfullyParsed is true > > TEST COMPLETE > >+Testing box with CSS zoom >+PASS bounds.left.toFixed(2) is "8.00" >+PASS bounds.top.toFixed(2) is "10.00" >+PASS bounds.width.toFixed(2) is "20.00" >+PASS bounds.height.toFixed(2) is "25.00" >+ > Testing box with CSS zoom on an ancestor > PASS bounds.left.toFixed(2) is "18.00" > PASS bounds.top.toFixed(2) is "150.00" >diff --git a/LayoutTests/fast/zooming/client-rects-with-css-and-page-zoom.html b/LayoutTests/fast/zooming/client-rects-with-css-and-page-zoom.html >index e631bb5c5ee..fa89a972ff9 100644 >--- a/LayoutTests/fast/zooming/client-rects-with-css-and-page-zoom.html >+++ b/LayoutTests/fast/zooming/client-rects-with-css-and-page-zoom.html >@@ -3,6 +3,16 @@ > <html> > <head> > <style> >+ #zoom-box { >+ zoom: 0.5; >+ position: absolute; >+ left: 8px; >+ top: 10px; >+ width: 40px; >+ height: 50px; >+ background-color: rgba(0, 0, 0, 0.1); >+ } >+ > .container { > zoom: 2.3; > } >@@ -40,6 +50,16 @@ > debug('This tests uses eventSender to zoom in twice'); > } > >+ box = document.getElementById('zoom-box'); >+ bounds = box.getBoundingClientRect(); >+ >+ debug(''); >+ debug('Testing box with CSS zoom') >+ shouldBeEqualToString('bounds.left.toFixed(2)', '8.00'); >+ shouldBeEqualToString('bounds.top.toFixed(2)', '10.00'); >+ shouldBeEqualToString('bounds.width.toFixed(2)', '20.00'); >+ shouldBeEqualToString('bounds.height.toFixed(2)', '25.00'); >+ > box = document.getElementById('inside-zoom-box'); > bounds = box.getBoundingClientRect(); > >@@ -65,6 +85,7 @@ > </script> > </head> > <body> >+ <div id="zoom-box"></div> > <div class="container"> > <div id="inside-zoom-box"></div> > </div> >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 50b239a36f2..8af5f60350f 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -6840,7 +6840,8 @@ void Document::convertAbsoluteToClientRect(FloatRect& rect, const RenderStyle& s > return; > > const auto& frameView = *view(); >- rect = frameView.absoluteToDocumentRect(rect, style.effectiveZoom()); >+ (void)style; >+ rect = frameView.absoluteToDocumentRect(rect); > rect = frameView.documentToClientRect(rect); > } > >-- >2.17.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185034
:
338891
|
339011
|
339432
| 339444 |
339451
|
339464
|
339466
|
339476
|
339502