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

Unified Diff: sky/engine/core/css/resolver/StyleAdjuster.cpp

Issue 1061163002: Remove all uses of display:block and display:inline-block. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: update one more usage 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 | « sky/engine/core/css/parser/CSSPropertyParser.cpp ('k') | sky/engine/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/resolver/StyleAdjuster.cpp
diff --git a/sky/engine/core/css/resolver/StyleAdjuster.cpp b/sky/engine/core/css/resolver/StyleAdjuster.cpp
index 8e0110d583738df5834ac64f11c084abe72b28c2..8788d7450e1745760596606d9a4eeb15fdc14ad0 100644
--- a/sky/engine/core/css/resolver/StyleAdjuster.cpp
+++ b/sky/engine/core/css/resolver/StyleAdjuster.cpp
@@ -184,53 +184,19 @@ void StyleAdjuster::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty
void StyleAdjuster::adjustStyleForAlignment(RenderStyle& style, const RenderStyle& parentStyle)
{
- bool isFlex = style.isDisplayFlexibleBox();
- bool absolutePositioned = style.position() == AbsolutePosition;
-
- // If the inherited value of justify-items includes the legacy keyword, 'auto'
- // computes to the the inherited value.
- // Otherwise, auto computes to:
- // - 'stretch' for flex containers.
- // - 'start' for everything else.
if (style.justifyItems() == ItemPositionAuto) {
- if (parentStyle.justifyItemsPositionType() == LegacyPosition) {
- style.setJustifyItems(parentStyle.justifyItems());
- style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionType());
- } else if (isFlex) {
- style.setJustifyItems(ItemPositionStretch);
- }
+ style.setJustifyItems(parentStyle.justifyItems());
+ style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionType());
}
- // 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 {
- style.setJustifySelf(parentStyle.justifyItems());
- style.setJustifySelfOverflowAlignment(parentStyle.justifyItemsOverflowAlignment());
- }
+ style.setJustifySelf(parentStyle.justifyItems());
eseidel 2015/04/06 23:29:19 Should this be squashed into a single if now? Thes
ojan 2015/04/06 23:41:49 They're reading/writing different values. justifyI
+ style.setJustifySelfOverflowAlignment(parentStyle.justifyItemsOverflowAlignment());
}
- // The 'auto' keyword computes to:
- // - 'stretch' for flex containers,
- // - 'start' for everything else.
- if (style.alignItems() == ItemPositionAuto) {
- if (isFlex)
- style.setAlignItems(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 {
- style.setAlignSelf(parentStyle.alignItems());
- style.setAlignSelfOverflowAlignment(parentStyle.alignItemsOverflowAlignment());
- }
+ style.setAlignSelf(parentStyle.alignItems());
+ style.setAlignSelfOverflowAlignment(parentStyle.alignItemsOverflowAlignment());
eseidel 2015/04/06 23:29:19 This one too? are these ifs even needed?
}
}
« no previous file with comments | « sky/engine/core/css/parser/CSSPropertyParser.cpp ('k') | sky/engine/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698