WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
87380
Form controls in <fieldset disabled> should not be focusable.
https://bugs.webkit.org/show_bug.cgi?id=87380
Summary
Form controls in <fieldset disabled> should not be focusable.
Kent Tamura
Reported
2012-05-24 05:47:50 PDT
1. Load the following document. <fieldset disabled> <input> </fieldset> 2. Click the text field. EXPECTED: Nothing happens. ACTUAL: The text field gets focus and the focus ring is drawn.
Attachments
Patch
(10.26 KB, patch)
2012-05-29 23:27 PDT
,
Kent Tamura
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Kent Tamura
Comment 1
2012-05-29 23:27:07 PDT
Created
attachment 144718
[details]
Patch
Darin Adler
Comment 2
2012-05-30 12:30:57 PDT
Comment on
attachment 144718
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=144718&action=review
> Source/WebCore/html/HTMLFormControlElement.cpp:322 > bool HTMLFormControlElement::supportsFocus() const > { > - return !m_disabled; > + return !disabled(); > }
This code change shows that our naming in this class is not good! It's terrible to be in a situation where m_disabled is one thing and disabled() another, and switching from one to the other fixes a bug. The names should reflect differences between the two. Our longer term direction should be to give good, clear names to this class's members. If the names from the DOM standard are causing us problems then we should think about solutions to that; maybe we could start putting prefixes on some names used in DOM bindings to make sure no one is tempted to use them inside WebKit itself. Does this code change have any other effects? Is being wrapped inside a disabled fieldset the only difference between disabled() and m_disabled. Are there tests showing these other effects are OK?
Kent Tamura
Comment 3
2012-05-30 18:45:54 PDT
(In reply to
comment #2
)
> This code change shows that our naming in this class is not good! It's terrible to be in a situation where m_disabled is one thing and disabled() another, and switching from one to the other fixes a bug. The names should reflect differences between the two. > > Our longer term direction should be to give good, clear names to this class's members. If the names from the DOM standard are causing us problems then we should think about solutions to that; maybe we could start putting prefixes on some names used in DOM bindings to make sure no one is tempted to use them inside WebKit itself.
I agree with renaming. * rename m_disabled to m_reflectedDisabled, m_bareDisabled, m_rawDisabled, m_disabledAttributeValue, or * rename disabled() to effectiveDisabled() or something? The specification says 'disabled' for our disabled().
> Does this code change have any other effects? Is being wrapped inside a disabled fieldset the only difference between disabled() and m_disabled. Are there tests showing these other effects are OK?
I think we have no more bugs about <fieldset disabled>. But the test coverage might be not good.
WebKit Review Bot
Comment 4
2012-05-30 19:24:38 PDT
Comment on
attachment 144718
[details]
Patch Clearing flags on attachment: 144718 Committed
r119023
: <
http://trac.webkit.org/changeset/119023
>
WebKit Review Bot
Comment 5
2012-05-30 19:24:43 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug