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

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

Issue 361113002: Properly managing overlfow-aligment for inherit and initial. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Applied suggested changes. Created 6 years, 6 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/CSSProperties.in ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleBuilderCustom.cpp
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index 264bdd4d282bdebad5307b13774d698cd8408392..ea5d3f76e642f20f7380249c84214b352a359063 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -203,6 +203,37 @@ void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state
state.style()->setVisitedLinkColor(state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->color(), true));
}
+void StyleBuilderFunctions::applyInitialCSSPropertyJustifyItems(StyleResolverState& state)
+{
+ state.style()->setJustifyItems(RenderStyle::initialJustifyItems());
+ state.style()->setJustifyItemsOverflowAlignment(RenderStyle::initialJustifyItemsOverflowAlignment());
+ state.style()->setJustifyItemsPositionType(RenderStyle::initialJustifyItemsPositionType());
+}
+
+void StyleBuilderFunctions::applyInheritCSSPropertyJustifyItems(StyleResolverState& state)
+{
+ state.style()->setJustifyItems(state.parentStyle()->justifyItems());
+ state.style()->setJustifyItemsOverflowAlignment(state.parentStyle()->justifyItemsOverflowAlignment());
+ state.style()->setJustifyItemsPositionType(state.parentStyle()->justifyItemsPositionType());
+}
+
+void StyleBuilderFunctions::applyValueCSSPropertyJustifyItems(StyleResolverState& state, CSSValue* value)
+{
+
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+ if (Pair* pairValue = primitiveValue->getPairValue()) {
+ if (pairValue->first()->getValueID() == CSSValueLegacy) {
+ state.style()->setJustifyItemsPositionType(LegacyPosition);
+ state.style()->setJustifyItems(*pairValue->second());
+ } else {
+ state.style()->setJustifyItems(*pairValue->first());
+ state.style()->setJustifyItemsOverflowAlignment(*pairValue->second());
+ }
+ } else {
+ state.style()->setJustifyItems(*primitiveValue);
+ }
+}
+
void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& state)
{
state.style()->clearCursorList();
« no previous file with comments | « Source/core/css/CSSProperties.in ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698