summaryrefslogtreecommitdiff
path: root/Source/WebCore/css
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-27 21:51:42 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-27 21:51:42 +0200
commitbe01689f43cf6882cf670d33df49ead1f570c53a (patch)
tree4bb2161d8983b38e3e7ed37b4a50303bfd5e2e85 /Source/WebCore/css
parenta89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (diff)
downloadqtwebkit-be01689f43cf6882cf670d33df49ead1f570c53a.tar.gz
Imported WebKit commit 8d6c5efc74f0222dfc7bcce8d845d4a2707ed9e6 (http://svn.webkit.org/repository/webkit/trunk@118629)
Diffstat (limited to 'Source/WebCore/css')
-rw-r--r--Source/WebCore/css/CSSComputedStyleDeclaration.cpp4
-rw-r--r--Source/WebCore/css/CSSParser.cpp14
-rw-r--r--Source/WebCore/css/CSSPrimitiveValueMappings.h6
-rw-r--r--Source/WebCore/css/CSSProperty.cpp2
-rw-r--r--Source/WebCore/css/CSSPropertyNames.in2
-rw-r--r--Source/WebCore/css/CSSValueKeywords.in4
-rw-r--r--Source/WebCore/css/StyleBuilder.cpp2
-rw-r--r--Source/WebCore/css/StylePropertySet.cpp4
-rw-r--r--Source/WebCore/css/StylePropertyShorthand.cpp4
-rw-r--r--Source/WebCore/css/StylePropertyShorthand.h2
-rw-r--r--Source/WebCore/css/StyleResolver.cpp6
-rw-r--r--Source/WebCore/css/makeprop.pl5
-rw-r--r--Source/WebCore/css/makevalues.pl5
13 files changed, 56 insertions, 4 deletions
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index 52b41b726..596fa7cde 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -226,6 +226,7 @@ static const CSSPropertyID computedProperties[] = {
#if ENABLE(CSS_FILTERS)
CSSPropertyWebkitFilter,
#endif
+#if ENABLE(CSS3_FLEXBOX)
CSSPropertyWebkitFlex,
CSSPropertyWebkitFlexOrder,
CSSPropertyWebkitFlexPack,
@@ -235,6 +236,7 @@ static const CSSPropertyID computedProperties[] = {
CSSPropertyWebkitFlexFlow,
CSSPropertyWebkitFlexLinePack,
CSSPropertyWebkitFlexWrap,
+#endif
CSSPropertyWebkitFontKerning,
CSSPropertyWebkitFontSmoothing,
CSSPropertyWebkitFontVariantLigatures,
@@ -1627,6 +1629,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
return cssValuePool().createValue(style->display());
case CSSPropertyEmptyCells:
return cssValuePool().createValue(style->emptyCells());
+#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlex: {
RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
list->append(cssValuePool().createValue(style->positiveFlex()));
@@ -1667,6 +1670,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
list->append(cssValuePool().createValue(style->flexWrap()));
return list.release();
}
+#endif
case CSSPropertyFloat:
return cssValuePool().createValue(style->floating());
case CSSPropertyFont: {
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index e14ed8ae9..725bc245e 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -684,6 +684,7 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
if (valueID == CSSValueSrgb || valueID == CSSValueDefault)
return true;
break;
+#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlexAlign:
if (valueID == CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueCenter || valueID == CSSValueBaseline || valueID == CSSValueStretch)
return true;
@@ -708,6 +709,7 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
if (valueID == CSSValueNone || valueID == CSSValueWrap || valueID == CSSValueWrapReverse)
return true;
break;
+#endif
case CSSPropertyWebkitFontKerning:
if (valueID == CSSValueAuto || valueID == CSSValueNormal || valueID == CSSValueNone)
return true;
@@ -912,12 +914,14 @@ static inline bool isKeywordPropertyID(CSSPropertyID propertyId)
case CSSPropertyWebkitColumnBreakBefore:
case CSSPropertyWebkitColumnBreakInside:
case CSSPropertyWebkitColumnRuleStyle:
+#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlexAlign:
case CSSPropertyWebkitFlexDirection:
case CSSPropertyWebkitFlexItemAlign:
case CSSPropertyWebkitFlexLinePack:
case CSSPropertyWebkitFlexPack:
case CSSPropertyWebkitFlexWrap:
+#endif
case CSSPropertyWebkitFontKerning:
case CSSPropertyWebkitFontSmoothing:
case CSSPropertyWebkitHyphens:
@@ -2089,6 +2093,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
}
break;
#endif
+#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlex:
if (id == CSSValueNone)
validPrimitive = true;
@@ -2103,6 +2108,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
m_valueList->next();
}
break;
+#endif
case CSSPropertyWebkitMarquee:
return parseShorthand(propId, webkitMarqueeShorthand(), important);
case CSSPropertyWebkitMarqueeIncrement:
@@ -2415,8 +2421,10 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyPadding:
// <padding-width>{1,4} | inherit
return parse4Values(propId, paddingShorthand().properties(), important);
+#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlexFlow:
return parseShorthand(propId, webkitFlexFlowShorthand(), important);
+#endif
case CSSPropertyFont:
// [ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [ / 'line-height' ]?
// 'font-family' ] | caption | icon | menu | message-box | small-caption | status-bar | inherit
@@ -2549,12 +2557,14 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyWebkitColumnBreakBefore:
case CSSPropertyWebkitColumnBreakInside:
case CSSPropertyWebkitColumnRuleStyle:
+#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlexAlign:
case CSSPropertyWebkitFlexDirection:
case CSSPropertyWebkitFlexItemAlign:
case CSSPropertyWebkitFlexLinePack:
case CSSPropertyWebkitFlexPack:
case CSSPropertyWebkitFlexWrap:
+#endif
case CSSPropertyWebkitFontKerning:
case CSSPropertyWebkitFontSmoothing:
case CSSPropertyWebkitHyphens:
@@ -5555,6 +5565,8 @@ bool CSSParser::parseReflect(CSSPropertyID propId, bool important)
return true;
}
+#if ENABLE(CSS3_FLEXBOX)
+
PassRefPtr<CSSValue> CSSParser::parseFlex(CSSParserValueList* args)
{
if (!args || !args->size() || args->size() > 3)
@@ -5600,6 +5612,8 @@ PassRefPtr<CSSValue> CSSParser::parseFlex(CSSParserValueList* args)
return flex;
}
+#endif
+
struct BorderImageParseContext {
BorderImageParseContext()
: m_canAdvance(false)
diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h
index c734e065a..24a7d445c 100644
--- a/Source/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h
@@ -1111,12 +1111,14 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDisplay e)
case INLINE_BOX:
m_value.ident = CSSValueWebkitInlineBox;
break;
+#if ENABLE(CSS3_FLEXBOX)
case FLEX:
m_value.ident = CSSValueWebkitFlex;
break;
case INLINE_FLEX:
m_value.ident = CSSValueWebkitInlineFlex;
break;
+#endif
case GRID:
m_value.ident = CSSValueWebkitGrid;
break;
@@ -1166,6 +1168,8 @@ template<> inline CSSPrimitiveValue::operator EEmptyCell() const
}
}
+#if ENABLE(CSS3_FLEXBOX)
+
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexAlign e)
: CSSValue(PrimitiveClass)
{
@@ -1371,6 +1375,8 @@ template<> inline CSSPrimitiveValue::operator EFlexWrap() const
}
}
+#endif
+
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFloat e)
: CSSValue(PrimitiveClass)
{
diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp
index fc76a5e7a..319b02614 100644
--- a/Source/WebCore/css/CSSProperty.cpp
+++ b/Source/WebCore/css/CSSProperty.cpp
@@ -537,6 +537,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
#if ENABLE(CSS_FILTERS)
case CSSPropertyWebkitFilter:
#endif
+#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlex:
case CSSPropertyWebkitFlexOrder:
case CSSPropertyWebkitFlexPack:
@@ -546,6 +547,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
case CSSPropertyWebkitFlexFlow:
case CSSPropertyWebkitFlexLinePack:
case CSSPropertyWebkitFlexWrap:
+#endif
case CSSPropertyWebkitFontSizeDelta:
case CSSPropertyWebkitGridColumns:
case CSSPropertyWebkitGridRows:
diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in
index eddd71503..2739dbafc 100644
--- a/Source/WebCore/css/CSSPropertyNames.in
+++ b/Source/WebCore/css/CSSPropertyNames.in
@@ -256,6 +256,7 @@ z-index
#if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS
-webkit-filter
#endif
+#if defined(ENABLE_CSS3_FLEXBOX) && ENABLE_CSS3_FLEXBOX
-webkit-flex
-webkit-flex-align
-webkit-flex-direction
@@ -265,6 +266,7 @@ z-index
-webkit-flex-order
-webkit-flex-pack
-webkit-flex-wrap
+#endif
-webkit-font-size-delta
-webkit-grid-columns
-webkit-grid-rows
diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in
index b626949e8..28e14cf4a 100644
--- a/Source/WebCore/css/CSSValueKeywords.in
+++ b/Source/WebCore/css/CSSValueKeywords.in
@@ -332,8 +332,10 @@ table-cell
table-caption
-webkit-box
-webkit-inline-box
+#if defined(ENABLE_CSS3_FLEXBOX) && ENABLE_CSS3_FLEXBOX
-webkit-flex
-webkit-inline-flex
+#endif
-webkit-grid
-webkit-inline-grid
//none
@@ -481,6 +483,7 @@ block-axis
single
multiple
+#if defined(ENABLE_CSS3_FLEXBOX) && ENABLE_CSS3_FLEXBOX
// CSS_PROP_FLEX_ALIGN
// start
// end
@@ -511,6 +514,7 @@ wrap-reverse
// justify
// distribute
// stretch
+#endif
// CSS_PROP_MARQUEE_DIRECTION
forwards
diff --git a/Source/WebCore/css/StyleBuilder.cpp b/Source/WebCore/css/StyleBuilder.cpp
index 53d384c8b..4c5bae6e5 100644
--- a/Source/WebCore/css/StyleBuilder.cpp
+++ b/Source/WebCore/css/StyleBuilder.cpp
@@ -1931,6 +1931,7 @@ StyleBuilder::StyleBuilder()
setPropertyHandler(CSSPropertyWebkitColumnSpan, ApplyPropertyDefault<ColumnSpan, &RenderStyle::columnSpan, ColumnSpan, &RenderStyle::setColumnSpan, ColumnSpan, &RenderStyle::initialColumnSpan>::createHandler());
setPropertyHandler(CSSPropertyWebkitColumnRuleStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::columnRuleStyle, EBorderStyle, &RenderStyle::setColumnRuleStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
setPropertyHandler(CSSPropertyWebkitColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler());
+#if ENABLE(CSS3_FLEXBOX)
setPropertyHandler(CSSPropertyWebkitFlex, ApplyPropertyFlex::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexAlign, EFlexAlign, &RenderStyle::setFlexAlign, EFlexAlign, &RenderStyle::initialFlexAlign>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexDirection, ApplyPropertyDefault<EFlexDirection, &RenderStyle::flexDirection, EFlexDirection, &RenderStyle::setFlexDirection, EFlexDirection, &RenderStyle::initialFlexDirection>::createHandler());
@@ -1940,6 +1941,7 @@ StyleBuilder::StyleBuilder()
setPropertyHandler(CSSPropertyWebkitFlexOrder, ApplyPropertyDefault<int, &RenderStyle::flexOrder, int, &RenderStyle::setFlexOrder, int, &RenderStyle::initialFlexOrder>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexPack, ApplyPropertyDefault<EFlexPack, &RenderStyle::flexPack, EFlexPack, &RenderStyle::setFlexPack, EFlexPack, &RenderStyle::initialFlexPack>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexWrap, ApplyPropertyDefault<EFlexWrap, &RenderStyle::flexWrap, EFlexWrap, &RenderStyle::setFlexWrap, EFlexWrap, &RenderStyle::initialFlexWrap>::createHandler());
+#endif
#if ENABLE(CSS_REGIONS)
setPropertyHandler(CSSPropertyWebkitFlowFrom, ApplyPropertyString<MapNoneToNull, &RenderStyle::regionThread, &RenderStyle::setRegionThread, &RenderStyle::initialRegionThread>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlowInto, ApplyPropertyString<MapNoneToNull, &RenderStyle::flowThread, &RenderStyle::setFlowThread, &RenderStyle::initialFlowThread>::createHandler());
diff --git a/Source/WebCore/css/StylePropertySet.cpp b/Source/WebCore/css/StylePropertySet.cpp
index 2cc488701..4ec31996a 100644
--- a/Source/WebCore/css/StylePropertySet.cpp
+++ b/Source/WebCore/css/StylePropertySet.cpp
@@ -120,8 +120,10 @@ String StylePropertySet::getPropertyValue(CSSPropertyID propertyID) const
return get4Values(borderWidthShorthand());
case CSSPropertyBorderStyle:
return get4Values(borderStyleShorthand());
+#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlexFlow:
return getShorthandValue(webkitFlexFlowShorthand());
+#endif
case CSSPropertyFont:
return fontValue();
case CSSPropertyMargin:
@@ -697,10 +699,12 @@ String StylePropertySet::asText() const
case CSSPropertyWebkitAnimationFillMode:
shorthandPropertyID = CSSPropertyWebkitAnimation;
break;
+#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlexDirection:
case CSSPropertyWebkitFlexWrap:
shorthandPropertyID = CSSPropertyWebkitFlexFlow;
break;
+#endif
case CSSPropertyWebkitMaskPositionX:
case CSSPropertyWebkitMaskPositionY:
case CSSPropertyWebkitMaskRepeatX:
diff --git a/Source/WebCore/css/StylePropertyShorthand.cpp b/Source/WebCore/css/StylePropertyShorthand.cpp
index 9c4cd370d..2265248e7 100644
--- a/Source/WebCore/css/StylePropertyShorthand.cpp
+++ b/Source/WebCore/css/StylePropertyShorthand.cpp
@@ -307,12 +307,14 @@ const StylePropertyShorthand& webkitColumnRuleShorthand()
return webkitColumnRuleLonghands;
}
+#if ENABLE(CSS3_FLEXBOX)
const StylePropertyShorthand& webkitFlexFlowShorthand()
{
static const CSSPropertyID flexFlowProperties[] = { CSSPropertyWebkitFlexDirection, CSSPropertyWebkitFlexWrap };
DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitFlexFlowLonghands, (flexFlowProperties, WTF_ARRAY_LENGTH(flexFlowProperties)));
return webkitFlexFlowLonghands;
}
+#endif
const StylePropertyShorthand& webkitMarginCollapseShorthand()
{
@@ -477,8 +479,10 @@ const StylePropertyShorthand& shorthandForProperty(CSSPropertyID propertyID)
return webkitColumnsShorthand();
case CSSPropertyWebkitColumnRule:
return webkitColumnRuleShorthand();
+#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlexFlow:
return webkitFlexFlowShorthand();
+#endif
case CSSPropertyWebkitMarginCollapse:
return webkitMarginCollapseShorthand();
case CSSPropertyWebkitMarquee:
diff --git a/Source/WebCore/css/StylePropertyShorthand.h b/Source/WebCore/css/StylePropertyShorthand.h
index d97a9a68a..a0585381f 100644
--- a/Source/WebCore/css/StylePropertyShorthand.h
+++ b/Source/WebCore/css/StylePropertyShorthand.h
@@ -86,7 +86,9 @@ const StylePropertyShorthand& webkitBorderEndShorthand();
const StylePropertyShorthand& webkitBorderStartShorthand();
const StylePropertyShorthand& webkitColumnsShorthand();
const StylePropertyShorthand& webkitColumnRuleShorthand();
+#if ENABLE(CSS3_FLEXBOX)
const StylePropertyShorthand& webkitFlexFlowShorthand();
+#endif
const StylePropertyShorthand& webkitMarginCollapseShorthand();
const StylePropertyShorthand& webkitMarqueeShorthand();
const StylePropertyShorthand& webkitMaskShorthand();
diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp
index 07290a64e..06b41a8ac 100644
--- a/Source/WebCore/css/StyleResolver.cpp
+++ b/Source/WebCore/css/StyleResolver.cpp
@@ -1914,7 +1914,9 @@ static EDisplay equivalentBlockDisplay(EDisplay display, bool isFloating, bool s
case BLOCK:
case TABLE:
case BOX:
+#if ENABLE(CSS3_FLEXBOX)
case FLEX:
+#endif
case GRID:
return display;
@@ -1927,8 +1929,10 @@ static EDisplay equivalentBlockDisplay(EDisplay display, bool isFloating, bool s
return TABLE;
case INLINE_BOX:
return BOX;
+#if ENABLE(CSS3_FLEXBOX)
case INLINE_FLEX:
return FLEX;
+#endif
case INLINE_GRID:
return GRID;
@@ -4105,6 +4109,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue *value)
case CSSPropertyWebkitColumns:
case CSSPropertyWebkitColumnSpan:
case CSSPropertyWebkitColumnWidth:
+#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlex:
case CSSPropertyWebkitFlexAlign:
case CSSPropertyWebkitFlexDirection:
@@ -4114,6 +4119,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue *value)
case CSSPropertyWebkitFlexOrder:
case CSSPropertyWebkitFlexPack:
case CSSPropertyWebkitFlexWrap:
+#endif
#if ENABLE(CSS_REGIONS)
case CSSPropertyWebkitFlowFrom:
case CSSPropertyWebkitFlowInto:
diff --git a/Source/WebCore/css/makeprop.pl b/Source/WebCore/css/makeprop.pl
index fbf0dd525..9bc0290d3 100644
--- a/Source/WebCore/css/makeprop.pl
+++ b/Source/WebCore/css/makeprop.pl
@@ -3,7 +3,7 @@
# This file is part of the WebKit project
#
# Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
-# Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+# Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved.
# Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
# Copyright (C) 2010 Andras Becsi (abecsi@inf.u-szeged.hu), University of Szeged
#
@@ -222,4 +222,5 @@ EOF
close HEADER;
-system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf --output-file=CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?";
+my $gperf = $ENV{GPERF} ? $ENV{GPERF} : "gperf";
+system("\"$gperf\" --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf --output-file=CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?";
diff --git a/Source/WebCore/css/makevalues.pl b/Source/WebCore/css/makevalues.pl
index 353360698..9c9fb5793 100644
--- a/Source/WebCore/css/makevalues.pl
+++ b/Source/WebCore/css/makevalues.pl
@@ -3,7 +3,7 @@
# This file is part of the WebKit project
#
# Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
-# Copyright (C) 2007 Apple Inc. All rights reserved.
+# Copyright (C) 2007, 2012 Apple Inc. All rights reserved.
# Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
# Copyright (C) 2010 Andras Becsi (abecsi@inf.u-szeged.hu), University of Szeged
#
@@ -160,4 +160,5 @@ const char* getValueName(unsigned short id);
EOF
close HEADER;
-system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf --output-file=CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?";
+my $gperf = $ENV{GPERF} ? $ENV{GPERF} : "gperf";
+system("\"$gperf\" --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf --output-file=CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?";