Changeset 121303 in webkit
- Timestamp:
- Jun 26, 2012, 5:00:52 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/inserting/font-size-clears-from-typing-style-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/editing/deleting/delete-br-002-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/editing/deleting/delete-br-004-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/mac/editing/deleting/delete-br-005-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/mac/editing/deleting/delete-br-006-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/editing/DeleteSelectionCommand.cpp (modified) (1 diff)
-
Source/WebCore/editing/htmlediting.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r121299 r121303 1 2012-06-26 Ryosuke Niwa <rniwa@webkit.org> 2 3 Stop calling node() and deprecatedEditingOffset() in comparePositions 4 https://bugs.webkit.org/show_bug.cgi?id=54535 5 6 Reviewed by Enrica Casucci. 7 8 Rebaselined existing tests. There are no user-visible changes. 9 10 * editing/inseting/font-size-clears-from-typing-style-expected.txt: No longer keeps div's around 11 when merging paragraphs. 12 * platform/mac/editing/deleting/delete-br-002-expected.txt: 13 * platform/mac/editing/deleting/delete-br-004-expected.txt: 14 * platform/mac/editing/deleting/delete-br-005-expected.txt: 15 * platform/mac/editing/deleting/delete-br-006-expected.txt: 16 1 17 2012-06-26 Alice Cheng <alice_cheng@apple.com> 2 18 -
trunk/LayoutTests/editing/inserting/font-size-clears-from-typing-style-expected.txt
r121298 r121303 1 1 Tests that we don't serialize redundant font-size in typingStyle. There should be no span or style attribute around A or B below.See https://bugs.webkit.org/show_bug.cgi?id=26279. 2 | <div> 3 | id="wrapper" 4 | "B<#selection-caret>A" 2 | "B<#selection-caret>A" 3 | <br> -
trunk/LayoutTests/platform/mac/editing/deleting/delete-br-002-expected.txt
r93134 r121303 25 25 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 26 26 EDITING DELEGATE: shouldDeleteDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document 27 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 2 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 27 28 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 28 29 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/LayoutTests/platform/mac/editing/deleting/delete-br-004-expected.txt
r93134 r121303 26 26 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 27 27 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 4 of SPAN > DIV > BODY > HTML > #document 28 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > SPAN > DIV > BODY > HTML > #document to 9 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 28 29 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 29 30 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 43 44 RenderText {#text} at (14,70) size 92x28 44 45 text run at (14,70) width 92: "years ago" 45 RenderText {#text} at (0,0) size 0x046 46 caret: position 0 of child 3 {#text} of child 1 {SPAN} of child 1 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/deleting/delete-br-005-expected.txt
r93134 r121303 26 26 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 27 27 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 4 of SPAN > DIV > BODY > HTML > #document 28 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > SPAN > DIV > BODY > HTML > #document to 9 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 28 29 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 29 30 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 30 31 EDITING DELEGATE: shouldDeleteDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document 32 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > SPAN > DIV > BODY > HTML > #document to 9 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 2 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 31 33 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 32 34 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 45 47 RenderText {#text} at (14,42) size 92x28 46 48 text run at (14,42) width 92: "years ago" 47 RenderText {#text} at (0,0) size 0x048 49 caret: position 0 of child 2 {#text} of child 1 {SPAN} of child 1 {DIV} of body -
trunk/LayoutTests/platform/mac/editing/deleting/delete-br-006-expected.txt
r93134 r121303 26 26 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 27 27 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 4 of SPAN > DIV > BODY > HTML > #document 28 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > SPAN > DIV > BODY > HTML > #document to 9 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 28 29 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 29 30 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 30 31 EDITING DELEGATE: shouldDeleteDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document 32 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > SPAN > DIV > BODY > HTML > #document to 9 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 2 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 31 33 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 32 34 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification … … 48 50 RenderText {#text} at (218,14) size 92x28 49 51 text run at (218,14) width 92: "years ago" 50 RenderText {#text} at (0,0) size 0x051 52 caret: position 23 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body -
trunk/Source/WebCore/ChangeLog
r121300 r121303 1 2012-06-26 Ryosuke Niwa <rniwa@webkit.org> 2 3 Stop calling node() and deprecatedEditingOffset() in comparePositions 4 https://bugs.webkit.org/show_bug.cgi?id=54535 5 6 Reviewed by Enrica Casucci. 7 8 Replaced deprecatedNode() and deprecatedEditingOffset() by containerNode() and computeOffsetInContainerNode() 9 in comparePositions(). 10 11 In addition, fixed a bunch of bugs in DeleteSelectionCommand::handleSpecialCaseBRDelete revealed by this change: 12 - Use node after position instead of deprecated node in determinig whether start and end positions at a br. 13 - Don't set m_startsAtEmptyLine true when BR is wrapped in a block element. The only reason this code had worked 14 was positions like (div, offset, 0) and (br, before) in <div><br> were treated differently, which we no longer do. 15 16 * editing/DeleteSelectionCommand.cpp: 17 (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete): 18 * editing/htmlediting.cpp: 19 (WebCore::comparePositions): 20 1 21 2012-06-26 Christophe Dumez <christophe.dumez@intel.com> 2 22 -
trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp
r116798 r121303 298 298 bool DeleteSelectionCommand::handleSpecialCaseBRDelete() 299 299 { 300 Node* nodeAfterUpstreamStart = m_upstreamStart.computeNodeAfterPosition(); 301 Node* nodeAfterDownstreamStart = m_downstreamStart.computeNodeAfterPosition(); 302 // Upstream end will appear before BR due to canonicalization 303 Node* nodeAfterUpstreamEnd = m_upstreamEnd.computeNodeAfterPosition(); 304 305 if (!nodeAfterUpstreamStart || !nodeAfterDownstreamStart) 306 return false; 307 300 308 // Check for special-case where the selection contains only a BR on a line by itself after another BR. 301 bool upstreamStartIsBR = m_upstreamStart.deprecatedNode()->hasTagName(brTag);302 bool downstreamStartIsBR = m_downstreamStart.deprecatedNode()->hasTagName(brTag);303 bool isBROnLineByItself = upstreamStartIsBR && downstreamStartIsBR && m_downstreamStart.deprecatedNode() == m_upstreamEnd.deprecatedNode();309 bool upstreamStartIsBR = nodeAfterUpstreamStart->hasTagName(brTag); 310 bool downstreamStartIsBR = nodeAfterDownstreamStart->hasTagName(brTag); 311 bool isBROnLineByItself = upstreamStartIsBR && downstreamStartIsBR && nodeAfterDownstreamStart == nodeAfterUpstreamEnd; 304 312 if (isBROnLineByItself) { 305 removeNode( m_downstreamStart.deprecatedNode());313 removeNode(nodeAfterDownstreamStart); 306 314 return true; 307 315 } 308 316 309 // Not a special-case delete per se, but we can detect that the merging of content between blocks310 // should not be done.311 if (upstreamStartIsBR && downstreamStartIsBR ) {317 // FIXME: This code doesn't belong in here. 318 // We detect the case where the start is an empty line consisting of BR not wrapped in a block element. 319 if (upstreamStartIsBR && downstreamStartIsBR && !(isStartOfBlock(positionBeforeNode(nodeAfterUpstreamStart)) && isEndOfBlock(positionAfterNode(nodeAfterUpstreamStart)))) { 312 320 m_startsAtEmptyLine = true; 313 321 m_endingPosition = m_downstreamEnd; -
trunk/Source/WebCore/editing/htmlediting.cpp
r120991 r121303 79 79 return 0; 80 80 81 Node* nodeA = commonScope->ancestorInThisScope(a. deprecatedNode());81 Node* nodeA = commonScope->ancestorInThisScope(a.containerNode()); 82 82 ASSERT(nodeA); 83 bool hasDescendentA = nodeA != a. deprecatedNode();84 int offsetA = hasDescendentA ? 0 : a. deprecatedEditingOffset();85 86 Node* nodeB = commonScope->ancestorInThisScope(b. deprecatedNode());83 bool hasDescendentA = nodeA != a.containerNode(); 84 int offsetA = hasDescendentA ? 0 : a.computeOffsetInContainerNode(); 85 86 Node* nodeB = commonScope->ancestorInThisScope(b.containerNode()); 87 87 ASSERT(nodeB); 88 bool hasDescendentB = nodeB != b. deprecatedNode();89 int offsetB = hasDescendentB ? 0 : b. deprecatedEditingOffset();88 bool hasDescendentB = nodeB != b.containerNode(); 89 int offsetB = hasDescendentB ? 0 : b.computeOffsetInContainerNode(); 90 90 91 91 int bias = 0;
Note:
See TracChangeset
for help on using the changeset viewer.