From: <rb...@us...> - 2013-07-09 16:05:44
|
Revision: 8383 http://sourceforge.net/p/htmlunit/code/8383 Author: rbri Date: 2013-07-09 16:05:40 +0000 (Tue, 09 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-09 11:44:19 UTC (rev 8382) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java 2013-07-09 16:05:40 UTC (rev 8383) @@ -182,8 +182,23 @@ map.put("PARAM", "inline"); map.put("PROGRESS", "inline"); map.put("Q", "inline"); - + map.put("RUBY", "ruby"); + map.put("RT", "ruby-text"); + map.put("RP", "inline"); + map.put("S", "inline"); + map.put("SAMP", "inline"); + map.put("SCRIPT", "inline"); + map.put("SECTION", "inline"); + map.put("SELECT", "inline-block"); + map.put("SMALL", "inline"); + map.put("SUP", "inline"); + map.put("SOURCE", "inline"); map.put("SPAN", "inline"); + map.put("STRIKE", "inline"); + map.put("STRONG", "inline"); + map.put("SUB", "inline"); + map.put("SUMMARY", "inline"); + map.put("SUP", "inline"); map.put("TABLE", "table"); map.put("TBODY", "table-row-group"); @@ -212,6 +227,11 @@ map.put("OPTION", "block"); map.put("PARAM", "none"); map.put("PROGRESS", "inline-block"); + map.put("RUBY", "inline"); + map.put("RT", "inline"); + map.put("SCRIPT", "none"); + map.put("SECTION", "block"); + map.put("SELECT", "inline"); 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-09 11:44:19 UTC (rev 8382) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclarationTest.java 2013-07-09 16:05:40 UTC (rev 8383) @@ -766,6 +766,96 @@ * @throws Exception if an error occurs */ @Test + @Alerts(DEFAULT = { "inline", "inline", "inline" }, + IE = { "ruby", "ruby-text", "inline" }) + public void defaultDisplayValues_R() throws Exception { + final String html = "<!DOCTYPE HTML>\n<html><body>\n" + + " <ruby id='ruby'>\n" + + " <rt id='rt'>\n" + + " <rp id='rp'></rp>\n" + + " </rt>\n" + + " </ruby> \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('ruby');\n" + + " x('rt');\n" + + " x('rp');\n" + + " </script>\n" + + "</body></html>"; + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts(DEFAULT = { "inline", "inline", "none", "block", "inline", "inline", + "inline", "inline", "inline", "inline", "inline", "inline", "inline" }, + IE = { "inline", "inline", "inline", "inline", "inline-block", "inline", + "inline", "inline", "inline", "inline", "inline", "inline", "inline" }) + public void defaultDisplayValues_S() throws Exception { + final String html = "<!DOCTYPE HTML>\n<html><body>\n" + + " <p>\n" + + " <s id='s'></s>\n" + + " <small id='small'></small>\n" + + " <span id='span'></span>\n" + + " <strike id='strike'></strike>\n" + + " <strong id='strong'></strong>\n" + + " <sub id='sub'></sub>\n" + + " <sup id='sup'></sup>\n" + + " </p> \n" + + + " <samp id='samp'></samp>\n" + + " <section id='section'></section>\n" + + " <summary id='summary'></summary>\n" + + + " <audio>\n" + + " <source id='source'>\n" + + " </audio>\n" + + + " <form>\n" + + " <select id='select'>\n" + + " <option></option>\n" + + " </select>\n" + + " </form>\n" + + + " <script id='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('s');\n" + + " x('samp');\n" + + " x('script');\n" + + " x('section');\n" + + " x('select');\n" + + " x('small');\n" + + " x('source');\n" + + " x('span');\n" + + " x('strike');\n" + + " x('strong');\n" + + " x('sub');\n" + + " x('summary');\n" + + " x('sup');\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" |