From: <rb...@us...> - 2013-12-20 19:52:09
|
Revision: 8884 http://sourceforge.net/p/htmlunit/code/8884 Author: rbri Date: 2013-12-20 19:52:06 +0000 (Fri, 20 Dec 2013) Log Message: ----------- next step, ObjectsTest are running with FF17/24 now Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactory.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/AttributesTest.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/ObjectsTest.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/HtmlOutput.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.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-20 16:02:42 UTC (rev 8883) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactory.java 2013-12-20 19:52:06 UTC (rev 8884) @@ -83,7 +83,8 @@ HtmlNav.TAG_NAME, HtmlNextId.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, + HtmlOptionGroup.TAG_NAME, HtmlOption.TAG_NAME, HtmlOutput.TAG_NAME, + HtmlParagraph.TAG_NAME, HtmlParameter.TAG_NAME, HtmlPlainText.TAG_NAME, HtmlPreformattedText.TAG_NAME, HtmlProgress.TAG_NAME, HtmlRp.TAG_NAME, HtmlRt.TAG_NAME, HtmlRuby.TAG_NAME, @@ -469,6 +470,14 @@ else if (tagName.equals(HtmlOrderedList.TAG_NAME)) { element = new HtmlOrderedList(namespaceURI, qualifiedName, page, attributeMap); } + else if (tagName.equals(HtmlOutput.TAG_NAME)) { + if (page.getWebClient().getBrowserVersion().hasFeature(HTML5_TAGS)) { + element = new HtmlOutput(namespaceURI, qualifiedName, page, attributeMap); + } + else { + return UnknownElementFactory.instance.createElementNS(page, namespaceURI, qualifiedName, attributes); + } + } else if (tagName.equals(HtmlParagraph.TAG_NAME)) { element = new HtmlParagraph(namespaceURI, qualifiedName, page, attributeMap); } Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOutput.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOutput.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOutput.java 2013-12-20 19:52:06 UTC (rev 8884) @@ -0,0 +1,56 @@ +/* + * 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 "output". + * + * @version $Revision$ + * @author Ronald Brill + */ +public class HtmlOutput extends HtmlElement { + + /** The HTML tag represented by this element. */ + public static final String TAG_NAME = "output"; + + /** + * 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 + */ + HtmlOutput(final String namespaceURI, final String qualifiedName, final SgmlPage page, + final Map<String, DomAttr> attributes) { + super(namespaceURI, qualifiedName, page, attributes); + } + + /** + * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br/> + * + * Returns the default display style. + * + * @return the default display style. + */ + @Override + public DisplayStyle getDefaultStyleDisplay() { + return DisplayStyle.INLINE; + } +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOutput.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/configuration/JavaScriptConfiguration.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java 2013-12-20 16:02:42 UTC (rev 8883) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java 2013-12-20 19:52:06 UTC (rev 8884) @@ -170,6 +170,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLOptGroupElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLOptionElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLOptionsCollection; +import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLOutputElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLParagraphElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLParamElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLPhraseElement; @@ -313,7 +314,8 @@ HTMLNoShowElement.class, HTMLNextIdElement.class, HTMLOListElement.class, HTMLObjectElement.class, HTMLOptGroupElement.class, - HTMLOptionElement.class, HTMLOptionsCollection.class, HTMLParagraphElement.class, HTMLParamElement.class, + HTMLOptionElement.class, HTMLOptionsCollection.class, HTMLOutputElement.class, + HTMLParagraphElement.class, HTMLParamElement.class, HTMLPhraseElement.class, HTMLPreElement.class, HTMLProgressElement.class, HTMLScriptElement.class, HTMLSelectElement.class, HTMLSourceElement.class, HTMLSpanElement.class, Added: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.java (rev 0) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.java 2013-12-20 19:52:06 UTC (rev 8884) @@ -0,0 +1,33 @@ +/* + * 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.javascript.host.html; + +import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; + +import com.gargoylesoftware.htmlunit.html.HtmlOutput; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; +import com.gargoylesoftware.htmlunit.javascript.configuration.WebBrowser; + +/** + * The JavaScript object "HTMLOutputElement". + * + * @version $Revision$ + * @author Ronald Brill + */ +@JsxClass(domClass = HtmlOutput.class, browsers = { @WebBrowser(value = FF, minVersion = 16), @WebBrowser(CHROME) }) +public class HTMLOutputElement extends HTMLElement { + // nothing so far +} Property changes on: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.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/test/java/com/gargoylesoftware/htmlunit/html/AttributesTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/AttributesTest.java 2013-12-20 16:02:42 UTC (rev 8883) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/AttributesTest.java 2013-12-20 19:52:06 UTC (rev 8884) @@ -104,7 +104,8 @@ "HtmlNav", "HtmlNextId", "HtmlNoBreak", "HtmlNoEmbed", "HtmlNoFrames", "HtmlNoScript", "HtmlObject", "HtmlOrderedList", - "HtmlOptionGroup", "HtmlOption", "HtmlParagraph", + "HtmlOptionGroup", "HtmlOption", "HtmlOutput", + "HtmlParagraph", "HtmlParameter", "HtmlPlainText", "HtmlPreformattedText", "HtmlProgress", "HtmlRp", "HtmlRt", "HtmlRuby", 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-20 16:02:42 UTC (rev 8883) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLElementsTest.java 2013-12-20 19:52:06 UTC (rev 8884) @@ -862,6 +862,17 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "1", + IE8 = "0") + @NotYetImplemented(IE8) + public void elementClosesItself_output() throws Exception { + loadPageWithAlerts2(elementClosesItself("output")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts("0") public void elementClosesItself_p() throws Exception { loadPageWithAlerts2(elementClosesItself("p")); 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-20 16:02:42 UTC (rev 8883) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HTMLParser2Test.java 2013-12-20 19:52:06 UTC (rev 8884) @@ -1154,6 +1154,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_output() throws Exception { + loadPageWithAlerts2(createHtmlForChildNodes("output")); + } + + /** + * @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_p() throws Exception { Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/ObjectsTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/ObjectsTest.java 2013-12-20 16:02:42 UTC (rev 8883) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/ObjectsTest.java 2013-12-20 19:52:06 UTC (rev 8884) @@ -99,8 +99,8 @@ // list.add(new Object[] {name, BrowserVersion.INTERNET_EXPLORER_8}); // list.add(new Object[] {name, BrowserVersion.INTERNET_EXPLORER_9}); // list.add(new Object[] {name, BrowserVersion.INTERNET_EXPLORER_11}); -// list.add(new Object[] {name, BrowserVersion.FIREFOX_17}); -// list.add(new Object[] {name, BrowserVersion.FIREFOX_24}); + list.add(new Object[] {name, BrowserVersion.FIREFOX_17}); + list.add(new Object[] {name, BrowserVersion.FIREFOX_24}); // list.add(new Object[] {name, BrowserVersion.CHROME}); } return list; 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-20 16:02:42 UTC (rev 8883) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2013-12-20 19:52:06 UTC (rev 8884) @@ -3877,6 +3877,15 @@ * @throws Exception if the test fails */ @Test + @Alerts("<output></output>") + public void outerHTML_output() throws Exception { + loadPageWithAlerts2(outerHTML("output")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = "<p></p>", IE8 = "<P></P>") public void outerHTML_p() throws Exception { |