mirror of
https://github.com/servo/servo.git
synced 2025-06-20 07:08:59 +01:00
auto merge of #1774 : Ms2ger/servo/element-noops, r=jdm
This commit is contained in:
commit
ab72c473cd
2 changed files with 4 additions and 111 deletions
|
@ -524,24 +524,7 @@ impl Element {
|
||||||
HTMLCollection::new(&doc.get().window, ~[])
|
HTMLCollection::new(&doc.get().window, ~[])
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-element-matches
|
// http://dev.w3.org/csswg/cssom-view/#dom-element-getclientrects
|
||||||
pub fn MozMatchesSelector(&self, _selector: DOMString) -> Fallible<bool> {
|
|
||||||
// FIXME: stub - https://github.com/mozilla/servo/issues/1660
|
|
||||||
Ok(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn SetCapture(&self, _retargetToElement: bool) {
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn ReleaseCapture(&self) {
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn MozRequestFullScreen(&self) {
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn MozRequestPointerLock(&self) {
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn GetClientRects(&self, abstract_self: &JS<Element>) -> JS<ClientRectList> {
|
pub fn GetClientRects(&self, abstract_self: &JS<Element>) -> JS<ClientRectList> {
|
||||||
let doc = self.node.owner_doc();
|
let doc = self.node.owner_doc();
|
||||||
let win = &doc.get().window;
|
let win = &doc.get().window;
|
||||||
|
@ -565,6 +548,7 @@ impl Element {
|
||||||
ClientRectList::new(win, rects)
|
ClientRectList::new(win, rects)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// http://dev.w3.org/csswg/cssom-view/#dom-element-getboundingclientrect
|
||||||
pub fn GetBoundingClientRect(&self, abstract_self: &JS<Element>) -> JS<ClientRect> {
|
pub fn GetBoundingClientRect(&self, abstract_self: &JS<Element>) -> JS<ClientRect> {
|
||||||
let doc = self.node.owner_doc();
|
let doc = self.node.owner_doc();
|
||||||
let win = &doc.get().window;
|
let win = &doc.get().window;
|
||||||
|
@ -583,71 +567,14 @@ impl Element {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ScrollIntoView(&self, _top: bool) {
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn ScrollTop(&self) -> i32 {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn SetScrollTop(&mut self, _scroll_top: i32) {
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn ScrollLeft(&self) -> i32 {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn SetScrollLeft(&mut self, _scroll_left: i32) {
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn ScrollWidth(&self) -> i32 {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn ScrollHeight(&self) -> i32 {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn ClientTop(&self) -> i32 {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn ClientLeft(&self) -> i32 {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn ClientWidth(&self) -> i32 {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn ClientHeight(&self) -> i32 {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn GetInnerHTML(&self, abstract_self: &JS<Element>) -> Fallible<DOMString> {
|
pub fn GetInnerHTML(&self, abstract_self: &JS<Element>) -> Fallible<DOMString> {
|
||||||
//XXX TODO: XML case
|
//XXX TODO: XML case
|
||||||
Ok(serialize(&mut NodeIterator::new(NodeCast::from(abstract_self), false, false)))
|
Ok(serialize(&mut NodeIterator::new(NodeCast::from(abstract_self), false, false)))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn SetInnerHTML(&mut self, _abstract_self: &JS<Element>, _value: DOMString) -> ErrorResult {
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn GetOuterHTML(&self, abstract_self: &JS<Element>) -> Fallible<DOMString> {
|
pub fn GetOuterHTML(&self, abstract_self: &JS<Element>) -> Fallible<DOMString> {
|
||||||
Ok(serialize(&mut NodeIterator::new(NodeCast::from(abstract_self), true, false)))
|
Ok(serialize(&mut NodeIterator::new(NodeCast::from(abstract_self), true, false)))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn SetOuterHTML(&mut self, _abstract_self: &JS<Element>, _value: DOMString) -> ErrorResult {
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn InsertAdjacentHTML(&mut self, _position: DOMString, _text: DOMString) -> ErrorResult {
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn QuerySelector(&self, _selectors: DOMString) -> Fallible<Option<JS<Element>>> {
|
|
||||||
Ok(None)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait IElement {
|
pub trait IElement {
|
||||||
|
|
|
@ -54,54 +54,20 @@ interface Element : Node {
|
||||||
[Throws]
|
[Throws]
|
||||||
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
|
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
|
||||||
HTMLCollection getElementsByClassName(DOMString classNames);
|
HTMLCollection getElementsByClassName(DOMString classNames);
|
||||||
|
|
||||||
// Selectors API
|
|
||||||
/**
|
|
||||||
* Returns whether this element would be selected by the given selector
|
|
||||||
* string.
|
|
||||||
*
|
|
||||||
* See <http://dev.w3.org/2006/webapi/selectors-api2/#matchesselector>
|
|
||||||
*/
|
|
||||||
[Throws]
|
|
||||||
boolean mozMatchesSelector(DOMString selector);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface
|
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface
|
||||||
partial interface Element {
|
partial interface Element {
|
||||||
ClientRectList getClientRects();
|
ClientRectList getClientRects();
|
||||||
ClientRect getBoundingClientRect();
|
ClientRect getBoundingClientRect();
|
||||||
|
|
||||||
// scrolling
|
|
||||||
void scrollIntoView(optional boolean top = true);
|
|
||||||
// None of the CSSOM attributes are [Pure], because they flush
|
|
||||||
attribute long scrollTop; // scroll on setting
|
|
||||||
attribute long scrollLeft; // scroll on setting
|
|
||||||
readonly attribute long scrollWidth;
|
|
||||||
readonly attribute long scrollHeight;
|
|
||||||
|
|
||||||
readonly attribute long clientTop;
|
|
||||||
readonly attribute long clientLeft;
|
|
||||||
readonly attribute long clientWidth;
|
|
||||||
readonly attribute long clientHeight;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface
|
// http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface
|
||||||
partial interface Element {
|
partial interface Element {
|
||||||
[Throws,TreatNullAs=EmptyString]
|
[Throws,TreatNullAs=EmptyString]
|
||||||
attribute DOMString innerHTML;
|
readonly attribute DOMString innerHTML;
|
||||||
[Throws,TreatNullAs=EmptyString]
|
[Throws,TreatNullAs=EmptyString]
|
||||||
attribute DOMString outerHTML;
|
readonly attribute DOMString outerHTML;
|
||||||
[Throws]
|
|
||||||
void insertAdjacentHTML(DOMString position, DOMString text);
|
|
||||||
};
|
|
||||||
|
|
||||||
// http://www.w3.org/TR/selectors-api/#interface-definitions
|
|
||||||
partial interface Element {
|
|
||||||
[Throws]
|
|
||||||
Element? querySelector(DOMString selectors);
|
|
||||||
/*[Throws]
|
|
||||||
NodeList querySelectorAll(DOMString selectors);*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*Element implements ChildNode;
|
/*Element implements ChildNode;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue