Bug 1331213: Add an API to get nsMediaFeatures::features. r?heycam
We can't use the generated ones if we want a windows build.
MozReview-Commit-ID: 200LNgWl5Lm
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -14,16 +14,17 @@
#include "nsContentUtils.h"
#include "nsDOMTokenList.h"
#include "nsIContentInlines.h"
#include "nsIDOMNode.h"
#include "nsIDocument.h"
#include "nsIFrame.h"
#include "nsINode.h"
#include "nsIPrincipal.h"
+#include "nsMediaFeatures.h"
#include "nsNameSpaceManager.h"
#include "nsNetUtil.h"
#include "nsRuleNode.h"
#include "nsString.h"
#include "nsStyleStruct.h"
#include "nsStyleUtil.h"
#include "nsTArray.h"
@@ -1087,16 +1088,22 @@ Gecko_LoadStyleSheet(css::Loader* aLoade
// silently do nothing. Eventually we should be able to assert that the
// NS_NewURI succeeds, here.
return;
}
aLoader->LoadChildSheet(aParent, uri, media, nullptr, aImportRule, nullptr);
}
+const nsMediaFeature*
+Gecko_GetMediaFeatures()
+{
+ return nsMediaFeatures::features;
+}
+
NS_IMPL_THREADSAFE_FFI_REFCOUNTING(nsCSSValueSharedList, CSSValueSharedList);
#define STYLE_STRUCT(name, checkdata_cb) \
\
void \
Gecko_Construct_Default_nsStyle##name(nsStyle##name* ptr, \
const nsPresContext* pres_context) \
{ \
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -32,16 +32,17 @@ struct nsFont;
namespace mozilla {
class ServoStyleSheet;
class FontFamilyList;
enum FontFamilyType : uint32_t;
}
using mozilla::FontFamilyList;
using mozilla::FontFamilyType;
using mozilla::ServoElementSnapshot;
+struct nsMediaFeature;
struct nsStyleList;
struct nsStyleImage;
struct nsStyleGradientStop;
class nsStyleGradient;
class nsStyleCoord;
struct nsStyleDisplay;
#define NS_DECL_THREADSAFE_FFI_REFCOUNTING(class_, name_) \
@@ -289,16 +290,18 @@ void Gecko_CSSValue_SetNumber(nsCSSValue
void Gecko_CSSValue_SetKeyword(nsCSSValueBorrowedMut css_value, nsCSSKeyword keyword);
void Gecko_CSSValue_SetPercentage(nsCSSValueBorrowedMut css_value, float percent);
void Gecko_CSSValue_SetAngle(nsCSSValueBorrowedMut css_value, float radians);
void Gecko_CSSValue_SetCalc(nsCSSValueBorrowedMut css_value, nsStyleCoord::CalcValue calc);
void Gecko_CSSValue_SetFunction(nsCSSValueBorrowedMut css_value, int32_t len);
nsCSSValueBorrowedMut Gecko_CSSValue_GetArrayItem(nsCSSValueBorrowedMut css_value, int32_t index);
NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsCSSValueSharedList, CSSValueSharedList);
+const nsMediaFeature* Gecko_GetMediaFeatures();
+
// Style-struct management.
#define STYLE_STRUCT(name, checkdata_cb) \
void Gecko_Construct_Default_nsStyle##name( \
nsStyle##name* ptr, \
RawGeckoPresContextBorrowed pres_context); \
void Gecko_CopyConstruct_nsStyle##name(nsStyle##name* ptr, \
const nsStyle##name* other); \
void Gecko_Destroy_nsStyle##name(nsStyle##name* ptr);
--- a/servo/components/style/build_gecko.rs
+++ b/servo/components/style/build_gecko.rs
@@ -499,16 +499,17 @@ mod bindings {
"nsCSSPropertyID",
"nsCSSShadowArray",
"nsCSSValue",
"nsCSSValueSharedList",
"nsChangeHint",
"nsCursorImage",
"nsFont",
"nsIAtom",
+ "nsMediaFeature",
"nsRestyleHint",
"nsStyleBackground",
"nsStyleBorder",
"nsStyleColor",
"nsStyleColumn",
"nsStyleContent",
"nsStyleContext",
"nsStyleCoord",
--- a/servo/components/style/gecko_bindings/bindings.rs
+++ b/servo/components/style/gecko_bindings/bindings.rs
@@ -22,16 +22,17 @@ use gecko_bindings::structs::nsCSSKeywor
use gecko_bindings::structs::nsCSSPropertyID;
use gecko_bindings::structs::nsCSSShadowArray;
use gecko_bindings::structs::nsCSSValue;
use gecko_bindings::structs::nsCSSValueSharedList;
use gecko_bindings::structs::nsChangeHint;
use gecko_bindings::structs::nsCursorImage;
use gecko_bindings::structs::nsFont;
use gecko_bindings::structs::nsIAtom;
+use gecko_bindings::structs::nsMediaFeature;
use gecko_bindings::structs::nsRestyleHint;
use gecko_bindings::structs::nsStyleBackground;
unsafe impl Send for nsStyleBackground {}
unsafe impl Sync for nsStyleBackground {}
use gecko_bindings::structs::nsStyleBorder;
unsafe impl Send for nsStyleBorder {}
unsafe impl Sync for nsStyleBorder {}
use gecko_bindings::structs::nsStyleColor;
@@ -737,16 +738,19 @@ extern "C" {
pub fn Gecko_AddRefCSSValueSharedListArbitraryThread(aPtr:
*mut nsCSSValueSharedList);
}
extern "C" {
pub fn Gecko_ReleaseCSSValueSharedListArbitraryThread(aPtr:
*mut nsCSSValueSharedList);
}
extern "C" {
+ pub fn Gecko_GetMediaFeatures() -> *const nsMediaFeature;
+}
+extern "C" {
pub fn Gecko_Construct_Default_nsStyleFont(ptr: *mut nsStyleFont,
pres_context:
RawGeckoPresContextBorrowed);
}
extern "C" {
pub fn Gecko_CopyConstruct_nsStyleFont(ptr: *mut nsStyleFont,
other: *const nsStyleFont);
}