> 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