Skip to content


Browse files Browse the repository at this point in the history
focusing of disabled fieldset element is not prevented
focusing of disabled fieldset element is not prevented

Reviewed by Ryosuke Niwa.

Merge -

It is to align with web-specification and both Gecko and Blink.

* Source/WebCore/html/HTMLFieldSetElement.cpp:
(HTMLFieldSetElement::supportsFocus()) - Modify to add !isDisabledFormControl logic to check before focusing.
* LayoutTests/fast/forms/fieldset/fieldset-disabled.html: Modified to accomodate "tabindex' case.
* LayoutTests/fast/forms/fieldset/fieldset-disabled-expected.txt: Updated Expectations for 'tabindex' case

Canonical link:
  • Loading branch information
Ahmad Saleem authored and rniwa committed Aug 31, 2022
1 parent 2a66dfb commit 8ddd66f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Expand Up @@ -88,6 +88,7 @@ PASS legendFieldSet.disabled is false
PASS insertedLegendTextInput.value is "JJJK"
PASS firstLegendTextInput.value is "IIK"
PASS secondLegendTextInput.value is "K"
PASS disabledFieldsetWithTabindex.focus(); document.activeElement is document.body
PASS successfullyParsed is true

Expand Down
6 changes: 6 additions & 0 deletions LayoutTests/fast/forms/fieldset/fieldset-disabled.html
Expand Up @@ -31,6 +31,8 @@
<input type="text" id="parserGeneratedInput9">
<fieldset tabindex=0 disabled id="fieldset-tabindex"></fieldset>

description('Tests for HTMLFieldSetElement.disabled behavior.');
Expand Down Expand Up @@ -291,6 +293,10 @@
shouldBe('firstLegendTextInput.value', '"IIK"');
shouldBe('secondLegendTextInput.value', '"K"');

var disabledFieldsetWithTabindex = document.getElementById('fieldset-tabindex');
shouldBe('disabledFieldsetWithTabindex.focus(); document.activeElement', 'document.body');

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLFieldSetElement.cpp
Expand Up @@ -150,7 +150,7 @@ bool HTMLFieldSetElement::matchesInvalidPseudoClass() const

bool HTMLFieldSetElement::supportsFocus() const
return HTMLElement::supportsFocus();
return HTMLElement::supportsFocus() && !isDisabledFormControl();

const AtomString& HTMLFieldSetElement::formControlType() const
Expand Down

0 comments on commit 8ddd66f

Please sign in to comment.