OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |