module HTML5::Atom

Overview

Module Atom provides integer codes (also known as atoms) for a fixed set of frequently occurring HTML5 strings: tag names and attribute keys such as "p" and "id".

Sharing an atom's name between all elements with the same tag can result in fewer string allocations when tokenizing and parsing HTML5. Integer comparisons are also generally faster than string comparisons.

The value of an atom's particular code is not guaranteed to stay the same between versions of this module. Neither is any ordering guaranteed: whether Atom::H1 < Atom::H2 may also change. The codes are not guaranteed to be dense. The only guarantees are that e.g. looking up "div" will yield Atom::Div, calling Atom::Div.to_s will return "div", and Atom::Div != 0.

Defined in:

html5/atom/atom.cr
html5/atom/table.cr

Constant Summary

A = Atom[1]
Abbr = Atom[327940]
Accept = Atom[6]
AcceptCharset = Atom[14]
Accesskey = Atom[4617]
Acronym = Atom[27143]
Action = Atom[163078]
Address = Atom[472839]
Align = Atom[28933]
Allowfullscreen = Atom[127759]
Allowpaymentrequest = Atom[33043]
Allowusermedia = Atom[40206]
Alt = Atom[51203]
Annotation = Atom[114442]
AnnotationXml = Atom[114446]
Applet = Atom[211206]
Area = Atom[226820]
Article = Atom[270855]
As = Atom[8706]
Aside = Atom[24325]
Async = Atom[59909]
Audio = Atom[64773]
Autocapitalize = Atom[67854]
Autocomplete = Atom[164620]
Autofocus = Atom[71433]
Autoplay = Atom[79112]
B = Atom[3585]
Base = Atom[8452]
Basefont = Atom[8456]
Bdi = Atom[31235]
Bdo = Atom[82947]
Bgsound = Atom[87815]
Big = Atom[91907]
Blink = Atom[92677]
Blockquote = Atom[97546]
Body = Atom[3588]
Br = Atom[7938]
Button = Atom[100102]
Canvas = Atom[23302]
Caption = Atom[147975]
Center = Atom[140294]
Challenge = Atom[173577]
Charset = Atom[1799]
Checked = Atom[236807]
Cite = Atom[60932]
Class = Atom[102917]
Code = Atom[287236]
Col = Atom[106755]
Colgroup = Atom[106760]
Color = Atom[111877]
Cols = Atom[113156]
Colspan = Atom[113159]
Command = Atom[118023]
Content = Atom[381191]
Contenteditable = Atom[381199]
Contextmenu = Atom[239115]
Controls = Atom[122888]
Coords = Atom[125958]
Crossorigin = Atom[135435]
Data = Atom[292100]
Datalist = Atom[292104]
Datetime = Atom[181000]
Dd = Atom[188930]
Decoding = Atom[25096]
Default = Atom[287751]
Defer = Atom[300293]
Del = Atom[374275]
Desc = Atom[22532]
Details = Atom[47879]
Dfn = Atom[51971]
Dialog = Atom[31494]
Dir = Atom[89347]
Dirname = Atom[89351]
Disabled = Atom[94472]
Div = Atom[96259]
Dl = Atom[402690]
Download = Atom[305160]
Draggable = Atom[119561]
Dropzone = Atom[273160]
Dt = Atom[426754]
Em = Atom[21506]
Embed = Atom[21509]
Enctype = Atom[169991]
Enterkeyhint = Atom[140556]
Face = Atom[139780]
Fieldset = Atom[145160]
Figcaption = Atom[147210]
Figure = Atom[152326]
Font = Atom[9476]
Footer = Atom[55046]
For = Atom[155395]
ForeignObject = Atom[155405]
Foreignobject = Atom[158733]
Form = Atom[162052]
Formaction = Atom[162058]
Formenctype = Atom[168971]
Formmethod = Atom[175882]
Formnovalidate = Atom[178446]
Formtarget = Atom[183050]
Frame = Atom[52997]
Frameset = Atom[53000]
H1 = Atom[87298]
H2 = Atom[190722]
H3 = Atom[208130]
H4 = Atom[222466]
H5 = Atom[225026]
H6 = Atom[427266]
Head = Atom[217348]
Header = Atom[217350]
Headers = Atom[217351]
Height = Atom[14342]
Hgroup = Atom[185606]
Hidden = Atom[188422]
High = Atom[189956]
Hr = Atom[86018]
Href = Atom[191236]
Hreflang = Atom[191240]
Html = Atom[15364]
HttpEquiv = Atom[193290]
I = Atom[10497]
Icon = Atom[380932]
Id = Atom[24834]
Iframe = Atom[198406]
Image = Atom[199941]
Imagesizes = Atom[199946]
Imagesrcset = Atom[203787]
Img = Atom[206595]
Input = Atom[298501]
Inputmode = Atom[298505]
Ins = Atom[137731]
Integrity = Atom[142857]
Is = Atom[94722]
Isindex = Atom[208647]
Ismap = Atom[210437]
Itemid = Atom[241926]
Itemprop = Atom[61192]
Itemref = Atom[258823]
Itemscope = Atom[439561]
Itemtype = Atom[212744]
Kbd = Atom[30979]
Keygen = Atom[6150]
Keytype = Atom[38407]
Kind = Atom[93700]
Label = Atom[16133]
Lang = Atom[192260]
Legend = Atom[121350]
Li = Atom[29186]
Link = Atom[92932]
List = Atom[293124]
Listing = Atom[293127]
Loading = Atom[306183]
Loop = Atom[17156]
Low = Atom[33539]
Main = Atom[332036]
Malignmark = Atom[28682]
Manifest = Atom[465672]
Map = Atom[210947]
Mark = Atom[30212]
Marquee = Atom[214791]
Math = Atom[216580]
Max = Atom[220419]
Maxlength = Atom[220425]
Media = Atom[42501]
Mediagroup = Atom[42506]
Menu = Atom[240900]
Menuitem = Atom[240904]
Meta = Atom[326148]
Meter = Atom[90629]
Method = Atom[176902]
Mglyph = Atom[206854]
Mi = Atom[222978]
Min = Atom[222979]
Minlength = Atom[222985]
Mn = Atom[179202]
Mo = Atom[58370]
Ms = Atom[440322]
Mtext = Atom[225541]
Multiple = Atom[229128]
Muted = Atom[231173]
Name = Atom[90116]
Nav = Atom[332803]
Nobr = Atom[7428]
Noembed = Atom[20999]
Noframes = Atom[52488]
Nomodule = Atom[57864]
Nonce = Atom[63493]
Noscript = Atom[131336]
Novalidate = Atom[179466]
Object = Atom[160518]
Ol = Atom[77058]
Onabort = Atom[101127]
Onafterprint = Atom[149260]
Onautocomplete = Atom[164110]
Onautocompleteerror = Atom[164115]
Onauxclick = Atom[415498]
Onbeforeprint = Atom[451085]
Onbeforeunload = Atom[469774]
Onblur = Atom[105222]
Oncancel = Atom[65800]
Oncanplay = Atom[83465]
Oncanplaythrough = Atom[83472]
Onchange = Atom[278792]
Onclick = Atom[196615]
Onclose = Atom[232455]
Oncontextmenu = Atom[238605]
Oncopy = Atom[243462]
Oncuechange = Atom[245003]
Oncut = Atom[247813]
Ondblclick = Atom[249098]
Ondrag = Atom[251654]
Ondragend = Atom[251657]
Ondragenter = Atom[253963]
Ondragexit = Atom[256778]
Ondragleave = Atom[263435]
Ondragover = Atom[266250]
Ondragstart = Atom[268811]
Ondrop = Atom[272646]
Ondurationchange = Atom[276752]
Onemptied = Atom[274441]
Onended = Atom[280839]
Onerror = Atom[282631]
Onfocus = Atom[284423]
Onformdata = Atom[290570]
Onhashchange = Atom[294924]
Oninput = Atom[297991]
Oninvalid = Atom[301577]
Onkeydown = Atom[303881]
Onkeypress = Atom[307978]
Onkeyup = Atom[312071]
Onlanguagechange = Atom[315408]
Onload = Atom[319494]
Onloadeddata = Atom[319500]
Onloadedmetadata = Atom[324112]
Onloadend = Atom[334601]
Onloadstart = Atom[336907]
Onmessage = Atom[339721]
Onmessageerror = Atom[339726]
Onmousedown = Atom[343307]
Onmouseenter = Atom[346124]
Onmouseleave = Atom[349196]
Onmousemove = Atom[352267]
Onmouseout = Atom[355082]
Onmouseover = Atom[358411]
Onmouseup = Atom[361225]
Onmousewheel = Atom[364812]
Onoffline = Atom[367881]
Ononline = Atom[370184]
Onpagehide = Atom[372234]
Onpageshow = Atom[375050]
Onpaste = Atom[378119]
Onpause = Atom[385031]
Onplay = Atom[387590]
Onplaying = Atom[387593]
Onpopstate = Atom[389898]
Onprogress = Atom[392458]
Onratechange = Atom[396044]
Onrejectionhandled = Atom[399122]
Onreset = Atom[403719]
Onresize = Atom[405512]
Onscroll = Atom[407560]
Onsecuritypolicyviolation = Atom[409625]
Onseeked = Atom[418056]
Onseeking = Atom[420105]
Onselect = Atom[422408]
Onshow = Atom[424966]
Onslotchange = Atom[427788]
Onsort = Atom[430854]
Onstalled = Atom[433417]
Onstorage = Atom[435721]
Onsubmit = Atom[438024]
Onsuspend = Atom[442121]
Ontimeupdate = Atom[9740]
Ontoggle = Atom[444424]
Onunhandledrejection = Atom[446484]
Onunload = Atom[454408]
Onvolumechange = Atom[456462]
Onwaiting = Atom[460041]
Onwheel = Atom[462343]
Open = Atom[62724]
Optgroup = Atom[17672]
Optimum = Atom[464135]
Option = Atom[468742]
Output = Atom[356870]
P = Atom[1025]
Param = Atom[331013]
Pattern = Atom[19463]
Picture = Atom[44807]
Ping = Atom[50180]
Placeholder = Atom[75531]
Plaintext = Atom[108553]
Playsinline = Atom[80139]
Poster = Atom[186886]
Pre = Atom[309251]
Preload = Atom[313607]
Progress = Atom[392968]
Prompt = Atom[363270]
Public = Atom[379910]
Q = Atom[36609]
Radiogroup = Atom[328714]
Rb = Atom[8194]
Readonly = Atom[227080]
Referrerpolicy = Atom[259854]
Rel = Atom[313859]
Required = Atom[153352]
Reversed = Atom[46088]
Rows = Atom[56324]
Rowspan = Atom[56327]
Rp = Atom[150786]
Rt = Atom[102402]
Rtc = Atom[102403]
Ruby = Atom[78084]
S = Atom[2817]
Samp = Atom[49412]
Sandbox = Atom[73479]
Scope = Atom[440581]
Scoped = Atom[440582]
Script = Atom[131846]
Seamless = Atom[233736]
Section = Atom[103943]
Select = Atom[422918]
Selected = Atom[422920]
Shape = Atom[124677]
Size = Atom[201220]
Sizes = Atom[201221]
Slot = Atom[428292]
Small = Atom[127237]
Sortable = Atom[431368]
Sorted = Atom[138246]
Source = Atom[202246]
Spacer = Atom[218886]
Span = Atom[57092]
Spellcheck = Atom[235530]
Src = Atom[205059]
Srcdoc = Atom[285958]
Srclang = Atom[310279]
Srcset = Atom[205062]
Start = Atom[270341]
Step = Atom[379140]
Strike = Atom[37382]
Strong = Atom[467206]
Style = Atom[394757]
Sub = Atom[438531]
Summary = Atom[474375]
Sup = Atom[476163]
Svg = Atom[476931]
System = Atom[477702]
Tabindex = Atom[322056]
Table = Atom[383749]
Target = Atom[184070]
Tbody = Atom[3333]
Td = Atom[51714]
Template = Atom[478472]
Textarea = Atom[225800]
Tfoot = Atom[54789]
Th = Atom[85762]
Thead = Atom[217093]
Time = Atom[10244]
Title = Atom[289285]
Tr = Atom[35842]
Track = Atom[110597]
Translate = Atom[133129]
Tt = Atom[19970]
Type = Atom[39172]
Typemustmatch = Atom[170765]
U = Atom[11265]
Ul = Atom[59138]
Updateviacache = Atom[11278]
Usemap = Atom[386054]
Value = Atom[333317]
Var = Atom[96771]
Video = Atom[195589]
Wbr = Atom[377347]
Width = Atom[426245]
Workertype = Atom[480522]
Wrap = Atom[483076]
Xmp = Atom[75011]

Constructors

Class Method Summary

Constructor Detail

def self.lookup(s : Bytes) : Atom #

returns the Atom whose name is s. It returns zero if there is no such Atom. Lookup is case sensitive


[View source]

Class Method Detail

def self.string(s : Bytes) : String #

returns a string whose contents are equal to s.


[View source]