[webkit-dev] [blink-dev] Selection & CSS Regions

Manuel Rego Casasnovas rego at igalia.com
Thu Dec 19 09:39:11 PST 2013

Hi Yosi,

On 19/12/13 02:17, Yoshifumi Inoue wrote:
> Selection for Shadow DOM tree is similar to CSS Region. Shadow DOM tree
> also randomizes rendering order against (shadow/non-shadow) DOM tree order.
> Using render tree information for selection also allows us to handle
> position:absolute elements, e.g. advertised elements displayed displayed
> at page bottom.
> We have a plan to make TextIterator to traverse Render Tree rather than
> DOM tree for ease and robust support of Shadow DOM tree.

Let me check if I understand your mail properly.

You're talking about fixing the selection from the user point of view
forgetting about selection being always DOM based (like in editing

For example in the following page with absolute positions, the idea
would be that when you select from content-1 to content-2, absolute-1
text is not selected:

I agree that this would be the best solution from the user point of

So, if I'm not wrong, the plan is to make TextIterator traverse the
render tree, so things like shadow DOM, absolute positions or CSS
Regions could be properly traversed.

I'm wondering if the next step would be that selection's algorithms
use TextIterator to traverse the render tree too or not. If not I
guess that similar changes should be needed in rendering code.

As a side note, in CSS Regions it might be needed to jump from a
RenderRegion to its content in the RenderFlowThread and the other way
around. That could be done in TextIterator as we'll have all render
tree information. Directly traverse of the render tree won't fix the
issue in CSS Regions.

Thanks for your feedback,

PS: I've been testing different layout models (shadow DOM, absolute
positions, flexbox and regions) checking selection's behavior, you can
find a summary at:

More information about the webkit-dev mailing list