New issue
Advanced search Search tips
Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 28
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 781434
issue 852470

Blocking:
issue 573309
issue 854889
issue 651572



Sign in to add a comment
link

Issue 651764: Element#innerText should be spec complaint

Reported by foolip@chromium.org, Sep 30 2016 Project Member

Issue description

http://w3c-test.org/innerText/getter.html

The failure need analysis, but may point to low-hanging fruit for improving interop. Judgement is required, the failure may be entangled with spec issues.

See  issue 651572  for the source of this data, which includes failing subtests.

Note: Results may have changed in the interim.
 

Comment 1 by yosin@chromium.org, Oct 4 2016

Status: Available (was: Untriaged)
Proposed to fix in Q4 2016

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

Blocking: 573309

Comment 3 by xiaoche...@chromium.org, Nov 13 2017

Blockedon: 781434
Summary: Failing web-platform-tests for innerText that passes in Firefox and Edge (was: Failing web-platform-tests for innterText that passes in Firefox and Edge)
We'll have massive layout test rebaseline since layout test text dumper uses innerText.

We may want a different text dumper for tests.

Comment 4 by yosin@chromium.org, Jun 22 2018

Blockedon: 852470
Labels: -Pri-3 Pri-2
Status: Started (was: Available)
Summary: Element#innerText should be spec complaint (was: Failing web-platform-tests for innerText that passes in Firefox and Edge)
See https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute
We'll use Element#innerText for testRunner.dumpAsText() to have robust layout
test expectations

Comment 5 by yosin@chromium.org, Jun 22 2018

Owner: yosin@chromium.org
accesibility/canvas-fallback-content-2.html has extra spaces around BUTTON element.

<div>Link  <button>Button</button><div>
=>
"Link  Button"

See https://jsfiddle.net/3v62a0oh/3/

Comment 6 by yosin@chromium.org, Jun 22 2018

W3C test result page mentioned in #c1 is moved to
http://w3c-test.org/html/dom/elements/the-innertext-idl-attribute/getter.html

Comment 7 by yosin@chromium.org, Jul 3 2018

Blocking: 854889

Comment 8 by bugdroid1@chromium.org, Jul 3 2018

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

commit d30e48a5a8919b534abfb22f78faf7b740350962
Author: Yoshifumi Inoue <yosin@chromium.org>
Date: Tue Jul 03 10:32:44 2018

Add a new test case for Element#innerText in Web Platform Test

This patch introduces a new test case for Element#innerText to verify that
result has a collapsed whitespace due by soft line break.

In the test case, the layout object associated to space character between
<span> elements, doesn't have neither InlineTextBox and NGPhysicalTextFragment.
Thus, Element#innerText implementation should detect this and handle it.

Bug:  651764 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: Ia25d06a2a3fe993f2e966188b81f9e9c1d0fe982
Reviewed-on: https://chromium-review.googlesource.com/1124264
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572164}
[modify] https://crrev.com/d30e48a5a8919b534abfb22f78faf7b740350962/third_party/WebKit/LayoutTests/external/wpt/html/dom/elements/the-innertext-idl-attribute/getter-expected.txt
[modify] https://crrev.com/d30e48a5a8919b534abfb22f78faf7b740350962/third_party/WebKit/LayoutTests/external/wpt/html/dom/elements/the-innertext-idl-attribute/getter-tests.js
[modify] https://crrev.com/d30e48a5a8919b534abfb22f78faf7b740350962/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/external/wpt/html/dom/elements/the-innertext-idl-attribute/getter-expected.txt

Comment 9 by bugdroid1@chromium.org, Aug 10

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/dom-distiller/+/8825eafdb337c80459bd5048bace9c53e6397b6c

commit 8825eafdb337c80459bd5048bace9c53e6397b6c
Author: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Date: Fri Aug 10 22:52:46 2018

In tests, render elements before getting their innerText

In the tests, make sure an element is rendered before getting its
innerText.

Bug:  651764 ,  873298 
Change-Id: I980a2bdaba85f8226eeba733b47ce53c56bf0dce
Reviewed-on: https://chromium-review.googlesource.com/1171590
Reviewed-by: Matthew Jones <mdjones@chromium.org>

[modify] https://crrev.com/8825eafdb337c80459bd5048bace9c53e6397b6c/javatests/org/chromium/distiller/IEReadingViewParserTest.java
[modify] https://crrev.com/8825eafdb337c80459bd5048bace9c53e6397b6c/javatests/org/chromium/distiller/DocumentTitleGetterTest.java

Comment 11 by bugdroid1@chromium.org, Aug 14

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

commit 81db97a9a7f000ed4133a9891781658945853ae3
Author: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Date: Tue Aug 14 00:10:11 2018

Roll DOM Distiller JavaScript distribution package

Diff since last roll:
https://chromium.googlesource.com/chromium/dom-distiller/+/9596033e36..ccfe233400

Picked up changes:
https://chromium.googlesource.com/chromium/dom-distiller/+log/9596033e36..ccfe233400
ccfe233 Fix EmbedExtractorTest.testDivCaption
8825eaf In tests, render elements before getting their innerText
8c9af2c Make generateOutput(textOnly=true) standard compliant

