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

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

Issue 20681004: Make first-letter style to work with editing Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-08-01T17:57:42 Created 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 return; 888 return;
889 889
890 if (!selection.rootEditableElement()) 890 if (!selection.rootEditableElement())
891 return; 891 return;
892 892
893 ReplacementFragment fragment(document(), m_documentFragment.get(), selection ); 893 ReplacementFragment fragment(document(), m_documentFragment.get(), selection );
894 if (performTrivialReplace(fragment)) 894 if (performTrivialReplace(fragment))
895 return; 895 return;
896 896
897 // We can skip matching the style if the selection is plain text. 897 // We can skip matching the style if the selection is plain text.
898 if ((selection.start().deprecatedNode()->renderer() && selection.start().dep recatedNode()->renderer()->style()->userModify() == READ_WRITE_PLAINTEXT_ONLY) 898 if ((selection.start().renderer() && selection.start().renderer()->style()-> userModify() == READ_WRITE_PLAINTEXT_ONLY)
899 && (selection.end().deprecatedNode()->renderer() && selection.end().depr ecatedNode()->renderer()->style()->userModify() == READ_WRITE_PLAINTEXT_ONLY)) 899 && (selection.end().renderer() && selection.end().renderer()->style()->u serModify() == READ_WRITE_PLAINTEXT_ONLY))
900 m_matchStyle = false; 900 m_matchStyle = false;
901 901
902 if (m_matchStyle) { 902 if (m_matchStyle) {
903 m_insertionStyle = EditingStyle::create(selection.start()); 903 m_insertionStyle = EditingStyle::create(selection.start());
904 m_insertionStyle->mergeTypingStyle(document()); 904 m_insertionStyle->mergeTypingStyle(document());
905 } 905 }
906 906
907 VisiblePosition visibleStart = selection.visibleStart(); 907 VisiblePosition visibleStart = selection.visibleStart();
908 VisiblePosition visibleEnd = selection.visibleEnd(); 908 VisiblePosition visibleEnd = selection.visibleEnd();
909 909
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get()); 1487 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get());
1488 1488
1489 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d); 1489 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d);
1490 1490
1491 setEndingSelection(selectionAfterReplace); 1491 setEndingSelection(selectionAfterReplace);
1492 1492
1493 return true; 1493 return true;
1494 } 1494 }
1495 1495
1496 } // namespace WebCore 1496 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698