Class: Nokogiri::HTML4::ElementDescription
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Inherits: | Object |
Defined in: | ext/nokogiri/html4_element_description.c, ext/nokogiri/xml_reader.c, lib/nokogiri/html4/element_description.rb, lib/nokogiri/html4/element_description_defaults.rb |
Constant Summary
-
ACTION_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 435["action"]
-
ALIGN_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 422["align"]
-
ALT_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 238["alt"]
-
APPLET_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 245[ COREATTRS, "codebase", "archive", "alt", "name", "height", "width", "align", "hspace", "vspace", ]
-
AREA_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 257[ "shape", "coords", "href", "nohref", "tabindex", "accesskey", "onfocus", "onblur", ]
-
ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 211[COREATTRS, I18N, EVENTS]
-
A_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 220[ ATTRS, "charset", "type", "name", "href", "hreflang", "rel", "rev", "accesskey", "shape", "coords", "tabindex", "onfocus", "onblur", ]
-
BASEFONT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 267["id", "size", "color", "face"]
-
BGCOLOR_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 545["bgcolor"]
-
BLOCK =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 170[ HEADING, LIST, "pre", "p", "dl", "div", "center", "noscript", "noframes", "blockquote", "form", "isindex", "hr", "table", "fieldset", "address", ]
-
BLOCKLI_ELT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 436[BLOCK, "li"]
-
BODY_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 270[ATTRS, "onload", "onunload"]
-
BODY_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 269[FLOW, "ins", "del"]
-
BODY_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 271[ "background", "bgcolor", "text", "link", "vlink", "alink", ]
-
BUTTON_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 279[ ATTRS, "name", "value", "type", "disabled", "tabindex", "accesskey", "onfocus", "onblur", ]
-
CELLHALIGN =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 212["align", "char", "charoff"]
-
CELLVALIGN =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 213["valign"]
-
CLEAR_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 241["clear"]
-
COL_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 291[ATTRS, "span", "width", CELLHALIGN, CELLVALIGN]
-
COL_ELT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 292["col"]
-
COMPACT_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 296["compact"]
-
COMPACT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 294[ATTRS, "compact"]
-
CONTENT_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 438["content"]
-
COREATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 198["id", "class", "style", "title"]
-
CORE_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 217COREATTRS
-
CORE_I18N_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 216[COREATTRS, I18N]
-
DIR_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 548["dir"]
-
DL_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 295["dt", "dd"]
-
DefaultDescriptions =
This is filled in down below.
{}
-
EDIT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 293[ATTRS, "datetime", "cite"]
-
EMBED_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 376[ COREATTRS, "align", "alt", "border", "code", "codebase", "frameborder", "height", "hidden", "hspace", "name", "palette", "pluginspace", "pluginurl", "src", "type", "units", "vspace", "width", ]
-
EMPTY =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 191[]
-
EVENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 200[ "onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover", "onmouseout", "onkeypress", "onkeydown", "onkeyup", ]
-
FIELDSET_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 298[FLOW, "legend"]
-
FLOW =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 189[BLOCK, INLINE]
-
FLOW_PARAM =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 244[FLOW, "param"]
-
FONTSTYLE =
Attributes defined and categorized
["tt", "i", "b", "u", "s", "strike", "big", "small"]
-
FONT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 299[COREATTRS, I18N, "size", "color", "face"]
-
FORMCTRL =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 169["input", "select", "textarea", "label", "button"]
-
FORM_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 317[ ATTRS, "method", "enctype", "accept", "name", "onsubmit", "onreset", "accept-charset", ]
-
FORM_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 300[ HEADING, LIST, INLINE, "pre", "p", "div", "center", "noscript", "noframes", "blockquote", "isindex", "hr", "table", "fieldset", "address", ]
-
FRAMESET_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 338[COREATTRS, "rows", "cols", "onload", "onunload"]
-
FRAMESET_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 339["frameset", "frame", "noframes"]
-
FRAME_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 327[ COREATTRS, "longdesc", "name", "src", "frameborder", "marginwidth", "marginheight", "noresize", "scrolling", ]
-
HEADING =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 167["h1", "h2", "h3", "h4", "h5", "h6"]
-
HEAD_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 340[I18N, "profile"]
-
HEAD_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 341[ "title", "isindex", "base", "script", "style", "meta", "link", "object", ]
-
HREF_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 240["href"]
-
HR_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 351["align", "noshade", "size", "width"]
-
HTML_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 215ATTRS
-
HTML_CDATA =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 196HTML_PCDATA
-
HTML_CONTENT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 353["head", "body", "frameset"]
-
HTML_FLOW =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 193FLOW
-
HTML_INLINE =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 194INLINE
-
HTML_PCDATA =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 195PCDATA
-
I18N =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 199["lang", "dir"]
-
I18N_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 218I18N
-
IFRAME_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 354[ COREATTRS, "longdesc", "name", "src", "frameborder", "marginwidth", "marginheight", "scrolling", "align", "height", "width", ]
-
IMG_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 367[ ATTRS, "longdesc", "name", "height", "width", "usemap", "ismap", ]
-
INLINE =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 188[PCDATA, FONTSTYLE, PHRASE, SPECIAL, FORMCTRL]
-
INLINE_P =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 242[INLINE, "p"]
-
INPUT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 397[ ATTRS, "type", "name", "value", "checked", "disabled", "readonly", "size", "maxlength", "src", "alt", "usemap", "ismap", "tabindex", "accesskey", "onfocus", "onblur", "onselect", "onchange", "accept", ]
-
LABEL_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 297["label"]
-
LABEL_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 420[ATTRS, "for", "accesskey", "onfocus", "onblur"]
-
LANGUAGE_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 483["language"]
-
LEGEND_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 421[ATTRS, "accesskey"]
-
LINK_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 423[ ATTRS, "charset", "href", "hreflang", "type", "rel", "rev", "media", ]
-
LIST =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 168["ul", "ol", "dir", "menu"]
-
LI_ELT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 546["li"]
-
MAP_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 433[BLOCK, "area"]
-
META_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 437[I18N, "http-equiv", "name", "scheme"]
-
MODIFIER =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 190[]
-
NAME_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 434["name"]
-
NOFRAMES_CONTENT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 440["body", FLOW, MODIFIER]
-
OBJECT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 442[ ATTRS, "declare", "classid", "codebase", "data", "type", "codetype", "archive", "standby", "height", "width", "usemap", "name", "tabindex", ]
-
OBJECT_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 441[FLOW, "param"]
-
OBJECT_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 458["align", "border", "hspace", "vspace"]
-
OL_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 459["type", "compact", "start"]
-
OPTGROUP_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 461[ATTRS, "disabled"]
-
OPTION_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 462[ATTRS, "disabled", "label", "selected", "value"]
-
OPTION_ELT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 460["option"]
-
PARAM_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 463["id", "value", "valuetype", "type"]
-
PCDATA =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 166[]
-
PHRASE =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 136[ "em", "strong", "dfn", "code", "samp", "kbd", "var", "cite", "abbr", "acronym", ]
-
PRE_CONTENT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 465[ PHRASE, "tt", "i", "b", "u", "s", "strike", "a", "br", "script", "map", "q", "span", "bdo", "iframe", ]
-
PROMPT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 419[COREATTRS, I18N, "prompt"]
-
QUOTE_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 268[ATTRS, "cite"]
-
ROWS_COLS_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 237["rows", "cols"]
-
SCRIPT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 482["charset", "src", "defer", "event", "for"]
-
SELECT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 485[ ATTRS, "name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange", ]
-
SELECT_CONTENT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 484["optgroup", "option"]
-
SPECIAL =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 148[ "a", "img", "applet", "embed", "object", "font", "basefont", "br", "script", "map", "q", "sub", "sup", "span", "bdo", "iframe", ]
-
SRC_ALT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 239["src", "alt"]
-
STYLE_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 496[I18N, "media", "title"]
-
TABLE_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 497[ ATTRS, "summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding", "datapagesize", ]
-
TABLE_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 509[ "caption", "col", "colgroup", "thead", "tfoot", "tbody", "tr", ]
-
TABLE_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 508["align", "bgcolor"]
-
TALIGN_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 519[ATTRS, CELLHALIGN, CELLVALIGN]
-
TARGET_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 236["target"]
-
TEXTAREA_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 532[ ATTRS, "name", "disabled", "readonly", "tabindex", "accesskey", "onfocus", "onblur", "onselect", "onchange", ]
-
TH_TD_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 521[ ATTRS, "abbr", "axis", "headers", "scope", "rowspan", "colspan", CELLHALIGN, CELLVALIGN, ]
-
TH_TD_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 520["nowrap", "bgcolor", "width", "height"]
-
TR_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 544["th", "td"]
-
TR_ELT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 518["tr"]
-
TYPE_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 439["type"]
-
UL_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 547["type", "compact"]
-
VERSION_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 352["version"]
-
WIDTH_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 464["width"]
Class Method Summary
-
.[](tag_name)
Get ElementDescription for
tag_name
Instance Attribute Summary
-
#block? ⇒ Boolean
readonly
Is this element a block element?
-
#deprecated? ⇒ Boolean
readonly
Is this element deprecated?
-
#empty? ⇒ Boolean
readonly
Is this an empty element?
-
#implied_end_tag? ⇒ Boolean
readonly
Can the end tag be implied for this tag?
-
#implied_start_tag? ⇒ Boolean
readonly
Can the start tag be implied for this tag?
-
#inline? ⇒ Boolean
readonly
Is this element an inline element?
-
#save_end_tag? ⇒ Boolean
readonly
Should the end tag be saved?
Instance Method Summary
-
#default_sub_element
The default sub element for this element.
-
#deprecated_attributes
A list of deprecated attributes for this element.
-
#description
The description for this element.
-
#inspect
Inspection information.
-
#name
Alias for XML::Reader#name.
-
#optional_attributes
A list of optional attributes for this element.
-
#required_attributes
A list of required attributes for this element.
-
#sub_elements
A list of allowed sub elements for this element.
-
#to_s
Convert this description to a string.
- #default_desc private
Class Method Details
.[](tag_name)
Get ElementDescription for tag_name
# File 'ext/nokogiri/html4_element_description.c', line 266
static VALUE get_description(VALUE klass, VALUE tag_name) { const htmlElemDesc *description = htmlTagLookup( (const xmlChar *)StringValueCStr(tag_name) ); if (NULL == description) { return Qnil; } return TypedData_Wrap_Struct(klass, &html_elem_desc_type, DISCARD_CONST_QUAL(void *, description)); }
Instance Attribute Details
#block? ⇒ Boolean
(readonly)
Is this element a block element?
# File 'lib/nokogiri/html4/element_description.rb', line 8
def block? !inline? end
#deprecated? ⇒ Boolean
(readonly)
Is this element deprecated?
# File 'ext/nokogiri/html4_element_description.c', line 170
static VALUE deprecated_eh(VALUE self) { const htmlElemDesc *description; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); if (description->depr) { return Qtrue; } return Qfalse; }
#empty? ⇒ Boolean
(readonly)
Is this an empty element?
# File 'ext/nokogiri/html4_element_description.c', line 186
static VALUE empty_eh(VALUE self) { const htmlElemDesc *description; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); if (description->empty) { return Qtrue; } return Qfalse; }
#implied_end_tag? ⇒ Boolean
(readonly)
Can the end tag be implied for this tag?
# File 'ext/nokogiri/html4_element_description.c', line 218
static VALUE implied_end_tag_eh(VALUE self) { const htmlElemDesc *description; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); if (description->endTag) { return Qtrue; } return Qfalse; }
#implied_start_tag? ⇒ Boolean
(readonly)
Can the start tag be implied for this tag?
# File 'ext/nokogiri/html4_element_description.c', line 234
static VALUE implied_start_tag_eh(VALUE self) { const htmlElemDesc *description; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); if (description->startTag) { return Qtrue; } return Qfalse; }
#inline? ⇒ Boolean
(readonly)
Is this element an inline element?
# File 'ext/nokogiri/html4_element_description.c', line 154
static VALUE inline_eh(VALUE self) { const htmlElemDesc *description; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); if (description->isinline) { return Qtrue; } return Qfalse; }
#save_end_tag? ⇒ Boolean
(readonly)
Should the end tag be saved?
# File 'ext/nokogiri/html4_element_description.c', line 202
static VALUE save_end_tag_eh(VALUE self) { const htmlElemDesc *description; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); if (description->saveEndTag) { return Qtrue; } return Qfalse; }
Instance Method Details
#default_desc (private)
[ GitHub ]# File 'lib/nokogiri/html4/element_description_defaults.rb', line 31
def default_desc DefaultDescriptions[name.downcase] end
#default_sub_element
The default sub element for this element
# File 'ext/nokogiri/html4_element_description.c', line 94
static VALUE default_sub_element(VALUE self) { const htmlElemDesc *description; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); if (description->defaultsubelt) { return NOKOGIRI_STR_NEW2(description->defaultsubelt); } return Qnil; }
#deprecated_attributes
A list of deprecated attributes for this element
# File 'ext/nokogiri/html4_element_description.c', line 42
static VALUE deprecated_attributes(VALUE self) { const htmlElemDesc *description; VALUE list; int i; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); list = rb_ary_new(); if (NULL == description->attrs_depr) { return list; } for (i = 0; description->attrs_depr[i]; i++) { rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_depr[i])); } return list; }
#description
The description for this element
# File 'ext/nokogiri/html4_element_description.c', line 139
static VALUE description(VALUE self) { const htmlElemDesc *description; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); return NOKOGIRI_STR_NEW2(description->desc); }
#inspect
Inspection information
# File 'lib/nokogiri/html4/element_description.rb', line 20
def inspect "#<#{self.class.name}: #{name} #{description}>" end
#name
Alias for XML::Reader#name.
#optional_attributes
A list of optional attributes for this element
# File 'ext/nokogiri/html4_element_description.c', line 68
static VALUE optional_attributes(VALUE self) { const htmlElemDesc *description; VALUE list; int i; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); list = rb_ary_new(); if (NULL == description->attrs_opt) { return list; } for (i = 0; description->attrs_opt[i]; i++) { rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_opt[i])); } return list; }
#required_attributes
A list of required attributes for this element
# File 'ext/nokogiri/html4_element_description.c', line 16
static VALUE required_attributes(VALUE self) { const htmlElemDesc *description; VALUE list; int i; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); list = rb_ary_new(); if (NULL == description->attrs_req) { return list; } for (i = 0; description->attrs_depr[i]; i++) { rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_req[i])); } return list; }
#sub_elements
A list of allowed sub elements for this element.
# File 'ext/nokogiri/html4_element_description.c', line 113
static VALUE sub_elements(VALUE self) { const htmlElemDesc *description; VALUE list; int i; TypedData_Get_Struct(self, htmlElemDesc, &html_elem_desc_type, description); list = rb_ary_new(); if (NULL == description->subelts) { return list; } for (i = 0; description->subelts[i]; i++) { rb_ary_push(list, NOKOGIRI_STR_NEW2(description->subelts[i])); } return list; }
#to_s
Convert this description to a string
# File 'lib/nokogiri/html4/element_description.rb', line 14
def to_s "#{name}: #{description}" end