aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-10-04 11:11:53 -0500
committerGitHub <noreply@github.com>2016-10-04 11:11:53 -0500
commitb772f4335ee82007afe26fa58dd94d097d6135ba (patch)
tree5f65a9ee9a95291a0f7dc03b51c7cdbafdb1a439
parentd42235ee905acf6bea7f5983c77124b8be9656fc (diff)
parent361f372142135a510228228e2fe04d8ceed61fcb (diff)
downloadservo-b772f4335ee82007afe26fa58dd94d097d6135ba.tar.gz
servo-b772f4335ee82007afe26fa58dd94d097d6135ba.zip
Auto merge of #13570 - Wafflespeanut:font_stretch, r=Manishearth
Add support for 'font-stretch' in geckolib <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build-geckolib` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> r? @Manishearth <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13570) <!-- Reviewable:end -->
-rw-r--r--components/style/properties/gecko.mako.rs22
1 files changed, 20 insertions, 2 deletions
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs
index 99f6c0cdda3..acc3ee86fa6 100644
--- a/components/style/properties/gecko.mako.rs
+++ b/components/style/properties/gecko.mako.rs
@@ -447,7 +447,7 @@ impl Debug for ${style_struct.gecko_struct_name} {
# These are currently being shuffled to a different style struct on the gecko side.
force_stub += ["backface-visibility", "transform-box", "transform-style"]
# These live in an nsFont member in Gecko. Should be straightforward to do manually.
- force_stub += ["font-kerning", "font-stretch", "font-variant"]
+ force_stub += ["font-kerning", "font-variant"]
# These have unusual representations in gecko.
force_stub += ["list-style-type", "text-overflow"]
# In a nsTArray, have to be done manually, but probably not too much work
@@ -739,7 +739,7 @@ fn static_assert() {
</%self:impl_trait>
<%self:impl_trait style_struct_name="Font"
- skip_longhands="font-family font-style font-size font-weight"
+ skip_longhands="font-family font-stretch font-style font-size font-weight"
skip_additionals="*">
pub fn set_font_family(&mut self, v: longhands::font_family::computed_value::T) {
@@ -790,6 +790,24 @@ fn static_assert() {
Au(self.gecko.mSize)
}
+ pub fn set_font_stretch(&mut self, v: longhands::font_stretch::computed_value::T) {
+ use computed_values::font_stretch::T;
+
+ self.gecko.mFont.stretch = match v {
+ T::normal => structs::NS_FONT_STRETCH_NORMAL as i16,
+ T::ultra_condensed => structs::NS_FONT_STRETCH_ULTRA_CONDENSED as i16,
+ T::extra_condensed => structs::NS_FONT_STRETCH_EXTRA_CONDENSED as i16,
+ T::condensed => structs::NS_FONT_STRETCH_CONDENSED as i16,
+ T::semi_condensed => structs::NS_FONT_STRETCH_SEMI_CONDENSED as i16,
+ T::semi_expanded => structs::NS_FONT_STRETCH_SEMI_EXPANDED as i16,
+ T::expanded => structs::NS_FONT_STRETCH_EXPANDED as i16,
+ T::extra_expanded => structs::NS_FONT_STRETCH_EXTRA_EXPANDED as i16,
+ T::ultra_expanded => structs::NS_FONT_STRETCH_ULTRA_EXPANDED as i16,
+ };
+ }
+
+ ${impl_simple_copy('font_stretch', 'mFont.stretch')}
+
pub fn set_font_weight(&mut self, v: longhands::font_weight::computed_value::T) {
self.gecko.mFont.weight = v as u16;
}