Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to place an editable selection inside empty elements #10503

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Feb 22, 2023

  1. Impossible to place an editable selection inside empty elements

    https://bugs.webkit.org/show_bug.cgi?id=15256
    
    Reviewed by NOBODY (OOPS!).
    
    Use the uncanonicalized selection ends for text insertion.
    
    * LayoutTests/editing/deleting/delete-3775172-fix-expected.txt:
    * LayoutTests/editing/execCommand/5142012-3-expected.txt:
    * LayoutTests/editing/execCommand/typing-should-not-trigger-scrolling-when-selection-is-visible.html:
    * LayoutTests/editing/inserting/4840662.html:
    * LayoutTests/editing/inserting/5156401-2.html:
    * LayoutTests/editing/inserting/5510537-expected.txt:
    * LayoutTests/editing/inserting/editable-html-element-expected.txt:
    * LayoutTests/editing/inserting/editing-empty-divs-expected.txt:
    * LayoutTests/editing/inserting/insert-3778059-fix-expected.txt:
    * LayoutTests/editing/inserting/insert-at-end-01-expected.txt:
    * LayoutTests/editing/inserting/insert-at-end-02-expected.txt:
    * LayoutTests/editing/inserting/insert-before-link-1-expected.txt:
    * LayoutTests/editing/inserting/insert-html-crash-01-expected.txt:
    * LayoutTests/editing/inserting/typing-003-expected.txt:
    * LayoutTests/editing/inserting/typing-around-image-001-expected.txt:
    * LayoutTests/editing/selection/4983858-expected.txt:
    * LayoutTests/editing/spelling/centering-misspelling-dots-expected.txt:
    * LayoutTests/editing/spelling/misspelling-dots-dont-extend-beyond-words-expected.txt:
    * LayoutTests/editing/style/remove-underline-across-paragraph-expected.txt:
    * LayoutTests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
    * LayoutTests/editing/style/remove-underline-after-paragraph-expected.txt:
    * LayoutTests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
    * LayoutTests/editing/style/remove-underline-expected.txt:
    * LayoutTests/editing/style/remove-underline-from-stylesheet-expected.txt:
    * LayoutTests/editing/style/remove-underline-in-bold-expected.txt:
    * LayoutTests/editing/style/typing-style-003-expected.txt:
    * LayoutTests/editing/style/unbold-in-bold-expected.txt:
    * LayoutTests/editing/style/underline-expected.txt:
    * LayoutTests/editing/unsupported-content/list-type-before.html:
    * LayoutTests/editing/unsupported-content/table-type-before-expected.txt:
    * LayoutTests/platform/mac/editing/inserting/insert-text-at-tabspan-003-expected.txt:
    
    * Source/WebCore/editing/CompositeEditCommand.cpp:
    (WebCore::CompositeEditCommand::positionOutsideTabSpan): Consider the case where the anchor node
    is the WebKit tab span element.
    
    * Source/WebCore/editing/InsertTextCommand.cpp:
    (WebCore::InsertTextCommand::positionInsideTextNode): Consider the text node before or after
    the position.
    (WebCore::InsertTextCommand::doApply): Use the uncanonicalized selection start as the start position.
    Also don't rebalance whitespaces at the end if the starting position was not a candidate (e.g.
    we're at a visually empty text node) and the inserted text didn't end with a whitespace.
    rniwa committed Feb 22, 2023
    Configuration menu
    Copy the full SHA
    4136be1 View commit details
    Browse the repository at this point in the history