aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/script/dom/bindings/codegen/Bindings.conf1
-rw-r--r--src/components/script/dom/element.rs10
-rw-r--r--src/components/script/dom/htmlelement.rs7
-rw-r--r--src/components/script/dom/webidls/Element.webidl4
-rw-r--r--src/components/script/dom/webidls/HTMLElement.webidl4
5 files changed, 12 insertions, 14 deletions
diff --git a/src/components/script/dom/bindings/codegen/Bindings.conf b/src/components/script/dom/bindings/codegen/Bindings.conf
index 34deb138af2..7403c2256e1 100644
--- a/src/components/script/dom/bindings/codegen/Bindings.conf
+++ b/src/components/script/dom/bindings/codegen/Bindings.conf
@@ -52,6 +52,7 @@ DOMInterfaces = {
'Element': {
'needsAbstract': [
'attributes',
+ 'className',
'getBoundingClientRect',
'getClientRects',
'getElementsByClassName',
diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs
index df9ecb20430..55cec200304 100644
--- a/src/components/script/dom/element.rs
+++ b/src/components/script/dom/element.rs
@@ -430,6 +430,16 @@ impl Element {
self.set_string_attribute(abstract_self, "id", id);
}
+ // http://dom.spec.whatwg.org/#dom-element-classname
+ pub fn ClassName(&self, _abstract_self: &JS<Element>) -> DOMString {
+ self.get_string_attribute("class")
+ }
+
+ // http://dom.spec.whatwg.org/#dom-element-classname
+ pub fn SetClassName(&mut self, abstract_self: &JS<Element>, class: DOMString) {
+ self.set_string_attribute(abstract_self, "class", class);
+ }
+
// http://dom.spec.whatwg.org/#dom-element-attributes
pub fn Attributes(&mut self, abstract_self: &JS<Element>) -> JS<AttrList> {
match self.attr_list {
diff --git a/src/components/script/dom/htmlelement.rs b/src/components/script/dom/htmlelement.rs
index 8464d23aec0..f8a1cd96a9b 100644
--- a/src/components/script/dom/htmlelement.rs
+++ b/src/components/script/dom/htmlelement.rs
@@ -140,13 +140,6 @@ impl HTMLElement {
Ok(())
}
- pub fn ClassName(&self) -> DOMString {
- ~""
- }
-
- pub fn SetClassName(&self, _class: DOMString) {
- }
-
pub fn GetOffsetParent(&self) -> Option<JS<Element>> {
None
}
diff --git a/src/components/script/dom/webidls/Element.webidl b/src/components/script/dom/webidls/Element.webidl
index e26c9415d4a..2211fd5c887 100644
--- a/src/components/script/dom/webidls/Element.webidl
+++ b/src/components/script/dom/webidls/Element.webidl
@@ -28,10 +28,8 @@ interface Element : Node {
[Pure]
attribute DOMString id;
-/*
- FIXME Bug 810677 Move className from HTMLElement to Element
+ [Pure]
attribute DOMString className;
-*/
/*[Constant]
readonly attribute DOMTokenList? classList;*/
diff --git a/src/components/script/dom/webidls/HTMLElement.webidl b/src/components/script/dom/webidls/HTMLElement.webidl
index e0ce18aaff9..8f1315d011d 100644
--- a/src/components/script/dom/webidls/HTMLElement.webidl
+++ b/src/components/script/dom/webidls/HTMLElement.webidl
@@ -43,10 +43,6 @@ interface HTMLElement : Element {
readonly attribute boolean isContentEditable;
[SetterThrows, Pure]
attribute boolean spellcheck;
-
- // Mozilla specific stuff
- // FIXME Bug 810677 Move className from HTMLElement to Element
- attribute DOMString className;
};
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interface