Bug 1468402 - Part 3: Add test for subgrids in the grid list. r=pbro
[gecko.git] / layout / base / GeometryUtils.h
blobbfecdc2886ff67c95a78c54d4c81e4ab927cf19d
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 MOZILLA_GEOMETRYUTILS_H_
8 #define MOZILLA_GEOMETRYUTILS_H_
10 #include "mozilla/ErrorResult.h"
11 #include "nsTArray.h"
12 #include "nsCOMPtr.h"
14 /**
15 * This file defines utility functions for converting between layout
16 * coordinate systems.
19 class nsINode;
21 namespace mozilla {
23 namespace dom {
24 struct BoxQuadOptions;
25 struct ConvertCoordinateOptions;
26 class DOMQuad;
27 class DOMRectReadOnly;
28 class DOMPoint;
29 struct DOMPointInit;
30 class OwningTextOrElementOrDocument;
31 class TextOrElementOrDocument;
32 enum class CallerType : uint32_t;
33 } // namespace dom
35 typedef dom::TextOrElementOrDocument GeometryNode;
36 typedef dom::OwningTextOrElementOrDocument OwningGeometryNode;
38 /**
39 * Computes quads for aNode using aOptions, according to
40 * GeometryUtils.getBoxQuads. May set an error in aRv.
42 void GetBoxQuads(nsINode* aNode, const dom::BoxQuadOptions& aOptions,
43 nsTArray<RefPtr<dom::DOMQuad> >& aResult,
44 dom::CallerType aCallerType, ErrorResult& aRv);
46 already_AddRefed<dom::DOMQuad> ConvertQuadFromNode(
47 nsINode* aTo, dom::DOMQuad& aQuad, const GeometryNode& aFrom,
48 const dom::ConvertCoordinateOptions& aOptions, dom::CallerType aCallerType,
49 ErrorResult& aRv);
51 already_AddRefed<dom::DOMQuad> ConvertRectFromNode(
52 nsINode* aTo, dom::DOMRectReadOnly& aRect, const GeometryNode& aFrom,
53 const dom::ConvertCoordinateOptions& aOptions, dom::CallerType aCallerType,
54 ErrorResult& aRv);
56 already_AddRefed<dom::DOMPoint> ConvertPointFromNode(
57 nsINode* aTo, const dom::DOMPointInit& aPoint, const GeometryNode& aFrom,
58 const dom::ConvertCoordinateOptions& aOptions, dom::CallerType aCallerType,
59 ErrorResult& aRv);
61 } // namespace mozilla
63 #endif /* MOZILLA_GEOMETRYUTILS_H_ */