From: <rb...@us...> - 2018-06-29 13:28:42
|
Revision: 15412 http://sourceforge.net/p/htmlunit/code/15412 Author: rbri Date: 2018-06-29 13:28:37 +0000 (Fri, 29 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuElement.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-29 13:18:27 UTC (rev 15411) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2018-06-29 13:28:37 UTC (rev 15412) @@ -1081,6 +1081,10 @@ @BrowserFeature(IE) JS_MENU_TYPE_EMPTY, + /** Type property of menu returns the current (maybe invalid) value. */ + @BrowserFeature(FF60) + JS_MENU_TYPE_PASS, + /** Indicates if the String representation of a native function is without newline. */ @BrowserFeature({CHROME, EDGE}) JS_NATIVE_FUNCTION_TOSTRING_COMPACT, Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuElement.java 2018-06-29 13:18:27 UTC (rev 15411) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuElement.java 2018-06-29 13:28:37 UTC (rev 15412) @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_MENU_TYPE_EMPTY; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_MENU_TYPE_PASS; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; @@ -62,6 +63,10 @@ } final String type = getDomNodeOrDie().getAttributeDirect("type"); + if (getBrowserVersion().hasFeature(JS_MENU_TYPE_PASS)) { + return type; + } + if ("context".equalsIgnoreCase(type)) { return "context"; } @@ -68,6 +73,7 @@ if ("toolbar".equalsIgnoreCase(type)) { return "toolbar"; } + return "list"; } @@ -85,6 +91,11 @@ throw Context.reportRuntimeError("Cannot set the type property to invalid value: '" + type + "'"); } + if (getBrowserVersion().hasFeature(JS_MENU_TYPE_PASS)) { + getDomNodeOrDie().setAttribute("type", type); + return; + } + if ("context".equalsIgnoreCase(type)) { getDomNodeOrDie().setAttribute("type", "context"); return; |