script: Map HTMLCanvasElement width and height attributes.

This commit is contained in:
Emilio Cobos Álvarez 2017-04-07 16:03:25 +02:00
parent df29d02026
commit 53cad6227e
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 63 additions and 3 deletions

View file

@ -133,7 +133,7 @@ use std::sync::Arc;
use std::time::{Duration, Instant};
use style::attr::AttrValue;
use style::context::{QuirksMode, ReflowGoal};
use style::restyle_hints::{RestyleHint, RESTYLE_STYLE_ATTRIBUTE};
use style::restyle_hints::{RestyleHint, RESTYLE_SELF, RESTYLE_STYLE_ATTRIBUTE};
use style::selector_parser::{RestyleDamage, Snapshot};
use style::shared_lock::SharedRwLock as StyleSharedRwLock;
use style::str::{HTML_SPACE_CHARACTERS, split_html_space_chars, str_join};
@ -2355,6 +2355,13 @@ impl Document {
entry.hint |= RESTYLE_STYLE_ATTRIBUTE;
}
// FIXME(emilio): This should become something like
// element.is_attribute_mapped(attr.local_name()).
if attr.local_name() == &local_name!("width") ||
attr.local_name() == &local_name!("height") {
entry.hint |= RESTYLE_SELF;
}
let mut snapshot = entry.snapshot.as_mut().unwrap();
if snapshot.attrs.is_none() {
let attrs = el.attrs()