зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1362914 - Drop initial values of properties other than font-size and font-family in serialization of canvas font attribute. r=manishearth
According to the canvas spec [1], we must drop initial values other than font-size and font-family when we serialize canvas font attribute. As for font-size and font-family, the default values, '10px sans-serif' [2] are not dropped at all. [1] https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-font [2] https://html.spec.whatwg.org/multipage/scripting.html#canvastextdrawingstyles MozReview-Commit-ID: EyOxzJCQYQl --HG-- extra : rebase_source : d358a8e97fa7849a320a3619e746a526fe2a8439
This commit is contained in:
Родитель
34fd4e6344
Коммит
5c43533704
|
@ -2901,9 +2901,7 @@ GetFontStyleForServo(Element* aElement, const nsAString& aFont,
|
|||
// parsed (including having line-height removed). (Older drafts of
|
||||
// the spec required font sizes be converted to pixels, but that no
|
||||
// longer seems to be required.)
|
||||
Servo_DeclarationBlock_SerializeOneValue(declarations,
|
||||
eCSSProperty_font,
|
||||
&aOutUsedFont);
|
||||
Servo_SerializeFontValueForCanvas(declarations, &aOutUsedFont);
|
||||
|
||||
return sc.forget();
|
||||
}
|
||||
|
|
|
@ -473,6 +473,11 @@ SERVO_BINDING_FUNC(Servo_StyleSet_GetBaseComputedValuesForElement,
|
|||
const mozilla::ServoElementSnapshotTable* snapshots,
|
||||
mozilla::CSSPseudoElementType pseudo_type)
|
||||
|
||||
// For canvas font.
|
||||
SERVO_BINDING_FUNC(Servo_SerializeFontValueForCanvas, void,
|
||||
RawServoDeclarationBlockBorrowed declarations,
|
||||
nsAString* buffer)
|
||||
|
||||
// Style-struct management.
|
||||
#define STYLE_STRUCT(name, checkdata_cb) \
|
||||
struct nsStyle##name; \
|
||||
|
|
Загрузка…
Ссылка в новой задаче