зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1769012 - Deal with <xul:tree> scrollbars in Theme.cpp. r=mstange
Tree has a non-anonymous scrollbar whose mediator is the nsTreeBodyFrame: https://searchfox.org/mozilla-central/rev/b72e9d7d63bf499d1d8168291b93d4ec7fde236e/toolkit/content/widgets/tree.js#601 So use the scrollbar mediator interface rather than poking at the scroll frame directly. Differential Revision: https://phabricator.services.mozilla.com/D146158
This commit is contained in:
Родитель
f7fd6fc688
Коммит
211ac07df9
|
@ -19,7 +19,8 @@
|
|||
#include "mozilla/webrender/WebRenderAPI.h"
|
||||
#include "nsCSSColorUtils.h"
|
||||
#include "nsCSSRendering.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsScrollbarFrame.h"
|
||||
#include "nsIScrollbarMediator.h"
|
||||
#include "nsDeviceContext.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsRangeFrame.h"
|
||||
|
@ -1048,11 +1049,13 @@ static ScrollbarDrawing::ScrollbarKind ComputeScrollbarKind(
|
|||
if (NS_WARN_IF(!scrollbar)) {
|
||||
return ScrollbarDrawing::ScrollbarKind::VerticalRight;
|
||||
}
|
||||
nsIScrollableFrame* sf = do_QueryFrame(scrollbar->GetParent());
|
||||
if (NS_WARN_IF(!sf)) {
|
||||
MOZ_ASSERT(scrollbar->IsScrollbarFrame());
|
||||
nsIScrollbarMediator* sm =
|
||||
static_cast<nsScrollbarFrame*>(scrollbar)->GetScrollbarMediator();
|
||||
if (NS_WARN_IF(!sm)) {
|
||||
return ScrollbarDrawing::ScrollbarKind::VerticalRight;
|
||||
}
|
||||
return sf->IsScrollbarOnRight()
|
||||
return sm->IsScrollbarOnRight()
|
||||
? ScrollbarDrawing::ScrollbarKind::VerticalRight
|
||||
: ScrollbarDrawing::ScrollbarKind::VerticalLeft;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче