Bug 585877 - Remove support for document.width and document.height; r=jonas sr=jst
authorMs2ger <ms2ger@gmail.com>
Sun, 17 Apr 2011 10:57:17 +0200
changeset 68212 c551b62cf2e8b505b8d10cb719c8f1e02f266558
parent 68211 2befee0930502486416cf132a397903f1002d1c6
child 68213 5c5d9ed49e5e1a0ae50d5eb5bf349444a2817291
push idunknown
push userunknown
push dateunknown
reviewersjonas, jst
bugs585877
milestone6.0a1
first release with
nightly win64
c551b62cf2e8 / 6.0a1 / 20110417030205 / files
nightly linux32
nightly linux64
nightly mac
nightly win32
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly win64
Bug 585877 - Remove support for document.width and document.height; r=jonas sr=jst * * * try: -b do -p all -u mochitest-o -t none
content/html/document/src/nsHTMLDocument.cpp
dom/interfaces/html/nsIDOMNSHTMLDocument.idl
dom/locales/en-US/chrome/dom/dom.properties
js/src/xpconnect/src/dom_quickstubs.qsconf
toolkit/components/console/hudservice/tests/browser/Makefile.in
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595934_message_categories.js
toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-events-external.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-events-external.js
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -2314,68 +2314,16 @@ nsHTMLDocument::RemovedForm()
 }
 
 PRInt32
 nsHTMLDocument::GetNumFormsSynchronous()
 {
   return mNumForms;
 }
 
