Changeset 157956 in webkit
- Timestamp:
- Oct 24, 2013, 2:31:11 PM (13 years ago)
- Location:
- branches/safari-537.73-branch
- Files:
-
- 3 edited
- 2 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/forms/range/range-type-change-oninput-expected.txt (copied) (copied from trunk/LayoutTests/fast/forms/range/range-type-change-oninput-expected.txt )
-
LayoutTests/fast/forms/range/range-type-change-oninput.html (copied) (copied from trunk/LayoutTests/fast/forms/range/range-type-change-oninput.html )
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/shadow/SliderThumbElement.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-537.73-branch/LayoutTests/ChangeLog
r157954 r157956 1 2013-10-24 Lucas Forschler <lforschler@apple.com> 2 3 Merge r154308 4 5 2013-08-19 Ryosuke Niwa <rniwa@webkit.org> 6 7 <https://webkit.org/b/119930> input[type=range]: Fix a crash by changing input type in 'input' event handler 8 9 Reviewed by Kent Tamura. 10 11 Add a regresion test from https://chromium.googlesource.com/chromium/blink/+/99afc9b55ce176b4f5fe053070e19dbebc1891a5 12 13 * fast/forms/range/range-type-change-oninput-expected.txt: Added. 14 * fast/forms/range/range-type-change-oninput.html: Added. 15 1 16 2013-10-24 Oliver Hunt <oliver@apple.com> 2 17 -
branches/safari-537.73-branch/Source/WebCore/ChangeLog
r157767 r157956 1 2013-10-24 Lucas Forschler <lforschler@apple.com> 2 3 Merge r154308 4 5 2013-08-19 Ryosuke Niwa <rniwa@webkit.org> 6 7 <https://webkit.org/b/119930> input[type=range]: Fix a crash by changing input type in 'input' event handler 8 9 Reviewed by Kent Tamura. 10 11 Merge https://chromium.googlesource.com/chromium/blink/+/99afc9b55ce176b4f5fe053070e19dbebc1891a5 12 13 In SliderThumbElement::setPositionFromPoint, renderer() can be NULL after HTMLInputElement::setValueFromRenderer, 14 which dispatches 'input' event. Also, make a local vairable 'input' a RefPtr just in case. 15 16 Also add null-poinetr checks for the host element as SliderThumbElement only weakly holds onto the host element. 17 18 Test: fast/forms/range/range-type-change-oninput.html 19 20 * html/shadow/SliderThumbElement.cpp: 21 (WebCore::SliderThumbElement::isDisabledFormControl): 22 (WebCore::SliderThumbElement::matchesReadOnlyPseudoClass): 23 (WebCore::SliderThumbElement::matchesReadWritePseudoClass): 24 (WebCore::SliderThumbElement::setPositionFromPoint): 25 (WebCore::SliderThumbElement::hostInput): 26 1 27 2013-10-21 Lucas Forschler <lforschler@apple.com> 2 28 -
branches/safari-537.73-branch/Source/WebCore/html/shadow/SliderThumbElement.cpp
r151282 r157956 225 225 bool SliderThumbElement::isDisabledFormControl() const 226 226 { 227 return hostInput()->isDisabledFormControl(); 227 HTMLInputElement* input = hostInput(); 228 return !input || input->isDisabledFormControl(); 228 229 } 229 230 230 231 bool SliderThumbElement::matchesReadOnlyPseudoClass() const 231 232 { 232 return hostInput()->matchesReadOnlyPseudoClass(); 233 HTMLInputElement* input = hostInput(); 234 return input && input->matchesReadOnlyPseudoClass(); 233 235 } 234 236 235 237 bool SliderThumbElement::matchesReadWritePseudoClass() const 236 238 { 237 return hostInput()->matchesReadWritePseudoClass(); 239 HTMLInputElement* input = hostInput(); 240 return input && input->matchesReadWritePseudoClass(); 238 241 } 239 242 … … 251 254 void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point) 252 255 { 253 HTMLInputElement* input = hostInput();254 HTMLElement* trackElement = sliderTrackElementOf(input );256 RefPtr<HTMLInputElement> input(hostInput()); 257 HTMLElement* trackElement = sliderTrackElementOf(input.get()); 255 258 256 259 if (!input->renderer() || !renderBox() || !trackElement->renderBox()) … … 259 262 input->setTextAsOfLastFormControlChangeEvent(input->value()); 260 263 LayoutPoint offset = roundedLayoutPoint(input->renderer()->absoluteToLocal(point, UseTransforms)); 261 bool isVertical = hasVerticalAppearance(input );264 bool isVertical = hasVerticalAppearance(input.get()); 262 265 bool isLeftToRightDirection = renderBox()->style()->isLeftToRightDirection(); 263 266 LayoutUnit trackSize; … … 308 311 // FIXME: This is no longer being set from renderer. Consider updating the method name. 309 312 input->setValueFromRenderer(valueString); 310 renderer()->setNeedsLayout(true); 313 if (renderer()) 314 renderer()->setNeedsLayout(true); 311 315 input->dispatchFormControlChangeEvent(); 312 316 } … … 401 405 // Only HTMLInputElement creates SliderThumbElement instances as its shadow nodes. 402 406 // So, shadowHost() must be an HTMLInputElement. 403 return shadowHost()->toInputElement(); 407 Element* host = shadowHost(); 408 return host ? host->toInputElement() : 0; 404 409 } 405 410
Note:
See TracChangeset
for help on using the changeset viewer.