Bug 1497589 Part 3: Stub in physical direction enums for Flex API main and cross axes. r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D8616

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brad Werth 2018-10-17 20:22:46 +00:00
Родитель 04ba5f13c0
Коммит 55045f0ce3
3 изменённых файлов: 40 добавлений и 0 удалений

Просмотреть файл

@ -9,10 +9,33 @@
* 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;
};
/**

Просмотреть файл

@ -55,5 +55,17 @@ 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

Просмотреть файл

@ -8,6 +8,7 @@
#define mozilla_dom_Flex_h
#include "mozilla/dom/Element.h"
#include "mozilla/dom/FlexBinding.h"
#include "nsISupports.h"
#include "nsWrapperCache.h"
@ -38,10 +39,14 @@ public:
}
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