Closed
Bug 863618
Opened 12 years ago
Closed 11 years ago
getBoundingClientRect on range with scaled (transformed) element returns wrong offsets
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: disroden, Assigned: roc)
References
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0
Build ID: 20130329030352
Steps to reproduce:
I created a div with:
transform: matrix(2, 0, 0, 2, 0, 0);
transform-origin: 0 100%;
And some text in it. Selected a part of text with Range and called getBoundingClientRect. (See file attached)
Actual results:
It returns wrong ClientRect. As if transform wouldn't be applied.
Expected results:
getBoundingClientRect should return the correct ClientRect that counts transform.
Updated•12 years ago
|
Attachment #739466 -
Attachment mime type: text/plain → text/html
Updated•12 years ago
|
Component: Untriaged → Layout
Product: Firefox → Core
Updated•12 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 1•12 years ago
|
||
Looks like nsRange needs some RECTS_ACCOUNT_FOR_TRANSFORMS for it's GetAllInFlowRects calls, but it's not that simple as there is some custom code for when the range only includes part of a text frame. Those could probably be handled by using TransformFrameRectToAncestor.
Updated•11 years ago
|
Summary: getBoundingClientRect on range with scaled element returns wrong offsets → getBoundingClientRect on range with scaled (transformed) element returns wrong offsets
Comment 4•11 years ago
|
||
Added a test case. The issue also applies to all kinds of transforms.
| Assignee | ||
Comment 5•11 years ago
|
||
Attachment #8455925 -
Flags: review?(tnikkel)
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → roc
Status: NEW → ASSIGNED
Updated•11 years ago
|
Attachment #8455925 -
Flags: review?(tnikkel) → review+
| Assignee | ||
Comment 6•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in
before you can comment on or make changes to this bug.
Description
•