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

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

Issue 19510005: [oilpan] Completely move HTMLFormControlElement's hierarchy to the managed heap Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years, 5 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 | « Source/core/dom/Node.cpp ('k') | Source/core/editing/Editor.cpp » ('j') | no next file with comments »
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 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 if (!m_hasSelectionToDelete) 787 if (!m_hasSelectionToDelete)
788 m_selectionToDelete = endingSelection(); 788 m_selectionToDelete = endingSelection();
789 789
790 if (!m_selectionToDelete.isNonOrphanedRange()) 790 if (!m_selectionToDelete.isNonOrphanedRange())
791 return; 791 return;
792 792
793 String originalString = originalStringForAutocorrectionAtBeginningOfSelectio n(); 793 String originalString = originalStringForAutocorrectionAtBeginningOfSelectio n();
794 794
795 // If the deletion is occurring in a text field, and we're not deleting to r eplace the selection, then let the frame call across the bridge to notify the fo rm delegate. 795 // If the deletion is occurring in a text field, and we're not deleting to r eplace the selection, then let the frame call across the bridge to notify the fo rm delegate.
796 if (!m_replace) { 796 if (!m_replace) {
797 Element* textControl = enclosingTextFormControl(m_selectionToDelete.star t()); 797 Element* textControl = Handle<HTMLTextFormControlElement>(enclosingTextF ormControl(m_selectionToDelete.start())).raw();
798 if (textControl && textControl->focused()) 798 if (textControl && textControl->focused())
799 document()->frame()->editor()->textWillBeDeletedInTextField(textCont rol); 799 document()->frame()->editor()->textWillBeDeletedInTextField(textCont rol);
800 } 800 }
801 801
802 // save this to later make the selection with 802 // save this to later make the selection with
803 EAffinity affinity = m_selectionToDelete.affinity(); 803 EAffinity affinity = m_selectionToDelete.affinity();
804 804
805 Position downstreamEnd = m_selectionToDelete.end().downstream(); 805 Position downstreamEnd = m_selectionToDelete.end().downstream();
806 m_needPlaceholder = isStartOfParagraph(m_selectionToDelete.visibleStart(), C anCrossEditingBoundary) 806 m_needPlaceholder = isStartOfParagraph(m_selectionToDelete.visibleStart(), C anCrossEditingBoundary)
807 && isEndOfParagraph(m_selectionToDelete.visibleEnd(), CanCrossEditin gBoundary) 807 && isEndOfParagraph(m_selectionToDelete.visibleEnd(), CanCrossEditin gBoundary)
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 873
874 // Normally deletion doesn't preserve the typing style that was present before i t. For example, 874 // Normally deletion doesn't preserve the typing style that was present before i t. For example,
875 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't 875 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't
876 // stick around. Deletion should preserve a typing style that *it* sets, howeve r. 876 // stick around. Deletion should preserve a typing style that *it* sets, howeve r.
877 bool DeleteSelectionCommand::preservesTypingStyle() const 877 bool DeleteSelectionCommand::preservesTypingStyle() const
878 { 878 {
879 return m_typingStyle; 879 return m_typingStyle;
880 } 880 }
881 881
882 } // namespace WebCore 882 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698