Changeset 258532 in webkit
- Timestamp:
- Mar 16, 2020 5:14:34 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r258531 r258532 1 2020-03-16 ChangSeok Oh <changseok@webkit.org> 2 3 A change event gets dispatched when textarea gets changed without focus 4 https://bugs.webkit.org/show_bug.cgi?id=202144 5 6 Reviewed by Ryosuke Niwa. 7 8 The test should be identical to the extected result without crash. 9 10 * fast/forms/textfield-onchange-without-focus-expected.html: Added. 11 * fast/forms/textfield-onchange-without-focus.html: Added. 12 1 13 2020-03-16 Keith Miller <keith_miller@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r258528 r258532 1 2020-03-16 ChangSeok Oh <changseok@webkit.org> 2 3 A change event gets dispatched when textarea gets changed without focus 4 https://bugs.webkit.org/show_bug.cgi?id=202144 5 6 Reviewed by Ryosuke Niwa. 7 8 A crash happens in WebCore::ValidationMessage::buildBubbleTree. An immediate reason 9 is that DOM tree is modified in buildBubbleTree triggered by a timer. 10 The function calls document.updateLayout() that causes a change event 11 for textarea to fire when something changed in the textarea. 12 This bug is not reproduced on Mac because buildBubbleTree is not called. 13 See ValidationMessage::setMessage. 14 On the other hand, the root cause of this issue is triggering the change event 15 for textarea even if it is not focused when a change is made. This behavior 16 is different to what Gecko and Chromium do. When loading the test, they do not 17 trigger the change event although the textarea is filled by the script 18 since the textarea is not focused. Only when we manually make a change (meaning 19 the textarea is focused by user input), the event gets dispatched. To fix it, 20 setChangedSinceLastFormControlChangeEvent(true) is moved below the focus check 21 in HTMLTextAreaElement::subtreeHasChanged(); 22 23 Test: fast/forms/textfield-onchange-without-focus.html 24 25 * html/HTMLTextAreaElement.cpp: 26 (WebCore::HTMLTextAreaElement::subtreeHasChanged): 27 1 28 2020-03-16 Simon Fraser <simon.fraser@apple.com> 2 29 -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r248914 r258532 285 285 void HTMLTextAreaElement::subtreeHasChanged() 286 286 { 287 setChangedSinceLastFormControlChangeEvent(true);288 287 setFormControlValueMatchesRenderer(false); 289 288 updateValidity(); … … 291 290 if (!focused()) 292 291 return; 292 293 setChangedSinceLastFormControlChangeEvent(true); 293 294 294 295 if (RefPtr<Frame> frame = document().frame())
Note: See TracChangeset
for help on using the changeset viewer.