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 436["action"]
-
ALIGN_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 423["align"]
-
ALT_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 239["alt"]
-
APPLET_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 246[ COREATTRS, "codebase", "archive", "alt", "name", "height", "width", "align", "hspace", "vspace", ]
-
AREA_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 258[ "shape", "coords", "href", "nohref", "tabindex", "accesskey", "onfocus", "onblur", ]
-
ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 212[COREATTRS, I18N, EVENTS]
-
A_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 221[ 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 268["id", "size", "color", "face"]
-
BGCOLOR_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 546["bgcolor"]
-
BLOCK =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 171[ 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 437[BLOCK, "li"]
-
BODY_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 271[ATTRS, "onload", "onunload"]
-
BODY_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 270[FLOW, "ins", "del"]
-
BODY_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 272[ "background", "bgcolor", "text", "link", "vlink", "alink", ]
-
BUTTON_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 280[ ATTRS, "name", "value", "type", "disabled", "tabindex", "accesskey", "onfocus", "onblur", ]
-
CELLHALIGN =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 213["align", "char", "charoff"]
-
CELLVALIGN =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 214["valign"]
-
CLEAR_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 242["clear"]
-
COL_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 292[ATTRS, "span", "width", CELLHALIGN, CELLVALIGN]
-
COL_ELT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 293["col"]
-
COMPACT_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 297["compact"]
-
COMPACT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 295[ATTRS, "compact"]
-
CONTENT_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 439["content"]
-
COREATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 199["id", "class", "style", "title"]
-
CORE_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 218COREATTRS
-
CORE_I18N_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 217[COREATTRS, I18N]
-
DIR_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 549["dir"]
-
DL_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 296["dt", "dd"]
-
DefaultDescriptions =
This is filled in down below.
{}
-
EDIT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 294[ATTRS, "datetime", "cite"]
-
EMBED_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 377[ 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 192[]
-
EVENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 201[ "onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover", "onmouseout", "onkeypress", "onkeydown", "onkeyup", ]
-
FIELDSET_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 299[FLOW, "legend"]
-
FLOW =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 190[BLOCK, INLINE]
-
FLOW_PARAM =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 245[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 300[COREATTRS, I18N, "size", "color", "face"]
-
FORMCTRL =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 170["input", "select", "textarea", "label", "button"]
-
FORM_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 318[ ATTRS, "method", "enctype", "accept", "name", "onsubmit", "onreset", "accept-charset", ]
-
FORM_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 301[ 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 339[COREATTRS, "rows", "cols", "onload", "onunload"]
-
FRAMESET_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 340["frameset", "frame", "noframes"]
-
FRAME_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 328[ COREATTRS, "longdesc", "name", "src", "frameborder", "marginwidth", "marginheight", "noresize", "scrolling", ]
-
HEADING =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 168["h1", "h2", "h3", "h4", "h5", "h6"]
-
HEAD_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 341[I18N, "profile"]
-
HEAD_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 342[ "title", "isindex", "base", "script", "style", "meta", "link", "object", ]
-
HREF_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 241["href"]
-
HR_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 352["align", "noshade", "size", "width"]
-
HTML_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 216ATTRS
-
HTML_CDATA =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 197HTML_PCDATA
-
HTML_CONTENT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 354["head", "body", "frameset"]
-
HTML_FLOW =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 194FLOW
-
HTML_INLINE =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 195INLINE
-
HTML_PCDATA =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 196PCDATA
-
I18N =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 200["lang", "dir"]
-
I18N_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 219I18N
-
IFRAME_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 355[ COREATTRS, "longdesc", "name", "src", "frameborder", "marginwidth", "marginheight", "scrolling", "align", "height", "width", ]
-
IMG_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 368[ ATTRS, "longdesc", "name", "height", "width", "usemap", "ismap", ]
-
INLINE =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 189[PCDATA, FONTSTYLE, PHRASE, SPECIAL, FORMCTRL]
-
INLINE_P =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 243[INLINE, "p"]
-
INPUT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 398[ 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 298["label"]
-
LABEL_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 421[ATTRS, "for", "accesskey", "onfocus", "onblur"]
-
LANGUAGE_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 484["language"]
-
LEGEND_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 422[ATTRS, "accesskey"]
-
LINK_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 424[ ATTRS, "charset", "href", "hreflang", "type", "rel", "rev", "media", ]
-
LIST =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 169["ul", "ol", "dir", "menu"]
-
LI_ELT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 547["li"]
-
MAP_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 434[BLOCK, "area"]
-
META_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 438[I18N, "http-equiv", "name", "scheme"]
-
MODIFIER =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 191[]
-
NAME_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 435["name"]
-
NOFRAMES_CONTENT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 441["body", FLOW, MODIFIER]
-
OBJECT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 443[ 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 442[FLOW, "param"]
-
OBJECT_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 459["align", "border", "hspace", "vspace"]
-
OL_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 460["type", "compact", "start"]
-
OPTGROUP_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 462[ATTRS, "disabled"]
-
OPTION_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 463[ATTRS, "disabled", "label", "selected", "value"]
-
OPTION_ELT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 461["option"]
-
PARAM_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 464["id", "value", "valuetype", "type"]
-
PCDATA =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 167[]
-
PHRASE =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 137[ "em", "strong", "dfn", "code", "samp", "kbd", "var", "cite", "abbr", "acronym", ]
-
PRE_CONTENT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 466[ 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 420[COREATTRS, I18N, "prompt"]
-
QUOTE_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 269[ATTRS, "cite"]
-
ROWS_COLS_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 238["rows", "cols"]
-
SCRIPT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 483["charset", "src", "defer", "event", "for"]
-
SELECT_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 486[ ATTRS, "name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange", ]
-
SELECT_CONTENT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 485["optgroup", "option"]
-
SPECIAL =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 149[ "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 240["src", "alt"]
-
STYLE_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 497[I18N, "media", "title"]
-
TABLE_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 498[ ATTRS, "summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding", "datapagesize", ]
-
TABLE_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 510[ "caption", "col", "colgroup", "thead", "tfoot", "tbody", "tr", ]
-
TABLE_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 509["align", "bgcolor"]
-
TALIGN_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 520[ATTRS, CELLHALIGN, CELLVALIGN]
-
TARGET_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 237["target"]
-
TEXTAREA_ATTRS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 533[ ATTRS, "name", "disabled", "readonly", "tabindex", "accesskey", "onfocus", "onblur", "onselect", "onchange", ]
-
TH_TD_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 522[ ATTRS, "abbr", "axis", "headers", "scope", "rowspan", "colspan", CELLHALIGN, CELLVALIGN, ]
-
TH_TD_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 521["nowrap", "bgcolor", "width", "height"]
-
TR_CONTENTS =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 545["th", "td"]
-
TR_ELT =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 519["tr"]
-
TYPE_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 440["type"]
-
UL_DEPR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 548["type", "compact"]
-
VERSION_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 353["version"]
-
WIDTH_ATTR =
# File 'lib/nokogiri/html4/element_description_defaults.rb', line 465["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 32
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