Changeset 277778 in webkit


Ignore:
Timestamp:
May 20, 2021 6:21:40 AM (14 months ago)
Author:
Aditya Keerthi
Message:

Value of a color input does not update visually when using setAttribute
https://bugs.webkit.org/show_bug.cgi?id=166930
<rdar://problem/29983218>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/forms/color/color-input-set-attribute-value.html

  • html/ColorInputType.cpp:

(WebCore::ColorInputType::attributeChanged):

Update the color swatch when the value attribute is changed.

  • html/ColorInputType.h:

LayoutTests:

  • fast/forms/color/color-input-set-attribute-value-expected.html: Added.
  • fast/forms/color/color-input-set-attribute-value.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r277777 r277778  
     12021-05-20  Aditya Keerthi  <akeerthi@apple.com>
     2
     3        Value of a color input does not update visually when using setAttribute
     4        https://bugs.webkit.org/show_bug.cgi?id=166930
     5        <rdar://problem/29983218>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/forms/color/color-input-set-attribute-value-expected.html: Added.
     10        * fast/forms/color/color-input-set-attribute-value.html: Added.
     11
    1122021-05-20  Felipe Erias  <felipeerias@igalia.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r277777 r277778  
     12021-05-20  Aditya Keerthi  <akeerthi@apple.com>
     2
     3        Value of a color input does not update visually when using setAttribute
     4        https://bugs.webkit.org/show_bug.cgi?id=166930
     5        <rdar://problem/29983218>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Test: fast/forms/color/color-input-set-attribute-value.html
     10
     11        * html/ColorInputType.cpp:
     12        (WebCore::ColorInputType::attributeChanged):
     13
     14        Update the color swatch when the value attribute is changed.
     15
     16        * html/ColorInputType.h:
     17
    1182021-05-20  Felipe Erias  <felipeerias@igalia.com>
    219
  • trunk/Source/WebCore/html/ColorInputType.cpp

    r272097 r277778  
    166166}
    167167
     168void ColorInputType::attributeChanged(const QualifiedName& name)
     169{
     170    if (name == valueAttr)
     171        updateColorSwatch();
     172
     173    InputType::attributeChanged(name);
     174}
     175
    168176void ColorInputType::handleDOMActivateEvent(Event& event)
    169177{
  • trunk/Source/WebCore/html/ColorInputType.h

    r272097 r277778  
    6060    void createShadowSubtreeAndUpdateInnerTextElementEditability(ContainerNode::ChildChange::Source, bool) final;
    6161    void setValue(const String&, bool valueChanged, TextFieldEventBehavior) final;
     62    void attributeChanged(const QualifiedName&) final;
    6263    void handleDOMActivateEvent(Event&) final;
    6364    void detach() final;
Note: See TracChangeset for help on using the changeset viewer.