From: <rb...@us...> - 2013-07-10 17:36:50
|
Revision: 8385 http://sourceforge.net/p/htmlunit/code/8385 Author: rbri Date: 2013-07-10 17:36:47 +0000 (Wed, 10 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 19:03:08 UTC (rev 8384) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java 2013-07-10 17:36:47 UTC (rev 8385) @@ -203,9 +203,15 @@ map.put("TABLE", "table"); map.put("TBODY", "table-row-group"); map.put("TD", "table-cell"); + map.put("TEXTAREA", "inline-block"); + map.put("TFOOT", "table-footer-group"); map.put("TH", "table-cell"); map.put("THEAD", "table-header-group"); + map.put("THEAD", "table-header-group"); + map.put("TIME", "inline"); map.put("TR", "table-row"); + map.put("TRACK", "inline"); + map.put("TT", "inline"); DEFAULT_DISPLAYS = Collections.unmodifiableMap(map); map = new HashMap<String, String>(map); @@ -232,6 +238,7 @@ map.put("SCRIPT", "none"); map.put("SECTION", "block"); map.put("SELECT", "inline"); + map.put("TEXTAREA", "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 19:03:08 UTC (rev 8384) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclarationTest.java 2013-07-10 17:36:47 UTC (rev 8385) @@ -856,25 +856,50 @@ * @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 { + @Alerts(DEFAULT = { "table", "table-row-group", "table-cell", "inline", "table-footer-group", + "table-cell", "table-header-group", "inline", "table-row", "inline", "inline" }, + IE = { "table", "table-row-group", "table-cell", "inline-block", "table-footer-group", + "table-cell", "table-header-group", "inline", "table-row", "inline", "inline" }) + public void defaultDisplayValues_T() throws Exception { final String html = "<!DOCTYPE HTML>\n<html><body>\n" + " <table id='table'>\n" + " <thead id='thead'><tr id='tr'><th id='th'>header</th></tr></thead>\n" + + " <tfoot id='tfoot'><tr><td>footer</td></tr></tfoot>\n" + " <tbody id='tbody'><tr><td id='td'>body</td></tr></tbody>\n" + " </table>\n" - + " <ul id='ul'><li id='li'>blah</li></ul>\n" + + " <form>\n" + + " <textarea id='textarea'></textarea>\n" + + " </form>\n" - + " <script>\n" + + " <p>\n" + + " <time id='time'></time>\n" + + " <tt id='tt'></tt>\n" + + " </p> \n" + + + " <video>\n" + + " <track id='track'>\n" + + " </video>\n" + + + " <script id='script'>\n" + " function x(id) {\n" + " var e = document.getElementById(id);\n" - + " return e.currentStyle ? e.currentStyle.display : window.getComputedStyle(e, '').display;\n" + + " var disp = e.currentStyle ? e.currentStyle.display : window.getComputedStyle(e, '').display;\n" + + " alert(disp);\n" + " }\n" + " </script>\n" + " <script>\n" - + " alert(x('table') + ' ' + x('thead') + ' ' + x('tbody') + ' ' + x('th') + ' ' + x('tr') +\n" - + " ' ' + x('td') + ' ' + x('ul') + ' ' + x('li'));\n" + + " x('table');\n" + + " x('tbody');\n" + + " x('td');\n" + + " x('textarea');\n" + + " x('tfoot');\n" + + " x('th');\n" + + " x('thead');\n" + + " x('time');\n" + + " x('tr');\n" + + " x('track');\n" + + " x('tt');\n" + " </script>\n" + "</body></html>"; loadPageWithAlerts2(html); |