Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 842193004: [css-grid] Handle alignment with orthogonal flows (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@orthogonal-flows
Patch Set: Applied additional changes. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 6b443a587a2ce3eacddf7d97d75734b7ee46f0d8..221eb60f9c968ab097e58aea4b2db9feef54936a 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1092,28 +1092,33 @@ LayoutUnit LayoutBox::overrideLogicalContentHeight() const
return m_rareData->m_overrideLogicalContentHeight;
}
+// TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones.
LayoutUnit LayoutBox::overrideContainingBlockContentLogicalWidth() const
{
ASSERT(hasOverrideContainingBlockLogicalWidth());
return gOverrideContainingBlockLogicalWidthMap->get(this);
}
+// TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones.
LayoutUnit LayoutBox::overrideContainingBlockContentLogicalHeight() const
{
ASSERT(hasOverrideContainingBlockLogicalHeight());
return gOverrideContainingBlockLogicalHeightMap->get(this);
}
+// TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones.
bool LayoutBox::hasOverrideContainingBlockLogicalWidth() const
{
return gOverrideContainingBlockLogicalWidthMap && gOverrideContainingBlockLogicalWidthMap->contains(this);
}
+// TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones.
bool LayoutBox::hasOverrideContainingBlockLogicalHeight() const
{
return gOverrideContainingBlockLogicalHeightMap && gOverrideContainingBlockLogicalHeightMap->contains(this);
}
+// TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones.
void LayoutBox::setOverrideContainingBlockContentLogicalWidth(LayoutUnit logicalWidth)
{
if (!gOverrideContainingBlockLogicalWidthMap)
@@ -1121,6 +1126,7 @@ void LayoutBox::setOverrideContainingBlockContentLogicalWidth(LayoutUnit logical
gOverrideContainingBlockLogicalWidthMap->set(this, logicalWidth);
}
+// TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones.
void LayoutBox::setOverrideContainingBlockContentLogicalHeight(LayoutUnit logicalHeight)
{
if (!gOverrideContainingBlockLogicalHeightMap)
@@ -1128,6 +1134,7 @@ void LayoutBox::setOverrideContainingBlockContentLogicalHeight(LayoutUnit logica
gOverrideContainingBlockLogicalHeightMap->set(this, logicalHeight);
}
+// TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones.
void LayoutBox::clearContainingBlockOverrideSize()
{
if (gOverrideContainingBlockLogicalWidthMap)
@@ -1135,12 +1142,33 @@ void LayoutBox::clearContainingBlockOverrideSize()
clearOverrideContainingBlockContentLogicalHeight();
}
+// TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones.
void LayoutBox::clearOverrideContainingBlockContentLogicalHeight()
{
if (gOverrideContainingBlockLogicalHeightMap)
gOverrideContainingBlockLogicalHeightMap->remove(this);
}
+LayoutUnit LayoutBox::overrideContainingBlockContentWidth() const
+{
+ return containingBlock()->isHorizontalWritingMode() ? overrideContainingBlockContentLogicalWidth() : overrideContainingBlockContentLogicalHeight();
+}
+
+LayoutUnit LayoutBox::overrideContainingBlockContentHeight() const
+{
+ return containingBlock()->isHorizontalWritingMode() ? overrideContainingBlockContentLogicalHeight() : overrideContainingBlockContentLogicalWidth();
+}
+
+bool LayoutBox::hasOverrideContainingBlockWidth() const
+{
+ return containingBlock()->isHorizontalWritingMode() ? hasOverrideContainingBlockLogicalWidth() : hasOverrideContainingBlockLogicalHeight();
+}
+
+bool LayoutBox::hasOverrideContainingBlockHeight() const
+{
+ return containingBlock()->isHorizontalWritingMode() ? hasOverrideContainingBlockLogicalHeight() : hasOverrideContainingBlockLogicalWidth();
+}
+
LayoutUnit LayoutBox::extraInlineOffset() const
{
return gExtraInlineOffsetMap ? gExtraInlineOffsetMap->get(this) : LayoutUnit();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutGrid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698