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

Manuel Rego Casasnovas rego at igalia.com
Fri Dec 20 02:58:34 PST 2013


Hi Yosi,

On 20/12/13 02:37, Yoshifumi Inoue wrote:> 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.

Ok, I guess that it could be something similar to the RenderIterator
that has been recently introduced in WebKit:
http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderIterator.h

> I'm not clear about traversing doesn't solve CSS region selection. Does
> it come from current implementation? Or, is traversing wrong idea?

What I mean is that regular traverse of the render tree won't fix
selection issues in CSS Regoins (neither in absolute positions for
example).

Let me explain with a simple example:
http://people.igalia.com/mrego/css/regions/example.html

The Render tree is something like:
RenderView
  RenderHTML
    RenderBody
      RenderBlock content-1
      RenderRegion region-1
      RenderBlock content-2
  RenderFlowThread
    RenderBlock source-1

However visually you get something like:
content-1
region-1
  source-1
content-2

If you select from "content-1" to "content-2" and you traverse render
tree, you won't process "source-1".

So, we'd need some special conditions for CSS Regions in the
RenderIterator, to jump to the RenderFlowThread subtree (and the other
way around) when needed. I guess this is ok, as it's an implementation
detail.

> 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.

I agree that this will be after TextIterator, just trying to understand
the whole picture.

About changing the selection I'm thinking in RenderView::setSelection()
method. This method should also use the RenderIterator instead of
regular render tree traversing to fix the problem.

BTW, where can I find information about that new API
"Selection.getNodeSet(scope)"? It is not in the editing spec [1].

Thanks,
   Rego

[1] https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selection



More information about the webkit-dev mailing list