This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25159 - Specify HTMLElement.innerText and outerText
Summary: Specify HTMLElement.innerText and outerText
Status: RESOLVED DUPLICATE of bug 13145
Alias: None
Product: WHATWG
Classification: Unclassified
Component: Unwelcome (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Michael[tm] Smith
QA Contact: sideshowbarker+unwelcome
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-26 16:42 UTC by contributor
Modified: 2014-09-17 02:36 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2014-03-26 16:42:34 UTC
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)
Comment 1 Philip Jägenstedt 2014-03-26 16:44:24 UTC
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.
Comment 2 Ian 'Hixie' Hickson 2014-03-31 17:10:59 UTC
Do you have a definition I could use to spec them? Last I checked, I couldn't figure out what they did.
Comment 3 Philip Jägenstedt 2014-03-31 18:14:11 UTC
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.
Comment 4 Simon Pieters 2014-03-31 20:42:52 UTC
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
Comment 6 Ian 'Hixie' Hickson 2014-05-07 20:43:59 UTC
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.
Comment 7 Ian 'Hixie' Hickson 2014-09-17 02:36:05 UTC

*** This bug has been marked as a duplicate of bug 13145 ***