Bug 742261 - Remove useless queryCommandText/execCommandShowHelp methods; r=ehsan
authorAryeh Gregor <ayg@aryeh.name>
Wed, 04 Apr 2012 15:30:33 +0300
changeset 94464 f40757e784769060757a20580cec27972dd97f4a
parent 94463 6e9a4af5c92054bba47aad80e19ffbee7875d22d
child 94465 748db85b1a01b04023ca5a7593842adbc7b28d52
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs742261
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 742261 - Remove useless queryCommandText/execCommandShowHelp methods; r=ehsan
content/html/document/src/nsHTMLDocument.cpp
content/html/document/test/Makefile.in
content/html/document/test/test_bug742261.html
dom/interfaces/html/nsIDOMHTMLDocument.idl
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -3119,32 +3119,16 @@ nsHTMLDocument::ExecCommand(const nsAStr
     rv = cmdMgr->DoCommand(cmdToDispatch.get(), cmdParams, window);
   }
 
   *_retval = NS_SUCCEEDED(rv);
 
   return rv;
 }
 
-/* TODO: don't let this call do anything if the page is not done loading */
-/* boolean execCommandShowHelp(in DOMString commandID); */
-NS_IMETHODIMP
-nsHTMLDocument::ExecCommandShowHelp(const nsAString & commandID,
-                                    bool *_retval)
-{
-  NS_ENSURE_ARG_POINTER(_retval);
-  *_retval = false;
-
-  // if editing is not on, bail
-  if (!IsEditingOnAfterFlush())
-    return NS_ERROR_FAILURE;
-
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 /* boolean queryCommandEnabled(in DOMString commandID); */
 NS_IMETHODIMP
 nsHTMLDocument::QueryCommandEnabled(const nsAString & commandID,
                                     bool *_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = false;
 
@@ -3301,30 +3285,16 @@ nsHTMLDocument::QueryCommandSupported(co
   // commandID is supported if it can be converted to a Midas command
   nsCAutoString cmdToDispatch;
   if (ConvertToMidasInternalCommand(commandID, cmdToDispatch))
     *_retval = true;
 
   return NS_OK;
 }
 
-/* DOMString queryCommandText(in DOMString commandID); */
-NS_IMETHODIMP
-nsHTMLDocument::QueryCommandText(const nsAString & commandID,
-                                 nsAString & _retval)
-{
-  _retval.SetLength(0);
-
-  // if editing is not on, bail
-  if (!IsEditingOnAfterFlush())
-    return NS_ERROR_FAILURE;
-
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 /* DOMString queryCommandValue(in DOMString commandID); */
 NS_IMETHODIMP
 nsHTMLDocument::QueryCommandValue(const nsAString & commandID,
                                   nsAString &_retval)
 {
   _retval.SetLength(0);
 
   // if editing is not on, bail
--- a/content/html/document/test/Makefile.in
+++ b/content/html/document/test/Makefile.in
@@ -101,16 +101,17 @@ include $(topsrcdir)/config/rules.mk
 		test_bug497242.xhtml \
 		test_bug499092.html \
 		bug499092.xml \
 		bug499092.html \
 		test_bug512367.html \
 		test_bug571981.html \
 		test_bug677495.html \
 		test_bug677495-1.html \
+		test_bug742261.html \
 		$(NULL)
 
 ifneq (mobile,$(MOZ_BUILD_APP))
 _BROWSER_TEST_FILES = \
 		browser_bug592641.js \
 		bug592641_img.jpg \
 		$(NULL)
 endif
new file mode 100644
--- /dev/null
+++ b/content/html/document/test/test_bug742261.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=742261
+-->
+<title>Test for Bug 742261</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
+<body>
+<script>
+is(document.execCommandShowHelp, undefined,
+   "execCommandShowHelp shouldn't exist");
+is(document.queryCommandText, undefined,
+   "queryCommandText shouldn't exist");
+</script>
--- a/dom/interfaces/html/nsIDOMHTMLDocument.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDocument.idl
@@ -42,17 +42,17 @@
 /**
  * The nsIDOMHTMLDocument interface is the interface to a [X]HTML
  * document object.
  *
  * @see <http://www.whatwg.org/html/>
  */
 interface nsISelection;
 
-[scriptable, uuid(0d59c4f0-2272-4a72-8197-da6f86353ec1)]
+[scriptable, uuid(3dae5807-3615-4567-913f-c3956a2aa251)]
 interface nsIDOMHTMLDocument : nsIDOMDocument
 {
   readonly attribute DOMString            URL;
            attribute DOMString            domain;
            attribute DOMString            cookie;
   // returns "BackCompat" if we're in quirks mode,
   // or "CSS1Compat" if we're in strict mode
   readonly attribute DOMString            compatMode;
@@ -89,34 +89,28 @@ interface nsIDOMHTMLDocument : nsIDOMDoc
    * Midas additions
    */
   attribute DOMString       designMode;
 
   boolean                   execCommand(in DOMString commandID,
                                         [optional] in boolean doShowUI,
                                         [optional] in DOMString value);
 
-  // returns true if the help is being shown for command (false if not)
-  boolean                   execCommandShowHelp(in DOMString commandID);
-
   // returns true if the command is enabled (false otherwise)
   boolean                   queryCommandEnabled(in DOMString commandID);
   
   // returns true if the command is in a indeterminate state (false otherwise)
   boolean                   queryCommandIndeterm(in DOMString commandID);
 
   // returns true if the command has been executed (false otherwise)
   boolean                   queryCommandState(in DOMString commandID);
 
   // returns true if the command is supported on the current range
   boolean                   queryCommandSupported(in DOMString commandID);
 
-  //
-  DOMString                 queryCommandText(in DOMString commandID);
-
   // returns the current value of the document or current selection for command
   DOMString                 queryCommandValue(in DOMString commandID);
 
 
   // Obsolete APIs
            attribute DOMString            fgColor;
            attribute DOMString            bgColor;
            attribute DOMString            linkColor;