49
|
1 |
/*
|
|
2 |
* Copyright (c) 2000 - 2004 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
/** ----------------------------------------------------------------------- **
|
|
19 |
@package: NW_HTMLP
|
|
20 |
|
|
21 |
@synopsis: default
|
|
22 |
|
|
23 |
@description: HTML Parser
|
|
24 |
|
|
25 |
** ----------------------------------------------------------------------- **/
|
|
26 |
#ifndef CHTMLP_PARSER_H
|
|
27 |
#define CHTMLP_PARSER_H
|
|
28 |
|
|
29 |
#include <e32base.h>
|
|
30 |
#include "nw_htmlp_lexer.h"
|
|
31 |
#include "BrsrStatusCodes.h"
|
|
32 |
#include "nwx_buffer.h"
|
|
33 |
#include <nw_encoder_wbxmlwriter.h>
|
|
34 |
|
|
35 |
#ifdef __cplusplus
|
|
36 |
extern "C" {
|
|
37 |
#endif /* __cplusplus */
|
|
38 |
|
|
39 |
/* Next two govern allocation/reallocation of the open element stack. */
|
|
40 |
#ifndef NW_HTMLP_OPEN_ELEMENT_INITIAL_STACK_CAPACITY
|
|
41 |
#define NW_HTMLP_OPEN_ELEMENT_INITIAL_STACK_CAPACITY 16
|
|
42 |
#endif
|
|
43 |
#ifndef NW_HTMLP_OPEN_ELEMENT_STACK_GROW_BY
|
|
44 |
#define NW_HTMLP_OPEN_ELEMENT_STACK_GROW_BY 8
|
|
45 |
#endif
|
|
46 |
|
|
47 |
//Non DTD elements are not found in the HTMLP dictionary and index is stored in
|
|
48 |
//the upper 16 bits.
|
|
49 |
|
|
50 |
#ifndef NW_HTMLP_DTD_ElementTableMask
|
|
51 |
#define NW_HTMLP_DTD_ElementTableMask 0xffff0000
|
|
52 |
#endif
|
|
53 |
|
|
54 |
//Initialize the Non DTD value as actual index will always be greated than this.
|
|
55 |
|
|
56 |
#ifndef NW_HTMLP_DTD_ElementTableInit
|
|
57 |
#define NW_HTMLP_DTD_ElementTableInit 0x00009999
|
|
58 |
#endif
|
|
59 |
|
|
60 |
typedef struct {
|
|
61 |
void* contentHandler;
|
|
62 |
void* response;
|
|
63 |
} NW_Htmlp_CharsetConvContext;
|
|
64 |
|
|
65 |
|
|
66 |
/* RME Documentation tools do not support callback syntax. */
|
|
67 |
/* * ----------------------------------------------------------------------- **
|
|
68 |
@struct: NW_HTMLP_EventCallbacks
|
|
69 |
|
|
70 |
@synopsis: default
|
|
71 |
|
|
72 |
@scope: public
|
|
73 |
@variables:
|
|
74 |
TBrowserStatusCode (*beginDocumentCB) (NW_HTMLP_Lexer_t*, void*)
|
|
75 |
default
|
|
76 |
|
|
77 |
TBrowserStatusCode (*endDocumentCB) (NW_HTMLP_Lexer_t*, NW_Bool failed, void*)
|
|
78 |
default
|
|
79 |
|
|
80 |
TBrowserStatusCode (*startTagCB) (NW_Uint8 asciiCharCount, const NW_Uint8* pBuf,
|
|
81 |
void*)
|
|
82 |
default
|
|
83 |
|
|
84 |
TBrowserStatusCode (*endTagCB) (NW_Uint8 asciiCharCount, const NW_Uint8* pBuf,
|
|
85 |
NW_Bool emptyTag, void*)
|
|
86 |
default
|
|
87 |
|
|
88 |
TBrowserStatusCode (*contentCB) (NW_HTMLP_Lexer_t*, const NW_HTMLP_Interval_t*,
|
|
89 |
void*)
|
|
90 |
default
|
|
91 |
|
|
92 |
TBrowserStatusCode (*cdataCB) (NW_HTMLP_Lexer_t*, const NW_HTMLP_Interval_t*,
|
|
93 |
void*)
|
|
94 |
default
|
|
95 |
|
|
96 |
TBrowserStatusCode (*attributeStartCB) (void*)
|
|
97 |
default
|
|
98 |
|
|
99 |
TBrowserStatusCode (*attributeNameAndValueCB) (NW_HTMLP_Lexer_t*,
|
|
100 |
const NW_HTMLP_Interval_t* pName,
|
|
101 |
NW_Bool missingValue,
|
|
102 |
const NW_HTMLP_Interval_t* pValue,
|
|
103 |
void*)
|
|
104 |
default
|
|
105 |
|
|
106 |
TBrowserStatusCode (*attributesEndCB) (NW_Uint32 attributeCount, void*)
|
|
107 |
default
|
|
108 |
|
|
109 |
void* pClientPointer
|
|
110 |
Passed back in each callback.
|
|
111 |
|
|
112 |
@description: default
|
|
113 |
** ----------------------------------------------------------------------- **/
|
|
114 |
typedef struct NW_HTMLP_EventCallbacks_s {
|
|
115 |
TBrowserStatusCode (*beginDocumentCB) (NW_HTMLP_Lexer_t*, void*);
|
|
116 |
|
|
117 |
TBrowserStatusCode (*endDocumentCB) (NW_HTMLP_Lexer_t*, TBrowserStatusCode e, void*);
|
|
118 |
TBrowserStatusCode (*startTagCB) (NW_Uint8 byteCount, const NW_Uint8* pBuf,
|
|
119 |
void*, NW_Bool isLiteral);
|
|
120 |
TBrowserStatusCode (*endTagCB) (NW_Uint8 asciiCharCount, const NW_Uint8* pBuf,
|
|
121 |
NW_Bool emptyTag, void*);
|
|
122 |
TBrowserStatusCode (*contentCB) (NW_HTMLP_Lexer_t*, const NW_HTMLP_Interval_t*,
|
|
123 |
void*);
|
|
124 |
TBrowserStatusCode (*cdataCB) (NW_HTMLP_Lexer_t*, const NW_HTMLP_Interval_t*,
|
|
125 |
void*);
|
|
126 |
TBrowserStatusCode (*attributeStartCB) (void*);
|
|
127 |
// cp_count to track the attribute code page switch count.
|
|
128 |
TBrowserStatusCode (*attributeNameAndValueCB) (NW_HTMLP_Lexer_t*,
|
|
129 |
const NW_HTMLP_Interval_t* pName,
|
|
130 |
NW_Bool missingValue,
|
|
131 |
const NW_HTMLP_Interval_t* pValue,
|
|
132 |
void*,
|
|
133 |
NW_Uint32* cp_count);
|
|
134 |
TBrowserStatusCode (*attributesEndCB) (NW_Uint32 attributeCount, void*);
|
|
135 |
// cp_count to track the attribute code page switch count.
|
|
136 |
TBrowserStatusCode (*piFormCB) (NW_HTMLP_Lexer_t*,
|
|
137 |
const NW_HTMLP_Interval_t* pPITarget,
|
|
138 |
const NW_HTMLP_Interval_t* pArguments,
|
|
139 |
void*,
|
|
140 |
NW_Uint32* cp_count);
|
|
141 |
void* pClientPointer; /* passed back in each callback */
|
|
142 |
|
|
143 |
|
|
144 |
TBrowserStatusCode (*charsetConvertCallback) (void* context,
|
|
145 |
NW_Uint32 charsetLength,
|
|
146 |
NW_Uint32 charsetOffset,
|
|
147 |
NW_Buffer_t* body,
|
|
148 |
NW_Int32* numUnconvertible,
|
|
149 |
NW_Int32* indexFirstUnconvertible,
|
|
150 |
NW_Buffer_t** outBuf,
|
|
151 |
NW_Uint32 *selectedCharset);
|
|
152 |
void* charsetContext;
|
|
153 |
|
|
154 |
} NW_HTMLP_EventCallbacks_t;
|
|
155 |
|
|
156 |
/* Added for handling special cases for elements. It is good idea to document
|
|
157 |
* each special case here. In other words, this is small state machine to handle
|
|
158 |
* all such cases.
|
|
159 |
*
|
|
160 |
|
|
161 |
*
|
|
162 |
* 1) <script> : Consume all the contents inside the <script> element as it is.
|
|
163 |
*
|
|
164 |
*
|
|
165 |
* 2) <a> : The <a> can have "href" and other attributes. If "href" attribute is
|
|
166 |
* present then allow different formats of attributes
|
|
167 |
* e.g. href="www.nokia.com/" or 'www.nokia.com/' or www.nokia.com/ as
|
|
168 |
* part of the attribute value. Note, when no quotes are there then also
|
|
169 |
* '/' is part of the attribute value.
|
|
170 |
* 3) <title> : If <title> is closed by the mis-spelled end tag. The syntax of the
|
|
171 |
* <title> tag is "<title> contents </title>". If there is start tag
|
|
172 |
* <title> is found then any closing tag after this can be assumed as
|
|
173 |
* end </title> tag.
|
|
174 |
*
|
|
175 |
* 4) <base> : The <base> tag has the "href" attribute only. If the value of the
|
|
176 |
* "href" attribute is not enclosed in the quotes then in case of
|
|
177 |
* realtive URLs
|
|
178 |
* (e.g. <base href=http://uk.dir.yahoo.com/Product_Information_and_Reviews/>
|
|
179 |
* The last "/" forword slash is treated as EMPTY end tag but this is not
|
|
180 |
* true. If "/" is dropped then relative URLs are not formed correctly
|
|
181 |
* and page displaying error is obtained. For this case look for ">"
|
|
182 |
* only for end of tag.
|
|
183 |
*
|
|
184 |
*
|
|
185 |
*/
|
|
186 |
|
|
187 |
/** ----------------------------------------------------------------------- **
|
|
188 |
@enum: NW_HTMLP_ElementContentType
|
|
189 |
|
|
190 |
@synopsis: Special case handling cases
|
|
191 |
|
|
192 |
@scope: public
|
|
193 |
|
|
194 |
** ----------------------------------------------------------------------- **/
|
|
195 |
typedef enum NW_HTMLP_SPL_Elem_Type_e {
|
|
196 |
NW_HTMLP_SPL_NONE, //No special handling required
|
|
197 |
NW_HTMLP_SPL_SCRIPT, //To handle script
|
|
198 |
NW_HTMLP_SPL_NOSCRIPT, //To handle noscript
|
|
199 |
NW_HTMLP_SPL_ANCHOR_ATTR, //To handle attr val inside <a>
|
|
200 |
NW_HTMLP_SPL_META, //To handle meta element
|
|
201 |
NW_HTMLP_SPL_BODY, //To handle body start
|
|
202 |
NW_HTMLP_SPL_TITLE, //To handle mis-spelled </title>
|
|
203 |
NW_HTMLP_SPL_BASE_ATTR //To handle "href" attr val inside <base>
|
|
204 |
} NW_HTMLP_SPL_Elem_Type_t;
|
|
205 |
|
|
206 |
|
|
207 |
/** ----------------------------------------------------------------------- **
|
|
208 |
@struct: NW_HTMLP_SPL_Elem_Handling
|
|
209 |
|
|
210 |
@synopsis: Handles special cases for the element tags
|
|
211 |
|
|
212 |
@scope: public
|
|
213 |
|
|
214 |
@description: Handles special cases for the element tags
|
|
215 |
** ----------------------------------------------------------------------- **/
|
|
216 |
|
|
217 |
typedef struct NW_HTMLP_SPL_Elem_Handling_s
|
|
218 |
{
|
|
219 |
NW_Bool splHandle;
|
|
220 |
NW_Ucs2 tagName[128];
|
|
221 |
NW_HTMLP_SPL_Elem_Type_t type;
|
|
222 |
}NW_HTMLP_SPL_Elem_Handling_t;
|
|
223 |
|
|
224 |
typedef struct NW_HTMLP_ElementParseState_s {
|
|
225 |
NW_HTMLP_ElementTableIndex_t* pOpenElementStack;
|
|
226 |
|
|
227 |
/* points to stack top, needs to be int so -1 indicates empty */
|
|
228 |
NW_Int32 openElementStackPointer;
|
|
229 |
|
|
230 |
/* size in entries when originally malloc'ed, int32 like SP */
|
|
231 |
NW_Int32 openElementStackCapacity;
|
|
232 |
|
|
233 |
/* true only when in open element with content type tag PCDATA */
|
|
234 |
NW_Bool inPCDATA;
|
|
235 |
|
|
236 |
/* read position at end of element start, used to skip over newlines
|
|
237 |
after element start */
|
|
238 |
NW_Uint32 readPosition;
|
|
239 |
|
|
240 |
} NW_HTMLP_ElementParseState_t;
|
|
241 |
|
|
242 |
|
|
243 |
/** ----------------------------------------------------------------------- **
|
|
244 |
@class: CHtmlpParser
|
|
245 |
|
|
246 |
@synopsis: parser of a document or segment of a document.
|
|
247 |
|
|
248 |
@description: parser of a document or segment of a document.
|
|
249 |
** ----------------------------------------------------------------------- **/
|
|
250 |
class CHtmlpParser : public CBase
|
|
251 |
{
|
|
252 |
public:
|
|
253 |
|
|
254 |
/** ----------------------------------------------------------------------- **
|
|
255 |
@function: NewL
|
|
256 |
@synopsis: public constructor to create a new CHtmlpParser object.
|
|
257 |
@description: public constructor to create a new CHtmlpParser object.
|
|
258 |
@returns: newly created CHtmlpParser object.
|
|
259 |
** ----------------------------------------------------------------------- **/
|
|
260 |
static CHtmlpParser* NewL(
|
|
261 |
NW_Uint32 inputByteCount,
|
|
262 |
NW_Uint8* pInputBuf,
|
|
263 |
NW_HTMLP_ElementTableIndex_t elementCount,
|
|
264 |
NW_HTMLP_ElementDescriptionConst_t* pElementDictionary,
|
|
265 |
NW_Uint32 encoding,
|
|
266 |
NW_Bool consumeSpaces,
|
|
267 |
void * parser,
|
|
268 |
NW_Bool isScript);
|
|
269 |
|
|
270 |
/** ----------------------------------------------------------------------- **
|
|
271 |
@function: ~CHtmlpParser
|
|
272 |
@synopsis: public destructor.
|
|
273 |
@description: public destructor.
|
|
274 |
** ----------------------------------------------------------------------- **/
|
|
275 |
~CHtmlpParser();
|
|
276 |
|
|
277 |
/** ----------------------------------------------------------------------- **
|
|
278 |
@function: NW_HTMLP_Parse
|
|
279 |
@synopsis: Initiates parse of document.
|
|
280 |
@description: Initiates parse of document.
|
|
281 |
@returns: TBrowserStatusCode
|
|
282 |
Status of operation.
|
|
283 |
[KBrsrSuccess] Buffer parsed.
|
|
284 |
[KBrsrFailure] Parse failed.
|
|
285 |
[KBrsrOutOfMemory] Ran out of memory parsing the document.
|
|
286 |
** ----------------------------------------------------------------------- **/
|
|
287 |
TBrowserStatusCode NW_HTMLP_Parse(NW_Bool isFirstSegment, NW_Bool docComplete, NW_Bool needCharsetDetect);
|
|
288 |
|
|
289 |
NW_Buffer_t* getLastTextBuf();
|
|
290 |
|
|
291 |
NW_Int32 getLastValid();
|
|
292 |
|
|
293 |
NW_Uint32 getCodePageSwitchCount();
|
|
294 |
|
|
295 |
NW_Uint32 getElementCount();
|
|
296 |
|
|
297 |
NW_Buffer_t* getPreviousValidOutput();
|
|
298 |
|
|
299 |
NW_HTMLP_EventCallbacks_t * getEventCallbacks();
|
|
300 |
|
|
301 |
NW_HTMLP_Lexer_t* getLexer();
|
|
302 |
|
|
303 |
TBrowserStatusCode appendVisitedHeadText(NW_Byte* new_data, NW_Uint32 new_len);
|
|
304 |
|
|
305 |
NW_Buffer_t* getVisitedHeadText();
|
|
306 |
|
|
307 |
// For WML purposes, return the status of checking the attribute or element name
|
|
308 |
// in the appropriate dictionary.
|
|
309 |
TBrowserStatusCode NW_HTMLP_ValidateWMLAttribute(NW_HTMLP_Lexer_t* pL,const NW_HTMLP_Interval_t* pI_name,void* pV);
|
|
310 |
|
|
311 |
NW_Bool iRestarted;
|
|
312 |
NW_Bool iIsHtml;
|
|
313 |
NW_WBXML_Writer_t * iWbxmlWriter;
|
|
314 |
NW_Int32 iOrigEncoding;
|
|
315 |
NW_Buffer_t* iLeftBytes; // single byte left from last chunk, for (multibyte encodings)
|
|
316 |
NW_Bool iIsScript;
|
|
317 |
|
|
318 |
NW_Bool iTrackingUnTerminatedComment;
|
|
319 |
|
|
320 |
private:
|
|
321 |
|
|
322 |
/* the lexer */
|
|
323 |
NW_HTMLP_Lexer_t* iLexer;
|
|
324 |
|
|
325 |
/* Callback structure and parser state.*/
|
|
326 |
NW_HTMLP_EventCallbacks_t* iCBs;
|
|
327 |
|
|
328 |
NW_HTMLP_SPL_Elem_Handling_t* iSPLElemHandling;
|
|
329 |
|
|
330 |
NW_HTMLP_ElementParseState_t* iElementParseState;
|
|
331 |
|
|
332 |
NW_HTMLP_ElementParseState_t* iLastValidStack;
|
|
333 |
|
|
334 |
/* last text content parsed by parser for previous segment */
|
|
335 |
NW_Buffer_t* iLastTextBuf;
|
|
336 |
|
|
337 |
/* point to right after the last trustable item in the generated output WBXML buffer */
|
|
338 |
NW_Int32 iLastValid;
|
|
339 |
|
|
340 |
/* previously processed segements */
|
|
341 |
/* NW_Uint8* iPreviousOutputBuffer;*/
|
|
342 |
|
|
343 |
NW_Buffer_t* iPreviousValidOutput;
|
|
344 |
|
|
345 |
NW_Bool iConsumeSpaces;
|
|
346 |
|
|
347 |
NW_Int32 iLastTextBegin; /* offset of '<' within consumeContent or begining of the last piece text if there is no '<' */
|
|
348 |
|
|
349 |
// members related to code page switches
|
|
350 |
// iCurrentXX records the current state that wbxml writer passed, incld those that may be discarded from wbxml buffer later
|
|
351 |
// iValidXX records the state that is valid, never includes those cp switches that may be discarded later
|
|
352 |
NW_Uint8 iCurrentTagCP;
|
|
353 |
NW_Uint8 iValidTagCP;
|
|
354 |
|
|
355 |
NW_Uint8 iCurrentAttrCP;
|
|
356 |
NW_Uint8 iValidAttrCP;
|
|
357 |
|
|
358 |
NW_Uint32 iValidCPCount;
|
|
359 |
NW_Uint32 iCurrentCPCount;
|
|
360 |
// end of code page switch members
|
|
361 |
|
|
362 |
NW_Buffer_t* iVisitedHeadText;
|
|
363 |
|
|
364 |
NW_Int32 iLastScriptStart;
|
|
365 |
|
|
366 |
NW_Bool iNeedCharsetDetect;
|
|
367 |
|
|
368 |
NW_Bool iHasForm;
|
|
369 |
NW_Bool iWithinNoscript;
|
|
370 |
|
|
371 |
NW_Bool firstSegment;
|
|
372 |
NW_Bool htmlTagFound;
|
|
373 |
NW_Bool iDocComplete;
|
|
374 |
|
|
375 |
/* private constructor, called from NewL*/
|
|
376 |
CHtmlpParser( NW_Bool consumeSpaces);
|
|
377 |
void ConstructL(NW_Uint32 inputByteCount,
|
|
378 |
NW_Uint8* pInputBuf,
|
|
379 |
NW_HTMLP_ElementTableIndex_t elementCount,
|
|
380 |
NW_HTMLP_ElementDescriptionConst_t* pElementDictionary,
|
|
381 |
NW_Uint32 encoding,
|
|
382 |
NW_Bool isScript);
|
|
383 |
|
|
384 |
TBrowserStatusCode NW_HTMLP_IfExistsConsumeKeywordCase(
|
|
385 |
NW_HTMLP_Interval_t* pI,
|
|
386 |
NW_Uint32 asciiCharCount,
|
|
387 |
const NW_Uint8* pKeyword,
|
|
388 |
NW_Bool CaseSensitive,
|
|
389 |
NW_Bool* pMatch);
|
|
390 |
|
|
391 |
TBrowserStatusCode NW_HTMLP_IfExistsConsumeKeyword(
|
|
392 |
NW_HTMLP_Interval_t* pI,
|
|
393 |
NW_Uint32 asciiCharCount,
|
|
394 |
const NW_Uint8* pKeyword,
|
|
395 |
NW_Bool* pMatch);
|
|
396 |
|
|
397 |
TBrowserStatusCode NW_HTMLP_SkipSpace();
|
|
398 |
|
|
399 |
TBrowserStatusCode NW_HTMLP_SkipJunk();
|
|
400 |
|
|
401 |
TBrowserStatusCode NW_HTMLP_SkipCRLF();
|
|
402 |
|
|
403 |
TBrowserStatusCode NW_HTMLP_ParseName(NW_Bool* pMatch, NW_HTMLP_Interval_t* pI);
|
|
404 |
|
|
405 |
TBrowserStatusCode NW_HTMLP_FinishComment(NW_Bool* pMatch, NW_Bool imodeComment,
|
|
406 |
NW_Bool looseComment);
|
|
407 |
|
|
408 |
TBrowserStatusCode NW_HTMLP_FinishCdata(NW_HTMLP_Interval_t* pInterval, NW_Bool* pMatch);
|
|
409 |
|
|
410 |
TBrowserStatusCode NW_HTMLP_FinishDoctype(NW_Bool* pMatch, NW_HTMLP_Interval_t* doctypeInterval);
|
|
411 |
|
|
412 |
TBrowserStatusCode NW_HTMLP_IfLegalConsumeComment(NW_Bool* pMatch);
|
|
413 |
|
|
414 |
TBrowserStatusCode NW_HTMLP_IfLegalConsumePi(NW_Bool* pMatch);
|
|
415 |
|
|
416 |
TBrowserStatusCode NW_HTMLP_IfLegalConsumeCdata(NW_Bool* pMatch);
|
|
417 |
|
|
418 |
TBrowserStatusCode NW_HTMLP_HandleSpecialCases(NW_Bool* pMatch);
|
|
419 |
|
|
420 |
TBrowserStatusCode NW_HTMLP_IfLegalConsumeDoctype(NW_Bool* pMatch);
|
|
421 |
|
|
422 |
TBrowserStatusCode NW_HTMLP_ConsumeContent(NW_Bool* pMatch);
|
|
423 |
|
|
424 |
|
|
425 |
/* handle attributes */
|
|
426 |
void NW_HTMLP_SPL_Elem_Handle_Attr(NW_HTMLP_Interval_t* pI_name, NW_Bool* splAttrFound);
|
|
427 |
|
|
428 |
TBrowserStatusCode NW_HTMLP_CheckTagEndOrSpace (NW_Bool* aMatch);
|
|
429 |
|
|
430 |
TBrowserStatusCode NW_HTMLP_CheckTagEnd (NW_Bool* aMatch);
|
|
431 |
|
|
432 |
TBrowserStatusCode NW_HTMLP_AttributeValueConsume(NW_Bool* pMissingValue,
|
|
433 |
NW_HTMLP_Interval_t* pI,
|
|
434 |
NW_Bool* pMatch,NW_Bool splAttrFound);
|
|
435 |
|
|
436 |
TBrowserStatusCode NW_HTMLP_AttributeNameAndValueConsume(NW_HTMLP_Interval_t* pI_name,
|
|
437 |
NW_Bool* pMissingValue,
|
|
438 |
NW_HTMLP_Interval_t* pI_attvalue,
|
|
439 |
NW_Bool* pMatch,
|
|
440 |
NW_HTMLP_SPL_Elem_Handling_t* splElem);
|
|
441 |
|
|
442 |
|
|
443 |
TBrowserStatusCode NW_HTMLP_IfExistsConsumeMinEmptyElementSyntax(NW_Bool* pMatch);
|
|
444 |
|
|
445 |
TBrowserStatusCode NW_HTMLP_IfLegalConsumeAttributes(
|
|
446 |
NW_Bool* pMatch,
|
|
447 |
NW_Bool* pIsEmptyTagEnd,
|
|
448 |
const struct NW_HTMLP_EventCallbacks_s* pCB,
|
|
449 |
NW_HTMLP_SPL_Elem_Handling_t* splElem);
|
|
450 |
|
|
451 |
NW_HTMLP_ElementDescriptionConst_t* NW_HTMLP_ElementFindTagFromDoc(
|
|
452 |
NW_HTMLP_Interval_t* pI,
|
|
453 |
NW_HTMLP_ElementTableIndex_t* pIndex);
|
|
454 |
|
|
455 |
TBrowserStatusCode NW_HTMLP_IfLegalConsumeElementEnd(NW_Bool* pMatch);
|
|
456 |
|
|
457 |
TBrowserStatusCode NW_HTMLP_IfLegalConsumeElementStart(NW_Bool* pMatch);
|
|
458 |
|
|
459 |
TBrowserStatusCode NW_HTMLP_ElementParseState_ExplicitClosing(
|
|
460 |
NW_HTMLP_ElementTableIndex_t index,
|
|
461 |
NW_HTMLP_ElementDescriptionConst_t* pElement);
|
|
462 |
|
|
463 |
TBrowserStatusCode NW_HTMLP_ElementParseState_ImpliedClosings(NW_HTMLP_ElementDescriptionConst_t* pElement);
|
|
464 |
|
|
465 |
TBrowserStatusCode NW_HTMLP_ElementParseState_CloseAll();
|
|
466 |
|
|
467 |
void NW_HTMLP_SPL_Elem_Initialize();
|
|
468 |
|
|
469 |
void NW_HTMLP_SPL_Elem_Setup(NW_HTMLP_ElementTableIndex_t elementIndex, NW_Bool findCharset);
|
|
470 |
/* element stack operations */
|
|
471 |
|
|
472 |
TBrowserStatusCode NW_HTMLP_ElementParseState_New();
|
|
473 |
|
|
474 |
TBrowserStatusCode NW_HTMLP_ElementParseState_Push(NW_HTMLP_ElementTableIndex_t index);
|
|
475 |
|
|
476 |
NW_HTMLP_ElementTableIndex_t NW_HTMLP_ElementParseState_Pop();
|
|
477 |
|
|
478 |
void NW_HTMLP_ElementParseState_Delete(NW_HTMLP_ElementParseState_t** ppS);
|
|
479 |
|
|
480 |
TBrowserStatusCode NW_HTMLP_BR_SPL_Handle();
|
|
481 |
|
|
482 |
TBrowserStatusCode NW_HTMLP_ElementParseState_Clone(NW_HTMLP_ElementParseState_t** ppS);
|
|
483 |
|
|
484 |
TBrowserStatusCode setValidMarks();
|
|
485 |
|
|
486 |
TBrowserStatusCode commitValidMarks();
|
|
487 |
|
|
488 |
TBrowserStatusCode NW_HTMLP_SPL_Elem_Handle_xml_charset();
|
|
489 |
|
|
490 |
TBrowserStatusCode NW_HTMLP_SPL_Elem_Handle_Meta(NW_HTMLP_Interval_t* pI_name,
|
|
491 |
NW_HTMLP_Interval_t* pI_attvalue,
|
|
492 |
NW_HTMLP_SPL_Elem_Handling_t* splElem);
|
|
493 |
|
|
494 |
TBrowserStatusCode NW_HTMLP_SPL_Elem_Handle_BodyStart(NW_HTMLP_ElementDescriptionConst_t* pElement);
|
|
495 |
|
|
496 |
TBrowserStatusCode NW_HTMLP_SPL_Elem_Before_HTML_tag(NW_HTMLP_Lexer_t* pL, const NW_HTMLP_Interval_t* pI_content,
|
|
497 |
NW_Bool* onlySplChar);
|
|
498 |
|
|
499 |
void updateCurrentCP();
|
|
500 |
void updateCurrentCP(NW_Uint32 switches);
|
|
501 |
};
|
|
502 |
|
|
503 |
|
|
504 |
#ifdef __cplusplus
|
|
505 |
} // extern "C" {
|
|
506 |
#endif /* __cplusplus */
|
|
507 |
|
|
508 |
/* CHTMLP_PARSER_H */
|
|
509 |
#endif
|