Closed Bug 1915096 Opened 1 year ago Closed 1 year ago

CSS zoom property doesn't change font size when font-size is specified by keywords

Categories

(Core :: CSS Parsing and Computation, defect, P3)

Firefox 127
defect

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox138 --- fixed

People

(Reporter: 6k64x4ma, Assigned: swarup.ukil, Mentored)

References

Details

(Keywords: good-first-bug)

Attachments

(5 files)

Attached file test.html

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.

Attached image Edge vs Firefox
Blocks: csszoom

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.

The severity field is not set for this bug.
:jfkthame, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jfkthame)

This is because this line isn't applying the effective zoom, and it probably should.

Mentor: emilio
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jfkthame)
Keywords: good-first-bug
Priority: -- → P3
Attached file testcase

FYI font-size: initial and deprecated font elements also have this issue.

Hi, could I work on this bug?

Flags: needinfo?(emilio)

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 :)

Flags: needinfo?(emilio)
Attached file scratch.html

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?

Yes, either here or ping me on the introduction or css matrix rooms :)

Assignee: nobody → swarup.ukil
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9c7c326be95a Ensure CSS Zoom (effective_zoom) is applied correctly when font-size is specified by keywords. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/51462 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
Upstream PR merged by moz-wptsync-bot

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?

Flags: needinfo?(emilio)

Separate bug please. Though initial is a tricky one, much like inherit, see bug 1887627.

Flags: needinfo?(emilio)
See Also: → 1955571

Okay, I filed bug 1955571.

(In comment 16, I meant font-size, not font-family.)

Duplicate of this bug: 1960211
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: