[HtmlUnit] SVN: [14355] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/ javascript/host

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] SVN: [14355] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/ javascript/host

asashour-2
Revision: 14355
          http://sourceforge.net/p/htmlunit/code/14355
Author:   asashour
Date:     2017-05-04 12:17:45 +0000 (Thu, 04 May 2017)
Log Message:
-----------
move from Document to HTMLDocument (FF)

Modified Paths:
--------------
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-04 12:11:43 UTC (rev 14354)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-04 12:17:45 UTC (rev 14355)
@@ -877,7 +877,7 @@
     }
 
     /**
-     * JavaScript function "close".
+     * JavaScript function {@code close}.
      *
      * See http://www.whatwg.org/specs/web-apps/current-work/multipage/section-dynamic.html for
      * a good description of the semantics of open(), write(), writeln() and close().
@@ -884,9 +884,8 @@
      *
      * @throws IOException if an IO problem occurs
      */
-    @JsxFunction
+    @JsxFunction({CHROME, IE})
     public void close() throws IOException {
-        // overridden
     }
 
     /**
@@ -1008,7 +1007,7 @@
      * @param cmd the command identifier
      * @return {@code true} if the command is supported
      */
-    @JsxFunction
+    @JsxFunction({CHROME, IE})
     public boolean queryCommandSupported(final String cmd) {
         return hasCommand(cmd, true);
     }
@@ -1034,7 +1033,7 @@
      * @param cmd the command identifier
      * @return {@code true} if the command can be successfully executed
      */
-    @JsxFunction
+    @JsxFunction({CHROME, IE})
     public boolean queryCommandEnabled(final String cmd) {
         return hasCommand(cmd, true);
     }
@@ -1047,7 +1046,7 @@
      * @param value the string, number, or other value to assign (possible values depend on the command)
      * @return {@code true} if the command was successful, {@code false} otherwise
      */
-    @JsxFunction
+    @JsxFunction({CHROME, IE})
     public boolean execCommand(final String cmd, final boolean userInterface, final Object value) {
         if (!hasCommand(cmd, false)) {
             return false;

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java 2017-05-04 12:11:43 UTC (rev 14354)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java 2017-05-04 12:17:45 UTC (rev 14355)
@@ -657,6 +657,7 @@
      * {@inheritDoc}
      */
     @Override
+    @JsxFunction(FF)
     public void close() throws IOException {
         if (writeInCurrentDocument_) {
             LOG.warn("close() called when document is not open.");
@@ -676,6 +677,33 @@
     }
 
     /**
+     * {@inheritDoc}
+     */
+    @Override
+    @JsxFunction(FF)
+    public boolean execCommand(final String cmd, final boolean userInterface, final Object value) {
+        return super.execCommand(cmd, userInterface, value);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @JsxFunction(FF)
+    public boolean queryCommandEnabled(final String cmd) {
+        return super.queryCommandEnabled(cmd);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @JsxFunction(FF)
+    public boolean queryCommandSupported(final String cmd) {
+        return super.queryCommandSupported(cmd);
+    }
+
+    /**
      * Closes the document implicitly, i.e. flushes the <tt>document.write</tt> buffer (IE only).
      */
     private void implicitCloseIfNecessary() {


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop