[516758] HTML Editor doesn't recognize the HTML5 "main" tag

Also add the "autocomplete", "inputmode", and "is" global attributes

Change-Id: I6251f8adc8c4a2633484faab958f359348562abe
Signed-off-by: Nitin Dahyabhai <nitind@us.ibm.com>
diff --git a/web/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF b/web/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
index c903ee2..37c0123 100644
--- a/web/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
+++ b/web/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.html.core; singleton:=true
-Bundle-Version: 1.3.100.qualifier
+Bundle-Version: 1.3.200.qualifier
 Bundle-Activator: org.eclipse.wst.html.core.internal.HTMLCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/web/bundles/org.eclipse.wst.html.core/pom.xml b/web/bundles/org.eclipse.wst.html.core/pom.xml
index 14d1972..79472e9 100644
--- a/web/bundles/org.eclipse.wst.html.core/pom.xml
+++ b/web/bundles/org.eclipse.wst.html.core/pom.xml
@@ -21,6 +21,6 @@
 
   <groupId>org.eclipse.webtools.sourceediting</groupId>
   <artifactId>org.eclipse.wst.html.core</artifactId>
-  <version>1.3.100-SNAPSHOT</version>
+  <version>1.3.200-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 </project>
diff --git a/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java b/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java
index efad0aa..65553a6 100644
--- a/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java
+++ b/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java
@@ -24,6 +24,7 @@
 	/** html5 core attribs */
 	private static final String[] CORE = {
 		ATTR_NAME_ACCESSKEY, 
+		ATTR_NAME_AUTOCAPITALIZE,
 		ATTR_NAME_CLASS, 
 		ATTR_NAME_CONTENT_EDITABLE, 
 		ATTR_NAME_CONTEXT_MENU, 
@@ -32,8 +33,11 @@
 		ATTR_NAME_DROPZONE,
 		ATTR_NAME_HIDDEN, 
 		ATTR_NAME_ID, 
+		ATTR_NAME_INPUTMODE,
+		ATTR_NAME_IS,
 		ATTR_NAME_LANG, 
 		ATTR_NAME_ROLE,
+		ATTR_NAME_SLOT,
 		ATTR_NAME_SPELLCHECK,
 		ATTR_NAME_STYLE, 
 		ATTR_NAME_TABINDEX, 
@@ -133,6 +137,14 @@
 			atype.setEnumValues(values);
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
 		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOCAPITALIZE)) {
+			// (contenteditable (EMPTY|TRUE|FALSE|INHERIT) TRUE)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_ON, ATTR_VALUE_OFF, ATTR_VALUE_NONE, ATTR_VALUE_SENTENCES, ATTR_VALUE_WORDS, ATTR_VALUE_CHARACTERS};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_NONE);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOCAPITALIZE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTENT_EDITABLE)) {
 			// (contenteditable (EMPTY|TRUE|FALSE|INHERIT) TRUE)
 			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
@@ -189,9 +201,16 @@
 			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_HIGH, atype, CMAttributeDeclaration.OPTIONAL);
 		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_OPTIMUM)) {
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_OPTIMUM, atype, CMAttributeDeclaration.OPTIONAL);
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_INPUTMODE)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_NONE, ATTR_VALUE_TEXT, ATTR_VALUE_DECIMAL, ATTR_VALUE_NUMERIC, ATTR_VALUE_TEL, ATTR_VALUE_SEARCH, ATTR_VALUE_EMAIL, ATTR_VALUE_URL};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_INPUTMODE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_IS)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_IS, atype, CMAttributeDeclaration.OPTIONAL);
 		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_MIN)) {
 			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
@@ -206,6 +225,10 @@
 			atype.setEnumValues(new String[] { ATTR_NAME_OPEN });
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_OPEN, atype, CMAttributeDeclaration.OPTIONAL);
 		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_OPTIMUM)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_OPTIMUM, atype, CMAttributeDeclaration.OPTIONAL);
+		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_PUBDATE)) {
 			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			atype.setEnumValues(new String[] { ATTR_NAME_PUBDATE });
@@ -216,6 +239,11 @@
 			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_ROLE, atype, CMAttributeDeclaration.OPTIONAL);
 		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_SLOT)) {
+			// (span NUMBER 1)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SLOT, atype, CMAttributeDeclaration.OPTIONAL);
+		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_SPELLCHECK)) {
 			// (spellcheck (EMPTY|TRUE|FALSE) TRUE)
 			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
@@ -561,7 +589,7 @@
 	}
 
 	public void getCore(CMNamedNodeMapImpl declarations) {
-		Iterator names = Arrays.asList(CORE).iterator();
+		Iterator<String> names = Arrays.asList(CORE).iterator();
 		getDeclarations(declarations, names);
 	}
 
diff --git a/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java b/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java
index 65e6cb3..d3af7a0 100644
--- a/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java
+++ b/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2019 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
  * which accompanies this distribution, and is available at
@@ -60,6 +60,7 @@
 		public static final int ID_SVG =131;
 		public static final int ID_TIME =132;
 		public static final int ID_VIDEO =133;
+		public static final int ID_MAIN =134;
 
 		// D205513
 
@@ -111,7 +112,7 @@
 	/** %preformatted;. PRE */
 	private static final String[] PREFORMATTED = {PRE};
 	/** %sectioning;. ARTICLE | ASIDE | NAV | SECTION */
-	private static final String[] SECTIONING = { ARTICLE, ASIDE, NAV, SECTION };
+	private static final String[] SECTIONING = { ARTICLE, ASIDE, NAV, SECTION, MAIN };
 
 	/** %embedded;. AUDIO|CANVAS|EMBED|IFRAME|IMG|MATH|OBJECT|SVG|VIDEO */
 	private static final String[] EMBEDDED = { AUDIO, CANVAS, EMBED, IFRAME, IMG, MATH, OBJECT, SVG, VIDEO};
@@ -219,6 +220,9 @@
 			edec = new HedKEYGEN(this);
 
 		}
