2021-11-15 15:39:38 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2022-01-12 19:33:31 +03:00
|
|
|
#ifndef mozilla_widget_ThemeCocoa_h
|
|
|
|
#define mozilla_widget_ThemeCocoa_h
|
2021-11-15 15:39:38 +03:00
|
|
|
|
2022-01-12 19:33:31 +03:00
|
|
|
#include "Theme.h"
|
2021-11-15 15:39:38 +03:00
|
|
|
|
|
|
|
#include "ScrollbarDrawingCocoa.h"
|
|
|
|
|
2022-01-12 19:33:31 +03:00
|
|
|
namespace mozilla::widget {
|
2021-11-15 15:39:38 +03:00
|
|
|
|
2022-01-12 19:33:31 +03:00
|
|
|
class ThemeCocoa : public Theme {
|
2021-11-15 15:39:38 +03:00
|
|
|
public:
|
2022-01-12 19:33:31 +03:00
|
|
|
explicit ThemeCocoa(UniquePtr<ScrollbarDrawing>&& aScrollbarDrawing)
|
|
|
|
: Theme(std::move(aScrollbarDrawing)) {}
|
2021-11-15 15:39:38 +03:00
|
|
|
|
Bug 1793689 - Make GetMinimumWidgetSize work properly on non-XUL flexbox. r=TYLin,layout-reviewers
The XUL behavior in nsBox.cpp is fairly different to what the non-XUL
layout code paths do. In particular, canOverride=false means that the
min-{width,height} properties cannot go under the min widget size of the
widget, but that doesn't mean that intrinsic sizes don't affect the
final size of the widget.
This is very visible if you turn on flex emulation on Windows or macOS,
where the toolbar has an appearance that returns
width=0,height=N,canOverride=false.
With flex emulation we'd collapse the item to be zero-width, which is
not good at all.
The good thing is that this is no longer exposed to the web
(non-native-theme always returns canOverride=true), and our front-end
code doesn't seem to rely on this, so we can just remove support for
canOverride=false.
Differential Revision: https://phabricator.services.mozilla.com/D158608
2022-10-05 22:09:29 +03:00
|
|
|
LayoutDeviceIntSize GetMinimumWidgetSize(
|
|
|
|
nsPresContext* aPresContext, nsIFrame* aFrame,
|
|
|
|
StyleAppearance aAppearance) override;
|
2021-11-15 15:39:38 +03:00
|
|
|
|
2024-01-01 12:50:27 +03:00
|
|
|
NS_IMETHOD DrawWidgetBackground(gfxContext* aContext, nsIFrame*,
|
|
|
|
StyleAppearance, const nsRect& aRect,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
DrawOverflow) override;
|
|
|
|
|
|
|
|
bool CreateWebRenderCommandsForWidget(
|
|
|
|
wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources,
|
|
|
|
const layers::StackingContextHelper& aSc,
|
|
|
|
layers::RenderRootStateManager* aManager, nsIFrame*, StyleAppearance,
|
|
|
|
const nsRect& aRect) override;
|
|
|
|
|
2021-11-15 15:39:38 +03:00
|
|
|
protected:
|
2022-01-12 19:33:31 +03:00
|
|
|
virtual ~ThemeCocoa() = default;
|
2021-11-15 15:39:38 +03:00
|
|
|
};
|
|
|
|
|
2022-01-12 19:33:31 +03:00
|
|
|
} // namespace mozilla::widget
|
|
|
|
|
2021-11-15 15:39:38 +03:00
|
|
|
#endif
|