Changeset 280541 in webkit
- Timestamp:
- Aug 2, 2021 10:28:58 AM (12 months ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
LayoutTests/accessibility/mac/pseudo-element-text-markers-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/the-innertext-and-outertext-properties/innertext-setter-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/the-innertext-idl-attribute/setter-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/innerText/setter-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLElement.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/accessibility/mac/pseudo-element-text-markers-expected.txt
r280502 r280541 28 28 AXRole: AXGroup AXValue: 29 29 AXRole: AXStaticText AXValue: AXRole: AXScrollArea AXValue: 30 AXRole: AX WebArea AXValue:31 AXRole: AX Group AXValue:32 AXRole: AXStaticText AXValue: Hello33 AXRole: AX Group AXValue:34 AXRole: AXStaticText AXValue: This tests that the pseudo element style:body:before is accessible via the accessibility tree but not via TextMarkers.35 AXRole: AX Group AXValue:36 AXRole: AXStaticText AXValue: On success, you will see a series of "37 AXRole: AXStaticText AXValue: PASS38 AXRole: AXStaticText AXValue: " messages, followed by "39 AXRole: AXStaticText AXValue: TEST COMPLETE40 AXRole: AXStaticText AXValue: ".41 AXRole: AX Group AXValue:30 AXRole: AXStaticText AXValue: AXRole: AXWebArea AXValue: 31 AXRole: AXStaticText AXValue: AXRole: AXGroup AXValue: 32 AXRole: AXStaticText AXValue: AXRole: AXStaticText AXValue: Hello 33 AXRole: AXStaticText AXValue: AXRole: AXGroup AXValue: 34 AXRole: AXStaticText AXValue: AXRole: AXStaticText AXValue: This tests that the pseudo element style:body:before is accessible via the accessibility tree but not via TextMarkers. 35 AXRole: AXStaticText AXValue: AXRole: AXGroup AXValue: 36 AXRole: AXStaticText AXValue: AXRole: AXStaticText AXValue: On success, you will see a series of " 37 AXRole: AXStaticText AXValue: AXRole: AXStaticText AXValue: PASS 38 AXRole: AXStaticText AXValue: AXRole: AXStaticText AXValue: " messages, followed by " 39 AXRole: AXStaticText AXValue: AXRole: AXStaticText AXValue: TEST COMPLETE 40 AXRole: AXStaticText AXValue: AXRole: AXStaticText AXValue: ". 41 AXRole: AXStaticText AXValue: AXRole: AXGroup AXValue: 42 42 43 -
trunk/LayoutTests/imported/w3c/ChangeLog
r280531 r280541 1 2021-08-02 Chris Dumez <cdumez@apple.com> 2 3 HTMLElement.innerText setter should convert new lines to <br> 4 https://bugs.webkit.org/show_bug.cgi?id=228605 5 <rdar://problem/81333038> 6 7 Reviewed by Darin Adler. 8 9 Rebaseline WPT tests that are now passing. Those tests were already passing in Chrome and Firefox. 10 11 * web-platform-tests/html/dom/elements/the-innertext-and-outertext-properties/innertext-setter-expected.txt: 12 * web-platform-tests/html/dom/elements/the-innertext-idl-attribute/setter-expected.txt: 13 * web-platform-tests/innerText/setter-expected.txt: 14 1 15 2021-08-02 Jer Noble <jer.noble@apple.com> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/the-innertext-and-outertext-properties/innertext-setter-expected.txt
r280502 r280541 4 4 PASS Newlines convert to <br> in non-white-space:pre elements 5 5 PASS Newlines convert to <br> in non-white-space:pre elements, detached 6 FAIL Newlines convert to <br> in <pre> element assert_equals: expected "abc<br>def" but got "abc\ndef" 6 PASS Newlines convert to <br> in <pre> element 7 7 PASS Newlines convert to <br> in <pre> element, detached 8 FAIL Newlines convert to <br> in <textarea> element assert_equals: expected "abc<br>def" but got "abc\ndef" 8 PASS Newlines convert to <br> in <textarea> element 9 9 PASS Newlines convert to <br> in <textarea> element, detached 10 FAIL Newlines convert to <br> in white-space:pre element assert_equals: expected "abc<br>def" but got "abc\ndef" 10 PASS Newlines convert to <br> in white-space:pre element 11 11 PASS Newlines convert to <br> in white-space:pre element, detached 12 12 PASS CRs convert to <br> in non-white-space:pre elements 13 13 PASS CRs convert to <br> in non-white-space:pre elements, detached 14 FAIL CRs convert to <br> in <pre> element assert_equals: expected "abc<br>def" but got "abc\ndef" 14 PASS CRs convert to <br> in <pre> element 15 15 PASS CRs convert to <br> in <pre> element, detached 16 16 PASS Newline/CR pair converts to <br> in non-white-space:pre element … … 20 20 PASS CR/CR pair converts to two <br>s in non-white-space:pre element 21 21 PASS CR/CR pair converts to two <br>s in non-white-space:pre element, detached 22 FAIL CRs convert to <br> in white-space:pre element assert_equals: expected "abc<br>def" but got "abc\ndef" 22 PASS CRs convert to <br> in white-space:pre element 23 23 PASS CRs convert to <br> in white-space:pre element, detached 24 24 PASS < preserved -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/the-innertext-idl-attribute/setter-expected.txt
r280502 r280541 4 4 PASS Newlines convert to <br> in non-white-space:pre elements 5 5 PASS Newlines convert to <br> in non-white-space:pre elements, detached 6 FAIL Newlines convert to <br> in <pre> element assert_equals: expected "abc<br>def" but got "abc\ndef" 6 PASS Newlines convert to <br> in <pre> element 7 7 PASS Newlines convert to <br> in <pre> element, detached 8 FAIL Newlines convert to <br> in <textarea> element assert_equals: expected "abc<br>def" but got "abc\ndef" 8 PASS Newlines convert to <br> in <textarea> element 9 9 PASS Newlines convert to <br> in <textarea> element, detached 10 FAIL Newlines convert to <br> in white-space:pre element assert_equals: expected "abc<br>def" but got "abc\ndef" 10 PASS Newlines convert to <br> in white-space:pre element 11 11 PASS Newlines convert to <br> in white-space:pre element, detached 12 12 PASS CRs convert to <br> in non-white-space:pre elements 13 13 PASS CRs convert to <br> in non-white-space:pre elements, detached 14 FAIL CRs convert to <br> in <pre> element assert_equals: expected "abc<br>def" but got "abc\ndef" 14 PASS CRs convert to <br> in <pre> element 15 15 PASS CRs convert to <br> in <pre> element, detached 16 16 PASS Newline/CR pair converts to <br> in non-white-space:pre element … … 20 20 PASS CR/CR pair converts to two <br>s in non-white-space:pre element 21 21 PASS CR/CR pair converts to two <br>s in non-white-space:pre element, detached 22 FAIL CRs convert to <br> in white-space:pre element assert_equals: expected "abc<br>def" but got "abc\ndef" 22 PASS CRs convert to <br> in white-space:pre element 23 23 PASS CRs convert to <br> in white-space:pre element, detached 24 24 PASS < preserved -
trunk/LayoutTests/imported/w3c/web-platform-tests/innerText/setter-expected.txt
r280502 r280541 4 4 PASS Newlines convert to <br> in non-white-space:pre elements 5 5 PASS Newlines convert to <br> in non-white-space:pre elements, detached 6 FAIL Newlines convert to <br> in <pre> element assert_equals: expected "abc<br>def" but got "abc\ndef" 6 PASS Newlines convert to <br> in <pre> element 7 7 PASS Newlines convert to <br> in <pre> element, detached 8 FAIL Newlines convert to <br> in <textarea> element assert_equals: expected "abc<br>def" but got "abc\ndef" 8 PASS Newlines convert to <br> in <textarea> element 9 9 PASS Newlines convert to <br> in <textarea> element, detached 10 FAIL Newlines convert to <br> in white-space:pre element assert_equals: expected "abc<br>def" but got "abc\ndef" 10 PASS Newlines convert to <br> in white-space:pre element 11 11 PASS Newlines convert to <br> in white-space:pre element, detached 12 12 PASS CRs convert to <br> in non-white-space:pre elements 13 13 PASS CRs convert to <br> in non-white-space:pre elements, detached 14 FAIL CRs convert to <br> in <pre> element assert_equals: expected "abc<br>def" but got "abc\ndef" 14 PASS CRs convert to <br> in <pre> element 15 15 PASS CRs convert to <br> in <pre> element, detached 16 16 PASS Newline/CR pair converts to <br> in non-white-space:pre element … … 20 20 PASS CR/CR pair converts to two <br>s in non-white-space:pre element 21 21 PASS CR/CR pair converts to two <br>s in non-white-space:pre element, detached 22 FAIL CRs convert to <br> in white-space:pre element assert_equals: expected "abc<br>def" but got "abc\ndef" 22 PASS CRs convert to <br> in white-space:pre element 23 23 PASS CRs convert to <br> in white-space:pre element, detached 24 24 PASS < preserved -
trunk/Source/WebCore/ChangeLog
r280534 r280541 1 2021-08-02 Chris Dumez <cdumez@apple.com> 2 3 HTMLElement.innerText setter should convert new lines to <br> 4 https://bugs.webkit.org/show_bug.cgi?id=228605 5 <rdar://problem/81333038> 6 7 Reviewed by Darin Adler. 8 9 HTMLElement.innerText setter should convert new lines to <br>: 10 - https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute:dom-innertext-3 11 - https://html.spec.whatwg.org/multipage/dom.html#rendered-text-fragment 12 13 Our innerText setter had some logic that was specific to render styles that isn't part of 14 the specification. It was causing us to not replace the new lines with <br> in some 15 web-observable cases. I dropped this logic to align with Blink and Gecko. 16 17 No new tests, rebaselined existing tests. 18 19 * html/HTMLElement.cpp: 20 (WebCore::HTMLElement::setInnerText): 21 1 22 2021-08-02 Sam Weinig <weinig@apple.com> 2 23 -
trunk/Source/WebCore/html/HTMLElement.cpp
r280502 r280541 567 567 } 568 568 569 // FIXME: Do we need to be able to detect preserveNewline style even when there's no renderer? 570 // FIXME: Can the renderer be out of date here? Do we need to call updateStyleIfNeeded? 571 // For example, for the contents of textarea elements that are display:none? 572 auto* r = renderer(); 573 if ((r && r->style().preserveNewline()) || (isConnected() && isTextControlInnerTextElement())) { 569 if (isConnected() && isTextControlInnerTextElement()) { 574 570 if (!text.contains('\r')) { 575 571 stringReplaceAll(text);
Note: See TracChangeset
for help on using the changeset viewer.