Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to the HTML multipage spec, not the single-page one. #7997

Merged
merged 1 commit into from Oct 13, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Link to the HTML multipage spec, not the single-page one.

  • Loading branch information
eefriedman committed Oct 13, 2015
commit fa606bf1c87ef9f95555391c9243a3cc1383d9ce
@@ -744,13 +744,13 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
Ok(())
}

// https://html.spec.whatwg.org/#dom-context-2d-imagesmoothingenabled
// https://html.spec.whatwg.org/multipage/#dom-context-2d-imagesmoothingenabled
fn ImageSmoothingEnabled(&self) -> bool {
let state = self.state.borrow();
state.image_smoothing_enabled
}

// https://html.spec.whatwg.org/#dom-context-2d-imagesmoothingenabled
// https://html.spec.whatwg.org/multipage/#dom-context-2d-imagesmoothingenabled
fn SetImageSmoothingEnabled(&self, value: bool) -> () {
self.state.borrow_mut().image_smoothing_enabled = value;
}
@@ -1170,7 +1170,7 @@ impl DocumentMethods for Document {
}
}

// https://html.spec.whatwg.org/#dom-document-hasfocus
// https://html.spec.whatwg.org/multipage/#dom-document-hasfocus
fn HasFocus(&self) -> bool {
let target = self; // Step 1.
let window = self.window.root();
@@ -1394,7 +1394,7 @@ impl DocumentMethods for Document {
}
}

