Description
When working on #1678 I found the following issues.
cc @rocallahan
Getter
-
What should non-CSS UAs do? (45253f9)
-
Is "content order" for CSS boxes defined? (Step 2.5.) (Issue moved to [css-text] Define "content order" for innerText w3c/csswg-drafts#421 )
-
The
rp
check only works for direct children ofrp
, not descendants (e.g.<ruby><rp><span>(</span></rp>...
).
Do we want that to work? Or change the content model orrp
to "text"?
(Change <rp>'s content model to Text #1690) -
Issue inline in the spec:
This algorithm is amenable to being generalized to work on a ranges. Then we can use it as the basis for Selection's stringifier and maybe expose it directly on ranges. See Bugzilla bug 10583.
-
The only thing I'd consider changing further is making the recursion less declarative. Have that be some algorithm that is invoked for each child and also put the result in a variable of some kind the rest of the algorithm uses.
Yeah, it could use some more cleanup. Possibly also switch to iterative traversal instead of recursive?
Setter
-
The setter needs to be better defined, in terms of DOM concepts so mutation observers are invoked correctly etc. (0783a61)
-
innerText = null;
WebKit/Chromium "", Gecko/IE "null". (618de84 , Test innerText = ""/null/undefined web-platform-tests/wpt#3482) -
Chromium throws for
<br>.innerText = "x"
etc, Gecko does not.
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTMLElement.cpp?sq=package:chromium&dr=CSs&rcl=1471276009&l=140
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTMLElement.cpp?sq=package:chromium&dr=CSs&rcl=1471276009&l=454(Test that setting innerText on <br> etc doesn't throw web-platform-tests/wpt#3491)
-
Only update existing text node's data if element has just 1 text node?
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp?sq=package:chromium&dr=CSs&rcl=1471276009&l=640(innerText setter should replace existing text node web-platform-tests/wpt#3493)
-
If the assigned value starts with a newline, WebKit/Chromium insert an empty text node, Gecko/IE don't. (Current spec matches Gecko/IE.)
(innerText setter should not result in empty text nodes web-platform-tests/wpt#3492)
(Filed chromium bug 639064, webkit bug 160971, edge bug 8536472 for some of the above bullet points)
Other known issues
- should the innerText getter require layout? rocallahan/innerText-spec#2
- suggested tweak for explicit newline rocallahan/innerText-spec#3
- maybe add some tests for successive <pre> items rocallahan/innerText-spec#4 (Test innerText getter for two <pre> siblings web-platform-tests/wpt#3589)
- innerText should be supported for the <option> elements in a <select> rocallahan/innerText-spec#5 (Make <select> special in innerText #1717)