Auto merge of #18411 - servo:rename-preshint-method, r=emilio

Rename VirtualMethods::attribute_is_mapped

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18411)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-09-07 15:56:01 -05:00 committed by GitHub
commit e9336b39a6
4 changed files with 7 additions and 7 deletions

View file

@ -2500,7 +2500,7 @@ impl Document {
entry.hint.insert(RESTYLE_STYLE_ATTRIBUTE); 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); entry.hint.insert(RESTYLE_SELF);
} }

View file

@ -2303,14 +2303,14 @@ impl VirtualMethods for Element {
Some(self.upcast::<Node>() as &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. // FIXME: This should be more fine-grained, not all elements care about these.
if attr.local_name() == &local_name!("width") || if attr.local_name() == &local_name!("width") ||
attr.local_name() == &local_name!("height") { attr.local_name() == &local_name!("height") {
return true; 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) { fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {

View file

@ -71,13 +71,13 @@ impl VirtualMethods for HTMLFontElement {
Some(self.upcast::<HTMLElement>() as &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") { if attr.local_name() == &local_name!("color") {
return true; return true;
} }
// FIXME: Should also return true for `size` and `face` changes! // 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 { fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {

View file

@ -72,9 +72,9 @@ pub trait VirtualMethods {
/// Returns `true` if given attribute `attr` affects style of the /// Returns `true` if given attribute `attr` affects style of the
/// given element. /// given element.
fn attribute_is_mapped(&self, attr: &Attr) -> bool { fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool {
match self.super_type() { match self.super_type() {
Some(s) => s.attribute_is_mapped(attr), Some(s) => s.attribute_affects_presentational_hints(attr),
None => false None => false
} }
} }