+
    |fi                    h   ^RI Ht ^RI Ht ^RI Ht ^RIHt ^RI Ht ^RIHtH	t	H
t
HtHtHtHtHtHtHtHtHtHtHtHt RWR ltRXR lt ! R	 R
4      t ! R R4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t  ! R R]4      t! ! R R]4      t" ! R R]4      t# ! R R]4      t$ ! R R ]4      t% ! R! R"]4      t& ! R# R$]4      t' ! R% R&]4      t( ! R' R(]4      t) ! R) R*]4      t* ! R+ R,]4      t+ ! R- R.]4      t, ! R/ R0]4      t- ! R1 R2]4      t. ! R3 R4]4      t/ ! R5 R6]4      t0 ! R7 R8]4      t1 ! R9 R:]4      t2/ R;]bR<]bR=]bR>]bR?] bR@]!bRA]"bRB]#bRC]$bRD]%bRE]&bRF]'bRG](bRH])bRI]*bRJ]+bRK],bRL]-RM].RN]/RO]0RP]1RQ]2/Ct3RR t4RYRT lt5 ! RU RV]64      t7RS# )Z   )_inputstream)
_tokenizer)treebuilders)Marker)_utils)spaceCharactersasciiUpper2LowerspecialElementsheadingElementscdataElementsrcdataElements
tokenTypes
namespaceshtmlIntegrationPointElements"mathmlTextIntegrationPointElementsadjustForeignAttributesadjustMathMLAttributesadjustSVGAttributesE_ReparseExceptionc                l    \         P                  ! V4      p\        WBR7      pVP                  ! V 3/ VB # )a  Parse an HTML document as a string or file-like object into a tree

:arg doc: the document to parse as a string or file-like object

:arg treebuilder: the treebuilder to use when parsing

:arg namespaceHTMLElements: whether or not to namespace HTML elements

:returns: parsed tree

Example:

>>> from html5lib.html5parser import parse
>>> parse('<html><body><p>This is a doc</p></body></html>')
<Element u'{http://www.w3.org/1999/xhtml}html' at 0x7feac4909db0>

namespaceHTMLElements)r   getTreeBuilder
HTMLParserparse)doctreebuilderr   kwargstbps   &&&,  6/usr/lib/python3/dist-packages/html5lib/html5parser.pyr   r      s2    $ 
	$	$[	1B2CA773!&!!    c                p    \         P                  ! V4      p\        WSR7      pVP                  ! V 3RV/VB # )a  Parse an HTML fragment as a string or file-like object into a tree

:arg doc: the fragment to parse as a string or file-like object

:arg container: the container context to parse the fragment in

:arg treebuilder: the treebuilder to use when parsing

:arg namespaceHTMLElements: whether or not to namespace HTML elements

:returns: parsed tree

Example:

>>> from html5lib.html5libparser import parseFragment
>>> parseFragment('<b>this is a fragment</b>')
<Element u'DOCUMENT_FRAGMENT' at 0x7feac484b090>

r   	container)r   r   r   parseFragment)r   r%   r   r   r   r    r!   s   &&&&,  r"   r&   r&   ,   s7    ( 
	$	$[	1B2CA??3>)>v>>r#   c                      a  ] tR t^Et o RtRR ltRR ltR t]R 4       t	R t
R tR	 tR
 tR tRR ltR tR tR tR tR tR tRtV tR# )r   zUHTML parser

Generates a tree structure from a stream of (possibly malformed) HTML.

Nc           	     Z   W n         W@n        Vf   \        P                  ! R4      pM,\	        V\
        4      '       d   \        P                  ! V4      pV! V4      V n        . V n        \        P                  4        UUu/ uF  w  rVWV! W P                  4      bK  	  uppV n
        R# u uppi )ay  
:arg tree: a treebuilder class controlling the type of tree that will be
    returned. Built in treebuilders can be accessed through
    html5lib.treebuilders.getTreeBuilder(treeType)

:arg strict: raise an exception when a parse error is encountered

:arg namespaceHTMLElements: whether or not to namespace HTML elements

:arg debug: whether or not to enable debug mode which logs things

Example:

>>> from html5lib.html5parser import HTMLParser
>>> parser = HTMLParser()                     # generates parser with etree builder
>>> parser = HTMLParser('lxml', strict=True)  # generates parser with lxml builder which is strict

Netree)strictdebugr   r   
isinstancestrtreeerrors_phasesitemsphases)selfr.   r*   r   r+   nameclss   &&&&&  r"   __init__HTMLParser.__init__L   s    * 
<..w7Dc""..t4D./	 }}(& 7@dtSyy11&( (s   ?B'c                   W n         W0n        W@n        \        P                  ! V3R V /VB V n        V P                  4         V P                  4        R#   \         d%    T P                  4        T P                  4         R# i ; i)parserN)	innerHTMLModer%   	scriptingr   HTMLTokenizer	tokenizerresetmainLoopr   )r3   stream	innerHTMLr%   r;   r   s   &&&&&,r"   _parseHTMLParser._parseo   sf    &""#11&PPP

	MMO  	JJLMMO	s   A +BBc                    V P                   P                  4        R V n        . V n        . V n        RV n        V P                  '       Ed   V P                  P                  4       V n	        V P                  \        9   d'   V P                  P                  V P                  n        MsV P                  \        9   d'   V P                  P                  V P                  n        M8V P                  R8X  d'   V P                  P                   V P                  n        M V P"                  R,          V n        V P$                  P'                  4        V P)                  4        MR V n	        V P"                  R,          V n        RV n        RV n        RV n        R# )Fz	no quirks	plaintext
beforeHtmlinitialNT)r.   r>   firstStartTagr/   log
compatModer:   r%   lowerrA   r   r=   rcdataStatestater   rawtextStateplaintextStater2   phaseinsertHtmlElementresetInsertionMode	lastPhasebeforeRCDataPhase
framesetOKr3   s   &r"   r>   HTMLParser.reset}   s   		"%!^^113DN~~.'+~~'A'A$>1'+~~'B'B$;.'+~~'D'D$ \2DJJJ((*##%"DNY/DJ!%r#   c                    \        V R4      '       g   R# V P                  P                  P                  ^ ,          P                  # )zwName of the character encoding that was used to decode the input stream, or
:obj:`None` if that is not determined yet

r=   N)hasattrr=   r@   charEncodingr4   rV   s   &r"   documentEncodingHTMLParser.documentEncoding   s5     t[))~~$$11!4999r#   c                   VP                   R 8X  d]   VP                  \        R,          8X  dA   RVP                  9   ;'       d*    VP                  R,          P	                  \
        4      R9   # VP                  VP                   3\        9   # )annotation-xmlmathmlencoding)z	text/htmlzapplication/xhtml+xml)r4   	namespacer   
attributes	translater	   r   r3   elements   &&r"   isHTMLIntegrationPoint!HTMLParser.isHTMLIntegrationPoint   s    LL,,!!Z%99'"4"44 ; ;&&z2<<(*:;<
 %%w||48TTTr#   c                @    VP                   VP                  3\        9   # N)ra   r4   r   rd   s   &&r"   isMathMLTextIntegrationPoint'HTMLParser.isMathMLTextIntegrationPoint   s    !!7<<04VVVr#   c           	     v   \         R ,          p\         R,          p\         R,          p\         R,          p\         R,          p\         R,          p\         R,          p\         P                  ! 4        UU	u/ uF  w  rWbK	  	  p
pp	V P                  pV P                   EF2  pRpTpVEe   TpV P                  P
                  '       d   V P                  P
                  R,          MRpV'       d   VP                  MRpV'       d   VP                  MRpVR,          pVV8X  d.   V P                  VR	,          VP                  R
/ 4      4       RpK  \        V P                  P
                  4      ^ 8X  g   VV P                  P                  8X  g   V P                  V4      '       d)   VV8X  d   VR,          \        RR.4      9  gW   VW39   gO   V\        R,          8X  d   VR8X  d   VV8X  d   VR,          R8X  g!   V P                  V4      '       d   VW1V39   d   V P                   pMV P"                  R,          pV'       d   RV
V,          /pVW439   d   VR,          VR&   V P$                  P'                  V P                  P(                  P*                  V P                   P,                  P*                  VP,                  P*                  RVR,          ,           V34       VV8X  d   VP/                  V4      pEKW  VV8X  d   VP1                  V4      pEKr  VV8X  d   VP3                  V4      pEK  VV8X  d   VP5                  V4      pEK  VV8X  d   VP7                  V4      pEK  VV8X  g   EK  VP9                  V4      pEK  XV8X  g   EK  VR,          '       g   EK  VR,          '       d   EK  V P                  RRVR,          /4       EK5  	  Rp. pV'       dU   VP'                  V P                   4       V P                   P;                  4       pV'       g   KG  V P                   V9  d   KZ  Q hR# u up	pi )
CharactersSpaceCharactersStartTagEndTagCommentDoctype
ParseErrorNtypedatadatavarsr4   mglyph
malignmarkr_   r^   svginForeignContentprocessselfClosingselfClosingAcknowledgedz&non-void-element-with-trailing-solidusT)r   r1   r+   r=   r.   openElementsra   r4   
parseErrorgetlendefaultNamespacerj   	frozensetr   rf   rP   r2   rI   appendrM   __name__	__class__processCharactersprocessSpaceCharactersprocessStartTagprocessEndTagprocessCommentprocessDoctype
processEOF)r3   CharactersTokenSpaceCharactersTokenStartTagTokenEndTagTokenCommentTokenDoctypeTokenParseErrorTokenkeyvalue
type_namesr+   token
prev_token	new_tokencurrentNodecurrentNodeNamespacecurrentNodeNamert   rP   info	reprocessr2   s   &                      r"   r?   HTMLParser.mainLoop   s}   $\2)*;<":. *!),!),$\23=3C3C3EF3EZSej3E
F

^^EJI'&
<@II<R<R<Rdii44R8X\@K{'<'<QU$6A+"2"2t (?*OOIf$5y}}ZQS7TU $IDII223q8,		0J0JJ::;GG=0 =	8\:R0SS?"II-H1EE(,<<.v%/44[AA-BV!WW $

 $,> ? &
4(89M#??+4V+<DL)=)=)F)F)-)=)=)F)F).)A)A)2T&\)A)-	)/ 0 .$)$;$;I$F	!55$)$@$@$K	.$)$9$9)$D	,$)$7$7	$B	-$)$8$8$C	-$)$8$8$C	%*]*C*C"#<== H!'F); <>s $z 	MM$**%

--/Iyzz///	 E Gs   4P5c                f    V P                   ! VRR.VO5/ VB  V P                  P                  4       # )a  Parse a HTML document into a well-formed tree

:arg stream: a file-like object or string containing the HTML to be parsed

    The optional encoding parameter must be a string that indicates
    the encoding.  If specified, that encoding will be used,
    regardless of any BOM or later declaration (such as in a meta
    element).

:arg scripting: treat noscript elements as if JavaScript was turned on

:returns: parsed tree

Example:

>>> from html5lib.html5parser import HTMLParser
>>> parser = HTMLParser()
>>> parser.parse('<html><body><p>This is a doc</p></body></html>')
<Element u'{http://www.w3.org/1999/xhtml}html' at 0x7feac4909db0>

FN)rB   r.   getDocumentr3   r@   argsr   s   &&*,r"   r   HTMLParser.parse  s1    , 	FE49$9&9yy$$&&r#   c                d    V P                   ! VR.VO5/ VB  V P                  P                  4       # )a  Parse a HTML fragment into a well-formed tree fragment

:arg container: name of the element we're setting the innerHTML
    property if set to None, default to 'div'

:arg stream: a file-like object or string containing the HTML to be parsed

    The optional encoding parameter must be a string that indicates
    the encoding.  If specified, that encoding will be used,
    regardless of any BOM or later declaration (such as in a meta
    element)

:arg scripting: treat noscript elements as if JavaScript was turned on

:returns: parsed tree

Example:

>>> from html5lib.html5libparser import HTMLParser
>>> parser = HTMLParser()
>>> parser.parseFragment('<b>this is a fragment</b>')
<Element u'DOCUMENT_FRAGMENT' at 0x7feac484b090>

T)rB   r.   getFragmentr   s   &&*,r"   r&   HTMLParser.parseFragment   s/    2 	FD24262yy$$&&r#   c                    Vf   / pV P                   P                  V P                  P                  P	                  4       W34       V P
                  '       d   \        \        V,          V,          4      hR # ri   )r/   r   r=   r@   positionr*   rs   r   )r3   	errorcoderv   s   &&&r"   r   HTMLParser.parseError<  sY    HDNN11::<iRS;;;Qy\H455 r#   c                &    \        V\        4       R # ri   )adjust_attributesr   r3   r   s   &&r"   r   !HTMLParser.adjustMathMLAttributesD  s    %!78r#   c                &    \        V\        4       R # ri   )r   r   r   s   &&r"   r   HTMLParser.adjustSVGAttributesG  s    %!45r#   c                &    \        V\        4       R # ri   )r   adjustForeignAttributesMapr   s   &&r"   r   "HTMLParser.adjustForeignAttributesJ  s    %!;<r#   c                :    V P                   P                  4        R # ri   )r9   rP   r   s   &&r"   reparseTokenNormalHTMLParser.reparseTokenNormalM  s    r#   c                T   R pRRRRRRRRRR	R
R	RR	RRRRRRRRRRRRRR/pV P                   P                  RRR1,           F  pVP                  pRpW0P                   P                  ^ ,          8X  d#   V P                  '       g   Q hRpV P                  pVR9   d   V P                  '       g   Q hV'       g(   VP                  V P                   P
                  8w  d   K  WB9   d   V P                  W$,          ,          p M!V'       g   K  V P                  R,          p M	  XV n        R# )FselectinSelecttdinCellthtrinRowtbodyinTableBodytheadtfootcaption	inCaptioncolgroupinColumnGrouptableinTableheadinBodybodyframeset
inFramesethtml
beforeHeadNTr~   )r   r   r   r   )r.   r   r4   rA   ra   r   r2   rP   )r3   lastnewModesnodenodeName	new_phases   &     r"   rR   HTMLParser.resetInsertionModeQ  s$    j((']]]{YHHL
  II**4R400DyyHIyy--a00~~~%~>> AA~~~%~DNNdii.H.HH# KK(:;	 KK1	) 1, 
r#   c                D   VR9   g   Q hV P                   P                  V4       VR 8X  d'   V P                  P                  V P                  n        M%V P                  P
                  V P                  n        V P                  V n        V P                  R,          V n        R# )RAWTEXTtextN)r   RCDATA)	r.   insertElementr=   rN   rM   rL   rP   originalPhaser2   )r3   r   contentTypes   &&&r"   parseRCDataRawtextHTMLParser.parseRCDataRawtext}  ss    3333		&)##'>>#>#>DNN #'>>#=#=DNN !ZZ[[(
r#   )rT   rJ   r%   r+   r/   rH   rU   rA   r:   rS   rI   r   rP   r2   r;   r*   r=   r.   )NFTF)FdivF)zXXX-undefined-errorN)r   
__module____qualname____firstlineno____doc__r6   rB   r>   propertyr[   rf   rj   r?   r   r&   r   r   r   r   r   rR   r   __static_attributes____classdictcell____classdict__s   @r"   r   r   E   su     !(F D : :UWO0b'2'8696=*X) )r#   r   c                   ^   a  ] tR tRt o RtRtR tR tR tR t	R t
R tR	 tR
 tR tRtV tR# )Phasei  zJBase class for helper object that implements each phase of processing
    c                :    Wn         W n        / V n        / V n        R # ri   )r9   r.   _Phase__startTagCache_Phase__endTagCache)r3   r9   r.   s   &&&r"   r6   Phase.__init__  s    	!r#   c                    \         hri   )NotImplementedErrorrV   s   &r"   r   Phase.processEOF  s    !!r#   c                r    V P                   P                  WP                   P                  R,          4       R# r   Nr~   r.   insertCommentr   r   s   &&r"   r   Phase.processComment  s%     			yy'='=b'ABr#   c                <    V P                   P                  R 4       R# )zunexpected-doctypeNr9   r   r   s   &&r"   r   Phase.processDoctype  s    34r#   c                J    V P                   P                  VR ,          4       R# ru   Nr.   
insertTextr   s   &&r"   r   Phase.processCharacters      		U6]+r#   c                J    V P                   P                  VR ,          4       R# r   r   r   s   &&r"   r   Phase.processSpaceCharacters  r  r#   c                   VR ,          pW P                   9   d   V P                   V,          pMV P                  V,          ;q0P                   V&   \        V P                   4      \        V P                  4      R,          8  d:   V P                   P                  \	        \        V P                   4      4      4       Km  V! V4      # r4   g?)r   startTagHandlerr   popnextiterr3   r   r4   funcs   &&  r"   r   Phase.processStartTag  s     V} '''''-D040D0DT0JJD''-d**+c$2F2F.G#.MM$$((d43G3G.H)IJE{r#   c                   V P                   P                  '       g*   VR ,          R8X  d   V P                   P                  R4       VR,          P                  4        F[  w  r#W P                  P
                  ^ ,          P                  9  g   K2  W0P                  P
                  ^ ,          P                  V&   K]  	  RV P                   n        R# )r4   r   znon-html-rootru   FN)r9   rH   r   r1   r.   r   rb   r3   r   attrr   s   &&  r"   startTagHtmlPhase.startTagHtml  s    {{(((U6]f-DKK""?3 !=..0KD9911!4???=B		&&q)44T: 1 %*!r#   c                   VR ,          pW P                   9   d   V P                   V,          pMV P                  V,          ;q0P                   V&   \        V P                   4      \        V P                  4      R,          8  d:   V P                   P                  \	        \        V P                   4      4      4       Km  V! V4      # r  )r   endTagHandlerr   r  r	  r
  r  s   &&  r"   r   Phase.processEndTag  s     V} %%%%%d+D.2.@.@.FFD%%d+d(()C0B0B,Cc,II""&&tD1C1C,D'EFE{r#   )__endTagCache__startTagCacher9   r.   N)r9   r.   r  r  )r   r   r   r   r   	__slots__r6   r   r   r   r   r   r   r  r   r   r   r   s   @r"   r   r     sB     FI "C
5,,"* r#   r   c                   ^   a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 tR
tV tR# )InitialPhasei  c                    R # ri    r   s   &&r"   r   #InitialPhase.processSpaceCharacters      r#   c                d    V P                   P                  WP                   P                  4       R # ri   r.   r   documentr   s   &&r"   r   InitialPhase.processComment      		yy'9'9:r#   c                   VR ,          pVR,          pVR,          pVR,          pVR8w  g   Vf   Ve#   VR8w  d   V P                   P                  R4       Vf   RpV P                  P                  V4       VR8w  d   VP	                  \
        4      pV'       de   VR ,          R8w  gW   VP                  R4      '       g@   VR9   g9   VP                  R4      '       d   Ve   V'       d(   VP                  4       R	8X  d   R
V P                   n        MCVP                  R4      '       g   VP                  R4      '       d   Ve   RV P                   n        V P                   P                  R,          V P                   n
        R# )r4   publicIdsystemIdcorrectr   Nzabout:legacy-compatzunknown-doctype z:http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtdquirkszlimited quirksrF   )7z*+//silmaril//dtd html pro v0r11 19970101//z4-//advasoft ltd//dtd html 3.0 aswedit + extensions//z*-//as//dtd html 3.0 aswedit + extensions//z-//ietf//dtd html 2.0 level 1//z-//ietf//dtd html 2.0 level 2//z&-//ietf//dtd html 2.0 strict level 1//z&-//ietf//dtd html 2.0 strict level 2//z-//ietf//dtd html 2.0 strict//z-//ietf//dtd html 2.0//z-//ietf//dtd html 2.1e//z-//ietf//dtd html 3.0//z-//ietf//dtd html 3.2 final//z-//ietf//dtd html 3.2//z-//ietf//dtd html 3//z-//ietf//dtd html level 0//z-//ietf//dtd html level 1//z-//ietf//dtd html level 2//z-//ietf//dtd html level 3//z"-//ietf//dtd html strict level 0//z"-//ietf//dtd html strict level 1//z"-//ietf//dtd html strict level 2//z"-//ietf//dtd html strict level 3//z-//ietf//dtd html strict//z-//ietf//dtd html//z(-//metrius//dtd metrius presentational//z5-//microsoft//dtd internet explorer 2.0 html strict//z.-//microsoft//dtd internet explorer 2.0 html//z0-//microsoft//dtd internet explorer 2.0 tables//z5-//microsoft//dtd internet explorer 3.0 html strict//z.-//microsoft//dtd internet explorer 3.0 html//z0-//microsoft//dtd internet explorer 3.0 tables//z#-//netscape comm. corp.//dtd html//z*-//netscape comm. corp.//dtd strict html//z*-//o'reilly and associates//dtd html 2.0//z3-//o'reilly and associates//dtd html extended 1.0//z;-//o'reilly and associates//dtd html extended relaxed 1.0//zN-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//zE-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//z$-//spyglass//dtd html 2.0 extended//z+-//sq//dtd html 2.0 hotmetal + extensions//z--//sun microsystems corp.//dtd hotjava html//z4-//sun microsystems corp.//dtd hotjava strict html//z-//w3c//dtd html 3 1995-03-24//z-//w3c//dtd html 3.2 draft//z-//w3c//dtd html 3.2 final//z-//w3c//dtd html 3.2//z-//w3c//dtd html 3.2s draft//z-//w3c//dtd html 4.0 frameset//z#-//w3c//dtd html 4.0 transitional//z(-//w3c//dtd html experimental 19960712//z&-//w3c//dtd html experimental 970421//z-//w3c//dtd w3 html//z-//w3o//dtd w3 html 3.0//z#-//webtechs//dtd mozilla html 2.0//z-//webtechs//dtd mozilla html//)z$-//w3o//dtd w3 html strict 3.0//en//z"-/w3c/dtd html 4.0 transitional/enr   )z -//w3c//dtd html 4.01 frameset//z$-//w3c//dtd html 4.01 transitional//)z -//w3c//dtd xhtml 1.0 frameset//z$-//w3c//dtd xhtml 1.0 transitional//)r9   r   r.   insertDoctyperc   r	   
startswithrK   rJ   r2   rP   )r3   r   r4   r%  r&  r'  s   &&    r"   r   InitialPhase.processDoctype  sb   V}$$	"FNh2$5J)JKK""#45H		&r>))*:;H5=F2##6879 79p  % % ##=> >  X^^-1mm%-DKK"!!9: : !!;< < "%5DKK" KK..|<r#   c                    R V P                   n        V P                   P                  R,          V P                   n        R# )r)  rF   N)r9   rJ   r2   rP   rV   s   &r"   anythingElseInitialPhase.anythingElse>  s)    !) KK..|<r#   c                \    V P                   P                  R 4       V P                  4        V# )zexpected-doctype-but-got-charsr9   r   r.  r   s   &&r"   r   InitialPhase.processCharactersB  s&    ?@r#   c                p    V P                   P                  R RVR,          /4       V P                  4        V# )z"expected-doctype-but-got-start-tagr4   r1  r   s   &&r"   r   InitialPhase.processStartTagG  s4    C &f6	8r#   c                p    V P                   P                  R RVR,          /4       V P                  4        V# )z expected-doctype-but-got-end-tagr4   r1  r   s   &&r"   r   InitialPhase.processEndTagM  s4    A &f6	8r#   c                \    V P                   P                  R 4       V P                  4        R# )zexpected-doctype-but-got-eofTr1  rV   s   &r"   r   InitialPhase.processEOFS  s$    =>r#   r  N)r   r   r   r   tupler  r   r   r   r.  r   r   r   r   r   r   r   s   @r"   r  r    s;     I;]=~=
 r#   r  c                   X   a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	tV tR
# )BeforeHtmlPhaseiY  c                    V P                   P                  \        R R4      4       V P                  P                  R,          V P                  n        R# )r   ro   r   N)r.   
insertRootimpliedTagTokenr9   r2   rP   rV   s   &r"   rQ   !BeforeHtmlPhase.insertHtmlElement]  s6    		_VZ@A KK..|<r#   c                &    V P                  4        R # TrQ   rV   s   &r"   r   BeforeHtmlPhase.processEOFb  s     r#   c                d    V P                   P                  WP                   P                  4       R # ri   r   r   s   &&r"   r   BeforeHtmlPhase.processCommentf  r#  r#   c                    R # ri   r  r   s   &&r"   r   &BeforeHtmlPhase.processSpaceCharactersi  r  r#   c                &    V P                  4        V# ri   rB  r   s   &&r"   r   !BeforeHtmlPhase.processCharactersl  s     r#   c                d    VR ,          R8X  d   RV P                   n        V P                  4        V# )r4   r   T)r9   rH   rQ   r   s   &&r"   r   BeforeHtmlPhase.processStartTagp  s+    =F"(,DKK% r#   c                    VR ,          R9  d(   V P                   P                  RR VR ,          /4       R# V P                  4        V# )r4   zunexpected-end-tag-before-htmlNr   r   r   br)r9   r   rQ   r   s   &&r"   r   BeforeHtmlPhase.processEndTagv  sC    = >>KK""#C$*E&M#:< ""$Lr#   r  N)r   r   r   r   r9  r  rQ   r   r   r   r   r   r   r   r   r   s   @r"   r;  r;  Y  s4     I=
; r#   r;  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 t]P                  ! R
]	3R]
3.4      t]]n        ]P                  ! R]3.4      t]]n        RtV tR# )BeforeHeadPhasei  c                <    V P                  \        R R4      4       R# )r   ro   TstartTagHeadr>  rV   s   &r"   r   BeforeHeadPhase.processEOF  s    /&*=>r#   c                    R # ri   r  r   s   &&r"   r   &BeforeHeadPhase.processSpaceCharacters  r  r#   c                <    V P                  \        R R4      4       V# r   ro   rS  r   s   &&r"   r   !BeforeHeadPhase.processCharacters      /&*=>r#   c                Z    V P                   P                  R ,          P                  V4      # r   r9   r2   r   r   s   &&r"   r  BeforeHeadPhase.startTagHtml  "    {{!!(+;;EBBr#   c                    V P                   P                  V4       V P                   P                  R,          V P                   n        V P                  P
                  R,          V P                  n        R# )r   inHeadNr~   )r.   r   r   headPointerr9   r2   rP   r   s   &&r"   rT  BeforeHeadPhase.startTagHead  sJ    		& $		 6 6r :		 KK..x8r#   c                <    V P                  \        R R4      4       V# rY  rS  r   s   &&r"   startTagOtherBeforeHeadPhase.startTagOther  r[  r#   c                <    V P                  \        R R4      4       V# rY  rS  r   s   &&r"   endTagImplyHeadBeforeHeadPhase.endTagImplyHead  r[  r#   c                P    V P                   P                  R RVR,          /4       R# )zend-tag-after-implied-rootr4   Nr   r   s   &&r"   endTagOtherBeforeHeadPhase.endTagOther  s#    ; &f6	8r#   r   r   r  NrM  )r   r   r   r   r9  r  r   r   r   r  rT  rf  ri  rl  r   MethodDispatcherr  defaultr  r   r   r   s   @r"   rQ  rQ    s     IC9
8 --		/ O ,O++	'9- M (Mr#   rQ  c                   (  a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 tR
 tR tR tR tR tR tR t]P,                  ! R]3R]3R]3R]3R]3R]
3R]3R]	3.4      t]]n        ]P,                  ! R]3R]3.4      t]]n        RtV tR# )InHeadPhasei  c                &    V P                  4        R # rA  r.  rV   s   &r"   r   InHeadPhase.processEOF      r#   c                &    V P                  4        V# ri   rs  r   s   &&r"   r   InHeadPhase.processCharacters      r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r^  r   s   &&r"   r  InHeadPhase.startTagHtml  r`  r#   c                <    V P                   P                  R 4       R# )z!two-heads-are-not-better-than-oneNr   r   s   &&r"   rT  InHeadPhase.startTagHead  s    BCr#   c                    V P                   P                  V4       V P                   P                  P                  4        R VR&   R# Tr}   Nr.   r   r   r  r   s   &&r"   startTagBaseLinkCommand#InHeadPhase.startTagBaseLinkCommand  5    		&		""$+/'(r#   c                   V P                   P                  V4       V P                   P                  P                  4        R VR&   VR,          pV P                  P
                  P                  P                  ^,          R8X  d   RV9   d9   V P                  P
                  P                  P                  VR,          4       R	# RV9   d   RV9   d   VR,          P                  4       R8X  d   \        P                  ! VR,          P                  R4      4      p\        P                  ! V4      pVP                  4       pV P                  P
                  P                  P                  V4       R	# R	# R	# R	# R	# )
