diff --git a/layout/forms/nsFileControlFrame.cpp b/layout/forms/nsFileControlFrame.cpp index 9c105a53075..eba9c84269e 100644 --- a/layout/forms/nsFileControlFrame.cpp +++ b/layout/forms/nsFileControlFrame.cpp @@ -343,42 +343,7 @@ nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { - // box-shadow - if (StyleBorder()->mBoxShadow) { - aLists.BorderBackground()->AppendNewToTop(new (aBuilder) - nsDisplayBoxShadowOuter(aBuilder, this)); - } - - // Clip height only - nsRect clipRect(aBuilder->ToReferenceFrame(this), GetSize()); - clipRect.width = GetVisualOverflowRect().XMost(); - - nsDisplayListCollection tempList; - { - DisplayListClipState::AutoSaveRestore clipState(aBuilder); - clipState.ClipContainingBlockDescendants(clipRect, nullptr); - - // 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. - nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, tempList); - } - - tempList.BorderBackground()->DeleteAll(); - - tempList.MoveTo(aLists); - - // Disabled file controls don't pass mouse events to their children, so we - // put an invisible item in the display list above the children - // just to catch events - nsEventStates eventStates = mContent->AsElement()->State(); - if (eventStates.HasState(NS_EVENT_STATE_DISABLED) && IsVisibleForPainting(aBuilder)) { - aLists.Content()->AppendNewToTop( - new (aBuilder) nsDisplayEventReceiver(aBuilder, this)); - } - - DisplaySelectionOverlay(aBuilder, aLists.Content()); + BuildDisplayListForInline(aBuilder, aDirtyRect, aLists); } #ifdef ACCESSIBILITY diff --git a/layout/reftests/forms/input/file/input-file-background-ref.xul b/layout/reftests/forms/input/file/input-file-background-ref.xul index d5593b5bbc1..cf5b0c5e482 100644 --- a/layout/reftests/forms/input/file/input-file-background-ref.xul +++ b/layout/reftests/forms/input/file/input-file-background-ref.xul @@ -2,18 +2,15 @@ + + window { + background-color: blue; + } + + - - window { - background-color: blue; - } - Browse… - - - Browse… diff --git a/layout/reftests/forms/input/file/input-file-background.html b/layout/reftests/forms/input/file/input-file-background.html index 6479ef91be8..02af1d143db 100644 --- a/layout/reftests/forms/input/file/input-file-background.html +++ b/layout/reftests/forms/input/file/input-file-background.html @@ -7,7 +7,5 @@ -
- diff --git a/layout/reftests/forms/input/file/input-file-rtl-ref.xul b/layout/reftests/forms/input/file/input-file-rtl-ref.xul index a05051219fd..eb61d45c74e 100644 --- a/layout/reftests/forms/input/file/input-file-rtl-ref.xul +++ b/layout/reftests/forms/input/file/input-file-rtl-ref.xul @@ -3,15 +3,15 @@ + + vbox { + margin-right: 8px; + } + Browse… - - - Browse… - diff --git a/layout/reftests/forms/input/file/input-file-rtl.html b/layout/reftests/forms/input/file/input-file-rtl.html index 986a1b352ec..81e841a1244 100644 --- a/layout/reftests/forms/input/file/input-file-rtl.html +++ b/layout/reftests/forms/input/file/input-file-rtl.html @@ -4,8 +4,5 @@
-
- -
diff --git a/layout/reftests/forms/input/file/input-file-style-ref.xul b/layout/reftests/forms/input/file/input-file-style-ref.xul new file mode 100644 index 00000000000..20af35b4878 --- /dev/null +++ b/layout/reftests/forms/input/file/input-file-style-ref.xul @@ -0,0 +1,25 @@ + + + + + + .file { + background-color: blue; + border: 1px red solid; + width: 400px; + padding: 2px; + margin: 5px; + display: inline-block; + } + + .file > label { + /* color only applies to the label */ + color: white; + } + + + Browse… + + diff --git a/layout/reftests/forms/input/file/input-file-style.html b/layout/reftests/forms/input/file/input-file-style.html new file mode 100644 index 00000000000..76fa4d971d5 --- /dev/null +++ b/layout/reftests/forms/input/file/input-file-style.html @@ -0,0 +1,16 @@ + + + + + + + diff --git a/layout/reftests/forms/input-file-width-clip-ref.html b/layout/reftests/forms/input/file/input-file-width-clip-ref.html similarity index 100% rename from layout/reftests/forms/input-file-width-clip-ref.html rename to layout/reftests/forms/input/file/input-file-width-clip-ref.html diff --git a/layout/reftests/forms/input-file-width-clip-1.html b/layout/reftests/forms/input/file/input-file-width-clip.html similarity index 100% rename from layout/reftests/forms/input-file-width-clip-1.html rename to layout/reftests/forms/input/file/input-file-width-clip.html diff --git a/layout/reftests/forms/input/file/reftest.list b/layout/reftests/forms/input/file/reftest.list index 9d729311b19..ab854dce643 100644 --- a/layout/reftests/forms/input/file/reftest.list +++ b/layout/reftests/forms/input/file/reftest.list @@ -1,4 +1,7 @@ -fails-if(B2G) fuzzy-if(OSX==10.6,8,128) == input-file-simple.html input-file-simple-ref.xul # b2g failure is bug 855352 -fails-if(B2G) fuzzy-if(OSX==10.6,8,114) == input-file-rtl.html input-file-rtl-ref.xul # b2g failure is bug 855352 -fails-if(B2G) fuzzy-if(OSX==10.6,8,128) == input-file-size.html input-file-simple-ref.xul # b2g failure is bug 855352 -fails-if(B2G) fuzzy-if(OSX==10.6,8,128) == input-file-background.html input-file-background-ref.xul # b2g failure is bug 855352 +# B2G failures: bug 855352. +fails-if(B2G) fuzzy-if(OSX==10.6,8,128) == input-file-simple.html input-file-simple-ref.xul +fails-if(B2G) fuzzy-if(OSX==10.6,8,64) == input-file-rtl.html input-file-rtl-ref.xul +fails-if(B2G) fuzzy-if(OSX==10.6,8,128) == input-file-size.html input-file-simple-ref.xul +fails-if(B2G) fuzzy-if(OSX==10.6,8,64) == input-file-background.html input-file-background-ref.xul +fails-if(B2G) == input-file-style.html input-file-style-ref.xul +!= input-file-width-clip.html input-file-width-clip-ref.html diff --git a/layout/reftests/forms/input/file/style.css b/layout/reftests/forms/input/file/style.css index c6e13abb4a4..63fddfd4730 100644 --- a/layout/reftests/forms/input/file/style.css +++ b/layout/reftests/forms/input/file/style.css @@ -1,10 +1,10 @@ -vbox { - margin: 8px; +vbox, hbox { + margin-top: 8px; + margin-left: 8px; + display: block; } .file { - display: inline; - /* Copy of input properties that apply of forms.css below this */ color: -moz-FieldText; font: -moz-field; @@ -19,22 +19,23 @@ vbox { text-shadow: none; /* Copy of the type=file part of forms.css below this */ - -moz-appearance: none; + display: inline; /* this one isn't really a copy... */ white-space: nowrap; - cursor: default; + overflow:hidden; + + -moz-appearance: none; -moz-binding: none; - + cursor: default; border: none; - background-color: none; - - padding: 0 !important; + background-color: transparent; + padding: 0; } .file > label { display: inline-block; /* Copy from forms.css below this */ - width: 12em; + min-width: 12em; -moz-padding-start: 5px; color: inherit; diff --git a/layout/reftests/forms/reftest.list b/layout/reftests/forms/reftest.list index b0ec7ddb54e..8e012aaa90f 100644 --- a/layout/reftests/forms/reftest.list +++ b/layout/reftests/forms/reftest.list @@ -2,7 +2,6 @@ == checkbox-label-dynamic.html checkbox-label-dynamic-ref.html skip-if(B2G) fails-if(Android) == checkbox-radio-stretched.html checkbox-radio-stretched-ref.html # test for bug 464589 -skip-if(B2G) == input-file-width-clip-1.html input-file-width-clip-ref.html # test for bug 409587 == input-hidden-border.html about:blank == input-text-bounds-1.html input-text-bounds-1-ref.html == input-text-size-1.html input-text-size-1-ref.html diff --git a/layout/style/forms.css b/layout/style/forms.css index 44abee5b06e..c0f879fb293 100644 --- a/layout/style/forms.css +++ b/layout/style/forms.css @@ -411,20 +411,22 @@ input[type="image"]:-moz-focusring { /* file selector */ input[type="file"] { - -moz-appearance: none; + display: inline-block; white-space: nowrap; - cursor: default; + overflow:hidden; + + /* Revert rules which apply on all inputs. */ + -moz-appearance: none; -moz-binding: none; + cursor: default; border: none; background-color: transparent; - - /* TODO: check why. */ - padding: 0 !important; + padding: 0; } input[type="file"] > xul|label { - width: 12em; + min-width: 12em; -moz-padding-start: 5px; color: inherit;