innerText should emit blank lines around <p> elements regardless of CSS display value#63654
Conversation
|
EWS run on previous version of this PR (hash ac372d4) Details |
ac372d4 to
231cf4f
Compare
|
EWS run on previous version of this PR (hash 231cf4f) Details |
231cf4f to
a603592
Compare
|
EWS run on previous version of this PR (hash a603592) Details |
annevk
left a comment
There was a problem hiding this comment.
To be sure, this is after we dropped display: none p elements, right?
I don't know. All I can say is it matches the spec (I provided the link / steps in the commit message) and Chromium/Firefox. |
|
Right, it's just that step 3 in the linked specification is also a display check. |
Is there a way to turn this question into a question about web platform test coverage? |
|
Not quite in terms of WPT, but my ask is really if https://software.hixie.ch/utilities/js/live-dom-viewer/saved/14687 continues logging true for both cases as that's interoperable today. |
I'll test. If there is an issue, then we likely lack test coverage and I will add it. |
Your test is still passing. I couldn't find test coverage for it in WPT so I'll extend the WPT test. |
a603592 to
32389fd
Compare
|
EWS run on current version of this PR (hash 32389fd) Details |
…SS display value https://bugs.webkit.org/show_bug.cgi?id=313381 Reviewed by Anne van Kesteren. Per the WHATWG rendered text collection steps [1], the <p> element check (step 8) runs before the CSS display check (step 9), so <p> elements should always get a required line break count of 2 regardless of their computed display value. WebKit was checking the renderer's display type first, causing <p style="display:inline-block"> to emit no newlines at all. [1] https://html.spec.whatwg.org/multipage/dom.html#rendered-text-collection-steps No new tests, rebaselined existing subtest. This subtest was already passing in Chrome and Firefox. * LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/the-innertext-and-outertext-properties/getter-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/the-innertext-and-outertext-properties/getter-tests.js: * Source/WebCore/editing/TextIterator.cpp: (WebCore::shouldEmitNewlinesBeforeAndAfterNode): (WebCore::shouldEmitNewlineAfterNode): (WebCore::shouldEmitNewlineBeforeNode): (WebCore::TextIterator::representNodeOffsetZero): (WebCore::TextIterator::exitNode): * Source/WebCore/editing/TextIterator.h: Canonical link: https://commits.webkit.org/312169@main
32389fd to
0a2872f
Compare
|
Committed 312169@main (0a2872f): https://commits.webkit.org/312169@main Reviewed commits have been landed. Closing PR #63654 and removing active labels. |
0a2872f
32389fd
🛠 win🧪 win-tests🧪 ios-wk2-wpt🧪 api-mac-debug🧪 api-ios🧪 mac-AS-debug-wk2