servo: Merge #11326 - Move DOMString back to script (from nox:non-geckolib); r=Ms2ger

Source-Repo: https://github.com/servo/servo
Source-Revision: 6abcd793d780369767385b01b02ee725d6b10585
This commit is contained in:
Anthony Ramine 2016-05-24 02:07:29 -07:00
Родитель b32c6be3eb
Коммит 5aa3cb5ed3
188 изменённых файлов: 501 добавлений и 529 удалений

Просмотреть файл

@ -15,6 +15,7 @@ use dom::bindings::conversions::{FromJSValConvertible, jsstring_to_str};
use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::browsingcontext::{BrowsingContext, IterableContext};
use dom::element::Element;
use dom::node::Node;
@ -27,7 +28,6 @@ use script_thread::get_browsing_context;
use std::ffi::CStr;
use std::str;
use style::properties::longhands::{margin_top, margin_right, margin_bottom, margin_left};
use util::str::DOMString;
use uuid::Uuid;
#[allow(unsafe_code)]

Просмотреть файл

@ -4,12 +4,12 @@
use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::str::DOMString;
use dom::element::Element;
use dom::event::{Event, EventBubbles, EventCancelable};
use dom::eventtarget::EventTarget;
use dom::mouseevent::MouseEvent;
use dom::node::window_from_node;
use util::str::DOMString;
/// Trait for elements with defined activation behavior
pub trait Activatable {

Просмотреть файл

@ -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());
}
}

Просмотреть файл

@ -10,9 +10,9 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::DOMString;
use dom::event::{Event, EventBubbles, EventCancelable};
use string_cache::Atom;
use util::str::DOMString;
// https://html.spec.whatwg.org/multipage/#beforeunloadevent
#[dom_struct]

Просмотреть файл

@ -2087,16 +2087,15 @@ def UnionTypes(descriptors, dictionaries, callbacks, config):
'dom::bindings::conversions::FromJSValConvertible',
'dom::bindings::conversions::ToJSValConvertible',
'dom::bindings::conversions::ConversionBehavior',
'dom::bindings::conversions::root_from_handlevalue',
'dom::bindings::conversions::StringificationBehavior',
'dom::bindings::conversions::root_from_handlevalue',
'dom::bindings::error::throw_not_in_union',
'dom::bindings::js::Root',
'dom::bindings::str::USVString',
'dom::bindings::str::{DOMString, USVString}',
'dom::types::*',
'js::jsapi::JSContext',
'js::jsapi::{HandleValue, MutableHandleValue}',
'js::jsval::JSVal',
'util::str::DOMString',
]
# Now find all the things we'll need as arguments and return values because
@ -5598,14 +5597,12 @@ class CGBindingRoot(CGThing):
'dom::bindings::proxyhandler::{ensure_expando_object, fill_property_descriptor}',
'dom::bindings::proxyhandler::{get_expando_object, get_property_descriptor}',
'dom::bindings::num::Finite',
'dom::bindings::str::ByteString',
'dom::bindings::str::USVString',
'dom::bindings::str::{ByteString, DOMString, USVString}',
'dom::bindings::trace::RootedVec',
'dom::bindings::weakref::{DOM_WEAK_SLOT, WeakBox, WeakReferenceable}',
'mem::heap_size_of_raw_self_and_children',
'libc',
'util::prefs',
'util::str::DOMString',
'std::borrow::ToOwned',
'std::cmp',
'std::mem',

Просмотреть файл

@ -36,27 +36,26 @@ use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::num::Finite;
use dom::bindings::reflector::{Reflectable, Reflector};
use dom::bindings::str::{ByteString, USVString};
use dom::bindings::str::{ByteString, DOMString, USVString};
use dom::bindings::utils::DOMClass;
use js;
pub use js::conversions::{FromJSValConvertible, ToJSValConvertible, ConversionBehavior};
use js::conversions::latin1_to_string;
use js::error::throw_type_error;
use js::glue::{GetProxyPrivate, IsWrapper};
use js::glue::{RUST_JSID_IS_STRING, RUST_JSID_TO_STRING, UnwrapObject};
use js::jsapi::{HandleId, HandleObject, HandleValue, JS_GetClass};
use js::jsapi::{JSClass, JSContext, JSObject, MutableHandleValue};
use js::jsapi::{JS_GetLatin1StringCharsAndLength, JS_GetReservedSlot};
use js::jsapi::{JS_GetObjectAsArrayBufferView, JS_GetArrayBufferViewType};
use js::jsapi::{JS_GetTwoByteStringCharsAndLength, JS_IsArrayObject, JS_NewStringCopyN};
use js::jsapi::{JS_StringHasLatin1Chars, JS_WrapValue};
use js::jsapi::{Type};
use js::jsapi::{HandleId, HandleObject, HandleValue, JSClass, JSContext};
use js::jsapi::{JSObject, JSString, JS_GetArrayBufferViewType, JS_GetClass};
use js::jsapi::{JS_GetLatin1StringCharsAndLength, JS_GetObjectAsArrayBufferView};
use js::jsapi::{JS_GetReservedSlot, JS_GetTwoByteStringCharsAndLength};
use js::jsapi::{JS_IsArrayObject, JS_NewStringCopyN, JS_StringHasLatin1Chars};
use js::jsapi::{JS_WrapValue, MutableHandleValue, Type};
use js::jsval::{ObjectValue, StringValue};
use js::rust::ToString;
use libc;
use num_traits::Float;
use std::{ptr, mem, slice};
pub use util::non_geckolib::{StringificationBehavior, jsstring_to_str};
use util::str::DOMString;
use std::{char, mem, ptr, slice};
use util::opts;
/// A trait to check whether a given `JSObject` implements an IDL interface.
pub trait IDLInterface {
@ -125,6 +124,82 @@ impl ToJSValConvertible for USVString {
}
}
/// Behavior for stringification of `JSVal`s.
#[derive(PartialEq, Clone)]
pub enum StringificationBehavior {
/// Convert `null` to the string `"null"`.
Default,
/// Convert `null` to the empty string.
Empty,
}
// https://heycam.github.io/webidl/#es-DOMString
impl ToJSValConvertible for DOMString {
unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) {
(**self).to_jsval(cx, rval);
}
}
// https://heycam.github.io/webidl/#es-DOMString
impl FromJSValConvertible for DOMString {
type Config = StringificationBehavior;
unsafe fn from_jsval(cx: *mut JSContext,
value: HandleValue,
null_behavior: StringificationBehavior)
-> Result<DOMString, ()> {
if null_behavior == StringificationBehavior::Empty &&
value.get().is_null() {
Ok(DOMString::new())
} else {
let jsstr = ToString(cx, value);
if jsstr.is_null() {
debug!("ToString failed");
Err(())
} else {
Ok(jsstring_to_str(cx, jsstr))
}
}
}
}
/// Convert the given `JSString` to a `DOMString`. Fails if the string does not
/// contain valid UTF-16.
pub unsafe fn jsstring_to_str(cx: *mut JSContext, s: *mut JSString) -> DOMString {
let latin1 = JS_StringHasLatin1Chars(s);
DOMString::from_string(if latin1 {
latin1_to_string(cx, s)
} else {
let mut length = 0;
let chars = JS_GetTwoByteStringCharsAndLength(cx, ptr::null(), s, &mut length);
assert!(!chars.is_null());
let potentially_ill_formed_utf16 = slice::from_raw_parts(chars, length as usize);
let mut s = String::with_capacity(length as usize);
for item in char::decode_utf16(potentially_ill_formed_utf16.iter().cloned()) {
match item {
Ok(c) => s.push(c),
Err(_) => {
// FIXME: Add more info like document URL in the message?
macro_rules! message {
() => {
"Found an unpaired surrogate in a DOM string. \
If you see this in real web content, \
please comment on https://github.com/servo/servo/issues/6564"
}
}
if opts::get().replace_surrogates {
error!(message!());
s.push('\u{FFFD}');
} else {
panic!(concat!(message!(), " Use `-Z replace-surrogates` \
on the command line to make this non-fatal."));
}
}
}
}
s
})
}
// http://heycam.github.io/webidl/#es-USVString
impl FromJSValConvertible for USVString {
type Config = ();

Просмотреть файл

@ -6,11 +6,14 @@
use std::ascii::AsciiExt;
use std::borrow::ToOwned;
use std::fmt;
use std::hash::{Hash, Hasher};
use std::mem;
use std::ops;
use std::ops::{Deref, DerefMut};
use std::str;
use std::str::FromStr;
use std::str::{Bytes, FromStr};
use string_cache::Atom;
/// Encapsulates the IDL `ByteString` type.
#[derive(JSTraceable, Clone, Eq, PartialEq, HeapSizeOf)]
@ -114,3 +117,119 @@ pub fn is_token(s: &[u8]) -> bool {
}
})
}
/// A DOMString.
#[derive(Clone, Debug, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd)]
pub struct DOMString(String);
impl !Send for DOMString {}
impl DOMString {
/// Creates a new `DOMString`.
pub fn new() -> DOMString {
DOMString(String::new())
}
/// Creates a new `DOMString` from a `String`.
pub fn from_string(s: String) -> DOMString {
DOMString(s)
}
/// Appends a given string slice onto the end of this String.
pub fn push_str(&mut self, string: &str) {
self.0.push_str(string)
}
/// Truncates this `DOMString`, removing all contents.
pub fn clear(&mut self) {
self.0.clear()
}
/// An iterator over the bytes of this `DOMString`.
pub fn bytes(&self) -> Bytes {
self.0.bytes()
}
}
impl Default for DOMString {
fn default() -> Self {
DOMString(String::new())
}
}
impl Deref for DOMString {
type Target = str;
#[inline]
fn deref(&self) -> &str {
&self.0
}
}
impl DerefMut for DOMString {
#[inline]
fn deref_mut(&mut self) -> &mut str {
&mut self.0
}
}
impl AsRef<str> for DOMString {
fn as_ref(&self) -> &str {
&self.0
}
}
impl fmt::Display for DOMString {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Display::fmt(&**self, f)
}
}
impl PartialEq<str> for DOMString {
fn eq(&self, other: &str) -> bool {
&**self == other
}
}
impl<'a> PartialEq<&'a str> for DOMString {
fn eq(&self, other: &&'a str) -> bool {
&**self == *other
}
}
impl From<String> for DOMString {
fn from(contents: String) -> DOMString {
DOMString(contents)
}
}
impl<'a> From<&'a str> for DOMString {
fn from(contents: &str) -> DOMString {
DOMString::from(String::from(contents))
}
}
impl From<DOMString> for Atom {
fn from(contents: DOMString) -> Atom {
Atom::from(contents.0)
}
}
impl From<DOMString> for String {
fn from(contents: DOMString) -> String {
contents.0
}
}
impl Into<Vec<u8>> for DOMString {
fn into(self) -> Vec<u8> {
self.0.into()
}
}
impl Extend<char> for DOMString {
fn extend<I>(&mut self, iterable: I) where I: IntoIterator<Item=char> {
self.0.extend(iterable)
}
}

Просмотреть файл

@ -37,6 +37,7 @@ use devtools_traits::WorkerId;
use dom::bindings::js::{JS, Root};
use dom::bindings::refcounted::Trusted;
use dom::bindings::reflector::{Reflectable, Reflector};
use dom::bindings::str::DOMString;
use dom::bindings::utils::WindowProxyHandler;
use dom::worker::SharedRt;
use encoding::types::EncodingRef;
@ -89,7 +90,7 @@ use style::selector_impl::PseudoElement;
use style::values::specified::Length;
use url::Origin as UrlOrigin;
use url::Url;
use util::str::{DOMString, LengthOrPercentageOrAuto};
use util::str::LengthOrPercentageOrAuto;
use uuid::Uuid;
use webrender_traits::WebGLError;

Просмотреть файл

@ -7,9 +7,11 @@
use dom::bindings::codegen::InterfaceObjectMap;
use dom::bindings::codegen::PrototypeList;
use dom::bindings::codegen::PrototypeList::{MAX_PROTO_CHAIN_LENGTH, PROTO_OR_IFACE_LENGTH};
use dom::bindings::conversions::{DOM_OBJECT_SLOT, is_dom_class, private_from_proto_check};
use dom::bindings::conversions::{DOM_OBJECT_SLOT, is_dom_class};
use dom::bindings::conversions::{jsstring_to_str, private_from_proto_check};
use dom::bindings::error::throw_invalid_this;
use dom::bindings::inheritance::TopTypeId;
use dom::bindings::str::DOMString;
use dom::bindings::trace::trace_object;
use dom::browsingcontext;
use heapsize::HeapSizeOf;
@ -37,9 +39,7 @@ use std::ffi::CString;
use std::os::raw::c_void;
use std::ptr;
use std::slice;
use util::non_geckolib::jsstring_to_str;
use util::prefs;
use util::str::DOMString;
/// Proxy handler for a WindowProxy.
pub struct WindowProxyHandler(pub *const libc::c_void);

Просмотреть файл

@ -5,8 +5,8 @@
//! Functions for validating and extracting qualified XML names.
use dom::bindings::error::{Error, ErrorResult, Fallible};
use dom::bindings::str::DOMString;
use string_cache::{Atom, Namespace};
use util::str::DOMString;
/// Validate a qualified name. See https://dom.spec.whatwg.org/#validate for details.
pub fn validate_qualified_name(qualified_name: &str) -> ErrorResult {

Просмотреть файл

@ -9,6 +9,7 @@ use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use encoding::all::UTF_8;
use encoding::types::{EncoderTrap, Encoding};
use num_traits::ToPrimitive;
@ -17,7 +18,6 @@ use std::borrow::ToOwned;
use std::cell::Cell;
use std::cmp::{max, min};
use std::sync::Arc;
use util::str::DOMString;
#[derive(Clone, JSTraceable)]
pub struct DataSlice {

Просмотреть файл

@ -11,6 +11,7 @@ use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::bluetoothadvertisingdata::BluetoothAdvertisingData;
use dom::bluetoothdevice::BluetoothDevice;
use dom::bluetoothuuid::BluetoothUUID;
@ -18,7 +19,6 @@ use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_scanfilter::{BluetoothScanfilter, BluetoothScanfilterSequence};
use net_traits::bluetooth_scanfilter::{RequestDeviceoptions, ServiceUUIDSequence};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use util::str::DOMString;
const FILTER_EMPTY_ERROR: &'static str = "'filters' member must be non - empty to find any devices.";
const FILTER_ERROR: &'static str = "A filter must restrict the devices in some way.";

Просмотреть файл

@ -7,9 +7,9 @@ use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMet
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, Root, MutHeap, MutNullableHeap};
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::bluetoothadvertisingdata::BluetoothAdvertisingData;
use dom::bluetoothremotegattserver::BluetoothRemoteGATTServer;
use util::str::DOMString;
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothdevice
#[dom_struct]

Просмотреть файл

@ -14,14 +14,13 @@ use dom::bindings::error::{Fallible, ErrorResult};
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, MutHeap, Root};
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::ByteString;
use dom::bindings::str::{ByteString, DOMString};
use dom::bluetoothcharacteristicproperties::BluetoothCharacteristicProperties;
use dom::bluetoothremotegattdescriptor::BluetoothRemoteGATTDescriptor;
use dom::bluetoothremotegattservice::BluetoothRemoteGATTService;
use dom::bluetoothuuid::{BluetoothDescriptorUUID, BluetoothUUID};
use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use util::str::DOMString;
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattcharacteristic
#[dom_struct]

Просмотреть файл

@ -15,11 +15,10 @@ use dom::bindings::error::{Fallible, ErrorResult};
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, MutHeap, Root};
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::ByteString;
use dom::bindings::str::{ByteString, DOMString};
use dom::bluetoothremotegattcharacteristic::BluetoothRemoteGATTCharacteristic;
use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use util::str::DOMString;
// http://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattdescriptor
#[dom_struct]

Просмотреть файл

@ -10,13 +10,13 @@ use dom::bindings::error::{Fallible, ErrorResult};
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, MutHeap, Root};
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::bluetoothdevice::BluetoothDevice;
use dom::bluetoothremotegattservice::BluetoothRemoteGATTService;
use dom::bluetoothuuid::{BluetoothServiceUUID, BluetoothUUID};
use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use std::cell::Cell;
use util::str::DOMString;
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattserver
#[dom_struct]

Просмотреть файл

@ -9,13 +9,13 @@ use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, MutHeap, Root};
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::bluetoothcharacteristicproperties::BluetoothCharacteristicProperties;
use dom::bluetoothdevice::BluetoothDevice;
use dom::bluetoothremotegattcharacteristic::BluetoothRemoteGATTCharacteristic;
use dom::bluetoothuuid::{BluetoothCharacteristicUUID, BluetoothUUID};
use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use util::str::DOMString;
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattservice
#[dom_struct]

Просмотреть файл

@ -7,8 +7,8 @@ use dom::bindings::error::Error::Syntax;
use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::reflector::Reflector;
use dom::bindings::str::DOMString;
use regex::Regex;
use util::str::DOMString;
pub type UUID = DOMString;
pub type BluetoothServiceUUID = StringOrUnsignedLong;

Просмотреть файл

@ -8,6 +8,7 @@ use dom::bindings::conversions::{ToJSValConvertible, root_from_handleobject};
use dom::bindings::js::{JS, Root, RootedReference};
use dom::bindings::proxyhandler::{fill_property_descriptor, get_property_descriptor};
use dom::bindings::reflector::{Reflectable, Reflector};
use dom::bindings::str::DOMString;
use dom::bindings::trace::JSTraceable;
use dom::bindings::utils::WindowProxyHandler;
use dom::bindings::utils::get_array_index_from_id;
@ -26,7 +27,6 @@ use js::jsval::{UndefinedValue, PrivateValue};
use msg::constellation_msg::{PipelineId, SubpageId};
use std::cell::Cell;
use url::Url;
use util::str::DOMString;
#[dom_struct]
pub struct BrowsingContext {

Просмотреть файл

@ -13,7 +13,7 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::num::Finite;
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use util::str::DOMString;
use dom::bindings::str::DOMString;
// https://html.spec.whatwg.org/multipage/#canvasgradient
#[dom_struct]

Просмотреть файл

@ -25,6 +25,7 @@ use dom::bindings::inheritance::Castable;
use dom::bindings::js::{JS, LayoutJS, Root};
use dom::bindings::num::Finite;
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::canvasgradient::{CanvasGradient, CanvasGradientStyle, ToFillOrStrokeStyle};
use dom::canvaspattern::CanvasPattern;
use dom::htmlcanvaselement::HTMLCanvasElement;
@ -46,7 +47,6 @@ use std::str::FromStr;
use std::{cmp, fmt};
use unpremultiplytable::UNPREMULTIPLY_TABLE;
use url::Url;
use util::str::DOMString;
use util::vec::byte_swap;
#[must_root]

Просмотреть файл

@ -12,6 +12,7 @@ use dom::bindings::codegen::UnionTypes::NodeOrString;
use dom::bindings::error::{Error, ErrorResult, Fallible};
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{LayoutJS, Root};
use dom::bindings::str::DOMString;
use dom::comment::Comment;
use dom::document::Document;
use dom::element::Element;
@ -19,7 +20,6 @@ use dom::node::{Node, NodeDamage};
use dom::processinginstruction::ProcessingInstruction;
use dom::text::Text;
use std::cell::Ref;
use util::str::DOMString;
// https://dom.spec.whatwg.org/#characterdata
#[dom_struct]

Просмотреть файл

@ -10,9 +10,9 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::DOMString;
use dom::event::{Event, EventBubbles, EventCancelable};
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct CloseEvent {

Просмотреть файл

@ -7,10 +7,10 @@ use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::characterdata::CharacterData;
use dom::document::Document;
use dom::node::Node;
use util::str::DOMString;
/// An HTML comment.
#[dom_struct]

Просмотреть файл

@ -9,9 +9,9 @@ use dom::bindings::codegen::Bindings::ConsoleBinding::ConsoleMethods;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use std::collections::HashMap;
use time::{Timespec, get_time};
use util::str::DOMString;
// https://developer.mozilla.org/en-US/docs/Web/API/Console
#[dom_struct]

Просмотреть файл

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::Element;
use dom::element::ElementCreator;
@ -76,7 +77,6 @@ use dom::htmlulistelement::HTMLUListElement;
use dom::htmlunknownelement::HTMLUnknownElement;
use dom::htmlvideoelement::HTMLVideoElement;
use string_cache::{Atom, QualName};
use util::str::DOMString;
pub fn create_element(name: QualName,
prefix: Option<Atom>,

Просмотреть файл

@ -6,7 +6,7 @@ use cssparser::serialize_identifier;
use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::reflector::Reflector;
use util::str::DOMString;
use dom::bindings::str::DOMString;
#[dom_struct]
pub struct CSS {

Просмотреть файл

@ -8,6 +8,7 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{JS, Root};
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::element::{Element, StylePriority};
use dom::node::{Node, NodeDamage, window_from_node};
use dom::window::Window;
@ -18,7 +19,7 @@ use string_cache::Atom;
use style::properties::{PropertyDeclaration, Shorthand};
use style::properties::{is_supported_property, parse_one_declaration};
use style::selector_impl::PseudoElement;
use util::str::{DOMString, str_join};
use util::str::str_join;
// http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
#[dom_struct]

Просмотреть файл

@ -10,11 +10,11 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{MutHeapJSVal, Root};
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::DOMString;
use dom::event::Event;
use js::jsapi::{HandleValue, JSContext};
use js::jsval::JSVal;
use string_cache::Atom;
use util::str::DOMString;
// https://dom.spec.whatwg.org/#interface-customevent
#[dom_struct]

Просмотреть файл

@ -14,6 +14,7 @@ use dom::bindings::inheritance::Castable;
use dom::bindings::js::{Root, RootCollection};
use dom::bindings::refcounted::LiveDOMReferences;
use dom::bindings::reflector::Reflectable;
use dom::bindings::str::DOMString;
use dom::bindings::structuredclone::StructuredCloneData;
use dom::messageevent::MessageEvent;
use dom::worker::{SimpleWorkerErrorHandler, SharedRt, TrustedWorkerAddress};
@ -36,7 +37,6 @@ use std::mem::replace;
use std::sync::mpsc::{Receiver, RecvError, Select, Sender, channel};
use std::sync::{Arc, Mutex};
use url::Url;
use util::str::DOMString;
use util::thread::spawn_named_with_send_on_panic;
use util::thread_state::{IN_WORKER, SCRIPT};

Просмотреть файл

@ -28,6 +28,7 @@ use dom::bindings::js::{JS, LayoutJS, MutNullableHeap, Root};
use dom::bindings::num::Finite;
use dom::bindings::refcounted::Trusted;
use dom::bindings::reflector::{Reflectable, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::bindings::trace::RootedVec;
use dom::bindings::xmlname::XMLName::InvalidXMLName;
use dom::bindings::xmlname::{validate_and_extract, namespace_from_domstring, xml_name_type};
@ -127,7 +128,7 @@ use task_source::dom_manipulation::DOMManipulationTask;
use time;
use url::Url;
use url::percent_encoding::percent_decode;
use util::str::{DOMString, split_html_space_chars, str_join};
use util::str::{split_html_space_chars, str_join};
#[derive(JSTraceable, PartialEq, HeapSizeOf)]
pub enum IsHTMLDocument {
@ -2087,7 +2088,7 @@ impl DocumentMethods for Document {
local_name.make_ascii_lowercase();
}
let name = Atom::from(local_name);
let value = AttrValue::String(DOMString::new());
let value = AttrValue::String("".to_owned());
Ok(Attr::new(&self.window, name.clone(), value, name, ns!(), None, None))
}
@ -2099,7 +2100,7 @@ impl DocumentMethods for Document {
-> Fallible<Root<Attr>> {
let (namespace, prefix, local_name) = try!(validate_and_extract(namespace,
&qualified_name));
let value = AttrValue::String(DOMString::new());
let value = AttrValue::String("".to_owned());
let qualified_name = Atom::from(qualified_name);
Ok(Attr::new(&self.window,
local_name,

Просмотреть файл

@ -10,13 +10,13 @@ use dom::bindings::error::{ErrorResult, Fallible};
use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::Element;
use dom::htmlcollection::HTMLCollection;
use dom::node::{Node, window_from_node};
use dom::nodelist::NodeList;
use string_cache::Atom;
use util::str::DOMString;
// https://dom.spec.whatwg.org/#documentfragment
#[dom_struct]

Просмотреть файл

@ -8,9 +8,9 @@ use dom::bindings::codegen::UnionTypes::NodeOrString;
use dom::bindings::error::ErrorResult;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::node::Node;
use util::str::DOMString;
// https://dom.spec.whatwg.org/#documenttype
/// The `DOCTYPE` tag.

Просмотреть файл

@ -8,7 +8,7 @@ use dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use util::str::DOMString;
use dom::bindings::str::DOMString;
#[repr(u16)]
#[derive(JSTraceable, Copy, Clone, Debug, HeapSizeOf)]

Просмотреть файл

@ -12,6 +12,7 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{JS, Root};
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::bindings::xmlname::{validate_qualified_name, namespace_from_domstring};
use dom::document::DocumentSource;
use dom::document::{Document, IsHTMLDocument};
@ -23,7 +24,6 @@ use dom::htmltitleelement::HTMLTitleElement;
use dom::node::Node;
use dom::text::Text;
use dom::xmldocument::XMLDocument;
use util::str::DOMString;
// https://dom.spec.whatwg.org/#domimplementation
#[dom_struct]

Просмотреть файл

@ -12,12 +12,12 @@ use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, Root};
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::document::DocumentSource;
use dom::document::{Document, IsHTMLDocument};
use dom::window::Window;
use parse::html::{ParseContext, parse_html};
use parse::xml::{self, parse_xml};
use util::str::DOMString;
#[dom_struct]
pub struct DOMParser {

Просмотреть файл

@ -8,9 +8,9 @@ use dom::bindings::error::ErrorResult;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, Root};
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::htmlelement::HTMLElement;
use dom::node::window_from_node;
use util::str::DOMString;
#[dom_struct]
pub struct DOMStringMap {

Просмотреть файл

@ -9,10 +9,11 @@ use dom::bindings::error::{Error, ErrorResult, Fallible};
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, Root};
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::element::Element;
use dom::node::window_from_node;
use string_cache::Atom;
use util::str::{DOMString, HTML_SPACE_CHARACTERS};
use util::str::HTML_SPACE_CHARACTERS;
#[dom_struct]
pub struct DOMTokenList {

Просмотреть файл

@ -26,6 +26,7 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::{Castable, ElementTypeId, HTMLElementTypeId, NodeTypeId};
use dom::bindings::js::{JS, LayoutJS, MutNullableHeap};
use dom::bindings::js::{Root, RootedReference};
use dom::bindings::str::DOMString;
use dom::bindings::xmlname::XMLName::InvalidXMLName;
use dom::bindings::xmlname::{namespace_from_domstring, validate_and_extract, xml_name_type};
use dom::characterdata::CharacterData;
@ -91,7 +92,7 @@ use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, parse_sty
use style::selector_impl::{NonTSPseudoClass, ServoSelectorImpl};
use style::values::CSSFloat;
use style::values::specified::{self, CSSColor, CSSRGBA, LengthOrPercentage};
use util::str::{DOMString, LengthOrPercentageOrAuto};
use util::str::LengthOrPercentageOrAuto;
// TODO: Update focus state when the top-level browsing context gains or loses system focus,
// and when the element enters or leaves a browsing context container.
@ -1031,7 +1032,7 @@ impl Element {
if *namespace == ns!() {
vtable_for(self.upcast()).parse_plain_attribute(local_name, value)
} else {
AttrValue::String(value)
AttrValue::String(value.into())
}
}
@ -1076,7 +1077,7 @@ impl Element {
pub fn set_atomic_attribute(&self, local_name: &Atom, value: DOMString) {
assert!(*local_name == local_name.to_ascii_lowercase());
let value = AttrValue::from_atomic(value);
let value = AttrValue::from_atomic(value.into());
self.set_attribute(local_name, value);
}
@ -1126,7 +1127,7 @@ impl Element {
}
pub fn set_string_attribute(&self, local_name: &Atom, value: DOMString) {
assert!(*local_name == local_name.to_ascii_lowercase());
self.set_attribute(local_name, AttrValue::String(value));
self.set_attribute(local_name, AttrValue::String(value.into()));
}
pub fn get_tokenlist_attribute(&self, local_name: &Atom) -> Vec<Atom> {
@ -1140,7 +1141,8 @@ impl Element {
pub fn set_tokenlist_attribute(&self, local_name: &Atom, value: DOMString) {
assert!(*local_name == local_name.to_ascii_lowercase());
self.set_attribute(local_name, AttrValue::from_serialized_tokenlist(value));
self.set_attribute(local_name,
AttrValue::from_serialized_tokenlist(value.into()));
}
pub fn set_atomic_tokenlist_attribute(&self, local_name: &Atom, tokens: Vec<Atom>) {
@ -1169,7 +1171,7 @@ impl Element {
pub fn set_int_attribute(&self, local_name: &Atom, value: i32) {
assert!(*local_name == local_name.to_ascii_lowercase());
self.set_attribute(local_name, AttrValue::Int(DOMString::from(value.to_string()), value));
self.set_attribute(local_name, AttrValue::Int(value.to_string(), value));
}
pub fn get_uint_attribute(&self, local_name: &Atom, default: u32) -> u32 {
@ -1187,9 +1189,7 @@ impl Element {
}
pub fn set_uint_attribute(&self, local_name: &Atom, value: u32) {
assert!(*local_name == local_name.to_ascii_lowercase());
// FIXME(ajeffrey): Directly convert u32 to DOMString
self.set_attribute(local_name,
AttrValue::UInt(DOMString::from(value.to_string()), value));
self.set_attribute(local_name, AttrValue::UInt(value.to_string(), value));
}
pub fn will_mutate_attr(&self) {
@ -2032,8 +2032,8 @@ impl VirtualMethods for Element {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("id") => AttrValue::from_atomic(value),
&atom!("class") => AttrValue::from_serialized_tokenlist(value),
&atom!("id") => AttrValue::from_atomic(value.into()),
&atom!("class") => AttrValue::from_serialized_tokenlist(value.into()),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -11,12 +11,12 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{MutHeapJSVal, Root};
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::DOMString;
use dom::event::{Event, EventBubbles, EventCancelable};
use js::jsapi::{RootedValue, HandleValue, JSContext};
use js::jsval::JSVal;
use std::cell::Cell;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct ErrorEvent {

Просмотреть файл

@ -9,12 +9,12 @@ use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, MutNullableHeap, Root};
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::eventtarget::EventTarget;
use std::cell::Cell;
use std::default::Default;
use string_cache::Atom;
use time;
use util::str::DOMString;
#[derive(JSTraceable, Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u16)]

Просмотреть файл

@ -9,10 +9,10 @@ use dom::bindings::error::{Error, Fallible};
use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::DOMString;
use dom::eventtarget::EventTarget;
use std::cell::Cell;
use url::Url;
use util::str::DOMString;
#[derive(JSTraceable, PartialEq, Copy, Clone, Debug, HeapSizeOf)]
enum EventSourceReadyState {

Просмотреть файл

@ -19,6 +19,7 @@ use dom::bindings::error::{Error, Fallible, report_pending_exception};
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::reflector::{Reflectable, Reflector};
use dom::bindings::str::DOMString;
use dom::element::Element;
use dom::errorevent::ErrorEvent;
use dom::event::{Event, EventBubbles, EventCancelable};
@ -42,7 +43,6 @@ use std::ptr;
use std::rc::Rc;
use string_cache::Atom;
use url::Url;
use util::str::DOMString;
#[derive(PartialEq, Clone, JSTraceable)]
pub enum CommonEventHandler {

Просмотреть файл

@ -9,12 +9,12 @@ use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::DOMString;
use dom::blob::{Blob, DataSlice, blob_parts_to_bytes};
use dom::window::Window;
use net_traits::filemanager_thread::SelectedFile;
use std::sync::Arc;
use time;
use util::str::DOMString;
#[dom_struct]
pub struct File {

Просмотреть файл

@ -12,6 +12,7 @@ use dom::bindings::inheritance::Castable;
use dom::bindings::js::{JS, MutNullableHeap, Root};
use dom::bindings::refcounted::Trusted;
use dom::bindings::reflector::{Reflectable, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::blob::{Blob, DataSlice};
use dom::domexception::{DOMErrorName, DOMException};
use dom::event::{Event, EventBubbles, EventCancelable};
@ -27,7 +28,6 @@ use script_runtime::{ScriptChan, CommonScriptMsg};
use script_thread::Runnable;
use std::cell::Cell;
use string_cache::Atom;
use util::str::DOMString;
use util::thread::spawn_named;
#[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)]

Просмотреть файл

@ -10,12 +10,12 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{JS, MutNullableHeap, Root, RootedReference};
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::DOMString;
use dom::event::{EventBubbles, EventCancelable};
use dom::eventtarget::EventTarget;
use dom::uievent::UIEvent;
use dom::window::Window;
use std::default::Default;
use util::str::DOMString;
#[dom_struct]
pub struct FocusEvent {

Просмотреть файл

@ -10,9 +10,9 @@ use dom::bindings::inheritance::Castable;
use dom::bindings::js::{Root};
use dom::bindings::num::Finite;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::DOMString;
use dom::uievent::UIEvent;
use dom::window::Window;
use util::str::DOMString;
#[dom_struct]
pub struct ForceTouchEvent {

Просмотреть файл

@ -10,14 +10,13 @@ use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, Root};
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::USVString;
use dom::bindings::str::{DOMString, USVString};
use dom::blob::Blob;
use dom::file::File;
use dom::htmlformelement::HTMLFormElement;
use std::collections::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use string_cache::Atom;
use util::str::DOMString;
#[derive(JSTraceable, Clone)]
#[must_root]

Просмотреть файл

@ -10,10 +10,9 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::USVString;
use dom::bindings::str::{DOMString, USVString};
use dom::event::Event;
use string_cache::Atom;
use util::str::DOMString;
// https://html.spec.whatwg.org/multipage/#hashchangeevent
#[dom_struct]

Просмотреть файл

@ -13,7 +13,7 @@ use dom::bindings::codegen::Bindings::MouseEventBinding::MouseEventMethods;
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{JS, MutNullableHeap, Root};
use dom::bindings::str::USVString;
use dom::bindings::str::{DOMString, USVString};
use dom::document::Document;
use dom::domtokenlist::DOMTokenList;
use dom::element::Element;
@ -29,7 +29,6 @@ use num_traits::ToPrimitive;
use std::default::Default;
use string_cache::Atom;
use url::Url;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLAnchorElement {
@ -92,7 +91,7 @@ impl VirtualMethods for HTMLAnchorElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("rel") => AttrValue::from_serialized_tokenlist(value),
&atom!("rel") => AttrValue::from_serialized_tokenlist(value.into()),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -7,12 +7,12 @@ use dom::bindings::codegen::Bindings::HTMLAppletElementBinding;
use dom::bindings::codegen::Bindings::HTMLAppletElementBinding::HTMLAppletElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLAppletElement {
@ -53,7 +53,7 @@ impl VirtualMethods for HTMLAppletElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("name") => AttrValue::from_atomic(value),
&atom!("name") => AttrValue::from_atomic(value.into()),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::codegen::Bindings::HTMLAreaElementBinding;
use dom::bindings::codegen::Bindings::HTMLAreaElementBinding::HTMLAreaElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{JS, MutNullableHeap, Root};
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::domtokenlist::DOMTokenList;
use dom::htmlelement::HTMLElement;
@ -14,7 +15,6 @@ use dom::node::Node;
use dom::virtualmethods::VirtualMethods;
use std::default::Default;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLAreaElement {
@ -46,7 +46,7 @@ impl VirtualMethods for HTMLAreaElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("rel") => AttrValue::from_serialized_tokenlist(value),
&atom!("rel") => AttrValue::from_serialized_tokenlist(value.into()),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLAudioElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlmediaelement::HTMLMediaElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLAudioElement {

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::codegen::Bindings::HTMLBaseElementBinding;
use dom::bindings::codegen::Bindings::HTMLBaseElementBinding::HTMLBaseElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element};
use dom::htmlelement::HTMLElement;
@ -14,7 +15,6 @@ use dom::node::{Node, UnbindContext, document_from_node};
use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use url::Url;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLBaseElement {

Просмотреть файл

@ -9,6 +9,7 @@ use dom::bindings::codegen::Bindings::HTMLBodyElementBinding::{self, HTMLBodyEle
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{LayoutJS, Root};
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
use dom::eventtarget::EventTarget;
@ -19,7 +20,6 @@ use script_traits::ScriptMsg as ConstellationMsg;
use string_cache::Atom;
use time;
use url::Url;
use util::str::DOMString;
/// How long we should wait before performing the initial reflow after `<body>` is parsed, in
/// nanoseconds.
@ -141,8 +141,10 @@ impl VirtualMethods for HTMLBodyElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match *name {
atom!("bgcolor") |
atom!("text") => AttrValue::from_legacy_color(value),
atom!("background") => AttrValue::from_url(document_from_node(self).url(), value),
atom!("text") => AttrValue::from_legacy_color(value.into()),
atom!("background") => {
AttrValue::from_url(document_from_node(self).url(), value.into())
},
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLBRElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLBRElement {

Просмотреть файл

@ -8,6 +8,7 @@ use dom::bindings::codegen::Bindings::HTMLButtonElementBinding;
use dom::bindings::codegen::Bindings::HTMLButtonElementBinding::HTMLButtonElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element};
use dom::event::Event;
@ -25,7 +26,6 @@ use dom::virtualmethods::VirtualMethods;
use std::cell::Cell;
use string_cache::Atom;
use style::element_state::*;
use util::str::DOMString;
#[derive(JSTraceable, PartialEq, Copy, Clone)]
#[derive(HeapSizeOf)]

Просмотреть файл

@ -16,6 +16,7 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{HeapGCValue, JS, LayoutJS, Root};
use dom::bindings::num::Finite;
use dom::bindings::str::DOMString;
use dom::canvasrenderingcontext2d::{CanvasRenderingContext2D, LayoutCanvasRenderingContext2DHelpers};
use dom::document::Document;
use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
@ -32,7 +33,6 @@ use offscreen_gl_context::GLContextAttributes;
use rustc_serialize::base64::{STANDARD, ToBase64};
use std::iter::repeat;
use string_cache::Atom;
use util::str::DOMString;
const DEFAULT_WIDTH: u32 = 300;
const DEFAULT_HEIGHT: u32 = 150;
@ -312,8 +312,8 @@ impl VirtualMethods for HTMLCanvasElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("width") => AttrValue::from_u32(value, DEFAULT_WIDTH),
&atom!("height") => AttrValue::from_u32(value, DEFAULT_HEIGHT),
&atom!("width") => AttrValue::from_u32(value.into(), DEFAULT_WIDTH),
&atom!("height") => AttrValue::from_u32(value.into(), DEFAULT_HEIGHT),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -8,6 +8,7 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{JS, Root, MutNullableHeap};
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::bindings::trace::JSTraceable;
use dom::bindings::xmlname::namespace_from_domstring;
use dom::element::Element;
@ -16,7 +17,7 @@ use dom::window::Window;
use std::ascii::AsciiExt;
use std::cell::Cell;
use string_cache::{Atom, Namespace, QualName};
use util::str::{DOMString, split_html_space_chars};
use util::str::split_html_space_chars;
pub trait CollectionFilter : JSTraceable {
fn filter<'a>(&self, elem: &'a Element, root: &'a Node) -> bool;

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLDataElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLDataElement {

Просмотреть файл

@ -6,6 +6,7 @@ use dom::bindings::codegen::Bindings::HTMLDataListElementBinding;
use dom::bindings::codegen::Bindings::HTMLDataListElementBinding::HTMLDataListElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::Element;
use dom::htmlcollection::{CollectionFilter, HTMLCollection};
@ -13,7 +14,6 @@ use dom::htmlelement::HTMLElement;
use dom::htmloptionelement::HTMLOptionElement;
use dom::node::{Node, window_from_node};
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLDataListElement {

Просмотреть файл

@ -8,6 +8,7 @@ use dom::bindings::codegen::Bindings::HTMLDetailsElementBinding::HTMLDetailsElem
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::refcounted::Trusted;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::AttributeMutation;
use dom::eventtarget::EventTarget;
@ -18,7 +19,6 @@ use script_thread::Runnable;
use std::cell::Cell;
use string_cache::Atom;
use task_source::dom_manipulation::DOMManipulationTask;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLDetailsElement {

Просмотреть файл

@ -6,11 +6,11 @@ use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::HTMLDialogElementBinding;
use dom::bindings::codegen::Bindings::HTMLDialogElementBinding::HTMLDialogElementMethods;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLDialogElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLDirectoryElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLDirectoryElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLDivElementBinding::{self, HTMLDivElementMethods};
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLDivElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLDListElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLDListElement {

Просмотреть файл

@ -15,6 +15,7 @@ use dom::bindings::error::{Error, ErrorResult};
use dom::bindings::inheritance::Castable;
use dom::bindings::inheritance::{ElementTypeId, HTMLElementTypeId, NodeTypeId};
use dom::bindings::js::{JS, MutNullableHeap, Root, RootedReference};
use dom::bindings::str::DOMString;
use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration};
use dom::document::{Document, FocusType};
use dom::domstringmap::DOMStringMap;
@ -35,7 +36,6 @@ use std::default::Default;
use std::rc::Rc;
use string_cache::Atom;
use style::element_state::*;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLEmbedElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLEmbedElement {

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::codegen::Bindings::HTMLFieldSetElementBinding;
use dom::bindings::codegen::Bindings::HTMLFieldSetElementBinding::HTMLFieldSetElementMethods;
use dom::bindings::inheritance::{Castable, ElementTypeId, HTMLElementTypeId, NodeTypeId};
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element};
use dom::htmlcollection::{CollectionFilter, HTMLCollection};
@ -18,7 +19,6 @@ use dom::validitystate::ValidityState;
use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use style::element_state::*;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLFieldSetElement {

Просмотреть файл

@ -8,6 +8,7 @@ use dom::bindings::codegen::Bindings::HTMLFontElementBinding;
use dom::bindings::codegen::Bindings::HTMLFontElementBinding::HTMLFontElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{LayoutJS, Root};
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{Element, RawLayoutElementHelpers};
use dom::htmlelement::HTMLElement;
@ -15,7 +16,7 @@ use dom::node::Node;
use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use style::values::specified;
use util::str::{DOMString, HTML_SPACE_CHARACTERS, read_numbers};
use util::str::{HTML_SPACE_CHARACTERS, read_numbers};
#[dom_struct]
pub struct HTMLFontElement {
@ -59,7 +60,7 @@ impl HTMLFontElementMethods for HTMLFontElement {
fn SetSize(&self, value: DOMString) {
let element = self.upcast::<Element>();
let length = parse_length(&value);
element.set_attribute(&atom!("size"), AttrValue::Length(value, length));
element.set_attribute(&atom!("size"), AttrValue::Length(value.into(), length));
}
}
@ -70,11 +71,11 @@ impl VirtualMethods for HTMLFontElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("face") => AttrValue::from_atomic(value),
&atom!("color") => AttrValue::from_legacy_color(value),
&atom!("face") => AttrValue::from_atomic(value.into()),
&atom!("color") => AttrValue::from_legacy_color(value.into()),
&atom!("size") => {
let length = parse_length(&value);
AttrValue::Length(value, length)
AttrValue::Length(value.into(), length)
},
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}

Просмотреть файл

@ -9,13 +9,13 @@ use dom::bindings::codegen::UnionTypes::RadioNodeListOrElement;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::reflector::{Reflectable, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::element::Element;
use dom::htmlcollection::{CollectionFilter, HTMLCollection};
use dom::node::Node;
use dom::radionodelist::RadioNodeList;
use dom::window::Window;
use std::iter;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLFormControlsCollection {

Просмотреть файл

@ -16,6 +16,7 @@ use dom::bindings::inheritance::{Castable, ElementTypeId, HTMLElementTypeId, Nod
use dom::bindings::js::{JS, MutNullableHeap, Root};
use dom::bindings::refcounted::Trusted;
use dom::bindings::reflector::Reflectable;
use dom::bindings::str::DOMString;
use dom::blob::Blob;
use dom::document::Document;
use dom::element::Element;
@ -51,7 +52,7 @@ use std::sync::mpsc::Sender;
use string_cache::Atom;
use task_source::dom_manipulation::DOMManipulationTask;
use url::form_urlencoded;
use util::str::{DOMString, split_html_space_chars};
use util::str::split_html_space_chars;
#[derive(JSTraceable, PartialEq, Clone, Copy, HeapSizeOf)]
pub struct GenerationId(u32);
@ -907,7 +908,7 @@ impl VirtualMethods for HTMLFormElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("name") => AttrValue::from_atomic(value),
&atom!("name") => AttrValue::from_atomic(value.into()),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLFrameElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLFrameElement {

Просмотреть файл

@ -7,11 +7,11 @@ use dom::bindings::codegen::Bindings::HTMLFrameSetElementBinding;
use dom::bindings::codegen::Bindings::HTMLFrameSetElementBinding::HTMLFrameSetElementMethods;
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::{Node, window_from_node};
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLFrameSetElement {

Просмотреть файл

@ -5,13 +5,13 @@
use dom::bindings::codegen::Bindings::HTMLHeadElementBinding;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use dom::userscripts::load_script;
use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLHeadElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLHeadingElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[derive(JSTraceable, HeapSizeOf)]
pub enum HeadingLevel {

Просмотреть файл

@ -7,13 +7,14 @@ use dom::attr::AttrValue;
use dom::bindings::codegen::Bindings::HTMLHRElementBinding::{self, HTMLHRElementMethods};
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{LayoutJS, Root};
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{Element, RawLayoutElementHelpers};
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use util::str::{DOMString, LengthOrPercentageOrAuto};
use util::str::LengthOrPercentageOrAuto;
#[dom_struct]
pub struct HTMLHRElement {
@ -92,9 +93,9 @@ impl VirtualMethods for HTMLHRElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("align") => AttrValue::from_dimension(value),
&atom!("color") => AttrValue::from_legacy_color(value),
&atom!("width") => AttrValue::from_dimension(value),
&atom!("align") => AttrValue::from_dimension(value.into()),
&atom!("color") => AttrValue::from_legacy_color(value.into()),
&atom!("width") => AttrValue::from_dimension(value.into()),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLHtmlElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLHtmlElement {

Просмотреть файл

@ -19,6 +19,7 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{Root, LayoutJS};
use dom::bindings::reflector::Reflectable;
use dom::bindings::str::DOMString;
use dom::customevent::CustomEvent;
use dom::document::Document;
use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
@ -42,7 +43,7 @@ use string_cache::Atom;
use style::context::ReflowGoal;
use url::Url;
use util::prefs;
use util::str::{DOMString, LengthOrPercentageOrAuto};
use util::str::LengthOrPercentageOrAuto;
pub fn mozbrowser_enabled() -> bool {
prefs::get_pref("dom.mozbrowser.enabled").as_boolean().unwrap_or(false)
@ -539,9 +540,9 @@ impl VirtualMethods for HTMLIFrameElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("sandbox") => AttrValue::from_serialized_tokenlist(value),
&atom!("width") => AttrValue::from_dimension(value),
&atom!("height") => AttrValue::from_dimension(value),
&atom!("sandbox") => AttrValue::from_serialized_tokenlist(value.into()),
&atom!("width") => AttrValue::from_dimension(value.into()),
&atom!("height") => AttrValue::from_dimension(value.into()),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -14,6 +14,7 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{LayoutJS, Root};
use dom::bindings::refcounted::Trusted;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
use dom::eventtarget::EventTarget;
@ -31,7 +32,7 @@ use script_thread::Runnable;
use std::sync::Arc;
use string_cache::Atom;
use url::Url;
use util::str::{DOMString, LengthOrPercentageOrAuto};
use util::str::LengthOrPercentageOrAuto;
#[derive(JSTraceable, HeapSizeOf)]
#[allow(dead_code)]
@ -377,9 +378,9 @@ impl VirtualMethods for HTMLImageElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("name") => AttrValue::from_atomic(value),
&atom!("width") | &atom!("height") => AttrValue::from_dimension(value),
&atom!("hspace") | &atom!("vspace") => AttrValue::from_u32(value, 0),
&atom!("name") => AttrValue::from_atomic(value.into()),
&atom!("width") | &atom!("height") => AttrValue::from_dimension(value.into()),
&atom!("hspace") | &atom!("vspace") => AttrValue::from_u32(value.into(), 0),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}
@ -394,6 +395,6 @@ fn image_dimension_setter(element: &Element, attr: Atom, value: u32) {
value
};
let dim = LengthOrPercentageOrAuto::Length(Au::from_px(value as i32));
let value = AttrValue::Dimension(DOMString::from(value.to_string()), dim);
let value = AttrValue::Dimension(value.to_string(), dim);
element.set_attribute(&attr, value);
}

Просмотреть файл

@ -14,6 +14,7 @@ use dom::bindings::codegen::Bindings::KeyboardEventBinding::KeyboardEventMethods
use dom::bindings::error::{Error, ErrorResult};
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{JS, LayoutJS, Root, RootedReference, MutNullableHeap};
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers, LayoutElementHelpers};
use dom::event::{Event, EventBubbles, EventCancelable};
@ -42,7 +43,6 @@ use style::element_state::*;
use textinput::KeyReaction::{DispatchInput, Nothing, RedrawSelection, TriggerDefaultAction};
use textinput::Lines::Single;
use textinput::{TextInput, SelectionDirection};
use util::str::{DOMString};
const DEFAULT_SUBMIT_VALUE: &'static str = "Submit";
const DEFAULT_RESET_VALUE: &'static str = "Reset";
@ -881,10 +881,10 @@ impl VirtualMethods for HTMLInputElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("name") => AttrValue::from_atomic(value),
&atom!("size") => AttrValue::from_limited_u32(value, DEFAULT_INPUT_SIZE),
&atom!("type") => AttrValue::from_atomic(value),
&atom!("maxlength") => AttrValue::from_limited_i32(value, DEFAULT_MAX_LENGTH),
&atom!("name") => AttrValue::from_atomic(value.into()),
&atom!("size") => AttrValue::from_limited_u32(value.into(), DEFAULT_INPUT_SIZE),
&atom!("type") => AttrValue::from_atomic(value.into()),
&atom!("maxlength") => AttrValue::from_limited_i32(value.into(), DEFAULT_MAX_LENGTH),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -8,6 +8,7 @@ use dom::bindings::codegen::Bindings::HTMLLabelElementBinding;
use dom::bindings::codegen::Bindings::HTMLLabelElementBinding::HTMLLabelElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::Element;
use dom::event::Event;
@ -17,7 +18,6 @@ use dom::htmlformelement::{FormControl, HTMLFormElement};
use dom::node::{document_from_node, Node};
use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLLabelElement {
@ -122,7 +122,7 @@ impl VirtualMethods for HTMLLabelElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("for") => AttrValue::from_atomic(value),
&atom!("for") => AttrValue::from_atomic(value.into()),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::codegen::Bindings::HTMLLegendElementBinding::HTMLLegendElemen
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::Element;
use dom::htmlelement::HTMLElement;
@ -15,7 +16,6 @@ use dom::htmlformelement::{HTMLFormElement, FormControl};
use dom::node::{Node, UnbindContext};
use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLLegendElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLLIElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLLIElement {

Просмотреть файл

@ -12,6 +12,7 @@ use dom::bindings::inheritance::Castable;
use dom::bindings::js::{JS, MutNullableHeap, Root};
use dom::bindings::js::{RootedReference};
use dom::bindings::refcounted::Trusted;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::domtokenlist::DOMTokenList;
use dom::element::{AttributeMutation, Element, ElementCreator};
@ -40,7 +41,7 @@ use style::media_queries::{MediaQueryList, parse_media_query_list};
use style::servo::Stylesheet;
use style::stylesheets::Origin;
use url::Url;
use util::str::{DOMString, HTML_SPACE_CHARACTERS};
use util::str::HTML_SPACE_CHARACTERS;
no_jsmanaged_fields!(Stylesheet);
@ -158,7 +159,7 @@ impl VirtualMethods for HTMLLinkElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("rel") => AttrValue::from_serialized_tokenlist(value),
&atom!("rel") => AttrValue::from_serialized_tokenlist(value.into()),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLMapElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLMapElement {

Просмотреть файл

@ -15,6 +15,7 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{Root, MutNullableHeap, JS};
use dom::bindings::refcounted::Trusted;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{Element, AttributeMutation};
use dom::event::{Event, EventBubbles, EventCancelable};
@ -34,7 +35,6 @@ use string_cache::Atom;
use task_source::dom_manipulation::DOMManipulationTask;
use time::{self, Timespec, Duration};
use url::Url;
use util::str::DOMString;
struct HTMLMediaElementContext {
/// The element that initiated the request.

Просмотреть файл

@ -8,6 +8,7 @@ use dom::bindings::codegen::Bindings::HTMLMetaElementBinding;
use dom::bindings::codegen::Bindings::HTMLMetaElementBinding::HTMLMetaElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::{Root, RootedReference};
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::Element;
use dom::htmlelement::HTMLElement;
@ -19,7 +20,7 @@ use string_cache::Atom;
use style::servo::Stylesheet;
use style::stylesheets::{CSSRule, Origin};
use style::viewport::ViewportRule;
use util::str::{DOMString, HTML_SPACE_CHARACTERS};
use util::str::HTML_SPACE_CHARACTERS;
#[dom_struct]
pub struct HTMLMetaElement {
@ -117,7 +118,7 @@ impl VirtualMethods for HTMLMetaElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("name") => AttrValue::from_atomic(value),
&atom!("name") => AttrValue::from_atomic(value.into()),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
}
}

Просмотреть файл

@ -5,12 +5,12 @@
use dom::bindings::codegen::Bindings::HTMLMeterElementBinding::{self, HTMLMeterElementMethods};
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use dom::nodelist::NodeList;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLMeterElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLModElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLModElement {

Просмотреть файл

@ -8,6 +8,7 @@ use dom::bindings::codegen::Bindings::HTMLObjectElementBinding;
use dom::bindings::codegen::Bindings::HTMLObjectElementBinding::HTMLObjectElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element};
use dom::htmlelement::HTMLElement;
@ -19,7 +20,6 @@ use dom::virtualmethods::VirtualMethods;
use net_traits::image::base::Image;
use std::sync::Arc;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLObjectElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLOListElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLOListElement {

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::codegen::Bindings::HTMLOptGroupElementBinding;
use dom::bindings::codegen::Bindings::HTMLOptGroupElementBinding::HTMLOptGroupElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element};
use dom::htmlelement::HTMLElement;
@ -15,7 +16,6 @@ use dom::node::Node;
use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use style::element_state::*;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLOptGroupElement {

Просмотреть файл

@ -9,6 +9,7 @@ use dom::bindings::codegen::Bindings::HTMLOptionElementBinding::HTMLOptionElemen
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::characterdata::CharacterData;
use dom::document::Document;
use dom::element::{AttributeMutation, Element};
@ -21,7 +22,7 @@ use dom::virtualmethods::VirtualMethods;
use std::cell::Cell;
use string_cache::Atom;
use style::element_state::*;
use util::str::{DOMString, split_html_space_chars, str_join};
use util::str::{split_html_space_chars, str_join};
#[dom_struct]
pub struct HTMLOptionElement {

Просмотреть файл

@ -6,6 +6,7 @@ use dom::bindings::codegen::Bindings::HTMLOutputElementBinding;
use dom::bindings::codegen::Bindings::HTMLOutputElementBinding::HTMLOutputElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::htmlformelement::{FormControl, HTMLFormElement};
@ -13,7 +14,6 @@ use dom::node::{Node, window_from_node};
use dom::nodelist::NodeList;
use dom::validitystate::ValidityState;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLOutputElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLParagraphElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLParagraphElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLParamElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLParamElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLPreElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLPreElement {

Просмотреть файл

@ -5,12 +5,12 @@
use dom::bindings::codegen::Bindings::HTMLProgressElementBinding::{self, HTMLProgressElementMethods};
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use dom::nodelist::NodeList;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLProgressElement {

Просмотреть файл

@ -4,11 +4,11 @@
use dom::bindings::codegen::Bindings::HTMLQuoteElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmlelement::HTMLElement;
use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
pub struct HTMLQuoteElement {

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше