stylo: Serialization of font for canvas is different from gecko

RESOLVED FIXED in Firefox 55

Status

()

Core
CSS Parsing and Computation
P2
normal
RESOLVED FIXED
21 days ago
6 days ago

People

(Reporter: hiro, Assigned: hiro)

Tracking

(Depends on: 1 bug, Blocks: 1 bug)

Trunk
mozilla55
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox55 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

21 days ago
Gecko returns "10px sans-serif", whereas stylo returns "normal normal normal normal 10px sans-serif".

Below test cases fail because of this bug:

 dom/canvas/test/test_canvas_font_setter.html
 dom/canvas/test/test_canvas.html
(Assignee)

Comment 1

21 days ago
This is caused by the difference of serialization of font shorthand property.
Depends on: 1345218
Assignee: nobody → hikezoe
Priority: -- → P2
(Assignee)

Comment 2

10 days ago
From the canvas spec [1]

 For example, after the following statement:

 context.font = 'italic 400 12px/2 Unknown Font, sans-serif';

 ...the expression context.font would evaluate to the string "italic 12px "Unknown Font", sans-serif". The "400" font-weight doesn't appear because that is the default value. The line-height doesn't appear because it is forced to "normal", the default value.

As per this spec, we need another serialization function to drop default values for canvas.

[1] https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-font
(Assignee)

Comment 3

9 days ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=9f7068a2abae1e6596f46c660f02f55ac8915568
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 6

9 days ago
mozreview-review
Comment on attachment 8869353 [details]
Bug 1362914 - Factor out PropertyDeclaration only iterator.

https://reviewboard.mozilla.org/r/140996/#review144664
Attachment #8869353 - Flags: review?(manishearth) → review+

Comment 7

9 days ago
mozreview-review
Comment on attachment 8869354 [details]
Bug 1362914 - Drop initial values of properties other than font-size and font-family in serialization of canvas font attribute.

https://reviewboard.mozilla.org/r/140998/#review144668
Attachment #8869354 - Flags: review?(manishearth) → review+
(Assignee)

Comment 8

9 days ago
Thank you!

https://github.com/servo/servo/pull/16959
Comment hidden (mozreview-request)
(Assignee)

Updated

9 days ago
Attachment #8869353 - Attachment is obsolete: true

Comment 10

6 days ago
Pushed by hikezoe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0db843910232
Drop initial values of properties other than font-size and font-family in serialization of canvas font attribute. r=manishearth

Comment 11

6 days ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/0db843910232
Status: NEW → RESOLVED
Last Resolved: 6 days ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.