2017-11-16 00:20:35 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* 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/. */
|
|
|
|
|
2018-10-17 23:22:26 +03:00
|
|
|
#ifndef mozilla_dom_FlexItemValues_h
|
|
|
|
#define mozilla_dom_FlexItemValues_h
|
2017-11-16 00:20:35 +03:00
|
|
|
|
|
|
|
#include "mozilla/dom/FlexBinding.h"
|
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
|
2017-10-18 02:27:35 +03:00
|
|
|
struct ComputedFlexItemInfo;
|
|
|
|
|
2017-11-16 00:20:35 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2018-10-17 23:22:26 +03:00
|
|
|
class FlexLineValues;
|
2017-11-16 00:20:35 +03:00
|
|
|
|
2018-10-17 23:22:26 +03:00
|
|
|
class FlexItemValues : public nsISupports, public nsWrapperCache {
|
2017-11-16 00:20:35 +03:00
|
|
|
public:
|
2018-10-17 23:22:26 +03:00
|
|
|
explicit FlexItemValues(FlexLineValues* aParent,
|
|
|
|
const ComputedFlexItemInfo* aItem);
|
2017-11-16 00:20:35 +03:00
|
|
|
|
|
|
|
protected:
|
2018-10-17 23:22:26 +03:00
|
|
|
virtual ~FlexItemValues() = default;
|
2017-11-16 00:20:35 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2018-10-17 23:22:26 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexItemValues)
|
2017-11-16 00:20:35 +03:00
|
|
|
|
|
|
|
virtual JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
2018-10-17 23:22:26 +03:00
|
|
|
FlexLineValues* GetParentObject() { return mParent; }
|
2017-11-16 00:20:35 +03:00
|
|
|
|
|
|
|
nsINode* GetNode() const;
|
2018-11-17 03:56:51 +03:00
|
|
|
DOMRectReadOnly* FrameRect() const;
|
2017-11-16 00:20:35 +03:00
|
|
|
double MainBaseSize() const;
|
|
|
|
double MainDeltaSize() const;
|
|
|
|
double MainMinSize() const;
|
|
|
|
double MainMaxSize() const;
|
|
|
|
double CrossMinSize() const;
|
|
|
|
double CrossMaxSize() const;
|
2018-10-25 02:46:16 +03:00
|
|
|
FlexItemClampState ClampState() const;
|
2017-11-16 00:20:35 +03:00
|
|
|
|
|
|
|
protected:
|
2018-10-17 23:22:26 +03:00
|
|
|
RefPtr<FlexLineValues> mParent;
|
2017-10-18 02:27:35 +03:00
|
|
|
RefPtr<nsINode> mNode;
|
2018-11-17 03:56:51 +03:00
|
|
|
RefPtr<DOMRectReadOnly> mFrameRect;
|
2017-10-18 02:27:35 +03:00
|
|
|
|
2018-11-15 21:01:52 +03:00
|
|
|
// These sizes are all CSS pixel units.
|
2017-10-18 02:27:35 +03:00
|
|
|
double mMainBaseSize;
|
|
|
|
double mMainDeltaSize;
|
|
|
|
double mMainMinSize;
|
|
|
|
double mMainMaxSize;
|
|
|
|
double mCrossMinSize;
|
|
|
|
double mCrossMaxSize;
|
2018-10-25 02:46:16 +03:00
|
|
|
FlexItemClampState mClampState;
|
2017-11-16 00:20:35 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2018-10-17 23:22:26 +03:00
|
|
|
#endif /* mozilla_dom_FlexItemValues_h */
|