Discussion:
[whatwg] <meter> rendering for case min == max
Mikko Rantalainen
2018-03-19 11:13:07 UTC
Permalink
According to
https://html.spec.whatwg.org/multipage/form-elements.html#the-meter-element
following inequalities must hold for <meter>:

minimum ≤ value ≤ maximum
minimum ≤ low ≤ maximum (if low is specified)
minimum ≤ high ≤ maximum (if high is specified)
minimum ≤ optimum ≤ maximum (if optimum is specified)

This (and other prose) allows for following element

<meter min=0 value=0 max=0>Nothing to be done</meter>

https://jsfiddle.net/zx5xesg6/

However, rendering engines (at least Blink and Gecko) disagree on
rendering of such an element. Blink renders this as an empty meter and
Gecko renders this as an full meter.

I'm slightly balanced for rendering this as full meter (Gecko style)
because I would guess such meter is usually displaying some kind of
progress ("total number of items completed for this exam") and if
nothing is to be done, the meter should be full. Another choice would be
to make this even more similar to <progress> which already handles
similar situation similarly between different user agents.

The spec should specify one way or the other for this corner case.
--
Mikko
Anne van Kesteren
2018-03-19 11:49:57 UTC
Permalink
On Mon, Mar 19, 2018 at 11:13 AM, Mikko Rantalainen
Post by Mikko Rantalainen
The spec should specify one way or the other for this corner case.
Agreed, we're tracking this in
https://github.com/whatwg/html/issues/3520. If anyone would like to
help clarify the prose in the form of a pull request or wants to make
a strong case for Firefox's behavior, that'd be much appreciated.
--
https://annevankesteren.nl/
Loading...