Changing pseudoClass (:disabled) should cause distribution.
authorshinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Nov 2012 07:41:33 +0000 (07:41 +0000)
committershinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Nov 2012 07:41:33 +0000 (07:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=101901

Reviewed by Hajime Morita.

Source/WebCore:

We have to invalidate distribution when pseudo-class (:disabled) is changed.

According to the HTML5 spec, :disabled will match button, input, select, textarea, optgroup,
option, command, li, and fieldset. However, command is not implemented yet, we skip li and command. li might
have 'disabled' state, but we need a command element to make it 'disabled' state.

Tests: fast/dom/shadow/pseudoclass-update-disabled-button.html
       fast/dom/shadow/pseudoclass-update-disabled-fieldset.html
       fast/dom/shadow/pseudoclass-update-disabled-input.html
       fast/dom/shadow/pseudoclass-update-disabled-optgroup.html
       fast/dom/shadow/pseudoclass-update-disabled-option.html
       fast/dom/shadow/pseudoclass-update-disabled-select.html
       fast/dom/shadow/pseudoclass-update-disabled-textarea.html

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::disabledAttributeChanged):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::parseAttribute):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::parseAttribute):

LayoutTests:

* fast/dom/shadow/pseudoclass-update-disabled-button-expected.html: Added.
* fast/dom/shadow/pseudoclass-update-disabled-button.html: Added.
* fast/dom/shadow/pseudoclass-update-disabled-fieldset-expected.html: Added.
* fast/dom/shadow/pseudoclass-update-disabled-fieldset.html: Added.
* fast/dom/shadow/pseudoclass-update-disabled-input-expected.html: Added.
* fast/dom/shadow/pseudoclass-update-disabled-input.html: Added.
* fast/dom/shadow/pseudoclass-update-disabled-optgroup-expected.txt: Added.
* fast/dom/shadow/pseudoclass-update-disabled-optgroup.html: Added.
* fast/dom/shadow/pseudoclass-update-disabled-option-expected.txt: Added.
* fast/dom/shadow/pseudoclass-update-disabled-option.html: Added.
* fast/dom/shadow/pseudoclass-update-disabled-select-expected.html: Added.
* fast/dom/shadow/pseudoclass-update-disabled-select.html: Added.
* fast/dom/shadow/pseudoclass-update-disabled-textarea-expected.html: Added.
* fast/dom/shadow/pseudoclass-update-disabled-textarea.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134748 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-button-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-button.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-fieldset-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-fieldset.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-input-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-input.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-option-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-option.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-select-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-select.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-textarea-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-textarea.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLOptGroupElement.cpp
Source/WebCore/html/HTMLOptionElement.cpp

