void read(Tokeniser t, CharacterReader r) {
   char c = r.consume();
   switch (c) {
     case '\t':
     case '\n':
     case '\r':
     case '\f':
     case ' ':
       break;
     case '"':
       // set system id to empty string
       t.transition(DoctypeSystemIdentifier_doubleQuoted);
       break;
     case '\'':
       // set public id to empty string
       t.transition(DoctypeSystemIdentifier_singleQuoted);
       break;
     case '>':
       t.error(this);
       t.doctypePending.forceQuirks = true;
       t.emitDoctypePending();
       t.transition(Data);
       break;
     case eof:
       t.eofError(this);
       t.doctypePending.forceQuirks = true;
       t.emitDoctypePending();
       t.transition(Data);
       break;
     default:
       t.error(this);
       t.doctypePending.forceQuirks = true;
       t.transition(BogusDoctype);
   }
 }
 void read(Tokeniser t, CharacterReader r) {
   if (r.matchesLetter()) {
     t.createDoctypePending();
     t.transition(DoctypeName);
     return;
   }
   char c = r.consume();
   switch (c) {
     case '\t':
     case '\n':
     case '\r':
     case '\f':
     case ' ':
       break; // ignore whitespace
     case nullChar:
       t.error(this);
       t.doctypePending.name.append(replacementChar);
       t.transition(DoctypeName);
       break;
     case eof:
       t.eofError(this);
       t.createDoctypePending();
       t.doctypePending.forceQuirks = true;
       t.emitDoctypePending();
       t.transition(Data);
       break;
     default:
       t.createDoctypePending();
       t.doctypePending.name.append(c);
       t.transition(DoctypeName);
   }
 }
 void read(Tokeniser t, CharacterReader r) {
   char c = r.consume();
   switch (c) {
     case '\t':
     case '\n':
     case '\r':
     case '\f':
     case ' ':
       break;
     case '>':
       t.emitDoctypePending();
       t.transition(Data);
       break;
     case eof:
       t.eofError(this);
       t.doctypePending.forceQuirks = true;
       t.emitDoctypePending();
       t.transition(Data);
       break;
     default:
       t.error(this);
       t.transition(BogusDoctype);
       // NOT force quirks
   }
 }
 void read(Tokeniser t, CharacterReader r) {
   char c = r.consume();
   switch (c) {
     case '\'':
       t.transition(AfterDoctypeSystemIdentifier);
       break;
     case nullChar:
       t.error(this);
       t.doctypePending.systemIdentifier.append(replacementChar);
       break;
     case '>':
       t.error(this);
       t.doctypePending.forceQuirks = true;
       t.emitDoctypePending();
       t.transition(Data);
       break;
     case eof:
       t.eofError(this);
       t.doctypePending.forceQuirks = true;
       t.emitDoctypePending();
       t.transition(Data);
       break;
     default:
       t.doctypePending.systemIdentifier.append(c);
   }
 }
 void read(Tokeniser t, CharacterReader r) {
   if (r.matchesLetter()) {
     String name = r.consumeLetterSequence();
     t.doctypePending.name.append(name.toLowerCase());
     return;
   }
   char c = r.consume();
   switch (c) {
     case '>':
       t.emitDoctypePending();
       t.transition(Data);
       break;
     case '\t':
     case '\n':
     case '\r':
     case '\f':
     case ' ':
       t.transition(AfterDoctypeName);
       break;
     case nullChar:
       t.error(this);
       t.doctypePending.name.append(replacementChar);
       break;
     case eof:
       t.eofError(this);
       t.doctypePending.forceQuirks = true;
       t.emitDoctypePending();
       t.transition(Data);
       break;
     default:
       t.doctypePending.name.append(c);
   }
 }
 void read(Tokeniser t, CharacterReader r) {
   char c = r.consume();
   switch (c) {
     case '>':
       t.emitDoctypePending();
       t.transition(Data);
       break;
     case eof:
       t.emitDoctypePending();
       t.transition(Data);
       break;
     default:
       // ignore char
       break;
   }
 }
Exemple #7
0
 void read(Tokeniser t, CharacterReader r) {
   if (r.isEmpty()) {
     t.eofError(this);
     t.doctypePending.forceQuirks = true;
     t.emitDoctypePending();
     t.transition(Data);
     return;
   }
   if (r.matches('>')) {
     t.emitDoctypePending();
     t.advanceTransition(Data);
   } else if (r.matchConsumeIgnoreCase("PUBLIC")) {
     t.transition(AfterDoctypePublicKeyword);
   } else if (r.matchConsumeIgnoreCase("SYSTEM")) {
     t.transition(AfterDoctypeSystemKeyword);
   } else {
     t.error(this);
     t.doctypePending.forceQuirks = true;
     t.advanceTransition(BogusDoctype);
   }
 }
Exemple #8
0
 void read(Tokeniser t, CharacterReader r) {
   char c = r.consume();
   switch (c) {
     case '\t':
     case '\n':
     case '\f':
     case ' ':
       t.transition(BeforeDoctypeName);
       break;
     case eof:
       t.eofError(this);
       t.createDoctypePending();
       t.doctypePending.forceQuirks = true;
       t.emitDoctypePending();
       t.transition(Data);
       break;
     default:
       t.error(this);
       t.transition(BeforeDoctypeName);
   }
 }