Closed
Bug 742431
Opened 12 years ago
Closed 4 years ago
Remove IsDisabled() in favor of EventStates
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
DUPLICATE
of bug 1405087
People
(Reporter: mounir, Assigned: mounir)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 2 obsolete files)
11.46 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Attachment #612249 -
Flags: review?(bzbarsky)
Comment 1•12 years ago
|
||
Comment on attachment 612249 [details] [diff] [review] Patch v1 Why not keep IsDisabled() to return State().HasState(NS_EVENT_STATE_DISABLED), but more readable?
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #612249 -
Attachment is obsolete: true
Attachment #612249 -
Flags: review?(bzbarsky)
Attachment #612481 -
Flags: review?(bzbarsky)
Comment 3•12 years ago
|
||
Comment on attachment 612481 [details] [diff] [review] Patch v2 >+ * We need a method to do this because of the recursive check. How about: This should only be called from intrinsic state computation. instead? r=me
Attachment #612481 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 4•12 years ago
|
||
Actually, this is failing some tests because checking State() in IntrinsicState() is wrong because mState isn't updated so it returns a wrong value. I should try to find an idea to fix that cleanly. Boris, feel free to step in if you have one...
Comment 5•12 years ago
|
||
Er... what's checking State() in IntrinsicState()?
Assignee | ||
Comment 6•12 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #5) > Er... what's checking State() in IntrinsicState()? Arg, I've been looking at ::AfterSetAttr() thinking it was ::IntrinsicState() yesterday... It's not that but something more subtle actually: when fieldset's disabled state is changed, all descendants have FieldSetDisabledChanged() called and form controls that can be invalid will update their validity state based on that change, *then*, UpdateState() is called. Which means NS_EVENT_STATE_DISABLED will have the same state when checking the validity state. The cleanest way I see to fix that would be to have UpdateState() called twice: once before checking the validity and once after. With a callback when states change (I have a patch doing that), we could actually update the validity state on state change. Would that be an okay solution?
Assignee | ||
Comment 7•12 years ago
|
||
I'm adding a call to UpdateState(aNotify) in *::FieldSetDisabledChanged(). This is fixing the bug but might make us notify twice for a state change Shouldn't be horrible though. If we implement a callback when a state changes, we could remove *::FieldSetDisabledChanged() and only update the validity when NS_EVENT_STATE_DISABLED is changed. However, that would make us call UpdateState() for the StateChanged() callback called from UpdateState().
Attachment #612481 -
Attachment is obsolete: true
Attachment #612879 -
Flags: review?(bzbarsky)
Comment 8•12 years ago
|
||
> + * We need a method to do this because of the recursive check. See comment 3.
Comment 9•12 years ago
|
||
Comment on attachment 612879 [details] [diff] [review] Patch v2.1 r=me
Attachment #612879 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 10•12 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #8) > > + * We need a method to do this because of the recursive check. > > See comment 3. Oups, I missed that. It's fixed locally. So, you confirm you are okay with the two UpdateState() call after each other?
Comment 11•12 years ago
|
||
Yes, that sounds reasonable to me.
Comment 12•4 years ago
|
||
This is done in:
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•