WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch rebased
bug-134419-20140630130844.patch (text/plain), 36.22 KB, created by
Javier Fernandez
on 2014-06-30 04:09:05 PDT
(
hide
)
Description:
patch rebased
Filename:
MIME Type:
Creator:
Javier Fernandez
Created:
2014-06-30 04:09:05 PDT
Size:
36.22 KB
patch
obsolete
>Subversion Revision: 170581 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a6e91819750cc32c8c2f41110f2fd6decae7bf87..38c86eb918fdfb77d626d2d1fbf5b91802803e02 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,42 @@ >+2014-06-27 Javier Fernandez <jfernandez@igalia.com> >+ >+ [CSS Grid Layout] Implement justify-self css property >+ https://bugs.webkit.org/show_bug.cgi?id=134419 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This change adds the justify-self property from CSS 3 Box Alignment >+ and implements the parsing. >+ >+ From Blink r164685 by <jchaffraix@chromium.org> >+ >+ Test: fast/css/parse-justify-self.html >+ >+ * css/CSSComputedStyleDeclaration.cpp: >+ (WebCore::ComputedStyleExtractor::propertyValue): >+ * css/CSSParser.cpp: >+ (WebCore::isValidKeywordPropertyAndValue): >+ (WebCore::CSSParser::parseValue): >+ (WebCore::isItemPositionKeyword): >+ (WebCore::CSSParser::parseJustifySelf): >+ * css/CSSParser.h: >+ * css/CSSPrimitiveValueMappings.h: >+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): >+ (WebCore::CSSPrimitiveValue::operator EJustifySelf): >+ (WebCore::CSSPrimitiveValue::operator EJustifySelfOverflowAlignment): >+ * css/CSSPropertyNames.in: >+ * css/CSSValueKeywords.in: >+ * css/DeprecatedStyleBuilder.cpp: >+ (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): >+ * css/StyleResolver.cpp: >+ (WebCore::StyleResolver::applyProperty): >+ * rendering/style/RenderStyle.h: >+ * rendering/style/RenderStyleConstants.h: >+ * rendering/style/StyleRareNonInheritedData.cpp: >+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): >+ (WebCore::StyleRareNonInheritedData::operator==): >+ * rendering/style/StyleRareNonInheritedData.h: >+ > 2014-06-30 Ryuan Choi <ryuan.choi@samsung.com> > > [EFL] Remove m_evasObject from Widget >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index dbb8db6b0b459b6bd5f4ba085e594adbb40c54f6..b60a53218136f5b0594c8ebd058f75cfdf592002 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -283,6 +283,7 @@ static const CSSPropertyID computedProperties[] = { > CSSPropertyWebkitFlexDirection, > CSSPropertyWebkitFlexWrap, > CSSPropertyWebkitJustifyContent, >+ CSSPropertyWebkitJustifySelf, > CSSPropertyWebkitFontKerning, > CSSPropertyWebkitFontSmoothing, > CSSPropertyWebkitFontVariantLigatures, >@@ -2006,6 +2007,13 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propert > return cssValuePool().createValue(style->flexWrap()); > case CSSPropertyWebkitJustifyContent: > return cssValuePool().createValue(style->justifyContent()); >+ case CSSPropertyWebkitJustifySelf: { >+ RefPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); >+ result->append(CSSPrimitiveValue::create(style->justifySelf())); >+ if (style->justifySelf() >= JustifySelfCenter && style->justifySelfOverflowAlignment() != JustifySelfOverflowAlignmentDefault) >+ result->append(CSSPrimitiveValue::create(style->justifySelfOverflowAlignment())); >+ return result.release(); >+ } > case CSSPropertyWebkitOrder: > return cssValuePool().createValue(style->order(), CSSPrimitiveValue::CSS_NUMBER); > case CSSPropertyFloat: >diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp >index 7bc19726d21d11f2424159a3af3dd7f110f9d5d1..fb8562ba301e2f99672811f6a86f048f2848f290 100644 >--- a/Source/WebCore/css/CSSParser.cpp >+++ b/Source/WebCore/css/CSSParser.cpp >@@ -851,14 +851,17 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int > return true; > break; > case CSSPropertyWebkitAlignContent: >- if (valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueSpaceBetween || valueID == CSSValueSpaceAround || valueID == CSSValueStretch) >- return true; >- break; >+ // FIXME: Per CSS alignment, this property should accept an optional <overflow-position>. We should share this parsing code with 'justify-self'. >+ if (valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueSpaceBetween || valueID == CSSValueSpaceAround || valueID == CSSValueStretch) >+ return true; >+ break; > case CSSPropertyWebkitAlignItems: >+ // FIXME: Per CSS alignment, this property should accept the same arguments as 'justify-self' so we should share its parsing code. > if (valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueBaseline || valueID == CSSValueStretch) > return true; > break; > case CSSPropertyWebkitAlignSelf: >+ // FIXME: Per CSS alignment, this property should accept the same arguments as 'justify-self' so we should share its parsing code. > if (valueID == CSSValueAuto || valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueBaseline || valueID == CSSValueStretch) > return true; > break; >@@ -871,9 +874,14 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int > return true; > break; > case CSSPropertyWebkitJustifyContent: >+ // FIXME: Per CSS alignment, this property should accept an optional <overflow-position>. We should share this parsing code with 'justify-self'. > if (valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueSpaceBetween || valueID == CSSValueSpaceAround) > return true; > break; >+ case CSSPropertyWebkitJustifySelf: >+ if (valueID == CSSValueAuto || valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueBaseline || valueID == CSSValueStretch) >+ return true; >+ break; > case CSSPropertyWebkitFontKerning: > if (valueID == CSSValueAuto || valueID == CSSValueNormal || valueID == CSSValueNone) > return true; >@@ -2574,6 +2582,8 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important) > } > return false; > } >+ case CSSPropertyWebkitJustifySelf: >+ return parseJustifySelf(propId, important); > #if ENABLE(CSS_GRID_LAYOUT) > case CSSPropertyWebkitGridAutoColumns: > case CSSPropertyWebkitGridAutoRows: >@@ -3077,6 +3087,64 @@ void CSSParser::addFillValue(RefPtr<CSSValue>& lval, PassRefPtr<CSSValue> rval) > lval = rval; > } > >+static bool isItemPositionKeyword(CSSValueID id) >+{ >+ return id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter >+ || id == CSSValueSelfStart || id == CSSValueSelfEnd || id == CSSValueFlexStart >+ || id == CSSValueFlexEnd || id == CSSValueLeft || id == CSSValueRight; >+} >+ >+bool CSSParser::parseJustifySelf(CSSPropertyID propId, bool important) >+{ >+ // auto | baseline | stretch | [<item-position> && <overflow-position>? ] >+ // <item-position> = center | start | end | self-start | self-end | flex-start | flex-end | left | right; >+ // <overflow-position> = true | safe >+ >+ CSSParserValue* value = m_valueList->current(); >+ >+ if (value->id == CSSValueAuto || value->id == CSSValueBaseline || value->id == CSSValueStretch) { >+ if (m_valueList->next()) >+ return false; >+ >+ addProperty(propId, cssValuePool().createIdentifierValue(value->id), important); >+ return true; >+ } >+ >+ RefPtr<CSSPrimitiveValue> position = 0; >+ RefPtr<CSSPrimitiveValue> overflowAlignmentKeyword = 0; >+ if (isItemPositionKeyword(value->id)) { >+ position = cssValuePool().createIdentifierValue(value->id); >+ value = m_valueList->next(); >+ if (value) { >+ if (value->id == CSSValueTrue || value->id == CSSValueSafe) >+ overflowAlignmentKeyword = cssValuePool().createIdentifierValue(value->id); >+ else >+ return false; >+ } >+ } else if (value->id == CSSValueTrue || value->id == CSSValueSafe) { >+ overflowAlignmentKeyword = cssValuePool().createIdentifierValue(value->id); >+ value = m_valueList->next(); >+ if (value) { >+ if (isItemPositionKeyword(value->id)) >+ position = cssValuePool().createIdentifierValue(value->id); >+ else >+ return false; >+ } >+ } else >+ return false; >+ >+ if (m_valueList->next()) >+ return false; >+ >+ ASSERT(position); >+ if (overflowAlignmentKeyword) >+ addProperty(propId, createPrimitiveValuePair(position, overflowAlignmentKeyword), important); >+ else >+ addProperty(propId, position.release(), important); >+ >+ return true; >+} >+ > static bool parseBackgroundClip(CSSParserValue* parserValue, RefPtr<CSSValue>& cssValue) > { > if (parserValue->id == CSSValueBorderBox || parserValue->id == CSSValuePaddingBox >diff --git a/Source/WebCore/css/CSSParser.h b/Source/WebCore/css/CSSParser.h >index 08bdd4462884438f260a87b2b2a8efd6c2750299..4445d9375b603cd0868d02e0fc6a86eed78c149a 100644 >--- a/Source/WebCore/css/CSSParser.h >+++ b/Source/WebCore/css/CSSParser.h >@@ -182,6 +182,8 @@ public: > > bool parseClipShape(CSSPropertyID, bool important); > >+ bool parseJustifySelf(CSSPropertyID, bool important); >+ > #if ENABLE(CSS_SHAPES) > PassRefPtr<CSSValue> parseShapeProperty(CSSPropertyID); > #endif >diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h >index 19e27211eff2c7a217f8be08e3097f088d936256..b08405c4c8c416d93824a1c613d65456478690da 100644 >--- a/Source/WebCore/css/CSSPrimitiveValueMappings.h >+++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h >@@ -5128,6 +5128,118 @@ template<> inline CSSPrimitiveValue::operator CSSBoxType() const > return BoxMissing; > } > >+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EJustifySelf justifySelf) >+ : CSSValue(PrimitiveClass) >+{ >+ m_primitiveUnitType = CSS_VALUE_ID; >+ switch (justifySelf) { >+ case JustifySelfAuto: >+ m_value.valueID = CSSValueAuto; >+ break; >+ case JustifySelfStretch: >+ m_value.valueID = CSSValueStretch; >+ break; >+ case JustifySelfBaseline: >+ m_value.valueID = CSSValueBaseline; >+ break; >+ case JustifySelfCenter: >+ m_value.valueID = CSSValueCenter; >+ break; >+ case JustifySelfStart: >+ m_value.valueID = CSSValueStart; >+ break; >+ case JustifySelfEnd: >+ m_value.valueID = CSSValueEnd; >+ break; >+ case JustifySelfSelfStart: >+ m_value.valueID = CSSValueSelfStart; >+ break; >+ case JustifySelfSelfEnd: >+ m_value.valueID = CSSValueSelfEnd; >+ break; >+ case JustifySelfFlexStart: >+ m_value.valueID = CSSValueFlexStart; >+ break; >+ case JustifySelfFlexEnd: >+ m_value.valueID = CSSValueFlexEnd; >+ break; >+ case JustifySelfLeft: >+ m_value.valueID = CSSValueLeft; >+ break; >+ case JustifySelfRight: >+ m_value.valueID = CSSValueRight; >+ break; >+ default: >+ m_value.valueID = CSSValueAuto; >+ break; >+ } >+} >+ >+template<> inline CSSPrimitiveValue::operator EJustifySelf() const >+{ >+ switch (m_value.valueID) { >+ case CSSValueAuto: >+ return JustifySelfAuto; >+ case CSSValueStretch: >+ return JustifySelfStretch; >+ case CSSValueBaseline: >+ return JustifySelfBaseline; >+ case CSSValueCenter: >+ return JustifySelfCenter; >+ case CSSValueStart: >+ return JustifySelfStart; >+ case CSSValueEnd: >+ return JustifySelfEnd; >+ case CSSValueSelfStart: >+ return JustifySelfSelfStart; >+ case CSSValueSelfEnd: >+ return JustifySelfSelfEnd; >+ case CSSValueFlexStart: >+ return JustifySelfFlexStart; >+ case CSSValueFlexEnd: >+ return JustifySelfFlexEnd; >+ case CSSValueLeft: >+ return JustifySelfLeft; >+ case CSSValueRight: >+ return JustifySelfRight; >+ default: >+ break; >+ } >+ ASSERT_NOT_REACHED(); >+ return JustifySelfAuto; >+} >+ >+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EJustifySelfOverflowAlignment overflowAlignment) >+ : CSSValue(PrimitiveClass) >+{ >+ m_primitiveUnitType = CSS_VALUE_ID; >+ switch (overflowAlignment) { >+ case JustifySelfOverflowAlignmentDefault: >+ m_value.valueID = CSSValueDefault; >+ break; >+ case JustifySelfOverflowAlignmentTrue: >+ m_value.valueID = CSSValueTrue; >+ break; >+ case JustifySelfOverflowAlignmentSafe: >+ m_value.valueID = CSSValueSafe; >+ break; >+ } >+} >+ >+template<> inline CSSPrimitiveValue::operator EJustifySelfOverflowAlignment() const >+{ >+ switch (m_value.valueID) { >+ case CSSValueTrue: >+ return JustifySelfOverflowAlignmentTrue; >+ case CSSValueSafe: >+ return JustifySelfOverflowAlignmentSafe; >+ default: >+ break; >+ } >+ ASSERT_NOT_REACHED(); >+ return JustifySelfOverflowAlignmentTrue; >+} >+ > } > > #endif >diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in >index fc30c3f8a97b2f176e482962a5d41ded3629ef21..b66abadf5f7ae6ec4f9c84a799a089df0e0e3ff3 100644 >--- a/Source/WebCore/css/CSSPropertyNames.in >+++ b/Source/WebCore/css/CSSPropertyNames.in >@@ -303,6 +303,7 @@ isolation > -webkit-flex-shrink > -webkit-flex-wrap > -webkit-justify-content >+-webkit-justify-self > -webkit-font-size-delta > #if defined(ENABLE_CSS_GRID_LAYOUT) && ENABLE_CSS_GRID_LAYOUT > -webkit-grid >diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in >index 9ea57aaa07b65a61c8f54543d3eb6e440eed42de..095c94bf98b289325a61649f9cc4080e45e8e615 100644 >--- a/Source/WebCore/css/CSSValueKeywords.in >+++ b/Source/WebCore/css/CSSValueKeywords.in >@@ -544,6 +544,23 @@ space-around > // space-between > // space-around > >+// CSS_PROP_JUSTIFY_SELF >+// auto >+// stretch >+// baseline >+// center >+// start >+// end >+self-start >+self-end >+// flex-start >+// flex-end >+// left >+// right >+true >+safe >+ >+ > // CSS_PROP_FLEX_FLOW > row > row-reverse >diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp >index 5bd347133f91156266f2263d2b301166063f820d..0225d3cba6bbdc25678c3672eba95dc6dc010feb 100644 >--- a/Source/WebCore/css/StyleResolver.cpp >+++ b/Source/WebCore/css/StyleResolver.cpp >@@ -2791,6 +2791,16 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value) > return; > } > #endif /* ENABLE(CSS_GRID_LAYOUT) */ >+ case CSSPropertyWebkitJustifySelf: { >+ HANDLE_INHERIT_AND_INITIAL(justifySelf, JustifySelf); >+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); >+ if (Pair* pairValue = primitiveValue->getPairValue()) { >+ state.style()->setJustifySelf(*pairValue->first()); >+ state.style()->setJustifySelfOverflowAlignment(*pairValue->second()); >+ } else >+ state.style()->setJustifySelf(*primitiveValue); >+ return; >+ } > // These properties are aliased and DeprecatedStyleBuilder already applied the property on the prefixed version. > case CSSPropertyTransitionDelay: > case CSSPropertyTransitionDuration: >diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h >index 1ec21fec7b09c3ee3f3cf7a1c07dc053a429a8c0..31725cdb0d8d838cd79d905405bc1f9ed0266fb5 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.h >+++ b/Source/WebCore/rendering/style/RenderStyle.h >@@ -914,6 +914,8 @@ public: > bool isReverseFlexDirection() const { return flexDirection() == FlowRowReverse || flexDirection() == FlowColumnReverse; } > EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(rareNonInheritedData->m_flexibleBox->m_flexWrap); } > EJustifyContent justifyContent() const { return static_cast<EJustifyContent>(rareNonInheritedData->m_justifyContent); } >+ EJustifySelf justifySelf() const { return static_cast<EJustifySelf>(rareNonInheritedData->m_justifySelf); } >+ EJustifySelfOverflowAlignment justifySelfOverflowAlignment() const { return static_cast<EJustifySelfOverflowAlignment>(rareNonInheritedData->m_justifySelfOverflowAlignment); } > > #if ENABLE(CSS_GRID_LAYOUT) > const Vector<GridTrackSize>& gridColumns() const { return rareNonInheritedData->m_grid->m_gridColumns; } >@@ -1456,6 +1458,8 @@ public: > void setFlexDirection(EFlexDirection direction) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexDirection, direction); } > void setFlexWrap(EFlexWrap w) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexWrap, w); } > void setJustifyContent(EJustifyContent p) { SET_VAR(rareNonInheritedData, m_justifyContent, p); } >+ void setJustifySelf(EJustifySelf p) { SET_VAR(rareNonInheritedData, m_justifySelf, p); } >+ void setJustifySelfOverflowAlignment(EJustifySelfOverflowAlignment overflowAlignment) { SET_VAR(rareNonInheritedData, m_justifySelfOverflowAlignment, overflowAlignment); } > #if ENABLE(CSS_GRID_LAYOUT) > void setGridAutoColumns(const GridTrackSize& length) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridAutoColumns, length); } > void setGridAutoRows(const GridTrackSize& length) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridAutoRows, length); } >@@ -1820,6 +1824,8 @@ public: > static EFlexDirection initialFlexDirection() { return FlowRow; } > static EFlexWrap initialFlexWrap() { return FlexNoWrap; } > static EJustifyContent initialJustifyContent() { return JustifyFlexStart; } >+ static EJustifySelf initialJustifySelf() { return JustifySelfAuto; } >+ static EJustifySelfOverflowAlignment initialJustifySelfOverflowAlignment() { return JustifySelfOverflowAlignmentDefault; } > static int initialMarqueeLoopCount() { return -1; } > static int initialMarqueeSpeed() { return 85; } > static Length initialMarqueeIncrement() { return Length(6, Fixed); } >diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h >index f015d7426ebd26cf77ca9c52d3a93077096f0788..46fc349cb5116985f01879e79360ca80c6bb0c4a 100644 >--- a/Source/WebCore/rendering/style/RenderStyleConstants.h >+++ b/Source/WebCore/rendering/style/RenderStyleConstants.h >@@ -184,6 +184,9 @@ enum EAlignItems { AlignAuto, AlignFlexStart, AlignFlexEnd, AlignCenter, AlignSt > enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse }; > enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse }; > enum EJustifyContent { JustifyFlexStart, JustifyFlexEnd, JustifyCenter, JustifySpaceBetween, JustifySpaceAround }; >+enum EJustifySelf {JustifySelfAuto, JustifySelfStretch, JustifySelfBaseline, JustifySelfCenter, JustifySelfStart, JustifySelfEnd, JustifySelfSelfStart, JustifySelfSelfEnd, JustifySelfFlexStart, JustifySelfFlexEnd, JustifySelfLeft, JustifySelfRight}; >+enum EJustifySelfOverflowAlignment {JustifySelfOverflowAlignmentDefault, JustifySelfOverflowAlignmentTrue, JustifySelfOverflowAlignmentSafe}; >+ > > enum ETextSecurity { > TSNONE, TSDISC, TSCIRCLE, TSSQUARE >diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp >index 31a4398fc7e9898eedb65e10363c7403cddf7619..c33b269e4d83580f1cee411d5ffea36e2195e5f0 100644 >--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp >+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp >@@ -76,6 +76,8 @@ StyleRareNonInheritedData::StyleRareNonInheritedData() > , m_alignItems(RenderStyle::initialAlignItems()) > , m_alignSelf(RenderStyle::initialAlignSelf()) > , m_justifyContent(RenderStyle::initialJustifyContent()) >+ , m_justifySelf(RenderStyle::initialJustifySelf()) >+ , m_justifySelfOverflowAlignment(RenderStyle::initialJustifySelfOverflowAlignment()) > , userDrag(RenderStyle::initialUserDrag()) > , textOverflow(RenderStyle::initialTextOverflow()) > , marginBeforeCollapse(MCOLLAPSE) >@@ -153,6 +155,8 @@ inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn > , m_alignItems(o.m_alignItems) > , m_alignSelf(o.m_alignSelf) > , m_justifyContent(o.m_justifyContent) >+ , m_justifySelf(o.m_justifySelf) >+ , m_justifySelfOverflowAlignment(o.m_justifySelfOverflowAlignment) > , userDrag(o.userDrag) > , textOverflow(o.textOverflow) > , marginBeforeCollapse(o.marginBeforeCollapse) >@@ -255,7 +259,9 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c > && m_isolation == o.m_isolation > #endif > && m_aspectRatioType == o.m_aspectRatioType >- && m_objectFit == o.m_objectFit; >+ && m_objectFit == o.m_objectFit >+ && m_justifySelf == o.m_justifySelf >+ && m_justifySelfOverflowAlignment == o.m_justifySelfOverflowAlignment; > } > > bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInheritedData& o) const >diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h >index c40c604cd74c79dc6f2ead422bae506d2b60c03a..ff585ebab05a910f1de17639de0829f9bf00f82e 100644 >--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h >+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h >@@ -176,6 +176,9 @@ public: > unsigned m_alignSelf : 3; // EAlignItems > unsigned m_justifyContent : 3; // EJustifyContent > >+ unsigned m_justifySelf : 4; // EJustifySelf >+ unsigned m_justifySelfOverflowAlignment : 2; // EJustifySelfOverflowAlignment >+ > unsigned userDrag : 2; // EUserDrag > unsigned textOverflow : 1; // Whether or not lines that spill out should be truncated with "..." > unsigned marginBeforeCollapse : 2; // EMarginCollapse >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 3630edf6bb39a29c5c212cb28e5a5bd5edc9ad73..11a7833cd380d617257bcf707aea92704fb455cf 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,18 @@ >+2014-06-27 Javier Fernandez <jfernandez@igalia.com> >+ >+ [CSS Grid Layout] Implement justify-self css property >+ https://bugs.webkit.org/show_bug.cgi?id=134419 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This change adds the justify-self property from CSS 3 Box Alignment >+ and implements the parsing. >+ >+ From Blink r164685 by <jchaffraix@chromium.org> >+ >+ * fast/css/parse-justify-self-expected.txt: Added. >+ * fast/css/parse-justify-self.html: Added. >+ > 2014-06-29 Yoav Weiss <yoav@yoav.ws> > > Add support for HTMLImageElement's sizes attribute >diff --git a/LayoutTests/fast/css/parse-justify-self-expected.txt b/LayoutTests/fast/css/parse-justify-self-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..f176c3860d6b9e6b7e465743d60324f8a60ca062 >--- /dev/null >+++ b/LayoutTests/fast/css/parse-justify-self-expected.txt >@@ -0,0 +1,61 @@ >+Test that setting and getting justify-self works as expected >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Test getting justify-self set through CSS >+PASS getComputedStyle(justifySelfBaseline, '').getPropertyValue('-webkit-justify-self') is 'baseline' >+PASS getComputedStyle(justifySelfStretch, '').getPropertyValue('-webkit-justify-self') is 'stretch' >+PASS getComputedStyle(justifySelfStart, '').getPropertyValue('-webkit-justify-self') is 'start' >+PASS getComputedStyle(justifySelfEnd, '').getPropertyValue('-webkit-justify-self') is 'end' >+PASS getComputedStyle(justifySelfCenter, '').getPropertyValue('-webkit-justify-self') is 'center' >+PASS getComputedStyle(justifySelfSelfEnd, '').getPropertyValue('-webkit-justify-self') is 'self-end' >+PASS getComputedStyle(justifySelfSelfStart, '').getPropertyValue('-webkit-justify-self') is 'self-start' >+PASS getComputedStyle(justifySelfLeft, '').getPropertyValue('-webkit-justify-self') is 'left' >+PASS getComputedStyle(justifySelfRight, '').getPropertyValue('-webkit-justify-self') is 'right' >+PASS getComputedStyle(justifySelfEndTrue, '').getPropertyValue('-webkit-justify-self') is 'end true' >+PASS getComputedStyle(justifySelfCenterTrue, '').getPropertyValue('-webkit-justify-self') is 'center true' >+PASS getComputedStyle(justifySelfSelfEndSafe, '').getPropertyValue('-webkit-justify-self') is 'self-end safe' >+PASS getComputedStyle(justifySelfSelfStartSafe, '').getPropertyValue('-webkit-justify-self') is 'self-start safe' >+PASS getComputedStyle(justifySelfRightSafe, '').getPropertyValue('-webkit-justify-self') is 'right safe' >+PASS getComputedStyle(justifySelfLeftTrue, '').getPropertyValue('-webkit-justify-self') is 'left true' >+ >+Test initial value of justify-self through JS >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+ >+Test getting and setting justify-self through JS >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'center' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'start true' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+ >+Test bad combinaisons of justify-self >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+ >+Test the value 'initial' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'center' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'auto' >+ >+Test the value 'inherit' >+PASS getComputedStyle(parentElement, '').getPropertyValue('-webkit-justify-self') is 'end' >+PASS getComputedStyle(element, '').getPropertyValue('-webkit-justify-self') is 'end' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/css/parse-justify-self.html b/LayoutTests/fast/css/parse-justify-self.html >new file mode 100644 >index 0000000000000000000000000000000000000000..868620bee88713f5b2aedcde8d2ead073cea30bb >--- /dev/null >+++ b/LayoutTests/fast/css/parse-justify-self.html >@@ -0,0 +1,232 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<style> >+#justifySelfBaseline { >+ -webkit-justify-self: baseline; >+} >+ >+#justifySelfStretch { >+ -webkit-justify-self: stretch; >+} >+ >+#justifySelfStart { >+ -webkit-justify-self: start; >+} >+ >+#justifySelfEnd { >+ -webkit-justify-self: end; >+} >+ >+#justifySelfCenter { >+ -webkit-justify-self: center; >+} >+ >+#justifySelfSelfStart { >+ -webkit-justify-self: self-start; >+} >+ >+#justifySelfSelfEnd { >+ -webkit-justify-self: self-end; >+} >+ >+#justifySelfLeft { >+ -webkit-justify-self: left; >+} >+ >+#justifySelfRight { >+ -webkit-justify-self: right; >+} >+ >+#justifySelfEndTrue { >+ -webkit-justify-self: end true; >+} >+ >+#justifySelfCenterTrue { >+ -webkit-justify-self: center true; >+} >+ >+#justifySelfSelfEndSafe { >+ -webkit-justify-self: self-end safe; >+} >+ >+#justifySelfSelfStartSafe { >+ -webkit-justify-self: self-start safe; >+} >+ >+#justifySelfRightSafe { >+ -webkit-justify-self: right safe; >+} >+ >+#justifySelfLeftTrue { >+ -webkit-justify-self: left true; >+} >+</style> >+<script src="../../resources/js-test.js"></script> >+</head> >+<body> >+<div id="justifySelfBaseline"></div> >+<div id="justifySelfStretch"></div> >+<div id="justifySelfStart"></div> >+<div id="justifySelfEnd"></div> >+<div id="justifySelfCenter"></div> >+<div id="justifySelfSelfStart"></div> >+<div id="justifySelfSelfEnd"></div> >+<div id="justifySelfLeft"></div> >+<div id="justifySelfRight"></div> >+ >+<div id="justifySelfEndTrue"></div> >+<div id="justifySelfCenterTrue"></div> >+<div id="justifySelfSelfEndSafe"></div> >+<div id="justifySelfSelfStartSafe"></div> >+<div id="justifySelfRightSafe"></div> >+<div id="justifySelfLeftTrue"></div> >+<script> >+description('Test that setting and getting justify-self works as expected'); >+ >+debug("Test getting justify-self set through CSS"); >+var justifySelfBaseline = document.getElementById("justifySelfBaseline"); >+shouldBe("getComputedStyle(justifySelfBaseline, '').getPropertyValue('-webkit-justify-self')", "'baseline'"); >+ >+var justifySelfStretch = document.getElementById("justifySelfStretch"); >+shouldBe("getComputedStyle(justifySelfStretch, '').getPropertyValue('-webkit-justify-self')", "'stretch'"); >+ >+var justifySelfStart = document.getElementById("justifySelfStart"); >+shouldBe("getComputedStyle(justifySelfStart, '').getPropertyValue('-webkit-justify-self')", "'start'"); >+ >+var justifySelfEnd = document.getElementById("justifySelfEnd"); >+shouldBe("getComputedStyle(justifySelfEnd, '').getPropertyValue('-webkit-justify-self')", "'end'"); >+ >+var justifySelfCenter = document.getElementById("justifySelfCenter"); >+shouldBe("getComputedStyle(justifySelfCenter, '').getPropertyValue('-webkit-justify-self')", "'center'"); >+ >+var justifySelfSelfEnd = document.getElementById("justifySelfSelfEnd"); >+shouldBe("getComputedStyle(justifySelfSelfEnd, '').getPropertyValue('-webkit-justify-self')", "'self-end'"); >+ >+var justifySelfSelfStart = document.getElementById("justifySelfSelfStart"); >+shouldBe("getComputedStyle(justifySelfSelfStart, '').getPropertyValue('-webkit-justify-self')", "'self-start'"); >+ >+var justifySelfLeft = document.getElementById("justifySelfLeft"); >+shouldBe("getComputedStyle(justifySelfLeft, '').getPropertyValue('-webkit-justify-self')", "'left'"); >+ >+var justifySelfRight = document.getElementById("justifySelfRight"); >+shouldBe("getComputedStyle(justifySelfRight, '').getPropertyValue('-webkit-justify-self')", "'right'"); >+ >+var justifySelfEndTrue = document.getElementById("justifySelfEndTrue"); >+shouldBe("getComputedStyle(justifySelfEndTrue, '').getPropertyValue('-webkit-justify-self')", "'end true'"); >+ >+var justifySelfCenterTrue = document.getElementById("justifySelfCenterTrue"); >+shouldBe("getComputedStyle(justifySelfCenterTrue, '').getPropertyValue('-webkit-justify-self')", "'center true'"); >+ >+var justifySelfSelfEndSafe = document.getElementById("justifySelfSelfEndSafe"); >+shouldBe("getComputedStyle(justifySelfSelfEndSafe, '').getPropertyValue('-webkit-justify-self')", "'self-end safe'"); >+ >+var justifySelfSelfStartSafe = document.getElementById("justifySelfSelfStartSafe"); >+shouldBe("getComputedStyle(justifySelfSelfStartSafe, '').getPropertyValue('-webkit-justify-self')", "'self-start safe'"); >+ >+var justifySelfRightSafe = document.getElementById("justifySelfRightSafe"); >+shouldBe("getComputedStyle(justifySelfRightSafe, '').getPropertyValue('-webkit-justify-self')", "'right safe'"); >+ >+var justifySelfLeftTrue = document.getElementById("justifySelfLeftTrue"); >+shouldBe("getComputedStyle(justifySelfLeftTrue, '').getPropertyValue('-webkit-justify-self')", "'left true'"); >+ >+debug(""); >+debug("Test initial value of justify-self through JS"); >+element = document.createElement("div"); >+document.body.appendChild(element); >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+debug(""); >+debug("Test getting and setting justify-self through JS"); >+element = document.createElement("div"); >+document.body.appendChild(element); >+element.style.webkitJustifySelf = "center"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'center'"); >+ >+element = document.createElement("div"); >+document.body.appendChild(element); >+element.style.webkitJustifySelf = "true start"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'start true'"); >+ >+element.style.webkitJustifySelf = "auto"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+debug(""); >+debug("Test bad combinaisons of justify-self"); >+element = document.createElement("div"); >+document.body.appendChild(element); >+element.style.webkitJustifySelf = "true auto"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "auto safe"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "auto left"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "baseline safe"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "baseline center"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "stretch true"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "stretch right"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "true true"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "true safe"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "center start"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "stretch true"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "safe stretch"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "baseline safe"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "true baseline"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "true safe"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "true safe left"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "true left safe"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+element.style.webkitJustifySelf = "left safe true safe"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+debug(""); >+debug("Test the value 'initial'"); >+element.style.webkitJustifySelf = "center"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'center'"); >+element.style.webkitJustifySelf = "initial"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'auto'"); >+ >+debug(""); >+debug("Test the value 'inherit'"); >+parentElement = document.createElement("div"); >+document.body.appendChild(parentElement); >+parentElement.style.webkitJustifySelf = "end"; >+shouldBe("getComputedStyle(parentElement, '').getPropertyValue('-webkit-justify-self')", "'end'"); >+ >+element = document.createElement("div"); >+parentElement.appendChild(element); >+element.style.webkitJustifySelf = "inherit"; >+shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-justify-self')", "'end'"); >+</script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 134419
:
234031
|
234037
|
234039
|
234043
|
234047
|
234070
|
234071
|
234073
|
234075
|
234077
|
234103
|
234664
|
234754
|
234758
|
234774