Esempio n. 1
0
 public override 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);
             break;
         // NOT force quirks
     }
 }
Esempio n. 2
0
 public override 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;
     }
 }
Esempio n. 3
0
 public override 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);
             break;
     }
 }
Esempio n. 4
0
 public override 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(DoctypeSystemIdentifierDoubleQuoted);
             break;
         case '\'':
             // set public id to empty string
             t.Transition(DoctypeSystemIdentifierSingleQuoted);
             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);
             break;
     }
 }
Esempio n. 5
0
            public override void Read(Tokeniser t, CharacterReader r)
            {
                if (r.IsEmpty())
                {
                    t.EofError(this);
                    t.DoctypePending.ForceQuirks = true;
                    t.EmitDoctypePending();
                    t.Transition(Data);
                    return;
                }
                if (r.MatchesAny('\t', '\n', '\r', '\f', ' '))
                {
                    r.Advance(); // ignore whitespace
                }
                else 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);
                }

            }
Esempio n. 6
0
 public override void Read(Tokeniser t, CharacterReader r)
 {
     if (r.MatchesLetter())
     {
         string name = r.ConsumeLetterSequence();
         t.DoctypePending.Name.Append(name.ToLowerInvariant());
         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);
             break;
     }
 }
Esempio n. 7
0
 public override 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);
             break;
     }
 }