Skip to content
Permalink
Browse files

Compute attribute name atoms at compile-time.

  • Loading branch information
eefriedman committed Nov 27, 2015
1 parent 3720e4d commit c02c0576c821a95fa4a68c29d410566e99487dc9
@@ -86,25 +86,25 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
}

// https://html.spec.whatwg.org/multipage/#dom-a-coords
make_getter!(Coords);
make_getter!(Coords, "coords");

// https://html.spec.whatwg.org/multipage/#dom-a-coords
make_setter!(SetCoords, "coords");

// https://html.spec.whatwg.org/multipage/#dom-a-name
make_getter!(Name);
make_getter!(Name, "name");

// https://html.spec.whatwg.org/multipage/#dom-a-name
make_setter!(SetName, "name");

// https://html.spec.whatwg.org/multipage/#dom-a-rev
make_getter!(Rev);
make_getter!(Rev, "rev");

// https://html.spec.whatwg.org/multipage/#dom-a-rev
make_setter!(SetRev, "rev");

// https://html.spec.whatwg.org/multipage/#dom-a-shape
make_getter!(Shape);
make_getter!(Shape, "shape");

// https://html.spec.whatwg.org/multipage/#dom-a-shape
make_setter!(SetShape, "shape");
@@ -40,7 +40,7 @@ impl HTMLAppletElement {

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

// https://html.spec.whatwg.org/multipage/#the-applet-element:dom-applet-name
make_atomic_setter!(SetName, "name");
@@ -60,7 +60,7 @@ impl HTMLBodyElementMethods for HTMLBodyElement {
make_legacy_color_setter!(SetBgColor, "bgcolor");

// https://html.spec.whatwg.org/multipage/#dom-body-text
make_getter!(Text);
make_getter!(Text, "text");

// https://html.spec.whatwg.org/multipage/#dom-body-text
make_legacy_color_setter!(SetText, "text");
@@ -71,7 +71,7 @@ impl HTMLButtonElementMethods for HTMLButtonElement {
}

// https://html.spec.whatwg.org/multipage/#dom-fe-disabled
make_bool_getter!(Disabled);
make_bool_getter!(Disabled, "disabled");

// https://html.spec.whatwg.org/multipage/#dom-fe-disabled
make_bool_setter!(SetDisabled, "disabled");
@@ -82,44 +82,46 @@ impl HTMLButtonElementMethods for HTMLButtonElement {
}

// https://html.spec.whatwg.org/multipage/#dom-button-type
make_enumerated_getter!(Type, "submit", ("reset") | ("button") | ("menu"));
make_enumerated_getter!(Type, "type", "submit", ("reset") | ("button") | ("menu"));

// https://html.spec.whatwg.org/multipage/#dom-button-type
make_setter!(SetType, "type");

// https://html.spec.whatwg.org/multipage/#dom-fs-formaction
make_url_or_base_getter!(FormAction);
make_url_or_base_getter!(FormAction, "formaction");

// https://html.spec.whatwg.org/multipage/#dom-fs-formaction
make_setter!(SetFormAction, "formaction");

// https://html.spec.whatwg.org/multipage/#dom-fs-formenctype
make_enumerated_getter!(
FormEnctype, "application/x-www-form-urlencoded", ("text/plain") | ("multipart/form-data"));
make_enumerated_getter!(FormEnctype,
"formenctype",
"application/x-www-form-urlencoded",
("text/plain") | ("multipart/form-data"));

// https://html.spec.whatwg.org/multipage/#dom-fs-formenctype
make_setter!(SetFormEnctype, "formenctype");

// https://html.spec.whatwg.org/multipage/#dom-fs-formmethod
make_enumerated_getter!(FormMethod, "get", ("post") | ("dialog"));
make_enumerated_getter!(FormMethod, "formmethod", "get", ("post") | ("dialog"));

// https://html.spec.whatwg.org/multipage/#dom-fs-formmethod
make_setter!(SetFormMethod, "formmethod");

// https://html.spec.whatwg.org/multipage/#dom-fs-formtarget
make_getter!(FormTarget);
make_getter!(FormTarget, "formtarget");

// https://html.spec.whatwg.org/multipage/#dom-fs-formtarget
make_setter!(SetFormTarget, "formtarget");

// https://html.spec.whatwg.org/multipage/#dom-fe-name
make_getter!(Name);
make_getter!(Name, "name");

// https://html.spec.whatwg.org/multipage/#dom-fe-name
make_setter!(SetName, "name");

// https://html.spec.whatwg.org/multipage/#dom-button-value
make_getter!(Value);
make_getter!(Value, "value");

// https://html.spec.whatwg.org/multipage/#dom-button-value
make_setter!(SetValue, "value");
@@ -39,7 +39,7 @@ impl HTMLDialogElement {

impl HTMLDialogElementMethods for HTMLDialogElement {
// https://html.spec.whatwg.org/multipage/#dom-dialog-open
make_bool_getter!(Open);
make_bool_getter!(Open, "open");

// https://html.spec.whatwg.org/multipage/#dom-dialog-open
make_bool_setter!(SetOpen, "open");
@@ -34,7 +34,7 @@ impl HTMLDivElement {

impl HTMLDivElementMethods for HTMLDivElement {
// https://html.spec.whatwg.org/multipage/#dom-div-align
make_getter!(Align);
make_getter!(Align, "align");

// https://html.spec.whatwg.org/multipage/#dom-div-align
make_setter!(SetAlign, "align");
@@ -129,17 +129,17 @@ impl HTMLElementMethods for HTMLElement {
}

// https://html.spec.whatwg.org/multipage/#attr-title
make_getter!(Title);
make_getter!(Title, "title");
// https://html.spec.whatwg.org/multipage/#attr-title
make_setter!(SetTitle, "title");

// https://html.spec.whatwg.org/multipage/#attr-lang
make_getter!(Lang);
make_getter!(Lang, "lang");
// https://html.spec.whatwg.org/multipage/#attr-lang
make_setter!(SetLang, "lang");

// https://html.spec.whatwg.org/multipage/#dom-hidden
make_bool_getter!(Hidden);
make_bool_getter!(Hidden, "hidden");
// https://html.spec.whatwg.org/multipage/#dom-hidden
make_bool_setter!(SetHidden, "hidden");

@@ -68,7 +68,7 @@ impl HTMLFieldSetElementMethods for HTMLFieldSetElement {
}

// https://html.spec.whatwg.org/multipage/#dom-fieldset-disabled
make_bool_getter!(Disabled);
make_bool_getter!(Disabled, "disabled");

// https://html.spec.whatwg.org/multipage/#dom-fieldset-disabled
make_bool_setter!(SetDisabled, "disabled");
@@ -47,13 +47,13 @@ impl HTMLFontElementMethods for HTMLFontElement {
make_legacy_color_setter!(SetColor, "color");

// https://html.spec.whatwg.org/multipage/#dom-font-face
make_getter!(Face);
make_getter!(Face, "face");

// https://html.spec.whatwg.org/multipage/#dom-font-face
make_atomic_setter!(SetFace, "face");

// https://html.spec.whatwg.org/multipage/#dom-font-size
make_getter!(Size);
make_getter!(Size, "size");

// https://html.spec.whatwg.org/multipage/#dom-font-size
fn SetSize(&self, value: DOMString) {
@@ -75,19 +75,22 @@ impl HTMLFormElementMethods for HTMLFormElement {
make_setter!(SetAcceptCharset, "accept-charset");

// https://html.spec.whatwg.org/multipage/#dom-fs-action
make_url_or_base_getter!(Action);
make_url_or_base_getter!(Action, "action");

// https://html.spec.whatwg.org/multipage/#dom-fs-action
make_setter!(SetAction, "action");

// https://html.spec.whatwg.org/multipage/#dom-form-autocomplete
make_enumerated_getter!(Autocomplete, "on", ("off"));
make_enumerated_getter!(Autocomplete, "autocomplete", "on", ("off"));

// https://html.spec.whatwg.org/multipage/#dom-form-autocomplete
make_setter!(SetAutocomplete, "autocomplete");

// https://html.spec.whatwg.org/multipage/#dom-fs-enctype
make_enumerated_getter!(Enctype, "application/x-www-form-urlencoded", ("text/plain") | ("multipart/form-data"));
make_enumerated_getter!(Enctype,
"enctype",
"application/x-www-form-urlencoded",
("text/plain") | ("multipart/form-data"));

// https://html.spec.whatwg.org/multipage/#dom-fs-enctype
make_setter!(SetEnctype, "enctype");
@@ -103,25 +106,25 @@ impl HTMLFormElementMethods for HTMLFormElement {
}

// https://html.spec.whatwg.org/multipage/#dom-fs-method
make_enumerated_getter!(Method, "get", ("post") | ("dialog"));
make_enumerated_getter!(Method, "method", "get", ("post") | ("dialog"));

// https://html.spec.whatwg.org/multipage/#dom-fs-method
make_setter!(SetMethod, "method");

// https://html.spec.whatwg.org/multipage/#dom-form-name
make_getter!(Name);
make_getter!(Name, "name");

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

// https://html.spec.whatwg.org/multipage/#dom-fs-novalidate
make_bool_getter!(NoValidate);
make_bool_getter!(NoValidate, "novalidate");

// https://html.spec.whatwg.org/multipage/#dom-fs-novalidate
make_bool_setter!(SetNoValidate, "novalidate");

// https://html.spec.whatwg.org/multipage/#dom-fs-target
make_getter!(Target);
make_getter!(Target, "target");

// https://html.spec.whatwg.org/multipage/#dom-fs-target
make_setter!(SetTarget, "target");
@@ -38,13 +38,13 @@ impl HTMLHRElement {

impl HTMLHRElementMethods for HTMLHRElement {
// https://html.spec.whatwg.org/multipage/#dom-hr-color
make_getter!(Color);
make_getter!(Color, "color");

// https://html.spec.whatwg.org/multipage/#dom-hr-color
make_legacy_color_setter!(SetColor, "color");

// https://html.spec.whatwg.org/multipage/#dom-hr-width
make_getter!(Width);
make_getter!(Width, "width");

// https://html.spec.whatwg.org/multipage/#dom-hr-width
make_dimension_setter!(SetWidth, "width");
@@ -380,12 +380,12 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
}

// https://html.spec.whatwg.org/multipage/#dom-dim-width
make_getter!(Width);
make_getter!(Width, "width");
// https://html.spec.whatwg.org/multipage/#dom-dim-width
make_setter!(SetWidth, "width");

// https://html.spec.whatwg.org/multipage/#dom-dim-height
make_getter!(Height);
make_getter!(Height, "height");
// https://html.spec.whatwg.org/multipage/#dom-dim-height
make_setter!(SetHeight, "height");
}
@@ -182,22 +182,22 @@ impl LayoutHTMLImageElementHelpers for LayoutJS<HTMLImageElement> {

impl HTMLImageElementMethods for HTMLImageElement {
// https://html.spec.whatwg.org/multipage/#dom-img-alt
make_getter!(Alt);
make_getter!(Alt, "alt");
// https://html.spec.whatwg.org/multipage/#dom-img-alt
make_setter!(SetAlt, "alt");

// https://html.spec.whatwg.org/multipage/#dom-img-src
make_url_getter!(Src);
make_url_getter!(Src, "src");
// https://html.spec.whatwg.org/multipage/#dom-img-src
make_setter!(SetSrc, "src");

// https://html.spec.whatwg.org/multipage/#dom-img-usemap
make_getter!(UseMap);
make_getter!(UseMap, "usemap");
// https://html.spec.whatwg.org/multipage/#dom-img-usemap
make_setter!(SetUseMap, "usemap");

// https://html.spec.whatwg.org/multipage/#dom-img-ismap
make_bool_getter!(IsMap);
make_bool_getter!(IsMap, "ismap");
// https://html.spec.whatwg.org/multipage/#dom-img-ismap
make_bool_setter!(SetIsMap, "ismap");

@@ -248,37 +248,37 @@ impl HTMLImageElementMethods for HTMLImageElement {
}

// https://html.spec.whatwg.org/multipage/#dom-img-name
make_getter!(Name);
make_getter!(Name, "name");

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

// https://html.spec.whatwg.org/multipage/#dom-img-align
make_getter!(Align);
make_getter!(Align, "align");

// https://html.spec.whatwg.org/multipage/#dom-img-align
make_setter!(SetAlign, "align");

// https://html.spec.whatwg.org/multipage/#dom-img-hspace
make_uint_getter!(Hspace);
make_uint_getter!(Hspace, "hspace");

// https://html.spec.whatwg.org/multipage/#dom-img-hspace
make_uint_setter!(SetHspace, "hspace");

// https://html.spec.whatwg.org/multipage/#dom-img-vspace
make_uint_getter!(Vspace);
make_uint_getter!(Vspace, "vspace");

// https://html.spec.whatwg.org/multipage/#dom-img-vspace
make_uint_setter!(SetVspace, "vspace");

// https://html.spec.whatwg.org/multipage/#dom-img-longdesc
make_getter!(LongDesc);
make_getter!(LongDesc, "longdesc");

// https://html.spec.whatwg.org/multipage/#dom-img-longdesc
make_setter!(SetLongDesc, "longdesc");

// https://html.spec.whatwg.org/multipage/#dom-img-border
make_getter!(Border);
make_getter!(Border, "border");

// https://html.spec.whatwg.org/multipage/#dom-img-border
make_setter!(SetBorder, "border");

0 comments on commit c02c057

Please sign in to comment.
You can’t perform that action at this time.