// https://html.spec.whatwg.org/#dom-document-lastmodified
// https://html.spec.whatwg.org/multipage/#dom-document-lastmodified
fn LastModified(&self) -> DOMString {
match self.last_modified {
Some(ref t) => t.clone(),
@@ -1419,7 +1419,7 @@ impl DocumentMethods for Document {
TreeWalker::new(self, root, whatToShow, filter)
}

// https://html.spec.whatwg.org/#document.title
// https://html.spec.whatwg.org/multipage/#document.title
fn Title(&self) -> DOMString {
let title = self.GetDocumentElement().and_then(|root| {
if root.r().namespace() == &ns!(SVG) && root.r().local_name() == &atom!("svg") {
@@ -1446,7 +1446,7 @@ impl DocumentMethods for Document {
}
}

// https://html.spec.whatwg.org/#document.title
// https://html.spec.whatwg.org/multipage/#document.title
fn SetTitle(&self, title: DOMString) {
let root = match self.GetDocumentElement() {
Some(root) => root,
@@ -1497,7 +1497,7 @@ impl DocumentMethods for Document {
elem.r().SetTextContent(Some(title));
}

// https://html.spec.whatwg.org/#dom-document-head
// https://html.spec.whatwg.org/multipage/#dom-document-head
fn GetHead(&self) -> Option<Root<HTMLHeadElement>> {
self.get_html_element().and_then(|root| {
let node = NodeCast::from_ref(root.r());
@@ -1507,12 +1507,12 @@ impl DocumentMethods for Document {
})
}

// https://html.spec.whatwg.org/#dom-document-currentscript
// https://html.spec.whatwg.org/multipage/#dom-document-currentscript
fn GetCurrentScript(&self) -> Option<Root<HTMLScriptElement>> {
self.current_script.get_rooted()
}

// https://html.spec.whatwg.org/#dom-document-body
// https://html.spec.whatwg.org/multipage/#dom-document-body
fn GetBody(&self) -> Option<Root<HTMLElement>> {
self.get_html_element().and_then(|root| {
let node = NodeCast::from_ref(root.r());
@@ -1528,7 +1528,7 @@ impl DocumentMethods for Document {
})
}

// https://html.spec.whatwg.org/#dom-document-body
// https://html.spec.whatwg.org/multipage/#dom-document-body
fn SetBody(&self, new_body: Option<&HTMLElement>) -> ErrorResult {
// Step 1.
let new_body = match new_body {
@@ -1571,7 +1571,7 @@ impl DocumentMethods for Document {
Ok(())
}

// https://html.spec.whatwg.org/#dom-document-getelementsbyname
// https://html.spec.whatwg.org/multipage/#dom-document-getelementsbyname
fn GetElementsByName(&self, name: DOMString) -> Root<NodeList> {
self.create_node_list(|node| {
let element = match ElementCast::to_ref(node) {
@@ -1587,7 +1587,7 @@ impl DocumentMethods for Document {
})
}

// https://html.spec.whatwg.org/#dom-document-images
// https://html.spec.whatwg.org/multipage/#dom-document-images
fn Images(&self) -> Root<HTMLCollection> {
self.images.or_init(|| {
let window = self.window.root();
@@ -1597,7 +1597,7 @@ impl DocumentMethods for Document {
})
}

// https://html.spec.whatwg.org/#dom-document-embeds
// https://html.spec.whatwg.org/multipage/#dom-document-embeds
fn Embeds(&self) -> Root<HTMLCollection> {
self.embeds.or_init(|| {
let window = self.window.root();
@@ -1607,12 +1607,12 @@ impl DocumentMethods for Document {
})
}

// https://html.spec.whatwg.org/#dom-document-plugins
// https://html.spec.whatwg.org/multipage/#dom-document-plugins
fn Plugins(&self) -> Root<HTMLCollection> {
self.Embeds()
}

// https://html.spec.whatwg.org/#dom-document-links
// https://html.spec.whatwg.org/multipage/#dom-document-links
fn Links(&self) -> Root<HTMLCollection> {
self.links.or_init(|| {
let window = self.window.root();
@@ -1622,7 +1622,7 @@ impl DocumentMethods for Document {
})
}

// https://html.spec.whatwg.org/#dom-document-forms
// https://html.spec.whatwg.org/multipage/#dom-document-forms
fn Forms(&self) -> Root<HTMLCollection> {
self.forms.or_init(|| {
let window = self.window.root();
@@ -1632,7 +1632,7 @@ impl DocumentMethods for Document {
})
}

// https://html.spec.whatwg.org/#dom-document-scripts
// https://html.spec.whatwg.org/multipage/#dom-document-scripts
fn Scripts(&self) -> Root<HTMLCollection> {
self.scripts.or_init(|| {
let window = self.window.root();
@@ -1642,7 +1642,7 @@ impl DocumentMethods for Document {
})
}

// https://html.spec.whatwg.org/#dom-document-anchors
// https://html.spec.whatwg.org/multipage/#dom-document-anchors
fn Anchors(&self) -> Root<HTMLCollection> {
self.anchors.or_init(|| {
let window = self.window.root();
@@ -1652,7 +1652,7 @@ impl DocumentMethods for Document {
})
}

// https://html.spec.whatwg.org/#dom-document-applets
// https://html.spec.whatwg.org/multipage/#dom-document-applets
fn Applets(&self) -> Root<HTMLCollection> {
// FIXME: This should be return OBJECT elements containing applets.
self.applets.or_init(|| {
@@ -1663,7 +1663,7 @@ impl DocumentMethods for Document {
})
}

// https://html.spec.whatwg.org/#dom-document-location
// https://html.spec.whatwg.org/multipage/#dom-document-location
fn Location(&self) -> Root<Location> {
let window = self.window.root();
let window = window.r();
@@ -1771,7 +1771,7 @@ impl DocumentMethods for Document {
filter_by_name(&self.name, NodeCast::from_ref(elem))
}
}
// https://html.spec.whatwg.org/#dom-document-nameditem-filter
// https://html.spec.whatwg.org/multipage/#dom-document-nameditem-filter
fn filter_by_name(name: &Atom, node: &Node) -> bool {
let html_elem_type = match node.type_id() {
NodeTypeId::Element(ElementTypeId::HTMLElement(type_)) => type_,
@@ -1861,7 +1861,7 @@ impl DocumentMethods for Document {
// This method intentionally does nothing
}

// https://html.spec.whatwg.org/#dom-document-releaseevents
// https://html.spec.whatwg.org/multipage/#dom-document-releaseevents
fn ReleaseEvents(&self) {
// This method intentionally does nothing
}
@@ -33,7 +33,7 @@ impl DOMStringMap {
}
}

// https://html.spec.whatwg.org/#domstringmap
// https://html.spec.whatwg.org/multipage/#domstringmap
impl DOMStringMapMethods for DOMStringMap {
// https://html.spec.whatwg.org/multipage/#dom-domstringmap-removeitem
fn NamedDeleter(&self, name: DOMString) {
@@ -50,10 +50,10 @@ impl HTMLAppletElement {
}

impl HTMLAppletElementMethods for HTMLAppletElement {
// https://html.spec.whatwg.org/#the-applet-element:dom-applet-name
// https://html.spec.whatwg.org/multipage/#the-applet-element:dom-applet-name
make_getter!(Name);

// https://html.spec.whatwg.org/#the-applet-element:dom-applet-name
// https://html.spec.whatwg.org/multipage/#the-applet-element:dom-applet-name
make_atomic_setter!(SetName, "name");
}

@@ -268,7 +268,7 @@ impl HTMLElementMethods for HTMLElement {
}
}

// https://html.spec.whatwg.org/#attr-data-*
// https://html.spec.whatwg.org/multipage/#attr-data-*

fn to_snake_case(name: DOMString) -> DOMString {
let mut attr_name = "data-".to_owned();
@@ -8,7 +8,7 @@ use dom::bindings::js::Root;
use dom::bindings::utils::{Reflector, reflect_dom_object};
use dom::window::Window;

// https://html.spec.whatwg.org/#validitystate
// https://html.spec.whatwg.org/multipage/#validitystate
#[dom_struct]
pub struct ValidityState {
reflector_: Reflector,
@@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// https://html.spec.whatwg.org/#canvasgradient
// https://html.spec.whatwg.org/multipage/#canvasgradient
// [Exposed=(Window,Worker)]
interface CanvasGradient {
// opaque object
@@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// https://html.spec.whatwg.org/#the-domstringmap-interface
// https://html.spec.whatwg.org/multipage/#the-domstringmap-interface
[OverrideBuiltins]
interface DOMStringMap {
getter DOMString (DOMString name);
@@ -139,7 +139,7 @@ partial /*sealed*/ interface Document {
};
Document implements GlobalEventHandlers;

// https://html.spec.whatwg.org/#Document-partial
// https://html.spec.whatwg.org/multipage/#Document-partial
partial interface Document {
// [TreatNullAs=EmptyString] attribute DOMString fgColor;
// [TreatNullAs=EmptyString] attribute DOMString linkColor;
@@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// https://html.spec.whatwg.org/#the-body-element
// https://html.spec.whatwg.org/multipage/#the-body-element
interface HTMLBodyElement : HTMLElement {
// also has obsolete members
};
@@ -360,7 +360,7 @@ pub fn base64_atob(input: DOMString) -> Fallible<DOMString> {
}

impl WindowMethods for Window {
// https://html.spec.whatwg.org/#dom-alert
// https://html.spec.whatwg.org/multipage/#dom-alert
fn Alert(&self, s: DOMString) {
// Right now, just print to the console
// Ensure that stderr doesn't trample through the alert() we use to
@@ -384,17 +384,17 @@ impl WindowMethods for Window {
self.browsing_context().as_ref().unwrap().active_document()
}

// https://html.spec.whatwg.org/#dom-location
// https://html.spec.whatwg.org/multipage/#dom-location
fn Location(&self) -> Root<Location> {
self.Document().r().Location()
}

// https://html.spec.whatwg.org/#dom-sessionstorage
// https://html.spec.whatwg.org/multipage/#dom-sessionstorage
fn SessionStorage(&self) -> Root<Storage> {
self.session_storage.or_init(|| Storage::new(&GlobalRef::Window(self), StorageType::Session))
}

// https://html.spec.whatwg.org/#dom-localstorage
// https://html.spec.whatwg.org/multipage/#dom-localstorage
fn LocalStorage(&self) -> Root<Storage> {
self.local_storage.or_init(|| Storage::new(&GlobalRef::Window(self), StorageType::Local))
}
@@ -409,17 +409,17 @@ impl WindowMethods for Window {
self.crypto.or_init(|| Crypto::new(GlobalRef::Window(self)))
}

// https://html.spec.whatwg.org/#dom-frameelement
// https://html.spec.whatwg.org/multipage/#dom-frameelement
fn GetFrameElement(&self) -> Option<Root<Element>> {
self.browsing_context().as_ref().unwrap().frame_element()
}

// https://html.spec.whatwg.org/#dom-navigator
// https://html.spec.whatwg.org/multipage/#dom-navigator
fn Navigator(&self) -> Root<Navigator> {
self.navigator.or_init(|| Navigator::new(self))
}

// https://html.spec.whatwg.org/#dom-windowtimers-settimeout
// https://html.spec.whatwg.org/multipage/#dom-windowtimers-settimeout
fn SetTimeout(&self, _cx: *mut JSContext, callback: Rc<Function>, timeout: i32, args: Vec<HandleValue>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::FunctionTimerCallback(callback),
args,
@@ -429,7 +429,7 @@ impl WindowMethods for Window {
self.script_chan.clone())
}

// https://html.spec.whatwg.org/#dom-windowtimers-settimeout
// https://html.spec.whatwg.org/multipage/#dom-windowtimers-settimeout
fn SetTimeout_(&self, _cx: *mut JSContext, callback: DOMString, timeout: i32, args: Vec<HandleValue>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::StringTimerCallback(callback),
args,
@@ -439,12 +439,12 @@ impl WindowMethods for Window {
self.script_chan.clone())
}

// https://html.spec.whatwg.org/#dom-windowtimers-cleartimeout
// https://html.spec.whatwg.org/multipage/#dom-windowtimers-cleartimeout
fn ClearTimeout(&self, handle: i32) {
self.timers.clear_timeout_or_interval(handle);
}

// https://html.spec.whatwg.org/#dom-windowtimers-setinterval
// https://html.spec.whatwg.org/multipage/#dom-windowtimers-setinterval
fn SetInterval(&self, _cx: *mut JSContext, callback: Rc<Function>, timeout: i32, args: Vec<HandleValue>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::FunctionTimerCallback(callback),
args,
@@ -454,7 +454,7 @@ impl WindowMethods for Window {
self.script_chan.clone())
}

// https://html.spec.whatwg.org/#dom-windowtimers-setinterval
// https://html.spec.whatwg.org/multipage/#dom-windowtimers-setinterval
fn SetInterval_(&self, _cx: *mut JSContext, callback: DOMString, timeout: i32, args: Vec<HandleValue>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::StringTimerCallback(callback),
args,
@@ -464,7 +464,7 @@ impl WindowMethods for Window {
self.script_chan.clone())
}

// https://html.spec.whatwg.org/#dom-windowtimers-clearinterval
// https://html.spec.whatwg.org/multipage/#dom-windowtimers-clearinterval
fn ClearInterval(&self, handle: i32) {
self.ClearTimeout(handle);
}
@@ -75,8 +75,8 @@ fn read_numbers<I: Iterator<Item=char>>(mut iter: Peekable<I>) -> Option<i64> {


/// Shared implementation to parse an integer according to
/// <https://html.spec.whatwg.org/#rules-for-parsing-integers> or
/// <https://html.spec.whatwg.org/#rules-for-parsing-non-negative-integers>
/// <https://html.spec.whatwg.org/multipage/#rules-for-parsing-integers> or
/// <https://html.spec.whatwg.org/multipage/#rules-for-parsing-non-negative-integers>
fn do_parse_integer<T: Iterator<Item=char>>(input: T) -> Option<i64> {
let mut input = input.skip_while(|c| {
HTML_SPACE_CHARACTERS.iter().any(|s| s == c)
@@ -101,15 +101,15 @@ fn do_parse_integer<T: Iterator<Item=char>>(input: T) -> Option<i64> {
}

/// Parse an integer according to
/// <https://html.spec.whatwg.org/#rules-for-parsing-integers>.
/// <https://html.spec.whatwg.org/multipage/#rules-for-parsing-integers>.
pub fn parse_integer<T: Iterator<Item=char>>(input: T) -> Option<i32> {
do_parse_integer(input).and_then(|result| {
result.to_i32()
})
}

/// Parse an integer according to
/// <https://html.spec.whatwg.org/#rules-for-parsing-non-negative-integers>
/// <https://html.spec.whatwg.org/multipage/#rules-for-parsing-non-negative-integers>
pub fn parse_unsigned_integer<T: Iterator<Item=char>>(input: T) -> Option<u32> {
do_parse_integer(input).and_then(|result| {
result.to_u32()
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.