Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start precomputing presentational hints. #6311

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Introduce VirtualMethods::presentational_hints.

  • Loading branch information
Ms2ger committed Jun 22, 2015
commit ebe003d5d3d1c8f5194369bfeea49f3556b0c92b
@@ -262,6 +262,7 @@ impl<'a> AttrHelpers<'a> for &'a Attr {
*self.value.borrow_mut() = value;

if namespace_is_null {
*self.presentational_hints.borrow_mut() = vtable_for(&node).presentational_hints(self);
vtable_for(&node).after_set_attr(self)
}
}
@@ -37,6 +37,7 @@ use dom::event::Event;
use dom::htmlelement::HTMLElementTypeId;
use dom::node::{Node, NodeHelpers, NodeTypeId, CloneChildrenFlag};

use style::properties::PropertyDeclaration;
use util::str::DOMString;

use string_cache::Atom;
@@ -81,6 +82,14 @@ pub trait VirtualMethods {
}
}

/// ...
fn presentational_hints(&self, attribute: JSRef<Attr>) -> Vec<PropertyDeclaration> {
match self.super_type() {
Some(ref s) => s.presentational_hints(attribute),
_ => Vec::new(),
}
}

/// Called when a Node is appended to a tree, where 'tree_in_doc' indicates
/// whether the tree is part of a Document.
fn bind_to_tree(&self, tree_in_doc: bool) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.