summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2014-07-18 12:33:23 (GMT)
committer Daniel Silverstone <dsilvers@digital-scurf.org>2014-07-18 12:33:23 (GMT)
commit9aae1b6cc3ec89c96f0cdcc173405eef1d5b1c2c (patch)
treea620d0d2f56db44778157ac7925b2b8fa9899e5b
parentdb5517f4e24d0e7c39a405ce1b363c887196784a (diff)
parentd293e6e7ffdc9224ffba9593f4cc8f73701f2cd5 (diff)
downloadlibdom-9aae1b6cc3ec89c96f0cdcc173405eef1d5b1c2c.tar.gz
libdom-9aae1b6cc3ec89c96f0cdcc173405eef1d5b1c2c.tar.bz2
Merge remote-tracking branch 'origin/rupindersingh/libdom_recovered'
Reviewed-By: Daniel Silverstone <dsilvers@netsurf-browser.org>
-rw-r--r--Makefile38
-rw-r--r--include/dom/dom.h38
-rw-r--r--include/dom/html/html_anchor_element.h87
-rw-r--r--include/dom/html/html_applet_element.h78
-rw-r--r--include/dom/html/html_area_element.h62
-rw-r--r--include/dom/html/html_base_element.h16
-rw-r--r--include/dom/html/html_basefont_element.h27
-rw-r--r--include/dom/html/html_br_element.h16
-rw-r--r--include/dom/html/html_directory_element.h16
-rw-r--r--include/dom/html/html_div_element.h16
-rw-r--r--include/dom/html/html_dlist_element.h16
-rw-r--r--include/dom/html/html_document.h10
-rw-r--r--include/dom/html/html_fieldset_element.h17
-rw-r--r--include/dom/html/html_font_element.h27
-rw-r--r--include/dom/html/html_frame_element.h63
-rw-r--r--include/dom/html/html_frameset_element.h22
-rw-r--r--include/dom/html/html_heading_element.h16
-rw-r--r--include/dom/html/html_iframe_element.h75
-rw-r--r--include/dom/html/html_image_element.h84
-rw-r--r--include/dom/html/html_input_element.h4
-rw-r--r--include/dom/html/html_isindex_element.h6
-rw-r--r--include/dom/html/html_label_element.h26
-rw-r--r--include/dom/html/html_legend_element.h27
-rw-r--r--include/dom/html/html_li_element.h22
-rw-r--r--include/dom/html/html_map_element.h21
-rw-r--r--include/dom/html/html_menu_element.h16
-rw-r--r--include/dom/html/html_mod_element.h22
-rw-r--r--include/dom/html/html_object_element.h121
-rw-r--r--include/dom/html/html_olist_element.h28
-rw-r--r--include/dom/html/html_option_element.h2
-rw-r--r--include/dom/html/html_paragraph_element.h16
-rw-r--r--include/dom/html/html_param_element.h34
-rw-r--r--include/dom/html/html_pre_element.h16
-rw-r--r--include/dom/html/html_quote_element.h16
-rw-r--r--include/dom/html/html_script_element.h52
-rw-r--r--include/dom/html/html_style_element.h13
-rw-r--r--include/dom/html/html_table_element.h123
-rw-r--r--include/dom/html/html_tablecaption_element.h16
-rw-r--r--include/dom/html/html_tablecell_element.h99
-rw-r--r--include/dom/html/html_tablecol_element.h48
-rw-r--r--include/dom/html/html_tablerow_element.h62
-rw-r--r--include/dom/html/html_tablesection_element.h52
-rw-r--r--include/dom/html/html_ulist_element.h22
-rw-r--r--src/html/Makefile29
-rw-r--r--src/html/TODO88
-rw-r--r--src/html/html_anchor_element.c220
-rw-r--r--src/html/html_anchor_element.h45
-rw-r--r--src/html/html_applet_element.c191
-rw-r--r--src/html/html_applet_element.h45
-rw-r--r--src/html/html_area_element.c215
-rw-r--r--src/html/html_area_element.h45
-rw-r--r--src/html/html_base_element.c43
-rw-r--r--src/html/html_basefont_element.c177
-rw-r--r--src/html/html_basefont_element.h45
-rw-r--r--src/html/html_br_element.c155
-rw-r--r--src/html/html_br_element.h45
-rw-r--r--src/html/html_collection.c29
-rw-r--r--src/html/html_directory_element.c140
-rw-r--r--src/html/html_directory_element.h45
-rw-r--r--src/html/html_div_element.c154
-rw-r--r--src/html/html_div_element.h45
-rw-r--r--src/html/html_dlist_element.c140
-rw-r--r--src/html/html_dlist_element.h45
-rw-r--r--src/html/html_document.c384
-rw-r--r--src/html/html_document.h7
-rw-r--r--src/html/html_document_strings.h44
-rw-r--r--src/html/html_fieldset_element.c146
-rw-r--r--src/html/html_fieldset_element.h46
-rw-r--r--src/html/html_font_element.c157
-rw-r--r--src/html/html_font_element.h45
-rw-r--r--src/html/html_form_element.c2
-rw-r--r--src/html/html_frame_element.c280
-rw-r--r--src/html/html_frame_element.h47
-rw-r--r--src/html/html_frameset_element.c229
-rw-r--r--src/html/html_frameset_element.h46
-rw-r--r--src/html/html_heading_element.c156
-rw-r--r--src/html/html_heading_element.h45
-rw-r--r--src/html/html_iframe_element.c262
-rw-r--r--src/html/html_iframe_element.h48
-rw-r--r--src/html/html_image_element.c245
-rw-r--r--src/html/html_image_element.h45
-rw-r--r--src/html/html_input_element.c45
-rw-r--r--src/html/html_input_element.h2
-rw-r--r--src/html/html_isindex_element.c81
-rw-r--r--src/html/html_isindex_element.h4
-rw-r--r--src/html/html_label_element.c187
-rw-r--r--src/html/html_label_element.h47
-rw-r--r--src/html/html_legend_element.c208
-rw-r--r--src/html/html_legend_element.h46
-rw-r--r--src/html/html_li_element.c177
-rw-r--r--src/html/html_li_element.h45
-rw-r--r--src/html/html_map_element.c188
-rw-r--r--src/html/html_map_element.h47
-rw-r--r--src/html/html_menu_element.c140
-rw-r--r--src/html/html_menu_element.h45
-rw-r--r--src/html/html_mod_element.c156
-rw-r--r--src/html/html_mod_element.h45
-rw-r--r--src/html/html_object_element.c259
-rw-r--r--src/html/html_object_element.h49
-rw-r--r--src/html/html_olist_element.c201
-rw-r--r--src/html/html_olist_element.h45
-rw-r--r--src/html/html_option_element.c19
-rw-r--r--src/html/html_options_collection.c4
-rw-r--r--src/html/html_paragraph_element.c154
-rw-r--r--src/html/html_paragraph_element.h45
-rw-r--r--src/html/html_param_element.c155
-rw-r--r--src/html/html_param_element.h45
-rw-r--r--src/html/html_pre_element.c136
-rw-r--r--src/html/html_pre_element.h45
-rw-r--r--src/html/html_quote_element.c154
-rw-r--r--src/html/html_quote_element.h45
-rw-r--r--src/html/html_script_element.c213
-rw-r--r--src/html/html_script_element.h45
-rw-r--r--src/html/html_select_element.c150
-rw-r--r--src/html/html_style_element.c83
-rw-r--r--src/html/html_style_element.h2
-rw-r--r--src/html/html_table_element.c740
-rw-r--r--src/html/html_table_element.h56
-rw-r--r--src/html/html_tablecaption_element.c153
-rw-r--r--src/html/html_tablecaption_element.h45
-rw-r--r--src/html/html_tablecell_element.c306
-rw-r--r--src/html/html_tablecell_element.h47
-rw-r--r--src/html/html_tablecol_element.c181
-rw-r--r--src/html/html_tablecol_element.h45
-rw-r--r--src/html/html_tablerow_element.c368
-rw-r--r--src/html/html_tablerow_element.h46
-rw-r--r--src/html/html_tablesection_element.c279
-rw-r--r--src/html/html_tablesection_element.h47
-rw-r--r--src/html/html_text_area_element.c16
-rw-r--r--src/html/html_ulist_element.c177
-rw-r--r--src/html/html_ulist_element.h45
-rw-r--r--test/DOMTSHandler.pm121
-rw-r--r--test/Makefile3
-rw-r--r--test/dom1-interfaces.xml119
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement01.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement02.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement02.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement03.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement03.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement04.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement04.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement05.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement05.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement06.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement06.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement07.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement07.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement08.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement08.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement09.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement09.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement10.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement10.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement11.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement11.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement12.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement12.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement13.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement13.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAnchorElement14.xml (renamed from test/testcases/tests/level1/html/HTMLAnchorElement14.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAppletElement01.xml (renamed from test/testcases/tests/level1/html/HTMLAppletElement01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAppletElement02.xml (renamed from test/testcases/tests/level1/html/HTMLAppletElement02.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAppletElement03.xml (renamed from test/testcases/tests/level1/html/HTMLAppletElement03.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAppletElement04.xml (renamed from test/testcases/tests/level1/html/HTMLAppletElement04.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAppletElement05.xml (renamed from test/testcases/tests/level1/html/HTMLAppletElement05.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAppletElement06.xml (renamed from test/testcases/tests/level1/html/HTMLAppletElement06.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAppletElement07.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLAppletElement07.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAppletElement08.xml (renamed from test/testcases/tests/level1/html/HTMLAppletElement08.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAppletElement09.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLAppletElement09.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAppletElement10.xml (renamed from test/testcases/tests/level1/html/HTMLAppletElement10.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAppletElement11.xml (renamed from test/testcases/tests/level1/html/HTMLAppletElement11.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAreaElement01.xml (renamed from test/testcases/tests/level1/html/HTMLAreaElement01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAreaElement02.xml (renamed from test/testcases/tests/level1/html/HTMLAreaElement02.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAreaElement03.xml (renamed from test/testcases/tests/level1/html/HTMLAreaElement03.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAreaElement04.xml (renamed from test/testcases/tests/level1/html/HTMLAreaElement04.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAreaElement05.xml (renamed from test/testcases/tests/level1/html/HTMLAreaElement05.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAreaElement06.xml (renamed from test/testcases/tests/level1/html/HTMLAreaElement06.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAreaElement07.xml (renamed from test/testcases/tests/level1/html/HTMLAreaElement07.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLAreaElement08.xml (renamed from test/testcases/tests/level1/html/HTMLAreaElement08.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLBRElement01.xml (renamed from test/testcases/tests/level1/html/HTMLBRElement01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLBaseElement01.xml (renamed from test/testcases/tests/level1/html/HTMLBaseElement01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLBaseElement02.xml (renamed from test/testcases/tests/level1/html/HTMLBaseElement02.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLBaseFontElement01.xml (renamed from test/testcases/tests/level1/html/HTMLBaseFontElement01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLBaseFontElement02.xml (renamed from test/testcases/tests/level1/html/HTMLBaseFontElement02.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLBaseFontElement03.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLBaseFontElement03.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLCollection01.xml.notimpl49
-rw-r--r--test/testcases/tests/level1/html/HTMLCollection02.xml.kfail49
-rw-r--r--test/testcases/tests/level1/html/HTMLCollection03.xml.kfail49
-rw-r--r--test/testcases/tests/level1/html/HTMLCollection04.xml (renamed from test/testcases/tests/level1/html/HTMLCollection04.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLCollection05.xml (renamed from test/testcases/tests/level1/html/HTMLCollection05.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLCollection06.xml (renamed from test/testcases/tests/level1/html/HTMLCollection06.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLCollection07.xml (renamed from test/testcases/tests/level1/html/HTMLCollection07.xml.notimpl)2
-rw-r--r--test/testcases/tests/level1/html/HTMLCollection08.xml (renamed from test/testcases/tests/level1/html/HTMLCollection08.xml.notimpl)2
-rw-r--r--test/testcases/tests/level1/html/HTMLCollection09.xml (renamed from test/testcases/tests/level1/html/HTMLCollection09.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLCollection10.xml (renamed from test/testcases/tests/level1/html/HTMLCollection10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLCollection11.xml (renamed from test/testcases/tests/level1/html/HTMLCollection11.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDirectoryElement01.xml (renamed from test/testcases/tests/level1/html/HTMLDirectoryElement01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDivElement01.xml (renamed from test/testcases/tests/level1/html/HTMLDivElement01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDlistElement01.xml (renamed from test/testcases/tests/level1/html/HTMLDlistElement01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument02.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument02.xml)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument03.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument03.xml)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument04.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument04.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument05.xml (renamed from test/testcases/tests/level1/html/HTMLDocument05.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument07.xml (renamed from test/testcases/tests/level1/html/HTMLDocument07.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument08.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument08.xml.notimpl)1
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument09.xml (renamed from test/testcases/tests/level1/html/HTMLDocument09.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument10.xml (renamed from test/testcases/tests/level1/html/HTMLDocument10.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument11.xml (renamed from test/testcases/tests/level1/html/HTMLDocument11.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument12.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument12.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument13.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument13.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument14.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument14.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument15.xml (renamed from test/testcases/tests/level1/html/HTMLDocument15.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument16.xml (renamed from test/testcases/tests/level1/html/HTMLDocument16.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument17.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument17.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument18.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument18.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument19.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument19.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument20.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument20.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLDocument21.xml.kfail (renamed from test/testcases/tests/level1/html/HTMLDocument21.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFieldSetElement01.xml (renamed from test/testcases/tests/level1/html/HTMLFieldSetElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFieldSetElement02.xml (renamed from test/testcases/tests/level1/html/HTMLFieldSetElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFontElement01.xml (renamed from test/testcases/tests/level1/html/HTMLFontElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFontElement02.xml (renamed from test/testcases/tests/level1/html/HTMLFontElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFontElement03.xml (renamed from test/testcases/tests/level1/html/HTMLFontElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFormElement01.xml (renamed from test/testcases/tests/level1/html/HTMLFormElement01.xml.int-broken)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFormElement02.xml (renamed from test/testcases/tests/level1/html/HTMLFormElement02.xml.int-broken)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFrameElement01.xml (renamed from test/testcases/tests/level1/html/HTMLFrameElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFrameElement02.xml (renamed from test/testcases/tests/level1/html/HTMLFrameElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFrameElement03.xml (renamed from test/testcases/tests/level1/html/HTMLFrameElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFrameElement04.xml (renamed from test/testcases/tests/level1/html/HTMLFrameElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFrameElement05.xml (renamed from test/testcases/tests/level1/html/HTMLFrameElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFrameElement06.xml (renamed from test/testcases/tests/level1/html/HTMLFrameElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFrameElement07.xml (renamed from test/testcases/tests/level1/html/HTMLFrameElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFrameElement08.xml (renamed from test/testcases/tests/level1/html/HTMLFrameElement08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFrameSetElement01.xml (renamed from test/testcases/tests/level1/html/HTMLFrameSetElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLFrameSetElement02.xml (renamed from test/testcases/tests/level1/html/HTMLFrameSetElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLHeadingElement01.xml (renamed from test/testcases/tests/level1/html/HTMLHeadingElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLHeadingElement02.xml (renamed from test/testcases/tests/level1/html/HTMLHeadingElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLHeadingElement03.xml (renamed from test/testcases/tests/level1/html/HTMLHeadingElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLHeadingElement04.xml (renamed from test/testcases/tests/level1/html/HTMLHeadingElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLHeadingElement05.xml (renamed from test/testcases/tests/level1/html/HTMLHeadingElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLHeadingElement06.xml (renamed from test/testcases/tests/level1/html/HTMLHeadingElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLIFrameElement01.xml (renamed from test/testcases/tests/level1/html/HTMLIFrameElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLIFrameElement02.xml (renamed from test/testcases/tests/level1/html/HTMLIFrameElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLIFrameElement03.xml (renamed from test/testcases/tests/level1/html/HTMLIFrameElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLIFrameElement04.xml (renamed from test/testcases/tests/level1/html/HTMLIFrameElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLIFrameElement05.xml (renamed from test/testcases/tests/level1/html/HTMLIFrameElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLIFrameElement06.xml (renamed from test/testcases/tests/level1/html/HTMLIFrameElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLIFrameElement07.xml (renamed from test/testcases/tests/level1/html/HTMLIFrameElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLIFrameElement08.xml (renamed from test/testcases/tests/level1/html/HTMLIFrameElement08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLIFrameElement09.xml (renamed from test/testcases/tests/level1/html/HTMLIFrameElement09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLIFrameElement10.xml (renamed from test/testcases/tests/level1/html/HTMLIFrameElement10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement01.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement02.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement03.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement04.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement07.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement08.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement09.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement10.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLInputElement21.xml (renamed from test/testcases/tests/level1/html/HTMLInputElement21.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLLIElement01.xml (renamed from test/testcases/tests/level1/html/HTMLLIElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLLIElement02.xml (renamed from test/testcases/tests/level1/html/HTMLLIElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLLabelElement01.xml (renamed from test/testcases/tests/level1/html/HTMLLabelElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLLabelElement02.xml (renamed from test/testcases/tests/level1/html/HTMLLabelElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLLabelElement03.xml (renamed from test/testcases/tests/level1/html/HTMLLabelElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLLabelElement04.xml (renamed from test/testcases/tests/level1/html/HTMLLabelElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLLegendElement01.xml (renamed from test/testcases/tests/level1/html/HTMLLegendElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLLegendElement02.xml (renamed from test/testcases/tests/level1/html/HTMLLegendElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLLegendElement03.xml (renamed from test/testcases/tests/level1/html/HTMLLegendElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLLegendElement04.xml (renamed from test/testcases/tests/level1/html/HTMLLegendElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLMapElement01.xml.kfail44
-rw-r--r--test/testcases/tests/level1/html/HTMLMapElement02.xml (renamed from test/testcases/tests/level1/html/HTMLMapElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLMenuElement01.xml (renamed from test/testcases/tests/level1/html/HTMLMenuElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLModElement01.xml (renamed from test/testcases/tests/level1/html/HTMLModElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLModElement02.xml (renamed from test/testcases/tests/level1/html/HTMLModElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLModElement03.xml (renamed from test/testcases/tests/level1/html/HTMLModElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLModElement04.xml (renamed from test/testcases/tests/level1/html/HTMLModElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLOListElement01.xml (renamed from test/testcases/tests/level1/html/HTMLOListElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLOListElement02.xml (renamed from test/testcases/tests/level1/html/HTMLOListElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLOListElement03.xml (renamed from test/testcases/tests/level1/html/HTMLOListElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement01.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement02.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement03.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement04.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement05.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement06.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement07.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement08.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement09.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement10.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement12.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement12.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement13.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement13.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement14.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement14.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement15.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement15.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement17.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement17.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement18.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement18.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLObjectElement19.xml (renamed from test/testcases/tests/level1/html/HTMLObjectElement19.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLOptionElement05.xml (renamed from test/testcases/tests/level1/html/HTMLOptionElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLParagraphElement01.xml (renamed from test/testcases/tests/level1/html/HTMLParagraphElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLParamElement01.xml (renamed from test/testcases/tests/level1/html/HTMLParamElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLParamElement02.xml (renamed from test/testcases/tests/level1/html/HTMLParamElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLParamElement03.xml (renamed from test/testcases/tests/level1/html/HTMLParamElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLParamElement04.xml (renamed from test/testcases/tests/level1/html/HTMLParamElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLPreElement01.xml (renamed from test/testcases/tests/level1/html/HTMLPreElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLQuoteElement01.xml (renamed from test/testcases/tests/level1/html/HTMLQuoteElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLQuoteElement02.xml (renamed from test/testcases/tests/level1/html/HTMLQuoteElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLScriptElement01.xml (renamed from test/testcases/tests/level1/html/HTMLScriptElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLScriptElement02.xml (renamed from test/testcases/tests/level1/html/HTMLScriptElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLScriptElement03.xml (renamed from test/testcases/tests/level1/html/HTMLScriptElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLScriptElement04.xml (renamed from test/testcases/tests/level1/html/HTMLScriptElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLScriptElement05.xml (renamed from test/testcases/tests/level1/html/HTMLScriptElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLScriptElement06.xml (renamed from test/testcases/tests/level1/html/HTMLScriptElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLScriptElement07.xml (renamed from test/testcases/tests/level1/html/HTMLScriptElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLSelectElement05.xml (renamed from test/testcases/tests/level1/html/HTMLSelectElement05.xml.int-broken)0
-rw-r--r--test/testcases/tests/level1/html/HTMLSelectElement16.xml (renamed from test/testcases/tests/level1/html/HTMLSelectElement16.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLSelectElement17.xml (renamed from test/testcases/tests/level1/html/HTMLSelectElement17.xml.int-broken)0
-rw-r--r--test/testcases/tests/level1/html/HTMLSelectElement18.xml (renamed from test/testcases/tests/level1/html/HTMLSelectElement18.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLSelectElement19.xml (renamed from test/testcases/tests/level1/html/HTMLSelectElement19.xml.kfail)2
-rw-r--r--test/testcases/tests/level1/html/HTMLStyleElement01.xml (renamed from test/testcases/tests/level1/html/HTMLStyleElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLStyleElement02.xml (renamed from test/testcases/tests/level1/html/HTMLStyleElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLStyleElement03.xml (renamed from test/testcases/tests/level1/html/HTMLStyleElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCaptionElement01.xml (renamed from test/testcases/tests/level1/html/HTMLTableCaptionElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement01.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement02.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement03.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement04.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement05.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement06.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement07.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement08.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement09.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement10.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement11.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement11.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement12.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement12.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement13.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement13.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement14.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement14.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement15.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement15.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement16.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement16.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement17.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement17.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement18.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement18.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement19.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement19.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement20.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement20.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement21.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement21.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement22.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement22.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement23.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement23.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement24.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement24.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement25.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement25.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement26.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement26.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement27.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement27.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement28.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement28.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement29.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement29.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement30.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement30.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement01.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement02.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement03.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement04.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement05.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement06.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement07.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement08.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement09.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement10.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement11.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement11.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableColElement12.xml (renamed from test/testcases/tests/level1/html/HTMLTableColElement12.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement01.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement02.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement03.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement04.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement05.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement06.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement07.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement08.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement09.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement10.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement11.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement11.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement12.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement12.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement13.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement13.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement14.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement14.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement15.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement15.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement16.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement16.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement17.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement17.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement18.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement18.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement19.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement19.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement20.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement20.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement21.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement21.xml.kfail)4
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement22.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement22.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement23.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement23.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement24.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement24.xml.kfail)4
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement25.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement25.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement26.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement26.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement27.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement27.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement28.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement28.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement29.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement29.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement30.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement30.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement31.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement31.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement32.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement32.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableElement33.xml (renamed from test/testcases/tests/level1/html/HTMLTableElement33.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement01.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement02.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement03.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement04.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement05.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement06.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement07.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement08.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement09.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement10.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement11.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement11.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement12.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement12.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement13.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement13.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableRowElement14.xml (renamed from test/testcases/tests/level1/html/HTMLTableRowElement14.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement01.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement02.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement03.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement04.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement05.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement06.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement07.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement08.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement09.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement10.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement11.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement11.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement12.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement12.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement13.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement13.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement14.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement14.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement15.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement15.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement16.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement16.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement17.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement17.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement18.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement18.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement19.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement19.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement20.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement20.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement21.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement21.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement22.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement22.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement23.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement23.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableSectionElement24.xml (renamed from test/testcases/tests/level1/html/HTMLTableSectionElement24.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLUListElement01.xml (renamed from test/testcases/tests/level1/html/HTMLUListElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLUListElement02.xml (renamed from test/testcases/tests/level1/html/HTMLUListElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/anchor01.xml (renamed from test/testcases/tests/level1/html/anchor01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/anchor02.xml (renamed from test/testcases/tests/level1/html/anchor02.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/anchor03.xml (renamed from test/testcases/tests/level1/html/anchor03.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/anchor04.xml.kfail (renamed from test/testcases/tests/level1/html/anchor04.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/anchor05.xml (renamed from test/testcases/tests/level1/html/anchor05.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/anchor06.xml (renamed from test/testcases/tests/level1/html/anchor06.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/area01.xml (renamed from test/testcases/tests/level1/html/area01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/area02.xml (renamed from test/testcases/tests/level1/html/area02.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/area03.xml (renamed from test/testcases/tests/level1/html/area03.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/area04.xml (renamed from test/testcases/tests/level1/html/area04.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/basefont01.xml (renamed from test/testcases/tests/level1/html/basefont01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/body01.xml (renamed from test/testcases/tests/level1/html/body01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/button01.xml (renamed from test/testcases/tests/level1/html/button01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/button02.xml (renamed from test/testcases/tests/level1/html/button02.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/button03.xml (renamed from test/testcases/tests/level1/html/button03.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/button04.xml (renamed from test/testcases/tests/level1/html/button04.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/button05.xml (renamed from test/testcases/tests/level1/html/button05.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/button06.xml (renamed from test/testcases/tests/level1/html/button06.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/button07.xml (renamed from test/testcases/tests/level1/html/button07.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/button08.xml (renamed from test/testcases/tests/level1/html/button08.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/button09.xml (renamed from test/testcases/tests/level1/html/button09.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/dlist01.xml (renamed from test/testcases/tests/level1/html/dlist01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/doc01.xml (renamed from test/testcases/tests/level1/html/doc01.xml.notimpl)0
-rw-r--r--test/testcases/tests/level1/html/files/object.html2
-rw-r--r--test/testcases/tests/level1/html/files/object.xhtml2
-rw-r--r--test/testcases/tests/level1/html/object01.xml (renamed from test/testcases/tests/level1/html/object01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object02.xml (renamed from test/testcases/tests/level1/html/object02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object03.xml (renamed from test/testcases/tests/level1/html/object03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object04.xml (renamed from test/testcases/tests/level1/html/object04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object05.xml (renamed from test/testcases/tests/level1/html/object05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object06.xml (renamed from test/testcases/tests/level1/html/object06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object07.xml (renamed from test/testcases/tests/level1/html/object07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object09.xml (renamed from test/testcases/tests/level1/html/object09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object10.xml (renamed from test/testcases/tests/level1/html/object10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object11.xml (renamed from test/testcases/tests/level1/html/object11.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object12.xml (renamed from test/testcases/tests/level1/html/object12.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object14.xml (renamed from test/testcases/tests/level1/html/object14.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/object15.xml (renamed from test/testcases/tests/level1/html/object15.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table01.xml (renamed from test/testcases/tests/level1/html/table01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table02.xml (renamed from test/testcases/tests/level1/html/table02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table03.xml (renamed from test/testcases/tests/level1/html/table03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table04.xml (renamed from test/testcases/tests/level1/html/table04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table06.xml (renamed from test/testcases/tests/level1/html/table06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table07.xml (renamed from test/testcases/tests/level1/html/table07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table08.xml (renamed from test/testcases/tests/level1/html/table08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table09.xml (renamed from test/testcases/tests/level1/html/table09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table10.xml (renamed from test/testcases/tests/level1/html/table10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table12.xml (renamed from test/testcases/tests/level1/html/table12.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table15.xml (renamed from test/testcases/tests/level1/html/table15.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table17.xml (renamed from test/testcases/tests/level1/html/table17.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table18.xml (renamed from test/testcases/tests/level1/html/table18.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table19.xml (renamed from test/testcases/tests/level1/html/table19.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table20.xml (renamed from test/testcases/tests/level1/html/table20.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table21.xml (renamed from test/testcases/tests/level1/html/table21.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table22.xml (renamed from test/testcases/tests/level1/html/table22.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table23.xml (renamed from test/testcases/tests/level1/html/table23.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table24.xml (renamed from test/testcases/tests/level1/html/table24.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table25.xml (renamed from test/testcases/tests/level1/html/table25.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table26.xml (renamed from test/testcases/tests/level1/html/table26.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table27.xml (renamed from test/testcases/tests/level1/html/table27.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table28.xml (renamed from test/testcases/tests/level1/html/table28.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table29.xml (renamed from test/testcases/tests/level1/html/table29.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table30.xml (renamed from test/testcases/tests/level1/html/table30.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table31.xml (renamed from test/testcases/tests/level1/html/table31.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table32.xml (renamed from test/testcases/tests/level1/html/table32.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table33.xml (renamed from test/testcases/tests/level1/html/table33.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table34.xml (renamed from test/testcases/tests/level1/html/table34.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table35.xml (renamed from test/testcases/tests/level1/html/table35.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table36.xml (renamed from test/testcases/tests/level1/html/table36.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table37.xml (renamed from test/testcases/tests/level1/html/table37.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table38.xml (renamed from test/testcases/tests/level1/html/table38.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table39.xml (renamed from test/testcases/tests/level1/html/table39.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table40.xml (renamed from test/testcases/tests/level1/html/table40.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table41.xml (renamed from test/testcases/tests/level1/html/table41.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table42.xml (renamed from test/testcases/tests/level1/html/table42.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table43.xml (renamed from test/testcases/tests/level1/html/table43.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table44.xml (renamed from test/testcases/tests/level1/html/table44.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table45.xml (renamed from test/testcases/tests/level1/html/table45.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table46.xml (renamed from test/testcases/tests/level1/html/table46.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table47.xml (renamed from test/testcases/tests/level1/html/table47.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table48.xml (renamed from test/testcases/tests/level1/html/table48.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table49.xml (renamed from test/testcases/tests/level1/html/table49.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table50.xml (renamed from test/testcases/tests/level1/html/table50.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table51.xml (renamed from test/testcases/tests/level1/html/table51.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table52.xml (renamed from test/testcases/tests/level1/html/table52.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/table53.xml (renamed from test/testcases/tests/level1/html/table53.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/.HTMLImageElement05.xml.swpbin0 -> 12288 bytes
-rw-r--r--test/testcases/tests/level2/html/HTMLBaseFontElement03.xml2
-rw-r--r--test/testcases/tests/level2/html/HTMLBodyElement07.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLBodyElement07.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLBodyElement08.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLBodyElement08.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLBodyElement09.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLBodyElement09.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLBodyElement10.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLBodyElement10.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLBodyElement11.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLBodyElement11.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLBodyElement12.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLBodyElement12.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLDocument22.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLDocument22.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLDocument23.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLDocument23.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLDocument24.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLDocument24.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLDocument25.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLDocument25.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLDocument26.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLDocument26.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLDocument27.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLDocument27.xml)0
-rw-r--r--test/testcases/tests/level2/html/HTMLFrameElement09.xml2
-rw-r--r--test/testcases/tests/level2/html/HTMLIFrameElement11.xml2
-rw-r--r--test/testcases/tests/level2/html/HTMLTableElement39.xml.kfail (renamed from test/testcases/tests/level2/html/HTMLTableElement39.xml)5
-rw-r--r--test/testcases/tests/level2/html/files/applet.html12
-rw-r--r--test/testcases/tests/level2/html/files/applet.xhtml15
-rw-r--r--test/testcases/tests/level2/html/files/applet.xml15
-rw-r--r--test/testcases/tests/level2/html/files/applet2.html12
-rw-r--r--test/testcases/tests/level2/html/files/applet2.xhtml15
-rw-r--r--test/testcases/tests/level2/html/files/applet2.xml15
-rw-r--r--test/testcases/tests/level2/html/files/area.html14
-rw-r--r--test/testcases/tests/level2/html/files/area.xhtml17
-rw-r--r--test/testcases/tests/level2/html/files/area.xml17
-rw-r--r--test/testcases/tests/level2/html/files/area2.html15
-rw-r--r--test/testcases/tests/level2/html/files/area2.xhtml16
-rw-r--r--test/testcases/tests/level2/html/files/area2.xml16
-rw-r--r--test/testcases/tests/level2/html/files/basefont.html12
-rw-r--r--test/testcases/tests/level2/html/files/basefont.xhtml14
-rw-r--r--test/testcases/tests/level2/html/files/basefont.xml14
-rw-r--r--test/testcases/tests/level2/html/files/document.html36
-rw-r--r--test/testcases/tests/level2/html/files/document.xhtml39
-rw-r--r--test/testcases/tests/level2/html/files/document.xml39
-rw-r--r--test/testcases/tests/level2/html/files/img.html13
-rw-r--r--test/testcases/tests/level2/html/files/img.xhtml15
-rw-r--r--test/testcases/tests/level2/html/files/img.xml15
-rw-r--r--test/testcases/tests/level2/html/files/input.html60
-rw-r--r--test/testcases/tests/level2/html/files/input.xhtml62
-rw-r--r--test/testcases/tests/level2/html/files/input.xml62
-rw-r--r--test/testcases/tests/level2/html/files/object.html18
-rw-r--r--test/testcases/tests/level2/html/files/object.xhtml20
-rw-r--r--test/testcases/tests/level2/html/files/object.xml20
-rw-r--r--test/testcases/tests/level2/html/files/object2.html17
-rw-r--r--test/testcases/tests/level2/html/files/object2.xhtml20
-rw-r--r--test/testcases/tests/level2/html/files/object2.xml20
-rw-r--r--test/testcases/tests/level2/html/files/select.html44
-rw-r--r--test/testcases/tests/level2/html/files/select.xhtml41
-rw-r--r--test/testcases/tests/level2/html/files/select.xml41
-rw-r--r--test/testcases/tests/level2/html/files/table.html78
-rw-r--r--test/testcases/tests/level2/html/files/table.xhtml81
-rw-r--r--test/testcases/tests/level2/html/files/table.xml81
-rw-r--r--test/testcases/tests/level2/html/files/table1.html12
-rw-r--r--test/testcases/tests/level2/html/files/table1.xhtml15
-rw-r--r--test/testcases/tests/level2/html/files/table1.xml15
-rw-r--r--test/testcases/tests/level2/html/files/tablerow.html59
-rw-r--r--test/testcases/tests/level2/html/files/tablerow.xhtml62
-rw-r--r--test/testcases/tests/level2/html/files/tablerow.xml62
-rw-r--r--test/testcases/tests/level2/html/files/tablesection.html62
-rw-r--r--test/testcases/tests/level2/html/files/tablesection.xhtml65
-rw-r--r--test/testcases/tests/level2/html/files/tablesection.xml65
-rw-r--r--test/testcases/tests/level2/html/hasFeature02.xml.kfail (renamed from test/testcases/tests/level2/html/hasFeature02.xml)0
-rw-r--r--test/testcases/tests/level2/html/hasFeature03.xml.kfail (renamed from test/testcases/tests/level2/html/hasFeature03.xml)0
-rw-r--r--test/testcases/tests/level2/html/hasFeature04.xml.kfail (renamed from test/testcases/tests/level2/html/hasFeature04.xml)0
-rw-r--r--test/testcases/tests/level2/html/hasFeature05.xml.kfail (renamed from test/testcases/tests/level2/html/hasFeature05.xml)0
-rw-r--r--test/testcases/tests/level2/html/hasFeature06.xml.kfail (renamed from test/testcases/tests/level2/html/hasFeature06.xml)0
-rw-r--r--test/testcases/tests/level2/html/metadata.xml.kfail (renamed from test/testcases/tests/level2/html/metadata.xml)0
-rw-r--r--test/testutils/domtsasserts.c4
580 files changed, 13122 insertions, 430 deletions
diff --git a/Makefile b/Makefile
index c6bc2bd..bcbc27b 100644
--- a/Makefile
+++ b/Makefile
@@ -97,6 +97,44 @@ INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_option_element.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_opt_group_element.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_options_collection.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_hr_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_dlist_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_directory_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_menu_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_fieldset_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_legend_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_div_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_paragraph_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_heading_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_quote_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_pre_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_br_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_label_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_ulist_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_olist_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_li_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_font_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_mod_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_anchor_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_basefont_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_image_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_object_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_param_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_applet_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_area_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_map_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_script_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_tablecaption_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_tablecell_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_tablecol_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_tablesection_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_table_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_tablerow_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_base_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_style_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_frameset_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_frame_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_iframe_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_isindex_element.h
INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR)/pkgconfig:lib$(COMPONENT).pc.in
INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR):$(OUTPUT)
diff --git a/include/dom/dom.h b/include/dom/dom.h
index d34f27f..0dba25d 100644
--- a/include/dom/dom.h
+++ b/include/dom/dom.h
@@ -56,6 +56,44 @@
#include <dom/html/html_select_element.h>
#include <dom/html/html_options_collection.h>
#include <dom/html/html_hr_element.h>
+#include <dom/html/html_dlist_element.h>
+#include <dom/html/html_directory_element.h>
+#include <dom/html/html_menu_element.h>
+#include <dom/html/html_fieldset_element.h>
+#include <dom/html/html_legend_element.h>
+#include <dom/html/html_div_element.h>
+#include <dom/html/html_paragraph_element.h>
+#include <dom/html/html_heading_element.h>
+#include <dom/html/html_quote_element.h>
+#include <dom/html/html_pre_element.h>
+#include <dom/html/html_br_element.h>
+#include <dom/html/html_label_element.h>
+#include <dom/html/html_ulist_element.h>
+#include <dom/html/html_olist_element.h>
+#include <dom/html/html_li_element.h>
+#include <dom/html/html_font_element.h>
+#include <dom/html/html_mod_element.h>
+#include <dom/html/html_anchor_element.h>
+#include <dom/html/html_basefont_element.h>
+#include <dom/html/html_image_element.h>
+#include <dom/html/html_object_element.h>
+#include <dom/html/html_param_element.h>
+#include <dom/html/html_applet_element.h>
+#include <dom/html/html_area_element.h>
+#include <dom/html/html_map_element.h>
+#include <dom/html/html_script_element.h>
+#include <dom/html/html_tablecaption_element.h>
+#include <dom/html/html_tablecell_element.h>
+#include <dom/html/html_tablecol_element.h>
+#include <dom/html/html_tablesection_element.h>
+#include <dom/html/html_table_element.h>
+#include <dom/html/html_tablerow_element.h>
+#include <dom/html/html_base_element.h>
+#include <dom/html/html_style_element.h>
+#include <dom/html/html_frameset_element.h>
+#include <dom/html/html_frame_element.h>
+#include <dom/html/html_iframe_element.h>
+#include <dom/html/html_isindex_element.h>
/* DOM Events header */
#include <dom/events/events.h>
diff --git a/include/dom/html/html_anchor_element.h b/include/dom/html/html_anchor_element.h
index 2e182d5..c7bcdea 100644
--- a/include/dom/html/html_anchor_element.h
+++ b/include/dom/html/html_anchor_element.h
@@ -3,5 +3,92 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_anchor_element_h_
+#define dom_html_anchor_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_anchor_element dom_html_anchor_element;
+
+
+dom_exception dom_html_anchor_element_get_access_key(
+ dom_html_anchor_element *anchor, dom_string **access_key);
+
+dom_exception dom_html_anchor_element_set_access_key(
+ dom_html_anchor_element *anchor, dom_string *access_key);
+
+dom_exception dom_html_anchor_element_get_charset(
+ dom_html_anchor_element *anchor, dom_string **charset);
+
+dom_exception dom_html_anchor_element_set_charset(
+ dom_html_anchor_element *anchor, dom_string *charset);
+
+dom_exception dom_html_anchor_element_get_coords(
+ dom_html_anchor_element *anchor, dom_string **coords);
+
+dom_exception dom_html_anchor_element_set_coords(
+ dom_html_anchor_element *anchor, dom_string *coords);
+
+dom_exception dom_html_anchor_element_get_href(
+ dom_html_anchor_element *anchor, dom_string **href);
+
+dom_exception dom_html_anchor_element_set_href(
+ dom_html_anchor_element *anchor, dom_string *href);
+
+dom_exception dom_html_anchor_element_get_hreflang(
+ dom_html_anchor_element *anchor, dom_string **hreflang);
+
+dom_exception dom_html_anchor_element_set_hreflang(
+ dom_html_anchor_element *anchor, dom_string *hreflang);
+
+dom_exception dom_html_anchor_element_get_name(
+ dom_html_anchor_element *anchor, dom_string **name);
+
+dom_exception dom_html_anchor_element_set_name(
+ dom_html_anchor_element *anchor, dom_string *name);
+
+dom_exception dom_html_anchor_element_get_rel(
+ dom_html_anchor_element *anchor, dom_string **rel);
+
+dom_exception dom_html_anchor_element_set_rel(
+ dom_html_anchor_element *anchor, dom_string *rel);
+
+dom_exception dom_html_anchor_element_get_rev(
+ dom_html_anchor_element *anchor, dom_string **rev);
+
+dom_exception dom_html_anchor_element_set_rev(
+ dom_html_anchor_element *anchor, dom_string *rev);
+
+dom_exception dom_html_anchor_element_get_shape(
+ dom_html_anchor_element *anchor, dom_string **shape);
+
+dom_exception dom_html_anchor_element_set_shape(
+ dom_html_anchor_element *anchor, dom_string *shape);
+
+dom_exception dom_html_anchor_element_get_target(
+ dom_html_anchor_element *anchor, dom_string **target);
+
+dom_exception dom_html_anchor_element_set_target(
+ dom_html_anchor_element *anchor, dom_string *target);
+
+dom_exception dom_html_anchor_element_get_type(
+ dom_html_anchor_element *anchor, dom_string **type);
+
+dom_exception dom_html_anchor_element_set_type(
+ dom_html_anchor_element *anchor, dom_string *type);
+
+dom_exception dom_html_anchor_element_get_tab_index(
+ dom_html_anchor_element *anchor, int32_t *tab_index);
+
+dom_exception dom_html_anchor_element_set_tab_index(
+ dom_html_anchor_element *anchor, uint32_t tab_index);
+
+dom_exception dom_html_anchor_element_blur(dom_html_anchor_element *ele);
+dom_exception dom_html_anchor_element_focus(dom_html_anchor_element *ele);
+
+#endif
diff --git a/include/dom/html/html_applet_element.h b/include/dom/html/html_applet_element.h
index 2e182d5..29e5c62 100644
--- a/include/dom/html/html_applet_element.h
+++ b/include/dom/html/html_applet_element.h
@@ -3,5 +3,83 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_applet_element_h_
+#define dom_html_applet_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_applet_element dom_html_applet_element;
+
+dom_exception dom_html_applet_element_get_align(
+ dom_html_applet_element *applet, dom_string **align);
+
+dom_exception dom_html_applet_element_set_align(
+ dom_html_applet_element *applet, dom_string *align);
+
+dom_exception dom_html_applet_element_get_alt(
+ dom_html_applet_element *applet, dom_string **alt);
+
+dom_exception dom_html_applet_element_set_alt(
+ dom_html_applet_element *applet, dom_string *alt);
+
+dom_exception dom_html_applet_element_get_archive(
+ dom_html_applet_element *applet, dom_string **archive);
+
+dom_exception dom_html_applet_element_set_archive(
+ dom_html_applet_element *applet, dom_string *archive);
+
+dom_exception dom_html_applet_element_get_code(
+ dom_html_applet_element *applet, dom_string **code);
+
+dom_exception dom_html_applet_element_set_code(
+ dom_html_applet_element *applet, dom_string *code);
+
+dom_exception dom_html_applet_element_get_code_base(
+ dom_html_applet_element *applet, dom_string **code_base);
+
+dom_exception dom_html_applet_element_set_code_base(
+ dom_html_applet_element *applet, dom_string *code_base);
+
+dom_exception dom_html_applet_element_get_height(
+ dom_html_applet_element *applet, dom_string **height);
+
+dom_exception dom_html_applet_element_set_height(
+ dom_html_applet_element *applet, dom_string *height);
+
+dom_exception dom_html_applet_element_get_name(
+ dom_html_applet_element *applet, dom_string **name);
+
+dom_exception dom_html_applet_element_set_name(
+ dom_html_applet_element *applet, dom_string *name);
+
+dom_exception dom_html_applet_element_get_object(
+ dom_html_applet_element *applet, dom_string **object);
+
+dom_exception dom_html_applet_element_set_object(
+ dom_html_applet_element *applet, dom_string *object);
+
+dom_exception dom_html_applet_element_get_width(
+ dom_html_applet_element *applet, dom_string **width);
+
+dom_exception dom_html_applet_element_set_width(
+ dom_html_applet_element *applet, dom_string *width);
+
+
+dom_exception dom_html_applet_element_get_hspace(
+ dom_html_applet_element *applet, int32_t *hspace);
+
+dom_exception dom_html_applet_element_set_hspace(
+ dom_html_applet_element *applet, uint32_t hspace);
+
+dom_exception dom_html_applet_element_get_vspace(
+ dom_html_applet_element *applet, int32_t *vspace);
+
+dom_exception dom_html_applet_element_set_vspace(
+ dom_html_applet_element *applet, uint32_t vspace);
+#endif
+
diff --git a/include/dom/html/html_area_element.h b/include/dom/html/html_area_element.h
index 2e182d5..c57202b 100644
--- a/include/dom/html/html_area_element.h
+++ b/include/dom/html/html_area_element.h
@@ -3,5 +3,67 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1access_keyr99@gmail.com>
*/
+#ifndef dom_html_area_element_h_
+#define dom_html_area_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+#include <dom/html/html_form_element.h>
+#include <dom/html/html_document.h>
+
+typedef struct dom_html_area_element dom_html_area_element;
+
+dom_exception dom_html_area_element_get_access_key(
+ dom_html_area_element *area, dom_string **access_key);
+
+dom_exception dom_html_area_element_set_access_key(
+ dom_html_area_element *area, dom_string *access_key);
+
+dom_exception dom_html_area_element_get_alt(
+ dom_html_area_element *area, dom_string **alt);
+
+dom_exception dom_html_area_element_set_alt(
+ dom_html_area_element *area, dom_string *alt);
+
+dom_exception dom_html_area_element_get_coords(
+ dom_html_area_element *area, dom_string **coords);
+
+dom_exception dom_html_area_element_set_coords(
+ dom_html_area_element *area, dom_string *coords);
+
+dom_exception dom_html_area_element_get_href(
+ dom_html_area_element *area, dom_string **href);
+
+dom_exception dom_html_area_element_set_href(
+ dom_html_area_element *area, dom_string *href);
+
+dom_exception dom_html_area_element_get_no_href(
+ dom_html_area_element *ele, bool *no_href);
+
+dom_exception dom_html_area_element_set_no_href(
+ dom_html_area_element *ele, bool no_href);
+
+dom_exception dom_html_area_element_get_shape(
+ dom_html_area_element *area, dom_string **shape);
+
+dom_exception dom_html_area_element_set_shape(
+ dom_html_area_element *area, dom_string *shape);
+
+dom_exception dom_html_area_element_get_tab_index(
+ dom_html_area_element *area, int32_t *tab_index);
+
+dom_exception dom_html_area_element_set_tab_index(
+ dom_html_area_element *area, uint32_t tab_index);
+
+dom_exception dom_html_area_element_get_target(
+ dom_html_area_element *area, dom_string **target);
+
+dom_exception dom_html_area_element_set_target(
+ dom_html_area_element *area, dom_string *target);
+
+#endif
diff --git a/include/dom/html/html_base_element.h b/include/dom/html/html_base_element.h
index 5ff28ee..c8283f3 100644
--- a/include/dom/html/html_base_element.h
+++ b/include/dom/html/html_base_element.h
@@ -8,7 +8,23 @@
#ifndef dom_html_base_element_h_
#define dom_html_base_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
typedef struct dom_html_base_element dom_html_base_element;
+dom_exception dom_html_base_element_get_href(
+ dom_html_base_element *element, dom_string **href);
+
+dom_exception dom_html_base_element_set_href(
+ dom_html_base_element *element, dom_string *href);
+
+dom_exception dom_html_base_element_get_target(
+ dom_html_base_element *element, dom_string **target);
+
+dom_exception dom_html_base_element_set_target(
+ dom_html_base_element *element, dom_string *target);
+
#endif
diff --git a/include/dom/html/html_basefont_element.h b/include/dom/html/html_basefont_element.h
index 2e182d5..fa60e0d 100644
--- a/include/dom/html/html_basefont_element.h
+++ b/include/dom/html/html_basefont_element.h
@@ -3,5 +3,32 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_base_font_element_h_
+#define dom_html_base_font_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_base_font_element dom_html_base_font_element;
+
+dom_exception dom_html_base_font_element_get_size(
+ dom_html_base_font_element *element, int32_t *size);
+
+dom_exception dom_html_base_font_element_set_size(
+ dom_html_base_font_element *element, uint32_t size);
+
+dom_exception dom_html_base_font_element_get_color(
+ dom_html_base_font_element *element, dom_string **color);
+
+dom_exception dom_html_base_font_element_set_color(
+ dom_html_base_font_element *element, dom_string *color);
+
+dom_exception dom_html_base_font_element_get_face(
+ dom_html_base_font_element *element, dom_string **face);
+
+dom_exception dom_html_base_font_element_set_face(
+ dom_html_base_font_element *element, dom_string *face);
+#endif
diff --git a/include/dom/html/html_br_element.h b/include/dom/html/html_br_element.h
index 2e182d5..9475e74 100644
--- a/include/dom/html/html_br_element.h
+++ b/include/dom/html/html_br_element.h
@@ -3,5 +3,21 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_br_element_h_
+#define dom_html_br_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_br_element dom_html_br_element;
+
+dom_exception dom_html_br_element_get_clear(
+ dom_html_br_element *ele, dom_string **clear);
+
+dom_exception dom_html_br_element_set_clear(
+ dom_html_br_element *ele, dom_string *clear);
+
+#endif
diff --git a/include/dom/html/html_directory_element.h b/include/dom/html/html_directory_element.h
index 2e182d5..67fa269 100644
--- a/include/dom/html/html_directory_element.h
+++ b/include/dom/html/html_directory_element.h
@@ -3,5 +3,21 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_directory_element_h_
+#define dom_html_directory_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_directory_element dom_html_directory_element;
+
+dom_exception dom_html_directory_element_get_compact(
+ dom_html_directory_element *ele, bool *compact);
+
+dom_exception dom_html_directory_element_set_compact(
+ dom_html_directory_element *ele, bool compact);
+
+#endif
diff --git a/include/dom/html/html_div_element.h b/include/dom/html/html_div_element.h
index 2e182d5..051a6d5 100644
--- a/include/dom/html/html_div_element.h
+++ b/include/dom/html/html_div_element.h
@@ -3,5 +3,21 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_div_element_h_
+#define dom_html_div_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_div_element dom_html_div_element;
+
+dom_exception dom_html_div_element_get_align(
+ dom_html_div_element *element, dom_string **align);
+
+dom_exception dom_html_div_element_set_align(
+ dom_html_div_element *element, dom_string *align);
+
+#endif
diff --git a/include/dom/html/html_dlist_element.h b/include/dom/html/html_dlist_element.h
index 2e182d5..e537994 100644
--- a/include/dom/html/html_dlist_element.h
+++ b/include/dom/html/html_dlist_element.h
@@ -3,5 +3,21 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_d_list_element_h_
+#define dom_html_d_list_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_d_list_element dom_html_d_list_element;
+
+dom_exception dom_html_d_list_element_get_compact(
+ dom_html_d_list_element *ele, bool *compact);
+
+dom_exception dom_html_d_list_element_set_compact(
+ dom_html_d_list_element *ele, bool compact);
+
+#endif
diff --git a/include/dom/html/html_document.h b/include/dom/html/html_document.h
index 1f868a5..936ea69 100644
--- a/include/dom/html/html_document.h
+++ b/include/dom/html/html_document.h
@@ -114,7 +114,7 @@ static inline dom_exception dom_html_document_get_body(dom_html_document *doc,
get_body(doc, body);
}
#define dom_html_document_get_body(d, b) \
- dom_html_document_get_title((dom_html_document *) (d), \
+ dom_html_document_get_body((dom_html_document *) (d), \
(struct dom_html_element **) (b))
static inline dom_exception dom_html_document_set_body(dom_html_document *doc,
@@ -174,7 +174,7 @@ static inline dom_exception dom_html_document_get_anchors(dom_html_document *doc
get_anchors(doc, col);
}
#define dom_html_document_get_anchors(d, c) \
- dom_html_document_get_title((dom_html_document *) (d), \
+ dom_html_document_get_anchors((dom_html_document *) (d), \
(struct dom_html_collection **) (c))
static inline dom_exception dom_html_document_get_cookie(dom_html_document *doc,
@@ -184,7 +184,7 @@ static inline dom_exception dom_html_document_get_cookie(dom_html_document *doc,
get_cookie(doc, cookie);
}
#define dom_html_document_get_cookie(d, c) \
- dom_html_document_get_title((dom_html_document *) (d), (c))
+ dom_html_document_get_cookie((dom_html_document *) (d), (c))
static inline dom_exception dom_html_document_set_cookie(dom_html_document *doc,
dom_string *cookie)
@@ -237,8 +237,8 @@ static inline dom_exception dom_html_document_get_elements_by_name(dom_html_docu
return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
get_elements_by_name(doc, name, list);
}
-#define dom_html_document_get_elements_by_name(d, n, l) \
- dom_html_document_get_element_by_name((dom_html_document *) (d), \
+#define dom_html_document_get_element_by_name(d, n, l) \
+ dom_html_document_get_elements_by_name((dom_html_document *) (d), \
(n), (struct dom_nodelist **) (l))
#endif
diff --git a/include/dom/html/html_fieldset_element.h b/include/dom/html/html_fieldset_element.h
index 2e182d5..26383b3 100644
--- a/include/dom/html/html_fieldset_element.h
+++ b/include/dom/html/html_fieldset_element.h
@@ -3,5 +3,22 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_field_set_element_h_
+#define dom_html_field_set_element_h_
+
+#include <stdbool.h>
+
+#include <dom/core/exceptions.h>
+
+#include <dom/html/html_form_element.h>
+
+typedef struct dom_html_field_set_element dom_html_field_set_element;
+
+struct dom_html_element;
+dom_exception dom_html_field_set_element_get_form(
+ dom_html_field_set_element *ele, dom_html_form_element **form);
+#endif
+
diff --git a/include/dom/html/html_font_element.h b/include/dom/html/html_font_element.h
index 2e182d5..b878f42 100644
--- a/include/dom/html/html_font_element.h
+++ b/include/dom/html/html_font_element.h
@@ -3,5 +3,32 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_font_element_h_
+#define dom_html_font_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_font_element dom_html_font_element;
+
+dom_exception dom_html_font_element_get_color(
+ dom_html_font_element *ele, dom_string **color);
+
+dom_exception dom_html_font_element_set_color(
+ dom_html_font_element *ele, dom_string *color);
+
+dom_exception dom_html_font_element_get_face(
+ dom_html_font_element *ele, dom_string **face);
+
+dom_exception dom_html_font_element_set_face(
+ dom_html_font_element *ele, dom_string *face);
+
+dom_exception dom_html_font_element_get_size(
+ dom_html_font_element *ele, dom_string **size);
+
+dom_exception dom_html_font_element_set_size(
+ dom_html_font_element *ele, dom_string *size);
+#endif
diff --git a/include/dom/html/html_frame_element.h b/include/dom/html/html_frame_element.h
index 2e182d5..1202f5c 100644
--- a/include/dom/html/html_frame_element.h
+++ b/include/dom/html/html_frame_element.h
@@ -3,5 +3,68 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_frame_element_h_
+#define dom_html_frame_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+#include <dom/html/html_document.h>
+typedef struct dom_html_frame_element dom_html_frame_element;
+
+dom_exception dom_html_frame_element_get_frame_border(
+ dom_html_frame_element *element, dom_string **frame_border);
+
+dom_exception dom_html_frame_element_set_frame_border(
+ dom_html_frame_element *element, dom_string *frame_border);
+
+dom_exception dom_html_frame_element_set_long_desc(
+ dom_html_frame_element *ele, dom_string *long_desc);
+
+dom_exception dom_html_frame_element_get_long_desc(
+ dom_html_frame_element *ele, dom_string **long_desc);
+
+dom_exception dom_html_frame_element_get_margin_height(
+ dom_html_frame_element *element, dom_string **margin_height);
+
+dom_exception dom_html_frame_element_set_margin_height(
+ dom_html_frame_element *element, dom_string *margin_height);
+
+dom_exception dom_html_frame_element_get_margin_width(
+ dom_html_frame_element *element, dom_string **margin_width);
+
+dom_exception dom_html_frame_element_set_margin_width(
+ dom_html_frame_element *element, dom_string *margin_width);
+
+dom_exception dom_html_frame_element_get_name(
+ dom_html_frame_element *element, dom_string **name);
+
+dom_exception dom_html_frame_element_set_name(
+ dom_html_frame_element *element, dom_string *name);
+
+dom_exception dom_html_frame_element_get_scrolling(
+ dom_html_frame_element *element, dom_string **scrolling);
+
+dom_exception dom_html_frame_element_set_scrolling(
+ dom_html_frame_element *element, dom_string *scrolling);
+
+dom_exception dom_html_frame_element_get_src(
+ dom_html_frame_element *element, dom_string **src);
+
+dom_exception dom_html_frame_element_set_src(
+ dom_html_frame_element *element, dom_string *src);
+
+dom_exception dom_html_frame_element_set_no_resize(dom_html_frame_element *ele,
+ bool no_resize);
+
+dom_exception dom_html_frame_element_get_no_resize(dom_html_frame_element *ele,
+ bool *no_resize);
+
+dom_exception dom_html_frame_element_get_content_document(
+ dom_html_frame_element *ele,
+ dom_document **content_document);
+
+#endif
diff --git a/include/dom/html/html_frameset_element.h b/include/dom/html/html_frameset_element.h
index 2e182d5..c0de3b4 100644
--- a/include/dom/html/html_frameset_element.h
+++ b/include/dom/html/html_frameset_element.h
@@ -3,5 +3,27 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_frame_set_element_h_
+#define dom_html_frame_set_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_frame_set_element dom_html_frame_set_element;
+
+dom_exception dom_html_frame_set_element_get_rows(
+ dom_html_frame_set_element *element, dom_string **rows);
+
+dom_exception dom_html_frame_set_element_set_rows(
+ dom_html_frame_set_element *element, dom_string *rows);
+
+dom_exception dom_html_frame_set_element_set_cols(
+ dom_html_frame_set_element *ele, dom_string *cols);
+
+dom_exception dom_html_frame_set_element_get_cols(
+ dom_html_frame_set_element *ele, dom_string **cols);
+
+#endif
diff --git a/include/dom/html/html_heading_element.h b/include/dom/html/html_heading_element.h
index 2e182d5..fb42b89 100644
--- a/include/dom/html/html_heading_element.h
+++ b/include/dom/html/html_heading_element.h
@@ -3,5 +3,21 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_heading_element_h_
+#define dom_html_heading_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_heading_element dom_html_heading_element;
+
+dom_exception dom_html_heading_element_get_align(
+ dom_html_heading_element *element, dom_string **align);
+
+dom_exception dom_html_heading_element_set_align(
+ dom_html_heading_element *element, dom_string *align);
+
+#endif
diff --git a/include/dom/html/html_iframe_element.h b/include/dom/html/html_iframe_element.h
index 2e182d5..f064cfe 100644
--- a/include/dom/html/html_iframe_element.h
+++ b/include/dom/html/html_iframe_element.h
@@ -3,5 +3,80 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_iframe_element_h_
+#define dom_html_iframe_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+#include <dom/html/html_document.h>
+typedef struct dom_html_iframe_element dom_html_iframe_element;
+
+dom_exception dom_html_iframe_element_get_frame_border(
+ dom_html_iframe_element *element, dom_string **frame_border);
+
+dom_exception dom_html_iframe_element_set_frame_border(
+ dom_html_iframe_element *element, dom_string *frame_border);
+
+dom_exception dom_html_iframe_element_get_align(
+ dom_html_iframe_element *element, dom_string **align);
+
+dom_exception dom_html_iframe_element_set_align(
+ dom_html_iframe_element *element, dom_string *align);
+
+dom_exception dom_html_iframe_element_set_long_desc(
+ dom_html_iframe_element *ele, dom_string *long_desc);
+
+dom_exception dom_html_iframe_element_get_long_desc(
+ dom_html_iframe_element *ele, dom_string **long_desc);
+
+dom_exception dom_html_iframe_element_get_margin_height(
+ dom_html_iframe_element *element, dom_string **margin_height);
+
+dom_exception dom_html_iframe_element_set_margin_height(
+ dom_html_iframe_element *element, dom_string *margin_height);
+
+dom_exception dom_html_iframe_element_get_margin_width(
+ dom_html_iframe_element *element, dom_string **margin_width);
+
+dom_exception dom_html_iframe_element_set_margin_width(
+ dom_html_iframe_element *element, dom_string *margin_width);
+
+dom_exception dom_html_iframe_element_get_name(
+ dom_html_iframe_element *element, dom_string **name);
+
+dom_exception dom_html_iframe_element_set_name(
+ dom_html_iframe_element *element, dom_string *name);
+
+dom_exception dom_html_iframe_element_get_scrolling(
+ dom_html_iframe_element *element, dom_string **scrolling);
+
+dom_exception dom_html_iframe_element_set_scrolling(
+ dom_html_iframe_element *element, dom_string *scrolling);
+
+dom_exception dom_html_iframe_element_get_src(
+ dom_html_iframe_element *element, dom_string **src);
+
+dom_exception dom_html_iframe_element_set_src(
+ dom_html_iframe_element *element, dom_string *src);
+
+dom_exception dom_html_iframe_element_get_height(
+ dom_html_iframe_element *element, dom_string **height);
+
+dom_exception dom_html_iframe_element_set_height(
+ dom_html_iframe_element *element, dom_string *height);
+
+dom_exception dom_html_iframe_element_get_width(
+ dom_html_iframe_element *element, dom_string **width);
+
+dom_exception dom_html_iframe_element_set_width(
+ dom_html_iframe_element *element, dom_string *width);
+
+dom_exception dom_html_iframe_element_get_content_document(
+ dom_html_iframe_element *ele,
+ dom_document **content_document);
+
+#endif
diff --git a/include/dom/html/html_image_element.h b/include/dom/html/html_image_element.h
index 2e182d5..7e3e879 100644
--- a/include/dom/html/html_image_element.h
+++ b/include/dom/html/html_image_element.h
@@ -3,5 +3,89 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_image_element_h_
+#define dom_html_image_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_image_element dom_html_image_element;
+
+
+dom_exception dom_html_image_element_get_name(
+ dom_html_image_element *image, dom_string **name);
+
+dom_exception dom_html_image_element_set_name(
+ dom_html_image_element *image, dom_string *name);
+
+dom_exception dom_html_image_element_get_align(
+ dom_html_image_element *image, dom_string **align);
+
+dom_exception dom_html_image_element_set_align(
+ dom_html_image_element *image, dom_string *align);
+
+dom_exception dom_html_image_element_get_alt(
+ dom_html_image_element *image, dom_string **alt);
+
+dom_exception dom_html_image_element_set_alt(
+ dom_html_image_element *image, dom_string *alt);
+
+dom_exception dom_html_image_element_get_border(
+ dom_html_image_element *image, dom_string **border);
+
+dom_exception dom_html_image_element_set_border(
+ dom_html_image_element *image, dom_string *border);
+
+dom_exception dom_html_image_element_get_long_desc(
+ dom_html_image_element *image, dom_string **long_desc);
+
+dom_exception dom_html_image_element_set_long_desc(
+ dom_html_image_element *image, dom_string *long_desc);
+
+dom_exception dom_html_image_element_get_src(
+ dom_html_image_element *image, dom_string **src);
+
+dom_exception dom_html_image_element_set_src(
+ dom_html_image_element *image, dom_string *src);
+
+dom_exception dom_html_image_element_get_use_map(
+ dom_html_image_element *image, dom_string **use_map);
+
+dom_exception dom_html_image_element_set_use_map(
+ dom_html_image_element *image, dom_string *use_map);
+
+dom_exception dom_html_image_element_get_height(
+ dom_html_image_element *image, int32_t *height);
+
+dom_exception dom_html_image_element_set_height(
+ dom_html_image_element *image, uint32_t height);
+
+dom_exception dom_html_image_element_get_hspace(
+ dom_html_image_element *image, int32_t *hspace);
+
+dom_exception dom_html_image_element_set_hspace(
+ dom_html_image_element *image, uint32_t hspace);
+
+dom_exception dom_html_image_element_get_vspace(
+ dom_html_image_element *image, int32_t *vspace);
+
+dom_exception dom_html_image_element_set_vspace(
+ dom_html_image_element *image, uint32_t vspace);
+
+dom_exception dom_html_image_element_get_width(
+ dom_html_image_element *image, int32_t *width);
+
+dom_exception dom_html_image_element_set_width(
+ dom_html_image_element *image, uint32_t width);
+
+dom_exception dom_html_image_element_get_is_map(
+ dom_html_image_element *ele, bool *is_map);
+
+dom_exception dom_html_image_element_set_is_map(
+ dom_html_image_element *ele, bool is_map);
+
+#endif
diff --git a/include/dom/html/html_input_element.h b/include/dom/html/html_input_element.h
index eb6aecd..086e1cb 100644
--- a/include/dom/html/html_input_element.h
+++ b/include/dom/html/html_input_element.h
@@ -85,10 +85,10 @@ dom_exception dom_html_input_element_set_read_only(
dom_html_input_element *input, bool read_only);
dom_exception dom_html_input_element_get_size(
- dom_html_input_element *input, dom_string **size);
+ dom_html_input_element *input, int32_t *size);
dom_exception dom_html_input_element_set_size(
- dom_html_input_element *input, dom_string *size);
+ dom_html_input_element *input, uint32_t size);
dom_exception dom_html_input_element_get_src(
dom_html_input_element *input, dom_string **src);
diff --git a/include/dom/html/html_isindex_element.h b/include/dom/html/html_isindex_element.h
index 4961ccc..d41a149 100644
--- a/include/dom/html/html_isindex_element.h
+++ b/include/dom/html/html_isindex_element.h
@@ -9,6 +9,7 @@
#define dom_html_isindex_element_h_
#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
struct dom_html_form_element;
@@ -22,5 +23,10 @@ typedef struct dom_html_isindex_element dom_html_isindex_element;
dom_exception dom_html_isindex_element_get_form(dom_html_isindex_element *ele,
struct dom_html_form_element **form);
+dom_exception dom_html_isindex_element_get_prompt(dom_html_isindex_element *ele,
+ dom_string **prompt);
+
+dom_exception dom_html_isindex_element_set_prompt(dom_html_isindex_element *ele,
+ dom_string *prompt);
#endif
diff --git a/include/dom/html/html_label_element.h b/include/dom/html/html_label_element.h
index 2e182d5..6aca45d 100644
--- a/include/dom/html/html_label_element.h
+++ b/include/dom/html/html_label_element.h
@@ -5,3 +5,29 @@
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
*/
+#ifndef dom_html_label_element_h_
+#define dom_html_label_element_h_
+
+#include <stdbool.h>
+
+#include <dom/core/exceptions.h>
+
+#include <dom/html/html_form_element.h>
+
+typedef struct dom_html_label_element dom_html_label_element;
+
+dom_exception dom_html_label_element_get_access_key(
+ dom_html_label_element *ele, dom_string **access_key);
+dom_exception dom_html_label_element_set_access_key(
+ dom_html_label_element *ele, dom_string *access_key);
+
+dom_exception dom_html_label_element_get_html_for(
+ dom_html_label_element *ele, dom_string **html_for);
+dom_exception dom_html_label_element_set_html_for(
+ dom_html_label_element *ele, dom_string *html_for);
+
+dom_exception dom_html_label_element_get_form(
+ dom_html_label_element *ele, dom_html_form_element **form);
+
+#endif
+
diff --git a/include/dom/html/html_legend_element.h b/include/dom/html/html_legend_element.h
index 2e182d5..caf34a6 100644
--- a/include/dom/html/html_legend_element.h
+++ b/include/dom/html/html_legend_element.h
@@ -3,5 +3,32 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_legend_element_h_
+#define dom_html_legend_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+#include <dom/html/html_form_element.h>
+
+typedef struct dom_html_legend_element dom_html_legend_element;
+
+dom_exception dom_html_legend_element_get_form(
+ dom_html_legend_element *ele, dom_html_form_element **form);
+
+dom_exception dom_html_legend_element_get_access_key(
+ dom_html_legend_element *element, dom_string **access_key);
+
+dom_exception dom_html_legend_element_set_access_key(
+ dom_html_legend_element *element, dom_string *access_key);
+
+dom_exception dom_html_legend_element_get_align(
+ dom_html_legend_element *element, dom_string **align);
+
+dom_exception dom_html_legend_element_set_align(
+ dom_html_legend_element *ele, dom_string *align);
+
+#endif
diff --git a/include/dom/html/html_li_element.h b/include/dom/html/html_li_element.h
index 2e182d5..465bb98 100644
--- a/include/dom/html/html_li_element.h
+++ b/include/dom/html/html_li_element.h
@@ -3,5 +3,27 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_li_element_h_
+#define dom_html_li_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_li_element dom_html_li_element;
+
+dom_exception dom_html_li_element_get_value(
+ dom_html_li_element *ele, int32_t *value);
+
+dom_exception dom_html_li_element_set_value(
+ dom_html_li_element *ele, uint32_t value);
+
+dom_exception dom_html_li_element_get_type(
+ dom_html_li_element *ele, dom_string **type);
+
+dom_exception dom_html_li_element_set_type(
+ dom_html_li_element *ele, dom_string *type);
+
+#endif
diff --git a/include/dom/html/html_map_element.h b/include/dom/html/html_map_element.h
index 2e182d5..6abdee5 100644
--- a/include/dom/html/html_map_element.h
+++ b/include/dom/html/html_map_element.h
@@ -3,5 +3,26 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_map_element_h_
+#define dom_html_map_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+#include <dom/html/html_collection.h>
+
+typedef struct dom_html_map_element dom_html_map_element;
+
+dom_exception dom_html_map_element_get_name(
+ dom_html_map_element *ele, dom_string **name);
+
+dom_exception dom_html_map_element_set_name(
+ dom_html_map_element *ele, dom_string *name);
+
+dom_exception dom_html_map_element_get_areas(
+ dom_html_map_element *ele, dom_html_collection **areas);
+
+#endif
diff --git a/include/dom/html/html_menu_element.h b/include/dom/html/html_menu_element.h
index 2e182d5..f4dad74 100644
--- a/include/dom/html/html_menu_element.h
+++ b/include/dom/html/html_menu_element.h
@@ -3,5 +3,21 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_menu_element_h_
+#define dom_html_menu_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_menu_element dom_html_menu_element;
+
+dom_exception dom_html_menu_element_get_compact(
+ dom_html_menu_element *ele, bool *compact);
+
+dom_exception dom_html_menu_element_set_compact(
+ dom_html_menu_element *ele, bool compact);
+
+#endif
diff --git a/include/dom/html/html_mod_element.h b/include/dom/html/html_mod_element.h
index 2e182d5..99c4f2e 100644
--- a/include/dom/html/html_mod_element.h
+++ b/include/dom/html/html_mod_element.h
@@ -3,5 +3,27 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_mod_element_h_
+#define dom_html_mod_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_mod_element dom_html_mod_element;
+
+dom_exception dom_html_mod_element_get_cite(
+ dom_html_mod_element *ele, dom_string **cite);
+
+dom_exception dom_html_mod_element_set_cite(
+ dom_html_mod_element *ele, dom_string *cite);
+
+dom_exception dom_html_mod_element_get_date_time(
+ dom_html_mod_element *ele, dom_string **date_time);
+
+dom_exception dom_html_mod_element_set_date_time(
+ dom_html_mod_element *ele, dom_string *date_time);
+
+#endif
diff --git a/include/dom/html/html_object_element.h b/include/dom/html/html_object_element.h
index 2e182d5..0263e85 100644
--- a/include/dom/html/html_object_element.h
+++ b/include/dom/html/html_object_element.h
@@ -3,5 +3,126 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_object_element_h_
+#define dom_html_object_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+#include <dom/html/html_form_element.h>
+#include <dom/html/html_document.h>
+
+typedef struct dom_html_object_element dom_html_object_element;
+
+dom_exception dom_html_object_element_get_form(
+ dom_html_object_element *ele, dom_html_form_element **form);
+
+dom_exception dom_html_object_element_get_code(
+ dom_html_object_element *object, dom_string **code);
+
+dom_exception dom_html_object_element_set_code(
+ dom_html_object_element *object, dom_string *code);
+
+dom_exception dom_html_object_element_get_align(
+ dom_html_object_element *object, dom_string **align);
+
+dom_exception dom_html_object_element_set_align(
+ dom_html_object_element *object, dom_string *align);
+
+dom_exception dom_html_object_element_get_archive(
+ dom_html_object_element *object, dom_string **archive);
+
+dom_exception dom_html_object_element_set_archive(
+ dom_html_object_element *object, dom_string *archive);
+
+dom_exception dom_html_object_element_get_border(
+ dom_html_object_element *object, dom_string **border);
+
+dom_exception dom_html_object_element_set_border(
+ dom_html_object_element *object, dom_string *border);
+
+dom_exception dom_html_object_element_get_code_base(
+ dom_html_object_element *object, dom_string **code_base);
+
+dom_exception dom_html_object_element_set_code_base(
+ dom_html_object_element *object, dom_string *code_base);
+
+dom_exception dom_html_object_element_get_code_type(
+ dom_html_object_element *object, dom_string **code_type);
+
+dom_exception dom_html_object_element_set_code_type(
+ dom_html_object_element *object, dom_string *code_type);
+
+dom_exception dom_html_object_element_get_data(
+ dom_html_object_element *object, dom_string **data);
+
+dom_exception dom_html_object_element_set_data(
+ dom_html_object_element *object, dom_string *data);
+
+dom_exception dom_html_object_element_get_declare(
+ dom_html_object_element *ele, bool *declare);
+
+dom_exception dom_html_object_element_set_declare(
+ dom_html_object_element *ele, bool declare);
+
+dom_exception dom_html_object_element_get_height(
+ dom_html_object_element *object, dom_string **height);
+
+dom_exception dom_html_object_element_set_height(
+ dom_html_object_element *object, dom_string *height);
+
+dom_exception dom_html_object_element_get_name(
+ dom_html_object_element *object, dom_string **name);
+
+dom_exception dom_html_object_element_set_name(
+ dom_html_object_element *object, dom_string *name);
+
+dom_exception dom_html_object_element_get_standby(
+ dom_html_object_element *object, dom_string **standby);
+
+dom_exception dom_html_object_element_set_standby(
+ dom_html_object_element *object, dom_string *standby);
+
+dom_exception dom_html_object_element_get_type(
+ dom_html_object_element *object, dom_string **type);
+
+dom_exception dom_html_object_element_set_type(
+ dom_html_object_element *object, dom_string *type);
+
+dom_exception dom_html_object_element_get_use_map(
+ dom_html_object_element *object, dom_string **use_map);
+
+dom_exception dom_html_object_element_set_use_map(
+ dom_html_object_element *object, dom_string *use_map);
+
+dom_exception dom_html_object_element_get_width(
+ dom_html_object_element *object, dom_string **width);
+
+dom_exception dom_html_object_element_set_width(
+ dom_html_object_element *object, dom_string *width);
+
+dom_exception dom_html_object_element_get_hspace(
+ dom_html_object_element *object, int32_t *hspace);
+
+dom_exception dom_html_object_element_set_hspace(
+ dom_html_object_element *object, uint32_t hspace);
+
+dom_exception dom_html_object_element_get_tab_index(
+ dom_html_object_element *object, int32_t *tab_index);
+
+dom_exception dom_html_object_element_set_tab_index(
+ dom_html_object_element *object, uint32_t tab_index);
+
+dom_exception dom_html_object_element_get_vspace(
+ dom_html_object_element *object, int32_t *vspace);
+
+dom_exception dom_html_object_element_set_vspace(
+ dom_html_object_element *object, uint32_t vspace);
+
+dom_exception dom_html_object_element_get_content_document(
+ dom_html_object_element *object, dom_document **content_document);
+#endif
diff --git a/include/dom/html/html_olist_element.h b/include/dom/html/html_olist_element.h
index 2e182d5..3d1511e 100644
--- a/include/dom/html/html_olist_element.h
+++ b/include/dom/html/html_olist_element.h
@@ -3,5 +3,33 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_o_list_element_h_
+#define dom_html_o_list_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_o_list_element dom_html_o_list_element;
+
+dom_exception dom_html_o_list_element_get_compact(
+ dom_html_o_list_element *ele, bool *compact);
+
+dom_exception dom_html_o_list_element_set_compact(
+ dom_html_o_list_element *ele, bool compact);
+
+dom_exception dom_html_o_list_element_get_start(
+ dom_html_o_list_element *ele, int32_t *start);
+
+dom_exception dom_html_o_list_element_set_start(
+ dom_html_o_list_element *ele, uint32_t start);
+
+dom_exception dom_html_o_list_element_get_type(
+ dom_html_o_list_element *ele, dom_string **type);
+
+dom_exception dom_html_o_list_element_set_type(
+ dom_html_o_list_element *ele, dom_string *type);
+
+#endif
diff --git a/include/dom/html/html_option_element.h b/include/dom/html/html_option_element.h
index 53ba286..aa0d11c 100644
--- a/include/dom/html/html_option_element.h
+++ b/include/dom/html/html_option_element.h
@@ -28,7 +28,7 @@ dom_exception dom_html_option_element_get_text(
dom_html_option_element *option, dom_string **text);
dom_exception dom_html_option_element_get_index(
- dom_html_option_element *option, unsigned long *index);
+ dom_html_option_element *option, int32_t *index);
dom_exception dom_html_option_element_get_disabled(
dom_html_option_element *option, bool *disabled);
diff --git a/include/dom/html/html_paragraph_element.h b/include/dom/html/html_paragraph_element.h
index 2e182d5..c0e228a 100644
--- a/include/dom/html/html_paragraph_element.h
+++ b/include/dom/html/html_paragraph_element.h
@@ -3,5 +3,21 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_paragraph_element_h_
+#define dom_html_paragraph_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_paragraph_element dom_html_paragraph_element;
+
+dom_exception dom_html_paragraph_element_get_align(
+ dom_html_paragraph_element *element, dom_string **align);
+
+dom_exception dom_html_paragraph_element_set_align(
+ dom_html_paragraph_element *element, dom_string *align);
+
+#endif
diff --git a/include/dom/html/html_param_element.h b/include/dom/html/html_param_element.h
index 2e182d5..be12789 100644
--- a/include/dom/html/html_param_element.h
+++ b/include/dom/html/html_param_element.h
@@ -3,5 +3,39 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_param_element_h_
+#define dom_html_param_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_param_element dom_html_param_element;
+
+dom_exception dom_html_param_element_get_name(
+ dom_html_param_element *element, dom_string **name);
+
+dom_exception dom_html_param_element_set_name(
+ dom_html_param_element *element, dom_string *name);
+
+dom_exception dom_html_param_element_get_type(
+ dom_html_param_element *element, dom_string **type);
+
+dom_exception dom_html_param_element_set_type(
+ dom_html_param_element *ele, dom_string *type);
+
+dom_exception dom_html_param_element_get_value(
+ dom_html_param_element *ele, dom_string **value);
+
+dom_exception dom_html_param_element_set_value(
+ dom_html_param_element *ele, dom_string *value);
+
+dom_exception dom_html_param_element_get_value_type(
+ dom_html_param_element *ele, dom_string **value_type);
+
+dom_exception dom_html_param_element_set_value_type(
+ dom_html_param_element *ele, dom_string *value_type);
+
+#endif
diff --git a/include/dom/html/html_pre_element.h b/include/dom/html/html_pre_element.h
index 2e182d5..bd72701 100644
--- a/include/dom/html/html_pre_element.h
+++ b/include/dom/html/html_pre_element.h
@@ -3,5 +3,21 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_pre_element_h_
+#define dom_html_pre_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_pre_element dom_html_pre_element;
+
+dom_exception dom_html_pre_element_get_width(
+ dom_html_pre_element *element, int32_t *width);
+
+dom_exception dom_html_pre_element_set_width(
+ dom_html_pre_element *element, uint32_t width);
+
+#endif
diff --git a/include/dom/html/html_quote_element.h b/include/dom/html/html_quote_element.h
index 2e182d5..7d88eef 100644
--- a/include/dom/html/html_quote_element.h
+++ b/include/dom/html/html_quote_element.h
@@ -3,5 +3,21 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_quote_element_h_
+#define dom_html_quote_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_quote_element dom_html_quote_element;
+
+dom_exception dom_html_quote_element_get_cite(
+ dom_html_quote_element *element, dom_string **cite);
+
+dom_exception dom_html_quote_element_set_cite(
+ dom_html_quote_element *element, dom_string *cite);
+
+#endif
diff --git a/include/dom/html/html_script_element.h b/include/dom/html/html_script_element.h
index 2e182d5..b7df3aa 100644
--- a/include/dom/html/html_script_element.h
+++ b/include/dom/html/html_script_element.h
@@ -3,5 +3,57 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_script_element_h_
+#define dom_html_script_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_script_element dom_html_script_element;
+
+dom_exception dom_html_script_element_get_defer(
+ dom_html_script_element *ele, bool *defer);
+
+dom_exception dom_html_script_element_set_defer(
+ dom_html_script_element *ele, bool defer);
+
+dom_exception dom_html_script_element_get_text(
+ dom_html_script_element *element, dom_string **text);
+
+dom_exception dom_html_script_element_set_text(
+ dom_html_script_element *element, dom_string *text);
+
+dom_exception dom_html_script_element_get_html_for(
+ dom_html_script_element *element, dom_string **html_for);
+
+dom_exception dom_html_script_element_set_html_for(
+ dom_html_script_element *element, dom_string *html_for);
+
+dom_exception dom_html_script_element_get_event(
+ dom_html_script_element *element, dom_string **event);
+
+dom_exception dom_html_script_element_set_event(
+ dom_html_script_element *ele, dom_string *event);
+
+dom_exception dom_html_script_element_get_charset(
+ dom_html_script_element *ele, dom_string **charset);
+
+dom_exception dom_html_script_element_set_charset(
+ dom_html_script_element *ele, dom_string *charset);
+
+dom_exception dom_html_script_element_get_src(
+ dom_html_script_element *ele, dom_string **src);
+
+dom_exception dom_html_script_element_set_src(
+ dom_html_script_element *ele, dom_string *src);
+
+dom_exception dom_html_script_element_get_type(
+ dom_html_script_element *ele, dom_string **type);
+
+dom_exception dom_html_script_element_set_type(
+ dom_html_script_element *ele, dom_string *type);
+
+#endif
diff --git a/include/dom/html/html_style_element.h b/include/dom/html/html_style_element.h
index 868a043..5b3cd41 100644
--- a/include/dom/html/html_style_element.h
+++ b/include/dom/html/html_style_element.h
@@ -10,6 +10,7 @@
#include <stdbool.h>
#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
typedef struct dom_html_style_element dom_html_style_element;
@@ -19,5 +20,17 @@ dom_exception dom_html_style_element_get_disabled(dom_html_style_element *ele,
dom_exception dom_html_style_element_set_disabled(dom_html_style_element *ele,
bool disabled);
+dom_exception dom_html_style_element_get_media(dom_html_style_element *ele,
+ dom_string **media);
+
+dom_exception dom_html_style_element_set_media(dom_html_style_element *ele,
+ dom_string *media);
+
+dom_exception dom_html_style_element_get_type(dom_html_style_element *ele,
+ dom_string **type);
+
+dom_exception dom_html_style_element_set_type(dom_html_style_element *ele,
+ dom_string *type);
+
#endif
diff --git a/include/dom/html/html_table_element.h b/include/dom/html/html_table_element.h
index 2e182d5..6fcd7ed 100644
--- a/include/dom/html/html_table_element.h
+++ b/include/dom/html/html_table_element.h
@@ -3,5 +3,128 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_table_element_h_
+#define dom_html_table_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+#include<dom/html/html_element.h>
+#include<dom/html/html_tablecaption_element.h>
+#include<dom/html/html_tablesection_element.h>
+#include<dom/html/html_tablerow_element.h>
+
+typedef struct dom_html_table_element dom_html_table_element;
+
+dom_exception dom_html_table_element_get_caption(
+ dom_html_table_element *element, dom_html_table_caption_element **caption);
+
+dom_exception dom_html_table_element_set_caption(
+ dom_html_table_element *element, dom_html_table_caption_element *caption);
+
+dom_exception dom_html_table_element_get_t_head(
+ dom_html_table_element *element, dom_html_table_section_element **t_head);
+
+dom_exception dom_html_table_element_set_t_head(
+ dom_html_table_element *element, dom_html_table_section_element *t_head);
+
+dom_exception dom_html_table_element_get_t_foot(
+ dom_html_table_element *element, dom_html_table_section_element **t_foot);
+
+dom_exception dom_html_table_element_set_t_foot(
+ dom_html_table_element *element, dom_html_table_section_element *t_foot);
+
+dom_exception dom_html_table_element_get_rows(
+ dom_html_table_element *element, dom_html_collection **rows);
+
+dom_exception dom_html_table_element_get_t_bodies(
+ dom_html_table_element *element, dom_html_collection **t_bodies);
+
+dom_exception dom_html_table_element_get_align(
+ dom_html_table_element *table, dom_string **align);
+
+dom_exception dom_html_table_element_set_align(
+ dom_html_table_element *table, dom_string *align);
+
+dom_exception dom_html_table_element_get_bg_color(
+ dom_html_table_element *table, dom_string **bg_color);
+
+dom_exception dom_html_table_element_set_bg_color(
+ dom_html_table_element *table, dom_string *bg_color);
+
+dom_exception dom_html_table_element_get_border(
+ dom_html_table_element *table, dom_string **border);
+
+dom_exception dom_html_table_element_set_border(
+ dom_html_table_element *table, dom_string *border);
+
+dom_exception dom_html_table_element_get_cell_padding(
+ dom_html_table_element *table, dom_string **cell_padding);
+
+dom_exception dom_html_table_element_set_cell_padding(
+ dom_html_table_element *table, dom_string *cell_padding);
+
+dom_exception dom_html_table_element_get_cell_spacing(
+ dom_html_table_element *table, dom_string **cell_spacing);
+
+dom_exception dom_html_table_element_set_cell_spacing(
+ dom_html_table_element *table, dom_string *cell_spacing);
+
+dom_exception dom_html_table_element_get_frame(
+ dom_html_table_element *table, dom_string **frame);
+
+dom_exception dom_html_table_element_set_frame(
+ dom_html_table_element *table, dom_string *frame);
+
+dom_exception dom_html_table_element_get_rules(
+ dom_html_table_element *table, dom_string **rules);
+
+dom_exception dom_html_table_element_set_rules(
+ dom_html_table_element *table, dom_string *rules);
+
+dom_exception dom_html_table_element_get_summary(
+ dom_html_table_element *table, dom_string **summary);
+
+dom_exception dom_html_table_element_set_summary(
+ dom_html_table_element *table, dom_string *summary);
+
+dom_exception dom_html_table_element_get_width(
+ dom_html_table_element *table, dom_string **width);
+
+dom_exception dom_html_table_element_set_width(
+ dom_html_table_element *table, dom_string *width);
+
+dom_exception dom_html_table_element_create_caption(
+ dom_html_table_element *element,
+ dom_html_element **caption);
+
+dom_exception dom_html_table_element_delete_caption(
+ dom_html_table_element *element);
+
+dom_exception dom_html_table_element_create_t_head(
+ dom_html_table_element *element,
+ dom_html_element **t_head);
+
+dom_exception dom_html_table_element_delete_t_head(
+ dom_html_table_element *element);
+
+dom_exception dom_html_table_element_create_t_foot(
+ dom_html_table_element *element,
+ dom_html_element **t_foot);
+
+dom_exception dom_html_table_element_delete_t_foot(
+ dom_html_table_element *element);
+
+dom_exception dom_html_table_element_insert_row(
+ dom_html_table_element *element,
+ int32_t index, dom_html_element **row);
+
+dom_exception dom_html_table_element_delete_row(
+ dom_html_table_element *element,
+ int32_t index);
+
+#endif
diff --git a/include/dom/html/html_tablecaption_element.h b/include/dom/html/html_tablecaption_element.h
index 2e182d5..412efae 100644
--- a/include/dom/html/html_tablecaption_element.h
+++ b/include/dom/html/html_tablecaption_element.h
@@ -3,5 +3,21 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_table_caption_element_h_
+#define dom_html_table_caption_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_table_caption_element dom_html_table_caption_element;
+
+dom_exception dom_html_table_caption_element_get_align(
+ dom_html_table_caption_element *element, dom_string **align);
+
+dom_exception dom_html_table_caption_element_set_align(
+ dom_html_table_caption_element *element, dom_string *align);
+
+#endif
diff --git a/include/dom/html/html_tablecell_element.h b/include/dom/html/html_tablecell_element.h
index 2e182d5..938d148 100644
--- a/include/dom/html/html_tablecell_element.h
+++ b/include/dom/html/html_tablecell_element.h
@@ -3,5 +3,104 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1bg_colorr99@gmail.com>
*/
+#ifndef dom_html_table_cell_element_h_
+#define dom_html_table_cell_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_table_cell_element dom_html_table_cell_element;
+
+dom_exception dom_html_table_cell_element_get_cell_index(
+ dom_html_table_cell_element *table_cell, int32_t *cell_index);
+
+dom_exception dom_html_table_cell_element_get_abbr(
+ dom_html_table_cell_element *table_cell, dom_string **abbr);
+
+dom_exception dom_html_table_cell_element_set_abbr(
+ dom_html_table_cell_element *table_cell, dom_string *abbr);
+
+dom_exception dom_html_table_cell_element_get_align(
+ dom_html_table_cell_element *table_cell, dom_string **align);
+
+dom_exception dom_html_table_cell_element_set_align(
+ dom_html_table_cell_element *table_cell, dom_string *align);
+
+dom_exception dom_html_table_cell_element_get_axis(
+ dom_html_table_cell_element *table_cell, dom_string **axis);
+
+dom_exception dom_html_table_cell_element_set_axis(
+ dom_html_table_cell_element *table_cell, dom_string *axis);
+
+dom_exception dom_html_table_cell_element_get_bg_color(
+ dom_html_table_cell_element *table_cell, dom_string **bg_color);
+
+dom_exception dom_html_table_cell_element_set_bg_color(
+ dom_html_table_cell_element *table_cell, dom_string *bg_color);
+
+dom_exception dom_html_table_cell_element_get_ch(
+ dom_html_table_cell_element *table_cell, dom_string **ch);
+
+dom_exception dom_html_table_cell_element_set_ch(
+ dom_html_table_cell_element *table_cell, dom_string *ch);
+
+dom_exception dom_html_table_cell_element_get_ch_off(
+ dom_html_table_cell_element *table_cell, dom_string **ch_off);
+
+dom_exception dom_html_table_cell_element_set_ch_off(
+ dom_html_table_cell_element *table_cell, dom_string *ch_off);
+
+dom_exception dom_html_table_cell_element_get_headers(
+ dom_html_table_cell_element *table_cell, dom_string **headers);
+
+dom_exception dom_html_table_cell_element_set_headers(
+ dom_html_table_cell_element *table_cell, dom_string *headers);
+
+dom_exception dom_html_table_cell_element_get_height(
+ dom_html_table_cell_element *table_cell, dom_string **height);
+
+dom_exception dom_html_table_cell_element_set_height(
+ dom_html_table_cell_element *table_cell, dom_string *height);
+
+dom_exception dom_html_table_cell_element_get_scope(
+ dom_html_table_cell_element *table_cell, dom_string **scope);
+
+dom_exception dom_html_table_cell_element_set_scope(
+ dom_html_table_cell_element *table_cell, dom_string *scope);
+
+dom_exception dom_html_table_cell_element_get_v_align(
+ dom_html_table_cell_element *table_cell, dom_string **v_align);
+
+dom_exception dom_html_table_cell_element_set_v_align(
+ dom_html_table_cell_element *table_cell, dom_string *v_align);
+
+dom_exception dom_html_table_cell_element_get_width(
+ dom_html_table_cell_element *table_cell, dom_string **width);
+
+dom_exception dom_html_table_cell_element_set_width(
+ dom_html_table_cell_element *table_cell, dom_string *width);
+
+dom_exception dom_html_table_cell_element_get_col_span(
+ dom_html_table_cell_element *table_cell, int32_t *col_span);
+
+dom_exception dom_html_table_cell_element_set_col_span(
+ dom_html_table_cell_element *table_cell, uint32_t col_span);
+
+dom_exception dom_html_table_cell_element_get_row_span(
+ dom_html_table_cell_element *table_cell, int32_t *row_span);
+
+dom_exception dom_html_table_cell_element_set_row_span(
+ dom_html_table_cell_element *table_cell, uint32_t row_span);
+
+dom_exception dom_html_table_cell_element_get_no_wrap(
+ dom_html_table_cell_element *ele, bool *no_wrap);
+
+dom_exception dom_html_table_cell_element_set_no_wrap(
+ dom_html_table_cell_element *ele, bool no_wrap);
+
+#endif
+
diff --git a/include/dom/html/html_tablecol_element.h b/include/dom/html/html_tablecol_element.h
index 2e182d5..56865a9 100644
--- a/include/dom/html/html_tablecol_element.h
+++ b/include/dom/html/html_tablecol_element.h
@@ -3,5 +3,53 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1v_alignr99@gmail.com>
*/
+#ifndef dom_html_table_col_element_h_
+#define dom_html_table_col_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_table_col_element dom_html_table_col_element;
+
+dom_exception dom_html_table_col_element_get_align(
+ dom_html_table_col_element *table_col, dom_string **align);
+
+dom_exception dom_html_table_col_element_set_align(
+ dom_html_table_col_element *table_col, dom_string *align);
+
+dom_exception dom_html_table_col_element_get_ch(
+ dom_html_table_col_element *table_col, dom_string **ch);
+
+dom_exception dom_html_table_col_element_set_ch(
+ dom_html_table_col_element *table_col, dom_string *ch);
+
+dom_exception dom_html_table_col_element_get_ch_off(
+ dom_html_table_col_element *table_col, dom_string **ch_off);
+
+dom_exception dom_html_table_col_element_set_ch_off(
+ dom_html_table_col_element *table_col, dom_string *ch_off);
+
+dom_exception dom_html_table_col_element_get_v_align(
+ dom_html_table_col_element *table_col, dom_string **v_align);
+
+dom_exception dom_html_table_col_element_set_v_align(
+ dom_html_table_col_element *table_col, dom_string *v_align);
+
+dom_exception dom_html_table_col_element_get_width(
+ dom_html_table_col_element *table_col, dom_string **width);
+
+dom_exception dom_html_table_col_element_set_width(
+ dom_html_table_col_element *table_col, dom_string *width);
+
+dom_exception dom_html_table_col_element_get_span(
+ dom_html_table_col_element *table_col, int32_t *span);
+
+dom_exception dom_html_table_col_element_set_span(
+ dom_html_table_col_element *table_col, uint32_t span);
+
+#endif
+
diff --git a/include/dom/html/html_tablerow_element.h b/include/dom/html/html_tablerow_element.h
index 2e182d5..897e243 100644
--- a/include/dom/html/html_tablerow_element.h
+++ b/include/dom/html/html_tablerow_element.h
@@ -3,5 +3,67 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_table_row_element_h_
+#define dom_html_table_row_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+#include<dom/html/html_element.h>
+#include<dom/html/html_collection.h>
+
+typedef struct dom_html_table_row_element dom_html_table_row_element;
+
+dom_exception dom_html_table_row_element_get_align(
+ dom_html_table_row_element *table, dom_string **align);
+
+dom_exception dom_html_table_row_element_set_align(
+ dom_html_table_row_element *table, dom_string *align);
+
+dom_exception dom_html_table_row_element_get_bg_color(
+ dom_html_table_row_element *table, dom_string **bg_color);
+
+dom_exception dom_html_table_row_element_set_bg_color(
+ dom_html_table_row_element *table, dom_string *bg_color);
+
+dom_exception dom_html_table_row_element_get_ch(
+ dom_html_table_row_element *table, dom_string **ch);
+
+dom_exception dom_html_table_row_element_set_ch(
+ dom_html_table_row_element *table, dom_string *ch);
+
+dom_exception dom_html_table_row_element_get_ch_off(
+ dom_html_table_row_element *table, dom_string **ch_off);
+
+dom_exception dom_html_table_row_element_set_ch_off(
+ dom_html_table_row_element *table, dom_string *ch_off);
+
+dom_exception dom_html_table_row_element_get_v_align(
+ dom_html_table_row_element *table, dom_string **v_align);
+
+dom_exception dom_html_table_row_element_set_v_align(
+ dom_html_table_row_element *table, dom_string *v_align);
+
+dom_exception dom_html_table_row_element_get_row_index(
+ dom_html_table_row_element *table, int32_t *index);
+
+dom_exception dom_html_table_row_element_get_section_row_index(
+ dom_html_table_row_element *table_row, int32_t *section_row_index);
+
+dom_exception dom_html_table_row_element_get_cells(
+ dom_html_table_row_element *element,
+ dom_html_collection **cells);
+
+dom_exception dom_html_table_row_element_delete_cell(
+ dom_html_table_row_element *element,
+ int32_t index);
+
+dom_exception dom_html_table_row_element_insert_cell(
+ dom_html_table_row_element *element,
+ int32_t index, dom_html_element **cell);
+
+#endif
diff --git a/include/dom/html/html_tablesection_element.h b/include/dom/html/html_tablesection_element.h
index 2e182d5..bceec18 100644
--- a/include/dom/html/html_tablesection_element.h
+++ b/include/dom/html/html_tablesection_element.h
@@ -3,5 +3,57 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1v_alignr99@gmail.com>
*/
+#ifndef dom_html_table_section_element_h_
+#define dom_html_table_section_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+#include <dom/html/html_collection.h>
+#include <dom/html/html_element.h>
+
+#include <dom/html/html_tablerow_element.h>
+
+typedef struct dom_html_table_section_element dom_html_table_section_element;
+
+dom_exception dom_html_table_section_element_get_align(
+ dom_html_table_section_element *table_section, dom_string **align);
+
+dom_exception dom_html_table_section_element_set_align(
+ dom_html_table_section_element *table_section, dom_string *align);
+
+dom_exception dom_html_table_section_element_get_ch(
+ dom_html_table_section_element *table_section, dom_string **ch);
+
+dom_exception dom_html_table_section_element_set_ch(
+ dom_html_table_section_element *table_section, dom_string *ch);
+
+dom_exception dom_html_table_section_element_get_ch_off(
+ dom_html_table_section_element *table_section, dom_string **ch_off);
+
+dom_exception dom_html_table_section_element_set_ch_off(
+ dom_html_table_section_element *table_section, dom_string *ch_off);
+
+dom_exception dom_html_table_section_element_get_v_align(
+ dom_html_table_section_element *table_section, dom_string **v_align);
+
+dom_exception dom_html_table_section_element_set_v_align(
+ dom_html_table_section_element *table_section, dom_string *v_align);
+
+dom_exception dom_html_table_section_element_get_rows(
+ dom_html_table_section_element *table_section, dom_html_collection **rows);
+
+dom_exception dom_html_table_section_element_insert_row(
+ dom_html_table_section_element *element,
+ int32_t index, dom_html_element **new_row);
+
+dom_exception dom_html_table_section_element_delete_row(
+ dom_html_table_section_element *element,
+ int32_t index);
+
+#endif
+
diff --git a/include/dom/html/html_ulist_element.h b/include/dom/html/html_ulist_element.h
index 2e182d5..c5daa6a 100644
--- a/include/dom/html/html_ulist_element.h
+++ b/include/dom/html/html_ulist_element.h
@@ -3,5 +3,27 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_html_u_list_element_h_
+#define dom_html_u_list_element_h_
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_u_list_element dom_html_u_list_element;
+
+dom_exception dom_html_u_list_element_get_compact(
+ dom_html_u_list_element *ele, bool *compact);
+
+dom_exception dom_html_u_list_element_set_compact(
+ dom_html_u_list_element *ele, bool compact);
+
+dom_exception dom_html_u_list_element_get_type(
+ dom_html_u_list_element *ele, dom_string **type);
+
+dom_exception dom_html_u_list_element_set_type(
+ dom_html_u_list_element *ele, dom_string *type);
+
+#endif
diff --git a/src/html/Makefile b/src/html/Makefile
index 5226b53..c98ce9a 100644
--- a/src/html/Makefile
+++ b/src/html/Makefile
@@ -3,24 +3,23 @@ DIR_SOURCES := \
html_document.c html_collection.c html_options_collection.c \
html_element.c html_html_element.c html_head_element.c \
html_link_element.c html_title_element.c html_meta_element.c \
- html_base_element.c html_isindex_element.c html_style_element.c \
+ html_base_element.c html_style_element.c \
html_body_element.c html_form_element.c html_select_element.c \
html_button_element.c html_input_element.c html_text_area_element.c \
- html_opt_group_element.c html_option_element.c html_hr_element.c
+ html_opt_group_element.c html_option_element.c html_hr_element.c \
+ html_dlist_element.c html_directory_element.c html_menu_element.c \
+ html_fieldset_element.c html_legend_element.c html_div_element.c \
+ html_paragraph_element.c html_heading_element.c html_quote_element.c \
+ html_pre_element.c html_br_element.c html_label_element.c \
+ html_ulist_element.c html_olist_element.c html_li_element.c \
+ html_font_element.c html_mod_element.c html_anchor_element.c \
+ html_basefont_element.c html_image_element.c html_object_element.c \
+ html_param_element.c html_applet_element.c html_area_element.c \
+ html_map_element.c html_script_element.c html_tablecaption_element.c \
+ html_tablecell_element.c html_tablecol_element.c html_tablesection_element.c \
+ html_table_element.c html_tablerow_element.c html_frameset_element.c \
+ html_frame_element.c html_iframe_element.c html_isindex_element.c \
UNINMPLEMENTED_SOURCES := \
- html_label_element.c html_fieldset_element.c \
- html_legend_element.c html_ulist_element.c html_olist_element.c \
- html_dlist_element.c html_directory_element.c html_menu_element.c \
- html_li_element.c html_div_element.c html_paragraph_element.c \
- html_heading_element.c html_quote_element.c html_pre_element.c \
- html_br_element.c html_basefont_element.c html_font_element.c \
- html_mod_element.c html_anchor_element.c \
- html_image_element.c html_object_element.c html_param_element.c \
- html_applet_element.c html_map_element.c html_area_element.c \
- html_script_element.c html_table_element.c html_tablecaption_element.c \
- html_tablecol_element.c html_tablesection_element.c html_tablerow_element.c \
- html_tablecell_element.c html_frameset_element.c html_frame_element.c \
- html_iframe_element.c
include $(NSBUILD)/Makefile.subdir
diff --git a/src/html/TODO b/src/html/TODO
index 37ade2c..b55a6d7 100644
--- a/src/html/TODO
+++ b/src/html/TODO
@@ -4,54 +4,54 @@ as far as the test suite is concerned.
HTMLElement html_element DONE
HTMLHtmlElement html_html_element DONE
HTMLHeadElement html_head_element DONE
-HTMLLinkElement html_link_element MISSING
+HTMLLinkElement html_link_element DONE
HTMLTitleElement html_title_element DONE
-HTMLMetaElement html_meta_element MISSING
-HTMLBaseElement html_base_element MISSING
+HTMLMetaElement html_meta_element DONE
+HTMLBaseElement html_base_element DONE
HTMLIsIndexElement html_isindex_element MISSING
-HTMLStyleElement html_style_element MISSING
-HTMLBodyElement html_body_element MISSING
+HTMLStyleElement html_style_element DONE
+HTMLBodyElement html_body_element DONE
HTMLFormElement html_form_element DONE
-HTMLSelectElement html_select_element MISSING
-HTMLOptGroupElement html_optgroup_element MISSING
-HTMLOptionElement html_option_element MISSING
-HTMLInputElement html_input_element MISSING
-HTMLTextAreaElement html_textarea_element MISSING
-HTMLButtonElement html_button_element MISSING
-HTMLLabelElement html_label_element MISSING
-HTMLFieldSetElement html_fieldset_element MISSING
-HTMLLegendElement html_legend_element MISSING
-HTMLUListElement html_ulist_element MISSING
-HTMLOListElement html_olist_element MISSING
-HTMLDListElement html_dlist_element MISSING
-HTMLDirectoryElement html_directory_element MISSING
-HTMLMenuElement html_menu_element MISSING
-HTMLLIElement html_li_element MISSING
-HTMLBlockquoteElement html_blockquote_element MISSING
-HTMLDivElement html_div_element MISSING
-HTMLParagraphElement html_paragraph_element MISSING
-HTMLHeadingElement html_heading_element MISSING
-HTMLQuoteElement html_quote_element MISSING
-HTMLPreElement html_pre_element MISSING
-HTMLBRElement html_br_element MISSING
-HTMLBaseFontElement html_basefont_element MISSING
-HTMLFontElement html_font_element MISSING
+HTMLSelectElement html_select_element DONE
+HTMLOptGroupElement html_optgroup_element DONE
+HTMLOptionElement html_option_element DONE
+HTMLInputElement html_input_element DONE
+HTMLTextAreaElement html_textarea_element DONE
+HTMLButtonElement html_button_element DONE
+HTMLLabelElement html_label_element DONE
+HTMLFieldSetElement html_fieldset_element DONE
+HTMLLegendElement html_legend_element DONE
+HTMLUListElement html_ulist_element DONE
+HTMLOListElement html_olist_element DONE
+HTMLDListElement html_dlist_element DONE
+HTMLDirectoryElement html_directory_element DONE
+HTMLMenuElement html_menu_element DONE
+HTMLLIElement html_li_element DONE
+HTMLBlockquoteElement html_blockquote_element DONE
+HTMLDivElement html_div_element DONE
+HTMLParagraphElement html_paragraph_element DONE
+HTMLHeadingElement html_heading_element DONE
+HTMLQuoteElement html_quote_element DONE
+HTMLPreElement html_pre_element DONE
+HTMLBRElement html_br_element DONE
+HTMLBaseFontElement html_basefont_element DONE
+HTMLFontElement html_font_element DONE
HTMLHRElement html_hr_element DONE
-HTMLModElement html_mod_element MISSING
-HTMLAnchorElement html_anchor_element MISSING
-HTMLImageElement html_image_element MISSING
-HTMLObjectElement html_object_element MISSING
-HTMLParamElement html_param_element MISSING
-HTMLAppletElement html_applet_element MISSING
-HTMLMapElement html_map_element MISSING
-HTMLAreaElement html_area_element MISSING
-HTMLScriptElement html_script_element MISSING
-HTMLTableElement html_table_element MISSING
-HTMLTableCaptionElement html_tablecaption_element MISSING
-HTMLTableColElement html_tablecol_element MISSING
-HTMLTableSectionElement html_tablesection_element MISSING
-HTMLTableRowElement html_tablerow_element MISSING
-HTMLTableCellElement html_tablecell_element MISSING
+HTMLModElement html_mod_element DONE
+HTMLAnchorElement html_anchor_element DONE
+HTMLImageElement html_image_element DONE
+HTMLObjectElement html_object_element DONE
+HTMLParamElement html_param_element DONE
+HTMLAppletElement html_applet_element DONE
+HTMLMapElement html_map_element DONE
+HTMLAreaElement html_area_element DONE
+HTMLScriptElement html_script_element DONE
+HTMLTableElement html_table_element DONE
+HTMLTableCaptionElement html_tablecaption_element DONE
+HTMLTableColElement html_tablecol_element DONE
+HTMLTableSectionElement html_tablesection_element DONE
+HTMLTableRowElement html_tablerow_element DONE
+HTMLTableCellElement html_tablecell_element DONE
HTMLFrameSetElement html_frameset_element MISSING
HTMLFrameElement html_frame_element MISSING
HTMLIFrameElement html_iframe_element MISSING
diff --git a/src/html/html_anchor_element.c b/src/html/html_anchor_element.c
index 2e182d5..77f8cef 100644
--- a/src/html/html_anchor_element.c
+++ b/src/html/html_anchor_element.c
@@ -3,5 +3,225 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_anchor_element.h>
+
+#include "html/html_document.h"
+#include "html/html_anchor_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_ANCHOR_ELEMENT
+ },
+ DOM_HTML_ANCHOR_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_anchor_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_anchor_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_anchor_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_anchor_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_anchor_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_anchor_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_anchor_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_anchor_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_anchor_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_A],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_anchor_element object
+ *
+ * \param ele The dom_html_anchor_element object
+ */
+void _dom_html_anchor_element_finalise(struct dom_html_anchor_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_anchor_element object
+ *
+ * \param ele The dom_html_anchor_element object
+ */
+void _dom_html_anchor_element_destroy(struct dom_html_anchor_element *ele)
+{
+ _dom_html_anchor_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_anchor_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_anchor_element_destroy(dom_node_internal *node)
+{
+ _dom_html_anchor_element_destroy((struct dom_html_anchor_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_anchor_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_anchor_element_get_##attr( \
+ dom_html_anchor_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_anchor_element_set_##attr( \
+ dom_html_anchor_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(access_key);
+SIMPLE_GET_SET(charset);
+SIMPLE_GET_SET(coords);
+SIMPLE_GET_SET(href);
+SIMPLE_GET_SET(hreflang);
+SIMPLE_GET_SET(name);
+SIMPLE_GET_SET(rel);
+SIMPLE_GET_SET(rev);
+SIMPLE_GET_SET(shape);
+SIMPLE_GET_SET(target);
+SIMPLE_GET_SET(type);
+
+dom_exception dom_html_anchor_element_get_tab_index(
+ dom_html_anchor_element *anchor, int32_t *tab_index)
+{
+ return dom_html_element_get_int32_t_property(&anchor->base, "tabindex",
+ SLEN("tabindex"), tab_index);
+}
+
+dom_exception dom_html_anchor_element_set_tab_index(
+ dom_html_anchor_element *anchor, uint32_t tab_index)
+{
+ return dom_html_element_set_int32_t_property(&anchor->base, "tabindex",
+ SLEN("tabindex"), tab_index);
+}
+
+
+/**
+ * Blur this control
+ *
+ * \param ele The form object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_anchor_element_blur(dom_html_anchor_element *ele)
+{
+ struct dom_html_document *doc =
+ (dom_html_document *) dom_node_get_owner(ele);
+ bool success = false;
+ assert(doc != NULL);
+
+ /* This event does not bubble & is non-cancelable. Mentioned in w3 specs. More research is needed to prove why. */
+ return _dom_dispatch_generic_event((dom_document *) doc,
+ (dom_event_target *) ele,
+ doc->memoised[hds_blur], false,
+ false, &success);
+}
+
+/**
+ * Focus this control
+ *
+ * \param ele The form object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_anchor_element_focus(dom_html_anchor_element *ele)
+{
+ struct dom_html_document *doc =
+ (dom_html_document *) dom_node_get_owner(ele);
+ bool success = false;
+ assert(doc != NULL);
+
+ /* This event does not bubble & is non-cancelable. Mentioned in w3 specs. More research is needed to prove why. */
+ return _dom_dispatch_generic_event((dom_document *)doc,
+ (dom_event_target *) ele,
+ doc->memoised[hds_focus], false,
+ false, &success);
+}
+
diff --git a/src/html/html_anchor_element.h b/src/html/html_anchor_element.h
index 2e182d5..a9f5b5b 100644
--- a/src/html/html_anchor_element.h
+++ b/src/html/html_anchor_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_anchor_element_h_
+#define dom_internal_html_anchor_element_h_
+
+#include <dom/html/html_anchor_element.h>
+
+#include "html/html_element.h"
+
+struct dom_html_anchor_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_anchor_element object */
+dom_exception _dom_html_anchor_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_anchor_element **ele);
+
+/* Initialise a dom_html_anchor_element object */
+dom_exception _dom_html_anchor_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_anchor_element *ele);
+
+/* Finalise a dom_html_anchor_element object */
+void _dom_html_anchor_element_finalise(struct dom_html_anchor_element *ele);
+
+/* Destroy a dom_html_anchor_element object */
+void _dom_html_anchor_element_destroy(struct dom_html_anchor_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_anchor_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_anchor_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_anchor_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_ANCHOR_ELEMENT_PROTECT_VTABLE \
+ _dom_html_anchor_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_ANCHOR_ELEMENT \
+ _dom_virtual_html_anchor_element_destroy, \
+ _dom_html_anchor_element_copy
+
+#endif
diff --git a/src/html/html_applet_element.c b/src/html/html_applet_element.c
index 2e182d5..9f6c16f 100644
--- a/src/html/html_applet_element.c
+++ b/src/html/html_applet_element.c
@@ -3,5 +3,196 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_applet_element.h>
+
+#include "html/html_document.h"
+#include "html/html_applet_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_APPLET_ELEMENT
+ },
+ DOM_HTML_APPLET_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_applet_element applet
+ *
+ * \param doc The document applet
+ * \param ele The returned element applet
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_applet_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_applet_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_applet_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_applet_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_applet_element applet
+ *
+ * \param doc The document applet
+ * \param ele The dom_html_applet_element applet
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_applet_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_applet_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_APPLET],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_applet_element applet
+ *
+ * \param ele The dom_html_applet_element applet
+ */
+void _dom_html_applet_element_finalise(struct dom_html_applet_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_applet_element applet
+ *
+ * \param ele The dom_html_applet_element applet
+ */
+void _dom_html_applet_element_destroy(struct dom_html_applet_element *ele)
+{
+ _dom_html_applet_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_applet_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_applet_element_destroy(dom_node_internal *node)
+{
+ _dom_html_applet_element_destroy((struct dom_html_applet_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_applet_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_applet_element_get_##attr( \
+ dom_html_applet_element *element, \
+ dom_string **attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_applet_element_set_##attr( \
+ dom_html_applet_element *element, \
+ dom_string *attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(align);
+SIMPLE_GET_SET(alt);
+SIMPLE_GET_SET(archive);
+SIMPLE_GET_SET(code);
+SIMPLE_GET_SET(code_base);
+SIMPLE_GET_SET(height);
+SIMPLE_GET_SET(name);
+SIMPLE_GET_SET(object);
+SIMPLE_GET_SET(width);
+
+dom_exception dom_html_applet_element_get_hspace(
+ dom_html_applet_element *applet, int32_t *hspace)
+{
+ return dom_html_element_get_int32_t_property(&applet->base, "hspace",
+ SLEN("hspace"), hspace);
+}
+
+dom_exception dom_html_applet_element_set_hspace(
+ dom_html_applet_element *applet, uint32_t hspace)
+{
+ return dom_html_element_set_int32_t_property(&applet->base, "hspace",
+ SLEN("hspace"), hspace);
+}
+
+dom_exception dom_html_applet_element_get_vspace(
+ dom_html_applet_element *applet, int32_t *vspace)
+{
+ return dom_html_element_get_int32_t_property(&applet->base, "vspace",
+ SLEN("vspace"), vspace);
+}
+
+dom_exception dom_html_applet_element_set_vspace(
+ dom_html_applet_element *applet, uint32_t vspace)
+{
+ return dom_html_element_set_int32_t_property(&applet->base, "vspace",
+ SLEN("vspace"), vspace);
+}
+
diff --git a/src/html/html_applet_element.h b/src/html/html_applet_element.h
index 2e182d5..21e6d7a 100644
--- a/src/html/html_applet_element.h
+++ b/src/html/html_applet_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_applet_element_h_
+#define dom_internal_html_applet_element_h_
+
+#include <dom/html/html_applet_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_applet_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_applet_element object */
+dom_exception _dom_html_applet_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_applet_element **ele);
+
+/* Initialise a dom_html_applet_element object */
+dom_exception _dom_html_applet_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_applet_element *ele);
+
+/* Finalise a dom_html_applet_element object */
+void _dom_html_applet_element_finalise(struct dom_html_applet_element *ele);
+
+/* Destroy a dom_html_applet_element object */
+void _dom_html_applet_element_destroy(struct dom_html_applet_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_applet_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_applet_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_applet_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_APPLET_ELEMENT_PROTECT_VTABLE \
+ _dom_html_applet_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_APPLET_ELEMENT \
+ _dom_virtual_html_applet_element_destroy, \
+ _dom_html_applet_element_copy
+
+#endif
diff --git a/src/html/html_area_element.c b/src/html/html_area_element.c
index 2e182d5..85a2a3e 100644
--- a/src/html/html_area_element.c
+++ b/src/html/html_area_element.c
@@ -3,5 +3,220 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_area_element.h>
+
+#include "html/html_document.h"
+#include "html/html_area_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_AREA_ELEMENT
+ },
+ DOM_HTML_AREA_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_area_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_area_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_area_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_area_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_area_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_area_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_area_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_area_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_area_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_AREA],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_area_element object
+ *
+ * \param ele The dom_html_area_element object
+ */
+void _dom_html_area_element_finalise(struct dom_html_area_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_area_element object
+ *
+ * \param ele The dom_html_area_element object
+ */
+void _dom_html_area_element_destroy(struct dom_html_area_element *ele)
+{
+ _dom_html_area_element_finalise(ele);
+ free(ele);
+}
+
+/**
+ * Get the no_href property
+ *
+ * \param ele The dom_html_area_element object
+ * \param no_href The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_area_element_get_no_href(dom_html_area_element *ele,
+ bool *no_href)
+{
+ return dom_html_element_get_bool_property(&ele->base, "nohref",
+ SLEN("nohref"), no_href);
+}
+
+/**
+ * Set the no_href property
+ *
+ * \param ele The dom_html_area_element object
+ * \param no_href The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_area_element_set_no_href(dom_html_area_element *ele,
+ bool no_href)
+{
+ return dom_html_element_set_bool_property(&ele->base, "nohref",
+ SLEN("nohref"), no_href);
+}
+
+/**
+ * Set the tab_index property
+ *
+ * \param ele The dom_html_area_element object
+ * \param no_href The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_area_element_get_tab_index(
+ dom_html_area_element *area, int32_t *tab_index)
+{
+ return dom_html_element_get_int32_t_property(&area->base, "tabindex",
+ SLEN("tabindex"), tab_index);
+}
+
+/**
+ * Set the tab_index property
+ *
+ * \param ele The dom_html_area_element object
+ * \param no_href The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_area_element_set_tab_index(
+ dom_html_area_element *area, uint32_t tab_index)
+{
+ return dom_html_element_set_int32_t_property(&area->base, "tabindex",
+ SLEN("tabindex"), tab_index);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_area_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_area_element_destroy(dom_node_internal *node)
+{
+ _dom_html_area_element_destroy((struct dom_html_area_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_area_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_area_element_get_##attr( \
+ dom_html_area_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_area_element_set_##attr( \
+ dom_html_area_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(access_key);
+SIMPLE_GET_SET(alt);
+SIMPLE_GET_SET(coords);
+SIMPLE_GET_SET(href);
+SIMPLE_GET_SET(shape);
+SIMPLE_GET_SET(target);
diff --git a/src/html/html_area_element.h b/src/html/html_area_element.h
index 2e182d5..a45d1df 100644
--- a/src/html/html_area_element.h
+++ b/src/html/html_area_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_area_element_h_
+#define dom_internal_html_area_element_h_
+
+#include <dom/html/html_area_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_area_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_area_element object */
+dom_exception _dom_html_area_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_area_element **ele);
+
+/* Initialise a dom_html_area_element object */
+dom_exception _dom_html_area_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_area_element *ele);
+
+/* Finalise a dom_html_area_element object */
+void _dom_html_area_element_finalise(struct dom_html_area_element *ele);
+
+/* Destroy a dom_html_area_element object */
+void _dom_html_area_element_destroy(struct dom_html_area_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_area_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_area_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_area_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_AREA_ELEMENT_PROTECT_VTABLE \
+ _dom_html_area_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_AREA_ELEMENT \
+ _dom_virtual_html_area_element_destroy, \
+ _dom_html_area_element_copy
+
+#endif
diff --git a/src/html/html_base_element.c b/src/html/html_base_element.c
index 150ef37..6be8e3a 100644
--- a/src/html/html_base_element.c
+++ b/src/html/html_base_element.c
@@ -7,6 +7,7 @@
#include <stdlib.h>
+#include "html/html_document.h"
#include "html/html_base_element.h"
#include "core/node.h"
@@ -118,3 +119,45 @@ dom_exception _dom_html_base_element_copy(dom_node_internal *old,
return _dom_html_element_copy(old, copy);
}
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_base_element_get_##attr( \
+ dom_html_base_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_base_element_set_##attr( \
+ dom_html_base_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(href);
+SIMPLE_GET_SET(target);
diff --git a/src/html/html_basefont_element.c b/src/html/html_basefont_element.c
index 2e182d5..7aa20a0 100644
--- a/src/html/html_basefont_element.c
+++ b/src/html/html_basefont_element.c
@@ -3,5 +3,182 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+#include <dom/html/html_basefont_element.h>
+
+#include "html/html_document.h"
+#include "html/html_basefont_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_BASE_FONT_ELEMENT
+ },
+ DOM_HTML_BASE_FONT_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_base_font_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_base_font_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_base_font_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_base_font_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_base_font_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_base_font_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_base_font_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_base_font_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_base_font_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_BASEFONT],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_base_font_element object
+ *
+ * \param ele The dom_html_base_font_element object
+ */
+void _dom_html_base_font_element_finalise(struct dom_html_base_font_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_base_font_element object
+ *
+ * \param ele The dom_html_base_font_element object
+ */
+void _dom_html_base_font_element_destroy(struct dom_html_base_font_element *ele)
+{
+ _dom_html_base_font_element_finalise(ele);
+ free(ele);
+}
+
+/**
+ * Get the width Property
+ *
+ * \param base_font The dom_html_base_font_element object
+ */
+dom_exception dom_html_base_font_element_get_size(
+ dom_html_base_font_element *base_font, int32_t *size)
+{
+ return dom_html_element_get_int32_t_property(&base_font->base, "size",
+ SLEN("size"), size);
+}
+
+/**
+ * Set the width Property
+ *
+ * \param base_font The dom_html_base_font_element object
+ */
+dom_exception dom_html_base_font_element_set_size(
+ dom_html_base_font_element *base_font, uint32_t size)
+{
+ return dom_html_element_set_int32_t_property(&base_font->base, "size",
+ SLEN("size"), size);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_base_font_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_base_font_element_destroy(dom_node_internal *node)
+{
+ _dom_html_base_font_element_destroy((struct dom_html_base_font_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_base_font_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_base_font_element_get_##attr( \
+ dom_html_base_font_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)-> \
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_base_font_element_set_##attr( \
+ dom_html_base_font_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)-> \
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+SIMPLE_GET_SET(color);
+SIMPLE_GET_SET(face);
diff --git a/src/html/html_basefont_element.h b/src/html/html_basefont_element.h
index 2e182d5..e6427ec 100644
--- a/src/html/html_basefont_element.h
+++ b/src/html/html_basefont_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_basefont_element_h_
+#define dom_internal_html_basefont_element_h_
+
+#include <dom/html/html_basefont_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_base_font_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_base_font_element object */
+dom_exception _dom_html_base_font_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_base_font_element **ele);
+
+/* Initialise a dom_html_base_font_element object */
+dom_exception _dom_html_base_font_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_base_font_element *ele);
+
+/* Finalise a dom_html_base_font_element object */
+void _dom_html_base_font_element_finalise(struct dom_html_base_font_element *ele);
+
+/* Destroy a dom_html_base_font_element object */
+void _dom_html_base_font_element_destroy(struct dom_html_base_font_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_base_font_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_base_font_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_base_font_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_BASE_FONT_ELEMENT_PROTECT_VTABLE \
+ _dom_html_base_font_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_BASE_FONT_ELEMENT \
+ _dom_virtual_html_base_font_element_destroy, \
+ _dom_html_base_font_element_copy
+
+#endif
diff --git a/src/html/html_br_element.c b/src/html/html_br_element.c
index 2e182d5..fbc133e 100644
--- a/src/html/html_br_element.c
+++ b/src/html/html_br_element.c
@@ -3,5 +3,160 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_br_element.h>
+
+#include "html/html_document.h"
+#include "html/html_br_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_BR_ELEMENT
+ },
+ DOM_HTML_BR_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_br_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_br_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_br_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_br_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_br_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_br_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_br_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_br_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_br_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_BR],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_br_element object
+ *
+ * \param ele The dom_html_br_element object
+ */
+void _dom_html_br_element_finalise(struct dom_html_br_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_br_element object
+ *
+ * \param ele The dom_html_br_element object
+ */
+void _dom_html_br_element_destroy(struct dom_html_br_element *ele)
+{
+ _dom_html_br_element_finalise(ele);
+ free(ele);
+}
+
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_br_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_br_element_destroy(dom_node_internal *node)
+{
+ _dom_html_br_element_destroy((struct dom_html_br_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_br_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_br_element_get_##attr( \
+ dom_html_br_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_br_element_set_##attr( \
+ dom_html_br_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(clear);
diff --git a/src/html/html_br_element.h b/src/html/html_br_element.h
index 2e182d5..ff2df3d 100644
--- a/src/html/html_br_element.h
+++ b/src/html/html_br_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_br_element_h_
+#define dom_internal_html_br_element_h_
+
+#include <dom/html/html_br_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_br_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_br_element object */
+dom_exception _dom_html_br_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_br_element **ele);
+
+/* Initialise a dom_html_br_element object */
+dom_exception _dom_html_br_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_br_element *ele);
+
+/* Finalise a dom_html_br_element object */
+void _dom_html_br_element_finalise(struct dom_html_br_element *ele);
+
+/* Destroy a dom_html_br_element object */
+void _dom_html_br_element_destroy(struct dom_html_br_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_br_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_br_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_br_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_BR_ELEMENT_PROTECT_VTABLE \
+ _dom_html_br_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_BR_ELEMENT \
+ _dom_virtual_html_br_element_destroy, \
+ _dom_html_br_element_copy
+
+#endif
diff --git a/src/html/html_collection.c b/src/html/html_collection.c
index a99297f..43a26c5 100644
--- a/src/html/html_collection.c
+++ b/src/html/html_collection.c
@@ -11,6 +11,7 @@
#include <libwapcaplet/libwapcaplet.h>
#include "html/html_collection.h"
+#include "html/html_document.h"
#include "core/node.h"
#include "core/element.h"
@@ -25,7 +26,7 @@
* \param doc The document
* \param root The root element of the collection
* \param ic The callback function used to determin whether certain node
- * beint32_ts to the collection
+ * belongs to the collection
* \param col The result collection object
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
@@ -132,7 +133,7 @@ dom_exception dom_html_collection_get_length(dom_html_collection *col,
/* No children and siblings */
struct dom_node_internal *parent = node->parent;
- while (parent != col->root &&
+ while (node != col->root &&
node == parent->last_child) {
node = parent;
parent = parent->parent;
@@ -182,7 +183,7 @@ dom_exception dom_html_collection_item(dom_html_collection *col,
/* No children and siblings */
struct dom_node_internal *parent = n->parent;
- while (parent != col->root &&
+ while (n != col->root &&
n == parent->last_child) {
n = parent;
parent = parent->parent;
@@ -212,8 +213,8 @@ dom_exception dom_html_collection_named_item(dom_html_collection *col,
dom_string *name, struct dom_node **node)
{
struct dom_node_internal *n = col->root;
+ dom_html_document *doc = (dom_html_document *)dom_node_get_owner(n);
dom_exception err;
-
while (n != NULL) {
if (n->type == DOM_ELEMENT_NODE &&
col->ic(n, col->ctx) == true) {
@@ -235,6 +236,22 @@ dom_exception dom_html_collection_named_item(dom_html_collection *col,
if (id != NULL)
dom_string_unref(id);
+
+ /* Check for Name attr if id not matched/found */
+ dom_string *id_name = NULL;
+ err = _dom_element_get_attribute((dom_element *)n,
+ doc->memoised[hds_name], &id_name);
+ if(err != DOM_NO_ERR) {
+ return err;
+ }
+ if (id_name != NULL && dom_string_isequal(name, id_name)) {
+ *node = (struct dom_node *) n;
+ dom_node_ref(n);
+ dom_string_unref(id_name);
+
+ return DOM_NO_ERR;
+ }
+
}
/* Depth first iterating */
@@ -246,13 +263,13 @@ dom_exception dom_html_collection_named_item(dom_html_collection *col,
/* No children and siblings */
struct dom_node_internal *parent = n->parent;
- while (parent != col->root &&
+ while (n != col->root &&
n == parent->last_child) {
n = parent;
parent = parent->parent;
}
- if (parent == col->root)
+ if (n == col->root)
n = NULL;
else
n = n->next;
diff --git a/src/html/html_directory_element.c b/src/html/html_directory_element.c
index 2e182d5..4e0d9e0 100644
--- a/src/html/html_directory_element.c
+++ b/src/html/html_directory_element.c
@@ -3,5 +3,145 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_directory_element.h>
+
+#include "html/html_document.h"
+#include "html/html_directory_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_DIRECTORY_ELEMENT
+ },
+ DOM_HTML_DIRECTORY_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_directory_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_directory_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_directory_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_directory_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_directory_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_directory_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_directory_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_directory_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_directory_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_DIRECTORY],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_directory_element object
+ *
+ * \param ele The dom_html_directory_element object
+ */
+void _dom_html_directory_element_finalise(struct dom_html_directory_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_directory_element object
+ *
+ * \param ele The dom_html_directory_element object
+ */
+void _dom_html_directory_element_destroy(struct dom_html_directory_element *ele)
+{
+ _dom_html_directory_element_finalise(ele);
+ free(ele);
+}
+
+/**
+ * Get the compact property
+ *
+ * \param ele The dom_html_directory_element object
+ * \param compact The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_directory_element_get_compact(dom_html_directory_element *ele,
+ bool *compact)
+{
+ return dom_html_element_get_bool_property(&ele->base, "compact",
+ SLEN("compact"), compact);
+}
+
+/**
+ * Set the compact property
+ *
+ * \param ele The dom_html_directory_element object
+ * \param compact The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_directory_element_set_compact(dom_html_directory_element *ele,
+ bool compact)
+{
+ return dom_html_element_set_bool_property(&ele->base, "compact",
+ SLEN("compact"), compact);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_directory_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_directory_element_destroy(dom_node_internal *node)
+{
+ _dom_html_directory_element_destroy((struct dom_html_directory_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_directory_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
diff --git a/src/html/html_directory_element.h b/src/html/html_directory_element.h
index 2e182d5..9f3fe2b 100644
--- a/src/html/html_directory_element.h
+++ b/src/html/html_directory_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_directory_element_h_
+#define dom_internal_html_directory_element_h_
+
+#include <dom/html/html_directory_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_directory_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_directory_element object */
+dom_exception _dom_html_directory_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_directory_element **ele);
+
+/* Initialise a dom_html_directory_element object */
+dom_exception _dom_html_directory_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_directory_element *ele);
+
+/* Finalise a dom_html_directory_element object */
+void _dom_html_directory_element_finalise(struct dom_html_directory_element *ele);
+
+/* Destroy a dom_html_directory_element object */
+void _dom_html_directory_element_destroy(struct dom_html_directory_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_directory_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_directory_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_directory_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_DIRECTORY_ELEMENT_PROTECT_VTABLE \
+ _dom_html_directory_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_DIRECTORY_ELEMENT \
+ _dom_virtual_html_directory_element_destroy, \
+ _dom_html_directory_element_copy
+
+#endif
diff --git a/src/html/html_div_element.c b/src/html/html_div_element.c
index 2e182d5..0c689d6 100644
--- a/src/html/html_div_element.c
+++ b/src/html/html_div_element.c
@@ -3,5 +3,159 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_div_element.h>
+
+#include "html/html_document.h"
+#include "html/html_div_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_DIV_ELEMENT
+ },
+ DOM_HTML_DIV_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_div_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_div_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_div_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_div_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_div_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_div_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_div_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_div_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_div_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_DIV],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_div_element object
+ *
+ * \param ele The dom_html_div_element object
+ */
+void _dom_html_div_element_finalise(struct dom_html_div_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_div_element object
+ *
+ * \param ele The dom_html_div_element object
+ */
+void _dom_html_div_element_destroy(struct dom_html_div_element *ele)
+{
+ _dom_html_div_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_div_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_div_element_destroy(dom_node_internal *node)
+{
+ _dom_html_div_element_destroy((struct dom_html_div_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_div_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_div_element_get_##attr( \
+ dom_html_div_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_div_element_set_##attr( \
+ dom_html_div_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(align);
diff --git a/src/html/html_div_element.h b/src/html/html_div_element.h
index 2e182d5..62d1c3f 100644
--- a/src/html/html_div_element.h
+++ b/src/html/html_div_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_div_element_h_
+#define dom_internal_html_div_element_h_
+
+#include <dom/html/html_div_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_div_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_div_element object */
+dom_exception _dom_html_div_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_div_element **ele);
+
+/* Initialise a dom_html_div_element object */
+dom_exception _dom_html_div_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_div_element *ele);
+
+/* Finalise a dom_html_div_element object */
+void _dom_html_div_element_finalise(struct dom_html_div_element *ele);
+
+/* Destroy a dom_html_div_element object */
+void _dom_html_div_element_destroy(struct dom_html_div_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_div_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_div_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_div_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_DIV_ELEMENT_PROTECT_VTABLE \
+ _dom_html_div_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_DIV_ELEMENT \
+ _dom_virtual_html_div_element_destroy, \
+ _dom_html_div_element_copy
+
+#endif
diff --git a/src/html/html_dlist_element.c b/src/html/html_dlist_element.c
index 2e182d5..f63accc 100644
--- a/src/html/html_dlist_element.c
+++ b/src/html/html_dlist_element.c
@@ -3,5 +3,145 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_dlist_element.h>
+
+#include "html/html_document.h"
+#include "html/html_dlist_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_DL_ELEMENT
+ },
+ DOM_HTML_DL_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_d_list_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_d_list_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_d_list_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_d_list_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_d_list_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_d_list_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_d_list_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_d_list_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_d_list_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_DL],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_d_list_element object
+ *
+ * \param ele The dom_html_d_list_element object
+ */
+void _dom_html_d_list_element_finalise(struct dom_html_d_list_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_d_list_element object
+ *
+ * \param ele The dom_html_d_list_element object
+ */
+void _dom_html_d_list_element_destroy(struct dom_html_d_list_element *ele)
+{
+ _dom_html_d_list_element_finalise(ele);
+ free(ele);
+}
+
+/**
+ * Get the compact property
+ *
+ * \param ele The dom_html_d_list_element object
+ * \param compact The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_d_list_element_get_compact(dom_html_d_list_element *ele,
+ bool *compact)
+{
+ return dom_html_element_get_bool_property(&ele->base, "compact",
+ SLEN("compact"), compact);
+}
+
+/**
+ * Set the compact property
+ *
+ * \param ele The dom_html_d_list_element object
+ * \param compact The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_d_list_element_set_compact(dom_html_d_list_element *ele,
+ bool compact)
+{
+ return dom_html_element_set_bool_property(&ele->base, "compact",
+ SLEN("compact"), compact);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_d_list_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_d_list_element_destroy(dom_node_internal *node)
+{
+ _dom_html_d_list_element_destroy((struct dom_html_d_list_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_d_list_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
diff --git a/src/html/html_dlist_element.h b/src/html/html_dlist_element.h
index 2e182d5..8e40dca 100644
--- a/src/html/html_dlist_element.h
+++ b/src/html/html_dlist_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_d_list_element_h_
+#define dom_internal_html_d_list_element_h_
+
+#include <dom/html/html_dlist_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_d_list_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_d_list_element object */
+dom_exception _dom_html_d_list_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_d_list_element **ele);
+
+/* Initialise a dom_html_d_list_element object */
+dom_exception _dom_html_d_list_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_d_list_element *ele);
+
+/* Finalise a dom_html_d_list_element object */
+void _dom_html_d_list_element_finalise(struct dom_html_d_list_element *ele);
+
+/* Destroy a dom_html_d_list_element object */
+void _dom_html_d_list_element_destroy(struct dom_html_d_list_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_d_list_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_d_list_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_d_list_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_DL_ELEMENT_PROTECT_VTABLE \
+ _dom_html_d_list_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_DL_ELEMENT \
+ _dom_virtual_html_d_list_element_destroy, \
+ _dom_html_d_list_element_copy
+
+#endif
diff --git a/src/html/html_document.c b/src/html/html_document.c
index 0da16bb..6adfedd 100644
--- a/src/html/html_document.c
+++ b/src/html/html_document.c
@@ -25,6 +25,42 @@
#include "html/html_option_element.h"
#include "html/html_select_element.h"
#include "html/html_hr_element.h"
+#include "html/html_dlist_element.h"
+#include "html/html_directory_element.h"
+#include "html/html_menu_element.h"
+#include "html/html_fieldset_element.h"
+#include "html/html_legend_element.h"
+#include "html/html_paragraph_element.h"
+#include "html/html_heading_element.h"
+#include "html/html_quote_element.h"
+#include "html/html_pre_element.h"
+#include "html/html_br_element.h"
+#include "html/html_label_element.h"
+#include "html/html_ulist_element.h"
+#include "html/html_olist_element.h"
+#include "html/html_li_element.h"
+#include "html/html_font_element.h"
+#include "html/html_mod_element.h"
+#include "html/html_anchor_element.h"
+#include "html/html_basefont_element.h"
+#include "html/html_image_element.h"
+#include "html/html_object_element.h"
+#include "html/html_param_element.h"
+#include "html/html_applet_element.h"
+#include "html/html_map_element.h"
+#include "html/html_area_element.h"
+#include "html/html_script_element.h"
+#include "html/html_tablecaption_element.h"
+#include "html/html_tablecell_element.h"
+#include "html/html_tablecol_element.h"
+#include "html/html_tablesection_element.h"
+#include "html/html_table_element.h"
+#include "html/html_tablerow_element.h"
+#include "html/html_style_element.h"
+#include "html/html_frameset_element.h"
+#include "html/html_frame_element.h"
+#include "html/html_iframe_element.h"
+#include "html/html_isindex_element.h"
#include "core/attr.h"
#include "core/string.h"
@@ -91,16 +127,17 @@ dom_exception _dom_html_document_initialise(dom_html_document *doc,
doc->domain = NULL;
doc->url = NULL;
doc->cookie = NULL;
-
+ doc->body = NULL;
+
doc->memoised = calloc(sizeof(dom_string *), hds_COUNT);
if (doc->memoised == NULL) {
error = DOM_NO_MEM_ERR;
goto out;
}
-
+
#define HTML_DOCUMENT_STRINGS_ACTION(attr,str) \
error = dom_string_create_interned((const uint8_t *) #str, \
- SLEN(#str), &doc->memoised[hds_##attr]); \
+ SLEN(#str), &doc->memoised[hds_##attr]); \
if (error != DOM_NO_ERR) { \
goto out; \
}
@@ -224,6 +261,127 @@ _dom_html_document_create_element_internal(dom_html_document *html,
} else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_HR])) {
exc = _dom_html_hr_element_create(html, namespace, prefix,
(dom_html_hr_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_DL])) {
+ exc = _dom_html_d_list_element_create(html, namespace, prefix,
+ (dom_html_d_list_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_DIRECTORY])) {
+ exc = _dom_html_directory_element_create(html, namespace, prefix,
+ (dom_html_directory_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_MENU])) {
+ exc = _dom_html_menu_element_create(html, namespace, prefix,
+ (dom_html_menu_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_FIELDSET])) {
+ exc = _dom_html_field_set_element_create(html, namespace, prefix,
+ (dom_html_field_set_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_LEGEND])) {
+ exc = _dom_html_legend_element_create(html, namespace, prefix,
+ (dom_html_legend_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_P])) {
+ exc = _dom_html_paragraph_element_create(html, namespace, prefix,
+ (dom_html_paragraph_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_H1]) ||
+ dom_string_caseless_isequal(tag_name, html->memoised[hds_H2]) ||
+ dom_string_caseless_isequal(tag_name, html->memoised[hds_H3]) ||
+ dom_string_caseless_isequal(tag_name, html->memoised[hds_H4]) ||
+ dom_string_caseless_isequal(tag_name, html->memoised[hds_H5]) ||
+ dom_string_caseless_isequal(tag_name, html->memoised[hds_H6])
+ ) {
+ exc = _dom_html_heading_element_create(html, tag_name, namespace, prefix,
+ (dom_html_heading_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_Q])) {
+ exc = _dom_html_quote_element_create(html, namespace, prefix,
+ (dom_html_quote_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_PRE])) {
+ exc = _dom_html_pre_element_create(html, namespace, prefix,
+ (dom_html_pre_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_BR])) {
+ exc = _dom_html_br_element_create(html, namespace, prefix,
+ (dom_html_br_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_LABEL])) {
+ exc = _dom_html_label_element_create(html, namespace, prefix,
+ (dom_html_label_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_UL])) {
+ exc = _dom_html_u_list_element_create(html, namespace, prefix,
+ (dom_html_u_list_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_OL])) {
+ exc = _dom_html_o_list_element_create(html, namespace, prefix,
+ (dom_html_o_list_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_LI])) {
+ exc = _dom_html_li_element_create(html, namespace, prefix,
+ (dom_html_li_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_FONT])) {
+ exc = _dom_html_font_element_create(html, namespace, prefix,
+ (dom_html_font_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_DEL]) ||
+ dom_string_caseless_isequal(tag_name, html->memoised[hds_INS])) {
+ exc = _dom_html_mod_element_create(html, tag_name, namespace,
+ prefix, (dom_html_mod_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_A])) {
+ exc = _dom_html_anchor_element_create(html, namespace, prefix,
+ (dom_html_anchor_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_BASEFONT])) {
+ exc = _dom_html_base_font_element_create(html, namespace, prefix,
+ (dom_html_base_font_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_IMG])) {
+ exc = _dom_html_image_element_create(html, namespace, prefix,
+ (dom_html_image_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_OBJECT])) {
+ exc = _dom_html_object_element_create(html, namespace, prefix,
+ (dom_html_object_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_PARAM])) {
+ exc = _dom_html_param_element_create(html, namespace, prefix,
+ (dom_html_param_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_APPLET])) {
+ exc = _dom_html_applet_element_create(html, namespace, prefix,
+ (dom_html_applet_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_MAP])) {
+ exc = _dom_html_map_element_create(html, namespace, prefix,
+ (dom_html_map_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_AREA])) {
+ exc = _dom_html_area_element_create(html, namespace, prefix,
+ (dom_html_area_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_SCRIPT])) {
+ exc = _dom_html_script_element_create(html, namespace, prefix,
+ (dom_html_script_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_CAPTION])) {
+ exc = _dom_html_table_caption_element_create(html, namespace, prefix,
+ (dom_html_table_caption_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_TD]) ||
+ dom_string_caseless_isequal(tag_name, html->memoised[hds_TH])
+ ) {
+ exc = _dom_html_table_cell_element_create(html, tag_name, namespace, prefix,
+ (dom_html_table_cell_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_COL])||
+ dom_string_caseless_isequal(tag_name, html->memoised[hds_COLGROUP])
+ ) {
+ exc = _dom_html_table_col_element_create(html, tag_name, namespace, prefix,
+ (dom_html_table_col_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_THEAD])||
+ dom_string_caseless_isequal(tag_name, html->memoised[hds_TBODY])||
+ dom_string_caseless_isequal(tag_name, html->memoised[hds_TFOOT])) {
+ exc = _dom_html_table_section_element_create(html, tag_name, namespace, prefix,
+ (dom_html_table_section_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_TABLE])) {
+ exc = _dom_html_table_element_create(html, namespace, prefix,
+ (dom_html_table_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_TD])) {
+ exc = _dom_html_table_row_element_create(html, namespace, prefix,
+ (dom_html_table_row_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_STYLE])) {
+ exc = _dom_html_style_element_create(html,
+ (dom_html_style_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_FRAMESET])) {
+ exc = _dom_html_frame_set_element_create(html, namespace, prefix,
+ (dom_html_frame_set_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_FRAME])) {
+ exc = _dom_html_frame_element_create(html, namespace, prefix,
+ (dom_html_frame_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_IFRAME])) {
+ exc = _dom_html_iframe_element_create(html, namespace, prefix,
+ (dom_html_iframe_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_ISINDEX])) {
+ exc = _dom_html_isindex_element_create(html, namespace, prefix,
+ (dom_html_isindex_element **) result);
} else {
exc = _dom_html_element_create(html, tag_name, namespace,
prefix, result);
@@ -486,57 +644,193 @@ dom_exception _dom_html_document_get_url(dom_html_document *doc,
dom_exception _dom_html_document_get_body(dom_html_document *doc,
struct dom_html_element **body)
{
- UNUSED(doc);
- UNUSED(body);
+ dom_exception exc = DOM_NO_ERR;
- return DOM_NOT_SUPPORTED_ERR;
+ if (doc->body != NULL) {
+ *body = doc->body;
+ } else {
+ dom_element *node;
+ dom_nodelist *nodes;
+ uint32_t len;
+
+ exc = dom_document_get_elements_by_tag_name(doc,
+ doc->memoised[hds_BODY],
+ &nodes);
+ if (exc != DOM_NO_ERR) {
+ return exc;
+ }
+
+ exc = dom_nodelist_get_length(nodes, &len);
+ if (exc != DOM_NO_ERR) {
+ dom_nodelist_unref(nodes);
+ return exc;
+ }
+
+ if (len == 0) {
+ exc = dom_document_get_elements_by_tag_name(doc,
+ doc->memoised[hds_FRAMESET],
+ &nodes);
+ if (exc != DOM_NO_ERR) {
+ return exc;
+ }
+ exc = dom_nodelist_get_length(nodes, &len);
+ if (exc != DOM_NO_ERR) {
+ dom_nodelist_unref(nodes);
+ return exc;
+ }
+ if(len == 0) {
+ dom_nodelist_unref(nodes);
+ return DOM_NO_ERR;
+ }
+ }
+
+ exc = dom_nodelist_item(nodes, 0, (void *) &node);
+ dom_nodelist_unref(nodes);
+ if (exc != DOM_NO_ERR) {
+ return exc;
+ }
+
+ *body = (dom_html_element *)node;
+ dom_node_unref(node);
+ }
+
+ return exc;
}
dom_exception _dom_html_document_set_body(dom_html_document *doc,
struct dom_html_element *body)
{
- UNUSED(doc);
- UNUSED(body);
+ doc->body = body;
+ return DOM_NO_ERR;
+}
- return DOM_NOT_SUPPORTED_ERR;
+/**
+ * Callback for creating the images collection
+ *
+ * \param node The dom_node_internal object
+ * \param ctx The dom_html_document object (void *)
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+bool images_callback(struct dom_node_internal *node, void *ctx)
+{
+ if(node->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(node->name,
+ ((dom_html_document *)ctx)->memoised[hds_IMG])) {
+ return true;
+ }
+ return false;
}
dom_exception _dom_html_document_get_images(dom_html_document *doc,
struct dom_html_collection **col)
{
- UNUSED(doc);
- UNUSED(col);
+ dom_html_document *root;
+ dom_exception err;
+ err = dom_document_get_document_element(doc, &root);
+ if (err != DOM_NO_ERR)
+ return err;
- return DOM_NOT_SUPPORTED_ERR;
+ return _dom_html_collection_create(doc, (dom_node_internal *) root,
+ images_callback, doc, col);
+}
+
+bool applet_callback(struct dom_node_internal * node, void *ctx)
+{
+ if(node->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(node->name,
+ ((dom_html_document *)ctx)->memoised[hds_APPLET])) {
+ return true;
+ }
+ return false;
+}
+/**
+ * Callback for creating the applets collection
+ *
+ * \param node The dom_node_internal object
+ * \param ctx The dom_html_document object (void *)
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+bool applets_callback(struct dom_node_internal *node, void *ctx)
+{
+ if(node->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(node->name,
+ ((dom_html_document *)ctx)->memoised[hds_OBJECT])) {
+ uint32_t len = 0;
+ dom_html_collection *applets;
+ _dom_html_collection_create(ctx, node,
+ applet_callback, ctx, &applets);
+
+ dom_html_collection_get_length(applets, &len);
+ if(len != 0)
+ return true;
+ }
+ return false;
}
dom_exception _dom_html_document_get_applets(dom_html_document *doc,
struct dom_html_collection **col)
{
- UNUSED(doc);
- UNUSED(col);
+ dom_html_document *root;
+ dom_exception err;
+ err = dom_document_get_document_element(doc, &root);
+ if (err != DOM_NO_ERR)
+ return err;
- return DOM_NOT_SUPPORTED_ERR;
+ return _dom_html_collection_create(doc, (dom_node_internal *) root,
+ applets_callback, doc, col);
+}
+
+/**
+ * Callback for creating the links collection
+ *
+ * \param node The dom_node_internal object
+ * \param ctx The dom_html_document object (void *)
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+bool links_callback(struct dom_node_internal *node, void *ctx)
+{
+ if(node->type == DOM_ELEMENT_NODE &&
+ (dom_string_caseless_isequal(node->name,
+ ((dom_html_document *)ctx)->memoised[hds_A]) ||
+ dom_string_caseless_isequal(node->name,
+ ((dom_html_document *)ctx)->memoised[hds_AREA]))
+ ) {
+ bool has_value = false;
+ dom_exception err;
+
+ err = dom_element_has_attribute(node,
+ ((dom_html_document *)ctx)->memoised[hds_href], &has_value);
+ if(err !=DOM_NO_ERR)
+ return err;
+
+ if(has_value)
+ return true;
+ }
+ return false;
}
dom_exception _dom_html_document_get_links(dom_html_document *doc,
struct dom_html_collection **col)
{
- UNUSED(doc);
- UNUSED(col);
+ dom_html_document *root;
+ dom_exception err;
+ err = dom_document_get_document_element(doc, &root);
+ if (err != DOM_NO_ERR)
+ return err;
- return DOM_NOT_SUPPORTED_ERR;
+ return _dom_html_collection_create(doc, (dom_node_internal *) root,
+ links_callback, doc, col);
}
static bool __dom_html_document_node_is_form(dom_node_internal *node,
- void *ctx)
+ void *ctx)
{
dom_html_document *doc = (dom_html_document *)node->owner;
-
+
UNUSED(ctx);
-
+
return dom_string_caseless_isequal(node->name,
- doc->memoised[hds_FORM]);
+ doc->memoised[hds_FORM]);
}
dom_exception _dom_html_document_get_forms(dom_html_document *doc,
@@ -564,13 +858,43 @@ dom_exception _dom_html_document_get_forms(dom_html_document *doc,
return DOM_NO_ERR;
}
+/**
+ * Callback for creating the anchors collection
+ *
+ * \param node The dom_node_internal object
+ * \param ctx The dom_html_document object (void *)
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+bool anchors_callback(struct dom_node_internal *node, void *ctx)
+{
+ if(node->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(node->name,
+ ((dom_html_document *)ctx)->memoised[hds_A])) {
+ bool has_value = false;
+ dom_exception err;
+
+ err = dom_element_has_attribute(node,
+ ((dom_html_document *)ctx)->memoised[hds_name], &has_value);
+ if(err !=DOM_NO_ERR)
+ return err;
+
+ if(has_value)
+ return true;
+ }
+ return false;
+}
+
dom_exception _dom_html_document_get_anchors(dom_html_document *doc,
struct dom_html_collection **col)
{
- UNUSED(doc);
- UNUSED(col);
+ dom_html_document *root;
+ dom_exception err;
+ err = dom_document_get_document_element(doc, &root);
+ if (err != DOM_NO_ERR)
+ return err;
- return DOM_NOT_SUPPORTED_ERR;
+ return _dom_html_collection_create(doc, (dom_node_internal *) root,
+ anchors_callback, doc, col);
}
dom_exception _dom_html_document_get_cookie(dom_html_document *doc,
@@ -578,7 +902,7 @@ dom_exception _dom_html_document_get_cookie(dom_html_document *doc,
{
UNUSED(doc);
UNUSED(cookie);
-
+ /*todo implement this after updating client interface */
return DOM_NOT_SUPPORTED_ERR;
}
@@ -588,6 +912,7 @@ dom_exception _dom_html_document_set_cookie(dom_html_document *doc,
UNUSED(doc);
UNUSED(cookie);
+ /*todo implement this after updating client interface */
return DOM_NOT_SUPPORTED_ERR;
}
@@ -595,13 +920,14 @@ dom_exception _dom_html_document_open(dom_html_document *doc)
{
UNUSED(doc);
+ /*todo implement this after updating client interface */
return DOM_NOT_SUPPORTED_ERR;
}
dom_exception _dom_html_document_close(dom_html_document *doc)
{
UNUSED(doc);
-
+ /*todo implement this after updating client interface */
return DOM_NOT_SUPPORTED_ERR;
}
@@ -611,6 +937,7 @@ dom_exception _dom_html_document_write(dom_html_document *doc,
UNUSED(doc);
UNUSED(text);
+ /*todo implement this after updating client interface */
return DOM_NOT_SUPPORTED_ERR;
}
@@ -620,6 +947,7 @@ dom_exception _dom_html_document_writeln(dom_html_document *doc,
UNUSED(doc);
UNUSED(text);
+ /*todo implement this after _dom_html_document_write */
return DOM_NOT_SUPPORTED_ERR;
}
@@ -629,7 +957,7 @@ dom_exception _dom_html_document_get_elements_by_name(dom_html_document *doc,
UNUSED(doc);
UNUSED(name);
UNUSED(list);
-
+ /*todo implement after updating core nodelist interface */
return DOM_NOT_SUPPORTED_ERR;
}
diff --git a/src/html/html_document.h b/src/html/html_document.h
index 67250f5..c00529b 100644
--- a/src/html/html_document.h
+++ b/src/html/html_document.h
@@ -9,6 +9,7 @@
#define dom_internal_html_document_h_
#include <dom/html/html_document.h>
+#include <dom/html/html_element.h>
#include "core/document.h"
@@ -23,6 +24,7 @@ struct dom_html_document {
dom_string *domain; /**< HTML document domain */
dom_string *url; /**< HTML document URL */
dom_string *cookie; /**< HTML document cookie */
+ dom_html_element *body; /**< HTML BodyElement */
/** Cached strings for html objects to use */
dom_string **memoised;
@@ -126,6 +128,11 @@ dom_exception _dom_html_document_create_attribute(dom_document *doc,
dom_exception _dom_html_document_create_attribute_ns(dom_document *doc,
dom_string *namespace, dom_string *qname,
dom_attr **result);
+bool images_callback(struct dom_node_internal *node, void *ctx);
+bool applets_callback(struct dom_node_internal *node, void *ctx);
+bool applet_callback(struct dom_node_internal *node, void *ctx);
+bool links_callback(struct dom_node_internal *node, void *ctx);
+bool anchors_callback(struct dom_node_internal *node, void *ctx);
#define DOM_DOCUMENT_VTABLE_HTML \
_dom_document_get_doctype, \
diff --git a/src/html/html_document_strings.h b/src/html/html_document_strings.h
index 8e9d79e..35fca73 100644
--- a/src/html/html_document_strings.h
+++ b/src/html/html_document_strings.h
@@ -65,6 +65,8 @@ HTML_DOCUMENT_STRINGS_ACTION1(method)
/* HTML_DOCUMENT_STRINGS_ACTION1(target) */
/* Useful attributes used by HTMLButtonElement */
HTML_DOCUMENT_STRINGS_ACTION(access_key,accesskey)
+/* Useful attributes used by HTMLBrElement */
+HTML_DOCUMENT_STRINGS_ACTION1(clear)
/* HTML_DOCUMENT_STRINGS_ACTION1(name) */
/* HTML_DOCUMENT_STRINGS_ACTION1(type) */
HTML_DOCUMENT_STRINGS_ACTION1(value)
@@ -81,7 +83,47 @@ HTML_DOCUMENT_STRINGS_ACTION(read_only,readonly)
HTML_DOCUMENT_STRINGS_ACTION1(size)
HTML_DOCUMENT_STRINGS_ACTION1(src)
HTML_DOCUMENT_STRINGS_ACTION1(width)
+HTML_DOCUMENT_STRINGS_ACTION1(compact)
+HTML_DOCUMENT_STRINGS_ACTION1(cite)
+HTML_DOCUMENT_STRINGS_ACTION1(color)
+HTML_DOCUMENT_STRINGS_ACTION1(face)
+HTML_DOCUMENT_STRINGS_ACTION1(coords)
+HTML_DOCUMENT_STRINGS_ACTION1(shape)
+HTML_DOCUMENT_STRINGS_ACTION1(border)
+HTML_DOCUMENT_STRINGS_ACTION1(code)
+HTML_DOCUMENT_STRINGS_ACTION1(archive)
+HTML_DOCUMENT_STRINGS_ACTION1(data)
+HTML_DOCUMENT_STRINGS_ACTION1(height)
+HTML_DOCUMENT_STRINGS_ACTION1(standby)
+HTML_DOCUMENT_STRINGS_ACTION1(object)
+HTML_DOCUMENT_STRINGS_ACTION1(event)
+HTML_DOCUMENT_STRINGS_ACTION1(defer)
+HTML_DOCUMENT_STRINGS_ACTION1(abbr)
+HTML_DOCUMENT_STRINGS_ACTION1(axis)
+HTML_DOCUMENT_STRINGS_ACTION1(headers)
+HTML_DOCUMENT_STRINGS_ACTION1(scope)
+HTML_DOCUMENT_STRINGS_ACTION1(frame)
+HTML_DOCUMENT_STRINGS_ACTION1(rules)
+HTML_DOCUMENT_STRINGS_ACTION1(summary)
+HTML_DOCUMENT_STRINGS_ACTION1(prompt)
+HTML_DOCUMENT_STRINGS_ACTION1(rows)
+HTML_DOCUMENT_STRINGS_ACTION1(cols)
+HTML_DOCUMENT_STRINGS_ACTION1(scrolling)
HTML_DOCUMENT_STRINGS_ACTION(tab_index,tabindex)
+HTML_DOCUMENT_STRINGS_ACTION(html_for,for)
+HTML_DOCUMENT_STRINGS_ACTION(date_time,datetime)
+HTML_DOCUMENT_STRINGS_ACTION(long_desc,longdesc)
+HTML_DOCUMENT_STRINGS_ACTION(code_base,codebase)
+HTML_DOCUMENT_STRINGS_ACTION(code_type,codetype)
+HTML_DOCUMENT_STRINGS_ACTION(value_type,valuetype)
+HTML_DOCUMENT_STRINGS_ACTION(v_align,valign)
+HTML_DOCUMENT_STRINGS_ACTION(ch,char)
+HTML_DOCUMENT_STRINGS_ACTION(ch_off,charoff)
+HTML_DOCUMENT_STRINGS_ACTION(cell_padding,cellpadding)
+HTML_DOCUMENT_STRINGS_ACTION(cell_spacing,cellspacing)
+HTML_DOCUMENT_STRINGS_ACTION(frame_border,frameborder)
+HTML_DOCUMENT_STRINGS_ACTION(margin_height,marginheight)
+HTML_DOCUMENT_STRINGS_ACTION(margin_width,marginwidth)
/* HTML_DOCUMENT_STRINGS_ACTION1(type) */
HTML_DOCUMENT_STRINGS_ACTION(use_map,usemap)
/* HTML_DOCUMENT_STRINGS_ACTION1(value) */
@@ -126,7 +168,7 @@ HTML_DOCUMENT_STRINGS_ACTION1(LEGEND)
HTML_DOCUMENT_STRINGS_ACTION1(UL)
HTML_DOCUMENT_STRINGS_ACTION1(OL)
HTML_DOCUMENT_STRINGS_ACTION1(DL)
-HTML_DOCUMENT_STRINGS_ACTION1(DIR)
+HTML_DOCUMENT_STRINGS_ACTION1(DIRECTORY)
HTML_DOCUMENT_STRINGS_ACTION1(MENU)
HTML_DOCUMENT_STRINGS_ACTION1(LI)
HTML_DOCUMENT_STRINGS_ACTION1(BLOCKQUOTE)
diff --git a/src/html/html_fieldset_element.c b/src/html/html_fieldset_element.c
index 2e182d5..2ab873e 100644
--- a/src/html/html_fieldset_element.c
+++ b/src/html/html_fieldset_element.c
@@ -3,5 +3,151 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_fieldset_element.h>
+
+#include "html/html_document.h"
+#include "html/html_fieldset_element.h"
+
+#include "core/node.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_FIELDSET_ELEMENT
+ },
+ DOM_HTML_FIELDSET_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_field_set_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_field_set_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_field_set_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_field_set_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_field_set_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_field_set_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_field_set_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_field_set_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_field_set_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_FIELDSET],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_field_set_element object
+ *
+ * \param ele The dom_html_field_set_element object
+ */
+void _dom_html_field_set_element_finalise(struct dom_html_field_set_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_field_set_element object
+ *
+ * \param ele The dom_html_field_set_element object
+ */
+void _dom_html_field_set_element_destroy(struct dom_html_field_set_element *ele)
+{
+ _dom_html_field_set_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_field_set_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_field_set_element_destroy(dom_node_internal *node)
+{
+ _dom_html_field_set_element_destroy((struct dom_html_field_set_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_field_set_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/**
+ * Get the dom_html_form_element object
+ *
+ * \param field_set The dom_html_legend_element object
+ * \param form The returned dom_html_form_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+
+dom_exception dom_html_field_set_element_get_form(
+ dom_html_field_set_element *field_set, dom_html_form_element **form)
+{
+ dom_html_document *doc =
+ (dom_html_document *) ((dom_node_internal *) field_set)->owner;
+ dom_node_internal *form_tmp = ((dom_node_internal *) field_set)->parent;
+
+ /* Search ancestor chain for FIELDSET element */
+ while (form_tmp != NULL) {
+ if (form_tmp->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(form_tmp->name,
+ doc->memoised[hds_FORM]))
+ break;
+
+ form_tmp = form_tmp->parent;
+ }
+
+ if (form_tmp != NULL) {
+ *form = (dom_html_form_element *) form_tmp;
+ return DOM_NO_ERR;
+ }
+
+ *form = NULL;
+
+ return DOM_NO_ERR;
+}
diff --git a/src/html/html_fieldset_element.h b/src/html/html_fieldset_element.h
index 2e182d5..8ae1d59 100644
--- a/src/html/html_fieldset_element.h
+++ b/src/html/html_fieldset_element.h
@@ -3,5 +3,51 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_field_set_element_h_
+#define dom_internal_html_field_set_element_h_
+
+#include <dom/html/html_fieldset_element.h>
+
+#include "html/html_element.h"
+
+struct dom_html_field_set_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_field_set_element object */
+dom_exception _dom_html_field_set_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_field_set_element **ele);
+
+/* Initialise a dom_html_field_set_element object */
+dom_exception _dom_html_field_set_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_field_set_element *ele);
+
+/* Finalise a dom_html_field_set_element object */
+void _dom_html_field_set_element_finalise(struct dom_html_field_set_element *ele);
+
+/* Destroy a dom_html_field_set_element object */
+void _dom_html_field_set_element_destroy(struct dom_html_field_set_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_field_set_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_field_set_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_field_set_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_FIELDSET_ELEMENT_PROTECT_VTABLE \
+ _dom_html_field_set_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_FIELDSET_ELEMENT \
+ _dom_virtual_html_field_set_element_destroy, \
+ _dom_html_field_set_element_copy
+
+#endif
+
diff --git a/src/html/html_font_element.c b/src/html/html_font_element.c
index 2e182d5..aadcb22 100644
--- a/src/html/html_font_element.c
+++ b/src/html/html_font_element.c
@@ -3,5 +3,162 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_font_element.h>
+
+#include "html/html_document.h"
+#include "html/html_font_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_FONT_ELEMENT
+ },
+ DOM_HTML_FONT_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_font_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_font_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_font_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_font_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_font_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_font_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_font_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_font_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_font_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_FONT],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_font_element object
+ *
+ * \param ele The dom_html_font_element object
+ */
+void _dom_html_font_element_finalise(struct dom_html_font_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_font_element object
+ *
+ * \param ele The dom_html_font_element object
+ */
+void _dom_html_font_element_destroy(struct dom_html_font_element *ele)
+{
+ _dom_html_font_element_finalise(ele);
+ free(ele);
+}
+
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_font_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_font_element_destroy(dom_node_internal *node)
+{
+ _dom_html_font_element_destroy((struct dom_html_font_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_font_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_font_element_get_##attr( \
+ dom_html_font_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_font_element_set_##attr( \
+ dom_html_font_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(color);
+SIMPLE_GET_SET(face);
+SIMPLE_GET_SET(size);
diff --git a/src/html/html_font_element.h b/src/html/html_font_element.h
index 2e182d5..42a2ec4 100644
--- a/src/html/html_font_element.h
+++ b/src/html/html_font_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_font_element_h_
+#define dom_internal_html_font_element_h_
+
+#include <dom/html/html_font_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_font_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_font_element object */
+dom_exception _dom_html_font_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_font_element **ele);
+
+/* Initialise a dom_html_font_element object */
+dom_exception _dom_html_font_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_font_element *ele);
+
+/* Finalise a dom_html_font_element object */
+void _dom_html_font_element_finalise(struct dom_html_font_element *ele);
+
+/* Destroy a dom_html_font_element object */
+void _dom_html_font_element_destroy(struct dom_html_font_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_font_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_font_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_font_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_FONT_ELEMENT_PROTECT_VTABLE \
+ _dom_html_font_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_FONT_ELEMENT \
+ _dom_virtual_html_font_element_destroy, \
+ _dom_html_font_element_copy
+
+#endif
diff --git a/src/html/html_form_element.c b/src/html/html_form_element.c
index 333cf74..0606ba6 100644
--- a/src/html/html_form_element.c
+++ b/src/html/html_form_element.c
@@ -281,7 +281,7 @@ static bool _dom_is_form_control(struct dom_node_internal *node, void *ctx)
assert(node->type == DOM_ELEMENT_NODE);
- /* Form controls are INPUT TEXTAREA SELECT and BUTTON */
+ /* Form controls are INPUT TEXTAREA SELECT and BUTTON*/
if (dom_string_caseless_isequal(node->name,
doc->memoised[hds_INPUT]))
return ((dom_html_input_element *)node)->form == form;
diff --git a/src/html/html_frame_element.c b/src/html/html_frame_element.c
index 2e182d5..16534b5 100644
--- a/src/html/html_frame_element.c
+++ b/src/html/html_frame_element.c
@@ -3,5 +3,285 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_frame_element.h>
+
+#include "html/html_document.h"
+#include "html/html_frame_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_FRAME_ELEMENT
+ },
+ DOM_HTML_FRAME_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_frame_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_frame_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_frame_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_frame_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_frame_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_frame_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_frame_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_frame_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_frame_element *ele)
+{
+ dom_string *scrolling_default = NULL;
+ dom_exception err;
+ err = dom_string_create((const uint8_t *) "auto", SLEN("auto"), &scrolling_default);
+ if (err != DOM_NO_ERR)
+ return err;
+
+
+ dom_string *frame_border_default = NULL;
+ err = dom_string_create((const uint8_t *) "1", SLEN("1"), &frame_border_default);
+ if (err != DOM_NO_ERR)
+ return err;
+
+ err = _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_FRAME],
+ namespace, prefix);
+
+ ele->scrolling_default = scrolling_default;
+ ele->frame_border_default = frame_border_default;
+
+ return err;
+}
+
+/**
+ * Finalise a dom_html_frame_element object
+ *
+ * \param ele The dom_html_frame_element object
+ */
+void _dom_html_frame_element_finalise(struct dom_html_frame_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_frame_element object
+ *
+ * \param ele The dom_html_frame_element object
+ */
+void _dom_html_frame_element_destroy(struct dom_html_frame_element *ele)
+{
+ _dom_html_frame_element_finalise(ele);
+ free(ele);
+}
+
+/**
+ * Get the no_resize property
+ *
+ * \param ele The dom_html_frame_element object
+ * \param no_resize The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_frame_element_get_no_resize(dom_html_frame_element *ele,
+ bool *no_resize)
+{
+ return dom_html_element_get_bool_property(&ele->base, "noresize",
+ SLEN("noresize"), no_resize);
+}
+
+/**
+ * Set the no_resize property
+ *
+ * \param ele The dom_html_frame_element object
+ * \param no_resize The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_frame_element_set_no_resize(dom_html_frame_element *ele,
+ bool no_resize)
+{
+ return dom_html_element_set_bool_property(&ele->base, "noresize",
+ SLEN("noresize"), no_resize);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_frame_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_frame_element_destroy(dom_node_internal *node)
+{
+ _dom_html_frame_element_destroy((struct dom_html_frame_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_frame_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_frame_element_get_##attr( \
+ dom_html_frame_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_frame_element_set_##attr( \
+ dom_html_frame_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(long_desc);
+SIMPLE_GET_SET(name);
+SIMPLE_GET_SET(src);
+SIMPLE_SET(frame_border);
+SIMPLE_GET_SET(margin_width);
+SIMPLE_GET_SET(margin_height);
+SIMPLE_SET(scrolling);
+
+
+/**
+ * Get the frame_border property
+ *
+ * \param ele The dom_html_frame_element object
+ * \param frame_border The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_frame_element_get_frame_border(
+ dom_html_frame_element *ele,
+ dom_string **frame_border)
+{
+ dom_html_document *doc;
+ bool has_value = false;
+ dom_exception err;
+
+ doc = (dom_html_document *) ((dom_node_internal *) ele)->owner;
+
+ err = dom_element_has_attribute(ele,
+ doc->memoised[hds_frame_border], &has_value);
+ if(err !=DOM_NO_ERR)
+ return err;
+
+ if(has_value) {
+ return dom_element_get_attribute(ele,
+ doc->memoised[hds_frame_border], frame_border);
+ }
+
+ *frame_border = ele->frame_border_default;
+ if (*frame_border != NULL)
+ dom_string_ref(*frame_border);
+ return DOM_NO_ERR;
+}
+
+/**
+ * Get the frame_border property
+ *
+ * \param ele The dom_html_frame_element object
+ * \param scrolling The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_frame_element_get_scrolling(
+ dom_html_frame_element *ele,
+ dom_string **scrolling)
+{
+ dom_html_document *doc;
+ bool has_value = false;
+ dom_exception err;
+
+ doc = (dom_html_document *) ((dom_node_internal *) ele)->owner;
+
+ err = dom_element_has_attribute(ele,
+ doc->memoised[hds_scrolling], &has_value);
+ if(err !=DOM_NO_ERR)
+ return err;
+
+ if(has_value) {
+ return dom_element_get_attribute(ele,
+ doc->memoised[hds_scrolling], scrolling);
+ }
+
+ *scrolling = ele->scrolling_default;
+ if (*scrolling != NULL)
+ dom_string_ref(*scrolling);
+ return DOM_NO_ERR;
+}
+
+dom_exception dom_html_frame_element_get_content_document(
+ dom_html_frame_element *ele,
+ dom_document **content_document)
+{
+ *content_document = dom_node_get_owner(ele);
+ return DOM_NO_ERR;
+}
diff --git a/src/html/html_frame_element.h b/src/html/html_frame_element.h
index 2e182d5..c313cbc 100644
--- a/src/html/html_frame_element.h
+++ b/src/html/html_frame_element.h
@@ -3,5 +3,52 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_frame_element_h_
+#define dom_internal_html_frame_element_h_
+
+#include <dom/html/html_frame_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_frame_element {
+ struct dom_html_element base;
+ /**< The base class */
+ dom_string *scrolling_default;
+ dom_string *frame_border_default;
+};
+
+/* Create a dom_html_frame_element object */
+dom_exception _dom_html_frame_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_frame_element **ele);
+
+/* Initialise a dom_html_frame_element object */
+dom_exception _dom_html_frame_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_frame_element *ele);
+
+/* Finalise a dom_html_frame_element object */
+void _dom_html_frame_element_finalise(struct dom_html_frame_element *ele);
+
+/* Destroy a dom_html_frame_element object */
+void _dom_html_frame_element_destroy(struct dom_html_frame_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_frame_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_frame_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_frame_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_FRAME_ELEMENT_PROTECT_VTABLE \
+ _dom_html_frame_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_FRAME_ELEMENT \
+ _dom_virtual_html_frame_element_destroy, \
+ _dom_html_frame_element_copy
+
+#endif
diff --git a/src/html/html_frameset_element.c b/src/html/html_frameset_element.c
index 2e182d5..b096156 100644
--- a/src/html/html_frameset_element.c
+++ b/src/html/html_frameset_element.c
@@ -3,5 +3,234 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+#include <dom/html/html_frameset_element.h>
+
+#include "html/html_document.h"
+#include "html/html_frameset_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_FRAME_SET_ELEMENT
+ },
+ DOM_HTML_FRAME_SET_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_frame_set_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_frame_set_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_frame_set_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_frame_set_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_frame_set_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_frame_set_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_frame_set_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_frame_set_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_frame_set_element *ele)
+{
+ dom_string *cols_rows_default = NULL;
+ dom_exception err;
+ err = dom_string_create((const uint8_t *) "100%", SLEN("100%"), &cols_rows_default);
+ if (err != DOM_NO_ERR)
+ return err;
+
+ err = _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_FRAMESET],
+ namespace, prefix);
+ ele->cols_rows_default = cols_rows_default;
+ return err;
+}
+
+/**
+ * Finalise a dom_html_frame_set_element object
+ *
+ * \param ele The dom_html_frame_set_element object
+ */
+void _dom_html_frame_set_element_finalise(struct dom_html_frame_set_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_frame_set_element object
+ *
+ * \param ele The dom_html_frame_set_element object
+ */
+void _dom_html_frame_set_element_destroy(struct dom_html_frame_set_element *ele)
+{
+ _dom_html_frame_set_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_frame_set_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_frame_set_element_destroy(dom_node_internal *node)
+{
+ _dom_html_frame_set_element_destroy((struct dom_html_frame_set_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_frame_set_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_frame_set_element_get_##attr( \
+ dom_html_frame_set_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_frame_set_element_set_##attr( \
+ dom_html_frame_set_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_SET(rows);
+SIMPLE_SET(cols);
+
+/**
+ * Get the rows property
+ *
+ * \param ele The dom_html_frame_set_element object
+ * \param rows The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_frame_set_element_get_rows(
+ dom_html_frame_set_element *ele,
+ dom_string **rows)
+{
+ dom_html_document *doc;
+ bool has_value = false;
+ dom_exception err;
+
+ doc = (dom_html_document *) ((dom_node_internal *) ele)->owner;
+
+ err = dom_element_has_attribute(ele,
+ doc->memoised[hds_rows], &has_value);
+ if(err !=DOM_NO_ERR)
+ return err;
+
+ if(has_value) {
+ return dom_element_get_attribute(ele,
+ doc->memoised[hds_rows], rows);
+ }
+
+ *rows = ele->cols_rows_default;
+ if (*rows != NULL)
+ dom_string_ref(*rows);
+
+ return DOM_NO_ERR;
+}
+
+/**
+ * Get the cols property
+ *
+ * \param ele The dom_html_frame_set_element object
+ * \param cols The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_frame_set_element_get_cols(
+ dom_html_frame_set_element *ele,
+ dom_string **cols)
+{
+ dom_html_document *doc;
+ bool has_value = false;
+ dom_exception err;
+
+ doc = (dom_html_document *) ((dom_node_internal *) ele)->owner;
+
+ err = dom_element_has_attribute(ele,
+ doc->memoised[hds_cols], &has_value);
+ if(err !=DOM_NO_ERR)
+ return err;
+
+ if(has_value) {
+ return dom_element_get_attribute(ele,
+ doc->memoised[hds_cols], cols);
+ }
+
+ *cols = ele->cols_rows_default;
+ if (*cols != NULL)
+ dom_string_ref(*cols);
+ return DOM_NO_ERR;
+}
diff --git a/src/html/html_frameset_element.h b/src/html/html_frameset_element.h
index 2e182d5..fd1c255 100644
--- a/src/html/html_frameset_element.h
+++ b/src/html/html_frameset_element.h
@@ -3,5 +3,51 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_frame_set_element_h_
+#define dom_internal_html_frame_set_element_h_
+
+#include <dom/html/html_frameset_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_frame_set_element {
+ struct dom_html_element base;
+ /**< The base class */
+ dom_string *cols_rows_default;
+};
+
+/* Create a dom_html_frame_set_element object */
+dom_exception _dom_html_frame_set_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_frame_set_element **ele);
+
+/* Initialise a dom_html_frame_set_element object */
+dom_exception _dom_html_frame_set_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_frame_set_element *ele);
+
+/* Finalise a dom_html_frame_set_element object */
+void _dom_html_frame_set_element_finalise(struct dom_html_frame_set_element *ele);
+
+/* Destroy a dom_html_frame_set_element object */
+void _dom_html_frame_set_element_destroy(struct dom_html_frame_set_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_frame_set_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_frame_set_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_frame_set_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_FRAME_SET_ELEMENT_PROTECT_VTABLE \
+ _dom_html_frame_set_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_FRAME_SET_ELEMENT \
+ _dom_virtual_html_frame_set_element_destroy, \
+ _dom_html_frame_set_element_copy
+
+#endif
diff --git a/src/html/html_heading_element.c b/src/html/html_heading_element.c
index 2e182d5..ba2842f 100644
--- a/src/html/html_heading_element.c
+++ b/src/html/html_heading_element.c
@@ -3,5 +3,161 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_heading_element.h>
+
+#include "html/html_document.h"
+#include "html/html_heading_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_HEADING_ELEMENT
+ },
+ DOM_HTML_HEADING_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_heading_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_heading_element_create(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace,
+ dom_string *prefix, struct dom_html_heading_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_heading_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_heading_element_initialise(doc,
+ tag_name, namespace,
+ prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_heading_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_heading_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_heading_element_initialise(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace,
+ dom_string *prefix, struct dom_html_heading_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ tag_name, namespace,
+ prefix);
+}
+
+/**
+ * Finalise a dom_html_heading_element object
+ *
+ * \param ele The dom_html_heading_element object
+ */
+void _dom_html_heading_element_finalise(struct dom_html_heading_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_heading_element object
+ *
+ * \param ele The dom_html_heading_element object
+ */
+void _dom_html_heading_element_destroy(struct dom_html_heading_element *ele)
+{
+ _dom_html_heading_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_heading_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_heading_element_destroy(dom_node_internal *node)
+{
+ _dom_html_heading_element_destroy((struct dom_html_heading_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_heading_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_heading_element_get_##attr( \
+ dom_html_heading_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_heading_element_set_##attr( \
+ dom_html_heading_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(align);
diff --git a/src/html/html_heading_element.h b/src/html/html_heading_element.h
index 2e182d5..fdd1c25 100644
--- a/src/html/html_heading_element.h
+++ b/src/html/html_heading_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_heading_element_h_
+#define dom_internal_html_heading_element_h_
+
+#include <dom/html/html_heading_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_heading_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_heading_element object */
+dom_exception _dom_html_heading_element_create(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace,
+ dom_string *prefix, struct dom_html_heading_element **ele);
+
+/* Initialise a dom_html_heading_element object */
+dom_exception _dom_html_heading_element_initialise(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace,
+ dom_string *prefix, struct dom_html_heading_element *ele);
+
+/* Finalise a dom_html_heading_element object */
+void _dom_html_heading_element_finalise(struct dom_html_heading_element *ele);
+
+/* Destroy a dom_html_heading_element object */
+void _dom_html_heading_element_destroy(struct dom_html_heading_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_heading_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_heading_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_heading_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_HEADING_ELEMENT_PROTECT_VTABLE \
+ _dom_html_heading_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_HEADING_ELEMENT \
+ _dom_virtual_html_heading_element_destroy, \
+ _dom_html_heading_element_copy
+
+#endif
diff --git a/src/html/html_iframe_element.c b/src/html/html_iframe_element.c
index 2e182d5..6f15b3e 100644
--- a/src/html/html_iframe_element.c
+++ b/src/html/html_iframe_element.c
@@ -3,5 +3,267 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_iframe_element.h>
+
+#include "html/html_document.h"
+#include "html/html_iframe_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_IFRAME_ELEMENT
+ },
+ DOM_HTML_IFRAME_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_iframe_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_iframe_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_iframe_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_iframe_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_iframe_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_iframe_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_iframe_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_iframe_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_iframe_element *ele)
+{
+ dom_string *scrolling_default = NULL;
+ dom_exception err;
+ err = dom_string_create((const uint8_t *) "auto", SLEN("auto"), &scrolling_default);
+ if (err != DOM_NO_ERR)
+ return err;
+
+
+ dom_string *frame_border_default = NULL;
+ err = dom_string_create((const uint8_t *) "1", SLEN("1"), &frame_border_default);
+ if (err != DOM_NO_ERR)
+ return err;
+
+ err = _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_IFRAME],
+ namespace, prefix);
+
+ ele->scrolling_default = scrolling_default;
+ ele->frame_border_default = frame_border_default;
+
+ return err;
+}
+
+/**
+ * Finalise a dom_html_iframe_element object
+ *
+ * \param ele The dom_html_iframe_element object
+ */
+void _dom_html_iframe_element_finalise(struct dom_html_iframe_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_iframe_element object
+ *
+ * \param ele The dom_html_iframe_element object
+ */
+void _dom_html_iframe_element_destroy(struct dom_html_iframe_element *ele)
+{
+ _dom_html_iframe_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_iframe_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_iframe_element_destroy(dom_node_internal *node)
+{
+ _dom_html_iframe_element_destroy((struct dom_html_iframe_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_iframe_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_iframe_element_get_##attr( \
+ dom_html_iframe_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_iframe_element_set_##attr( \
+ dom_html_iframe_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(long_desc);
+SIMPLE_GET_SET(align);
+SIMPLE_GET_SET(name);
+SIMPLE_GET_SET(src);
+SIMPLE_GET_SET(margin_width);
+SIMPLE_GET_SET(margin_height);
+SIMPLE_SET(scrolling);
+SIMPLE_SET(frame_border);
+SIMPLE_GET_SET(width);
+SIMPLE_GET_SET(height);
+
+
+/**
+ * Get the frame_border property
+ *
+ * \param ele The dom_html_iframe_element object
+ * \param iframe_border The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_iframe_element_get_frame_border(
+ dom_html_iframe_element *ele,
+ dom_string **frame_border)
+{
+ dom_html_document *doc;
+ bool has_value = false;
+ dom_exception err;
+
+ doc = (dom_html_document *) ((dom_node_internal *) ele)->owner;
+
+ err = dom_element_has_attribute(ele,
+ doc->memoised[hds_frame_border], &has_value);
+ if(err !=DOM_NO_ERR)
+ return err;
+
+ if(has_value) {
+ return dom_element_get_attribute(ele,
+ doc->memoised[hds_frame_border], frame_border);
+ }
+
+ *frame_border = ele->frame_border_default;
+ if (*frame_border != NULL)
+ dom_string_ref(*frame_border);
+ return DOM_NO_ERR;
+}
+
+/**
+ * Get the frame_border property
+ *
+ * \param ele The dom_html_iframe_element object
+ * \param scrolling The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_iframe_element_get_scrolling(
+ dom_html_iframe_element *ele,
+ dom_string **scrolling)
+{
+ dom_html_document *doc;
+ bool has_value = false;
+ dom_exception err;
+
+ doc = (dom_html_document *) ((dom_node_internal *) ele)->owner;
+
+ err = dom_element_has_attribute(ele,
+ doc->memoised[hds_scrolling], &has_value);
+ if(err !=DOM_NO_ERR)
+ return err;
+
+ if(has_value) {
+ return dom_element_get_attribute(ele,
+ doc->memoised[hds_scrolling], scrolling);
+ }
+
+ *scrolling = ele->scrolling_default;
+ if (*scrolling != NULL)
+ dom_string_ref(*scrolling);
+ return DOM_NO_ERR;
+}
+
+/**
+ * Get the frame_border property
+ *
+ * \param ele The dom_html_iframe_element object
+ * \param content_document The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_iframe_element_get_content_document(
+ dom_html_iframe_element *ele,
+ dom_document **content_document)
+{
+ *content_document = dom_node_get_owner(ele);
+ return DOM_NO_ERR;
+}
diff --git a/src/html/html_iframe_element.h b/src/html/html_iframe_element.h
index 2e182d5..dafc9e1 100644
--- a/src/html/html_iframe_element.h
+++ b/src/html/html_iframe_element.h
@@ -3,5 +3,53 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_iframe_element_h_
+#define dom_internal_html_iframe_element_h_
+
+#include <dom/html/html_iframe_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_iframe_element {
+ struct dom_html_element base;
+ /**< The base class */
+ dom_string *scrolling_default;
+ dom_string *frame_border_default;
+};
+
+/* Create a dom_html_iframe_element object */
+dom_exception _dom_html_iframe_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_iframe_element **ele);
+
+/* Initialise a dom_html_iframe_element object */
+dom_exception _dom_html_iframe_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_iframe_element *ele);
+
+/* Finalise a dom_html_iframe_element object */
+void _dom_html_iframe_element_finalise(struct dom_html_iframe_element *ele);
+
+/* Destroy a dom_html_iframe_element object */
+void _dom_html_iframe_element_destroy(struct dom_html_iframe_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_iframe_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_iframe_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_iframe_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_IFRAME_ELEMENT_PROTECT_VTABLE \
+ _dom_html_iframe_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_IFRAME_ELEMENT \
+ _dom_virtual_html_iframe_element_destroy, \
+ _dom_html_iframe_element_copy
+
+#endif
+
diff --git a/src/html/html_image_element.c b/src/html/html_image_element.c
index 2e182d5..77bdd27 100644
--- a/src/html/html_image_element.c
+++ b/src/html/html_image_element.c
@@ -3,5 +3,250 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_image_element.h>
+
+#include "html/html_document.h"
+#include "html/html_image_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_IMAGE_ELEMENT
+ },
+ DOM_HTML_IMAGE_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_image_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_image_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_image_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_image_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_image_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_image_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_image_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_image_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_image_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_IMG],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_image_element object
+ *
+ * \param ele The dom_html_image_element object
+ */
+void _dom_html_image_element_finalise(struct dom_html_image_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_image_element object
+ *
+ * \param ele The dom_html_image_element object
+ */
+void _dom_html_image_element_destroy(struct dom_html_image_element *ele)
+{
+ _dom_html_image_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_image_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_image_element_destroy(dom_node_internal *node)
+{
+ _dom_html_image_element_destroy((struct dom_html_image_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_image_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_image_element_get_##attr( \
+ dom_html_image_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_image_element_set_##attr( \
+ dom_html_image_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(name);
+SIMPLE_GET_SET(align);
+SIMPLE_GET_SET(alt);
+SIMPLE_GET_SET(border);
+SIMPLE_GET_SET(long_desc);
+SIMPLE_GET_SET(src);
+SIMPLE_GET_SET(use_map);
+
+dom_exception dom_html_image_element_get_height(
+ dom_html_image_element *image, int32_t *height)
+{
+ return dom_html_element_get_int32_t_property(&image->base, "height",
+ SLEN("height"), height);
+}
+
+dom_exception dom_html_image_element_set_height(
+ dom_html_image_element *image, uint32_t height)
+{
+ return dom_html_element_set_int32_t_property(&image->base, "height",
+ SLEN("height"), height);
+}
+
+dom_exception dom_html_image_element_get_hspace(
+ dom_html_image_element *image, int32_t *hspace)
+{
+ return dom_html_element_get_int32_t_property(&image->base, "hspace",
+ SLEN("hspace"), hspace);
+}
+
+dom_exception dom_html_image_element_set_hspace(
+ dom_html_image_element *image, uint32_t hspace)
+{
+ return dom_html_element_set_int32_t_property(&image->base, "hspace",
+ SLEN("hspace"), hspace);
+}
+
+dom_exception dom_html_image_element_get_vspace(
+ dom_html_image_element *image, int32_t *vspace)
+{
+ return dom_html_element_get_int32_t_property(&image->base, "vspace",
+ SLEN("cspace"), vspace);
+}
+
+dom_exception dom_html_image_element_set_vspace(
+ dom_html_image_element *image, uint32_t vspace)
+{
+ return dom_html_element_set_int32_t_property(&image->base, "vspace",
+ SLEN("vsapce"), vspace);
+}
+
+dom_exception dom_html_image_element_get_width(
+ dom_html_image_element *image, int32_t *width)
+{
+ return dom_html_element_get_int32_t_property(&image->base, "width",
+ SLEN("width"), width);
+}
+
+dom_exception dom_html_image_element_set_width(
+ dom_html_image_element *image, uint32_t width)
+{
+ return dom_html_element_set_int32_t_property(&image->base, "width",
+ SLEN("width"), width);
+}
+
+/**
+ * Get the is_map property
+ *
+ * \param ele The dom_html_image_element object
+ * \param is_map The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_image_element_get_is_map(dom_html_image_element *ele,
+ bool *is_map)
+{
+ return dom_html_element_get_bool_property(&ele->base, "ismap",
+ SLEN("ismap"), is_map);
+}
+
+/**
+ * Set the is_map property
+ *
+ * \param ele The dom_html_image_element object
+ * \param is_map The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_image_element_set_is_map(dom_html_image_element *ele,
+ bool is_map)
+{
+ return dom_html_element_set_bool_property(&ele->base, "ismap",
+ SLEN("ismap"), is_map);
+}
+
diff --git a/src/html/html_image_element.h b/src/html/html_image_element.h
index 2e182d5..ac73a1b 100644
--- a/src/html/html_image_element.h
+++ b/src/html/html_image_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_image_element_h_
+#define dom_internal_html_image_element_h_
+
+#include <dom/html/html_image_element.h>
+
+#include "html/html_element.h"
+
+struct dom_html_image_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_image_element object */
+dom_exception _dom_html_image_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_image_element **ele);
+
+/* Initialise a dom_html_image_element object */
+dom_exception _dom_html_image_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_image_element *ele);
+
+/* Finalise a dom_html_image_element object */
+void _dom_html_image_element_finalise(struct dom_html_image_element *ele);
+
+/* Destroy a dom_html_image_element object */
+void _dom_html_image_element_destroy(struct dom_html_image_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_image_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_image_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_image_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_IMAGE_ELEMENT_PROTECT_VTABLE \
+ _dom_html_image_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_IMAGE_ELEMENT \
+ _dom_virtual_html_image_element_destroy, \
+ _dom_html_image_element_copy
+
+#endif
diff --git a/src/html/html_input_element.c b/src/html/html_input_element.c
index bab79f2..84079f7 100644
--- a/src/html/html_input_element.c
+++ b/src/html/html_input_element.c
@@ -65,6 +65,8 @@ dom_exception _dom_html_input_element_initialise(struct dom_html_document *doc,
ele->default_checked_set = false;
ele->default_value = NULL;
ele->default_value_set = false;
+ ele->checked = false;
+ ele->checked_set = false;
return _dom_html_element_initialise(doc, &ele->base,
doc->memoised[hds_INPUT],
@@ -166,6 +168,11 @@ dom_exception dom_html_input_element_set_read_only(dom_html_input_element *ele,
dom_exception dom_html_input_element_get_checked(dom_html_input_element *ele,
bool *checked)
{
+ if(ele->checked_set) {
+ *checked = ele->checked;
+ return DOM_NO_ERR;
+ }
+
return dom_html_element_get_bool_property(&ele->base, "checked",
SLEN("checked"), checked);
}
@@ -349,12 +356,24 @@ SIMPLE_GET_SET(access_key);
SIMPLE_GET_SET(align);
SIMPLE_GET_SET(alt);
SIMPLE_GET_SET(name);
-SIMPLE_GET_SET(size);
SIMPLE_GET_SET(src);
SIMPLE_GET(type);
SIMPLE_GET_SET(use_map);
SIMPLE_GET_SET(value);
+dom_exception dom_html_input_element_get_size(
+ dom_html_input_element *input, int32_t *size)
+{
+ return dom_html_element_get_int32_t_property(&input->base, "size",
+ SLEN("size"), size);
+}
+
+dom_exception dom_html_input_element_set_size(
+ dom_html_input_element *input, uint32_t size)
+{
+ return dom_html_element_set_int32_t_property(&input->base, "size",
+ SLEN("size"), size);
+}
dom_exception dom_html_input_element_get_tab_index(
dom_html_input_element *input, int32_t *tab_index)
{
@@ -435,11 +454,11 @@ dom_exception dom_html_input_element_focus(dom_html_input_element *ele)
bool success = false;
assert(doc != NULL);
- /** \todo Is this event (a) default (b) bubbling and (c) cancelable? */
+ /** \this event doesnt bubble and is non-cancelable src:wikipedia*/
return _dom_dispatch_generic_event((dom_document *)doc,
(dom_event_target *) ele,
- doc->memoised[hds_focus], true,
- true, &success);
+ doc->memoised[hds_focus], false,
+ false, &success);
}
/**
@@ -455,11 +474,11 @@ dom_exception dom_html_input_element_select(dom_html_input_element *ele)
bool success = false;
assert(doc != NULL);
- /** \todo Is this event (a) default (b) bubbling and (c) cancelable? */
+ /** \this event bubbles and non-cancelable src:wikipedia*/
return _dom_dispatch_generic_event((dom_document *)doc,
(dom_event_target *) ele,
doc->memoised[hds_select], true,
- true, &success);
+ false, &success);
}
/**
@@ -473,13 +492,21 @@ dom_exception dom_html_input_element_click(dom_html_input_element *ele)
struct dom_html_document *doc =
(dom_html_document *) dom_node_get_owner(ele);
bool success = false;
+ dom_exception err;
assert(doc != NULL);
- /** \todo Is this is meant to check/uncheck boxes, radios etc */
- /** \todo Is this event (a) default (b) bubbling and (c) cancelable? */
- return _dom_dispatch_generic_event((dom_document *)doc,
+
+ /** \This event bubbles & is cancelable src:Wikipedia*/
+ err = _dom_dispatch_generic_event((dom_document *)doc,
(dom_event_target *) ele,
doc->memoised[hds_click], true,
true, &success);
+ if(err != DOM_NO_ERR)
+ return err;
+
+ ele->checked = true;
+ ele->checked_set = true;
+
+ return DOM_NO_ERR;
}
diff --git a/src/html/html_input_element.h b/src/html/html_input_element.h
index 72c7d51..b818b2e 100644
--- a/src/html/html_input_element.h
+++ b/src/html/html_input_element.h
@@ -21,6 +21,8 @@ struct dom_html_input_element {
bool default_checked_set; /**< Whether default_checked has been set */
dom_string *default_value; /**< Initial value */
bool default_value_set; /**< Whether default_value has been set */
+ bool checked; /**< Whether the element has been checked by a click */
+ bool checked_set;
};
/* Create a dom_html_input_element object */
diff --git a/src/html/html_isindex_element.c b/src/html/html_isindex_element.c
index 6dc96b9..e79e011 100644
--- a/src/html/html_isindex_element.c
+++ b/src/html/html_isindex_element.c
@@ -7,9 +7,13 @@
#include <stdlib.h>
+#include <dom/html/html_isindex_element.h>
+
+#include "html/html_document.h"
#include "html/html_isindex_element.h"
#include "core/node.h"
+#include "core/attr.h"
#include "utils/utils.h"
static struct dom_element_protected_vtable _protect_vtable = {
@@ -22,55 +26,41 @@ static struct dom_element_protected_vtable _protect_vtable = {
/**
* Create a dom_html_isindex_element object
*
- * \param doc The document object
- * \param form The form element which contains this element
- * \param ele The returned element object
+ * \param doc The document object
+ * \param ele The returned element object
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
dom_exception _dom_html_isindex_element_create(struct dom_html_document *doc,
- struct dom_html_form_element *form,
+ dom_string *namespace, dom_string *prefix,
struct dom_html_isindex_element **ele)
{
struct dom_node_internal *node;
-
*ele = malloc(sizeof(dom_html_isindex_element));
if (*ele == NULL)
return DOM_NO_MEM_ERR;
-
+
/* Set up vtables */
node = (struct dom_node_internal *) *ele;
node->base.vtable = &_dom_html_element_vtable;
node->vtable = &_protect_vtable;
- return _dom_html_isindex_element_initialise(doc, form, *ele);
+ return _dom_html_isindex_element_initialise(doc, namespace, prefix, *ele);
}
/**
* Initialise a dom_html_isindex_element object
*
- * \param doc The document object
- * \param form The form element which contains this element
- * \param ele The dom_html_isindex_element object
+ * \param doc The document object
+ * \param ele The dom_html_isindex_element object
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
dom_exception _dom_html_isindex_element_initialise(struct dom_html_document *doc,
- struct dom_html_form_element *form,
+ dom_string *namespace, dom_string *prefix,
struct dom_html_isindex_element *ele)
{
- dom_string *name = NULL;
- dom_exception err;
-
- UNUSED(form);
-
- err = dom_string_create((const uint8_t *) "ISINDEX", SLEN("ISINDEX"),
- &name);
- if (err != DOM_NO_ERR)
- return err;
-
- err = _dom_html_element_initialise(doc, &ele->base, name, NULL, NULL);
- dom_string_unref(name);
-
- return err;
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_ISINDEX],
+ namespace, prefix);
}
/**
@@ -125,7 +115,46 @@ dom_exception _dom_html_isindex_element_copy(dom_node_internal *old,
return _dom_html_element_copy(old, copy);
}
-
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_isindex_element_get_##attr( \
+ dom_html_isindex_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_isindex_element_set_##attr( \
+ dom_html_isindex_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+SIMPLE_GET_SET(prompt);
/*-----------------------------------------------------------------------*/
/* Public APIs */
diff --git a/src/html/html_isindex_element.h b/src/html/html_isindex_element.h
index 12ad26e..a39170b 100644
--- a/src/html/html_isindex_element.h
+++ b/src/html/html_isindex_element.h
@@ -19,12 +19,12 @@ struct dom_html_isindex_element {
/* Create a dom_html_isindex_element object */
dom_exception _dom_html_isindex_element_create(struct dom_html_document *doc,
- struct dom_html_form_element *form,
+ dom_string *namespace, dom_string *prefix,
struct dom_html_isindex_element **ele);
/* Initialise a dom_html_isindex_element object */
dom_exception _dom_html_isindex_element_initialise(struct dom_html_document *doc,
- struct dom_html_form_element *form,
+ dom_string *namespace, dom_string *prefix,
struct dom_html_isindex_element *ele);
/* Finalise a dom_html_isindex_element object */
diff --git a/src/html/html_label_element.c b/src/html/html_label_element.c
index 2e182d5..1ffbf71 100644
--- a/src/html/html_label_element.c
+++ b/src/html/html_label_element.c
@@ -3,5 +3,192 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include "html/html_document.h"
+#include "html/html_label_element.h"
+
+#include "core/node.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_LABEL_ELEMENT
+ },
+ DOM_HTML_LABEL_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_label_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_label_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_label_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_label_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_label_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_label_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_label_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_label_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_label_element *ele)
+{
+ ele->form = NULL;
+
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_LABEL],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_label_element object
+ *
+ * \param ele The dom_html_label_element object
+ */
+void _dom_html_label_element_finalise(struct dom_html_label_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_label_element object
+ *
+ * \param ele The dom_html_label_element object
+ */
+void _dom_html_label_element_destroy(struct dom_html_label_element *ele)
+{
+ _dom_html_label_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_label_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_label_element_destroy(dom_node_internal *node)
+{
+ _dom_html_label_element_destroy((struct dom_html_label_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_label_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/**
+ * Get the dom_html_form_element object
+ *
+ * \param label The dom_html_label_element object
+ * \param form The returned dom_htmlform_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_label_element_get_form(
+ dom_html_label_element *label, dom_html_form_element **form)
+{
+ dom_html_document *doc
+ = (dom_html_document *) ((dom_node_internal *) label)->owner;
+ dom_node_internal *form_tmp = ((dom_node_internal *) label)->parent;
+
+ /* Search ancestor chain for FIELDSET element */
+ while (form_tmp != NULL) {
+ if (form_tmp->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(form_tmp->name,
+ doc->memoised[hds_FORM]))
+ break;
+
+ form_tmp = form_tmp->parent;
+ }
+
+ if (form_tmp != NULL) {
+ *form = (dom_html_form_element *) form_tmp;
+ return DOM_NO_ERR;
+ }
+
+ *form = NULL;
+
+ return DOM_NO_ERR;
+}
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_label_element_get_##attr( \
+ dom_html_label_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_label_element_set_##attr( \
+ dom_html_label_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+SIMPLE_GET_SET(access_key);
+SIMPLE_GET_SET(html_for);
+
diff --git a/src/html/html_label_element.h b/src/html/html_label_element.h
index 2e182d5..e28b453 100644
--- a/src/html/html_label_element.h
+++ b/src/html/html_label_element.h
@@ -3,5 +3,52 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_label_element_h_
+#define dom_internal_html_label_element_h_
+
+#include <dom/html/html_label_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_label_element {
+ struct dom_html_element base;
+ /**< The base class */
+ dom_html_form_element *form;
+ /**< The form associated with label */
+};
+
+/* Create a dom_html_label_element object */
+dom_exception _dom_html_label_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_label_element **ele);
+
+/* Initialise a dom_html_label_element object */
+dom_exception _dom_html_label_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_label_element *ele);
+
+/* Finalise a dom_html_label_element object */
+void _dom_html_label_element_finalise(struct dom_html_label_element *ele);
+
+/* Destroy a dom_html_label_element object */
+void _dom_html_label_element_destroy(struct dom_html_label_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_label_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_label_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_label_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_LABEL_ELEMENT_PROTECT_VTABLE \
+ _dom_html_label_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_LABEL_ELEMENT \
+ _dom_virtual_html_label_element_destroy, \
+ _dom_html_label_element_copy
+
+#endif
diff --git a/src/html/html_legend_element.c b/src/html/html_legend_element.c
index 2e182d5..2d0e939 100644
--- a/src/html/html_legend_element.c
+++ b/src/html/html_legend_element.c
@@ -3,5 +3,213 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_legend_element.h>
+#include <dom/html/html_fieldset_element.h>
+
+#include "html/html_document.h"
+#include "html/html_legend_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_LEGEND_ELEMENT
+ },
+ DOM_HTML_LEGEND_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_legend_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_legend_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_legend_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_legend_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_legend_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_legend_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_legend_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_legend_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_legend_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_LEGEND],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_legend_element object
+ *
+ * \param ele The dom_html_legend_element object
+ */
+void _dom_html_legend_element_finalise(struct dom_html_legend_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_legend_element object
+ *
+ * \param ele The dom_html_legend_element object
+ */
+void _dom_html_legend_element_destroy(struct dom_html_legend_element *ele)
+{
+ _dom_html_legend_element_finalise(ele);
+ free(ele);
+}
+
+/**
+ * Get the dom_html_form_element object
+ *
+ * \param legend The dom_html_legend_element object
+ * \param form The returned dom_html_form_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_legend_element_get_form(
+ dom_html_legend_element *legend, dom_html_form_element **form)
+{
+ dom_html_document *doc
+ = (dom_html_document *) ((dom_node_internal *) legend)->owner;
+ dom_node_internal *field_set = ((dom_node_internal *) legend)->parent;
+
+ /* Search ancestor chain for FIELDSET element */
+ while (field_set != NULL) {
+ if (field_set->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(field_set->name,
+ doc->memoised[hds_FIELDSET]))
+ break;
+
+ field_set = field_set->parent;
+ }
+
+ if (field_set != NULL) {
+ return dom_html_field_set_element_get_form((dom_html_field_set_element *) field_set,
+ form);
+ }
+
+ *form = NULL;
+
+ return DOM_NO_ERR;
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_legend_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_legend_element_destroy(dom_node_internal *node)
+{
+ _dom_html_legend_element_destroy((struct dom_html_legend_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_legend_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_legend_element_get_##attr( \
+ dom_html_legend_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_legend_element_set_##attr( \
+ dom_html_legend_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(access_key);
+SIMPLE_SET(align);
+
+dom_exception dom_html_legend_element_get_align(
+ dom_html_legend_element *legend, dom_string **align)
+{
+ dom_exception err;
+ dom_html_document *doc = (dom_html_document *)
+ ((dom_node_internal *)legend)->owner;
+ err = dom_element_get_attribute(legend,
+ doc->memoised[hds_align], align);
+ if (err != DOM_NO_ERR)
+ return err;
+
+ if (*align == NULL) {
+ err = dom_string_create((const uint8_t *) "none", SLEN("none"), align);
+ }
+
+ return err;
+}
+
diff --git a/src/html/html_legend_element.h b/src/html/html_legend_element.h
index 2e182d5..a656ae4 100644
--- a/src/html/html_legend_element.h
+++ b/src/html/html_legend_element.h
@@ -3,5 +3,51 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_legend_element_h_
+#define dom_internal_html_legend_element_h_
+
+#include <dom/html/html_legend_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_legend_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_legend_element object */
+dom_exception _dom_html_legend_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_legend_element **ele);
+
+/* Initialise a dom_html_legend_element object */
+dom_exception _dom_html_legend_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_legend_element *ele);
+
+/* Finalise a dom_html_legend_element object */
+void _dom_html_legend_element_finalise(struct dom_html_legend_element *ele);
+
+/* Destroy a dom_html_legend_element object */
+void _dom_html_legend_element_destroy(struct dom_html_legend_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_legend_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_legend_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_legend_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_LEGEND_ELEMENT_PROTECT_VTABLE \
+ _dom_html_legend_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_LEGEND_ELEMENT \
+ _dom_virtual_html_legend_element_destroy, \
+ _dom_html_legend_element_copy
+
+#endif
+
diff --git a/src/html/html_li_element.c b/src/html/html_li_element.c
index 2e182d5..ca265ae 100644
--- a/src/html/html_li_element.c
+++ b/src/html/html_li_element.c
@@ -3,5 +3,182 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+#include <dom/html/html_li_element.h>
+
+#include "html/html_document.h"
+#include "html/html_li_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_LI_ELEMENT
+ },
+ DOM_HTML_LI_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_li_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_li_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *lifix,
+ struct dom_html_li_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_li_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_li_element_initialise(doc, namespace, lifix, *ele);
+}
+
+/**
+ * Initialise a dom_html_li_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_li_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_li_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *lifix,
+ struct dom_html_li_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_LI],
+ namespace, lifix);
+}
+
+/**
+ * Finalise a dom_html_li_element object
+ *
+ * \param ele The dom_html_li_element object
+ */
+void _dom_html_li_element_finalise(struct dom_html_li_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_li_element object
+ *
+ * \param ele The dom_html_li_element object
+ */
+void _dom_html_li_element_destroy(struct dom_html_li_element *ele)
+{
+ _dom_html_li_element_finalise(ele);
+ free(ele);
+}
+
+/**
+ * Get the value Property
+ *
+ * \param li The dom_html_li_element object
+ */
+dom_exception dom_html_li_element_get_value(
+ dom_html_li_element *li, int32_t *value)
+{
+ return dom_html_element_get_int32_t_property(&li->base, "value",
+ SLEN("value"), value);
+}
+
+/**
+ * Set the value Property
+ *
+ * \param li The dom_html_li_element object
+ */
+dom_exception dom_html_li_element_set_value(
+ dom_html_li_element *li, uint32_t value)
+{
+ return dom_html_element_set_int32_t_property(&li->base, "value",
+ SLEN("value"), value);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_li_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_li_element_destroy(dom_node_internal *node)
+{
+ _dom_html_li_element_destroy((struct dom_html_li_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_li_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_li_element_get_##attr( \
+ dom_html_li_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_li_element_set_##attr( \
+ dom_html_li_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(type);
diff --git a/src/html/html_li_element.h b/src/html/html_li_element.h
index 2e182d5..c50a2db 100644
--- a/src/html/html_li_element.h
+++ b/src/html/html_li_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_li_element_h_
+#define dom_internal_html_li_element_h_
+
+#include <dom/html/html_li_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_li_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_li_element object */
+dom_exception _dom_html_li_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *lifix,
+ struct dom_html_li_element **ele);
+
+/* Initialise a dom_html_li_element object */
+dom_exception _dom_html_li_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *lifix,
+ struct dom_html_li_element *ele);
+
+/* Finalise a dom_html_li_element object */
+void _dom_html_li_element_finalise(struct dom_html_li_element *ele);
+
+/* Destroy a dom_html_li_element object */
+void _dom_html_li_element_destroy(struct dom_html_li_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_li_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_li_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_li_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_LI_ELEMENT_PROTECT_VTABLE \
+ _dom_html_li_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_LI_ELEMENT \
+ _dom_virtual_html_li_element_destroy, \
+ _dom_html_li_element_copy
+
+#endif
diff --git a/src/html/html_map_element.c b/src/html/html_map_element.c
index 2e182d5..cf0fe5e 100644
--- a/src/html/html_map_element.c
+++ b/src/html/html_map_element.c
@@ -3,5 +3,193 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+#include <dom/html/html_map_element.h>
+
+#include "html/html_document.h"
+#include "html/html_map_element.h"
+
+#include "html/html_collection.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_MAP_ELEMENT
+ },
+ DOM_HTML_MAP_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_map_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_map_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_map_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_map_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_map_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_map_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_map_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_map_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_map_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_MAP],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_map_element object
+ *
+ * \param ele The dom_html_map_element object
+ */
+void _dom_html_map_element_finalise(struct dom_html_map_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_map_element object
+ *
+ * \param ele The dom_html_map_element object
+ */
+void _dom_html_map_element_destroy(struct dom_html_map_element *ele)
+{
+ _dom_html_map_element_finalise(ele);
+ free(ele);
+}
+
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_map_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_map_element_destroy(dom_node_internal *node)
+{
+ _dom_html_map_element_destroy((struct dom_html_map_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_map_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_map_element_get_##attr( \
+ dom_html_map_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_map_element_set_##attr( \
+ dom_html_map_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(name);
+
+/* The callback function for _dom_html_collection_create*/
+bool callback(struct dom_node_internal *node, void *ctx)
+{
+ if(node->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(node->name,
+ ((dom_html_document *)ctx)->memoised[hds_AREA]))
+ {
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * Get the areas property
+ *
+ * \param ele The dom_html_map_element object
+ * \param areas The returned dom_html_collection object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+
+dom_exception dom_html_map_element_get_areas(
+ dom_html_map_element *ele, dom_html_collection **areas)
+{
+ dom_html_document *doc
+ = (dom_html_document *) ((dom_node_internal *) ele)->owner;
+
+ /*doc is passed as a parameter to callback to avoid repeated calculations */
+ return _dom_html_collection_create(doc, (dom_node_internal *) ele,
+ callback, (void *) doc, areas);
+}
diff --git a/src/html/html_map_element.h b/src/html/html_map_element.h
index 2e182d5..0230808 100644
--- a/src/html/html_map_element.h
+++ b/src/html/html_map_element.h
@@ -3,5 +3,52 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_map_element_h_
+#define dom_internal_html_map_element_h_
+
+#include <dom/html/html_map_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_map_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_map_element object */
+dom_exception _dom_html_map_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_map_element **ele);
+
+/* Initialise a dom_html_map_element object */
+dom_exception _dom_html_map_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_map_element *ele);
+
+/* Finalise a dom_html_map_element object */
+void _dom_html_map_element_finalise(struct dom_html_map_element *ele);
+
+/* Destroy a dom_html_map_element object */
+void _dom_html_map_element_destroy(struct dom_html_map_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_map_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_map_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_map_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_MAP_ELEMENT_PROTECT_VTABLE \
+ _dom_html_map_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_MAP_ELEMENT \
+ _dom_virtual_html_map_element_destroy, \
+ _dom_html_map_element_copy
+
+#endif
+
+bool callback(struct dom_node_internal *node, void *ctx);
diff --git a/src/html/html_menu_element.c b/src/html/html_menu_element.c
index 2e182d5..af0f34c 100644
--- a/src/html/html_menu_element.c
+++ b/src/html/html_menu_element.c
@@ -3,5 +3,145 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_menu_element.h>
+
+#include "html/html_document.h"
+#include "html/html_menu_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_MENU_ELEMENT
+ },
+ DOM_HTML_MENU_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_menu_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_menu_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_menu_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_menu_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_menu_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_menu_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_menu_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_menu_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_menu_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_MENU],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_menu_element object
+ *
+ * \param ele The dom_html_menu_element object
+ */
+void _dom_html_menu_element_finalise(struct dom_html_menu_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_menu_element object
+ *
+ * \param ele The dom_html_menu_element object
+ */
+void _dom_html_menu_element_destroy(struct dom_html_menu_element *ele)
+{
+ _dom_html_menu_element_finalise(ele);
+ free(ele);
+}
+
+/**
+ * Get the compact property
+ *
+ * \param ele The dom_html_menu_element object
+ * \param compact The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_menu_element_get_compact(dom_html_menu_element *ele,
+ bool *compact)
+{
+ return dom_html_element_get_bool_property(&ele->base, "compact",
+ SLEN("compact"), compact);
+}
+
+/**
+ * Set the compact property
+ *
+ * \param ele The dom_html_menu_element object
+ * \param compact The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_menu_element_set_compact(dom_html_menu_element *ele,
+ bool compact)
+{
+ return dom_html_element_set_bool_property(&ele->base, "compact",
+ SLEN("compact"), compact);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_menu_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_menu_element_destroy(dom_node_internal *node)
+{
+ _dom_html_menu_element_destroy((struct dom_html_menu_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_menu_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
diff --git a/src/html/html_menu_element.h b/src/html/html_menu_element.h
index 2e182d5..cb84e3d 100644
--- a/src/html/html_menu_element.h
+++ b/src/html/html_menu_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_menu_element_h_
+#define dom_internal_html_menu_element_h_
+
+#include <dom/html/html_menu_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_menu_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_menu_element object */
+dom_exception _dom_html_menu_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_menu_element **ele);
+
+/* Initialise a dom_html_menu_element object */
+dom_exception _dom_html_menu_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_menu_element *ele);
+
+/* Finalise a dom_html_menu_element object */
+void _dom_html_menu_element_finalise(struct dom_html_menu_element *ele);
+
+/* Destroy a dom_html_menu_element object */
+void _dom_html_menu_element_destroy(struct dom_html_menu_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_menu_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_menu_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_menu_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_MENU_ELEMENT_PROTECT_VTABLE \
+ _dom_html_menu_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_MENU_ELEMENT \
+ _dom_virtual_html_menu_element_destroy, \
+ _dom_html_menu_element_copy
+
+#endif
diff --git a/src/html/html_mod_element.c b/src/html/html_mod_element.c
index 2e182d5..f20a994 100644
--- a/src/html/html_mod_element.c
+++ b/src/html/html_mod_element.c
@@ -3,5 +3,161 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_mod_element.h>
+
+#include "html/html_document.h"
+#include "html/html_mod_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_MOD_ELEMENT
+ },
+ DOM_HTML_MOD_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_mod_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_mod_element_create(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace,
+ dom_string *prefix, struct dom_html_mod_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_mod_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_mod_element_initialise(doc, tag_name, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_mod_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_mod_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_mod_element_initialise(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace,
+ dom_string *prefix, struct dom_html_mod_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ tag_name,
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_mod_element object
+ *
+ * \param ele The dom_html_mod_element object
+ */
+void _dom_html_mod_element_finalise(struct dom_html_mod_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_mod_element object
+ *
+ * \param ele The dom_html_mod_element object
+ */
+void _dom_html_mod_element_destroy(struct dom_html_mod_element *ele)
+{
+ _dom_html_mod_element_finalise(ele);
+ free(ele);
+}
+
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_mod_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_mod_element_destroy(dom_node_internal *node)
+{
+ _dom_html_mod_element_destroy((struct dom_html_mod_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_mod_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_mod_element_get_##attr( \
+ dom_html_mod_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_mod_element_set_##attr( \
+ dom_html_mod_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(cite);
+SIMPLE_GET_SET(date_time);
diff --git a/src/html/html_mod_element.h b/src/html/html_mod_element.h
index 2e182d5..9df07d5 100644
--- a/src/html/html_mod_element.h
+++ b/src/html/html_mod_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_mod_element_h_
+#define dom_internal_html_mod_element_h_
+
+#include <dom/html/html_mod_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_mod_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_mod_element object */
+dom_exception _dom_html_mod_element_create(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace,
+ dom_string *prefix, struct dom_html_mod_element **ele);
+
+/* Initialise a dom_html_mod_element object */
+dom_exception _dom_html_mod_element_initialise(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_mod_element *ele);
+
+/* Finalise a dom_html_mod_element object */
+void _dom_html_mod_element_finalise(struct dom_html_mod_element *ele);
+
+/* Destroy a dom_html_mod_element object */
+void _dom_html_mod_element_destroy(struct dom_html_mod_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_mod_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_mod_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_mod_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_MOD_ELEMENT_PROTECT_VTABLE \
+ _dom_html_mod_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_MOD_ELEMENT \
+ _dom_virtual_html_mod_element_destroy, \
+ _dom_html_mod_element_copy
+
+#endif
diff --git a/src/html/html_object_element.c b/src/html/html_object_element.c
index 2e182d5..7da4567 100644
--- a/src/html/html_object_element.c
+++ b/src/html/html_object_element.c
@@ -3,5 +3,264 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_object_element.h>
+
+#include "html/html_document.h"
+#include "html/html_object_element.h"
+
+#include "html/html_form_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_OBJECT_ELEMENT
+ },
+ DOM_HTML_OBJECT_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_object_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_object_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_object_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_object_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_object_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_object_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_object_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_object_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_object_element *ele)
+{
+ ele->form = NULL;
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_OBJECT],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_object_element object
+ *
+ * \param ele The dom_html_object_element object
+ */
+void _dom_html_object_element_finalise(struct dom_html_object_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_object_element object
+ *
+ * \param ele The dom_html_object_element object
+ */
+void _dom_html_object_element_destroy(struct dom_html_object_element *ele)
+{
+ _dom_html_object_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_object_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_object_element_destroy(dom_node_internal *node)
+{
+ _dom_html_object_element_destroy((struct dom_html_object_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_object_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_object_element_get_##attr( \
+ dom_html_object_element *element, \
+ dom_string **attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_object_element_set_##attr( \
+ dom_html_object_element *element, \
+ dom_string *attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(code);
+SIMPLE_GET_SET(align);
+SIMPLE_GET_SET(archive);
+SIMPLE_GET_SET(border);
+SIMPLE_GET_SET(code_base);
+SIMPLE_GET_SET(code_type);
+SIMPLE_GET_SET(data);
+SIMPLE_GET_SET(height);
+SIMPLE_GET_SET(name);
+SIMPLE_GET_SET(standby);
+SIMPLE_GET_SET(type);
+SIMPLE_GET_SET(use_map);
+SIMPLE_GET_SET(width);
+
+dom_exception dom_html_object_element_get_hspace(
+ dom_html_object_element *object, int32_t *hspace)
+{
+ return dom_html_element_get_int32_t_property(&object->base, "hspace",
+ SLEN("hspace"), hspace);
+}
+
+dom_exception dom_html_object_element_set_hspace(
+ dom_html_object_element *object, uint32_t hspace)
+{
+ return dom_html_element_set_int32_t_property(&object->base, "hspace",
+ SLEN("hspace"), hspace);
+}
+
+dom_exception dom_html_object_element_get_vspace(
+ dom_html_object_element *object, int32_t *vspace)
+{
+ return dom_html_element_get_int32_t_property(&object->base, "vspace",
+ SLEN("vspace"), vspace);
+}
+
+dom_exception dom_html_object_element_set_vspace(
+ dom_html_object_element *object, uint32_t vspace)
+{
+ return dom_html_element_set_int32_t_property(&object->base, "vspace",
+ SLEN("vspace"), vspace);
+}
+
+dom_exception dom_html_object_element_get_tab_index(
+ dom_html_object_element *object, int32_t *tab_index)
+{
+ return dom_html_element_get_int32_t_property(&object->base, "tabindex",
+ SLEN("tabindex"), tab_index);
+}
+
+dom_exception dom_html_object_element_set_tab_index(
+ dom_html_object_element *object, uint32_t tab_index)
+{
+ return dom_html_element_set_int32_t_property(&object->base, "tabindex",
+ SLEN("tabindex"), tab_index);
+}
+
+dom_exception dom_html_object_element_get_declare(dom_html_object_element *ele,
+ bool *declare)
+{
+ return dom_html_element_get_bool_property(&ele->base, "declare",
+ SLEN("declare"), declare);
+}
+
+dom_exception dom_html_object_element_set_declare(dom_html_object_element *ele,
+ bool declare)
+{
+ return dom_html_element_set_bool_property(&ele->base, "declare",
+ SLEN("declare"), declare);
+}
+
+dom_exception dom_html_object_element_get_form(
+ dom_html_object_element *object, dom_html_form_element **form)
+{
+ dom_html_document *doc
+ = (dom_html_document *) ((dom_node_internal *) object)->owner;
+ dom_node_internal *form_tmp = ((dom_node_internal *) object)->parent;
+
+ while (form_tmp != NULL) {
+ if (form_tmp->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(form_tmp->name,
+ doc->memoised[hds_FORM]))
+ break;
+
+ form_tmp = form_tmp->parent;
+ }
+
+ if (form_tmp != NULL) {
+ *form = (dom_html_form_element *) form_tmp;
+ return DOM_NO_ERR;
+ }
+
+ *form = NULL;
+
+ return DOM_NO_ERR;
+}
+
+dom_exception dom_html_object_element_get_content_document(
+ dom_html_object_element *object, dom_document **content_document)
+{
+ *content_document = (((dom_node_internal *) object)->owner);
+ return DOM_NO_ERR;
+}
+
diff --git a/src/html/html_object_element.h b/src/html/html_object_element.h
index 2e182d5..83512d6 100644
--- a/src/html/html_object_element.h
+++ b/src/html/html_object_element.h
@@ -3,5 +3,54 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_object_element_h_
+#define dom_internal_html_object_element_h_
+
+#include <dom/html/html_object_element.h>
+
+#include "html/html_element.h"
+
+struct dom_html_object_element {
+ struct dom_html_element base;
+ /**< The base class */
+ dom_html_form_element *form;
+ /**< The form associated with object */
+};
+
+/* Create a dom_html_object_element object */
+dom_exception _dom_html_object_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_object_element **ele);
+
+/* Initialise a dom_html_object_element object */
+dom_exception _dom_html_object_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_object_element *ele);
+
+/* Finalise a dom_html_object_element object */
+void _dom_html_object_element_finalise(struct dom_html_object_element *ele);
+
+/* Destroy a dom_html_object_element object */
+void _dom_html_object_element_destroy(struct dom_html_object_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_object_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+
+void _dom_virtual_html_object_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_object_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_OBJECT_ELEMENT_PROTECT_VTABLE \
+ _dom_html_object_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_OBJECT_ELEMENT \
+ _dom_virtual_html_object_element_destroy, \
+ _dom_html_object_element_copy
+
+#endif
+
diff --git a/src/html/html_olist_element.c b/src/html/html_olist_element.c
index 2e182d5..16b8763 100644
--- a/src/html/html_olist_element.c
+++ b/src/html/html_olist_element.c
@@ -3,5 +3,206 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+#include <dom/html/html_olist_element.h>
+
+#include "html/html_document.h"
+#include "html/html_olist_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_O_LIST_ELEMENT
+ },
+ DOM_HTML_O_LIST_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_o_list_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_o_list_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *o_listfix,
+ struct dom_html_o_list_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_o_list_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_o_list_element_initialise(doc, namespace, o_listfix, *ele);
+}
+
+/**
+ * Initialise a dom_html_o_list_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_o_list_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_o_list_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *o_listfix,
+ struct dom_html_o_list_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_OL],
+ namespace, o_listfix);
+}
+
+/**
+ * Finalise a dom_html_o_list_element object
+ *
+ * \param ele The dom_html_o_list_element object
+ */
+void _dom_html_o_list_element_finalise(struct dom_html_o_list_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_o_list_element object
+ *
+ * \param ele The dom_html_o_list_element object
+ */
+void _dom_html_o_list_element_destroy(struct dom_html_o_list_element *ele)
+{
+ _dom_html_o_list_element_finalise(ele);
+ free(ele);
+}
+
+/**
+ * Get the compact Property
+ *
+ * \param o_list The dom_html_o_list_element object
+ */
+dom_exception dom_html_o_list_element_get_compact(
+ dom_html_o_list_element *o_list, bool *compact)
+{
+ return dom_html_element_get_bool_property(&o_list->base, "compact",
+ SLEN("compact"), compact);
+}
+
+/**
+ * Set the compact Property
+ *
+ * \param o_list The dom_html_o_list_element object
+ */
+dom_exception dom_html_o_list_element_set_compact(
+ dom_html_o_list_element *o_list, bool compact)
+{
+ return dom_html_element_set_bool_property(&o_list->base, "compact",
+ SLEN("compact"), compact);
+}
+
+/**
+ * Get the start Property
+ *
+ * \param o_list The dom_html_o_list_element object
+ */
+dom_exception dom_html_o_list_element_get_start(
+ dom_html_o_list_element *o_list, int32_t *start)
+{
+ return dom_html_element_get_int32_t_property(&o_list->base, "start",
+ SLEN("start"), start);
+}
+
+/**
+ * Set the start Property
+ *
+ * \param o_list The dom_html_o_list_element object
+ */
+dom_exception dom_html_o_list_element_set_start(
+ dom_html_o_list_element *o_list, uint32_t start)
+{
+ return dom_html_element_set_int32_t_property(&o_list->base, "start",
+ SLEN("start"), start);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_o_list_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_o_list_element_destroy(dom_node_internal *node)
+{
+ _dom_html_o_list_element_destroy((struct dom_html_o_list_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_o_list_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_o_list_element_get_##attr( \
+ dom_html_o_list_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_o_list_element_set_##attr( \
+ dom_html_o_list_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(type);
diff --git a/src/html/html_olist_element.h b/src/html/html_olist_element.h
index 2e182d5..301d8ac 100644
--- a/src/html/html_olist_element.h
+++ b/src/html/html_olist_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_o_list_element_h_
+#define dom_internal_html_o_list_element_h_
+
+#include <dom/html/html_olist_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_o_list_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_o_list_element object */
+dom_exception _dom_html_o_list_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *o_listfix,
+ struct dom_html_o_list_element **ele);
+
+/* Initialise a dom_html_o_list_element object */
+dom_exception _dom_html_o_list_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *o_listfix,
+ struct dom_html_o_list_element *ele);
+
+/* Finalise a dom_html_o_list_element object */
+void _dom_html_o_list_element_finalise(struct dom_html_o_list_element *ele);
+
+/* Destroy a dom_html_o_list_element object */
+void _dom_html_o_list_element_destroy(struct dom_html_o_list_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_o_list_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_o_list_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_o_list_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_O_LIST_ELEMENT_PROTECT_VTABLE \
+ _dom_html_o_list_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_O_LIST_ELEMENT \
+ _dom_virtual_html_o_list_element_destroy, \
+ _dom_html_o_list_element_copy
+
+#endif
diff --git a/src/html/html_option_element.c b/src/html/html_option_element.c
index b133deb..b777c5f 100644
--- a/src/html/html_option_element.c
+++ b/src/html/html_option_element.c
@@ -255,13 +255,22 @@ dom_exception dom_html_option_element_get_text(
* \return DOM_NO_ERR on success, appropriate error otherwise.
*/
dom_exception dom_html_option_element_get_index(
- dom_html_option_element *option, unsigned long *index)
+ dom_html_option_element *option, int32_t *index)
{
- UNUSED(option);
- UNUSED(index);
+ dom_html_document *doc = (dom_html_document *) dom_node_get_owner(option);
+ int32_t idx = 0;
+ dom_node_internal *n = ((dom_node_internal *)option)->parent;
- /** \todo Implement */
- return DOM_NOT_SUPPORTED_ERR;
+ for(n = n->first_child;n != NULL; n = n->next) {
+ if((dom_node_internal *)option == n) {
+ *index = idx;
+ break;
+ } else if(dom_string_caseless_isequal(n->name,doc->memoised[hds_OPTION])) {
+ idx += 1;
+ }
+ }
+
+ return DOM_NO_ERR;
}
/**
diff --git a/src/html/html_options_collection.c b/src/html/html_options_collection.c
index 85001ad..3e06915 100644
--- a/src/html/html_options_collection.c
+++ b/src/html/html_options_collection.c
@@ -190,13 +190,13 @@ dom_exception dom_html_options_collection_named_item(dom_html_options_collection
/* No children and siblings */
struct dom_node_internal *parent = n->parent;
- while (parent != col->base.root &&
+ while (n != col->base.root &&
n == parent->last_child) {
n = parent;
parent = parent->parent;
}
- if (parent == col->base.root)
+ if (n == col->base.root)
n = NULL;
else
n = n->next;
diff --git a/src/html/html_paragraph_element.c b/src/html/html_paragraph_element.c
index 2e182d5..20a6c28 100644
--- a/src/html/html_paragraph_element.c
+++ b/src/html/html_paragraph_element.c
@@ -3,5 +3,159 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_paragraph_element.h>
+
+#include "html/html_document.h"
+#include "html/html_paragraph_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_P_ELEMENT
+ },
+ DOM_HTML_P_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_paragraph_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_paragraph_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_paragraph_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_paragraph_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_paragraph_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_paragraph_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_paragraph_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_paragraph_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_paragraph_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_P],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_paragraph_element object
+ *
+ * \param ele The dom_html_paragraph_element object
+ */
+void _dom_html_paragraph_element_finalise(struct dom_html_paragraph_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_paragraph_element object
+ *
+ * \param ele The dom_html_paragraph_element object
+ */
+void _dom_html_paragraph_element_destroy(struct dom_html_paragraph_element *ele)
+{
+ _dom_html_paragraph_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_paragraph_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_paragraph_element_destroy(dom_node_internal *node)
+{
+ _dom_html_paragraph_element_destroy((struct dom_html_paragraph_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_paragraph_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_paragraph_element_get_##attr( \
+ dom_html_paragraph_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_paragraph_element_set_##attr( \
+ dom_html_paragraph_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(align);
diff --git a/src/html/html_paragraph_element.h b/src/html/html_paragraph_element.h
index 2e182d5..b6627dd 100644
--- a/src/html/html_paragraph_element.h
+++ b/src/html/html_paragraph_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_paragraph_element_h_
+#define dom_internal_html_paragraph_element_h_
+
+#include <dom/html/html_paragraph_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_paragraph_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_paragraph_element object */
+dom_exception _dom_html_paragraph_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_paragraph_element **ele);
+
+/* Initialise a dom_html_paragraph_element object */
+dom_exception _dom_html_paragraph_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_paragraph_element *ele);
+
+/* Finalise a dom_html_paragraph_element object */
+void _dom_html_paragraph_element_finalise(struct dom_html_paragraph_element *ele);
+
+/* Destroy a dom_html_paragraph_element object */
+void _dom_html_paragraph_element_destroy(struct dom_html_paragraph_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_paragraph_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_paragraph_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_paragraph_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_P_ELEMENT_PROTECT_VTABLE \
+ _dom_html_paragraph_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_P_ELEMENT \
+ _dom_virtual_html_paragraph_element_destroy, \
+ _dom_html_paragraph_element_copy
+
+#endif
diff --git a/src/html/html_param_element.c b/src/html/html_param_element.c
index 2e182d5..6bda015 100644
--- a/src/html/html_param_element.c
+++ b/src/html/html_param_element.c
@@ -3,5 +3,160 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+#include <dom/html/html_param_element.h>
+
+#include "html/html_document.h"
+#include "html/html_param_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_PARAM_ELEMENT
+ },
+ DOM_HTML_PARAM_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_param_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_param_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_param_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_param_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_param_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_param_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_param_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_param_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_param_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_PARAM],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_param_element object
+ *
+ * \param ele The dom_html_param_element object
+ */
+void _dom_html_param_element_finalise(struct dom_html_param_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_param_element object
+ *
+ * \param ele The dom_html_param_element object
+ */
+void _dom_html_param_element_destroy(struct dom_html_param_element *ele)
+{
+ _dom_html_param_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_param_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_param_element_destroy(dom_node_internal *node)
+{
+ _dom_html_param_element_destroy((struct dom_html_param_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_param_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_param_element_get_##attr( \
+ dom_html_param_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)-> \
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_param_element_set_##attr( \
+ dom_html_param_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)-> \
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+SIMPLE_GET_SET(name);
+SIMPLE_GET_SET(type);
+SIMPLE_GET_SET(value);
+SIMPLE_GET_SET(value_type);
diff --git a/src/html/html_param_element.h b/src/html/html_param_element.h
index 2e182d5..2cd8150 100644
--- a/src/html/html_param_element.h
+++ b/src/html/html_param_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_param_element_h_
+#define dom_internal_html_param_element_h_
+
+#include <dom/html/html_param_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_param_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_param_element object */
+dom_exception _dom_html_param_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_param_element **ele);
+
+/* Initialise a dom_html_param_element object */
+dom_exception _dom_html_param_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_param_element *ele);
+
+/* Finalise a dom_html_param_element object */
+void _dom_html_param_element_finalise(struct dom_html_param_element *ele);
+
+/* Destroy a dom_html_param_element object */
+void _dom_html_param_element_destroy(struct dom_html_param_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_param_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_param_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_param_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_PARAM_ELEMENT_PROTECT_VTABLE \
+ _dom_html_param_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_PARAM_ELEMENT \
+ _dom_virtual_html_param_element_destroy, \
+ _dom_html_param_element_copy
+
+#endif
diff --git a/src/html/html_pre_element.c b/src/html/html_pre_element.c
index 2e182d5..1d220fd 100644
--- a/src/html/html_pre_element.c
+++ b/src/html/html_pre_element.c
@@ -3,5 +3,141 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_pre_element.h>
+
+#include "html/html_document.h"
+#include "html/html_pre_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_PRE_ELEMENT
+ },
+ DOM_HTML_PRE_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_pre_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_pre_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_pre_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_pre_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_pre_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_pre_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_pre_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_pre_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_pre_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_PRE],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_pre_element object
+ *
+ * \param ele The dom_html_pre_element object
+ */
+void _dom_html_pre_element_finalise(struct dom_html_pre_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_pre_element object
+ *
+ * \param ele The dom_html_pre_element object
+ */
+void _dom_html_pre_element_destroy(struct dom_html_pre_element *ele)
+{
+ _dom_html_pre_element_finalise(ele);
+ free(ele);
+}
+
+/**
+ * Get the width Property
+ *
+ * \param pre The dom_html_pre_element object
+ */
+dom_exception dom_html_pre_element_get_width(
+ dom_html_pre_element *pre, int32_t *width)
+{
+ return dom_html_element_get_int32_t_property(&pre->base, "width",
+ SLEN("width"), width);
+}
+
+/**
+ * Set the width Property
+ *
+ * \param pre The dom_html_pre_element object
+ */
+dom_exception dom_html_pre_element_set_width(
+ dom_html_pre_element *pre, uint32_t width)
+{
+ return dom_html_element_set_int32_t_property(&pre->base, "width",
+ SLEN("width"), width);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_pre_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_pre_element_destroy(dom_node_internal *node)
+{
+ _dom_html_pre_element_destroy((struct dom_html_pre_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_pre_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
diff --git a/src/html/html_pre_element.h b/src/html/html_pre_element.h
index 2e182d5..75d8df8 100644
--- a/src/html/html_pre_element.h
+++ b/src/html/html_pre_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_pre_element_h_
+#define dom_internal_html_pre_element_h_
+
+#include <dom/html/html_pre_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_pre_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_pre_element object */
+dom_exception _dom_html_pre_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_pre_element **ele);
+
+/* Initialise a dom_html_pre_element object */
+dom_exception _dom_html_pre_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_pre_element *ele);
+
+/* Finalise a dom_html_pre_element object */
+void _dom_html_pre_element_finalise(struct dom_html_pre_element *ele);
+
+/* Destroy a dom_html_pre_element object */
+void _dom_html_pre_element_destroy(struct dom_html_pre_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_pre_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_pre_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_pre_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_PRE_ELEMENT_PROTECT_VTABLE \
+ _dom_html_pre_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_PRE_ELEMENT \
+ _dom_virtual_html_pre_element_destroy, \
+ _dom_html_pre_element_copy
+
+#endif
diff --git a/src/html/html_quote_element.c b/src/html/html_quote_element.c
index 2e182d5..d16bad8 100644
--- a/src/html/html_quote_element.c
+++ b/src/html/html_quote_element.c
@@ -3,5 +3,159 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_quote_element.h>
+
+#include "html/html_document.h"
+#include "html/html_quote_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_QUOTE_ELEMENT
+ },
+ DOM_HTML_QUOTE_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_quote_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_quote_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_quote_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_quote_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_quote_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_quote_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_quote_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_quote_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_quote_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_Q],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_quote_element object
+ *
+ * \param ele The dom_html_quote_element object
+ */
+void _dom_html_quote_element_finalise(struct dom_html_quote_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_quote_element object
+ *
+ * \param ele The dom_html_quote_element object
+ */
+void _dom_html_quote_element_destroy(struct dom_html_quote_element *ele)
+{
+ _dom_html_quote_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_quote_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_quote_element_destroy(dom_node_internal *node)
+{
+ _dom_html_quote_element_destroy((struct dom_html_quote_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_quote_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_quote_element_get_##attr( \
+ dom_html_quote_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_quote_element_set_##attr( \
+ dom_html_quote_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(cite);
diff --git a/src/html/html_quote_element.h b/src/html/html_quote_element.h
index 2e182d5..a8bfbb2 100644
--- a/src/html/html_quote_element.h
+++ b/src/html/html_quote_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_quote_element_h_
+#define dom_internal_html_quote_element_h_
+
+#include <dom/html/html_quote_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_quote_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_quote_element object */
+dom_exception _dom_html_quote_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_quote_element **ele);
+
+/* Initialise a dom_html_quote_element object */
+dom_exception _dom_html_quote_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_quote_element *ele);
+
+/* Finalise a dom_html_quote_element object */
+void _dom_html_quote_element_finalise(struct dom_html_quote_element *ele);
+
+/* Destroy a dom_html_quote_element object */
+void _dom_html_quote_element_destroy(struct dom_html_quote_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_quote_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_quote_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_quote_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_QUOTE_ELEMENT_PROTECT_VTABLE \
+ _dom_html_quote_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_QUOTE_ELEMENT \
+ _dom_virtual_html_quote_element_destroy, \
+ _dom_html_quote_element_copy
+
+#endif
diff --git a/src/html/html_script_element.c b/src/html/html_script_element.c
index 2e182d5..f107d45 100644
--- a/src/html/html_script_element.c
+++ b/src/html/html_script_element.c
@@ -3,5 +3,218 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+#include <dom/html/html_script_element.h>
+
+#include "html/html_document.h"
+#include "html/html_script_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_SCRIPT_ELEMENT
+ },
+ DOM_HTML_SCRIPT_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_script_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_script_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_script_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_script_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_script_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_script_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_script_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_script_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_script_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_SCRIPT],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_script_element object
+ *
+ * \param ele The dom_html_script_element object
+ */
+void _dom_html_script_element_finalise(struct dom_html_script_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_script_element object
+ *
+ * \param ele The dom_html_script_element object
+ */
+void _dom_html_script_element_destroy(struct dom_html_script_element *ele)
+{
+ _dom_html_script_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_script_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_script_element_destroy(dom_node_internal *node)
+{
+ _dom_html_script_element_destroy((struct dom_html_script_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_script_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_script_element_get_##attr( \
+ dom_html_script_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_script_element_set_##attr( \
+ dom_html_script_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(html_for);
+SIMPLE_GET_SET(event);
+SIMPLE_GET_SET(charset);
+SIMPLE_GET_SET(src);
+SIMPLE_GET_SET(type);
+
+/**
+ * Get the defer property
+ *
+ * \param ele The dom_html_script_element object
+ * \param defer The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_script_element_get_defer(dom_html_script_element *ele,
+ bool *defer)
+{
+ return dom_html_element_get_bool_property(&ele->base, "defer",
+ SLEN("defer"), defer);
+}
+
+/**
+ * Set the defer property
+ *
+ * \param ele The dom_html_script_element object
+ * \param defer The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_script_element_set_defer(dom_html_script_element *ele,
+ bool defer)
+{
+ return dom_html_element_set_bool_property(&ele->base, "defer",
+ SLEN("defer"), defer);
+}
+
+/**
+ * Get the text property
+ *
+ * \param ele The dom_html_script_element object
+ * \param text The returned dom_string object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_script_element_get_text(
+ dom_html_script_element *ele,
+ dom_string **text)
+{
+ return _dom_node_get_text_content((dom_node_internal *)ele, text);
+}
+
+/**
+ * Set the text property
+ *
+ * \param ele The dom_html_script_element object
+ * \param text The dom_string value to be set
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_script_element_set_text(
+ dom_html_script_element *ele,
+ dom_string *text)
+{
+ return _dom_node_set_text_content((dom_node_internal *)ele, text);
+}
diff --git a/src/html/html_script_element.h b/src/html/html_script_element.h
index 2e182d5..dcb7b72 100644
--- a/src/html/html_script_element.h
+++ b/src/html/html_script_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_script_element_h_
+#define dom_internal_html_script_element_h_
+
+#include <dom/html/html_script_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_script_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_script_element object */
+dom_exception _dom_html_script_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_script_element **ele);
+
+/* Initialise a dom_html_script_element object */
+dom_exception _dom_html_script_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_script_element *ele);
+
+/* Finalise a dom_html_script_element object */
+void _dom_html_script_element_finalise(struct dom_html_script_element *ele);
+
+/* Destroy a dom_html_script_element object */
+void _dom_html_script_element_destroy(struct dom_html_script_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_script_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_script_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_script_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_SCRIPT_ELEMENT_PROTECT_VTABLE \
+ _dom_html_script_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_SCRIPT_ELEMENT \
+ _dom_virtual_html_script_element_destroy, \
+ _dom_html_script_element_copy
+
+#endif
diff --git a/src/html/html_select_element.c b/src/html/html_select_element.c
index c02f0bd..7a5e84e 100644
--- a/src/html/html_select_element.c
+++ b/src/html/html_select_element.c
@@ -65,8 +65,8 @@ dom_exception _dom_html_select_element_initialise(struct dom_html_document *doc,
ele->form = NULL;
return _dom_html_element_initialise(doc, &ele->base,
- doc->memoised[hds_SELECT],
- namespace, prefix);
+ doc->memoised[hds_SELECT],
+ namespace, prefix);
}
/**
@@ -125,16 +125,16 @@ dom_exception _dom_html_select_element_copy(dom_node_internal *old,
/* Public APIs */
static dom_exception _dom_html_select_element_make_collection(
- dom_html_select_element *ele,
- dom_html_options_collection **col)
+ dom_html_select_element *ele,
+ dom_html_options_collection **col)
{
dom_html_document *doc = (dom_html_document *) dom_node_get_owner(ele);
assert(doc != NULL);
return _dom_html_options_collection_create(doc,
- (dom_node_internal *) ele,
- is_option, ele, col);
+ (dom_node_internal *) ele,
+ is_option, ele, col);
}
/**
@@ -174,11 +174,11 @@ dom_exception dom_html_select_element_get_selected_index(
dom_html_select_element *ele, int32_t *index)
{
dom_exception err;
- uint32_t idx, len;
+ uint32_t idx,len;
dom_node *option;
bool selected;
dom_html_options_collection *col;
-
+
err = _dom_html_select_element_make_collection(ele, &col);
err = dom_html_options_collection_get_length(col, &len);
@@ -194,7 +194,7 @@ dom_exception dom_html_select_element_get_selected_index(
dom_html_options_collection_unref(col);
return err;
}
-
+
err = dom_html_option_element_get_selected(
(dom_html_option_element *) option, &selected);
@@ -204,7 +204,7 @@ dom_exception dom_html_select_element_get_selected_index(
dom_html_options_collection_unref(col);
return err;
}
-
+
if (selected) {
*index = idx;
dom_html_options_collection_unref(col);
@@ -228,11 +228,30 @@ dom_exception dom_html_select_element_get_selected_index(
dom_exception dom_html_select_element_set_selected_index(
dom_html_select_element *ele, int32_t index)
{
- UNUSED(ele);
- UNUSED(index);
+ dom_exception err;
+ dom_node *option;
+ dom_html_options_collection *col;
- /** \todo Implement */
- return DOM_NOT_SUPPORTED_ERR;
+ err = _dom_html_select_element_make_collection(ele, &col);
+
+ err = dom_html_options_collection_item(col,
+ index, &option);
+ if (err != DOM_NO_ERR) {
+ dom_html_options_collection_unref(col);
+ return err;
+ }
+
+ err = dom_html_option_element_set_selected(
+ (dom_html_option_element *) option, true);
+
+ dom_node_unref(option);
+
+ dom_html_options_collection_unref(col);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+
+ return DOM_NO_ERR;
}
/**
@@ -250,7 +269,7 @@ dom_exception dom_html_select_element_get_value(
dom_node *option;
bool selected;
dom_html_options_collection *col;
-
+
err = _dom_html_select_element_make_collection(ele, &col);
if (err != DOM_NO_ERR)
return err;
@@ -291,7 +310,7 @@ dom_exception dom_html_select_element_get_value(
*value = NULL;
dom_html_options_collection_unref(col);
-
+
return DOM_NO_ERR;
}
@@ -305,11 +324,54 @@ dom_exception dom_html_select_element_get_value(
dom_exception dom_html_select_element_set_value(
dom_html_select_element *ele, dom_string *value)
{
- UNUSED(ele);
- UNUSED(value);
+ dom_exception err;
+ uint32_t idx, len;
+ dom_node *option;
+ bool selected;
+ dom_html_options_collection *col;
+
+ err = _dom_html_select_element_make_collection(ele, &col);
+ if (err != DOM_NO_ERR)
+ return err;
+
+ err = dom_html_select_element_get_length(ele, &len);
+ if (err != DOM_NO_ERR) {
+ dom_html_options_collection_unref(col);
+ return err;
+ }
+
+ for (idx = 0; idx < len; idx++) {
+ err = dom_html_options_collection_item(col,
+ idx, &option);
+ if (err != DOM_NO_ERR) {
+ dom_html_options_collection_unref(col);
+ return err;
+ }
+
+ err = dom_html_option_element_get_selected(
+ (dom_html_option_element *) option, &selected);
+ if (err != DOM_NO_ERR) {
+ dom_html_options_collection_unref(col);
+ dom_node_unref(option);
+ return err;
+ }
+
+ if (selected) {
+ err = dom_html_option_element_set_value(
+ (dom_html_option_element *) option,
+ value);
+
+ dom_html_options_collection_unref(col);
+ dom_node_unref(option);
+
+ return err;
+ }
+ }
+
+ dom_html_options_collection_unref(col);
+
+ return DOM_NO_ERR;
- /** \todo Implement */
- return DOM_NOT_SUPPORTED_ERR;
}
/**
@@ -362,7 +424,7 @@ dom_exception dom_html_select_element_set_length(
* \return DOM_NO_ERR on success, appropriate error otherwise.
*/
dom_exception dom_html_select_element_get_form(
- dom_html_select_element *select, dom_html_form_element **form)
+ dom_html_select_element *select, dom_html_form_element **form)
{
*form = select->form;
@@ -536,12 +598,12 @@ dom_exception dom_html_select_element_set_tab_index(
dom_exception dom__html_select_element_add(dom_html_select_element *select,
struct dom_html_element *ele, struct dom_html_element *before)
{
- UNUSED(select);
- UNUSED(ele);
- UNUSED(before);
- /** \todo Implement */
- return DOM_NOT_SUPPORTED_ERR;
+ return _dom_node_insert_before((dom_node_internal *)select,
+ (dom_node_internal *)ele, (dom_node_internal *)before,
+ (dom_node_internal **)&ele);
+
+
}
dom_exception dom_html_select_element_remove(dom_html_select_element *ele,
@@ -549,17 +611,31 @@ dom_exception dom_html_select_element_remove(dom_html_select_element *ele,
{
dom_exception err;
uint32_t len;
+ dom_node *option;
err = dom_html_select_element_get_length(ele, &len);
if (err != DOM_NO_ERR)
return err;
/* Ensure index is in range */
- if (index < 0 || (uint32_t)index >= len)
+ if (index < 0 || index >= (int32_t)len)
return DOM_NO_ERR;
+ dom_html_options_collection *col;
- /** \todo What does remove mean? Remove option from tree and destroy it? */
- return DOM_NOT_SUPPORTED_ERR;
+ err = _dom_html_select_element_make_collection(ele, &col);
+ if (err != DOM_NO_ERR)
+ return err;
+
+ err = dom_html_options_collection_item(col,
+ index, &option);
+
+ if (err != DOM_NO_ERR) {
+ dom_html_options_collection_unref(col);
+ return err;
+ }
+ return _dom_node_remove_child(((dom_node_internal *)option)->parent,
+ (dom_node_internal *)option,
+ (dom_node_internal **)&option);
}
/**
@@ -577,9 +653,9 @@ dom_exception dom_html_select_element_blur(struct dom_html_select_element *ele)
/** \todo Is this event (a) default (b) bubbling and (c) cancelable? */
return _dom_dispatch_generic_event((dom_document *) doc,
- (dom_event_target *) ele,
- doc->memoised[hds_blur], true,
- true, &success);
+ (dom_event_target *) ele,
+ doc->memoised[hds_blur], true,
+ true, &success);
}
/**
@@ -597,9 +673,9 @@ dom_exception dom_html_select_element_focus(struct dom_html_select_element *ele)
/** \todo Is this event (a) default (b) bubbling and (c) cancelable? */
return _dom_dispatch_generic_event((dom_document *) doc,
- (dom_event_target *) ele,
- doc->memoised[hds_focus], true,
- true, &success);
+ (dom_event_target *) ele,
+ doc->memoised[hds_focus], true,
+ true, &success);
}
@@ -611,7 +687,7 @@ bool is_option(struct dom_node_internal *node, void *ctx)
{
dom_html_select_element *ele = ctx;
dom_html_document *doc = (dom_html_document *) dom_node_get_owner(ele);
-
+
if (dom_string_isequal(node->name, doc->memoised[hds_OPTION]))
return true;
@@ -619,7 +695,7 @@ bool is_option(struct dom_node_internal *node, void *ctx)
}
dom_exception _dom_html_select_element_set_form(
- dom_html_select_element *select, dom_html_form_element *form)
+ dom_html_select_element *select, dom_html_form_element *form)
{
select->form = form;
diff --git a/src/html/html_style_element.c b/src/html/html_style_element.c
index 98eb79b..681f0b8 100644
--- a/src/html/html_style_element.c
+++ b/src/html/html_style_element.c
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include "html/html_style_element.h"
+#include "html/html_document.h"
#include "core/node.h"
#include "utils/utils.h"
@@ -34,7 +35,7 @@ dom_exception _dom_html_style_element_create(struct dom_html_document *doc,
*ele = malloc(sizeof(dom_html_style_element));
if (*ele == NULL)
return DOM_NO_MEM_ERR;
-
+
/* Set up vtables */
node = (struct dom_node_internal *) *ele;
node->base.vtable = &_dom_html_element_vtable;
@@ -54,13 +55,20 @@ dom_exception _dom_html_style_element_initialise(struct dom_html_document *doc,
struct dom_html_style_element *ele)
{
dom_string *name = NULL;
+ dom_string *media_default = NULL;
dom_exception err;
err = dom_string_create((const uint8_t *) "STYLE", SLEN("STYLE"),
&name);
if (err != DOM_NO_ERR)
return err;
+
+ err = dom_string_create((const uint8_t *) "screen", SLEN("screen"),
+ &media_default);
+ if (err != DOM_NO_ERR)
+ return err;
+ ele->media = media_default;
err = _dom_html_element_initialise(doc, &ele->base, name, NULL, NULL);
dom_string_unref(name);
@@ -119,9 +127,49 @@ dom_exception _dom_html_style_element_copy(dom_node_internal *old,
return _dom_html_element_copy(old, copy);
}
+
/*-----------------------------------------------------------------------*/
/* Public APIs */
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_style_element_get_##attr( \
+ dom_html_style_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+dom_exception dom_html_style_element_set_##attr( \
+ dom_html_style_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+SIMPLE_GET_SET(type);
+SIMPLE_SET(media);
+
/**
* Get the disabled property
*
@@ -150,3 +198,36 @@ dom_exception dom_html_style_element_set_disabled(dom_html_style_element *ele,
SLEN("disabled"), disabled);
}
+/**
+ * Get the media property
+ *
+ * \param ele The dom_html_style_element object
+ * \param media The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_style_element_get_media(dom_html_style_element *ele,
+ dom_string **media)
+{
+ dom_html_document *doc;
+ bool has_value = false;
+ dom_exception err;
+
+ doc = (dom_html_document *) ((dom_node_internal *) ele)->owner;
+
+ err = dom_element_has_attribute(ele,
+ doc->memoised[hds_media], &has_value);
+ if(err !=DOM_NO_ERR)
+ return err;
+
+ if(has_value) {
+ return dom_element_get_attribute(ele,
+ doc->memoised[hds_media], media);
+ }
+
+ *media = ele->media;
+ if (*media != NULL)
+ dom_string_ref(*media);
+ return DOM_NO_ERR;
+
+}
+
diff --git a/src/html/html_style_element.h b/src/html/html_style_element.h
index e7a47e5..285da94 100644
--- a/src/html/html_style_element.h
+++ b/src/html/html_style_element.h
@@ -15,6 +15,8 @@
struct dom_html_style_element {
struct dom_html_element base;
/**< The base class */
+ dom_string *media;
+ /**< The default string value for the media attribute*/
};
/* Create a dom_html_style_element object */
diff --git a/src/html/html_table_element.c b/src/html/html_table_element.c
index 2e182d5..0f27fd3 100644
--- a/src/html/html_table_element.c
+++ b/src/html/html_table_element.c
@@ -3,5 +3,745 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_table_element.h>
+
+#include "html/html_document.h"
+#include "html/html_table_element.h"
+#include "html/html_tablecaption_element.h"
+#include "html/html_tablesection_element.h"
+#include "html/html_tablerow_element.h"
+#include "html/html_collection.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_TABLE_ELEMENT
+ },
+ DOM_HTML_TABLE_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_table_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_table_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_table_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_table_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_table_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_element *ele)
+{
+ ele->caption = NULL;
+ ele->t_head = NULL;
+ ele->t_foot = NULL;
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_TABLE],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_table_element object
+ *
+ * \param ele The dom_html_table_element object
+ */
+void _dom_html_table_element_finalise(struct dom_html_table_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_table_element object
+ *
+ * \param ele The dom_html_table_element object
+ */
+void _dom_html_table_element_destroy(struct dom_html_table_element *ele)
+{
+ _dom_html_table_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_table_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_table_element_destroy(dom_node_internal *node)
+{
+ _dom_html_table_element_destroy((struct dom_html_table_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_table_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_table_element_get_##attr( \
+ dom_html_table_element *element, \
+ dom_string **attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)-> \
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_table_element_set_##attr( \
+ dom_html_table_element *element, \
+ dom_string *attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)-> \
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+SIMPLE_GET_SET(align);
+SIMPLE_GET_SET(bg_color);
+SIMPLE_GET_SET(border);
+SIMPLE_GET_SET(cell_padding);
+SIMPLE_GET_SET(cell_spacing);
+SIMPLE_GET_SET(frame);
+SIMPLE_GET_SET(rules);
+SIMPLE_GET_SET(summary);
+SIMPLE_GET_SET(width);
+
+/**
+ * Get the caption Attribute
+ *
+ * \param table The dom_html_table_element object
+ */
+dom_exception dom_html_table_element_get_caption(
+ dom_html_table_element *table, dom_html_table_caption_element **caption)
+{
+ dom_node_internal *node_tmp = ((dom_node_internal *)table);
+ dom_html_document *doc = (dom_html_document *)(node_tmp->owner);
+
+ if(table->caption == NULL) {
+ for (node_tmp = node_tmp->first_child; node_tmp != NULL; node_tmp = node_tmp->next) {
+ if((node_tmp->type == DOM_ELEMENT_NODE) &&
+ dom_string_caseless_isequal(doc->memoised[hds_CAPTION],node_tmp->name)) {
+ break;
+ }
+ }
+ table->caption = (dom_html_table_caption_element *)node_tmp;
+ }
+ *caption = (table->caption);
+ return DOM_NO_ERR;
+}
+
+/**
+ * Set the caption Attribute
+ *
+ * \param table The dom_html_table_element object
+ * \param table The dom_html_table_element object
+ */
+dom_exception dom_html_table_element_set_caption(
+ dom_html_table_element *table, dom_html_table_caption_element *caption)
+{
+ dom_node_internal *check_node = ((dom_node_internal *)caption);
+ dom_html_document *doc = (dom_html_document *)(((dom_node_internal *)table)->owner);
+ if(check_node == NULL) {
+ return DOM_HIERARCHY_REQUEST_ERR;
+ }
+ if(!dom_string_caseless_isequal(doc->memoised[hds_CAPTION],check_node->name)) {
+ return DOM_HIERARCHY_REQUEST_ERR;
+ }
+ table->caption = caption;
+ return DOM_NO_ERR;
+}
+
+/**
+ * Get the t_head Attribute
+ *
+ * \param table The dom_html_table_element object
+ */
+dom_exception dom_html_table_element_get_t_head(
+ dom_html_table_element *table, dom_html_table_section_element **t_head)
+{
+ dom_node_internal *node_tmp = ((dom_node_internal *)table);
+ dom_html_document *doc = (dom_html_document *)(node_tmp->owner);
+
+ if(table->t_head == NULL) {
+ for (node_tmp = node_tmp->first_child; node_tmp != NULL; node_tmp = node_tmp->next) {
+ if((node_tmp->type == DOM_ELEMENT_NODE) &&
+ dom_string_caseless_isequal(doc->memoised[hds_THEAD],node_tmp->name)) {
+ break;
+ }
+ }
+ table->t_head = (dom_html_table_section_element *)node_tmp;
+ }
+ *t_head = table->t_head;
+ return DOM_NO_ERR;
+}
+
+/**
+ * Set the t_head Attribute
+ *
+ * \param table The dom_html_table_element object
+ * \param table The dom_html_table_element object
+ */
+dom_exception dom_html_table_element_set_t_head(
+ dom_html_table_element *table, dom_html_table_section_element *t_head)
+{
+ dom_node_internal *check_node = ((dom_node_internal *)t_head);
+ dom_html_document *doc = (dom_html_document *)(((dom_node_internal *)table)->owner);
+ if(check_node == NULL) {
+ return DOM_HIERARCHY_REQUEST_ERR;
+ }
+ if(!dom_string_caseless_isequal(doc->memoised[hds_CAPTION],check_node->name)) {
+ return DOM_HIERARCHY_REQUEST_ERR;
+ }
+ table->t_head = t_head;
+ return DOM_NO_ERR;
+}
+
+/**
+ * Get the t_foot Attribute
+ *
+ * \param table The dom_html_table_element object
+ */
+dom_exception dom_html_table_element_get_t_foot(
+ dom_html_table_element *table, dom_html_table_section_element **t_foot)
+{
+ dom_node_internal *node_tmp = ((dom_node_internal *)table);
+ dom_html_document *doc = (dom_html_document *)(node_tmp->owner);
+
+ if(table->t_foot == NULL) {
+ for (node_tmp = node_tmp->first_child; node_tmp != NULL; node_tmp = node_tmp->next) {
+ if((node_tmp->type == DOM_ELEMENT_NODE) &&
+ dom_string_caseless_isequal(doc->memoised[hds_TFOOT],node_tmp->name)) {
+ break;
+ }
+ }
+ table->t_foot = (dom_html_table_section_element *)node_tmp;
+ }
+ *t_foot = (table->t_foot);
+ return DOM_NO_ERR;
+}
+
+/**
+ * Set the t_foot Attribute
+ *
+ * \param table The dom_html_table_element object
+ */
+dom_exception dom_html_table_element_set_t_foot(
+ dom_html_table_element *table, dom_html_table_section_element *t_foot)
+{
+ dom_node_internal *check_node = ((dom_node_internal *)t_foot); /*< temporary node to check for raised exceptions */
+ dom_html_document *doc = (dom_html_document *)(((dom_node_internal *)table)->owner);
+ if(check_node == NULL) {
+ return DOM_HIERARCHY_REQUEST_ERR;
+ }
+ if(!dom_string_caseless_isequal(doc->memoised[hds_TFOOT],check_node->name)) {
+ return DOM_HIERARCHY_REQUEST_ERR;
+ }
+ table->t_foot = t_foot;
+ return DOM_NO_ERR;
+}
+
+/**
+ * Callback for creating the rows collection
+ *
+ * \param node The dom_html_table_element object
+ * \param ctx The dom_html_document object (void *)
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+bool table_rows_callback(struct dom_node_internal *node, void *ctx)
+{
+ if(node->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(node->name,
+ ((dom_html_document *)ctx)->memoised[hds_TR])) {
+ return true;
+ }
+ return false;
+}
+
+/**
+ * Get the rows collection
+ *
+ * \param element The dom_html_table_element object
+ * \param rows The Status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_element_get_rows(
+ dom_html_table_element *element,
+ dom_html_collection **rows)
+{
+ dom_html_document *doc = (dom_html_document *) ((dom_node_internal *) element)->owner;
+ return _dom_html_collection_create(doc, (dom_node_internal *)element,
+ table_rows_callback, (void *)doc, rows);
+}
+
+/**
+ * Callback for creating the tbodies collection
+ *
+ * \param node The dom_html_table_element object
+ * \param ctx The dom_html_document object (void *)
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+bool table_t_bodies_callback(struct dom_node_internal *node, void *ctx)
+{
+ if(node->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(node->name,
+ ((dom_html_document *)ctx)->memoised[hds_TBODY])) {
+ return true;
+ }
+ return false;
+}
+
+/**
+ * Get the tBodies collection
+ *
+ * \param element The dom_html_table_element object
+ * \param t_bodies The Status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_element_get_t_bodies(
+ dom_html_table_element *element,
+ dom_html_collection **t_bodies)
+{
+ dom_html_document *doc = (dom_html_document *) ((dom_node_internal *) element)->owner;
+ return _dom_html_collection_create(doc, (dom_node_internal *)element,
+ table_t_bodies_callback, (void *)doc, t_bodies);
+}
+
+/**
+ * Get or Create the table caption
+ *
+ * \param element The dom_html_table_element object
+ * \param caption The Status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_element_create_caption(
+ dom_html_table_element *element,
+ dom_html_element **caption)
+{
+ dom_exception exp;
+ if((exp = dom_html_table_element_get_caption(element,
+ (dom_html_table_caption_element **)caption)) != DOM_NO_ERR) {
+ return exp;
+ }
+ if((*caption) == NULL) {
+ dom_html_document *doc = (dom_html_document *)
+ ((dom_node_internal *) element)->owner;
+ exp = _dom_html_table_caption_element_create(doc,
+ ((dom_node_internal *)element)->namespace,
+ ((dom_node_internal *)element)->prefix,
+ (dom_html_table_caption_element **)caption);
+ if(exp != DOM_NO_ERR) {
+ return exp;
+ }
+ _dom_node_append_child((dom_node_internal *)element,
+ (dom_node_internal *)*caption,
+ (dom_node_internal **)caption);
+ element->caption = (dom_html_table_caption_element *)*caption;
+
+ }
+ return DOM_NO_ERR;
+}
+
+/**
+ * Delete the table caption, if one exists
+ *
+ * \param element The dom_html_table_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_element_delete_caption(
+ dom_html_table_element *element)
+{
+ dom_html_table_caption_element *caption;
+ dom_html_table_element_get_caption(element, &caption);
+ _dom_node_remove_child((dom_node_internal *)element,
+ (dom_node_internal *)caption,
+ (dom_node_internal **)&caption);
+ element->caption = NULL;
+ return DOM_NO_ERR;
+}
+
+/**
+ * Get or Create the table Foot
+ *
+ * \param element The dom_html_table_element object
+ * \param t_foot The Status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_element_create_t_foot(
+ dom_html_table_element *element,
+ dom_html_element **t_foot)
+{
+ dom_exception exp;
+ exp = dom_html_table_element_get_t_foot(element,
+ (dom_html_table_section_element **)t_foot);
+ if(exp !=DOM_NO_ERR) {
+ return exp;
+ }
+ if((*t_foot) == NULL) {
+ dom_html_document *doc = (dom_html_document *)
+ ((dom_node_internal *) element)->owner;
+ exp = _dom_html_table_section_element_create(doc,
+ doc->memoised[hds_TFOOT],
+ ((dom_node_internal *)element)->namespace,
+ ((dom_node_internal *)element)->prefix,
+ (dom_html_table_section_element **)t_foot);
+ if(exp != DOM_NO_ERR) {
+ return exp;
+ }
+ _dom_node_append_child((dom_node_internal *)element,
+ (dom_node_internal *)*t_foot,
+ (dom_node_internal **)t_foot);
+ element->t_foot = (dom_html_table_section_element *)*t_foot;
+
+ }
+ return DOM_NO_ERR;
+}
+
+/**
+ * Delete the table Foot, if one exists
+ *
+ * \param element The dom_html_table_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_element_delete_t_foot(
+ dom_html_table_element *element)
+{
+ dom_html_table_section_element *t_foot;
+ dom_html_table_element_get_t_foot(element, &t_foot);
+ _dom_node_remove_child((dom_node_internal *)element,
+ (dom_node_internal *)t_foot,
+ (dom_node_internal **)&t_foot);
+ element->t_foot = NULL;
+ return DOM_NO_ERR;
+}
+
+/**
+ * Get or Create the table Head
+ *
+ * \param element The dom_html_table_element object
+ * \param t_head The Status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_element_create_t_head(
+ dom_html_table_element *element,
+ dom_html_element **t_head)
+{
+ dom_html_table_element_get_t_head(element,
+ (dom_html_table_section_element **)t_head);
+ if((*t_head) == NULL) {
+ dom_exception exp;
+ dom_html_document *doc = (dom_html_document *)
+ ((dom_node_internal *) element)->owner;
+ exp = _dom_html_table_section_element_create(doc,
+ doc->memoised[hds_THEAD],
+ ((dom_node_internal *)element)->namespace,
+ ((dom_node_internal *)element)->prefix,
+ (dom_html_table_section_element **)t_head);
+ if(exp != DOM_NO_ERR) {
+ return exp;
+ }
+ _dom_node_append_child((dom_node_internal *)element,
+ (dom_node_internal *)*t_head,
+ (dom_node_internal **)t_head);
+ element->t_head = (dom_html_table_section_element *)*t_head;
+
+ }
+ return DOM_NO_ERR;
+}
+
+/**
+ * Delete the table Head, if one exists
+ *
+ * \param element The dom_html_table_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_element_delete_t_head(
+ dom_html_table_element *element)
+{
+ dom_html_table_section_element *t_head;
+ dom_html_table_element_get_t_head(element, &t_head);
+ _dom_node_remove_child((dom_node_internal *)element,
+ (dom_node_internal *)t_head,
+ (dom_node_internal **)&t_head);
+ element->t_head = NULL;
+ return DOM_NO_ERR;
+}
+
+/**
+ * Get or Create the table Body
+ *
+ * \param element The dom_html_table_element object
+ * \param t_head The Status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_element_create_t_body(
+ dom_html_table_element *element,
+ dom_html_table_section_element **t_body)
+{
+ dom_html_collection *t_bodies;
+ uint32_t len;
+ dom_html_table_element_get_t_bodies(element,
+ &t_bodies);
+ dom_html_collection_get_length(t_bodies,
+ &len);
+
+ if(len == 0) {
+ dom_exception exp;
+ dom_html_document *doc = (dom_html_document *)
+ ((dom_node_internal *) element)->owner;
+ exp = _dom_html_table_section_element_create(doc,
+ doc->memoised[hds_TBODY],
+ ((dom_node_internal *)element)->namespace,
+ ((dom_node_internal *)element)->prefix,
+ t_body);
+ if(exp != DOM_NO_ERR) {
+ return exp;
+ }
+ return _dom_node_append_child((dom_node_internal *)element,
+ (dom_node_internal *)*t_body,
+ (dom_node_internal **)t_body);
+
+ } else {
+ return dom_html_collection_item(t_bodies,
+ 0, (dom_node **)t_body);
+ }
+ return DOM_NO_ERR;
+}
+/**
+ * Insert a new Row into the table
+ *
+ * \param element The dom_html_table_element object
+ * \param index The Index to insert the Row
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_element_insert_row(
+ dom_html_table_element *element,
+ int32_t index,
+ dom_html_element **row)
+{
+ dom_exception exp;
+ dom_html_collection* rows;
+ uint32_t len;
+ dom_html_document *doc = (dom_html_document *)
+ ((dom_node_internal *) element)->owner;
+
+ exp = dom_html_table_element_get_rows(element,
+ &rows);
+ if(exp != DOM_NO_ERR) {
+ return exp;
+ }
+ exp = dom_html_collection_get_length(rows,
+ &len);
+
+ exp = _dom_html_table_row_element_create(doc,
+ ((dom_node_internal *)element)->namespace,
+ ((dom_node_internal *)element)->prefix,
+ (dom_html_table_row_element **)row);
+ if(exp != DOM_NO_ERR) {
+ return exp;
+ }
+
+ if(index > (int32_t)len || index < -1) {
+ return DOM_INDEX_SIZE_ERR;
+ } else if(len == 0) {
+ dom_html_table_section_element *new_body;
+ exp = dom_html_table_element_create_t_body(element,
+ &new_body);
+ if(exp != DOM_NO_ERR) {
+ return exp;
+ }
+
+ return _dom_node_append_child((dom_node_internal *)new_body,
+ (dom_node_internal *)*row,
+ (dom_node_internal **)row);
+
+ } else {
+ if(index ==-1) {
+ index = (int32_t)len;
+ }
+
+ dom_html_collection* rows;
+ dom_html_table_section_element *t_head;
+ dom_html_table_section_element *t_foot;
+ uint32_t window_len = 0, section_len;
+
+ dom_html_table_element_get_t_head(element, &t_head);
+ dom_html_table_section_element_get_rows(t_head, &rows);
+ dom_html_collection_get_length(rows, &section_len);
+
+ if(window_len + section_len > (uint32_t)index ||
+ window_len + section_len == len) {
+ return dom_html_table_section_element_insert_row(t_head,
+ index-window_len, row);
+ }
+
+ window_len += section_len;
+
+ dom_node_internal *n = (dom_node_internal *)element;
+
+ for (n = n->first_child; n != NULL; n = n->next) {
+ if((n->type == DOM_ELEMENT_NODE) &&
+ dom_string_caseless_isequal(doc->memoised[hds_TBODY],n->name)) {
+
+ dom_html_table_section_element_get_rows((dom_html_table_section_element *)n, &rows);
+ dom_html_collection_get_length(rows, &section_len);
+
+ if(window_len + section_len > (uint32_t)index ||
+ window_len + section_len == len) {
+ return dom_html_table_section_element_insert_row(
+ (dom_html_table_section_element *)n,
+ index-window_len, row);
+ }
+
+ window_len += section_len;
+ }
+ }
+ dom_html_table_element_get_t_foot(element, &t_foot);
+ dom_html_table_section_element_get_rows(t_foot, &rows);
+ dom_html_collection_get_length(rows, &section_len);
+ if(window_len + section_len > (uint32_t)index ||
+ window_len +section_len == len) {
+ return dom_html_table_section_element_insert_row(t_foot,
+ index-window_len, row);
+ }
+ return DOM_INDEX_SIZE_ERR;
+ }
+}
+/**
+ * Delete the table Head, if one exists
+ *
+ * \param element The dom_html_table_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_element_delete_row(
+ dom_html_table_element *element,
+ int32_t index)
+{
+ dom_exception exp;
+ dom_html_collection* rows;
+ uint32_t len;
+ dom_html_document *doc = (dom_html_document *)
+ ((dom_node_internal *) element)->owner;
+
+ exp = dom_html_table_element_get_rows(element,
+ &rows);
+ if(exp != DOM_NO_ERR) {
+ return exp;
+ }
+ exp = dom_html_collection_get_length(rows,
+ &len);
+
+ if(exp != DOM_NO_ERR) {
+ return exp;
+ }
+
+ if(index >= (int32_t)len || index < -1 || len ==0) {
+ return DOM_INDEX_SIZE_ERR;
+ } else {
+ if(index ==-1) {
+ index = (int32_t)len-1;
+ }
+ dom_html_collection* rows;
+ dom_html_table_section_element *t_head;
+ dom_html_table_section_element *t_foot;
+ uint32_t window_len = 0, section_len;
+ dom_html_table_element_get_t_head(element, &t_head);
+ dom_html_table_section_element_get_rows(t_head, &rows);
+ dom_html_collection_get_length(rows, &section_len);
+ if(window_len + section_len > (uint32_t)index) {
+ return dom_html_table_section_element_delete_row(t_head,
+ index-window_len);
+ }
+ window_len += section_len;
+ dom_node_internal *n = (dom_node_internal *)element;
+ for (n = n->first_child; n != NULL; n = n->next) {
+ if((n->type == DOM_ELEMENT_NODE) &&
+ dom_string_caseless_isequal(doc->memoised[hds_TBODY],n->name)) {
+ dom_html_table_section_element_get_rows((dom_html_table_section_element *)n, &rows);
+ dom_html_collection_get_length(rows, &section_len);
+ if(window_len + section_len > (uint32_t)index) {
+ return dom_html_table_section_element_delete_row(
+ (dom_html_table_section_element *)n,
+ index-window_len);
+ }
+ window_len += section_len;
+ }
+ }
+ exp = dom_html_table_element_get_t_foot(element, &t_foot);
+ dom_html_table_section_element_get_rows(t_foot, &rows);
+ dom_html_collection_get_length(rows, &section_len);
+ if(window_len + section_len > (uint32_t)index) {
+ return dom_html_table_section_element_delete_row(t_foot,
+ index-window_len);
+ }
+ return DOM_INDEX_SIZE_ERR;
+ }
+
+}
diff --git a/src/html/html_table_element.h b/src/html/html_table_element.h
index 2e182d5..caabbe8 100644
--- a/src/html/html_table_element.h
+++ b/src/html/html_table_element.h
@@ -3,5 +3,61 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_table_element_h_
+#define dom_internal_html_table_element_h_
+
+#include <dom/html/html_table_element.h>
+#include "html/html_element.h"
+
+struct dom_html_table_element {
+ struct dom_html_element base;
+ /**< The base class */
+ dom_html_table_caption_element* caption;
+ /**< The caption associated with the table*/
+ dom_html_table_section_element* t_head;
+ /**< The thead element associated with the table*/
+ dom_html_table_section_element* t_foot;
+ /**< The tfoot element associated with the table*/
+};
+
+/* Create a dom_html_table_element object */
+dom_exception _dom_html_table_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_element **ele);
+
+/* Initialise a dom_html_table_element object */
+dom_exception _dom_html_table_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_element *ele);
+
+/* Finalise a dom_html_table_element object */
+void _dom_html_table_element_finalise(struct dom_html_table_element *ele);
+
+/* Destroy a dom_html_table_element object */
+void _dom_html_table_element_destroy(struct dom_html_table_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_table_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_table_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_table_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_TABLE_ELEMENT_PROTECT_VTABLE \
+ _dom_html_table_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_TABLE_ELEMENT \
+ _dom_virtual_html_table_element_destroy, \
+ _dom_html_table_element_copy
+
+#endif
+
+bool table_rows_callback(struct dom_node_internal *node, void *ctx);
+bool table_t_bodies_callback(struct dom_node_internal *node, void *ctx);
+dom_exception dom_html_table_element_create_t_body(
+ dom_html_table_element *element,
+ dom_html_table_section_element **t_body);
diff --git a/src/html/html_tablecaption_element.c b/src/html/html_tablecaption_element.c
index 2e182d5..d2c3fc6 100644
--- a/src/html/html_tablecaption_element.c
+++ b/src/html/html_tablecaption_element.c
@@ -3,5 +3,158 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_tablecaption_element.h>
+
+#include "html/html_document.h"
+#include "html/html_tablecaption_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_TABLE_CAPTION_ELEMENT
+ },
+ DOM_HTML_TABLE_CAPTION_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_table_caption_element object
+ *
+ * \table_caption doc The document object
+ * \table_caption ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_caption_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_caption_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_table_caption_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_table_caption_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_table_caption_element object
+ *
+ * \table_caption doc The document object
+ * \table_caption ele The dom_html_table_caption_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_caption_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_caption_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_CAPTION],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_table_caption_element object
+ *
+ * \table_caption ele The dom_html_table_caption_element object
+ */
+void _dom_html_table_caption_element_finalise(struct dom_html_table_caption_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_table_caption_element object
+ *
+ * \table_caption ele The dom_html_table_caption_element object
+ */
+void _dom_html_table_caption_element_destroy(struct dom_html_table_caption_element *ele)
+{
+ _dom_html_table_caption_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_table_caption_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_table_caption_element_destroy(dom_node_internal *node)
+{
+ _dom_html_table_caption_element_destroy((struct dom_html_table_caption_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_table_caption_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_table_caption_element_get_##attr( \
+ dom_html_table_caption_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)-> \
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_table_caption_element_set_##attr( \
+ dom_html_table_caption_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)-> \
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+SIMPLE_GET_SET(align);
diff --git a/src/html/html_tablecaption_element.h b/src/html/html_tablecaption_element.h
index 2e182d5..b1cfd3b 100644
--- a/src/html/html_tablecaption_element.h
+++ b/src/html/html_tablecaption_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_table_caption_element_h_
+#define dom_internal_html_table_caption_element_h_
+
+#include <dom/html/html_tablecaption_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_table_caption_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_table_caption_element object */
+dom_exception _dom_html_table_caption_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_caption_element **ele);
+
+/* Initialise a dom_html_table_caption_element object */
+dom_exception _dom_html_table_caption_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_caption_element *ele);
+
+/* Finalise a dom_html_table_caption_element object */
+void _dom_html_table_caption_element_finalise(struct dom_html_table_caption_element *ele);
+
+/* Destroy a dom_html_table_caption_element object */
+void _dom_html_table_caption_element_destroy(struct dom_html_table_caption_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_table_caption_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_table_caption_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_table_caption_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_TABLE_CAPTION_ELEMENT_PROTECT_VTABLE \
+ _dom_html_table_caption_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_TABLE_CAPTION_ELEMENT \
+ _dom_virtual_html_table_caption_element_destroy, \
+ _dom_html_table_caption_element_copy
+
+#endif
diff --git a/src/html/html_tablecell_element.c b/src/html/html_tablecell_element.c
index 2e182d5..cc596c1 100644
--- a/src/html/html_tablecell_element.c
+++ b/src/html/html_tablecell_element.c
@@ -3,5 +3,311 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_tablecell_element.h>
+
+#include "html/html_document.h"
+#include "html/html_tablecell_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_TABLE_CELL_ELEMENT
+ },
+ DOM_HTML_TABLE_CELL_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_table_cell_element table_cell
+ *
+ * \param doc The document table_cell
+ * \param ele The returned element table_cell
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_cell_element_create(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_cell_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_table_cell_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_table_cell_element_initialise(doc, tag_name, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_table_cell_element table_cell
+ *
+ * \param doc The document table_cell
+ * \param ele The dom_html_table_cell_element table_cell
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_cell_element_initialise(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_cell_element *ele)
+{
+ ele->id = -1;
+ return _dom_html_element_initialise(doc, &ele->base,
+ tag_name,
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_table_cell_element table_cell
+ *
+ * \param ele The dom_html_table_cell_element table_cell
+ */
+void _dom_html_table_cell_element_finalise(struct dom_html_table_cell_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_table_cell_element table_cell
+ *
+ * \param ele The dom_html_table_cell_element table_cell
+ */
+void _dom_html_table_cell_element_destroy(struct dom_html_table_cell_element *ele)
+{
+ _dom_html_table_cell_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_table_cell_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_table_cell_element_destroy(dom_node_internal *node)
+{
+ _dom_html_table_cell_element_destroy((struct dom_html_table_cell_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_table_cell_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_table_cell_element_get_##attr( \
+ dom_html_table_cell_element *element, \
+ dom_string **attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_table_cell_element_set_##attr( \
+ dom_html_table_cell_element *element, \
+ dom_string *attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(abbr);
+SIMPLE_GET_SET(align);
+SIMPLE_GET_SET(axis);
+SIMPLE_GET_SET(bg_color);
+SIMPLE_GET_SET(ch);
+SIMPLE_GET_SET(ch_off);
+SIMPLE_GET_SET(headers);
+SIMPLE_GET_SET(height);
+SIMPLE_GET_SET(scope);
+SIMPLE_GET_SET(v_align);
+SIMPLE_GET_SET(width);
+
+/**
+ * Get the cell_index property
+ *
+ * \param table_cell The dom_html_table_cell_element object
+ * \param cell_index The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_get_cell_index(
+ dom_html_table_cell_element *table_cell, int32_t *cell_index)
+{
+ if(table_cell->id == -1) {
+ dom_node_internal *n = ((dom_node_internal *)table_cell)->parent;
+ dom_html_document *doc = (dom_html_document *)(n->owner);
+ int32_t cnt = 0;
+ while(n != NULL) {
+ if(dom_string_caseless_isequal(doc->memoised[hds_TR],n->name)) {
+ break;
+ }
+ n = n->parent;
+ }
+ dom_node_internal *root = n;
+ while(n != NULL) {
+ if(n == (dom_node_internal *)table_cell) {
+ break;
+ } else if((n->type == DOM_ELEMENT_NODE) &&
+ (dom_string_caseless_isequal(doc->memoised[hds_TD],n->name) ||
+ dom_string_caseless_isequal(doc->memoised[hds_TH],n->name))) {
+ ((dom_html_table_cell_element *)n)->id = cnt;
+ cnt += 1;
+ }
+ if(n->first_child != NULL) {
+ n = n->first_child;
+ } else if(n->next != NULL) {
+ n = n->next;
+ } else {
+ /* No children and siblings */
+ struct dom_node_internal *parent = n->parent;
+ while (n == parent->last_child &&
+ n != root) {
+ n = parent;
+ parent = parent->parent;
+ }
+
+ if(n == root) {
+ n = NULL;
+ } else {
+ n = n->next;
+ }
+ }
+ }
+ table_cell->id = cnt;
+ }
+ *cell_index = table_cell->id;
+ return DOM_NO_ERR;
+}
+
+/**
+ * Get the col_span property
+ *
+ * \param table_cell The dom_html_table_cell_element object
+ * \param no_wrap The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_get_col_span(
+ dom_html_table_cell_element *table_cell, int32_t *col_span)
+{
+ return dom_html_element_get_int32_t_property(&table_cell->base, "colspan",
+ SLEN("colspan"), col_span);
+}
+
+/**
+ * Set the col_span property
+ *
+ * \param table_cell The dom_html_table_cell_element object
+ * \param no_wrap The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_set_col_span(
+ dom_html_table_cell_element *table_cell, uint32_t col_span)
+{
+ return dom_html_element_set_int32_t_property(&table_cell->base, "colspan",
+ SLEN("colspan"), col_span);
+}
+
+/**
+ * Get the row_span property
+ *
+ * \param table_cell The dom_html_table_cell_element object
+ * \param no_wrap The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_get_row_span(
+ dom_html_table_cell_element *table_cell, int32_t *row_span)
+{
+ return dom_html_element_get_int32_t_property(&table_cell->base, "rowspan",
+ SLEN("rowspan"), row_span);
+}
+
+/**
+ * Set the row_span property
+ *
+ * \param table_cell The dom_html_table_cell_element object
+ * \param no_wrap The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_set_row_span(
+ dom_html_table_cell_element *table_cell, uint32_t row_span)
+{
+ return dom_html_element_set_int32_t_property(&table_cell->base, "rowspan",
+ SLEN("rowspan"), row_span);
+}
+
+/**
+ * Get the no_wrap property
+ *
+ * \param ele The dom_html_table_cell_element object
+ * \param no_wrap The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_get_no_wrap(dom_html_table_cell_element *ele,
+ bool *no_wrap)
+{
+ return dom_html_element_get_bool_property(&ele->base, "nowrap",
+ SLEN("nowrap"), no_wrap);
+}
+
+/**
+ * Set the no_wrap property
+ *
+ * \param ele The dom_html_table_cell_element object
+ * \param no_wrap The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_set_no_wrap(dom_html_table_cell_element *ele,
+ bool no_wrap)
+{
+ return dom_html_element_set_bool_property(&ele->base, "nowrap",
+ SLEN("nowrap"), no_wrap);
+}
+
diff --git a/src/html/html_tablecell_element.h b/src/html/html_tablecell_element.h
index 2e182d5..801c3c0 100644
--- a/src/html/html_tablecell_element.h
+++ b/src/html/html_tablecell_element.h
@@ -3,5 +3,52 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_table_cell_element_h_
+#define dom_internal_html_table_cell_element_h_
+
+#include <dom/html/html_tablecell_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_table_cell_element {
+ struct dom_html_element base;
+ /**< The base class */
+ int32_t id;
+ /**< The Index Associated with the cell*/
+};
+
+/* Create a dom_html_table_cell_element object */
+dom_exception _dom_html_table_cell_element_create(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_cell_element **ele);
+
+/* Initialise a dom_html_table_cell_element object */
+dom_exception _dom_html_table_cell_element_initialise(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_cell_element *ele);
+
+/* Finalise a dom_html_table_cell_element object */
+void _dom_html_table_cell_element_finalise(struct dom_html_table_cell_element *ele);
+
+/* Destroy a dom_html_table_cell_element object */
+void _dom_html_table_cell_element_destroy(struct dom_html_table_cell_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_table_cell_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_table_cell_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_table_cell_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_TABLE_CELL_ELEMENT_PROTECT_VTABLE \
+ _dom_html_table_cell_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_TABLE_CELL_ELEMENT \
+ _dom_virtual_html_table_cell_element_destroy, \
+ _dom_html_table_cell_element_copy
+
+#endif
diff --git a/src/html/html_tablecol_element.c b/src/html/html_tablecol_element.c
index 2e182d5..cf21a24 100644
--- a/src/html/html_tablecol_element.c
+++ b/src/html/html_tablecol_element.c
@@ -3,5 +3,186 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar<rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_tablecol_element.h>
+
+#include "html/html_document.h"
+#include "html/html_tablecol_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_TABLE_COL_ELEMENT
+ },
+ DOM_HTML_TABLE_COL_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_table_col_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_col_element_create(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_col_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_table_col_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_table_col_element_initialise(doc, tag_name, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_table_col_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_table_col_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_col_element_initialise(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_col_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ tag_name,
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_table_col_element object
+ *
+ * \param ele The dom_html_table_col_element object
+ */
+void _dom_html_table_col_element_finalise(struct dom_html_table_col_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_table_col_element object
+ *
+ * \param ele The dom_html_table_col_element object
+ */
+void _dom_html_table_col_element_destroy(struct dom_html_table_col_element *ele)
+{
+ _dom_html_table_col_element_finalise(ele);
+ free(ele);
+}
+
+/**
+ * Get the width Property
+ *
+ * \param table_col The dom_html_table_col_element object
+ */
+dom_exception dom_html_table_col_element_get_span(
+ dom_html_table_col_element *table_col, int32_t *span)
+{
+ return dom_html_element_get_int32_t_property(&table_col->base, "span",
+ SLEN("span"), span);
+}
+
+/**
+ * Set the width Property
+ *
+ * \param table_col The dom_html_table_col_element object
+ */
+dom_exception dom_html_table_col_element_set_span(
+ dom_html_table_col_element *table_col, uint32_t span)
+{
+ return dom_html_element_set_int32_t_property(&table_col->base, "span",
+ SLEN("span"), span);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_table_col_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_table_col_element_destroy(dom_node_internal *node)
+{
+ _dom_html_table_col_element_destroy((struct dom_html_table_col_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_table_col_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_table_col_element_get_##attr( \
+ dom_html_table_col_element *element, \
+ dom_string **attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)-> \
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_table_col_element_set_##attr( \
+ dom_html_table_col_element *element, \
+ dom_string *attr) \
+ { \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)-> \
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+ }
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+SIMPLE_GET_SET(align);
+SIMPLE_GET_SET(ch);
+SIMPLE_GET_SET(ch_off);
+SIMPLE_GET_SET(v_align);
+SIMPLE_GET_SET(width);
diff --git a/src/html/html_tablecol_element.h b/src/html/html_tablecol_element.h
index 2e182d5..a8e6fa7 100644
--- a/src/html/html_tablecol_element.h
+++ b/src/html/html_tablecol_element.h
@@ -3,5 +3,50 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_table_col_element_h_
+#define dom_internal_html_table_col_element_h_
+
+#include <dom/html/html_tablecol_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_table_col_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_table_col_element object */
+dom_exception _dom_html_table_col_element_create(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_col_element **ele);
+
+/* Initialise a dom_html_table_col_element object */
+dom_exception _dom_html_table_col_element_initialise(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_col_element *ele);
+
+/* Finalise a dom_html_table_col_element object */
+void _dom_html_table_col_element_finalise(struct dom_html_table_col_element *ele);
+
+/* Destroy a dom_html_table_col_element object */
+void _dom_html_table_col_element_destroy(struct dom_html_table_col_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_table_col_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_table_col_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_table_col_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_TABLE_COL_ELEMENT_PROTECT_VTABLE \
+ _dom_html_table_col_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_TABLE_COL_ELEMENT \
+ _dom_virtual_html_table_col_element_destroy, \
+ _dom_html_table_col_element_copy
+
+#endif
diff --git a/src/html/html_tablerow_element.c b/src/html/html_tablerow_element.c
index 2e182d5..fb3e27b 100644
--- a/src/html/html_tablerow_element.c
+++ b/src/html/html_tablerow_element.c
@@ -3,5 +3,373 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_tablerow_element.h>
+#include <dom/html/html_table_element.h>
+
+#include "html/html_document.h"
+#include "html/html_tablerow_element.h"
+#include "html/html_collection.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_TABLE_ROW_ELEMENT
+ },
+ DOM_HTML_TABLE_ROW_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_table_row_element table_row
+ *
+ * \param doc The document table_row
+ * \param ele The returned element table_row
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_row_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_row_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_table_row_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_table_row_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_table_row_element table_row
+ *
+ * \param doc The document table_row
+ * \param ele The dom_html_table_row_element table_row
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_row_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_row_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_TR],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_table_row_element table_row
+ *
+ * \param ele The dom_html_table_row_element table_row
+ */
+void _dom_html_table_row_element_finalise(struct dom_html_table_row_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_table_row_element table_row
+ *
+ * \param ele The dom_html_table_row_element table_row
+ */
+void _dom_html_table_row_element_destroy(struct dom_html_table_row_element *ele)
+{
+ _dom_html_table_row_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_table_row_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_table_row_element_destroy(dom_node_internal *node)
+{
+ _dom_html_table_row_element_destroy((struct dom_html_table_row_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_table_row_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_table_row_element_get_##attr( \
+ dom_html_table_row_element *element, \
+ dom_string **attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_table_row_element_set_##attr( \
+ dom_html_table_row_element *element, \
+ dom_string *attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(align);
+SIMPLE_GET_SET(bg_color);
+SIMPLE_GET_SET(ch);
+SIMPLE_GET_SET(ch_off);
+SIMPLE_GET_SET(v_align);
+
+/**
+ * Get the index of the Row in logical order
+ *
+ * \param element The dom_html_table_row_element object
+ * \param index The Status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_row_element_get_row_index(
+ dom_html_table_row_element *table_row, int32_t *row_index)
+{
+ dom_node_internal *n = ((dom_node_internal *)table_row)->parent;
+ dom_node_internal *parent = n;
+ dom_html_document *doc = (dom_html_document *) ((dom_node_internal *) table_row)->owner;
+ uint32_t count = 0;
+ for(n = n->first_child; n != (dom_node_internal *)table_row;
+ n = n->next) {
+ if(n->type == DOM_ELEMENT_NODE &&
+ dom_string_caseless_isequal(n->name,doc->memoised[hds_TR])) {
+ count += 1;
+ }
+ }
+
+ if(dom_string_caseless_isequal((parent->parent)->name, doc->memoised[hds_TABLE]) &&
+ dom_string_caseless_isequal(parent->name, doc->memoised[hds_THEAD])
+ ) {
+ *row_index = count;
+ }else if(dom_string_caseless_isequal((parent->parent)->name, doc->memoised[hds_TABLE]) &&
+ (dom_string_caseless_isequal(parent->name, doc->memoised[hds_TBODY]) ||
+ dom_string_caseless_isequal(parent->name, doc->memoised[hds_TFOOT]))) {
+ uint32_t len;
+ n = parent->parent;
+ dom_html_table_section_element *t_head;
+ dom_html_collection *rows;
+ dom_html_table_element_get_t_head(
+ (dom_html_table_element *)(parent->parent),
+ &t_head);
+ dom_html_table_section_element_get_rows(t_head,
+ &rows);
+ dom_html_collection_get_length(rows,
+ &len);
+ count += len;
+ for(n = n->first_child;n != parent && n != NULL;
+ n = n->next) {
+ if(dom_string_caseless_isequal(n->name, doc->memoised[hds_TBODY])) {
+ dom_html_table_section_element_get_rows(
+ (dom_html_table_section_element *)n,
+ &rows);
+ dom_html_collection_get_length(row