Skip to content

Commit

Permalink
Generate bindings for HTMLLinkElement
Browse files Browse the repository at this point in the history
  • Loading branch information
recrack authored and jdm committed Aug 23, 2013
1 parent c830679 commit 75ccbdb
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/script/dom/bindings/codegen/Bindings.conf
Expand Up @@ -561,6 +561,7 @@ addHTMLElement('HTMLHtmlElement')
addHTMLElement('HTMLHRElement')
addHTMLElement('HTMLIFrameElement')
addHTMLElement('HTMLImageElement')
addHTMLElement('HTMLLinkElement')
addHTMLElement('HTMLMetaElement')
addHTMLElement('HTMLOListElement')
addHTMLElement('HTMLParagraphElement')
Expand Down
1 change: 1 addition & 0 deletions src/components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -4631,6 +4631,7 @@ def makeEnumTypedef(e):
'dom::htmlhrelement::HTMLHRElement',
'dom::htmliframeelement::HTMLIFrameElement', #XXXjdm
'dom::htmlimageelement::HTMLImageElement', #XXXjdm
'dom::htmllinkelement::HTMLLinkElement', #XXXrecrack
'dom::htmlmetaelement::HTMLMetaElement',
'dom::htmlolistelement::HTMLOListElement',
'dom::htmlscriptelement::HTMLScriptElement',
Expand Down
47 changes: 47 additions & 0 deletions src/components/script/dom/bindings/codegen/HTMLLinkElement.webidl
@@ -0,0 +1,47 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/.
*
* The origin of this IDL file is
* http://www.whatwg.org/specs/web-apps/current-work/#the-link-element
* http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
* Opera Software ASA. You are granted a license to use, reproduce
* and create derivative works of this document.
*/

// http://www.whatwg.org/specs/web-apps/current-work/#the-link-element
interface HTMLLinkElement : HTMLElement {
[Pure]
attribute boolean disabled;
[SetterThrows, Pure]
attribute DOMString href;
[SetterThrows, Pure]
attribute DOMString crossOrigin;
[SetterThrows, Pure]
attribute DOMString rel;
// Not supported yet:
// readonly attribute DOMTokenList relList;
[SetterThrows, Pure]
attribute DOMString media;
[SetterThrows, Pure]
attribute DOMString hreflang;
[SetterThrows, Pure]
attribute DOMString type;
// Not supported yet:
// [PutForwards=value] readonly attribute DOMSettableTokenList sizes;
};

// TODO
//HTMLLinkElement implements LinkStyle;

// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLLinkElement {
[SetterThrows, Pure]
attribute DOMString charset;
[SetterThrows, Pure]
attribute DOMString rev;
[SetterThrows, Pure]
attribute DOMString target;
};
3 changes: 3 additions & 0 deletions src/components/script/dom/bindings/node.rs
Expand Up @@ -13,6 +13,7 @@ use dom::element::{HTMLElementTypeId,
HTMLCanvasElementTypeId, HTMLDataElementTypeId,
HTMLDivElementTypeId, HTMLHeadElementTypeId, HTMLHRElementTypeId,
HTMLHtmlElementTypeId, HTMLIframeElementTypeId, HTMLImageElementTypeId,
HTMLLinkElementTypeId,
HTMLMetaElementTypeId, HTMLOListElementTypeId,
HTMLParagraphElementTypeId, HTMLScriptElementTypeId,
HTMLSpanElementTypeId, HTMLSourceElementTypeId,
Expand All @@ -34,6 +35,7 @@ use dom::htmldataelement::HTMLDataElement;
use dom::htmldlistelement::HTMLDListElement;
use dom::htmliframeelement::HTMLIFrameElement;
use dom::htmlimageelement::HTMLImageElement;
use dom::htmllinkelement::HTMLLinkElement;
use dom::htmlmetaelement::HTMLMetaElement;
use dom::htmlolistelement::HTMLOListElement;
use dom::htmlscriptelement::HTMLScriptElement;
Expand Down Expand Up @@ -127,6 +129,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
ElementNodeTypeId(HTMLHtmlElementTypeId) => generate_element!(HTMLHtmlElement),
ElementNodeTypeId(HTMLIframeElementTypeId) => generate_element!(HTMLIFrameElement),
ElementNodeTypeId(HTMLImageElementTypeId) => generate_element!(HTMLImageElement),
ElementNodeTypeId(HTMLLinkElementTypeId) => generate_element!(HTMLLinkElement),
ElementNodeTypeId(HTMLMetaElementTypeId) => generate_element!(HTMLMetaElement),
ElementNodeTypeId(HTMLOListElementTypeId) => generate_element!(HTMLOListElement),
ElementNodeTypeId(HTMLParagraphElementTypeId) => generate_element!(HTMLParagraphElement),
Expand Down
5 changes: 4 additions & 1 deletion src/components/script/dom/element.rs
Expand Up @@ -12,6 +12,7 @@ use dom::bindings::codegen::{HTMLAnchorElementBinding, HTMLAppletElementBinding,
HTMLHeadElementBinding, HTMLHRElementBinding,
HTMLHtmlElementBinding, HTMLIFrameElementBinding,
HTMLImageElementBinding, HTMLMetaElementBinding,
HTMLLinkElementBinding,
HTMLOListElementBinding, HTMLParagraphElementBinding,
HTMLScriptElementBinding, HTMLSourceElementBinding, HTMLSpanElementBinding,
HTMLStyleElementBinding, HTMLTableCaptionElementBinding,
Expand All @@ -36,6 +37,7 @@ use dom::htmlelement::HTMLElement;
use dom::htmlhrelement::HTMLHRElement;
use dom::htmliframeelement::HTMLIFrameElement;
use dom::htmlimageelement::HTMLImageElement;
use dom::htmllinkelement::HTMLLinkElement;
use dom::htmlmetaelement::HTMLMetaElement;
use dom::htmlolistelement::HTMLOListElement;
use dom::htmlscriptelement::HTMLScriptElement;
Expand Down Expand Up @@ -140,7 +142,6 @@ pub struct HTMLFormElement { parent: HTMLElement }
pub struct HTMLHeadElement { parent: HTMLElement }
pub struct HTMLHtmlElement { parent: HTMLElement }
pub struct HTMLInputElement { parent: HTMLElement }
pub struct HTMLLinkElement { parent: HTMLElement }
pub struct HTMLListItemElement { parent: HTMLElement }
pub struct HTMLOptionElement { parent: HTMLElement }
pub struct HTMLParagraphElement { parent: HTMLElement }
Expand Down Expand Up @@ -232,6 +233,8 @@ generate_cacheable_wrapper!(HTMLIFrameElement, HTMLIFrameElementBinding::Wrap)
generate_binding_object!(HTMLIFrameElement)
generate_cacheable_wrapper!(HTMLImageElement, HTMLImageElementBinding::Wrap)
generate_binding_object!(HTMLImageElement)
generate_cacheable_wrapper!(HTMLLinkElement, HTMLLinkElementBinding::Wrap)
generate_binding_object!(HTMLLinkElement)
generate_cacheable_wrapper!(HTMLMetaElement, HTMLMetaElementBinding::Wrap)
generate_binding_object!(HTMLMetaElement)
generate_cacheable_wrapper!(HTMLOListElement, HTMLOListElementBinding::Wrap)
Expand Down
82 changes: 82 additions & 0 deletions src/components/script/dom/htmllinkelement.rs
@@ -0,0 +1,82 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */

use dom::bindings::utils::{DOMString, null_string, ErrorResult};
use dom::htmlelement::HTMLElement;

pub struct HTMLLinkElement {
parent: HTMLElement,
}

impl HTMLLinkElement {
pub fn Disabled(&self) -> bool {
false
}

pub fn SetDisabled(&mut self, _disable: bool) {
}

pub fn Href(&self) -> DOMString {
null_string
}

pub fn SetHref(&mut self, _href: &DOMString, _rv: &mut ErrorResult) {
}

pub fn CrossOrigin(&self) -> DOMString {
null_string
}

pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) {
}

pub fn Rel(&self) -> DOMString {
null_string
}

pub fn SetRel(&mut self, _rel: &DOMString, _rv: &mut ErrorResult) {
}

pub fn Media(&self) -> DOMString {
null_string
}

pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) {
}

pub fn Hreflang(&self) -> DOMString {
null_string
}

pub fn SetHreflang(&mut self, _href: &DOMString, _rv: &mut ErrorResult) {
}

pub fn Type(&self) -> DOMString {
null_string
}

pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
}

pub fn Charset(&self) -> DOMString {
null_string
}

pub fn SetCharset(&mut self, _charset: &DOMString, _rv: &mut ErrorResult) {
}

pub fn Rev(&self) -> DOMString {
null_string
}

pub fn SetRev(&mut self, _rev: &DOMString, _rv: &mut ErrorResult) {
}

pub fn Target(&self) -> DOMString {
null_string
}

pub fn SetTarget(&mut self, _target: &DOMString, _rv: &mut ErrorResult) {
}
}
3 changes: 2 additions & 1 deletion src/components/script/html/hubbub_html_parser.rs
Expand Up @@ -21,7 +21,7 @@ use dom::element::{HTMLElementTypeId,
UnknownElementTypeId};
use dom::element::{HTMLDivElement, HTMLFontElement, HTMLFormElement,
HTMLHeadElement, HTMLHeadingElement, HTMLHtmlElement,
HTMLInputElement, HTMLLinkElement,
HTMLInputElement,
HTMLOptionElement, HTMLParagraphElement, HTMLListItemElement,
HTMLSelectElement, HTMLSmallElement,
HTMLSpanElement, HTMLTableCellElement};
Expand All @@ -39,6 +39,7 @@ use dom::htmldlistelement::HTMLDListElement;
use dom::htmlhrelement::HTMLHRElement;
use dom::htmliframeelement::{IFrameSize, HTMLIFrameElement};
use dom::htmlimageelement::HTMLImageElement;
use dom::htmllinkelement::HTMLLinkElement;
use dom::htmlmetaelement::HTMLMetaElement;
use dom::htmlolistelement::HTMLOListElement;
use dom::htmlscriptelement::HTMLScriptElement;
Expand Down
2 changes: 2 additions & 0 deletions src/components/script/script.rc
Expand Up @@ -60,6 +60,7 @@ pub mod dom {
pub mod HTMLHtmlElementBinding;
pub mod HTMLIFrameElementBinding;
pub mod HTMLImageElementBinding;
pub mod HTMLLinkElementBinding;
pub mod HTMLMetaElementBinding;
pub mod HTMLOListElementBinding;
pub mod HTMLParagraphElementBinding;
Expand Down Expand Up @@ -110,6 +111,7 @@ pub mod dom {
pub mod htmlhrelement;
pub mod htmliframeelement;
pub mod htmlimageelement;
pub mod htmllinkelement;
pub mod htmlmetaelement;
pub mod htmlolistelement;
pub mod htmlscriptelement;
Expand Down

5 comments on commit 75ccbdb

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at jdm@75ccbdb

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging jdm/servo/linkelem = 75ccbdb into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jdm/servo/linkelem = 75ccbdb merged ok, testing candidate = d6d03ac

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = d6d03ac

Please sign in to comment.