[webkit-changes] [WebKit/WebKit] 093ca3: InsertLineBreak sometimes inserts a non-breaking s...

Ryosuke Niwa noreply at github.com
Tue Feb 14 00:15:10 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 093ca30b56a3ee7a091992ef4c387c50b6b437e7
      https://github.com/WebKit/WebKit/commit/093ca30b56a3ee7a091992ef4c387c50b6b437e7
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    A LayoutTests/editing/inserting/insert-line-break-whitespace-pre-line-expected.txt
    A LayoutTests/editing/inserting/insert-line-break-whitespace-pre-line.html
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/insertlinebreak-with-white-space-style.tentative_pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=inline&method=enter-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=inline&method=shift-enter-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=inline-block&method=enter-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=inline-block&method=shift-enter-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=table-cell&method=enter-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=table-cell&method=shift-enter-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-with-white-space-style.tentative_white-space=pre-line&command=insertParagraph-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-with-white-space-style.tentative_white-space=pre-line&command=insertText-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=forwarddelete&left-white-space=normal&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=forwarddelete&left-white-space=nowrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=forwarddelete&left-white-space=pre&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=forwarddelete&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=select-boundary&left-white-space=normal&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=select-boundary&left-white-space=nowrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=select-boundary&left-white-space=pre&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=select-boundary&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=forwarddelete&left-white-space=normal&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=forwarddelete&left-white-space=nowrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=forwarddelete&left-white-space=pre&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=forwarddelete&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=select-boundary&left-white-space=normal&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=select-boundary&left-white-space=nowrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=select-boundary&left-white-space=pre&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=select-boundary&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=forwarddelete&left-white-space=normal&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=forwarddelete&left-white-space=nowrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=forwarddelete&left-white-space=pre&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=forwarddelete&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=select-boundary&left-white-space=normal&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=select-boundary&left-white-space=nowrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=select-boundary&left-white-space=pre&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=select-boundary&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/run/delete_7001-last-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/run/forwarddelete_6001-last-expected.txt
    M Source/WebCore/editing/CompositeEditCommand.cpp

  Log Message:
  -----------
  InsertLineBreak sometimes inserts a non-breaking space instead of a new line
https://bugs.webkit.org/show_bug.cgi?id=252226

Reviewed by Wenson Hsieh.

Don't replace new line characters with non-breaking spaces and spaces when line breaks characters are treated as line breaks and not whitespaces.

* LayoutTests/editing/inserting/insert-line-break-whitespace-pre-line-expected.txt: Added.
* LayoutTests/editing/inserting/insert-line-break-whitespace-pre-line.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertlinebreak-with-white-space-style.tentative_pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=inline&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=inline&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=inline-block&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=inline-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=table-cell&method=enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-in-inline-editing-host.tentative_white-space=pre-line&display=table-cell&method=shift-enter-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-with-white-space-style.tentative_white-space=pre-line&command=insertParagraph-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/insertparagraph-with-white-space-style.tentative_white-space=pre-line&command=insertText-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=forwarddelete&left-white-space=normal&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=forwarddelete&left-white-space=nowrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=forwarddelete&left-white-space=pre&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=forwarddelete&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=select-boundary&left-white-space=normal&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=select-boundary&left-white-space=nowrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=select-boundary&left-white-space=pre&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-line-and-right-paragraph_method=select-boundary&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=forwarddelete&left-white-space=normal&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=forwarddelete&left-white-space=nowrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=forwarddelete&left-white-space=pre&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=forwarddelete&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=select-boundary&left-white-space=normal&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=select-boundary&left-white-space=nowrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=select-boundary&left-white-space=pre&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-left-paragraph-and-right-line_method=select-boundary&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=forwarddelete&left-white-space=normal&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=forwarddelete&left-white-space=nowrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=forwarddelete&left-white-space=pre&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=forwarddelete&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=select-boundary&left-white-space=normal&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=select-boundary&left-white-space=nowrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=select-boundary&left-white-space=pre&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/other/join-different-white-space-style-paragraphs_method=select-boundary&left-white-space=pre-wrap&right-white-space=pre-line-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/delete_7001-last-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/forwarddelete_6001-last-expected.txt:
* Source/WebCore/editing/CompositeEditCommand.cpp:
(WebCore::isWhitespaceForRebalance):
(WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):

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




More information about the webkit-changes mailing list