Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0a2872fc14e11acdb13c2a6ae92d11c40d6ea6a0
https://github.com/WebKit/WebKit/commit/0a2872fc14e11acdb13c2a6ae92d11c40d6ea6a0
Author: Chris Dumez <[email protected]>
Date: 2026-04-27 (Mon, 27 Apr 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/the-innertext-and-outertext-properties/getter-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/the-innertext-and-outertext-properties/getter-tests.js
M Source/WebCore/editing/TextIterator.cpp
M Source/WebCore/editing/TextIterator.h
Log Message:
-----------
innerText should emit blank lines around <p> elements regardless of CSS
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
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications