aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-11-10 18:38:48 -0600
committerGitHub <noreply@github.com>2016-11-10 18:38:48 -0600
commit75d35241db63894db31b6385143ffea0db5cac70 (patch)
tree69c0f7aa4db234457b366b992969abddd7b5a18c
parent796fae4bbe966a4e6e32b01fa44f6123c7162992 (diff)
parentbb5f351f4ac8febcb6669afeaf336e3e9fa34c39 (diff)
downloadservo-75d35241db63894db31b6385143ffea0db5cac70.tar.gz
servo-75d35241db63894db31b6385143ffea0db5cac70.zip
Auto merge of #14168 - Manishearth:tmp-transform, r=heycam
stylo: support transform r=heycam from https://bugzilla.mozilla.org/show_bug.cgi?id=1314200 <!-- 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/14168) <!-- Reviewable:end -->
-rw-r--r--components/layout/display_list_builder.rs4
-rw-r--r--components/layout/fragment.rs4
-rwxr-xr-xcomponents/style/binding_tools/regen.py24
-rw-r--r--components/style/gecko_bindings/bindings.rs51
-rw-r--r--components/style/gecko_bindings/structs_debug.rs766
-rw-r--r--components/style/gecko_bindings/structs_release.rs766
-rw-r--r--components/style/gecko_bindings/sugar/refptr.rs17
-rw-r--r--components/style/properties/gecko.mako.rs100
-rw-r--r--components/style/properties/longhand/box.mako.rs522
-rw-r--r--components/style/properties/longhand/effects.mako.rs519
-rw-r--r--components/style/properties/properties.mako.rs5
-rw-r--r--components/style/servo/restyle_damage.rs2
12 files changed, 2238 insertions, 542 deletions
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs
index d5f3317cee5..0b2beedcff9 100644
--- a/components/layout/display_list_builder.rs
+++ b/components/layout/display_list_builder.rs
@@ -1813,7 +1813,7 @@ impl FragmentDisplayListBuilding for Fragment {
fn transform_matrix(&self, stacking_relative_border_box: &Rect<Au>) -> Matrix4D<f32> {
let mut transform = Matrix4D::identity();
- let operations = match self.style.get_effects().transform.0 {
+ let operations = match self.style.get_box().transform.0 {
None => return transform,
Some(ref operations) => operations,
};
@@ -2036,7 +2036,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
self.base.clip = self.base.clip.translate(&-stacking_relative_border_box.origin);
// Account for `transform`, if applicable.
- if self.fragment.style.get_effects().transform.0.is_none() {
+ if self.fragment.style.get_box().transform.0.is_none() {
return
}
let transform = match self.fragment
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index a0f09dd5dd1..f947c4f9493 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -2584,7 +2584,7 @@ impl Fragment {
if self.style().get_effects().mix_blend_mode != mix_blend_mode::T::normal {
return true
}
- if self.style().get_effects().transform.0.is_some() {
+ if self.style().get_box().transform.0.is_some() {
return true
}
@@ -2638,7 +2638,7 @@ impl Fragment {
_ => return self.style().get_position().z_index.number_or_zero(),
}
- if self.style().get_effects().transform.0.is_some() {
+ if self.style().get_box().transform.0.is_some() {
return self.style().get_position().z_index.number_or_zero();
}
diff --git a/components/style/binding_tools/regen.py b/components/style/binding_tools/regen.py
index 997dc612c43..78a22738f1a 100755
--- a/components/style/binding_tools/regen.py
+++ b/components/style/binding_tools/regen.py
@@ -104,6 +104,7 @@ COMPILATION_TARGETS = {
"nsBorderColors",
"nsChangeHint",
"nscolor",
+ "nsCSSKeyword",
"nsCSSPropertyID",
"nsCSSRect",
"nsCSSRect_heap",
@@ -271,7 +272,11 @@ COMPILATION_TARGETS = {
"StyleBasicShape",
"StyleBasicShapeType",
"StyleClipPath",
+ "nscoord",
+ "nsCSSKeyword",
"nsCSSShadowArray",
+ "nsCSSValue",
+ "nsCSSValueSharedList",
"nsChangeHint",
"nsFont",
"nsIAtom",
@@ -335,6 +340,9 @@ COMPILATION_TARGETS = {
"RawGeckoDocument",
"RawServoDeclarationBlockStrong",
],
+ "servo_borrow_types": [
+ "nsCSSValue",
+ ],
"whitelist_functions": [
"Servo_.*",
"Gecko_.*"
@@ -544,7 +552,7 @@ Option<&'a {0}>;".format(ty))
zero_size_type(ty, flags)
if "servo_immutable_borrow_types" in current_target:
- for ty in current_target["servo_immutable_borrow_types"]:
+ for ty in current_target.get("servo_immutable_borrow_types", []) + current_target.get("servo_borrow_types", []):
flags.append("--blacklist-type")
flags.append("{}Borrowed".format(ty))
flags.append("--raw-line")
@@ -552,8 +560,18 @@ Option<&'a {0}>;".format(ty))
flags.append("--blacklist-type")
flags.append("{}BorrowedOrNull".format(ty))
flags.append("--raw-line")
- flags.append("pub type {0}BorrowedOrNull<'a> = \
-Option<&'a {0}>;".format(ty))
+ flags.append("pub type {0}BorrowedOrNull<'a> = Option<&'a {0}>;".format(ty))
+ if "servo_borrow_types" in current_target:
+ for ty in current_target["servo_borrow_types"]:
+ flags.append("--blacklist-type")
+ flags.append("{}BorrowedMut".format(ty))
+ flags.append("--raw-line")
+ flags.append("pub type {0}BorrowedMut<'a> = &'a mut {0};".format(ty))
+ flags.append("--blacklist-type")
+ flags.append("{}BorrowedMutOrNull".format(ty))
+ flags.append("--raw-line")
+ flags.append("pub type {0}BorrowedMutOrNull<'a> = \
+Option<&'a mut {0}>;".format(ty))
# Right now the only immutable borrow types are ones which we import
# from the |structs| module. As such, we don't need to create an opaque
# type with zero_size_type. If we ever introduce immutable borrow types
diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs
index 6611454dbdb..e438478a352 100644
--- a/components/style/gecko_bindings/bindings.rs
+++ b/components/style/gecko_bindings/bindings.rs
@@ -26,6 +26,10 @@ pub type RawGeckoDocumentBorrowed<'a> = &'a RawGeckoDocument;
pub type RawGeckoDocumentBorrowedOrNull<'a> = Option<&'a RawGeckoDocument>;
pub type RawServoDeclarationBlockStrongBorrowed<'a> = &'a RawServoDeclarationBlockStrong;
pub type RawServoDeclarationBlockStrongBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlockStrong>;
+pub type nsCSSValueBorrowed<'a> = &'a nsCSSValue;
+pub type nsCSSValueBorrowedOrNull<'a> = Option<&'a nsCSSValue>;
+pub type nsCSSValueBorrowedMut<'a> = &'a mut nsCSSValue;
+pub type nsCSSValueBorrowedMutOrNull<'a> = Option<&'a mut nsCSSValue>;
pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet;
pub type RawServoStyleSetBorrowedMut<'a> = &'a mut RawServoStyleSet;
pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned<RawServoStyleSet>;
@@ -50,7 +54,11 @@ use gecko_bindings::structs::SheetParsingMode;
use gecko_bindings::structs::StyleBasicShape;
use gecko_bindings::structs::StyleBasicShapeType;
use gecko_bindings::structs::StyleClipPath;
+use gecko_bindings::structs::nscoord;
+use gecko_bindings::structs::nsCSSKeyword;
use gecko_bindings::structs::nsCSSShadowArray;
+use gecko_bindings::structs::nsCSSValue;
+use gecko_bindings::structs::nsCSSValueSharedList;
use gecko_bindings::structs::nsChangeHint;
use gecko_bindings::structs::nsFont;
use gecko_bindings::structs::nsIAtom;
@@ -613,6 +621,49 @@ extern "C" {
*mut nsStyleQuoteValues);
}
extern "C" {
+ pub fn Gecko_NewCSSValueSharedList(len: u32) -> *mut nsCSSValueSharedList;
+}
+extern "C" {
+ pub fn Gecko_CSSValue_SetAbsoluteLength(css_value: nsCSSValueBorrowedMut,
+ len: nscoord);
+}
+extern "C" {
+ pub fn Gecko_CSSValue_SetNumber(css_value: nsCSSValueBorrowedMut,
+ number: f32);
+}
+extern "C" {
+ pub fn Gecko_CSSValue_SetKeyword(css_value: nsCSSValueBorrowedMut,
+ keyword: nsCSSKeyword);
+}
+extern "C" {
+ pub fn Gecko_CSSValue_SetPercentage(css_value: nsCSSValueBorrowedMut,
+ percent: f32);
+}
+extern "C" {
+ pub fn Gecko_CSSValue_SetAngle(css_value: nsCSSValueBorrowedMut,
+ radians: f32);
+}
+extern "C" {
+ pub fn Gecko_CSSValue_SetCalc(css_value: nsCSSValueBorrowedMut,
+ calc: nsStyleCoord_CalcValue);
+}
+extern "C" {
+ pub fn Gecko_CSSValue_SetFunction(css_value: nsCSSValueBorrowedMut,
+ len: i32);
+}
+extern "C" {
+ pub fn Gecko_CSSValue_GetArrayItem(css_value: nsCSSValueBorrowedMut,
+ index: i32) -> nsCSSValueBorrowedMut;
+}
+extern "C" {
+ pub fn Gecko_AddRefCSSValueSharedListArbitraryThread(aPtr:
+ *mut nsCSSValueSharedList);
+}
+extern "C" {
+ pub fn Gecko_ReleaseCSSValueSharedListArbitraryThread(aPtr:
+ *mut nsCSSValueSharedList);
+}
+extern "C" {
pub fn Gecko_Construct_nsStyleFont(ptr: *mut nsStyleFont);
}
extern "C" {
diff --git a/components/style/gecko_bindings/structs_debug.rs b/components/style/gecko_bindings/structs_debug.rs
index be9627a71e6..c3acede57cc 100644
--- a/components/style/gecko_bindings/structs_debug.rs
+++ b/components/style/gecko_bindings/structs_debug.rs
@@ -8779,6 +8779,765 @@ fn bindgen_test_layout_StyleComplexColor() {
impl Clone for StyleComplexColor {
fn clone(&self) -> Self { *self }
}
+#[repr(i16)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+pub enum nsCSSKeyword {
+ eCSSKeyword_UNKNOWN = -1,
+ eCSSKeyword__moz_activehyperlinktext = 0,
+ eCSSKeyword__moz_all = 1,
+ eCSSKeyword__moz_alt_content = 2,
+ eCSSKeyword__moz_anchor_decoration = 3,
+ eCSSKeyword__moz_available = 4,
+ eCSSKeyword__moz_box = 5,
+ eCSSKeyword__moz_button = 6,
+ eCSSKeyword__moz_buttondefault = 7,
+ eCSSKeyword__moz_buttonhoverface = 8,
+ eCSSKeyword__moz_buttonhovertext = 9,
+ eCSSKeyword__moz_cellhighlight = 10,
+ eCSSKeyword__moz_cellhighlighttext = 11,
+ eCSSKeyword__moz_center = 12,
+ eCSSKeyword__moz_combobox = 13,
+ eCSSKeyword__moz_comboboxtext = 14,
+ eCSSKeyword__moz_block_height = 15,
+ eCSSKeyword__moz_deck = 16,
+ eCSSKeyword__moz_default_background_color = 17,
+ eCSSKeyword__moz_default_color = 18,
+ eCSSKeyword__moz_desktop = 19,
+ eCSSKeyword__moz_dialog = 20,
+ eCSSKeyword__moz_dialogtext = 21,
+ eCSSKeyword__moz_document = 22,
+ eCSSKeyword__moz_dragtargetzone = 23,
+ eCSSKeyword__moz_element = 24,
+ eCSSKeyword__moz_eventreerow = 25,
+ eCSSKeyword__moz_field = 26,
+ eCSSKeyword__moz_fieldtext = 27,
+ eCSSKeyword__moz_fit_content = 28,
+ eCSSKeyword__moz_fixed = 29,
+ eCSSKeyword__moz_grabbing = 30,
+ eCSSKeyword__moz_grab = 31,
+ eCSSKeyword__moz_grid_group = 32,
+ eCSSKeyword__moz_grid_line = 33,
+ eCSSKeyword__moz_grid = 34,
+ eCSSKeyword__moz_groupbox = 35,
+ eCSSKeyword__moz_gtk_info_bar = 36,
+ eCSSKeyword__moz_gtk_info_bar_text = 37,
+ eCSSKeyword__moz_hidden_unscrollable = 38,
+ eCSSKeyword__moz_hyperlinktext = 39,
+ eCSSKeyword__moz_html_cellhighlight = 40,
+ eCSSKeyword__moz_html_cellhighlighttext = 41,
+ eCSSKeyword__moz_image_rect = 42,
+ eCSSKeyword__moz_info = 43,
+ eCSSKeyword__moz_inline_box = 44,
+ eCSSKeyword__moz_inline_grid = 45,
+ eCSSKeyword__moz_inline_stack = 46,
+ eCSSKeyword__moz_isolate = 47,
+ eCSSKeyword__moz_isolate_override = 48,
+ eCSSKeyword__moz_left = 49,
+ eCSSKeyword__moz_list = 50,
+ eCSSKeyword__moz_mac_buttonactivetext = 51,
+ eCSSKeyword__moz_mac_chrome_active = 52,
+ eCSSKeyword__moz_mac_chrome_inactive = 53,
+ eCSSKeyword__moz_mac_defaultbuttontext = 54,
+ eCSSKeyword__moz_mac_focusring = 55,
+ eCSSKeyword__moz_mac_fullscreen_button = 56,
+ eCSSKeyword__moz_mac_menuselect = 57,
+ eCSSKeyword__moz_mac_menushadow = 58,
+ eCSSKeyword__moz_mac_menutextdisable = 59,
+ eCSSKeyword__moz_mac_menutextselect = 60,
+ eCSSKeyword__moz_mac_disabledtoolbartext = 61,
+ eCSSKeyword__moz_mac_secondaryhighlight = 62,
+ eCSSKeyword__moz_max_content = 63,
+ eCSSKeyword__moz_menuhover = 64,
+ eCSSKeyword__moz_menuhovertext = 65,
+ eCSSKeyword__moz_menubartext = 66,
+ eCSSKeyword__moz_menubarhovertext = 67,
+ eCSSKeyword__moz_middle_with_baseline = 68,
+ eCSSKeyword__moz_min_content = 69,
+ eCSSKeyword__moz_nativehyperlinktext = 70,
+ eCSSKeyword__moz_none = 71,
+ eCSSKeyword__moz_oddtreerow = 72,
+ eCSSKeyword__moz_plaintext = 73,
+ eCSSKeyword__moz_popup = 74,
+ eCSSKeyword__moz_pre_space = 75,
+ eCSSKeyword__moz_pull_down_menu = 76,
+ eCSSKeyword__moz_right = 77,
+ eCSSKeyword__moz_scrollbars_horizontal = 78,
+ eCSSKeyword__moz_scrollbars_none = 79,
+ eCSSKeyword__moz_scrollbars_vertical = 80,
+ eCSSKeyword__moz_stack = 81,
+ eCSSKeyword__moz_text = 82,
+ eCSSKeyword__moz_use_system_font = 83,
+ eCSSKeyword__moz_visitedhyperlinktext = 84,
+ eCSSKeyword__moz_window = 85,
+ eCSSKeyword__moz_workspace = 86,
+ eCSSKeyword__moz_zoom_in = 87,
+ eCSSKeyword__moz_zoom_out = 88,
+ eCSSKeyword__webkit_box = 89,
+ eCSSKeyword__webkit_flex = 90,
+ eCSSKeyword__webkit_inline_box = 91,
+ eCSSKeyword__webkit_inline_flex = 92,
+ eCSSKeyword_absolute = 93,
+ eCSSKeyword_active = 94,
+ eCSSKeyword_activeborder = 95,
+ eCSSKeyword_activecaption = 96,
+ eCSSKeyword_add = 97,
+ eCSSKeyword_additive = 98,
+ eCSSKeyword_alias = 99,
+ eCSSKeyword_all = 100,
+ eCSSKeyword_all_petite_caps = 101,
+ eCSSKeyword_all_scroll = 102,
+ eCSSKeyword_all_small_caps = 103,
+ eCSSKeyword_alpha = 104,
+ eCSSKeyword_alternate = 105,
+ eCSSKeyword_alternate_reverse = 106,
+ eCSSKeyword_always = 107,
+ eCSSKeyword_annotation = 108,
+ eCSSKeyword_appworkspace = 109,
+ eCSSKeyword_auto = 110,
+ eCSSKeyword_auto_fill = 111,
+ eCSSKeyword_auto_fit = 112,
+ eCSSKeyword_auto_flow = 113,
+ eCSSKeyword_avoid = 114,
+ eCSSKeyword_background = 115,
+ eCSSKeyword_backwards = 116,
+ eCSSKeyword_balance = 117,
+ eCSSKeyword_baseline = 118,
+ eCSSKeyword_bidi_override = 119,
+ eCSSKeyword_blink = 120,
+ eCSSKeyword_block = 121,
+ eCSSKeyword_block_axis = 122,
+ eCSSKeyword_blur = 123,
+ eCSSKeyword_bold = 124,
+ eCSSKeyword_bold_fraktur = 125,
+ eCSSKeyword_bold_italic = 126,
+ eCSSKeyword_bold_sans_serif = 127,
+ eCSSKeyword_bold_script = 128,
+ eCSSKeyword_bolder = 129,
+ eCSSKeyword_border_box = 130,
+ eCSSKeyword_both = 131,
+ eCSSKeyword_bottom = 132,
+ eCSSKeyword_bottom_outside = 133,
+ eCSSKeyword_break_all = 134,
+ eCSSKeyword_break_word = 135,
+ eCSSKeyword_brightness = 136,
+ eCSSKeyword_browser = 137,
+ eCSSKeyword_bullets = 138,
+ eCSSKeyword_button = 139,
+ eCSSKeyword_buttonface = 140,
+ eCSSKeyword_buttonhighlight = 141,
+ eCSSKeyword_buttonshadow = 142,
+ eCSSKeyword_buttontext = 143,
+ eCSSKeyword_capitalize = 144,
+ eCSSKeyword_caption = 145,
+ eCSSKeyword_captiontext = 146,
+ eCSSKeyword_cell = 147,
+ eCSSKeyword_center = 148,
+ eCSSKeyword_ch = 149,
+ eCSSKeyword_character_variant = 150,
+ eCSSKeyword_circle = 151,
+ eCSSKeyword_cjk_decimal = 152,
+ eCSSKeyword_clip = 153,
+ eCSSKeyword_clone = 154,
+ eCSSKeyword_close_quote = 155,
+ eCSSKeyword_closest_corner = 156,
+ eCSSKeyword_closest_side = 157,
+ eCSSKeyword_cm = 158,
+ eCSSKeyword_col_resize = 159,
+ eCSSKeyword_collapse = 160,
+ eCSSKeyword_color = 161,
+ eCSSKeyword_color_burn = 162,
+ eCSSKeyword_color_dodge = 163,
+ eCSSKeyword_common_ligatures = 164,
+ eCSSKeyword_column = 165,
+ eCSSKeyword_column_reverse = 166,
+ eCSSKeyword_condensed = 167,
+ eCSSKeyword_contain = 168,
+ eCSSKeyword_content_box = 169,
+ eCSSKeyword_contents = 170,
+ eCSSKeyword_context_fill = 171,
+ eCSSKeyword_context_fill_opacity = 172,
+ eCSSKeyword_context_menu = 173,
+ eCSSKeyword_context_stroke = 174,
+ eCSSKeyword_context_stroke_opacity = 175,
+ eCSSKeyword_context_value = 176,
+ eCSSKeyword_continuous = 177,
+ eCSSKeyword_contrast = 178,
+ eCSSKeyword_copy = 179,
+ eCSSKeyword_contextual = 180,
+ eCSSKeyword_cover = 181,
+ eCSSKeyword_crop = 182,
+ eCSSKeyword_cross = 183,
+ eCSSKeyword_crosshair = 184,
+ eCSSKeyword_currentcolor = 185,
+ eCSSKeyword_cursive = 186,
+ eCSSKeyword_cyclic = 187,
+ eCSSKeyword_darken = 188,
+ eCSSKeyword_dashed = 189,
+ eCSSKeyword_dense = 190,
+ eCSSKeyword_decimal = 191,
+ eCSSKeyword_default = 192,
+ eCSSKeyword_deg = 193,
+ eCSSKeyword_diagonal_fractions = 194,
+ eCSSKeyword_dialog = 195,
+ eCSSKeyword_difference = 196,
+ eCSSKeyword_digits = 197,
+ eCSSKeyword_disabled = 198,
+ eCSSKeyword_disc = 199,
+ eCSSKeyword_disclosure_closed = 200,
+ eCSSKeyword_disclosure_open = 201,
+ eCSSKeyword_discretionary_ligatures = 202,
+ eCSSKeyword_dot = 203,
+ eCSSKeyword_dotted = 204,
+ eCSSKeyword_double = 205,
+ eCSSKeyword_double_circle = 206,
+ eCSSKeyword_double_struck = 207,
+ eCSSKeyword_drag = 208,
+ eCSSKeyword_drop_shadow = 209,
+ eCSSKeyword_e_resize = 210,
+ eCSSKeyword_ease = 211,
+ eCSSKeyword_ease_in = 212,
+ eCSSKeyword_ease_in_out = 213,
+ eCSSKeyword_ease_out = 214,
+ eCSSKeyword_economy = 215,
+ eCSSKeyword_element = 216,
+ eCSSKeyword_elements = 217,
+ eCSSKeyword_ellipse = 218,
+ eCSSKeyword_ellipsis = 219,
+ eCSSKeyword_em = 220,
+ eCSSKeyword_embed = 221,
+ eCSSKeyword_enabled = 222,
+ eCSSKeyword_end = 223,
+ eCSSKeyword_ethiopic_numeric = 224,
+ eCSSKeyword_ex = 225,
+ eCSSKeyword_exact = 226,
+ eCSSKeyword_exclude = 227,
+ eCSSKeyword_exclusion = 228,
+ eCSSKeyword_expanded = 229,
+ eCSSKeyword_extends = 230,
+ eCSSKeyword_extra_condensed = 231,
+ eCSSKeyword_extra_expanded = 232,
+ eCSSKeyword_ew_resize = 233,
+ eCSSKeyword_fallback = 234,
+ eCSSKeyword_fantasy = 235,
+ eCSSKeyword_farthest_side = 236,
+ eCSSKeyword_farthest_corner = 237,
+ eCSSKeyword_fill = 238,
+ eCSSKeyword_filled = 239,
+ eCSSKeyword_fill_box = 240,
+ eCSSKeyword_fit_content = 241,
+ eCSSKeyword_fixed = 242,
+ eCSSKeyword_flat = 243,
+ eCSSKeyword_flex = 244,
+ eCSSKeyword_flex_end = 245,
+ eCSSKeyword_flex_start = 246,
+ eCSSKeyword_flip = 247,
+ eCSSKeyword_forwards = 248,
+ eCSSKeyword_fraktur = 249,
+ eCSSKeyword_from_image = 250,
+ eCSSKeyword_full_width = 251,
+ eCSSKeyword_fullscreen = 252,
+ eCSSKeyword_grab = 253,
+ eCSSKeyword_grabbing = 254,
+ eCSSKeyword_grad = 255,
+ eCSSKeyword_grayscale = 256,
+ eCSSKeyword_graytext = 257,
+ eCSSKeyword_grid = 258,
+ eCSSKeyword_groove = 259,
+ eCSSKeyword_hard_light = 260,
+ eCSSKeyword_hebrew = 261,
+ eCSSKeyword_help = 262,
+ eCSSKeyword_hidden = 263,
+ eCSSKeyword_hide = 264,
+ eCSSKeyword_highlight = 265,
+ eCSSKeyword_highlighttext = 266,
+ eCSSKeyword_historical_forms = 267,
+ eCSSKeyword_historical_ligatures = 268,
+ eCSSKeyword_horizontal = 269,
+ eCSSKeyword_horizontal_tb = 270,
+ eCSSKeyword_hue = 271,
+ eCSSKeyword_hue_rotate = 272,
+ eCSSKeyword_hz = 273,
+ eCSSKeyword_icon = 274,
+ eCSSKeyword_ignore = 275,
+ eCSSKeyword_in = 276,
+ eCSSKeyword_interlace = 277,
+ eCSSKeyword_inactive = 278,
+ eCSSKeyword_inactiveborder = 279,
+ eCSSKeyword_inactivecaption = 280,
+ eCSSKeyword_inactivecaptiontext = 281,
+ eCSSKeyword_infinite = 282,
+ eCSSKeyword_infobackground = 283,
+ eCSSKeyword_infotext = 284,
+ eCSSKeyword_inherit = 285,
+ eCSSKeyword_initial = 286,
+ eCSSKeyword_inline = 287,
+ eCSSKeyword_inline_axis = 288,
+ eCSSKeyword_inline_block = 289,
+ eCSSKeyword_inline_end = 290,
+ eCSSKeyword_inline_flex = 291,
+ eCSSKeyword_inline_grid = 292,
+ eCSSKeyword_inline_start = 293,
+ eCSSKeyword_inline_table = 294,
+ eCSSKeyword_inset = 295,
+ eCSSKeyword_inside = 296,
+ eCSSKeyword_interpolatematrix = 297,
+ eCSSKeyword_intersect = 298,
+ eCSSKeyword_isolate = 299,
+ eCSSKeyword_isolate_override = 300,
+ eCSSKeyword_invert = 301,
+ eCSSKeyword_italic = 302,
+ eCSSKeyword_japanese_formal = 303,
+ eCSSKeyword_japanese_informal = 304,
+ eCSSKeyword_jis78 = 305,
+ eCSSKeyword_jis83 = 306,
+ eCSSKeyword_jis90 = 307,
+ eCSSKeyword_jis04 = 308,
+ eCSSKeyword_justify = 309,
+ eCSSKeyword_keep_all = 310,
+ eCSSKeyword_khz = 311,
+ eCSSKeyword_korean_hangul_formal = 312,
+ eCSSKeyword_korean_hanja_formal = 313,
+ eCSSKeyword_korean_hanja_informal = 314,
+ eCSSKeyword_landscape = 315,
+ eCSSKeyword_large = 316,
+ eCSSKeyword_larger = 317,
+ eCSSKeyword_layout = 318,
+ eCSSKeyword_last_baseline = 319,
+ eCSSKeyword_left = 320,
+ eCSSKeyword_legacy = 321,
+ eCSSKeyword_lighten = 322,
+ eCSSKeyword_lighter = 323,
+ eCSSKeyword_line_through = 324,
+ eCSSKeyword_linear = 325,
+ eCSSKeyword_lining_nums = 326,
+ eCSSKeyword_list_item = 327,
+ eCSSKeyword_local = 328,
+ eCSSKeyword_logical = 329,
+ eCSSKeyword_looped = 330,
+ eCSSKeyword_lowercase = 331,
+ eCSSKeyword_lr = 332,
+ eCSSKeyword_lr_tb = 333,
+ eCSSKeyword_ltr = 334,
+ eCSSKeyword_luminance = 335,
+ eCSSKeyword_luminosity = 336,
+ eCSSKeyword_mandatory = 337,
+ eCSSKeyword_manipulation = 338,
+ eCSSKeyword_manual = 339,
+ eCSSKeyword_margin_box = 340,
+ eCSSKeyword_markers = 341,
+ eCSSKeyword_match_parent = 342,
+ eCSSKeyword_match_source = 343,
+ eCSSKeyword_matrix = 344,
+ eCSSKeyword_matrix3d = 345,
+ eCSSKeyword_max_content = 346,
+ eCSSKeyword_medium = 347,
+ eCSSKeyword_menu = 348,
+ eCSSKeyword_menutext = 349,
+ eCSSKeyword_message_box = 350,
+ eCSSKeyword_middle = 351,
+ eCSSKeyword_min_content = 352,
+ eCSSKeyword_minmax = 353,
+ eCSSKeyword_mix = 354,
+ eCSSKeyword_mixed = 355,
+ eCSSKeyword_mm = 356,
+ eCSSKeyword_monospace = 357,
+ eCSSKeyword_move = 358,
+ eCSSKeyword_ms = 359,
+ eCSSKeyword_multiply = 360,
+ eCSSKeyword_n_resize = 361,
+ eCSSKeyword_narrower = 362,
+ eCSSKeyword_ne_resize = 363,
+ eCSSKeyword_nesw_resize = 364,
+ eCSSKeyword_no_close_quote = 365,
+ eCSSKeyword_no_common_ligatures = 366,
+ eCSSKeyword_no_contextual = 367,
+ eCSSKeyword_no_discretionary_ligatures = 368,
+ eCSSKeyword_no_drag = 369,
+ eCSSKeyword_no_drop = 370,
+ eCSSKeyword_no_historical_ligatures = 371,
+ eCSSKeyword_no_open_quote = 372,
+ eCSSKeyword_no_repeat = 373,
+ eCSSKeyword_none = 374,
+ eCSSKeyword_normal = 375,
+ eCSSKeyword_not_allowed = 376,
+ eCSSKeyword_nowrap = 377,
+ eCSSKeyword_numeric = 378,
+ eCSSKeyword_ns_resize = 379,
+ eCSSKeyword_nw_resize = 380,
+ eCSSKeyword_nwse_resize = 381,
+ eCSSKeyword_oblique = 382,
+ eCSSKeyword_oldstyle_nums = 383,
+ eCSSKeyword_opacity = 384,
+ eCSSKeyword_open = 385,
+ eCSSKeyword_open_quote = 386,
+ eCSSKeyword_optional = 387,
+ eCSSKeyword_ordinal = 388,
+ eCSSKeyword_ornaments = 389,
+ eCSSKeyword_outset = 390,
+ eCSSKeyword_outside = 391,
+ eCSSKeyword_over = 392,
+ eCSSKeyword_overlay = 393,
+ eCSSKeyword_overline = 394,
+ eCSSKeyword_paint = 395,
+ eCSSKeyword_padding_box = 396,
+ eCSSKeyword_painted = 397,
+ eCSSKeyword_pan_x = 398,
+ eCSSKeyword_pan_y = 399,
+ eCSSKeyword_paused = 400,
+ eCSSKeyword_pc = 401,
+ eCSSKeyword_perspective = 402,
+ eCSSKeyword_petite_caps = 403,
+ eCSSKeyword_physical = 404,
+ eCSSKeyword_plaintext = 405,
+ eCSSKeyword_pointer = 406,
+ eCSSKeyword_polygon = 407,
+ eCSSKeyword_portrait = 408,
+ eCSSKeyword_pre = 409,
+ eCSSKeyword_pre_wrap = 410,
+ eCSSKeyword_pre_line = 411,
+ eCSSKeyword_preserve_3d = 412,
+ eCSSKeyword_progress = 413,
+ eCSSKeyword_progressive = 414,
+ eCSSKeyword_proportional_nums = 415,
+ eCSSKeyword_proportional_width = 416,
+ eCSSKeyword_proximity = 417,
+ eCSSKeyword_pt = 418,
+ eCSSKeyword_px = 419,
+ eCSSKeyword_rad = 420,
+ eCSSKeyword_read_only = 421,
+ eCSSKeyword_read_write = 422,
+ eCSSKeyword_relative = 423,
+ eCSSKeyword_repeat = 424,
+ eCSSKeyword_repeat_x = 425,
+ eCSSKeyword_repeat_y = 426,
+ eCSSKeyword_reverse = 427,
+ eCSSKeyword_ridge = 428,
+ eCSSKeyword_right = 429,
+ eCSSKeyword_rl = 430,
+ eCSSKeyword_rl_tb = 431,
+ eCSSKeyword_rotate = 432,
+ eCSSKeyword_rotate3d = 433,
+ eCSSKeyword_rotatex = 434,
+ eCSSKeyword_rotatey = 435,
+ eCSSKeyword_rotatez = 436,
+ eCSSKeyword_round = 437,
+ eCSSKeyword_row = 438,
+ eCSSKeyword_row_resize = 439,
+ eCSSKeyword_row_reverse = 440,
+ eCSSKeyword_rtl = 441,
+ eCSSKeyword_ruby = 442,
+ eCSSKeyword_ruby_base = 443,
+ eCSSKeyword_ruby_base_container = 444,
+ eCSSKeyword_ruby_text = 445,
+ eCSSKeyword_ruby_text_container = 446,
+ eCSSKeyword_running = 447,
+ eCSSKeyword_s = 448,
+ eCSSKeyword_s_resize = 449,
+ eCSSKeyword_safe = 450,
+ eCSSKeyword_saturate = 451,
+ eCSSKeyword_saturation = 452,
+ eCSSKeyword_scale = 453,
+ eCSSKeyword_scale_down = 454,
+ eCSSKeyword_scale3d = 455,
+ eCSSKeyword_scalex = 456,
+ eCSSKeyword_scaley = 457,
+ eCSSKeyword_scalez = 458,
+ eCSSKeyword_screen = 459,
+ eCSSKeyword_script = 460,
+ eCSSKeyword_scroll = 461,
+ eCSSKeyword_scrollbar = 462,
+ eCSSKeyword_scrollbar_small = 463,
+ eCSSKeyword_scrollbar_horizontal = 464,
+ eCSSKeyword_scrollbar_vertical = 465,
+ eCSSKeyword_se_resize = 466,
+ eCSSKeyword_select_after = 467,
+ eCSSKeyword_select_all = 468,
+ eCSSKeyword_select_before = 469,
+ eCSSKeyword_select_menu = 470,
+ eCSSKeyword_select_same = 471,
+ eCSSKeyword_self_end = 472,
+ eCSSKeyword_self_start = 473,
+ eCSSKeyword_semi_condensed = 474,
+ eCSSKeyword_semi_expanded = 475,
+ eCSSKeyword_separate = 476,
+ eCSSKeyword_sepia = 477,
+ eCSSKeyword_serif = 478,
+ eCSSKeyword_sesame = 479,
+ eCSSKeyword_show = 480,
+ eCSSKeyword_sideways = 481,
+ eCSSKeyword_sideways_lr = 482,
+ eCSSKeyword_sideways_right = 483,
+ eCSSKeyword_sideways_rl = 484,
+ eCSSKeyword_simp_chinese_formal = 485,
+ eCSSKeyword_simp_chinese_informal = 486,
+ eCSSKeyword_simplified = 487,
+ eCSSKeyword_skew = 488,
+ eCSSKeyword_skewx = 489,
+ eCSSKeyword_skewy = 490,
+ eCSSKeyword_slashed_zero = 491,
+ eCSSKeyword_slice = 492,
+ eCSSKeyword_small = 493,
+ eCSSKeyword_small_caps = 494,
+ eCSSKeyword_small_caption = 495,
+ eCSSKeyword_smaller = 496,
+ eCSSKeyword_smooth = 497,
+ eCSSKeyword_soft = 498,
+ eCSSKeyword_soft_light = 499,
+ eCSSKeyword_solid = 500,
+ eCSSKeyword_space_around = 501,
+ eCSSKeyword_space_between = 502,
+ eCSSKeyword_space_evenly = 503,
+ eCSSKeyword_span = 504,
+ eCSSKeyword_spell_out = 505,
+ eCSSKeyword_square = 506,
+ eCSSKeyword_stacked_fractions = 507,
+ eCSSKeyword_start = 508,
+ eCSSKeyword_static = 509,
+ eCSSKeyword_standalone = 510,
+ eCSSKeyword_status_bar = 511,
+ eCSSKeyword_step_end = 512,
+ eCSSKeyword_step_start = 513,
+ eCSSKeyword_sticky = 514,
+ eCSSKeyword_stretch = 515,
+ eCSSKeyword_stretch_to_fit = 516,
+ eCSSKeyword_stretched = 517,
+ eCSSKeyword_strict = 518,
+ eCSSKeyword_stroke = 519,
+ eCSSKeyword_stroke_box = 520,
+ eCSSKeyword_style = 521,
+ eCSSKeyword_styleset = 522,
+ eCSSKeyword_stylistic = 523,
+ eCSSKeyword_sub = 524,
+ eCSSKeyword_subgrid = 525,
+ eCSSKeyword_subtract = 526,
+ eCSSKeyword_super = 527,
+ eCSSKeyword_sw_resize = 528,
+ eCSSKeyword_swash = 529,
+ eCSSKeyword_swap = 530,
+ eCSSKeyword_table = 531,
+ eCSSKeyword_table_caption = 532,
+ eCSSKeyword_table_cell = 533,
+ eCSSKeyword_table_column = 534,
+ eCSSKeyword_table_column_group = 535,
+ eCSSKeyword_table_footer_group = 536,
+ eCSSKeyword_table_header_group = 537,
+ eCSSKeyword_table_row = 538,
+ eCSSKeyword_table_row_group = 539,
+ eCSSKeyword_tabular_nums = 540,
+ eCSSKeyword_tailed = 541,
+ eCSSKeyword_tb = 542,
+ eCSSKeyword_tb_rl = 543,
+ eCSSKeyword_text = 544,
+ eCSSKeyword_text_bottom = 545,
+ eCSSKeyword_text_top = 546,
+ eCSSKeyword_thick = 547,
+ eCSSKeyword_thin = 548,
+ eCSSKeyword_threeddarkshadow = 549,
+ eCSSKeyword_threedface = 550,
+ eCSSKeyword_threedhighlight = 551,
+ eCSSKeyword_threedlightshadow = 552,
+ eCSSKeyword_threedshadow = 553,
+ eCSSKeyword_titling_caps = 554,
+ eCSSKeyword_toggle = 555,
+ eCSSKeyword_top = 556,
+ eCSSKeyword_top_outside = 557,
+ eCSSKeyword_trad_chinese_formal = 558,
+ eCSSKeyword_trad_chinese_informal = 559,
+ eCSSKeyword_traditional = 560,
+ eCSSKeyword_translate = 561,
+ eCSSKeyword_translate3d = 562,
+ eCSSKeyword_translatex = 563,
+ eCSSKeyword_translatey = 564,
+ eCSSKeyword_translatez = 565,
+ eCSSKeyword_transparent = 566,
+ eCSSKeyword_triangle = 567,
+ eCSSKeyword_tri_state = 568,
+ eCSSKeyword_ultra_condensed = 569,
+ eCSSKeyword_ultra_expanded = 570,
+ eCSSKeyword_under = 571,
+ eCSSKeyword_underline = 572,
+ eCSSKeyword_unicase = 573,
+ eCSSKeyword_unsafe = 574,
+ eCSSKeyword_unset = 575,
+ eCSSKeyword_uppercase = 576,
+ eCSSKeyword_upright = 577,
+ eCSSKeyword_vertical = 578,
+ eCSSKeyword_vertical_lr = 579,
+ eCSSKeyword_vertical_rl = 580,
+ eCSSKeyword_vertical_text = 581,
+ eCSSKeyword_view_box = 582,
+ eCSSKeyword_visible = 583,
+ eCSSKeyword_visiblefill = 584,
+ eCSSKeyword_visiblepainted = 585,
+ eCSSKeyword_visiblestroke = 586,
+ eCSSKeyword_w_resize = 587,
+ eCSSKeyword_wait = 588,
+ eCSSKeyword_wavy = 589,
+ eCSSKeyword_weight = 590,
+ eCSSKeyword_wider = 591,
+ eCSSKeyword_window = 592,
+ eCSSKeyword_windowframe = 593,
+ eCSSKeyword_windowtext = 594,
+ eCSSKeyword_words = 595,
+ eCSSKeyword_wrap = 596,
+ eCSSKeyword_wrap_reverse = 597,
+ eCSSKeyword_write_only = 598,
+ eCSSKeyword_x_large = 599,
+ eCSSKeyword_x_small = 600,
+ eCSSKeyword_xx_large = 601,
+ eCSSKeyword_xx_small = 602,
+ eCSSKeyword_zoom_in = 603,
+ eCSSKeyword_zoom_out = 604,
+ eCSSKeyword_radio = 605,
+ eCSSKeyword_checkbox = 606,
+ eCSSKeyword_button_bevel = 607,
+ eCSSKeyword_toolbox = 608,
+ eCSSKeyword_toolbar = 609,
+ eCSSKeyword_toolbarbutton = 610,
+ eCSSKeyword_toolbargripper = 611,
+ eCSSKeyword_dualbutton = 612,
+ eCSSKeyword_toolbarbutton_dropdown = 613,
+ eCSSKeyword_button_arrow_up = 614,
+ eCSSKeyword_button_arrow_down = 615,
+ eCSSKeyword_button_arrow_next = 616,
+ eCSSKeyword_button_arrow_previous = 617,
+ eCSSKeyword_separator = 618,
+ eCSSKeyword_splitter = 619,
+ eCSSKeyword_statusbar = 620,
+ eCSSKeyword_statusbarpanel = 621,
+ eCSSKeyword_resizerpanel = 622,
+ eCSSKeyword_resizer = 623,
+ eCSSKeyword_listbox = 624,
+ eCSSKeyword_listitem = 625,
+ eCSSKeyword_numbers = 626,
+ eCSSKeyword_number_input = 627,
+ eCSSKeyword_treeview = 628,
+ eCSSKeyword_treeitem = 629,
+ eCSSKeyword_treetwisty = 630,
+ eCSSKeyword_treetwistyopen = 631,
+ eCSSKeyword_treeline = 632,
+ eCSSKeyword_treeheader = 633,
+ eCSSKeyword_treeheadercell = 634,
+ eCSSKeyword_treeheadersortarrow = 635,
+ eCSSKeyword_progressbar = 636,
+ eCSSKeyword_progressbar_vertical = 637,
+ eCSSKeyword_progresschunk = 638,
+ eCSSKeyword_progresschunk_vertical = 639,
+ eCSSKeyword_tab = 640,
+ eCSSKeyword_tabpanels = 641,
+ eCSSKeyword_tabpanel = 642,
+ eCSSKeyword_tab_scroll_arrow_back = 643,
+ eCSSKeyword_tab_scroll_arrow_forward = 644,
+ eCSSKeyword_tooltip = 645,
+ eCSSKeyword_spinner = 646,
+ eCSSKeyword_spinner_upbutton = 647,
+ eCSSKeyword_spinner_downbutton = 648,
+ eCSSKeyword_spinner_textfield = 649,
+ eCSSKeyword_scrollbarbutton_up = 650,
+ eCSSKeyword_scrollbarbutton_down = 651,
+ eCSSKeyword_scrollbarbutton_left = 652,
+ eCSSKeyword_scrollbarbutton_right = 653,
+ eCSSKeyword_scrollbartrack_horizontal = 654,
+ eCSSKeyword_scrollbartrack_vertical = 655,
+ eCSSKeyword_scrollbarthumb_horizontal = 656,
+ eCSSKeyword_scrollbarthumb_vertical = 657,
+ eCSSKeyword_sheet = 658,
+ eCSSKeyword_textfield = 659,
+ eCSSKeyword_textfield_multiline = 660,
+ eCSSKeyword_caret = 661,
+ eCSSKeyword_searchfield = 662,
+ eCSSKeyword_menubar = 663,
+ eCSSKeyword_menupopup = 664,
+ eCSSKeyword_menuitem = 665,
+ eCSSKeyword_checkmenuitem = 666,
+ eCSSKeyword_radiomenuitem = 667,
+ eCSSKeyword_menucheckbox = 668,
+ eCSSKeyword_menuradio = 669,
+ eCSSKeyword_menuseparator = 670,
+ eCSSKeyword_menuarrow = 671,
+ eCSSKeyword_menuimage = 672,
+ eCSSKeyword_menuitemtext = 673,
+ eCSSKeyword_menulist = 674,
+ eCSSKeyword_menulist_button = 675,
+ eCSSKeyword_menulist_text = 676,
+ eCSSKeyword_menulist_textfield = 677,
+ eCSSKeyword_meterbar = 678,
+ eCSSKeyword_meterchunk = 679,
+ eCSSKeyword_minimal_ui = 680,
+ eCSSKeyword_range = 681,
+ eCSSKeyword_range_thumb = 682,
+ eCSSKeyword_sans_serif = 683,
+ eCSSKeyword_sans_serif_bold_italic = 684,
+ eCSSKeyword_sans_serif_italic = 685,
+ eCSSKeyword_scale_horizontal = 686,
+ eCSSKeyword_scale_vertical = 687,
+ eCSSKeyword_scalethumb_horizontal = 688,
+ eCSSKeyword_scalethumb_vertical = 689,
+ eCSSKeyword_scalethumbstart = 690,
+ eCSSKeyword_scalethumbend = 691,
+ eCSSKeyword_scalethumbtick = 692,
+ eCSSKeyword_groupbox = 693,
+ eCSSKeyword_checkbox_container = 694,
+ eCSSKeyword_radio_container = 695,
+ eCSSKeyword_checkbox_label = 696,
+ eCSSKeyword_radio_label = 697,
+ eCSSKeyword_button_focus = 698,
+ eCSSKeyword__moz_win_media_toolbox = 699,
+ eCSSKeyword__moz_win_communications_toolbox = 700,
+ eCSSKeyword__moz_win_browsertabbar_toolbox = 701,
+ eCSSKeyword__moz_win_mediatext = 702,
+ eCSSKeyword__moz_win_communicationstext = 703,
+ eCSSKeyword__moz_win_glass = 704,
+ eCSSKeyword__moz_win_borderless_glass = 705,
+ eCSSKeyword__moz_window_titlebar = 706,
+ eCSSKeyword__moz_window_titlebar_maximized = 707,
+ eCSSKeyword__moz_window_frame_left = 708,
+ eCSSKeyword__moz_window_frame_right = 709,
+ eCSSKeyword__moz_window_frame_bottom = 710,
+ eCSSKeyword__moz_window_button_close = 711,
+ eCSSKeyword__moz_window_button_minimize = 712,
+ eCSSKeyword__moz_window_button_maximize = 713,
+ eCSSKeyword__moz_window_button_restore = 714,
+ eCSSKeyword__moz_window_button_box = 715,
+ eCSSKeyword__moz_window_button_box_maximized = 716,
+ eCSSKeyword__moz_mac_help_button = 717,
+ eCSSKeyword__moz_win_exclude_glass = 718,
+ eCSSKeyword__moz_mac_vibrancy_light = 719,
+ eCSSKeyword__moz_mac_vibrancy_dark = 720,
+ eCSSKeyword__moz_mac_disclosure_button_closed = 721,
+ eCSSKeyword__moz_mac_disclosure_button_open = 722,
+ eCSSKeyword__moz_mac_source_list = 723,
+ eCSSKeyword__moz_mac_source_list_selection = 724,
+ eCSSKeyword__moz_mac_active_source_list_selection = 725,
+ eCSSKeyword_alphabetic = 726,
+ eCSSKeyword_bevel = 727,
+ eCSSKeyword_butt = 728,
+ eCSSKeyword_central = 729,
+ eCSSKeyword_crispedges = 730,
+ eCSSKeyword_evenodd = 731,
+ eCSSKeyword_geometricprecision = 732,
+ eCSSKeyword_hanging = 733,
+ eCSSKeyword_ideographic = 734,
+ eCSSKeyword_linearrgb = 735,
+ eCSSKeyword_mathematical = 736,
+ eCSSKeyword_miter = 737,
+ eCSSKeyword_no_change = 738,
+ eCSSKeyword_non_scaling_stroke = 739,
+ eCSSKeyword_nonzero = 740,
+ eCSSKeyword_optimizelegibility = 741,
+ eCSSKeyword_optimizequality = 742,
+ eCSSKeyword_optimizespeed = 743,
+ eCSSKeyword_reset_size = 744,
+ eCSSKeyword_srgb = 745,
+ eCSSKeyword_symbolic = 746,
+ eCSSKeyword_symbols = 747,
+ eCSSKeyword_text_after_edge = 748,
+ eCSSKeyword_text_before_edge = 749,
+ eCSSKeyword_use_script = 750,
+ eCSSKeyword__moz_crisp_edges = 751,
+ eCSSKeyword_space = 752,
+ eCSSKeyword_COUNT = 753,
+}
pub const nsCSSPropertyID_eCSSProperty_COUNT_DUMMY: nsCSSPropertyID =
nsCSSPropertyID::eCSSProperty_z_index;
pub const nsCSSPropertyID_eCSSProperty_all: nsCSSPropertyID =
@@ -9777,14 +10536,13 @@ fn bindgen_test_layout_nsCSSValueList_heap() {
#[repr(C)]
#[derive(Debug)]
pub struct nsCSSValueSharedList {
- pub mRefCnt: nsAutoRefCnt,
- pub _mOwningThread: nsAutoOwningThread,
+ pub mRefCnt: ThreadSafeAutoRefCnt,
pub mHead: *mut nsCSSValueList,
}
-pub type nsCSSValueSharedList_HasThreadSafeRefCnt = FalseType;
+pub type nsCSSValueSharedList_HasThreadSafeRefCnt = TrueType;
#[test]
fn bindgen_test_layout_nsCSSValueSharedList() {
- assert_eq!(::std::mem::size_of::<nsCSSValueSharedList>() , 24usize);
+ assert_eq!(::std::mem::size_of::<nsCSSValueSharedList>() , 16usize);
assert_eq!(::std::mem::align_of::<nsCSSValueSharedList>() , 8usize);
}
#[repr(C)]
diff --git a/components/style/gecko_bindings/structs_release.rs b/components/style/gecko_bindings/structs_release.rs
index 414bc984720..a9bdbbd4b3b 100644
--- a/components/style/gecko_bindings/structs_release.rs
+++ b/components/style/gecko_bindings/structs_release.rs
@@ -8736,6 +8736,765 @@ fn bindgen_test_layout_StyleComplexColor() {
impl Clone for StyleComplexColor {
fn clone(&self) -> Self { *self }
}
+#[repr(i16)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+pub enum nsCSSKeyword {
+ eCSSKeyword_UNKNOWN = -1,
+ eCSSKeyword__moz_activehyperlinktext = 0,
+ eCSSKeyword__moz_all = 1,
+ eCSSKeyword__moz_alt_content = 2,
+ eCSSKeyword__moz_anchor_decoration = 3,
+ eCSSKeyword__moz_available = 4,
+ eCSSKeyword__moz_box = 5,
+ eCSSKeyword__moz_button = 6,
+ eCSSKeyword__moz_buttondefault = 7,
+ eCSSKeyword__moz_buttonhoverface = 8,
+ eCSSKeyword__moz_buttonhovertext = 9,
+ eCSSKeyword__moz_cellhighlight = 10,
+ eCSSKeyword__moz_cellhighlighttext = 11,
+ eCSSKeyword__moz_center = 12,
+ eCSSKeyword__moz_combobox = 13,
+ eCSSKeyword__moz_comboboxtext = 14,
+ eCSSKeyword__moz_block_height = 15,
+ eCSSKeyword__moz_deck = 16,
+ eCSSKeyword__moz_default_background_color = 17,
+ eCSSKeyword__moz_default_color = 18,
+ eCSSKeyword__moz_desktop = 19,
+ eCSSKeyword__moz_dialog = 20,
+ eCSSKeyword__moz_dialogtext = 21,
+ eCSSKeyword__moz_document = 22,
+ eCSSKeyword__moz_dragtargetzone = 23,
+ eCSSKeyword__moz_element = 24,
+ eCSSKeyword__moz_eventreerow = 25,
+ eCSSKeyword__moz_field = 26,
+ eCSSKeyword__moz_fieldtext = 27,
+ eCSSKeyword__moz_fit_content = 28,
+ eCSSKeyword__moz_fixed = 29,
+ eCSSKeyword__moz_grabbing = 30,
+ eCSSKeyword__moz_grab = 31,
+ eCSSKeyword__moz_grid_group = 32,
+ eCSSKeyword__moz_grid_line = 33,
+ eCSSKeyword__moz_grid = 34,
+ eCSSKeyword__moz_groupbox = 35,
+ eCSSKeyword__moz_gtk_info_bar = 36,
+ eCSSKeyword__moz_gtk_info_bar_text = 37,
+ eCSSKeyword__moz_hidden_unscrollable = 38,
+ eCSSKeyword__moz_hyperlinktext = 39,
+ eCSSKeyword__moz_html_cellhighlight = 40,
+ eCSSKeyword__moz_html_cellhighlighttext = 41,
+ eCSSKeyword__moz_image_rect = 42,
+ eCSSKeyword__moz_info = 43,
+ eCSSKeyword__moz_inline_box = 44,
+ eCSSKeyword__moz_inline_grid = 45,
+ eCSSKeyword__moz_inline_stack = 46,
+ eCSSKeyword__moz_isolate = 47,
+ eCSSKeyword__moz_isolate_override = 48,
+ eCSSKeyword__moz_left = 49,
+ eCSSKeyword__moz_list = 50,
+ eCSSKeyword__moz_mac_buttonactivetext = 51,
+ eCSSKeyword__moz_mac_chrome_active = 52,
+ eCSSKeyword__moz_mac_chrome_inactive = 53,
+ eCSSKeyword__moz_mac_defaultbuttontext = 54,
+ eCSSKeyword__moz_mac_focusring = 55,
+ eCSSKeyword__moz_mac_fullscreen_button = 56,
+ eCSSKeyword__moz_mac_menuselect = 57,
+ eCSSKeyword__moz_mac_menushadow = 58,
+ eCSSKeyword__moz_mac_menutextdisable = 59,
+ eCSSKeyword__moz_mac_menutextselect = 60,
+ eCSSKeyword__moz_mac_disabledtoolbartext = 61,
+ eCSSKeyword__moz_mac_secondaryhighlight = 62,
+ eCSSKeyword__moz_max_content = 63,
+ eCSSKeyword__moz_menuhover = 64,
+ eCSSKeyword__moz_menuhovertext = 65,
+ eCSSKeyword__moz_menubartext = 66,
+ eCSSKeyword__moz_menubarhovertext = 67,
+ eCSSKeyword__moz_middle_with_baseline = 68,
+ eCSSKeyword__moz_min_content = 69,
+ eCSSKeyword__moz_nativehyperlinktext = 70,
+ eCSSKeyword__moz_none = 71,
+ eCSSKeyword__moz_oddtreerow = 72,
+ eCSSKeyword__moz_plaintext = 73,
+ eCSSKeyword__moz_popup = 74,
+ eCSSKeyword__moz_pre_space = 75,
+ eCSSKeyword__moz_pull_down_menu = 76,
+ eCSSKeyword__moz_right = 77,
+ eCSSKeyword__moz_scrollbars_horizontal = 78,
+ eCSSKeyword__moz_scrollbars_none = 79,
+ eCSSKeyword__moz_scrollbars_vertical = 80,
+ eCSSKeyword__moz_stack = 81,
+ eCSSKeyword__moz_text = 82,
+ eCSSKeyword__moz_use_system_font = 83,
+ eCSSKeyword__moz_visitedhyperlinktext = 84,
+ eCSSKeyword__moz_window = 85,
+ eCSSKeyword__moz_workspace = 86,
+ eCSSKeyword__moz_zoom_in = 87,
+ eCSSKeyword__moz_zoom_out = 88,
+ eCSSKeyword__webkit_box = 89,
+ eCSSKeyword__webkit_flex = 90,
+ eCSSKeyword__webkit_inline_box = 91,
+ eCSSKeyword__webkit_inline_flex = 92,
+ eCSSKeyword_absolute = 93,
+ eCSSKeyword_active = 94,
+ eCSSKeyword_activeborder = 95,
+ eCSSKeyword_activecaption = 96,
+ eCSSKeyword_add = 97,
+ eCSSKeyword_additive = 98,
+ eCSSKeyword_alias = 99,
+ eCSSKeyword_all = 100,
+ eCSSKeyword_all_petite_caps = 101,
+ eCSSKeyword_all_scroll = 102,
+ eCSSKeyword_all_small_caps = 103,
+ eCSSKeyword_alpha = 104,
+ eCSSKeyword_alternate = 105,
+ eCSSKeyword_alternate_reverse = 106,
+ eCSSKeyword_always = 107,
+ eCSSKeyword_annotation = 108,
+ eCSSKeyword_appworkspace = 109,
+ eCSSKeyword_auto = 110,
+ eCSSKeyword_auto_fill = 111,
+ eCSSKeyword_auto_fit = 112,
+ eCSSKeyword_auto_flow = 113,
+ eCSSKeyword_avoid = 114,
+ eCSSKeyword_background = 115,
+ eCSSKeyword_backwards = 116,
+ eCSSKeyword_balance = 117,
+ eCSSKeyword_baseline = 118,
+ eCSSKeyword_bidi_override = 119,
+ eCSSKeyword_blink = 120,
+ eCSSKeyword_block = 121,
+ eCSSKeyword_block_axis = 122,
+ eCSSKeyword_blur = 123,
+ eCSSKeyword_bold = 124,
+ eCSSKeyword_bold_fraktur = 125,
+ eCSSKeyword_bold_italic = 126,
+ eCSSKeyword_bold_sans_serif = 127,
+ eCSSKeyword_bold_script = 128,
+ eCSSKeyword_bolder = 129,
+ eCSSKeyword_border_box = 130,
+ eCSSKeyword_both = 131,
+ eCSSKeyword_bottom = 132,
+ eCSSKeyword_bottom_outside = 133,
+ eCSSKeyword_break_all = 134,
+ eCSSKeyword_break_word = 135,
+ eCSSKeyword_brightness = 136,
+ eCSSKeyword_browser = 137,
+ eCSSKeyword_bullets = 138,
+ eCSSKeyword_button = 139,
+ eCSSKeyword_buttonface = 140,
+ eCSSKeyword_buttonhighlight = 141,
+ eCSSKeyword_buttonshadow = 142,
+ eCSSKeyword_buttontext = 143,
+ eCSSKeyword_capitalize = 144,
+ eCSSKeyword_caption = 145,
+ eCSSKeyword_captiontext = 146,
+ eCSSKeyword_cell = 147,
+ eCSSKeyword_center = 148,
+ eCSSKeyword_ch = 149,
+ eCSSKeyword_character_variant = 150,
+ eCSSKeyword_circle = 151,
+ eCSSKeyword_cjk_decimal = 152,
+ eCSSKeyword_clip = 153,
+ eCSSKeyword_clone = 154,
+ eCSSKeyword_close_quote = 155,
+ eCSSKeyword_closest_corner = 156,
+ eCSSKeyword_closest_side = 157,
+ eCSSKeyword_cm = 158,
+ eCSSKeyword_col_resize = 159,
+ eCSSKeyword_collapse = 160,
+ eCSSKeyword_color = 161,
+ eCSSKeyword_color_burn = 162,
+ eCSSKeyword_color_dodge = 163,
+ eCSSKeyword_common_ligatures = 164,
+ eCSSKeyword_column = 165,
+ eCSSKeyword_column_reverse = 166,
+ eCSSKeyword_condensed = 167,
+ eCSSKeyword_contain = 168,
+ eCSSKeyword_content_box = 169,
+ eCSSKeyword_contents = 170,
+ eCSSKeyword_context_fill = 171,
+ eCSSKeyword_context_fill_opacity = 172,
+ eCSSKeyword_context_menu = 173,
+ eCSSKeyword_context_stroke = 174,
+ eCSSKeyword_context_stroke_opacity = 175,
+ eCSSKeyword_context_value = 176,
+ eCSSKeyword_continuous = 177,
+ eCSSKeyword_contrast = 178,
+ eCSSKeyword_copy = 179,
+ eCSSKeyword_contextual = 180,
+ eCSSKeyword_cover = 181,
+ eCSSKeyword_crop = 182,
+ eCSSKeyword_cross = 183,
+ eCSSKeyword_crosshair = 184,
+ eCSSKeyword_currentcolor = 185,
+ eCSSKeyword_cursive = 186,
+ eCSSKeyword_cyclic = 187,
+ eCSSKeyword_darken = 188,
+ eCSSKeyword_dashed = 189,
+ eCSSKeyword_dense = 190,
+ eCSSKeyword_decimal = 191,
+ eCSSKeyword_default = 192,
+ eCSSKeyword_deg = 193,
+ eCSSKeyword_diagonal_fractions = 194,
+ eCSSKeyword_dialog = 195,
+ eCSSKeyword_difference = 196,
+ eCSSKeyword_digits = 197,
+ eCSSKeyword_disabled = 198,
+ eCSSKeyword_disc = 199,
+ eCSSKeyword_disclosure_closed = 200,
+ eCSSKeyword_disclosure_open = 201,
+ eCSSKeyword_discretionary_ligatures = 202,
+ eCSSKeyword_dot = 203,
+ eCSSKeyword_dotted = 204,
+ eCSSKeyword_double = 205,
+ eCSSKeyword_double_circle = 206,
+ eCSSKeyword_double_struck = 207,
+ eCSSKeyword_drag = 208,
+ eCSSKeyword_drop_shadow = 209,
+ eCSSKeyword_e_resize = 210,
+ eCSSKeyword_ease = 211,
+ eCSSKeyword_ease_in = 212,
+ eCSSKeyword_ease_in_out = 213,
+ eCSSKeyword_ease_out = 214,
+ eCSSKeyword_economy = 215,
+ eCSSKeyword_element = 216,
+ eCSSKeyword_elements = 217,
+ eCSSKeyword_ellipse = 218,
+ eCSSKeyword_ellipsis = 219,
+ eCSSKeyword_em = 220,
+ eCSSKeyword_embed = 221,
+ eCSSKeyword_enabled = 222,
+ eCSSKeyword_end = 223,
+ eCSSKeyword_ethiopic_numeric = 224,
+ eCSSKeyword_ex = 225,
+ eCSSKeyword_exact = 226,
+ eCSSKeyword_exclude = 227,
+ eCSSKeyword_exclusion = 228,
+ eCSSKeyword_expanded = 229,
+ eCSSKeyword_extends = 230,
+ eCSSKeyword_extra_condensed = 231,
+ eCSSKeyword_extra_expanded = 232,
+ eCSSKeyword_ew_resize = 233,
+ eCSSKeyword_fallback = 234,
+ eCSSKeyword_fantasy = 235,
+ eCSSKeyword_farthest_side = 236,
+ eCSSKeyword_farthest_corner = 237,
+ eCSSKeyword_fill = 238,
+ eCSSKeyword_filled = 239,
+ eCSSKeyword_fill_box = 240,
+ eCSSKeyword_fit_content = 241,
+ eCSSKeyword_fixed = 242,
+ eCSSKeyword_flat = 243,
+ eCSSKeyword_flex = 244,
+ eCSSKeyword_flex_end = 245,
+ eCSSKeyword_flex_start = 246,
+ eCSSKeyword_flip = 247,
+ eCSSKeyword_forwards = 248,
+ eCSSKeyword_fraktur = 249,
+ eCSSKeyword_from_image = 250,
+ eCSSKeyword_full_width = 251,
+ eCSSKeyword_fullscreen = 252,
+ eCSSKeyword_grab = 253,
+ eCSSKeyword_grabbing = 254,
+ eCSSKeyword_grad = 255,
+ eCSSKeyword_grayscale = 256,
+ eCSSKeyword_graytext = 257,
+ eCSSKeyword_grid = 258,
+ eCSSKeyword_groove = 259,
+ eCSSKeyword_hard_light = 260,
+ eCSSKeyword_hebrew = 261,
+ eCSSKeyword_help = 262,
+ eCSSKeyword_hidden = 263,
+ eCSSKeyword_hide = 264,
+ eCSSKeyword_highlight = 265,
+ eCSSKeyword_highlighttext = 266,
+ eCSSKeyword_historical_forms = 267,
+ eCSSKeyword_historical_ligatures = 268,
+ eCSSKeyword_horizontal = 269,
+ eCSSKeyword_horizontal_tb = 270,
+ eCSSKeyword_hue = 271,
+ eCSSKeyword_hue_rotate = 272,
+ eCSSKeyword_hz = 273,
+ eCSSKeyword_icon = 274,
+ eCSSKeyword_ignore = 275,
+ eCSSKeyword_in = 276,
+ eCSSKeyword_interlace = 277,
+ eCSSKeyword_inactive = 278,
+ eCSSKeyword_inactiveborder = 279,
+ eCSSKeyword_inactivecaption = 280,
+ eCSSKeyword_inactivecaptiontext = 281,
+ eCSSKeyword_infinite = 282,
+ eCSSKeyword_infobackground = 283,
+ eCSSKeyword_infotext = 284,
+ eCSSKeyword_inherit = 285,
+ eCSSKeyword_initial = 286,
+ eCSSKeyword_inline = 287,
+ eCSSKeyword_inline_axis = 288,
+ eCSSKeyword_inline_block = 289,
+ eCSSKeyword_inline_end = 290,
+ eCSSKeyword_inline_flex = 291,
+ eCSSKeyword_inline_grid = 292,
+ eCSSKeyword_inline_start = 293,
+ eCSSKeyword_inline_table = 294,
+ eCSSKeyword_inset = 295,
+ eCSSKeyword_inside = 296,
+ eCSSKeyword_interpolatematrix = 297,
+ eCSSKeyword_intersect = 298,
+ eCSSKeyword_isolate = 299,
+ eCSSKeyword_isolate_override = 300,
+ eCSSKeyword_invert = 301,
+ eCSSKeyword_italic = 302,
+ eCSSKeyword_japanese_formal = 303,
+ eCSSKeyword_japanese_informal = 304,
+ eCSSKeyword_jis78 = 305,
+ eCSSKeyword_jis83 = 306,
+ eCSSKeyword_jis90 = 307,
+ eCSSKeyword_jis04 = 308,
+ eCSSKeyword_justify = 309,
+ eCSSKeyword_keep_all = 310,
+ eCSSKeyword_khz = 311,
+ eCSSKeyword_korean_hangul_formal = 312,
+ eCSSKeyword_korean_hanja_formal = 313,
+ eCSSKeyword_korean_hanja_informal = 314,
+ eCSSKeyword_landscape = 315,
+ eCSSKeyword_large = 316,
+ eCSSKeyword_larger = 317,
+ eCSSKeyword_layout = 318,
+ eCSSKeyword_last_baseline = 319,
+ eCSSKeyword_left = 320,
+ eCSSKeyword_legacy = 321,
+ eCSSKeyword_lighten = 322,
+ eCSSKeyword_lighter = 323,
+ eCSSKeyword_line_through = 324,
+ eCSSKeyword_linear = 325,
+ eCSSKeyword_lining_nums = 326,
+ eCSSKeyword_list_item = 327,
+ eCSSKeyword_local = 328,
+ eCSSKeyword_logical = 329,
+ eCSSKeyword_looped = 330,
+ eCSSKeyword_lowercase = 331,
+ eCSSKeyword_lr = 332,
+ eCSSKeyword_lr_tb = 333,
+ eCSSKeyword_ltr = 334,
+ eCSSKeyword_luminance = 335,
+ eCSSKeyword_luminosity = 336,
+ eCSSKeyword_mandatory = 337,
+ eCSSKeyword_manipulation = 338,
+ eCSSKeyword_manual = 339,
+ eCSSKeyword_margin_box = 340,
+ eCSSKeyword_markers = 341,
+ eCSSKeyword_match_parent = 342,
+ eCSSKeyword_match_source = 343,
+ eCSSKeyword_matrix = 344,
+ eCSSKeyword_matrix3d = 345,
+ eCSSKeyword_max_content = 346,
+ eCSSKeyword_medium = 347,
+ eCSSKeyword_menu = 348,
+ eCSSKeyword_menutext = 349,
+ eCSSKeyword_message_box = 350,
+ eCSSKeyword_middle = 351,
+ eCSSKeyword_min_content = 352,
+ eCSSKeyword_minmax = 353,
+ eCSSKeyword_mix = 354,
+ eCSSKeyword_mixed = 355,
+ eCSSKeyword_mm = 356,
+ eCSSKeyword_monospace = 357,
+ eCSSKeyword_move = 358,
+ eCSSKeyword_ms = 359,
+ eCSSKeyword_multiply = 360,
+ eCSSKeyword_n_resize = 361,
+ eCSSKeyword_narrower = 362,
+ eCSSKeyword_ne_resize = 363,
+ eCSSKeyword_nesw_resize = 364,
+ eCSSKeyword_no_close_quote = 365,
+ eCSSKeyword_no_common_ligatures = 366,
+ eCSSKeyword_no_contextual = 367,
+ eCSSKeyword_no_discretionary_ligatures = 368,
+ eCSSKeyword_no_drag = 369,
+ eCSSKeyword_no_drop = 370,
+ eCSSKeyword_no_historical_ligatures = 371,
+ eCSSKeyword_no_open_quote = 372,
+ eCSSKeyword_no_repeat = 373,
+ eCSSKeyword_none = 374,
+ eCSSKeyword_normal = 375,
+ eCSSKeyword_not_allowed = 376,
+ eCSSKeyword_nowrap = 377,
+ eCSSKeyword_numeric = 378,
+ eCSSKeyword_ns_resize = 379,
+ eCSSKeyword_nw_resize = 380,
+ eCSSKeyword_nwse_resize = 381,
+ eCSSKeyword_oblique = 382,
+ eCSSKeyword_oldstyle_nums = 383,
+ eCSSKeyword_opacity = 384,
+ eCSSKeyword_open = 385,
+ eCSSKeyword_open_quote = 386,
+ eCSSKeyword_optional = 387,
+ eCSSKeyword_ordinal = 388,
+ eCSSKeyword_ornaments = 389,
+ eCSSKeyword_outset = 390,
+ eCSSKeyword_outside = 391,
+ eCSSKeyword_over = 392,
+ eCSSKeyword_overlay = 393,
+ eCSSKeyword_overline = 394,
+ eCSSKeyword_paint = 395,
+ eCSSKeyword_padding_box = 396,
+ eCSSKeyword_painted = 397,
+ eCSSKeyword_pan_x = 398,
+ eCSSKeyword_pan_y = 399,
+ eCSSKeyword_paused = 400,
+ eCSSKeyword_pc = 401,
+ eCSSKeyword_perspective = 402,
+ eCSSKeyword_petite_caps = 403,
+ eCSSKeyword_physical = 404,
+ eCSSKeyword_plaintext = 405,
+ eCSSKeyword_pointer = 406,
+ eCSSKeyword_polygon = 407,
+ eCSSKeyword_portrait = 408,
+ eCSSKeyword_pre = 409,
+ eCSSKeyword_pre_wrap = 410,
+ eCSSKeyword_pre_line = 411,
+ eCSSKeyword_preserve_3d = 412,
+ eCSSKeyword_progress = 413,
+ eCSSKeyword_progressive = 414,
+ eCSSKeyword_proportional_nums = 415,
+ eCSSKeyword_proportional_width = 416,
+ eCSSKeyword_proximity = 417,
+ eCSSKeyword_pt = 418,
+ eCSSKeyword_px = 419,
+ eCSSKeyword_rad = 420,
+ eCSSKeyword_read_only = 421,
+ eCSSKeyword_read_write = 422,
+ eCSSKeyword_relative = 423,
+ eCSSKeyword_repeat = 424,
+ eCSSKeyword_repeat_x = 425,
+ eCSSKeyword_repeat_y = 426,
+ eCSSKeyword_reverse = 427,
+ eCSSKeyword_ridge = 428,
+ eCSSKeyword_right = 429,
+ eCSSKeyword_rl = 430,
+ eCSSKeyword_rl_tb = 431,
+ eCSSKeyword_rotate = 432,
+ eCSSKeyword_rotate3d = 433,
+ eCSSKeyword_rotatex = 434,
+ eCSSKeyword_rotatey = 435,
+ eCSSKeyword_rotatez = 436,
+ eCSSKeyword_round = 437,
+ eCSSKeyword_row = 438,
+ eCSSKeyword_row_resize = 439,
+ eCSSKeyword_row_reverse = 440,
+ eCSSKeyword_rtl = 441,
+ eCSSKeyword_ruby = 442,
+ eCSSKeyword_ruby_base = 443,
+ eCSSKeyword_ruby_base_container = 444,
+ eCSSKeyword_ruby_text = 445,
+ eCSSKeyword_ruby_text_container = 446,
+ eCSSKeyword_running = 447,
+ eCSSKeyword_s = 448,
+ eCSSKeyword_s_resize = 449,
+ eCSSKeyword_safe = 450,
+ eCSSKeyword_saturate = 451,
+ eCSSKeyword_saturation = 452,
+ eCSSKeyword_scale = 453,
+ eCSSKeyword_scale_down = 454,
+ eCSSKeyword_scale3d = 455,
+ eCSSKeyword_scalex = 456,
+ eCSSKeyword_scaley = 457,
+ eCSSKeyword_scalez = 458,
+ eCSSKeyword_screen = 459,
+ eCSSKeyword_script = 460,
+ eCSSKeyword_scroll = 461,
+ eCSSKeyword_scrollbar = 462,
+ eCSSKeyword_scrollbar_small = 463,
+ eCSSKeyword_scrollbar_horizontal = 464,
+ eCSSKeyword_scrollbar_vertical = 465,
+ eCSSKeyword_se_resize = 466,
+ eCSSKeyword_select_after = 467,
+ eCSSKeyword_select_all = 468,
+ eCSSKeyword_select_before = 469,
+ eCSSKeyword_select_menu = 470,
+ eCSSKeyword_select_same = 471,
+ eCSSKeyword_self_end = 472,
+ eCSSKeyword_self_start = 473,
+ eCSSKeyword_semi_condensed = 474,
+ eCSSKeyword_semi_expanded = 475,
+ eCSSKeyword_separate = 476,
+ eCSSKeyword_sepia = 477,
+ eCSSKeyword_serif = 478,
+ eCSSKeyword_sesame = 479,
+ eCSSKeyword_show = 480,
+ eCSSKeyword_sideways = 481,
+ eCSSKeyword_sideways_lr = 482,
+ eCSSKeyword_sideways_right = 483,
+ eCSSKeyword_sideways_rl = 484,
+ eCSSKeyword_simp_chinese_formal = 485,
+ eCSSKeyword_simp_chinese_informal = 486,
+ eCSSKeyword_simplified = 487,
+ eCSSKeyword_skew = 488,
+ eCSSKeyword_skewx = 489,
+ eCSSKeyword_skewy = 490,
+ eCSSKeyword_slashed_zero = 491,
+ eCSSKeyword_slice = 492,
+ eCSSKeyword_small = 493,
+ eCSSKeyword_small_caps = 494,
+ eCSSKeyword_small_caption = 495,
+ eCSSKeyword_smaller = 496,
+ eCSSKeyword_smooth = 497,
+ eCSSKeyword_soft = 498,
+ eCSSKeyword_soft_light = 499,
+ eCSSKeyword_solid = 500,
+ eCSSKeyword_space_around = 501,
+ eCSSKeyword_space_between = 502,
+ eCSSKeyword_space_evenly = 503,
+ eCSSKeyword_span = 504,
+ eCSSKeyword_spell_out = 505,
+ eCSSKeyword_square = 506,
+ eCSSKeyword_stacked_fractions = 507,
+ eCSSKeyword_start = 508,
+ eCSSKeyword_static = 509,
+ eCSSKeyword_standalone = 510,
+ eCSSKeyword_status_bar = 511,
+ eCSSKeyword_step_end = 512,
+ eCSSKeyword_step_start = 513,
+ eCSSKeyword_sticky = 514,
+ eCSSKeyword_stretch = 515,
+ eCSSKeyword_stretch_to_fit = 516,
+ eCSSKeyword_stretched = 517,
+ eCSSKeyword_strict = 518,
+ eCSSKeyword_stroke = 519,
+ eCSSKeyword_stroke_box = 520,
+ eCSSKeyword_style = 521,
+ eCSSKeyword_styleset = 522,
+ eCSSKeyword_stylistic = 523,
+ eCSSKeyword_sub = 524,
+ eCSSKeyword_subgrid = 525,
+ eCSSKeyword_subtract = 526,
+ eCSSKeyword_super = 527,
+ eCSSKeyword_sw_resize = 528,
+ eCSSKeyword_swash = 529,
+ eCSSKeyword_swap = 530,
+ eCSSKeyword_table = 531,
+ eCSSKeyword_table_caption = 532,
+ eCSSKeyword_table_cell = 533,
+ eCSSKeyword_table_column = 534,
+ eCSSKeyword_table_column_group = 535,
+ eCSSKeyword_table_footer_group = 536,
+ eCSSKeyword_table_header_group = 537,
+ eCSSKeyword_table_row = 538,
+ eCSSKeyword_table_row_group = 539,
+ eCSSKeyword_tabular_nums = 540,
+ eCSSKeyword_tailed = 541,
+ eCSSKeyword_tb = 542,
+ eCSSKeyword_tb_rl = 543,
+ eCSSKeyword_text = 544,
+ eCSSKeyword_text_bottom = 545,
+ eCSSKeyword_text_top = 546,
+ eCSSKeyword_thick = 547,
+ eCSSKeyword_thin = 548,
+ eCSSKeyword_threeddarkshadow = 549,
+ eCSSKeyword_threedface = 550,
+ eCSSKeyword_threedhighlight = 551,
+ eCSSKeyword_threedlightshadow = 552,
+ eCSSKeyword_threedshadow = 553,
+ eCSSKeyword_titling_caps = 554,
+ eCSSKeyword_toggle = 555,
+ eCSSKeyword_top = 556,
+ eCSSKeyword_top_outside = 557,
+ eCSSKeyword_trad_chinese_formal = 558,
+ eCSSKeyword_trad_chinese_informal = 559,
+ eCSSKeyword_traditional = 560,
+ eCSSKeyword_translate = 561,
+ eCSSKeyword_translate3d = 562,
+ eCSSKeyword_translatex = 563,
+ eCSSKeyword_translatey = 564,
+ eCSSKeyword_translatez = 565,
+ eCSSKeyword_transparent = 566,
+ eCSSKeyword_triangle = 567,
+ eCSSKeyword_tri_state = 568,
+ eCSSKeyword_ultra_condensed = 569,
+ eCSSKeyword_ultra_expanded = 570,
+ eCSSKeyword_under = 571,
+ eCSSKeyword_underline = 572,
+ eCSSKeyword_unicase = 573,
+ eCSSKeyword_unsafe = 574,
+ eCSSKeyword_unset = 575,
+ eCSSKeyword_uppercase = 576,
+ eCSSKeyword_upright = 577,
+ eCSSKeyword_vertical = 578,
+ eCSSKeyword_vertical_lr = 579,
+ eCSSKeyword_vertical_rl = 580,
+ eCSSKeyword_vertical_text = 581,
+ eCSSKeyword_view_box = 582,
+ eCSSKeyword_visible = 583,
+ eCSSKeyword_visiblefill = 584,
+ eCSSKeyword_visiblepainted = 585,
+ eCSSKeyword_visiblestroke = 586,
+ eCSSKeyword_w_resize = 587,
+ eCSSKeyword_wait = 588,
+ eCSSKeyword_wavy = 589,
+ eCSSKeyword_weight = 590,
+ eCSSKeyword_wider = 591,
+ eCSSKeyword_window = 592,
+ eCSSKeyword_windowframe = 593,
+ eCSSKeyword_windowtext = 594,
+ eCSSKeyword_words = 595,
+ eCSSKeyword_wrap = 596,
+ eCSSKeyword_wrap_reverse = 597,
+ eCSSKeyword_write_only = 598,
+ eCSSKeyword_x_large = 599,
+ eCSSKeyword_x_small = 600,
+ eCSSKeyword_xx_large = 601,
+ eCSSKeyword_xx_small = 602,
+ eCSSKeyword_zoom_in = 603,
+ eCSSKeyword_zoom_out = 604,
+ eCSSKeyword_radio = 605,
+ eCSSKeyword_checkbox = 606,
+ eCSSKeyword_button_bevel = 607,
+ eCSSKeyword_toolbox = 608,
+ eCSSKeyword_toolbar = 609,
+ eCSSKeyword_toolbarbutton = 610,
+ eCSSKeyword_toolbargripper = 611,
+ eCSSKeyword_dualbutton = 612,
+ eCSSKeyword_toolbarbutton_dropdown = 613,
+ eCSSKeyword_button_arrow_up = 614,
+ eCSSKeyword_button_arrow_down = 615,
+ eCSSKeyword_button_arrow_next = 616,
+ eCSSKeyword_button_arrow_previous = 617,
+ eCSSKeyword_separator = 618,
+ eCSSKeyword_splitter = 619,
+ eCSSKeyword_statusbar = 620,
+ eCSSKeyword_statusbarpanel = 621,
+ eCSSKeyword_resizerpanel = 622,
+ eCSSKeyword_resizer = 623,
+ eCSSKeyword_listbox = 624,
+ eCSSKeyword_listitem = 625,
+ eCSSKeyword_numbers = 626,
+ eCSSKeyword_number_input = 627,
+ eCSSKeyword_treeview = 628,
+ eCSSKeyword_treeitem = 629,
+ eCSSKeyword_treetwisty = 630,
+ eCSSKeyword_treetwistyopen = 631,
+ eCSSKeyword_treeline = 632,
+ eCSSKeyword_treeheader = 633,
+ eCSSKeyword_treeheadercell = 634,
+ eCSSKeyword_treeheadersortarrow = 635,
+ eCSSKeyword_progressbar = 636,
+ eCSSKeyword_progressbar_vertical = 637,
+ eCSSKeyword_progresschunk = 638,
+ eCSSKeyword_progresschunk_vertical = 639,
+ eCSSKeyword_tab = 640,
+ eCSSKeyword_tabpanels = 641,
+ eCSSKeyword_tabpanel = 642,
+ eCSSKeyword_tab_scroll_arrow_back = 643,
+ eCSSKeyword_tab_scroll_arrow_forward = 644,
+ eCSSKeyword_tooltip = 645,
+ eCSSKeyword_spinner = 646,
+ eCSSKeyword_spinner_upbutton = 647,
+ eCSSKeyword_spinner_downbutton = 648,
+ eCSSKeyword_spinner_textfield = 649,
+ eCSSKeyword_scrollbarbutton_up = 650,
+ eCSSKeyword_scrollbarbutton_down = 651,
+ eCSSKeyword_scrollbarbutton_left = 652,
+ eCSSKeyword_scrollbarbutton_right = 653,
+ eCSSKeyword_scrollbartrack_horizontal = 654,
+ eCSSKeyword_scrollbartrack_vertical = 655,
+ eCSSKeyword_scrollbarthumb_horizontal = 656,
+ eCSSKeyword_scrollbarthumb_vertical = 657,
+ eCSSKeyword_sheet = 658,
+ eCSSKeyword_textfield = 659,
+ eCSSKeyword_textfield_multiline = 660,
+ eCSSKeyword_caret = 661,
+ eCSSKeyword_searchfield = 662,
+ eCSSKeyword_menubar = 663,
+ eCSSKeyword_menupopup = 664,
+ eCSSKeyword_menuitem = 665,
+ eCSSKeyword_checkmenuitem = 666,
+ eCSSKeyword_radiomenuitem = 667,
+ eCSSKeyword_menucheckbox = 668,
+ eCSSKeyword_menuradio = 669,
+ eCSSKeyword_menuseparator = 670,
+ eCSSKeyword_menuarrow = 671,
+ eCSSKeyword_menuimage = 672,
+ eCSSKeyword_menuitemtext = 673,
+ eCSSKeyword_menulist = 674,
+ eCSSKeyword_menulist_button = 675,
+ eCSSKeyword_menulist_text = 676,
+ eCSSKeyword_menulist_textfield = 677,
+ eCSSKeyword_meterbar = 678,
+ eCSSKeyword_meterchunk = 679,
+ eCSSKeyword_minimal_ui = 680,
+ eCSSKeyword_range = 681,
+ eCSSKeyword_range_thumb = 682,
+ eCSSKeyword_sans_serif = 683,
+ eCSSKeyword_sans_serif_bold_italic = 684,
+ eCSSKeyword_sans_serif_italic = 685,
+ eCSSKeyword_scale_horizontal = 686,
+ eCSSKeyword_scale_vertical = 687,
+ eCSSKeyword_scalethumb_horizontal = 688,
+ eCSSKeyword_scalethumb_vertical = 689,
+ eCSSKeyword_scalethumbstart = 690,
+ eCSSKeyword_scalethumbend = 691,
+ eCSSKeyword_scalethumbtick = 692,
+ eCSSKeyword_groupbox = 693,
+ eCSSKeyword_checkbox_container = 694,
+ eCSSKeyword_radio_container = 695,
+ eCSSKeyword_checkbox_label = 696,
+ eCSSKeyword_radio_label = 697,
+ eCSSKeyword_button_focus = 698,
+ eCSSKeyword__moz_win_media_toolbox = 699,
+ eCSSKeyword__moz_win_communications_toolbox = 700,
+ eCSSKeyword__moz_win_browsertabbar_toolbox = 701,
+ eCSSKeyword__moz_win_mediatext = 702,
+ eCSSKeyword__moz_win_communicationstext = 703,
+ eCSSKeyword__moz_win_glass = 704,
+ eCSSKeyword__moz_win_borderless_glass = 705,
+ eCSSKeyword__moz_window_titlebar = 706,
+ eCSSKeyword__moz_window_titlebar_maximized = 707,
+ eCSSKeyword__moz_window_frame_left = 708,
+ eCSSKeyword__moz_window_frame_right = 709,
+ eCSSKeyword__moz_window_frame_bottom = 710,
+ eCSSKeyword__moz_window_button_close = 711,
+ eCSSKeyword__moz_window_button_minimize = 712,
+ eCSSKeyword__moz_window_button_maximize = 713,
+ eCSSKeyword__moz_window_button_restore = 714,
+ eCSSKeyword__moz_window_button_box = 715,
+ eCSSKeyword__moz_window_button_box_maximized = 716,
+ eCSSKeyword__moz_mac_help_button = 717,
+ eCSSKeyword__moz_win_exclude_glass = 718,
+ eCSSKeyword__moz_mac_vibrancy_light = 719,
+ eCSSKeyword__moz_mac_vibrancy_dark = 720,
+ eCSSKeyword__moz_mac_disclosure_button_closed = 721,
+ eCSSKeyword__moz_mac_disclosure_button_open = 722,
+ eCSSKeyword__moz_mac_source_list = 723,
+ eCSSKeyword__moz_mac_source_list_selection = 724,
+ eCSSKeyword__moz_mac_active_source_list_selection = 725,
+ eCSSKeyword_alphabetic = 726,
+ eCSSKeyword_bevel = 727,
+ eCSSKeyword_butt = 728,
+ eCSSKeyword_central = 729,
+ eCSSKeyword_crispedges = 730,
+ eCSSKeyword_evenodd = 731,
+ eCSSKeyword_geometricprecision = 732,
+ eCSSKeyword_hanging = 733,
+ eCSSKeyword_ideographic = 734,
+ eCSSKeyword_linearrgb = 735,
+ eCSSKeyword_mathematical = 736,
+ eCSSKeyword_miter = 737,
+ eCSSKeyword_no_change = 738,
+ eCSSKeyword_non_scaling_stroke = 739,
+ eCSSKeyword_nonzero = 740,
+ eCSSKeyword_optimizelegibility = 741,
+ eCSSKeyword_optimizequality = 742,
+ eCSSKeyword_optimizespeed = 743,
+ eCSSKeyword_reset_size = 744,
+ eCSSKeyword_srgb = 745,
+ eCSSKeyword_symbolic = 746,
+ eCSSKeyword_symbols = 747,
+ eCSSKeyword_text_after_edge = 748,
+ eCSSKeyword_text_before_edge = 749,
+ eCSSKeyword_use_script = 750,
+ eCSSKeyword__moz_crisp_edges = 751,
+ eCSSKeyword_space = 752,
+ eCSSKeyword_COUNT = 753,
+}
pub const nsCSSPropertyID_eCSSProperty_COUNT_DUMMY: nsCSSPropertyID =
nsCSSPropertyID::eCSSProperty_z_index;
pub const nsCSSPropertyID_eCSSProperty_all: nsCSSPropertyID =
@@ -9734,14 +10493,13 @@ fn bindgen_test_layout_nsCSSValueList_heap() {
#[repr(C)]
#[derive(Debug)]
pub struct nsCSSValueSharedList {
- pub mRefCnt: nsAutoRefCnt,
- pub _mOwningThread: nsAutoOwningThread,
+ pub mRefCnt: ThreadSafeAutoRefCnt,
pub mHead: *mut nsCSSValueList,
}
-pub type nsCSSValueSharedList_HasThreadSafeRefCnt = FalseType;
+pub type nsCSSValueSharedList_HasThreadSafeRefCnt = TrueType;
#[test]
fn bindgen_test_layout_nsCSSValueSharedList() {
- assert_eq!(::std::mem::size_of::<nsCSSValueSharedList>() , 24usize);
+ assert_eq!(::std::mem::size_of::<nsCSSValueSharedList>() , 16usize);
assert_eq!(::std::mem::align_of::<nsCSSValueSharedList>() , 8usize);
}
#[repr(C)]
diff --git a/components/style/gecko_bindings/sugar/refptr.rs b/components/style/gecko_bindings/sugar/refptr.rs
index 9c7dcfddc63..ac94bb4bbec 100644
--- a/components/style/gecko_bindings/sugar/refptr.rs
+++ b/components/style/gecko_bindings/sugar/refptr.rs
@@ -156,13 +156,21 @@ impl<T: RefCounted> structs::RefPtr<T> {
///
/// Both `self` and `other` must be valid, but can be null
pub unsafe fn set(&mut self, other: &Self) {
+ self.clear();
+ if !other.mRawPtr.is_null() {
+ *self = other.to_safe().forget();
+ }
+ }
+
+ /// Clear an instance of the structs::RefPtr<T>, by releasing
+ /// it and setting its contents to null
+ ///
+ /// `self` must be valid, but can be null
+ pub unsafe fn clear(&mut self) {
if !self.mRawPtr.is_null() {
(*self.mRawPtr).release();
self.mRawPtr = ptr::null_mut();
}
- if !other.mRawPtr.is_null() {
- *self = other.to_safe().forget();
- }
}
/// Replace a `structs::RefPtr<T>` with a `RefPtr<T>`,
@@ -233,5 +241,8 @@ impl_threadsafe_refcount!(::gecko_bindings::bindings::ThreadSafeURIHolder,
impl_threadsafe_refcount!(::gecko_bindings::structs::nsStyleQuoteValues,
Gecko_AddRefQuoteValuesArbitraryThread,
Gecko_ReleaseQuoteValuesArbitraryThread);
+impl_threadsafe_refcount!(::gecko_bindings::structs::nsCSSValueSharedList,
+ Gecko_AddRefCSSValueSharedListArbitraryThread,
+ Gecko_ReleaseCSSValueSharedListArbitraryThread);
pub type GeckoArcPrincipal = RefPtr<::gecko_bindings::bindings::ThreadSafePrincipalHolder>;
pub type GeckoArcURI = RefPtr<::gecko_bindings::bindings::ThreadSafeURIHolder>;
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs
index f1ecd7ffd13..a95822e7581 100644
--- a/components/style/properties/gecko.mako.rs
+++ b/components/style/properties/gecko.mako.rs
@@ -11,6 +11,7 @@
use app_units::Au;
use custom_properties::ComputedValuesMap;
+use gecko_bindings::bindings;
% for style_struct in data.style_structs:
use gecko_bindings::structs::${style_struct.gecko_ffi_name};
use gecko_bindings::bindings::Gecko_Construct_${style_struct.gecko_ffi_name};
@@ -961,7 +962,7 @@ fn static_assert() {
<% skip_box_longhands= """display overflow-y vertical-align
-moz-binding page-break-before page-break-after
- scroll-snap-points-x scroll-snap-points-y""" %>
+ scroll-snap-points-x scroll-snap-points-y transform""" %>
<%self:impl_trait style_struct_name="Box" skip_longhands="${skip_box_longhands}">
// We manually-implement the |display| property until we get general
@@ -1107,6 +1108,102 @@ fn static_assert() {
${impl_coord_copy('scroll_snap_points_y', 'mScrollSnapPointsY')}
+ <%def name="transform_function_arm(name, keyword, items)">
+ <%
+ pattern = None
+ if name == "matrix":
+ # m11, m12, m13, ..
+ indices = [str(i) + str(j) for i in range(1, 5) for j in range(1, 5)]
+ # m11: number1, m12: number2, ..
+ single_patterns = ["m%s: number%s" % (index, i + 1) for (i, index) in enumerate(indices)]
+ pattern = "ComputedMatrix { %s }" % ", ".join(single_patterns)
+ else:
+ # Generate contents of pattern from items
+ pattern = ", ".join([b + str(a+1) for (a,b) in enumerate(items)])
+
+ # First %s substituted with the call to GetArrayItem, the second
+ # %s substituted with the corresponding variable
+ css_value_setters = {
+ "length" : "bindings::Gecko_CSSValue_SetAbsoluteLength(%s, %s.0)",
+ "percentage" : "bindings::Gecko_CSSValue_SetPercentage(%s, %s)",
+ "lop" : "set_lop(%s, %s)",
+ "angle" : "bindings::Gecko_CSSValue_SetAngle(%s, %s.0)",
+ "number" : "bindings::Gecko_CSSValue_SetNumber(%s, %s)",
+ }
+ %>
+ ComputedOperation::${name.title()}(${pattern}) => {
+ bindings::Gecko_CSSValue_SetFunction(gecko_value, ${len(items) + 1});
+ bindings::Gecko_CSSValue_SetKeyword(
+ bindings::Gecko_CSSValue_GetArrayItem(gecko_value, 0),
+ eCSSKeyword_${keyword}
+ );
+ % for index, item in enumerate(items):
+ ${css_value_setters[item] % (
+ "bindings::Gecko_CSSValue_GetArrayItem(gecko_value, %d)" % (index + 1),
+ item + str(index + 1)
+ )};
+ % endfor
+ }
+ </%def>
+ pub fn set_transform(&mut self, other: longhands::transform::computed_value::T) {
+ use gecko_bindings::structs::nsCSSKeyword::*;
+ use gecko_bindings::sugar::refptr::RefPtr;
+ use properties::longhands::transform::computed_value::ComputedMatrix;
+ use properties::longhands::transform::computed_value::ComputedOperation;
+ use values::computed::LengthOrPercentage;
+
+ unsafe fn set_lop(value: &mut structs::nsCSSValue, lop: LengthOrPercentage) {
+ match lop {
+ LengthOrPercentage::Length(au) => {
+ bindings::Gecko_CSSValue_SetAbsoluteLength(value, au.0)
+ }
+ LengthOrPercentage::Percentage(pc) => {
+ bindings::Gecko_CSSValue_SetPercentage(value, pc)
+ }
+ LengthOrPercentage::Calc(calc) => {
+ bindings::Gecko_CSSValue_SetCalc(value, calc.into())
+ }
+ }
+ }
+
+ let vec = if let Some(v) = other.0 {
+ v
+ } else {
+ unsafe {
+ self.gecko.mSpecifiedTransform.clear();
+ }
+ return;
+ };
+
+ let list = unsafe {
+ RefPtr::from_addrefed(bindings::Gecko_NewCSSValueSharedList(vec.len() as u32))
+ };
+
+ let mut cur = list.mHead;
+ let mut iter = vec.into_iter();
+ while !cur.is_null() {
+ let gecko_value = unsafe { &mut (*cur).mValue };
+ let servo = iter.next().expect("Gecko_NewCSSValueSharedList should create a shared \
+ value list of the same length as the transform vector");
+ unsafe {
+ match servo {
+ ${transform_function_arm("matrix", "matrix3d", ["number"] * 16)}
+ ${transform_function_arm("skew", "skew", ["angle"] * 2)}
+ ${transform_function_arm("translate", "translate3d", ["lop", "lop", "length"])}
+ ${transform_function_arm("scale", "scale3d", ["number"] * 3)}
+ ${transform_function_arm("rotate", "rotate3d", ["number"] * 3 + ["angle"])}
+ ${transform_function_arm("perspective", "perspective", ["length"])}
+ }
+ cur = (*cur).mNext;
+ }
+ }
+ debug_assert!(iter.next().is_none());
+ unsafe { self.gecko.mSpecifiedTransform.set_move(list) };
+ }
+
+ pub fn copy_transform_from(&mut self, other: &Self) {
+ unsafe { self.gecko.mSpecifiedTransform.set(&other.gecko.mSpecifiedTransform); }
+ }
</%self:impl_trait>
<%def name="simple_image_array_property(name, shorthand, field_name)">
@@ -1609,7 +1706,6 @@ fn static_assert() {
Gecko_CopyFiltersFrom(&other.gecko as *const _ as *mut _, &mut self.gecko);
}
}
-
</%self:impl_trait>
diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs
index 8b145c5ee77..41ab2e5909c 100644
--- a/components/style/properties/longhand/box.mako.rs
+++ b/components/style/properties/longhand/box.mako.rs
@@ -937,6 +937,528 @@ ${helpers.keyword_list("animation-fill-mode",
</%helpers:longhand>
+
+<%helpers:longhand name="transform" products="gecko servo" animatable="${product == 'servo'}">
+ use app_units::Au;
+ use style_traits::ToCss;
+ use values::CSSFloat;
+ use values::HasViewportPercentage;
+
+ use std::fmt;
+
+ pub mod computed_value {
+ use values::CSSFloat;
+ use values::computed;
+
+ #[derive(Clone, Copy, Debug, PartialEq)]
+ #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
+ pub struct ComputedMatrix {
+ pub m11: CSSFloat, pub m12: CSSFloat, pub m13: CSSFloat, pub m14: CSSFloat,
+ pub m21: CSSFloat, pub m22: CSSFloat, pub m23: CSSFloat, pub m24: CSSFloat,
+ pub m31: CSSFloat, pub m32: CSSFloat, pub m33: CSSFloat, pub m34: CSSFloat,
+ pub m41: CSSFloat, pub m42: CSSFloat, pub m43: CSSFloat, pub m44: CSSFloat,
+ }
+
+ impl ComputedMatrix {
+ pub fn identity() -> ComputedMatrix {
+ ComputedMatrix {
+ m11: 1.0, m12: 0.0, m13: 0.0, m14: 0.0,
+ m21: 0.0, m22: 1.0, m23: 0.0, m24: 0.0,
+ m31: 0.0, m32: 0.0, m33: 1.0, m34: 0.0,
+ m41: 0.0, m42: 0.0, m43: 0.0, m44: 1.0
+ }
+ }
+ }
+
+ #[derive(Clone, Debug, PartialEq)]
+ #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
+ pub enum ComputedOperation {
+ Matrix(ComputedMatrix),
+ Skew(computed::Angle, computed::Angle),
+ Translate(computed::LengthOrPercentage,
+ computed::LengthOrPercentage,
+ computed::Length),
+ Scale(CSSFloat, CSSFloat, CSSFloat),
+ Rotate(CSSFloat, CSSFloat, CSSFloat, computed::Angle),
+ Perspective(computed::Length),
+ }
+
+ #[derive(Clone, Debug, PartialEq)]
+ #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
+ pub struct T(pub Option<Vec<ComputedOperation>>);
+ }
+
+ pub use self::computed_value::ComputedMatrix as SpecifiedMatrix;
+
+ fn parse_two_lengths_or_percentages(input: &mut Parser)
+ -> Result<(specified::LengthOrPercentage,
+ specified::LengthOrPercentage),()> {
+ let first = try!(specified::LengthOrPercentage::parse(input));
+ let second = input.try(|input| {
+ try!(input.expect_comma());
+ specified::LengthOrPercentage::parse(input)
+ }).unwrap_or(specified::LengthOrPercentage::zero());
+ Ok((first, second))
+ }
+
+ fn parse_two_floats(input: &mut Parser) -> Result<(CSSFloat,CSSFloat),()> {
+ let first = try!(specified::parse_number(input));
+ let second = input.try(|input| {
+ try!(input.expect_comma());
+ specified::parse_number(input)
+ }).unwrap_or(first);
+ Ok((first, second))
+ }
+
+ fn parse_two_angles(input: &mut Parser) -> Result<(specified::Angle, specified::Angle),()> {
+ let first = try!(specified::Angle::parse(input));
+ let second = input.try(|input| {
+ try!(input.expect_comma());
+ specified::Angle::parse(input)
+ }).unwrap_or(specified::Angle(0.0));
+ Ok((first, second))
+ }
+
+ #[derive(Copy, Clone, Debug, PartialEq)]
+ #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
+ enum TranslateKind {
+ Translate,
+ TranslateX,
+ TranslateY,
+ TranslateZ,
+ Translate3D,
+ }
+
+ #[derive(Clone, Debug, PartialEq)]
+ #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
+ enum SpecifiedOperation {
+ Matrix(SpecifiedMatrix),
+ Skew(specified::Angle, specified::Angle),
+ Translate(TranslateKind,
+ specified::LengthOrPercentage,
+ specified::LengthOrPercentage,
+ specified::Length),
+ Scale(CSSFloat, CSSFloat, CSSFloat),
+ Rotate(CSSFloat, CSSFloat, CSSFloat, specified::Angle),
+ Perspective(specified::Length),
+ }
+
+ impl ToCss for computed_value::T {
+ fn to_css<W>(&self, _: &mut W) -> fmt::Result where W: fmt::Write {
+ // TODO(pcwalton)
+ Ok(())
+ }
+ }
+
+ impl HasViewportPercentage for SpecifiedOperation {
+ fn has_viewport_percentage(&self) -> bool {
+ match *self {
+ SpecifiedOperation::Translate(_, l1, l2, l3) => {
+ l1.has_viewport_percentage() ||
+ l2.has_viewport_percentage() ||
+ l3.has_viewport_percentage()
+ },
+ SpecifiedOperation::Perspective(length) => length.has_viewport_percentage(),
+ _ => false
+ }
+ }
+ }
+
+ impl ToCss for SpecifiedOperation {
+ fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
+ match *self {
+ // todo(gw): implement serialization for transform
+ // types other than translate.
+ SpecifiedOperation::Matrix(_m) => {
+ Ok(())
+ }
+ SpecifiedOperation::Skew(_sx, _sy) => {
+ Ok(())
+ }
+ SpecifiedOperation::Translate(kind, tx, ty, tz) => {
+ match kind {
+ TranslateKind::Translate => {
+ try!(dest.write_str("translate("));
+ try!(tx.to_css(dest));
+ try!(dest.write_str(", "));
+ try!(ty.to_css(dest));
+ dest.write_str(")")
+ }
+ TranslateKind::TranslateX => {
+ try!(dest.write_str("translateX("));
+ try!(tx.to_css(dest));
+ dest.write_str(")")
+ }
+ TranslateKind::TranslateY => {
+ try!(dest.write_str("translateY("));
+ try!(ty.to_css(dest));
+ dest.write_str(")")
+ }
+ TranslateKind::TranslateZ => {
+ try!(dest.write_str("translateZ("));
+ try!(tz.to_css(dest));
+ dest.write_str(")")
+ }
+ TranslateKind::Translate3D => {
+ try!(dest.write_str("translate3d("));
+ try!(tx.to_css(dest));
+ try!(dest.write_str(", "));
+ try!(ty.to_css(dest));
+ try!(dest.write_str(", "));
+ try!(tz.to_css(dest));
+ dest.write_str(")")
+ }
+ }
+ }
+ SpecifiedOperation::Scale(_sx, _sy, _sz) => {
+ Ok(())
+ }
+ SpecifiedOperation::Rotate(_ax, _ay, _az, _angle) => {
+ Ok(())
+ }
+ SpecifiedOperation::Perspective(_p) => {
+ Ok(())
+ }
+ }
+ }
+ }
+
+ impl HasViewportPercentage for SpecifiedValue {
+ fn has_viewport_percentage(&self) -> bool {
+ let &SpecifiedValue(ref specified_ops) = self;
+ specified_ops.iter().any(|ref x| x.has_viewport_percentage())
+ }
+ }
+
+ #[derive(Clone, Debug, PartialEq)]
+ #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
+ pub struct SpecifiedValue(Vec<SpecifiedOperation>);
+
+ impl ToCss for SpecifiedValue {
+ fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
+ let mut first = true;
+ for operation in &self.0 {
+ if !first {
+ try!(dest.write_str(" "));
+ }
+ first = false;
+ try!(operation.to_css(dest))
+ }
+ Ok(())
+ }
+ }
+
+ #[inline]
+ pub fn get_initial_value() -> computed_value::T {
+ computed_value::T(None)
+ }
+
+ pub fn parse(_: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue,()> {
+ if input.try(|input| input.expect_ident_matching("none")).is_ok() {
+ return Ok(SpecifiedValue(Vec::new()))
+ }
+
+ let mut result = Vec::new();
+ loop {
+ let name = match input.expect_function() {
+ Ok(name) => name,
+ Err(_) => break,
+ };
+ match_ignore_ascii_case! {
+ name,
+ "matrix" => {
+ try!(input.parse_nested_block(|input| {
+ let values = try!(input.parse_comma_separated(|input| {
+ specified::parse_number(input)
+ }));
+ if values.len() != 6 {
+ return Err(())
+ }
+ result.push(SpecifiedOperation::Matrix(
+ SpecifiedMatrix {
+ m11: values[0], m12: values[1], m13: 0.0, m14: 0.0,
+ m21: values[2], m22: values[3], m23: 0.0, m24: 0.0,
+ m31: 0.0, m32: 0.0, m33: 1.0, m34: 0.0,
+ m41: values[4], m42: values[5], m43: 0.0, m44: 1.0
+ }));
+ Ok(())
+ }))
+ },
+ "matrix3d" => {
+ try!(input.parse_nested_block(|input| {
+ let values = try!(input.parse_comma_separated(|input| {
+ specified::parse_number(input)
+ }));
+ if values.len() != 16 {
+ return Err(())
+ }
+ result.push(SpecifiedOperation::Matrix(
+ SpecifiedMatrix {
+ m11: values[ 0], m12: values[ 1], m13: values[ 2], m14: values[ 3],
+ m21: values[ 4], m22: values[ 5], m23: values[ 6], m24: values[ 7],
+ m31: values[ 8], m32: values[ 9], m33: values[10], m34: values[11],
+ m41: values[12], m42: values[13], m43: values[14], m44: values[15]
+ }));
+ Ok(())
+ }))
+ },
+ "translate" => {
+ try!(input.parse_nested_block(|input| {
+ let (tx, ty) = try!(parse_two_lengths_or_percentages(input));
+ result.push(SpecifiedOperation::Translate(TranslateKind::Translate,
+ tx,
+ ty,
+ specified::Length::Absolute(Au(0))));
+ Ok(())
+ }))
+ },
+ "translatex" => {
+ try!(input.parse_nested_block(|input| {
+ let tx = try!(specified::LengthOrPercentage::parse(input));
+ result.push(SpecifiedOperation::Translate(
+ TranslateKind::TranslateX,
+ tx,
+ specified::LengthOrPercentage::zero(),
+ specified::Length::Absolute(Au(0))));
+ Ok(())
+ }))
+ },
+ "translatey" => {
+ try!(input.parse_nested_block(|input| {
+ let ty = try!(specified::LengthOrPercentage::parse(input));
+ result.push(SpecifiedOperation::Translate(
+ TranslateKind::TranslateY,
+ specified::LengthOrPercentage::zero(),
+ ty,
+ specified::Length::Absolute(Au(0))));
+ Ok(())
+ }))
+ },
+ "translatez" => {
+ try!(input.parse_nested_block(|input| {
+ let tz = try!(specified::Length::parse(input));
+ result.push(SpecifiedOperation::Translate(
+ TranslateKind::TranslateZ,
+ specified::LengthOrPercentage::zero(),
+ specified::LengthOrPercentage::zero(),
+ tz));
+ Ok(())
+ }))
+ },
+ "translate3d" => {
+ try!(input.parse_nested_block(|input| {
+ let tx = try!(specified::LengthOrPercentage::parse(input));
+ try!(input.expect_comma());
+ let ty = try!(specified::LengthOrPercentage::parse(input));
+ try!(input.expect_comma());
+ let tz = try!(specified::Length::parse(input));
+ result.push(SpecifiedOperation::Translate(
+ TranslateKind::Translate3D,
+ tx,
+ ty,
+ tz));
+ Ok(())
+ }))
+
+ },
+ "scale" => {
+ try!(input.parse_nested_block(|input| {
+ let (sx, sy) = try!(parse_two_floats(input));
+ result.push(SpecifiedOperation::Scale(sx, sy, 1.0));
+ Ok(())
+ }))
+ },
+ "scalex" => {
+ try!(input.parse_nested_block(|input| {
+ let sx = try!(specified::parse_number(input));
+ result.push(SpecifiedOperation::Scale(sx, 1.0, 1.0));
+ Ok(())
+ }))
+ },
+ "scaley" => {
+ try!(input.parse_nested_block(|input| {
+ let sy = try!(specified::parse_number(input));
+ result.push(SpecifiedOperation::Scale(1.0, sy, 1.0));
+ Ok(())
+ }))
+ },
+ "scalez" => {
+ try!(input.parse_nested_block(|input| {
+ let sz = try!(specified::parse_number(input));
+ result.push(SpecifiedOperation::Scale(1.0, 1.0, sz));
+ Ok(())
+ }))
+ },
+ "scale3d" => {
+ try!(input.parse_nested_block(|input| {
+ let sx = try!(specified::parse_number(input));
+ try!(input.expect_comma());
+ let sy = try!(specified::parse_number(input));
+ try!(input.expect_comma());
+ let sz = try!(specified::parse_number(input));
+ result.push(SpecifiedOperation::Scale(sx, sy, sz));
+ Ok(())
+ }))
+ },
+ "rotate" => {
+ try!(input.parse_nested_block(|input| {
+ let theta = try!(specified::Angle::parse(input));
+ result.push(SpecifiedOperation::Rotate(0.0, 0.0, 1.0, theta));
+ Ok(())
+ }))
+ },
+ "rotatex" => {
+ try!(input.parse_nested_block(|input| {
+ let theta = try!(specified::Angle::parse(input));
+ result.push(SpecifiedOperation::Rotate(1.0, 0.0, 0.0, theta));
+ Ok(())
+ }))
+ },
+ "rotatey" => {
+ try!(input.parse_nested_block(|input| {
+ let theta = try!(specified::Angle::parse(input));
+ result.push(SpecifiedOperation::Rotate(0.0, 1.0, 0.0, theta));
+ Ok(())
+ }))
+ },
+ "rotatez" => {
+ try!(input.parse_nested_block(|input| {
+ let theta = try!(specified::Angle::parse(input));
+ result.push(SpecifiedOperation::Rotate(0.0, 0.0, 1.0, theta));
+ Ok(())
+ }))
+ },
+ "rotate3d" => {
+ try!(input.parse_nested_block(|input| {
+ let ax = try!(specified::parse_number(input));
+ try!(input.expect_comma());
+ let ay = try!(specified::parse_number(input));
+ try!(input.expect_comma());
+ let az = try!(specified::parse_number(input));
+ try!(input.expect_comma());
+ let theta = try!(specified::Angle::parse(input));
+ // TODO(gw): Check the axis can be normalized!!
+ result.push(SpecifiedOperation::Rotate(ax, ay, az, theta));
+ Ok(())
+ }))
+ },
+ "skew" => {
+ try!(input.parse_nested_block(|input| {
+ let (theta_x, theta_y) = try!(parse_two_angles(input));
+ result.push(SpecifiedOperation::Skew(theta_x, theta_y));
+ Ok(())
+ }))
+ },
+ "skewx" => {
+ try!(input.parse_nested_block(|input| {
+ let theta_x = try!(specified::Angle::parse(input));
+ result.push(SpecifiedOperation::Skew(theta_x, specified::Angle(0.0)));
+ Ok(())
+ }))
+ },
+ "skewy" => {
+ try!(input.parse_nested_block(|input| {
+ let theta_y = try!(specified::Angle::parse(input));
+ result.push(SpecifiedOperation::Skew(specified::Angle(0.0), theta_y));
+ Ok(())
+ }))
+ },
+ "perspective" => {
+ try!(input.parse_nested_block(|input| {
+ let d = try!(specified::Length::parse(input));
+ result.push(SpecifiedOperation::Perspective(d));
+ Ok(())
+ }))
+ },
+ _ => return Err(())
+ }
+ }
+
+ if !result.is_empty() {
+ Ok(SpecifiedValue(result))
+ } else {
+ Err(())
+ }
+ }
+
+ impl ToComputedValue for SpecifiedValue {
+ type ComputedValue = computed_value::T;
+
+ #[inline]
+ fn to_computed_value(&self, context: &Context) -> computed_value::T {
+ if self.0.is_empty() {
+ return computed_value::T(None)
+ }
+
+ let mut result = vec!();
+ for operation in &self.0 {
+ match *operation {
+ SpecifiedOperation::Matrix(ref matrix) => {
+ result.push(computed_value::ComputedOperation::Matrix(*matrix));
+ }
+ SpecifiedOperation::Translate(_, ref tx, ref ty, ref tz) => {
+ result.push(computed_value::ComputedOperation::Translate(tx.to_computed_value(context),
+ ty.to_computed_value(context),
+ tz.to_computed_value(context)));
+ }
+ SpecifiedOperation::Scale(sx, sy, sz) => {
+ result.push(computed_value::ComputedOperation::Scale(sx, sy, sz));
+ }
+ SpecifiedOperation::Rotate(ax, ay, az, theta) => {
+ let len = (ax * ax + ay * ay + az * az).sqrt();
+ result.push(computed_value::ComputedOperation::Rotate(ax / len, ay / len, az / len, theta));
+ }
+ SpecifiedOperation::Skew(theta_x, theta_y) => {
+ result.push(computed_value::ComputedOperation::Skew(theta_x, theta_y));
+ }
+ SpecifiedOperation::Perspective(d) => {
+ result.push(computed_value::ComputedOperation::Perspective(d.to_computed_value(context)));
+ }
+ };
+ }
+
+ computed_value::T(Some(result))
+ }
+
+ #[inline]
+ fn from_computed_value(computed: &computed_value::T) -> Self {
+ SpecifiedValue(computed.0.as_ref().map(|computed| {
+ let mut result = vec!();
+ for operation in computed {
+ match *operation {
+ computed_value::ComputedOperation::Matrix(ref matrix) => {
+ result.push(SpecifiedOperation::Matrix(*matrix));
+ }
+ computed_value::ComputedOperation::Translate(ref tx, ref ty, ref tz) => {
+ // XXXManishearth we lose information here; perhaps we should try to
+ // recover the original function? Not sure if this can be observed.
+ result.push(SpecifiedOperation::Translate(TranslateKind::Translate,
+ ToComputedValue::from_computed_value(tx),
+ ToComputedValue::from_computed_value(ty),
+ ToComputedValue::from_computed_value(tz)));
+ }
+ computed_value::ComputedOperation::Scale(sx, sy, sz) => {
+ result.push(SpecifiedOperation::Scale(sx, sy, sz));
+ }
+ computed_value::ComputedOperation::Rotate(ax, ay, az, theta) => {
+ result.push(SpecifiedOperation::Rotate(ax, ay, az, theta));
+ }
+ computed_value::ComputedOperation::Skew(theta_x, theta_y) => {
+ result.push(SpecifiedOperation::Skew(theta_x, theta_y));
+ }
+ computed_value::ComputedOperation::Perspective(ref d) => {
+ result.push(SpecifiedOperation::Perspective(
+ ToComputedValue::from_computed_value(d)
+ ));
+ }
+ };
+ }
+ result
+ }).unwrap_or(Vec::new()))
+ }
+ }
+</%helpers:longhand>
+
// CSSOM View Module
// https://www.w3.org/TR/cssom-view-1/
${helpers.single_keyword("scroll-behavior",
diff --git a/components/style/properties/longhand/effects.mako.rs b/components/style/properties/longhand/effects.mako.rs
index 87595133b91..643c3f96ca8 100644
--- a/components/style/properties/longhand/effects.mako.rs
+++ b/components/style/properties/longhand/effects.mako.rs
@@ -670,525 +670,6 @@ ${helpers.predefined_type("opacity",
}
</%helpers:longhand>
-<%helpers:longhand name="transform" products="servo" animatable="True">
- use app_units::Au;
- use std::fmt;
- use style_traits::ToCss;
- use values::{CSSFloat, HasViewportPercentage};
-
- pub mod computed_value {
- use values::CSSFloat;
- use values::computed;
-
- #[derive(Clone, Copy, Debug, PartialEq)]
- #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
- pub struct ComputedMatrix {
- pub m11: CSSFloat, pub m12: CSSFloat, pub m13: CSSFloat, pub m14: CSSFloat,
- pub m21: CSSFloat, pub m22: CSSFloat, pub m23: CSSFloat, pub m24: CSSFloat,
- pub m31: CSSFloat, pub m32: CSSFloat, pub m33: CSSFloat, pub m34: CSSFloat,
- pub m41: CSSFloat, pub m42: CSSFloat, pub m43: CSSFloat, pub m44: CSSFloat,
- }
-
- impl ComputedMatrix {
- pub fn identity() -> ComputedMatrix {
- ComputedMatrix {
- m11: 1.0, m12: 0.0, m13: 0.0, m14: 0.0,
- m21: 0.0, m22: 1.0, m23: 0.0, m24: 0.0,
- m31: 0.0, m32: 0.0, m33: 1.0, m34: 0.0,
- m41: 0.0, m42: 0.0, m43: 0.0, m44: 1.0
- }
- }
- }
-
- #[derive(Clone, Debug, PartialEq)]
- #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
- pub enum ComputedOperation {
- Matrix(ComputedMatrix),
- Skew(computed::Angle, computed::Angle),
- Translate(computed::LengthOrPercentage,
- computed::LengthOrPercentage,
- computed::Length),
- Scale(CSSFloat, CSSFloat, CSSFloat),
- Rotate(CSSFloat, CSSFloat, CSSFloat, computed::Angle),
- Perspective(computed::Length),
- }
-
- #[derive(Clone, Debug, PartialEq)]
- #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
- pub struct T(pub Option<Vec<ComputedOperation>>);
- }
-
- pub use self::computed_value::ComputedMatrix as SpecifiedMatrix;
-
- fn parse_two_lengths_or_percentages(input: &mut Parser)
- -> Result<(specified::LengthOrPercentage,
- specified::LengthOrPercentage),()> {
- let first = try!(specified::LengthOrPercentage::parse(input));
- let second = input.try(|input| {
- try!(input.expect_comma());
- specified::LengthOrPercentage::parse(input)
- }).unwrap_or(specified::LengthOrPercentage::zero());
- Ok((first, second))
- }
-
- fn parse_two_floats(input: &mut Parser) -> Result<(CSSFloat,CSSFloat),()> {
- let first = try!(specified::parse_number(input));
- let second = input.try(|input| {
- try!(input.expect_comma());
- specified::parse_number(input)
- }).unwrap_or(first);
- Ok((first, second))
- }
-
- fn parse_two_angles(input: &mut Parser) -> Result<(specified::Angle, specified::Angle),()> {
- let first = try!(specified::Angle::parse(input));
- let second = input.try(|input| {
- try!(input.expect_comma());
- specified::Angle::parse(input)
- }).unwrap_or(specified::Angle(0.0));
- Ok((first, second))
- }
-
- #[derive(Copy, Clone, Debug, PartialEq)]
- #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
- enum TranslateKind {
- Translate,
- TranslateX,
- TranslateY,
- TranslateZ,
- Translate3D,
- }
-
- #[derive(Clone, Debug, PartialEq)]
- #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
- enum SpecifiedOperation {
- Matrix(SpecifiedMatrix),
- Skew(specified::Angle, specified::Angle),
- Translate(TranslateKind,
- specified::LengthOrPercentage,
- specified::LengthOrPercentage,
- specified::Length),
- Scale(CSSFloat, CSSFloat, CSSFloat),
- Rotate(CSSFloat, CSSFloat, CSSFloat, specified::Angle),
- Perspective(specified::Length),
- }
-
- impl ToCss for computed_value::T {
- fn to_css<W>(&self, _: &mut W) -> fmt::Result where W: fmt::Write {
- // TODO(pcwalton)
- Ok(())
- }
- }
-
- impl HasViewportPercentage for SpecifiedOperation {
- fn has_viewport_percentage(&self) -> bool {
- match *self {
- SpecifiedOperation::Translate(_, l1, l2, l3) => {
- l1.has_viewport_percentage() ||
- l2.has_viewport_percentage() ||
- l3.has_viewport_percentage()
- },
- SpecifiedOperation::Perspective(length) => length.has_viewport_percentage(),
- _ => false
- }
- }
- }
-
- impl ToCss for SpecifiedOperation {
- fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
- match *self {
- // todo(gw): implement serialization for transform
- // types other than translate.
- SpecifiedOperation::Matrix(_m) => {
- Ok(())
- }
- SpecifiedOperation::Skew(_sx, _sy) => {
- Ok(())
- }
- SpecifiedOperation::Translate(kind, tx, ty, tz) => {
- match kind {
- TranslateKind::Translate => {
- try!(dest.write_str("translate("));
- try!(tx.to_css(dest));
- try!(dest.write_str(", "));
- try!(ty.to_css(dest));
- dest.write_str(")")
- }
- TranslateKind::TranslateX => {
- try!(dest.write_str("translateX("));
- try!(tx.to_css(dest));
- dest.write_str(")")
- }
- TranslateKind::TranslateY => {
- try!(dest.write_str("translateY("));
- try!(ty.to_css(dest));
- dest.write_str(")")
- }
- TranslateKind::TranslateZ => {
- try!(dest.write_str("translateZ("));
- try!(tz.to_css(dest));
- dest.write_str(")")
- }
- TranslateKind::Translate3D => {
- try!(dest.write_str("translate3d("));
- try!(tx.to_css(dest));
- try!(dest.write_str(", "));
- try!(ty.to_css(dest));
- try!(dest.write_str(", "));
- try!(tz.to_css(dest));
- dest.write_str(")")
- }
- }
- }
- SpecifiedOperation::Scale(_sx, _sy, _sz) => {
- Ok(())
- }
- SpecifiedOperation::Rotate(_ax, _ay, _az, _angle) => {
- Ok(())
- }
- SpecifiedOperation::Perspective(_p) => {
- Ok(())
- }
- }
- }
- }
-
- impl HasViewportPercentage for SpecifiedValue {
- fn has_viewport_percentage(&self) -> bool {
- let &SpecifiedValue(ref specified_ops) = self;
- specified_ops.iter().any(|ref x| x.has_viewport_percentage())
- }
- }
-
- #[derive(Clone, Debug, PartialEq)]
- #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
- pub struct SpecifiedValue(Vec<SpecifiedOperation>);
-
- impl ToCss for SpecifiedValue {
- fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
- let mut first = true;
- for operation in &self.0 {
- if !first {
- try!(dest.write_str(" "));
- }
- first = false;
- try!(operation.to_css(dest))
- }
- Ok(())
- }
- }
-
- #[inline]
- pub fn get_initial_value() -> computed_value::T {
- computed_value::T(None)
- }
-
- pub fn parse(_: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue,()> {
- if input.try(|input| input.expect_ident_matching("none")).is_ok() {
- return Ok(SpecifiedValue(Vec::new()))
- }
-
- let mut result = Vec::new();
- loop {
- let name = match input.expect_function() {
- Ok(name) => name,
- Err(_) => break,
- };
- match_ignore_ascii_case! {
- name,
- "matrix" => {
- try!(input.parse_nested_block(|input| {
- let values = try!(input.parse_comma_separated(|input| {
- specified::parse_number(input)
- }));
- if values.len() != 6 {
- return Err(())
- }
- result.push(SpecifiedOperation::Matrix(
- SpecifiedMatrix {
- m11: values[0], m12: values[1], m13: 0.0, m14: 0.0,
- m21: values[2], m22: values[3], m23: 0.0, m24: 0.0,
- m31: 0.0, m32: 0.0, m33: 1.0, m34: 0.0,
- m41: values[4], m42: values[5], m43: 0.0, m44: 1.0
- }));
- Ok(())
- }))
- },
- "matrix3d" => {
- try!(input.parse_nested_block(|input| {
- let values = try!(input.parse_comma_separated(|input| {
- specified::parse_number(input)
- }));
- if values.len() != 16 {
- return Err(())
- }
- result.push(SpecifiedOperation::Matrix(
- SpecifiedMatrix {
- m11: values[ 0], m12: values[ 1], m13: values[ 2], m14: values[ 3],
- m21: values[ 4], m22: values[ 5], m23: values[ 6], m24: values[ 7],
- m31: values[ 8], m32: values[ 9], m33: values[10], m34: values[11],
- m41: values[12], m42: values[13], m43: values[14], m44: values[15]
- }));
- Ok(())
- }))
- },
- "translate" => {
- try!(input.parse_nested_block(|input| {
- let (tx, ty) = try!(parse_two_lengths_or_percentages(input));
- result.push(SpecifiedOperation::Translate(TranslateKind::Translate,
- tx,
- ty,
- specified::Length::Absolute(Au(0))));
- Ok(())
- }))
- },
- "translatex" => {
- try!(input.parse_nested_block(|input| {
- let tx = try!(specified::LengthOrPercentage::parse(input));
- result.push(SpecifiedOperation::Translate(
- TranslateKind::TranslateX,
- tx,
- specified::LengthOrPercentage::zero(),
- specified::Length::Absolute(Au(0))));
- Ok(())
- }))
- },
- "translatey" => {
- try!(input.parse_nested_block(|input| {
- let ty = try!(specified::LengthOrPercentage::parse(input));
- result.push(SpecifiedOperation::Translate(
- TranslateKind::TranslateY,
- specified::LengthOrPercentage::zero(),
- ty,
- specified::Length::Absolute(Au(0))));
- Ok(())
- }))
- },
- "translatez" => {
- try!(input.parse_nested_block(|input| {
- let tz = try!(specified::Length::parse(input));
- result.push(SpecifiedOperation::Translate(
- TranslateKind::TranslateZ,
- specified::LengthOrPercentage::zero(),
- specified::LengthOrPercentage::zero(),
- tz));
- Ok(())
- }))
- },
- "translate3d" => {
- try!(input.parse_nested_block(|input| {
- let tx = try!(specified::LengthOrPercentage::parse(input));
- try!(input.expect_comma());
- let ty = try!(specified::LengthOrPercentage::parse(input));
- try!(input.expect_comma());
- let tz = try!(specified::Length::parse(input));
- result.push(SpecifiedOperation::Translate(
- TranslateKind::Translate3D,
- tx,
- ty,
- tz));
- Ok(())
- }))
-
- },
- "scale" => {
- try!(input.parse_nested_block(|input| {
- let (sx, sy) = try!(parse_two_floats(input));
- result.push(SpecifiedOperation::Scale(sx, sy, 1.0));
- Ok(())
- }))
- },
- "scalex" => {
- try!(input.parse_nested_block(|input| {
- let sx = try!(specified::parse_number(input));
- result.push(SpecifiedOperation::Scale(sx, 1.0, 1.0));
- Ok(())
- }))
- },
- "scaley" => {
- try!(input.parse_nested_block(|input| {
- let sy = try!(specified::parse_number(input));
- result.push(SpecifiedOperation::Scale(1.0, sy, 1.0));
- Ok(())
- }))
- },
- "scalez" => {
- try!(input.parse_nested_block(|input| {
- let sz = try!(specified::parse_number(input));
- result.push(SpecifiedOperation::Scale(1.0, 1.0, sz));
- Ok(())
- }))
- },
- "scale3d" => {
- try!(input.parse_nested_block(|input| {
- let sx = try!(specified::parse_number(input));
- try!(input.expect_comma());
- let sy = try!(specified::parse_number(input));
- try!(input.expect_comma());
- let sz = try!(specified::parse_number(input));
- result.push(SpecifiedOperation::Scale(sx, sy, sz));
- Ok(())
- }))
- },
- "rotate" => {
- try!(input.parse_nested_block(|input| {
- let theta = try!(specified::Angle::parse(input));
- result.push(SpecifiedOperation::Rotate(0.0, 0.0, 1.0, theta));
- Ok(())
- }))
- },
- "rotatex" => {
- try!(input.parse_nested_block(|input| {
- let theta = try!(specified::Angle::parse(input));
- result.push(SpecifiedOperation::Rotate(1.0, 0.0, 0.0, theta));
- Ok(())
- }))
- },
- "rotatey" => {
- try!(input.parse_nested_block(|input| {
- let theta = try!(specified::Angle::parse(input));
- result.push(SpecifiedOperation::Rotate(0.0, 1.0, 0.0, theta));
- Ok(())
- }))
- },
- "rotatez" => {
- try!(input.parse_nested_block(|input| {
- let theta = try!(specified::Angle::parse(input));
- result.push(SpecifiedOperation::Rotate(0.0, 0.0, 1.0, theta));
- Ok(())
- }))
- },
- "rotate3d" => {
- try!(input.parse_nested_block(|input| {
- let ax = try!(specified::parse_number(input));
- try!(input.expect_comma());
- let ay = try!(specified::parse_number(input));
- try!(input.expect_comma());
- let az = try!(specified::parse_number(input));
- try!(input.expect_comma());
- let theta = try!(specified::Angle::parse(input));
- // TODO(gw): Check the axis can be normalized!!
- result.push(SpecifiedOperation::Rotate(ax, ay, az, theta));
- Ok(())
- }))
- },
- "skew" => {
- try!(input.parse_nested_block(|input| {
- let (theta_x, theta_y) = try!(parse_two_angles(input));
- result.push(SpecifiedOperation::Skew(theta_x, theta_y));
- Ok(())
- }))
- },
- "skewx" => {
- try!(input.parse_nested_block(|input| {
- let theta_x = try!(specified::Angle::parse(input));
- result.push(SpecifiedOperation::Skew(theta_x, specified::Angle(0.0)));
- Ok(())
- }))
- },
- "skewy" => {
- try!(input.parse_nested_block(|input| {
- let theta_y = try!(specified::Angle::parse(input));
- result.push(SpecifiedOperation::Skew(specified::Angle(0.0), theta_y));
- Ok(())
- }))
- },
- "perspective" => {
- try!(input.parse_nested_block(|input| {
- let d = try!(specified::Length::parse(input));
- result.push(SpecifiedOperation::Perspective(d));
- Ok(())
- }))
- },
- _ => return Err(())
- }
- }
-
- if !result.is_empty() {
- Ok(SpecifiedValue(result))
- } else {
- Err(())
- }
- }
-
- impl ToComputedValue for SpecifiedValue {
- type ComputedValue = computed_value::T;
-
- #[inline]
- fn to_computed_value(&self, context: &Context) -> computed_value::T {
- if self.0.is_empty() {
- return computed_value::T(None)
- }
-
- let mut result = vec!();
- for operation in &self.0 {
- match *operation {
- SpecifiedOperation::Matrix(ref matrix) => {
- result.push(computed_value::ComputedOperation::Matrix(*matrix));
- }
- SpecifiedOperation::Translate(_, ref tx, ref ty, ref tz) => {
- result.push(computed_value::ComputedOperation::Translate(tx.to_computed_value(context),
- ty.to_computed_value(context),
- tz.to_computed_value(context)));
- }
- SpecifiedOperation::Scale(sx, sy, sz) => {
- result.push(computed_value::ComputedOperation::Scale(sx, sy, sz));
- }
- SpecifiedOperation::Rotate(ax, ay, az, theta) => {
- let len = (ax * ax + ay * ay + az * az).sqrt();
- result.push(computed_value::ComputedOperation::Rotate(ax / len, ay / len, az / len, theta));
- }
- SpecifiedOperation::Skew(theta_x, theta_y) => {
- result.push(computed_value::ComputedOperation::Skew(theta_x, theta_y));
- }
- SpecifiedOperation::Perspective(d) => {
- result.push(computed_value::ComputedOperation::Perspective(d.to_computed_value(context)));
- }
- };
- }
-
- computed_value::T(Some(result))
- }
-
- #[inline]
- fn from_computed_value(computed: &computed_value::T) -> Self {
- SpecifiedValue(computed.0.as_ref().map(|computed| {
- let mut result = vec!();
- for operation in computed {
- match *operation {
- computed_value::ComputedOperation::Matrix(ref matrix) => {
- result.push(SpecifiedOperation::Matrix(*matrix));
- }
- computed_value::ComputedOperation::Translate(ref tx, ref ty, ref tz) => {
- // XXXManishearth we lose information here; perhaps we should try to
- // recover the original function? Not sure if this can be observed.
- result.push(SpecifiedOperation::Translate(TranslateKind::Translate,
- ToComputedValue::from_computed_value(tx),
- ToComputedValue::from_computed_value(ty),
- ToComputedValue::from_computed_value(tz)));
- }
- computed_value::ComputedOperation::Scale(sx, sy, sz) => {
- result.push(SpecifiedOperation::Scale(sx, sy, sz));
- }
- computed_value::ComputedOperation::Rotate(ax, ay, az, theta) => {
- result.push(SpecifiedOperation::Rotate(ax, ay, az, theta));
- }
- computed_value::ComputedOperation::Skew(theta_x, theta_y) => {
- result.push(SpecifiedOperation::Skew(theta_x, theta_y));
- }
- computed_value::ComputedOperation::Perspective(ref d) => {
- result.push(SpecifiedOperation::Perspective(
- ToComputedValue::from_computed_value(d)
- ));
- }
- };
- }
- result
- }).unwrap_or(Vec::new()))
- }
- }
-</%helpers:longhand>
-
pub struct OriginParseResult {
pub horizontal: Option<specified::LengthOrPercentage>,
pub vertical: Option<specified::LengthOrPercentage>,
diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs
index dfa2593e1cb..7fe88d7bebf 100644
--- a/components/style/properties/properties.mako.rs
+++ b/components/style/properties/properties.mako.rs
@@ -1237,6 +1237,7 @@ impl ComputedValues {
use computed_values::transform_style;
let effects = self.get_effects();
+ let box_ = self.get_box();
// TODO(gw): Add clip-path, isolation, mask-image, mask-border-source when supported.
if effects.opacity < 1.0 ||
@@ -1247,7 +1248,7 @@ impl ComputedValues {
}
if effects.transform_style == transform_style::T::auto {
- if effects.transform.0.is_some() {
+ if box_.transform.0.is_some() {
return transform_style::T::flat;
}
if let Either::First(ref _length) = effects.perspective {
@@ -1261,7 +1262,7 @@ impl ComputedValues {
pub fn transform_requires_layer(&self) -> bool {
// Check if the transform matrix is 2D or 3D
- if let Some(ref transform_list) = self.get_effects().transform.0 {
+ if let Some(ref transform_list) = self.get_box().transform.0 {
for transform in transform_list {
match *transform {
computed_values::transform::ComputedOperation::Perspective(..) => {
diff --git a/components/style/servo/restyle_damage.rs b/components/style/servo/restyle_damage.rs
index 08dd549b288..616c3506173 100644
--- a/components/style/servo/restyle_damage.rs
+++ b/components/style/servo/restyle_damage.rs
@@ -232,7 +232,7 @@ fn compute_damage(old: &ServoComputedValues, new: &ServoComputedValues) -> Servo
get_position.top, get_position.left,
get_position.right, get_position.bottom,
get_effects.opacity,
- get_effects.transform, get_effects.transform_style, get_effects.transform_origin,
+ get_box.transform, get_effects.transform_style, get_effects.transform_origin,
get_effects.perspective, get_effects.perspective_origin
]) || add_if_not_equal!(old, new, damage,
[REPAINT], [