From 33b8a6dacd034cec0085aa0904819acee07e5ada Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Tue, 14 Aug 2018 08:37:37 +0000 Subject: [PATCH] Bug 1483090 - Rename StyleUserInterface to StyleUI. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D3276 --HG-- extra : moz-landing-system : lando --- dom/base/nsFocusManager.cpp | 2 +- dom/events/EventStateManager.cpp | 4 ++-- dom/html/HTMLOptGroupElement.cpp | 2 +- dom/html/nsGenericHTMLElement.cpp | 3 +-- dom/xul/nsXULPopupListener.cpp | 2 +- layout/base/nsCaret.cpp | 5 ++--- layout/doc/adding-style-props.html | 2 +- layout/forms/nsImageControlFrame.cpp | 2 +- layout/generic/nsFrame.cpp | 12 +++++------ layout/generic/nsFrame.h | 2 +- layout/generic/nsImageFrame.cpp | 3 +-- layout/generic/nsSubDocumentFrame.cpp | 2 +- layout/generic/nsTextFrame.cpp | 2 +- layout/ipc/RenderFrameParent.cpp | 2 +- layout/painting/nsDisplayList.cpp | 2 +- layout/style/ComputedStyle.cpp | 2 +- layout/style/ServoBindings.cpp | 5 ++--- layout/style/ServoBindings.h | 5 ++--- layout/style/ServoBindings.toml | 4 ++-- layout/style/nsCSSVisitedDependentPropList.h | 2 +- layout/style/nsComputedDOMStyle.cpp | 10 +++++----- layout/style/nsStyleConsts.h | 2 +- layout/style/nsStyleStruct.cpp | 20 +++++++++---------- layout/style/nsStyleStruct.h | 12 +++++------ layout/style/nsStyleStructInlines.h | 4 ++-- layout/style/nsStyleStructList.h | 2 +- layout/svg/nsSVGImageFrame.cpp | 2 +- layout/svg/nsSVGUtils.cpp | 2 +- layout/xul/tree/nsTreeBodyFrame.cpp | 3 +-- .../properties/longhands/inherited_ui.mako.rs | 2 +- widget/cocoa/nsNativeThemeCocoa.mm | 2 +- widget/nsNativeTheme.cpp | 6 ++---- widget/windows/nsNativeThemeWin.cpp | 8 ++++---- 33 files changed, 66 insertions(+), 74 deletions(-) diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index bd0c985595e1..4184c84fc18b 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -1630,7 +1630,7 @@ nsFocusManager::CheckIfFocusable(Element* aElement, uint32_t aFlags) // offscreen browsers can still be focused. nsIDocument* subdoc = doc->GetSubDocumentFor(aElement); if (subdoc && IsWindowVisible(subdoc->GetWindow())) { - const nsStyleUserInterface* ui = frame->StyleUserInterface(); + const nsStyleUI* ui = frame->StyleUI(); int32_t tabIndex = (ui->mUserFocus == StyleUserFocus::Ignore || ui->mUserFocus == StyleUserFocus::None) ? -1 : 0; return aElement->IsFocusable(&tabIndex, aFlags & FLAG_BYMOUSE) ? aElement : nullptr; diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 58feef4dad20..cf0ee02bc2aa 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -3191,7 +3191,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, bool suppressBlur = false; if (mCurrentTarget) { mCurrentTarget->GetContentForEvent(aEvent, getter_AddRefs(newFocus)); - const nsStyleUserInterface* ui = mCurrentTarget->StyleUserInterface(); + const nsStyleUI* ui = mCurrentTarget->StyleUI(); activeContent = mCurrentTarget->GetContent(); // In some cases, we do not want to even blur the current focused @@ -5221,7 +5221,7 @@ EventStateManager::SetContentState(nsIContent* aContent, EventStates aState) // XXX Is this even what we want? if (mCurrentTarget) { - const nsStyleUserInterface* ui = mCurrentTarget->StyleUserInterface(); + const nsStyleUI* ui = mCurrentTarget->StyleUI(); if (ui->mUserInput == StyleUserInput::None) { return false; } diff --git a/dom/html/HTMLOptGroupElement.cpp b/dom/html/HTMLOptGroupElement.cpp index 4b79d8a86971..da0ecf8fdd24 100644 --- a/dom/html/HTMLOptGroupElement.cpp +++ b/dom/html/HTMLOptGroupElement.cpp @@ -53,7 +53,7 @@ HTMLOptGroupElement::GetEventTargetParent(EventChainPreVisitor& aVisitor) if (nsIFrame* frame = GetPrimaryFrame()) { // FIXME(emilio): This poking at the style of the frame is broken unless we // flush before every event handling, which we don't really want to. - if (frame->StyleUserInterface()->mUserInput == StyleUserInput::None) { + if (frame->StyleUI()->mUserInput == StyleUserInput::None) { return; } } diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp index df5f774b1e93..3874a387d748 100644 --- a/dom/html/nsGenericHTMLElement.cpp +++ b/dom/html/nsGenericHTMLElement.cpp @@ -2180,8 +2180,7 @@ nsGenericHTMLFormElement::IsElementDisabledForEvents(EventMessage aMessage, // FIXME(emilio): This poking at the style of the frame is slightly bogus // unless we flush before every event, which we don't really want to do. - if (aFrame && - aFrame->StyleUserInterface()->mUserInput == StyleUserInput::None) { + if (aFrame && aFrame->StyleUI()->mUserInput == StyleUserInput::None) { return true; } diff --git a/dom/xul/nsXULPopupListener.cpp b/dom/xul/nsXULPopupListener.cpp index a71df6771838..67751c5fca13 100644 --- a/dom/xul/nsXULPopupListener.cpp +++ b/dom/xul/nsXULPopupListener.cpp @@ -205,7 +205,7 @@ nsXULPopupListener::FireFocusOnTargetContent(nsIContent* aTargetContent, nsIFrame* targetFrame = aTargetContent->GetPrimaryFrame(); if (!targetFrame) return NS_ERROR_FAILURE; - const nsStyleUserInterface* ui = targetFrame->StyleUserInterface(); + const nsStyleUI* ui = targetFrame->StyleUI(); bool suppressBlur = (ui->mUserFocus == StyleUserFocus::Ignore); RefPtr newFocusElement; diff --git a/layout/base/nsCaret.cpp b/layout/base/nsCaret.cpp index 82e79b99ae65..e84f163ba5ff 100644 --- a/layout/base/nsCaret.cpp +++ b/layout/base/nsCaret.cpp @@ -510,9 +510,8 @@ nsCaret::GetPaintGeometry(nsRect* aRect) } // now we have a frame, check whether it's appropriate to show the caret here - const nsStyleUserInterface* userinterface = frame->StyleUserInterface(); - if ((!mIgnoreUserModify && - userinterface->mUserModify == StyleUserModify::ReadOnly) || + const nsStyleUI* ui = frame->StyleUI(); + if ((!mIgnoreUserModify && ui->mUserModify == StyleUserModify::ReadOnly) || frame->IsContentDisabled()) { return nullptr; } diff --git a/layout/doc/adding-style-props.html b/layout/doc/adding-style-props.html index 559413f932d2..e2a446d72cab 100644 --- a/layout/doc/adding-style-props.html +++ b/layout/doc/adding-style-props.html @@ -287,7 +287,7 @@ value can be held for the layout objects to use.
First look into nsStyleStruct.h to see the existing style strucs. Find the one that you want to store the -data on. In this example, we want to put it on the nsStyleUserInterface struct, +data on. In this example, we want to put it on the nsStyleUI struct, however there is also a class nsStyleUIReset that holds the non-inherited values, so we will use that one (remember, our property is not inherited). Add a data member diff --git a/layout/forms/nsImageControlFrame.cpp b/layout/forms/nsImageControlFrame.cpp index 31a284c79efd..c77ac3df9312 100644 --- a/layout/forms/nsImageControlFrame.cpp +++ b/layout/forms/nsImageControlFrame.cpp @@ -176,7 +176,7 @@ nsImageControlFrame::GetCursor(const nsPoint& aPoint, { // Use style defined cursor if one is provided, otherwise when // the cursor style is "auto" we use the pointer cursor. - FillCursorInformationFromStyle(StyleUserInterface(), aCursor); + FillCursorInformationFromStyle(StyleUI(), aCursor); if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) { aCursor.mCursor = NS_STYLE_CURSOR_POINTER; diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index af13153fe0dd..943845ff61bb 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -2393,7 +2393,7 @@ nsIFrame::DisplayCaret(nsDisplayListBuilder* aBuilder, nscolor nsIFrame::GetCaretColorAt(int32_t aOffset) { - return nsLayoutUtils::GetColor(this, &nsStyleUserInterface::mCaretColor); + return nsLayoutUtils::GetColor(this, &nsStyleUI::mCaretColor); } bool @@ -5202,7 +5202,7 @@ nsresult nsFrame::GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor) { - FillCursorInformationFromStyle(StyleUserInterface(), aCursor); + FillCursorInformationFromStyle(StyleUI(), aCursor); if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) { // If this is editable, I-beam cursor is better for most elements. aCursor.mCursor = @@ -6503,7 +6503,7 @@ nsIFrame::IsContentDisabled() const { // FIXME(emilio): Doing this via CSS means callers must ensure the style is up // to date, and they don't! - if (StyleUserInterface()->mUserInput == StyleUserInput::None) { + if (StyleUI()->mUserInput == StyleUserInput::None) { return true; } @@ -9997,7 +9997,7 @@ nsIFrame::IsFocusable(int32_t *aTabIndex, bool aWithMouse) if (mContent && mContent->IsElement() && IsVisibleConsideringAncestors() && Style()->GetPseudo() != nsCSSAnonBoxes::anonymousFlexItem && Style()->GetPseudo() != nsCSSAnonBoxes::anonymousGridItem) { - const nsStyleUserInterface* ui = StyleUserInterface(); + const nsStyleUI* ui = StyleUI(); if (ui->mUserFocus != StyleUserFocus::Ignore && ui->mUserFocus != StyleUserFocus::None) { // Pass in default tabindex of -1 for nonfocusable and 0 for focusable @@ -10097,7 +10097,7 @@ nsIFrame::VerticalAlignEnum() const } /* static */ -void nsFrame::FillCursorInformationFromStyle(const nsStyleUserInterface* ui, +void nsFrame::FillCursorInformationFromStyle(const nsStyleUI* ui, nsIFrame::Cursor& aCursor) { aCursor.mCursor = ui->mCursor; @@ -11262,7 +11262,7 @@ nsIFrame::GetCompositorHitTestInfo(nsDisplayListBuilder* aBuilder) // are the event targets for any regions viewport frames may cover. return result; } - const uint8_t pointerEvents = StyleUserInterface()->GetEffectivePointerEvents(this); + const uint8_t pointerEvents = StyleUI()->GetEffectivePointerEvents(this); if (pointerEvents == NS_STYLE_POINTER_EVENTS_NONE) { return result; } diff --git a/layout/generic/nsFrame.h b/layout/generic/nsFrame.h index abbde4683529..8c7c0e56a06b 100644 --- a/layout/generic/nsFrame.h +++ b/layout/generic/nsFrame.h @@ -685,7 +685,7 @@ protected: mozilla::TableSelection* aTarget); // Fills aCursor with the appropriate information from ui - static void FillCursorInformationFromStyle(const nsStyleUserInterface* ui, + static void FillCursorInformationFromStyle(const nsStyleUI* ui, nsIFrame::Cursor& aCursor); NS_IMETHOD DoXULLayout(nsBoxLayoutState& aBoxLayoutState) override; diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 3521a98d13eb..ae1784d1fcd7 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -2201,8 +2201,7 @@ nsImageFrame::GetCursor(const nsPoint& aPoint, PresShell()->StyleSet()-> ResolveStyleFor(area->AsElement(), Style(), LazyComputeBehavior::Allow); - FillCursorInformationFromStyle(areaStyle->StyleUserInterface(), - aCursor); + FillCursorInformationFromStyle(areaStyle->StyleUI(), aCursor); if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) { aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT; } diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index d466a6fc89f6..8719621ddadf 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -340,7 +340,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // If we are pointer-events:none then we don't need to HitTest background bool pointerEventsNone = - StyleUserInterface()->mPointerEvents == NS_STYLE_POINTER_EVENTS_NONE; + StyleUI()->mPointerEvents == NS_STYLE_POINTER_EVENTS_NONE; if (!aBuilder->IsForEventDelivery() || !pointerEventsNone) { nsDisplayListCollection decorations(aBuilder); DisplayBorderBackgroundOutline(aBuilder, decorations); diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 5f332259f872..d554d199e301 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -4633,7 +4633,7 @@ nsresult nsTextFrame::GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor) { - FillCursorInformationFromStyle(StyleUserInterface(), aCursor); + FillCursorInformationFromStyle(StyleUI(), aCursor); if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) { if (!IsSelectable(nullptr)) { aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT; diff --git a/layout/ipc/RenderFrameParent.cpp b/layout/ipc/RenderFrameParent.cpp index 7eab66c2ec5d..392a1c2583fa 100644 --- a/layout/ipc/RenderFrameParent.cpp +++ b/layout/ipc/RenderFrameParent.cpp @@ -351,7 +351,7 @@ nsDisplayRemote::nsDisplayRemote(nsDisplayListBuilder* aBuilder, , mEventRegionsOverride(EventRegionsOverride::NoOverride) { bool frameIsPointerEventsNone = - aFrame->StyleUserInterface()->GetEffectivePointerEvents(aFrame) == + aFrame->StyleUI()->GetEffectivePointerEvents(aFrame) == NS_STYLE_POINTER_EVENTS_NONE; if (aBuilder->IsInsidePointerEventsNoneDoc() || frameIsPointerEventsNone) { mEventRegionsOverride |= EventRegionsOverride::ForceEmptyHitRegion; diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 1858d78f15f5..50e734adb0b6 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -2851,7 +2851,7 @@ static bool IsFrameReceivingPointerEvents(nsIFrame* aFrame) { return NS_STYLE_POINTER_EVENTS_NONE != - aFrame->StyleUserInterface()->GetEffectivePointerEvents(aFrame); + aFrame->StyleUI()->GetEffectivePointerEvents(aFrame); } // A list of frames, and their z depth. Used for sorting diff --git a/layout/style/ComputedStyle.cpp b/layout/style/ComputedStyle.cpp index 30624ab9a9bd..58c334a911b0 100644 --- a/layout/style/ComputedStyle.cpp +++ b/layout/style/ComputedStyle.cpp @@ -131,7 +131,7 @@ ComputedStyle::CalcStyleDifference(ComputedStyle* aNewContext, DO_STRUCT_DIFFERENCE(XUL); DO_STRUCT_DIFFERENCE(Column); DO_STRUCT_DIFFERENCE(Content); - DO_STRUCT_DIFFERENCE(UserInterface); + DO_STRUCT_DIFFERENCE(UI); DO_STRUCT_DIFFERENCE(Visibility); DO_STRUCT_DIFFERENCE(Outline); DO_STRUCT_DIFFERENCE(TableBorder); diff --git a/layout/style/ServoBindings.cpp b/layout/style/ServoBindings.cpp index aa71c797457e..92eb3c68e49f 100644 --- a/layout/style/ServoBindings.cpp +++ b/layout/style/ServoBindings.cpp @@ -1576,7 +1576,7 @@ Gecko_InitializeImageCropRect(nsStyleImage* aImage) } void -Gecko_SetCursorArrayLength(nsStyleUserInterface* aStyleUI, size_t aLen) +Gecko_SetCursorArrayLength(nsStyleUI* aStyleUI, size_t aLen) { aStyleUI->mCursorImages.Clear(); aStyleUI->mCursorImages.SetLength(aLen); @@ -1593,8 +1593,7 @@ Gecko_SetCursorImageValue(nsCursorImage* aCursor, } void -Gecko_CopyCursorArrayFrom(nsStyleUserInterface* aDest, - const nsStyleUserInterface* aSrc) +Gecko_CopyCursorArrayFrom(nsStyleUI* aDest, const nsStyleUI* aSrc) { aDest->mCursorImages = aSrc->mCursorImages; } diff --git a/layout/style/ServoBindings.h b/layout/style/ServoBindings.h index ab7266568b5b..41c253d09ab3 100644 --- a/layout/style/ServoBindings.h +++ b/layout/style/ServoBindings.h @@ -379,11 +379,10 @@ void Gecko_SetListStyleImageImageValue(nsStyleList* style_struct, void Gecko_CopyListStyleImageFrom(nsStyleList* dest, const nsStyleList* src); // cursor style. -void Gecko_SetCursorArrayLength(nsStyleUserInterface* ui, size_t len); +void Gecko_SetCursorArrayLength(nsStyleUI* ui, size_t len); void Gecko_SetCursorImageValue(nsCursorImage* aCursor, mozilla::css::ImageValue* aImageValue); -void Gecko_CopyCursorArrayFrom(nsStyleUserInterface* dest, - const nsStyleUserInterface* src); +void Gecko_CopyCursorArrayFrom(nsStyleUI* dest, const nsStyleUI* src); void Gecko_SetContentDataImageValue(nsStyleContentData* aList, mozilla::css::ImageValue* aImageValue); diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml index 60a5b9c3baa4..c3d055feac0d 100644 --- a/layout/style/ServoBindings.toml +++ b/layout/style/ServoBindings.toml @@ -338,7 +338,7 @@ whitelist-types = [ "nsStyleUIReset", "nsStyleUnion", "nsStyleUnit", - "nsStyleUserInterface", + "nsStyleUI", "nsStyleVisibility", "nsStyleXUL", "nsTArrayHeader", @@ -585,7 +585,7 @@ structs-types = [ "nsStyleUIReset", "nsStyleUnion", "nsStyleUnit", - "nsStyleUserInterface", + "nsStyleUI", "nsStyleVisibility", "nsStyleXUL", "nsTimingFunction", diff --git a/layout/style/nsCSSVisitedDependentPropList.h b/layout/style/nsCSSVisitedDependentPropList.h index 230d98af6599..0b3ddffcb15b 100644 --- a/layout/style/nsCSSVisitedDependentPropList.h +++ b/layout/style/nsCSSVisitedDependentPropList.h @@ -33,4 +33,4 @@ STYLE_STRUCT(Text, (mTextEmphasisColor, mWebkitTextStrokeColor)) STYLE_STRUCT(TextReset, (mTextDecorationColor)) STYLE_STRUCT(SVG, (mFill, mStroke)) -STYLE_STRUCT(UserInterface, (mCaretColor)) +STYLE_STRUCT(UI, (mCaretColor)) diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index c1faa0295e1c..521c9d0af4e9 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -727,7 +727,7 @@ CollectImageURLsForProperty(nsCSSPropertyID aProp, switch (aProp) { case eCSSProperty_cursor: - for (auto& image : aStyle.StyleUserInterface()->mCursorImages) { + for (auto& image : aStyle.StyleUI()->mCursorImages) { AddImageURL(*image.mImage, aURLs); } break; @@ -2985,7 +2985,7 @@ already_AddRefed nsComputedDOMStyle::DoGetScrollbarFaceColor() { RefPtr val = new nsROCSSPrimitiveValue; - SetValueForWidgetColor(val, StyleUserInterface()->mScrollbarFaceColor, + SetValueForWidgetColor(val, StyleUI()->mScrollbarFaceColor, StyleAppearance::ScrollbarthumbVertical); return val.forget(); } @@ -2994,7 +2994,7 @@ already_AddRefed nsComputedDOMStyle::DoGetScrollbarTrackColor() { RefPtr val = new nsROCSSPrimitiveValue; - SetValueForWidgetColor(val, StyleUserInterface()->mScrollbarTrackColor, + SetValueForWidgetColor(val, StyleUI()->mScrollbarTrackColor, StyleAppearance::ScrollbarVertical); return val.forget(); } @@ -3477,7 +3477,7 @@ already_AddRefed nsComputedDOMStyle::DoGetCaretColor() { RefPtr val = new nsROCSSPrimitiveValue; - SetValueFromComplexColor(val, StyleUserInterface()->mCaretColor); + SetValueFromComplexColor(val, StyleUI()->mCaretColor); return val.forget(); } @@ -3486,7 +3486,7 @@ nsComputedDOMStyle::DoGetCursor() { RefPtr valueList = GetROCSSValueList(true); - const nsStyleUserInterface *ui = StyleUserInterface(); + const nsStyleUI *ui = StyleUI(); for (const nsCursorImage& item : ui->mCursorImages) { RefPtr itemList = GetROCSSValueList(false); diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index 9122dac3de22..df8c28712ce0 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -382,7 +382,7 @@ enum class StyleContent : uint8_t { AltContent }; -// See nsStyleUserInterface +// See nsStyleUI #define NS_STYLE_CURSOR_AUTO 1 #define NS_STYLE_CURSOR_CROSSHAIR 2 #define NS_STYLE_CURSOR_DEFAULT 3 // ie: an arrow diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index aa12428a4eb1..6cd803ff5021 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -4559,7 +4559,7 @@ nsStyleText::TextEmphasisSide(WritingMode aWM) const } //----------------------- -// nsStyleUserInterface +// nsStyleUI // nsCursorImage::nsCursorImage() @@ -4605,7 +4605,7 @@ nsCursorImage::operator==(const nsCursorImage& aOther) const DefinitelyEqualImages(mImage, aOther.mImage); } -nsStyleUserInterface::nsStyleUserInterface(const nsPresContext* aContext) +nsStyleUI::nsStyleUI(const nsPresContext* aContext) : mUserInput(StyleUserInput::Auto) , mUserModify(StyleUserModify::ReadOnly) , mUserFocus(StyleUserFocus::None) @@ -4615,10 +4615,10 @@ nsStyleUserInterface::nsStyleUserInterface(const nsPresContext* aContext) , mScrollbarFaceColor(StyleComplexColor::Auto()) , mScrollbarTrackColor(StyleComplexColor::Auto()) { - MOZ_COUNT_CTOR(nsStyleUserInterface); + MOZ_COUNT_CTOR(nsStyleUI); } -nsStyleUserInterface::nsStyleUserInterface(const nsStyleUserInterface& aSource) +nsStyleUI::nsStyleUI(const nsStyleUI& aSource) : mUserInput(aSource.mUserInput) , mUserModify(aSource.mUserModify) , mUserFocus(aSource.mUserFocus) @@ -4629,17 +4629,17 @@ nsStyleUserInterface::nsStyleUserInterface(const nsStyleUserInterface& aSource) , mScrollbarFaceColor(aSource.mScrollbarFaceColor) , mScrollbarTrackColor(aSource.mScrollbarTrackColor) { - MOZ_COUNT_CTOR(nsStyleUserInterface); + MOZ_COUNT_CTOR(nsStyleUI); } -nsStyleUserInterface::~nsStyleUserInterface() +nsStyleUI::~nsStyleUI() { - MOZ_COUNT_DTOR(nsStyleUserInterface); + MOZ_COUNT_DTOR(nsStyleUI); } void -nsStyleUserInterface::FinishStyle( - nsPresContext* aPresContext, const nsStyleUserInterface* aOldStyle) +nsStyleUI::FinishStyle(nsPresContext* aPresContext, + const nsStyleUI* aOldStyle) { MOZ_ASSERT(NS_IsMainThread()); @@ -4658,7 +4658,7 @@ nsStyleUserInterface::FinishStyle( } nsChangeHint -nsStyleUserInterface::CalcDifference(const nsStyleUserInterface& aNewData) const +nsStyleUI::CalcDifference(const nsStyleUI& aNewData) const { nsChangeHint hint = nsChangeHint(0); if (mCursor != aNewData.mCursor) { diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 50ff0f315c7c..1835d12bf86c 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -2776,16 +2776,16 @@ struct nsCursorImage } }; -struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUserInterface +struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUI { - explicit nsStyleUserInterface(const nsPresContext* aContext); - nsStyleUserInterface(const nsStyleUserInterface& aOther); - ~nsStyleUserInterface(); + explicit nsStyleUI(const nsPresContext* aContext); + nsStyleUI(const nsStyleUI& aOther); + ~nsStyleUI(); - void FinishStyle(nsPresContext*, const nsStyleUserInterface*); + void FinishStyle(nsPresContext*, const nsStyleUI*); const static bool kHasFinishStyle = true; - nsChangeHint CalcDifference(const nsStyleUserInterface& aNewData) const; + nsChangeHint CalcDifference(const nsStyleUI& aNewData) const; mozilla::StyleUserInput mUserInput; mozilla::StyleUserModify mUserModify; // (modify-content) diff --git a/layout/style/nsStyleStructInlines.h b/layout/style/nsStyleStructInlines.h index 454d21406fd8..11bf16cc277a 100644 --- a/layout/style/nsStyleStructInlines.h +++ b/layout/style/nsStyleStructInlines.h @@ -246,7 +246,7 @@ nsStyleDisplay::IsAbsolutelyPositioned(const nsIFrame* aContextFrame) const } uint8_t -nsStyleUserInterface::GetEffectivePointerEvents(nsIFrame* aFrame) const +nsStyleUI::GetEffectivePointerEvents(nsIFrame* aFrame) const { if (aFrame->GetContent() && !aFrame->GetContent()->GetParent()) { // The root element has a cluster of frames associated with it @@ -255,7 +255,7 @@ nsStyleUserInterface::GetEffectivePointerEvents(nsIFrame* aFrame) const // frame. nsIFrame* f = aFrame->GetContent()->GetPrimaryFrame(); if (f) { - return f->StyleUserInterface()->mPointerEvents; + return f->StyleUI()->mPointerEvents; } } return mPointerEvents; diff --git a/layout/style/nsStyleStructList.h b/layout/style/nsStyleStructList.h index 0f625271f71d..fe620488c037 100644 --- a/layout/style/nsStyleStructList.h +++ b/layout/style/nsStyleStructList.h @@ -37,7 +37,7 @@ STYLE_STRUCT_INHERITED(Color) STYLE_STRUCT_INHERITED(List) STYLE_STRUCT_INHERITED(Text) STYLE_STRUCT_INHERITED(Visibility) -STYLE_STRUCT_INHERITED(UserInterface) +STYLE_STRUCT_INHERITED(UI) STYLE_STRUCT_INHERITED(TableBorder) STYLE_STRUCT_INHERITED(SVG) diff --git a/layout/svg/nsSVGImageFrame.cpp b/layout/svg/nsSVGImageFrame.cpp index 946f2851bacd..ceede3146dcd 100644 --- a/layout/svg/nsSVGImageFrame.cpp +++ b/layout/svg/nsSVGImageFrame.cpp @@ -502,7 +502,7 @@ nsSVGImageFrame::GetHitTestFlags() { uint16_t flags = 0; - switch (StyleUserInterface()->mPointerEvents) { + switch (StyleUI()->mPointerEvents) { case NS_STYLE_POINTER_EVENTS_NONE: break; case NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED: diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index 492decb8eba7..3238836144ee 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -1704,7 +1704,7 @@ nsSVGUtils::GetGeometryHitTestFlags(nsIFrame* aFrame) { uint16_t flags = 0; - switch (aFrame->StyleUserInterface()->mPointerEvents) { + switch (aFrame->StyleUI()->mPointerEvents) { case NS_STYLE_POINTER_EVENTS_NONE: break; case NS_STYLE_POINTER_EVENTS_AUTO: diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index 003df45b4495..e4336e81d83f 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -2442,8 +2442,7 @@ nsTreeBodyFrame::GetCursor(const nsPoint& aPoint, // Our scratch array is already prefilled. ComputedStyle* childContext = GetPseudoComputedStyle(child); - FillCursorInformationFromStyle(childContext->StyleUserInterface(), - aCursor); + FillCursorInformationFromStyle(childContext->StyleUI(), aCursor); if (aCursor.mCursor == NS_STYLE_CURSOR_AUTO) aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT; diff --git a/servo/components/style/properties/longhands/inherited_ui.mako.rs b/servo/components/style/properties/longhands/inherited_ui.mako.rs index 9718e33a84d1..e597f97ce8c3 100644 --- a/servo/components/style/properties/longhands/inherited_ui.mako.rs +++ b/servo/components/style/properties/longhands/inherited_ui.mako.rs @@ -4,7 +4,7 @@ <%namespace name="helpers" file="/helpers.mako.rs" /> -<% data.new_style_struct("InheritedUI", inherited=True, gecko_name="UserInterface") %> +<% data.new_style_struct("InheritedUI", inherited=True, gecko_name="UI") %> ${helpers.predefined_type("cursor", "Cursor", diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index dc901fefa8e0..81dd3ac36c25 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -2748,7 +2748,7 @@ nsNativeThemeCocoa::ComputeScrollbarParams(nsIFrame* aFrame, bool aIsHorizontal) // generally good enough for use cases of custom scrollbars. if (!params.overlay) { ComputedStyle* style = nsLayoutUtils::StyleForScrollbar(aFrame); - if (style->StyleUserInterface()->HasCustomScrollbars()) { + if (style->StyleUI()->HasCustomScrollbars()) { params.custom = true; params.trackColor = GetScrollbarTrackColor(style, &GetAutoScrollbarTrackColor); diff --git a/widget/nsNativeTheme.cpp b/widget/nsNativeTheme.cpp index b5b8e74c433e..e29fd9e82a65 100644 --- a/widget/nsNativeTheme.cpp +++ b/widget/nsNativeTheme.cpp @@ -849,8 +849,7 @@ nscolor nsNativeTheme::GetScrollbarFaceColor(ComputedStyle* aStyle, AutoColorGetter aAutoGetter) { - StyleComplexColor complexColor = - aStyle->StyleUserInterface()->mScrollbarFaceColor; + StyleComplexColor complexColor = aStyle->StyleUI()->mScrollbarFaceColor; if (complexColor.IsAuto()) { return aAutoGetter(aStyle); } @@ -866,8 +865,7 @@ nscolor nsNativeTheme::GetScrollbarTrackColor(ComputedStyle* aStyle, AutoColorGetter aAutoGetter) { - StyleComplexColor complexColor = - aStyle->StyleUserInterface()->mScrollbarTrackColor; + StyleComplexColor complexColor = aStyle->StyleUI()->mScrollbarTrackColor; nscolor color; if (complexColor.IsAuto()) { color = aAutoGetter(aStyle); diff --git a/widget/windows/nsNativeThemeWin.cpp b/widget/windows/nsNativeThemeWin.cpp index 1dec103914ab..ef40451c4d25 100644 --- a/widget/windows/nsNativeThemeWin.cpp +++ b/widget/windows/nsNativeThemeWin.cpp @@ -1559,7 +1559,7 @@ nsNativeThemeWin::DrawWidgetBackground(gfxContext* aContext, if (IsWidgetScrollbarPart(aWidgetType)) { ComputedStyle* style = nsLayoutUtils::StyleForScrollbar(aFrame); - if (style->StyleUserInterface()->HasCustomScrollbars()) { + if (style->StyleUI()->HasCustomScrollbars()) { return DrawCustomScrollbarPart(aContext, aFrame, style, aWidgetType, aRect, aDirtyRect); } @@ -3192,7 +3192,7 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, WidgetT else { if (contentState.HasAllStates(NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_HOVER)) { aState |= DFCS_PUSHED; - const nsStyleUserInterface *uiData = aFrame->StyleUserInterface(); + const nsStyleUI *uiData = aFrame->StyleUI(); // The down state is flat if the button is focusable if (uiData->mUserFocus == StyleUserFocus::Normal) { if (!aFrame->GetContent()->IsHTMLElement()) @@ -4231,8 +4231,8 @@ nsNativeThemeWin::DrawCustomScrollbarPart(gfxContext* aContext, const nsRect& aRect, const nsRect& aClipRect) { - MOZ_ASSERT(!aStyle->StyleUserInterface()->mScrollbarFaceColor.IsAuto() || - !aStyle->StyleUserInterface()->mScrollbarTrackColor.IsAuto()); + MOZ_ASSERT(!aStyle->StyleUI()->mScrollbarFaceColor.IsAuto() || + !aStyle->StyleUI()->mScrollbarTrackColor.IsAuto()); gfxRect tr(aRect.X(), aRect.Y(), aRect.Width(), aRect.Height()), dr(aClipRect.X(), aClipRect.Y(),