CSS zoom property doesn't change font size when font-size is specified by keywords
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox138 | --- | fixed |
People
(Reporter: 6k64x4ma, Assigned: swarup.ukil, Mentored)
References
Details
(Keywords: good-first-bug)
Attachments
(5 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0
Steps to reproduce:
Load the attached file.
Actual results:
The first line is not zoomed on Firefox.
Both lines are the same size on Microsoft Edge.
Expected results:
Firefox should match Edge.
Comment 2•1 year ago
|
||
What's also interesting in this test case is that getComputedStyle($0).fontSize on the first element returns "8px" in Firefox & "16px" in Chrome. The second one returns "16px" in both browsers. If you remove the zoom: 2 declaration, suddenly even Firefox reports "16px" everywhere.
It looks as if Firefox didn't apply zoom properly here but then in another piece of the code it assumed zoom has been applied & it tried to compensate by dividing the resolved value by zoom.
Comment 3•1 year ago
|
||
The severity field is not set for this bug.
:jfkthame, could you have a look please?
For more information, please visit BugBot documentation.
Comment 4•1 year ago
|
||
This is because this line isn't applying the effective zoom, and it probably should.
FYI font-size: initial and deprecated font elements also have this issue.
Comment 7•1 year ago
|
||
Sure, no need to ask for permission, just follow the docs in here. Once you submit the patch the bug gets auto-assigned to you :)
Comment 8•1 year ago
|
||
I've also came across this incompatibility, and I've worked out that the font set by font-family can also disable the zoom property. I'm attaching my test case, try opening the devtools and disabling zoom on the centre-content div.
Hi, I'm an aspiring new contributor here, since this says its unassigned I wanted to state my intention to look into this matter. I take it I could just add another comment here if any help is needed?
Comment 10•1 year ago
|
||
Yes, either here or ping me on the introduction or css matrix rooms :)
| Assignee | ||
Comment 11•1 year ago
|
||
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Comment 14•1 year ago
|
||
| bugherder | ||
| Reporter | ||
Comment 16•1 year ago
|
||
Thanks to Swarup's patch, the problem is mostly fixed.
What remains is the font-family: initial case mentioned in comment 5.
Should I file another bug or reopen this?
Comment 17•1 year ago
|
||
Separate bug please. Though initial is a tricky one, much like inherit, see bug 1887627.
| Reporter | ||
Comment 18•1 year ago
|
||
Okay, I filed bug 1955571.
(In comment 16, I meant font-size, not font-family.)
Description
•