[webkit-dev] A Range question

Finnur Thorarinsson finnur at chromium.org
Fri Apr 9 10:52:06 PDT 2010


Hi all,

I need a WebKit "Ranger" for this question:

Imagine I have the word "Foo" inside an edit field (input type=text
value="Foo") and the word "bar" outside of it, like so: [Foo]bar

If I try to create a Range of the text Foobar, the range will get collapsed.

It collapses because Range::setEnd has a |start| inside the shadow tree and
an |end| outside of it. Specifically, setEnd walks up the parent chain for
both |start| and |end| (to see if they share the same root container), but
doesn't reach the top for |start| because while walking up the parent list
it stops on a shadow node (TextControlInnerTextElement), which has only a
shadow parent.

Is this expected? Is this a bug? Is the right fix to have it walk up the
shadow parent for shadow nodes?

Best regards,
Finnur

PS. I believe this is the root cause for
https://bugs.webkit.org/show_bug.cgi?id=25868, which was a regression caused
by the fix for https://bugs.webkit.org/show_bug.cgi?id=7023.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100409/a3a2fb48/attachment.html>


More information about the webkit-dev mailing list