Class | Nokogiri::HTML::ElementDescription
In: | lib/nokogiri/html/element_description.rb lib/nokogiri/html/element_description_defaults.rb ext/nokogiri/html_sax_parser_context.c
Parent: | Object

call-seq:

     [](tag_name)

Get ElemementDescription for `tag_name`

### Methods

[] block? default_sub_element default_sub_element deprecated? deprecated? deprecated_attributes deprecated_attributes description description empty? implied_end_tag? implied_end_tag? implied_start_tag? implied_start_tag? inline? inspect name optional_attributes optional_attributes required_attributes required_attributes save_end_tag? save_end_tag? sub_elements to_s

### Constants

Desc | = | Struct.new("HTMLElementDescription", :name, :startTag, :endTag, :saveEndTag, :empty, :depr, :dtd, :isinline, :desc, :subelts, :defaultsubelt, :attrs_opt, :attrs_depr, :attrs_req) |  | Methods are defined protected by method_defined? because at this point the C-library or Java library is alraedy loaded, and we don‘t want to clobber any methods that have been defined there.
DefaultDescriptions | = | Hash.new() |  | This is filled in down below.
FONTSTYLE | = | ["tt", "i", "b", "u", "s", "strike", "big", "small"] |  | Attributes defined and categorized
PHRASE | = | ['em', 'strong', 'dfn', 'code', 'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym']
SPECIAL | = | ['a', 'img', 'applet', 'embed', 'object', 'font','basefont', 'br', 'script', 'map', 'q', 'sub', 'sup', 'span', 'bdo', 'iframe']
PCDATA | = | []
HEADING | = | ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
LIST | = | ['ul', 'ol', 'dir', 'menu']
FORMCTRL | = | ['input', 'select', 'textarea', 'label', 'button']
BLOCK | = | [HEADING, LIST, 'pre', 'p', 'dl', 'div', 'center', 'noscript', 'noframes', 'blockquote', 'form', 'isindex', 'hr', 'table', 'fieldset', 'address']
INLINE | = | [PCDATA, FONTSTYLE, PHRASE, SPECIAL, FORMCTRL]
FLOW | = | [BLOCK, INLINE]
MODIFIER | = | []
EMPTY | = | []
HTML_FLOW | = | FLOW
HTML_INLINE | = | INLINE
HTML_PCDATA | = | PCDATA
HTML_CDATA | = | HTML_PCDATA
COREATTRS | = | ['id', 'class', 'style', 'title']
I18N | = | ['lang', 'dir']
EVENTS | = | ['onclick', 'ondblclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
ATTRS | = | [COREATTRS, I18N,EVENTS]
CELLHALIGN | = | ['align', 'char', 'charoff']
CELLVALIGN | = | ['valign']
HTML_ATTRS | = | ATTRS
CORE_I18N_ATTRS | = | [COREATTRS, I18N]
CORE_ATTRS | = | COREATTRS
I18N_ATTRS | = | I18N
A_ATTRS | = | [ATTRS, 'charset', 'type', 'name', 'href', 'hreflang', 'rel', 'rev', 'accesskey', 'shape', 'coords', 'tabindex', 'onfocus', 'onblur']
TARGET_ATTR | = | ['target']
ROWS_COLS_ATTR | = | ['rows', 'cols']
ALT_ATTR | = | ['alt']
SRC_ALT_ATTRS | = | ['src', 'alt']
HREF_ATTRS | = | ['href']
CLEAR_ATTRS | = | ['clear']
INLINE_P | = | [INLINE, 'p']
FLOW_PARAM | = | [FLOW, 'param']
APPLET_ATTRS | = | [COREATTRS , 'codebase', 'archive', 'alt', 'name', 'height', 'width', 'align', 'hspace', 'vspace']
AREA_ATTRS | = | ['shape', 'coords', 'href', 'nohref', 'tabindex', 'accesskey', 'onfocus', 'onblur']
BASEFONT_ATTRS | = | ['id', 'size', 'color', 'face']
QUOTE_ATTRS | = | [ATTRS, 'cite']
BODY_CONTENTS | = | [FLOW, 'ins', 'del']
BODY_ATTRS | = | [ATTRS, 'onload', 'onunload']
BODY_DEPR | = | ['background', 'bgcolor', 'text', 'link', 'vlink', 'alink']
BUTTON_ATTRS | = | [ATTRS, 'name', 'value', 'type', 'disabled', 'tabindex', 'accesskey', 'onfocus', 'onblur']
COL_ATTRS | = | [ATTRS, 'span', 'width', CELLHALIGN, CELLVALIGN]
COL_ELT | = | ['col']
EDIT_ATTRS | = | [ATTRS, 'datetime', 'cite']
COMPACT_ATTRS | = | [ATTRS, 'compact']
DL_CONTENTS | = | ['dt', 'dd']
COMPACT_ATTR | = | ['compact']
LABEL_ATTR | = | ['label']
FIELDSET_CONTENTS | = | [FLOW, 'legend' ]
FONT_ATTRS | = | [COREATTRS, I18N, 'size', 'color', 'face' ]
FORM_CONTENTS | = | [HEADING, LIST, INLINE, 'pre', 'p', 'div', 'center', 'noscript', 'noframes', 'blockquote', 'isindex', 'hr', 'table', 'fieldset', 'address']
FORM_ATTRS | = | [ATTRS, 'method', 'enctype', 'accept', 'name', 'onsubmit', 'onreset', 'accept-charset']
FRAME_ATTRS | = | [COREATTRS, 'longdesc', 'name', 'src', 'frameborder', 'marginwidth', 'marginheight', 'noresize', 'scrolling' ]
FRAMESET_ATTRS | = | [COREATTRS, 'rows', 'cols', 'onload', 'onunload']
FRAMESET_CONTENTS | = | ['frameset', 'frame', 'noframes']
HEAD_ATTRS | = | [I18N, 'profile']
HEAD_CONTENTS | = | ['title', 'isindex', 'base', 'script', 'style', 'meta', 'link', 'object']
HR_DEPR | = | ['align', 'noshade', 'size', 'width']
VERSION_ATTR | = | ['version']
HTML_CONTENT | = | ['head', 'body', 'frameset']
IFRAME_ATTRS | = | [COREATTRS, 'longdesc', 'name', 'src', 'frameborder', 'marginwidth', 'marginheight', 'scrolling', 'align', 'height', 'width']
IMG_ATTRS | = | [ATTRS, 'longdesc', 'name', 'height', 'width', 'usemap', 'ismap']
EMBED_ATTRS | = | [COREATTRS, 'align', 'alt', 'border', 'code', 'codebase', 'frameborder', 'height', 'hidden', 'hspace', 'name', 'palette', 'pluginspace', 'pluginurl', 'src', 'type', 'units', 'vspace', 'width']
INPUT_ATTRS | = | [ATTRS, 'type', 'name', 'value', 'checked', 'disabled', 'readonly', 'size', 'maxlength', 'src', 'alt', 'usemap', 'ismap', 'tabindex', 'accesskey', 'onfocus', 'onblur', 'onselect', 'onchange', 'accept']
PROMPT_ATTRS | = | [COREATTRS, I18N, 'prompt']
LABEL_ATTRS | = | [ATTRS, 'for', 'accesskey', 'onfocus', 'onblur']
LEGEND_ATTRS | = | [ATTRS, 'accesskey']
ALIGN_ATTR | = | ['align']
LINK_ATTRS | = | [ATTRS, 'charset', 'href', 'hreflang', 'type', 'rel', 'rev', 'media']
MAP_CONTENTS | = | [BLOCK, 'area']
NAME_ATTR | = | ['name']
ACTION_ATTR | = | ['action']
BLOCKLI_ELT | = | [BLOCK, 'li']
META_ATTRS | = | [I18N, 'http-equiv', 'name', 'scheme']
CONTENT_ATTR | = | ['content']
TYPE_ATTR | = | ['type']
NOFRAMES_CONTENT | = | ['body', FLOW, MODIFIER]
OBJECT_CONTENTS | = | [FLOW, 'param']
OBJECT_ATTRS | = | [ATTRS, 'declare', 'classid', 'codebase', 'data', 'type', 'codetype', 'archive', 'standby', 'height', 'width', 'usemap', 'name', 'tabindex']
OBJECT_DEPR | = | ['align', 'border', 'hspace', 'vspace']
OL_ATTRS | = | ['type', 'compact', 'start']
OPTION_ELT | = | ['option']
OPTGROUP_ATTRS | = | [ATTRS, 'disabled']
OPTION_ATTRS | = | [ATTRS, 'disabled', 'label', 'selected', 'value']
PARAM_ATTRS | = | ['id', 'value', 'valuetype', 'type']
WIDTH_ATTR | = | ['width']
PRE_CONTENT | = | [PHRASE, 'tt', 'i', 'b', 'u', 's', 'strike', 'a', 'br', 'script', 'map', 'q', 'span', 'bdo', 'iframe']
SCRIPT_ATTRS | = | ['charset', 'src', 'defer', 'event', 'for']
LANGUAGE_ATTR | = | ['language']
SELECT_CONTENT | = | ['optgroup', 'option']
SELECT_ATTRS | = | [ATTRS, 'name', 'size', 'multiple', 'disabled', 'tabindex', 'onfocus', 'onblur', 'onchange']
STYLE_ATTRS | = | [I18N, 'media', 'title']
TABLE_ATTRS | = | [ATTRS, 'summary', 'width', 'border', 'frame', 'rules', 'cellspacing', 'cellpadding', 'datapagesize']
TABLE_DEPR | = | ['align', 'bgcolor']
TABLE_CONTENTS | = | ['caption', 'col', 'colgroup', 'thead', 'tfoot', 'tbody', 'tr']
TR_ELT | = | ['tr']
TALIGN_ATTRS | = | [ATTRS, CELLHALIGN, CELLVALIGN]
TH_TD_DEPR | = | ['nowrap', 'bgcolor', 'width', 'height']
TH_TD_ATTR | = | [ATTRS, 'abbr', 'axis', 'headers', 'scope', 'rowspan', 'colspan', CELLHALIGN, CELLVALIGN]
TEXTAREA_ATTRS | = | [ATTRS, 'name', 'disabled', 'readonly', 'tabindex', 'accesskey', 'onfocus', 'onblur', 'onselect', 'onchange']
TR_CONTENTS | = | ['th', 'td']
BGCOLOR_ATTR | = | ['bgcolor']
LI_ELT | = | ['li']
UL_DEPR | = | ['type', 'compact']
DIR_ATTR | = | ['dir']

### Public Class methods

[](tag_name)

Get ElemementDescription for `tag_name`

### Public Instance methods

block?()

Is this element a block element?

default_sub_element

The default sub element for this element

default_sub_element()
deprecated?

Is this element deprecated?

deprecated?()
deprecated_attributes

A list of deprecated attributes for this element

deprecated_attributes()
description()
description

The description for this element

empty?

Is this an empty element?

implied_end_tag?

Can the end tag be implied for this tag?

implied_end_tag?()
implied_start_tag?

Can the start tag be implied for this tag?

implied_start_tag?()
inline?

Is this element an inline element?

inspect()

Inspection information

name

Get the tag name for this ElemementDescription

optional_attributes

A list of optional attributes for this element

optional_attributes()
required_attributes()
required_attributes

A list of required attributes for this element

save_end_tag?()
save_end_tag?

Should the end tag be saved?

sub_elements

A list of allowed sub elements for this element.

to_s()

Convert this description to a string

[Validate]