+		else if (elementName.equalsIgnoreCase(MAIN)) {
+			edec = new HedSectioning(HTML50Namespace.ElementName.MAIN,this);
+		}
 		else if (elementName.equalsIgnoreCase(MARK)) {
 			edec = new HedPhrase(HTML50Namespace.ElementName.MARK,this);
 
@@ -508,6 +512,7 @@
 			fNames[Ids.ID_LI] = LI;
 			fNames[Ids.ID_LINK] = LINK;
 			fNames[Ids.ID_MAP] = MAP;
+			fNames[Ids50.ID_MAIN] = MAIN;
 			fNames[Ids50.ID_MARK] = MARK;
 			fNames[Ids.ID_MARQUEE] = MARQUEE;
 			fNames[Ids50.ID_MATH] = MATH;
diff --git a/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java b/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java
index b041046..d8cbdc7 100644
--- a/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java
+++ b/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2017 IBM Corporation and others.
+ * Copyright (c) 2010, 2019 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
  * which accompanies this distribution, and is available at
@@ -28,6 +28,7 @@
 		String HEADER = "header";
 		String HGROUP = "hgroup";
 		String KEYGEN = "keygen";
+		String MAIN = "main";
 		String MARK = "mark";
 		String MATH = "math";
 		String METER = "meter";
@@ -49,11 +50,15 @@
 	String HTML50_TAG_PREFIX = "";
 
 	// global attribute names
+	String ATTR_NAME_AUTOCAPITALIZE = "autocapitalize"; // %coreattrs; //$NON-NLS-1$
 	String ATTR_NAME_CONTENT_EDITABLE = "contenteditable"; // %coreattrs; //$NON-NLS-1$
 	String ATTR_NAME_CONTEXT_MENU = "contextmenu"; // %coreattrs; //$NON-NLS-1$
 	String ATTR_NAME_DRAGGABLE = "draggable"; // %coreattrs; //$NON-NLS-1$
 	String ATTR_NAME_DROPZONE = "dropzone"; // %coreattrs; //$NON-NLS-1$
+	String ATTR_NAME_INPUTMODE = "inputmode"; //$NON-NLS-1$
+	String ATTR_NAME_IS = "is"; //$NON-NLS-1$
 	String ATTR_NAME_ROLE = "role"; // %coreattrs; //$NON_NLS-1$
+	String ATTR_NAME_SLOT = "slot"; //$NON-NLS-1$
 	String ATTR_NAME_SPELLCHECK = "spellcheck"; // %coreattrs; //$NON-NLS-1$
 	String ATTR_NAME_TRANSLATE = "translate"; // %coreattrs; //$NON-NLS-1$
 	
@@ -189,9 +194,17 @@
 	String ATTR_VALUE_COLOR = "color"; //input type //$NON-NLS-1$
 	String ATTR_VALUE_NUMBER_STRING = "number"; //input type //$NON-NLS-1$
 
+	//Input modes
+	String ATTR_VALUE_DECIMAL = "decimal"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_NUMERIC = "numeric"; //input type //$NON-NLS-1$
+
 	String ATTR_VALUE_ON = "on"; //input autocomplete //$NON-NLS-1$
 	String ATTR_VALUE_OFF = "off"; //input autocomplete //$NON-NLS-1$
 	
+	String ATTR_VALUE_CHARACTERS = "characters"; //global attr autocapitalize //$NON-NLS-1$
+	String ATTR_VALUE_SENTENCES = "sentences"; //global attr autocapitalize //$NON-NLS-1$
+	String ATTR_VALUE_WORDS = "words"; //global attr autocapitalize //$NON-NLS-1$
+
 	String ATTR_VALUE_PUT = "PUT"; //input formmethod //$NON-NLS-1$
 	String ATTR_VALUE_DELETE = "DELETE"; //input formmethod //$NON-NLS-1$
 	
diff --git a/web/tests/org.eclipse.wst.html.core.tests/META-INF/MANIFEST.MF b/web/tests/org.eclipse.wst.html.core.tests/META-INF/MANIFEST.MF
index eff4602..2f2adb9 100644
--- a/web/tests/org.eclipse.wst.html.core.tests/META-INF/MANIFEST.MF
+++ b/web/tests/org.eclipse.wst.html.core.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.wst.html.core.tests;singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.1.100.qualifier
 Bundle-Activator: org.eclipse.wst.html.core.tests.HTMLCoreTestsPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
diff --git a/web/tests/org.eclipse.wst.html.core.tests/pom.xml b/web/tests/org.eclipse.wst.html.core.tests/pom.xml
index 5d08430..61dbac7 100644
--- a/web/tests/org.eclipse.wst.html.core.tests/pom.xml
+++ b/web/tests/org.eclipse.wst.html.core.tests/pom.xml
@@ -21,7 +21,7 @@
 
   <groupId>org.eclipse.webtools.sourceediting</groupId>
   <artifactId>org.eclipse.wst.html.core.tests</artifactId>
-  <version>1.1.0-SNAPSHOT</version>
+  <version>1.1.100-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <properties>
diff --git a/web/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/html5/model/HTML5ContentModelTest.java b/web/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/html5/model/HTML5ContentModelTest.java
index 82b4bdf..6a21a17 100644
--- a/web/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/html5/model/HTML5ContentModelTest.java
+++ b/web/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/html5/model/HTML5ContentModelTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2017 IBM Corporation and others.
+ * Copyright (c) 2010, 2019 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
  * which accompanies this distribution, and is available at
@@ -43,8 +43,8 @@
 	private void checkAttrNames(String documentKey, String elementName, String[] attrNames) {
 		CMDocument document = HTMLCMDocumentFactory.getCMDocument(documentKey);
 		CMNode elementDeclaration = document.getElements().getNamedItem(elementName);
+		assertNotNull("no such element declaration:" + elementName, elementDeclaration);
 		assertEquals("not an element declaration:" + elementDeclaration, CMNode.ELEMENT_DECLARATION, elementDeclaration.getNodeType());
-		assertNotNull("missing element declaration:" + elementName, elementDeclaration);
 		
 		CMNamedNodeMap attributes = ((CMElementDeclaration) elementDeclaration).getAttributes();
 		
@@ -162,6 +162,10 @@
 	
 	}
 	
+	public void testAttributesOnHTML5Main() {
+		checkAttrNames(CMDocType.HTML5_DOC_TYPE, HTML50Namespace.ElementName.MAIN, getGlobalList());
+	}
+	
 	public void testAttributesOnHTML5Mark() {
 		checkAttrNames(CMDocType.HTML5_DOC_TYPE, HTML50Namespace.ElementName.MARK, getGlobalList());
 	}