New issue
Advanced search Search tips
Starred by 11 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocked on:
issue 651764
issue 705478



Sign in to add a comment
link

Issue 573309: We should make Element#innerText to behave as the spec

Reported by laukst...@gmail.com, Dec 30 2015

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36

Steps to reproduce the problem:
http://rocallahan.github.io/innerText-spec/ is WHATWG approved innerText spec (https://github.com/whatwg/compat/issues/5#issuecomment-168049752)

What is the expected behavior?

What went wrong?
Tests:
Setting innerText http://rocallahan.github.io/innerText-spec/setter-tests.html (24 passes)
Getting innerText http://rocallahan.github.io/innerText-spec/getter-tests.html (120 passes, 67 fails)

Tested on Chrome 49.0.2607.0 canary (64-bit)

Did this work before? No 

Chrome version: 47.0.2526.106  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 20.0 r0

Any issues on that can be raised against https://github.com/rocallahan/innerText-spec/issues

Firefox Nightly 46 passes all tests, support landed in Firefox 45 https://bugzilla.mozilla.org/show_bug.cgi?id=264412
 

Comment 1 by ranjitkan@chromium.org, Dec 31 2015

Labels: TE-NeedsFurtherTriage

Comment 2 by tkent@chromium.org, Jan 4 2016

Cc: yosin@chromium.org
Labels: -Cr-Blink Cr-Blink-HTML

Comment 3 by dominicc@chromium.org, Jan 14 2016

Labels: -OS-Windows -TE-NeedsFurtherTriage OS-all Hotlist-Interop
Status: Available

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

Cc: tkent@chromium.org
 Issue 639064  has been merged into this issue.

Comment 5 by tkent@chromium.org, Oct 5 2016

Blockedon: 651572

Comment 6 by tkent@chromium.org, Nov 21 2016

Blockedon: -651572 651764

Comment 7 by bugdroid1@chromium.org, Nov 21 2016

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/63d26d050ffc4707fabaef0cac4206f8118cea45

commit 63d26d050ffc4707fabaef0cac4206f8118cea45
Author: tkent <tkent@chromium.org>
Date: Mon Nov 21 09:51:56 2016

WPT: Request to import domparsing, domxpath, and innerText.

BUG= 651752 ,  651757 , 573309
NOTRY=true

Review-Url: https://codereview.chromium.org/2516983003
Cr-Commit-Position: refs/heads/master@{#433500}

[modify] https://crrev.com/63d26d050ffc4707fabaef0cac4206f8118cea45/third_party/WebKit/LayoutTests/W3CImportExpectations

Comment 8 by zcorpan@gmail.com, Nov 29 2016

Also see:
innerText: include parentheses around <rt> if there's no <rp>
https://github.com/whatwg/html/issues/1801

Comment 9 by zcorpan@gmail.com, Mar 14 2017

From dup  Issue 639064 

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

https://github.com/w3c/web-platform-tests/pull/3492 just landed with these new failures for this case:

Start with CR	FAIL	assert_not_equals: Should not have empty text nodes got disallowed value ""
Start with LF	FAIL	assert_not_equals: Should not have empty text nodes got disallowed value ""
Start with CRLF	FAIL	assert_not_equals: Should not have empty text nodes got disallowed value ""

Comment 10 by tkent@chromium.org, Mar 27 2017

Blockedon: 705478

Comment 11 by yosin@chromium.org, May 31 2017

Summary: We should make Element#innerText to behave as the spec (was: innerText spec)

Comment 12 by sheriffbot@chromium.org, May 31 2018

Project Member
Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 13 by tkent@chromium.org, Jun 1 2018

Status: Available (was: Untriaged)

Comment 14 by tkent@chromium.org, Jun 20 2018

 Issue 854177  has been merged into this issue.

Comment 15 by bugdroid1@chromium.org, Oct 22

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fa583784527c3c1575f1145d31c79c6733176d38

commit fa583784527c3c1575f1145d31c79c6733176d38
Author: Sunny <ratsunny@gmail.com>
Date: Mon Oct 22 05:50:45 2018

Align some set innerText behavior with standard

According to spec[1], when a string starts with CR/LF set as innerText,
the first child node should not be an empty text node. So we adjust the
logic in HTMLElement::TextToFragment to make sure it follows the spec.

Besides, same in spec[1], there is no special procedure for setting
innerText when the element is being rendered and styled as preserving
new line, so corresponding code was removed in this commit.

15 failed wpt tests could be passed after this change.

[1] https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute

Bug: 573309,  705478 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I6765601a14c2e95cec3841e084046da79aca065c
Reviewed-on: https://chromium-review.googlesource.com/c/1266728
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601480}
[modify] https://crrev.com/fa583784527c3c1575f1145d31c79c6733176d38/third_party/WebKit/LayoutTests/external/wpt/html/dom/elements/the-innertext-idl-attribute/setter-expected.txt
[modify] https://crrev.com/fa583784527c3c1575f1145d31c79c6733176d38/third_party/blink/renderer/core/html/html_element.cc

Sign in to add a comment