mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 23:23:33 +00:00
Bug 1698821 - Simplify native-appearance-disabling for number spinners. r=dholbert
The root cause of this bug is that we're now accidentally using the native theme for the spinners because GetNumberControlFrameForSpinButton broke with my changes. These pseudos are not exposed to content, and there's just one user of this pseudo-class (the print.css one). So just disable native appearance explicitly and remove that check. Differential Revision: https://phabricator.services.mozilla.com/D108653
This commit is contained in:
parent
4e97659d91
commit
e65533e909
@ -188,28 +188,6 @@ bool nsNumberControlFrame::SpinnerDownButtonIsDepressed() const {
|
||||
->NumberSpinnerDownButtonIsDepressed();
|
||||
}
|
||||
|
||||
#define STYLES_DISABLING_NATIVE_THEMING \
|
||||
NS_AUTHOR_SPECIFIED_BORDER_OR_BACKGROUND | NS_AUTHOR_SPECIFIED_PADDING
|
||||
|
||||
bool nsNumberControlFrame::ShouldUseNativeStyleForSpinner() const {
|
||||
MOZ_ASSERT(mSpinUp && mSpinDown,
|
||||
"We should not be called when we have no spinner");
|
||||
|
||||
nsIFrame* spinUpFrame = mSpinUp->GetPrimaryFrame();
|
||||
nsIFrame* spinDownFrame = mSpinDown->GetPrimaryFrame();
|
||||
|
||||
return spinUpFrame &&
|
||||
spinUpFrame->StyleDisplay()->EffectiveAppearance() ==
|
||||
StyleAppearance::SpinnerUpbutton &&
|
||||
!PresContext()->HasAuthorSpecifiedRules(
|
||||
spinUpFrame, STYLES_DISABLING_NATIVE_THEMING) &&
|
||||
spinDownFrame &&
|
||||
spinDownFrame->StyleDisplay()->EffectiveAppearance() ==
|
||||
StyleAppearance::SpinnerDownbutton &&
|
||||
!PresContext()->HasAuthorSpecifiedRules(
|
||||
spinDownFrame, STYLES_DISABLING_NATIVE_THEMING);
|
||||
}
|
||||
|
||||
void nsNumberControlFrame::AppendAnonymousContentTo(
|
||||
nsTArray<nsIContent*>& aElements, uint32_t aFilter) {
|
||||
if (mSpinBox) {
|
||||
|
@ -292,6 +292,7 @@ input[type="number"].photon-number::-moz-number-spin-down {
|
||||
background-position: center;
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
input[type="number"].photon-number::-moz-number-spin-up {
|
||||
|
@ -46,9 +46,13 @@ NS_IMPL_ISUPPORTS(nsNativeTheme, nsITimerCallback, nsINamed)
|
||||
bool isXULCheckboxRadio = (aAppearance == StyleAppearance::Checkbox ||
|
||||
aAppearance == StyleAppearance::Radio) &&
|
||||
aFrame->GetContent()->IsXULElement();
|
||||
if (isXULCheckboxRadio) aFrame = aFrame->GetParent();
|
||||
if (isXULCheckboxRadio) {
|
||||
aFrame = aFrame->GetParent();
|
||||
}
|
||||
|
||||
if (!aFrame->GetContent()) return EventStates();
|
||||
if (!aFrame->GetContent()) {
|
||||
return EventStates();
|
||||
}
|
||||
|
||||
nsIContent* frameContent = aFrame->GetContent();
|
||||
EventStates flags;
|
||||
@ -264,15 +268,6 @@ bool nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
if (aAppearance == StyleAppearance::SpinnerUpbutton ||
|
||||
aAppearance == StyleAppearance::SpinnerDownbutton) {
|
||||
nsNumberControlFrame* numberControlFrame =
|
||||
nsNumberControlFrame::GetNumberControlFrameForSpinButton(aFrame);
|
||||
if (numberControlFrame) {
|
||||
return !numberControlFrame->ShouldUseNativeStyleForSpinner();
|
||||
}
|
||||
}
|
||||
|
||||
return nsLayoutUtils::AuthorSpecifiedBorderBackgroundDisablesTheming(
|
||||
aAppearance) &&
|
||||
aFrame->GetContent()->IsHTMLElement() &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user