forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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> chromium/dom-distiller#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] whatwg/html#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}
- Loading branch information
Showing
39 changed files
with
972 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
content/test/data/accessibility/aria/aria-textbox-with-rich-text-expected-mac.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
content/test/data/accessibility/aria/aria-textbox-with-rich-text-expected-win.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE ia2_hypertext='<obj0><obj1>' n_characters=2 caret_offset=0 n_selections=0 | ||
++ROLE_SYSTEM_TEXT value='TextBox1<newline>' FOCUSABLE IA2_STATE_SINGLE_LINE xml-roles:textbox ia2_hypertext='<obj0>' n_characters=1 caret_offset=0 n_selections=0 | ||
++ROLE_SYSTEM_TEXT value='TextBox1' FOCUSABLE IA2_STATE_SINGLE_LINE xml-roles:textbox ia2_hypertext='<obj0>' n_characters=1 caret_offset=0 n_selections=0 | ||
++++IA2_ROLE_HEADING name='TextBox1' xml-roles:heading ia2_hypertext='TextBox1' n_characters=8 caret_offset=0 n_selections=0 | ||
++++++ROLE_SYSTEM_STATICTEXT name='TextBox1' ia2_hypertext='TextBox1' n_characters=8 caret_offset=0 n_selections=0 | ||
++ROLE_SYSTEM_TEXT value='TextBox2<newline>Some text.' FOCUSABLE IA2_STATE_MULTI_LINE xml-roles:textbox ia2_hypertext='<obj0><obj1>' n_characters=2 n_selections=0 | ||
++ROLE_SYSTEM_TEXT value='TextBox2<newline><newline>Some text.' FOCUSABLE IA2_STATE_MULTI_LINE xml-roles:textbox ia2_hypertext='<obj0><obj1>' n_characters=2 n_selections=0 | ||
++++IA2_ROLE_HEADING name='TextBox2' xml-roles:heading ia2_hypertext='TextBox2' n_characters=8 n_selections=0 | ||
++++++ROLE_SYSTEM_STATICTEXT name='TextBox2' ia2_hypertext='TextBox2' n_characters=8 n_selections=0 | ||
++++IA2_ROLE_PARAGRAPH ia2_hypertext='Some text.' n_characters=10 n_selections=0 | ||
++++++ROLE_SYSTEM_STATICTEXT name='Some text.' ia2_hypertext='Some text.' n_characters=10 n_selections=0 | ||
++++++ROLE_SYSTEM_STATICTEXT name='Some text.' ia2_hypertext='Some text.' n_characters=10 n_selections=0 |
2 changes: 1 addition & 1 deletion
2
content/test/data/accessibility/html/contenteditable-descendants-expected-blink.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
content/test/data/accessibility/html/contenteditable-descendants-expected-mac.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
content/test/data/accessibility/html/contenteditable-descendants-expected-win.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...est/data/accessibility/html/contenteditable-descendants-with-selection-expected-blink.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../test/data/accessibility/html/contenteditable-descendants-with-selection-expected-mac.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../test/data/accessibility/html/contenteditable-descendants-with-selection-expected-win.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...data/accessibility/html/contenteditable-with-embedded-contenteditables-expected-blink.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t/data/accessibility/html/contenteditable-with-embedded-contenteditables-expected-mac.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t/data/accessibility/html/contenteditable-with-embedded-contenteditables-expected-win.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.