Incorrect bounding box positions for linefeed characters in white-space:pre
Reported by
siul...@gmail.com,
Mar 2 2017
|
||||||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Steps to reproduce the problem:
1. Load the attached HTML
It demonstrates the getBoundingClientRect of each of the 7 chars in "a\nb\n\n\nc" in a single TextNode with white-space:pre
What is the expected behavior?
The reported positions should be roughly at: (in (top, left) format)
(0,0) (0,9) (15,0) (15,9) (30,0) (45,0) (60,0)
Firefox reports roughly these.
What went wrong?
Chrome reports positions roughly at:
(0,0) (0,9) (15,0) (15,9) (15,18) (30,9) (60,0)
The (15,18) position doesn't make sense because even if you count a width of 9 for "\n" everything should still fit within y=0..18.
The (30,9) => (60,0) jump also doesn't make sense given the height of a line is only roughly 15.
Did this work before? N/A
Does this work in other browsers? Yes
Chrome version: 56.0.2924.87 Channel: stable
OS Version: OS X 10.12.0
Flash Version:
,
Mar 3 2017
,
Mar 3 2017
Unable to reproduce the issue in Mac 10.12.3 by using chrome reported version #56.0.2924.87 and latest canary #58.0.3028.3.
Steps followed to reproduce the issue are as follows:
-----------
1. Loaded the attached HTML.
2. Did not observe Chrome reporting positions at:
(0,0) (0,9) (15,0) (15,9) (15,18) (30,9) (60,0)
Also did not got the expected result i.e
(0,0) (0,9) (15,0) (15,9) (30,0) (45,0) (60,0)
Attaching screen cast for reference
siulung@ - Could you please provide the expected result screenshot. It will help us in triaging the issue further.
Thanks...!!
,
Mar 3 2017
@krajshree What you see is exactly what I reported. They are "roughly" at those locations because rounding errors do exist due to font and line-height differences, but the essence is a character is roughly 9px wide and 15px high.
After all, what's important is this result
(-1,0) (-1,9) (14,0) (14,9) (14,18) (29,9) (59,0)
is too different from the "theoretical" result
(0,0) (0,9) (15,0) (15,9) (30,0) (45,0) (60,0)
What I claim is I can accept 1px variances so only the 2nd last and 3rd last values are truly wrong.
,
Mar 3 2017
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 9 2017
Able to reproduce the issue on windows 7, Ubuntu 14.04 and Mac 10.12.3 using chrome version 56.0.2924.87 and canary 59.0.3035.0. This is non regression issue as the issue seen from M40 old builds. Marking it as Untriaged to get more inputs from dev. Thanks,
,
Mar 9 2017
,
Mar 21 2017
I uploaded the patch for this issue (https://codereview.chromium.org/2763013002/)
,
Mar 29 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/19d5f8b3d7cd8ba33ba3f2dd331c339384b299dd commit 19d5f8b3d7cd8ba33ba3f2dd331c339384b299dd Author: wanchang.ryu <wanchang.ryu@lge.com> Date: Wed Mar 29 07:10:23 2017 Fix incorrect bounding box position for '\n' absoluteQuadsForRange function generates unrealted empty quads with even not overlapping InlineTextBox. This fix considers inclusive InlineTextbox, overlapping InlineTextbox, and exclusive InlineTextbox cases separately. Considering exclusive InlineTextbox is still required because non rendering characters(e.g. whitespace) are missing and to cover if range offset is only in this area. BUG= 698038 Review-Url: https://codereview.chromium.org/2763013002 Cr-Commit-Position: refs/heads/master@{#460310} [add] https://crrev.com/19d5f8b3d7cd8ba33ba3f2dd331c339384b299dd/third_party/WebKit/LayoutTests/fast/dom/Range/getBoundingClientRect-linebreak-character.html [modify] https://crrev.com/19d5f8b3d7cd8ba33ba3f2dd331c339384b299dd/third_party/WebKit/Source/core/layout/LayoutText.cpp
,
Aug 28 2017
Is there any good Bug Components for CSSOM?
,
Aug 29 2017
,
Oct 18 2017
hayato@, I just checked the test case provided by the original report and it seems fixed. is there any further work needed?
,
Oct 18 2017
Ah, I just re-labeled this bug. Let's close this if this seems fixed. |
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by siul...@gmail.com
, Mar 2 2017654 bytes
654 bytes View Download