| 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 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |