Bug 1523562 [wpt PR 14799] - [Animation Worklet] Upstream animation worklet inside...
[gecko.git] / parser / html / nsHtml5MetaScanner.cpp
blob41de496a02b1bad3d6fce1cc6ed5f598d2c38751
1 /*
2 * Copyright (c) 2007 Henri Sivonen
3 * Copyright (c) 2008-2015 Mozilla Foundation
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
25 * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
26 * Please edit MetaScanner.java instead and regenerate.
29 #define nsHtml5MetaScanner_cpp__
31 #include "nsAtom.h"
32 #include "nsHtml5AtomTable.h"
33 #include "nsHtml5String.h"
34 #include "nsNameSpaceManager.h"
35 #include "nsIContent.h"
36 #include "nsTraceRefcnt.h"
37 #include "jArray.h"
38 #include "nsHtml5ArrayCopy.h"
39 #include "nsAHtml5TreeBuilderState.h"
40 #include "nsGkAtoms.h"
41 #include "nsHtml5ByteReadable.h"
42 #include "nsHtml5Macros.h"
43 #include "nsIContentHandle.h"
44 #include "nsHtml5Portability.h"
45 #include "nsHtml5ContentCreatorFunction.h"
47 #include "nsHtml5AttributeName.h"
48 #include "nsHtml5ElementName.h"
49 #include "nsHtml5Tokenizer.h"
50 #include "nsHtml5TreeBuilder.h"
51 #include "nsHtml5StackNode.h"
52 #include "nsHtml5UTF16Buffer.h"
53 #include "nsHtml5StateSnapshot.h"
54 #include "nsHtml5Portability.h"
56 #include "nsHtml5MetaScanner.h"
58 static char16_t const CHARSET_DATA[] = {'h', 'a', 'r', 's', 'e', 't'};
59 staticJArray<char16_t, int32_t> nsHtml5MetaScanner::CHARSET = {
60 CHARSET_DATA, MOZ_ARRAY_LENGTH(CHARSET_DATA)};
61 static char16_t const CONTENT_DATA[] = {'o', 'n', 't', 'e', 'n', 't'};
62 staticJArray<char16_t, int32_t> nsHtml5MetaScanner::CONTENT = {
63 CONTENT_DATA, MOZ_ARRAY_LENGTH(CONTENT_DATA)};
64 static char16_t const HTTP_EQUIV_DATA[] = {'t', 't', 'p', '-', 'e',
65 'q', 'u', 'i', 'v'};
66 staticJArray<char16_t, int32_t> nsHtml5MetaScanner::HTTP_EQUIV = {
67 HTTP_EQUIV_DATA, MOZ_ARRAY_LENGTH(HTTP_EQUIV_DATA)};
68 static char16_t const CONTENT_TYPE_DATA[] = {'c', 'o', 'n', 't', 'e', 'n',
69 't', '-', 't', 'y', 'p', 'e'};
70 staticJArray<char16_t, int32_t> nsHtml5MetaScanner::CONTENT_TYPE = {
71 CONTENT_TYPE_DATA, MOZ_ARRAY_LENGTH(CONTENT_TYPE_DATA)};
73 nsHtml5MetaScanner::nsHtml5MetaScanner(nsHtml5TreeBuilder* tb)
74 : readable(nullptr),
75 metaState(NO),
76 contentIndex(INT32_MAX),
77 charsetIndex(INT32_MAX),
78 httpEquivIndex(INT32_MAX),
79 contentTypeIndex(INT32_MAX),
80 stateSave(DATA),
81 strBufLen(0),
82 strBuf(jArray<char16_t, int32_t>::newJArray(36)),
83 content(nullptr),
84 charset(nullptr),
85 httpEquivState(HTTP_EQUIV_NOT_SEEN),
86 treeBuilder(tb),
87 mEncoding(nullptr) {
88 MOZ_COUNT_CTOR(nsHtml5MetaScanner);
91 nsHtml5MetaScanner::~nsHtml5MetaScanner() {
92 MOZ_COUNT_DTOR(nsHtml5MetaScanner);
93 content.Release();
94 charset.Release();
97 void nsHtml5MetaScanner::stateLoop(int32_t state) {
98 int32_t c = -1;
99 bool reconsume = false;
100 stateloop:
101 for (;;) {
102 switch (state) {
103 case DATA: {
104 for (;;) {
105 if (reconsume) {
106 reconsume = false;
107 } else {
108 c = read();
110 switch (c) {
111 case -1: {
112 NS_HTML5_BREAK(stateloop);
114 case '<': {
115 state = nsHtml5MetaScanner::TAG_OPEN;
116 NS_HTML5_BREAK(dataloop);
118 default: { continue; }
121 dataloop_end:;
122 MOZ_FALLTHROUGH;
124 case TAG_OPEN: {
125 for (;;) {
126 c = read();
127 switch (c) {
128 case -1: {
129 NS_HTML5_BREAK(stateloop);
131 case 'm':
132 case 'M': {
133 metaState = M;
134 state = nsHtml5MetaScanner::TAG_NAME;
135 NS_HTML5_BREAK(tagopenloop);
137 case '!': {
138 state = nsHtml5MetaScanner::MARKUP_DECLARATION_OPEN;
139 NS_HTML5_CONTINUE(stateloop);
141 case '\?':
142 case '/': {
143 state = nsHtml5MetaScanner::SCAN_UNTIL_GT;
144 NS_HTML5_CONTINUE(stateloop);
146 case '>': {
147 state = nsHtml5MetaScanner::DATA;
148 NS_HTML5_CONTINUE(stateloop);
150 default: {
151 if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
152 metaState = NO;
153 state = nsHtml5MetaScanner::TAG_NAME;
154 NS_HTML5_BREAK(tagopenloop);
156 state = nsHtml5MetaScanner::DATA;
157 reconsume = true;
158 NS_HTML5_CONTINUE(stateloop);
162 tagopenloop_end:;
163 MOZ_FALLTHROUGH;
165 case TAG_NAME: {
166 for (;;) {
167 c = read();
168 switch (c) {
169 case -1: {
170 NS_HTML5_BREAK(stateloop);
172 case ' ':
173 case '\t':
174 case '\n':
175 case '\f': {
176 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
177 NS_HTML5_BREAK(tagnameloop);
179 case '/': {
180 state = nsHtml5MetaScanner::SELF_CLOSING_START_TAG;
181 NS_HTML5_CONTINUE(stateloop);
183 case '>': {
184 state = nsHtml5MetaScanner::DATA;
185 NS_HTML5_CONTINUE(stateloop);
187 case 'e':
188 case 'E': {
189 if (metaState == M) {
190 metaState = E;
191 } else {
192 metaState = NO;
194 continue;
196 case 't':
197 case 'T': {
198 if (metaState == E) {
199 metaState = T;
200 } else {
201 metaState = NO;
203 continue;
205 case 'a':
206 case 'A': {
207 if (metaState == T) {
208 metaState = A;
209 } else {
210 metaState = NO;
212 continue;
214 default: {
215 metaState = NO;
216 continue;
220 tagnameloop_end:;
221 MOZ_FALLTHROUGH;
223 case BEFORE_ATTRIBUTE_NAME: {
224 for (;;) {
225 if (reconsume) {
226 reconsume = false;
227 } else {
228 c = read();
230 switch (c) {
231 case -1: {
232 NS_HTML5_BREAK(stateloop);
234 case ' ':
235 case '\t':
236 case '\n':
237 case '\f': {
238 continue;
240 case '/': {
241 state = nsHtml5MetaScanner::SELF_CLOSING_START_TAG;
242 NS_HTML5_CONTINUE(stateloop);
244 case '>': {
245 if (handleTag()) {
246 NS_HTML5_BREAK(stateloop);
248 state = DATA;
249 NS_HTML5_CONTINUE(stateloop);
251 case 'c':
252 case 'C': {
253 contentIndex = 0;
254 charsetIndex = 0;
255 httpEquivIndex = INT32_MAX;
256 contentTypeIndex = INT32_MAX;
257 state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
258 NS_HTML5_BREAK(beforeattributenameloop);
260 case 'h':
261 case 'H': {
262 contentIndex = INT32_MAX;
263 charsetIndex = INT32_MAX;
264 httpEquivIndex = 0;
265 contentTypeIndex = INT32_MAX;
266 state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
267 NS_HTML5_BREAK(beforeattributenameloop);
269 default: {
270 contentIndex = INT32_MAX;
271 charsetIndex = INT32_MAX;
272 httpEquivIndex = INT32_MAX;
273 contentTypeIndex = INT32_MAX;
274 state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
275 NS_HTML5_BREAK(beforeattributenameloop);
279 beforeattributenameloop_end:;
280 MOZ_FALLTHROUGH;
282 case ATTRIBUTE_NAME: {
283 for (;;) {
284 c = read();
285 switch (c) {
286 case -1: {
287 NS_HTML5_BREAK(stateloop);
289 case ' ':
290 case '\t':
291 case '\n':
292 case '\f': {
293 state = nsHtml5MetaScanner::AFTER_ATTRIBUTE_NAME;
294 NS_HTML5_CONTINUE(stateloop);
296 case '/': {
297 state = nsHtml5MetaScanner::SELF_CLOSING_START_TAG;
298 NS_HTML5_CONTINUE(stateloop);
300 case '=': {
301 strBufLen = 0;
302 contentTypeIndex = 0;
303 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_VALUE;
304 NS_HTML5_BREAK(attributenameloop);
306 case '>': {
307 if (handleTag()) {
308 NS_HTML5_BREAK(stateloop);
310 state = nsHtml5MetaScanner::DATA;
311 NS_HTML5_CONTINUE(stateloop);
313 default: {
314 if (metaState == A) {
315 if (c >= 'A' && c <= 'Z') {
316 c += 0x20;
318 if (contentIndex < CONTENT.length &&
319 c == CONTENT[contentIndex]) {
320 ++contentIndex;
321 } else {
322 contentIndex = INT32_MAX;
324 if (charsetIndex < CHARSET.length &&
325 c == CHARSET[charsetIndex]) {
326 ++charsetIndex;
327 } else {
328 charsetIndex = INT32_MAX;
330 if (httpEquivIndex < HTTP_EQUIV.length &&
331 c == HTTP_EQUIV[httpEquivIndex]) {
332 ++httpEquivIndex;
333 } else {
334 httpEquivIndex = INT32_MAX;
337 continue;
341 attributenameloop_end:;
342 MOZ_FALLTHROUGH;
344 case BEFORE_ATTRIBUTE_VALUE: {
345 for (;;) {
346 c = read();
347 switch (c) {
348 case -1: {
349 NS_HTML5_BREAK(stateloop);
351 case ' ':
352 case '\t':
353 case '\n':
354 case '\f': {
355 continue;
357 case '\"': {
358 state = nsHtml5MetaScanner::ATTRIBUTE_VALUE_DOUBLE_QUOTED;
359 NS_HTML5_BREAK(beforeattributevalueloop);
361 case '\'': {
362 state = nsHtml5MetaScanner::ATTRIBUTE_VALUE_SINGLE_QUOTED;
363 NS_HTML5_CONTINUE(stateloop);
365 case '>': {
366 if (handleTag()) {
367 NS_HTML5_BREAK(stateloop);
369 state = nsHtml5MetaScanner::DATA;
370 NS_HTML5_CONTINUE(stateloop);
372 default: {
373 handleCharInAttributeValue(c);
374 state = nsHtml5MetaScanner::ATTRIBUTE_VALUE_UNQUOTED;
375 NS_HTML5_CONTINUE(stateloop);
379 beforeattributevalueloop_end:;
380 MOZ_FALLTHROUGH;
382 case ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
383 for (;;) {
384 if (reconsume) {
385 reconsume = false;
386 } else {
387 c = read();
389 switch (c) {
390 case -1: {
391 NS_HTML5_BREAK(stateloop);
393 case '\"': {
394 handleAttributeValue();
395 state = nsHtml5MetaScanner::AFTER_ATTRIBUTE_VALUE_QUOTED;
396 NS_HTML5_BREAK(attributevaluedoublequotedloop);
398 default: {
399 handleCharInAttributeValue(c);
400 continue;
404 attributevaluedoublequotedloop_end:;
405 MOZ_FALLTHROUGH;
407 case AFTER_ATTRIBUTE_VALUE_QUOTED: {
408 for (;;) {
409 c = read();
410 switch (c) {
411 case -1: {
412 NS_HTML5_BREAK(stateloop);
414 case ' ':
415 case '\t':
416 case '\n':
417 case '\f': {
418 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
419 NS_HTML5_CONTINUE(stateloop);
421 case '/': {
422 state = nsHtml5MetaScanner::SELF_CLOSING_START_TAG;
423 NS_HTML5_BREAK(afterattributevaluequotedloop);
425 case '>': {
426 if (handleTag()) {
427 NS_HTML5_BREAK(stateloop);
429 state = nsHtml5MetaScanner::DATA;
430 NS_HTML5_CONTINUE(stateloop);
432 default: {
433 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
434 reconsume = true;
435 NS_HTML5_CONTINUE(stateloop);
439 afterattributevaluequotedloop_end:;
440 MOZ_FALLTHROUGH;
442 case SELF_CLOSING_START_TAG: {
443 c = read();
444 switch (c) {
445 case -1: {
446 NS_HTML5_BREAK(stateloop);
448 case '>': {
449 if (handleTag()) {
450 NS_HTML5_BREAK(stateloop);
452 state = nsHtml5MetaScanner::DATA;
453 NS_HTML5_CONTINUE(stateloop);
455 default: {
456 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
457 reconsume = true;
458 NS_HTML5_CONTINUE(stateloop);
462 case ATTRIBUTE_VALUE_UNQUOTED: {
463 for (;;) {
464 if (reconsume) {
465 reconsume = false;
466 } else {
467 c = read();
469 switch (c) {
470 case -1: {
471 NS_HTML5_BREAK(stateloop);
473 case ' ':
474 case '\t':
475 case '\n':
476 case '\f': {
477 handleAttributeValue();
478 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
479 NS_HTML5_CONTINUE(stateloop);
481 case '>': {
482 handleAttributeValue();
483 if (handleTag()) {
484 NS_HTML5_BREAK(stateloop);
486 state = nsHtml5MetaScanner::DATA;
487 NS_HTML5_CONTINUE(stateloop);
489 default: {
490 handleCharInAttributeValue(c);
491 continue;
496 case AFTER_ATTRIBUTE_NAME: {
497 for (;;) {
498 c = read();
499 switch (c) {
500 case -1: {
501 NS_HTML5_BREAK(stateloop);
503 case ' ':
504 case '\t':
505 case '\n':
506 case '\f': {
507 continue;
509 case '/': {
510 handleAttributeValue();
511 state = nsHtml5MetaScanner::SELF_CLOSING_START_TAG;
512 NS_HTML5_CONTINUE(stateloop);
514 case '=': {
515 strBufLen = 0;
516 contentTypeIndex = 0;
517 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_VALUE;
518 NS_HTML5_CONTINUE(stateloop);
520 case '>': {
521 handleAttributeValue();
522 if (handleTag()) {
523 NS_HTML5_BREAK(stateloop);
525 state = nsHtml5MetaScanner::DATA;
526 NS_HTML5_CONTINUE(stateloop);
528 case 'c':
529 case 'C': {
530 contentIndex = 0;
531 charsetIndex = 0;
532 state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
533 NS_HTML5_CONTINUE(stateloop);
535 default: {
536 contentIndex = INT32_MAX;
537 charsetIndex = INT32_MAX;
538 state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
539 NS_HTML5_CONTINUE(stateloop);
544 case MARKUP_DECLARATION_OPEN: {
545 for (;;) {
546 c = read();
547 switch (c) {
548 case -1: {
549 NS_HTML5_BREAK(stateloop);
551 case '-': {
552 state = nsHtml5MetaScanner::MARKUP_DECLARATION_HYPHEN;
553 NS_HTML5_BREAK(markupdeclarationopenloop);
555 default: {
556 state = nsHtml5MetaScanner::SCAN_UNTIL_GT;
557 reconsume = true;
558 NS_HTML5_CONTINUE(stateloop);
562 markupdeclarationopenloop_end:;
563 MOZ_FALLTHROUGH;
565 case MARKUP_DECLARATION_HYPHEN: {
566 for (;;) {
567 c = read();
568 switch (c) {
569 case -1: {
570 NS_HTML5_BREAK(stateloop);
572 case '-': {
573 state = nsHtml5MetaScanner::COMMENT_START;
574 NS_HTML5_BREAK(markupdeclarationhyphenloop);
576 default: {
577 state = nsHtml5MetaScanner::SCAN_UNTIL_GT;
578 reconsume = true;
579 NS_HTML5_CONTINUE(stateloop);
583 markupdeclarationhyphenloop_end:;
584 MOZ_FALLTHROUGH;
586 case COMMENT_START: {
587 for (;;) {
588 c = read();
589 switch (c) {
590 case -1: {
591 NS_HTML5_BREAK(stateloop);
593 case '-': {
594 state = nsHtml5MetaScanner::COMMENT_START_DASH;
595 NS_HTML5_CONTINUE(stateloop);
597 case '>': {
598 state = nsHtml5MetaScanner::DATA;
599 NS_HTML5_CONTINUE(stateloop);
601 default: {
602 state = nsHtml5MetaScanner::COMMENT;
603 NS_HTML5_BREAK(commentstartloop);
607 commentstartloop_end:;
608 MOZ_FALLTHROUGH;
610 case COMMENT: {
611 for (;;) {
612 c = read();
613 switch (c) {
614 case -1: {
615 NS_HTML5_BREAK(stateloop);
617 case '-': {
618 state = nsHtml5MetaScanner::COMMENT_END_DASH;
619 NS_HTML5_BREAK(commentloop);
621 default: { continue; }
624 commentloop_end:;
625 MOZ_FALLTHROUGH;
627 case COMMENT_END_DASH: {
628 for (;;) {
629 c = read();
630 switch (c) {
631 case -1: {
632 NS_HTML5_BREAK(stateloop);
634 case '-': {
635 state = nsHtml5MetaScanner::COMMENT_END;
636 NS_HTML5_BREAK(commentenddashloop);
638 default: {
639 state = nsHtml5MetaScanner::COMMENT;
640 NS_HTML5_CONTINUE(stateloop);
644 commentenddashloop_end:;
645 MOZ_FALLTHROUGH;
647 case COMMENT_END: {
648 for (;;) {
649 c = read();
650 switch (c) {
651 case -1: {
652 NS_HTML5_BREAK(stateloop);
654 case '>': {
655 state = nsHtml5MetaScanner::DATA;
656 NS_HTML5_CONTINUE(stateloop);
658 case '-': {
659 continue;
661 default: {
662 state = nsHtml5MetaScanner::COMMENT;
663 NS_HTML5_CONTINUE(stateloop);
668 case COMMENT_START_DASH: {
669 c = read();
670 switch (c) {
671 case -1: {
672 NS_HTML5_BREAK(stateloop);
674 case '-': {
675 state = nsHtml5MetaScanner::COMMENT_END;
676 NS_HTML5_CONTINUE(stateloop);
678 case '>': {
679 state = nsHtml5MetaScanner::DATA;
680 NS_HTML5_CONTINUE(stateloop);
682 default: {
683 state = nsHtml5MetaScanner::COMMENT;
684 NS_HTML5_CONTINUE(stateloop);
688 case ATTRIBUTE_VALUE_SINGLE_QUOTED: {
689 for (;;) {
690 if (reconsume) {
691 reconsume = false;
692 } else {
693 c = read();
695 switch (c) {
696 case -1: {
697 NS_HTML5_BREAK(stateloop);
699 case '\'': {
700 handleAttributeValue();
701 state = nsHtml5MetaScanner::AFTER_ATTRIBUTE_VALUE_QUOTED;
702 NS_HTML5_CONTINUE(stateloop);
704 default: {
705 handleCharInAttributeValue(c);
706 continue;
711 case SCAN_UNTIL_GT: {
712 for (;;) {
713 if (reconsume) {
714 reconsume = false;
715 } else {
716 c = read();
718 switch (c) {
719 case -1: {
720 NS_HTML5_BREAK(stateloop);
722 case '>': {
723 state = nsHtml5MetaScanner::DATA;
724 NS_HTML5_CONTINUE(stateloop);
726 default: { continue; }
732 stateloop_end:;
733 stateSave = state;
736 void nsHtml5MetaScanner::handleCharInAttributeValue(int32_t c) {
737 if (metaState == A) {
738 if (contentIndex == CONTENT.length || charsetIndex == CHARSET.length) {
739 addToBuffer(c);
740 } else if (httpEquivIndex == HTTP_EQUIV.length) {
741 if (contentTypeIndex < CONTENT_TYPE.length &&
742 toAsciiLowerCase(c) == CONTENT_TYPE[contentTypeIndex]) {
743 ++contentTypeIndex;
744 } else {
745 contentTypeIndex = INT32_MAX;
751 void nsHtml5MetaScanner::addToBuffer(int32_t c) {
752 if (strBufLen == strBuf.length) {
753 jArray<char16_t, int32_t> newBuf = jArray<char16_t, int32_t>::newJArray(
754 strBuf.length + (strBuf.length << 1));
755 nsHtml5ArrayCopy::arraycopy(strBuf, newBuf, strBuf.length);
756 strBuf = newBuf;
758 strBuf[strBufLen++] = (char16_t)c;
761 void nsHtml5MetaScanner::handleAttributeValue() {
762 if (metaState != A) {
763 return;
765 if (contentIndex == CONTENT.length && !content) {
766 content = nsHtml5Portability::newStringFromBuffer(strBuf, 0, strBufLen,
767 treeBuilder, false);
768 return;
770 if (charsetIndex == CHARSET.length && !charset) {
771 charset = nsHtml5Portability::newStringFromBuffer(strBuf, 0, strBufLen,
772 treeBuilder, false);
773 return;
775 if (httpEquivIndex == HTTP_EQUIV.length &&
776 httpEquivState == HTTP_EQUIV_NOT_SEEN) {
777 httpEquivState = (contentTypeIndex == CONTENT_TYPE.length)
778 ? HTTP_EQUIV_CONTENT_TYPE
779 : HTTP_EQUIV_OTHER;
780 return;
784 bool nsHtml5MetaScanner::handleTag() {
785 bool stop = handleTagInner();
786 content.Release();
787 content = nullptr;
788 charset.Release();
789 charset = nullptr;
790 httpEquivState = HTTP_EQUIV_NOT_SEEN;
791 return stop;
794 bool nsHtml5MetaScanner::handleTagInner() {
795 if (!!charset && tryCharset(charset)) {
796 return true;
798 if (!!content && httpEquivState == HTTP_EQUIV_CONTENT_TYPE) {
799 nsHtml5String extract =
800 nsHtml5TreeBuilder::extractCharsetFromContent(content, treeBuilder);
801 if (!extract) {
802 return false;
804 bool success = tryCharset(extract);
805 extract.Release();
806 return success;
808 return false;
811 void nsHtml5MetaScanner::initializeStatics() {}
813 void nsHtml5MetaScanner::releaseStatics() {}
815 #include "nsHtml5MetaScannerCppSupplement.h"