Closed Bug 863618 Opened 9 years ago Closed 7 years ago
Bounding Client Rect on range with scaled (transformed) element returns wrong offsets
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.
Attachment #739466 - Attachment mime type: text/plain → text/html
Component: Untriaged → Layout
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
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.
Summary: getBoundingClientRect on range with scaled element returns wrong offsets → getBoundingClientRect on range with scaled (transformed) element returns wrong offsets
Added a test case. The issue also applies to all kinds of transforms.
7 years ago
Assignee: nobody → roc
Status: NEW → ASSIGNED
7 years ago
No longer blocks: 1025815
Attachment #8455925 - Flags: review?(tnikkel) → review+
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.