<div dir="ltr">I would like to provide render tree iterator base rendered position from Render Tree for TextIterator, Selection, and others. TextIterator is the first client of its. <div><br></div><div>I'm not clear about traversing doesn't solve CSS region selection. Does it come from current implementation? Or, is traversing wrong idea?</div>
<div><br></div><div>BTW, changing selection will be after TextIterator, because exposing selected node to JavaScript needs new API, e.g. Selection.getNodeSet(scope). So, it will come later.<div><br></div><div>Thanks!</div>
<div>-yosi</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 20, 2013 at 2:39 AM, Manuel Rego Casasnovas <span dir="ltr"><<a href="mailto:rego@igalia.com" target="_blank">rego@igalia.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Yosi,<br>
<div class="im"><br>
On 19/12/13 02:17, Yoshifumi Inoue wrote:<br>
> Selection for Shadow DOM tree is similar to CSS Region. Shadow DOM tree<br>
> also randomizes rendering order against (shadow/non-shadow) DOM tree order.<br>
><br>
> Using render tree information for selection also allows us to handle<br>
> position:absolute elements, e.g. advertised elements displayed displayed<br>
> at page bottom.<br>
><br>
> We have a plan to make TextIterator to traverse Render Tree rather than<br>
> DOM tree for ease and robust support of Shadow DOM tree.<br>
<br>
</div>Let me check if I understand your mail properly.<br>
<br>
You're talking about fixing the selection from the user point of view<br>
forgetting about selection being always DOM based (like in editing<br>
spec).<br>
<br>
For example in the following page with absolute positions, the idea<br>
would be that when you select from content-1 to content-2, absolute-1<br>
text is not selected:<br>
<a href="http://people.igalia.com/mrego/css/absolute/example.html" target="_blank">http://people.igalia.com/mrego/css/absolute/example.html</a><br>
<br>
I agree that this would be the best solution from the user point of<br>
view.<br>
<br>
So, if I'm not wrong, the plan is to make TextIterator traverse the<br>
render tree, so things like shadow DOM, absolute positions or CSS<br>
Regions could be properly traversed.<br>
<br>
I'm wondering if the next step would be that selection's algorithms<br>
use TextIterator to traverse the render tree too or not. If not I<br>
guess that similar changes should be needed in rendering code.<br>
<br>
As a side note, in CSS Regions it might be needed to jump from a<br>
RenderRegion to its content in the RenderFlowThread and the other way<br>
around. That could be done in TextIterator as we'll have all render<br>
tree information. Directly traverse of the render tree won't fix the<br>
issue in CSS Regions.<br>
<br>
Thanks for your feedback,<br>
Rego<br>
<br>
PS: I've been testing different layout models (shadow DOM, absolute<br>
positions, flexbox and regions) checking selection's behavior, you can<br>
find a summary at:<br>
<a href="https://github.com/Igalia/css-regions-selection/wiki/Selection-&-Other-layout-models" target="_blank">https://github.com/Igalia/css-regions-selection/wiki/Selection-&-Other-layout-models</a><br>
<br>
</blockquote></div><br></div>