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

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

Issue 1119663002: Making Unicode character names consistent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase patch Created 5 years, 7 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
« no previous file with comments | « Source/core/editing/MarkupAccumulator.cpp ('k') | Source/core/editing/VisibleSelection.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, 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 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 1292
1293 HTMLTextFormControlElement* textControl = enclosingTextFormControl(positionA tStartOfInsertedContent().deepEquivalent()); 1293 HTMLTextFormControlElement* textControl = enclosingTextFormControl(positionA tStartOfInsertedContent().deepEquivalent());
1294 if (isHTMLInputElement(textControl) && toHTMLInputElement(textControl)->type () == InputTypeNames::password) 1294 if (isHTMLInputElement(textControl) && toHTMLInputElement(textControl)->type () == InputTypeNames::password)
1295 return false; // Disable smart replace for password fields. 1295 return false; // Disable smart replace for password fields.
1296 1296
1297 return true; 1297 return true;
1298 } 1298 }
1299 1299
1300 static bool isCharacterSmartReplaceExemptConsideringNonBreakingSpace(UChar32 cha racter, bool previousCharacter) 1300 static bool isCharacterSmartReplaceExemptConsideringNonBreakingSpace(UChar32 cha racter, bool previousCharacter)
1301 { 1301 {
1302 return isCharacterSmartReplaceExempt(character == noBreakSpace ? ' ' : chara cter, previousCharacter); 1302 return isCharacterSmartReplaceExempt(character == noBreakSpaceCharacter ? ' ' : character, previousCharacter);
1303 } 1303 }
1304 1304
1305 void ReplaceSelectionCommand::addSpacesForSmartReplace() 1305 void ReplaceSelectionCommand::addSpacesForSmartReplace()
1306 { 1306 {
1307 VisiblePosition startOfInsertedContent = positionAtStartOfInsertedContent(); 1307 VisiblePosition startOfInsertedContent = positionAtStartOfInsertedContent();
1308 VisiblePosition endOfInsertedContent = positionAtEndOfInsertedContent(); 1308 VisiblePosition endOfInsertedContent = positionAtEndOfInsertedContent();
1309 1309
1310 Position endUpstream = endOfInsertedContent.deepEquivalent().upstream(); 1310 Position endUpstream = endOfInsertedContent.deepEquivalent().upstream();
1311 Node* endNode = endUpstream.computeNodeBeforePosition(); 1311 Node* endNode = endUpstream.computeNodeBeforePosition();
1312 int endOffset = endNode && endNode->isTextNode() ? toText(endNode)->length() : 0; 1312 int endOffset = endNode && endNode->isTextNode() ? toText(endNode)->length() : 0;
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 DEFINE_TRACE(ReplaceSelectionCommand) 1542 DEFINE_TRACE(ReplaceSelectionCommand)
1543 { 1543 {
1544 visitor->trace(m_startOfInsertedContent); 1544 visitor->trace(m_startOfInsertedContent);
1545 visitor->trace(m_endOfInsertedContent); 1545 visitor->trace(m_endOfInsertedContent);
1546 visitor->trace(m_insertionStyle); 1546 visitor->trace(m_insertionStyle);
1547 visitor->trace(m_documentFragment); 1547 visitor->trace(m_documentFragment);
1548 CompositeEditCommand::trace(visitor); 1548 CompositeEditCommand::trace(visitor);
1549 } 1549 }
1550 1550
1551 } // namespace blink 1551 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/MarkupAccumulator.cpp ('k') | Source/core/editing/VisibleSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698