Bug 605985 part 2 - Make -moz-appearance:none on radio and checkbox inputs make them non-replaced elements. r=dholbert

This commit is contained in:
L. David Baron 2017-02-09 21:22:40 +01:00
Родитель e84ea3a684
Коммит 53a46a6356
2 изменённых файлов: 20 добавлений и 1 удалений

Просмотреть файл

@ -101,6 +101,7 @@
#include "nsBackdropFrame.h"
#include "nsTransitionManager.h"
#include "DetailsFrame.h"
#include "nsThemeConstants.h"
#ifdef MOZ_XUL
#include "nsIRootBox.h"
@ -3704,7 +3705,23 @@ nsCSSFrameConstructor::FindInputData(Element* aElement,
nsCOMPtr<nsIFormControl> control = do_QueryInterface(aElement);
NS_ASSERTION(control, "input doesn't implement nsIFormControl?");
return FindDataByInt(control->GetType(), aElement, aStyleContext,
auto controlType = control->GetType();
// Note that Android/Gonk widgets don't have theming support and thus
// appearance:none is the same as any other appearance value.
// So this chunk doesn't apply there:
#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK)
// radio and checkbox inputs with appearance:none should be constructed
// by display type. (Note that we're not checking that appearance is
// not (respectively) NS_THEME_RADIO and NS_THEME_CHECKBOX.)
if ((controlType == NS_FORM_INPUT_CHECKBOX ||
controlType == NS_FORM_INPUT_RADIO) &&
aStyleContext->StyleDisplay()->mAppearance == NS_THEME_NONE) {
return nullptr;
}
#endif
return FindDataByInt(controlType, aElement, aStyleContext,
sInputData, ArrayLength(sInputData));
}

Просмотреть файл

@ -546,6 +546,7 @@ input[type="file"]:dir(rtl) > xul|label {
/* radio buttons */
input[type="radio"] {
display: inline-block;
-moz-appearance: radio;
margin-block-start: 3px;
margin-block-end: 0px;
@ -555,6 +556,7 @@ input[type="radio"] {
/* check boxes */
input[type="checkbox"] {
display: inline-block;
-moz-appearance: checkbox;
margin-block-start: 3px;
margin-block-end: 3px;