Auto merge of #17058 - Manishearth:stylo-randomprops, r=emilio

stylo: Support remaning longhands

r=xidorn https://bugzilla.mozilla.org/show_bug.cgi?id=1367275

<!-- 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/17058)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-27 13:37:59 -05:00 committed by GitHub
commit 369d5cf124
14 changed files with 425 additions and 166 deletions

View file

@ -1133,6 +1133,14 @@ extern "C" {
pub fn Gecko_nsStyleSVG_CopyDashArray(dst: *mut nsStyleSVG,
src: *const nsStyleSVG);
}
extern "C" {
pub fn Gecko_nsStyleSVG_SetContextPropertiesLength(svg: *mut nsStyleSVG,
len: u32);
}
extern "C" {
pub fn Gecko_nsStyleSVG_CopyContextProperties(dst: *mut nsStyleSVG,
src: *const nsStyleSVG);
}
extern "C" {
pub fn Gecko_NewURLValue(uri: ServoBundledURI) -> *mut URLValue;
}
@ -1307,6 +1315,11 @@ extern "C" {
pres_context:
RawGeckoPresContextBorrowed);
}
extern "C" {
pub fn Gecko_nsStyleFont_FixupMinFontSize(font: *mut nsStyleFont,
pres_context:
RawGeckoPresContextBorrowed);
}
extern "C" {
pub fn Gecko_GetBaseSize(lang: *mut nsIAtom) -> FontSizePrefs;
}

View file

@ -806,6 +806,11 @@ pub mod root {
4;
pub const NS_STYLE_CONTEXT_PROPERTY_FILL: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_CONTEXT_PROPERTY_STROKE: ::std::os::raw::c_uint = 2;
pub const NS_STYLE_WINDOW_SHADOW_NONE: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_WINDOW_SHADOW_DEFAULT: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_WINDOW_SHADOW_MENU: ::std::os::raw::c_uint = 2;
pub const NS_STYLE_WINDOW_SHADOW_TOOLTIP: ::std::os::raw::c_uint = 3;
pub const NS_STYLE_WINDOW_SHADOW_SHEET: ::std::os::raw::c_uint = 4;
pub const NS_STYLE_DOMINANT_BASELINE_AUTO: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT: ::std::os::raw::c_uint =
1;
@ -2191,7 +2196,8 @@ pub mod root {
#[repr(C)]
#[derive(Debug, Copy)]
pub struct FontVariation {
pub _bindgen_opaque_blob: [u32; 2usize],
pub mTag: u32,
pub mValue: f32,
}
#[test]
fn bindgen_test_layout_FontVariation() {
@ -2202,6 +2208,17 @@ pub mod root {
concat ! (
"Alignment of " , stringify ! ( FontVariation )
));
assert_eq! (unsafe {
& ( * ( 0 as * const FontVariation ) ) . mTag as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
FontVariation ) , "::" , stringify ! ( mTag ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const FontVariation ) ) . mValue as
* const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
FontVariation ) , "::" , stringify ! ( mValue )
));
}
impl Clone for FontVariation {
fn clone(&self) -> Self { *self }

View file

@ -806,6 +806,11 @@ pub mod root {
4;
pub const NS_STYLE_CONTEXT_PROPERTY_FILL: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_CONTEXT_PROPERTY_STROKE: ::std::os::raw::c_uint = 2;
pub const NS_STYLE_WINDOW_SHADOW_NONE: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_WINDOW_SHADOW_DEFAULT: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_WINDOW_SHADOW_MENU: ::std::os::raw::c_uint = 2;
pub const NS_STYLE_WINDOW_SHADOW_TOOLTIP: ::std::os::raw::c_uint = 3;
pub const NS_STYLE_WINDOW_SHADOW_SHEET: ::std::os::raw::c_uint = 4;
pub const NS_STYLE_DOMINANT_BASELINE_AUTO: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT: ::std::os::raw::c_uint =
1;
@ -2097,7 +2102,8 @@ pub mod root {
#[repr(C)]
#[derive(Debug, Copy)]
pub struct FontVariation {
pub _bindgen_opaque_blob: [u32; 2usize],
pub mTag: u32,
pub mValue: f32,
}
#[test]
fn bindgen_test_layout_FontVariation() {
@ -2108,6 +2114,17 @@ pub mod root {
concat ! (
"Alignment of " , stringify ! ( FontVariation )
));
assert_eq! (unsafe {
& ( * ( 0 as * const FontVariation ) ) . mTag as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
FontVariation ) , "::" , stringify ! ( mTag ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const FontVariation ) ) . mValue as
* const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
FontVariation ) , "::" , stringify ! ( mValue )
));
}
impl Clone for FontVariation {
fn clone(&self) -> Self { *self }

View file

@ -17,6 +17,7 @@ use gecko_bindings::sugar::ns_css_value::ToNsCssValue;
use gecko_bindings::sugar::refptr::{RefPtr, UniqueRefPtr};
use shared_lock::{ToCssWithGuard, SharedRwLockReadGuard};
use std::{fmt, str};
use values::generics::FontSettings;
/// A @font-face rule
pub type FontFaceRule = RefPtr<nsCSSFontFaceRule>;
@ -36,8 +37,8 @@ impl ToNsCssValue for font_weight::T {
impl ToNsCssValue for font_feature_settings::T {
fn convert(self, nscssvalue: &mut nsCSSValue) {
match self {
font_feature_settings::T::Normal => nscssvalue.set_normal(),
font_feature_settings::T::Tag(tags) => {
FontSettings::Normal => nscssvalue.set_normal(),
FontSettings::Tag(tags) => {
nscssvalue.set_pair_list(tags.into_iter().map(|entry| {
let mut feature = nsCSSValue::null();
let mut raw = [0u8; 4];
@ -45,7 +46,7 @@ impl ToNsCssValue for font_feature_settings::T {
feature.set_string(str::from_utf8(&raw).unwrap());
let mut index = nsCSSValue::null();
index.set_integer(entry.value as i32);
index.set_integer(entry.value.0 as i32);
(feature, index)
}))