зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1025669 - part 0.5, Add LogicalMargin::ApplySkipSides. r=jfkthame
This commit is contained in:
Родитель
3e13115cf3
Коммит
cb30f027c3
|
@ -36,6 +36,15 @@
|
|||
#define CHECK_WRITING_MODE(param) \
|
||||
NS_ASSERTION(param == mWritingMode, "writing-mode mismatch")
|
||||
|
||||
#define LOGICAL_SIDE_B_START 1
|
||||
#define LOGICAL_SIDE_I_START 2
|
||||
#define LOGICAL_SIDE_B_END 4
|
||||
#define LOGICAL_SIDE_I_END 8
|
||||
#define LOGICAL_SIDES_I_BOTH (LOGICAL_SIDE_I_START | LOGICAL_SIDE_I_END)
|
||||
#define LOGICAL_SIDES_B_BOTH (LOGICAL_SIDE_B_START | LOGICAL_SIDE_B_END)
|
||||
#define LOGICAL_SIDES_ALL (LOGICAL_SIDE_I_START | LOGICAL_SIDE_I_END | \
|
||||
LOGICAL_SIDE_B_START | LOGICAL_SIDE_B_END)
|
||||
|
||||
/**
|
||||
* mozilla::WritingMode is an immutable class representing a
|
||||
* writing mode.
|
||||
|
@ -833,6 +842,22 @@ public:
|
|||
*this : LogicalMargin(aToMode, GetPhysicalMargin(aFromMode));
|
||||
}
|
||||
|
||||
void ApplySkipSides(int aSkipSides)
|
||||
{
|
||||
if (aSkipSides & LOGICAL_SIDE_B_START) {
|
||||
BStart() = 0;
|
||||
}
|
||||
if (aSkipSides & LOGICAL_SIDE_B_END) {
|
||||
BEnd() = 0;
|
||||
}
|
||||
if (aSkipSides & LOGICAL_SIDE_I_START) {
|
||||
IStart() = 0;
|
||||
}
|
||||
if (aSkipSides & LOGICAL_SIDE_I_END) {
|
||||
IEnd() = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool IsEmpty() const
|
||||
{
|
||||
return (mMargin.left == 0 && mMargin.top == 0 &&
|
||||
|
|
|
@ -2315,14 +2315,6 @@ public:
|
|||
* passed in, indicating that it should be used to determine if sides
|
||||
* should be skipped during reflow.
|
||||
*/
|
||||
#define LOGICAL_SIDE_B_START 1
|
||||
#define LOGICAL_SIDE_I_START 2
|
||||
#define LOGICAL_SIDE_B_END 4
|
||||
#define LOGICAL_SIDE_I_END 8
|
||||
#define LOGICAL_SIDES_I_BOTH (LOGICAL_SIDE_I_START | LOGICAL_SIDE_I_END)
|
||||
#define LOGICAL_SIDES_B_BOTH (LOGICAL_SIDE_B_START | LOGICAL_SIDE_B_END)
|
||||
#define LOGICAL_SIDES_ALL (LOGICAL_SIDE_I_START | LOGICAL_SIDE_I_END | \
|
||||
LOGICAL_SIDE_B_START | LOGICAL_SIDE_B_END)
|
||||
int GetSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const;
|
||||
virtual int
|
||||
GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const {
|
||||
|
|
Загрузка…
Ссылка в новой задаче