HTML: Add spec comments to algorithms and improve correctness

This commit is contained in:
networkException 2022-01-06 23:39:12 +01:00
parent fbaae88b65
commit 933bbb2804
Signed by: networkException
GPG key ID: E3877443AE684391
3 changed files with 708 additions and 52 deletions

View file

@ -17,4 +17,5 @@ export type ParseError = 'unexpected-null-character' |
'abrupt-closing-of-empty-comment' | 'abrupt-closing-of-empty-comment' |
'eof-in-comment' | 'eof-in-comment' |
'missing-semicolon-after-character-reference' | 'missing-semicolon-after-character-reference' |
'unknown-named-character-reference'; 'unknown-named-character-reference' |
'missing-doctype-name';

File diff suppressed because it is too large Load diff

View file

@ -26,6 +26,10 @@ export class DOCTYPEToken extends Token {
this.appendToName(REPLACEMENT_CHARACTER); this.appendToName(REPLACEMENT_CHARACTER);
} }
public setForceQuirks(): void {
this.forceQuirks = true;
}
public static createWithForcedQuirks(): DOCTYPEToken { public static createWithForcedQuirks(): DOCTYPEToken {
return new DOCTYPEToken(undefined, undefined, undefined, true); return new DOCTYPEToken(undefined, undefined, undefined, true);
} }
@ -34,6 +38,10 @@ export class DOCTYPEToken extends Token {
return new DOCTYPEToken(name, undefined, undefined, undefined); return new DOCTYPEToken(name, undefined, undefined, undefined);
} }
public static createWithReplacementCharacter(): DOCTYPEToken {
return new DOCTYPEToken(REPLACEMENT_CHARACTER, undefined, undefined, undefined);
}
public override inspect(indent: number): string { public override inspect(indent: number): string {
return `DOCTYPEToken { '${this.name}' }`; return `DOCTYPEToken { '${this.name}' }`;
} }