From: <rb...@us...> - 2013-12-18 19:59:28
|
Revision: 8871 http://sourceforge.net/p/htmlunit/code/8871 Author: rbri Date: 2013-12-18 19:59:25 +0000 (Wed, 18 Dec 2013) Log Message: ----------- and again fixes for our javascript objects Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactory.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLElementsTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLParser2Test.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java Added Paths: ----------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArticle.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAside.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigure.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFooter.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeader.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMark.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNav.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSection.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactory.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactory.java 2013-12-18 12:08:40 UTC (rev 8870) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactory.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -54,7 +54,8 @@ * You can generate your own test cases by looking into TestSource.generateTestForHtmlElements */ static final List<String> SUPPORTED_TAGS_ = Arrays.asList(HtmlAbbreviated.TAG_NAME, HtmlAcronym.TAG_NAME, - HtmlAnchor.TAG_NAME, HtmlAddress.TAG_NAME, HtmlApplet.TAG_NAME, HtmlArea.TAG_NAME, HtmlAudio.TAG_NAME, + HtmlAnchor.TAG_NAME, HtmlAddress.TAG_NAME, HtmlApplet.TAG_NAME, HtmlArea.TAG_NAME, + HtmlArticle.TAG_NAME, HtmlAside.TAG_NAME, HtmlAudio.TAG_NAME, HtmlBackgroundSound.TAG_NAME, HtmlBase.TAG_NAME, HtmlBaseFont.TAG_NAME, HtmlBidirectionalOverride.TAG_NAME, HtmlBig.TAG_NAME, HtmlBlink.TAG_NAME, HtmlBlockQuote.TAG_NAME, HtmlBody.TAG_NAME, HtmlBold.TAG_NAME, @@ -65,19 +66,21 @@ HtmlDeletedText.TAG_NAME, HtmlDirectory.TAG_NAME, HtmlDivision.TAG_NAME, HtmlDefinitionList.TAG_NAME, HtmlDefinitionTerm.TAG_NAME, HtmlEmbed.TAG_NAME, - HtmlEmphasis.TAG_NAME, HtmlFieldSet.TAG_NAME, - HtmlFont.TAG_NAME, HtmlForm.TAG_NAME, - HtmlFrame.TAG_NAME, HtmlFrameSet.TAG_NAME, HtmlHeading1.TAG_NAME, - HtmlHeading2.TAG_NAME, HtmlHeading3.TAG_NAME, - HtmlHeading4.TAG_NAME, HtmlHeading5.TAG_NAME, - HtmlHeading6.TAG_NAME, HtmlHead.TAG_NAME, + HtmlEmphasis.TAG_NAME, + HtmlFieldSet.TAG_NAME, HtmlFigure.TAG_NAME, + HtmlFont.TAG_NAME, HtmlForm.TAG_NAME, HtmlFooter.TAG_NAME, + HtmlFrame.TAG_NAME, HtmlFrameSet.TAG_NAME, + HtmlHead.TAG_NAME, HtmlHeader.TAG_NAME, + HtmlHeading1.TAG_NAME, HtmlHeading2.TAG_NAME, HtmlHeading3.TAG_NAME, + HtmlHeading4.TAG_NAME, HtmlHeading5.TAG_NAME, HtmlHeading6.TAG_NAME, HtmlHorizontalRule.TAG_NAME, HtmlHtml.TAG_NAME, HtmlInlineFrame.TAG_NAME, HtmlInlineQuotation.TAG_NAME, HtmlImage.TAG_NAME, HtmlImage.TAG_NAME2, HtmlInsertedText.TAG_NAME, HtmlIsIndex.TAG_NAME, HtmlItalic.TAG_NAME, HtmlKeyboard.TAG_NAME, HtmlLabel.TAG_NAME, HtmlLegend.TAG_NAME, HtmlListing.TAG_NAME, HtmlListItem.TAG_NAME, - HtmlLink.TAG_NAME, HtmlMap.TAG_NAME, HtmlMarquee.TAG_NAME, + HtmlLink.TAG_NAME, HtmlMap.TAG_NAME, HtmlMark.TAG_NAME, HtmlMarquee.TAG_NAME, HtmlMenu.TAG_NAME, HtmlMeta.TAG_NAME, HtmlMeter.TAG_NAME, HtmlMultiColumn.TAG_NAME, + HtmlNav.TAG_NAME, HtmlNoBreak.TAG_NAME, HtmlNoEmbed.TAG_NAME, HtmlNoFrames.TAG_NAME, HtmlNoScript.TAG_NAME, HtmlObject.TAG_NAME, HtmlOrderedList.TAG_NAME, HtmlOptionGroup.TAG_NAME, HtmlOption.TAG_NAME, HtmlParagraph.TAG_NAME, @@ -85,7 +88,7 @@ HtmlProgress.TAG_NAME, HtmlRp.TAG_NAME, HtmlRt.TAG_NAME, HtmlRuby.TAG_NAME, HtmlS.TAG_NAME, HtmlSample.TAG_NAME, - HtmlScript.TAG_NAME, HtmlSelect.TAG_NAME, HtmlSmall.TAG_NAME, + HtmlScript.TAG_NAME, HtmlSection.TAG_NAME, HtmlSelect.TAG_NAME, HtmlSmall.TAG_NAME, HtmlSource.TAG_NAME, HtmlSpacer.TAG_NAME, HtmlSpan.TAG_NAME, HtmlStrike.TAG_NAME, HtmlStrong.TAG_NAME, HtmlStyle.TAG_NAME, HtmlSubscript.TAG_NAME, HtmlSuperscript.TAG_NAME, @@ -172,6 +175,22 @@ else if (tagName.equals(HtmlArea.TAG_NAME)) { element = new HtmlArea(namespaceURI, qualifiedName, page, attributeMap); } + else if (tagName.equals(HtmlArticle.TAG_NAME)) { + if (page.getWebClient().getBrowserVersion().hasFeature(HTML5_TAGS)) { + element = new HtmlArticle(namespaceURI, qualifiedName, page, attributeMap); + } + else { + return UnknownElementFactory.instance.createElementNS(page, namespaceURI, qualifiedName, attributes); + } + } + else if (tagName.equals(HtmlAside.TAG_NAME)) { + if (page.getWebClient().getBrowserVersion().hasFeature(HTML5_TAGS)) { + element = new HtmlAside(namespaceURI, qualifiedName, page, attributeMap); + } + else { + return UnknownElementFactory.instance.createElementNS(page, namespaceURI, qualifiedName, attributes); + } + } else if (tagName.equals(HtmlAudio.TAG_NAME)) { if (page.getWebClient().getBrowserVersion().hasFeature(HTML5_TAGS)) { element = new HtmlAudio(namespaceURI, qualifiedName, page, attributeMap); @@ -273,12 +292,28 @@ else if (tagName.equals(HtmlFieldSet.TAG_NAME)) { element = new HtmlFieldSet(namespaceURI, qualifiedName, page, attributeMap); } + else if (tagName.equals(HtmlFigure.TAG_NAME)) { + if (page.getWebClient().getBrowserVersion().hasFeature(HTML5_TAGS)) { + element = new HtmlFigure(namespaceURI, qualifiedName, page, attributeMap); + } + else { + return UnknownElementFactory.instance.createElementNS(page, namespaceURI, qualifiedName, attributes); + } + } else if (tagName.equals(HtmlFont.TAG_NAME)) { element = new HtmlFont(namespaceURI, qualifiedName, page, attributeMap); } else if (tagName.equals(HtmlForm.TAG_NAME)) { element = new HtmlForm(namespaceURI, qualifiedName, page, attributeMap); } + else if (tagName.equals(HtmlFooter.TAG_NAME)) { + if (page.getWebClient().getBrowserVersion().hasFeature(HTML5_TAGS)) { + element = new HtmlFooter(namespaceURI, qualifiedName, page, attributeMap); + } + else { + return UnknownElementFactory.instance.createElementNS(page, namespaceURI, qualifiedName, attributes); + } + } else if (tagName.equals(HtmlFrame.TAG_NAME)) { if (attributeMap != null) { final DomAttr srcAttribute = attributeMap.get("src"); @@ -294,6 +329,14 @@ else if (tagName.equals(HtmlHead.TAG_NAME)) { element = new HtmlHead(namespaceURI, qualifiedName, page, attributeMap); } + else if (tagName.equals(HtmlHeader.TAG_NAME)) { + if (page.getWebClient().getBrowserVersion().hasFeature(HTML5_TAGS)) { + element = new HtmlHeader(namespaceURI, qualifiedName, page, attributeMap); + } + else { + return UnknownElementFactory.instance.createElementNS(page, namespaceURI, qualifiedName, attributes); + } + } else if (tagName.equals(HtmlHeading1.TAG_NAME)) { element = new HtmlHeading1(namespaceURI, qualifiedName, page, attributeMap); } @@ -363,6 +406,14 @@ else if (tagName.equals(HtmlMap.TAG_NAME)) { element = new HtmlMap(namespaceURI, qualifiedName, page, attributeMap); } + else if (tagName.equals(HtmlMark.TAG_NAME)) { + if (page.getWebClient().getBrowserVersion().hasFeature(HTML5_TAGS)) { + element = new HtmlMark(namespaceURI, qualifiedName, page, attributeMap); + } + else { + return UnknownElementFactory.instance.createElementNS(page, namespaceURI, qualifiedName, attributes); + } + } else if (tagName.equals(HtmlMarquee.TAG_NAME)) { element = new HtmlMarquee(namespaceURI, qualifiedName, page, attributeMap); } @@ -383,6 +434,14 @@ else if (tagName.equals(HtmlMultiColumn.TAG_NAME)) { element = new HtmlMultiColumn(namespaceURI, qualifiedName, page, attributeMap); } + else if (tagName.equals(HtmlNav.TAG_NAME)) { + if (page.getWebClient().getBrowserVersion().hasFeature(HTML5_TAGS)) { + element = new HtmlNav(namespaceURI, qualifiedName, page, attributeMap); + } + else { + return UnknownElementFactory.instance.createElementNS(page, namespaceURI, qualifiedName, attributes); + } + } else if (tagName.equals(HtmlNoBreak.TAG_NAME)) { element = new HtmlNoBreak(namespaceURI, qualifiedName, page, attributeMap); } @@ -455,6 +514,14 @@ else if (tagName.equals(HtmlScript.TAG_NAME)) { element = new HtmlScript(namespaceURI, qualifiedName, page, attributeMap); } + else if (tagName.equals(HtmlSection.TAG_NAME)) { + if (page.getWebClient().getBrowserVersion().hasFeature(HTML5_TAGS)) { + element = new HtmlSection(namespaceURI, qualifiedName, page, attributeMap); + } + else { + return UnknownElementFactory.instance.createElementNS(page, namespaceURI, qualifiedName, attributes); + } + } else if (tagName.equals(HtmlSelect.TAG_NAME)) { element = new HtmlSelect(namespaceURI, qualifiedName, page, attributeMap); } Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArticle.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArticle.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArticle.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002-2013 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.html; + +import java.util.Map; + +import com.gargoylesoftware.htmlunit.SgmlPage; + +/** + * Wrapper for the HTML element "article". + * + * @version $Revision$ + * @author Ronald Brill + */ +public class HtmlArticle extends HtmlElement { + + /** The HTML tag represented by this element. */ + public static final String TAG_NAME = "article"; + + /** + * Creates a new instance. + * + * @param namespaceURI the URI that identifies an XML namespace + * @param qualifiedName the qualified name of the element type to instantiate + * @param page the page that contains this element + * @param attributes the initial attributes + */ + HtmlArticle(final String namespaceURI, final String qualifiedName, final SgmlPage page, + final Map<String, DomAttr> attributes) { + super(namespaceURI, qualifiedName, page, attributes); + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArticle.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Revision \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAside.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAside.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAside.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002-2013 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.html; + +import java.util.Map; + +import com.gargoylesoftware.htmlunit.SgmlPage; + +/** + * Wrapper for the HTML element "aside". + * + * @version $Revision$ + * @author Ronald Brill + */ +public class HtmlAside extends HtmlElement { + + /** The HTML tag represented by this element. */ + public static final String TAG_NAME = "aside"; + + /** + * Creates a new instance. + * + * @param namespaceURI the URI that identifies an XML namespace + * @param qualifiedName the qualified name of the element type to instantiate + * @param page the page that contains this element + * @param attributes the initial attributes + */ + HtmlAside(final String namespaceURI, final String qualifiedName, final SgmlPage page, + final Map<String, DomAttr> attributes) { + super(namespaceURI, qualifiedName, page, attributes); + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAside.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Revision \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigure.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigure.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigure.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002-2013 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.html; + +import java.util.Map; + +import com.gargoylesoftware.htmlunit.SgmlPage; + +/** + * Wrapper for the HTML element "figure". + * + * @version $Revision$ + * @author Ronald Brill + */ +public class HtmlFigure extends HtmlElement { + + /** The HTML tag represented by this element. */ + public static final String TAG_NAME = "figure"; + + /** + * Creates a new instance. + * + * @param namespaceURI the URI that identifies an XML namespace + * @param qualifiedName the qualified name of the element type to instantiate + * @param page the page that contains this element + * @param attributes the initial attributes + */ + HtmlFigure(final String namespaceURI, final String qualifiedName, final SgmlPage page, + final Map<String, DomAttr> attributes) { + super(namespaceURI, qualifiedName, page, attributes); + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigure.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Revision \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFooter.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFooter.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFooter.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002-2013 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.html; + +import java.util.Map; + +import com.gargoylesoftware.htmlunit.SgmlPage; + +/** + * Wrapper for the HTML element "footer". + * + * @version $Revision$ + * @author Ronald Brill + */ +public class HtmlFooter extends HtmlElement { + + /** The HTML tag represented by this element. */ + public static final String TAG_NAME = "footer"; + + /** + * Creates a new instance. + * + * @param namespaceURI the URI that identifies an XML namespace + * @param qualifiedName the qualified name of the element type to instantiate + * @param page the page that contains this element + * @param attributes the initial attributes + */ + HtmlFooter(final String namespaceURI, final String qualifiedName, final SgmlPage page, + final Map<String, DomAttr> attributes) { + super(namespaceURI, qualifiedName, page, attributes); + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFooter.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Revision \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeader.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeader.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeader.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002-2013 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.html; + +import java.util.Map; + +import com.gargoylesoftware.htmlunit.SgmlPage; + +/** + * Wrapper for the HTML element "header". + * + * @version $Revision$ + * @author Ronald Brill + */ +public class HtmlHeader extends HtmlElement { + + /** The HTML tag represented by this element. */ + public static final String TAG_NAME = "header"; + + /** + * Creates a new instance. + * + * @param namespaceURI the URI that identifies an XML namespace + * @param qualifiedName the qualified name of the element type to instantiate + * @param page the page that contains this element + * @param attributes the initial attributes + */ + HtmlHeader(final String namespaceURI, final String qualifiedName, final SgmlPage page, + final Map<String, DomAttr> attributes) { + super(namespaceURI, qualifiedName, page, attributes); + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeader.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Revision \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMark.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMark.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMark.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002-2013 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.html; + +import java.util.Map; + +import com.gargoylesoftware.htmlunit.SgmlPage; + +/** + * Wrapper for the HTML element "mark". + * + * @version $Revision$ + * @author Ronald Brill + */ +public class HtmlMark extends HtmlElement { + + /** The HTML tag represented by this element. */ + public static final String TAG_NAME = "mark"; + + /** + * Creates a new instance. + * + * @param namespaceURI the URI that identifies an XML namespace + * @param qualifiedName the qualified name of the element type to instantiate + * @param page the page that contains this element + * @param attributes the initial attributes + */ + HtmlMark(final String namespaceURI, final String qualifiedName, final SgmlPage page, + final Map<String, DomAttr> attributes) { + super(namespaceURI, qualifiedName, page, attributes); + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMark.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Revision \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNav.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNav.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNav.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002-2013 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.html; + +import java.util.Map; + +import com.gargoylesoftware.htmlunit.SgmlPage; + +/** + * Wrapper for the HTML element "nav". + * + * @version $Revision$ + * @author Ronald Brill + */ +public class HtmlNav extends HtmlElement { + + /** The HTML tag represented by this element. */ + public static final String TAG_NAME = "nav"; + + /** + * Creates a new instance. + * + * @param namespaceURI the URI that identifies an XML namespace + * @param qualifiedName the qualified name of the element type to instantiate + * @param page the page that contains this element + * @param attributes the initial attributes + */ + HtmlNav(final String namespaceURI, final String qualifiedName, final SgmlPage page, + final Map<String, DomAttr> attributes) { + super(namespaceURI, qualifiedName, page, attributes); + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNav.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Revision \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSection.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSection.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSection.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002-2013 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gargoylesoftware.htmlunit.html; + +import java.util.Map; + +import com.gargoylesoftware.htmlunit.SgmlPage; + +/** + * Wrapper for the HTML element "section". + * + * @version $Revision$ + * @author Ronald Brill + */ +public class HtmlSection extends HtmlElement { + + /** The HTML tag represented by this element. */ + public static final String TAG_NAME = "section"; + + /** + * Creates a new instance. + * + * @param namespaceURI the URI that identifies an XML namespace + * @param qualifiedName the qualified name of the element type to instantiate + * @param page the page that contains this element + * @param attributes the initial attributes + */ + HtmlSection(final String namespaceURI, final String qualifiedName, final SgmlPage page, + final Map<String, DomAttr> attributes) { + super(namespaceURI, qualifiedName, page, attributes); + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSection.java ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Revision \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java 2013-12-18 12:08:40 UTC (rev 8870) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -91,15 +91,23 @@ import com.gargoylesoftware.htmlunit.html.HTMLParser; import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlArea; +import com.gargoylesoftware.htmlunit.html.HtmlArticle; +import com.gargoylesoftware.htmlunit.html.HtmlAside; import com.gargoylesoftware.htmlunit.html.HtmlBody; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlElement; +import com.gargoylesoftware.htmlunit.html.HtmlFigure; +import com.gargoylesoftware.htmlunit.html.HtmlFooter; import com.gargoylesoftware.htmlunit.html.HtmlFrameSet; +import com.gargoylesoftware.htmlunit.html.HtmlHeader; +import com.gargoylesoftware.htmlunit.html.HtmlMark; +import com.gargoylesoftware.htmlunit.html.HtmlNav; import com.gargoylesoftware.htmlunit.html.HtmlNoBreak; import com.gargoylesoftware.htmlunit.html.HtmlNoEmbed; import com.gargoylesoftware.htmlunit.html.HtmlNoFrames; import com.gargoylesoftware.htmlunit.html.HtmlNoScript; import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlSection; import com.gargoylesoftware.htmlunit.html.HtmlTable; import com.gargoylesoftware.htmlunit.html.HtmlTableDataCell; import com.gargoylesoftware.htmlunit.html.HtmlWordBreak; @@ -153,11 +161,19 @@ * @author Frank Danek */ @JsxClasses({ + @JsxClass(domClass = HtmlArticle.class), + @JsxClass(domClass = HtmlAside.class), @JsxClass(domClass = HtmlElement.class), + @JsxClass(domClass = HtmlFigure.class), + @JsxClass(domClass = HtmlFooter.class), + @JsxClass(domClass = HtmlHeader.class), + @JsxClass(domClass = HtmlMark.class), + @JsxClass(domClass = HtmlNav.class), @JsxClass(domClass = HtmlNoBreak.class, browsers = { @WebBrowser(FF) }), @JsxClass(domClass = HtmlNoEmbed.class, browsers = { @WebBrowser(FF), @WebBrowser(value = IE, minVersion = 9) }), @JsxClass(domClass = HtmlNoFrames.class, browsers = { @WebBrowser(FF), @WebBrowser(value = IE, minVersion = 9) }), @JsxClass(domClass = HtmlNoScript.class, browsers = { @WebBrowser(FF), @WebBrowser(value = IE, minVersion = 9) }), + @JsxClass(domClass = HtmlSection.class), @JsxClass(domClass = HtmlWordBreak.class, browsers = { @WebBrowser(FF), @WebBrowser(value = IE, minVersion = 9) }) }) public class HTMLElement extends Element implements ScriptableWithFallbackGetter { @@ -2911,7 +2927,7 @@ } return "inline"; } - if ("WBR".equals(tagName)) { + if ("WBR".equals(tagName) || "MARK".equals(tagName)) { return "inline"; } return super.getDefaultStyleDisplay(); Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLElementsTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLElementsTest.java 2013-12-18 12:08:40 UTC (rev 8870) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLElementsTest.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -113,6 +113,28 @@ @Alerts(DEFAULT = "1", IE8 = "0") @NotYetImplemented(IE8) + public void elementClosesItself_article() throws Exception { + loadPageWithAlerts2(elementClosesItself("article")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "1", + IE8 = "0") + @NotYetImplemented(IE8) + public void elementClosesItself_aside() throws Exception { + loadPageWithAlerts2(elementClosesItself("aside")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "1", + IE8 = "0") + @NotYetImplemented(IE8) public void elementClosesItself_audio() throws Exception { loadPageWithAlerts2(elementClosesItself("audio")); } @@ -272,7 +294,9 @@ * @throws Exception if the test fails */ @Test - @Alerts("1") + @Alerts(DEFAULT = "1", + IE8 = "0") + @NotYetImplemented(IE8) public void elementClosesItself_datalist() throws Exception { loadPageWithAlerts2(elementClosesItself("datalist")); } @@ -372,6 +396,17 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "1", + IE8 = "0") + @NotYetImplemented(IE8) + public void elementClosesItself_figure() throws Exception { + loadPageWithAlerts2(elementClosesItself("figure")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("1") public void elementClosesItself_font() throws Exception { loadPageWithAlerts2(elementClosesItself("font")); @@ -381,6 +416,17 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "1", + IE8 = "0") + @NotYetImplemented(IE8) + public void elementClosesItself_footer() throws Exception { + loadPageWithAlerts2(elementClosesItself("footer")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("1") @NotYetImplemented(IE8) public void elementClosesItself_form() throws Exception { @@ -488,6 +534,17 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "1", + IE8 = "0") + @NotYetImplemented(IE8) + public void elementClosesItself_header() throws Exception { + loadPageWithAlerts2(elementClosesItself("header")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("0") public void elementClosesItself_hr() throws Exception { loadPageWithAlerts2(elementClosesItself("hr")); @@ -649,6 +706,17 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "1", + IE8 = "0") + @NotYetImplemented(IE8) + public void elementClosesItself_mark() throws Exception { + loadPageWithAlerts2(elementClosesItself("mark")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("1") public void elementClosesItself_menu() throws Exception { loadPageWithAlerts2(elementClosesItself("menu")); @@ -667,7 +735,9 @@ * @throws Exception if the test fails */ @Test - @Alerts("1") + @Alerts(DEFAULT = "1", + IE8 = "0") + @NotYetImplemented(IE8) public void elementClosesItself_meter() throws Exception { loadPageWithAlerts2(elementClosesItself("meter")); } @@ -700,6 +770,17 @@ @Alerts(DEFAULT = "1", IE8 = "0") @NotYetImplemented(IE8) + public void elementClosesItself_nav() throws Exception { + loadPageWithAlerts2(elementClosesItself("nav")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "1", + IE8 = "0") + @NotYetImplemented(IE8) public void elementClosesItself_noembed() throws Exception { loadPageWithAlerts2(elementClosesItself("noembed")); } @@ -730,7 +811,7 @@ */ @Test @Alerts(DEFAULT = "1", - IE8 = "0") + IE8 = "null") @NotYetImplemented(IE8) public void elementClosesItself_object() throws Exception { loadPageWithAlerts2(elementClosesItself("object")); @@ -879,6 +960,17 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "1", + IE8 = "0") + @NotYetImplemented(IE8) + public void elementClosesItself_section() throws Exception { + loadPageWithAlerts2(elementClosesItself("section")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("0") public void elementClosesItself_select() throws Exception { loadPageWithAlerts2(elementClosesItself("select")); @@ -956,7 +1048,7 @@ * @throws Exception if the test fails */ @Test - @Alerts("1") + @Alerts(DEFAULT = "1") public void elementClosesItself_sub() throws Exception { loadPageWithAlerts2(elementClosesItself("sub")); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLParser2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLParser2Test.java 2013-12-18 12:08:40 UTC (rev 8870) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLParser2Test.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -373,6 +373,28 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = { "1", "0", "1", "1", "0", "1" }, + IE8 = { "2", "2", "2", "4", "4", "3" }) + @NotYetImplemented + public void childNodes_article() throws Exception { + loadPageWithAlerts2(createHtmlForChildNodes("article")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = { "1", "0", "1", "1", "0", "1" }, + IE8 = { "2", "2", "2", "4", "4", "3" }) + @NotYetImplemented + public void childNodes_aside() throws Exception { + loadPageWithAlerts2(createHtmlForChildNodes("aside")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = { "3", "2", "2", "3", "2", "2" }, IE8 = { "2", "2", "2", "4", "4", "3" }) @NotYetImplemented(IE8) @@ -663,6 +685,17 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = { "1", "0", "1", "1", "0", "1" }, + IE8 = { "2", "2", "2", "4", "4", "3" }) + @NotYetImplemented + public void childNodes_figure() throws Exception { + loadPageWithAlerts2(createHtmlForChildNodes("figure")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = { "3", "2", "2", "3", "2", "2" }, IE8 = { "1", "1", "1", "2", "2", "1" }) public void childNodes_font() throws Exception { @@ -684,6 +717,17 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = { "1", "0", "1", "1", "0", "1" }, + IE8 = { "2", "2", "2", "4", "4", "3" }) + @NotYetImplemented + public void childNodes_footer() throws Exception { + loadPageWithAlerts2(createHtmlForChildNodes("footer")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = { "1", "1", "1", "1", "1", "1" }, IE8 = { "2", "2", "2", "4", "4", "3" }) @NotYetImplemented @@ -777,6 +821,17 @@ */ @Test @Alerts(DEFAULT = { "1", "0", "1", "1", "0", "1" }, + IE8 = { "2", "2", "2", "4", "4", "3" }) + @NotYetImplemented + public void childNodes_header() throws Exception { + loadPageWithAlerts2(createHtmlForChildNodes("header")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = { "1", "0", "1", "1", "0", "1" }, IE8 = { "0", "0", "0", "0", "0", "0" }) public void childNodes_hr() throws Exception { loadPageWithAlerts2(createHtmlForChildNodes("hr")); @@ -941,6 +996,17 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = { "3", "2", "2", "3", "2", "2" }, + IE8 = { "2", "2", "2", "4", "4", "3" }) + @NotYetImplemented(IE8) + public void childNodes_mark() throws Exception { + loadPageWithAlerts2(createHtmlForChildNodes("mark")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = { "1", "0", "1", "1", "0", "1" }, IE8 = { "0", "0", "0", "0", "0", "0" }) public void childNodes_menu() throws Exception { @@ -984,6 +1050,17 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = { "1", "0", "1", "1", "0", "1" }, + IE8 = { "2", "2", "2", "4", "4", "3" }) + @NotYetImplemented + public void childNodes_nav() throws Exception { + loadPageWithAlerts2(createHtmlForChildNodes("nav")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = { "3", "2", "2", "3", "2", "2" }, IE8 = { "1", "1", "1", "2", "2", "1" }) public void childNodes_nobr() throws Exception { @@ -1141,7 +1218,7 @@ */ @Test @Alerts(DEFAULT = { "3", "2", "2", "3", "2", "2" }, - IE8 = { "1", "1", "1", "2", "2", "1" }) + IE8 = { "2", "2", "2", "4", "4", "3" }) @NotYetImplemented() public void childNodes_rt() throws Exception { loadPageWithAlerts2(createHtmlForChildNodes("rt")); @@ -1152,7 +1229,7 @@ */ @Test @Alerts(DEFAULT = { "3", "2", "2", "3", "2", "2" }, - IE8 = { "1", "1", "1", "2", "2", "1" }) + IE8 = { "2", "2", "2", "4", "4", "3" }) @NotYetImplemented() public void childNodes_rp() throws Exception { loadPageWithAlerts2(createHtmlForChildNodes("rp")); @@ -1193,6 +1270,17 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = { "1", "0", "1", "1", "0", "1" }, + IE8 = { "2", "2", "2", "4", "4", "3" }) + @NotYetImplemented + public void childNodes_section() throws Exception { + loadPageWithAlerts2(createHtmlForChildNodes("section")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = { "3", "2", "2", "3", "2", "2" }, IE8 = { "2", "2", "1", "2", "2", "1" }) @NotYetImplemented(IE8) Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2013-12-18 12:08:40 UTC (rev 8870) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2013-12-18 19:59:25 UTC (rev 8871) @@ -2992,12 +2992,15 @@ } private String outerHTML(final String elementName) { - return "<html><head>\n" + return "<!DOCTYPE html><html><head>\n" + " <script>\n" + " function test(){\n" - + " var value = document.createElement('" + elementName + "').cloneNode(true).outerHTML;\n" - + " while (value && (value.charAt(0) == '\\r' || value.charAt(0) == '\\n'))\n" + + " var value = document.createElement('" + elementName + "').outerHTML;\n" + + " while (value && (value.charAt(0) == '\\r' || value.charAt(0) == '\\n')) {\n" + " value = value.substring(1);\n" + + " }\n" + // IE8 inserts a fancy namespace declaration if the tag is unknown + + " value = value.replace('<?XML:NAMESPACE PREFIX = PUBLIC NS = \"URN:COMPONENT\" />', '');\n" + " alert(value);\n" + " }\n" + " </script>\n" @@ -3069,6 +3072,24 @@ * @throws Exception if the test fails */ @Test + @Alerts("<article></article>") + public void outerHTML_article() throws Exception { + loadPageWithAlerts2(outerHTML("article")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("<aside></aside>") + public void outerHTML_aside() throws Exception { + loadPageWithAlerts2(outerHTML("aside")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("<audio></audio>") public void outerHTML_audio() throws Exception { loadPageWithAlerts2(outerHTML("audio")); @@ -3258,9 +3279,7 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "<datalist></datalist>", - IE8 = "<:datalist></:datalist>") - @NotYetImplemented(IE8) + @Alerts("<datalist></datalist>") public void outerHTML_datalist() throws Exception { loadPageWithAlerts2(outerHTML("datalist")); } @@ -3369,6 +3388,15 @@ * @throws Exception if the test fails */ @Test + @Alerts("<figure></figure>") + public void outerHTML_figure() throws Exception { + loadPageWithAlerts2(outerHTML("figure")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = "<font></font>", IE8 = "<FONT></FONT>") public void outerHTML_font() throws Exception { @@ -3389,6 +3417,15 @@ * @throws Exception if the test fails */ @Test + @Alerts("<footer></footer>") + public void outerHTML_footer() throws Exception { + loadPageWithAlerts2(outerHTML("footer")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = "<frame>", IE8 = "<FRAME>") public void outerHTML_frame() throws Exception { @@ -3479,6 +3516,15 @@ * @throws Exception if the test fails */ @Test + @Alerts("<header></header>") + public void outerHTML_header() throws Exception { + loadPageWithAlerts2(outerHTML("header")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = "<hr>", IE8 = "<HR>") public void outerHTML_hr() throws Exception { @@ -3682,6 +3728,15 @@ * @throws Exception if the test fails */ @Test + @Alerts("<mark></mark>") + public void outerHTML_mark() throws Exception { + loadPageWithAlerts2(outerHTML("mark")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = "<menu></menu>", IE8 = "<MENU></MENU>") public void outerHTML_menu() throws Exception { @@ -3720,6 +3775,15 @@ * @throws Exception if the test fails */ @Test + @Alerts("<nav></nav>") + public void outerHTML_nav() throws Exception { + loadPageWithAlerts2(outerHTML("nav")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = "<nobr></nobr>", IE8 = "<NOBR></NOBR>") public void outerHTML_nobr() throws Exception { @@ -3879,6 +3943,15 @@ * @throws Exception if the test fails */ @Test + @Alerts("<section></section>") + public void outerHTML_section() throws Exception { + loadPageWithAlerts2(outerHTML("section")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = "<select></select>", IE8 = "<SELECT></SELECT>") public void outerHTML_select() throws Exception { |