Changeset 95645 in webkit
- Timestamp:
- Sep 21, 2011, 10:06:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r95644 r95645 1 2011-09-20 Ryosuke Niwa <rniwa@webkit.org> 2 3 Span element gets produced using backspace/delete to merge header with paragraph 4 https://bugs.webkit.org/show_bug.cgi?id=68413 5 6 Reviewed by Darin Adler. 7 8 Add a test to remove the line break before a p element. WebKit should not preserve 9 the font color from the style rule but should preserve the font style from inline style declaration. 10 11 Also fix merge-paragraph-from-h6* to actually h6 instead of h1. 12 13 * editing/deleting/merge-paragraph-from-h6-expected.txt: 14 * editing/deleting/merge-paragraph-from-h6-with-style-expected.txt: 15 * editing/deleting/merge-paragraph-from-h6-with-style.html: 16 * editing/deleting/merge-paragraph-from-h6.html: 17 * editing/deleting/merge-paragraph-from-p-with-style-expected.txt: Added. 18 * editing/deleting/merge-paragraph-from-p-with-style.html: Added. 19 1 20 2011-09-21 Ojan Vafai <ojan@chromium.org> 2 21 -
trunk/LayoutTests/editing/deleting/merge-paragraph-from-h6-expected.txt
r95335 r95645 3 3 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 4 4 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 5 EDITING DELEGATE: shouldDeleteDOMRange:range from 7 of #text > DIV > BODY > HTML > #document to 0 of H 1> DIV > BODY > HTML > #document5 EDITING DELEGATE: shouldDeleteDOMRange:range from 7 of #text > DIV > BODY > HTML > #document to 0 of H6 > DIV > BODY > HTML > #document 6 6 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 7 7 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 6 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE -
trunk/LayoutTests/editing/deleting/merge-paragraph-from-h6-with-style-expected.txt
r95335 r95645 3 3 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 4 4 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 5 EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 0 of H 1> DIV > BODY > HTML > #document5 EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 0 of H6 > DIV > BODY > HTML > #document 6 6 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 7 7 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > EM > DIV > BODY > HTML > #document to 5 of #text > EM > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE -
trunk/LayoutTests/editing/deleting/merge-paragraph-from-h6-with-style.html
r95335 r95645 6 6 <div id="test" contenteditable> 7 7 <em>hello</em> 8 <h 1><font color="red">world</font></h1>8 <h6><font color="red">world</font></h6> 9 9 </div> 10 10 </div> -
trunk/LayoutTests/editing/deleting/merge-paragraph-from-h6.html
r95335 r95645 6 6 <div id="test" contenteditable> 7 7 hello 8 <h 1>world</h1>8 <h6>world</h6> 9 9 </div> 10 10 </div> -
trunk/Source/WebCore/ChangeLog
r95641 r95645 1 2011-09-20 Ryosuke Niwa <rniwa@webkit.org> 2 3 Span element gets produced using backspace/delete to merge header with paragraph 4 https://bugs.webkit.org/show_bug.cgi?id=68413 5 6 Reviewed by Darin Adler. 7 8 Add p element to the list of elements to retain appearance. Also modified removeStyleFromNode 9 (and renamed to removeStyleFromRules) not to remove inline style declarations because 10 inline styles need to stay on copy. 11 12 Test: editing/deleting/merge-paragraph-from-p-with-style.html 13 14 * editing/DeleteSelectionCommand.cpp: 15 (WebCore::DeleteSelectionCommand::saveTypingStyleState): 16 * editing/EditingStyle.cpp: 17 (WebCore::EditingStyle::removeStyleFromRules): Renamed from removeStyleFromNode. 18 * editing/EditingStyle.h: 19 * editing/markup.cpp: 20 (WebCore::isBlockNodeToRetainAppearance): 21 (WebCore::StyledMarkupAccumulator::serializeNodes): 22 1 23 2011-09-21 Alice Boxhall <aboxhall@chromium.org> 2 24 -
trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp
r94898 r95645 284 284 // Figure out the typing style in effect before the delete is done. 285 285 m_typingStyle = EditingStyle::create(m_selectionToDelete.start()); 286 m_typingStyle->removeStyle AddedByNode(enclosingAnchorElement(m_selectionToDelete.start()));286 m_typingStyle->removeStyleFromRules(enclosingAnchorElement(m_selectionToDelete.start())); 287 287 288 288 // If we're deleting into a Mail blockquote, save the style at end() instead of start() -
trunk/Source/WebCore/editing/EditingStyle.cpp
r93001 r95645 520 520 } 521 521 522 void EditingStyle::removeStyleAddedByNode(Node* node) 523 { 522 void EditingStyle::removeStyleFromRules(Node* node) 523 { 524 // FIXME: This should share code with removeStyleFromRulesAndContext 525 // but it's hard to do until we figure out how to compare font-size property without computed style. 524 526 if (!node || !node->parentNode()) 525 527 return; … … 527 529 RefPtr<CSSMutableStyleDeclaration> nodeStyle = editingStyleFromComputedStyle(computedStyle(node)); 528 530 parentStyle->diff(nodeStyle.get()); 531 if (node->isStyledElement() && static_cast<StyledElement*>(node)->inlineStyleDecl()) 532 nodeStyle = getPropertiesNotIn(nodeStyle.get(), static_cast<StyledElement*>(node)->inlineStyleDecl()); 529 533 nodeStyle->diff(m_mutableStyle.get()); 530 534 } -
trunk/Source/WebCore/editing/EditingStyle.h
r92823 r95645 103 103 PassRefPtr<EditingStyle> extractAndRemoveTextDirection(); 104 104 void removeBlockProperties(); 105 void removeStyle AddedByNode(Node*);105 void removeStyleFromRules(Node*); 106 106 void removeStyleConflictingWithStyleOfNode(Node*); 107 107 void removeNonEditingProperties(); -
trunk/Source/WebCore/editing/markup.cpp
r95335 r95645 350 350 names.add(h6Tag.impl()); 351 351 names.add(listingTag.impl()); 352 names.add(pTag.impl()); 352 353 names.add(preTag.impl()); 353 354 } … … 369 370 // to help us differentiate those styles from ones that the user has applied. 370 371 // This helps us get the color of content pasted into blockquotes right. 371 m_wrappingStyle->removeStyle AddedByNode(enclosingNodeOfType(firstPositionInOrBeforeNode(parentOfHighestNode), isBlockNodeToRetainAppearance, CanCrossEditingBoundary));372 m_wrappingStyle->removeStyleFromRules(enclosingNodeOfType(firstPositionInOrBeforeNode(parentOfHighestNode), isBlockNodeToRetainAppearance, CanCrossEditingBoundary)); 372 373 373 374 // Call collapseTextDecorationProperties first or otherwise it'll copy the value over from in-effect to text-decorations.
Note:
See TracChangeset
for help on using the changeset viewer.