-nsresult
-nsHTMLDocument::GetBodySize(PRInt32* aWidth,
-                            PRInt32* aHeight)
-{
-  *aWidth = *aHeight = 0;
-
-  FlushPendingNotifications(Flush_Layout);
-
-  // Find the <body> element: this is what we'll want to use for the
-  // document's width and height values.
-  Element* body = GetBodyElement();
-  if (!body) {
-    return NS_OK;
-  }
-
-  // Now grab its frame
-  nsIFrame* frame = body->GetPrimaryFrame();
-  if (!frame)
-    return NS_OK;
-  
-  nsSize size = frame->GetSize();
-
-  *aWidth = nsPresContext::AppUnitsToIntCSSPixels(size.width);
-  *aHeight = nsPresContext::AppUnitsToIntCSSPixels(size.height);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHTMLDocument::GetWidth(PRInt32* aWidth)
-{
-  NS_ENSURE_ARG_POINTER(aWidth);
-  if (!mWarnedWidthHeight) {
-    ReportUseOfDeprecatedMethod(this, "UseOfDocumentWidthWarning");
-    mWarnedWidthHeight = true;
-  }
-  PRInt32 height;
-  return GetBodySize(aWidth, &height);
-}
-
-NS_IMETHODIMP
-nsHTMLDocument::GetHeight(PRInt32* aHeight)
-{
-  NS_ENSURE_ARG_POINTER(aHeight);
-  if (!mWarnedWidthHeight) {
-    ReportUseOfDeprecatedMethod(this, "UseOfDocumentHeightWarning");
-    mWarnedWidthHeight = true;
-  }
-  PRInt32 width;
-  return GetBodySize(&width, aHeight);
-}
-
 NS_IMETHODIMP
 nsHTMLDocument::GetAlinkColor(nsAString& aAlinkColor)
 {
   aAlinkColor.Truncate();
 
   nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(GetBodyElement());
   if (body) {
     body->GetALink(aAlinkColor);
--- a/dom/interfaces/html/nsIDOMNSHTMLDocument.idl
+++ b/dom/interfaces/html/nsIDOMNSHTMLDocument.idl
@@ -34,21 +34,19 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "domstubs.idl"
 
-[scriptable, uuid(95cd5ad4-ae8a-4f0e-b168-35e03d5e0b9a)]
+[scriptable, uuid(386e9eee-1f06-40a6-a1a7-ed986646b793)]
 interface nsIDOMNSHTMLDocument : nsISupports
 {
-  readonly attribute long                 width;
-  readonly attribute long                 height;
            attribute DOMString            alinkColor;
            attribute DOMString            linkColor;
            attribute DOMString            vlinkColor;
            attribute DOMString            bgColor;
            attribute DOMString            fgColor;
            attribute DOMString            domain;
 
   readonly attribute nsIDOMHTMLCollection embeds;
--- a/dom/locales/en-US/chrome/dom/dom.properties
+++ b/dom/locales/en-US/chrome/dom/dom.properties
@@ -70,10 +70,8 @@ FormValidationCheckboxMissing=Please che
 FormValidationRadioMissing=Please select one of these options.
 FormValidationFileMissing=Please select a file.
 FormValidationSelectMissing=Please select an item in the list.
 FormValidationInvalidEmail=Please enter an email address.
 FormValidationInvalidURL=Please enter a URL.
 FormValidationPatternMismatch=Please match the requested format.
 # LOCALIZATION NOTE (FormValidationPatternMismatchWithTitle): %S is the (possibly truncated) title attribute value.
 FormValidationPatternMismatchWithTitle=Please match the requested format: %S.
-UseOfDocumentWidthWarning=Non-standard document.width was used. Use standard document.body.clientWidth instead.
-UseOfDocumentHeightWarning=Non-standard document.height was used. Use standard document.body.clientHeight instead.
--- a/js/src/xpconnect/src/dom_quickstubs.qsconf
+++ b/js/src/xpconnect/src/dom_quickstubs.qsconf
@@ -324,18 +324,16 @@ members = [
     'nsIDOMHTMLTextAreaElement.value',
     'nsIDOMHTMLTextAreaElement.type',
     'nsIDOMHTMLTextAreaElement.select',
     'nsIDOMHTMLTitleElement.text',
     'nsIDOMHTMLCanvasElement.width',
     'nsIDOMHTMLCanvasElement.height',
     'nsIDOMHTMLCanvasElement.getContext',
     'nsIDOMHTMLCanvasElement.toDataURL',
-    'nsIDOMNSHTMLDocument.width',
-    'nsIDOMNSHTMLDocument.height',
     'nsIDOMNSHTMLDocument.domain',
     'nsIDOMNSHTMLDocument.getSelection',
     'nsIDOMNSHTMLDocument.designMode',
     'nsIDOMNSHTMLElement.contentEditable',
     'nsIDOMNSHTMLElement.isContentEditable',
     'nsIDOMNSHTMLElement.offsetParent',
     'nsIDOMNSHTMLElement.innerHTML',
     'nsIDOMNSHTMLElement.offsetLeft',
--- a/toolkit/components/console/hudservice/tests/browser/Makefile.in
+++ b/toolkit/components/console/hudservice/tests/browser/Makefile.in
@@ -160,18 +160,16 @@ include $(topsrcdir)/config/rules.mk
 	test-bug-595934-imagemap.html \
 	test-bug-595934-html.html \
 	test-bug-595934-malformedxml.xhtml \
 	test-bug-595934-svg.xhtml \
 	test-bug-595934-workers.html \
 	test-bug-595934-workers.js \
 	test-bug-595934-dom-html-external.html \
 	test-bug-595934-dom-html-external.js \
-	test-bug-595934-dom-events-external.html \
-	test-bug-595934-dom-events-external.js \
 	test-bug-595934-dom-events-external2.html \
 	test-bug-595934-dom-events-external2.js \
 	test-bug-595934-canvas.html \
 	test-bug-595934-canvas.js \
 	test-bug-595934-css-parser.html \
 	test-bug-595934-css-parser.css \
 	test-bug-595934-canvas-css.html \
 	test-bug-595934-canvas-css.js \
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595934_message_categories.js
+++ b/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595934_message_categories.js
@@ -54,21 +54,17 @@ const TESTS = [
     category: "DOM Worker javascript",
     matchString: "fooBarWorker",
   },
   { // #8
     file: "test-bug-595934-dom-html-external.html",
     category: "DOM:HTML",
     matchString: "document.all",
   },
-  { // #9
-    file: "test-bug-595934-dom-events-external.html",
-    category: "DOM Events",
-    matchString: "clientWidth",
-  },
+  // #9 was a warning about document.width, for which support has been removed.
   { // #10
     file: "test-bug-595934-dom-events-external2.html",
     category: "DOM Events",
     matchString: "preventBubble()",
   },
   { // #11
     file: "test-bug-595934-canvas.html",
     category: "Canvas",
deleted file mode 100644
--- a/toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-events-external.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-  <head>
-    <title>Web Console test for bug 595934 - category: DOM Events.
-      (external script)</title>
-<!-- Any copyright is dedicated to the Public Domain.
-     http://creativecommons.org/publicdomain/zero/1.0/ -->
-    <script type="text/javascript"
-      src="test-bug-595934-dom-events-external.js"></script>
-  </head>
-  <body>
-    <p>Web Console test for bug 595934 - category "DOM Events" (external
-    script).</p>
-  </body>
-</html>
deleted file mode 100644
--- a/toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-events-external.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-window.addEventListener("DOMContentLoaded", function() {
-  document.width;
-}, false);
-