mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Fix cloning of Element's attributes
No virtual method was invoked when copies of attributes were appended to newly-cloned elements.
This commit is contained in:
parent
d5ee58caf2
commit
650afc9d3e
4 changed files with 10 additions and 56 deletions
|
@ -83,7 +83,7 @@ use url::UrlParser;
|
|||
|
||||
use std::ascii::AsciiExt;
|
||||
use std::borrow::{Cow, ToOwned};
|
||||
use std::cell::{Ref, RefMut};
|
||||
use std::cell::Ref;
|
||||
use std::default::Default;
|
||||
use std::mem;
|
||||
use std::sync::Arc;
|
||||
|
@ -597,10 +597,6 @@ impl Element {
|
|||
self.attrs.borrow()
|
||||
}
|
||||
|
||||
pub fn attrs_mut(&self) -> RefMut<Vec<JS<Attr>>> {
|
||||
self.attrs.borrow_mut()
|
||||
}
|
||||
|
||||
pub fn style_attribute(&self) -> &DOMRefCell<Option<PropertyDeclarationBlock>> {
|
||||
&self.style_attribute
|
||||
}
|
||||
|
|
|
@ -1768,15 +1768,12 @@ impl Node {
|
|||
let node_elem = ElementCast::to_ref(node).unwrap();
|
||||
let copy_elem = ElementCast::to_ref(copy.r()).unwrap();
|
||||
|
||||
let window = document.r().window();
|
||||
for ref attr in &*node_elem.attrs() {
|
||||
let attr = attr.root();
|
||||
let newattr =
|
||||
Attr::new(window.r(),
|
||||
attr.r().local_name().clone(), attr.r().value().clone(),
|
||||
attr.r().name().clone(), attr.r().namespace().clone(),
|
||||
attr.r().prefix().clone(), Some(copy_elem));
|
||||
copy_elem.attrs_mut().push(JS::from_rooted(&newattr));
|
||||
for attr in node_elem.attrs().iter().map(JS::root) {
|
||||
copy_elem.push_new_attribute(attr.local_name().clone(),
|
||||
attr.value().clone(),
|
||||
attr.name().clone(),
|
||||
attr.namespace().clone(),
|
||||
attr.prefix().clone());
|
||||
}
|
||||
},
|
||||
_ => ()
|
||||
|
|
|
@ -27,12 +27,6 @@
|
|||
[Detached Element.matches: :lang pseudo-class selector, matching specified language with partial value (with no refNodes): #pseudo-lang-div3:lang(en)]
|
||||
expected: FAIL
|
||||
|
||||
[Detached Element.matches: :enabled pseudo-class selector, matching all disabled form controls (with no refNodes): #pseudo-ui :disabled]
|
||||
expected: FAIL
|
||||
|
||||
[Detached Element.matches: :checked pseudo-class selector, matching checked radio buttons and checkboxes (with no refNodes): #pseudo-ui :checked]
|
||||
expected: FAIL
|
||||
|
||||
[Fragment Element.matches: Attribute hyphen-separated list selector, matching lang attribute with partial value (with no refNodes): #attr-hyphen-div3[lang|="en"\]]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -42,12 +36,6 @@
|
|||
[Fragment Element.matches: :lang pseudo-class selector, matching specified language with partial value (with no refNodes): #pseudo-lang-div3:lang(en)]
|
||||
expected: FAIL
|
||||
|
||||
[Fragment Element.matches: :enabled pseudo-class selector, matching all disabled form controls (with no refNodes): #pseudo-ui :disabled]
|
||||
expected: FAIL
|
||||
|
||||
[Fragment Element.matches: :checked pseudo-class selector, matching checked radio buttons and checkboxes (with no refNodes): #pseudo-ui :checked]
|
||||
expected: FAIL
|
||||
|
||||
[In-document Element.matches: Universal selector, matching all children of the specified reference element (with refNode Element): >*]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -120,21 +120,6 @@
|
|||
[Detached Element.querySelector: :lang pseudo-class selector, not matching incorrect language: #pseudo-lang-div4:lang(es-AR)]
|
||||
expected: FAIL
|
||||
|
||||
[Detached Element.querySelectorAll: :enabled pseudo-class selector, matching all enabled form controls: #pseudo-ui :enabled]
|
||||
expected: FAIL
|
||||
|
||||
[Detached Element.querySelectorAll: :enabled pseudo-class selector, matching all disabled form controls: #pseudo-ui :disabled]
|
||||
expected: FAIL
|
||||
|
||||
[Detached Element.querySelector: :enabled pseudo-class selector, matching all disabled form controls: #pseudo-ui :disabled]
|
||||
expected: FAIL
|
||||
|
||||
[Detached Element.querySelectorAll: :checked pseudo-class selector, matching checked radio buttons and checkboxes: #pseudo-ui :checked]
|
||||
expected: FAIL
|
||||
|
||||
[Detached Element.querySelector: :checked pseudo-class selector, matching checked radio buttons and checkboxes: #pseudo-ui :checked]
|
||||
expected: FAIL
|
||||
|
||||
[Detached Element.querySelectorAll: :first-line pseudo-element (one-colon syntax) selector, not matching any elements: #pseudo-element:first-line]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -201,21 +186,6 @@
|
|||
[Fragment.querySelector: :lang pseudo-class selector, not matching incorrect language: #pseudo-lang-div4:lang(es-AR)]
|
||||
expected: FAIL
|
||||
|
||||
[Fragment.querySelectorAll: :enabled pseudo-class selector, matching all enabled form controls: #pseudo-ui :enabled]
|
||||
expected: FAIL
|
||||
|
||||
[Fragment.querySelectorAll: :enabled pseudo-class selector, matching all disabled form controls: #pseudo-ui :disabled]
|
||||
expected: FAIL
|
||||
|
||||
[Fragment.querySelector: :enabled pseudo-class selector, matching all disabled form controls: #pseudo-ui :disabled]
|
||||
expected: FAIL
|
||||
|
||||
[Fragment.querySelectorAll: :checked pseudo-class selector, matching checked radio buttons and checkboxes: #pseudo-ui :checked]
|
||||
expected: FAIL
|
||||
|
||||
[Fragment.querySelector: :checked pseudo-class selector, matching checked radio buttons and checkboxes: #pseudo-ui :checked]
|
||||
expected: FAIL
|
||||
|
||||
[Fragment.querySelectorAll: :first-line pseudo-element (one-colon syntax) selector, not matching any elements: #pseudo-element:first-line]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -759,3 +729,6 @@
|
|||
[In-document Element.querySelectorAll: Syntax, group of selectors separator, no whitespace: #group em,#group strong]
|
||||
expected: FAIL
|
||||
|
||||
[In-document Element.querySelectorAll: :enabled pseudo-class selector, matching all disabled form controls: #pseudo-ui :disabled]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue