implement Element::className

This commit is contained in:
Vincent Sanders 2013-01-23 17:00:13 +00:00
parent 16d938dd63
commit 7ab835df8f
3 changed files with 20 additions and 0 deletions

View File

@ -163,6 +163,22 @@ getter id %{
}
%}
/* attribute DOMString Element::className; */
getter className %{
dom_string *value;
dom_exception exc;
exc = dom_element_get_attribute(private->node, corestring_dom_class, &value);
if (exc != DOM_NO_ERR) {
return JS_FALSE;
}
if (value != NULL) {
jsret = JS_NewStringCopyN(cx, dom_string_data(value), dom_string_length(value));
dom_string_unref(value);
}
%}
/* DOMString? Element::getAttribute(DOMString name); */
operation getAttribute %{
dom_string *value;

View File

@ -134,6 +134,7 @@ dom_string *corestring_dom_cellpadding;
dom_string *corestring_dom_cellspacing;
dom_string *corestring_dom_change;
dom_string *corestring_dom_charset;
dom_string *corestring_dom_class;
dom_string *corestring_dom_click;
dom_string *corestring_dom_close;
dom_string *corestring_dom_color;
@ -357,6 +358,7 @@ void corestrings_fini(void)
CSS_DOM_STRING_UNREF(cellspacing);
CSS_DOM_STRING_UNREF(change);
CSS_DOM_STRING_UNREF(charset);
CSS_DOM_STRING_UNREF(class);
CSS_DOM_STRING_UNREF(click);
CSS_DOM_STRING_UNREF(close);
CSS_DOM_STRING_UNREF(color);
@ -611,6 +613,7 @@ nserror corestrings_init(void)
CSS_DOM_STRING_INTERN(cellspacing);
CSS_DOM_STRING_INTERN(change);
CSS_DOM_STRING_INTERN(charset);
CSS_DOM_STRING_INTERN(class);
CSS_DOM_STRING_INTERN(click);
CSS_DOM_STRING_INTERN(close);
CSS_DOM_STRING_INTERN(color);

View File

@ -140,6 +140,7 @@ extern struct dom_string *corestring_dom_cellpadding;
extern struct dom_string *corestring_dom_cellspacing;
extern struct dom_string *corestring_dom_change;
extern struct dom_string *corestring_dom_charset;
extern struct dom_string *corestring_dom_class;
extern struct dom_string *corestring_dom_click;
extern struct dom_string *corestring_dom_close;
extern struct dom_string *corestring_dom_color;