зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ac922efad9fd (bug 1463687) for failures in build/build/src/layout/base/nsLayoutUtils.cpp on a CLOSED TREE
This commit is contained in:
Родитель
837eabb26b
Коммит
303e1e01d9
|
@ -20,7 +20,6 @@
|
|||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/ServoStyleSetInlines.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "nsCharTraits.h"
|
||||
|
@ -10187,27 +10186,3 @@ nsLayoutUtils::ParseFontLanguageOverride(const nsAString& aLangTag)
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* static */ ComputedStyle*
|
||||
nsLayoutUtils::StyleForScrollbar(nsIFrame* aScrollbarPart)
|
||||
{
|
||||
nsIFrame* scrollFrame =
|
||||
GetClosestFrameOfType(aScrollbarPart, LayoutFrameType::Scroll);
|
||||
MOZ_ASSERT(scrollFrame, "Scrollbar part frame "
|
||||
"should have a scroll frame ancestor");
|
||||
|
||||
if (scrollFrame->GetParent()->IsViewportFrame()) {
|
||||
nsPresContext* pc = scrollFrame->PresContext();
|
||||
if (Element* root = pc->Document()->GetRootElement()) {
|
||||
if (nsIFrame* frameOfRoot = root->GetPrimaryFrame()) {
|
||||
return frameOfRoot->Style();
|
||||
}
|
||||
// If the root doesn't have primary frame, get the computed style
|
||||
// from the element. Dropping the strong reference is fine because
|
||||
// the style should be held strongly by the element.
|
||||
RefPtr<ComputedStyle> style = pc->StyleSet()->ResolveServoStyle(root);
|
||||
return style.get();
|
||||
}
|
||||
}
|
||||
return scrollFrame->Style();
|
||||
}
|
||||
|
|
|
@ -3111,15 +3111,6 @@ public:
|
|||
return ResolveToLength<true>(aGap, aPercentageBasis);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the computed style for the given scrollbar part frame.
|
||||
*
|
||||
* Generally it returns the computed style of the scroll frame which
|
||||
* contains the given part frame. If the scroll frame is for the
|
||||
* viewport, the computed style of the document element is returned.
|
||||
*/
|
||||
static ComputedStyle* StyleForScrollbar(nsIFrame* aScrollbarPart);
|
||||
|
||||
private:
|
||||
static uint32_t sFontSizeInflationEmPerLine;
|
||||
static uint32_t sFontSizeInflationMinTwips;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "nsIContent.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsLookAndFeel.h"
|
||||
#include "nsMenuFrame.h"
|
||||
|
@ -1552,12 +1551,10 @@ nsNativeThemeWin::DrawWidgetBackground(gfxContext* aContext,
|
|||
const nsRect& aRect,
|
||||
const nsRect& aDirtyRect)
|
||||
{
|
||||
if (IsWidgetScrollbarPart(aWidgetType)) {
|
||||
ComputedStyle* style = nsLayoutUtils::StyleForScrollbar(aFrame);
|
||||
if (style->StyleUserInterface()->HasCustomScrollbars()) {
|
||||
return DrawCustomScrollbarPart(aContext, aFrame, style,
|
||||
aWidgetType, aRect, aDirtyRect);
|
||||
}
|
||||
if (aFrame->StyleUserInterface()->HasCustomScrollbars() &&
|
||||
IsWidgetScrollbarPart(aWidgetType)) {
|
||||
return DrawCustomScrollbarPart(aContext, aFrame, aWidgetType,
|
||||
aRect, aDirtyRect);
|
||||
}
|
||||
|
||||
HANDLE theme = GetTheme(aWidgetType);
|
||||
|
@ -4266,19 +4263,19 @@ GetScrollbarArrowColor(nscolor aTrackColor)
|
|||
nsresult
|
||||
nsNativeThemeWin::DrawCustomScrollbarPart(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
ComputedStyle* aStyle,
|
||||
uint8_t aWidgetType,
|
||||
const nsRect& aRect,
|
||||
const nsRect& aClipRect)
|
||||
{
|
||||
MOZ_ASSERT(!aStyle->StyleUserInterface()->mScrollbarFaceColor.mIsAuto ||
|
||||
!aStyle->StyleUserInterface()->mScrollbarTrackColor.mIsAuto);
|
||||
ComputedStyle* style = aFrame->Style();
|
||||
MOZ_ASSERT(!style->StyleUserInterface()->mScrollbarFaceColor.mIsAuto ||
|
||||
!style->StyleUserInterface()->mScrollbarTrackColor.mIsAuto);
|
||||
|
||||
gfxRect tr(aRect.X(), aRect.Y(), aRect.Width(), aRect.Height()),
|
||||
dr(aClipRect.X(), aClipRect.Y(),
|
||||
aClipRect.Width(), aClipRect.Height());
|
||||
|
||||
nscolor trackColor = GetScrollbarTrackColor(aStyle);
|
||||
nscolor trackColor = GetScrollbarTrackColor(style);
|
||||
HBRUSH dcBrush = (HBRUSH) GetStockObject(DC_BRUSH);
|
||||
|
||||
gfxFloat p2a = gfxFloat(aFrame->PresContext()->AppUnitsPerDevPixel());
|
||||
|
@ -4314,7 +4311,7 @@ nsNativeThemeWin::DrawCustomScrollbarPart(gfxContext* aContext,
|
|||
tr2.Deflate(0, dev2css);
|
||||
}
|
||||
nativeDrawing.TransformToNativeRect(tr2, widgetRect);
|
||||
nscolor faceColor = GetScrollbarFaceColor(aStyle);
|
||||
nscolor faceColor = GetScrollbarFaceColor(style);
|
||||
::SetDCBrushColor(hdc, ToColorRef(faceColor));
|
||||
::FillRect(hdc, &widgetRect, dcBrush);
|
||||
break;
|
||||
|
|
|
@ -116,7 +116,6 @@ protected:
|
|||
HBRUSH defaultBack);
|
||||
nsresult DrawCustomScrollbarPart(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
mozilla::ComputedStyle* aStyle,
|
||||
uint8_t aWidgetType,
|
||||
const nsRect& aRect,
|
||||
const nsRect& aClipRect);
|
||||
|
|
Загрузка…
Ссылка в новой задаче