OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 // typing style at the start of the selection, nor is there a reason to | 285 // typing style at the start of the selection, nor is there a reason to |
286 // compute the style at the start of the selection after deletion (see the | 286 // compute the style at the start of the selection after deletion (see the |
287 // early return in calculateTypingStyleAfterDelete). | 287 // early return in calculateTypingStyleAfterDelete). |
288 if (m_upstreamStart.deprecatedNode() == m_downstreamEnd.deprecatedNode() && m_upstreamStart.deprecatedNode()->isTextNode()) | 288 if (m_upstreamStart.deprecatedNode() == m_downstreamEnd.deprecatedNode() && m_upstreamStart.deprecatedNode()->isTextNode()) |
289 return; | 289 return; |
290 | 290 |
291 if (shouldNotInheritStyleFrom(*m_selectionToDelete.start().anchorNode())) | 291 if (shouldNotInheritStyleFrom(*m_selectionToDelete.start().anchorNode())) |
292 return; | 292 return; |
293 | 293 |
294 // Figure out the typing style in effect before the delete is done. | 294 // Figure out the typing style in effect before the delete is done. |
295 m_typingStyle = EditingStyle::create(m_selectionToDelete.start()); | 295 m_typingStyle = EditingStyle::create(m_selectionToDelete.start(), EditingSty le::EditingPropertiesInEffect); |
yosin_UTC9
2013/09/09 04:57:48
How about changing default value of EditingStyle::
| |
296 m_typingStyle->removeStyleAddedByNode(enclosingAnchorElement(m_selectionToDe lete.start())); | 296 m_typingStyle->removeStyleAddedByNode(enclosingAnchorElement(m_selectionToDe lete.start())); |
297 | 297 |
298 // If we're deleting into a Mail blockquote, save the style at end() instead of start() | 298 // If we're deleting into a Mail blockquote, save the style at end() instead of start() |
299 // We'll use this later in computeTypingStyleAfterDelete if we end up outsid e of a Mail blockquote | 299 // We'll use this later in computeTypingStyleAfterDelete if we end up outsid e of a Mail blockquote |
300 if (enclosingNodeOfType(m_selectionToDelete.start(), isMailBlockquote)) | 300 if (enclosingNodeOfType(m_selectionToDelete.start(), isMailBlockquote)) |
301 m_deleteIntoBlockquoteStyle = EditingStyle::create(m_selectionToDelete.e nd()); | 301 m_deleteIntoBlockquoteStyle = EditingStyle::create(m_selectionToDelete.e nd()); |
yosin_UTC9
2013/09/09 04:57:48
Should we pass EditingStyle::EditingPropertiesInEf
| |
302 else | 302 else |
303 m_deleteIntoBlockquoteStyle = 0; | 303 m_deleteIntoBlockquoteStyle = 0; |
304 } | 304 } |
305 | 305 |
306 bool DeleteSelectionCommand::handleSpecialCaseBRDelete() | 306 bool DeleteSelectionCommand::handleSpecialCaseBRDelete() |
307 { | 307 { |
308 Node* nodeAfterUpstreamStart = m_upstreamStart.computeNodeAfterPosition(); | 308 Node* nodeAfterUpstreamStart = m_upstreamStart.computeNodeAfterPosition(); |
309 Node* nodeAfterDownstreamStart = m_downstreamStart.computeNodeAfterPosition( ); | 309 Node* nodeAfterDownstreamStart = m_downstreamStart.computeNodeAfterPosition( ); |
310 // Upstream end will appear before BR due to canonicalization | 310 // Upstream end will appear before BR due to canonicalization |
311 Node* nodeAfterUpstreamEnd = m_upstreamEnd.computeNodeAfterPosition(); | 311 Node* nodeAfterUpstreamEnd = m_upstreamEnd.computeNodeAfterPosition(); |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
840 | 840 |
841 // Normally deletion doesn't preserve the typing style that was present before i t. For example, | 841 // Normally deletion doesn't preserve the typing style that was present before i t. For example, |
842 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't | 842 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't |
843 // stick around. Deletion should preserve a typing style that *it* sets, howeve r. | 843 // stick around. Deletion should preserve a typing style that *it* sets, howeve r. |
844 bool DeleteSelectionCommand::preservesTypingStyle() const | 844 bool DeleteSelectionCommand::preservesTypingStyle() const |
845 { | 845 { |
846 return m_typingStyle; | 846 return m_typingStyle; |
847 } | 847 } |
848 | 848 |
849 } // namespace WebCore | 849 } // namespace WebCore |
OLD | NEW |