public void StartAttribute() { if (this.htmlToken.AttributeTail == this.htmlToken.AttributeList.Length) { int num; if (this.maxAttrs / 2 > this.htmlToken.AttributeList.Length) { num = this.htmlToken.AttributeList.Length * 2; } else { num = this.maxAttrs; } HtmlToken.AttributeEntry[] array = new HtmlToken.AttributeEntry[num]; Array.Copy(this.htmlToken.AttributeList, 0, array, 0, this.htmlToken.AttributeTail); this.htmlToken.AttributeList = array; } if (this.htmlToken.PartMinor == HtmlToken.TagPartMinor.Empty) { this.htmlToken.PartMinor = HtmlToken.TagPartMinor.BeginAttribute; } this.htmlToken.AttributeList[this.htmlToken.AttributeTail].NameIndex = HtmlNameIndex.Unknown; this.htmlToken.AttributeList[this.htmlToken.AttributeTail].PartMajor = HtmlToken.AttrPartMajor.Begin; this.htmlToken.AttributeList[this.htmlToken.AttributeTail].PartMinor = HtmlToken.AttrPartMinor.BeginName; this.htmlToken.AttributeList[this.htmlToken.AttributeTail].QuoteChar = 0; this.htmlToken.AttributeList[this.htmlToken.AttributeTail].Name.Initialize(this.htmlToken.Whole.Tail, this.tailOffset); this.htmlToken.AttributeList[this.htmlToken.AttributeTail].LocalName.Initialize(this.htmlToken.Whole.Tail, this.tailOffset); this.htmlToken.AttributeList[this.htmlToken.AttributeTail].Value.Reset(); this.state = 24; }
public void StartAttribute() { if (this.htmlToken.attributeTail == this.htmlToken.attributeList.Length) { InternalDebug.Assert(this.htmlToken.attributeList.Length < this.maxAttrs); int newSize; if (this.maxAttrs / 2 > this.htmlToken.attributeList.Length) { newSize = this.htmlToken.attributeList.Length * 2; } else { newSize = this.maxAttrs; } HtmlToken.AttributeEntry[] newAttrs = new HtmlToken.AttributeEntry[newSize]; Array.Copy(this.htmlToken.attributeList, 0, newAttrs, 0, this.htmlToken.attributeTail); this.htmlToken.attributeList = newAttrs; } InternalDebug.Assert(this.htmlToken.attributeTail < this.htmlToken.attributeList.Length); InternalDebug.Assert(this.state == BuildStateTagBeforeAttr); InternalDebug.Assert(this.htmlToken.partMinor == HtmlToken.TagPartMinor.Empty || this.htmlToken.partMinor == HtmlToken.TagPartMinor.EndName || this.htmlToken.partMinor == HtmlToken.TagPartMinor.EndNameWithAttributes || this.htmlToken.partMinor == HtmlToken.TagPartMinor.CompleteName || this.htmlToken.partMinor == HtmlToken.TagPartMinor.CompleteNameWithAttributes || this.htmlToken.partMinor == HtmlToken.TagPartMinor.EndAttribute || this.htmlToken.partMinor == HtmlToken.TagPartMinor.EndAttributeWithOtherAttributes || this.htmlToken.partMinor == HtmlToken.TagPartMinor.Attributes); if (this.htmlToken.partMinor == HtmlToken.TagPartMinor.Empty) { this.htmlToken.partMinor = HtmlToken.TagPartMinor.BeginAttribute; } this.htmlToken.attributeList[this.htmlToken.attributeTail].nameIndex = HtmlNameIndex.Unknown; this.htmlToken.attributeList[this.htmlToken.attributeTail].partMajor = HtmlToken.AttrPartMajor.Begin; this.htmlToken.attributeList[this.htmlToken.attributeTail].partMinor = HtmlToken.AttrPartMinor.BeginName; this.htmlToken.attributeList[this.htmlToken.attributeTail].quoteChar = 0; this.htmlToken.attributeList[this.htmlToken.attributeTail].name.Initialize(this.htmlToken.whole.tail, this.tailOffset); this.htmlToken.attributeList[this.htmlToken.attributeTail].localName.Initialize(this.htmlToken.whole.tail, this.tailOffset); this.htmlToken.attributeList[this.htmlToken.attributeTail].value.Reset(); this.state = BuildStateTagAttrName; }