[Webkit-unassigned] [Bug 182181] Range getBoundingClientRect returning zero rect on simple text node with <br> before it

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 8 07:32:35 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=182181

--- Comment #8 from Gabe Giosia <giosia at google.com> ---
I first started seeing this bug sometime around iOS11; It seems to have been introduced in https://trac.webkit.org/changeset/212693/webkit

I have worked around the bug by wrapping text in a span-tag when using Range.getBoundingClientRect(). Starting a Range in an in-line-level element live a span(rather than block-element like a div) bypasses the buggy code by disabling the use of simpleLineLayout. Using this span-wrap-hack has many side-effects and isn't ideal(dom modification, CSS selector breakage, etc).

It's likely possible that some of the simpleLineLayout bypass-code can also be removed. 
e.g.
>    if (simpleLineLayout() && parent()->firstChild() == parent()->lastChild()) {

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190308/0b1d24cb/attachment.html>


More information about the webkit-unassigned mailing list