Implement :in-range and :out-of-range for <input> when the element is suffering from a value overflow/underflow

RESOLVED FIXED in mozilla16

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
7 years ago
4 years ago

People

(Reporter: mounir, Assigned: mounir)

Tracking

({doc-bug-filed, html5})

Trunk
mozilla16
doc-bug-filed, html5
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

7 years ago
This should be quite straightforward with bug 635499 and bug 635553 fixed (and using there tests).
(Assignee)

Comment 1

7 years ago
Filed a bug against the specs to have :in-range and :out-of-range pseudo-classes application for HTML elements fit what CSS3-UI requires (which makes more sense too).
(Assignee)

Updated

7 years ago
(Assignee)

Comment 2

7 years ago
Created attachment 514088 [details] [diff] [review]
Patch v1
Assignee: nobody → mounir.lamouri
Status: NEW → ASSIGNED
Attachment #514088 - Flags: review?(jonas)
(Assignee)

Updated

7 years ago
Whiteboard: [needs review]
(Assignee)

Updated

7 years ago
Blocks: 598833
Comment on attachment 514088 [details] [diff] [review]
Patch v1

>+  // :in-range and :out-of-range only apply if min and max apply.
>+  if (DoesMinMaxApply()) {
>+    state |= (GetValidityState(VALIDITY_STATE_RANGE_OVERFLOW) ||
>+              GetValidityState(VALIDITY_STATE_RANGE_UNDERFLOW))
>+               ? NS_EVENT_STATE_OUTOFRANGE
>+               : NS_EVENT_STATE_INRANGE;
>+  }

As I stated in the HTML bug, I still think that these pseudo-classes should only apply if we're actually enforcing a range. I.e. if either min or max exists and have a valid value.
(Assignee)

Comment 4

6 years ago
Created attachment 525734 [details] [diff] [review]
Part 1 - Keep track of whether an input element has a range applying

This will be way more clean when state will be flags on the elements.
Attachment #514088 - Attachment is obsolete: true
Attachment #514088 - Flags: review?(jonas)
Attachment #525734 - Flags: review?(jonas)
(Assignee)

Comment 5

6 years ago
Created attachment 525735 [details] [diff] [review]
Part 2 - Implement :in-range and :out-of-range
Attachment #525735 - Flags: review?(jonas)
(Assignee)

Comment 6

6 years ago
Jonas, the patch should correspond to what you want.
Attachment #525734 - Flags: review?(jonas) → review+
Attachment #525735 - Flags: review?(jonas) → review+
(Assignee)

Comment 7

5 years ago
https://hg.mozilla.org/mozilla-central/rev/c49c1f667e7a
https://hg.mozilla.org/mozilla-central/rev/5c252caac591
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs review]
Target Milestone: --- → mozilla16
See bug 866457 for documentation.
Keywords: dev-doc-needed → doc-bug-filed
You need to log in before you can comment on or make changes to this bug.