Bug:  651764 , 859410 , 873291 , 873298 
Change-Id: I66bf2c9a433751597fc4c7153ce5955e28dad064
Reviewed-on: https://chromium-review.googlesource.com/1171847
Reviewed-by: Matthew Jones <mdjones@chromium.org>
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582763}
[modify] https://crrev.com/81db97a9a7f000ed4133a9891781658945853ae3/DEPS
[modify] https://crrev.com/81db97a9a7f000ed4133a9891781658945853ae3/third_party/dom_distiller_js/README.chromium

Comment 12 by bugdroid1@chromium.org, Aug 24

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

commit 72d438ee5563db3087ea1f6630834343bdb8fb65
Author: Yoshifumi Inoue <yosin@chromium.org>
Date: Fri Aug 24 08:17:29 2018

Implement Element#innerText to conform the spec

NOT READY FOR COMMIT
To commit this patch, I need to do:
 - Rebaseline 9500+ layout files for linux, mac, win, since existing
 implementation doesn't conform the spec[1]
 - Fix DOM distiller bug[3]
  It depends on textContent(true) to have newline for <br>
  https://github.com/chromium/dom-distiller/issues/10
  WebTextTest.testGenerateOutputBRElements should have spec complaint test
  expectation
 - Fix CrSettingsSiteDetailsPermissionTest.All
   change expectations to have <option>s


This patch implements Element#innerText to conform the spec[1].
Pass rate of WPT is changed from 78 failures to 6 failures for 213 test cases.

The design doc is https://goo.gl/VW9xxe.

The differences of current implementations are:
 - No more leading/training newlines
 - No more trailing whitespaces
 - At most two newlines between sequences of <p> and <div>.
 - Contents of <select>, <optgroup> and <option> in result.
 - No newline for <br> for disconnected element.

Note: Handling of <select>, <optgroup> and <option> aren't conformed with the
spec[1] since the spec[1] requires to implement Element#innerText specific
CSS handling, ::first-line, ::first-letter, text-transform etc, for contents
of <option>. I filed the issue[2].


[1] https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute
[2] https://github.com/whatwg/html/issues/3797 innerText for <select>, <optgroup> and <option>

TBR=alexmos@chromium.org
TBR=dpapad@chromium.org
TBR=dmazzoni@chromium.org
TBR=skyostil@chromium.org

Bug:  651764 ,  859410 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I48a02db0347d8ebd189f3ef608b31a4a93d89e84
Reviewed-on: https://chromium-review.googlesource.com/1114673
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585756}
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/chrome/browser/chrome_security_exploit_browsertest.cc
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/chrome/test/data/webui/settings/site_details_permission_tests.js
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/content/test/data/accessibility/aria/aria-textbox-with-rich-text-expected-mac.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/content/test/data/accessibility/aria/aria-textbox-with-rich-text-expected-win.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/content/test/data/accessibility/html/contenteditable-descendants-expected-blink.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/content/test/data/accessibility/html/contenteditable-descendants-expected-mac.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/content/test/data/accessibility/html/contenteditable-descendants-expected-win.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/content/test/data/accessibility/html/contenteditable-descendants-with-selection-expected-blink.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/content/test/data/accessibility/html/contenteditable-descendants-with-selection-expected-mac.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/content/test/data/accessibility/html/contenteditable-descendants-with-selection-expected-win.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/content/test/data/accessibility/html/contenteditable-with-embedded-contenteditables-expected-blink.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/content/test/data/accessibility/html/contenteditable-with-embedded-contenteditables-expected-mac.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/content/test/data/accessibility/html/contenteditable-with-embedded-contenteditables-expected-win.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/headless/test/data/protocol/sanity/renderer-in-cross-origin-object-expected.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/accessibility/menu-list-sends-change-notification-expected.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/accessibility/multiselect-list-reports-active-option-expected.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/editing/pasteboard/innerText-inline-table.html
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/editing/pasteboard/newlines-around-floating-or-positioned.html
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/external/wpt/html/dom/elements/the-innertext-idl-attribute/getter-expected.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/fast/dom/inner-text-001-expected.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/fast/dom/inner-text-first-letter.html
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/fast/dom/inner-text-with-no-renderer.html
[delete] https://crrev.com/40f1a7556c25c113bf1f7fcd9b36cfe686051bc7/third_party/WebKit/LayoutTests/fast/forms/select/menulist-no-renderer-for-unexpected-children-expected.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/fast/forms/select/menulist-no-renderer-for-unexpected-children.html
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/external/wpt/html/dom/elements/the-innertext-idl-attribute/getter-expected.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/http/tests/devtools/editor/text-editor-indent-autodetection-expected.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/http/tests/devtools/help/release-note-expected.txt
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/WebKit/LayoutTests/http/tests/devtools/network/network-cookies-pane.js
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/blink/renderer/core/dom/element.cc
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/blink/renderer/core/dom/element.h
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/blink/renderer/core/editing/BUILD.gn
[add] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/blink/renderer/core/editing/element_inner_text.cc
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/blink/renderer/core/editing/ime/input_method_controller_test.cc
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/blink/renderer/core/editing/iterators/text_iterator_behavior.h
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/blink/renderer/core/exported/web_document.cc
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/blink/renderer/core/html/forms/html_option_element.cc
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/blink/renderer/core/html/forms/html_option_element.h
[modify] https://crrev.com/72d438ee5563db3087ea1f6630834343bdb8fb65/third_party/blink/renderer/core/layout/ng/inline/ng_physical_text_fragment.h

Comment 13 by yosin@chromium.org, Aug 28

Status: Fixed (was: Started)

Sign in to add a comment