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

Side by Side Diff: Source/core/editing/ReplaceSelectionCommand.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/editing/FrameSelection.cpp ('k') | Source/core/html/BaseButtonInputType.h » ('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, 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 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 // A br that was originally holding a line open should be displaced by inser ted content or turned into a line break. 1243 // A br that was originally holding a line open should be displaced by inser ted content or turned into a line break.
1244 // A br that was originally acting as a line break should still be acting as a line break, not as a placeholder. 1244 // A br that was originally acting as a line break should still be acting as a line break, not as a placeholder.
1245 return isStartOfParagraph(visiblePos) && isEndOfParagraph(visiblePos); 1245 return isStartOfParagraph(visiblePos) && isEndOfParagraph(visiblePos);
1246 } 1246 }
1247 1247
1248 bool ReplaceSelectionCommand::shouldPerformSmartReplace() const 1248 bool ReplaceSelectionCommand::shouldPerformSmartReplace() const
1249 { 1249 {
1250 if (!m_smartReplace) 1250 if (!m_smartReplace)
1251 return false; 1251 return false;
1252 1252
1253 Element* textControl = enclosingTextFormControl(positionAtStartOfInsertedCon tent().deepEquivalent()); 1253 Element* textControl = Handle<HTMLTextFormControlElement>(enclosingTextFormC ontrol(positionAtStartOfInsertedContent().deepEquivalent())).raw();
1254 if (textControl && textControl->hasTagName(inputTag) && static_cast<HTMLInpu tElement*>(textControl)->isPasswordField()) 1254 if (textControl && textControl->hasTagName(inputTag) && static_cast<HTMLInpu tElement*>(textControl)->isPasswordField())
1255 return false; // Disable smart replace for password fields. 1255 return false; // Disable smart replace for password fields.
1256 1256
1257 return true; 1257 return true;
1258 } 1258 }
1259 1259
1260 static bool isCharacterSmartReplaceExemptConsideringNonBreakingSpace(UChar32 cha racter, bool previousCharacter) 1260 static bool isCharacterSmartReplaceExemptConsideringNonBreakingSpace(UChar32 cha racter, bool previousCharacter)
1261 { 1261 {
1262 return isCharacterSmartReplaceExempt(character == noBreakSpace ? ' ' : chara cter, previousCharacter); 1262 return isCharacterSmartReplaceExempt(character == noBreakSpace ? ' ' : chara cter, previousCharacter);
1263 } 1263 }
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get()); 1490 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get());
1491 1491
1492 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d); 1492 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d);
1493 1493
1494 setEndingSelection(selectionAfterReplace); 1494 setEndingSelection(selectionAfterReplace);
1495 1495
1496 return true; 1496 return true;
1497 } 1497 }
1498 1498
1499 } // namespace WebCore 1499 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/FrameSelection.cpp ('k') | Source/core/html/BaseButtonInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698