Bug 1690340 - Part 1: Hide all the panel tools in the developer tools menu. r=jdescottes
[gecko.git] / parser / html / nsHtml5MetaScanner.cpp
blobac4786293b74f3c924257d98b35970101605df89
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: {
119 continue;
123 dataloop_end:;
124 [[fallthrough]];
126 case TAG_OPEN: {
127 for (;;) {
128 c = read();
129 switch (c) {
130 case -1: {
131 NS_HTML5_BREAK(stateloop);
133 case 'm':
134 case 'M': {
135 metaState = M;
136 state = nsHtml5MetaScanner::TAG_NAME;
137 NS_HTML5_BREAK(tagopenloop);
139 case '!': {
140 state = nsHtml5MetaScanner::MARKUP_DECLARATION_OPEN;
141 NS_HTML5_CONTINUE(stateloop);
143 case '\?':
144 case '/': {
145 state = nsHtml5MetaScanner::SCAN_UNTIL_GT;
146 NS_HTML5_CONTINUE(stateloop);
148 case '>': {
149 state = nsHtml5MetaScanner::DATA;
150 NS_HTML5_CONTINUE(stateloop);
152 default: {
153 if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
154 metaState = NO;
155 state = nsHtml5MetaScanner::TAG_NAME;
156 NS_HTML5_BREAK(tagopenloop);
158 state = nsHtml5MetaScanner::DATA;
159 reconsume = true;
160 NS_HTML5_CONTINUE(stateloop);
164 tagopenloop_end:;
165 [[fallthrough]];
167 case TAG_NAME: {
168 for (;;) {
169 c = read();
170 switch (c) {
171 case -1: {
172 NS_HTML5_BREAK(stateloop);
174 case ' ':
175 case '\t':
176 case '\n':
177 case '\f': {
178 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
179 NS_HTML5_BREAK(tagnameloop);
181 case '/': {
182 state = nsHtml5MetaScanner::SELF_CLOSING_START_TAG;
183 NS_HTML5_CONTINUE(stateloop);
185 case '>': {
186 state = nsHtml5MetaScanner::DATA;
187 NS_HTML5_CONTINUE(stateloop);
189 case 'e':
190 case 'E': {
191 if (metaState == M) {
192 metaState = E;
193 } else {
194 metaState = NO;
196 continue;
198 case 't':
199 case 'T': {
200 if (metaState == E) {
201 metaState = T;
202 } else {
203 metaState = NO;
205 continue;
207 case 'a':
208 case 'A': {
209 if (metaState == T) {
210 metaState = A;
211 } else {
212 metaState = NO;
214 continue;
216 default: {
217 metaState = NO;
218 continue;
222 tagnameloop_end:;
223 [[fallthrough]];
225 case BEFORE_ATTRIBUTE_NAME: {
226 for (;;) {
227 if (reconsume) {
228 reconsume = false;
229 } else {
230 c = read();
232 switch (c) {
233 case -1: {
234 NS_HTML5_BREAK(stateloop);
236 case ' ':
237 case '\t':
238 case '\n':
239 case '\f': {
240 continue;
242 case '/': {
243 state = nsHtml5MetaScanner::SELF_CLOSING_START_TAG;
244 NS_HTML5_CONTINUE(stateloop);
246 case '>': {
247 if (handleTag()) {
248 NS_HTML5_BREAK(stateloop);
250 state = DATA;
251 NS_HTML5_CONTINUE(stateloop);
253 case 'c':
254 case 'C': {
255 contentIndex = 0;
256 charsetIndex = 0;
257 httpEquivIndex = INT32_MAX;
258 contentTypeIndex = INT32_MAX;
259 state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
260 NS_HTML5_BREAK(beforeattributenameloop);
262 case 'h':
263 case 'H': {
264 contentIndex = INT32_MAX;
265 charsetIndex = INT32_MAX;
266 httpEquivIndex = 0;
267 contentTypeIndex = INT32_MAX;
268 state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
269 NS_HTML5_BREAK(beforeattributenameloop);
271 default: {
272 contentIndex = INT32_MAX;
273 charsetIndex = INT32_MAX;
274 httpEquivIndex = INT32_MAX;
275 contentTypeIndex = INT32_MAX;
276 state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
277 NS_HTML5_BREAK(beforeattributenameloop);
281 beforeattributenameloop_end:;
282 [[fallthrough]];
284 case ATTRIBUTE_NAME: {
285 for (;;) {
286 c = read();
287 switch (c) {
288 case -1: {
289 NS_HTML5_BREAK(stateloop);
291 case ' ':
292 case '\t':
293 case '\n':
294 case '\f': {
295 state = nsHtml5MetaScanner::AFTER_ATTRIBUTE_NAME;
296 NS_HTML5_CONTINUE(stateloop);
298 case '/': {
299 state = nsHtml5MetaScanner::SELF_CLOSING_START_TAG;
300 NS_HTML5_CONTINUE(stateloop);
302 case '=': {
303 strBufLen = 0;
304 contentTypeIndex = 0;
305 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_VALUE;
306 NS_HTML5_BREAK(attributenameloop);
308 case '>': {
309 if (handleTag()) {
310 NS_HTML5_BREAK(stateloop);
312 state = nsHtml5MetaScanner::DATA;
313 NS_HTML5_CONTINUE(stateloop);
315 default: {
316 if (metaState == A) {
317 if (c >= 'A' && c <= 'Z') {
318 c += 0x20;
320 if (contentIndex < CONTENT.length &&
321 c == CONTENT[contentIndex]) {
322 ++contentIndex;
323 } else {
324 contentIndex = INT32_MAX;
326 if (charsetIndex < CHARSET.length &&
327 c == CHARSET[charsetIndex]) {
328 ++charsetIndex;
329 } else {
330 charsetIndex = INT32_MAX;
332 if (httpEquivIndex < HTTP_EQUIV.length &&
333 c == HTTP_EQUIV[httpEquivIndex]) {
334 ++httpEquivIndex;
335 } else {
336 httpEquivIndex = INT32_MAX;
339 continue;
343 attributenameloop_end:;
344 [[fallthrough]];
346 case BEFORE_ATTRIBUTE_VALUE: {
347 for (;;) {
348 c = read();
349 switch (c) {
350 case -1: {
351 NS_HTML5_BREAK(stateloop);
353 case ' ':
354 case '\t':
355 case '\n':
356 case '\f': {
357 continue;
359 case '\"': {
360 state = nsHtml5MetaScanner::ATTRIBUTE_VALUE_DOUBLE_QUOTED;
361 NS_HTML5_BREAK(beforeattributevalueloop);
363 case '\'': {
364 state = nsHtml5MetaScanner::ATTRIBUTE_VALUE_SINGLE_QUOTED;
365 NS_HTML5_CONTINUE(stateloop);
367 case '>': {
368 if (handleTag()) {
369 NS_HTML5_BREAK(stateloop);
371 state = nsHtml5MetaScanner::DATA;
372 NS_HTML5_CONTINUE(stateloop);
374 default: {
375 handleCharInAttributeValue(c);
376 state = nsHtml5MetaScanner::ATTRIBUTE_VALUE_UNQUOTED;
377 NS_HTML5_CONTINUE(stateloop);
381 beforeattributevalueloop_end:;
382 [[fallthrough]];
384 case ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
385 for (;;) {
386 if (reconsume) {
387 reconsume = false;
388 } else {
389 c = read();
391 switch (c) {
392 case -1: {
393 NS_HTML5_BREAK(stateloop);
395 case '\"': {
396 handleAttributeValue();
397 state = nsHtml5MetaScanner::AFTER_ATTRIBUTE_VALUE_QUOTED;
398 NS_HTML5_BREAK(attributevaluedoublequotedloop);
400 default: {
401 handleCharInAttributeValue(c);
402 continue;
406 attributevaluedoublequotedloop_end:;
407 [[fallthrough]];
409 case AFTER_ATTRIBUTE_VALUE_QUOTED: {
410 for (;;) {
411 c = read();
412 switch (c) {
413 case -1: {
414 NS_HTML5_BREAK(stateloop);
416 case ' ':
417 case '\t':
418 case '\n':
419 case '\f': {
420 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
421 NS_HTML5_CONTINUE(stateloop);
423 case '/': {
424 state = nsHtml5MetaScanner::SELF_CLOSING_START_TAG;
425 NS_HTML5_BREAK(afterattributevaluequotedloop);
427 case '>': {
428 if (handleTag()) {
429 NS_HTML5_BREAK(stateloop);
431 state = nsHtml5MetaScanner::DATA;
432 NS_HTML5_CONTINUE(stateloop);
434 default: {
435 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
436 reconsume = true;
437 NS_HTML5_CONTINUE(stateloop);
441 afterattributevaluequotedloop_end:;
442 [[fallthrough]];
444 case SELF_CLOSING_START_TAG: {
445 c = read();
446 switch (c) {
447 case -1: {
448 NS_HTML5_BREAK(stateloop);
450 case '>': {
451 if (handleTag()) {
452 NS_HTML5_BREAK(stateloop);
454 state = nsHtml5MetaScanner::DATA;
455 NS_HTML5_CONTINUE(stateloop);
457 default: {
458 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
459 reconsume = true;
460 NS_HTML5_CONTINUE(stateloop);
464 case ATTRIBUTE_VALUE_UNQUOTED: {
465 for (;;) {
466 if (reconsume) {
467 reconsume = false;
468 } else {
469 c = read();
471 switch (c) {
472 case -1: {
473 NS_HTML5_BREAK(stateloop);
475 case ' ':
476 case '\t':
477 case '\n':
478 case '\f': {
479 handleAttributeValue();
480 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
481 NS_HTML5_CONTINUE(stateloop);
483 case '>': {
484 handleAttributeValue();
485 if (handleTag()) {
486 NS_HTML5_BREAK(stateloop);
488 state = nsHtml5MetaScanner::DATA;
489 NS_HTML5_CONTINUE(stateloop);
491 default: {
492 handleCharInAttributeValue(c);
493 continue;
498 case AFTER_ATTRIBUTE_NAME: {
499 for (;;) {
500 c = read();
501 switch (c) {
502 case -1: {
503 NS_HTML5_BREAK(stateloop);
505 case ' ':
506 case '\t':
507 case '\n':
508 case '\f': {
509 continue;
511 case '/': {
512 handleAttributeValue();
513 state = nsHtml5MetaScanner::SELF_CLOSING_START_TAG;
514 NS_HTML5_CONTINUE(stateloop);
516 case '=': {
517 strBufLen = 0;
518 contentTypeIndex = 0;
519 state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_VALUE;
520 NS_HTML5_CONTINUE(stateloop);
522 case '>': {
523 handleAttributeValue();
524 if (handleTag()) {
525 NS_HTML5_BREAK(stateloop);
527 state = nsHtml5MetaScanner::DATA;
528 NS_HTML5_CONTINUE(stateloop);
530 case 'c':
531 case 'C': {
532 contentIndex = 0;
533 charsetIndex = 0;
534 state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
535 NS_HTML5_CONTINUE(stateloop);
537 default: {
538 contentIndex = INT32_MAX;
539 charsetIndex = INT32_MAX;
540 state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
541 NS_HTML5_CONTINUE(stateloop);
546 case MARKUP_DECLARATION_OPEN: {
547 for (;;) {
548 c = read();
549 switch (c) {
550 case -1: {
551 NS_HTML5_BREAK(stateloop);
553 case '-': {
554 state = nsHtml5MetaScanner::MARKUP_DECLARATION_HYPHEN;
555 NS_HTML5_BREAK(markupdeclarationopenloop);
557 default: {
558 state = nsHtml5MetaScanner::SCAN_UNTIL_GT;
559 reconsume = true;
560 NS_HTML5_CONTINUE(stateloop);
564 markupdeclarationopenloop_end:;
565 [[fallthrough]];
567 case MARKUP_DECLARATION_HYPHEN: {
568 for (;;) {
569 c = read();
570 switch (c) {
571 case -1: {
572 NS_HTML5_BREAK(stateloop);
574 case '-': {
575 state = nsHtml5MetaScanner::COMMENT_START;
576 NS_HTML5_BREAK(markupdeclarationhyphenloop);
578 default: {
579 state = nsHtml5MetaScanner::SCAN_UNTIL_GT;
580 reconsume = true;
581 NS_HTML5_CONTINUE(stateloop);
585 markupdeclarationhyphenloop_end:;
586 [[fallthrough]];
588 case COMMENT_START: {
589 for (;;) {
590 c = read();
591 switch (c) {
592 case -1: {
593 NS_HTML5_BREAK(stateloop);
595 case '-': {
596 state = nsHtml5MetaScanner::COMMENT_START_DASH;
597 NS_HTML5_CONTINUE(stateloop);
599 case '>': {
600 state = nsHtml5MetaScanner::DATA;
601 NS_HTML5_CONTINUE(stateloop);
603 default: {
604 state = nsHtml5MetaScanner::COMMENT;
605 NS_HTML5_BREAK(commentstartloop);
609 commentstartloop_end:;
610 [[fallthrough]];
612 case COMMENT: {
613 for (;;) {
614 c = read();
615 switch (c) {
616 case -1: {
617 NS_HTML5_BREAK(stateloop);
619 case '-': {
620 state = nsHtml5MetaScanner::COMMENT_END_DASH;
621 NS_HTML5_BREAK(commentloop);
623 default: {
624 continue;
628 commentloop_end:;
629 [[fallthrough]];
631 case COMMENT_END_DASH: {
632 for (;;) {
633 c = read();
634 switch (c) {
635 case -1: {
636 NS_HTML5_BREAK(stateloop);
638 case '-': {
639 state = nsHtml5MetaScanner::COMMENT_END;
640 NS_HTML5_BREAK(commentenddashloop);
642 default: {
643 state = nsHtml5MetaScanner::COMMENT;
644 NS_HTML5_CONTINUE(stateloop);
648 commentenddashloop_end:;
649 [[fallthrough]];
651 case COMMENT_END: {
652 for (;;) {
653 c = read();
654 switch (c) {
655 case -1: {
656 NS_HTML5_BREAK(stateloop);
658 case '>': {
659 state = nsHtml5MetaScanner::DATA;
660 NS_HTML5_CONTINUE(stateloop);
662 case '-': {
663 continue;
665 default: {
666 state = nsHtml5MetaScanner::COMMENT;
667 NS_HTML5_CONTINUE(stateloop);
672 case COMMENT_START_DASH: {
673 c = read();
674 switch (c) {
675 case -1: {
676 NS_HTML5_BREAK(stateloop);
678 case '-': {
679 state = nsHtml5MetaScanner::COMMENT_END;
680 NS_HTML5_CONTINUE(stateloop);
682 case '>': {
683 state = nsHtml5MetaScanner::DATA;
684 NS_HTML5_CONTINUE(stateloop);
686 default: {
687 state = nsHtml5MetaScanner::COMMENT;
688 NS_HTML5_CONTINUE(stateloop);
692 case ATTRIBUTE_VALUE_SINGLE_QUOTED: {
693 for (;;) {
694 if (reconsume) {
695 reconsume = false;
696 } else {
697 c = read();
699 switch (c) {
700 case -1: {
701 NS_HTML5_BREAK(stateloop);
703 case '\'': {
704 handleAttributeValue();
705 state = nsHtml5MetaScanner::AFTER_ATTRIBUTE_VALUE_QUOTED;
706 NS_HTML5_CONTINUE(stateloop);
708 default: {
709 handleCharInAttributeValue(c);
710 continue;
715 case SCAN_UNTIL_GT: {
716 for (;;) {
717 if (reconsume) {
718 reconsume = false;
719 } else {
720 c = read();
722 switch (c) {
723 case -1: {
724 NS_HTML5_BREAK(stateloop);
726 case '>': {
727 state = nsHtml5MetaScanner::DATA;
728 NS_HTML5_CONTINUE(stateloop);
730 default: {
731 continue;
738 stateloop_end:;
739 stateSave = state;
742 void nsHtml5MetaScanner::handleCharInAttributeValue(int32_t c) {
743 if (metaState == A) {
744 if (contentIndex == CONTENT.length || charsetIndex == CHARSET.length) {
745 addToBuffer(c);
746 } else if (httpEquivIndex == HTTP_EQUIV.length) {
747 if (contentTypeIndex < CONTENT_TYPE.length &&
748 toAsciiLowerCase(c) == CONTENT_TYPE[contentTypeIndex]) {
749 ++contentTypeIndex;
750 } else {
751 contentTypeIndex = INT32_MAX;
757 void nsHtml5MetaScanner::addToBuffer(int32_t c) {
758 if (strBufLen == strBuf.length) {
759 jArray<char16_t, int32_t> newBuf = jArray<char16_t, int32_t>::newJArray(
760 nsHtml5Portability::checkedAdd(strBuf.length, (strBuf.length << 1)));
761 nsHtml5ArrayCopy::arraycopy(strBuf, newBuf, strBuf.length);
762 strBuf = newBuf;
764 strBuf[strBufLen++] = (char16_t)c;
767 void nsHtml5MetaScanner::handleAttributeValue() {
768 if (metaState != A) {
769 return;
771 if (contentIndex == CONTENT.length && !content) {
772 content = nsHtml5Portability::newStringFromBuffer(strBuf, 0, strBufLen,
773 treeBuilder, false);
774 return;
776 if (charsetIndex == CHARSET.length && !charset) {
777 charset = nsHtml5Portability::newStringFromBuffer(strBuf, 0, strBufLen,
778 treeBuilder, false);
779 return;
781 if (httpEquivIndex == HTTP_EQUIV.length &&
782 httpEquivState == HTTP_EQUIV_NOT_SEEN) {
783 httpEquivState = (contentTypeIndex == CONTENT_TYPE.length)
784 ? HTTP_EQUIV_CONTENT_TYPE
785 : HTTP_EQUIV_OTHER;
786 return;
790 bool nsHtml5MetaScanner::handleTag() {
791 bool stop = handleTagInner();
792 content.Release();
793 content = nullptr;
794 charset.Release();
795 charset = nullptr;
796 httpEquivState = HTTP_EQUIV_NOT_SEEN;
797 return stop;
800 bool nsHtml5MetaScanner::handleTagInner() {
801 if (!!charset && tryCharset(charset)) {
802 return true;
804 if (!!content && httpEquivState == HTTP_EQUIV_CONTENT_TYPE) {
805 nsHtml5String extract =
806 nsHtml5TreeBuilder::extractCharsetFromContent(content, treeBuilder);
807 if (!extract) {
808 return false;
810 bool success = tryCharset(extract);
811 extract.Release();
812 return success;
814 return false;
817 void nsHtml5MetaScanner::initializeStatics() {}
819 void nsHtml5MetaScanner::releaseStatics() {}
821 #include "nsHtml5MetaScannerCppSupplement.h"