Closed
Bug 1057680
Opened 9 years ago
Closed 8 years ago
Add support for specifying 'font-stretch' in the CSS 'font' shorthand
Categories
(Core :: CSS Parsing and Computation, enhancement)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: syoichi, Assigned: jfkthame)
References
(Blocks 1 open bug, )
Details
(4 keywords, Whiteboard: [parity-blink])
Attachments
(5 files, 1 obsolete file)
1.43 KB,
text/html
|
Details | |
pt 1 - Add a font-stretch keyword to the valid values for the font shorthand in property_database.js
1.87 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
6.41 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
3.83 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
5.02 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
CSS 2.1: [ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar http://www.w3.org/TR/CSS21/fonts.html#font-shorthand CSS 3: [ [ <‘font-style’> || <font-variant-css21> || <‘font-weight’> || <‘font-stretch’ ]? <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ] | caption | icon | menu | message-box | small-caption | status-bar http://dev.w3.org/csswg/css-fonts-3/#font-prop Now Gecko lacks "<font-weight>" support. But, it seems that Blink supports new syntax parsing(I don't know about rendering). If this feature is implemented, this MDN page should be updated. https://developer.mozilla.org/en-US/docs/Web/CSS/font
Reporter | ||
Updated•9 years ago
|
Comment 1•9 years ago
|
||
(In reply to Syoichi Tsuyuhara from comment #0) > Now Gecko lacks "<font-weight>" support. Do you mean <font-stretch>?
Reporter | ||
Comment 2•9 years ago
|
||
(In reply to David Baron [:dbaron] (UTC-7) (needinfo? for questions) (away/busy Aug 27-Sep 11) from comment #1) > (In reply to Syoichi Tsuyuhara from comment #0) > > Now Gecko lacks "<font-weight>" support. > > Do you mean <font-stretch>? Ah, yes. It's correct. I'm sorry.
Reporter | ||
Comment 3•9 years ago
|
||
Comment on attachment 8477815 [details]
Test Case for CSS Fonts Module Level 3's font shorthand property syntax parsing(about <font-stretch>)
Fix Test Case's Description
Attachment #8477815 -
Attachment description: Test Case for CSS Fonts Module Level 3's font shorthand property syntax parsing(about <font-weight>) → Test Case for CSS Fonts Module Level 3's font shorthand property syntax parsing(about <font-stretch>)
Updated•9 years ago
|
Summary: Add support for font shorthand property's new syntax → Add support for specifying 'font-stretch' in the CSS 'font' shorthand
Updated•9 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 4•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b56bb92baa7c
Assignee | ||
Comment 5•8 years ago
|
||
Here's a patch to add a font-stretch keyword to the shorthand in property_database. I've checked that this causes several mochitests to fail, as expected (so it will need to be folded together with the actual code patch for landing).
Attachment #8656004 -
Flags: review?(jdaggett)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•8 years ago
|
||
And this should make the font shorthand accept the stretch keywords. If unit tests are happy with this, I'll also add a reftest to confirm that it has the expected effect on rendering.
Attachment #8656005 -
Flags: review?(jdaggett)
Assignee | ||
Comment 7•8 years ago
|
||
Oops - fixed copy/paste error in the patch.
Attachment #8656009 -
Flags: review?(jdaggett)
Assignee | ||
Updated•8 years ago
|
Attachment #8656005 -
Attachment is obsolete: true
Attachment #8656005 -
Flags: review?(jdaggett)
Assignee | ||
Comment 8•8 years ago
|
||
Attachment #8656044 -
Flags: review?(jdaggett)
Assignee | ||
Comment 9•8 years ago
|
||
Attachment #8656045 -
Flags: review?(jdaggett)
Assignee | ||
Comment 10•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=43113ee0c7a3
Updated•8 years ago
|
Attachment #8656004 -
Flags: review?(jdaggett) → review+
Comment 11•8 years ago
|
||
Comment on attachment 8656009 [details] [diff] [review] pt 2 - Add support for font-stretch values in the font shorthand r+ with minor cleanup below > + // Get optional font-style, font-variant, font-weight, font-stretch > + // (in any order) > + static const nsCSSProperty fontIDs[] = { > + eCSSProperty_font_style, > + eCSSProperty_font_variant_caps, > + eCSSProperty_font_weight, > + eCSSProperty_font_stretch > + }; > @@ -12249,16 +12251,20 @@ CSSParserImpl::ParseFont() > if ((found & 4) == 0) { > // Provide default font-weight > values[2].SetIntValue(NS_FONT_WEIGHT_NORMAL, eCSSUnit_Enumerated); > } > + if ((found & 8) == 0) { > + // Provide default font-stretch > + values[3].SetIntValue(NS_FONT_STRETCH_NORMAL, eCSSUnit_Enumerated); > + } I think it would be a good idea to tidy this code up a bit by using explicit constants (e.g. STYLE_INDEX, WEIGHT_INDEX) and a comment to indicate that the indices are dependent upon the ordering of fontIDs[].
Attachment #8656009 -
Flags: review?(jdaggett) → review+
Updated•8 years ago
|
Attachment #8656044 -
Flags: review?(jdaggett) → review+
Comment 12•8 years ago
|
||
Comment on attachment 8656045 [details] [diff] [review] pt 3 - Reftest for use of font-stretch values in the font shorthand Review of attachment 8656045 [details] [diff] [review]: ----------------------------------------------------------------- r+ with the fix below ::: layout/reftests/font-matching/reftest.list @@ +71,5 @@ > HTTP(..) == stretchmapping-137.html stretchmapping-137-ref.html > > # test for font-stretch using @font-face > skip-if(B2G||Mulet) skip-if(Android&&AndroidVersion>15) HTTP(..) == font-stretch-1.html font-stretch-1-ref.html # bugs 773482, 927602 # Initial mulet triage: parity with B2G/B2G Desktop > +skip-if(B2G||Mulet) skip-if(Android&&AndroidVersion>15) HTTP(..) == font-shorthand-stretch-1.html font-stretch-1-ref.html Copy the bug numbers from the line above
Attachment #8656045 -
Flags: review?(jdaggett) → review+
Assignee | ||
Comment 13•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a0f54b7bf6b3dbb8fb5fabe7821b21b7ca27fd23 Bug 1057680 - Add support for font-stretch values in the font shorthand. r=jdaggett https://hg.mozilla.org/integration/mozilla-inbound/rev/8408b26adf818039e669e807f20d6c2e5d7c054a Bug 1057680 - Reftest for use of font-stretch values in the font shorthand. r=jdaggett
Comment 14•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a0f54b7bf6b3 https://hg.mozilla.org/mozilla-central/rev/8408b26adf81
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Comment 15•8 years ago
|
||
Updated: https://developer.mozilla.org/en-US/Firefox/Releases/43#CSS and https://developer.mozilla.org/en-US/docs/Web/CSS/font
Keywords: dev-doc-needed → dev-doc-complete
Comment 16•8 years ago
|
||
For testing: the testcase should return TRUE on all lines.
QA Whiteboard: [good first verify]
You need to log in
before you can comment on or make changes to this bug.
Description
•