2003-04-09 01:23:34 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2001-09-26 04:40:45 +04:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
2001-09-26 04:40:45 +04:00
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.1 (the "License"); you may not use this file except in
|
|
|
|
* compliance with the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-26 04:40:45 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
1999-11-06 06:43:54 +03:00
|
|
|
*
|
2001-09-26 04:40:45 +04:00
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef NS_IPARSER___
|
|
|
|
#define NS_IPARSER___
|
|
|
|
|
|
|
|
|
1998-07-23 12:21:02 +04:00
|
|
|
/**
|
|
|
|
* MODULE NOTES:
|
|
|
|
* @update gess 4/1/98
|
|
|
|
*
|
|
|
|
* This class defines the iparser interface. This XPCOM
|
|
|
|
* inteface is all that parser clients ever need to see.
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#include "nsISupports.h"
|
1998-07-02 12:14:22 +04:00
|
|
|
#include "nsIStreamListener.h"
|
|
|
|
#include "nsIDTD.h"
|
1998-07-14 01:13:09 +04:00
|
|
|
#include "nsIInputStream.h"
|
2000-05-14 23:24:59 +04:00
|
|
|
#include "nsHashtable.h"
|
2001-10-20 00:48:18 +04:00
|
|
|
#include "nsVoidArray.h"
|
1999-01-09 04:09:02 +03:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#define NS_IPARSER_IID \
|
|
|
|
{0x355cbba0, 0xbf7d, 0x11d1, \
|
|
|
|
{0xaa, 0xd9, 0x00, 0x80, 0x5f, 0x8a, 0x3e, 0x14}}
|
|
|
|
|
2000-05-26 23:45:26 +04:00
|
|
|
// {41421C60-310A-11d4-816F-000064657374}
|
|
|
|
#define NS_IDEBUG_DUMP_CONTENT_IID \
|
|
|
|
{ 0x41421c60, 0x310a, 0x11d4, { 0x81, 0x6f, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } };
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
class nsIContentSink;
|
2001-04-10 10:01:08 +04:00
|
|
|
class nsIRequestObserver;
|
1999-06-16 03:29:54 +04:00
|
|
|
class nsIParserFilter;
|
1998-05-15 02:19:08 +04:00
|
|
|
class nsString;
|
1999-06-23 07:29:44 +04:00
|
|
|
class nsIURI;
|
2001-08-22 04:38:46 +04:00
|
|
|
class nsIChannel;
|
1998-08-12 12:53:55 +04:00
|
|
|
|
2000-03-25 06:35:50 +03:00
|
|
|
enum eParserCommands {
|
|
|
|
eViewNormal,
|
|
|
|
eViewSource,
|
2002-08-29 12:17:41 +04:00
|
|
|
eViewFragment,
|
2000-03-25 08:38:11 +03:00
|
|
|
eViewErrors
|
2000-03-25 06:35:50 +03:00
|
|
|
};
|
|
|
|
|
1999-02-16 10:38:27 +03:00
|
|
|
enum eCRCQuality {
|
|
|
|
eCRCGood = 0,
|
|
|
|
eCRCFair,
|
|
|
|
eCRCPoor
|
|
|
|
};
|
|
|
|
|
1999-02-19 02:45:44 +03:00
|
|
|
|
2000-03-25 06:35:50 +03:00
|
|
|
enum eParserDocType {
|
|
|
|
ePlainText = 0,
|
2001-09-08 22:37:19 +04:00
|
|
|
eXML,
|
|
|
|
eHTML_Quirks,
|
|
|
|
eHTML3_Quirks, // separate, for editor output, since HTML pre-4.0 lacks tbody
|
|
|
|
eHTML_Strict
|
2000-03-25 06:35:50 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-12-26 06:17:59 +03:00
|
|
|
// define Charset source constants
|
|
|
|
// note: the value order define the priority
|
|
|
|
#define kCharsetUninitialized 0
|
|
|
|
#define kCharsetFromWeakDocTypeDefault 1
|
|
|
|
#define kCharsetFromUserDefault 2
|
|
|
|
#define kCharsetFromDocTypeDefault 3
|
|
|
|
#define kCharsetFromCache 4
|
|
|
|
#define kCharsetFromParentFrame 5
|
|
|
|
#define kCharsetFromBookmarks 6
|
|
|
|
#define kCharsetFromAutoDetection 7
|
2002-08-27 00:13:31 +04:00
|
|
|
#define kCharsetFromHintPrevDoc 8
|
|
|
|
#define kCharsetFromMetaTag 9
|
|
|
|
#define kCharsetFromByteOrderMark 10
|
|
|
|
#define kCharsetFromChannel 11
|
|
|
|
#define kCharsetFromParentForced 12
|
|
|
|
#define kCharsetFromUserForced 13
|
|
|
|
#define kCharsetFromOtherComponent 14
|
|
|
|
#define kCharsetFromPreviousLoading 15
|
1999-04-26 21:49:45 +04:00
|
|
|
|
1999-01-12 03:19:17 +03:00
|
|
|
enum eStreamState {eNone,eOnStart,eOnDataAvail,eOnStop};
|
|
|
|
|
2001-06-21 06:06:23 +04:00
|
|
|
/**
|
2000-05-26 23:45:26 +04:00
|
|
|
* FOR DEBUG PURPOSE ONLY
|
|
|
|
*
|
|
|
|
* Use this interface to query objects that contain content information.
|
|
|
|
* Ex. Parser can trigger dump content by querying the sink that has
|
|
|
|
* access to the content.
|
|
|
|
*
|
|
|
|
* @update harishd 05/25/00
|
|
|
|
*/
|
|
|
|
class nsIDebugDumpContent : public nsISupports {
|
|
|
|
public:
|
2002-06-26 07:38:55 +04:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDEBUG_DUMP_CONTENT_IID)
|
2000-05-26 23:45:26 +04:00
|
|
|
NS_IMETHOD DumpContentModel()=0;
|
|
|
|
};
|
1999-05-05 03:20:28 +04:00
|
|
|
|
1998-05-01 00:23:07 +04:00
|
|
|
/**
|
1998-04-15 21:27:56 +04:00
|
|
|
* This class defines the iparser interface. This XPCOM
|
|
|
|
* inteface is all that parser clients ever need to see.
|
|
|
|
*
|
|
|
|
* @update gess 3/25/98
|
1998-05-01 00:23:07 +04:00
|
|
|
*/
|
1999-10-01 02:01:48 +04:00
|
|
|
class nsIParser : public nsISupports {
|
1998-04-25 23:45:14 +04:00
|
|
|
public:
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2002-06-26 07:38:55 +04:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPARSER_IID)
|
1999-06-30 23:12:21 +04:00
|
|
|
|
1998-07-23 12:21:02 +04:00
|
|
|
/**
|
|
|
|
* Call this method if you have a DTD that you want to share with the parser.
|
|
|
|
* Registered DTD's get remembered until the system shuts down.
|
|
|
|
*
|
|
|
|
* @update gess 3/25/98
|
|
|
|
* @param aDTD -- ptr DTD that you're publishing the services of
|
|
|
|
*/
|
2002-12-06 04:54:39 +03:00
|
|
|
NS_IMETHOD RegisterDTD(nsIDTD* aDTD)=0;
|
1998-05-15 02:19:08 +04:00
|
|
|
|
1998-11-26 05:55:59 +03:00
|
|
|
|
1998-07-23 12:21:02 +04:00
|
|
|
/**
|
1998-11-26 05:55:59 +03:00
|
|
|
* Select given content sink into parser for parser output
|
|
|
|
* @update gess5/11/98
|
|
|
|
* @param aSink is the new sink to be used by parser
|
2003-04-09 01:23:34 +04:00
|
|
|
* @return
|
1998-11-26 05:55:59 +03:00
|
|
|
*/
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD_(void) SetContentSink(nsIContentSink* aSink)=0;
|
1998-11-26 05:55:59 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2003-04-09 01:23:34 +04:00
|
|
|
* retrieve the sink set into the parser
|
1998-11-26 05:55:59 +03:00
|
|
|
* @update gess5/11/98
|
2003-04-09 01:23:34 +04:00
|
|
|
* @return current sink
|
1998-07-23 12:21:02 +04:00
|
|
|
*/
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD_(nsIContentSink*) GetContentSink(void)=0;
|
1998-06-25 05:42:50 +04:00
|
|
|
|
1998-11-11 14:55:32 +03:00
|
|
|
/**
|
|
|
|
* Call this method once you've created a parser, and want to instruct it
|
|
|
|
* about the command which caused the parser to be constructed. For example,
|
|
|
|
* this allows us to select a DTD which can do, say, view-source.
|
|
|
|
*
|
|
|
|
* @update gess 3/25/98
|
1998-11-13 07:36:46 +03:00
|
|
|
* @param aCommand -- ptrs to string that contains command
|
|
|
|
* @return nada
|
1998-11-11 14:55:32 +03:00
|
|
|
*/
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD_(void) GetCommand(nsString& aCommand)=0;
|
|
|
|
NS_IMETHOD_(void) SetCommand(const char* aCommand)=0;
|
|
|
|
NS_IMETHOD_(void) SetCommand(eParserCommands aParserCommand)=0;
|
1998-11-11 14:55:32 +03:00
|
|
|
|
1999-04-26 21:49:45 +04:00
|
|
|
/**
|
|
|
|
* Call this method once you've created a parser, and want to instruct it
|
|
|
|
* about what charset to load
|
|
|
|
*
|
|
|
|
* @update ftang 4/23/99
|
|
|
|
* @param aCharset- the charest of a document
|
|
|
|
* @param aCharsetSource- the soure of the chares
|
|
|
|
* @return nada
|
|
|
|
*/
|
2003-06-17 20:40:34 +04:00
|
|
|
NS_IMETHOD_(void) SetDocumentCharset(const nsACString& aCharset, PRInt32 aSource)=0;
|
|
|
|
NS_IMETHOD_(void) GetDocumentCharset(nsACString& oCharset, PRInt32& oSource)=0;
|
1999-04-26 21:49:45 +04:00
|
|
|
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD_(void) SetParserFilter(nsIParserFilter* aFilter) = 0;
|
1999-06-16 03:29:54 +04:00
|
|
|
|
2001-08-22 04:38:46 +04:00
|
|
|
/**
|
|
|
|
* Get the channel associated with this parser
|
|
|
|
* @update harishd,gagan 07/17/01
|
|
|
|
* @param aChannel out param that will contain the result
|
|
|
|
* @return NS_OK if successful
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetChannel(nsIChannel** aChannel) = 0;
|
1998-07-23 12:21:02 +04:00
|
|
|
|
1999-10-01 02:01:48 +04:00
|
|
|
/**
|
|
|
|
* Get the DTD associated with this parser
|
|
|
|
* @update vidur 9/29/99
|
|
|
|
* @param aDTD out param that will contain the result
|
|
|
|
* @return NS_OK if successful, NS_ERROR_FAILURE for runtime error
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetDTD(nsIDTD** aDTD) = 0;
|
|
|
|
|
1998-07-02 12:14:22 +04:00
|
|
|
/******************************************************************************************
|
|
|
|
* Parse methods always begin with an input source, and perform conversions
|
1998-07-23 12:21:02 +04:00
|
|
|
* until you wind up being emitted to the given contentsink (which may or may not
|
|
|
|
* be a proxy for the NGLayout content model).
|
1998-07-02 12:14:22 +04:00
|
|
|
******************************************************************************************/
|
2001-02-07 02:35:29 +03:00
|
|
|
|
2001-02-10 01:36:23 +03:00
|
|
|
// Call this method to resume the parser from the blocked state..
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD ContinueParsing() = 0;
|
2001-02-07 02:35:29 +03:00
|
|
|
|
|
|
|
// Stops parsing temporarily.
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD_(void) BlockParser() = 0;
|
2001-02-07 02:35:29 +03:00
|
|
|
|
|
|
|
// Open up the parser for tokenization, building up content
|
|
|
|
// model..etc. However, this method does not resume parsing
|
|
|
|
// automatically. It's the callers' responsibility to restart
|
|
|
|
// the parsing engine.
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD_(void) UnblockParser() = 0;
|
2001-02-07 02:35:29 +03:00
|
|
|
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD_(PRBool) IsParserEnabled() = 0;
|
|
|
|
NS_IMETHOD_(PRBool) IsComplete() = 0;
|
2000-03-25 06:35:50 +03:00
|
|
|
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD Parse(nsIURI* aURL,
|
|
|
|
nsIRequestObserver* aListener = nsnull,
|
|
|
|
PRBool aEnableVerify = PR_FALSE,
|
|
|
|
void* aKey = 0,
|
|
|
|
nsDTDMode aMode = eDTDMode_autodetect) = 0;
|
|
|
|
NS_IMETHOD Parse(nsIInputStream* aStream,
|
|
|
|
const nsACString& aMimeType,
|
|
|
|
PRBool aEnableVerify = PR_FALSE,
|
|
|
|
void* aKey = 0,
|
|
|
|
nsDTDMode aMode = eDTDMode_autodetect) = 0;
|
|
|
|
NS_IMETHOD Parse(const nsAString& aSourceBuffer,
|
|
|
|
void* aKey,
|
|
|
|
const nsACString& aMimeType,
|
|
|
|
PRBool aEnableVerify,
|
|
|
|
PRBool aLastCall,
|
|
|
|
nsDTDMode aMode = eDTDMode_autodetect) = 0;
|
2000-03-25 06:35:50 +03:00
|
|
|
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD Terminate(void) = 0;
|
1998-05-15 02:19:08 +04:00
|
|
|
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD ParseFragment(const nsAString& aSourceBuffer,
|
|
|
|
void* aKey,
|
|
|
|
nsVoidArray& aTagStack,
|
|
|
|
PRUint32 anInsertPos,
|
|
|
|
const nsACString& aContentType,
|
|
|
|
nsDTDMode aMode = eDTDMode_autodetect) = 0;
|
1999-04-05 10:55:49 +04:00
|
|
|
|
1998-06-18 03:13:28 +04:00
|
|
|
/**
|
|
|
|
* This method gets called when the tokens have been consumed, and it's time
|
|
|
|
* to build the model via the content sink.
|
|
|
|
* @update gess5/11/98
|
1998-07-23 12:21:02 +04:00
|
|
|
* @return error code -- 0 if model building went well .
|
1998-06-18 03:13:28 +04:00
|
|
|
*/
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD BuildModel(void) = 0;
|
1998-06-01 23:51:52 +04:00
|
|
|
|
1998-08-12 12:53:55 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve the parse mode from the parser...
|
|
|
|
*
|
|
|
|
* @update gess 6/9/98
|
|
|
|
* @return ptr to scanner
|
|
|
|
*/
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD_(nsDTDMode) GetParseMode(void) = 0;
|
1999-05-16 09:27:23 +04:00
|
|
|
|
2001-06-21 06:06:23 +04:00
|
|
|
/**
|
|
|
|
* Call this method to cancel any pending parsing events.
|
|
|
|
* Parsing events may be pending if all of the document's content
|
|
|
|
* has been passed to the parser but the parser has been interrupted
|
|
|
|
* because processing the tokens took too long.
|
|
|
|
*
|
|
|
|
* @update kmcclusk 05/18/01
|
|
|
|
* @return NS_OK if succeeded else ERROR.
|
|
|
|
*/
|
|
|
|
|
2003-04-09 01:23:34 +04:00
|
|
|
NS_IMETHOD CancelParsingEvents() = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
1999-01-09 04:09:02 +03:00
|
|
|
/* ===========================================================*
|
|
|
|
Some useful constants...
|
|
|
|
* ===========================================================*/
|
|
|
|
|
|
|
|
#include "prtypes.h"
|
|
|
|
#include "nsError.h"
|
|
|
|
|
Fix for
26583,2946, 22636 (partial),32782
33570,27136,24184,35125,
35806,36063,29456
r=rickg,waqar
34311 - Patch provided by Patrick ( Fix for MLK ).
r=me.
2000-04-22 01:22:03 +04:00
|
|
|
#define NS_ERROR_HTMLPARSER_EOF NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1000)
|
|
|
|
#define NS_ERROR_HTMLPARSER_UNKNOWN NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1001)
|
|
|
|
#define NS_ERROR_HTMLPARSER_CANTPROPAGATE NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1002)
|
|
|
|
#define NS_ERROR_HTMLPARSER_CONTEXTMISMATCH NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1003)
|
|
|
|
#define NS_ERROR_HTMLPARSER_BADFILENAME NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1004)
|
|
|
|
#define NS_ERROR_HTMLPARSER_BADURL NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1005)
|
|
|
|
#define NS_ERROR_HTMLPARSER_INVALIDPARSERCONTEXT NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1006)
|
|
|
|
#define NS_ERROR_HTMLPARSER_INTERRUPTED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1007)
|
|
|
|
#define NS_ERROR_HTMLPARSER_BLOCK NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1008)
|
|
|
|
#define NS_ERROR_HTMLPARSER_BADTOKENIZER NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1009)
|
|
|
|
#define NS_ERROR_HTMLPARSER_BADATTRIBUTE NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1010)
|
|
|
|
#define NS_ERROR_HTMLPARSER_UNRESOLVEDDTD NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1011)
|
2001-01-05 01:15:06 +03:00
|
|
|
#define NS_ERROR_HTMLPARSER_MISPLACEDTABLECONTENT NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1012)
|
Fix for
26583,2946, 22636 (partial),32782
33570,27136,24184,35125,
35806,36063,29456
r=rickg,waqar
34311 - Patch provided by Patrick ( Fix for MLK ).
r=me.
2000-04-22 01:22:03 +04:00
|
|
|
#define NS_ERROR_HTMLPARSER_BADDTD NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1013)
|
|
|
|
#define NS_ERROR_HTMLPARSER_BADCONTEXT NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1014)
|
|
|
|
#define NS_ERROR_HTMLPARSER_STOPPARSING NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1015)
|
|
|
|
#define NS_ERROR_HTMLPARSER_UNTERMINATEDSTRINGLITERAL NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1016)
|
2000-09-09 03:06:13 +04:00
|
|
|
#define NS_ERROR_HTMLPARSER_HIERARCHYTOODEEP NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_HTMLPARSER,1017)
|
|
|
|
|
2001-06-21 06:06:23 +04:00
|
|
|
|
1999-05-05 04:55:54 +04:00
|
|
|
#define NS_ERROR_HTMLPARSER_CONTINUE NS_OK
|
1999-01-09 04:09:02 +03:00
|
|
|
|
|
|
|
|
1999-07-16 21:31:38 +04:00
|
|
|
const PRUint32 kEOF = NS_ERROR_HTMLPARSER_EOF;
|
|
|
|
const PRUint32 kUnknownError = NS_ERROR_HTMLPARSER_UNKNOWN;
|
|
|
|
const PRUint32 kCantPropagate = NS_ERROR_HTMLPARSER_CANTPROPAGATE;
|
|
|
|
const PRUint32 kContextMismatch = NS_ERROR_HTMLPARSER_CONTEXTMISMATCH;
|
|
|
|
const PRUint32 kBadFilename = NS_ERROR_HTMLPARSER_BADFILENAME;
|
|
|
|
const PRUint32 kBadURL = NS_ERROR_HTMLPARSER_BADURL;
|
|
|
|
const PRUint32 kInvalidParserContext = NS_ERROR_HTMLPARSER_INVALIDPARSERCONTEXT;
|
|
|
|
const PRUint32 kBlocked = NS_ERROR_HTMLPARSER_BLOCK;
|
Fix for
26583,2946, 22636 (partial),32782
33570,27136,24184,35125,
35806,36063,29456
r=rickg,waqar
34311 - Patch provided by Patrick ( Fix for MLK ).
r=me.
2000-04-22 01:22:03 +04:00
|
|
|
const PRUint32 kBadStringLiteral = NS_ERROR_HTMLPARSER_UNTERMINATEDSTRINGLITERAL;
|
2000-09-09 03:06:13 +04:00
|
|
|
const PRUint32 kHierarchyTooDeep = NS_ERROR_HTMLPARSER_HIERARCHYTOODEEP;
|
1999-01-09 04:09:02 +03:00
|
|
|
|
1999-11-14 09:23:11 +03:00
|
|
|
const PRUnichar kNewLine = '\n';
|
|
|
|
const PRUnichar kCR = '\r';
|
|
|
|
const PRUnichar kLF = '\n';
|
|
|
|
const PRUnichar kTab = '\t';
|
|
|
|
const PRUnichar kSpace = ' ';
|
|
|
|
const PRUnichar kQuote = '"';
|
|
|
|
const PRUnichar kApostrophe = '\'';
|
|
|
|
const PRUnichar kLessThan = '<';
|
|
|
|
const PRUnichar kGreaterThan = '>';
|
|
|
|
const PRUnichar kAmpersand = '&';
|
|
|
|
const PRUnichar kForwardSlash = '/';
|
|
|
|
const PRUnichar kBackSlash = '\\';
|
|
|
|
const PRUnichar kEqual = '=';
|
|
|
|
const PRUnichar kMinus = '-';
|
|
|
|
const PRUnichar kPlus = '+';
|
|
|
|
const PRUnichar kExclamation = '!';
|
|
|
|
const PRUnichar kSemicolon = ';';
|
|
|
|
const PRUnichar kHashsign = '#';
|
|
|
|
const PRUnichar kAsterisk = '*';
|
|
|
|
const PRUnichar kUnderbar = '_';
|
|
|
|
const PRUnichar kComma = ',';
|
|
|
|
const PRUnichar kLeftParen = '(';
|
|
|
|
const PRUnichar kRightParen = ')';
|
|
|
|
const PRUnichar kLeftBrace = '{';
|
|
|
|
const PRUnichar kRightBrace = '}';
|
|
|
|
const PRUnichar kQuestionMark = '?';
|
|
|
|
const PRUnichar kLeftSquareBracket = '[';
|
|
|
|
const PRUnichar kRightSquareBracket = ']';
|
1999-01-09 04:09:02 +03:00
|
|
|
const PRUnichar kNullCh = '\0';
|
|
|
|
|
1999-02-16 10:38:27 +03:00
|
|
|
#define kHTMLTextContentType "text/html"
|
|
|
|
#define kXMLTextContentType "text/xml"
|
2001-04-27 00:46:17 +04:00
|
|
|
#define kXMLApplicationContentType "application/xml"
|
|
|
|
#define kXHTMLApplicationContentType "application/xhtml+xml"
|
2001-03-25 20:49:38 +04:00
|
|
|
#define kXULTextContentType "application/vnd.mozilla.xul+xml"
|
1999-02-16 10:38:27 +03:00
|
|
|
#define kRDFTextContentType "text/rdf"
|
|
|
|
#define kXIFTextContentType "text/xif"
|
|
|
|
#define kPlainTextContentType "text/plain"
|
1999-02-26 09:33:54 +03:00
|
|
|
#define kViewSourceCommand "view-source"
|
2002-08-29 12:17:41 +04:00
|
|
|
#define kViewFragmentCommand "view-fragment"
|
1999-09-16 00:29:54 +04:00
|
|
|
#define kTextCSSContentType "text/css"
|
2001-05-04 02:28:44 +04:00
|
|
|
#define kApplicationJSContentType "application/x-javascript"
|
|
|
|
#define kTextJSContentType "text/javascript"
|
2001-05-04 14:13:25 +04:00
|
|
|
#define kSGMLTextContentType "text/sgml"
|
2001-12-12 10:59:31 +03:00
|
|
|
#define kSVGTextContentType "image/svg+xml"
|
2000-03-25 06:35:50 +03:00
|
|
|
|
2001-05-16 02:32:26 +04:00
|
|
|
#define NS_IPARSER_FLAG_UNKNOWN_MODE 0x00000000
|
|
|
|
#define NS_IPARSER_FLAG_QUIRKS_MODE 0x00000002
|
|
|
|
#define NS_IPARSER_FLAG_STRICT_MODE 0x00000004
|
|
|
|
#define NS_IPARSER_FLAG_AUTO_DETECT_MODE 0x00000010
|
|
|
|
#define NS_IPARSER_FLAG_VIEW_NORMAL 0x00000020
|
|
|
|
#define NS_IPARSER_FLAG_VIEW_SOURCE 0x00000040
|
|
|
|
#define NS_IPARSER_FLAG_VIEW_ERRORS 0x00000080
|
2004-01-27 07:50:56 +03:00
|
|
|
#define NS_IPARSER_FLAG_PRESERVE_CONTENT 0x00000100
|
|
|
|
#define NS_IPARSER_FLAG_PLAIN_TEXT 0x00000200
|
|
|
|
#define NS_IPARSER_FLAG_XML 0x00000400
|
|
|
|
#define NS_IPARSER_FLAG_HTML 0x00000800
|
2001-05-16 02:32:26 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#endif
|