Skip to content

Conversation

rniwa
Copy link
Member

@rniwa rniwa commented Feb 14, 2023

37c9962

InsertParagraph should insert a BR when the root editable element is a phrasing content
https://bugs.webkit.org/show_bug.cgi?id=252219

Reviewed by Wenson Hsieh.

When the root editable element only allows phrasing content (e.g. span) then execCommand('insertParagraph') should insert a br instead of a div.

* LayoutTests/editing/inserting/insert-paragraph-separator-phrasing-editable-root-expected.txt: Added.
* LayoutTests/editing/inserting/insert-paragraph-separator-phrasing-editable-root.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=normal&display=block&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=normal&display=block&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=normal&display=list-item&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=normal&display=list-item&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre&display=block&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre&display=block&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre&display=list-item&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre&display=list-item&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=block&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=block&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=list-item&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=list-item&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-wrap&display=block&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-wrap&display=block&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-wrap&display=list-item&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-wrap&display=list-item&method=shift-enter-expected.txt:
* Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::isPhrasingContent):
(WebCore::isEditableRootPhrasingContent):
(WebCore::InsertParagraphSeparatorCommand::doApply):

Canonical link: https://commits.webkit.org/260242@main

7195bf0

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🛠 gtk
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 gtk-wk2
✅ 🧪 api-ios ✅ 🧪 mac-wk1 🧪 api-gtk
✅ 🛠 tv ✅ 🧪 mac-wk2
✅ 🛠 tv-sim ✅ 🧪 mac-AS-debug-wk2
✅ 🛠 watch ✅ 🧪 mac-wk2-stress
✅ 🛠 watch-sim
✅ 🛠 🧪 unsafe-merge

@rniwa rniwa self-assigned this Feb 14, 2023
@rniwa rniwa added the HTML Editing For bugs in HTML editing support (including designMode and contentEditable). label Feb 14, 2023
@rniwa rniwa requested a review from whsieh February 14, 2023 01:59
@rniwa rniwa added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 14, 2023
…a phrasing content

https://bugs.webkit.org/show_bug.cgi?id=252219

Reviewed by Wenson Hsieh.

When the root editable element only allows phrasing content (e.g. span) then execCommand('insertParagraph') should insert a br instead of a div.

* LayoutTests/editing/inserting/insert-paragraph-separator-phrasing-editable-root-expected.txt: Added.
* LayoutTests/editing/inserting/insert-paragraph-separator-phrasing-editable-root.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=normal&display=block&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=normal&display=block&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=normal&display=list-item&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=normal&display=list-item&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre&display=block&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre&display=block&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre&display=list-item&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre&display=list-item&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=block&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=block&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=list-item&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=list-item&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-wrap&display=block&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-wrap&display=block&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-wrap&display=list-item&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-wrap&display=list-item&method=shift-enter-expected.txt:
* Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::isPhrasingContent):
(WebCore::isEditableRootPhrasingContent):
(WebCore::InsertParagraphSeparatorCommand::doApply):

Canonical link: https://commits.webkit.org/260242@main
@webkit-commit-queue
Copy link
Collaborator

Committed 260242@main (37c9962): https://commits.webkit.org/260242@main

Reviewed commits have been landed. Closing PR #10065 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system merged commit 37c9962 into WebKit:main Feb 14, 2023
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 14, 2023
@rniwa rniwa deleted the fix252219 branch February 14, 2023 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HTML Editing For bugs in HTML editing support (including designMode and contentEditable).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants