From: <rb...@us...> - 2013-11-03 10:30:03
|
Revision: 8733 http://sourceforge.net/p/htmlunit/code/8733 Author: rbri Date: 2013-11-03 10:29:59 +0000 (Sun, 03 Nov 2013) Log Message: ----------- missing test added Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java 2013-11-03 08:52:23 UTC (rev 8732) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java 2013-11-03 10:29:59 UTC (rev 8733) @@ -31,6 +31,7 @@ import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.SgmlPage; import com.gargoylesoftware.htmlunit.html.DomElement; +import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.HTMLParser; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlImage; @@ -68,6 +69,7 @@ NORMALIZED_ALIGN_VALUES.put("texttop", "textTop"); } + private boolean endTagForbidden_ = true; private boolean instantiatedViaJavaScript_ = false; /** @@ -83,6 +85,17 @@ } /** + * {@inheritDoc} + */ + @Override + public void setDomNode(final DomNode domNode) { + super.setDomNode(domNode); + if ("image".equalsIgnoreCase(domNode.getLocalName())) { + endTagForbidden_ = false; + } + } + + /** * Sets the <tt>src</tt> attribute. * @param src the <tt>src</tt> attribute value */ @@ -331,7 +344,7 @@ */ @Override protected boolean isEndTagForbidden() { - return true; + return endTagForbidden_; } /** 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-11-03 08:52:23 UTC (rev 8732) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElementTest.java 2013-11-03 10:29:59 UTC (rev 8733) @@ -3537,6 +3537,18 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "<image></image>", + IE10 = "<img>", + IE8 = "<IMG>") + @NotYetImplemented(IE8) + public void outerHTML_image() throws Exception { + loadPageWithAlerts2(outerHTML("image")); + } + + /** + * @throws Exception if the test fails + */ + @Test @Alerts(DEFAULT = "<img>", IE8 = "<IMG>") public void outerHTML_img() throws Exception { |