Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update textarea textContent/defaultValue/value interaction #2766

Merged
merged 1 commit into from Jun 27, 2017

Conversation

domenic
Copy link
Member

@domenic domenic commented Jun 15, 2017

This fixes #2752, where it was revealed that most browsers do not care
about the textContent of a textarea, but instead about its child text
content. That is, if you use the DOM APIs to insert a child element into
the textarea element, its text does not show up for editing or as part
of the value and defaultValue properties (even though it shows up in
textContent).

This moves to a model where textareas operate entirely on the child text
content. This matches Blink and Gecko, and somewhat matches WebKit.

This also fixes #2750, by using the newly-introduced "child text content
change steps" hook introduced to DOM in
whatwg/dom#466.

/cc @bzbarsky @zcorpan @tkent-google @cdumez @travisleithead

Tests: web-platform-tests/wpt#6256 (managed to find a Chrome bug!)

Do not merge yet until DOM PR it depends on is approved/merged.

This fixes #2752, where it was revealed that most browsers do not care
about the textContent of a textarea, but instead about its child text
content. That is, if you use the DOM APIs to insert a child element into
the textarea element, its text does not show up for editing or as part
of the value and defaultValue properties (even though it shows up in
textContent).

This moves to a model where textareas operate entirely on the child text
content. This matches Blink and Gecko, and somewhat matches WebKit.

This also fixes #2750, by using the newly-introduced "child text content
change steps" hook introduced to DOM in
whatwg/dom#466.
domenic added a commit to web-platform-tests/wpt that referenced this pull request Jun 15, 2017
@domenic domenic added the do not merge yet Pull request must not be merged per rationale in comment label Jun 15, 2017
@bzbarsky
Copy link
Contributor

Looks good to me, fwiw.

@domenic domenic added interop Implementations are not interoperable with each other and removed do not merge yet Pull request must not be merged per rationale in comment labels Jun 22, 2017
@domenic domenic merged commit 5afbba1 into master Jun 27, 2017
@domenic domenic deleted the textarea-textcontent branch June 27, 2017 16:09
@domenic
Copy link
Member Author

domenic commented Jun 27, 2017

domenic added a commit to web-platform-tests/wpt that referenced this pull request Jun 27, 2017
domenic added a commit to web-platform-tests/wpt that referenced this pull request Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interop Implementations are not interoperable with each other normative change topic: forms
3 participants