Tag dictionary node (c) 1998-2000 (W3C) MIT, INRIA, Keio University See Tidy.cs for the copyright notice. Derived from HTML Tidy Release 4 Aug 2000
示例#1
0
 public Dict Add(Dict dict)
 {
     Dict d = _tagHashtable.ContainsKey(dict.Name) ? (Dict) _tagHashtable[dict.Name] : null;
     if (d != null)
     {
         d.Versions = dict.Versions;
         d.Model |= dict.Model;
         d.Parser = dict.Parser;
         d.CheckAttribs = dict.CheckAttribs;
         return d;
     }
     _tagHashtable[dict.Name] = dict;
     return dict;
 }
示例#2
0
        public TagCollection()
        {
            foreach (Dict tag in Tags)
                Add(tag);

            TagHtml = Lookup("html");
            TagHead = Lookup("head");
            TagBody = Lookup("body");
            TagFrameset = Lookup("frameset");
            TagFrame = Lookup("frame");
            TagNoframes = Lookup("noframes");
            TagMeta = Lookup("meta");
            TagTitle = Lookup("title");
            TagBase = Lookup("base");
            TagHr = Lookup("hr");
            TagPre = Lookup("pre");
            TagListing = Lookup("listing");
            TagH1 = Lookup("h1");
            TagH2 = Lookup("h2");
            TagP = Lookup("p");
            TagUl = Lookup("ul");
            TagOl = Lookup("ol");
            TagDir = Lookup("dir");
            TagLi = Lookup("li");
            TagDt = Lookup("dt");
            TagDd = Lookup("dd");
            TagDl = Lookup("dl");
            TagTd = Lookup("td");
            TagTh = Lookup("th");
            TagTr = Lookup("tr");
            TagCol = Lookup("col");
            TagBr = Lookup("br");
            TagA = Lookup("a");
            TagLink = Lookup("link");
            TagB = Lookup("b");
            TagI = Lookup("i");
            TagStrong = Lookup("strong");
            TagEm = Lookup("em");
            TagBig = Lookup("big");
            TagSmall = Lookup("small");
            TagParam = Lookup("param");
            TagOption = Lookup("option");
            TagOptgroup = Lookup("optgroup");
            TagImg = Lookup("img");
            TagMap = Lookup("map");
            TagArea = Lookup("area");
            TagNobr = Lookup("nobr");
            TagWbr = Lookup("wbr");
            TagFont = Lookup("font");
            TagSpacer = Lookup("spacer");
            TagLayer = Lookup("layer");
            TagCenter = Lookup("center");
            TagStyle = Lookup("style");
            TagScript = Lookup("script");
            TagNoscript = Lookup("noscript");
            TagTable = Lookup("table");
            TagCaption = Lookup("caption");
            TagForm = Lookup("form");
            TagTextarea = Lookup("textarea");
            TagBlockquote = Lookup("blockquote");
            TagApplet = Lookup("applet");
            TagObject = Lookup("object");
            TagDiv = Lookup("div");
            TagSpan = Lookup("span");
        }
示例#3
0
        public virtual bool IsDescendantOf(Dict tag)
        {
            Node parent;

            for (parent = Parent; parent != null; parent = parent.Parent)
            {
                if (parent.Tag == tag)
                {
                    return true;
                }
            }

            return false;
        }
示例#4
0
        public TagCollection()
        {
            foreach (Dict tag in Tags)
            {
                Add(tag);
            }

            TagHtml       = Lookup("html");
            TagHead       = Lookup("head");
            TagBody       = Lookup("body");
            TagFrameset   = Lookup("frameset");
            TagFrame      = Lookup("frame");
            TagNoframes   = Lookup("noframes");
            TagMeta       = Lookup("meta");
            TagTitle      = Lookup("title");
            TagBase       = Lookup("base");
            TagHr         = Lookup("hr");
            TagPre        = Lookup("pre");
            TagListing    = Lookup("listing");
            TagH1         = Lookup("h1");
            TagH2         = Lookup("h2");
            TagP          = Lookup("p");
            TagUl         = Lookup("ul");
            TagOl         = Lookup("ol");
            TagDir        = Lookup("dir");
            TagLi         = Lookup("li");
            TagDt         = Lookup("dt");
            TagDd         = Lookup("dd");
            TagDl         = Lookup("dl");
            TagTd         = Lookup("td");
            TagTh         = Lookup("th");
            TagTr         = Lookup("tr");
            TagCol        = Lookup("col");
            TagBr         = Lookup("br");
            TagA          = Lookup("a");
            TagLink       = Lookup("link");
            TagB          = Lookup("b");
            TagI          = Lookup("i");
            TagStrong     = Lookup("strong");
            TagEm         = Lookup("em");
            TagBig        = Lookup("big");
            TagSmall      = Lookup("small");
            TagParam      = Lookup("param");
            TagOption     = Lookup("option");
            TagOptgroup   = Lookup("optgroup");
            TagImg        = Lookup("img");
            TagMap        = Lookup("map");
            TagArea       = Lookup("area");
            TagNobr       = Lookup("nobr");
            TagWbr        = Lookup("wbr");
            TagFont       = Lookup("font");
            TagSpacer     = Lookup("spacer");
            TagLayer      = Lookup("layer");
            TagCenter     = Lookup("center");
            TagStyle      = Lookup("style");
            TagScript     = Lookup("script");
            TagNoscript   = Lookup("noscript");
            TagTable      = Lookup("table");
            TagCaption    = Lookup("caption");
            TagForm       = Lookup("form");
            TagTextarea   = Lookup("textarea");
            TagBlockquote = Lookup("blockquote");
            TagApplet     = Lookup("applet");
            TagObject     = Lookup("object");
            TagDiv        = Lookup("div");
            TagSpan       = Lookup("span");
        }
示例#5
0
 public static void CoerceNode(Lexer lexer, Node node, Dict tag)
 {
     Node tmp = lexer.InferredTag(tag.Name);
     Report.Warning(lexer, node, tmp, Report.OBSOLETE_ELEMENT);
     node.Was = node.Tag;
     node.Tag = tag;
     node.Type = START_TAG;
     node.Isimplicit = true;
     node.Element = tag.Name;
 }