Changeset 130532 in webkit
- Timestamp:
- Oct 5, 2012, 11:26:37 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r130529 r130532 1 2012-10-05 Ryosuke Niwa <rniwa@webkit.org> 2 3 Deleting across multiple paragraphs can change the style of surrounding text 4 https://bugs.webkit.org/show_bug.cgi?id=97266 5 6 Reviewed by Levi Weintraub. 7 8 Added a regression test and rebaselined tests. 9 10 * editing/deleting/delete-before-block-image-2-expected.txt: 11 * editing/deleting/merge-paragraph-from-p-with-style-expected.txt: 12 * editing/deleting/merge-paragraph-from-p-with-style.html: We changed the behavior. The editing style of p 13 is now preserved when merging paragraphs. 14 * editing/deleting/merge-paragraph-with-style-from-rule-expected.txt: Added. 15 * editing/deleting/merge-paragraph-with-style-from-rule.html: Added. 16 * platform/mac/editing/deleting/delete-block-merge-contents-001-expected.txt: 17 * platform/mac/editing/pasteboard/merge-end-blockquote-expected.txt: 18 1 19 2012-10-05 Julien Chaffraix <jchaffraix@webkit.org> 2 20 -
trunk/LayoutTests/editing/deleting/delete-before-block-image-2-expected.txt
r50542 r130532 1 <img id="img" s tyle="display:block;" src="../resources/abe.png">1 <img id="img" src="../resources/abe.png" style="display: block;"> 2 2 3 3 Selection: [[object HTMLDivElement], 0] -
trunk/LayoutTests/editing/deleting/merge-paragraph-from-p-with-style-expected.txt
r126656 r130532 9 9 EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification 10 10 This tests deleting line break before p. 11 " helloworld" should both be in black text (no p element) and "world" should be italicized.11 "world" in "helloworld" should be italicized in red. 12 12 | " 13 13 hello<#selection-caret>" 14 14 | <span> 15 | style=" font-style: italic;"15 | style="color: red; font-style: italic;" 16 16 | "world" 17 17 | " -
trunk/LayoutTests/editing/deleting/merge-paragraph-from-p-with-style.html
r96870 r130532 8 8 <body> 9 9 <p id="description">This tests deleting line break before p. 10 " helloworld" should both be in black text (no p element) and "world" should be italicized.</p>10 "world" in "helloworld" should be italicized in red.</p> 11 11 <div id="test" contenteditable> 12 12 hello -
trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-001-expected.txt
r96870 r130532 19 19 RenderText {#text} at (0,0) size 84x28 20 20 text run at (0,0) width 84: "OneTwo" 21 RenderText {#text} at (0,0) size 0x0 21 22 caret: position 4 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/pasteboard/merge-end-blockquote-expected.txt
r96870 r130532 2 2 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification 3 3 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 4 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 ofDIV > BODY > HTML > #document toDOMRange:range from 16 of #text > DIV > BODY > HTML > #document to 16 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE4 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 17 of #text > DIV > BODY > HTML > #document to 17 of #text > DIV > BODY > HTML > #document toDOMRange:range from 16 of #text > DIV > BODY > HTML > #document to 16 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 5 5 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 6 6 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 12 12 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 13 13 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 14 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 14 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document to 14 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document to 4of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE14 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 14 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document to 14 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document to 3 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 15 15 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 16 16 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 42 42 RenderText {#text} at (0,0) size 49x18 43 43 text run at (0,0) width 49: "barText" 44 caret: position 4of child 0 {#text} of child 0 {DIV} of child 1 {BLOCKQUOTE} of child 10 {DIV} of body44 caret: position 3 of child 0 {#text} of child 0 {DIV} of child 1 {BLOCKQUOTE} of child 10 {DIV} of body -
trunk/Source/WebCore/ChangeLog
r130531 r130532 1 2012-10-05 Ryosuke Niwa <rniwa@webkit.org> 2 3 Deleting across multiple paragraphs can change the style of surrounding text 4 https://bugs.webkit.org/show_bug.cgi?id=97266 5 6 Reviewed by Levi Weintraub. 7 8 Preserve editing styles from CSS rules in wrappingStyleForSerialization as well as inline styles 9 even when we're not annotating. We don't want to preserve all styles because it's against 10 the user expectation to keep borders, etc... when merging paragraphs. We also don't want to copy 11 styles from a mail blockquote because that's not a style the user has applied. See the comment 12 in EditingStyle::wrappingStyleForSerialization. 13 14 Test: editing/deleting/merge-paragraph-with-style-from-rule.html 15 16 * editing/EditingStyle.cpp: 17 (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement): 18 (WebCore::EditingStyle::wrappingStyleForSerialization): 19 1 20 2012-10-05 Dan Bernstein <mitz@apple.com> 2 21 -
trunk/Source/WebCore/editing/EditingStyle.cpp
r128572 r130532 982 982 void EditingStyle::mergeInlineAndImplicitStyleOfElement(StyledElement* element, CSSPropertyOverrideMode mode, PropertiesToInclude propertiesToInclude) 983 983 { 984 RefPtr<EditingStyle> styleFromRules = EditingStyle::create(); 985 styleFromRules->mergeStyleFromRulesForSerialization(element); 986 styleFromRules->removeNonEditingProperties(); 987 mergeStyle(styleFromRules->m_mutableStyle.get(), mode); 988 984 989 mergeInlineStyleOfElement(element, mode, propertiesToInclude); 985 990 … … 1020 1025 // When not annotating for interchange, we only preserve inline style declarations. 1021 1026 for (Node* node = context; node && !node->isDocumentNode(); node = node->parentNode()) { 1022 if (node->isStyledElement() ) {1027 if (node->isStyledElement() && !isMailBlockquote(node)) { 1023 1028 wrappingStyle->mergeInlineAndImplicitStyleOfElement(static_cast<StyledElement*>(node), EditingStyle::DoNotOverrideValues, 1024 1029 EditingStyle::EditingPropertiesInEffect);
Note:
See TracChangeset
for help on using the changeset viewer.