about summary refs log tree commit diff stats
path: root/src/html/enums.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/html/enums.nim')
-rw-r--r--src/html/enums.nim22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/html/enums.nim b/src/html/enums.nim
index 24f496bb..67ae4e76 100644
--- a/src/html/enums.nim
+++ b/src/html/enums.nim
@@ -16,6 +16,21 @@ type
   ButtonType* = enum
     BUTTON_SUBMIT, BUTTON_RESET, BUTTON_BUTTON
 
+  NodeType* = enum
+    ELEMENT_NODE = 1,
+    ATTRIBUTE_NODE = 2,
+    TEXT_NODE = 3,
+    CDATA_SECTION_NODE = 4,
+    ENTITY_REFERENCE_NODE = 5,
+    ENTITY_NODE = 6
+    PROCESSING_INSTRUCTION_NODE = 7,
+    COMMENT_NODE = 8,
+    DOCUMENT_NODE = 9,
+    DOCUMENT_TYPE_NODE = 10,
+    DOCUMENT_FRAGMENT_NODE = 11,
+    NOTATION_NODE = 12
+
+
 #TODO support all the other ones
 const SupportedFormAssociatedElements* = {
   TAG_BUTTON, TAG_INPUT, TAG_SELECT, TAG_TEXTAREA
@@ -31,7 +46,8 @@ const AutocapitalizeInheritingElements* = {
 
 const LabelableElements* = {
   # input only if type not hidden
-  TAG_BUTTON, TAG_INPUT, TAG_METER, TAG_OUTPUT, TAG_PROGRESS, TAG_SELECT, TAG_TEXTAREA
+  TAG_BUTTON, TAG_INPUT, TAG_METER, TAG_OUTPUT, TAG_PROGRESS, TAG_SELECT,
+  TAG_TEXTAREA
 }
 
 # https://html.spec.whatwg.org/multipage/syntax.html#void-elements
@@ -40,6 +56,10 @@ const VoidElements* = {
   TAG_LINK, TAG_META, TAG_SOURCE, TAG_TRACK, TAG_WBR
 }
 
+const ResettableElements* = {
+  TAG_INPUT, TAG_OUTPUT, TAG_SELECT, TAG_TEXTAREA
+}
+
 func getInputTypeMap(): Table[string, InputType] =
   for i in InputType:
     let enumname = $InputType(i)