[HtmlUnit] SVN: [15325] trunk/htmlunit/src

rbri--- via HtmlUnit-develop <[email protected]>
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID <[email protected]>
Revision: 15325
          http://sourceforge.net/p/htmlunit/code/15325
Author:   rbri
Date:     2018-06-16 12:47:20 +0000 (Sat, 16 Jun 2018)
Log Message:
-----------
ff60 support (wip)

Modified Paths:
--------------
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlApplet.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOption.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Location.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasRenderingContext2D.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframesRule.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlApplet.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlApplet.java	2018-06-16 12:34:48 UTC (rev 15324)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlApplet.java	2018-06-16 12:47:20 UTC (rev 15325)
@@ -14,8 +14,6 @@
  */
 package com.gargoylesoftware.htmlunit.html;
 
-import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.APPLET_INLINE_BLOCK;
-
 import java.applet.Applet;
 import java.io.IOException;
 import java.net.URL;
@@ -348,9 +346,6 @@
      */
     @Override
     public DisplayStyle getDefaultStyleDisplay() {
-        if (getPage().getWebClient().getBrowserVersion().hasFeature(APPLET_INLINE_BLOCK)) {
-            return DisplayStyle.INLINE_BLOCK;
-        }
         return DisplayStyle.INLINE;
     }
 }

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOption.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOption.java	2018-06-16 12:34:48 UTC (rev 15324)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOption.java	2018-06-16 12:47:20 UTC (rev 15325)
@@ -22,7 +22,6 @@
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONMOUSEOVER_NEVER_FOR_SELECT_OPTION;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONMOUSEUP_FOR_SELECT_OPTION_TRIGGERS_ADDITIONAL_UP_FOR_SELECT;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONMOUSEUP_NOT_FOR_SELECT_OPTION;
-import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLOPTION_EXACT_ONE_OPTION_GETS_NERVER_DESELECTED;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLOPTION_PREVENT_DISABLED;
 
 import java.io.IOException;
@@ -110,7 +109,7 @@
      * @param shiftKey {@code true} if SHIFT is pressed
      * @param ctrlKey {@code true} if CTRL is pressed
      */
-    private void setSelected(boolean selected, final boolean invokeOnFocus, final boolean isClick,
+    private void setSelected(final boolean selected, final boolean invokeOnFocus, final boolean isClick,
             final boolean shiftKey, final boolean ctrlKey) {
         if (selected == isSelected()) {
             return;
@@ -117,10 +116,6 @@
         }
         final HtmlSelect select = getEnclosingSelect();
         if (select != null) {
-            if (hasFeature(HTMLOPTION_EXACT_ONE_OPTION_GETS_NERVER_DESELECTED)
-                    && !select.isMultipleSelectEnabled() && select.getOptionSize() == 1) {
-                selected = true;
-            }
             select.setSelectedAttribute(this, selected, invokeOnFocus, shiftKey, ctrlKey, isClick);
             return;
         }

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java	2018-06-16 12:34:48 UTC (rev 15324)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java	2018-06-16 12:47:20 UTC (rev 15325)
@@ -23,7 +23,6 @@
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_OBJECT_GET_OWN_PROPERTY_SYMBOLS;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_REFLECT;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SYMBOL;
-import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SYMBOL_FF60;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_ACTIVEXOBJECT_HIDDEN;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.STRING_INCLUDES;
@@ -37,7 +36,6 @@
 import java.lang.reflect.Method;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Deque;
 import java.util.HashMap;
 import java.util.List;
@@ -230,16 +228,6 @@
             deleteProperties(window, "Symbol");
         }
 
-        if (browserVersion.hasFeature(JS_SYMBOL_FF60)) {
-            final ScriptableObject sym = (ScriptableObject) ScriptableObject.getProperty(window, "Symbol");
-            final List<String> toDelete = Arrays.asList("hasInstance", "isConcatSpreadable", "replace",
-                    "search", "split", "string", "toStringTag", "unscopables");
-            for (String propName : toDelete) {
-                sym.setAttributes(propName, ScriptableObject.EMPTY);
-                sym.delete(propName);
-            }
-        }
-
         final ScriptableObject errorObject = (ScriptableObject) ScriptableObject.getProperty(window, "Error");
         if (browserVersion.hasFeature(JS_ERROR_STACK_TRACE_LIMIT)) {
             errorObject.defineProperty("stackTraceLimit", 10, ScriptableObject.EMPTY);

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Location.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Location.java	2018-06-16 12:34:48 UTC (rev 15324)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Location.java	2018-06-16 12:47:20 UTC (rev 15325)
@@ -21,7 +21,6 @@
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_LOCATION_HASH_RETURNS_HASH_FOR_EMPTY_DEFINED;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_LOCATION_HREF_HASH_IS_ENCODED;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.URL_ABOUT_BLANK_HAS_BLANK_PATH;
-import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.URL_ABOUT_BLANK_HAS_EMPTY_PATH;
 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;
@@ -432,9 +431,6 @@
     @JsxGetter
     public String getPathname() {
         if (WebClient.URL_ABOUT_BLANK == getUrl()) {
-            if (getBrowserVersion().hasFeature(URL_ABOUT_BLANK_HAS_EMPTY_PATH)) {
-                return "";
-            }
             if (getBrowserVersion().hasFeature(URL_ABOUT_BLANK_HAS_BLANK_PATH)) {
                 return "blank";
             }

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasRenderingContext2D.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasRenderingContext2D.java	2018-06-16 12:34:48 UTC (rev 15324)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasRenderingContext2D.java	2018-06-16 12:47:20 UTC (rev 15325)
@@ -14,7 +14,6 @@
  */
 package com.gargoylesoftware.htmlunit.javascript.host.canvas;
 
-import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CANVAS_DRAW_THROWS_FOR_MISSING_IMG;
 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;
@@ -333,9 +332,6 @@
             }
         }
         catch (final IOException ioe) {
-            if (getBrowserVersion().hasFeature(JS_CANVAS_DRAW_THROWS_FOR_MISSING_IMG)) {
-                throw Context.throwAsScriptRuntimeEx(ioe);
-            }
         }
     }
 

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframesRule.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframesRule.java	2018-06-16 12:34:48 UTC (rev 15324)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframesRule.java	2018-06-16 12:47:20 UTC (rev 15325)
@@ -14,7 +14,6 @@
  */
 package com.gargoylesoftware.htmlunit.javascript.host.css;
 
-import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CSS_MOZ_CSS_KEYFRAMES_RULE;
 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.FF52;
@@ -58,16 +57,4 @@
     public short getType() {
         return KEYFRAMES_RULE;
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public Object getDefaultValue(final Class<?> hint) {
-        if ((String.class.equals(hint) || hint == null)
-                && getBrowserVersion().hasFeature(JS_CSS_MOZ_CSS_KEYFRAMES_RULE)) {
-            return "[object MozCSSKeyframesRule]";
-        }
-        return super.getDefaultValue(hint);
-    }
 }

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java	2018-06-16 12:34:48 UTC (rev 15324)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java	2018-06-16 12:47:20 UTC (rev 15325)
@@ -20,12 +20,10 @@
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_LENGTH_COMPUTABLE;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_NO_CROSS_ORIGIN_TO_ABOUT;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_OPEN_ALLOW_EMTPY_URL;
-import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_OPEN_WITHCREDENTIALS_TRUE_IN_SYNC_EXCEPTION;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_OVERRIDE_MIME_TYPE_BEFORE_SEND;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_USE_CONTENT_CHARSET;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_USE_DEFAULT_CHARSET_FROM_PAGE;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_WITHCREDENTIALS_ALLOW_ORIGIN_ALL;
-import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_WITHCREDENTIALS_NOT_WRITEABLE_IN_SYNC_EXCEPTION;
 import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME;
 import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF;
 import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE;
@@ -515,13 +513,6 @@
             async = ScriptRuntime.toBoolean(asyncParam);
         }
 
-        if (!async
-                && isWithCredentials()
-                && getBrowserVersion().hasFeature(XHR_OPEN_WITHCREDENTIALS_TRUE_IN_SYNC_EXCEPTION)) {
-            throw Context.reportRuntimeError(
-                            "open() in sync mode is not possible because 'withCredentials' is set to true");
-        }
-
         final String url = Context.toString(urlParam);
 
         // (URL + Method + User + Password) become a WebRequest instance.
@@ -960,11 +951,6 @@
      */
     @JsxSetter
     public void setWithCredentials(final boolean withCredentials) {
-        if (!async_ && state_ != UNSENT) {
-            if (getBrowserVersion().hasFeature(XHR_WITHCREDENTIALS_NOT_WRITEABLE_IN_SYNC_EXCEPTION)) {
-                throw Context.reportRuntimeError("Property 'withCredentials' not writable in sync mode.");
-            }
-        }
         withCredentials_ = withCredentials;
     }
 

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java	2018-06-16 12:34:48 UTC (rev 15324)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java	2018-06-16 12:47:20 UTC (rev 15325)
@@ -471,10 +471,10 @@
     }
 
     private static String getBrowserName(final BrowserVersion browserVersion) {
-        if (browserVersion == BrowserVersion.FIREFOX_60) {
+        if (browserVersion == BrowserVersion.FIREFOX_52) {
             return BrowserType.FIREFOX + '-' + browserVersion.getBrowserVersionNumeric();
         }
-        else if (browserVersion == BrowserVersion.FIREFOX_52) {
+        else if (browserVersion == BrowserVersion.FIREFOX_60) {
             return BrowserType.FIREFOX;
         }
         if (browserVersion == BrowserVersion.INTERNET_EXPLORER) {


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.