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

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: Rebased and got back previous setter names. 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
« no previous file with comments | « Source/core/css/ComputedStyleCSSValueMapping.cpp ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index 3cb5dd5aa9e48f4c4717bafc326dc095afa33423..4eec24ede36d89633a05478e69e479c32fdb09fc 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -268,57 +268,51 @@ void StyleAdjuster::adjustStyleForAlignment(ComputedStyle& style, const Computed
// Otherwise, auto computes to:
// - 'stretch' for flex containers and grid containers.
// - 'start' for everything else.
- if (style.justifyItems() == ItemPositionAuto) {
- if (parentStyle.justifyItemsPositionType() == LegacyPosition) {
+ if (style.justifyItemsPosition() == ItemPositionAuto) {
+ if (parentStyle.justifyItemsPositionType() == LegacyPosition)
style.setJustifyItems(parentStyle.justifyItems());
- style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionType());
- } else if (isFlexOrGrid) {
- style.setJustifyItems(ItemPositionStretch);
- }
+ else if (isFlexOrGrid)
+ style.setJustifyItemsPosition(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) {
- style.setJustifySelf(ItemPositionStretch);
- } else {
+ if (style.justifySelfPosition() == ItemPositionAuto) {
+ if (absolutePositioned)
+ style.setJustifySelfPosition(ItemPositionStretch);
+ else
style.setJustifySelf(parentStyle.justifyItems());
- style.setJustifySelfOverflowAlignment(parentStyle.justifyItemsOverflowAlignment());
- }
}
// The 'auto' keyword computes to:
// - 'stretch' for flex containers and grid containers,
// - 'start' for everything else.
- if (style.alignItems() == ItemPositionAuto) {
+ if (style.alignItemsPosition() == ItemPositionAuto) {
if (isFlexOrGrid)
- style.setAlignItems(ItemPositionStretch);
+ style.setAlignItemsPosition(ItemPositionStretch);
}
// The 'auto' keyword computes to 'stretch' on absolutely-positioned elements,
// 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) {
- style.setAlignSelf(ItemPositionStretch);
- } else {
+ if (style.alignSelfPosition() == ItemPositionAuto) {
+ if (absolutePositioned)
+ style.setAlignSelfPosition(ItemPositionStretch);
+ 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.justifyContentPosition() == ContentPositionAuto) && (style.justifyContentDistribution() == ContentDistributionDefault)) {
if (style.isDisplayFlexibleOrGridBox()) {
if (style.isDisplayFlexibleBox())
- style.setJustifyContent(ContentPositionFlexStart);
+ style.setJustifyContentPosition(ContentPositionFlexStart);
else
- style.setJustifyContent(ContentPositionStart);
+ style.setJustifyContentPosition(ContentPositionStart);
}
}
@@ -326,12 +320,12 @@ 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.alignContentPosition() == ContentPositionAuto && style.alignContentDistribution() == ContentDistributionDefault) {
if (style.isDisplayFlexibleOrGridBox()) {
if (style.isDisplayFlexibleBox())
style.setAlignContentDistribution(ContentDistributionStretch);
else
- style.setAlignContent(ContentPositionStart);
+ style.setAlignContentPosition(ContentPositionStart);
}
}
}
« no previous file with comments | « Source/core/css/ComputedStyleCSSValueMapping.cpp ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698