Beispiel #1
0
        private void StackCheck(Token token)
        {
            DropStackToTag();

            switch (token.Type)
            {
            case HtmlNodeType.ClosedTag:
            case HtmlNodeType.Comment:
            case HtmlNodeType.Text:
            case HtmlNodeType.Whitespace:
            {
                if (HtmlNodeType.Tag == _nestedTokens.Top.Type)
                {
                    _nestedTokens.Push(token);
                }
                else
                {
                    _nestedTokens.Swap(token);
                }
                break;
            }

            case HtmlNodeType.Tag:
            {
                if (!Tag.IsAtomic(token.Name))
                {
                    _nestedTokens.Push(token);
                }
                else
                {
                    _nestedTokens.Swap(token);
                }
                break;
            }

            case HtmlNodeType.EndTag:
            {
                _nestedTokens.Push(token);
                break;
            }

            default:
                throw new HtmlException(RD.GetString("tagUnknown"));
            }
        }
Beispiel #2
0
 public override void RemoveAt(int pos)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Beispiel #3
0
 public override void Remove(HtmlNode x)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Beispiel #4
0
 public override void Insert(int pos, HtmlNode x)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Beispiel #5
0
 public override void Clear()
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Beispiel #6
0
 public override int AddRange(HtmlNode[] x)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Beispiel #7
0
 public override int Add(HtmlAttribute x)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }