Skip to content
  • rniwa@webkit.org's avatar
    Deleting across multiple paragraphs can change the style of surrounding text · 69e647cc
    rniwa@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=97266
    
    Reviewed by Levi Weintraub.
    
    Source/WebCore: 
    
    Preserve editing styles from CSS rules in wrappingStyleForSerialization as well as inline styles
    even when we're not annotating. We don't want to preserve all styles because it's against
    the user expectation to keep borders, etc... when merging paragraphs. We also don't want to copy
    styles from a mail blockquote because that's not a style the user has applied. See the comment
    in EditingStyle::wrappingStyleForSerialization.
    
    Test: editing/deleting/merge-paragraph-with-style-from-rule.html
    
    * editing/EditingStyle.cpp:
    (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
    (WebCore::EditingStyle::wrappingStyleForSerialization):
    
    LayoutTests: 
    
    Added a regression test and rebaselined tests.
    
    * editing/deleting/delete-before-block-image-2-expected.txt:
    * editing/deleting/merge-paragraph-from-p-with-style-expected.txt:
    * editing/deleting/merge-paragraph-from-p-with-style.html: We changed the behavior. The editing style of p
    is now preserved when merging paragraphs.
    * editing/deleting/merge-paragraph-with-style-from-rule-expected.txt: Added.
    * editing/deleting/merge-paragraph-with-style-from-rule.html: Added.
    * platform/mac/editing/deleting/delete-block-merge-contents-001-expected.txt:
    * platform/mac/editing/pasteboard/merge-end-blockquote-expected.txt:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    69e647cc