Handle dynamic font color change

This commit is contained in:
P. Albrecht 2017-09-07 11:24:34 +02:00
parent 54cd23adb8
commit 8161d1931d
7 changed files with 80 additions and 4 deletions

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use cssparser::RGBA;
use dom::attr::Attr;
use dom::bindings::codegen::Bindings::HTMLFontElementBinding;
use dom::bindings::codegen::Bindings::HTMLFontElementBinding::HTMLFontElementMethods;
use dom::bindings::inheritance::Castable;
@ -70,6 +71,15 @@ impl VirtualMethods for HTMLFontElement {
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
}
fn attribute_is_mapped(&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)
}
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
match name {
&local_name!("face") => AttrValue::from_atomic(value.into()),