Commit graph

21 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
ef16c5844f Rustfmt recent changes. 2019-12-16 14:23:56 +01:00
Emilio Cobos Álvarez
a541046147 style: Use less Au in font code.
Font code is the only thing that was using Au in the style system without
interfacing with Gecko, and there was no real reason for it to do so.

This slightly simplifies the code.

Differential Revision: https://phabricator.services.mozilla.com/D57248
2019-12-16 14:23:56 +01:00
Emilio Cobos Álvarez
49842f5031 style: Fix servo build, and appease tidy / fmt. 2019-04-12 12:20:15 +02:00
Emilio Cobos Álvarez
8c004c0858 style: Reformat recent changes. 2019-04-12 12:20:14 +02:00
Emilio Cobos Álvarez
2184e3f2e5 style: Cleanup generic font-family handling.
To be more similar between Rust and C++. This introduces GenericFontFamily and
exposes that plus FontFamilyNameSyntax to C++, using that where appropriate
instead of plain uint8_t as we were doing.

As a follow-up, as discussed on IRC with Jonathan, we can remove the -moz-fixed
family, and turn it just into an alias of Monospace.

The only non-trivial change is the MatchType changes, but they're ok I think.
The code already assumed at most one CSS generic, and the struct still takes 8
bits. I've verified that the relevant tests are passing (though try is closed).

Differential Revision: https://phabricator.services.mozilla.com/D24272
2019-04-12 12:19:55 +02:00
Cameron McCormack
d4635f1d12 style: Use horizontal metrics for ch in vertical mixed/sideways writing modes and for ex always.
Differential Revision: https://phabricator.services.mozilla.com/D23426
2019-03-27 14:29:18 +01:00
Cameron McCormack
d5f208e18c style: Allow FontMetricsProvider to produce ex height and zero width independently.
We are always able to produce an x height, but depending on whether the
glyph exists, we sometimes can't produce a zero glyph width.

Differential Revision: https://phabricator.services.mozilla.com/D23424
2019-03-27 14:29:17 +01:00
Emilio Cobos Álvarez
d3f254d2e4 style: Make all font-metrics-affecting properties cascade early.
And make font-size computation work on the whole font of the parent, not just
accounting for the parent's font-size.

Differential Revision: https://phabricator.services.mozilla.com/D20656
2019-03-27 14:29:08 +01:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Simon Sapin
b1822a39fa cargo fix --edition --features gecko 2018-11-10 17:47:28 +01:00
Simon Sapin
a15d33a10e cargo fix --edition 2018-11-10 17:47:28 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Bobby Holley
c99bcdd4b8 Run rustfmt on selectors, servo_arc, and style.
This was generated with:

./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style

Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
2018-04-10 17:35:15 -07:00
Bobby Holley
9a8821a1b0 Avoid debug serialization of PropertyDeclaration & co in release builds.
In total, this PR saves ~60k.

The conditional compilation on the _Debug FFI function eliminates one
of the ToCss variants, eliminating 54.4k, as well as a bunch of other
<1k functions. Removing the public trait implementation of Debug for the
font metrics provider eliminates the last Debug impl from stylo.

MozReview-Commit-ID: nIfQ3sy4OW
2018-01-15 17:24:27 -08:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Manish Goregaokar
25667d0321 stylo: Use gecko's font metrics 2017-04-10 14:29:51 +08:00
Manish Goregaokar
2febe7ccde stylo: Use font metrics provider as a cache for font size results 2017-04-09 19:15:37 +08:00
Manish Goregaokar
e402c72d0e stylo: Store font metrics provider in thread local style context 2017-04-09 19:15:35 +08:00
Emilio Cobos Álvarez
68476df18e
style: Document the font_metrics module. 2016-12-31 23:24:19 +01:00
Emilio Cobos Álvarez
6c3458767b
style: Refactor and add infrastructure for font metrics in style.
This commit itself only moves things around and adds an extra parameter to the
`apply_declarations` function to eventually handle #14079 correctly.

Probably needs a more granular API to query fonts, á la nsFontMetrics, but
that's trivial to do once this is landed.

Then we should make the font provider mandatory, and implement the missing stylo
bits.
2016-11-13 11:54:10 +01:00