author | Brad Werth <bwerth@mozilla.com> |
Wed, 17 Oct 2018 20:22:46 +0000 | |
changeset 497689 | 082aaca611f9f0e13cd82d6cc708b687cfd35b7c |
parent 497688 | d0b82fc9252d1c017cfd7e3381873c9e2ee9ee8f |
child 497690 | d8e73cf6952fd03c118b8cdd3cc97a8f59045f95 |
push id | 10002 |
push user | archaeopteryx@coole-files.de |
push date | Fri, 19 Oct 2018 23:09:29 +0000 |
treeherder | mozilla-beta@01378c910610 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | dholbert |
bugs | 1497589 |
milestone | 64.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/chrome-webidl/Flex.webidl +++ b/dom/chrome-webidl/Flex.webidl @@ -4,20 +4,43 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * These objects support visualization of flex containers by the * dev tools. */ +/** + * A flex container's main and cross axes are either horizontal or + * vertical, each with two possible directions. + */ +enum FlexPhysicalDirection { + "horizontal-lr", + "horizontal-rl", + "vertical-tb", + "vertical-bt", +}; + [ChromeOnly] interface Flex { sequence<FlexLineValues> getLines(); + + /** + * The physical direction in which successive flex items are placed, + * within a flex line in this flex container. + */ + readonly attribute FlexPhysicalDirection mainAxisDirection; + + /** + * The physical direction in which successive flex lines are placed + * in this flex container (if it is or were multi-line). + */ + readonly attribute FlexPhysicalDirection crossAxisDirection; }; /** * Lines with items that have been shrunk are shrinking; with items * that have grown are growing, and all others are unchanged. */ enum FlexLineGrowthState { "unchanged", "shrinking", "growing" };
--- a/dom/flex/Flex.cpp +++ b/dom/flex/Flex.cpp @@ -50,10 +50,22 @@ Flex::WrapObject(JSContext* aCx, JS::Han } void Flex::GetLines(nsTArray<RefPtr<FlexLineValues>>& aResult) { aResult.AppendElements(mLines); } +FlexPhysicalDirection +Flex::MainAxisDirection() const +{ + return mMainAxisDirection; +} + +FlexPhysicalDirection +Flex::CrossAxisDirection() const +{ + return mCrossAxisDirection; +} + } // namespace dom } // namespace mozilla
--- a/dom/flex/Flex.h +++ b/dom/flex/Flex.h @@ -3,16 +3,17 @@ /* 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/. */ #ifndef mozilla_dom_Flex_h #define mozilla_dom_Flex_h #include "mozilla/dom/Element.h" +#include "mozilla/dom/FlexBinding.h" #include "nsISupports.h" #include "nsWrapperCache.h" class nsFlexContainerFrame; namespace mozilla { namespace dom { @@ -33,18 +34,22 @@ public: virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; Element* GetParentObject() { return mParent; } void GetLines(nsTArray<RefPtr<FlexLineValues>>& aResult); + FlexPhysicalDirection MainAxisDirection() const; + FlexPhysicalDirection CrossAxisDirection() const; protected: nsCOMPtr<Element> mParent; nsTArray<RefPtr<FlexLineValues>> mLines; + FlexPhysicalDirection mMainAxisDirection; + FlexPhysicalDirection mCrossAxisDirection; }; } // namespace dom } // namespace mozilla #endif /* mozilla_dom_Flex_h */