Changeset 84329 in webkit


Ignore:
Timestamp:
Apr 19, 2011 7:13:22 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-19 Julien Chaffraix <jchaffraix@codeaurora.org>

Reviewed by Alexey Proskuryakov.

https://bugs.webkit.org/show_bug.cgi?id=45425
HTMLLinkElement.disabled does not forward value to the Stylesheet's disabled attribute on setting

Test case by Bijan Amirzada <bijana@codeaurora.org>.

  • fast/dom/HTMLLinkElement/disabled-attribute-expected.txt: Added.
  • fast/dom/HTMLLinkElement/disabled-attribute.html: Added. Test that the properties are properly forwarded to the stylesheet.
  • fast/dom/boolean-attribute-reflection-expected.txt:
  • fast/dom/script-tests/boolean-attribute-reflection.js: Removed link:disabled as it is not reflected anymore.

2011-04-19 Julien Chaffraix <jchaffraix@codeaurora.org>

Reviewed by Alexey Proskuryakov.

https://bugs.webkit.org/show_bug.cgi?id=45425
HTMLLinkElement.disabled does not forward value to the Stylesheet's disabled attribute on setting

Test: fast/html/htmllink-disable.html
Test: fast/dom/HTMLLinkElement/disabled-attribute.html

Match the HTML5 specification by forwarding the 'disabled' attribute to our stylesheet.

Based on previous work by Bijan Amirzada <bijana@codeaurora.org>.

  • html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::disabled): Return our stylesheet's 'disabled' value or false if we don't have a stylesheet. (WebCore::HTMLLinkElement::setDisabled): Set our stylesheet's 'disabled' value or ignore the call if we don't have a stylesheet.
  • html/HTMLLinkElement.h:
  • html/HTMLLinkElement.idl: Remove 'Reflect' as it is not a reflected attribute anymore in HTML5. This matches the way FF4, Opera and IE9 handle the attribute.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r84327 r84329  
     12011-04-19  Julien Chaffraix  <jchaffraix@codeaurora.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=45425
     6        HTMLLinkElement.disabled does not forward value to the Stylesheet's disabled attribute on setting
     7
     8        Test case by Bijan Amirzada <bijana@codeaurora.org>.
     9
     10        * fast/dom/HTMLLinkElement/disabled-attribute-expected.txt: Added.
     11        * fast/dom/HTMLLinkElement/disabled-attribute.html: Added.
     12        Test that the properties are properly forwarded to the stylesheet.
     13
     14        * fast/dom/boolean-attribute-reflection-expected.txt:
     15        * fast/dom/script-tests/boolean-attribute-reflection.js: Removed link:disabled as it is
     16        not reflected anymore.
     17
    1182011-04-19  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/LayoutTests/fast/dom/boolean-attribute-reflection-expected.txt

    r75354 r84329  
    6060PASS e = make('input'); e.setAttribute('required', 'x'); e.required = false; e.getAttribute('required') is null
    6161PASS e = make('input'); e.setAttribute('required', 'x'); e.required = true; e.getAttribute('required') is ''
    62 PASS e = make('link'); e.removeAttribute('disabled'); e.disabled is false
    63 PASS e = make('link'); e.setAttribute('disabled', ''); e.disabled is true
    64 PASS e = make('link'); e.setAttribute('disabled', 'x'); e.disabled = false; e.getAttribute('disabled') is null
    65 PASS e = make('link'); e.setAttribute('disabled', 'x'); e.disabled = true; e.getAttribute('disabled') is ''
    6662PASS e = make('menu'); e.removeAttribute('compact'); e.compact is false
    6763PASS e = make('menu'); e.setAttribute('compact', ''); e.compact is true
  • trunk/LayoutTests/fast/dom/script-tests/boolean-attribute-reflection.js

    r75354 r84329  
    1616    [ "input", "readOnly" ],
    1717    [ "input", "required" ],
    18     [ "link", "disabled" ],
    1918    [ "menu", "compact" ],
    2019    [ "object", "declare" ],
  • trunk/Source/WebCore/ChangeLog

    r84326 r84329  
     12011-04-19  Julien Chaffraix  <jchaffraix@codeaurora.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=45425
     6        HTMLLinkElement.disabled does not forward value to the Stylesheet's disabled attribute on setting
     7
     8        Test: fast/html/htmllink-disable.html
     9        Test: fast/dom/HTMLLinkElement/disabled-attribute.html
     10
     11        Match the HTML5 specification by forwarding the 'disabled' attribute to our stylesheet.
     12
     13        Based on previous work by Bijan Amirzada <bijana@codeaurora.org>.
     14
     15        * html/HTMLLinkElement.cpp:
     16        (WebCore::HTMLLinkElement::disabled): Return our stylesheet's 'disabled' value or
     17        false if we don't have a stylesheet.
     18        (WebCore::HTMLLinkElement::setDisabled): Set our stylesheet's 'disabled' value or
     19        ignore the call if we don't have a stylesheet.
     20        * html/HTMLLinkElement.h:
     21        * html/HTMLLinkElement.idl: Remove 'Reflect' as it is not a reflected attribute anymore in HTML5.
     22        This matches the way FF4, Opera and IE9 handle the attribute.
     23
    1242011-04-19  Ryosuke Niwa  <rniwa@webkit.org>
    225
  • trunk/Source/WebCore/html/HTMLLinkElement.cpp

    r84110 r84329  
    513513}
    514514
    515 }
     515bool HTMLLinkElement::disabled() const
     516{
     517    return m_sheet && m_sheet->disabled();
     518}
     519
     520void HTMLLinkElement::setDisabled(bool disabled)
     521{
     522    if (!m_sheet)
     523        return;
     524    m_sheet->setDisabled(disabled);
     525}
     526
     527}
  • trunk/Source/WebCore/html/HTMLLinkElement.h

    r84110 r84329  
    7878    bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript; }
    7979    bool isIcon() const { return m_relAttribute.m_isIcon; }
     80    bool disabled() const;
     81    void setDisabled(bool);
    8082
    8183private:
  • trunk/Source/WebCore/html/HTMLLinkElement.idl

    r72344 r84329  
    2222
    2323    interface [CustomMarkFunction] HTMLLinkElement : HTMLElement {
    24         attribute [Reflect] boolean disabled;
     24        attribute boolean disabled;
    2525        attribute [Reflect] DOMString charset;
    2626        attribute [Reflect, URL] DOMString href;
Note: See TracChangeset for help on using the changeset viewer.