This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://www.whatwg.org/specs/web-apps/current-work/ Multipage: http://www.whatwg.org/C#elements-in-the-dom Complete: http://www.whatwg.org/c#elements-in-the-dom Referrer: Comment: Specify HTMLElement.innerText and outerText Posted from: 113.23.85.162 User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36 OPR/20.0.1387.59 (Edition Next)
I added counters to see if these could be dropped from Blink, but they're used a lot: http://www.chromestatus.com/metrics/feature/timeline/popularity/213 http://www.chromestatus.com/metrics/feature/timeline/popularity/214 In my ad-hoc testing Firefox is the only browser to not support it, so specifying it seems like the path of least resistance. HTML, DOM, or DOM Parsing and Serialization seems like the place for this, so I'm starting with where HTMLElement is defined. I guess it wouldn't hurt to put it on Element, but that's not required for Web compat, or at least it's not where Blink/WebKit puts it.
Do you have a definition I could use to spec them? Last I checked, I couldn't figure out what they did.
I had a look at Blink and had no idea innerText was this crazy. The innerText getter uses the line boxes from the render tree in some way, but falls back to just textContent in the absence of a renderer. The outerText getter is just an alias for innerText. The innerText setters replaces newlines in the input with <br> elements, but also has some scary things involving the rendered. The outerText setter looks more sane, I think it just replaces newlines with <br>. I think maybe a sensible first attempt would be to reverse engineer the interoperable subset of how these properties work on elements not inserted into a document, which would be something like a "semantic textContent". If it turns out that applying CSS is needed for Web compat, this is going to be pretty ugly. I can help out with Blink use counters to determine what's Web compatible and not.
Aryeh worked on a spec for it before. It seems it's gone but I found some backup: https://rawgithub.com/jackcviers/Rangy/master/spec/innerText.htm See http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-February/030179.html Also Selection.toString() supposedly should do the same thing as innerText. https://www.w3.org/Bugs/Public/show_bug.cgi?id=10583 https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-selection-stringifier
https://web.archive.org/web/20110205234444/http://aryeh.name/spec/innertext/test/innerText.html relic from the tests.
I think the first step here is figuring out what these actually need to be. If it depends on CSS, which it seems likely to, then this is probably at best something for CSSOM.
*** This bug has been marked as a duplicate of bug 13145 ***