https://bugs.webkit.org/show_bug.cgi?id=101462
Reviewed by David Hyatt.
Source/WebCore:
According to the latest CSS3 Multi-column specification:
http://www.w3.org/TR/2011/CR-css3-multicol-
20110412/#column-span
column-span should accept values [ none | all ], instead of
[ 1 | all ]. This patch updates WebKit implementation to reflect
this change in the specification. The value 1 is still supported
for compatibility reasons and is mapped to none.
No new tests, already covered by existing tests.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ColumnSpan):
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:
LayoutTests:
Update expected results for several test cases now that the
default value for column-span property was renamed from 1
to none.
* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* svg/css/getComputedStyle-basic-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136053
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-11-28 Christophe Dumez <christophe.dumez@intel.com>
+
+ CSS3 Multicolumn: column-span should accept value 'none' (instead of '1')
+ https://bugs.webkit.org/show_bug.cgi?id=101462
+
+ Reviewed by David Hyatt.
+
+ Update expected results for several test cases now that the
+ default value for column-span property was renamed from 1
+ to none.
+
+ * fast/css/getComputedStyle/computed-style-expected.txt:
+ * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
+ * svg/css/getComputedStyle-basic-expected.txt:
+
2012-11-28 Stephen Chenney <schenney@chromium.org>
Chromium TestExpectations minor changes.
-webkit-column-rule-color: rgb(0, 0, 0);
-webkit-column-rule-style: none;
-webkit-column-rule-width: 0px;
--webkit-column-span: 1;
+-webkit-column-span: none;
-webkit-column-width: auto;
-webkit-align-content: stretch;
-webkit-align-items: stretch;
-webkit-column-rule-color: rgb(0, 0, 0)
-webkit-column-rule-style: none
-webkit-column-rule-width: 0px
--webkit-column-span: 1
+-webkit-column-span: none
-webkit-column-width: auto
-webkit-align-content: stretch
-webkit-align-items: stretch
rect: style.getPropertyCSSValue(-webkit-column-rule-style) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(-webkit-column-rule-width) : 0px
rect: style.getPropertyCSSValue(-webkit-column-rule-width) : [object CSSPrimitiveValue]
-rect: style.getPropertyValue(-webkit-column-span) : 1
+rect: style.getPropertyValue(-webkit-column-span) : none
rect: style.getPropertyCSSValue(-webkit-column-span) : [object CSSPrimitiveValue]
rect: style.getPropertyValue(-webkit-column-width) : auto
rect: style.getPropertyCSSValue(-webkit-column-width) : [object CSSPrimitiveValue]
g: style.getPropertyCSSValue(-webkit-column-rule-style) : [object CSSPrimitiveValue]
g: style.getPropertyValue(-webkit-column-rule-width) : 0px
g: style.getPropertyCSSValue(-webkit-column-rule-width) : [object CSSPrimitiveValue]
-g: style.getPropertyValue(-webkit-column-span) : 1
+g: style.getPropertyValue(-webkit-column-span) : none
g: style.getPropertyCSSValue(-webkit-column-span) : [object CSSPrimitiveValue]
g: style.getPropertyValue(-webkit-column-width) : auto
g: style.getPropertyCSSValue(-webkit-column-width) : [object CSSPrimitiveValue]
+2012-11-28 Christophe Dumez <christophe.dumez@intel.com>
+
+ CSS3 Multicolumn: column-span should accept value 'none' (instead of '1')
+ https://bugs.webkit.org/show_bug.cgi?id=101462
+
+ Reviewed by David Hyatt.
+
+ According to the latest CSS3 Multi-column specification:
+ http://www.w3.org/TR/2011/CR-css3-multicol-20110412/#column-span
+
+ column-span should accept values [ none | all ], instead of
+ [ 1 | all ]. This patch updates WebKit implementation to reflect
+ this change in the specification. The value 1 is still supported
+ for compatibility reasons and is mapped to none.
+
+ No new tests, already covered by existing tests.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ (WebCore::CSSPrimitiveValue::operator ColumnSpan):
+ * rendering/style/RenderStyle.h:
+ * rendering/style/RenderStyleConstants.h:
+
2012-11-28 Anton Vayvod <avayvod@chromium.org>
Text Autosizing: Clusters should use width of LCA of their text nodes
case CSSPropertyWebkitColumnRuleWidth:
return zoomAdjustedPixelValue(style->columnRuleWidth(), style.get());
case CSSPropertyWebkitColumnSpan:
- if (style->columnSpan())
- return cssValuePool().createIdentifierValue(CSSValueAll);
- return cssValuePool().createValue(1, CSSPrimitiveValue::CSS_NUMBER);
+ return cssValuePool().createIdentifierValue(style->columnSpan() ? CSSValueAll : CSSValueNone);
case CSSPropertyWebkitColumnBreakAfter:
return cssValuePool().createValue(style->columnBreakAfter());
case CSSPropertyWebkitColumnBreakBefore:
if (id == CSSValueNormal || id == CSSValueReverse)
validPrimitive = true;
break;
- case CSSPropertyWebkitColumnSpan: // all | 1
- if (id == CSSValueAll)
+ case CSSPropertyWebkitColumnSpan: // none | all | 1 (will be dropped in the unprefixed property)
+ if (id == CSSValueAll || id == CSSValueNone)
validPrimitive = true;
else
validPrimitive = validUnit(value, FNumber | FNonNeg) && value->fValue == 1;
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColumnSpan columnSpan)
: CSSValue(PrimitiveClass)
{
+ m_primitiveUnitType = CSS_IDENT;
switch (columnSpan) {
case ColumnSpanAll:
- m_primitiveUnitType = CSS_IDENT;
m_value.ident = CSSValueAll;
break;
- case ColumnSpanOne:
- m_primitiveUnitType = CSS_NUMBER;
- m_value.num = 1;
+ case ColumnSpanNone:
+ m_value.ident = CSSValueNone;
break;
}
}
template<> inline CSSPrimitiveValue::operator ColumnSpan() const
{
- if (m_primitiveUnitType == CSS_IDENT && m_value.ident == CSSValueAll)
- return ColumnSpanAll;
+ // Map 1 to none for compatibility reasons.
if (m_primitiveUnitType == CSS_NUMBER && m_value.num == 1)
- return ColumnSpanOne;
+ return ColumnSpanNone;
+
+ switch (m_value.ident) {
+ case CSSValueAll:
+ return ColumnSpanAll;
+ case CSSValueNone:
+ return ColumnSpanNone;
+ }
+
ASSERT_NOT_REACHED();
- return ColumnSpanOne;
+ return ColumnSpanNone;
}
static Order initialRTLOrdering() { return LogicalOrder; }
static float initialTextStrokeWidth() { return 0; }
static unsigned short initialColumnCount() { return 1; }
- static ColumnSpan initialColumnSpan() { return ColumnSpanOne; }
+ static ColumnSpan initialColumnSpan() { return ColumnSpanNone; }
static const TransformOperations& initialTransform() { DEFINE_STATIC_LOCAL(TransformOperations, ops, ()); return ops; }
static Length initialTransformOriginX() { return Length(50.0, Percent); }
static Length initialTransformOriginY() { return Length(50.0, Percent); }
PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1)
};
-enum ColumnSpan { ColumnSpanOne = 0, ColumnSpanAll};
+enum ColumnSpan { ColumnSpanNone = 0, ColumnSpanAll };
enum EBorderCollapse { BSEPARATE = 0, BCOLLAPSE = 1 };