Changeset 154308 in webkit
- Timestamp:
- Aug 19, 2013, 5:02:56 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/forms/range/range-type-change-oninput-expected.txt (added)
-
LayoutTests/fast/forms/range/range-type-change-oninput.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/shadow/SliderThumbElement.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r154306 r154308 1 2013-08-19 Ryosuke Niwa <rniwa@webkit.org> 2 3 <https://webkit.org/b/119930> input[type=range]: Fix a crash by changing input type in 'input' event handler 4 5 Reviewed by Kent Tamura. 6 7 Add a regresion test from https://chromium.googlesource.com/chromium/blink/+/99afc9b55ce176b4f5fe053070e19dbebc1891a5 8 9 * fast/forms/range/range-type-change-oninput-expected.txt: Added. 10 * fast/forms/range/range-type-change-oninput.html: Added. 11 1 12 2013-08-19 Alexey Proskuryakov <ap@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r154306 r154308 1 2013-08-19 Ryosuke Niwa <rniwa@webkit.org> 2 3 <https://webkit.org/b/119930> input[type=range]: Fix a crash by changing input type in 'input' event handler 4 5 Reviewed by Kent Tamura. 6 7 Merge https://chromium.googlesource.com/chromium/blink/+/99afc9b55ce176b4f5fe053070e19dbebc1891a5 8 9 In SliderThumbElement::setPositionFromPoint, renderer() can be NULL after HTMLInputElement::setValueFromRenderer, 10 which dispatches 'input' event. Also, make a local vairable 'input' a RefPtr just in case. 11 12 Also add null-poinetr checks for the host element as SliderThumbElement only weakly holds onto the host element. 13 14 Test: fast/forms/range/range-type-change-oninput.html 15 16 * html/shadow/SliderThumbElement.cpp: 17 (WebCore::SliderThumbElement::isDisabledFormControl): 18 (WebCore::SliderThumbElement::matchesReadOnlyPseudoClass): 19 (WebCore::SliderThumbElement::matchesReadWritePseudoClass): 20 (WebCore::SliderThumbElement::setPositionFromPoint): 21 (WebCore::SliderThumbElement::hostInput): 22 1 23 2013-08-19 Alexey Proskuryakov <ap@apple.com> 2 24 -
trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp
r154254 r154308 230 230 bool SliderThumbElement::isDisabledFormControl() const 231 231 { 232 return hostInput()->isDisabledFormControl(); 232 HTMLInputElement* input = hostInput(); 233 return !input || input->isDisabledFormControl(); 233 234 } 234 235 235 236 bool SliderThumbElement::matchesReadOnlyPseudoClass() const 236 237 { 237 return hostInput()->matchesReadOnlyPseudoClass(); 238 HTMLInputElement* input = hostInput(); 239 return input && input->matchesReadOnlyPseudoClass(); 238 240 } 239 241 240 242 bool SliderThumbElement::matchesReadWritePseudoClass() const 241 243 { 242 return hostInput()->matchesReadWritePseudoClass(); 244 HTMLInputElement* input = hostInput(); 245 return input && input->matchesReadWritePseudoClass(); 243 246 } 244 247 … … 256 259 void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point) 257 260 { 258 HTMLInputElement* input = hostInput();259 HTMLElement* trackElement = sliderTrackElementOf(input );261 RefPtr<HTMLInputElement> input(hostInput()); 262 HTMLElement* trackElement = sliderTrackElementOf(input.get()); 260 263 261 264 if (!input->renderer() || !renderBox() || !trackElement->renderBox()) … … 264 267 input->setTextAsOfLastFormControlChangeEvent(input->value()); 265 268 LayoutPoint offset = roundedLayoutPoint(input->renderer()->absoluteToLocal(point, UseTransforms)); 266 bool isVertical = hasVerticalAppearance(input );269 bool isVertical = hasVerticalAppearance(input.get()); 267 270 bool isLeftToRightDirection = renderBox()->style()->isLeftToRightDirection(); 268 271 LayoutUnit trackSize; … … 313 316 // FIXME: This is no longer being set from renderer. Consider updating the method name. 314 317 input->setValueFromRenderer(valueString); 315 renderer()->setNeedsLayout(true); 318 if (renderer()) 319 renderer()->setNeedsLayout(true); 316 320 input->dispatchFormControlChangeEvent(); 317 321 } … … 405 409 // Only HTMLInputElement creates SliderThumbElement instances as its shadow nodes. 406 410 // So, shadowHost() must be an HTMLInputElement. 407 return shadowHost()->toInputElement(); 411 Element* host = shadowHost(); 412 return host ? host->toInputElement() : 0; 408 413 } 409 414
Note:
See TracChangeset
for help on using the changeset viewer.