OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 unsigned newSelectionEnd = selectionEnd(); | 228 unsigned newSelectionEnd = selectionEnd(); |
229 | 229 |
230 start = std::min(start, textLength); | 230 start = std::min(start, textLength); |
231 end = std::min(end, textLength); | 231 end = std::min(end, textLength); |
232 | 232 |
233 if (start < end) | 233 if (start < end) |
234 text.replace(start, end - start, replacement); | 234 text.replace(start, end - start, replacement); |
235 else | 235 else |
236 text.insert(replacement, start); | 236 text.insert(replacement, start); |
237 | 237 |
238 setInnerEditorValue(text); | 238 setValue(text, TextFieldEventBehavior::DispatchNoEvent); |
239 subtreeHasChanged(); | |
240 | 239 |
241 if (selectionMode == "select") { | 240 if (selectionMode == "select") { |
242 newSelectionStart = start; | 241 newSelectionStart = start; |
243 newSelectionEnd = start + replacementLength; | 242 newSelectionEnd = start + replacementLength; |
244 } else if (selectionMode == "start") { | 243 } else if (selectionMode == "start") { |
245 newSelectionStart = newSelectionEnd = start; | 244 newSelectionStart = newSelectionEnd = start; |
246 } else if (selectionMode == "end") { | 245 } else if (selectionMode == "end") { |
247 newSelectionStart = newSelectionEnd = start + replacementLength; | 246 newSelectionStart = newSelectionEnd = start + replacementLength; |
248 } else { | 247 } else { |
249 ASSERT(selectionMode == "preserve"); | 248 ASSERT(selectionMode == "preserve"); |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 } | 1009 } |
1011 | 1010 |
1012 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(const Ele
ment& source) | 1011 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(const Ele
ment& source) |
1013 { | 1012 { |
1014 const HTMLTextFormControlElement& sourceElement = static_cast<const HTMLText
FormControlElement&>(source); | 1013 const HTMLTextFormControlElement& sourceElement = static_cast<const HTMLText
FormControlElement&>(source); |
1015 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; | 1014 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; |
1016 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); | 1015 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); |
1017 } | 1016 } |
1018 | 1017 |
1019 } // namespace blink | 1018 } // namespace blink |
OLD | NEW |