aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXidorn Quan <me@upsuper.org>2016-11-03 14:47:05 +1100
committerXidorn Quan <me@upsuper.org>2016-11-03 14:56:36 +1100
commiteb3bbc6bb9fafd8c65433d4564dceafbb7d5511f (patch)
tree6b119738175ffccdfd169eadd9b31966a74025fd
parent1af2edf190f13881095cf5186218653e9322c826 (diff)
downloadservo-eb3bbc6bb9fafd8c65433d4564dceafbb7d5511f.tar.gz
servo-eb3bbc6bb9fafd8c65433d4564dceafbb7d5511f.zip
Add binding functions for cssText getter / setter
-rw-r--r--components/style/gecko_bindings/bindings.rs5
-rw-r--r--ports/geckolib/glue.rs9
2 files changed, 13 insertions, 1 deletions
diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs
index f2a2c19f1a5..adeecc3925d 100644
--- a/components/style/gecko_bindings/bindings.rs
+++ b/components/style/gecko_bindings/bindings.rs
@@ -933,6 +933,11 @@ extern "C" {
-> bool;
}
extern "C" {
+ pub fn Servo_DeclarationBlock_GetCssText(declarations:
+ RawServoDeclarationBlockBorrowed,
+ result: *mut nsAString_internal);
+}
+extern "C" {
pub fn Servo_DeclarationBlock_SerializeOneValue(declarations:
RawServoDeclarationBlockBorrowed,
buffer: *mut nsString);
diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs
index b266a4c7084..4e3062faa0b 100644
--- a/ports/geckolib/glue.rs
+++ b/ports/geckolib/glue.rs
@@ -26,9 +26,9 @@ use style::gecko_bindings::bindings::{RawServoStyleSetBorrowed, RawServoStyleSet
use style::gecko_bindings::bindings::{RawServoStyleSheetBorrowed, ServoComputedValuesBorrowed};
use style::gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedValuesStrong};
use style::gecko_bindings::bindings::{ThreadSafePrincipalHolder, ThreadSafeURIHolder};
+use style::gecko_bindings::bindings::{nsACString, nsAString};
use style::gecko_bindings::bindings::Gecko_Utf8SliceToString;
use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
-use style::gecko_bindings::bindings::nsACString;
use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom};
use style::gecko_bindings::structs::ServoElementSnapshot;
use style::gecko_bindings::structs::nsRestyleHint;
@@ -444,6 +444,13 @@ pub extern "C" fn Servo_DeclarationBlock_Equals(a: RawServoDeclarationBlockBorro
}
#[no_mangle]
+pub extern "C" fn Servo_DeclarationBlock_GetCssText(declarations: RawServoDeclarationBlockBorrowed,
+ result: *mut nsAString) {
+ let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
+ declarations.read().to_css(unsafe { result.as_mut().unwrap() }).unwrap();
+}
+
+#[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
declarations: RawServoDeclarationBlockBorrowed,
buffer: *mut nsString)