aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/cssstyledeclaration.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2018-02-27 19:19:43 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2018-02-27 19:29:07 +0100
commit650e947c941768e1646affed89d65c90c5ec0281 (patch)
treed4500c72b330441e53f5001d9f73119f04453f44 /components/script/dom/cssstyledeclaration.rs
parent030509e66b9d3432c112bb5639f446535749963e (diff)
downloadservo-650e947c941768e1646affed89d65c90c5ec0281.tar.gz
servo-650e947c941768e1646affed89d65c90c5ec0281.zip
style: Make Servo deal with CSS property prefs more correctly.
Right now you could still set preffed-off properties from CSSStyleDeclaration.
Diffstat (limited to 'components/script/dom/cssstyledeclaration.rs')
-rw-r--r--components/script/dom/cssstyledeclaration.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs
index 2699bda9b07..37b1a0a4ae1 100644
--- a/components/script/dom/cssstyledeclaration.rs
+++ b/components/script/dom/cssstyledeclaration.rs
@@ -164,9 +164,17 @@ macro_rules! css_properties(
( $([$getter:ident, $setter:ident, $id:expr],)* ) => (
$(
fn $getter(&self) -> DOMString {
+ debug_assert!(
+ $id.enabled_for_all_content(),
+ "Someone forgot a #[Pref] annotation"
+ );
self.get_property_value($id)
}
fn $setter(&self, value: DOMString) -> ErrorResult {
+ debug_assert!(
+ $id.enabled_for_all_content(),
+ "Someone forgot a #[Pref] annotation"
+ );
self.set_property($id, value, DOMString::new())
}
)*
@@ -238,6 +246,10 @@ impl CSSStyleDeclaration {
return Err(Error::NoModificationAllowed);
}
+ if !id.enabled_for_all_content() {
+ return Ok(());
+ }
+
self.owner.mutate_associated_block(|pdb, changed| {
if value.is_empty() {
// Step 3