index fe36c26..3ec46f2 100644 (file)
@@ -1,3 +1,25 @@
+2012-11-14  Shinya Kawanaka  <shinyak@chromium.org> 
+
+        Changing pseudoClass (:disabled) should cause distribution.
+        https://bugs.webkit.org/show_bug.cgi?id=101901
+
+        Reviewed by Hajime Morita.
+
+        * fast/dom/shadow/pseudoclass-update-disabled-button-expected.html: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-button.html: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-fieldset-expected.html: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-fieldset.html: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-input-expected.html: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-input.html: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-optgroup-expected.txt: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-optgroup.html: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-option-expected.txt: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-option.html: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-select-expected.html: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-select.html: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-textarea-expected.html: Added.
+        * fast/dom/shadow/pseudoclass-update-disabled-textarea.html: Added.
+
 2012-11-14  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r134691, r134703, r134715, r134716,
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-button-expected.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-button-expected.html
new file mode 100644 (file)
index 0000000..2038a26
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+
+<body>
+
+<p>When the 'disabled' state of a button tag is changed, we have to invalidate distribution.</p>
+
+<div id="host1"><button disabled>Button 2</button></div>
+
+<div id="host2"><button disabled>Button 3</button></div>
+
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-button.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-button.html
new file mode 100644 (file)
index 0000000..6864caa
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/polyfill.js"></script>
+</head>
+
+<body>
+
+<p>When the 'disabled' state of a button tag is changed, we have to invalidate distribution.</p>
+
+<div id="host1">
+    <button id="button1">Button 1</button>
+    <button id="button2">Button 2</button>
+</div>
+
+<div id="host2">
+    <button id="button3" disabled>Button 3</button>
+    <button id="button4" disabled>Button 4</button>
+</div>
+
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+new WebKitShadowRoot(host1).innerHTML = '<content select=":disabled"></content>';
+new WebKitShadowRoot(host2).innerHTML = '<content select=":disabled"></content>';
+
+setTimeout(function() {
+    button2.setAttribute('disabled', true);
+    button4.removeAttribute('disabled');
+    testRunner.notifyDone();
+}, 0);
+
+</script>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-fieldset-expected.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-fieldset-expected.html
new file mode 100644 (file)
index 0000000..89539e4
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+
+<body>
+
+<p>When the 'disabled' state of a fieldset tag is changed, we have to invalidate distribution.</p>
+
+<div id="host1"><fieldset id="fieldset2" disabled>Fieldset 2</fieldset></div>
+
+<div id="host2"><fieldset id="fieldset3" disabled>Fieldset 3</fieldset></div>
+
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-fieldset.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-fieldset.html
new file mode 100644 (file)
index 0000000..5857151
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/polyfill.js"></script>
+</head>
+
+<body>
+
+<p>When the 'disabled' state of a fieldset tag is changed, we have to invalidate distribution.</p>
+
+<div id="host1">
+    <fieldset id="fieldset1">Fieldset 1</fieldset>
+    <fieldset id="fieldset2">Fieldset 2</fieldset>
+</div>
+
+<div id="host2">
+    <fieldset id="fieldset3" disabled>Fieldset 3</fieldset>
+    <fieldset id="fieldset4" disabled>Fieldset 4</fieldset>
+</div>
+
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+new WebKitShadowRoot(host1).innerHTML = '<content select=":disabled"></content>';
+new WebKitShadowRoot(host2).innerHTML = '<content select=":disabled"></content>';
+
+setTimeout(function() {
+    fieldset2.setAttribute('disabled', true);
+    fieldset4.removeAttribute('disabled');
+    testRunner.notifyDone();
+}, 0);
+
+</script>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-input-expected.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-input-expected.html
new file mode 100644 (file)
index 0000000..93e1d4f
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+
+<body>
+
+<p>When the 'disabled' state of an input tag is changed, we have to invalidate distribution.</p>
+
+<div id="host1"><input id="input2" value="Input 2" disabled></div>
+
+<div id="host2"><input id="input3" value="Input 3" disabled></div>
+
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-input.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-input.html
new file mode 100644 (file)
index 0000000..32f21ce
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/polyfill.js"></script>
+</head>
+
+<body>
+
+<p>When the 'disabled' state of an input tag is changed, we have to invalidate distribution.</p>
+
+<div id="host1">
+    <input id="input1" value="Input 1">
+    <input id="input2" value="Input 2">
+</div>
+
+<div id="host2">
+    <input id="input3" value="Input 3" disabled>
+    <input id="input4" value="Input 4" disabled>
+</div>
+
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+new WebKitShadowRoot(host1).innerHTML = '<content select=":disabled"></content>';
+new WebKitShadowRoot(host2).innerHTML = '<content select=":disabled"></content>';
+
+setTimeout(function() {
+    input2.setAttribute('disabled', true);
+    input4.removeAttribute('disabled');
+    testRunner.notifyDone();
+}, 0);
+
+</script>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup-expected.txt b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup-expected.txt
new file mode 100644 (file)
index 0000000..c4b4e32
--- /dev/null
@@ -0,0 +1,12 @@
+When an optgroup element became 'disabled' or not-'disabled', distribution should happen.
+
+Since an optgroup element does not create a renderer, we cannot check this using reftest.
+
+PASS nodes1.length is 1
+PASS nodes1.item(0).innerHTML is "optgroup 2"
+PASS nodes2.length is 1
+PASS nodes2.item(0).innerHTML is "optgroup 3"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-optgroup.html
new file mode 100644 (file)
index 0000000..d886033
--- /dev/null
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/polyfill.js"></script>
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+
+<body>
+
+<p>When an optgroup element became 'disabled' or not-'disabled', distribution should happen.</p>
+<p>Since an optgroup element does not create a renderer, we cannot check this using reftest.</p>
+
+<div id="container">
+    <div id="host1">
+        <optgroup id="optgroup1">optgroup 1</optgroup>
+        <optgroup id="optgroup2">optgroup 2</optgroup>
+    </div>
+
+    <div id="host2">
+        <optgroup id="optgroup3" disabled>optgroup 3</optgroup>
+        <optgroup id="optgroup4" disabled>optgroup 4</optgroup>
+    </div>
+</div>
+
+<pre id="console"></pre>
+
+<script>
+jsTestIsAsync = true;
+
+var shadowRoot1 = new WebKitShadowRoot(host1);
+var shadowRoot2 = new WebKitShadowRoot(host2);
+
+shadowRoot1.innerHTML = '<content select=":disabled">';
+shadowRoot2.innerHTML = '<content select=":disabled">';
+
+var content1 = shadowRoot1.querySelector('content');
+var content2 = shadowRoot2.querySelector('content');
+
+setTimeout(function() {
+    optgroup2.setAttribute('disabled', true);
+    optgroup4.removeAttribute('disabled');
+
+    nodes1 = content1.getDistributedNodes();
+    shouldBe('nodes1.length', '1');
+    shouldBe('nodes1.item(0).innerHTML', '"optgroup 2"');
+
+    nodes2 = content2.getDistributedNodes();
+    shouldBe('nodes2.length', '1');
+    shouldBe('nodes2.item(0).innerHTML', '"optgroup 3"');
+
+    container.innerHTML = "";
+    finishJSTest();
+}, 0);
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-option-expected.txt b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-option-expected.txt
new file mode 100644 (file)
index 0000000..af8817e
--- /dev/null
@@ -0,0 +1,12 @@
+When an option element became 'disabled' or not-'disabled', distribution should happen.
+
+Since an option element does not create a renderer, we cannot check this using reftest.
+
+PASS nodes1.length is 1
+PASS nodes1.item(0).innerHTML is "option 2"
+PASS nodes2.length is 1
+PASS nodes2.item(0).innerHTML is "option 3"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-option.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-option.html
new file mode 100644 (file)
index 0000000..450227f
--- /dev/null
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/polyfill.js"></script>
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+
+<body>
+
+<p>When an option element became 'disabled' or not-'disabled', distribution should happen.</p>
+<p>Since an option element does not create a renderer, we cannot check this using reftest.</p>
+
+<div id="container">
+    <div id="host1">
+        <option id="option1">option 1</option>
+        <option id="option2">option 2</option>
+    </div>
+
+    <div id="host2">
+        <option id="option3" disabled>option 3</option>
+        <option id="option4" disabled>option 4</option>
+    </div>
+</div>
+
+<pre id="console"></pre>
+
+<script>
+jsTestIsAsync = true;
+
+var shadowRoot1 = new WebKitShadowRoot(host1);
+var shadowRoot2 = new WebKitShadowRoot(host2);
+
+shadowRoot1.innerHTML = '<content select=":disabled">';
+shadowRoot2.innerHTML = '<content select=":disabled">';
+
+var content1 = shadowRoot1.querySelector('content');
+var content2 = shadowRoot2.querySelector('content');
+
+setTimeout(function() {
+    option2.setAttribute('disabled', true);
+    option4.removeAttribute('disabled');
+
+    nodes1 = content1.getDistributedNodes();
+    shouldBe('nodes1.length', '1');
+    shouldBe('nodes1.item(0).innerHTML', '"option 2"');
+
+    nodes2 = content2.getDistributedNodes();
+    shouldBe('nodes2.length', '1');
+    shouldBe('nodes2.item(0).innerHTML', '"option 3"');
+
+    container.innerHTML = "";
+    finishJSTest();
+}, 0);
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-select-expected.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-select-expected.html
new file mode 100644 (file)
index 0000000..f3a8914
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+
+<body>
+
+<p>When the 'disabled' state of a select tag is changed, we have to invalidate distribution.</p>
+
+<div id="host1"><select disabled><option>Select 2</option></select></div>
+
+<div id="host2"><select disabled><option>Select 3</option></select></div>
+
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-select.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-select.html
new file mode 100644 (file)
index 0000000..da03c14
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/polyfill.js"></script>
+</head>
+
+<body>
+
+<p>When the 'disabled' state of a select tag is changed, we have to invalidate distribution.</p>
+
+<div id="host1">
+    <select id="select1"><option>Select 1</option></select>
+    <select id="select2"><option>Select 2</option></select>
+</div>
+
+<div id="host2">
+    <select id="select3" disabled><option>Select 3</option></select>
+    <select id="select4" disabled><option>Select 4</option></select>
+</div>
+
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+new WebKitShadowRoot(host1).innerHTML = '<content select=":disabled"></content>';
+new WebKitShadowRoot(host2).innerHTML = '<content select=":disabled"></content>';
+
+setTimeout(function() {
+    select2.setAttribute('disabled', true);
+    select4.removeAttribute('disabled');
+    testRunner.notifyDone();
+}, 0);
+
+</script>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-textarea-expected.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-textarea-expected.html
new file mode 100644 (file)
index 0000000..3c3739a
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+
+<body>
+
+<p>When the 'disabled' state of a textarea tag is changed, we have to invalidate distribution.</p>
+
+<div id="host1"><textarea disabled>Textarea 2</textarea></div>
+
+<div id="host2"><textarea disabled>Textarea 3</textarea></div>
+
+</body>
+</html>
+
diff --git a/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-textarea.html b/LayoutTests/fast/dom/shadow/pseudoclass-update-disabled-textarea.html
new file mode 100644 (file)
index 0000000..d75f4cc
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/polyfill.js"></script>
+</head>
+
+<body>
+
+<p>When the 'disabled' state of a textarea tag is changed, we have to invalidate distribution.</p>
+
+<div id="host1">
+    <textarea id="textarea1">Textarea 1</textarea>
+    <textarea id="textarea2">Textarea 2</textarea>
+</div>
+
+<div id="host2">
+    <textarea id="textarea3" disabled>Textarea 3</textarea>
+    <textarea id="textarea4" disabled>Textarea 4</textarea>
+</div>
+
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+new WebKitShadowRoot(host1).innerHTML = '<content select=":disabled"></content>';
+new WebKitShadowRoot(host2).innerHTML = '<content select=":disabled"></content>';
+
+setTimeout(function() {
+    textarea2.setAttribute('disabled', true);
+    textarea4.removeAttribute('disabled');
+    testRunner.notifyDone();
+}, 0);
+
+</script>
+</body>
+</html>
+
index 073bc0e..2a67c08 100644 (file)
@@ -1,3 +1,31 @@
+2012-11-14  Shinya Kawanaka  <shinyak@chromium.org> 
+
+        Changing pseudoClass (:disabled) should cause distribution.
+        https://bugs.webkit.org/show_bug.cgi?id=101901
+
+        Reviewed by Hajime Morita.
+
+        We have to invalidate distribution when pseudo-class (:disabled) is changed.
+
+        According to the HTML5 spec, :disabled will match button, input, select, textarea, optgroup,
+        option, command, li, and fieldset. However, command is not implemented yet, we skip li and command. li might
+        have 'disabled' state, but we need a command element to make it 'disabled' state.
+
+        Tests: fast/dom/shadow/pseudoclass-update-disabled-button.html
+               fast/dom/shadow/pseudoclass-update-disabled-fieldset.html
+               fast/dom/shadow/pseudoclass-update-disabled-input.html
+               fast/dom/shadow/pseudoclass-update-disabled-optgroup.html
+               fast/dom/shadow/pseudoclass-update-disabled-option.html
+               fast/dom/shadow/pseudoclass-update-disabled-select.html
+               fast/dom/shadow/pseudoclass-update-disabled-textarea.html
+
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::disabledAttributeChanged):
+        * html/HTMLOptGroupElement.cpp:
+        (WebCore::HTMLOptGroupElement::parseAttribute):
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::parseAttribute):
+
 2012-11-14  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r134691, r134703, r134715, r134716,