Tr}   ru   	tentativecharsetcontentz
http-equivzcontent-typezutf-8N)r.   r   r   r  r9   r=   r@   rZ   changeEncodingrK   r   EncodingBytesencodeContentAttrParserr   )r3   r   rb   ru   r9   codecs   &&    r"   startTagMetaInHeadPhase.startTagMeta  s#   		&		""$+/'(6]
;;  ''44Q7;FJ&%%,,;;Jy<QRz)*,\*002nD
 $11*Y2G2N2Nw2WX%77=%%,,;;EB E - * Gr#   c                >    V P                   P                  VR 4       R# )r   Nr9   r   r   s   &&r"   startTagTitleInHeadPhase.startTagTitle  s    &&uh7r#   c                >    V P                   P                  VR 4       R# )r   Nr  r   s   &&r"   startTagNoFramesStyle!InHeadPhase.startTagNoFramesStyle      &&ui8r#   c                   V P                   P                  '       d   V P                   P                  VR 4       R# V P                  P	                  V4       V P                   P
                  R,          V P                   n        R# )r   inHeadNoscriptN)r9   r;   r   r.   r   r2   rP   r   s   &&r"   startTagNoscriptInHeadPhase.startTagNoscript  sT    ;;   KK**5)<II##E* $ 2 23C DDKKr#   c                P   V P                   P                  V4       V P                  P                  P                  V P                  P                  n        V P                  P                  V P                  n        V P                  P                  R ,          V P                  n        R# )r   N)	r.   r   r9   r=   scriptDataStaterM   rP   r   r2   r   s   &&r"   startTagScriptInHeadPhase.startTagScript  sg    		&&*kk&;&;&K&K#$(KK$5$5! KK..v6r#   c                &    V P                  4        V# ri   rs  r   s   &&r"   rf  InHeadPhase.startTagOther  rx  r#   c                   V P                   P                  P                  P                  4       pVP                  R 8X  g   Q RVP                  ,          4       hV P                   P
                  R,          V P                   n        R# )r   zExpected head got %s	afterHeadNr9   r.   r   r  r4   r2   rP   r3   r   r   s   && r"   
endTagHeadInHeadPhase.endTagHead  s\    {{,,002yyF"F$:TYY$FF" KK..{;r#   c                &    V P                  4        V# ri   rs  r   s   &&r"   endTagHtmlBodyBrInHeadPhase.endTagHtmlBodyBr  rx  r#   c                P    V P                   P                  R RVR,          /4       R# unexpected-end-tagr4   Nr   r   s   &&r"   rl  InHeadPhase.endTagOther       3feFm5LMr#   c                :    V P                  \        R 4      4       R# )r   N)r  r>  rV   s   &r"   r.  InHeadPhase.anythingElse  s    /0r#   r   titlenoscriptscriptmetar   r  N)noframesstyle)basebasefontbgsoundcommandlink)rN  r   r   )r   r   r   r   r9  r  r   r   r  rT  r  r  r  r  r  r  rf  r  r  rl  r.  r   rn  r  ro  r  r   r   r   s   @r"   rq  rq    s     ICD0
C*89E7<
N1 --		- 	 56	%&	>"	;	 	"		
/ 
O ,O++		!12- M (Mr#   rq  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 tR
 tR tR tR t]P&                  ! R]
3R]3R]3.4      t]]n        ]P&                  ! R]3R]3.4      t]]n        RtV tR# )InHeadNoscriptPhasei  c                \    V P                   P                  R 4       V P                  4        R# )zeof-in-head-noscriptTr1  rV   s   &r"   r   InHeadNoscriptPhase.processEOF  s$    56r#   c                Z    V P                   P                  R ,          P                  V4      # rb  )r9   r2   r   r   s   &&r"   r   "InHeadNoscriptPhase.processComment  s"    {{!!(+::5AAr#   c                \    V P                   P                  R 4       V P                  4        V# )zchar-in-head-noscriptr1  r   s   &&r"   r   %InHeadNoscriptPhase.processCharacters  s&    67r#   c                Z    V P                   P                  R ,          P                  V4      # r  r9   r2   r   r   s   &&r"   r   *InHeadNoscriptPhase.processSpaceCharacters$  "    {{!!(+BB5IIr#   c                Z    V P                   P                  R ,          P                  V4      # r]  r^  r   s   &&r"   r   InHeadNoscriptPhase.startTagHtml'  r`  r#   c                Z    V P                   P                  R ,          P                  V4      # r  r^  r   s   &&r"   r  +InHeadNoscriptPhase.startTagBaseLinkCommand*  r`  r#   c                P    V P                   P                  R RVR,          /4       R# unexpected-start-tagr4   Nr   r   s   &&r"   startTagHeadNoscript(InHeadNoscriptPhase.startTagHeadNoscript-       5f7NOr#   c                p    V P                   P                  R RVR,          /4       V P                  4        V# zunexpected-inhead-noscript-tagr4   r1  r   s   &&r"   rf  !InHeadNoscriptPhase.startTagOther0  2    ?&%PV-AXYr#   c                   V P                   P                  P                  P                  4       pVP                  R 8X  g   Q RVP                  ,          4       hV P                   P
                  R,          V P                   n        R# )r  zExpected noscript got %srb  Nr  r  s   && r"   endTagNoscript"InHeadNoscriptPhase.endTagNoscript5  s\    {{,,002yyJ&N(BTYY(NN& KK..x8r#   c                p    V P                   P                  R RVR,          /4       V P                  4        V# r  r1  r   s   &&r"   endTagBrInHeadNoscriptPhase.endTagBr:  r  r#   c                P    V P                   P                  R RVR,          /4       R# r  r   r   s   &&r"   rl  InHeadNoscriptPhase.endTagOther?  r  r#   c                :    V P                  \        R 4      4       R# )r  N)r  r>  rV   s   &r"   r.   InHeadNoscriptPhase.anythingElseB  s    OJ78r#   r   r  rN  r  N)r  r  r  r  r  r  )r   r  )r   r   r   r   r9  r  r   r   r   r   r  r  r  rf  r  r  rl  r.  r   rn  r  ro  r  r   r   r   s   @r"   r  r    s     I
B
JCCP
9

N9 --		EG^_	34/ O
 ,O++	^$	x- M (Mr#   r  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 tR
 tR tR t]P$                  ! R]3R]	3R]
3R]3R]3.4      t]]n        ]P$                  ! R]3.4      t]]n        RtV tR# )AfterHeadPhaseiT  c                &    V P                  4        R # rA  rs  rV   s   &r"   r   AfterHeadPhase.processEOFW  ru  r#   c                &    V P                  4        V# ri   rs  r   s   &&r"   r    AfterHeadPhase.processCharacters[  rx  r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r^  r   s   &&r"   r  AfterHeadPhase.startTagHtml_  r`  r#   c                    R V P                   n        V P                  P                  V4       V P                   P                  R,          V P                   n        R# )Fr   N)r9   rU   r.   r   r2   rP   r   s   &&r"   startTagBodyAfterHeadPhase.startTagBodyb  s;    !&		& KK..x8r#   c                    V P                   P                  V4       V P                  P                  R ,          V P                  n        R# )r   N)r.   r   r9   r2   rP   r   s   &&r"   startTagFramesetAfterHeadPhase.startTagFramesetg  s/    		& KK..|<r#   c                   V P                   P                  R RVR,          /4       V P                  P                  P	                  V P                  P
                  4       V P                   P                  R,          P                  V4       V P                  P                  RRR1,           F<  pVP                  R8X  g   K  V P                  P                  P                  V4        R# 	  R# )z#unexpected-start-tag-out-of-my-headr4   rb  Nr   r~   )
r9   r   r.   r   r   rc  r2   r   r4   remover  s   && r"   startTagFromHeadAfterHeadPhase.startTagFromHeadk  s    D &f6	8		%%dii&;&;<8$44U;II**4R400DyyF"		&&--d3 1r#   c                P    V P                   P                  R RVR,          /4       R# r  r   r   s   &&r"   rT  AfterHeadPhase.startTagHeadu  r  r#   c                &    V P                  4        V# ri   rs  r   s   &&r"   rf  AfterHeadPhase.startTagOtherx  rx  r#   c                &    V P                  4        V# ri   rs  r   s   &&r"   r  AfterHeadPhase.endTagHtmlBodyBr|  rx  r#   c                P    V P                   P                  R RVR,          /4       R# r  r   r   s   &&r"   rl  AfterHeadPhase.endTagOther  r  r#   c                    V P                   P                  \        R R4      4       V P                  P                  R,          V P                  n        RV P                  n        R# )r   ro   r   TN)r.   r   r>  r9   r2   rP   rU   rV   s   &r"   r.  AfterHeadPhase.anythingElse  sB    		
 CD KK..x8!%r#   r   r   r   r   r  N)	r  r  r  r  r  r  r  r  r  )r   r   rN  )r   r   r   r   r9  r  r   r   r  r  r  r  rT  rf  r  rl  r.  r   rn  r  ro  r  r   r   r   s   @r"   r  r  T  s     IC9
=PN&
 --			%&
		 
/ O ,O++.D.>.@ -A BM'Mr#   r  c                     a a ] tR tRt oRKtV 3R ltR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R  t#R! t$R" t%R# t&R$ t'R% t(R& t)R' t*R( t+R) t,R* t-R+ t.R, t/R- t0R. t1R/ t2R0 t3R1 t4R2 t5R3 t6R4 t7]8Pr                  ! . R5]:Pv                  3NRL]3NR6]3NR7]3NRM]3N]<]3NRN]3NR9]3NRO]3NR:]3NR;]3NRP]3NR<]3NR=]3NRQ]3NR>]3NR?]3NRR]3NRS]3NRA]3NRB]3NRC] 3NRD]!3NRE]"3NRF]#3NRG]$3NRT]%3NRH]'3NRU](3NRV]&3NRI])3NRJ]*3NRW]+3N4      t=],]=n>        ]8Pr                  ! R6].3R5]/3RX]03R9]13R8]-3RY]23]<]33RZ]43RQ]53R@]63.
4      t?]7]?n>        RKt@VtAV ;tB# )[InBodyPhasei  c                R   < \         \        V `
  ! V/ VB  V P                  V n        R # ri   )superr  r6   processSpaceCharactersNonPrer   r3   r   r   r   s   &*,r"   r6   InBodyPhase.__init__  s%    k4)4:6:&*&G&G#r#   c                    VP                   VP                   8H  ;'       d;    VP                  VP                  8H  ;'       d    VP                  VP                  8H  # ri   )r4   ra   rb   )r3   node1node2s   &&&r"   isMatchingFormattingElement'InBodyPhase.isMatchingFormattingElement  sO    

ejj( 5 55??25 5  E$4$44	6r#   c                   V P                   P                  V4       V P                   P                  R,          p. pV P                   P                  RRR1,           F9  pV\        J d    M.V P                  WB4      '       g   K(  VP                  V4       K;  	  \        V4      ^8:  g   Q h\        V4      ^8X  d-   V P                   P                  P                  VR,          4       V P                   P                  P                  V4       R# r   )	r.   r   r   activeFormattingElementsr   r  r   r   r  )r3   r   re   matchingElementsr   s   &&   r"   addFormattingElement InBodyPhase.addFormattingElement  s    		&))((,II66tt<<Dv~11$@@ ''-	 = #$))) A%II..556Fr6JK		**11':r#   c                    \        R4      pV P                  P                  RRR1,           F2  pVP                  V9  g   K  V P                  P                  R4        R# 	  R# )ddNz expected-closing-tag-but-got-eof)r  dtlir!   r   r   r   r   r   r   r   r   r~   )r   r.   r   r4   r9   r   )r3   allowed_elementsr   s   &  r"   r   InBodyPhase.processEOF  sW    $ &. / II**4R400Dyy 00&&'IJ 1r#   c                   VR ,          pV P                   V n        VP                  R4      '       dg   V P                  P                  R,          P
                  R9   d;   V P                  P                  R,          P                  4       '       g
   VR,          pV'       d8   V P                  P                  4        V P                  P                  V4       R# R# )ru   
:r   NNNr~   )prelistingtextarea)	r   r   r+  r.   r   r4   
hasContent#reconstructActiveFormattingElementsr   )r3   r   ru   s   && r"   !processSpaceCharactersDropNewline-InBodyPhase.processSpaceCharactersDropNewline  s     V}&*&G&G#OOD!!II""2&++/MMII**2.99;;8DII99;II  & r#   c                   VR ,          R8X  d   R# V P                   P                  4        V P                   P                  VR ,          4       V P                  P                  '       d^   \
        ;QJ d#    R VR ,           4       F  '       g   K   RM	  RM! R VR ,           4       4      '       d   RV P                  n        R# R# R# )ru    Nc              3   4   "   T F  pV\         9  x  K  	  R # 5iri   r   .0chars   & r"   	<genexpr>0InBodyPhase.processCharacters.<locals>.<genexpr>  s      +)D O+)s   TF)r.   r  r   r9   rU   anyr   s   &&r"   r   InBodyPhase.processCharacters  s    =H$		557		U6]+KK"""C +!&M+CCC +!&M+ + +%*DKK"+ #r#   c                ~    V P                   P                  4        V P                   P                  VR ,          4       R# r   )r.   r  r   r   s   &&r"   r   (InBodyPhase.processSpaceCharactersNonPre  s(    		557		U6]+r#   c                Z    V P                   P                  R ,          P                  V4      # r  r^  r   s   &&r"   startTagProcessInHead!InBodyPhase.startTagProcessInHead  r`  r#   c                0   V P                   P                  R RR/4       \        V P                  P                  4      ^8X  g-   V P                  P                  ^,          P
                  R8w  d!   V P                   P                  '       g   Q hR# RV P                   n        VR,          P                  4        F[  w  r#W P                  P                  ^,          P                  9  g   K2  W0P                  P                  ^,          P                  V&   K]  	  R# )r  r4   r   Fru   N)
r9   r   r   r.   r   r4   rA   rU   r1   rb   r  s   &&  r"   r  InBodyPhase.startTagBody  s    57GH		&&'1,		&&q)..&8;;(((((%*DKK"$V}224yy55a8CCCAFII**1-88>  5r#   c                   V P                   P                  R RR/4       \        V P                  P                  4      ^8X  g-   V P                  P                  ^,          P
                  R8w  d!   V P                   P                  '       g   Q hR# V P                   P                  '       g   R# V P                  P                  ^,          P                  '       dR   V P                  P                  ^,          P                  P                  V P                  P                  ^,          4       V P                  P                  R,          P
                  R8w  d'   V P                  P                  P                  4        KR  V P                  P                  V4       V P                   P                  R,          V P                   n        R# )r  r4   r   r   r   r   Nr~   )r9   r   r   r.   r   r4   rA   rU   parentremoveChildr  r   r2   rP   r   s   &&r"   r  InBodyPhase.startTagFrameset  s'   5
7KL		&&'1,		0F0Fq0I0N0NRX0X;;((((('''yy%%a(///		&&q)00<<TYY=S=STU=VW))((,11V;		&&**,II##E* $ 2 2< @DKKr#   c                    V P                   P                  R RR7      '       d   V P                  \        R 4      4       V P                   P	                  V4       R# r!   buttonvariantN)r.   elementInScopeendTagPr>  r   r   s   &&r"   startTagClosePInBodyPhase.startTagCloseP  s?    99##C#::LL-.		&r#   c                    V P                   P                  R RR7      '       d   V P                  \        R 4      4       V P                   P	                  V4       RV P
                  n        V P                  V n        R# )r!   r4  r5  FN)	r.   r7  r8  r>  r   r9   rU   r  r   r   s   &&r"   startTagPreListingInBodyPhase.startTagPreListing   sY    99##C#::LL-.		&!&&*&L&L#r#   c                   V P                   P                  '       d!   V P                  P                  R RR/4       R# V P                   P	                  RRR7      '       d   V P                  \        R4      4       V P                   P                  V4       V P                   P                  R,          V P                   n        R# )r  r4   formr!   r4  r5  Nr~   )	r.   formPointerr9   r   r7  r8  r>  r   r   r   s   &&r"   startTagFormInBodyPhase.startTagForm  s    99   KK""#9FF;KLyy''X'>>_S12II##E*$(II$:$:2$>DII!r#   c                r   R V P                   n        RR.RRR.RRR./pW!R,          ,          p\        V P                  P                  4       Fy  pVP
                  V9   d<   V P                   P                  P                  \        VP
                  R4      4        M.VP                  \        9   g   Kf  VP
                  R
9  g   Ky   M	  V P                  P                  RRR7      '       d0   V P                   P                  P                  \        RR4      4       V P                  P                  V4       R	# )Fr  r  r  r4   rp   r!   r4  r5  N)addressr   r!   )r9   rU   reversedr.   r   r4   rP   r   r>  	nameTupler
   r7  r   )r3   r   stopNamesMap	stopNamesr   s   &&   r"   startTagListItemInBodyPhase.startTagListItem  s    !&tftTltTl, !v/	TYY334DyyI%!!//#DIIx8:/1II%<< 5 99##C#::KK++X.0 			&r#   c                (   V P                   P                  R RR7      '       d   V P                  \        R 4      4       V P                   P	                  V4       V P
                  P                  P                  V P
                  P                  n        R# r3  )	r.   r7  r8  r>  r   r9   r=   rO   rM   r   s   &&r"   startTagPlaintextInBodyPhase.startTagPlaintext&  sa    99##C#::LL-.		&&*kk&;&;&J&J#r#   c                   V P                   P                  R RR7      '       d   V P                  \        R 4      4       V P                   P                  R,          P
                  \        9   dJ   V P                  P                  RRVR,          /4       V P                   P                  P                  4        V P                   P                  V4       R# )r!   r4  r5  r  r4   Nr~   )r.   r7  r8  r>  r   r4   r   r9   r   r  r   r   s   &&r"   startTagHeadingInBodyPhase.startTagHeading,  s    99##C#::LL-.99!!"%**o=KK""#9FE&M;RSII""&&(		&r#   c                   V P                   P                  R 4      pV'       d   V P                  P                  RRR RR /4       V P	                  \        R 4      4       W P                   P                  9   d&   V P                   P                  P                  V4       W P                   P                  9   d&   V P                   P                  P                  V4       V P                   P                  4        V P                  V4       R# )a$unexpected-start-tag-implies-end-tag	startNameendNameN)r.   !elementInActiveFormattingElementsr9   r   endTagFormattingr>  r   r  r	  r  r  )r3   r   afeAElements   && r"   	startTagAInBodyPhase.startTagA4  s    iiAA#FKK""#I$/i#EG!!/#"67ii444		&&--k:ii@@@		2299+F		557!!%(r#   c                \    V P                   P                  4        V P                  V4       R # ri   )r.   r  r  r   s   &&r"   startTagFormattingInBodyPhase.startTagFormattingA  s     		557!!%(r#   c                F   V P                   P                  4        V P                   P                  R 4      '       dU   V P                  P	                  RRR RR /4       V P                  \        R 4      4       V P                   P                  4        V P                  V4       R# )nobrrS  rT  rU  N)r.   r  r7  r9   r   r   r>  r  r   s   &&r"   startTagNobrInBodyPhase.startTagNobrE  sz    		55799##F++KK""#I$/F#KMv67II99;!!%(r#   c                L   V P                   P                  R 4      '       d=   V P                  P                  RRR RR /4       V P	                  \        R 4      4       V# V P                   P                  4        V P                   P                  V4       RV P                  n        R# )r4  rS  rT  rU  FN)	r.   r7  r9   r   r   r>  r  r   rU   r   s   &&r"   startTagButtonInBodyPhase.startTagButtonO  s    99##H--KK""#I$/9h#OQx89LII99;II##E*%*DKK"r#   c                    V P                   P                  4        V P                   P                  V4       V P                   P                  P	                  \
        4       R V P                  n        R# FN)r.   r  r   r	  r   r   r9   rU   r   s   &&r"   startTagAppletMarqueeObject'InBodyPhase.startTagAppletMarqueeObjectZ  sH    		557		&		**11&9!&r#   c                   V P                   P                  R RR7      '       d   V P                  \        R 4      4       V P                   P	                  4        RV P
                  n        V P
                  P                  VR4       R# )r!   r4  r5  Fr   N)r.   r7  r8  r>  r  r9   rU   r   r   s   &&r"   startTagXmpInBodyPhase.startTagXmp`  s]    99##C#::LL-.		557!&&&ui8r#   c                f   V P                   P                  R 8w  d>   V P                  P                  RRR7      '       d   V P	                  \        R4      4       V P                  P                  V4       RV P                   n        V P                   P                  R,          V P                   n	        R# )r)  r!   r4  r5  Fr   N)
r9   rJ   r.   r7  r   r>  r   rU   r2   rP   r   s   &&r"   startTagTableInBodyPhase.startTagTableg  sz    ;;!!X-yy''X'>>""?3#78		&!& KK..y9r#   c                    V P                   P                  4        V P                   P                  V4       V P                   P                  P	                  4        R VR&   RV P
                  n        R# )Tr}   FN)r.   r  r   r   r  r9   rU   r   s   &&r"   startTagVoidFormatting"InBodyPhase.startTagVoidFormattingo  sQ    		557		&		""$+/'(!&r#   c                    V P                   P                  pV P                  V4       R VR,          9   d=   VR,          R ,          P                  \        4      R8X  d   W P                   n        R# R# R# )rt   ru   hiddenN)r9   rU   rp  rc   r	   )r3   r   rU   s   && r"   startTagInputInBodyPhase.startTagInputv  s]    [[++
##E*eFm#ff%//0@AXM%/KK" N $r#   c                    V P                   P                  V4       V P                   P                  P                  4        R VR&   R# r~  r  r   s   &&r"   startTagParamSourceInBodyPhase.startTagParamSource~  r  r#   c                *   V P                   P                  R RR7      '       d   V P                  \        R 4      4       V P                   P	                  V4       V P                   P
                  P                  4        RVR&   RV P                  n        R# )r!   r4  r5  Tr}   FN)	r.   r7  r8  r>  r   r   r  r9   rU   r   s   &&r"   
startTagHrInBodyPhase.startTagHr  sl    99##C#::LL-.		&		""$+/'(!&r#   c           	         V P                   P                  R RRRR/4       V P                  \        RRVR,          VR,          R7      4       R	# )
zunexpected-start-tag-treated-asoriginalNameimagenewNameimgro   ru   r|   rb   r|   N)r9   r   r   r>  r   s   &&r"   startTagImageInBodyPhase.startTagImage  sN    @ .EJ	L_UJ8=f9>}9MO 	Pr#   c           	     4   V P                   P                  R RR/4       V P                  P                  '       d   R# / pRVR,          9   d   VR,          R,          VR&   V P	                  \        RRVR7      4       V P	                  \        R	R4      4       V P	                  \        R
R4      4       RVR,          9   d   VR,          R,          pMRpV P                  R\        R,          RV/4       VR,          P                  4       pRV9   d   VR RV9   d   VR RVR&   V P	                  \        RRVVR,          R7      4       V P                  \        R
4      4       V P	                  \        R	R4      4       V P                  \        R4      4       R# )zdeprecated-tagr4   isindexNactionru   r?  ro   )rb   hrlabelpromptz3This is a searchable index. Enter search keywords: rt   rm   inputr|   r  )
r9   r   r.   r@  r   r>  r   r   copyr   )r3   r   
form_attrsr  rb   s   &&   r"   startTagIsIndexInBodyPhase.startTagIsIndex  sy   /&)1DE99   
uV}$#(=#:Jx _VZ8BD 	E_T:>?_WjABuV}$6]8,FJFZ-vv>	@6]'')
z!8$z!8$&
6_Wj8B9>}9MO 	P 	?734_T:>??623r#   c                    V P                   P                  V4       V P                  P                  P                  V P                  P                  n        V P                  V n        R V P                  n        R# rf  )	r.   r   r9   r=   rL   rM   r  r   rU   r   s   &&r"   startTagTextareaInBodyPhase.startTagTextarea  sP    		&&*kk&;&;&G&G#&*&L&L#!&r#   c                J    R V P                   n        V P                  V4       R# rf  )r9   rU   startTagRawtextr   s   &&r"   startTagIFrameInBodyPhase.startTagIFrame  s    !&U#r#   c                    V P                   P                  '       d   V P                  V4       R # V P                  V4       R # ri   )r9   r;   r  rf  r   s   &&r"   r  InBodyPhase.startTagNoscript  s.    ;;     'u%r#   c                >    V P                   P                  VR4       R# )z8iframe, noembed noframes, noscript(if scripting enabled)r   Nr  r   s   &&r"   r  InBodyPhase.startTagRawtext  r  r#   c                8   V P                   P                  R,          P                  R8X  d/   V P                  P                  P                  \        R4      4       V P                   P                  4        V P                  P                   P                  V4       R# r   optionNr~   )	r.   r   r4   r9   rP   r   r>  r  r   r   s   &&r"   startTagOptInBodyPhase.startTagOpt  sd    99!!"%**h6KK++OH,EF		557&&u-r#   c                   V P                   P                  4        V P                   P                  V4       R V P                  n        V P                  P
                  V P                  P                  R,          V P                  P                  R,          V P                  P                  R,          V P                  P                  R,          V P                  P                  R,          V P                  P                  R,          39   d/   V P                  P                  R,          V P                  n        R	# V P                  P                  R,          V P                  n        R	# )
Fr   r   r   r   r   r   inSelectInTabler   N)r.   r  r   r9   rU   rP   r2   r   s   &&r"   startTagSelectInBodyPhase.startTagSelect  s    		557		&!&;;!3!3I!>!%!3!3K!@!%!3!3O!D!%!3!3M!B!%!3!3G!<!%!3!3H!=!? ? !% 2 23D EDKK $ 2 2: >DKKr#   c                >   V P                   P                  R 4      '       da   V P                   P                  4        V P                   P                  R,          P                  R 8w  d   V P
                  P                  4        V P                   P                  V4       R# )rubyNr~   )r.   r7  generateImpliedEndTagsr   r4   r9   r   r   r   s   &&r"   startTagRpRtInBodyPhase.startTagRpRt  sf    99##F++II,,.yy%%b)..&8&&(		&r#   c                p   V P                   P                  4        V P                  P                  V4       V P                  P	                  V4       \
        R ,          VR&   V P                   P                  V4       VR,          '       d,   V P                   P                  P                  4        RVR&   R# R# )r_   ra   r|   Tr}   N)	r.   r  r9   r   r   r   r   r   r  r   s   &&r"   startTagMathInBodyPhase.startTagMath  s    		557**51++E2'1k		& II""&&(/3E+,  r#   c                p   V P                   P                  4        V P                  P                  V4       V P                  P	                  V4       \
        R ,          VR&   V P                   P                  V4       VR,          '       d,   V P                   P                  P                  4        RVR&   R# R# )ry   ra   r|   Tr}   N)	r.   r  r9   r   r   r   r   r   r  r   s   &&r"   startTagSvgInBodyPhase.startTagSvg  s    		557''.++E2'.k		& II""&&(/3E+,  r#   c                P    V P                   P                  RRVR,          /4       R# )zElements that should be children of other elements that have a
different insertion mode; here they are ignored
"caption", "col", "colgroup", "frame", "frameset", "head",
"option", "optgroup", "tbody", "td", "tfoot", "th", "thead",
"tr", "noscript"
zunexpected-start-tag-ignoredr4   Nr   r   s   &&r"   startTagMisplacedInBodyPhase.startTagMisplaced  s"     	=f?VWr#   c                p    V P                   P                  4        V P                   P                  V4       R # ri   )r.   r  r   r   s   &&r"   rf  InBodyPhase.startTagOther  s$    		557		&r#   c                x   V P                   P                  R RR7      '       gW   V P                  \        R R4      4       V P                  P                  RRR /4       V P                  \        R R4      4       R# V P                   P                  R 4       V P                   P                  R,          P                  R 8w  d   V P                  P                  RRR /4       V P                   P                  P                  4       pVP                  R 8w  d'   V P                   P                  P                  4       pK7  R# )	r!   r4  r5  ro   r  r4   rp   Nr~   )r.   r7  r9  r>  r9   r   r8  r  r   r4   r  r  s   && r"   r8  InBodyPhase.endTagP  s    yy''X'>>Z @AKK""#7&#GLLh78II,,S1yy%%b)..#5&&';fc]K99))--/D))s"yy--113 #r#   c                   V P                   P                  R 4      '       g   V P                  P                  4        R# V P                   P                  R,          P
                  R 8w  dk   V P                   P                  R,           FI  pVP
                  \        R4      9  g   K  V P                  P                  RRR RVP
                  /4        M	  V P                  P                  R,          V P                  n        R# )	r   N:   NN$expected-one-end-tag-but-got-anothergotNameexpectedName	afterBodyr~   )r  r  r  optgroupr  r!   rprtr   r   r   r   r   r   r   r   )	r.   r7  r9   r   r   r4   r   r2   rP   r  s   && r"   
endTagBodyInBodyPhase.endTagBody  s    yy''//KK""$YY##B',,6		..r2299I /7 %8 8 KK**>"FNDIIFH  3 !KK..{;r#   c                    V P                   P                  R 4      '       d   V P                  \        R 4      4       V# R# )r   N)r.   r7  r  r>  r   s   &&r"   
endTagHtmlInBodyPhase.endTagHtml%  s2    99##F++OOOF34L ,r#   c                T   VR ,          R8X  d   V P                   V n        V P                  P                  VR ,          4      pV'       d   V P                  P	                  4        V P                  P
                  R,          P                  VR ,          8w  d&   V P                  P                  RR VR ,          /4       V'       de   V P                  P
                  P                  4       pVP                  VR ,          8w  d'   V P                  P
                  P                  4       pK>  R# R# )r4   r  end-tag-too-earlyNr~   )
r   r   r.   r7  r  r   r4   r9   r   r  )r3   r   inScoper   s   &&  r"   endTagBlockInBodyPhase.endTagBlock+  s    =E!*.*K*KD'))**5=9II,,.99!!"%**eFm;KK""#6v8OP99))--/D))uV},yy--113 - r#   c                   V P                   P                  pR V P                   n        Ve"   V P                   P                  V4      '       g!   V P                  P	                  RRR/4       R # V P                   P                  4        V P                   P                  R,          V8w  d   V P                  P	                  RRR/4       V P                   P                  P                  V4       R # )Nr  r4   r?  zend-tag-too-early-ignoredr~   )r.   r@  r7  r9   r   r  r   r  r  s   && r"   
endTagFormInBodyPhase.endTagForm9  s    yy$$ $		<tyy77==KK""#7$*F#35 II,,.yy%%b)T1&&'B(.'79II""))$/r#   c                   VR ,          R8X  d   RpMRpV P                   P                  VR ,          VR7      '       g(   V P                  P                  RR VR ,          /4       R# V P                   P	                  VR ,          R7       V P                   P
                  R,          P                  VR ,          8w  d&   V P                  P                  RR VR ,          /4       V P                   P
                  P                  4       pVP                  VR ,          8w  d'   V P                   P
                  P                  4       pK>  R# )	r4   r  listNr5  r  excluder  r~   )r.   r7  r9   r   r  r   r4   r  )r3   r   r6  r   s   &&  r"   endTagListItemInBodyPhase.endTagListItemF  s    =D GGyy''fw'GGKK""#7&%-9PQII,,U6],Cyy%%b)..%-?&&'U6]+- 99))--/D))uV},yy--113 -r#   c                j   \          F@  pV P                  P                  V4      '       g   K&  V P                  P                  4         M	  V P                  P                  R,          P
                  VR,          8w  d&   V P                  P                  RRVR,          /4       \          F  pV P                  P                  V4      '       g   K&  V P                  P                  P                  4       pVP
                  \         9  d'   V P                  P                  P                  4       pK;   R# 	  R# )r   r4   r  Nr~   )	r   r.   r7  r  r   r4   r9   r   r  )r3   r   items   && r"   endTagHeadingInBodyPhase.endTagHeadingW  s    #Dyy''--		002 $ 99!!"%**eFm;KK""#6v8OP#Dyy''--yy--113ii69911557D $r#   c                   ^ pV^8  Ed   V^,          pV P                   P                  VR,          4      pV'       dF   W0P                   P                  9   d?   V P                   P                  VP                  4      '       g   V P                  V4       R# W0P                   P                  9  dM   V P                  P                  RRVR,          /4       V P                   P                  P                  V4       R# V P                   P                  VP                  4      '       g(   V P                  P                  RRVR,          /4       R# W0P                   P                  R,          8w  d&   V P                  P                  RRVR,          /4       V P                   P                  P                  V4      pRpV P                   P                  VR  F  pVP                  \        9   g   K  Tp M	  Vfx   V P                   P                  P                  4       pWc8w  d'   V P                   P                  P                  4       pK,  V P                   P                  P                  V4       R# V P                   P                  V^,
          ,          pV P                   P                  P                  V4      pT;r^ pV P                   P                  P                  V
4      pV^8  Edw   V^,          pV^,          pV P                   P                  V,          p
WP                   P                  9  d(   V P                   P                  P                  V
4       Kx  W8X  d   MW8X  d-   V P                   P                  P                  V
4      ^,           pV
P                  4       pVV P                   P                  V P                   P                  P                  V
4      &   VV P                   P                  V P                   P                  P                  V
4      &   Tp
V	P                  '       d   V	P                  P!                  V	4       V
P#                  V	4       T
p	EK~  V	P                  '       d   V	P                  P!                  V	4       VP                  \%        R4      9   d/   V P                   P'                  4       w  rVP)                  W4       MVP#                  V	4       VP                  4       pVP+                  V4       VP#                  V4       V P                   P                  P                  V4       V P                   P                  P-                  W4       V P                   P                  P                  V4       V P                   P                  P-                  V P                   P                  P                  V4      ^,           V4       EK  R# )z)The much-feared adoption agency algorithmr4   Nzadoption-agency-1.2zadoption-agency-4.4zadoption-agency-1.3r~   r   r   r   r   r   )r.   rV  r   r7  r4   rl  r9   r   r	  r  indexrF  r
   r  	cloneNoder/  r0  appendChildr   getTableMisnestedNodePositioninsertBeforereparentChildreninsert)r3   r   outerLoopCounterformattingElementafeIndexfurthestBlockre   commonAncestorbookmarklastNoder   innerLoopCounterr  cloner/  r  s   &&              r"   rW  InBodyPhase.endTagFormattingf  s     " ! !%		 K Kf!%"ii&<&<<YY--.?.D.DEE   ' #))*@*@@&&'<vuV}>UV		2299:KL YY--.?.D.DEE&&'<vuV}>UV %		(>(>r(BBKK**+@65QW=BYZ yy--334EFH M9911()<$$7$+M = $))004462"ii4488:G		2299'B "YY33HqLAN yy99??@QRH ,+H II**006E"Q& A% 
yy--e4yyAAAII**11$7,,#yyAAGGMPQQH( GL 		22II66<<TBD ;@ 		&&II**0068 ???OO//9  * ++H5""i0Z&[['+yy'N'N'P$##H;**84 &//1E **51 %%e, II..556GHII..55hF II""))*;<II""))		&&,,];a?Ho #r#   c                   V P                   P                  VR ,          4      '       d   V P                   P                  4        V P                   P                  R,          P                  VR ,          8w  d&   V P
                  P                  RR VR ,          /4       V P                   P                  VR ,          4      '       d   V P                   P                  P                  4       pVP                  VR ,          8w  d'   V P                   P                  P                  4       pK>  V P                   P                  4        R# R# )r4   r  Nr~   )	r.   r7  r  r   r4   r9   r   r  clearActiveFormattingElements)r3   r   re   s   && r"   endTagAppletMarqueeObject%InBodyPhase.endTagAppletMarqueeObject	  s    99##E&M22II,,.99!!"%**eFm;KK""#6v8OP99##E&M22ii,,002G,,%-/))00446II335	 3r#   c                   V P                   P                  R RRRR/4       V P                  P                  4        V P                  P	                  \        RR4      4       V P                  P                  P                  4        R# )zunexpected-end-tag-treated-asr}  rN  r  z
br elementro   N)r9   r   r.   r  r   r>  r   r  r   s   &&r"   r  InBodyPhase.endTagBr  sc    > .iN	P		557		j AB		""$r#   c                R   V P                   P                  R R R1,           EF  pVP                  VR,          8X  d   V P                   P                  VR,          R7       V P                   P                  R,          P                  VR,          8w  d&   V P                  P                  RRVR,          /4       V P                   P                  P                  4       V8w  d   K+   R # VP                  \        9   g   K  V P                  P                  RRVR,          /4        R # 	  R # )Nr4   r  r  r~   )	r.   r   r4   r  r9   r   r  rF  r
   r  s   && r"   rl  InBodyPhase.endTagOther  s    II**4R400DyyE&M)		00v0G99))"-22eFmCKK**+?&%PV-AXYii,,002d:>>_4KK**+?&%PV-AXY 1r#   r   r   r   r!   r?  rE   rR  r_  r4  xmpr   rN  r  r  r~  r  r  iframer  r   mathry   )r   )	r  r  r  r  r  r  r  r  r  )rD  articleaside
blockquotecenterdetailsdirr   dlfieldset
figcaptionfigurefooterheaderhgroupmainmenunavolr!   sectionsummaryul)r  r  )r  r  r  )bbigcodeemfontissmallstrikestrongttu)appletmarqueeobject)arearN  embedr  keygenwbr)paramsourcetrack)noembedr  )r  r  )r  r  )r   colr   framer   r   r   r   r   r   r   )rD  r  r  r  r4  r  r  dialogr  r   r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  )r  r  r  )rR  r  r  r	  r
  r  r  r_  r  r  r  r  r  r  )Cr   r   r   r   r  r6   r  r  r   r  r   r   r*  r  r  r9  r<  rA  rI  rL  rO  rY  r\  r`  rc  rg  rj  rm  rp  rt  rw  rz  r  r  r  r  r  r  r  r  r  r  r  r  rf  r8  r  r  r  r  r  r  rW  r  r  rl  r   rn  r   r  r   r  ro  r  r   r   __classcell__r   r   s   @@r"   r  r    s     ,IH
6;"'
+,C	GA'
M?',K')))	+'9:'00
'P4>'$&9.?'
4
4X'4<$404"aHF
6% -- ,/	##$,/
&		 ,/
 
,/ 
%&,/
& 
		,/ 
/*,/ 
/0,/ 
,/ 
-.,/  
'(!,/" 
i#,/$
 2	4%,/( 
),/* 
>"+,/, 
)*EF-,/. 
/,/0 
- 1,/2 
9		!3,/6 
&':;7,/8 
- 9,/: 
z;,/< 
- =,/> 
O$?,/@ 
%&A,/B 
>"C,/D 
%&E,/F 
!/2G,/H 
>"I,/J 
|$K,/L 
 -M,/N < O,/P +Q,/R
"	$S,/ ,OZ ,O++		
& (3	4 
	g	^,	-(
)*:	<	(*CD	x- M  (Mr#   r  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
]P                  ! . 4      t]]n        ]P                  ! R]	3.4      t]
]n        RtV tR	# )
	TextPhaseil  c                J    V P                   P                  VR ,          4       R# r   r   r   s   &&r"   r   TextPhase.processCharacterso  r  r#   c                   V P                   P                  R RV P                  P                  R,          P                  /4       V P                  P                  P                  4        V P                   P                  V P                   n        R# )z&expected-named-closing-tag-but-got-eofr4   Tr~   )r9   r   r.   r   r4   r  r   rP   rV   s   &r"   r   TextPhase.processEOFr  sd    G &		(>(>r(B(G(GH	J		""$ KK55r#   c                ,    Q RVR,          ,          4       h)Fz4Tried to process start tag %s in RCDATA/RAWTEXT moder4   r  r   s   &&r"   rf  TextPhase.startTagOthery  s    \LuU[}\\ur#   c                    V P                   P                  P                  4       pVP                  R 8X  g   Q hV P                  P
                  V P                  n        R# )r  N)r.   r   r  r4   r9   r   rP   r  s   && r"   endTagScriptTextPhase.endTagScript|  sB    yy%%))+yyH$$$ KK55r#   c                    V P                   P                  P                  4        V P                  P                  V P                  n        R # ri   )r.   r   r  r9   r   rP   r   s   &&r"   rl  TextPhase.endTagOther  s.    		""$ KK55r#   r  r  N)r   r   r   r   r9  r  r   r   rf  r,  rl  r   rn  r  ro  r  r   r   r   s   @r"   r$  r$  l  sh     I,]66 --b1O+O++	< -" #M'Mr#   r$  c                   Z  a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 tR
 tR tR tR tR tR tR tR tR tR t]P2                  ! R]P6                  3R]3R]3R]3R]3R]3R]3R]3R]3R]3.
4      t]]n        ]P2                  ! R]3R ]3.4      t]]n        RtV t R# )!InTablePhasei  c                    V P                   P                  R,          P                  R9  d'   V P                   P                  P                  4        KR  R# )r   Nr~   )r   r   )r.   r   r4   r  rV   s   &r"   clearStackToTableContext%InTablePhase.clearStackToTableContext  s>    ii$$R(--5FF II""&&( Gr#   c                    V P                   P                  R,          P                  R8w  d   V P                  P	                  R4       R# V P                  P
                  '       g   Q hR# )r   r   zeof-in-tableNr~   r.   r   r4   r9   r   rA   rV   s   &r"   r   InTablePhase.processEOF  sG    99!!"%**f4KK"">2;;(((((r#   c                   V P                   P                  pV P                   P                  R ,          V P                   n        W P                   P                  n        V P                   P                  P	                  V4       R# inTableTextN)r9   rP   r2   r   r   r3   r   r   s   && r"   r   #InTablePhase.processSpaceCharacters  sT    )) KK..}=*7'007r#   c                   V P                   P                  pV P                   P                  R ,          V P                   n        W P                   P                  n        V P                   P                  P	                  V4       R# r9  )r9   rP   r2   r   r   r;  s   && r"   r   InTablePhase.processCharacters  sT    )) KK..}=*7'++E2r#   c                    R V P                   n        V P                  P                  R,          P	                  V4       RV P                   n        R# )Tr   FN)r.   insertFromTabler9   r2   r   r   s   &&r"   r   InTablePhase.insertText  s9     %)		!8$66u=$)		!r#   c                   V P                  4        V P                  P                  P                  \        4       V P                  P                  V4       V P                  P                  R ,          V P                  n        R# )r   N)	r3  r.   r	  r   r   r   r9   r2   rP   r   s   &&r"   startTagCaptionInTablePhase.startTagCaption  sS    %%'		**11&9		& KK..{;r#   c                    V P                  4        V P                  P                  V4       V P                  P                  R ,          V P                  n        R# )r   Nr3  r.   r   r9   r2   rP   r   s   &&r"   startTagColgroupInTablePhase.startTagColgroup  s;    %%'		& KK..?r#   c                <    V P                  \        R R4      4       V# )r   ro   )rG  r>  r   s   &&r"   startTagColInTablePhase.startTagCol  s    oj*EFr#   c                    V P                  4        V P                  P                  V4       V P                  P                  R ,          V P                  n        R# r   NrF  r   s   &&r"   startTagRowGroupInTablePhase.startTagRowGroup  s;    %%'		& KK..}=r#   c                <    V P                  \        R R4      4       V# )r   ro   )rN  r>  r   s   &&r"   startTagImplyTbodyInTablePhase.startTagImplyTbody  s    ogzBCr#   c                    V P                   P                  R RRRR/4       V P                   P                  P                  \	        R4      4       V P                   P
                  '       g   V# R# )rS  rT  r   rU  N)r9   r   rP   r   r>  rA   r   s   &&r"   rm  InTablePhase.startTagTable  s[    E +WiI	K''(@A{{$$$L %r#   c                Z    V P                   P                  R ,          P                  V4      # r  r^  r   s   &&r"   startTagStyleScript InTablePhase.startTagStyleScript  r`  r#   c                L   R VR,          9   d   VR,          R ,          P                  \        4      R8X  d]   V P                  P                  R4       V P                  P                  V4       V P                  P                  P                  4        R# V P                  V4       R# )rt   ru   rs  z unexpected-hidden-input-in-tableN)	rc   r	   r9   r   r.   r   r   r  rf  r   s   &&r"   rt  InTablePhase.startTagInput  st    eFm#ff%//0@AXMKK""#EFII##E*II""&&(u%r#   c                F   V P                   P                  R 4       V P                  P                  fn   V P                  P	                  V4       V P                  P
                  R,          V P                  n        V P                  P
                  P                  4        R# R# )zunexpected-form-in-tableNr~   )r9   r   r.   r@  r   r   r  r   s   &&r"   rA  InTablePhase.startTagForm  sm    9:99  (II##E*$(II$:$:2$>DII!II""&&( )r#   c                    V P                   P                  R RVR,          /4       RV P                  n        V P                   P                  R,          P                  V4       RV P                  n        R# )z)unexpected-start-tag-implies-table-voodoor4   Tr   FN)r9   r   r.   r@  r2   r   r   s   &&r"   rf  InTablePhase.startTagOther  sX    JVUZ[aUbLcd$(		!8$44U;$)		!r#   c                   V P                   P                  R R R7      '       Ed   V P                   P                  4        V P                   P                  R,          P                  R 8w  dF   V P
                  P                  RRR RV P                   P                  R,          P                  /4       V P                   P                  R,          P                  R 8w  d'   V P                   P                  P                  4        KR  V P                   P                  P                  4        V P
                  P                  4        R# V P
                  P                  '       g   Q hV P
                  P                  4        R# )r   r5  zend-tag-too-early-namedr  r  Nr~   )
r.   r7  r  r   r4   r9   r   r  rR   rA   r   s   &&r"   endTagTableInTablePhase.endTagTable  s   99##GW#==II,,.yy%%b)..'9&&'@(17(6		8N8Nr8R8W8W(YZ ))((,11W<		&&**,II""&&(KK**, ;;(((((KK""$r#   c                P    V P                   P                  R RVR,          /4       R# r  r   r   s   &&r"   endTagIgnoreInTablePhase.endTagIgnore   r  r#   c                    V P                   P                  R RVR,          /4       RV P                  n        V P                   P                  R,          P                  V4       RV P                  n        R# )z'unexpected-end-tag-implies-table-voodoor4   Tr   FN)r9   r   r.   r@  r2   r   r   s   &&r"   rl  InTablePhase.endTagOther  sX    H6SXY_S`Jab$(		!8$2259$)		!r#   r   r   r   r  r   r  r?  r  Nr   r   r   )r   r   r   )r  r  )r   r   r  r   r   r   r   r   r   r   r   )!r   r   r   r   r9  r  r3  r   r   r   r   rC  rG  rJ  rN  rQ  rm  rV  rt  rA  rf  r_  rb  rl  r   rn  r   r  r  ro  r  r   r   r   s   @r"   r1  r1    s    I))83*<@
>
C&)*% N* --	##$	O$	%&		$&67	/0	- 	12	- 	/ O ,O++	+
()5	7- M
 (Mr#   r1  c                   `   a a ] tR tRt oRtV 3R ltR tR tR tR t	R t
R tR	 tR
tVtV ;t# )InTableTextPhasei   c                L   < \         \        V `
  ! V/ VB  R V n        . V n        R # ri   )r  rh  r6   r   characterTokensr  s   &*,r"   r6   InTableTextPhase.__init__#  s(    .??!!r#   c                   R P                  V P                   Uu. uF  qR,          NK  	  up4      p\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d?   R\        R,          RV/pV P                  P
                  R,          P                  V4       M#V'       d   V P                  P                  V4       . V n        R# u upi )	r(  ru   c              3   2   "   T F  q\         9  x  K  	  R # 5iri   r  )r!  r  s   & r"   r#  3InTableTextPhase.flushCharacters.<locals>.<genexpr>*  s     <tt?*t   TFrt   rm   r   N)joinrj  r%  r   r9   r2   r   r.   )r3   r  ru   r   s   &   r"   flushCharacters InTableTextPhase.flushCharacters(  s    ww1E1EF1EV1EFG3<t<333<t<<<Z5vtDEKKy)44U;II  &! Gs   Cc                \    V P                  4        V P                  V P                  n        V# ri   rq  r   r9   rP   r   s   &&r"   r   InTableTextPhase.processComment1  %     ..r#   c                \    V P                  4        V P                  V P                  n        R # rA  rt  rV   s   &r"   r   InTableTextPhase.processEOF6  s#     ..r#   c                \    VR ,          R8X  d   R# V P                   P                  V4       R# ru   r  Nrj  r   r   s   &&r"   r   "InTableTextPhase.processCharacters;  s%    =H$##E*r#   c                <    V P                   P                  V4       R # ri   r{  r   s   &&r"   r   'InTableTextPhase.processSpaceCharacters@  s    ##E*r#   c                \    V P                  4        V P                  V P                  n        V# ri   rt  r   s   &&r"   r    InTableTextPhase.processStartTagE  rv  r#   c                \    V P                  4        V P                  V P                  n        V# ri   rt  r   s   &&r"   r   InTableTextPhase.processEndTagJ  rv  r#   )rj  r   )r   rj  )r   r   r   r   r  r6   rq  r   r   r   r   r   r   r   r   r!  r"  s   @@r"   rh  rh     s7     4I"
"

+
+

 r#   rh  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 tR
 t]P                   ! R]P$                  3R]	3.4      t]
]n        ]P                   ! R]3R]3R]3.4      t]]n        RtV tR# )InCaptionPhaseiP  c                F    V P                   P                  R RR7      '       * # )r   r   r5  r.   r7  rV   s   &r"   ignoreEndTagCaption"InCaptionPhase.ignoreEndTagCaptionT  s    99++Iw+GGGr#   c                \    V P                   P                  R ,          P                  4        R# r   Nr9   r2   r   rV   s   &r"   r   InCaptionPhase.processEOFW      8$//1r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r9   r2   r   r   s   &&r"   r    InCaptionPhase.processCharactersZ  "    {{!!(+==eDDr#   c                    V P                   P                  4        V P                  4       pV P                   P                  P	                  \        R 4      4       V'       g   V# R# r   Nr9   r   r  rP   r   r>  r3   r   ignoreEndTags   && r"   startTagTableElement#InCaptionPhase.startTagTableElement]  sJ     //1''	(BCL r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r^  r   s   &&r"   rf  InCaptionPhase.startTagOthere  r`  r#   c                6   V P                  4       '       EgJ   V P                  P                  4        V P                  P                  R,          P                  R8w  dF   V P
                  P                  RRRRV P                  P                  R,          P                  /4       V P                  P                  R,          P                  R8w  d'   V P                  P                  P                  4        KR  V P                  P                  P                  4        V P                  P                  4        V P
                  P                  R,          V P
                  n
        R# V P
                  P                  '       g   Q hV P
                  P                  4        R# )r   r   r  r  r  r   Nr~   )r  r.   r  r   r4   r9   r   r  r  r2   rP   rA   r   s   &&r"   endTagCaptionInCaptionPhase.endTagCaptionh  s   ''))II,,.yy%%b)..);&&'M(19(6		8N8Nr8R8W8W(YZ ))((,11Y>		&&**,II""&&(II335 $ 2 29 =DKK ;;(((((KK""$r#   c                    V P                   P                  4        V P                  4       pV P                   P                  P	                  \        R 4      4       V'       g   V# R# r  r  r  s   && r"   r_  InCaptionPhase.endTagTablez  sJ     //1''	(BCL r#   c                P    V P                   P                  R RVR,          /4       R# r  r   r   s   &&r"   rb  InCaptionPhase.endTagIgnore  r  r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r9   r2   r   r   s   &&r"   rl  InCaptionPhase.endTagOther  "    {{!!(+99%@@r#   r   r   r   r  N	r   r  r   r   r   r   r   r   r   )
r   r  r   r   r   r   r   r   r   r   )r   r   r   r   r9  r  r  r   r   r  rf  r  r_  rb  rl  r   rn  r   r  r  ro  r  r   r   r   s   @r"   r  r  P  s     IH2EC%$NA --	##$
.	0/ O
 ,O++	M"	+
&	(- M (Mr#   r  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 t]P                  ! R
]P"                  3R]	3.4      t]
]n        ]P                  ! R]3R]3.4      t]]n        RtV tR# )InColumnGroupPhasei  c                V    V P                   P                  R,          P                  R8H  # )r   r   r~   )r.   r   r4   rV   s   &r"   ignoreEndTagColgroup'InColumnGroupPhase.ignoreEndTagColgroup  s"    yy%%b)..&88r#   c                   V P                   P                  R,          P                  R8X  d!   V P                  P                  '       g   Q hR# V P                  4       pV P                  \        R4      4       V'       g   R# R# )r   r   Nr   Tr~   )r.   r   r4   r9   rA   r  endTagColgroupr>  )r3   r  s   & r"   r   InColumnGroupPhase.processEOF  sd    99!!"%**f4;;(((((446L
 ;<  r#   c                n    V P                  4       pV P                  \        R 4      4       V'       g   V# R# r   Nr  r  r>  r  s   && r"   r   $InColumnGroupPhase.processCharacters  0    002OJ78L r#   c                    V P                   P                  V4       V P                   P                  P                  4        R VR&   R# r~  r  r   s   &&r"   rJ  InColumnGroupPhase.startTagCol  r  r#   c                n    V P                  4       pV P                  \        R 4      4       V'       g   V# R# r  r  r  s   && r"   rf   InColumnGroupPhase.startTagOther  r  r#   c                F   V P                  4       '       d;   V P                  P                  '       g   Q hV P                  P                  4        R# V P                  P
                  P                  4        V P                  P                  R ,          V P                  n        R# r   N)	r  r9   rA   r   r.   r   r  r2   rP   r   s   &&r"   r  !InColumnGroupPhase.endTagColgroup  sh    $$&&;;(((((KK""$II""&&( $ 2 29 =DKKr#   c                B    V P                   P                  R RR/4       R# )z
no-end-tagr4   r  Nr   r   s   &&r"   	endTagColInColumnGroupPhase.endTagCol  s    |fe_=r#   c                n    V P                  4       pV P                  \        R 4      4       V'       g   V# R# r  r  r  s   && r"   rl  InColumnGroupPhase.endTagOther  r  r#   r   r  r   r  N)r   r   r   r   r9  r  r  r   r   rJ  rf  r  r  rl  r   rn  r   r  r  ro  r  r   r   r   s   @r"   r  r    s     I90
>> --	##$	/ O ,O++	^$		- M (Mr#   r  c                     a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 tR
 tR tR tR t]P&                  ! R]P*                  3R]
3R]3R]3.4      t]]n        ]P&                  ! R]3R]3R]3.4      t]]n        RtV tR# )InTableBodyPhasei  c                B   V P                   P                  R,          P                  R9  d'   V P                   P                  P                  4        KR  V P                   P                  R,          P                  R8X  d!   V P                  P
                  '       g   Q hR# R# )r   r   Nr~   )r   r   r   r   )r.   r   r4   r  r9   rA   rV   s   &r"   clearStackToTableBodyContext-InTableBodyPhase.clearStackToTableBodyContext  sv    ii$$R(-- 6G G II""&&(99!!"%**f4;;((((( 5r#   c                \    V P                   P                  R ,          P                  4        R# r  r  rV   s   &r"   r   InTableBodyPhase.processEOF      9%002r#   c                Z    V P                   P                  R ,          P                  V4      # r   r  r   s   &&r"   r   'InTableBodyPhase.processSpaceCharacters  "    {{!!),CCEJJr#   c                Z    V P                   P                  R ,          P                  V4      # r  r  r   s   &&r"   r   "InTableBodyPhase.processCharacters  "    {{!!),>>uEEr#   c                    V P                  4        V P                  P                  V4       V P                  P                  R ,          V P                  n        R# )r   N)r  r.   r   r9   r2   rP   r   s   &&r"   
startTagTrInTableBodyPhase.startTagTr  s;    ))+		& KK..w7r#   c                    V P                   P                  R RVR,          /4       V P                  \        RR4      4       V# )zunexpected-cell-in-table-bodyr4   r   ro   )r9   r   r  r>  r   s   &&r"   startTagTableCell"InTableBodyPhase.startTagTableCell  s;    > &f6	8j9:r#   c                   V P                   P                  R RR7      '       gG   V P                   P                  RRR7      '       g$   V P                   P                  RRR7      '       dR   V P                  4        V P                  \	        V P                   P
                  R,          P                  4      4       V# V P                  P                  '       g   Q hV P                  P                  4        R# r   r   r5  r   r   Nr~   
r.   r7  r  endTagTableRowGroupr>  r   r4   r9   rA   r   r   s   &&r"   startTagTableOther#InTableBodyPhase.startTagTableOther  s    II$$Wg$>>II$$Wg$>>		(('(BB--/$$		 6 6r : ? ?@BL ;;(((((KK""$r#   c                Z    V P                   P                  R ,          P                  V4      # r  r^  r   s   &&r"   rf  InTableBodyPhase.startTagOther	  "    {{!!),<<UCCr#   c                h   V P                   P                  VR ,          RR7      '       dc   V P                  4        V P                   P                  P	                  4        V P
                  P                  R,          V P
                  n        R# V P
                  P                  RR VR ,          /4       R# )r4   r   r5  r    unexpected-end-tag-in-table-bodyN)	r.   r7  r  r   r  r9   r2   rP   r   r   s   &&r"   r  $InTableBodyPhase.endTagTableRowGroup  s~    99##E&M7#CC--/II""&&( $ 2 29 =DKKKK""#E$*E&M#:<r#   c                   V P                   P                  R RR7      '       gG   V P                   P                  RRR7      '       g$   V P                   P                  RRR7      '       dR   V P                  4        V P                  \	        V P                   P
                  R,          P                  4      4       V# V P                  P                  '       g   Q hV P                  P                  4        R# r  r  r   s   &&r"   r_  InTableBodyPhase.endTagTable  s    II$$Wg$>>II$$Wg$>>		(('(BB--/$$		 6 6r : ? ?@BL ;;(((((KK""$r#   c                P    V P                   P                  R RVR,          /4       R# )r  r4   Nr   r   s   &&r"   rb  InTableBodyPhase.endTagIgnore"  #    A &f6	8r#   c                Z    V P                   P                  R ,          P                  V4      # r  r  r   s   &&r"   rl  InTableBodyPhase.endTagOther&  "    {{!!),::5AAr#   r   r   r   r  Nr   r   )r   r  r   r   r   r   rf  )r   r   r  r   r   r   r   r   )r   r   r   r   r9  r  r  r   r   r   r  r  r  rf  r  r_  rb  rl  r   rn  r   r  r  ro  r  r   r   r   s   @r"   r  r    s     I)3KF8
%D<%8B --	##$	z	()	B			/ O ,O++	$&9:	+
	- M (Mr#   r  c                     a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 tR
 tR tR tR tR t]P(                  ! R]P,                  3R]3R]3.4      t]]n        ]P(                  ! R]3R]3R]3R]3.4      t]]n        RtV tR# )
InRowPhasei;  c                0   V P                   P                  R,          P                  R9  dj   V P                  P	                  RRV P                   P                  R,          P                  /4       V P                   P                  P                  4        K  R# )r   z'unexpected-implied-end-tag-in-table-rowr4   Nr~   )r   r   )r.   r   r4   r9   r   r  rV   s   &r"   clearStackToTableRowContext&InRowPhase.clearStackToTableRowContext@  sn    ii$$R(--^CKK""#L$*DII,B,B2,F,K,K#LNII""&&( Dr#   c                F    V P                   P                  R RR7      '       * # )r   r   r5  r  rV   s   &r"   ignoreEndTagTrInRowPhase.ignoreEndTagTrF  s    99++D'+BBBr#   c                \    V P                   P                  R ,          P                  4        R# r  r  rV   s   &r"   r   InRowPhase.processEOFJ  r  r#   c                Z    V P                   P                  R ,          P                  V4      # r  r  r   s   &&r"   r   !InRowPhase.processSpaceCharactersM  r  r#   c                Z    V P                   P                  R ,          P                  V4      # r  r  r   s   &&r"   r   InRowPhase.processCharactersP  r  r#   c                   V P                  4        V P                  P                  V4       V P                  P                  R ,          V P                  n        V P                  P                  P                  \        4       R# )r   N)	r  r.   r   r9   r2   rP   r	  r   r   r   s   &&r"   r  InRowPhase.startTagTableCellS  sS    ((*		& KK..x8		**11&9r#   c                n    V P                  4       pV P                  \        R 4      4       V'       g   V# R# r   Nr  endTagTrr>  r  s   && r"   r  InRowPhase.startTagTableOtherY  s.    **,od+,L r#   c                Z    V P                   P                  R ,          P                  V4      # r  r^  r   s   &&r"   rf  InRowPhase.startTagOther`  r  r#   c                f   V P                  4       '       gc   V P                  4        V P                  P                  P	                  4        V P
                  P                  R ,          V P
                  n        R# V P
                  P                  '       g   Q hV P
                  P                  4        R# rM  )
r  r  r.   r   r  r9   r2   rP   rA   r   r   s   &&r"   r  InRowPhase.endTagTrc  sv    ""$$,,.II""&&( $ 2 2= ADKK ;;(((((KK""$r#   c                n    V P                  4       pV P                  \        R 4      4       V'       g   V# R# r  r  r  s   && r"   r_  InRowPhase.endTagTablem  s0    **,od+, L r#   c                    V P                   P                  VR ,          RR7      '       d   V P                  \        R4      4       V# V P                  P                  4        R# )r4   r   r5  r   N)r.   r7  r  r>  r9   r   r   s   &&r"   r  InRowPhase.endTagTableRowGroupu  sF    99##E&M7#CCMM/$/0LKK""$r#   c                P    V P                   P                  R RVR,          /4       R# )zunexpected-end-tag-in-table-rowr4   Nr   r   s   &&r"   rb  InRowPhase.endTagIgnore|  s#    @ &f6	8r#   c                Z    V P                   P                  R ,          P                  V4      # r  r  r   s   &&r"   rl  InRowPhase.endTagOther  r  r#   r   r   r   r  Nr  )r   r  r   r   r   r   r   rf  )r   r   r  r   r   r   r   )r   r   r   r   r9  r  r  r  r   r   r   r  r  rf  r  r_  r  rb  rl  r   rn  r   r  r  ro  r  r   r   r   s   @r"   r  r  ;  s     I)C3KF:D%%8B --	##$	()
#	%/ O ,O++	x	+	$&9:	C			- M (Mr#   r  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 tR
 t]P                   ! R]P$                  3R]	3.4      t]
]n        ]P                   ! R]3R]3R]3.4      t]]n        RtV tR# )InCellPhasei  c                   V P                   P                  R RR7      '       d   V P                  \        R 4      4       R# V P                   P                  RRR7      '       d   V P                  \        R4      4       R# R# r   r   r5  r   N)r.   r7  endTagTableCellr>  rV   s   &r"   	closeCellInCellPhase.closeCell  sa    99##D'#::  !67YY%%dG%<<  !67 =r#   c                \    V P                   P                  R ,          P                  4        R# r  r  rV   s   &r"   r   InCellPhase.processEOF  r  r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r  r   s   &&r"   r   InCellPhase.processCharacters  r  r#   c                &   V P                   P                  R RR7      '       g$   V P                   P                  RRR7      '       d   V P                  4        V# V P                  P                  '       g   Q hV P                  P                  4        R# r  )r.   r7  r  r9   rA   r   r   s   &&r"   r  InCellPhase.startTagTableOther  sm    II$$T7$;;		((w(??NNL ;;(((((KK""$r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r^  r   s   &&r"   rf  InCellPhase.startTagOther  r`  r#   c                   V P                   P                  VR ,          RR7      '       Ed'   V P                   P                  VR ,          4       V P                   P                  R,          P                  VR ,          8w  df   V P
                  P                  RR VR ,          /4        V P                   P                  P                  4       pVP                  VR ,          8X  g   K?  M$V P                   P                  P                  4        V P                   P                  4        V P
                  P                  R,          V P
                  n
        R# V P
                  P                  RR VR ,          /4       R# )r4   r   r5  zunexpected-cell-end-tagr   r  Nr~   )r.   r7  r  r   r4   r9   r   r  r  r2   rP   r  s   && r"   r  InCellPhase.endTagTableCell  s   99##E&M7#CCII,,U6];yy%%b)..%-?&&'@(.f'>@9911557DyyE&M1		&&**,II335 $ 2 27 ;DKKKK""#7&%-9PQr#   c                P    V P                   P                  R RVR,          /4       R# r  r   r   s   &&r"   rb  InCellPhase.endTagIgnore  r  r#   c                    V P                   P                  VR ,          RR7      '       d   V P                  4        V# V P                  P	                  4        R# )r4   r   r5  N)r.   r7  r  r9   r   r   s   &&r"   endTagImplyInCellPhase.endTagImply  sA    99##E&M7#CCNNL KK""$r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r  r   s   &&r"   rl  InCellPhase.endTagOther  r  r#   r   r  Nr  r  )r   r   r  r   r   r  )r   r   r   r   r9  r  r  r   r   r  rf  r  rb  r  rl  r   rn  r   r  r  ro  r  r   r   r   s   @r"   r  r    s     I82E%CR"N%A --	##$
,	./ O
 ,O++	'	7F	3[A- M
 (Mr#   r  c            	       $  a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 tR
 tR tR tR t]P&                  ! R]P*                  3R]3R]	3R]
3R]3R]3.4      t]]n        ]P&                  ! R]3R]3R]3.4      t]]n        RtV tR# )InSelectPhasei  c                    V P                   P                  R,          P                  R8w  d   V P                  P	                  R4       R# V P                  P
                  '       g   Q hR# )r   r   zeof-in-selectNr~   r6  rV   s   &r"   r   InSelectPhase.processEOF  sG    99!!"%**f4KK""?3;;(((((r#   c                j    VR ,          R8X  d   R# V P                   P                  VR ,          4       R# rz  r   r   s   &&r"   r   InSelectPhase.processCharacters  s'    =H$		U6]+r#   c                    V P                   P                  R,          P                  R8X  d%   V P                   P                  P                  4        V P                   P	                  V4       R# r  r.   r   r4   r  r   r   s   &&r"   startTagOptionInSelectPhase.startTagOption  sG    99!!"%**h6II""&&(		&r#   c                |   V P                   P                  R,          P                  R8X  d%   V P                   P                  P                  4        V P                   P                  R,          P                  R8X  d%   V P                   P                  P                  4        V P                   P	                  V4       R# )r   r  r  Nr~   r*  r   s   &&r"   startTagOptgroupInSelectPhase.startTagOptgroup  sz    99!!"%**h6II""&&(99!!"%**j8II""&&(		&r#   c                p    V P                   P                  R 4       V P                  \        R4      4       R# )zunexpected-select-in-selectr   N)r9   r   endTagSelectr>  r   s   &&r"   r  InSelectPhase.startTagSelect  s(    <=/(34r#   c                    V P                   P                  R 4       V P                  P                  RRR7      '       d   V P	                  \        R4      4       V# V P                   P                  '       g   Q hR# )zunexpected-input-in-selectr   r5  N)r9   r   r.   r7  r1  r>  rA   r   s   &&r"   rt  InSelectPhase.startTagInput	  s]    ;<99##Hh#??oh78L;;(((((r#   c                Z    V P                   P                  R ,          P                  V4      # r  r^  r   s   &&r"   r  InSelectPhase.startTagScript
	  r`  r#   c                P    V P                   P                  R RVR,          /4       R# )zunexpected-start-tag-in-selectr4   Nr   r   s   &&r"   rf  InSelectPhase.startTagOther	  #    ? &f6	8r#   c                    V P                   P                  R,          P                  R8X  d'   V P                   P                  P                  4        R# V P                  P                  RRR/4       R# )r   r  unexpected-end-tag-in-selectr4   Nr~   r.   r   r4   r  r9   r   r   s   &&r"   endTagOptionInSelectPhase.endTagOption	  sR    99!!"%**h6II""&&(KK""#A$*H#57r#   c                   V P                   P                  R,          P                  R8X  dQ   V P                   P                  R,          P                  R8X  d%   V P                   P                  P                  4        V P                   P                  R,          P                  R8X  d'   V P                   P                  P                  4        R# V P                  P                  RRR/4       R# )r   r  r  r;  r4   Nr~   r<  r   s   &&r"   endTagOptgroupInSelectPhase.endTagOptgroup	  s    II""2&++x7		&&r*//:=II""&&(99!!"%**j8II""&&( KK""#A$*J#79r#   c                   V P                   P                  R R R7      '       dx   V P                   P                  P                  4       pVP                  R 8w  d'   V P                   P                  P                  4       pK7  V P
                  P                  4        R# V P
                  P                  '       g   Q hV P
                  P                  4        R# )r   r5  N)	r.   r7  r   r  r4   r9   rR   rA   r   r  s   && r"   r1  InSelectPhase.endTagSelect%	  s    99##Hh#??99))--/D))x'yy--113KK**, ;;(((((KK""$r#   c                P    V P                   P                  R RVR,          /4       R# )r;  r4   Nr   r   s   &&r"   rl  InSelectPhase.endTagOther0	  #    = &f6	8r#   r   r  r  r   r  r  N)r  r  r  )r   r   r   r   r9  r  r   r   r+  r.  r  rt  r  rf  r=  rA  r1  rl  r   rn  r   r  r  ro  r  r   r   r   s   @r"   r$  r$    s     I),
''5)C879	%8 --	##$	>"	%&	>"	(-8	>"/ O ,O++	< 	^$	< - M
 (Mr#   r$  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R t]P                  ! R
]3.4      t]	]n        ]P                  ! R
]
3.4      t]]n        RtV tR	# )InSelectInTablePhaseiF	  c                \    V P                   P                  R ,          P                  4        R# )r   Nr  rV   s   &r"   r   InSelectInTablePhase.processEOFI	  s    :&113r#   c                Z    V P                   P                  R ,          P                  V4      # r   r  r   s   &&r"   r   &InSelectInTablePhase.processCharactersL	  s"    {{!!*-??FFr#   c                    V P                   P                  R RVR,          /4       V P                  \        R4      4       V# )z5unexpected-table-element-start-tag-in-select-in-tabler4   r   )r9   r   rl  r>  r   s   &&r"   rm  "InSelectInTablePhase.startTagTableO	  s<    VY_afgmanXop23r#   c                Z    V P                   P                  R ,          P                  V4      # rM  r^  r   s   &&r"   rf  "InSelectInTablePhase.startTagOtherT	  s"    {{!!*-==eDDr#   c                    V P                   P                  R RVR,          /4       V P                  P                  VR,          RR7      '       d   V P	                  \        R4      4       V# R# )z3unexpected-table-element-end-tag-in-select-in-tabler4   r   r5  r   N)r9   r   r.   r7  rl  r>  r   s   &&r"   r_   InSelectInTablePhase.endTagTableW	  s`    TW]_dek_lVmn99##E&M7#CC_X67L Dr#   c                Z    V P                   P                  R ,          P                  V4      # rM  r  r   s   &&r"   rl   InSelectInTablePhase.endTagOther]	  s"    {{!!*-;;EBBr#   r  N)r   r   r   r   r   r   r   r   )r   r   r   r   r9  r  r   r   rm  rf  r_  rl  r   rn  r  ro  r  r   r   r   s   @r"   rI  rI  F	  s     I4G
EC --	J		/ O ,O++	J		- M (Mr#   rI  c                     a  ] tR tRt o ]! 4       t]! . RNRNRNRNRNRNRNR	NR
NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*NR+NR,NR-N4      tR. tR/ t	R0 t
R1 tR2tV tR3# )4InForeignContentPhaseim	  r  r  r  r   rN  r  r	  r  r   r  r  r
  r  h1h2h3h4h5h6r   r  r  r  r  r  r  r  r_  r  r!   r  r  r  r  spanr  r  subsupr   r  r  r  varc                *   / R RbRRbRRbRRbRR	bR
RbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbR R!b/ R"R#bR$R%bR&R'bR(R)bR*R+bR,R-bR.R/bR0R1bR2R3bR4R5bR6R7bR8R9bR:R;bR<R=bR>R?bR@RAbRBRCbCRDRERFRG/CpVRH,          V9   d   W!RH,          ,          VRH&   RI# RI# )JaltglyphaltGlyphaltglyphdefaltGlyphDefaltglyphitemaltGlyphItemanimatecoloranimateColoranimatemotionanimateMotionanimatetransformanimateTransformclippathclipPathfeblendfeBlendfecolormatrixfeColorMatrixfecomponenttransferfeComponentTransferfecompositefeCompositefeconvolvematrixfeConvolveMatrixfediffuselightingfeDiffuseLightingfedisplacementmapfeDisplacementMapfedistantlightfeDistantLightfefloodfeFloodfefuncafeFuncAfefuncbfeFuncBfefuncgfeFuncGfefuncrfeFuncRfegaussianblurfeGaussianBlurfeimagefeImagefemergefeMergefemergenodefeMergeNodefemorphologyfeMorphologyfeoffsetfeOffsetfepointlightfePointLightfespecularlightingfeSpecularLightingfespotlightfeSpotLightfetilefeTilefeturbulencefeTurbulenceforeignobjectforeignObjectglyphrefglyphReflineargradientlinearGradientradialgradientradialGradienttextpathtextPathr4   Nr  )r3   r   replacementss   && r"   adjustSVGTagNames'InForeignContentPhase.adjustSVGTagNamesy	  s   #0
J #0%}#0&#0 '#0 (	#0
 +,>#0 #J#0 "9#0 (#0 ./D#0 &}#0 +,>#0 ,-@#0 ,-@#0 )*:#0 "9#0  "9!#0" "9##0$ "9%#0& "9'#0( )*:)#0* "9+#0, "9-#0. &}/#00 '1#02 #J3#04 '5#06 -.B7#08 &}9#0: !(;#0< '=#0> (?#0@ #JA#0B )*:C#0D )*:"JG#0J =L((v7E&M )r#   c                B   VR ,          R8X  d   RVR &   MuV P                   P                  '       dZ   \        ;QJ d#    R VR ,           4       F  '       g   K   RM	  RM! R VR ,           4       4      '       d   RV P                   n        \        P	                  W4       R# )ru   r  u   �c              3   2   "   T F  q\         9  x  K  	  R # 5iri   r  r   s   & r"   r#  :InForeignContentPhase.processCharacters.<locals>.<genexpr>	  s     H-$o--ro  TFN)r9   rU   r%  r   r   r   s   &&r"   r   'InForeignContentPhase.processCharacters	  sj    =H$$E&Mkk$$$cH%-HcccH%-HHH%*DKK",r#   c                   V P                   P                  R,          pVR,          V P                  9   g@   VR,          R8X  Ed6   \        VR,          P	                  4       4      0 Rm,          '       Ed   V P
                  P                  RRVR,          /4       V P                   P                  R,          P                  V P                   P                  8w  d   V P
                  P                  V P                   P                  R,          4      '       gc   V P
                  P                  V P                   P                  R,          4      '       g'   V P                   P                  P                  4        K  V# VP                  \        R,          8X  d   V P
                  P                  V4       MHVP                  \        R,          8X  d-   V P                  V4       V P
                  P                  V4       V P
                  P!                  V4       VP                  VR&   V P                   P#                  V4       VR,          '       d,   V P                   P                  P                  4        R	VR
&   R# R# )r   r4   r  ru   z*unexpected-html-element-in-foreign-contentr_   ry   ra   r|   Tr}   Nr~   >   facesizecolor)r.   r   breakoutElementssetkeysr9   r   ra   r   rf   rj   r  r   r   r  r   r   r   )r3   r   r   s   && r"   r   %InForeignContentPhase.processStartTag	  s   ii,,R0&MT2226]f$v##%&)BBBKK""#O$*E&M#:<99))"-7799--.{{99$)):P:PQS:TUU{{??		@V@VWY@Z[[		&&**,L $$
8(<<2259&&*U*;;&&u-//6KK//6!,!6!6E+II##E*]##		&&**,37/0 $r#   c                   \        V P                  P                  4      ^,
          pV P                  P                  R,          pVP                  P	                  \
        4      VR,          8w  d&   V P                  P                  RRVR,          /4        VP                  P	                  \
        4      VR,          8X  d   V P                  P                  V P                  P                  R,          8X  dT   V P                  P                  P                  4        V P                  P                  P                  V P                  n        V P                  P                  P                  4       V8w  d!   V P                  P                  '       d   KG  Q hRp V# V^,          pV P                  P                  V,          pVP                  V P                  P                  8w  d   EKQ  V P                  P                  P                  V4      p V# )r   r4   r  r:  Nr~   )r   r.   r   r4   rc   r	   r9   r   rP   r2   rq  r   r  ra   r   r   )r3   r   	nodeIndexr   r   s   &&   r"   r   #InForeignContentPhase.processEndTag	  sw   		../!3	yy%%b)99/0E&MAKK""#7&%-9PQyy""#34fE;;$$(:(:=(IIKK%%557(,(9(9(G(GDKK%ii,,002d:9911111 	  NI99)))4D~~!;!;; KK--;;EB	r#   r  N)r   r   r   r   r9  r  r   r  r  r   r   r   r   r   r   s   @r"   rX  rX  m	  s    I  "C# "Cu "Cl "CF "CD "C"*"C,2"C48"C:?"CAE"CGK"C"&"C(/"C15"C7;"C=A"C #'"C )-"C /3"C 5;"C =A"C CF"C HM"C #'	"C )2	"C 4:	"C <B	"C DJ	"C
 #'"C
 ),"C
 .3"C
 5;"C
 =@"C
 BI"C #)"C +3"C 5="C ?D"C FK"C #*"C ,0"C 25"C 7;"C =B"C D'8R-86 r#   rX  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR t]P                  ! R	]	3.4      t]
]n        ]P                  ! R	]3.4      t]]n        R
tV tR# )AfterBodyPhasei	  c                    R # ri   r  rV   s   &r"   r   AfterBodyPhase.processEOF	      r#   c                r    V P                   P                  WP                   P                  ^ ,          4       R# )    Nr   r   s   &&r"   r   AfterBodyPhase.processComment	  s%     			yy'='=a'@Ar#   c                    V P                   P                  R 4       V P                   P                  R,          V P                   n        V# )zunexpected-char-after-bodyr   r9   r   r2   rP   r   s   &&r"   r    AfterBodyPhase.processCharacters	  s5    ;< KK..x8r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r^  r   s   &&r"   r  AfterBodyPhase.startTagHtml	  r`  r#   c                    V P                   P                  R RVR,          /4       V P                   P                  R,          V P                   n        V# )zunexpected-start-tag-after-bodyr4   r   r  r   s   &&r"   rf  AfterBodyPhase.startTagOther	  sC    @ &f6	8 KK..x8r#   c                    V P                   P                  '       d   V P                   P                  R 4       R# V P                   P                  R,          V P                   n        R# )z'unexpected-end-tag-after-body-innerhtmlafterAfterBodyN)r9   rA   r   r2   rP   )r3   r4   s   &&r"   r  AfterBodyPhase.endTagHtml	  sA    ;;   KK""#LM $ 2 23C DDKKr#   c                    V P                   P                  R RVR,          /4       V P                   P                  R,          V P                   n        V# )zunexpected-end-tag-after-bodyr4   r   r  r   s   &&r"   rl  AfterBodyPhase.endTagOther 
  sC    > &f6	8 KK..x8r#   r   r  N)r   r   r   r   r9  r  r   r   r   r  rf  r  rl  r   rn  r  ro  r  r   r   r   s   @r"   r  r  	  s~     IB

CE --	/ O ,O++fj-A,BCM'Mr#   r  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 t]P                  ! R
]P"                  3R]3R]	3R]
3.4      t]]n        ]P                  ! R]3.4      t]]n        RtV tR# )InFramesetPhasei
  c                    V P                   P                  R,          P                  R8w  d   V P                  P	                  R4       R# V P                  P
                  '       g   Q hR# )r   r   zeof-in-framesetNr~   r6  rV   s   &r"   r   InFramesetPhase.processEOF
  sH    99!!"%**f4KK""#45;;(((((r#   c                <    V P                   P                  R 4       R# )zunexpected-char-in-framesetNr   r   s   &&r"   r   !InFramesetPhase.processCharacters
  s    <=r#   c                <    V P                   P                  V4       R # ri   )r.   r   r   s   &&r"   r   InFramesetPhase.startTagFrameset
  s    		&r#   c                    V P                   P                  V4       V P                   P                  P                  4        R # ri   r  r   s   &&r"   startTagFrameInFramesetPhase.startTagFrame
  s*    		&		""$r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r^  r   s   &&r"   startTagNoframes InFramesetPhase.startTagNoframes#
  r`  r#   c                P    V P                   P                  R RVR,          /4       R# )z unexpected-start-tag-in-framesetr4   Nr   r   s   &&r"   rf  InFramesetPhase.startTagOther&
  r  r#   c                   V P                   P                  R,          P                  R8X  d   V P                  P	                  R4       M$V P                   P                  P                  4        V P                  P                  '       g]   V P                   P                  R,          P                  R8w  d/   V P                  P                  R,          V P                  n        R# R# R# )r   r   z)unexpected-frameset-in-frameset-innerhtmlr   afterFramesetNr~   )	r.   r   r4   r9   r   r  rA   r2   rP   r   s   &&r"   endTagFramesetInFramesetPhase.endTagFrameset*
  s    99!!"%**f4KK""#NOII""&&(%%%		&&r*//:= !% 2 2? CDKK > &r#   c                P    V P                   P                  R RVR,          /4       R# )zunexpected-end-tag-in-framesetr4   Nr   r   s   &&r"   rl  InFramesetPhase.endTagOther6
  r9  r#   r   r   r  r  r  N)r   r   r   r   r9  r  r   r   r  r  r  rf  r  rl  r   rn  r   r  r  ro  r  r   r   r   s   @r"   r  r  
  s     I)>'%C8
D8 --	##$	%&	- 	%&	/ O ,O++	^$- M (Mr#   r  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R t]P                  ! R]P                  3R	]3.4      t]	]n        ]P                  ! R]
3.4      t]]n        R
tV tR# )AfterFramesetPhaseiH
  c                    R # ri   r  rV   s   &r"   r   AfterFramesetPhase.processEOFL
  r  r#   c                <    V P                   P                  R 4       R# )zunexpected-char-after-framesetNr   r   s   &&r"   r   $AfterFramesetPhase.processCharactersP
  s    ?@r#   c                Z    V P                   P                  R ,          P                  V4      # r  r^  r   s   &&r"   r  #AfterFramesetPhase.startTagNoframesS
  r`  r#   c                P    V P                   P                  R RVR,          /4       R# )z#unexpected-start-tag-after-framesetr4   Nr   r   s   &&r"   rf   AfterFramesetPhase.startTagOtherV
  s#    D &f6	8r#   c                ^    V P                   P                  R ,          V P                   n        R# )afterAfterFramesetN)r9   r2   rP   r   s   &&r"   r  AfterFramesetPhase.endTagHtmlZ
  s     KK../CDr#   c                P    V P                   P                  R RVR,          /4       R# )z!unexpected-end-tag-after-framesetr4   Nr   r   s   &&r"   rl  AfterFramesetPhase.endTagOther]
  s#    B &f6	8r#   r   r  r  N)r   r   r   r   r9  r  r   r   r  rf  r  rl  r   rn  r   r  r  ro  r  r   r   r   s   @r"   r  r  H
  s     IAC8E8 --	##$	%&/ O ,O++	- M (Mr#   r  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR t]P                  ! R	]
3.4      t]]n        R
tV tR# )AfterAfterBodyPhaseim
  c                    R # ri   r  rV   s   &r"   r   AfterAfterBodyPhase.processEOFp
  r  r#   c                d    V P                   P                  WP                   P                  4       R # ri   r   r   s   &&r"   r   "AfterAfterBodyPhase.processComments
  r#  r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r  r   s   &&r"   r   *AfterAfterBodyPhase.processSpaceCharactersv
  r  r#   c                    V P                   P                  R 4       V P                   P                  R,          V P                   n        V# )expected-eof-but-got-charr   r  r   s   &&r"   r   %AfterAfterBodyPhase.processCharactersy
  s5    :; KK..x8r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r^  r   s   &&r"   r   AfterAfterBodyPhase.startTagHtml~
  r`  r#   c                    V P                   P                  R RVR,          /4       V P                   P                  R,          V P                   n        V# )expected-eof-but-got-start-tagr4   r   r  r   s   &&r"   rf  !AfterAfterBodyPhase.startTagOther
  sC    ? &f6	8 KK..x8r#   c                    V P                   P                  R RVR,          /4       V P                   P                  R,          V P                   n        V# )expected-eof-but-got-end-tagr4   r   r  r   s   &&r"   r   !AfterAfterBodyPhase.processEndTag
  sC    = &f6	8 KK..x8r#   r   r  N)r   r   r   r   r9  r  r   r   r   r   r  rf  r   r   rn  r  ro  r   r   r   s   @r"   r  r  m
  s]     I;J
C --	/ O ,Or#   r  c                      a  ] tR tRt o ]! 4       tR tR tR tR t	R t
R tR tR	 t]P                  ! R
]
3R]3.4      t]]n        RtV tR# )AfterAfterFramesetPhasei
  c                    R # ri   r  rV   s   &r"   r   "AfterAfterFramesetPhase.processEOF
  r  r#   c                d    V P                   P                  WP                   P                  4       R # ri   r   r   s   &&r"   r   &AfterAfterFramesetPhase.processComment
  r#  r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r  r   s   &&r"   r   .AfterAfterFramesetPhase.processSpaceCharacters
  r  r#   c                <    V P                   P                  R 4       R# )r   Nr   r   s   &&r"   r   )AfterAfterFramesetPhase.processCharacters
  s    :;r#   c                Z    V P                   P                  R ,          P                  V4      # r]  r^  r   s   &&r"   r  $AfterAfterFramesetPhase.startTagHtml
  r`  r#   c                Z    V P                   P                  R ,          P                  V4      # r  r^  r   s   &&r"   startTagNoFrames(AfterAfterFramesetPhase.startTagNoFrames
  r`  r#   c                P    V P                   P                  R RVR,          /4       R# )r  r4   Nr   r   s   &&r"   rf  %AfterAfterFramesetPhase.startTagOther
  r9  r#   c                P    V P                   P                  R RVR,          /4       R# )r  r4   Nr   r   s   &&r"   r   %AfterAfterFramesetPhase.processEndTag
  rG  r#   r   r  r  N)r   r   r   r   r9  r  r   r   r   r   r  r  rf  r   r   rn  r  ro  r   r   r   s   @r"   r  r  
  sl     I;J<CC88 --		%&/ O ,Or#   r  rG   rF   r   rb  r  r  r   r   r   r:  r   r   r   r   r   r   r  rz   r  r   r  r  r  c                    a V R ,          P                  4       SP                  4       ,          pV'       d=   \        V R ,          4      ! V3R lV R ,          P                  4        4       4      V R &   R# R# )ru   c              3   N   <"   T F  w  rSP                  W4      V3x  K  	  R # 5iri   )r   )r!  kvr  s   &  r"   r#  $adjust_attributes.<locals>.<genexpr>
  s+      ,O8M .:-=-=a-CQ,G8Ms   "%N)r  rt   r1   )r   r  needs_adjustments   &f r"   r   r   
  s`    V}))+l.?.?.AAU6]+ ,O8=f8K8K8M,O Of r#   Nc                 8    Vf   / pR\         V,          RV RVRV/# )Nrt   r4   ru   r|   )r   )r4   rt   rb   r|   s   &&&&r"   r>  r>  
  s.    
Jt$fdFJ;( (r#   c                       ] tR tRtRtRtR# )rs   i
  zError in parsed documentr  N)r   r   r   r   r   r   r  r#   r"   rs   rs   
  s    "r#   rs   )r)   T)r   r)   T)rp   NF)8r(  r   r   r   treebuilders.baser   r   	constantsr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r&   r   r   r  r;  rQ  rq  r  r  r  r$  r1  rh  r  r  r  r  r  r$  rI  rX  r  r  r  r  r  r0   r   r>  	Exceptionrs   r  r#   r"   <module>r(     s      % 
 
 
 
 
".?2E) E)P
F FR@5 @F#e #L+(e +(\d(% d(N=(% =(@@(U @(FR(% R(j( (DO(5 O(d-u -`D(U D(N>( >(B`(u `(FW( W(tJ(% J(Za(E a(H$(5 $(NpE pf,(U ,(^6(e 6(r"( "(J#,% #,L!,e !,L|/ / k	
 )  k I | #  ' # Z k  !" +#$ -/')1/8O(	 	r#   