You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would need further analysis to get a sense of the impact; some of these are dead code (fallback for textContent), but some could be affecting behavior, e.g. reftagger.js has this
It seems to me it is a shorter path to interop if Gecko adds outerText than for everyone else to drop it. It's also a simple addition, as far as I can tell.
It's also a simple addition, as far as I can tell.
Is it? Do we know what outerText should do? If it is just a variant of the same algorithm as innerText, then adding it sounds ok, but I don't know how it has been implemented.
The outerText getter is an alias of innerText in Blink, but the setters actually don't share much code. The outerText setter looks a lot like outerHTML's though.
If usage were minuscule and removing it would simplify matters it's not unthinkable, but I wonder if it would simplify anything. @zcorpan, what do you think this would look like in spec terms?
The setter I thought would be like outerHTML's setter but instead of parsing HTML you construct a DocumentFragment using the same logic as in the innerText setter.
It turns out there are a few differences between Chromium and Edge 13 for outerText, and for outerHTML there's a difference between Edge 13 and IE 11.
Chromium does not allow setting outerText on br et. al., but Edge 13 and IE 11 do. This seems like a bug in Chromium (and the spec for innerText allows setting on any HTML element, same as innerHTML).
Chromium merges adjacent text nodes before/after the replaced element for outerText and outerHTML. This causes 3 mutation records in total. Edge 13 and IE 11 do the same for outerText, but this causes only 2 mutation records. Edge 13 (and Gecko) do not merge text nodes for outerHTML; 1 mutation record.
The spec for outerHTML does not say to merge text nodes. I don't see much point in doing that, and if Edge has already changed outerHTML to not do it, maybe could also change outerText to stop merging text nodes?
Activity
Ms2ger commentedon Feb 10, 2016
Is this necessary for compat?
annevk commentedon Feb 10, 2016
Paging @miketaylr.
cvrebert commentedon Aug 18, 2016
So, any interest in this now that innerText got merged (#1678)? @miketaylr ?
rniwa commentedon Oct 12, 2016
This is necessary for compat. All but Gecko supported this property for ages.
Ms2ger commentedon Oct 12, 2016
Do you have data to back that up? Gecko does not seem to ever have hit compat issues because of this.
zcorpan commentedon Oct 17, 2016
Use counter currently around 0.1%
https://www.chromestatus.com/metrics/feature/timeline/popularity/214
httparchive
1317 rows; top 10 rows are
Note that a
urlcan have multiplepages.Full results at
https://gist.github.com/zcorpan/5f3dc4c37367b8551e9295892b0aeb66
Would need further analysis to get a sense of the impact; some of these are dead code (fallback for
textContent), but some could be affecting behavior, e.g. reftagger.js has thiszcorpan commentedon Oct 18, 2016
It seems to me it is a shorter path to interop if Gecko adds
outerTextthan for everyone else to drop it. It's also a simple addition, as far as I can tell.Looking through https://github.com/search?l=JavaScript&q=outertext+gecko&ref=searchresults&type=Code&utf8=✓ I mostly see polyfills of
outerTextor straight usage of it, rather than it being used for browser sniffing. So adding it for Gecko seems like it would be a small web compat win, and relatively low risk.@Ms2ger do you object to adding this to Gecko?
Ms2ger commentedon Oct 18, 2016
I would prefer not to add, but I have no decision power for Gecko :)
zcorpan commentedon Oct 19, 2016
@smaug---- WDYT?
smaug---- commentedon Oct 19, 2016
Is it? Do we know what outerText should do? If it is just a variant of the same algorithm as innerText, then adding it sounds ok, but I don't know how it has been implemented.
foolip commentedon Oct 19, 2016
The outerText getter is an alias of innerText in Blink, but the setters actually don't share much code. The outerText setter looks a lot like outerHTML's though.
domenic commentedon Oct 19, 2016
I wonder what the usage rates of the getter vs. setter are. Although even if the setter is low, I can't imagine 3 browsers will want to remove it.
foolip commentedon Oct 19, 2016
If usage were minuscule and removing it would simplify matters it's not unthinkable, but I wonder if it would simplify anything. @zcorpan, what do you think this would look like in spec terms?
zcorpan commentedon Oct 20, 2016
The getter would just be an alias of innerText.
The setter I thought would be like outerHTML's setter but instead of parsing HTML you construct a DocumentFragment using the same logic as in the innerText setter.
It turns out there are a few differences between Chromium and Edge 13 for outerText, and for outerHTML there's a difference between Edge 13 and IE 11.
bret. al., but Edge 13 and IE 11 do. This seems like a bug in Chromium (and the spec for innerText allows setting on any HTML element, same as innerHTML).The spec for outerHTML does not say to merge text nodes. I don't see much point in doing that, and if Edge has already changed outerHTML to not do it, maybe could also change outerText to stop merging text nodes?
Tests
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4590
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4591
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4592
miketaylr commentedon Oct 20, 2016
(whoops, these pings got lost in my inbox... 😞)
It would be cool to see actual broken pages. Looking at https://gist.github.com/zcorpan/5f3dc4c37367b8551e9295892b0aeb66 from @zcorpan I see a ton of (minified) TinyMCE usage.
But that function is only used in an IE codepath:
Makes me wonder about the other results.
All the dojo usage is in an IE codepath as well:
this.applyTextDir(node,has("ie")?node.outerText:node.textContentSpecify outerText
Specify outerText