tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ViewportMetaData.h (1712B)


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