New issue
Advanced search Search tips

Issue 639064 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 573309
Owner: ----
Closed: Aug 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Align the innerText setter with the HTML spec and Gecko

Project Member Reported by zcorpan@gmail.com, Aug 18 2016

Issue description

See https://github.com/whatwg/html/issues/1679

Chromium throws for <br>.innerText = "x" etc, The spec and Gecko do 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

Chromium will update existing text node's data if element has just 1 text node.
The HTML spec and Gecko always replace with a new 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

If the assigned value starts with a newline, WebKit/Chromium inserts an empty text node, the spec/Gecko/IE don't.

Spec at https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute

Tests at https://github.com/w3c/web-platform-tests/tree/master/innerText (these might get moved to html/ or something later)
 

Comment 2 by tkent@chromium.org, Aug 19 2016

Mergedinto: 573309
Status: Duplicate (was: Untriaged)

Sign in to add a comment