Debian Codegraph @

closure-library/closure/goog/dom/pattern/starttag.js

raw
1 // Copyright 2007 The Closure Library Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS-IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 /**
16 * @fileoverview DOM pattern to match the start of a tag.
17 *
18 * @author [email protected] (Robby Walker)
19 */
20
21 goog.provide('goog.dom.pattern.StartTag');
22
23 goog.require('goog.dom.TagWalkType');
24 goog.require('goog.dom.pattern.Tag');
25
26
27
28 /**
29 * Pattern object that matches an opening tag.
30 *
31 * @param {string|RegExp} tag Name of the tag. Also will accept a regular
32 * expression to match against the tag name.
33 * @param {Object=} opt_attrs Optional map of attribute names to desired values.
34 * This pattern will only match when all attributes are present and match
35 * the string or regular expression value provided here.
36 * @param {Object=} opt_styles Optional map of CSS style names to desired
37 * values. This pattern will only match when all styles are present and
38 * match the string or regular expression value provided here.
39 * @param {Function=} opt_test Optional function that takes the element as a
40 * parameter and returns true if this pattern should match it.
41 * @constructor
42 * @extends {goog.dom.pattern.Tag}
43 */
44 goog.dom.pattern.StartTag = function(tag, opt_attrs, opt_styles, opt_test) {
45 goog.dom.pattern.Tag.call(
46 this, tag, goog.dom.TagWalkType.START_TAG, opt_attrs, opt_styles,
47 opt_test);
48 };
49 goog.inherits(goog.dom.pattern.StartTag, goog.dom.pattern.Tag);