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

Unified Diff: Source/core/css/resolver/StyleAdjuster.cpp

Issue 1070143002: [Alignment] Single class for holding the alignment data. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Using the StyleConverter. Created 5 years, 8 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: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index 733e50a61fb46c2684ba9ef0e8434d79e1581285..241af8c7586bb6d30078dbe4f8a6aaf299205988 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -267,24 +267,20 @@ void StyleAdjuster::adjustStyleForAlignment(ComputedStyle& style, const Computed
// - 'stretch' for flex containers and grid containers.
// - 'start' for everything else.
if (style.justifyItems() == ItemPositionAuto) {
- if (parentStyle.justifyItemsPositionType() == LegacyPosition) {
+ if (parentStyle.justifyItems() == LegacyPosition)
style.setJustifyItems(parentStyle.justifyItems());
- style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionType());
- } else if (isFlexOrGrid) {
+ else if (isFlexOrGrid)
style.setJustifyItems(ItemPositionStretch);
- }
}
// The 'auto' keyword computes to 'stretch' on absolutely-positioned elements,
// and to the computed value of justify-items on the parent (minus
// any legacy keywords) on all other boxes.
if (style.justifySelf() == ItemPositionAuto) {
- if (absolutePositioned) {
+ if (absolutePositioned)
style.setJustifySelf(ItemPositionStretch);
- } else {
+ else
style.setJustifySelf(parentStyle.justifyItems());
- style.setJustifySelfOverflowAlignment(parentStyle.justifyItemsOverflowAlignment());
- }
}
// The 'auto' keyword computes to:
@@ -299,19 +295,17 @@ void StyleAdjuster::adjustStyleForAlignment(ComputedStyle& style, const Computed
// and to the computed value of align-items on the parent (minus
// any 'legacy' keywords) on all other boxes.
if (style.alignSelf() == ItemPositionAuto) {
- if (absolutePositioned) {
+ if (absolutePositioned)
style.setAlignSelf(ItemPositionStretch);
- } else {
+ else
style.setAlignSelf(parentStyle.alignItems());
- style.setAlignSelfOverflowAlignment(parentStyle.alignItemsOverflowAlignment());
- }
}
// Block Containers: For table cells, the behavior of the 'auto' depends on the computed
// value of 'vertical-align', otherwise behaves as 'start'.
// Flex Containers: 'auto' computes to 'flex-start'.
// Grid Containers: 'auto' computes to 'start', and 'stretch' behaves like 'start'.
- if ((style.justifyContent() == ContentPositionAuto) && (style.justifyContentDistribution() == ContentDistributionDefault)) {
+ if ((style.justifyContent() == ContentPositionAuto) && (style.justifyContent() == ContentDistributionDefault)) {
if (style.isDisplayFlexibleOrGridBox()) {
if (style.isDisplayFlexibleBox())
style.setJustifyContent(ContentPositionFlexStart);
@@ -324,10 +318,10 @@ void StyleAdjuster::adjustStyleForAlignment(ComputedStyle& style, const Computed
// value of 'vertical-align', otherwise behaves as 'start'.
// Flex Containers: 'auto' computes to 'stretch'.
// Grid Containers: 'auto' computes to 'start', and 'stretch' behaves like 'start'.
- if (style.alignContent() == ContentPositionAuto && style.alignContentDistribution() == ContentDistributionDefault) {
+ if (style.alignContent() == ContentPositionAuto && style.alignContent() == ContentDistributionDefault) {
if (style.isDisplayFlexibleOrGridBox()) {
if (style.isDisplayFlexibleBox())
- style.setAlignContentDistribution(ContentDistributionStretch);
+ style.setAlignContent(ContentDistributionStretch);
else
style.setAlignContent(ContentPositionStart);
}

Powered by Google App Engine
This is Rietveld 408576698