mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user