Bug 1367275 - Part 2: stylo: Support -moz-window-shadow; r?xidorn
MozReview-Commit-ID: S5yVmbfLqa
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -1056,16 +1056,27 @@ enum class StyleGridTrackBreadth : uint8
#define NS_STYLE_GRADIENT_SIZE_EXPLICIT_SIZE 4
// See nsStyleSVG
// -moz-context-properties
#define NS_STYLE_CONTEXT_PROPERTY_FILL (1 << 0)
#define NS_STYLE_CONTEXT_PROPERTY_STROKE (1 << 1)
+/*
+ * -moz-window-shadow
+ * Also used in widget code
+ */
+
+#define NS_STYLE_WINDOW_SHADOW_NONE 0
+#define NS_STYLE_WINDOW_SHADOW_DEFAULT 1
+#define NS_STYLE_WINDOW_SHADOW_MENU 2
+#define NS_STYLE_WINDOW_SHADOW_TOOLTIP 3
+#define NS_STYLE_WINDOW_SHADOW_SHEET 4
+
// dominant-baseline
#define NS_STYLE_DOMINANT_BASELINE_AUTO 0
#define NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT 1
#define NS_STYLE_DOMINANT_BASELINE_NO_CHANGE 2
#define NS_STYLE_DOMINANT_BASELINE_RESET_SIZE 3
#define NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC 4
#define NS_STYLE_DOMINANT_BASELINE_ALPHABETIC 5
#define NS_STYLE_DOMINANT_BASELINE_HANGING 6
--- a/servo/components/style/gecko/generated/structs_debug.rs
+++ b/servo/components/style/gecko/generated/structs_debug.rs
@@ -801,16 +801,21 @@ pub mod root {
pub const NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE: ::std::os::raw::c_uint =
2;
pub const NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER: ::std::os::raw::c_uint =
3;
pub const NS_STYLE_GRADIENT_SIZE_EXPLICIT_SIZE: ::std::os::raw::c_uint =
4;
pub const NS_STYLE_CONTEXT_PROPERTY_FILL: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_CONTEXT_PROPERTY_STROKE: ::std::os::raw::c_uint = 2;
+ pub const NS_STYLE_WINDOW_SHADOW_NONE: ::std::os::raw::c_uint = 0;
+ pub const NS_STYLE_WINDOW_SHADOW_DEFAULT: ::std::os::raw::c_uint = 1;
+ pub const NS_STYLE_WINDOW_SHADOW_MENU: ::std::os::raw::c_uint = 2;
+ pub const NS_STYLE_WINDOW_SHADOW_TOOLTIP: ::std::os::raw::c_uint = 3;
+ pub const NS_STYLE_WINDOW_SHADOW_SHEET: ::std::os::raw::c_uint = 4;
pub const NS_STYLE_DOMINANT_BASELINE_AUTO: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT: ::std::os::raw::c_uint =
1;
pub const NS_STYLE_DOMINANT_BASELINE_NO_CHANGE: ::std::os::raw::c_uint =
2;
pub const NS_STYLE_DOMINANT_BASELINE_RESET_SIZE: ::std::os::raw::c_uint =
3;
pub const NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC: ::std::os::raw::c_uint =
@@ -34449,26 +34454,26 @@ pub mod root {
"Size of template specialization: " , stringify ! (
root::nsCharTraits ) ));
assert_eq!(::std::mem::align_of::<root::nsCharTraits>() , 1usize ,
concat ! (
"Alignment of template specialization: " , stringify ! (
root::nsCharTraits ) ));
}
#[test]
- fn __bindgen_test_layout__bindgen_ty_id_185241_instantiation_32() {
+ fn __bindgen_test_layout__bindgen_ty_id_185251_instantiation_32() {
assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( u8 )
));
assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! (
"Alignment of template specialization: " , stringify ! ( u8
) ));
}
#[test]
- fn __bindgen_test_layout__bindgen_ty_id_185277_instantiation_33() {
+ fn __bindgen_test_layout__bindgen_ty_id_185287_instantiation_33() {
assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( u8 )
));
assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! (
"Alignment of template specialization: " , stringify ! ( u8
) ));
}
#[test]
--- a/servo/components/style/gecko/generated/structs_release.rs
+++ b/servo/components/style/gecko/generated/structs_release.rs
@@ -801,16 +801,21 @@ pub mod root {
pub const NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE: ::std::os::raw::c_uint =
2;
pub const NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER: ::std::os::raw::c_uint =
3;
pub const NS_STYLE_GRADIENT_SIZE_EXPLICIT_SIZE: ::std::os::raw::c_uint =
4;
pub const NS_STYLE_CONTEXT_PROPERTY_FILL: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_CONTEXT_PROPERTY_STROKE: ::std::os::raw::c_uint = 2;
+ pub const NS_STYLE_WINDOW_SHADOW_NONE: ::std::os::raw::c_uint = 0;
+ pub const NS_STYLE_WINDOW_SHADOW_DEFAULT: ::std::os::raw::c_uint = 1;
+ pub const NS_STYLE_WINDOW_SHADOW_MENU: ::std::os::raw::c_uint = 2;
+ pub const NS_STYLE_WINDOW_SHADOW_TOOLTIP: ::std::os::raw::c_uint = 3;
+ pub const NS_STYLE_WINDOW_SHADOW_SHEET: ::std::os::raw::c_uint = 4;
pub const NS_STYLE_DOMINANT_BASELINE_AUTO: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT: ::std::os::raw::c_uint =
1;
pub const NS_STYLE_DOMINANT_BASELINE_NO_CHANGE: ::std::os::raw::c_uint =
2;
pub const NS_STYLE_DOMINANT_BASELINE_RESET_SIZE: ::std::os::raw::c_uint =
3;
pub const NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC: ::std::os::raw::c_uint =
@@ -33977,26 +33982,26 @@ pub mod root {
"Size of template specialization: " , stringify ! (
root::nsCharTraits ) ));
assert_eq!(::std::mem::align_of::<root::nsCharTraits>() , 1usize ,
concat ! (
"Alignment of template specialization: " , stringify ! (
root::nsCharTraits ) ));
}
#[test]
- fn __bindgen_test_layout__bindgen_ty_id_182965_instantiation_32() {
+ fn __bindgen_test_layout__bindgen_ty_id_182975_instantiation_32() {
assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( u8 )
));
assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! (
"Alignment of template specialization: " , stringify ! ( u8
) ));
}
#[test]
- fn __bindgen_test_layout__bindgen_ty_id_183001_instantiation_33() {
+ fn __bindgen_test_layout__bindgen_ty_id_183011_instantiation_33() {
assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( u8 )
));
assert_eq!(::std::mem::align_of::<u8>() , 1usize , concat ! (
"Alignment of template specialization: " , stringify ! ( u8
) ));
}
#[test]
--- a/servo/components/style/properties/longhand/ui.mako.rs
+++ b/servo/components/style/properties/longhand/ui.mako.rs
@@ -26,16 +26,23 @@
spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select")}
${helpers.single_keyword("-moz-window-dragging", "default drag no-drag", products="gecko",
gecko_ffi_name="mWindowDragging",
gecko_enum_prefix="StyleWindowDragging",
animation_value_type="none",
spec="None (Nonstandard Firefox-only property)")}
+${helpers.single_keyword("-moz-window-shadow", "none default menu tooltip sheet", products="gecko",
+ gecko_ffi_name="mWindowShadow",
+ gecko_constant_prefix="NS_STYLE_WINDOW_SHADOW",
+ animation_value_type="none",
+ internal=True,
+ spec="None (Nonstandard internal property)")}
+
<%helpers:longhand name="-moz-force-broken-image-icon"
products="gecko"
animation_value_type="none"
spec="None (Nonstandard Firefox-only property)">
use std::fmt;
use style_traits::ToCss;
use values::computed::ComputedValueAsSpecified;
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -13,16 +13,17 @@
#include "nsStringGlue.h"
#include "nsCOMPtr.h"
#include "nsWidgetInitData.h"
#include "nsTArray.h"
#include "nsITheme.h"
#include "nsITimer.h"
#include "nsRegionFwd.h"
+#include "nsStyleConsts.h"
#include "nsXULAppAPI.h"
#include "mozilla/Maybe.h"
#include "mozilla/EventForwards.h"
#include "mozilla/layers/LayersTypes.h"
#include "mozilla/RefPtr.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/gfx/Point.h"
#include "mozilla/widget/IMEData.h"
@@ -143,26 +144,16 @@ typedef void* nsNativeWidget;
#define NS_PRESENTATION_WINDOW 101
#define NS_PRESENTATION_SURFACE 102
#endif
#define NS_IWIDGET_IID \
{ 0x06396bf6, 0x2dd8, 0x45e5, \
{ 0xac, 0x45, 0x75, 0x26, 0x53, 0xb1, 0xc9, 0x80 } }
-/*
- * Window shadow styles
- * Also used for the -moz-window-shadow CSS property
- */
-
-#define NS_STYLE_WINDOW_SHADOW_NONE 0
-#define NS_STYLE_WINDOW_SHADOW_DEFAULT 1
-#define NS_STYLE_WINDOW_SHADOW_MENU 2
-#define NS_STYLE_WINDOW_SHADOW_TOOLTIP 3
-#define NS_STYLE_WINDOW_SHADOW_SHEET 4
/**
* Transparency modes
*/
enum nsTransparencyMode {
eTransparencyOpaque = 0, // Fully opaque
eTransparencyTransparent, // Parts of the window may be transparent