Changeset 202626 in webkit


Ignore:
Timestamp:
Jun 29, 2016 9:50:21 AM (8 years ago)
Author:
ddkilzer@apple.com
Message:

Crash when 'input' event handler for input[type=color] changes the input type
<https://webkit.org/b/159262>
<rdar://problem/27020404>

Reviewed by Daniel Bates.

Source/WebCore:

Fix based on a Blink change (patch by <tkent@chromium.org>):
<https://chromium.googlesource.com/chromium/src.git/+/a17cb3ecef49a078657524cdeaba33ad2083646c>

Test: fast/forms/color/color-type-change-on-input-crash.html

  • html/ColorInputType.cpp:

(WebCore::ColorInputType::didChooseColor): Add EventQueueScope
before setValueFromRenderer() to fix the bug.

  • html/HTMLInputElement.h:

(WebCore::HTMLInputElement::setValueFromRenderer): Add comment
about how to use this method.

LayoutTests:

Test based on a Blink change (patch by <tkent@chromium.org>):
<https://chromium.googlesource.com/chromium/src.git/+/a17cb3ecef49a078657524cdeaba33ad2083646c>

  • fast/forms/color/color-type-change-on-input-crash-expected.txt: Added.
  • fast/forms/color/color-type-change-on-input-crash.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202625 r202626  
     12016-06-29  David Kilzer  <ddkilzer@apple.com>
     2
     3        Crash when 'input' event handler for input[type=color] changes the input type
     4        <https://webkit.org/b/159262>
     5        <rdar://problem/27020404>
     6
     7        Reviewed by Daniel Bates.
     8
     9        Test based on a Blink change (patch by <tkent@chromium.org>):
     10        <https://chromium.googlesource.com/chromium/src.git/+/a17cb3ecef49a078657524cdeaba33ad2083646c>
     11
     12        * fast/forms/color/color-type-change-on-input-crash-expected.txt: Added.
     13        * fast/forms/color/color-type-change-on-input-crash.html: Added.
     14
    1152016-06-29  Adam Bergkvist  <adam.bergkvist@ericsson.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r202625 r202626  
     12016-06-29  David Kilzer  <ddkilzer@apple.com>
     2
     3        Crash when 'input' event handler for input[type=color] changes the input type
     4        <https://webkit.org/b/159262>
     5        <rdar://problem/27020404>
     6
     7        Reviewed by Daniel Bates.
     8
     9        Fix based on a Blink change (patch by <tkent@chromium.org>):
     10        <https://chromium.googlesource.com/chromium/src.git/+/a17cb3ecef49a078657524cdeaba33ad2083646c>
     11
     12        Test: fast/forms/color/color-type-change-on-input-crash.html
     13
     14        * html/ColorInputType.cpp:
     15        (WebCore::ColorInputType::didChooseColor): Add EventQueueScope
     16        before setValueFromRenderer() to fix the bug.
     17        * html/HTMLInputElement.h:
     18        (WebCore::HTMLInputElement::setValueFromRenderer): Add comment
     19        about how to use this method.
     20
    1212016-06-29  Adam Bergkvist  <adam.bergkvist@ericsson.com>
    222
  • trunk/Source/WebCore/html/ColorInputType.cpp

    r200696 r202626  
    11/*
    22 * Copyright (C) 2010 Google Inc. All rights reserved.
    3  * Copyright (C) 2015 Apple Inc. All rights reserved.
     3 * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    4747#include "RenderObject.h"
    4848#include "RenderView.h"
     49#include "ScopedEventQueue.h"
    4950#include "ScriptController.h"
    5051#include "ShadowRoot.h"
     
    175176    if (element().isDisabledOrReadOnly() || color == valueAsColor())
    176177        return;
     178    EventQueueScope scope;
    177179    element().setValueFromRenderer(color.serialized());
    178180    updateColorSwatch();
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r202245 r202626  
    33 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
    44 *           (C) 2000 Dirk Mueller (mueller@kde.org)
    5  * Copyright (C) 2004, 2005, 2006, 2007, 2010, 2016 Apple Inc. All rights reserved.
     5 * Copyright (C) 2004-2016 Apple Inc. All rights reserved.
    66 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
    77 *
     
    198198    String valueWithDefault() const;
    199199
     200    // This function dispatches 'input' event for non-textfield types. Callers
     201    // need to handle any DOM structure changes by event handlers, or need to
     202    // delay the 'input' event with EventQueueScope.
    200203    void setValueFromRenderer(const String&);
    201204
Note: See TracChangeset for help on using the changeset viewer.