Side navigation
#14792 closed bug (fixed)
Opened February 13, 2014 07:38PM UTC
Closed March 05, 2014 02:50AM UTC
Last modified March 05, 2014 02:52AM UTC
Inconsistent .css('font-weight') return values
Reported by: | whatthejeff | Owned by: | dmethvin |
---|---|---|---|
Priority: | low | Milestone: | 1.11.1/2.1.1 |
Component: | css | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The origin of this issue is: https://github.com/jquery/jquery/commit/b9b87d53c681a8337cdbdbe81f8f4e577e5ec277
In WebKit/Blink browsers, window.getComputedStyle
returns the following for font-weight
:
- "100"
- "200"
- "300"
- "normal"
- "500"
- "600"
- "bold"
- "800"
- "900"
In WebKit/Blink browsers, .css()
returns the following for font-weight
:
- "100"
- "200"
- "300"
- 400
- "500"
- "600"
- "bold"
- "800"
- "900"
It's inconsistent that the return type for normal/400 is a Number
when the return type for all other values is a String
.
It's also a little confusing that "normal" is converted to a numeric value, but "bold" is not.
In other browsers, both window.getComputedStyle
and .css()
return numeric strings for all values. This seems like the most desirable behavior.
Attachments (0)
Change History (5)
Changed February 24, 2014 03:13PM UTC by comment:1
component: | unfiled → css |
---|---|
priority: | undecided → low |
Changed March 03, 2014 04:36PM UTC by comment:2
milestone: | None → 1.11.1/2.1.1 |
---|---|
status: | new → open |
Let's fix "400" but not "bold".
Changed March 04, 2014 01:54AM UTC by comment:3
owner: | → dmethvin |
---|---|
status: | open → assigned |
Changed March 05, 2014 02:50AM UTC by comment:4
resolution: | → fixed |
---|---|
status: | assigned → closed |
CSS: Return values should be numbers
Fixes #14792
Changeset: f4b37d89820535d6c7503925aa8872645681a865
Changed March 05, 2014 02:52AM UTC by comment:5
Thanks :)
Seems that once again we're halfway in to fixing a messy rare edge case, one that probably matters for 1% of all users since it's survived this long. The spec does say that "bold" ==> 700 though so we could attempt to fix this.
http://www.w3.org/TR/css-fonts-3/#font-weight-prop