⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 157956 in webkit


Ignore:
Timestamp:
Oct 24, 2013, 2:31:11 PM (13 years ago)
Author:
Lucas Forschler
Message:

Merged r154308. <rdar://problem/15109394>

Location:
branches/safari-537.73-branch
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/safari-537.73-branch/LayoutTests/ChangeLog

    r157954 r157956  
     12013-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
    1162013-10-24  Oliver Hunt  <oliver@apple.com>
    217
  • branches/safari-537.73-branch/Source/WebCore/ChangeLog

    r157767 r157956  
     12013-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
    1272013-10-21  Lucas Forschler  <lforschler@apple.com>
    228
  • branches/safari-537.73-branch/Source/WebCore/html/shadow/SliderThumbElement.cpp

    r151282 r157956  
    225225bool SliderThumbElement::isDisabledFormControl() const
    226226{
    227     return hostInput()->isDisabledFormControl();
     227    HTMLInputElement* input = hostInput();
     228    return !input || input->isDisabledFormControl();
    228229}
    229230
    230231bool SliderThumbElement::matchesReadOnlyPseudoClass() const
    231232{
    232     return hostInput()->matchesReadOnlyPseudoClass();
     233    HTMLInputElement* input = hostInput();
     234    return input && input->matchesReadOnlyPseudoClass();
    233235}
    234236
    235237bool SliderThumbElement::matchesReadWritePseudoClass() const
    236238{
    237     return hostInput()->matchesReadWritePseudoClass();
     239    HTMLInputElement* input = hostInput();
     240    return input && input->matchesReadWritePseudoClass();
    238241}
    239242
    … …  
    251254void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point)
    252255{
    253     HTMLInputElement* input = hostInput();
    254     HTMLElement* trackElement = sliderTrackElementOf(input);
     256    RefPtr<HTMLInputElement> input(hostInput());
     257    HTMLElement* trackElement = sliderTrackElementOf(input.get());
    255258
    256259    if (!input->renderer() || !renderBox() || !trackElement->renderBox())
    … …  
    259262    input->setTextAsOfLastFormControlChangeEvent(input->value());
    260263    LayoutPoint offset = roundedLayoutPoint(input->renderer()->absoluteToLocal(point, UseTransforms));
    261     bool isVertical = hasVerticalAppearance(input);
     264    bool isVertical = hasVerticalAppearance(input.get());
    262265    bool isLeftToRightDirection = renderBox()->style()->isLeftToRightDirection();
    263266    LayoutUnit trackSize;
    … …  
    308311    // FIXME: This is no longer being set from renderer. Consider updating the method name.
    309312    input->setValueFromRenderer(valueString);
    310     renderer()->setNeedsLayout(true);
     313    if (renderer())
     314        renderer()->setNeedsLayout(true);
    311315    input->dispatchFormControlChangeEvent();
    312316}
    … …  
    401405    // Only HTMLInputElement creates SliderThumbElement instances as its shadow nodes.
    402406    // So, shadowHost() must be an HTMLInputElement.
    403     return shadowHost()->toInputElement();
     407    Element* host = shadowHost();
     408    return host ? host->toInputElement() : 0;
    404409}
    405410
Note: See TracChangeset for help on using the changeset viewer.