Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Side by Side Diff: Source/core/editing/DeleteSelectionCommand.cpp

Issue 423673002: Use tighter typing in editing: EditingStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/editing/EditingStyle.h » ('j') | Source/core/editing/EditingStyle.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // compute the style at the start of the selection after deletion (see the 277 // compute the style at the start of the selection after deletion (see the
278 // early return in calculateTypingStyleAfterDelete). 278 // early return in calculateTypingStyleAfterDelete).
279 if (m_upstreamStart.deprecatedNode() == m_downstreamEnd.deprecatedNode() && m_upstreamStart.deprecatedNode()->isTextNode()) 279 if (m_upstreamStart.deprecatedNode() == m_downstreamEnd.deprecatedNode() && m_upstreamStart.deprecatedNode()->isTextNode())
280 return; 280 return;
281 281
282 if (shouldNotInheritStyleFrom(*m_selectionToDelete.start().anchorNode())) 282 if (shouldNotInheritStyleFrom(*m_selectionToDelete.start().anchorNode()))
283 return; 283 return;
284 284
285 // Figure out the typing style in effect before the delete is done. 285 // Figure out the typing style in effect before the delete is done.
286 m_typingStyle = EditingStyle::create(m_selectionToDelete.start(), EditingSty le::EditingPropertiesInEffect); 286 m_typingStyle = EditingStyle::create(m_selectionToDelete.start(), EditingSty le::EditingPropertiesInEffect);
287 m_typingStyle->removeStyleAddedByNode(enclosingAnchorElement(m_selectionToDe lete.start())); 287 m_typingStyle->removeStyleAddedByElement(enclosingAnchorElement(m_selectionT oDelete.start()));
288 288
289 // If we're deleting into a Mail blockquote, save the style at end() instead of start() 289 // If we're deleting into a Mail blockquote, save the style at end() instead of start()
290 // We'll use this later in computeTypingStyleAfterDelete if we end up outsid e of a Mail blockquote 290 // We'll use this later in computeTypingStyleAfterDelete if we end up outsid e of a Mail blockquote
291 if (enclosingNodeOfType(m_selectionToDelete.start(), isMailBlockquote)) 291 if (enclosingNodeOfType(m_selectionToDelete.start(), isMailBlockquote))
292 m_deleteIntoBlockquoteStyle = EditingStyle::create(m_selectionToDelete.e nd()); 292 m_deleteIntoBlockquoteStyle = EditingStyle::create(m_selectionToDelete.e nd());
293 else 293 else
294 m_deleteIntoBlockquoteStyle = nullptr; 294 m_deleteIntoBlockquoteStyle = nullptr;
295 } 295 }
296 296
297 bool DeleteSelectionCommand::handleSpecialCaseBRDelete() 297 bool DeleteSelectionCommand::handleSpecialCaseBRDelete()
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 visitor->trace(m_deleteIntoBlockquoteStyle); 885 visitor->trace(m_deleteIntoBlockquoteStyle);
886 visitor->trace(m_startRoot); 886 visitor->trace(m_startRoot);
887 visitor->trace(m_endRoot); 887 visitor->trace(m_endRoot);
888 visitor->trace(m_startTableRow); 888 visitor->trace(m_startTableRow);
889 visitor->trace(m_endTableRow); 889 visitor->trace(m_endTableRow);
890 visitor->trace(m_temporaryPlaceholder); 890 visitor->trace(m_temporaryPlaceholder);
891 CompositeEditCommand::trace(visitor); 891 CompositeEditCommand::trace(visitor);
892 } 892 }
893 893
894 } // namespace blink 894 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/EditingStyle.h » ('j') | Source/core/editing/EditingStyle.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698