servo: Merge #12608 - Update anonymous box list (from bholley:sync_anon_box); r=emilio
authorBobby Holley <bobbyholley@gmail.com>
Tue, 26 Jul 2016 23:58:23 -0500
changeset 339374 258d7275c4e6615b749af905af6db34f1d5210b0
parent 339373 b43b28b4a31ad1a05b6680e3fb26b46d88f1fcf6
child 339375 d717781d7084dac585b938eb3dcc9fa6297c46b9
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
servo: Merge #12608 - Update anonymous box list (from bholley:sync_anon_box); r=emilio These have drifted since we introduced them. Adding a few other misc commits while I'm at it. Source-Repo: https://github.com/servo/servo Source-Revision: c1409af5438213d5a697aa83e983f8100c660b74
servo/components/style/gecko_selector_impl.rs
servo/ports/geckolib/gecko_bindings/bindings.rs
servo/ports/geckolib/gecko_bindings/tools/regen.py
--- a/servo/components/style/gecko_selector_impl.rs
+++ b/servo/components/style/gecko_selector_impl.rs
@@ -39,17 +39,18 @@ pub enum PseudoElement {
     MozColorSwatch,
 
     AnonBox(AnonBoxPseudoElement),
 }
 
 // https://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSAnonBoxList.h
 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
 pub enum AnonBoxPseudoElement {
-    MozNonElement,
+    MozText,
+    MozOtherNonElement,
     MozAnonymousBlock,
     MozAnonymousPositionedBlock,
     MozMathMLAnonymousBlock,
     MozXULAnonymousBlock,
 
     MozHorizontalFramesetBorder,
     MozVerticalFramesetBorder,
     MozLineFrame,
@@ -62,17 +63,17 @@ pub enum AnonBoxPseudoElement {
     MozDisplayComboboxControlFrame,
 
     MozHTMLCanvasContent,
     MozInlineTable,
     MozTable,
     MozTableCell,
     MozTableColumnGroup,
     MozTableColumn,
-    MozTableOuter,
+    MozTableWrapper,
     MozTableRowGroup,
     MozTableRow,
 
     MozCanvas,
     MozPageBreak,
     MozPage,
     MozPageContent,
     MozPageSequence,
@@ -209,17 +210,18 @@ impl SelectorImpl for GeckoSelectorImpl 
             _ => {}
         }
 
         if !context.in_user_agent_stylesheet {
             return Err(())
         }
 
         Ok(AnonBox(match_ignore_ascii_case! { name,
-            "-moz-non-element" => MozNonElement,
+            "-moz-text" => MozText,
+            "-moz-other-non-element" => MozOtherNonElement,
 
             "-moz-anonymous-block" => MozAnonymousBlock,
             "-moz-anonymous-positioned-block" => MozAnonymousPositionedBlock,
             "-moz-mathml-anonymous-block" => MozMathMLAnonymousBlock,
             "-moz-xul-anonymous-block" => MozXULAnonymousBlock,
 
             "-moz-hframeset-border" => MozHorizontalFramesetBorder,
             "-moz-vframeset-border" => MozVerticalFramesetBorder,
@@ -235,17 +237,17 @@ impl SelectorImpl for GeckoSelectorImpl 
             "-moz-display-comboboxcontrol-frame" => MozDisplayComboboxControlFrame,
             "-moz-html-canvas-content" => MozHTMLCanvasContent,
 
             "-moz-inline-table" => MozInlineTable,
             "-moz-table" => MozTable,
             "-moz-table-cell" => MozTableCell,
             "-moz-table-column-group" => MozTableColumnGroup,
             "-moz-table-column" => MozTableColumn,
-            "-moz-table-outer" => MozTableOuter,
+            "-moz-table-wrapper" => MozTableWrapper,
             "-moz-table-row-group" => MozTableRowGroup,
             "-moz-table-row" => MozTableRow,
 
             "-moz-canvas" => MozCanvas,
             "-moz-pagebreak" => MozPageBreak,
             "-moz-page" => MozPage,
             "-moz-pagecontent" => MozPageContent,
             "-moz-page-sequence" => MozPageSequence,
@@ -300,17 +302,18 @@ impl SelectorImplExt for GeckoSelectorIm
         where F: FnMut(PseudoElement) {
         use self::AnonBoxPseudoElement::*;
         use self::PseudoElement::*;
 
         fun(Before);
         fun(After);
         fun(FirstLine);
 
-        fun(AnonBox(MozNonElement));
+        fun(AnonBox(MozText));
+        fun(AnonBox(MozOtherNonElement));
         fun(AnonBox(MozAnonymousBlock));
         fun(AnonBox(MozAnonymousPositionedBlock));
         fun(AnonBox(MozMathMLAnonymousBlock));
         fun(AnonBox(MozXULAnonymousBlock));
 
         fun(AnonBox(MozHorizontalFramesetBorder));
         fun(AnonBox(MozVerticalFramesetBorder));
         fun(AnonBox(MozLineFrame));
@@ -323,17 +326,17 @@ impl SelectorImplExt for GeckoSelectorIm
         fun(AnonBox(MozDisplayComboboxControlFrame));
 
         fun(AnonBox(MozHTMLCanvasContent));
         fun(AnonBox(MozInlineTable));
         fun(AnonBox(MozTable));
         fun(AnonBox(MozTableCell));
         fun(AnonBox(MozTableColumnGroup));
         fun(AnonBox(MozTableColumn));
-        fun(AnonBox(MozTableOuter));
+        fun(AnonBox(MozTableWrapper));
         fun(AnonBox(MozTableRowGroup));
         fun(AnonBox(MozTableRow));
 
         fun(AnonBox(MozCanvas));
         fun(AnonBox(MozPageBreak));
         fun(AnonBox(MozPage));
         fun(AnonBox(MozPageContent));
         fun(AnonBox(MozPageSequence));
--- a/servo/ports/geckolib/gecko_bindings/bindings.rs
+++ b/servo/ports/geckolib/gecko_bindings/bindings.rs
@@ -130,16 +130,17 @@ impl HeapSizeOf for nsStyleUnit { fn hea
 use structs::nsStyleUnion;
 unsafe impl Send for nsStyleUnion {}
 unsafe impl Sync for nsStyleUnion {}
 impl HeapSizeOf for nsStyleUnion { fn heap_size_of_children(&self) -> usize { 0 } }
 use structs::nsStyleCoord_CalcValue as CalcValue;
 use structs::nsStyleCoord_Calc as Calc;
 use structs::nsRestyleHint;
 use structs::ServoElementSnapshot;
+use structs::nsChangeHint;
 use structs::SheetParsingMode;
 use structs::nsMainThreadPtrHandle;
 use structs::nsMainThreadPtrHolder;
 use structs::nscolor;
 use structs::nsFont;
 use structs::FontFamilyList;
 use structs::FontFamilyType;
 use structs::nsIAtom;
@@ -288,16 +289,20 @@ extern "C" {
                                base_uri: *mut ThreadSafeURIHolder,
                                referrer: *mut ThreadSafeURIHolder,
                                principal: *mut ThreadSafePrincipalHolder);
     pub fn Gecko_CopyMozBindingFrom(des: *mut nsStyleDisplay,
                                     src: *const nsStyleDisplay);
     pub fn Gecko_GetNodeFlags(node: *mut RawGeckoNode) -> u32;
     pub fn Gecko_SetNodeFlags(node: *mut RawGeckoNode, flags: u32);
     pub fn Gecko_UnsetNodeFlags(node: *mut RawGeckoNode, flags: u32);
+    pub fn Gecko_CalcAndStoreStyleDifference(element: *mut RawGeckoElement,
+                                             newstyle:
+                                                 *mut ServoComputedValues)
+     -> nsChangeHint;
     pub fn Gecko_EnsureTArrayCapacity(array: *mut ::std::os::raw::c_void,
                                       capacity: usize, elem_size: usize);
     pub fn Gecko_EnsureImageLayersLength(layers: *mut nsStyleImageLayers,
                                          len: usize);
     pub fn Gecko_InitializeImageLayer(layer: *mut Layer,
                                       layer_type: LayerType);
     pub fn Gecko_ResetStyleCoord(unit: *mut nsStyleUnit,
                                  value: *mut nsStyleUnion);
--- a/servo/ports/geckolib/gecko_bindings/tools/regen.py
+++ b/servo/ports/geckolib/gecko_bindings/tools/regen.py
@@ -121,18 +121,17 @@ COMPILATION_TARGETS = {
             "nsStyleContent", "nsStyleUIReset", "nsStyleTable",
             "nsStyleMargin", "nsStylePadding", "nsStyleBorder",
             "nsStyleOutline", "nsStyleXUL", "nsStyleSVGReset", "nsStyleColumn",
             "nsStyleEffects", "nsStyleImage", "nsStyleGradient",
             "nsStyleCoord", "nsStyleGradientStop", "nsStyleImageLayers",
             "nsStyleImageLayers::Layer", "nsStyleImageLayers::LayerType",
             "nsStyleUnit", "nsStyleUnion", "nsStyleCoord::CalcValue",
             "nsStyleCoord::Calc", "nsRestyleHint", "ServoElementSnapshot",
-
-            "SheetParsingMode", "nsMainThreadPtrHandle",
+            "nsChangeHint", "SheetParsingMode", "nsMainThreadPtrHandle",
             "nsMainThreadPtrHolder", "nscolor", "nsFont", "FontFamilyList",
             "FontFamilyType", "nsIAtom",
         ],
         "void_types": [
             "nsINode", "nsIDocument", "nsIPrincipal", "nsIURI",
         ],
     }
 }
@@ -206,17 +205,17 @@ def build(objdir, target_name, kind_name
     assert ((kind_name is None and "build_kinds" not in current_target) or
             (kind_name in current_target["build_kinds"]))
 
     if bindgen is None:
         bindgen = os.path.join(TOOLS_DIR, "rust-bindgen")
 
     if os.path.isdir(bindgen):
         bindgen = ["cargo", "run", "--manifest-path",
-                   os.path.join(bindgen, "Cargo.toml"), "--"]
+                   os.path.join(bindgen, "Cargo.toml"), "--features", "llvm_stable", "--"]
     else:
         bindgen = [bindgen]
 
     if output_filename is None:
         filename = "{}.rs".format(target_name)
 
         if kind_name is not None:
             filename = "{}_{}.rs".format(target_name, kind_name)