Chrome Version: Version 61.0.3142.1 (Official Build) canary SyzyASan (32-bit) Per the recently-clarified specification for textarea.defaultValue in https://github.com/whatwg/html/pull/2766, setting defaultValue should act like setting textContent. (In fact, this was the case with the old specification as well.) This means it should wipe out any children of the textarea. The tests at http://w3c-test.org/submissions/6256/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html show that this is not the case in Chrome. The tests will 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.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6a53ba2305e2d0196d8f46f8590e0ad1fa45d636 commit 6a53ba2305e2d0196d8f46f8590e0ad1fa45d636 Author: Shanmuga Pandi M <shanmuga.m@samsung.com> Date: Tue Jul 25 15:07:16 2017 Setting textArea.defaultValue should wipe out any children. On setting, it must act as the setter for the element's textContent IDL attribute and it should not normalize line endings. spec: https://html.spec.whatwg.org/multipage/form-elements.html#dom-textarea-defaultvalue Bug: 737138 Change-Id: Ib4973e72b168b083e522d8fd91262a9868cf6523 Reviewed-on: https://chromium-review.googlesource.com/579227 Commit-Queue: Kent Tamura <tkent@chromium.org> Reviewed-by: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#489300} [delete] https://crrev.com/a9f278a0500975315f87c79e1f2dca81a2f79a05/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-textarea-element/value-defaultValue-textContent-expected.txt [modify] https://crrev.com/6a53ba2305e2d0196d8f46f8590e0ad1fa45d636/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html [modify] https://crrev.com/6a53ba2305e2d0196d8f46f8590e0ad1fa45d636/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-selection-preservation-expected.txt [modify] https://crrev.com/6a53ba2305e2d0196d8f46f8590e0ad1fa45d636/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-selection-preservation.html [modify] https://crrev.com/6a53ba2305e2d0196d8f46f8590e0ad1fa45d636/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c008e20c9be6564277df6faab48984c627028758 commit c008e20c9be6564277df6faab48984c627028758 Author: Kent Tamura <tkent@chromium.org> Date: Fri Jul 28 04:02:19 2017 Revert "Setting textArea.defaultValue should wipe out any children." This reverts commit 6a53ba2305e2d0196d8f46f8590e0ad1fa45d636. Reason for revert: A serious regression. crbug.com/749729 Original change's description: > Setting textArea.defaultValue should wipe out any children. > > On setting, it must act as the setter for the element's > textContent IDL attribute and it should not normalize line endings. > > spec: > https://html.spec.whatwg.org/multipage/form-elements.html#dom-textarea-defaultvalue > > Bug: 737138 > Change-Id: Ib4973e72b168b083e522d8fd91262a9868cf6523 > Reviewed-on: https://chromium-review.googlesource.com/579227 > Commit-Queue: Kent Tamura <tkent@chromium.org> > Reviewed-by: Kent Tamura <tkent@chromium.org> > Cr-Commit-Position: refs/heads/master@{#489300} TBR=tkent@chromium.org,shanmuga.m@samsung.com,domenic@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 737138 , 749729 Change-Id: Iadf1d385478f5545e1cf0c9ef903f4797557066e Reviewed-on: https://chromium-review.googlesource.com/590827 Reviewed-by: Kent Tamura <tkent@chromium.org> Commit-Queue: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#490253} [add] https://crrev.com/c008e20c9be6564277df6faab48984c627028758/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-textarea-element/value-defaultValue-textContent-expected.txt [modify] https://crrev.com/c008e20c9be6564277df6faab48984c627028758/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html [modify] https://crrev.com/c008e20c9be6564277df6faab48984c627028758/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-selection-preservation-expected.txt [modify] https://crrev.com/c008e20c9be6564277df6faab48984c627028758/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-selection-preservation.html [modify] https://crrev.com/c008e20c9be6564277df6faab48984c627028758/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
Similar issue like Bug 749729 is seen with "textContent". <textarea id="x"></textarea> <script> x.addEventListener('input', function(e) { x.textContent= x.value; }); </script>
Comment 1 by tkent@chromium.org
, Jun 29 2017Status: Available (was: Untriaged)