mirror of
https://github.com/servo/servo.git
synced 2025-06-25 01:24:37 +01:00
auto merge of #1907 : brunoabinader/servo/element-classname, r=Ms2ger
Removes stub implementation from HTMLElement & implements logic in Element WebIDL.
This commit is contained in:
commit
508fe57f8d
6 changed files with 50 additions and 14 deletions
|
@ -52,6 +52,7 @@ DOMInterfaces = {
|
|||
'Element': {
|
||||
'needsAbstract': [
|
||||
'attributes',
|
||||
'className',
|
||||
'getBoundingClientRect',
|
||||
'getClientRects',
|
||||
'getElementsByClassName',
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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;*/
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue