servo: Merge #18411 - Rename VirtualMethods::attribute_is_mapped (from servo:rename-preshint-method); r=emilio
authorAnthony Ramine <n.oxyde@gmail.com>
Thu, 07 Sep 2017 15:56:01 -0500
changeset 429077 e1c49835b46a0493720127604d7333029648860a
parent 429076 8bbf531110dd428455d7e50033abd4cb989afca6
child 429078 8852f9e7fb7e3d17e5817ba582d2105827398d61
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #18411 - Rename VirtualMethods::attribute_is_mapped (from servo:rename-preshint-method); r=emilio Source-Repo: https://github.com/servo/servo Source-Revision: e9336b39a6c24037f8dce1bbc85f437af5f439d7
servo/components/script/dom/document.rs
servo/components/script/dom/element.rs
servo/components/script/dom/htmlfontelement.rs
servo/components/script/dom/virtualmethods.rs
--- a/servo/components/script/dom/document.rs
+++ b/servo/components/script/dom/document.rs
@@ -2495,17 +2495,17 @@ impl Document {
         let mut entry = self.ensure_pending_restyle(el);
         if entry.snapshot.is_none() {
             entry.snapshot = Some(Snapshot::new(el.html_element_in_html_document()));
         }
         if attr.local_name() == &local_name!("style") {
             entry.hint.insert(RESTYLE_STYLE_ATTRIBUTE);
         }
 
-        if vtable_for(el.upcast()).attribute_is_mapped(attr) {
+        if vtable_for(el.upcast()).attribute_affects_presentational_hints(attr) {
             entry.hint.insert(RESTYLE_SELF);
         }
 
         let snapshot = entry.snapshot.as_mut().unwrap();
         if attr.local_name() == &local_name!("id") {
             snapshot.id_changed = true;
         } else if attr.local_name() == &local_name!("class") {
             snapshot.class_changed = true;
--- a/servo/components/script/dom/element.rs
+++ b/servo/components/script/dom/element.rs
@@ -2298,24 +2298,24 @@ impl ElementMethods for Element {
     }
 }
 
 impl VirtualMethods for Element {
     fn super_type(&self) -> Option<&VirtualMethods> {
         Some(self.upcast::<Node>() as &VirtualMethods)
     }
 
-    fn attribute_is_mapped(&self, attr: &Attr) -> bool {
+    fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool {
         // FIXME: This should be more fine-grained, not all elements care about these.
         if attr.local_name() == &local_name!("width") ||
            attr.local_name() == &local_name!("height") {
             return true;
         }
 
-        self.super_type().unwrap().attribute_is_mapped(attr)
+        self.super_type().unwrap().attribute_affects_presentational_hints(attr)
     }
 
     fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
         self.super_type().unwrap().attribute_mutated(attr, mutation);
         let node = self.upcast::<Node>();
         let doc = node.owner_doc();
         match attr.local_name() {
             &local_name!("style") => {
--- a/servo/components/script/dom/htmlfontelement.rs
+++ b/servo/components/script/dom/htmlfontelement.rs
@@ -66,23 +66,23 @@ impl HTMLFontElementMethods for HTMLFont
     }
 }
 
 impl VirtualMethods for HTMLFontElement {
     fn super_type(&self) -> Option<&VirtualMethods> {
         Some(self.upcast::<HTMLElement>() as &VirtualMethods)
     }
 
-    fn attribute_is_mapped(&self, attr: &Attr) -> bool {
+    fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool {
         if attr.local_name() == &local_name!("color") {
             return true;
         }
 
         // FIXME: Should also return true for `size` and `face` changes!
-        self.super_type().unwrap().attribute_is_mapped(attr)
+        self.super_type().unwrap().attribute_affects_presentational_hints(attr)
     }
 
     fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
         match name {
             &local_name!("face") => AttrValue::from_atomic(value.into()),
             &local_name!("color") => AttrValue::from_legacy_color(value.into()),
             &local_name!("size") => parse_size(&value),
             _ => self.super_type().unwrap().parse_plain_attribute(name, value),
--- a/servo/components/script/dom/virtualmethods.rs
+++ b/servo/components/script/dom/virtualmethods.rs
@@ -67,19 +67,19 @@ pub trait VirtualMethods {
     fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
         if let Some(s) = self.super_type() {
             s.attribute_mutated(attr, mutation);
         }
     }
 
     /// Returns `true` if given attribute `attr` affects style of the
     /// given element.
-    fn attribute_is_mapped(&self, attr: &Attr) -> bool {
+    fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool {
         match self.super_type() {
-            Some(s) => s.attribute_is_mapped(attr),
+            Some(s) => s.attribute_affects_presentational_hints(attr),
             None => false
         }
     }
 
     /// Returns the right AttrValue variant for the attribute with name `name`
     /// on this element.
     fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
         match self.super_type() {