index cf16f43..7b4ae3e 100644 (file)
@@ -151,6 +151,7 @@ void HTMLFormControlElement::disabledAttributeChanged()
 {
     setNeedsWillValidateCheck();
     setNeedsStyleRecalc();
+    invalidateParentDistributionIfNecessary(this, SelectRuleFeatureSet::RuleFeatureDisabled);
     if (renderer() && renderer()->style()->hasAppearance())
         renderer()->theme()->stateChanged(renderer(), EnabledState);
 }
index c5e526f..03c9e14 100644 (file)
@@ -82,6 +82,9 @@ void HTMLOptGroupElement::parseAttribute(const Attribute& attribute)
 {
     HTMLElement::parseAttribute(attribute);
     recalcSelectOptions();
+
+    if (attribute.name() == disabledAttr)
+        invalidateParentDistributionIfNecessary(this, SelectRuleFeatureSet::RuleFeatureDisabled);
 }
 
 void HTMLOptGroupElement::recalcSelectOptions()
index d169173..38edc3e 100644 (file)
@@ -203,6 +203,7 @@ void HTMLOptionElement::parseAttribute(const Attribute& attribute)
         m_disabled = !attribute.isNull();
         if (oldDisabled != m_disabled) {
             setNeedsStyleRecalc();
+            invalidateParentDistributionIfNecessary(this, SelectRuleFeatureSet::RuleFeatureDisabled);
             if (renderer() && renderer()->style()->hasAppearance())
                 renderer()->theme()->stateChanged(renderer(), EnabledState);
         }