Skip to content

Commit b036bb6

Browse files
committed
Update the compatMode in the right place
--HG-- branch : svgmathml
1 parent 8d2f6b0 commit b036bb6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/html5lib/html5parser.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ class InitialPhase(Phase):
428428
# this.
429429
def processEOF(self):
430430
self.parser.parseError("expected-doctype-but-got-eof")
431-
self.compatMode = "quirks"
431+
self.parser.compatMode = "quirks"
432432
self.parser.phase = self.parser.phases["beforeHtml"]
433433
self.parser.phase.processEOF()
434434

@@ -533,15 +533,15 @@ def processDoctype(self, token):
533533
systemId == None)
534534
or (systemId != None and
535535
systemId == "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd")):
536-
self.compatMode = "quirks"
536+
self.parser.compatMode = "quirks"
537537
elif (publicId in
538538
("-//w3c//dtd xhtml 1.0 frameset//EN",
539539
"-//w3c//dtd xhtml 1.0 transitional//EN")
540540
or (publicId in
541541
("-//w3c//dtd html 4.01 frameset//EN",
542542
"-//w3c//dtd html 4.01 transitional//EN") and
543543
systemId == None)):
544-
self.compatMode = "limited quirks"
544+
self.parser.compatMode = "limited quirks"
545545

546546
self.parser.phase = self.parser.phases["beforeHtml"]
547547

@@ -550,21 +550,21 @@ def processSpaceCharacters(self, token):
550550

551551
def processCharacters(self, token):
552552
self.parser.parseError("expected-doctype-but-got-chars")
553-
self.compatMode = "quirks"
553+
self.parser.compatMode = "quirks"
554554
self.parser.phase = self.parser.phases["beforeHtml"]
555555
self.parser.phase.processCharacters(token)
556556

557557
def processStartTag(self, token):
558558
self.parser.parseError("expected-doctype-but-got-start-tag",
559559
{"name": token["name"]})
560-
self.compatMode = "quirks"
560+
self.parser.compatMode = "quirks"
561561
self.parser.phase = self.parser.phases["beforeHtml"]
562562
self.parser.phase.processStartTag(token)
563563

564564
def processEndTag(self, token):
565565
self.parser.parseError("expected-doctype-but-got-end-tag",
566566
{"name": token["name"]})
567-
self.compatMode = "quirks"
567+
self.parser.compatMode = "quirks"
568568
self.parser.phase = self.parser.phases["beforeHtml"]
569569
self.parser.phase.processEndTag(token)
570570

0 commit comments

Comments
 (0)