Bug 631337 - Cannot resize the window using the corner resizer when body is position:relative. r=roc a=blocking2.0:final
authorMats Palmgren <matspal@gmail.com>
Thu, 10 Feb 2011 23:38:37 +0100
changeset 62312 a28d7d3ce0f0e8ade62d477559fc9ae14f3a16d3
parent 62311 00678ee61f4ab5f211b1fad940c76e3f8c7c77ac
child 62313 0a9069e1e1b8335db1b4b32c6ef0a8565707e999
push idunknown
push userunknown
push dateunknown
reviewersroc, blocking2
bugs631337
milestone2.0b12pre
Bug 631337 - Cannot resize the window using the corner resizer when body is position:relative. r=roc a=blocking2.0:final
layout/generic/nsGfxScrollFrame.cpp
toolkit/content/xul.css
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1897,27 +1897,27 @@ nsGfxScrollFrameInner::BuildDisplayList(
                             PR_TRUE, mIsRoot);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (mScrollbarsCanOverlapContent) {
     AppendScrollPartsTo(aBuilder, aDirtyRect, aLists,
                        scrollParts, createLayersForScrollbars);
   }
 
-  // Place the resizer in the display list in our Content() list above
-  // scrolled content in the Content() list.
-  // This ensures that the resizer appears above the content and the mouse can
-  // still target the resizer even when scrollbars are hidden.
-  if (HasResizer() && mResizerBox) {
+  if (HasResizer()) {
     rv = mOuter->BuildDisplayListForChild(aBuilder, mResizerBox, aDirtyRect, scrollParts,
                                           nsIFrame::DISPLAY_CHILD_FORCE_STACKING_CONTEXT);
     NS_ENSURE_SUCCESS(rv, rv);
     // DISPLAY_CHILD_FORCE_STACKING_CONTEXT puts everything into the
     // PositionedDescendants list.
-    ::AppendToTop(aBuilder, aLists.Content(),
+    // The resizer is positioned and has maximum z-index; we put it in
+    // PositionedDescendants() for the root frame to ensure that it appears
+    // above all content, bug 631337.
+    ::AppendToTop(aBuilder,
+                  mIsRoot ? aLists.PositionedDescendants() : aLists.Content(),
                   scrollParts.PositionedDescendants(), mResizerBox,
                   createLayersForScrollbars);
   }
 
   return NS_OK;
 }
 
 static void HandleScrollPref(nsIScrollable *aScrollable, PRInt32 aOrientation,
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -894,16 +894,18 @@ menulist > menupopup > menuitem {
 dropmarker {
   -moz-binding: url("chrome://global/content/bindings/general.xml#dropmarker");
 }
 
 /********** resizer **********/
 
 resizer {
   -moz-binding: url("chrome://global/content/bindings/resizer.xml#resizer");
+  position: relative;
+  z-index: 2147483647;
 }
 
 /********** splitter **********/
 
 splitter {
   -moz-binding: url("chrome://global/content/bindings/splitter.xml#splitter");
 }