MCPcopy Create free account
hub / github.com/ampproject/amphtml / constructor

Method constructor

validator/js/engine/htmlparser.js:167–211  ·  view source on GitHub ↗

* Creates an empty instance. * @param {!parserInterface.HtmlSaxHandler| * !parserInterface.HtmlSaxHandlerWithLocation} handler The * HtmlSaxHandler that will receive the events.

(handler)

Source from the content-addressed store, hash-verified

165 * HtmlSaxHandler that will receive the events.
166 */
167 constructor(handler) {
168 /**
169 * The current tag name and its parents.
170 * @type {!Array<string>}
171 * @private
172 */
173 this.stack_ = [];
174
175 /**
176 * The current tag name and its parents.
177 * @type {!parserInterface.HtmlSaxHandler|
178 * !parserInterface.HtmlSaxHandlerWithLocation} handler The
179 * HtmlSaxHandler that will receive the events.
180 * @private
181 */
182 this.handler_ = handler;
183
184 /**
185 * @type {number}
186 * @private
187 */
188 this.region_ = TagRegion.PRE_DOCTYPE;
189
190 /**
191 * Tracks when the start <head> tag has been encountered or manufactured.
192 * @type {boolean}
193 * @private
194 */
195 this.isHeadStarted_ = false;
196
197 /**
198 * Tracks when the start <body> tag has been encountered or manufactured.
199 * @type {boolean}
200 * @private
201 */
202 this.isBodyStarted_ = false;
203
204 /**
205 * Keeps track of the attributes from all body tags encountered within the
206 * document.
207 * @type {!Array<!Object>}
208 * @private
209 */
210 this.effectiveBodyAttribs_ = [];
211 }
212
213 /**
214 * Returns the attributes from all body tags within the document.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected