From 021ac6f2d9655ef3c1ee133d96daca5f59499818 Mon Sep 17 00:00:00 2001 From: "jwalden@mit.edu" Date: Fri, 14 Mar 2008 11:45:32 -0700 Subject: [PATCH] Bug 199692 - Update and reenable the document.elementFromPoint tests that didn't work when initially committed due to window sizing issues; there may still be some issues, but we'll todo aggressively in followup commits if necessary -- better halfway in than not at all. Patch is partly me, partly Ben Karel , r from Ben and r=roc. a=itsatest --- content/html/document/test/Makefile.in | 6 +- .../document/test/bug199692-nested-d2.html | 3 +- .../html/document/test/bug199692-nested.html | 3 +- .../html/document/test/bug199692-popup.html | 188 ++++++++++++++++++ .../document/test/bug199692-scrolled.html | 34 ++++ .../html/document/test/test_bug199692.html | 108 +--------- dom/public/idl/core/nsIDOMNSDocument.idl | 9 +- 7 files changed, 239 insertions(+), 112 deletions(-) create mode 100644 content/html/document/test/bug199692-popup.html create mode 100644 content/html/document/test/bug199692-scrolled.html diff --git a/content/html/document/test/Makefile.in b/content/html/document/test/Makefile.in index 1a408fff9cf..76e8e0beefc 100644 --- a/content/html/document/test/Makefile.in +++ b/content/html/document/test/Makefile.in @@ -44,13 +44,13 @@ relativesrcdir = content/html/document/test include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk -# Add this back when this test passes again; it seems to fail right now when -# run inside an iframe, oddly, but not when run at top-level. -# test_bug199692.html _TEST_FILES = test_bug1682.html \ test_bug1823.html \ + test_bug199692.html \ bug199692-nested.html \ bug199692-nested-d2.html \ + bug199692-popup.html \ + bug199692-scrolled.html \ test_bug172261.html \ test_bug255820.html \ test_bug259332.html \ diff --git a/content/html/document/test/bug199692-nested-d2.html b/content/html/document/test/bug199692-nested-d2.html index 86c61795695..70064efe74b 100644 --- a/content/html/document/test/bug199692-nested-d2.html +++ b/content/html/document/test/bug199692-nested-d2.html @@ -1,9 +1,10 @@ - + + Nested, nested iframe for bug 199692 tests diff --git a/content/html/document/test/bug199692-nested.html b/content/html/document/test/bug199692-nested.html index 5eef6a3fe2b..27201a953de 100644 --- a/content/html/document/test/bug199692-nested.html +++ b/content/html/document/test/bug199692-nested.html @@ -1,9 +1,10 @@ - + + Nested iframe for bug 199692 tests diff --git a/content/html/document/test/bug199692-popup.html b/content/html/document/test/bug199692-popup.html new file mode 100644 index 00000000000..29512823eb3 --- /dev/null +++ b/content/html/document/test/bug199692-popup.html @@ -0,0 +1,188 @@ + + + + + + Popup in test for Bug 199692 + + + + + +Mozilla Bug 199692 + +
+ + +
txt
+ + +
+ + +

+ + +static + + +
float
+ + +fixed + + +abs + + +
rel
+ + +
+ +
+ + + + + +
+ + + + + + + + diff --git a/content/html/document/test/bug199692-scrolled.html b/content/html/document/test/bug199692-scrolled.html new file mode 100644 index 00000000000..f13bf7ab121 --- /dev/null +++ b/content/html/document/test/bug199692-scrolled.html @@ -0,0 +1,34 @@ + + + + + Scrolled page for bug 199692 tests + + + + + +
first
+
second
+ + + diff --git a/content/html/document/test/test_bug199692.html b/content/html/document/test/test_bug199692.html index d282aaadb4c..9729f3bdc08 100644 --- a/content/html/document/test/test_bug199692.html +++ b/content/html/document/test/test_bug199692.html @@ -1,4 +1,4 @@ - + -Mozilla Bug 199692 - -
- - -
txt
- - -
- - -

- - -static - - -
float
- - -fixed - - -abs - - -
rel
- - -
- -
- - - - - -
-
-
-
+ // The popup calls MochiTest methods in this window through window.opener + window.open("bug199692-popup.html", "bug199692", "width=600,height=600"); + diff --git a/dom/public/idl/core/nsIDOMNSDocument.idl b/dom/public/idl/core/nsIDOMNSDocument.idl index 536419a639c..02243bead88 100644 --- a/dom/public/idl/core/nsIDOMNSDocument.idl +++ b/dom/public/idl/core/nsIDOMNSDocument.idl @@ -72,8 +72,9 @@ interface nsIDOMNSDocument : nsISupports nsIDOMNodeList getElementsByClassName(in DOMString classes); /** - * Returns the element visible at the given point, relative to the - * upper-left-most visible point in the document. + * Returns the element from the caller's document at the given point, + * relative to the upper-left-most point in the (possibly scrolled) + * window or frame. * * If the element at the given point belongs to another document (such as * an iframe's subdocument), the element in the calling document's DOM @@ -81,8 +82,8 @@ interface nsIDOMNSDocument : nsISupports * anonymous or XBL generated content, such as a textbox's scrollbars, then * the first non-anonymous parent element (that is, the textbox) is returned. * - * If the specified point is outside the visible portion of the document, - * or either coordinate is negative, this method returns null. + * This method returns null if either coordinate is negative, or if the + * specified point lies outside the visible bounds of the document. * * Callers from XUL documents should wait until the onload event has fired * before calling this method.