diff options
author | Rupinder Singh Khokhar <rsk1coder99@gmail.com> | 2014-07-02 08:04:04 +0530 |
---|---|---|
committer | Rupinder Singh Khokhar <rsk1coder99@gmail.com> | 2014-08-01 21:44:30 +0530 |
commit | fab42cda1c4e8831c33f113e83f6966e38e47425 (patch) | |
tree | fbd3eab4a61c9c0004f5f27bd83e31a3439e3438 /src/treebuilder/treebuilder.c | |
parent | 751b5c694e39f8c9c271061fbb4d518e27cee928 (diff) | |
download | libhubbub-fab42cda1c4e8831c33f113e83f6966e38e47425.tar.gz libhubbub-fab42cda1c4e8831c33f113e83f6966e38e47425.tar.bz2 |
fixed dd,dt&li handler. Also fixed the scoping lists. Also added a missing summary tag to the start tag processor conditional.
Diffstat (limited to 'src/treebuilder/treebuilder.c')
-rw-r--r-- | src/treebuilder/treebuilder.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/treebuilder/treebuilder.c b/src/treebuilder/treebuilder.c index 45197b1..9e5734b 100644 --- a/src/treebuilder/treebuilder.c +++ b/src/treebuilder/treebuilder.c @@ -495,12 +495,11 @@ hubbub_error parse_generic_rcdata(hubbub_treebuilder *treebuilder, * * \param treebuilder Treebuilder to look in * \param type Element type to find - * \param in_table Whether we're looking in table scope - * \param in_button Whether we're looking in button scope + * \param scope The scope we're looking in * \return Element stack index, or 0 if not in scope */ uint32_t element_in_scope(hubbub_treebuilder *treebuilder, - element_type type, bool in_table, bool in_button) + element_type type, element_scope scope) { uint32_t node; @@ -518,17 +517,28 @@ uint32_t element_in_scope(hubbub_treebuilder *treebuilder, if (node_type == type) return node; - if (node_type == TABLE) + if (scope == TABLE_SCOPE && ( + node_type == TABLE || + node_type == HTML || + node_type == TEMPLATE)) break; - /* The list of element types given in the spec here are the - * scoping elements excluding TABLE and HTML and BUTTON. TABLE is handled - * in the previous conditional and HTML should only occur + if (scope == SELECT_SCOPE && + node_type != OPTGROUP && + node_type != OPTION) + break; + + /* The list of element types of the normal scope given in the spec here are the + * scoping elements excluding HTML and BUTTON. HTML should only occur * as the first node in the stack, which is never processed * in this loop. */ - if (!in_table && (node_type != BUTTON || ( - in_button && node_type == BUTTON)) && - (is_scoping_element(node_type) || + if (scope != TABLE_SCOPE && scope != SELECT_SCOPE && + ((scope == BUTTON_SCOPE && + node_type == BUTTON) || + (scope == LIST_ITEM_SCOPE && + (node_type == OL || + node_type == UL)) || + (node_type != BUTTON && is_scoping_element(node_type)) || (node_ns == HUBBUB_NS_SVG && ( node_type == FOREIGNOBJECT || node_type == DESC || |