mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Handle dynamic font color change
This commit is contained in:
parent
54cd23adb8
commit
8161d1931d
7 changed files with 80 additions and 4 deletions
|
@ -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()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue