Changeset 164329 in webkit
- Timestamp:
- Feb 18, 2014 4:04:07 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r164324 r164329 1 2014-02-18 Ryosuke Niwa <rniwa@webkit.org> 2 3 TextFieldInputType::handleBeforeTextInsertedEvent shouldn't use plainText 4 https://bugs.webkit.org/show_bug.cgi?id=128953 5 6 Reviewed by Alexey Proskuryakov. 7 8 Don't use FrameSelection's toNormalizedRange and plainText. Instead, use the cached selection start and selection 9 end to extract the selected text. The caches are updated inside FrameSelection::setSelection whenever selection 10 is inside a text form control via HTMLTextFormControlElement::selectionChanged. 11 12 * html/TextFieldInputType.cpp: 13 (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent): 14 1 15 2014-02-18 Viatcheslav Ostapenko <sl.ostapenko@samsung.com> 2 16 -
trunk/Source/WebCore/html/TextFieldInputType.cpp
r164184 r164329 375 375 // because they can be mismatched by sanitizeValue() in 376 376 // HTMLInputElement::subtreeHasChanged() in some cases. 377 unsigned oldLength = numGraphemeClusters(element().innerTextValue()); 377 String innerText = element().innerTextValue(); 378 unsigned oldLength = numGraphemeClusters(innerText); 378 379 379 380 // selectionLength represents the selection length of this text field to be … … 382 383 // selection length. The selection is the source of text drag-and-drop in 383 384 // that case, and nothing in the text field will be removed. 384 unsigned selectionLength = element().focused() ? numGraphemeClusters(plainText(element().document().frame()->selection().selection().toNormalizedRange().get())) : 0; 385 unsigned selectionLength = 0; 386 if (element().focused()) { 387 ASSERT(enclosingTextFormControl(element().document().frame()->selection().selection().start()) == &element()); 388 selectionLength = numGraphemeClusters(innerText.substring(element().selectionStart(), element().selectionEnd())); 389 } 385 390 ASSERT(oldLength >= selectionLength); 386 391
Note: See TracChangeset
for help on using the changeset viewer.