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

rbri--- via HtmlUnit-develop <[email protected]>
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID <[email protected]>
Revision: 15321
          http://sourceforge.net/p/htmlunit/code/15321
Author:   rbri
Date:     2018-06-15 18:08:05 +0000 (Fri, 15 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/JavaScriptEngine.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StringCustom.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeArrayTest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeStringTest.java

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java	2018-06-15 17:43:45 UTC (rev 15320)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java	2018-06-15 18:08:05 UTC (rev 15321)
@@ -1488,10 +1488,6 @@
     @BrowserFeature(CHROME)
     SLOT_CONTENTS,
 
-    /** Indicates that string.contains() is supported. */
-    @BrowserFeature(FF60)
-    STRING_CONTAINS,
-
     /** Indicates that string.includes() is supported. */
     @BrowserFeature({CHROME, FF})
     STRING_INCLUDES,

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-15 17:43:45 UTC (rev 15320)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java	2018-06-15 18:08:05 UTC (rev 15321)
@@ -26,7 +26,6 @@
 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_CONTAINS;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.STRING_INCLUDES;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.STRING_REPEAT;
 import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.STRING_STARTS_ENDS_WITH;
@@ -67,7 +66,6 @@
 import com.gargoylesoftware.htmlunit.javascript.host.DateCustom;
 import com.gargoylesoftware.htmlunit.javascript.host.NumberCustom;
 import com.gargoylesoftware.htmlunit.javascript.host.Reflect;
-import com.gargoylesoftware.htmlunit.javascript.host.StringCustom;
 import com.gargoylesoftware.htmlunit.javascript.host.Window;
 import com.gargoylesoftware.htmlunit.javascript.host.intl.Intl;
 
@@ -464,12 +462,6 @@
             removePrototypeProperties(window, "String", "trimLeft");
             removePrototypeProperties(window, "String", "trimRight");
         }
-        if (browserVersion.hasFeature(STRING_CONTAINS)) {
-            final ScriptableObject stringPrototype =
-                (ScriptableObject) ScriptableObject.getClassPrototype(window, "String");
-            stringPrototype.defineFunctionProperties(new String[] {"contains"},
-                StringCustom.class, ScriptableObject.EMPTY);
-        }
 
         // only FF has toSource
         if (!browserVersion.hasFeature(JS_FUNCTION_TOSOURCE)) {

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StringCustom.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StringCustom.java	2018-06-15 17:43:45 UTC (rev 15320)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StringCustom.java	2018-06-15 18:08:05 UTC (rev 15321)
@@ -14,10 +14,6 @@
  */
 package com.gargoylesoftware.htmlunit.javascript.host;
 
-import net.sourceforge.htmlunit.corejs.javascript.Context;
-import net.sourceforge.htmlunit.corejs.javascript.Function;
-import net.sourceforge.htmlunit.corejs.javascript.Scriptable;
-
 /**
  * Contains some missing features of Rhino NativeString.
  *
@@ -27,29 +23,4 @@
 public final class StringCustom {
 
     private StringCustom() { }
-
-    /**
-     * Determines whether one string may be found within another string,
-     * returning true or false as appropriate.
-     * @param context the JavaScript context
-     * @param thisObj the scriptable
-     * @param args the arguments passed into the method
-     * @param function the function
-     * @return true or false
-     */
-    public static boolean contains(
-            final Context context, final Scriptable thisObj, final Object[] args, final Function function) {
-        if (args.length < 1) {
-            return false;
-        }
-        final String string = Context.toString(thisObj);
-        final String search = Context.toString(args[0]);
-
-        if (args.length < 2) {
-            return string.contains(search);
-        }
-
-        final int start = (int) Math.max(0, Context.toNumber(args[1]));
-        return string.indexOf(search, start) > -1;
-    }
 }

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeArrayTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeArrayTest.java	2018-06-15 17:43:45 UTC (rev 15320)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeArrayTest.java	2018-06-15 18:08:05 UTC (rev 15321)
@@ -14,7 +14,6 @@
  */
 package com.gargoylesoftware.htmlunit.javascript;
 
-import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF60;
 import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE;
 
 import org.junit.Test;
@@ -44,7 +43,7 @@
     @Test
     @Alerts(DEFAULT = {"1<>5", "5<>2", "1<>2", "5<>1", "2<>1", "1<>1", "5<>9"},
             IE = {"5<>1", "2<>5", "2<>1", "2<>5", "1<>5", "1<>2", "1<>1", "9<>5"})
-    @NotYetImplemented({FF60, IE})
+    @NotYetImplemented(IE)
     public void sortSteps() throws Exception {
         final String html
             = "<html><head><title>foo</title><script>\n"

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeStringTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeStringTest.java	2018-06-15 17:43:45 UTC (rev 15320)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeStringTest.java	2018-06-15 18:08:05 UTC (rev 15321)
@@ -27,6 +27,7 @@
  * @author Marc Guillemot
  * @author Ahmed Ashour
  * @author Frank Danek
+ * @author Ronald Brill
  */
 @RunWith(BrowserRunner.class)
 public class NativeStringTest extends WebDriverTestCase {


------------------------------------------------------------------------------
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.