Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / layout / painting / HitTestInfo.h
blob95438b810ce1e8a32df840dc156bdbcbfedf9fd5
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef GFX_HITTESTINFO_H
8 #define GFX_HITTESTINFO_H
10 #include "mozilla/gfx/CompositorHitTestInfo.h"
11 #include "mozilla/layers/ScrollableLayerGuid.h"
12 #include "nsRect.h"
14 class nsIFrame;
16 namespace mozilla {
18 class nsDisplayListBuilder;
19 struct ActiveScrolledRoot;
21 namespace wr {
22 class DisplayListBuilder;
23 } // namespace wr
25 /**
26 * A helper class that manages compositor hit testing information.
28 class HitTestInfo {
29 public:
30 using CompositorHitTestInfo = gfx::CompositorHitTestInfo;
31 using ViewID = layers::ScrollableLayerGuid::ViewID;
33 ViewID GetViewId(wr::DisplayListBuilder& aBuilder,
34 const ActiveScrolledRoot* aASR) const;
36 void Initialize(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame);
37 void InitializeScrollTarget(nsDisplayListBuilder* aBuilder);
39 void SetAreaAndInfo(const nsRect& aArea, const CompositorHitTestInfo& aInfo) {
40 mArea = aArea;
41 mInfo = aInfo;
44 static void Shutdown();
46 const nsRect& Area() const { return mArea; }
47 const CompositorHitTestInfo& Info() const { return mInfo; }
49 static const HitTestInfo& Empty();
51 private:
52 nsRect mArea;
53 CompositorHitTestInfo mInfo;
54 mozilla::Maybe<ViewID> mScrollTarget;
57 } // namespace mozilla
59 #endif