Bug 674578 - Support resizer[dir="bottomstart"].
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 29 Jul 2011 11:38:41 +0200
changeset 73536 880d9e9ab428fd331658b14c2c1d05a6fe3a41d0
parent 73535 f839abc8f1503c22dbe2183ee568fae277f05b9d
child 73537 6e4e476f00772e57fbdb453ef61e6e753fe982fe
push id20885
push usereakhgari@mozilla.com
push dateFri, 29 Jul 2011 15:46:16 +0000
treeherdermozilla-central@8fb752f5e1fa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs674578
milestone8.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 674578 - Support resizer[dir="bottomstart"]. r=enn
content/base/src/nsGkAtomList.h
layout/reftests/native-theme/reftest.list
layout/reftests/native-theme/resizer-bottomleft.xul
layout/reftests/native-theme/resizer-bottomstart-rtl.xul
layout/reftests/native-theme/resizer-bottomstart.xul
layout/reftests/native-theme/resizer-left.xul
layout/xul/base/src/nsResizerFrame.cpp
toolkit/themes/pinstripe/global/resizer.css
toolkit/themes/winstripe/global/resizer.css
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -149,16 +149,17 @@ GK_ATOM(blockquote, "blockquote")
 GK_ATOM(blur, "blur")
 GK_ATOM(body, "body")
 GK_ATOM(boolean, "boolean")
 GK_ATOM(border, "border")
 GK_ATOM(bordercolor, "bordercolor")
 GK_ATOM(both, "both")
 GK_ATOM(bottom, "bottom")
 GK_ATOM(bottomend, "bottomend")
+GK_ATOM(bottomstart, "bottomstart")
 GK_ATOM(bottomleft, "bottomleft")
 GK_ATOM(bottommargin, "bottommargin")
 GK_ATOM(bottompadding, "bottompadding")
 GK_ATOM(bottomright, "bottomright")
 GK_ATOM(box, "box")
 GK_ATOM(br, "br")
 GK_ATOM(braille, "braille")
 GK_ATOM(broadcast, "broadcast")
--- a/layout/reftests/native-theme/reftest.list
+++ b/layout/reftests/native-theme/reftest.list
@@ -46,22 +46,30 @@ fails-if(Android) != 492155-4.html about
 != box-shadow-listbox.html box-shadow-listbox-ref.html
 != box-shadow-combobox.html box-shadow-combobox-ref.html
 
 # RTL mirroring tests
 == checkbox-not-mirrored-when-rtl.html checkbox-not-mirrored-when-rtl-ref.html
 skip-if(!cocoaWidget) == menulist-mirrored-when-rtl.xul menulist-mirrored-when-rtl-ref.xul
 skip-if(!cocoaWidget) == searchfield-mirrored-when-rtl.xul searchfield-mirrored-when-rtl-ref.xul
 skip-if(!cocoaWidget) == select-mirrored-when-rtl.html select-mirrored-when-rtl-ref.html
+
 != resizer-bottomend.xul blank-window.xul
 random-if(d2d) == resizer-bottomend.xul resizer-bottomright.xul # bug 581086 
 != resizer-bottomend.xul resizer-bottomend-rtl.xul
 skip-if(gtk2Widget) != resizer-bottomend-rtl.xul blank-window.xul
 skip-if(gtk2Widget) random-if(d2d) == resizer-bottomend-rtl.xul resizer-bottomend-flipped.xul # bug 581086
 
+!= resizer-bottomstart.xul blank-window.xul
+random-if(d2d) == resizer-bottomstart.xul resizer-bottomleft.xul
+random-if(d2d) == resizer-bottomstart.xul resizer-left.xul
+!= resizer-bottomstart.xul resizer-bottomstart-rtl.xul
+skip-if(gtk2Widget) != resizer-bottomstart-rtl.xul blank-window.xul
+skip-if(gtk2Widget) random-if(d2d) == resizer-bottomstart-rtl.xul resizer-bottomend.xul
+
 # Windows-only, depends on native scrollbar metrics
 skip-if(!winWidget) == scroll-thumb-minimum-size-notheme.html scroll-thumb-minimum-size-notheme-ref.html
 # skip-if(!winWidget) == scroll-thumb-minimum-size-theme.html scroll-thumb-minimum-size-theme-ref.html # Bug 512206
 
 == border-radius.html border-radius-ref.html
 
 == checkbox-dynamic-1.html checkbox-dynamic-1-ref.html
 
new file mode 100644
--- /dev/null
+++ b/layout/reftests/native-theme/resizer-bottomleft.xul
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+
+<window title="Resizer"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+  <hbox>
+    <resizer dir="bottomleft"/>
+    <spacer flex="1"/>
+  </hbox>
+</window>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/native-theme/resizer-bottomstart-rtl.xul
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+
+<window title="Resizer"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+  <hbox>
+    <resizer dir="bottomstart" style="direction: rtl"/>
+    <spacer flex="1"/>
+  </hbox>
+</window>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/native-theme/resizer-bottomstart.xul
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+
+<window title="Resizer"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+  <hbox>
+    <resizer dir="bottomstart"/>
+    <spacer flex="1"/>
+  </hbox>
+</window>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/native-theme/resizer-left.xul
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+
+<window title="Resizer"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+  <hbox>
+    <resizer dir="left"/>
+    <spacer flex="1"/>
+  </hbox>
+</window>
--- a/layout/xul/base/src/nsResizerFrame.cpp
+++ b/layout/xul/base/src/nsResizerFrame.cpp
@@ -325,18 +325,18 @@ nsResizerFrame::HandleEvent(nsPresContex
     break;
   }
 
   if (!doDefault)
     *aEventStatus = nsEventStatus_eConsumeNoDefault;
 
   if (doDefault && weakFrame.IsAlive())
     return nsTitleBarFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
-  else
-    return NS_OK;
+
+  return NS_OK;
 }
 
 nsIContent*
 nsResizerFrame::GetContentToResize(nsIPresShell* aPresShell, nsIBaseWindow** aWindow)
 {
   *aWindow = nsnull;
 
   nsAutoString elementid;
@@ -422,24 +422,24 @@ nsResizerFrame::AdjustDimensions(PRInt32
  */
 nsResizerFrame::Direction
 nsResizerFrame::GetDirection()
 {
   static const nsIContent::AttrValuesArray strings[] =
     {&nsGkAtoms::topleft,    &nsGkAtoms::top,    &nsGkAtoms::topright,
      &nsGkAtoms::left,                           &nsGkAtoms::right,
      &nsGkAtoms::bottomleft, &nsGkAtoms::bottom, &nsGkAtoms::bottomright,
-                                                 &nsGkAtoms::bottomend,
+     &nsGkAtoms::bottomstart,                    &nsGkAtoms::bottomend,
      nsnull};
 
   static const Direction directions[] =
     {{-1, -1}, {0, -1}, {1, -1},
      {-1,  0},          {1,  0},
      {-1,  1}, {0,  1}, {1,  1},
-                        {1,  1}
+     {-1,  1},          {1,  1}
     };
 
   if (!GetContent())
     return directions[0]; // default: topleft
 
   PRInt32 index = GetContent()->FindAttrValueIn(kNameSpaceID_None,
                                                 nsGkAtoms::dir,
                                                 strings, eCaseMatters);
--- a/toolkit/themes/pinstripe/global/resizer.css
+++ b/toolkit/themes/pinstripe/global/resizer.css
@@ -12,17 +12,24 @@ resizer[type="window"] {
   display: none;
 }
 
 resizer[rtl="true"],
 resizer[dir="bottomend"]:-moz-locale-dir(rtl) {
   background: url("chrome://global/skin/icons/resizer-rtl.png") no-repeat;
 }
 
+resizer[dir="left"],
 resizer[dir="bottomleft"],
+resizer[dir="bottomstart"] {
+  -moz-transform: scaleX(-1);
+}
+
+resizer[dir="bottomleft"],
+resizer[dir="bottomstart"]:not([rtl="true"]):not(:-moz-locale-dir(rtl)),
 resizer[dir="bottomend"][rtl="true"] {
   cursor: sw-resize;
 }
 
 resizer[dir="top"],
 resizer[dir="bottom"] {
   cursor: ns-resize;
 }
--- a/toolkit/themes/winstripe/global/resizer.css
+++ b/toolkit/themes/winstripe/global/resizer.css
@@ -8,17 +8,24 @@ resizer {
   height: 15px;
 }
 
 resizer[rtl="true"],
 resizer[dir="bottomend"]:-moz-locale-dir(rtl) {
   background: url("chrome://global/skin/icons/resizer-rtl.png") no-repeat;
 }
 
+resizer[dir="left"],
 resizer[dir="bottomleft"],
+resizer[dir="bottomstart"] {
+  -moz-transform: scaleX(-1);
+}
+
+resizer[dir="bottomleft"],
+resizer[dir="bottomstart"]:not([rtl="true"]):not(:-moz-locale-dir(rtl)),
 resizer[dir="bottomend"][rtl="true"] {
   cursor: sw-resize;
 }
 
 resizer[dir="top"],
 resizer[dir="bottom"] {
   cursor: ns-resize;
 }