зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
04ba5f13c0
Коммит
55045f0ce3
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче