w3c_selectors.js (2500B)
1 /* 2 * Copyright 2008 The Closure Compiler Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /** 18 * @fileoverview Definitions for W3C's Selectors API. 19 * This file depends on w3c_dom1.js. 20 * @see http://www.w3.org/TR/selectors-api2/ 21 * 22 * @externs 23 */ 24 25 /** 26 * @param {string} selectors 27 * @return {Element} 28 * @override 29 */ 30 Document.prototype.querySelector = function(selectors) {}; 31 32 /** 33 * @param {string} selectors 34 * @return {!NodeList} 35 * @override 36 */ 37 Document.prototype.querySelectorAll = function(selectors) {}; 38 39 /** 40 * @param {string} selectors 41 * @return {Element} 42 * @override 43 */ 44 Element.prototype.querySelector = function(selectors) {}; 45 46 /** 47 * @param {string} selectors 48 * @return {!NodeList} 49 * @override 50 */ 51 Element.prototype.querySelectorAll = function(selectors) {}; 52 53 /** 54 * https://dom.spec.whatwg.org/#dom-element-matches 55 * https://developer.mozilla.org/en-US/docs/Web/API/Element.matches 56 * @param {string} selectors 57 * @return {boolean} 58 */ 59 Element.prototype.matches = function(selectors) {}; 60 61 /** 62 * @param {string} selectors 63 * @param {(Node|NodeList)=} refNodes 64 * @return {boolean} 65 */ 66 Element.prototype.matchesSelector = function(selectors, refNodes) {}; 67 68 /** 69 * @see https://developer.mozilla.org/en/DOM/Node.mozMatchesSelector 70 * @param {string} selectors 71 * @return {boolean} 72 */ 73 Element.prototype.mozMatchesSelector = function(selectors) {}; 74 75 /** 76 * @see http://developer.apple.com/library/safari/documentation/WebKit/Reference/ElementClassRef/Element/Element.html 77 * @param {string} selectors 78 * @return {boolean} 79 */ 80 Element.prototype.webkitMatchesSelector = function(selectors) {}; 81 82 /** 83 * @see http://msdn.microsoft.com/en-us/library/ff975201.aspx 84 * @param {string} selectors 85 * @return {boolean} 86 */ 87 Element.prototype.msMatchesSelector = function(selectors) {}; 88 89 /** 90 * @see http://www.opera.com/docs/changelogs/windows/1150/ 91 * @param {string} selectors 92 * @return {boolean} 93 */ 94 Element.prototype.oMatchesSelector = function(selectors) {};