Closed Bug 1362914 Opened 7 years ago Closed 7 years ago

stylo: Serialization of font for canvas is different from gecko

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

Attachments

(1 file, 1 obsolete file)

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
This is caused by the difference of serialization of font shorthand property.
Depends on: 1345218
Assignee: nobody → hikezoe
Priority: -- → P2
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
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 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+
Attachment #8869353 - Attachment is obsolete: true
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
https://hg.mozilla.org/mozilla-central/rev/0db843910232
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: