Bug 475197. box-shadow should work on file input controls. r+sr=roc
authorMichael Ventnor <ventron.bugzilla@gmail.com>
Fri, 30 Jan 2009 20:10:25 +1300
changeset 24442 00f74e51fe52cead922fe34802b5fd541a33e3a3
parent 24441 02dd72d71d837f0a4079c8ec5d6bed137e805d1f
child 24443 75657a88c0635ddd33a91841fd9e4b82df8f4ae3
push idunknown
push userunknown
push dateunknown
bugs475197
milestone1.9.2a1pre
Bug 475197. box-shadow should work on file input controls. r+sr=roc
layout/forms/nsFileControlFrame.cpp
layout/reftests/box-shadow/boxshadow-fileupload-ref.html
layout/reftests/box-shadow/boxshadow-fileupload.html
layout/reftests/box-shadow/reftest.list
--- a/layout/forms/nsFileControlFrame.cpp
+++ b/layout/forms/nsFileControlFrame.cpp
@@ -543,16 +543,23 @@ nsFileControlFrame::GetFormProperty(nsIA
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                      const nsRect&           aDirtyRect,
                                      const nsDisplayListSet& aLists)
 {
+  // box-shadow
+  if (GetStyleBorder()->mBoxShadow) {
+    nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
+        nsDisplayBoxShadow(this));
+    NS_ENSURE_SUCCESS(rv, rv);
+  }
+
   // Our background is inherited to the text input, and we don't really want to
   // paint it or out padding and borders (which we never have anyway, per
   // styles in forms.css) -- doing it just makes us look ugly in some cases and
   // has no effect in others.
   nsDisplayListCollection tempList;
   nsresult rv = nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, tempList);
   if (NS_FAILED(rv))
     return rv;
new file mode 100644
--- /dev/null
+++ b/layout/reftests/box-shadow/boxshadow-fileupload-ref.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html><head>
+
+<style>
+#s {
+  position: absolute;
+  top: 20px;
+  left: 20px;
+  display: block;
+  width: 400px;
+  height: 150px;
+}
+
+#p {
+  background-color: black;
+  width: 400px;
+  height: 150px;
+  position: absolute;
+  top: 270px;
+  left: 20px;
+}
+</style>
+
+</head>
+<body>
+
+<input type="file" id="s" />
+<div id="p">&nbsp;</div>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/box-shadow/boxshadow-fileupload.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<html><head>
+
+<style>
+#s {
+  position: absolute;
+  top: 20px;
+  left: 20px;
+  display: block;
+  width: 400px;
+  height: 150px;
+  -moz-box-shadow: 0px 250px black;
+}
+</style>
+
+</head>
+<body>
+
+<input type="file" id="s" />
+
+</body>
+</html>
--- a/layout/reftests/box-shadow/reftest.list
+++ b/layout/reftests/box-shadow/reftest.list
@@ -2,8 +2,9 @@
 != boxshadow-blur.html boxshadow-blur-notref.html
 == boxshadow-multiple.html boxshadow-multiple-ref.html
 == boxshadow-spread.html boxshadow-spread-ref.html
 == tableboxshadow-basic.html tableboxshadow-basic-ref.html
 == tableboxshadow-trshadow.html tableboxshadow-trshadow-ref.html
 == tableboxshadow-tdshadow.html tableboxshadow-tdshadow-ref.html
 == boxshadow-rounding.html boxshadow-rounding-ref.html
 == boxshadow-button.html boxshadow-button-ref.html
+== boxshadow-fileupload.html boxshadow-fileupload-ref.html