From: <rb...@us...> - 2013-07-07 21:27:52
|
Revision: 8380 http://sourceforge.net/p/htmlunit/code/8380 Author: rbri Date: 2013-07-07 21:27:49 +0000 (Sun, 07 Jul 2013) Log Message: ----------- more defaults for the display property fixed Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclarationTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java 2013-07-07 13:57:50 UTC (rev 8379) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java 2013-07-07 21:27:49 UTC (rev 8380) @@ -179,6 +179,9 @@ map.put("OPTGROUP", "inline"); map.put("OPTION", "inline"); map.put("OUTPUT", "inline"); + map.put("PARAM", "inline"); + map.put("PROGRESS", "inline"); + map.put("Q", "inline"); map.put("SPAN", "inline"); @@ -207,6 +210,8 @@ // map.put("NOSCRIPT", "none"); map.put("OPTGROUP", "block"); map.put("OPTION", "block"); + map.put("PARAM", "none"); + map.put("PROGRESS", "inline-block"); DEFAULT_DISPLAYS_CSS = Collections.unmodifiableMap(map); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclarationTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclarationTest.java 2013-07-07 13:57:50 UTC (rev 8379) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclarationTest.java 2013-07-07 21:27:49 UTC (rev 8380) @@ -729,6 +729,43 @@ * @throws Exception if an error occurs */ @Test + @Alerts(DEFAULT = { "block", "none", "block", "inline-block", "inline" }, + IE = { "block", "inline", "block", "inline", "inline" }) + public void defaultDisplayValues_PQ() throws Exception { + // this fails in real IE8 but works in IE9 + final String html = "<!DOCTYPE HTML>\n<html><body>\n" + + " <p id='p'><q id='q'></q></p>\n" + + + " <object>\n" + + " <param id='param' name='movie' value=''></param>\n" + + " </object> " + + + " <pre id='pre'></pre>\n" + + " <progress id='progress'></progress>\n" + + + " <script>\n" + + " function x(id) {\n" + + " var e = document.getElementById(id);\n" + + " var disp = e.currentStyle ? e.currentStyle.display : window.getComputedStyle(e, '').display;\n" + + " alert(disp);\n" + + " }\n" + + " </script>\n" + + " <script>\n" + + " x('p');\n" + + " x('param');\n" + + " x('pre');\n" + + " x('progress');\n" + + + " x('q');\n" + + " </script>\n" + + "</body></html>"; + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if an error occurs + */ + @Test @Alerts("table table-header-group table-row-group table-cell table-row table-cell block list-item") public void defaultDisplayValuesTable() throws Exception { final String html = "<!DOCTYPE HTML>\n<html><body>\n" |