Closed
Bug 605125
Opened 14 years ago
Closed 14 years ago
Add :-moz-ui-valid pseudo-class
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla2.0b8
People
(Reporter: mounir, Assigned: mounir)
References
Details
(Keywords: dev-doc-complete, html5)
Attachments
(5 files, 2 obsolete files)
1.95 KB,
patch
|
bzbarsky
:
review+
jst
:
approval2.0+
|
Details | Diff | Splinter Review |
75.79 KB,
patch
|
bzbarsky
:
review+
jst
:
approval2.0+
|
Details | Diff | Splinter Review |
34.65 KB,
patch
|
bzbarsky
:
review+
jst
:
approval2.0+
|
Details | Diff | Splinter Review |
7.99 KB,
patch
|
bzbarsky
:
review+
jst
:
approval2.0+
|
Details | Diff | Splinter Review |
16.29 KB,
patch
|
bzbarsky
:
review+
jst
:
approval2.0+
|
Details | Diff | Splinter Review |
This is going to be very similar to bug 605124 but for :valid.
Assignee | ||
Comment 1•14 years ago
|
||
Assignee: nobody → mounir.lamouri
Status: NEW → ASSIGNED
Attachment #488907 -
Flags: review?(bzbarsky)
Comment 2•14 years ago
|
||
Comment on attachment 488907 [details] [diff] [review]
Part 1 - Add :-moz-ui-valid pseudo-class
r=me
Attachment #488907 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 3•14 years ago
|
||
Attachment #489210 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•14 years ago
|
Attachment #489210 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 4•14 years ago
|
||
I've an idea of what :-moz-ui-valid should be but I prefer to be sure limi and Jonas agree before asking reviews.
The idea is to make :-moz-ui-valid apply when:
1. the element is valid
2. the element has it's value changed or the form has been submitted
When typing, we should dynamically change the style if the element was invalid on focus. Otherwise, we should keep the current style.
IOW, there are 3 situations:
1. you focus a field which hasn't :-moz-ui-invalid nor :-moz-ui-valid applied, in that case, one of them will apply on blur if the value has been changed ;
2. you focus a field which has :-moz-ui-valid applied, in that case one of the two pseudo-class will apply to reflect the new state on blur ;
3. you focus a field which has :-moz-ui-invalid applied, in that case the style will dynamically change will typing.
Let me know if you think we can go with that.
Assignee | ||
Comment 5•14 years ago
|
||
Comment on attachment 489210 [details] [diff] [review]
Part 2 - Make :-moz-ui-valid follow rules for :valid
Boris, feel free to ignore the review if it should take you too much time given that I didn't got a real feedback. However, I think my proposal should make sense and I will write the patches.
Attachment #489210 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 6•14 years ago
|
||
Lot of tests but very small changes in the code.
Attachment #489494 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 7•14 years ago
|
||
Attachment #489503 -
Flags: review?(bzbarsky)
Attachment #489503 -
Flags: ui-review?(jonas)
Comment 8•14 years ago
|
||
Comment on attachment 489210 [details] [diff] [review]
Part 2 - Make :-moz-ui-valid follow rules for :valid
r=me
Attachment #489210 -
Flags: review?(bzbarsky) → review+
Comment 9•14 years ago
|
||
Comment on attachment 489494 [details] [diff] [review]
Part 3 - :-moz-ui-valid doesn't apply if the element hasn't been modified
r=me
Attachment #489494 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 10•14 years ago
|
||
Attachment #489542 -
Flags: review?(bzbarsky)
Comment 11•14 years ago
|
||
Comment on attachment 489503 [details] [diff] [review]
Part 4 - :-moz-ui-valid applies if the user tried to submit the form in an invalid state
r=me
Attachment #489503 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Updated•14 years ago
|
Attachment #488907 -
Flags: approval2.0?
Assignee | ||
Updated•14 years ago
|
Attachment #489210 -
Flags: approval2.0?
Assignee | ||
Updated•14 years ago
|
Attachment #489494 -
Flags: approval2.0?
Assignee | ||
Updated•14 years ago
|
Attachment #489503 -
Flags: approval2.0?
Assignee | ||
Updated•14 years ago
|
Attachment #489542 -
Flags: approval2.0?
Comment 12•14 years ago
|
||
Comment on attachment 489542 [details] [diff] [review]
Part 5 - :-moz-ui-valid should not apply while typing if the element had no style when it was focused
>+ // If nor invalid UI nor valid UI is shown, we shouldn't show the valid
>+ // UI while typing.
If neither ... nor ....
Maybe rename BF_DONT_SHOW_VALID_UI to BF_SUPPRESS_VALID_UI?
>+ // :-moz-ui-valid should never apply if when the element was focused,
Need comma before "when".
>+ // 1. the element is valid, and
This "and" doesn't match the || in the code. Which is correct?
>+ // 2. the element shouldn't show the invalid ui (and isn't valid).
I don't understand what this is trying to say.
It looks like whether we have NS_EVENT_STATE_MOZ_UI_VALID depends on the value of BF_CAN_SHOW_INVALID_UI. When the latter changes, do we do a ContentStatesChanged for the former?
The multipart comment is really hard to read, as is the code that follows it.... (esp. because the second 1&2 pair doesn't map to an actual || in the code, as far as I can see).
>+ * Return if an element should show the valid UI.
s/if/whether/
ShouldShowValidUI might be better named as CanShowValidUI, no?
Comment 4 sounds good to me.
Attachment #489503 -
Flags: ui-review?(jonas)
Assignee | ||
Comment 14•14 years ago
|
||
I tried to make things clearer by using the same name that I used for :-moz-ui-invalid and changed the comments.
Attachment #489542 -
Attachment is obsolete: true
Attachment #489817 -
Flags: review?(bzbarsky)
Attachment #489817 -
Flags: approval2.0?
Attachment #489542 -
Flags: review?(bzbarsky)
Attachment #489542 -
Flags: approval2.0?
Comment 15•14 years ago
|
||
The comment for mCanShowValidUI looks like it needs updating.
I still don't understand the long -moz-ui-valid comments. Please catch me on irc so we can talk about them?
Assignee | ||
Comment 16•14 years ago
|
||
With comments fixed.
Attachment #489817 -
Attachment is obsolete: true
Attachment #490602 -
Flags: review?(bzbarsky)
Attachment #490602 -
Flags: approval2.0?
Attachment #489817 -
Flags: review?(bzbarsky)
Attachment #489817 -
Flags: approval2.0?
Comment 17•14 years ago
|
||
Comment on attachment 490602 [details] [diff] [review]
Part 5 - :-moz-ui-valid should not apply while typing if the element had no style when it was focused
>+ // :-moz-ui-valid applies if:
Needs "all of the following are true".
r=me with that fixed
Attachment #490602 -
Flags: review?(bzbarsky) → review+
Comment 18•14 years ago
|
||
Hard for me to test all these cases, but generally seems to be doing the right thing. Was asked for informal feedback, so here it is. Let's get it in a beta and get some feedback on it. :)
Updated•14 years ago
|
Attachment #488907 -
Flags: approval2.0? → approval2.0+
Updated•14 years ago
|
Attachment #489210 -
Flags: approval2.0? → approval2.0+
Updated•14 years ago
|
Attachment #489494 -
Flags: approval2.0? → approval2.0+
Updated•14 years ago
|
Attachment #489503 -
Flags: approval2.0? → approval2.0+
Comment 19•14 years ago
|
||
Comment on attachment 490602 [details] [diff] [review]
Part 5 - :-moz-ui-valid should not apply while typing if the element had no style when it was focused
a=jst for this series of changes.
Attachment #490602 -
Flags: approval2.0? → approval2.0+
Assignee | ||
Comment 20•14 years ago
|
||
Pushed:
http://hg.mozilla.org/mozilla-central/rev/27db143745a7
http://hg.mozilla.org/mozilla-central/rev/a5443d86c431
http://hg.mozilla.org/mozilla-central/rev/b47d30240391
http://hg.mozilla.org/mozilla-central/rev/8761f71f04b5
http://hg.mozilla.org/mozilla-central/rev/c2d742db6304
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Comment 22•14 years ago
|
||
Documented at: https://developer.mozilla.org/en/CSS/:-moz-ui-valid
Keywords: dev-doc-needed → dev-doc-complete
Assignee | ||
Updated•14 years ago
|
Assignee: jswisher → mounir.lamouri
You need to log in
before you can comment on or make changes to this bug.
Description
•