2009-06-28 15:44:22 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2007 Henri Sivonen
|
2010-04-09 08:48:29 -07:00
|
|
|
* Copyright (c) 2008-2010 Mozilla Foundation
|
2009-06-28 15:44:22 -07:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
|
|
|
* Please edit MetaScanner.java instead and regenerate.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define nsHtml5MetaScanner_cpp__
|
|
|
|
|
|
|
|
#include "prtypes.h"
|
|
|
|
#include "nsIAtom.h"
|
2009-09-21 04:43:43 -07:00
|
|
|
#include "nsHtml5AtomTable.h"
|
2009-06-28 15:44:22 -07:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsINameSpaceManager.h"
|
|
|
|
#include "nsIContent.h"
|
|
|
|
#include "nsIDocument.h"
|
|
|
|
#include "nsTraceRefcnt.h"
|
|
|
|
#include "jArray.h"
|
|
|
|
#include "nsHtml5DocumentMode.h"
|
|
|
|
#include "nsHtml5ArrayCopy.h"
|
|
|
|
#include "nsHtml5NamedCharacters.h"
|
2010-06-24 01:54:33 -07:00
|
|
|
#include "nsHtml5NamedCharactersAccel.h"
|
2009-06-28 15:44:22 -07:00
|
|
|
#include "nsHtml5Atoms.h"
|
|
|
|
#include "nsHtml5ByteReadable.h"
|
2009-09-18 02:21:47 -07:00
|
|
|
#include "nsIUnicodeDecoder.h"
|
2009-09-21 06:18:20 -07:00
|
|
|
#include "nsAHtml5TreeBuilderState.h"
|
2010-04-19 06:25:13 -07:00
|
|
|
#include "nsHtml5Macros.h"
|
2009-06-28 15:44:22 -07:00
|
|
|
|
|
|
|
#include "nsHtml5Tokenizer.h"
|
|
|
|
#include "nsHtml5TreeBuilder.h"
|
|
|
|
#include "nsHtml5AttributeName.h"
|
|
|
|
#include "nsHtml5ElementName.h"
|
|
|
|
#include "nsHtml5HtmlAttributes.h"
|
|
|
|
#include "nsHtml5StackNode.h"
|
|
|
|
#include "nsHtml5UTF16Buffer.h"
|
|
|
|
#include "nsHtml5StateSnapshot.h"
|
|
|
|
#include "nsHtml5Portability.h"
|
|
|
|
|
|
|
|
#include "nsHtml5MetaScanner.h"
|
|
|
|
|
2010-12-08 04:37:19 -08:00
|
|
|
static PRUnichar const CHARSET_DATA[] = { 'h', 'a', 'r', 's', 'e', 't' };
|
|
|
|
staticJArray<PRUnichar,PRInt32> nsHtml5MetaScanner::CHARSET = { CHARSET_DATA, NS_ARRAY_LENGTH(CHARSET_DATA) };
|
|
|
|
static PRUnichar const CONTENT_DATA[] = { 'o', 'n', 't', 'e', 'n', 't' };
|
|
|
|
staticJArray<PRUnichar,PRInt32> nsHtml5MetaScanner::CONTENT = { CONTENT_DATA, NS_ARRAY_LENGTH(CONTENT_DATA) };
|
|
|
|
static PRUnichar const HTTP_EQUIV_DATA[] = { 't', 't', 'p', '-', 'e', 'q', 'u', 'i', 'v' };
|
|
|
|
staticJArray<PRUnichar,PRInt32> nsHtml5MetaScanner::HTTP_EQUIV = { HTTP_EQUIV_DATA, NS_ARRAY_LENGTH(HTTP_EQUIV_DATA) };
|
|
|
|
static PRUnichar const CONTENT_TYPE_DATA[] = { 'c', 'o', 'n', 't', 'e', 'n', 't', '-', 't', 'y', 'p', 'e' };
|
|
|
|
staticJArray<PRUnichar,PRInt32> nsHtml5MetaScanner::CONTENT_TYPE = { CONTENT_TYPE_DATA, NS_ARRAY_LENGTH(CONTENT_TYPE_DATA) };
|
|
|
|
|
|
|
|
nsHtml5MetaScanner::nsHtml5MetaScanner()
|
|
|
|
: readable(nsnull),
|
|
|
|
metaState(NS_HTML5META_SCANNER_NO),
|
|
|
|
contentIndex(PR_INT32_MAX),
|
|
|
|
charsetIndex(PR_INT32_MAX),
|
|
|
|
httpEquivIndex(PR_INT32_MAX),
|
|
|
|
contentTypeIndex(PR_INT32_MAX),
|
|
|
|
stateSave(NS_HTML5META_SCANNER_DATA),
|
|
|
|
strBufLen(0),
|
|
|
|
strBuf(jArray<PRUnichar,PRInt32>::newJArray(36)),
|
|
|
|
content(nsnull),
|
|
|
|
charset(nsnull),
|
|
|
|
httpEquivState(NS_HTML5META_SCANNER_HTTP_EQUIV_NOT_SEEN)
|
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(nsHtml5MetaScanner);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nsHtml5MetaScanner::~nsHtml5MetaScanner()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(nsHtml5MetaScanner);
|
|
|
|
nsHtml5Portability::releaseString(content);
|
|
|
|
nsHtml5Portability::releaseString(charset);
|
|
|
|
}
|
|
|
|
|
2009-06-28 15:44:22 -07:00
|
|
|
void
|
|
|
|
nsHtml5MetaScanner::stateLoop(PRInt32 state)
|
|
|
|
{
|
|
|
|
PRInt32 c = -1;
|
|
|
|
PRBool reconsume = PR_FALSE;
|
|
|
|
stateloop: for (; ; ) {
|
|
|
|
switch(state) {
|
|
|
|
case NS_HTML5META_SCANNER_DATA: {
|
|
|
|
for (; ; ) {
|
|
|
|
if (reconsume) {
|
|
|
|
reconsume = PR_FALSE;
|
|
|
|
} else {
|
|
|
|
c = read();
|
|
|
|
}
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '<': {
|
|
|
|
state = NS_HTML5META_SCANNER_TAG_OPEN;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(dataloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dataloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_TAG_OPEN: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case 'm':
|
|
|
|
case 'M': {
|
|
|
|
metaState = NS_HTML5META_SCANNER_M;
|
|
|
|
state = NS_HTML5META_SCANNER_TAG_NAME;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(tagopenloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '!': {
|
|
|
|
state = NS_HTML5META_SCANNER_MARKUP_DECLARATION_OPEN;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '\?':
|
|
|
|
case '/': {
|
|
|
|
state = NS_HTML5META_SCANNER_SCAN_UNTIL_GT;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
|
|
|
|
metaState = NS_HTML5META_SCANNER_NO;
|
|
|
|
state = NS_HTML5META_SCANNER_TAG_NAME;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(tagopenloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
|
|
|
reconsume = PR_TRUE;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tagopenloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_TAG_NAME: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
case '\n':
|
|
|
|
case '\f': {
|
|
|
|
state = NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_NAME;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(tagnameloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '/': {
|
|
|
|
state = NS_HTML5META_SCANNER_SELF_CLOSING_START_TAG;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case 'e':
|
|
|
|
case 'E': {
|
|
|
|
if (metaState == NS_HTML5META_SCANNER_M) {
|
|
|
|
metaState = NS_HTML5META_SCANNER_E;
|
|
|
|
} else {
|
|
|
|
metaState = NS_HTML5META_SCANNER_NO;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case 't':
|
|
|
|
case 'T': {
|
|
|
|
if (metaState == NS_HTML5META_SCANNER_E) {
|
|
|
|
metaState = NS_HTML5META_SCANNER_T;
|
|
|
|
} else {
|
|
|
|
metaState = NS_HTML5META_SCANNER_NO;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case 'a':
|
|
|
|
case 'A': {
|
|
|
|
if (metaState == NS_HTML5META_SCANNER_T) {
|
|
|
|
metaState = NS_HTML5META_SCANNER_A;
|
|
|
|
} else {
|
|
|
|
metaState = NS_HTML5META_SCANNER_NO;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
metaState = NS_HTML5META_SCANNER_NO;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tagnameloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_NAME: {
|
|
|
|
for (; ; ) {
|
|
|
|
if (reconsume) {
|
|
|
|
reconsume = PR_FALSE;
|
|
|
|
} else {
|
|
|
|
c = read();
|
|
|
|
}
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
case '\n':
|
|
|
|
case '\f': {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case '/': {
|
|
|
|
state = NS_HTML5META_SCANNER_SELF_CLOSING_START_TAG;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
2010-12-08 04:37:19 -08:00
|
|
|
if (handleTag()) {
|
|
|
|
NS_HTML5_BREAK(stateloop);
|
|
|
|
}
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case 'c':
|
|
|
|
case 'C': {
|
|
|
|
contentIndex = 0;
|
|
|
|
charsetIndex = 0;
|
2010-12-08 04:37:19 -08:00
|
|
|
httpEquivIndex = PR_INT32_MAX;
|
|
|
|
contentTypeIndex = PR_INT32_MAX;
|
|
|
|
state = NS_HTML5META_SCANNER_ATTRIBUTE_NAME;
|
|
|
|
NS_HTML5_BREAK(beforeattributenameloop);
|
|
|
|
}
|
|
|
|
case 'h':
|
|
|
|
case 'H': {
|
|
|
|
contentIndex = PR_INT32_MAX;
|
|
|
|
charsetIndex = PR_INT32_MAX;
|
|
|
|
httpEquivIndex = 0;
|
|
|
|
contentTypeIndex = PR_INT32_MAX;
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_ATTRIBUTE_NAME;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(beforeattributenameloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
2010-12-08 04:37:19 -08:00
|
|
|
contentIndex = PR_INT32_MAX;
|
|
|
|
charsetIndex = PR_INT32_MAX;
|
|
|
|
httpEquivIndex = PR_INT32_MAX;
|
|
|
|
contentTypeIndex = PR_INT32_MAX;
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_ATTRIBUTE_NAME;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(beforeattributenameloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
beforeattributenameloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_ATTRIBUTE_NAME: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
case '\n':
|
|
|
|
case '\f': {
|
|
|
|
state = NS_HTML5META_SCANNER_AFTER_ATTRIBUTE_NAME;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '/': {
|
|
|
|
state = NS_HTML5META_SCANNER_SELF_CLOSING_START_TAG;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '=': {
|
|
|
|
strBufLen = 0;
|
2010-12-08 04:37:19 -08:00
|
|
|
contentTypeIndex = 0;
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_VALUE;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(attributenameloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
2010-12-08 04:37:19 -08:00
|
|
|
if (handleTag()) {
|
|
|
|
NS_HTML5_BREAK(stateloop);
|
|
|
|
}
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
if (metaState == NS_HTML5META_SCANNER_A) {
|
|
|
|
if (c >= 'A' && c <= 'Z') {
|
|
|
|
c += 0x20;
|
|
|
|
}
|
2010-12-08 04:37:19 -08:00
|
|
|
if (contentIndex < CONTENT.length && c == CONTENT[contentIndex]) {
|
|
|
|
++contentIndex;
|
|
|
|
} else {
|
|
|
|
contentIndex = PR_INT32_MAX;
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
2010-12-08 04:37:19 -08:00
|
|
|
if (charsetIndex < CHARSET.length && c == CHARSET[charsetIndex]) {
|
|
|
|
++charsetIndex;
|
|
|
|
} else {
|
|
|
|
charsetIndex = PR_INT32_MAX;
|
|
|
|
}
|
|
|
|
if (httpEquivIndex < HTTP_EQUIV.length && c == HTTP_EQUIV[httpEquivIndex]) {
|
|
|
|
++httpEquivIndex;
|
|
|
|
} else {
|
|
|
|
httpEquivIndex = PR_INT32_MAX;
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
attributenameloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_VALUE: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
case '\n':
|
|
|
|
case '\f': {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case '\"': {
|
|
|
|
state = NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_DOUBLE_QUOTED;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(beforeattributevalueloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '\'': {
|
|
|
|
state = NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_SINGLE_QUOTED;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
2010-12-08 04:37:19 -08:00
|
|
|
if (handleTag()) {
|
|
|
|
NS_HTML5_BREAK(stateloop);
|
|
|
|
}
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
2010-12-08 04:37:19 -08:00
|
|
|
handleCharInAttributeValue(c);
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_UNQUOTED;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
beforeattributevalueloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
|
|
|
|
for (; ; ) {
|
|
|
|
if (reconsume) {
|
|
|
|
reconsume = PR_FALSE;
|
|
|
|
} else {
|
|
|
|
c = read();
|
|
|
|
}
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '\"': {
|
2010-12-08 04:37:19 -08:00
|
|
|
handleAttributeValue();
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_AFTER_ATTRIBUTE_VALUE_QUOTED;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(attributevaluedoublequotedloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
2010-12-08 04:37:19 -08:00
|
|
|
handleCharInAttributeValue(c);
|
2009-06-28 15:44:22 -07:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
attributevaluedoublequotedloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_AFTER_ATTRIBUTE_VALUE_QUOTED: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
case '\n':
|
|
|
|
case '\f': {
|
|
|
|
state = NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_NAME;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '/': {
|
|
|
|
state = NS_HTML5META_SCANNER_SELF_CLOSING_START_TAG;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(afterattributevaluequotedloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
2010-12-08 04:37:19 -08:00
|
|
|
if (handleTag()) {
|
|
|
|
NS_HTML5_BREAK(stateloop);
|
|
|
|
}
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
state = NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_NAME;
|
|
|
|
reconsume = PR_TRUE;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
afterattributevaluequotedloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_SELF_CLOSING_START_TAG: {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
2010-12-08 04:37:19 -08:00
|
|
|
if (handleTag()) {
|
|
|
|
NS_HTML5_BREAK(stateloop);
|
|
|
|
}
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
state = NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_NAME;
|
|
|
|
reconsume = PR_TRUE;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_UNQUOTED: {
|
|
|
|
for (; ; ) {
|
|
|
|
if (reconsume) {
|
|
|
|
reconsume = PR_FALSE;
|
|
|
|
} else {
|
|
|
|
c = read();
|
|
|
|
}
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
case '\n':
|
|
|
|
case '\f': {
|
2010-12-08 04:37:19 -08:00
|
|
|
handleAttributeValue();
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_NAME;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
2010-12-08 04:37:19 -08:00
|
|
|
handleAttributeValue();
|
|
|
|
if (handleTag()) {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
2010-12-08 04:37:19 -08:00
|
|
|
handleCharInAttributeValue(c);
|
2009-06-28 15:44:22 -07:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_AFTER_ATTRIBUTE_NAME: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
case '\n':
|
|
|
|
case '\f': {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case '/': {
|
2010-12-08 04:37:19 -08:00
|
|
|
handleAttributeValue();
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_SELF_CLOSING_START_TAG;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '=': {
|
2010-12-08 04:37:19 -08:00
|
|
|
strBufLen = 0;
|
|
|
|
contentTypeIndex = 0;
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_VALUE;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
2010-12-08 04:37:19 -08:00
|
|
|
handleAttributeValue();
|
|
|
|
if (handleTag()) {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case 'c':
|
|
|
|
case 'C': {
|
|
|
|
contentIndex = 0;
|
|
|
|
charsetIndex = 0;
|
|
|
|
state = NS_HTML5META_SCANNER_ATTRIBUTE_NAME;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
contentIndex = -1;
|
|
|
|
charsetIndex = -1;
|
|
|
|
state = NS_HTML5META_SCANNER_ATTRIBUTE_NAME;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_MARKUP_DECLARATION_OPEN: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '-': {
|
|
|
|
state = NS_HTML5META_SCANNER_MARKUP_DECLARATION_HYPHEN;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(markupdeclarationopenloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
state = NS_HTML5META_SCANNER_SCAN_UNTIL_GT;
|
|
|
|
reconsume = PR_TRUE;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
markupdeclarationopenloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_MARKUP_DECLARATION_HYPHEN: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '-': {
|
|
|
|
state = NS_HTML5META_SCANNER_COMMENT_START;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(markupdeclarationhyphenloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
state = NS_HTML5META_SCANNER_SCAN_UNTIL_GT;
|
|
|
|
reconsume = PR_TRUE;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
markupdeclarationhyphenloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_COMMENT_START: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '-': {
|
|
|
|
state = NS_HTML5META_SCANNER_COMMENT_START_DASH;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
state = NS_HTML5META_SCANNER_COMMENT;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(commentstartloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
commentstartloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_COMMENT: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '-': {
|
|
|
|
state = NS_HTML5META_SCANNER_COMMENT_END_DASH;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(commentloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
commentloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_COMMENT_END_DASH: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '-': {
|
|
|
|
state = NS_HTML5META_SCANNER_COMMENT_END;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(commentenddashloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
state = NS_HTML5META_SCANNER_COMMENT;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
commentenddashloop_end: ;
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_COMMENT_END: {
|
|
|
|
for (; ; ) {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '-': {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
state = NS_HTML5META_SCANNER_COMMENT;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_COMMENT_START_DASH: {
|
|
|
|
c = read();
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '-': {
|
|
|
|
state = NS_HTML5META_SCANNER_COMMENT_END;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
state = NS_HTML5META_SCANNER_COMMENT;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_SINGLE_QUOTED: {
|
|
|
|
for (; ; ) {
|
|
|
|
if (reconsume) {
|
|
|
|
reconsume = PR_FALSE;
|
|
|
|
} else {
|
|
|
|
c = read();
|
|
|
|
}
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '\'': {
|
2010-12-08 04:37:19 -08:00
|
|
|
handleAttributeValue();
|
2009-06-28 15:44:22 -07:00
|
|
|
state = NS_HTML5META_SCANNER_AFTER_ATTRIBUTE_VALUE_QUOTED;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
2010-12-08 04:37:19 -08:00
|
|
|
handleCharInAttributeValue(c);
|
2009-06-28 15:44:22 -07:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case NS_HTML5META_SCANNER_SCAN_UNTIL_GT: {
|
|
|
|
for (; ; ) {
|
|
|
|
if (reconsume) {
|
|
|
|
reconsume = PR_FALSE;
|
|
|
|
} else {
|
|
|
|
c = read();
|
|
|
|
}
|
|
|
|
switch(c) {
|
|
|
|
case -1: {
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_BREAK(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
case '>': {
|
|
|
|
state = NS_HTML5META_SCANNER_DATA;
|
2010-04-19 06:25:13 -07:00
|
|
|
NS_HTML5_CONTINUE(stateloop);
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stateloop_end: ;
|
|
|
|
stateSave = state;
|
|
|
|
}
|
|
|
|
|
2010-12-08 04:37:19 -08:00
|
|
|
void
|
|
|
|
nsHtml5MetaScanner::handleCharInAttributeValue(PRInt32 c)
|
|
|
|
{
|
|
|
|
if (metaState == NS_HTML5META_SCANNER_A) {
|
|
|
|
if (contentIndex == CONTENT.length || charsetIndex == CHARSET.length) {
|
|
|
|
addToBuffer(c);
|
|
|
|
} else if (httpEquivIndex == HTTP_EQUIV.length) {
|
|
|
|
if (contentTypeIndex < CONTENT_TYPE.length && toAsciiLowerCase(c) == CONTENT_TYPE[contentTypeIndex]) {
|
|
|
|
++contentTypeIndex;
|
|
|
|
} else {
|
|
|
|
contentTypeIndex = PR_INT32_MAX;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-28 15:44:22 -07:00
|
|
|
void
|
|
|
|
nsHtml5MetaScanner::addToBuffer(PRInt32 c)
|
|
|
|
{
|
|
|
|
if (strBufLen == strBuf.length) {
|
2010-09-28 00:32:31 -07:00
|
|
|
jArray<PRUnichar,PRInt32> newBuf = jArray<PRUnichar,PRInt32>::newJArray(strBuf.length + (strBuf.length << 1));
|
2009-06-28 15:44:22 -07:00
|
|
|
nsHtml5ArrayCopy::arraycopy(strBuf, newBuf, strBuf.length);
|
|
|
|
strBuf = newBuf;
|
|
|
|
}
|
|
|
|
strBuf[strBufLen++] = (PRUnichar) c;
|
|
|
|
}
|
|
|
|
|
2010-12-08 04:37:19 -08:00
|
|
|
void
|
|
|
|
nsHtml5MetaScanner::handleAttributeValue()
|
2009-06-28 15:44:22 -07:00
|
|
|
{
|
2010-12-08 04:37:19 -08:00
|
|
|
if (metaState != NS_HTML5META_SCANNER_A) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (contentIndex == CONTENT.length && !content) {
|
|
|
|
content = nsHtml5Portability::newStringFromBuffer(strBuf, 0, strBufLen);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (charsetIndex == CHARSET.length && !charset) {
|
|
|
|
charset = nsHtml5Portability::newStringFromBuffer(strBuf, 0, strBufLen);
|
|
|
|
return;
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
2010-12-08 04:37:19 -08:00
|
|
|
if (httpEquivIndex == HTTP_EQUIV.length && httpEquivState == NS_HTML5META_SCANNER_HTTP_EQUIV_NOT_SEEN) {
|
|
|
|
httpEquivState = (contentTypeIndex == CONTENT_TYPE.length) ? NS_HTML5META_SCANNER_HTTP_EQUIV_CONTENT_TYPE : NS_HTML5META_SCANNER_HTTP_EQUIV_OTHER;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PRBool
|
|
|
|
nsHtml5MetaScanner::handleTag()
|
|
|
|
{
|
|
|
|
PRBool stop = handleTagInner();
|
|
|
|
nsHtml5Portability::releaseString(content);
|
|
|
|
content = nsnull;
|
|
|
|
nsHtml5Portability::releaseString(charset);
|
|
|
|
charset = nsnull;
|
|
|
|
httpEquivState = NS_HTML5META_SCANNER_HTTP_EQUIV_NOT_SEEN;
|
|
|
|
return stop;
|
|
|
|
}
|
|
|
|
|
|
|
|
PRBool
|
|
|
|
nsHtml5MetaScanner::handleTagInner()
|
|
|
|
{
|
|
|
|
if (!!charset && tryCharset(charset)) {
|
|
|
|
return PR_TRUE;
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
2010-12-08 04:37:19 -08:00
|
|
|
if (!!content && httpEquivState == NS_HTML5META_SCANNER_HTTP_EQUIV_CONTENT_TYPE) {
|
|
|
|
nsString* extract = nsHtml5TreeBuilder::extractCharsetFromContent(content);
|
|
|
|
if (!extract) {
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
PRBool success = tryCharset(extract);
|
|
|
|
nsHtml5Portability::releaseString(extract);
|
|
|
|
return success;
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
2010-12-08 04:37:19 -08:00
|
|
|
return PR_FALSE;
|
2009-06-28 15:44:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5MetaScanner::initializeStatics()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5MetaScanner::releaseStatics()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#include "nsHtml5MetaScannerCppSupplement.h"
|
|
|
|
|