Re: Spec'ing innerText (Was Re: [Editing] Splitting Selection API Into a Separate Specification)

2014-04-13 Thread Ryosuke Niwa

 On Apr 13, 2014, at 5:21 AM, Aryeh Gregor a...@aryeh.name wrote:
 
 On Fri, Apr 11, 2014 at 9:05 PM, Ryosuke Niwa rn...@apple.com wrote:
 Thanks for the pointer.
 
 Unfortunately, we might need to take a slightly different approach more 
 based on the CSS box tree because whitespace collapsing, etc... are defined 
 in CSS2.1 and CSS level 3 specifications.
 
 As far as I know, CSS does not define the box tree with nearly enough
 precision to allow basing a precise innerText spec on it.  From
 black-box testing at the time I wrote the spec, it seemed to me that
 WebKit's implementation was built on some sort of internal CSS
 representation that does not match anything that currently exists in
 spec-land.  So I'm skeptical of the feasibility of this approach until
 someone rewrites CSS in a more precise fashion.  I also don't know if
 all implementations could support such an approach at all -- IIRC, I
 was told that for Gecko to even support display:none in
 Selection.toString was difficult.

Right, but the reason WebKit's implementation doesn't match any spec is because 
there is no spec!  With a sufficiently precise spec, we should be able to 
converge at least on innerText.

Having said that, I do agree we need to consult with CSS WG to have a more 
precise spec. for text layout in order to spec innerText.

- R. Niwa



Spec'ing innerText (Was Re: [Editing] Splitting Selection API Into a Separate Specification)

2014-04-11 Thread Ryosuke Niwa

On Apr 11, 2014, at 7:09 AM, Domenic Denicola dome...@domenicdenicola.com 
wrote:

 From: Ryosuke Niwa [mailto:rn...@apple.com] 
 
 Given defining innerText is completely outside the scope of the selection 
 API specification, we might need to defer this part to a level 2 
 specification since the only alternative is to wait for someone to write a 
 innerText spec.
 
 I don't know all the history here, but this bug and proto-spec seems relevant:
 
 - https://www.w3.org/Bugs/Public/show_bug.cgi?id=13145
 - 
 https://web.archive.org/web/20121127212525/http://aryeh.name/spec/innertext/innertext.html
 
 The work already done on this might make including innerText-dependent 
 features more feasible.


Thanks for the pointer.

Unfortunately, we might need to take a slightly different approach more based 
on the CSS box tree because whitespace collapsing, etc... are defined in CSS2.1 
and CSS level 3 specifications.

- R. Niwa