Skip to content
  • leviw@chromium.org's avatar
    InsertUnorderedList can lead to lost content and assertions in moveParagraphs · 94f8b8fd
    leviw@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=111228
    
    Reviewed by Ryosuke Niwa.
    
    Source/WebCore:
    
    When a list is wrapped in a presentational inline like a b tag, we'd create markup that included
    everything up to the b tag from moveParagraphs when intending to only move the contents of the
    list item. This could make it impossible to remove content from a list and trigger loss of
    editable text.
    
    Test: editing/execCommand/insert-remove-block-list-inside-presentational-inline.html
    
    * editing/EditingStyle.cpp:
    (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl): Ensure there's an inline style
    before calling propertyExistsInStyle.
    (WebCore::HTMLElementEquivalent::propertyExistsInStyle): Removing null check for style.
    All callers ensure this value isn't null.
    * editing/markup.cpp:
    (WebCore::highestAncestorToWrapMarkup): Avoid going over RenderBlocks when finding the highest
    presentational ancestor to avoid leaving the bounds of the original paragraph.
    
    LayoutTests:
    
    * editing/deleting/pruning-after-merge-1-expected.txt:
    * editing/execCommand/insert-remove-block-list-inside-presentational-inline-expected.txt: Added.
    * editing/execCommand/insert-remove-block-list-inside-presentational-inline.html: Added.
    * editing/pasteboard/paste-and-sanitize-expected.txt:
    * editing/pasteboard/paste-and-sanitize.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    94f8b8fd