mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Initial support for custom properties in CSSStyleDeclaration
This commit is contained in:
parent
d56ea10770
commit
feaf6f4c3f
9 changed files with 471 additions and 27 deletions
|
@ -650,7 +650,7 @@ impl Element {
|
|||
if let &mut Some(ref mut declarations) = &mut *inline_declarations {
|
||||
let index = declarations.normal
|
||||
.iter()
|
||||
.position(|decl| decl.name() == property);
|
||||
.position(|decl| decl.matches(property));
|
||||
if let Some(index) = index {
|
||||
Arc::make_mut(&mut declarations.normal).remove(index);
|
||||
return;
|
||||
|
@ -658,7 +658,7 @@ impl Element {
|
|||
|
||||
let index = declarations.important
|
||||
.iter()
|
||||
.position(|decl| decl.name() == property);
|
||||
.position(|decl| decl.matches(property));
|
||||
if let Some(index) = index {
|
||||
Arc::make_mut(&mut declarations.important).remove(index);
|
||||
return;
|
||||
|
@ -715,7 +715,8 @@ impl Element {
|
|||
let to = Arc::make_mut(to);
|
||||
let mut new_from = Vec::new();
|
||||
for declaration in from.drain(..) {
|
||||
if properties.contains(&declaration.name()) {
|
||||
let name = declaration.name();
|
||||
if properties.iter().any(|p| name == **p) {
|
||||
to.push(declaration)
|
||||
} else {
|
||||
new_from.push(declaration)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue