Bug 173878 - Match newly-clarified spec on textarea defaultValue/value/child text content
Summary: Match newly-clarified spec on textarea defaultValue/value/child text content
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-27 09:21 PDT by Domenic Denicola
Modified: 2017-08-04 13:50 PDT (History)
6 users (show)

See Also:


Attachments
WIP Patch (12.53 KB, patch)
2017-08-04 10:21 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (15.59 KB, patch)
2017-08-04 11:26 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (20.11 KB, patch)
2017-08-04 11:29 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Domenic Denicola 2017-06-27 09:21:51 PDT
In https://github.com/whatwg/html/issues/2752 and https://github.com/whatwg/html/issues/2750 it was discovered that various aspects of the textarea spec were confusing and did not match browser behavior (which was generally not interoperable).

In https://github.com/whatwg/html/pull/2766 we settled on a reasonable set of semantics that matched most browsers in most aspects and was simple to implement. The main changes are:

> The child text content change steps for textarea elements must, if the element's dirty value flag is false, set the element's raw value to its child text content.

> The defaultValue IDL attribute must, on getting, return the element's child text content. On setting, it must act as the setter for the element's textContent IDL attribute.

These are tested by the tests at http://w3c-test.org/submissions/6256/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html (which will eventually end up at http://w3c-test.org/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html when https://github.com/w3c/web-platform-tests/pull/6256 is merged).

Safari Tech Preview matches most aspects of the new semantics, with the following exceptions:

- The defaultValue getter should reflect the child text content, not the textContent (= "descendant text content"). This harmonizes it with what is actually rendered, and with the value property.
- The defaultValue setter should act as the textContent setter, i.e. it should wipe out all child nodes in addition to adding a new text node.
Comment 1 Chris Dumez 2017-08-04 10:21:26 PDT
Created attachment 317255 [details]
WIP Patch
Comment 2 Chris Dumez 2017-08-04 11:26:19 PDT
Created attachment 317261 [details]
Patch
Comment 3 Chris Dumez 2017-08-04 11:29:29 PDT
Created attachment 317262 [details]
Patch
Comment 4 WebKit Commit Bot 2017-08-04 13:49:56 PDT
Comment on attachment 317262 [details]
Patch

Clearing flags on attachment: 317262

Committed r220290: <http://trac.webkit.org/changeset/220290>
Comment 5 WebKit Commit Bot 2017-08-04 13:49:58 PDT
All reviewed patches have been landed.  Closing bug.