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 DOM_VIEWPORT_META_DATA_H_
8 #define DOM_VIEWPORT_META_DATA_H_
11 #include "nsAString.h"
13 namespace mozilla::dom
{
14 struct ViewportMetaData
{
15 // https://drafts.csswg.org/css-device-adapt/#meta-properties
18 nsString mInitialScale
;
19 nsString mMinimumScale
;
20 nsString mMaximumScale
;
21 nsString mUserScalable
;
22 nsString mViewportFit
;
24 bool operator==(const ViewportMetaData
& aOther
) const {
25 return mWidth
== aOther
.mWidth
&& mHeight
== aOther
.mHeight
&&
26 mInitialScale
== aOther
.mInitialScale
&&
27 mMinimumScale
== aOther
.mMinimumScale
&&
28 mMaximumScale
== aOther
.mMaximumScale
&&
29 mUserScalable
== aOther
.mUserScalable
&&
30 mViewportFit
== aOther
.mViewportFit
;
32 bool operator!=(const ViewportMetaData
& aOther
) const {
33 return !(*this == aOther
);
36 ViewportMetaData() = default;
37 /* Process viewport META data. This gives us information for the scale
38 * and zoom of a page on mobile devices. We stick the information in
39 * the document header and use it later on after rendering.
43 explicit ViewportMetaData(const nsAString
& aViewportInfo
);
46 } // namespace mozilla::dom
48 #endif // DOM_VIEWPORT_META_DATA_H_