WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
112085
Refactoring: Pull Node::disabled() and Node::isInert() down to Element.
https://bugs.webkit.org/show_bug.cgi?id=112085
Summary
Refactoring: Pull Node::disabled() and Node::isInert() down to Element.
Hajime Morrita
Reported
2013-03-11 18:00:21 PDT
Suggested at
https://bugs.webkit.org/show_bug.cgi?id=110952#c16
.
Attachments
Patch
(8.47 KB, patch)
2013-03-12 02:22 PDT
,
Matt Falkenhagen
no flags
Details
Formatted Diff
Diff
actually remove isInert
(8.76 KB, patch)
2013-03-12 02:57 PDT
,
Matt Falkenhagen
no flags
Details
Formatted Diff
Diff
Patch
(9.48 KB, patch)
2013-03-22 14:15 PDT
,
Matt Falkenhagen
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Matt Falkenhagen
Comment 1
2013-03-12 02:22:41 PDT
Created
attachment 192677
[details]
Patch
Hajime Morrita
Comment 2
2013-03-12 02:46:08 PDT
Comment on
attachment 192677
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=192677&action=review
> Source/WebCore/dom/Node.h:668 >
Don't you need to remove isInert() declaration?
Matt Falkenhagen
Comment 3
2013-03-12 02:57:43 PDT
Created
attachment 192689
[details]
actually remove isInert
WebKit Review Bot
Comment 4
2013-03-12 04:15:15 PDT
Comment on
attachment 192689
[details]
actually remove isInert Clearing flags on attachment: 192689 Committed
r145514
: <
http://trac.webkit.org/changeset/145514
>
WebKit Review Bot
Comment 5
2013-03-12 04:15:18 PDT
All reviewed patches have been landed. Closing bug.
WebKit Review Bot
Comment 6
2013-03-12 04:37:42 PDT
Re-opened since this is blocked by
bug 112134
Build Bot
Comment 7
2013-03-12 11:40:48 PDT
Comment on
attachment 192689
[details]
actually remove isInert
Attachment 192689
[details]
did not pass mac-ews (mac): Output:
http://webkit-commit-queue.appspot.com/results/17115356
Build Bot
Comment 8
2013-03-12 12:41:34 PDT
Comment on
attachment 192689
[details]
actually remove isInert
Attachment 192689
[details]
did not pass mac-ews (mac): Output:
http://webkit-commit-queue.appspot.com/results/17183114
Build Bot
Comment 9
2013-03-12 12:41:56 PDT
Comment on
attachment 192689
[details]
actually remove isInert
Attachment 192689
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-commit-queue.appspot.com/results/17074335
Darin Adler
Comment 10
2013-03-12 19:20:59 PDT
I still don’t think that “disabled” makes sense for all elements; it’s really a form control element concept, but maybe you could convince me.
Matt Falkenhagen
Comment 11
2013-03-12 22:20:06 PDT
(In reply to
comment #10
)
> I still don’t think that “disabled” makes sense for all elements; it’s really a form control element concept, but maybe you could convince me.
Ah I thought it might be used for more than form control elements, but I think you're right. If so, the work I intended for future patches to separate disabled from inertness may be simpler than I imagined. I'll give it a try in one patch.
Matt Falkenhagen
Comment 12
2013-03-21 16:17:21 PDT
One issue with moving disabled to HTMLFormControlElement is that HTMLOptGroupElement, HTMLOptionElement, SliderThumbElement, and SpinButtonElement override Node::disabled() and are not HTMLFormControlElements. I think Element::isEnabledFormControl and Node::disabled can be refactored to be the same function. isEnabledFormControl simply returns !disabled() except for SliderThumbElement and SpinButtonElement, where isEnabledFormControl() of the host is returned. I thought the two functions might be used to distinguish between readonly and disabled. But it looks redundant. For <input type="number" disabled>: SpinButtonElement: disabled is false, isEnabledFormControl is false SpinButtonElement's shadow host: disabled is true, isEnabledFormControl is false For <input type="number" readonly>: SpinButtonElement: disabled is false, isEnabledFormControl is true SpinButtonElement's shadow host: disabled is false, isEnabledFormControl is true The readonly case is just the same as the default, enabled case. Unless I've missed a case, there are just two states. So probably we can just use one function, provided that the shadow host of a SpinButtonElement is never a SliderThumbElement or SpinButtonElement, and that there no reason we can't have disabled be true (maybe for event handling?). SliderThumbElement is the same. I'm not sure the name isEnabledFormControl() is best. It returns true for elements that are not form controls. I think I'll refactor them into a function Element::isDisabledFormControl().
Matt Falkenhagen
Comment 13
2013-03-22 12:12:56 PDT
Here is my plan: 1. Move Node::disabled and Node::isInert to Element. 2. Remove Element::isEnabledFormControl, by calling Element::disabled instead (this is possible after
bug 112993
). 3. Rename Element::disabled to Element::isDisabledFormControl. Does that sound OK? I'll do (1) in one patch and (2) and (3) in another patch.
Matt Falkenhagen
Comment 14
2013-03-22 14:15:13 PDT
Created
attachment 194629
[details]
Patch
Hajime Morrita
Comment 15
2013-03-24 18:43:28 PDT
Comment on
attachment 194629
[details]
Patch Feels like we could have isDisabledElement(Node*) in Element.h. Having isElementNode() check makes the code a bit noisy.
Matt Falkenhagen
Comment 16
2013-03-24 19:58:14 PDT
(In reply to
comment #15
)
> (From update of
attachment 194629
[details]
) > Feels like we could have isDisabledElement(Node*) in Element.h. Having isElementNode() check makes the code a bit noisy.
Thanks. Hm, the problem is that I plan to rename Element::disabled() to Element::isDisabledFormControl() in the next patch, so isDisabledElement(Node*) might be a confusing name. Or maybe it's ok. I'll try it in or after the next patch.
Hajime Morrita
Comment 17
2013-03-24 20:16:33 PDT
(In reply to
comment #16
)
> Thanks. Hm, the problem is that I plan to rename Element::disabled() to Element::isDisabledFormControl() in the next patch, so isDisabledElement(Node*) might be a confusing name. Or maybe it's ok. I'll try it in or after the next patch.
Okay, isDisabledFormControl(Node*) will be sufficient. And making that change is another patch sounds fine to me.
WebKit Review Bot
Comment 18
2013-03-24 22:01:07 PDT
Comment on
attachment 194629
[details]
Patch Clearing flags on attachment: 194629 Committed
r146744
: <
http://trac.webkit.org/changeset/146744
>
WebKit Review Bot
Comment 19
2013-03-24 22:01:12 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