mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
This commit is contained in:
parent
7b467ee52d
commit
cdc7bca944
188 changed files with 501 additions and 529 deletions
|
@ -10,6 +10,7 @@ use dom::bindings::inheritance::Castable;
|
|||
use dom::bindings::js::{JS, MutNullableHeap};
|
||||
use dom::bindings::js::{LayoutJS, Root, RootedReference};
|
||||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::element::{AttributeMutation, Element};
|
||||
use dom::virtualmethods::vtable_for;
|
||||
use dom::window::Window;
|
||||
|
@ -18,7 +19,6 @@ use std::cell::Ref;
|
|||
use std::mem;
|
||||
use string_cache::{Atom, Namespace};
|
||||
pub use style::attr::{AttrIdentifier, AttrValue};
|
||||
use util::str::DOMString;
|
||||
|
||||
// https://dom.spec.whatwg.org/#interface-attr
|
||||
#[dom_struct]
|
||||
|
@ -101,14 +101,13 @@ impl AttrMethods for Attr {
|
|||
|
||||
// https://dom.spec.whatwg.org/#dom-attr-value
|
||||
fn SetValue(&self, value: DOMString) {
|
||||
match self.owner() {
|
||||
None => *self.value.borrow_mut() = AttrValue::String(value),
|
||||
Some(owner) => {
|
||||
let value = owner.parse_attribute(&self.identifier.namespace,
|
||||
self.local_name(),
|
||||
value);
|
||||
self.set_value(value, owner.r());
|
||||
}
|
||||
if let Some(owner) = self.owner() {
|
||||
let value = owner.parse_attribute(&self.identifier.namespace,
|
||||
self.local_name(),
|
||||
value);
|
||||
self.set_value(value, owner.r());
|
||||
} else {
|
||||
*self.value.borrow_mut() = AttrValue::String(value.into());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue