Make DOMString a newtype around String, rather than a typedef.

This should make it somewhat easier to experiment with alternative
representations in the future. To reduce churn, this commit leaves the String
field public, though.

Also, this will allow us to use the default String type to represent the IDL
USVString type, which explicitly forbids unpaired surrogates, ans as such is
a better match to the Rust String type.
This commit is contained in:
Ms2ger 2015-11-03 14:16:55 +01:00
parent e6aa976462
commit 6b75078503
83 changed files with 393 additions and 297 deletions

View file

@ -159,7 +159,7 @@ impl HTMLFormElement {
// TODO: Handle browsing contexts
// TODO: Handle validation
let event = Event::new(GlobalRef::Window(win.r()),
"submit".to_owned(),
DOMString("submit".to_owned()),
EventBubbles::Bubbles,
EventCancelable::Cancelable);
event.fire(self.upcast());
@ -171,7 +171,7 @@ impl HTMLFormElement {
// Step 7-8
let mut action = submitter.action();
if action.is_empty() {
action = base.serialize();
action = DOMString(base.serialize());
}
// TODO: Resolve the url relative to the submitter element
// Step 10-15
@ -283,7 +283,7 @@ impl HTMLFormElement {
if prev == '\r' {
buf.push('\n');
}
buf
DOMString(buf)
}
let mut ret = self.get_unclean_dataset(submitter);
@ -311,7 +311,7 @@ impl HTMLFormElement {
let win = window_from_node(self);
let event = Event::new(GlobalRef::Window(win.r()),
"reset".to_owned(),
DOMString("reset".to_owned()),
EventBubbles::Bubbles,
EventCancelable::Cancelable);
event.fire(self.upcast());