Ejemplo n.º 1
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;
                }
            }
            public override void Read(Tokeniser t, CharacterReader r)
            {
                char c = r.Consume();

                switch (c)
                {
                case '\t':
                case '\n':
                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
                    break;
                }
            }
            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', '\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);
                }
            }
Ejemplo n.º 4
0
            public override void Read(Tokeniser t, CharacterReader r)
            {
                char c = r.Consume();

                switch (c)
                {
                case '\t':
                case '\n':
                case '\f':
                case ' ':
                    t.Transition(BeforeDoctypeSystemIdentifier);
                    break;

                case '>':
                    t.Error(this);
                    t.doctypePending.forceQuirks = true;
                    t.EmitDoctypePending();
                    t.Transition(Data);
                    break;

                case '"':
                    t.Error(this);
                    // system id empty
                    t.Transition(DoctypeSystemIdentifier_doubleQuoted);
                    break;

                case '\'':
                    t.Error(this);
                    // system id empty
                    t.Transition(DoctypeSystemIdentifier_singleQuoted);
                    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.EmitDoctypePending();
                    break;
                }
            }
            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 '\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;
                }
            }
Ejemplo n.º 6
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;
                }
            }
            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 '\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;
                }
            }