Merge from Chromium at DEPS revision r205460
This commit was generated by merge_to_master.py.
Change-Id: Id50fcfa40590db3bd322348190cb5192c432eadf
diff --git a/Source/core/css/BasicShapeFunctions.cpp b/Source/core/css/BasicShapeFunctions.cpp
index c6f09d9..fe53cd0 100644
--- a/Source/core/css/BasicShapeFunctions.cpp
+++ b/Source/core/css/BasicShapeFunctions.cpp
@@ -42,7 +42,7 @@
{
RefPtr<CSSBasicShape> basicShapeValue;
switch (basicShape->type()) {
- case BasicShape::BASIC_SHAPE_RECTANGLE: {
+ case BasicShape::BasicShapeRectangleType: {
const BasicShapeRectangle* rectangle = static_cast<const BasicShapeRectangle*>(basicShape);
RefPtr<CSSBasicShapeRectangle> rectangleValue = CSSBasicShapeRectangle::create();
@@ -59,7 +59,7 @@
basicShapeValue = rectangleValue.release();
break;
}
- case BasicShape::BASIC_SHAPE_CIRCLE: {
+ case BasicShape::BasicShapeCircleType: {
const BasicShapeCircle* circle = static_cast<const BasicShapeCircle*>(basicShape);
RefPtr<CSSBasicShapeCircle> circleValue = CSSBasicShapeCircle::create();
@@ -70,7 +70,7 @@
basicShapeValue = circleValue.release();
break;
}
- case BasicShape::BASIC_SHAPE_ELLIPSE: {
+ case BasicShape::BasicShapeEllipseType: {
const BasicShapeEllipse* ellipse = static_cast<const BasicShapeEllipse*>(basicShape);
RefPtr<CSSBasicShapeEllipse> ellipseValue = CSSBasicShapeEllipse::create();
@@ -82,7 +82,7 @@
basicShapeValue = ellipseValue.release();
break;
}
- case BasicShape::BASIC_SHAPE_POLYGON: {
+ case BasicShape::BasicShapePolygonType: {
const BasicShapePolygon* polygon = static_cast<const BasicShapePolygon*>(basicShape);
RefPtr<CSSBasicShapePolygon> polygonValue = CSSBasicShapePolygon::create();
@@ -94,6 +94,23 @@
basicShapeValue = polygonValue.release();
break;
}
+ case BasicShape::BasicShapeInsetRectangleType: {
+ const BasicShapeInsetRectangle* rectangle = static_cast<const BasicShapeInsetRectangle*>(basicShape);
+ RefPtr<CSSBasicShapeInsetRectangle> rectangleValue = CSSBasicShapeInsetRectangle::create();
+
+ rectangleValue->setTop(cssValuePool().createValue(rectangle->top()));
+ rectangleValue->setRight(cssValuePool().createValue(rectangle->right()));
+ rectangleValue->setBottom(cssValuePool().createValue(rectangle->bottom()));
+ rectangleValue->setLeft(cssValuePool().createValue(rectangle->left()));
+ if (!rectangle->cornerRadiusX().isUndefined()) {
+ rectangleValue->setRadiusX(cssValuePool().createValue(rectangle->cornerRadiusX()));
+ if (!rectangle->cornerRadiusY().isUndefined())
+ rectangleValue->setRadiusY(cssValuePool().createValue(rectangle->cornerRadiusY()));
+ }
+
+ basicShapeValue = rectangleValue.release();
+ break;
+ }
default:
break;
}
@@ -110,7 +127,7 @@
RefPtr<BasicShape> basicShape;
switch (basicShapeValue->type()) {
- case CSSBasicShape::CSS_BASIC_SHAPE_RECTANGLE: {
+ case CSSBasicShape::CSSBasicShapeRectangleType: {
const CSSBasicShapeRectangle* rectValue = static_cast<const CSSBasicShapeRectangle *>(basicShapeValue);
RefPtr<BasicShapeRectangle> rect = BasicShapeRectangle::create();
@@ -126,7 +143,7 @@
basicShape = rect.release();
break;
}
- case CSSBasicShape::CSS_BASIC_SHAPE_CIRCLE: {
+ case CSSBasicShape::CSSBasicShapeCircleType: {
const CSSBasicShapeCircle* circleValue = static_cast<const CSSBasicShapeCircle *>(basicShapeValue);
RefPtr<BasicShapeCircle> circle = BasicShapeCircle::create();
@@ -137,7 +154,7 @@
basicShape = circle.release();
break;
}
- case CSSBasicShape::CSS_BASIC_SHAPE_ELLIPSE: {
+ case CSSBasicShape::CSSBasicShapeEllipseType: {
const CSSBasicShapeEllipse* ellipseValue = static_cast<const CSSBasicShapeEllipse *>(basicShapeValue);
RefPtr<BasicShapeEllipse> ellipse = BasicShapeEllipse::create();
@@ -149,7 +166,7 @@
basicShape = ellipse.release();
break;
}
- case CSSBasicShape::CSS_BASIC_SHAPE_POLYGON: {
+ case CSSBasicShape::CSSBasicShapePolygonType: {
const CSSBasicShapePolygon* polygonValue = static_cast<const CSSBasicShapePolygon *>(basicShapeValue);
RefPtr<BasicShapePolygon> polygon = BasicShapePolygon::create();
@@ -161,6 +178,22 @@
basicShape = polygon.release();
break;
}
+ case CSSBasicShape::CSSBasicShapeInsetRectangleType: {
+ const CSSBasicShapeInsetRectangle* rectValue = static_cast<const CSSBasicShapeInsetRectangle *>(basicShapeValue);
+ RefPtr<BasicShapeInsetRectangle> rect = BasicShapeInsetRectangle::create();
+
+ rect->setTop(convertToLength(styleResolver, rectValue->top()));
+ rect->setRight(convertToLength(styleResolver, rectValue->right()));
+ rect->setBottom(convertToLength(styleResolver, rectValue->bottom()));
+ rect->setLeft(convertToLength(styleResolver, rectValue->left()));
+ if (rectValue->radiusX()) {
+ rect->setCornerRadiusX(convertToLength(styleResolver, rectValue->radiusX()));
+ if (rectValue->radiusY())
+ rect->setCornerRadiusY(convertToLength(styleResolver, rectValue->radiusY()));
+ }
+ basicShape = rect.release();
+ break;
+ }
default:
break;
}
diff --git a/Source/core/css/WebKitCSSArrayFunctionValue.cpp b/Source/core/css/CSSArrayFunctionValue.cpp
similarity index 72%
rename from Source/core/css/WebKitCSSArrayFunctionValue.cpp
rename to Source/core/css/CSSArrayFunctionValue.cpp
index 753494b..54cfb6a 100644
--- a/Source/core/css/WebKitCSSArrayFunctionValue.cpp
+++ b/Source/core/css/CSSArrayFunctionValue.cpp
@@ -28,38 +28,38 @@
*/
#include "config.h"
-#include "core/css/WebKitCSSArrayFunctionValue.h"
+#include "core/css/CSSArrayFunctionValue.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
namespace WebCore {
-WebKitCSSArrayFunctionValue::WebKitCSSArrayFunctionValue()
- : CSSValueList(WebKitCSSArrayFunctionValueClass, CommaSeparator)
+CSSArrayFunctionValue::CSSArrayFunctionValue()
+ : CSSValueList(CSSArrayFunctionValueClass, CommaSeparator)
{
}
-WebKitCSSArrayFunctionValue::WebKitCSSArrayFunctionValue(const WebKitCSSArrayFunctionValue& cloneFrom)
+CSSArrayFunctionValue::CSSArrayFunctionValue(const CSSArrayFunctionValue& cloneFrom)
: CSSValueList(cloneFrom)
{
}
-String WebKitCSSArrayFunctionValue::customCssText() const
+String CSSArrayFunctionValue::customCssText() const
{
return "array(" + CSSValueList::customCssText() + ')';
}
-PassRefPtr<WebKitCSSArrayFunctionValue> WebKitCSSArrayFunctionValue::cloneForCSSOM() const
+PassRefPtr<CSSArrayFunctionValue> CSSArrayFunctionValue::cloneForCSSOM() const
{
- return adoptRef(new WebKitCSSArrayFunctionValue(*this));
+ return adoptRef(new CSSArrayFunctionValue(*this));
}
-bool WebKitCSSArrayFunctionValue::equals(const WebKitCSSArrayFunctionValue& other) const
+bool CSSArrayFunctionValue::equals(const CSSArrayFunctionValue& other) const
{
return CSSValueList::equals(other);
}
-void WebKitCSSArrayFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+void CSSArrayFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
CSSValueList::reportDescendantMemoryUsage(memoryObjectInfo);
diff --git a/Source/core/css/WebKitCSSArrayFunctionValue.h b/Source/core/css/CSSArrayFunctionValue.h
similarity index 75%
rename from Source/core/css/WebKitCSSArrayFunctionValue.h
rename to Source/core/css/CSSArrayFunctionValue.h
index 310b3cc..5251229 100644
--- a/Source/core/css/WebKitCSSArrayFunctionValue.h
+++ b/Source/core/css/CSSArrayFunctionValue.h
@@ -27,32 +27,32 @@
* SUCH DAMAGE.
*/
-#ifndef WebKitCSSArrayFunctionValue_h
-#define WebKitCSSArrayFunctionValue_h
+#ifndef CSSArrayFunctionValue_h
+#define CSSArrayFunctionValue_h
#include "core/css/CSSValueList.h"
-#include <wtf/PassRefPtr.h>
+#include "wtf/PassRefPtr.h"
namespace WebCore {
-class WebKitCSSArrayFunctionValue : public CSSValueList {
+class CSSArrayFunctionValue : public CSSValueList {
public:
- static PassRefPtr<WebKitCSSArrayFunctionValue> create()
+ static PassRefPtr<CSSArrayFunctionValue> create()
{
- return adoptRef(new WebKitCSSArrayFunctionValue());
+ return adoptRef(new CSSArrayFunctionValue());
}
String customCssText() const;
- PassRefPtr<WebKitCSSArrayFunctionValue> cloneForCSSOM() const;
+ PassRefPtr<CSSArrayFunctionValue> cloneForCSSOM() const;
- bool equals(const WebKitCSSArrayFunctionValue&) const;
+ bool equals(const CSSArrayFunctionValue&) const;
void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
private:
- WebKitCSSArrayFunctionValue();
- WebKitCSSArrayFunctionValue(const WebKitCSSArrayFunctionValue& cloneFrom);
+ CSSArrayFunctionValue();
+ CSSArrayFunctionValue(const CSSArrayFunctionValue& cloneFrom);
};
} // namespace WebCore
diff --git a/Source/core/css/CSSAspectRatioValue.cpp b/Source/core/css/CSSAspectRatioValue.cpp
index 8711ee9..2f6c463 100644
--- a/Source/core/css/CSSAspectRatioValue.cpp
+++ b/Source/core/css/CSSAspectRatioValue.cpp
@@ -30,7 +30,7 @@
#include "core/css/CSSAspectRatioValue.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
-#include <wtf/text/StringBuilder.h>
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
diff --git a/Source/core/css/CSSBasicShapes.cpp b/Source/core/css/CSSBasicShapes.cpp
index 3cb6b74..1505149 100644
--- a/Source/core/css/CSSBasicShapes.cpp
+++ b/Source/core/css/CSSBasicShapes.cpp
@@ -43,7 +43,7 @@
char separator[] = ", ";
StringBuilder result;
// Compute the required capacity in advance to reduce allocations.
- result.reserveCapacity((sizeof(opening) - 1) + (5 * (sizeof(separator) -1 )) + 1 + x.length() + y.length() + width.length() + height.length() + radiusX.length() + radiusY.length());
+ result.reserveCapacity((sizeof(opening) - 1) + (5 * (sizeof(separator) - 1)) + 1 + x.length() + y.length() + width.length() + height.length() + radiusX.length() + radiusY.length());
result.appendLiteral(opening);
result.append(x);
result.appendLiteral(separator);
@@ -76,7 +76,7 @@
bool CSSBasicShapeRectangle::equals(const CSSBasicShape& shape) const
{
- if (shape.type() != CSS_BASIC_SHAPE_RECTANGLE)
+ if (shape.type() != CSSBasicShapeRectangleType)
return false;
const CSSBasicShapeRectangle& other = static_cast<const CSSBasicShapeRectangle&>(shape);
@@ -120,7 +120,7 @@
bool CSSBasicShapeCircle::equals(const CSSBasicShape& shape) const
{
- if (shape.type() != CSS_BASIC_SHAPE_CIRCLE)
+ if (shape.type() != CSSBasicShapeCircleType)
return false;
const CSSBasicShapeCircle& other = static_cast<const CSSBasicShapeCircle&>(shape);
@@ -155,7 +155,7 @@
bool CSSBasicShapeEllipse::equals(const CSSBasicShape& shape) const
{
- if (shape.type() != CSS_BASIC_SHAPE_ELLIPSE)
+ if (shape.type() != CSSBasicShapeEllipseType)
return false;
const CSSBasicShapeEllipse& other = static_cast<const CSSBasicShapeEllipse&>(shape);
@@ -232,7 +232,7 @@
bool CSSBasicShapePolygon::equals(const CSSBasicShape& shape) const
{
- if (shape.type() != CSS_BASIC_SHAPE_POLYGON)
+ if (shape.type() != CSSBasicShapePolygonType)
return false;
const CSSBasicShapePolygon& rhs = static_cast<const CSSBasicShapePolygon&>(shape);
@@ -259,5 +259,76 @@
return false;
}
+static String buildInsetRectangleString(const String& top, const String& right, const String& bottom, const String& left, const String& radiusX, const String& radiusY)
+{
+ char opening[] = "inset-rectangle(";
+ char separator[] = ", ";
+ StringBuilder result;
+ // Compute the required capacity in advance to reduce allocations.
+ result.reserveCapacity((sizeof(opening) - 1) + (5 * (sizeof(separator) - 1)) + 1 + top.length() + right.length() + bottom.length() + left.length() + radiusX.length() + radiusY.length());
+ result.appendLiteral(opening);
+ result.append(top);
+ result.appendLiteral(separator);
+ result.append(right);
+ result.appendLiteral(separator);
+ result.append(bottom);
+ result.appendLiteral(separator);
+ result.append(left);
+ if (!radiusX.isNull()) {
+ result.appendLiteral(separator);
+ result.append(radiusX);
+ if (!radiusY.isNull()) {
+ result.appendLiteral(separator);
+ result.append(radiusY);
+ }
+ }
+ result.append(')');
+ return result.toString();
+}
+
+String CSSBasicShapeInsetRectangle::cssText() const
+{
+ return buildInsetRectangleString(m_top->cssText(),
+ m_right->cssText(),
+ m_bottom->cssText(),
+ m_left->cssText(),
+ m_radiusX.get() ? m_radiusX->cssText() : String(),
+ m_radiusY.get() ? m_radiusY->cssText() : String());
+}
+
+bool CSSBasicShapeInsetRectangle::equals(const CSSBasicShape& shape) const
+{
+ if (shape.type() != CSSBasicShapeInsetRectangleType)
+ return false;
+
+ const CSSBasicShapeInsetRectangle& other = static_cast<const CSSBasicShapeInsetRectangle&>(shape);
+ return compareCSSValuePtr(m_top, other.m_top)
+ && compareCSSValuePtr(m_right, other.m_right)
+ && compareCSSValuePtr(m_bottom, other.m_bottom)
+ && compareCSSValuePtr(m_left, other.m_left)
+ && compareCSSValuePtr(m_radiusX, other.m_radiusX)
+ && compareCSSValuePtr(m_radiusY, other.m_radiusY);
+}
+
+String CSSBasicShapeInsetRectangle::serializeResolvingVariables(const HashMap<AtomicString, String>& variables) const
+{
+ return buildInsetRectangleString(m_top->serializeResolvingVariables(variables),
+ m_right->serializeResolvingVariables(variables),
+ m_bottom->serializeResolvingVariables(variables),
+ m_left->serializeResolvingVariables(variables),
+ m_radiusX.get() ? m_radiusX->serializeResolvingVariables(variables) : String(),
+ m_radiusY.get() ? m_radiusY->serializeResolvingVariables(variables) : String());
+}
+
+bool CSSBasicShapeInsetRectangle::hasVariableReference() const
+{
+ return m_top->hasVariableReference()
+ || m_right->hasVariableReference()
+ || m_bottom->hasVariableReference()
+ || m_left->hasVariableReference()
+ || (m_radiusX.get() && m_radiusX->hasVariableReference())
+ || (m_radiusY.get() && m_radiusY->hasVariableReference());
+}
+
} // namespace WebCore
diff --git a/Source/core/css/CSSBasicShapes.h b/Source/core/css/CSSBasicShapes.h
index 13370b0..e099e19 100644
--- a/Source/core/css/CSSBasicShapes.h
+++ b/Source/core/css/CSSBasicShapes.h
@@ -41,10 +41,11 @@
class CSSBasicShape : public RefCounted<CSSBasicShape> {
public:
enum Type {
- CSS_BASIC_SHAPE_RECTANGLE = 1,
- CSS_BASIC_SHAPE_CIRCLE = 2,
- CSS_BASIC_SHAPE_ELLIPSE = 3,
- CSS_BASIC_SHAPE_POLYGON = 4
+ CSSBasicShapeRectangleType = 1,
+ CSSBasicShapeCircleType = 2,
+ CSSBasicShapeEllipseType = 3,
+ CSSBasicShapePolygonType = 4,
+ CSSBasicShapeInsetRectangleType = 5
};
virtual Type type() const = 0;
@@ -79,7 +80,7 @@
void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; }
void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY; }
- virtual Type type() const { return CSS_BASIC_SHAPE_RECTANGLE; }
+ virtual Type type() const { return CSSBasicShapeRectangleType; }
virtual String cssText() const;
virtual bool equals(const CSSBasicShape&) const;
@@ -97,6 +98,42 @@
RefPtr<CSSPrimitiveValue> m_radiusY;
};
+class CSSBasicShapeInsetRectangle : public CSSBasicShape {
+public:
+ static PassRefPtr<CSSBasicShapeInsetRectangle> create() { return adoptRef(new CSSBasicShapeInsetRectangle); }
+
+ CSSPrimitiveValue* top() const { return m_top.get(); }
+ CSSPrimitiveValue* right() const { return m_right.get(); }
+ CSSPrimitiveValue* bottom() const { return m_bottom.get(); }
+ CSSPrimitiveValue* left() const { return m_left.get(); }
+ CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); }
+ CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); }
+
+ void setTop(PassRefPtr<CSSPrimitiveValue> top) { m_top = top; }
+ void setRight(PassRefPtr<CSSPrimitiveValue> right) { m_right = right; }
+ void setBottom(PassRefPtr<CSSPrimitiveValue> bottom) { m_bottom = bottom; }
+ void setLeft(PassRefPtr<CSSPrimitiveValue> left) { m_left = left; }
+ void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; }
+ void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY; }
+
+ virtual Type type() const { return CSSBasicShapeInsetRectangleType; }
+ virtual String cssText() const;
+ virtual bool equals(const CSSBasicShape&) const;
+
+ virtual String serializeResolvingVariables(const HashMap<AtomicString, String>&) const;
+ virtual bool hasVariableReference() const;
+
+private:
+ CSSBasicShapeInsetRectangle() { }
+
+ RefPtr<CSSPrimitiveValue> m_right;
+ RefPtr<CSSPrimitiveValue> m_top;
+ RefPtr<CSSPrimitiveValue> m_bottom;
+ RefPtr<CSSPrimitiveValue> m_left;
+ RefPtr<CSSPrimitiveValue> m_radiusX;
+ RefPtr<CSSPrimitiveValue> m_radiusY;
+};
+
class CSSBasicShapeCircle : public CSSBasicShape {
public:
static PassRefPtr<CSSBasicShapeCircle> create() { return adoptRef(new CSSBasicShapeCircle); }
@@ -109,7 +146,7 @@
void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY; }
void setRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_radius = radius; }
- virtual Type type() const { return CSS_BASIC_SHAPE_CIRCLE; }
+ virtual Type type() const { return CSSBasicShapeCircleType; }
virtual String cssText() const;
virtual bool equals(const CSSBasicShape&) const;
@@ -138,7 +175,7 @@
void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; }
void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY; }
- virtual Type type() const { return CSS_BASIC_SHAPE_ELLIPSE; }
+ virtual Type type() const { return CSSBasicShapeEllipseType; }
virtual String cssText() const;
virtual bool equals(const CSSBasicShape&) const;
@@ -171,7 +208,7 @@
void setWindRule(WindRule w) { m_windRule = w; }
WindRule windRule() const { return m_windRule; }
- virtual Type type() const { return CSS_BASIC_SHAPE_POLYGON; }
+ virtual Type type() const { return CSSBasicShapePolygonType; }
virtual String cssText() const;
virtual bool equals(const CSSBasicShape&) const;
virtual String serializeResolvingVariables(const HashMap<AtomicString, String>&) const;
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index 36a24bb..48da4ed 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -25,18 +25,22 @@
#include "core/css/CSSComputedStyleDeclaration.h"
#include "CSSPropertyNames.h"
-#include "WebKitFontFamilyNames.h"
+#include "FontFamilyNames.h"
#include "core/css/BasicShapeFunctions.h"
+#include "core/css/CSSArrayFunctionValue.h"
#include "core/css/CSSAspectRatioValue.h"
#include "core/css/CSSBorderImage.h"
+#include "core/css/CSSFilterValue.h"
#include "core/css/CSSFunctionValue.h"
#include "core/css/CSSLineBoxContainValue.h"
+#include "core/css/CSSMixFunctionValue.h"
#include "core/css/CSSParser.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSPrimitiveValueMappings.h"
#include "core/css/CSSReflectValue.h"
#include "core/css/CSSSelector.h"
#include "core/css/CSSTimingFunctionValue.h"
+#include "core/css/CSSTransformValue.h"
#include "core/css/CSSValueList.h"
#include "core/css/CSSValuePool.h"
#include "core/css/FontFeatureValue.h"
@@ -46,7 +50,6 @@
#include "core/css/ShadowValue.h"
#include "core/css/StylePropertySet.h"
#include "core/css/StylePropertyShorthand.h"
-#include "core/css/WebKitCSSTransformValue.h"
#include "core/css/resolver/StyleResolver.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
@@ -64,15 +67,12 @@
#include "core/rendering/style/RenderStyle.h"
#include <wtf/text/StringBuilder.h>
-#include "core/css/WebKitCSSArrayFunctionValue.h"
-#include "core/css/WebKitCSSMixFunctionValue.h"
#include "core/platform/graphics/filters/custom/CustomFilterArrayParameter.h"
#include "core/platform/graphics/filters/custom/CustomFilterNumberParameter.h"
#include "core/platform/graphics/filters/custom/CustomFilterOperation.h"
#include "core/platform/graphics/filters/custom/CustomFilterParameter.h"
#include "core/platform/graphics/filters/custom/CustomFilterTransformParameter.h"
-#include "core/css/WebKitCSSFilterValue.h"
#include "core/rendering/style/StyleCustomFilterProgram.h"
namespace WebCore {
@@ -171,10 +171,10 @@
CSSPropertyTabSize,
CSSPropertyTextAlign,
CSSPropertyTextDecoration,
+ CSSPropertyTextDecorationLine,
+ CSSPropertyTextDecorationStyle,
+ CSSPropertyTextDecorationColor,
#if ENABLE(CSS3_TEXT)
- CSSPropertyWebkitTextDecorationLine,
- CSSPropertyWebkitTextDecorationStyle,
- CSSPropertyWebkitTextDecorationColor,
CSSPropertyWebkitTextAlignLast,
CSSPropertyWebkitTextUnderlinePosition,
#endif // CSS3_TEXT
@@ -231,7 +231,6 @@
CSSPropertyWebkitBoxReflect,
CSSPropertyWebkitBoxShadow,
CSSPropertyWebkitClipPath,
- CSSPropertyWebkitColorCorrection,
CSSPropertyWebkitColumnBreakAfter,
CSSPropertyWebkitColumnBreakBefore,
CSSPropertyWebkitColumnBreakInside,
@@ -257,15 +256,15 @@
CSSPropertyWebkitFontKerning,
CSSPropertyWebkitFontSmoothing,
CSSPropertyWebkitFontVariantLigatures,
- CSSPropertyWebkitGridAutoColumns,
- CSSPropertyWebkitGridAutoFlow,
- CSSPropertyWebkitGridAutoRows,
- CSSPropertyWebkitGridColumns,
- CSSPropertyWebkitGridRows,
- CSSPropertyWebkitGridStart,
- CSSPropertyWebkitGridEnd,
- CSSPropertyWebkitGridBefore,
- CSSPropertyWebkitGridAfter,
+ CSSPropertyGridAutoColumns,
+ CSSPropertyGridAutoFlow,
+ CSSPropertyGridAutoRows,
+ CSSPropertyGridColumns,
+ CSSPropertyGridRows,
+ CSSPropertyGridStart,
+ CSSPropertyGridEnd,
+ CSSPropertyGridBefore,
+ CSSPropertyGridAfter,
CSSPropertyWebkitHighlight,
CSSPropertyWebkitHyphenateCharacter,
CSSPropertyWebkitHyphenateLimitAfter,
@@ -390,7 +389,7 @@
return properties;
}
-static int valueForRepeatRule(int rule)
+static CSSValueID valueForRepeatRule(int rule)
{
switch (rule) {
case RepeatImageRule:
@@ -733,11 +732,11 @@
return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box->computedCSSContentBoxRect();
}
-static PassRefPtr<WebKitCSSTransformValue> matrixTransformValue(const TransformationMatrix& transform, const RenderStyle* style)
+static PassRefPtr<CSSTransformValue> matrixTransformValue(const TransformationMatrix& transform, const RenderStyle* style)
{
- RefPtr<WebKitCSSTransformValue> transformValue;
+ RefPtr<CSSTransformValue> transformValue;
if (transform.isAffine()) {
- transformValue = WebKitCSSTransformValue::create(WebKitCSSTransformValue::MatrixTransformOperation);
+ transformValue = CSSTransformValue::create(CSSTransformValue::MatrixTransformOperation);
transformValue->append(cssValuePool().createValue(transform.a(), CSSPrimitiveValue::CSS_NUMBER));
transformValue->append(cssValuePool().createValue(transform.b(), CSSPrimitiveValue::CSS_NUMBER));
@@ -746,7 +745,7 @@
transformValue->append(zoomAdjustedNumberValue(transform.e(), style));
transformValue->append(zoomAdjustedNumberValue(transform.f(), style));
} else {
- transformValue = WebKitCSSTransformValue::create(WebKitCSSTransformValue::Matrix3DTransformOperation);
+ transformValue = CSSTransformValue::create(CSSTransformValue::Matrix3DTransformOperation);
transformValue->append(cssValuePool().createValue(transform.m11(), CSSPrimitiveValue::CSS_NUMBER));
transformValue->append(cssValuePool().createValue(transform.m12(), CSSPrimitiveValue::CSS_NUMBER));
@@ -793,7 +792,7 @@
static PassRefPtr<CSSValue> valueForCustomFilterArrayParameter(const CustomFilterArrayParameter* arrayParameter)
{
- RefPtr<WebKitCSSArrayFunctionValue> arrayParameterValue = WebKitCSSArrayFunctionValue::create();
+ RefPtr<CSSArrayFunctionValue> arrayParameterValue = CSSArrayFunctionValue::create();
for (unsigned i = 0, size = arrayParameter->size(); i < size; ++i)
arrayParameterValue->append(cssValuePool().createValue(arrayParameter->valueAt(i), CSSPrimitiveValue::CSS_NUMBER));
return arrayParameterValue.release();
@@ -843,7 +842,7 @@
RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- RefPtr<WebKitCSSFilterValue> filterValue;
+ RefPtr<CSSFilterValue> filterValue;
Vector<RefPtr<FilterOperation> >::const_iterator end = style->filter().operations().end();
for (Vector<RefPtr<FilterOperation> >::const_iterator it = style->filter().operations().begin(); it != end; ++it) {
@@ -851,67 +850,67 @@
switch (filterOperation->getOperationType()) {
case FilterOperation::REFERENCE: {
ReferenceFilterOperation* referenceOperation = static_cast<ReferenceFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::ReferenceFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::ReferenceFilterOperation);
filterValue->append(cssValuePool().createValue(referenceOperation->url(), CSSPrimitiveValue::CSS_STRING));
break;
}
case FilterOperation::GRAYSCALE: {
BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::GrayscaleFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::GrayscaleFilterOperation);
filterValue->append(cssValuePool().createValue(colorMatrixOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
break;
}
case FilterOperation::SEPIA: {
BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::SepiaFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::SepiaFilterOperation);
filterValue->append(cssValuePool().createValue(colorMatrixOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
break;
}
case FilterOperation::SATURATE: {
BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::SaturateFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::SaturateFilterOperation);
filterValue->append(cssValuePool().createValue(colorMatrixOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
break;
}
case FilterOperation::HUE_ROTATE: {
BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::HueRotateFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::HueRotateFilterOperation);
filterValue->append(cssValuePool().createValue(colorMatrixOperation->amount(), CSSPrimitiveValue::CSS_DEG));
break;
}
case FilterOperation::INVERT: {
BasicComponentTransferFilterOperation* componentTransferOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::InvertFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::InvertFilterOperation);
filterValue->append(cssValuePool().createValue(componentTransferOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
break;
}
case FilterOperation::OPACITY: {
BasicComponentTransferFilterOperation* componentTransferOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::OpacityFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::OpacityFilterOperation);
filterValue->append(cssValuePool().createValue(componentTransferOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
break;
}
case FilterOperation::BRIGHTNESS: {
BasicComponentTransferFilterOperation* brightnessOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::BrightnessFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::BrightnessFilterOperation);
filterValue->append(cssValuePool().createValue(brightnessOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
break;
}
case FilterOperation::CONTRAST: {
BasicComponentTransferFilterOperation* contrastOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::ContrastFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::ContrastFilterOperation);
filterValue->append(cssValuePool().createValue(contrastOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
break;
}
case FilterOperation::BLUR: {
BlurFilterOperation* blurOperation = static_cast<BlurFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::BlurFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::BlurFilterOperation);
filterValue->append(zoomAdjustedPixelValue(blurOperation->stdDeviation().value(), style));
break;
}
case FilterOperation::DROP_SHADOW: {
DropShadowFilterOperation* dropShadowOperation = static_cast<DropShadowFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::DropShadowFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::DropShadowFilterOperation);
// We want our computed style to look like that of a text shadow (has neither spread nor inset style).
ShadowData shadowData = ShadowData(dropShadowOperation->location(), dropShadowOperation->stdDeviation(), 0, Normal, dropShadowOperation->color());
filterValue->append(valueForShadow(&shadowData, CSSPropertyTextShadow, style));
@@ -923,7 +922,7 @@
break;
case FilterOperation::CUSTOM: {
CustomFilterOperation* customOperation = static_cast<CustomFilterOperation*>(filterOperation);
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::CustomFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::CustomFilterOperation);
// The output should be verbose, even if the values are the default ones.
@@ -939,7 +938,7 @@
const CustomFilterProgramMixSettings mixSettings = program->mixSettings();
if (program->fragmentShader()) {
if (program->programType() == PROGRAM_TYPE_BLENDS_ELEMENT_TEXTURE) {
- RefPtr<WebKitCSSMixFunctionValue> mixFunction = WebKitCSSMixFunctionValue::create();
+ RefPtr<CSSMixFunctionValue> mixFunction = CSSMixFunctionValue::create();
mixFunction->append(program->fragmentShader()->cssValue());
mixFunction->append(cssValuePool().createValue(mixSettings.blendMode));
mixFunction->append(cssValuePool().createValue(mixSettings.compositeOperator));
@@ -980,7 +979,7 @@
break;
}
default:
- filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::UnknownFilterOperation);
+ filterValue = CSSFilterValue::create(CSSFilterValue::UnknownFilterOperation);
break;
}
list->append(filterValue.release());
@@ -1223,11 +1222,11 @@
ec = NO_MODIFICATION_ALLOWED_ERR;
}
-static int cssIdentifierForFontSizeKeyword(int keywordSize)
+static CSSValueID cssIdentifierForFontSizeKeyword(int keywordSize)
{
ASSERT_ARG(keywordSize, keywordSize);
ASSERT_ARG(keywordSize, keywordSize <= 8);
- return CSSValueXxSmall + keywordSize - 1;
+ return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1);
}
PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword() const
@@ -1283,7 +1282,7 @@
return getPropertyCSSValue(propertyID, UpdateLayout);
}
-static int identifierForFamily(const AtomicString& family)
+static CSSValueID identifierForFamily(const AtomicString& family)
{
if (family == cursiveFamily)
return CSSValueCursive;
@@ -1297,12 +1296,12 @@
return CSSValueSansSerif;
if (family == serifFamily)
return CSSValueSerif;
- return 0;
+ return CSSValueInvalid;
}
static PassRefPtr<CSSPrimitiveValue> valueForFamily(const AtomicString& family)
{
- if (int familyIdentifier = identifierForFamily(family))
+ if (CSSValueID familyIdentifier = identifierForFamily(family))
return cssValuePool().createIdentifierValue(familyIdentifier);
return cssValuePool().createValue(family.string(), CSSPrimitiveValue::CSS_STRING);
}
@@ -1323,7 +1322,6 @@
return list;
}
-#if ENABLE(CSS3_TEXT)
static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorationStyle textDecorationStyle)
{
switch (textDecorationStyle) {
@@ -1342,7 +1340,6 @@
ASSERT_NOT_REACHED();
return cssValuePool().createExplicitInitialValue();
}
-#endif // CSS3_TEXT
static PassRefPtr<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepeat yRepeat)
{
@@ -1919,29 +1916,31 @@
}
return list.release();
}
- case CSSPropertyWebkitGridAutoColumns:
+ case CSSPropertyGridAutoColumns:
return valueForGridTrackSize(style->gridAutoColumns(), style.get(), m_node->document()->renderView());
- case CSSPropertyWebkitGridAutoFlow:
+ case CSSPropertyGridAutoFlow:
return cssValuePool().createValue(style->gridAutoFlow());
- case CSSPropertyWebkitGridAutoRows:
+ case CSSPropertyGridAutoRows:
return valueForGridTrackSize(style->gridAutoRows(), style.get(), m_node->document()->renderView());
- case CSSPropertyWebkitGridColumns:
+ case CSSPropertyGridColumns:
return valueForGridTrackList(style->gridColumns(), style->namedGridColumnLines(), style.get(), m_node->document()->renderView());
- case CSSPropertyWebkitGridRows:
+ case CSSPropertyGridRows:
return valueForGridTrackList(style->gridRows(), style->namedGridRowLines(), style.get(), m_node->document()->renderView());
- case CSSPropertyWebkitGridStart:
+ case CSSPropertyGridStart:
return valueForGridPosition(style->gridStart());
- case CSSPropertyWebkitGridEnd:
+ case CSSPropertyGridEnd:
return valueForGridPosition(style->gridEnd());
- case CSSPropertyWebkitGridBefore:
+ case CSSPropertyGridBefore:
return valueForGridPosition(style->gridBefore());
- case CSSPropertyWebkitGridAfter:
+ case CSSPropertyGridAfter:
return valueForGridPosition(style->gridAfter());
- case CSSPropertyWebkitGridColumn:
- return getCSSPropertyValuesForGridShorthand(webkitGridColumnShorthand());
- case CSSPropertyWebkitGridRow:
- return getCSSPropertyValuesForGridShorthand(webkitGridRowShorthand());
+ case CSSPropertyGridColumn:
+ return getCSSPropertyValuesForGridShorthand(gridColumnShorthand());
+ case CSSPropertyGridRow:
+ return getCSSPropertyValuesForGridShorthand(gridRowShorthand());
+ case CSSPropertyGridArea:
+ return getCSSPropertyValuesForGridShorthand(gridAreaShorthand());
case CSSPropertyHeight:
if (renderer) {
@@ -2132,14 +2131,13 @@
case CSSPropertyTextAlign:
return cssValuePool().createValue(style->textAlign());
case CSSPropertyTextDecoration:
+ case CSSPropertyTextDecorationLine:
return renderTextDecorationFlagsToCSSValue(style->textDecoration());
-#if ENABLE(CSS3_TEXT)
- case CSSPropertyWebkitTextDecorationLine:
- return renderTextDecorationFlagsToCSSValue(style->textDecoration());
- case CSSPropertyWebkitTextDecorationStyle:
+ case CSSPropertyTextDecorationStyle:
return renderTextDecorationStyleFlagsToCSSValue(style->textDecorationStyle());
- case CSSPropertyWebkitTextDecorationColor:
+ case CSSPropertyTextDecorationColor:
return currentColorOrValidColor(style.get(), style->textDecorationColor());
+#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextAlignLast:
return cssValuePool().createValue(style->textAlignLast());
case CSSPropertyWebkitTextUnderlinePosition:
@@ -2536,8 +2534,6 @@
}
case CSSPropertyPointerEvents:
return cssValuePool().createValue(style->pointerEvents());
- case CSSPropertyWebkitColorCorrection:
- return cssValuePool().createValue(style->colorSpace());
case CSSPropertyWebkitLineGrid:
if (style->lineGrid().isNull())
return cssValuePool().createIdentifierValue(CSSValueNone);
@@ -2589,14 +2585,24 @@
case CSSPropertyWebkitShapeInside:
if (!style->shapeInside())
return cssValuePool().createIdentifierValue(CSSValueAuto);
- else if (style->shapeInside()->type() == ExclusionShapeValue::OUTSIDE)
+ if (style->shapeInside()->type() == ExclusionShapeValue::Outside)
return cssValuePool().createIdentifierValue(CSSValueOutsideShape);
- ASSERT(style->shapeInside()->type() == ExclusionShapeValue::SHAPE);
+ if (style->shapeInside()->type() == ExclusionShapeValue::Image) {
+ if (style->shapeInside()->image())
+ return style->shapeInside()->image()->cssValue();
+ return cssValuePool().createIdentifierValue(CSSValueNone);
+ }
+ ASSERT(style->shapeInside()->type() == ExclusionShapeValue::Shape);
return valueForBasicShape(style->shapeInside()->shape());
case CSSPropertyWebkitShapeOutside:
if (!style->shapeOutside())
return cssValuePool().createIdentifierValue(CSSValueAuto);
- ASSERT(style->shapeOutside()->type() == ExclusionShapeValue::SHAPE);
+ if (style->shapeOutside()->type() == ExclusionShapeValue::Image) {
+ if (style->shapeOutside()->image())
+ return style->shapeOutside()->image()->cssValue();
+ return cssValuePool().createIdentifierValue(CSSValueNone);
+ }
+ ASSERT(style->shapeOutside()->type() == ExclusionShapeValue::Shape);
return valueForBasicShape(style->shapeOutside()->shape());
case CSSPropertyWebkitWrapThrough:
return cssValuePool().createValue(style->wrapThrough());
@@ -2835,9 +2841,9 @@
m_node->document()->updateLayoutIgnorePendingStylesheets();
RenderStyle* style = m_node->computedStyle(m_pseudoElementSpecifier);
if (style && style->fontDescription().keywordSize()) {
- int sizeValue = cssIdentifierForFontSizeKeyword(style->fontDescription().keywordSize());
+ CSSValueID sizeValue = cssIdentifierForFontSizeKeyword(style->fontDescription().keywordSize());
const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(propertyValue);
- if (primitiveValue->isIdent() && primitiveValue->getIdent() == sizeValue)
+ if (primitiveValue->isValueID() && primitiveValue->getValueID() == sizeValue)
return true;
}
}
diff --git a/Source/core/css/CSSDefaultStyleSheets.cpp b/Source/core/css/CSSDefaultStyleSheets.cpp
index c9aa381..84db661 100644
--- a/Source/core/css/CSSDefaultStyleSheets.cpp
+++ b/Source/core/css/CSSDefaultStyleSheets.cpp
@@ -74,7 +74,7 @@
static StyleSheetContents* parseUASheet(const String& str)
{
- StyleSheetContents* sheet = StyleSheetContents::create().leakRef(); // leak the sheet on purpose
+ StyleSheetContents* sheet = StyleSheetContents::create(CSSParserContext(UASheetMode)).leakRef(); // leak the sheet on purpose
sheet->parseString(str);
return sheet;
}
diff --git a/Source/core/css/WebKitCSSFilterRule.cpp b/Source/core/css/CSSFilterRule.cpp
similarity index 83%
rename from Source/core/css/WebKitCSSFilterRule.cpp
rename to Source/core/css/CSSFilterRule.cpp
index e97096c..8810884 100644
--- a/Source/core/css/WebKitCSSFilterRule.cpp
+++ b/Source/core/css/CSSFilterRule.cpp
@@ -28,36 +28,36 @@
*/
#include "config.h"
-#include "core/css/WebKitCSSFilterRule.h"
+#include "core/css/CSSFilterRule.h"
#include "core/css/PropertySetCSSStyleDeclaration.h"
#include "core/css/StylePropertySet.h"
#include "core/css/StyleRule.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
-#include <wtf/text/StringBuilder.h>
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
-WebKitCSSFilterRule::WebKitCSSFilterRule(StyleRuleFilter* filterRule, CSSStyleSheet* parent)
+CSSFilterRule::CSSFilterRule(StyleRuleFilter* filterRule, CSSStyleSheet* parent)
: CSSRule(parent)
, m_filterRule(filterRule)
{
}
-WebKitCSSFilterRule::~WebKitCSSFilterRule()
+CSSFilterRule::~CSSFilterRule()
{
if (m_propertiesCSSOMWrapper)
m_propertiesCSSOMWrapper->clearParentRule();
}
-CSSStyleDeclaration* WebKitCSSFilterRule::style() const
+CSSStyleDeclaration* CSSFilterRule::style() const
{
if (!m_propertiesCSSOMWrapper)
- m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_filterRule->mutableProperties(), const_cast<WebKitCSSFilterRule*>(this));
+ m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_filterRule->mutableProperties(), const_cast<CSSFilterRule*>(this));
return m_propertiesCSSOMWrapper.get();
}
-String WebKitCSSFilterRule::cssText() const
+String CSSFilterRule::cssText() const
{
StringBuilder result;
result.appendLiteral("@-webkit-filter ");
@@ -75,7 +75,7 @@
return result.toString();
}
-void WebKitCSSFilterRule::reattach(StyleRuleBase* rule)
+void CSSFilterRule::reattach(StyleRuleBase* rule)
{
ASSERT(rule);
ASSERT_WITH_SECURITY_IMPLICATION(rule->isFilterRule());
@@ -84,7 +84,7 @@
m_propertiesCSSOMWrapper->reattach(m_filterRule->mutableProperties());
}
-void WebKitCSSFilterRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+void CSSFilterRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
CSSRule::reportMemoryUsage(memoryObjectInfo);
diff --git a/Source/core/css/WebKitCSSFilterRule.h b/Source/core/css/CSSFilterRule.h
similarity index 83%
rename from Source/core/css/WebKitCSSFilterRule.h
rename to Source/core/css/CSSFilterRule.h
index 71a0a87..a26e9fb 100644
--- a/Source/core/css/WebKitCSSFilterRule.h
+++ b/Source/core/css/CSSFilterRule.h
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef WebKitCSSFilterRule_h
-#define WebKitCSSFilterRule_h
+#ifndef CSSFilterRule_h
+#define CSSFilterRule_h
#include "core/css/CSSRule.h"
@@ -38,11 +38,11 @@
class StyleRuleFilter;
class StyleRuleCSSStyleDeclaration;
-class WebKitCSSFilterRule : public CSSRule {
+class CSSFilterRule : public CSSRule {
public:
- static PassRefPtr<WebKitCSSFilterRule> create(StyleRuleFilter* rule, CSSStyleSheet* sheet) { return adoptRef(new WebKitCSSFilterRule(rule, sheet)); }
+ static PassRefPtr<CSSFilterRule> create(StyleRuleFilter* rule, CSSStyleSheet* sheet) { return adoptRef(new CSSFilterRule(rule, sheet)); }
- virtual ~WebKitCSSFilterRule();
+ virtual ~CSSFilterRule();
virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_FILTER_RULE; }
virtual String cssText() const OVERRIDE;
@@ -52,7 +52,7 @@
CSSStyleDeclaration* style() const;
private:
- WebKitCSSFilterRule(StyleRuleFilter*, CSSStyleSheet* parent);
+ CSSFilterRule(StyleRuleFilter*, CSSStyleSheet* parent);
RefPtr<StyleRuleFilter> m_filterRule;
mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
@@ -61,4 +61,4 @@
}
-#endif // WebKitCSSFilterRule_h
+#endif // CSSFilterRule_h
diff --git a/Source/core/css/WebKitCSSFilterRule.idl b/Source/core/css/CSSFilterRule.idl
similarity index 95%
rename from Source/core/css/WebKitCSSFilterRule.idl
rename to Source/core/css/CSSFilterRule.idl
index 12bc237..8c87e90 100644
--- a/Source/core/css/WebKitCSSFilterRule.idl
+++ b/Source/core/css/CSSFilterRule.idl
@@ -27,7 +27,9 @@
* SUCH DAMAGE.
*/
-interface WebKitCSSFilterRule : CSSRule {
+[
+ InterfaceName=WebKitCSSFilterRule
+] interface CSSFilterRule : CSSRule {
readonly attribute CSSStyleDeclaration style;
// FIXME: We should expose the filter name once the CSSOM for the @filter rule is specified.
diff --git a/Source/core/css/WebKitCSSFilterValue.cpp b/Source/core/css/CSSFilterValue.cpp
similarity index 78%
rename from Source/core/css/WebKitCSSFilterValue.cpp
rename to Source/core/css/CSSFilterValue.cpp
index e7ed477..b96e31e 100644
--- a/Source/core/css/WebKitCSSFilterValue.cpp
+++ b/Source/core/css/CSSFilterValue.cpp
@@ -24,27 +24,27 @@
*/
#include "config.h"
-#include "core/css/WebKitCSSFilterValue.h"
+#include "core/css/CSSFilterValue.h"
#include "core/css/CSSValueList.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/WTFString.h>
+#include "wtf/PassRefPtr.h"
+#include "wtf/text/WTFString.h"
namespace WebCore {
-WebKitCSSFilterValue::WebKitCSSFilterValue(FilterOperationType operationType)
- : CSSValueList(WebKitCSSFilterClass, typeUsesSpaceSeparator(operationType) ? SpaceSeparator : CommaSeparator)
+CSSFilterValue::CSSFilterValue(FilterOperationType operationType)
+ : CSSValueList(CSSFilterClass, typeUsesSpaceSeparator(operationType) ? SpaceSeparator : CommaSeparator)
, m_type(operationType)
{
}
-bool WebKitCSSFilterValue::typeUsesSpaceSeparator(FilterOperationType operationType)
+bool CSSFilterValue::typeUsesSpaceSeparator(FilterOperationType operationType)
{
return operationType != CustomFilterOperation;
}
-String WebKitCSSFilterValue::customCssText() const
+String CSSFilterValue::customCssText() const
{
String result;
switch (m_type) {
@@ -91,23 +91,23 @@
return result + CSSValueList::customCssText() + ")";
}
-WebKitCSSFilterValue::WebKitCSSFilterValue(const WebKitCSSFilterValue& cloneFrom)
+CSSFilterValue::CSSFilterValue(const CSSFilterValue& cloneFrom)
: CSSValueList(cloneFrom)
, m_type(cloneFrom.m_type)
{
}
-PassRefPtr<WebKitCSSFilterValue> WebKitCSSFilterValue::cloneForCSSOM() const
+PassRefPtr<CSSFilterValue> CSSFilterValue::cloneForCSSOM() const
{
- return adoptRef(new WebKitCSSFilterValue(*this));
+ return adoptRef(new CSSFilterValue(*this));
}
-bool WebKitCSSFilterValue::equals(const WebKitCSSFilterValue& other) const
+bool CSSFilterValue::equals(const CSSFilterValue& other) const
{
return m_type == other.m_type && CSSValueList::equals(other);
}
-void WebKitCSSFilterValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+void CSSFilterValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
CSSValueList::reportDescendantMemoryUsage(memoryObjectInfo);
diff --git a/Source/core/css/WebKitCSSFilterValue.h b/Source/core/css/CSSFilterValue.h
similarity index 81%
rename from Source/core/css/WebKitCSSFilterValue.h
rename to Source/core/css/CSSFilterValue.h
index be52bdf..22500ed 100644
--- a/Source/core/css/WebKitCSSFilterValue.h
+++ b/Source/core/css/CSSFilterValue.h
@@ -23,16 +23,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebKitCSSFilterValue_h
-#define WebKitCSSFilterValue_h
+#ifndef CSSFilterValue_h
+#define CSSFilterValue_h
#include "core/css/CSSValueList.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
namespace WebCore {
-class WebKitCSSFilterValue : public CSSValueList {
+class CSSFilterValue : public CSSValueList {
public:
// NOTE: these have to match the values in the IDL
enum FilterOperationType {
@@ -53,24 +53,24 @@
static bool typeUsesSpaceSeparator(FilterOperationType);
- static PassRefPtr<WebKitCSSFilterValue> create(FilterOperationType type)
+ static PassRefPtr<CSSFilterValue> create(FilterOperationType type)
{
- return adoptRef(new WebKitCSSFilterValue(type));
+ return adoptRef(new CSSFilterValue(type));
}
String customCssText() const;
FilterOperationType operationType() const { return m_type; }
- PassRefPtr<WebKitCSSFilterValue> cloneForCSSOM() const;
+ PassRefPtr<CSSFilterValue> cloneForCSSOM() const;
- bool equals(const WebKitCSSFilterValue&) const;
+ bool equals(const CSSFilterValue&) const;
void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
private:
- WebKitCSSFilterValue(FilterOperationType);
- WebKitCSSFilterValue(const WebKitCSSFilterValue& cloneFrom);
+ CSSFilterValue(FilterOperationType);
+ CSSFilterValue(const CSSFilterValue& cloneFrom);
FilterOperationType m_type;
};
diff --git a/Source/core/css/WebKitCSSFilterValue.idl b/Source/core/css/CSSFilterValue.idl
similarity index 95%
rename from Source/core/css/WebKitCSSFilterValue.idl
rename to Source/core/css/CSSFilterValue.idl
index 4f5e23c..035b859 100644
--- a/Source/core/css/WebKitCSSFilterValue.idl
+++ b/Source/core/css/CSSFilterValue.idl
@@ -24,8 +24,9 @@
*/
[
- DoNotCheckConstants
-] interface WebKitCSSFilterValue : CSSValueList {
+ DoNotCheckConstants,
+ InterfaceName=WebKitCSSFilterValue
+] interface CSSFilterValue : CSSValueList {
// OperationTypes
diff --git a/Source/core/css/CSSFontSelector.cpp b/Source/core/css/CSSFontSelector.cpp
index eb12e24..443ed66 100644
--- a/Source/core/css/CSSFontSelector.cpp
+++ b/Source/core/css/CSSFontSelector.cpp
@@ -29,7 +29,7 @@
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
-#include "WebKitFontFamilyNames.h"
+#include "FontFamilyNames.h"
#include "core/css/CSSFontFace.h"
#include "core/css/CSSFontFaceRule.h"
#include "core/css/CSSFontFaceSource.h"
@@ -106,7 +106,7 @@
if (!fontStyle->isPrimitiveValue())
return;
- switch (toCSSPrimitiveValue(fontStyle.get())->getIdent()) {
+ switch (toCSSPrimitiveValue(fontStyle.get())->getValueID()) {
case CSSValueNormal:
traitsMask |= FontStyleNormalMask;
break;
@@ -124,7 +124,7 @@
if (!fontWeight->isPrimitiveValue())
return;
- switch (toCSSPrimitiveValue(fontWeight.get())->getIdent()) {
+ switch (toCSSPrimitiveValue(fontWeight.get())->getValueID()) {
case CSSValueBold:
case CSSValue700:
traitsMask |= FontWeight700Mask;
@@ -175,7 +175,7 @@
return;
for (unsigned i = 0; i < numVariants; ++i) {
- switch (toCSSPrimitiveValue(variantList->itemWithoutBoundsCheck(i))->getIdent()) {
+ switch (toCSSPrimitiveValue(variantList->itemWithoutBoundsCheck(i))->getValueID()) {
case CSSValueNormal:
traitsMask |= FontVariantNormalMask;
break;
@@ -255,12 +255,12 @@
for (int i = 0; i < familyLength; i++) {
CSSPrimitiveValue* item = toCSSPrimitiveValue(familyList->itemWithoutBoundsCheck(i));
String familyName;
- if (item->isString())
+ if (item->isString()) {
familyName = item->getStringValue();
- else if (item->isIdent()) {
+ } else if (item->isValueID()) {
// We need to use the raw text for all the generic family types, since @font-face is a way of actually
// defining what font to use for those types.
- switch (item->getIdent()) {
+ switch (item->getValueID()) {
case CSSValueSerif:
familyName = serifFamily;
break;
diff --git a/Source/core/css/CSSGradientValue.cpp b/Source/core/css/CSSGradientValue.cpp
index 90294b9..e1cee47 100644
--- a/Source/core/css/CSSGradientValue.cpp
+++ b/Source/core/css/CSSGradientValue.cpp
@@ -412,7 +412,7 @@
if (value->isCalculatedPercentageWithLength())
return value->cssCalcValue()->toCalcValue(style, rootStyle, style->effectiveZoom())->evaluate(edgeDistance);
- switch (value->getIdent()) {
+ switch (value->getValueID()) {
case CSSValueTop:
ASSERT(!isHorizontal);
return 0;
@@ -425,6 +425,8 @@
case CSSValueRight:
ASSERT(isHorizontal);
return size.width();
+ default:
+ break;
}
return value->computeLength<float>(style, rootStyle, zoomFactor);
@@ -555,7 +557,7 @@
if (m_angle && m_angle->computeDegrees() != 180) {
result.append(m_angle->cssText());
wroteSomething = true;
- } else if ((m_firstX || m_firstY) && !(!m_firstX && m_firstY && m_firstY->getIdent() == CSSValueBottom)) {
+ } else if ((m_firstX || m_firstY) && !(!m_firstX && m_firstY && m_firstY->getValueID() == CSSValueBottom)) {
result.appendLiteral("to ");
if (m_firstX && m_firstY) {
result.append(m_firstX->cssText());
@@ -692,9 +694,9 @@
// "Magic" corners, so the 50% line touches two corners.
float rise = size.width();
float run = size.height();
- if (m_firstX && m_firstX->getIdent() == CSSValueLeft)
+ if (m_firstX && m_firstX->getValueID() == CSSValueLeft)
run *= -1;
- if (m_firstY && m_firstY->getIdent() == CSSValueBottom)
+ if (m_firstY && m_firstY->getValueID() == CSSValueBottom)
rise *= -1;
// Compute angle, and flip it back to "bearing angle" degrees.
float angle = 90 - rad2deg(atan2(rise, run));
@@ -855,12 +857,12 @@
// The only ambiguous case that needs an explicit shape to be provided
// is when a sizing keyword is used (or all sizing is omitted).
- if (m_shape && m_shape->getIdent() != CSSValueEllipse && (m_sizingBehavior || (!m_sizingBehavior && !m_endHorizontalSize))) {
+ if (m_shape && m_shape->getValueID() != CSSValueEllipse && (m_sizingBehavior || (!m_sizingBehavior && !m_endHorizontalSize))) {
result.appendLiteral("circle");
wroteSomething = true;
}
- if (m_sizingBehavior && m_sizingBehavior->getIdent() != CSSValueFarthestCorner) {
+ if (m_sizingBehavior && m_sizingBehavior->getValueID() != CSSValueFarthestCorner) {
if (wroteSomething)
result.append(' ');
result.append(m_sizingBehavior->cssText());
@@ -1040,14 +1042,14 @@
} else {
enum GradientShape { Circle, Ellipse };
GradientShape shape = Ellipse;
- if ((m_shape && m_shape->getIdent() == CSSValueCircle)
+ if ((m_shape && m_shape->getValueID() == CSSValueCircle)
|| (!m_shape && !m_sizingBehavior && m_endHorizontalSize && !m_endVerticalSize))
shape = Circle;
enum GradientFill { ClosestSide, ClosestCorner, FarthestSide, FarthestCorner };
GradientFill fill = FarthestCorner;
- switch (m_sizingBehavior ? m_sizingBehavior->getIdent() : 0) {
+ switch (m_sizingBehavior ? m_sizingBehavior->getValueID() : 0) {
case CSSValueContain:
case CSSValueClosestSide:
fill = ClosestSide;
@@ -1062,6 +1064,8 @@
case CSSValueFarthestCorner:
fill = FarthestCorner;
break;
+ default:
+ break;
}
// Now compute the end radii based on the second point, shape and fill.
diff --git a/Source/core/css/CSSGrammar.y.in b/Source/core/css/CSSGrammar.y.in
index 574a3a8..9bc168f 100644
--- a/Source/core/css/CSSGrammar.y.in
+++ b/Source/core/css/CSSGrammar.y.in
@@ -87,7 +87,7 @@
%}
-%expect 29
+%expect 1
%nonassoc LOWEST_PREC
@@ -212,7 +212,6 @@
%type <relation> combinator
%type <rule> charset
-%type <rule> ignored_charset
%type <rule> ruleset
%type <rule> media
%type <rule> import
@@ -223,7 +222,6 @@
%type <rule> host
%type <rule> keyframes
%type <rule> invalid_rule
-%type <rule> invalid_at
%type <rule> rule
%type <rule> valid_rule
%type <ruleList> block_rule_body
@@ -248,10 +246,11 @@
%type <string> medium
%type <marginBox> margin_sym
-%type <string> media_feature
%type <mediaList> media_list
%type <mediaList> maybe_media_list
+%type <mediaList> mq_list
%type <mediaQuery> media_query
+%type <mediaQuery> valid_media_query
%type <mediaQueryRestrictor> maybe_media_restrictor
%type <valueList> maybe_media_value
%type <mediaQueryExp> media_query_exp
@@ -282,7 +281,6 @@
%type <selectorList> selector_list
%type <selectorList> simple_selector_list
%type <selectorList> region_selector
-%type <selector> selector_with_trailing_whitespace
%type <selector> class
%type <selector> attrib
%type <selector> pseudo
@@ -324,7 +322,7 @@
%%
stylesheet:
- maybe_space maybe_charset maybe_sgml rule_list
+ maybe_charset maybe_sgml rule_list
| internal_decls maybe_space
| internal_rule maybe_space
| internal_selector maybe_space
@@ -365,8 +363,8 @@
;
webkit_mediaquery:
- WEBKIT_MEDIAQUERY_SYM WHITESPACE maybe_space media_query '}' {
- parser->m_mediaQuery = parser->sinkFloatingMediaQuery($4);
+ WEBKIT_MEDIAQUERY_SYM maybe_space valid_media_query '}' {
+ parser->m_mediaQuery = parser->sinkFloatingMediaQuery($3);
}
;
@@ -423,16 +421,6 @@
}
;
-ignored_charset:
- CHARSET_SYM rule_error_recovery ';' {
- // Ignore any @charset rule not at the beginning of the style sheet.
- $$ = 0;
- }
- | CHARSET_SYM rule_error_recovery invalid_block {
- $$ = 0;
- }
-;
-
rule_list:
/* empty */
| rule_list rule maybe_sgml {
@@ -462,9 +450,7 @@
valid_rule {
parser->m_hadSyntacticallyValidCSSRule = true;
}
- | ignored_charset
| invalid_rule
- | invalid_at
;
block_rule_body:
@@ -514,9 +500,7 @@
block_rule:
block_valid_rule
- | ignored_charset
| invalid_rule
- | invalid_at
| namespace
| import
| region
@@ -575,31 +559,22 @@
| URI
;
-media_feature:
- IDENT maybe_space {
- $$ = $1;
- }
- ;
-
maybe_media_value:
/*empty*/ {
$$ = 0;
}
- | ':' maybe_space expr maybe_space {
+ | ':' maybe_space expr {
$$ = $3;
}
;
media_query_exp:
- maybe_media_restrictor maybe_space '(' maybe_space media_feature maybe_space maybe_media_value ')' maybe_space {
- // If restrictor is specified, media query expression is invalid.
- // Create empty media query expression and continue parsing media query.
- if ($1 != MediaQuery::None)
- $$ = parser->createFloatingMediaQueryExp("", 0);
- else {
- parser->tokenToLowerCase($5);
- $$ = parser->createFloatingMediaQueryExp($5, $7);
- }
+ '(' maybe_space IDENT maybe_space maybe_media_value closing_parenthesis maybe_space {
+ parser->tokenToLowerCase($3);
+ $$ = parser->createFloatingMediaQueryExp($3, $5);
+ }
+ | '(' error error_recovery closing_parenthesis {
+ YYERROR;
}
;
@@ -608,9 +583,9 @@
$$ = parser->createFloatingMediaQueryExpList();
$$->append(parser->sinkFloatingMediaQueryExp($1));
}
- | media_query_exp_list maybe_space MEDIA_AND maybe_space media_query_exp {
+ | media_query_exp_list MEDIA_AND maybe_space media_query_exp {
$$ = $1;
- $$->append(parser->sinkFloatingMediaQueryExp($5));
+ $$->append(parser->sinkFloatingMediaQueryExp($4));
}
;
@@ -627,31 +602,37 @@
/*empty*/ {
$$ = MediaQuery::None;
}
- | MEDIA_ONLY {
+ | MEDIA_ONLY maybe_space {
$$ = MediaQuery::Only;
}
- | MEDIA_NOT {
+ | MEDIA_NOT maybe_space {
$$ = MediaQuery::Not;
}
;
-media_query:
+valid_media_query:
media_query_exp_list {
$$ = parser->createFloatingMediaQuery(parser->sinkFloatingMediaQueryExpList($1));
}
- |
- maybe_media_restrictor maybe_space medium maybe_and_media_query_exp_list {
- parser->tokenToLowerCase($3);
- $$ = parser->createFloatingMediaQuery($1, $3, parser->sinkFloatingMediaQueryExpList($4));
+ | maybe_media_restrictor medium maybe_and_media_query_exp_list {
+ parser->tokenToLowerCase($2);
+ $$ = parser->createFloatingMediaQuery($1, $2, parser->sinkFloatingMediaQueryExpList($3));
+ }
+ ;
+
+media_query:
+ valid_media_query
+ | error rule_error_recovery {
+ $$ = parser->createFloatingNotAllQuery();
}
;
maybe_media_list:
- /* empty */ {
+ /* empty */ {
$$ = parser->createMediaQuerySet();
- }
- | media_list
- ;
+ }
+ | media_list
+ ;
media_list:
media_query {
@@ -659,15 +640,26 @@
$$->addMediaQuery(parser->sinkFloatingMediaQuery($1));
parser->updateLastMediaLine($$);
}
- | media_list ',' maybe_space media_query {
+ | mq_list media_query {
$$ = $1;
- if ($$) {
- $$->addMediaQuery(parser->sinkFloatingMediaQuery($4));
- parser->updateLastMediaLine($$);
- }
+ $$->addMediaQuery(parser->sinkFloatingMediaQuery($2));
+ parser->updateLastMediaLine($$);
}
- | media_list error {
- $$ = 0;
+ | mq_list {
+ $$ = $1;
+ $$->addMediaQuery(parser->sinkFloatingMediaQuery(parser->createFloatingNotAllQuery()));
+ parser->updateLastMediaLine($$);
+ }
+ ;
+
+mq_list:
+ media_query ',' maybe_space {
+ $$ = parser->createMediaQuerySet();
+ $$->addMediaQuery(parser->sinkFloatingMediaQuery($1));
+ }
+ | mq_list media_query ',' maybe_space {
+ $$ = $1;
+ $$->addMediaQuery(parser->sinkFloatingMediaQuery($2));
}
;
@@ -696,6 +688,10 @@
| before_media_rule MEDIA_SYM at_rule_header_end_maybe_space '{' at_rule_body_start maybe_space block_rule_body closing_brace {
$$ = parser->createMediaRule(0, $7);
}
+ | before_media_rule MEDIA_SYM maybe_space media_list ';' {
+ $$ = 0;
+ parser->endRuleBody(true);
+ }
| before_media_rule MEDIA_SYM at_rule_recovery {
$$ = 0;
parser->endRuleBody(true);
@@ -770,7 +766,7 @@
$$ = $3;
}
| supports_declaration_condition
- | '(' error error_location error_recovery ')' {
+ | '(' error error_location error_recovery ')' maybe_space {
parser->reportError($3, CSSParser::InvalidSupportsConditionError);
$$ = false;
}
@@ -883,7 +879,7 @@
;
page:
- before_page_rule PAGE_SYM maybe_space page_selector at_rule_header_end_maybe_space
+ before_page_rule PAGE_SYM maybe_space page_selector at_rule_header_end
'{' at_rule_body_start maybe_space_before_declaration declarations_and_margins closing_brace {
if ($4)
$$ = parser->createPageRule(parser->sinkFloatingSelector($4));
@@ -902,18 +898,18 @@
;
page_selector:
- IDENT {
+ IDENT maybe_space {
$$ = parser->createFloatingSelectorWithTagName(QualifiedName(nullAtom, $1, parser->m_defaultNamespace));
$$->setForPage();
}
- | IDENT pseudo_page {
+ | IDENT pseudo_page maybe_space {
$$ = $2;
if ($$) {
$$->prependTagSelector(QualifiedName(nullAtom, $1, parser->m_defaultNamespace));
$$->setForPage();
}
}
- | pseudo_page {
+ | pseudo_page maybe_space {
$$ = $1;
if ($$)
$$->setForPage();
@@ -1089,6 +1085,9 @@
parser->m_inFilterRule = false;
$$ = parser->createFilterRule($4);
}
+ | before_filter_rule WEBKIT_FILTER_RULE_SYM at_rule_recovery {
+ $$ = 0;
+ }
;
combinator:
@@ -1175,23 +1174,12 @@
}
;
-selector_with_trailing_whitespace:
- selector WHITESPACE {
- $$ = $1;
- }
- ;
-
selector:
- simple_selector {
- $$ = $1;
- }
- | selector_with_trailing_whitespace
+ simple_selector
+ | selector WHITESPACE
+ | selector WHITESPACE simple_selector
{
- $$ = $1;
- }
- | selector_with_trailing_whitespace simple_selector
- {
- $$ = $2;
+ $$ = $3;
if (!$1)
$$ = 0;
else if ($$) {
@@ -1435,7 +1423,7 @@
| ':' ':' CUEFUNCTION selector_recovery ')' {
YYERROR;
}
- | ':' ':' DISTRIBUTEDFUNCTION maybe_space relative_selector maybe_space ')' {
+ | ':' ':' DISTRIBUTEDFUNCTION maybe_space relative_selector ')' {
if (!$5)
$$ = 0;
else {
@@ -1666,7 +1654,7 @@
if ($$) {
if ($2) {
CSSParserValue v;
- v.id = 0;
+ v.id = CSSValueInvalid;
v.unit = CSSParserValue::Operator;
v.iValue = $2;
$$->addValue(v);
@@ -1697,21 +1685,21 @@
term:
unary_term maybe_space { $$ = $1; }
| unary_operator unary_term maybe_space { $$ = $2; $$.fValue *= $1; }
- | STRING maybe_space { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_STRING; }
+ | STRING maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_STRING; }
| IDENT maybe_space {
$$.id = cssValueKeywordID($1);
$$.unit = CSSPrimitiveValue::CSS_IDENT;
$$.string = $1;
}
/* We might need to actually parse the number from a dimension, but we can't just put something that uses $$.string into unary_term. */
- | DIMEN maybe_space { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; }
- | unary_operator DIMEN maybe_space { $$.id = 0; $$.string = $2; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; }
- | URI maybe_space { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_URI; }
- | UNICODERANGE maybe_space { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_UNICODE_RANGE; }
- | HEX maybe_space { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; }
- | '#' maybe_space { $$.id = 0; $$.string = CSSParserString(); $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; } /* Handle error case: "color: #;" */
+ | DIMEN maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; }
+ | unary_operator DIMEN maybe_space { $$.id = CSSValueInvalid; $$.string = $2; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; }
+ | URI maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_URI; }
+ | UNICODERANGE maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_UNICODE_RANGE; }
+ | HEX maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; }
+ | '#' maybe_space { $$.id = CSSValueInvalid; $$.string = CSSParserString(); $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; } /* Handle error case: "color: #;" */
| VARFUNCTION maybe_space IDENT closing_parenthesis maybe_space {
- $$.id = 0;
+ $$.id = CSSValueInvalid;
$$.string = $3;
$$.unit = CSSPrimitiveValue::CSS_VARIABLE_NAME;
}
@@ -1726,7 +1714,7 @@
$$ = $1;
}
| '%' maybe_space { /* Handle width: %; */
- $$.id = 0; $$.unit = 0;
+ $$.id = CSSValueInvalid; $$.unit = 0;
}
;
@@ -1773,7 +1761,7 @@
CSSParserFunction* f = parser->createFloatingFunction();
f->name = $1;
f->args = parser->sinkFloatingValueList($3);
- $$.id = 0;
+ $$.id = CSSValueInvalid;
$$.unit = CSSParserValue::Function;
$$.function = f;
} else
@@ -1784,7 +1772,7 @@
f->name = $1;
CSSParserValueList* valueList = parser->createFloatingValueList();
f->args = parser->sinkFloatingValueList(valueList);
- $$.id = 0;
+ $$.id = CSSValueInvalid;
$$.unit = CSSParserValue::Function;
$$.function = f;
} |
@@ -1796,7 +1784,7 @@
calc_func_term:
unary_term { $$ = $1; }
| VARFUNCTION maybe_space IDENT closing_parenthesis {
- $$.id = 0;
+ $$.id = CSSValueInvalid;
$$.string = $3;
$$.unit = CSSPrimitiveValue::CSS_VARIABLE_NAME;
}
@@ -1828,7 +1816,7 @@
if ($3) {
$$ = $3;
CSSParserValue v;
- v.id = 0;
+ v.id = CSSValueInvalid;
v.unit = CSSParserValue::Operator;
v.iValue = '(';
$$->insertValueAt(0, v);
@@ -1856,7 +1844,7 @@
if ($1 && $2) {
$$ = $1;
CSSParserValue v;
- v.id = 0;
+ v.id = CSSValueInvalid;
v.unit = CSSParserValue::Operator;
v.iValue = $2;
$$->addValue(v);
@@ -1869,7 +1857,7 @@
if ($1 && $2 && $3) {
$$ = $1;
CSSParserValue v;
- v.id = 0;
+ v.id = CSSValueInvalid;
v.unit = CSSParserValue::Operator;
v.iValue = $2;
$$->addValue(v);
@@ -1888,7 +1876,7 @@
if ($1 && $4) {
$$ = $1;
CSSParserValue v;
- v.id = 0;
+ v.id = CSSValueInvalid;
v.unit = CSSParserValue::Operator;
v.iValue = ',';
$$->addValue(v);
@@ -1903,7 +1891,7 @@
CSSParserFunction* f = parser->createFloatingFunction();
f->name = $1;
f->args = parser->sinkFloatingValueList($3);
- $$.id = 0;
+ $$.id = CSSValueInvalid;
$$.unit = CSSParserValue::Function;
$$.function = f;
}
@@ -1927,7 +1915,7 @@
CSSParserFunction* f = parser->createFloatingFunction();
f->name = $1;
f->args = parser->sinkFloatingValueList($3);
- $$.id = 0;
+ $$.id = CSSValueInvalid;
$$.unit = CSSParserValue::Function;
$$.function = f;
}
@@ -1937,12 +1925,9 @@
;
invalid_at:
- ATKEYWORD at_rule_recovery {
- $$ = 0;
- }
- | margin_sym at_rule_recovery {
- $$ = 0;
- }
+ ATKEYWORD at_rule_recovery
+ | margin_sym at_rule_recovery
+ | error CHARSET_SYM at_rule_recovery
;
at_rule_recovery:
@@ -1957,6 +1942,9 @@
error rule_error_recovery at_invalid_rule_header_end invalid_block {
$$ = 0;
}
+ | invalid_at {
+ $$ = 0;
+ }
;
at_invalid_rule_header_end:
diff --git a/Source/core/css/CSSGrammar.y.includes b/Source/core/css/CSSGrammar.y.includes
index b8eabfd..60162a5 100644
--- a/Source/core/css/CSSGrammar.y.includes
+++ b/Source/core/css/CSSGrammar.y.includes
@@ -26,6 +26,8 @@
#include "CSSPropertyNames.h"
#include "HTMLNames.h"
+#include "core/css/CSSKeyframeRule.h"
+#include "core/css/CSSKeyframesRule.h"
#include "core/css/CSSParser.h"
#include "core/css/CSSParserMode.h"
#include "core/css/CSSPrimitiveValue.h"
@@ -35,8 +37,6 @@
#include "core/css/MediaQueryExp.h"
#include "core/css/StyleRule.h"
#include "core/css/StyleSheetContents.h"
-#include "core/css/WebKitCSSKeyframeRule.h"
-#include "core/css/WebKitCSSKeyframesRule.h"
#include "core/dom/Document.h"
#include <wtf/FastMalloc.h>
#include <stdlib.h>
diff --git a/Source/core/css/WebKitCSSKeyframeRule.cpp b/Source/core/css/CSSKeyframeRule.cpp
similarity index 85%
rename from Source/core/css/WebKitCSSKeyframeRule.cpp
rename to Source/core/css/CSSKeyframeRule.cpp
index 289caf6..12f8ec3 100644
--- a/Source/core/css/WebKitCSSKeyframeRule.cpp
+++ b/Source/core/css/CSSKeyframeRule.cpp
@@ -24,12 +24,12 @@
*/
#include "config.h"
-#include "core/css/WebKitCSSKeyframeRule.h"
+#include "core/css/CSSKeyframeRule.h"
+#include "core/css/CSSKeyframesRule.h"
#include "core/css/PropertySetCSSStyleDeclaration.h"
#include "core/css/StylePropertySet.h"
-#include "core/css/WebKitCSSKeyframesRule.h"
-#include <wtf/text/StringBuilder.h>
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
@@ -47,7 +47,7 @@
m_properties = m_properties->mutableCopy();
return static_cast<MutableStylePropertySet*>(m_properties.get());
}
-
+
void StyleKeyframe::setProperties(PassRefPtr<StylePropertySet> properties)
{
m_properties = properties;
@@ -63,7 +63,7 @@
for (size_t i = 0; i < strings.size(); ++i) {
float key = -1;
String cur = strings[i].stripWhiteSpace();
-
+
// For now the syntax MUST be 'xxx%' or 'from' or 'to', where xxx is a legal floating point number
if (cur == "from")
key = 0;
@@ -72,14 +72,13 @@
else if (cur.endsWith('%')) {
float k = cur.substring(0, cur.length() - 1).toFloat();
if (k >= 0 && k <= 100)
- key = k/100;
+ key = k / 100;
}
if (key < 0) {
keys.clear();
return;
}
- else
- keys.append(key);
+ keys.append(key);
}
}
@@ -103,27 +102,27 @@
info.addMember(m_key, "key");
}
-WebKitCSSKeyframeRule::WebKitCSSKeyframeRule(StyleKeyframe* keyframe, WebKitCSSKeyframesRule* parent)
+CSSKeyframeRule::CSSKeyframeRule(StyleKeyframe* keyframe, CSSKeyframesRule* parent)
: CSSRule(0)
, m_keyframe(keyframe)
{
setParentRule(parent);
}
-WebKitCSSKeyframeRule::~WebKitCSSKeyframeRule()
+CSSKeyframeRule::~CSSKeyframeRule()
{
if (m_propertiesCSSOMWrapper)
m_propertiesCSSOMWrapper->clearParentRule();
}
-CSSStyleDeclaration* WebKitCSSKeyframeRule::style() const
+CSSStyleDeclaration* CSSKeyframeRule::style() const
{
if (!m_propertiesCSSOMWrapper)
- m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_keyframe->mutableProperties(), const_cast<WebKitCSSKeyframeRule*>(this));
+ m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_keyframe->mutableProperties(), const_cast<CSSKeyframeRule*>(this));
return m_propertiesCSSOMWrapper.get();
}
-void WebKitCSSKeyframeRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+void CSSKeyframeRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
CSSRule::reportMemoryUsage(memoryObjectInfo);
@@ -131,7 +130,7 @@
info.addMember(m_propertiesCSSOMWrapper, "propertiesCSSOMWrapper");
}
-void WebKitCSSKeyframeRule::reattach(StyleRuleBase*)
+void CSSKeyframeRule::reattach(StyleRuleBase*)
{
// No need to reattach, the underlying data is shareable on mutation.
ASSERT_NOT_REACHED();
diff --git a/Source/core/css/WebKitCSSKeyframeRule.h b/Source/core/css/CSSKeyframeRule.h
similarity index 89%
rename from Source/core/css/WebKitCSSKeyframeRule.h
rename to Source/core/css/CSSKeyframeRule.h
index e34821e..365ef74 100644
--- a/Source/core/css/WebKitCSSKeyframeRule.h
+++ b/Source/core/css/CSSKeyframeRule.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebKitCSSKeyframeRule_h
-#define WebKitCSSKeyframeRule_h
+#ifndef CSSKeyframeRule_h
+#define CSSKeyframeRule_h
#include "core/css/CSSRule.h"
@@ -34,7 +34,7 @@
class MutableStylePropertySet;
class StylePropertySet;
class StyleRuleCSSStyleDeclaration;
-class WebKitCSSKeyframesRule;
+class CSSKeyframesRule;
class StyleKeyframe : public RefCounted<StyleKeyframe> {
WTF_MAKE_FAST_ALLOCATED;
@@ -49,29 +49,29 @@
void setKeyText(const String& s) { m_key = s; }
void getKeys(Vector<float>& keys) const { parseKeyString(m_key, keys); }
-
+
const StylePropertySet* properties() const { return m_properties.get(); }
MutableStylePropertySet* mutableProperties();
void setProperties(PassRefPtr<StylePropertySet>);
-
+
String cssText() const;
void reportMemoryUsage(MemoryObjectInfo*) const;
private:
StyleKeyframe();
-
+
static void parseKeyString(const String&, Vector<float>& keys);
-
+
RefPtr<StylePropertySet> m_properties;
// FIXME: This should be a parsed vector of floats.
// comma separated list of keys
String m_key;
};
-class WebKitCSSKeyframeRule : public CSSRule {
+class CSSKeyframeRule : public CSSRule {
public:
- virtual ~WebKitCSSKeyframeRule();
+ virtual ~CSSKeyframeRule();
virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_KEYFRAME_RULE; }
virtual String cssText() const OVERRIDE { return m_keyframe->cssText(); }
@@ -84,14 +84,14 @@
CSSStyleDeclaration* style() const;
private:
- WebKitCSSKeyframeRule(StyleKeyframe*, WebKitCSSKeyframesRule* parent);
+ CSSKeyframeRule(StyleKeyframe*, CSSKeyframesRule* parent);
RefPtr<StyleKeyframe> m_keyframe;
mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
-
- friend class WebKitCSSKeyframesRule;
+
+ friend class CSSKeyframesRule;
};
} // namespace WebCore
-#endif // WebKitCSSKeyframeRule_h
+#endif // CSSKeyframeRule_h
diff --git a/Source/core/css/WebKitCSSKeyframeRule.idl b/Source/core/css/CSSKeyframeRule.idl
similarity index 95%
rename from Source/core/css/WebKitCSSKeyframeRule.idl
rename to Source/core/css/CSSKeyframeRule.idl
index ea5bb13..2c51a47 100644
--- a/Source/core/css/WebKitCSSKeyframeRule.idl
+++ b/Source/core/css/CSSKeyframeRule.idl
@@ -27,7 +27,10 @@
*/
// Introduced in DOM Level ?:
-interface WebKitCSSKeyframeRule : CSSRule {
+[
+ InterfaceName=WebKitCSSKeyframeRule
+]
+interface CSSKeyframeRule : CSSRule {
attribute DOMString keyText;
readonly attribute CSSStyleDeclaration style;
diff --git a/Source/core/css/WebKitCSSKeyframesRule.cpp b/Source/core/css/CSSKeyframesRule.cpp
similarity index 80%
rename from Source/core/css/WebKitCSSKeyframesRule.cpp
rename to Source/core/css/CSSKeyframesRule.cpp
index 36d8002..a7cd8cc 100644
--- a/Source/core/css/WebKitCSSKeyframesRule.cpp
+++ b/Source/core/css/CSSKeyframesRule.cpp
@@ -24,14 +24,14 @@
*/
#include "config.h"
-#include "core/css/WebKitCSSKeyframesRule.h"
+#include "core/css/CSSKeyframesRule.h"
+#include "core/css/CSSKeyframeRule.h"
#include "core/css/CSSParser.h"
#include "core/css/CSSRuleList.h"
#include "core/css/CSSStyleSheet.h"
-#include "core/css/WebKitCSSKeyframeRule.h"
-#include <wtf/MemoryInstrumentationVector.h>
-#include <wtf/text/StringBuilder.h>
+#include "wtf/MemoryInstrumentationVector.h"
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
@@ -77,7 +77,7 @@
percentageString = "100%";
else
percentageString = key;
-
+
for (unsigned i = 0; i < m_keyframes.size(); ++i) {
if (m_keyframes[i]->keyText() == percentageString)
return i;
@@ -92,14 +92,14 @@
info.addMember(m_name, "name");
}
-WebKitCSSKeyframesRule::WebKitCSSKeyframesRule(StyleRuleKeyframes* keyframesRule, CSSStyleSheet* parent)
+CSSKeyframesRule::CSSKeyframesRule(StyleRuleKeyframes* keyframesRule, CSSStyleSheet* parent)
: CSSRule(parent)
, m_keyframesRule(keyframesRule)
, m_childRuleCSSOMWrappers(keyframesRule->keyframes().size())
{
}
-WebKitCSSKeyframesRule::~WebKitCSSKeyframesRule()
+CSSKeyframesRule::~CSSKeyframesRule()
{
ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size());
@@ -109,14 +109,14 @@
}
}
-void WebKitCSSKeyframesRule::setName(const String& name)
+void CSSKeyframesRule::setName(const String& name)
{
CSSStyleSheet::RuleMutationScope mutationScope(this);
m_keyframesRule->setName(name);
}
-void WebKitCSSKeyframesRule::insertRule(const String& ruleText)
+void CSSKeyframesRule::insertRule(const String& ruleText)
{
ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size());
@@ -133,7 +133,7 @@
m_childRuleCSSOMWrappers.grow(length());
}
-void WebKitCSSKeyframesRule::deleteRule(const String& s)
+void CSSKeyframesRule::deleteRule(const String& s)
{
ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size());
@@ -150,13 +150,13 @@
m_childRuleCSSOMWrappers.remove(i);
}
-WebKitCSSKeyframeRule* WebKitCSSKeyframesRule::findRule(const String& s)
+CSSKeyframeRule* CSSKeyframesRule::findRule(const String& s)
{
int i = m_keyframesRule->findKeyframeIndex(s);
return (i >= 0) ? item(i) : 0;
}
-String WebKitCSSKeyframesRule::cssText() const
+String CSSKeyframesRule::cssText() const
{
StringBuilder result;
result.append("@-webkit-keyframes ");
@@ -173,39 +173,39 @@
return result.toString();
}
-unsigned WebKitCSSKeyframesRule::length() const
-{
- return m_keyframesRule->keyframes().size();
+unsigned CSSKeyframesRule::length() const
+{
+ return m_keyframesRule->keyframes().size();
}
-WebKitCSSKeyframeRule* WebKitCSSKeyframesRule::item(unsigned index) const
-{
+CSSKeyframeRule* CSSKeyframesRule::item(unsigned index) const
+{
if (index >= length())
return 0;
ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size());
- RefPtr<WebKitCSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index];
+ RefPtr<CSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index];
if (!rule)
- rule = adoptRef(new WebKitCSSKeyframeRule(m_keyframesRule->keyframes()[index].get(), const_cast<WebKitCSSKeyframesRule*>(this)));
+ rule = adoptRef(new CSSKeyframeRule(m_keyframesRule->keyframes()[index].get(), const_cast<CSSKeyframesRule*>(this)));
- return rule.get();
+ return rule.get();
}
-CSSRuleList* WebKitCSSKeyframesRule::cssRules()
+CSSRuleList* CSSKeyframesRule::cssRules()
{
if (!m_ruleListCSSOMWrapper)
- m_ruleListCSSOMWrapper = adoptPtr(new LiveCSSRuleList<WebKitCSSKeyframesRule>(this));
+ m_ruleListCSSOMWrapper = adoptPtr(new LiveCSSRuleList<CSSKeyframesRule>(this));
return m_ruleListCSSOMWrapper.get();
}
-void WebKitCSSKeyframesRule::reattach(StyleRuleBase* rule)
+void CSSKeyframesRule::reattach(StyleRuleBase* rule)
{
ASSERT(rule);
ASSERT_WITH_SECURITY_IMPLICATION(rule->isKeyframesRule());
m_keyframesRule = static_cast<StyleRuleKeyframes*>(rule);
}
-void WebKitCSSKeyframesRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+void CSSKeyframesRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
CSSRule::reportMemoryUsage(memoryObjectInfo);
diff --git a/Source/core/css/WebKitCSSKeyframesRule.h b/Source/core/css/CSSKeyframesRule.h
similarity index 79%
rename from Source/core/css/WebKitCSSKeyframesRule.h
rename to Source/core/css/CSSKeyframesRule.h
index 241703f..90ce7b3 100644
--- a/Source/core/css/WebKitCSSKeyframesRule.h
+++ b/Source/core/css/CSSKeyframesRule.h
@@ -23,35 +23,35 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebKitCSSKeyframesRule_h
-#define WebKitCSSKeyframesRule_h
+#ifndef CSSKeyframesRule_h
+#define CSSKeyframesRule_h
#include "core/css/CSSRule.h"
#include "core/css/StyleRule.h"
-#include <wtf/Forward.h>
-#include <wtf/text/AtomicString.h>
+#include "wtf/Forward.h"
+#include "wtf/text/AtomicString.h"
namespace WebCore {
class CSSRuleList;
class StyleKeyframe;
-class WebKitCSSKeyframeRule;
+class CSSKeyframeRule;
class StyleRuleKeyframes : public StyleRuleBase {
public:
static PassRefPtr<StyleRuleKeyframes> create() { return adoptRef(new StyleRuleKeyframes()); }
-
+
~StyleRuleKeyframes();
-
+
const Vector<RefPtr<StyleKeyframe> >& keyframes() const { return m_keyframes; }
-
+
void parserAppendKeyframe(PassRefPtr<StyleKeyframe>);
void wrapperAppendKeyframe(PassRefPtr<StyleKeyframe>);
void wrapperRemoveKeyframe(unsigned);
- String name() const { return m_name; }
+ String name() const { return m_name; }
void setName(const String& name) { m_name = AtomicString(name); }
-
+
int findKeyframeIndex(const String& key) const;
PassRefPtr<StyleRuleKeyframes> copy() const { return adoptRef(new StyleRuleKeyframes(*this)); }
@@ -66,11 +66,11 @@
AtomicString m_name;
};
-class WebKitCSSKeyframesRule : public CSSRule {
+class CSSKeyframesRule : public CSSRule {
public:
- static PassRefPtr<WebKitCSSKeyframesRule> create(StyleRuleKeyframes* rule, CSSStyleSheet* sheet) { return adoptRef(new WebKitCSSKeyframesRule(rule, sheet)); }
+ static PassRefPtr<CSSKeyframesRule> create(StyleRuleKeyframes* rule, CSSStyleSheet* sheet) { return adoptRef(new CSSKeyframesRule(rule, sheet)); }
- virtual ~WebKitCSSKeyframesRule();
+ virtual ~CSSKeyframesRule();
virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_KEYFRAMES_RULE; }
virtual String cssText() const OVERRIDE;
@@ -84,20 +84,20 @@
void insertRule(const String& rule);
void deleteRule(const String& key);
- WebKitCSSKeyframeRule* findRule(const String& key);
+ CSSKeyframeRule* findRule(const String& key);
// For IndexedGetter and CSSRuleList.
unsigned length() const;
- WebKitCSSKeyframeRule* item(unsigned index) const;
+ CSSKeyframeRule* item(unsigned index) const;
private:
- WebKitCSSKeyframesRule(StyleRuleKeyframes*, CSSStyleSheet* parent);
+ CSSKeyframesRule(StyleRuleKeyframes*, CSSStyleSheet* parent);
RefPtr<StyleRuleKeyframes> m_keyframesRule;
- mutable Vector<RefPtr<WebKitCSSKeyframeRule> > m_childRuleCSSOMWrappers;
+ mutable Vector<RefPtr<CSSKeyframeRule> > m_childRuleCSSOMWrappers;
mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper;
};
} // namespace WebCore
-#endif // WebKitCSSKeyframesRule_h
+#endif // CSSKeyframesRule_h
diff --git a/Source/core/css/WebKitCSSKeyframesRule.idl b/Source/core/css/CSSKeyframesRule.idl
similarity index 88%
rename from Source/core/css/WebKitCSSKeyframesRule.idl
rename to Source/core/css/CSSKeyframesRule.idl
index 895d34e..873e756 100644
--- a/Source/core/css/WebKitCSSKeyframesRule.idl
+++ b/Source/core/css/CSSKeyframesRule.idl
@@ -28,14 +28,15 @@
// Introduced in DOM Level ?:
[
-] interface WebKitCSSKeyframesRule : CSSRule {
+ InterfaceName=WebKitCSSKeyframesRule
+] interface CSSKeyframesRule : CSSRule {
[TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString name;
readonly attribute CSSRuleList cssRules;
- [ImplementedAs=item] getter WebKitCSSKeyframeRule(unsigned long index);
+ [ImplementedAs=item, NotEnumerable] getter CSSKeyframeRule(unsigned long index);
void insertRule([Default=Undefined] optional DOMString rule);
void deleteRule([Default=Undefined] optional DOMString key);
- WebKitCSSKeyframeRule findRule([Default=Undefined] optional DOMString key);
+ CSSKeyframeRule findRule([Default=Undefined] optional DOMString key);
};
diff --git a/Source/core/css/WebKitCSSMatrix.cpp b/Source/core/css/CSSMatrix.cpp
similarity index 64%
rename from Source/core/css/WebKitCSSMatrix.cpp
rename to Source/core/css/CSSMatrix.cpp
index 9efebb5..8efcc2a 100644
--- a/Source/core/css/WebKitCSSMatrix.cpp
+++ b/Source/core/css/CSSMatrix.cpp
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#include "core/css/WebKitCSSMatrix.h"
+#include "core/css/CSSMatrix.h"
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
@@ -32,27 +32,27 @@
#include "core/css/StylePropertySet.h"
#include "core/css/resolver/TransformBuilder.h"
#include "core/dom/ExceptionCode.h"
-#include <wtf/MathExtras.h>
+#include "wtf/MathExtras.h"
namespace WebCore {
-WebKitCSSMatrix::WebKitCSSMatrix(const TransformationMatrix& m)
+CSSMatrix::CSSMatrix(const TransformationMatrix& m)
: m_matrix(m)
{
ScriptWrappable::init(this);
}
-WebKitCSSMatrix::WebKitCSSMatrix(const String& s, ExceptionCode& ec)
+CSSMatrix::CSSMatrix(const String& s, ExceptionCode& ec)
{
ScriptWrappable::init(this);
setMatrixValue(s, ec);
}
-WebKitCSSMatrix::~WebKitCSSMatrix()
+CSSMatrix::~CSSMatrix()
{
}
-void WebKitCSSMatrix::setMatrixValue(const String& string, ExceptionCode& ec)
+void CSSMatrix::setMatrixValue(const String& string, ExceptionCode& ec)
{
if (string.isEmpty())
return;
@@ -64,7 +64,7 @@
RefPtr<CSSValue> value = styleDeclaration->getPropertyCSSValue(CSSPropertyWebkitTransform);
// Check for a "none" or empty transform. In these cases we can use the default identity matrix.
- if (!value || (value->isPrimitiveValue() && (toCSSPrimitiveValue(value.get()))->getIdent() == CSSValueNone))
+ if (!value || (value->isPrimitiveValue() && (toCSSPrimitiveValue(value.get()))->getValueID() == CSSValueNone))
return;
TransformOperations operations;
@@ -90,25 +90,25 @@
}
// Perform a concatenation of the matrices (this * secondMatrix)
-PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::multiply(WebKitCSSMatrix* secondMatrix) const
+PassRefPtr<CSSMatrix> CSSMatrix::multiply(CSSMatrix* secondMatrix) const
{
if (!secondMatrix)
return 0;
- return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).multiply(secondMatrix->m_matrix));
+ return CSSMatrix::create(TransformationMatrix(m_matrix).multiply(secondMatrix->m_matrix));
}
-PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::inverse(ExceptionCode& ec) const
+PassRefPtr<CSSMatrix> CSSMatrix::inverse(ExceptionCode& ec) const
{
if (!m_matrix.isInvertible()) {
ec = NOT_SUPPORTED_ERR;
return 0;
}
- return WebKitCSSMatrix::create(m_matrix.inverse());
+ return CSSMatrix::create(m_matrix.inverse());
}
-PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::translate(double x, double y, double z) const
+PassRefPtr<CSSMatrix> CSSMatrix::translate(double x, double y, double z) const
{
if (std::isnan(x))
x = 0;
@@ -116,10 +116,10 @@
y = 0;
if (std::isnan(z))
z = 0;
- return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).translate3d(x, y, z));
+ return CSSMatrix::create(TransformationMatrix(m_matrix).translate3d(x, y, z));
}
-PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::scale(double scaleX, double scaleY, double scaleZ) const
+PassRefPtr<CSSMatrix> CSSMatrix::scale(double scaleX, double scaleY, double scaleZ) const
{
if (std::isnan(scaleX))
scaleX = 1;
@@ -127,10 +127,10 @@
scaleY = scaleX;
if (std::isnan(scaleZ))
scaleZ = 1;
- return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).scale3d(scaleX, scaleY, scaleZ));
+ return CSSMatrix::create(TransformationMatrix(m_matrix).scale3d(scaleX, scaleY, scaleZ));
}
-PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::rotate(double rotX, double rotY, double rotZ) const
+PassRefPtr<CSSMatrix> CSSMatrix::rotate(double rotX, double rotY, double rotZ) const
{
if (std::isnan(rotX))
rotX = 0;
@@ -145,10 +145,10 @@
rotY = 0;
if (std::isnan(rotZ))
rotZ = 0;
- return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).rotate3d(rotX, rotY, rotZ));
+ return CSSMatrix::create(TransformationMatrix(m_matrix).rotate3d(rotX, rotY, rotZ));
}
-PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::rotateAxisAngle(double x, double y, double z, double angle) const
+PassRefPtr<CSSMatrix> CSSMatrix::rotateAxisAngle(double x, double y, double z, double angle) const
{
if (std::isnan(x))
x = 0;
@@ -158,36 +158,35 @@
z = 0;
if (std::isnan(angle))
angle = 0;
- if (x == 0 && y == 0 && z == 0)
+ if (!x && !y && !z)
z = 1;
- return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).rotate3d(x, y, z, angle));
+ return CSSMatrix::create(TransformationMatrix(m_matrix).rotate3d(x, y, z, angle));
}
-PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::skewX(double angle) const
+PassRefPtr<CSSMatrix> CSSMatrix::skewX(double angle) const
{
if (std::isnan(angle))
angle = 0;
- return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).skewX(angle));
+ return CSSMatrix::create(TransformationMatrix(m_matrix).skewX(angle));
}
-PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::skewY(double angle) const
+PassRefPtr<CSSMatrix> CSSMatrix::skewY(double angle) const
{
if (std::isnan(angle))
angle = 0;
- return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).skewY(angle));
+ return CSSMatrix::create(TransformationMatrix(m_matrix).skewY(angle));
}
-String WebKitCSSMatrix::toString() const
+String CSSMatrix::toString() const
{
// FIXME - Need to ensure valid CSS floating point values (https://bugs.webkit.org/show_bug.cgi?id=20674)
if (m_matrix.isAffine())
- return String::format("matrix(%f, %f, %f, %f, %f, %f)",
- m_matrix.a(), m_matrix.b(), m_matrix.c(), m_matrix.d(), m_matrix.e(), m_matrix.f());
+ return String::format("matrix(%f, %f, %f, %f, %f, %f)", m_matrix.a(), m_matrix.b(), m_matrix.c(), m_matrix.d(), m_matrix.e(), m_matrix.f());
return String::format("matrix3d(%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f)",
- m_matrix.m11(), m_matrix.m12(), m_matrix.m13(), m_matrix.m14(),
- m_matrix.m21(), m_matrix.m22(), m_matrix.m23(), m_matrix.m24(),
- m_matrix.m31(), m_matrix.m32(), m_matrix.m33(), m_matrix.m34(),
- m_matrix.m41(), m_matrix.m42(), m_matrix.m43(), m_matrix.m44());
+ m_matrix.m11(), m_matrix.m12(), m_matrix.m13(), m_matrix.m14(),
+ m_matrix.m21(), m_matrix.m22(), m_matrix.m23(), m_matrix.m24(),
+ m_matrix.m31(), m_matrix.m32(), m_matrix.m33(), m_matrix.m34(),
+ m_matrix.m41(), m_matrix.m42(), m_matrix.m43(), m_matrix.m44());
}
} // namespace WebCore
diff --git a/Source/core/css/WebKitCSSMatrix.h b/Source/core/css/CSSMatrix.h
similarity index 83%
rename from Source/core/css/WebKitCSSMatrix.h
rename to Source/core/css/CSSMatrix.h
index cd55888..a353304 100644
--- a/Source/core/css/WebKitCSSMatrix.h
+++ b/Source/core/css/CSSMatrix.h
@@ -23,31 +23,31 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebKitCSSMatrix_h
-#define WebKitCSSMatrix_h
+#ifndef CSSMatrix_h
+#define CSSMatrix_h
#include "bindings/v8/ScriptWrappable.h"
#include "core/platform/graphics/transforms/TransformationMatrix.h"
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+#include "wtf/text/WTFString.h"
namespace WebCore {
typedef int ExceptionCode;
-class WebKitCSSMatrix : public ScriptWrappable, public RefCounted<WebKitCSSMatrix> {
+class CSSMatrix : public ScriptWrappable, public RefCounted<CSSMatrix> {
public:
- static PassRefPtr<WebKitCSSMatrix> create(const TransformationMatrix& m)
+ static PassRefPtr<CSSMatrix> create(const TransformationMatrix& m)
{
- return adoptRef(new WebKitCSSMatrix(m));
+ return adoptRef(new CSSMatrix(m));
}
- static PassRefPtr<WebKitCSSMatrix> create(const String& s, ExceptionCode& ec)
+ static PassRefPtr<CSSMatrix> create(const String& s, ExceptionCode& ec)
{
- return adoptRef(new WebKitCSSMatrix(s, ec));
+ return adoptRef(new CSSMatrix(s, ec));
}
- virtual ~WebKitCSSMatrix();
+ virtual ~CSSMatrix();
double a() const { return m_matrix.a(); }
double b() const { return m_matrix.b(); }
@@ -103,60 +103,60 @@
// specified operation applied. The this value is not modified.
// Multiply this matrix by secondMatrix, on the right (result = this * secondMatrix)
- PassRefPtr<WebKitCSSMatrix> multiply(WebKitCSSMatrix* secondMatrix) const;
+ PassRefPtr<CSSMatrix> multiply(CSSMatrix* secondMatrix) const;
// Return the inverse of this matrix. Throw an exception if the matrix is not invertible
- PassRefPtr<WebKitCSSMatrix> inverse(ExceptionCode&) const;
+ PassRefPtr<CSSMatrix> inverse(ExceptionCode&) const;
// Return this matrix translated by the passed values.
// Passing a NaN will use a value of 0. This allows the 3D form to used for 2D operations
// Operation is performed as though the this matrix is multiplied by a matrix with
// the translation values on the left (result = translation(x,y,z) * this)
- PassRefPtr<WebKitCSSMatrix> translate(double x, double y, double z) const;
+ PassRefPtr<CSSMatrix> translate(double x, double y, double z) const;
// Returns this matrix scaled by the passed values.
// Passing scaleX or scaleZ as NaN uses a value of 1, but passing scaleY of NaN
// makes it the same as scaleX. This allows the 3D form to used for 2D operations
// Operation is performed as though the this matrix is multiplied by a matrix with
// the scale values on the left (result = scale(x,y,z) * this)
- PassRefPtr<WebKitCSSMatrix> scale(double scaleX, double scaleY, double scaleZ) const;
+ PassRefPtr<CSSMatrix> scale(double scaleX, double scaleY, double scaleZ) const;
// Returns this matrix rotated by the passed values.
// If rotY and rotZ are NaN, rotate about Z (rotX=0, rotateY=0, rotateZ=rotX).
// Otherwise use a rotation value of 0 for any passed NaN.
// Operation is performed as though the this matrix is multiplied by a matrix with
// the rotation values on the left (result = rotation(x,y,z) * this)
- PassRefPtr<WebKitCSSMatrix> rotate(double rotX, double rotY, double rotZ) const;
+ PassRefPtr<CSSMatrix> rotate(double rotX, double rotY, double rotZ) const;
// Returns this matrix rotated about the passed axis by the passed angle.
// Passing a NaN will use a value of 0. If the axis is (0,0,0) use a value
// Operation is performed as though the this matrix is multiplied by a matrix with
// the rotation values on the left (result = rotation(x,y,z,angle) * this)
- PassRefPtr<WebKitCSSMatrix> rotateAxisAngle(double x, double y, double z, double angle) const;
+ PassRefPtr<CSSMatrix> rotateAxisAngle(double x, double y, double z, double angle) const;
// Return this matrix skewed along the X axis by the passed values.
// Passing a NaN will use a value of 0.
// Operation is performed as though the this matrix is multiplied by a matrix with
// the skew values on the left (result = skewX(angle) * this)
- PassRefPtr<WebKitCSSMatrix> skewX(double angle) const;
+ PassRefPtr<CSSMatrix> skewX(double angle) const;
// Return this matrix skewed along the Y axis by the passed values.
// Passing a NaN will use a value of 0.
// Operation is performed as though the this matrix is multiplied by a matrix with
// the skew values on the left (result = skewY(angle) * this)
- PassRefPtr<WebKitCSSMatrix> skewY(double angle) const;
+ PassRefPtr<CSSMatrix> skewY(double angle) const;
const TransformationMatrix& transform() const { return m_matrix; }
String toString() const;
protected:
- WebKitCSSMatrix(const TransformationMatrix&);
- WebKitCSSMatrix(const String&, ExceptionCode&);
+ CSSMatrix(const TransformationMatrix&);
+ CSSMatrix(const String&, ExceptionCode&);
TransformationMatrix m_matrix;
};
} // namespace WebCore
-#endif // WebKitCSSMatrix_h
+#endif // CSSMatrix_h
diff --git a/Source/core/css/WebKitCSSMatrix.idl b/Source/core/css/CSSMatrix.idl
similarity index 86%
rename from Source/core/css/WebKitCSSMatrix.idl
rename to Source/core/css/CSSMatrix.idl
index 697acdd..8f2e2bb 100644
--- a/Source/core/css/WebKitCSSMatrix.idl
+++ b/Source/core/css/CSSMatrix.idl
@@ -26,8 +26,9 @@
// Introduced in DOM Level ?:
[
Constructor([Default=NullString] optional DOMString cssValue),
+ InterfaceName=WebKitCSSMatrix,
RaisesException
-] interface WebKitCSSMatrix {
+] interface CSSMatrix {
// These attributes are simple aliases for certain elements of the 4x4 matrix
attribute double a; // alias for m11
@@ -57,46 +58,46 @@
[RaisesException] void setMatrixValue([Default=Undefined] optional DOMString string);
// Multiply this matrix by secondMatrix, on the right (result = this * secondMatrix)
- [Immutable] WebKitCSSMatrix multiply([Default=Undefined] optional WebKitCSSMatrix secondMatrix);
+ [Immutable] CSSMatrix multiply([Default=Undefined] optional CSSMatrix secondMatrix);
// Return the inverse of this matrix. Throw an exception if the matrix is not invertible
- [Immutable, RaisesException] WebKitCSSMatrix inverse();
+ [Immutable, RaisesException] CSSMatrix inverse();
// Return this matrix translated by the passed values.
// Passing a NaN will use a value of 0. This allows the 3D form to used for 2D operations
- [Immutable] WebKitCSSMatrix translate([Default=Undefined] optional double x,
+ [Immutable] CSSMatrix translate([Default=Undefined] optional double x,
[Default=Undefined] optional double y,
[Default=Undefined] optional double z);
// Returns this matrix scaled by the passed values.
// Passing scaleX or scaleZ as NaN uses a value of 1, but passing scaleY of NaN
// makes it the same as scaleX. This allows the 3D form to used for 2D operations
- [Immutable] WebKitCSSMatrix scale([Default=Undefined] optional double scaleX,
+ [Immutable] CSSMatrix scale([Default=Undefined] optional double scaleX,
[Default=Undefined] optional double scaleY,
[Default=Undefined] optional double scaleZ);
// Returns this matrix rotated by the passed values.
// If rotY and rotZ are NaN, rotate about Z (rotX=0, rotateY=0, rotateZ=rotX).
// Otherwise use a rotation value of 0 for any passed NaN.
- [Immutable] WebKitCSSMatrix rotate([Default=Undefined] optional double rotX,
+ [Immutable] CSSMatrix rotate([Default=Undefined] optional double rotX,
[Default=Undefined] optional double rotY,
[Default=Undefined] optional double rotZ);
// Returns this matrix rotated about the passed axis by the passed angle.
// Passing a NaN will use a value of 0. If the axis is (0,0,0) use a value
// of (0,0,1).
- [Immutable] WebKitCSSMatrix rotateAxisAngle([Default=Undefined] optional double x,
+ [Immutable] CSSMatrix rotateAxisAngle([Default=Undefined] optional double x,
[Default=Undefined] optional double y,
[Default=Undefined] optional double z,
[Default=Undefined] optional double angle);
// Returns this matrix skewed along the X axis by the passed values.
// Passing a NaN will use a value of 0.
- [Immutable] WebKitCSSMatrix skewX([Default=Undefined] optional double angle);
+ [Immutable] CSSMatrix skewX([Default=Undefined] optional double angle);
// Returns this matrix skewed along the Y axis by the passed values.
// Passing a NaN will use a value of 0.
- [Immutable] WebKitCSSMatrix skewY([Default=Undefined] optional double angle);
+ [Immutable] CSSMatrix skewY([Default=Undefined] optional double angle);
[NotEnumerable] DOMString toString();
};
diff --git a/Source/core/css/WebKitCSSMixFunctionValue.cpp b/Source/core/css/CSSMixFunctionValue.cpp
similarity index 73%
rename from Source/core/css/WebKitCSSMixFunctionValue.cpp
rename to Source/core/css/CSSMixFunctionValue.cpp
index 01d1bdb..f056a06 100644
--- a/Source/core/css/WebKitCSSMixFunctionValue.cpp
+++ b/Source/core/css/CSSMixFunctionValue.cpp
@@ -28,38 +28,38 @@
*/
#include "config.h"
-#include "core/css/WebKitCSSMixFunctionValue.h"
+#include "core/css/CSSMixFunctionValue.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
namespace WebCore {
-
-WebKitCSSMixFunctionValue::WebKitCSSMixFunctionValue()
- : CSSValueList(WebKitCSSMixFunctionValueClass, SpaceSeparator)
+
+CSSMixFunctionValue::CSSMixFunctionValue()
+ : CSSValueList(CSSMixFunctionValueClass, SpaceSeparator)
{
}
-WebKitCSSMixFunctionValue::WebKitCSSMixFunctionValue(const WebKitCSSMixFunctionValue& cloneFrom)
+CSSMixFunctionValue::CSSMixFunctionValue(const CSSMixFunctionValue& cloneFrom)
: CSSValueList(cloneFrom)
{
}
-String WebKitCSSMixFunctionValue::customCssText() const
+String CSSMixFunctionValue::customCssText() const
{
return "mix(" + CSSValueList::customCssText() + ")";
}
-PassRefPtr<WebKitCSSMixFunctionValue> WebKitCSSMixFunctionValue::cloneForCSSOM() const
+PassRefPtr<CSSMixFunctionValue> CSSMixFunctionValue::cloneForCSSOM() const
{
- return adoptRef(new WebKitCSSMixFunctionValue(*this));
+ return adoptRef(new CSSMixFunctionValue(*this));
}
-bool WebKitCSSMixFunctionValue::equals(const WebKitCSSMixFunctionValue& other) const
+bool CSSMixFunctionValue::equals(const CSSMixFunctionValue& other) const
{
return CSSValueList::equals(other);
}
-void WebKitCSSMixFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+void CSSMixFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
CSSValueList::reportDescendantMemoryUsage(memoryObjectInfo);
diff --git a/Source/core/css/WebKitCSSMixFunctionValue.h b/Source/core/css/CSSMixFunctionValue.h
similarity index 76%
rename from Source/core/css/WebKitCSSMixFunctionValue.h
rename to Source/core/css/CSSMixFunctionValue.h
index bb36b66..b3b1489 100644
--- a/Source/core/css/WebKitCSSMixFunctionValue.h
+++ b/Source/core/css/CSSMixFunctionValue.h
@@ -27,34 +27,34 @@
* SUCH DAMAGE.
*/
-#ifndef WebKitCSSMixFunctionValue_h
-#define WebKitCSSMixFunctionValue_h
+#ifndef CSSMixFunctionValue_h
+#define CSSMixFunctionValue_h
#include "core/css/CSSValueList.h"
-#include <wtf/PassRefPtr.h>
+#include "wtf/PassRefPtr.h"
namespace WebCore {
-class WebKitCSSMixFunctionValue : public CSSValueList {
+class CSSMixFunctionValue : public CSSValueList {
public:
- static PassRefPtr<WebKitCSSMixFunctionValue> create()
+ static PassRefPtr<CSSMixFunctionValue> create()
{
- return adoptRef(new WebKitCSSMixFunctionValue());
+ return adoptRef(new CSSMixFunctionValue());
}
String customCssText() const;
- PassRefPtr<WebKitCSSMixFunctionValue> cloneForCSSOM() const;
+ PassRefPtr<CSSMixFunctionValue> cloneForCSSOM() const;
- bool equals(const WebKitCSSMixFunctionValue&) const;
+ bool equals(const CSSMixFunctionValue&) const;
void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
private:
- WebKitCSSMixFunctionValue();
- WebKitCSSMixFunctionValue(const WebKitCSSMixFunctionValue& cloneFrom);
+ CSSMixFunctionValue();
+ CSSMixFunctionValue(const CSSMixFunctionValue& cloneFrom);
};
-
+
} // namespace WebCore
diff --git a/Source/core/css/WebKitCSSMixFunctionValue.idl b/Source/core/css/CSSMixFunctionValue.idl
similarity index 93%
rename from Source/core/css/WebKitCSSMixFunctionValue.idl
rename to Source/core/css/CSSMixFunctionValue.idl
index c4a2abd..3519f33 100644
--- a/Source/core/css/WebKitCSSMixFunctionValue.idl
+++ b/Source/core/css/CSSMixFunctionValue.idl
@@ -28,6 +28,7 @@
*/
[
-] interface WebKitCSSMixFunctionValue : CSSValueList {
+ InterfaceName=WebKitCSSMixFunctionValue
+] interface CSSMixFunctionValue : CSSValueList {
};
diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp
index 8b9845c..d5db0ea 100644
--- a/Source/core/css/CSSParser.cpp
+++ b/Source/core/css/CSSParser.cpp
@@ -29,6 +29,7 @@
#include "CSSValueKeywords.h"
#include "RuntimeEnabledFeatures.h"
+#include "core/css/CSSArrayFunctionValue.h"
#include "core/css/CSSAspectRatioValue.h"
#include "core/css/CSSBasicShapes.h"
#include "core/css/CSSBorderImage.h"
@@ -41,13 +42,19 @@
#include "core/css/CSSImageValue.h"
#include "core/css/CSSInheritedValue.h"
#include "core/css/CSSInitialValue.h"
+#include "core/css/CSSKeyframeRule.h"
+#include "core/css/CSSKeyframesRule.h"
#include "core/css/CSSLineBoxContainValue.h"
+#include "core/css/CSSMixFunctionValue.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSPropertySourceData.h"
#include "core/css/CSSReflectValue.h"
+#include "core/css/CSSSVGDocumentValue.h"
#include "core/css/CSSSelector.h"
+#include "core/css/CSSShaderValue.h"
#include "core/css/CSSStyleSheet.h"
#include "core/css/CSSTimingFunctionValue.h"
+#include "core/css/CSSTransformValue.h"
#include "core/css/CSSUnicodeRangeValue.h"
#include "core/css/CSSValueList.h"
#include "core/css/CSSValuePool.h"
@@ -64,14 +71,6 @@
#include "core/css/StyleRule.h"
#include "core/css/StyleRuleImport.h"
#include "core/css/StyleSheetContents.h"
-#include "core/css/WebKitCSSArrayFunctionValue.h"
-#include "core/css/WebKitCSSFilterValue.h"
-#include "core/css/WebKitCSSKeyframeRule.h"
-#include "core/css/WebKitCSSKeyframesRule.h"
-#include "core/css/WebKitCSSMixFunctionValue.h"
-#include "core/css/WebKitCSSSVGDocumentValue.h"
-#include "core/css/WebKitCSSShaderValue.h"
-#include "core/css/WebKitCSSTransformValue.h"
#include "core/dom/Document.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/inspector/InspectorInstrumentation.h"
@@ -424,13 +423,12 @@
case CSSPropertyWebkitBorderEndColor:
case CSSPropertyWebkitBorderStartColor:
case CSSPropertyWebkitColumnRuleColor:
-#if ENABLE(CSS3_TEXT)
- case CSSPropertyWebkitTextDecorationColor:
-#endif // CSS3_TEXT
case CSSPropertyWebkitTextEmphasisColor:
case CSSPropertyWebkitTextFillColor:
case CSSPropertyWebkitTextStrokeColor:
return true;
+ case CSSPropertyTextDecorationColor:
+ return RuntimeEnabledFeatures::css3TextDecorationsEnabled();
default:
return false;
}
@@ -444,7 +442,7 @@
return false;
CSSParserString cssString;
cssString.init(string);
- int valueID = cssValueKeywordID(cssString);
+ CSSValueID valueID = cssValueKeywordID(cssString);
bool validPrimitive = false;
if (valueID == CSSValueWebkitText)
validPrimitive = true;
@@ -609,7 +607,7 @@
// -webkit-flex | -webkit-inline-flex | -webkit-grid | -webkit-inline-grid | lazy-block
if ((valueID >= CSSValueInline && valueID <= CSSValueWebkitInlineFlex) || valueID == CSSValueNone)
return true;
- if (parserContext.isCSSGridLayoutEnabled && (valueID == CSSValueWebkitGrid || valueID == CSSValueWebkitInlineGrid))
+ if (parserContext.isCSSGridLayoutEnabled && (valueID == CSSValueGrid || valueID == CSSValueInlineGrid))
return true;
if (valueID == CSSValueLazyBlock)
return RuntimeEnabledFeatures::lazyLayoutEnabled();
@@ -650,12 +648,12 @@
if (valueID == CSSValueNormal || valueID == CSSValueBreakWord)
return true;
break;
- case CSSPropertyOverflowX: // visible | hidden | scroll | auto | marquee | overlay | inherit
- if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitMarquee)
+ case CSSPropertyOverflowX: // visible | hidden | scroll | auto | overlay | inherit
+ if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay)
return true;
break;
- case CSSPropertyOverflowY: // visible | hidden | scroll | auto | marquee | overlay | inherit | -webkit-paged-x | -webkit-paged-y
- if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitMarquee || valueID == CSSValueWebkitPagedX || valueID == CSSValueWebkitPagedY)
+ case CSSPropertyOverflowY: // visible | hidden | scroll | auto | overlay | inherit | -webkit-paged-x | -webkit-paged-y
+ if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitPagedX || valueID == CSSValueWebkitPagedY)
return true;
break;
case CSSPropertyPageBreakAfter: // auto | always | avoid | left | right | inherit
@@ -769,10 +767,6 @@
if (valueID == CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueCenter || valueID == CSSValueJustify)
return true;
break;
- case CSSPropertyWebkitColorCorrection:
- if (valueID == CSSValueSrgb || valueID == CSSValueDefault)
- return true;
- break;
case CSSPropertyWebkitAlignContent:
if (valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueSpaceBetween || valueID == CSSValueSpaceAround || valueID == CSSValueStretch)
return true;
@@ -809,7 +803,7 @@
if (valueID == CSSValueNone || valueID == CSSValueManual || valueID == CSSValueAuto)
return true;
break;
- case CSSPropertyWebkitGridAutoFlow:
+ case CSSPropertyGridAutoFlow:
if (valueID == CSSValueNone || valueID == CSSValueRow || valueID == CSSValueColumn)
return true;
break;
@@ -998,7 +992,6 @@
case CSSPropertyWebkitBoxLines:
case CSSPropertyWebkitBoxOrient:
case CSSPropertyWebkitBoxPack:
- case CSSPropertyWebkitColorCorrection:
case CSSPropertyWebkitColumnBreakAfter:
case CSSPropertyWebkitColumnBreakBefore:
case CSSPropertyWebkitColumnBreakInside:
@@ -1012,7 +1005,7 @@
case CSSPropertyWebkitFontKerning:
case CSSPropertyWebkitFontSmoothing:
case CSSPropertyWebkitHyphens:
- case CSSPropertyWebkitGridAutoFlow:
+ case CSSPropertyGridAutoFlow:
case CSSPropertyWebkitLineAlign:
case CSSPropertyWebkitLineBreak:
case CSSPropertyWebkitLineSnap:
@@ -1071,7 +1064,7 @@
CSSParserString cssString;
cssString.init(string);
- int valueID = cssValueKeywordID(cssString);
+ CSSValueID valueID = cssValueKeywordID(cssString);
if (!valueID)
return false;
@@ -1091,7 +1084,7 @@
}
template <typename CharacterType>
-static bool parseTransformArguments(WebKitCSSTransformValue* transformValue, CharacterType* characters, unsigned length, unsigned start, unsigned expectedCount)
+static bool parseTransformArguments(CSSTransformValue* transformValue, CharacterType* characters, unsigned length, unsigned start, unsigned expectedCount)
{
while (expectedCount) {
size_t end = WTF::find(characters, length, expectedCount == 1 ? ')' : ',', start);
@@ -1124,27 +1117,27 @@
UChar c9 = toASCIILower(string[9]);
UChar c10 = toASCIILower(string[10]);
- WebKitCSSTransformValue::TransformOperationType transformType;
+ CSSTransformValue::TransformOperationType transformType;
unsigned expectedArgumentCount = 1;
unsigned argumentStart = 11;
if (c9 == 'x' && c10 == '(')
- transformType = WebKitCSSTransformValue::TranslateXTransformOperation;
+ transformType = CSSTransformValue::TranslateXTransformOperation;
else if (c9 == 'y' && c10 == '(')
- transformType = WebKitCSSTransformValue::TranslateYTransformOperation;
+ transformType = CSSTransformValue::TranslateYTransformOperation;
else if (c9 == 'z' && c10 == '(')
- transformType = WebKitCSSTransformValue::TranslateZTransformOperation;
+ transformType = CSSTransformValue::TranslateZTransformOperation;
else if (c9 == '(') {
- transformType = WebKitCSSTransformValue::TranslateTransformOperation;
+ transformType = CSSTransformValue::TranslateTransformOperation;
expectedArgumentCount = 2;
argumentStart = 10;
} else if (c9 == '3' && c10 == 'd' && string[11] == '(') {
- transformType = WebKitCSSTransformValue::Translate3DTransformOperation;
+ transformType = CSSTransformValue::Translate3DTransformOperation;
expectedArgumentCount = 3;
argumentStart = 12;
} else
return false;
- RefPtr<WebKitCSSTransformValue> transformValue = WebKitCSSTransformValue::create(transformType);
+ RefPtr<CSSTransformValue> transformValue = CSSTransformValue::create(transformType);
bool success;
if (string.is8Bit())
success = parseTransformArguments(transformValue.get(), string.characters8(), string.length(), argumentStart, expectedArgumentCount);
@@ -1281,7 +1274,7 @@
CSSParserString cssColor;
cssColor.init(string);
- int id = cssValueKeywordID(cssColor);
+ CSSValueID id = cssValueKeywordID(cssColor);
if (id <= 0)
return false;
@@ -1364,7 +1357,7 @@
ASSERT(!m_mediaQuery);
// can't use { because tokenizer state switches from mediaquery to initial state when it sees { token.
- // instead insert one " " (which is WHITESPACE in CSSGrammar.y)
+ // instead insert one " " (which is caught by maybe_space in CSSGrammar.y)
setupParser("@-webkit-mediaquery ", string, "} ");
cssyyparse(this);
@@ -1380,9 +1373,8 @@
continue;
if (property.id() == CSSPropertyVariable) {
const AtomicString& name = static_cast<CSSVariableValue*>(property.value())->name();
- if (seenVariables.contains(name))
+ if (!seenVariables.add(name).isNewEntry)
continue;
- seenVariables.add(name);
output[--unusedEntries] = property;
continue;
}
@@ -1618,7 +1610,7 @@
return !id && validUnit(value, FLength | FPercent | FNonNeg);
}
-inline PassRefPtr<CSSPrimitiveValue> CSSParser::parseValidPrimitive(int identifier, CSSParserValue* value)
+inline PassRefPtr<CSSPrimitiveValue> CSSParser::parseValidPrimitive(CSSValueID identifier, CSSParserValue* value)
{
if (identifier)
return cssValuePool().createIdentifierValue(identifier);
@@ -1680,7 +1672,7 @@
// FIXME: This is to avoid having to pass parsedCalc to all validUnit callers.
ASSERT(!m_parsedCalculation);
- int id = value->id;
+ CSSValueID id = value->id;
int num = inShorthand() ? 1 : m_valueList->size();
@@ -1826,24 +1818,20 @@
case CSSPropertyWebkitBorderBeforeColor:
case CSSPropertyWebkitBorderAfterColor:
case CSSPropertyColor: // <color> | inherit
- case CSSPropertyTextLineThroughColor: // CSS3 text decoration colors
+ case CSSPropertyTextDecorationColor: // CSS3 text decoration colors
+ case CSSPropertyTextLineThroughColor:
case CSSPropertyTextUnderlineColor:
case CSSPropertyTextOverlineColor:
case CSSPropertyWebkitColumnRuleColor:
-#if ENABLE(CSS3_TEXT)
- case CSSPropertyWebkitTextDecorationColor:
-#endif // CSS3_TEXT
case CSSPropertyWebkitTextEmphasisColor:
case CSSPropertyWebkitTextFillColor:
case CSSPropertyWebkitTextStrokeColor:
- if (id == CSSValueWebkitText)
- validPrimitive = true; // Always allow this, even when strict parsing is on,
- // since we use this in our UA sheets.
- else if (id == CSSValueCurrentcolor)
- validPrimitive = true;
- else if ((id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu ||
- (id >= CSSValueWebkitFocusRingColor && id < CSSValueWebkitText && inQuirksMode())) {
- validPrimitive = true;
+ if (propId == CSSPropertyTextDecorationColor
+ && !RuntimeEnabledFeatures::css3TextDecorationsEnabled())
+ return false;
+
+ if ((id >= CSSValueAqua && id <= CSSValueWebkitText) || id == CSSValueMenu) {
+ validPrimitive = isValueAllowedInMode(id, m_context.mode);
} else {
parsedValue = parseColor();
if (parsedValue)
@@ -2128,17 +2116,18 @@
// none | [ underline || overline || line-through || blink ] | inherit
return parseTextDecoration(propId, important);
-#if ENABLE(CSS3_TEXT)
- case CSSPropertyWebkitTextDecorationLine:
+ case CSSPropertyTextDecorationLine:
// none | [ underline || overline || line-through ] | inherit
return parseTextDecoration(propId, important);
- case CSSPropertyWebkitTextDecorationStyle:
+ case CSSPropertyTextDecorationStyle:
// solid | double | dotted | dashed | wavy
- if (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy)
+ if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()
+ && (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy))
validPrimitive = true;
break;
+#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextUnderlinePosition:
// auto | alphabetic | under
return parseTextUnderlinePosition(important);
@@ -2436,31 +2425,32 @@
return false;
}
- case CSSPropertyWebkitGridAutoColumns:
- case CSSPropertyWebkitGridAutoRows:
+ case CSSPropertyGridAutoColumns:
+ case CSSPropertyGridAutoRows:
if (!cssGridLayoutEnabled())
return false;
parsedValue = parseGridTrackSize();
break;
- case CSSPropertyWebkitGridColumns:
- case CSSPropertyWebkitGridRows:
+ case CSSPropertyGridColumns:
+ case CSSPropertyGridRows:
if (!cssGridLayoutEnabled())
return false;
return parseGridTrackList(propId, important);
- case CSSPropertyWebkitGridStart:
- case CSSPropertyWebkitGridEnd:
- case CSSPropertyWebkitGridBefore:
- case CSSPropertyWebkitGridAfter:
+ case CSSPropertyGridStart:
+ case CSSPropertyGridEnd:
+ case CSSPropertyGridBefore:
+ case CSSPropertyGridAfter:
if (!cssGridLayoutEnabled())
return false;
parsedValue = parseGridPosition();
break;
- case CSSPropertyWebkitGridColumn:
- case CSSPropertyWebkitGridRow: {
+ case CSSPropertyGridColumn:
+ case CSSPropertyGridRow:
+ case CSSPropertyGridArea: {
if (!cssGridLayoutEnabled())
return false;
@@ -2739,6 +2729,10 @@
validPrimitive = true;
else if (value->unit == CSSParserValue::Function)
return parseBasicShape(propId, important);
+ else if (value->unit == CSSPrimitiveValue::CSS_URI) {
+ parsedValue = CSSImageValue::create(completeURL(value->string));
+ m_valueList->next();
+ }
break;
case CSSPropertyWebkitShapeMargin:
case CSSPropertyWebkitShapePadding:
@@ -2797,7 +2791,6 @@
case CSSPropertyWebkitBoxLines:
case CSSPropertyWebkitBoxOrient:
case CSSPropertyWebkitBoxPack:
- case CSSPropertyWebkitColorCorrection:
case CSSPropertyWebkitColumnBreakAfter:
case CSSPropertyWebkitColumnBreakBefore:
case CSSPropertyWebkitColumnBreakInside:
@@ -2811,7 +2804,7 @@
case CSSPropertyWebkitFontKerning:
case CSSPropertyWebkitFontSmoothing:
case CSSPropertyWebkitHyphens:
- case CSSPropertyWebkitGridAutoFlow:
+ case CSSPropertyGridAutoFlow:
case CSSPropertyWebkitLineAlign:
case CSSPropertyWebkitLineBreak:
case CSSPropertyWebkitLineSnap:
@@ -3500,6 +3493,8 @@
case CSSValueNone:
case CSSValueNormal:
parsedValue = cssValuePool().createIdentifierValue(val->id);
+ default:
+ break;
}
} else if (val->unit == CSSPrimitiveValue::CSS_STRING) {
parsedValue = createPrimitiveStringValue(val);
@@ -3544,7 +3539,7 @@
PassRefPtr<CSSValue> CSSParser::parseBackgroundColor()
{
- int id = m_valueList->current()->id;
+ CSSValueID id = m_valueList->current()->id;
if (id == CSSValueWebkitText || (id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu || id == CSSValueCurrentcolor ||
(id >= CSSValueGrey && id < CSSValueWebkitText && inQuirksMode()))
return cssValuePool().createIdentifierValue(id);
@@ -3608,7 +3603,7 @@
PassRefPtr<CSSPrimitiveValue> CSSParser::parseFillPositionComponent(CSSParserValueList* valueList, unsigned& cumulativeFlags, FillPositionFlag& individualFlag, FillPositionParsingMode parsingMode)
{
- int id = valueList->current()->id;
+ CSSValueID id = valueList->current()->id;
if (id == CSSValueLeft || id == CSSValueTop || id == CSSValueRight || id == CSSValueBottom || id == CSSValueCenter) {
int percent = 0;
if (id == CSSValueLeft || id == CSSValueRight) {
@@ -3666,7 +3661,7 @@
return false;
}
-static bool isFillPositionKeyword(int value)
+static bool isFillPositionKeyword(CSSValueID value)
{
return value == CSSValueLeft || value == CSSValueTop || value == CSSValueBottom || value == CSSValueRight || value == CSSValueCenter;
}
@@ -3675,7 +3670,7 @@
{
// [ left | right ] [ <percentage] | <length> ] && [ top | bottom ] [ <percentage> | <length> ]
// In the case of 4 values <position> requires the second value to be a length or a percentage.
- if (isFillPositionKeyword(parsedValue2->getIdent()))
+ if (isFillPositionKeyword(parsedValue2->getValueID()))
return;
unsigned cumulativeFlags = 0;
@@ -3684,8 +3679,8 @@
if (!value3)
return;
- int ident1 = parsedValue1->getIdent();
- int ident3 = value3->getIdent();
+ CSSValueID ident1 = parsedValue1->getValueID();
+ CSSValueID ident3 = value3->getValueID();
if (ident1 == CSSValueCenter)
return;
@@ -3708,7 +3703,7 @@
return;
// 4th value must be a length or a percentage.
- if (isFillPositionKeyword(value4->getIdent()))
+ if (isFillPositionKeyword(value4->getValueID()))
return;
value1 = createPrimitiveValuePair(parsedValue1, parsedValue2);
@@ -3732,12 +3727,12 @@
valueList->next();
bool swapNeeded = false;
- int ident1 = parsedValue1->getIdent();
- int ident2 = parsedValue2->getIdent();
- int ident3 = value3->getIdent();
+ CSSValueID ident1 = parsedValue1->getValueID();
+ CSSValueID ident2 = parsedValue2->getValueID();
+ CSSValueID ident3 = value3->getValueID();
- int firstPositionKeyword;
- int secondPositionKeyword;
+ CSSValueID firstPositionKeyword;
+ CSSValueID secondPositionKeyword;
if (ident1 == CSSValueCenter) {
// <position> requires the first 'center' to be followed by a keyword.
@@ -3803,8 +3798,8 @@
#ifndef NDEBUG
CSSPrimitiveValue* first = toCSSPrimitiveValue(value1.get());
CSSPrimitiveValue* second = toCSSPrimitiveValue(value2.get());
- ident1 = first->getPairValue()->first()->getIdent();
- ident2 = second->getPairValue()->first()->getIdent();
+ ident1 = first->getPairValue()->first()->getValueID();
+ ident2 = second->getPairValue()->first()->getValueID();
ASSERT(ident1 == CSSValueLeft || ident1 == CSSValueRight);
ASSERT(ident2 == CSSValueBottom || ident2 == CSSValueTop);
#endif
@@ -3869,7 +3864,7 @@
value2.clear();
// Per CSS3 syntax, <position> can't have 'center' as its second keyword as we have more arguments to follow.
- if (parsedValue2->getIdent() == CSSValueCenter)
+ if (parsedValue2->getValueID() == CSSValueCenter)
return;
if (numberOfValues == 3)
@@ -3924,7 +3919,7 @@
void CSSParser::parseFillRepeat(RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2)
{
- int id = m_valueList->current()->id;
+ CSSValueID id = m_valueList->current()->id;
if (id == CSSValueRepeatX) {
m_implicitShorthand = true;
value1 = cssValuePool().createIdentifierValue(CSSValueRepeat);
@@ -3960,7 +3955,7 @@
// If only one value was specified, value2 is the same as value1.
m_implicitShorthand = true;
- value2 = cssValuePool().createIdentifierValue(toCSSPrimitiveValue(value1.get())->getIdent());
+ value2 = cssValuePool().createIdentifierValue(toCSSPrimitiveValue(value1.get())->getValueID());
}
PassRefPtr<CSSValue> CSSParser::parseFillSize(CSSPropertyID propId, bool& allowComma)
@@ -4252,7 +4247,7 @@
CSSParserValue* value = m_valueList->current();
if (value->unit != CSSPrimitiveValue::CSS_IDENT)
return 0;
- int result = cssPropertyID(value->string);
+ CSSPropertyID result = cssPropertyID(value->string);
if (result)
return cssValuePool().createIdentifierValue(result);
if (equalIgnoringCase(value, "all")) {
@@ -4560,24 +4555,30 @@
{
ShorthandScope scope(this, shorthandId);
const StylePropertyShorthand& shorthand = shorthandForProperty(shorthandId);
- ASSERT(shorthand.length() == 2);
if (!parseValue(shorthand.properties()[0], important))
return false;
- if (!m_valueList->current()) {
- // Only one value was specified, the opposite value should be set to 'auto'.
- // FIXME: If the first property was <ident>, the opposite value should be the same <ident>.
- addProperty(shorthand.properties()[1], cssValuePool().createIdentifierValue(CSSValueAuto), important);
- return true;
+ size_t index = 1;
+ for (; index < shorthand.length(); ++index) {
+ if (!m_valueList->current())
+ break;
+
+ if (!isForwardSlashOperator(m_valueList->current()))
+ return false;
+
+ if (!m_valueList->next())
+ return false;
+
+ if (!parseValue(shorthand.properties()[index], important))
+ return false;
}
- if (!isForwardSlashOperator(m_valueList->current()))
- return false;
+ // Only one value out of the 2 positions was specified, the opposite value should be set to 'auto'.
+ // FIXME: If the first property was <ident>, the opposite value should be the same <ident>.
+ for (; index < shorthand.length(); ++index)
+ addProperty(shorthand.properties()[index], cssValuePool().createIdentifierValue(CSSValueAuto), important);
- if (!m_valueList->next())
- return false;
-
- return parseValue(shorthand.properties()[1], important);
+ return true;
}
bool CSSParser::parseGridTrackList(CSSPropertyID propId, bool important)
@@ -4706,7 +4707,7 @@
if (i->unit != CSSPrimitiveValue::CSS_IDENT)
return 0;
- int listStyleID = 0;
+ CSSValueID listStyleID = CSSValueInvalid;
if (i->id == CSSValueNone || (i->id >= CSSValueDisc && i->id <= CSSValueKatakanaIroha))
listStyleID = i->id;
else
@@ -4825,6 +4826,60 @@
return shape;
}
+PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapeInsetRectangle(CSSParserValueList* args)
+{
+ ASSERT(args);
+
+ // inset-rectangle(top, right, bottom, left, [[rx], ry])
+ if (args->size() != 7 && args->size() != 9 && args->size() != 11)
+ return 0;
+
+ RefPtr<CSSBasicShapeInsetRectangle> shape = CSSBasicShapeInsetRectangle::create();
+
+ unsigned argumentNumber = 0;
+ CSSParserValue* argument = args->current();
+ while (argument) {
+ Units unitFlags = FLength | FPercent | FNonNeg;
+ if (!validUnit(argument, unitFlags))
+ return 0;
+
+ RefPtr<CSSPrimitiveValue> length = createPrimitiveNumericValue(argument);
+ ASSERT(argumentNumber < 6);
+ switch (argumentNumber) {
+ case 0:
+ shape->setTop(length);
+ break;
+ case 1:
+ shape->setRight(length);
+ break;
+ case 2:
+ shape->setBottom(length);
+ break;
+ case 3:
+ shape->setLeft(length);
+ break;
+ case 4:
+ shape->setRadiusX(length);
+ break;
+ case 5:
+ shape->setRadiusY(length);
+ break;
+ }
+ argument = args->next();
+ if (argument) {
+ if (!isComma(argument))
+ return 0;
+
+ argument = args->next();
+ }
+ argumentNumber++;
+ }
+
+ if (argumentNumber < 4)
+ return 0;
+ return shape;
+}
+
PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapeCircle(CSSParserValueList* args)
{
ASSERT(args);
@@ -4995,6 +5050,8 @@
shape = parseBasicShapeEllipse(args);
else if (equalIgnoringCase(value->function->name, "polygon("))
shape = parseBasicShapePolygon(args);
+ else if (equalIgnoringCase(value->function->name, "inset-rectangle("))
+ shape = parseBasicShapeInsetRectangle(args);
if (!shape)
return false;
@@ -5189,7 +5246,7 @@
bool CSSParser::parseLineHeight(bool important)
{
CSSParserValue* value = m_valueList->current();
- int id = value->id;
+ CSSValueID id = value->id;
bool validPrimitive = false;
// normal | <number> | <length> | <percentage> | inherit
if (id == CSSValueNormal)
@@ -5204,7 +5261,7 @@
bool CSSParser::parseFontSize(bool important)
{
CSSParserValue* value = m_valueList->current();
- int id = value->id;
+ CSSValueID id = value->id;
bool validPrimitive = false;
// <absolute-size> | <relative-size> | <length> | <percentage> | inherit
if (id >= CSSValueXxSmall && id <= CSSValueLarger)
@@ -5273,7 +5330,7 @@
if (validUnit(value, FInteger | FNonNeg, CSSQuirksMode)) {
int weight = static_cast<int>(value->fValue);
if (!(weight % 100) && weight >= 100 && weight <= 900) {
- addProperty(CSSPropertyFontWeight, cssValuePool().createIdentifierValue(CSSValue100 + weight / 100 - 1), important);
+ addProperty(CSSPropertyFontWeight, cssValuePool().createIdentifierValue(static_cast<CSSValueID>(CSSValue100 + weight / 100 - 1)), important);
return true;
}
}
@@ -6864,7 +6921,7 @@
else
stop.m_position = cssValuePool().createValue(1, CSSPrimitiveValue::CSS_NUMBER);
- int id = args->current()->id;
+ CSSValueID id = args->current()->id;
if (id == CSSValueWebkitText || (id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu)
stop.m_color = cssValuePool().createIdentifierValue(id);
else
@@ -6891,7 +6948,7 @@
return false;
stopArg = args->next();
- int id = stopArg->id;
+ CSSValueID id = stopArg->id;
if (id == CSSValueWebkitText || (id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu)
stop.m_color = cssValuePool().createIdentifierValue(id);
else
@@ -7058,7 +7115,7 @@
static PassRefPtr<CSSPrimitiveValue> parseGradientColorOrKeyword(CSSParser* p, CSSParserValue* value)
{
- int id = value->id;
+ CSSValueID id = value->id;
if (id == CSSValueWebkitText || (id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu || id == CSSValueCurrentcolor)
return cssValuePool().createIdentifierValue(id);
@@ -7197,6 +7254,8 @@
sizeValue = cssValuePool().createIdentifierValue(a->id);
foundValue = true;
break;
+ default:
+ break;
}
if (foundValue) {
@@ -7397,10 +7456,10 @@
if (sizeValue && horizontalSize)
return false;
// Circles must have 0 or 1 lengths.
- if (shapeValue && shapeValue->getIdent() == CSSValueCircle && verticalSize)
+ if (shapeValue && shapeValue->getValueID() == CSSValueCircle && verticalSize)
return false;
// Ellipses must have 0 or 2 length/percentages.
- if (shapeValue && shapeValue->getIdent() == CSSValueEllipse && horizontalSize && !verticalSize)
+ if (shapeValue && shapeValue->getValueID() == CSSValueEllipse && horizontalSize && !verticalSize)
return false;
// If there's only one size, it must be a length.
if (!verticalSize && horizontalSize && horizontalSize->isPercentage())
@@ -7671,7 +7730,7 @@
class TransformOperationInfo {
public:
TransformOperationInfo(const CSSParserString& name)
- : m_type(WebKitCSSTransformValue::UnknownTransformOperation)
+ : m_type(CSSTransformValue::UnknownTransformOperation)
, m_argCount(1)
, m_allowSingleArgument(false)
, m_unit(CSSParser::FUnknown)
@@ -7699,7 +7758,7 @@
& ((characters[3] == 'w') || (characters[3] == 'W'))
& (characters[4] == '(')) {
m_unit = CSSParser::FAngle;
- m_type = WebKitCSSTransformValue::SkewTransformOperation;
+ m_type = CSSTransformValue::SkewTransformOperation;
m_allowSingleArgument = true;
m_argCount = 3;
}
@@ -7713,7 +7772,7 @@
& ((characters[4] == 'e') || (characters[4] == 'E'))
& (characters[5] == '(')) {
m_unit = CSSParser::FNumber;
- m_type = WebKitCSSTransformValue::ScaleTransformOperation;
+ m_type = CSSTransformValue::ScaleTransformOperation;
m_allowSingleArgument = true;
m_argCount = 3;
}
@@ -7724,10 +7783,10 @@
& (characters[5] == '(')) {
if ((characters[4] == 'x') || (characters[4] == 'X')) {
m_unit = CSSParser::FAngle;
- m_type = WebKitCSSTransformValue::SkewXTransformOperation;
+ m_type = CSSTransformValue::SkewXTransformOperation;
} else if ((characters[4] == 'y') || (characters[4] == 'Y')) {
m_unit = CSSParser::FAngle;
- m_type = WebKitCSSTransformValue::SkewYTransformOperation;
+ m_type = CSSTransformValue::SkewYTransformOperation;
}
}
break;
@@ -7741,7 +7800,7 @@
& ((characters[5] == 'x') || (characters[5] == 'X'))
& (characters[6] == '(')) {
m_unit = CSSParser::FNumber;
- m_type = WebKitCSSTransformValue::MatrixTransformOperation;
+ m_type = CSSTransformValue::MatrixTransformOperation;
m_argCount = 11;
}
} else if ((characters[0] == 'r') || (characters[0] == 'R')) {
@@ -7752,7 +7811,7 @@
& ((characters[5] == 'e') || (characters[5] == 'E'))
& (characters[6] == '(')) {
m_unit = CSSParser::FAngle;
- m_type = WebKitCSSTransformValue::RotateTransformOperation;
+ m_type = CSSTransformValue::RotateTransformOperation;
}
} else if (((characters[0] == 's') || (characters[0] == 'S'))
& ((characters[1] == 'c') || (characters[1] == 'C'))
@@ -7762,13 +7821,13 @@
& (characters[6] == '(')) {
if ((characters[5] == 'x') || (characters[5] == 'X')) {
m_unit = CSSParser::FNumber;
- m_type = WebKitCSSTransformValue::ScaleXTransformOperation;
+ m_type = CSSTransformValue::ScaleXTransformOperation;
} else if ((characters[5] == 'y') || (characters[5] == 'Y')) {
m_unit = CSSParser::FNumber;
- m_type = WebKitCSSTransformValue::ScaleYTransformOperation;
+ m_type = CSSTransformValue::ScaleYTransformOperation;
} else if ((characters[5] == 'z') || (characters[5] == 'Z')) {
m_unit = CSSParser::FNumber;
- m_type = WebKitCSSTransformValue::ScaleZTransformOperation;
+ m_type = CSSTransformValue::ScaleZTransformOperation;
}
}
break;
@@ -7783,7 +7842,7 @@
& ((characters[6] == 'd') || (characters[6] == 'D'))
& (characters[7] == '(')) {
m_unit = CSSParser::FNumber;
- m_type = WebKitCSSTransformValue::Scale3DTransformOperation;
+ m_type = CSSTransformValue::Scale3DTransformOperation;
m_argCount = 5;
}
} else if (((characters[0] == 'r') || (characters[0] == 'R'))
@@ -7795,13 +7854,13 @@
& (characters[7] == '(')) {
if ((characters[6] == 'x') || (characters[6] == 'X')) {
m_unit = CSSParser::FAngle;
- m_type = WebKitCSSTransformValue::RotateXTransformOperation;
+ m_type = CSSTransformValue::RotateXTransformOperation;
} else if ((characters[6] == 'y') || (characters[6] == 'Y')) {
m_unit = CSSParser::FAngle;
- m_type = WebKitCSSTransformValue::RotateYTransformOperation;
+ m_type = CSSTransformValue::RotateYTransformOperation;
} else if ((characters[6] == 'z') || (characters[6] == 'Z')) {
m_unit = CSSParser::FAngle;
- m_type = WebKitCSSTransformValue::RotateZTransformOperation;
+ m_type = CSSTransformValue::RotateZTransformOperation;
}
}
break;
@@ -7817,7 +7876,7 @@
& ((characters[7] == 'd') || (characters[7] == 'D'))
& (characters[8] == '(')) {
m_unit = CSSParser::FNumber;
- m_type = WebKitCSSTransformValue::Matrix3DTransformOperation;
+ m_type = CSSTransformValue::Matrix3DTransformOperation;
m_argCount = 31;
}
} else if (((characters[0] == 'r') || (characters[0] == 'R'))
@@ -7830,7 +7889,7 @@
& ((characters[7] == 'd') || (characters[7] == 'D'))
& (characters[8] == '(')) {
m_unit = CSSParser::FNumber;
- m_type = WebKitCSSTransformValue::Rotate3DTransformOperation;
+ m_type = CSSTransformValue::Rotate3DTransformOperation;
m_argCount = 7;
}
break;
@@ -7847,7 +7906,7 @@
& ((characters[8] == 'e') || (characters[8] == 'E'))
& (characters[9] == '(')) {
m_unit = CSSParser::FLength | CSSParser::FPercent;
- m_type = WebKitCSSTransformValue::TranslateTransformOperation;
+ m_type = CSSTransformValue::TranslateTransformOperation;
m_allowSingleArgument = true;
m_argCount = 3;
}
@@ -7866,13 +7925,13 @@
& (characters[10] == '(')) {
if ((characters[9] == 'x') || (characters[9] == 'X')) {
m_unit = CSSParser::FLength | CSSParser::FPercent;
- m_type = WebKitCSSTransformValue::TranslateXTransformOperation;
+ m_type = CSSTransformValue::TranslateXTransformOperation;
} else if ((characters[9] == 'y') || (characters[9] == 'Y')) {
m_unit = CSSParser::FLength | CSSParser::FPercent;
- m_type = WebKitCSSTransformValue::TranslateYTransformOperation;
+ m_type = CSSTransformValue::TranslateYTransformOperation;
} else if ((characters[9] == 'z') || (characters[9] == 'Z')) {
m_unit = CSSParser::FLength | CSSParser::FPercent;
- m_type = WebKitCSSTransformValue::TranslateZTransformOperation;
+ m_type = CSSTransformValue::TranslateZTransformOperation;
}
}
break;
@@ -7891,7 +7950,7 @@
& ((characters[10] == 'e') || (characters[10] == 'E'))
& (characters[11] == '(')) {
m_unit = CSSParser::FNumber;
- m_type = WebKitCSSTransformValue::PerspectiveTransformOperation;
+ m_type = CSSTransformValue::PerspectiveTransformOperation;
}
} else if (((characters[0] == 't') || (characters[0] == 'T'))
& ((characters[1] == 'r') || (characters[1] == 'R'))
@@ -7906,22 +7965,22 @@
& ((characters[10] == 'd') || (characters[10] == 'D'))
& (characters[11] == '(')) {
m_unit = CSSParser::FLength | CSSParser::FPercent;
- m_type = WebKitCSSTransformValue::Translate3DTransformOperation;
+ m_type = CSSTransformValue::Translate3DTransformOperation;
m_argCount = 5;
}
break;
} // end switch ()
}
- WebKitCSSTransformValue::TransformOperationType type() const { return m_type; }
+ CSSTransformValue::TransformOperationType type() const { return m_type; }
unsigned argCount() const { return m_argCount; }
CSSParser::Units unit() const { return m_unit; }
- bool unknown() const { return m_type == WebKitCSSTransformValue::UnknownTransformOperation; }
+ bool unknown() const { return m_type == CSSTransformValue::UnknownTransformOperation; }
bool hasCorrectArgCount(unsigned argCount) { return m_argCount == argCount || (m_allowSingleArgument && argCount == 1); }
private:
- WebKitCSSTransformValue::TransformOperationType m_type;
+ CSSTransformValue::TransformOperationType m_type;
unsigned m_argCount;
bool m_allowSingleArgument;
CSSParser::Units m_unit;
@@ -7963,10 +8022,10 @@
return 0;
// The transform is a list of functional primitives that specify transform operations.
- // We collect a list of WebKitCSSTransformValues, where each value specifies a single operation.
+ // We collect a list of CSSTransformValues, where each value specifies a single operation.
- // Create the new WebKitCSSTransformValue for this operation and add it to our list.
- RefPtr<WebKitCSSTransformValue> transformValue = WebKitCSSTransformValue::create(info.type());
+ // Create the new CSSTransformValue for this operation and add it to our list.
+ RefPtr<CSSTransformValue> transformValue = CSSTransformValue::create(info.type());
// Snag our values.
CSSParserValue* a = args->current();
@@ -7974,19 +8033,19 @@
while (a) {
CSSParser::Units unit = info.unit();
- if (info.type() == WebKitCSSTransformValue::Rotate3DTransformOperation && argNumber == 3) {
+ if (info.type() == CSSTransformValue::Rotate3DTransformOperation && argNumber == 3) {
// 4th param of rotate3d() is an angle rather than a bare number, validate it as such
if (!validUnit(a, FAngle, CSSStrictMode))
return 0;
- } else if (info.type() == WebKitCSSTransformValue::Translate3DTransformOperation && argNumber == 2) {
+ } else if (info.type() == CSSTransformValue::Translate3DTransformOperation && argNumber == 2) {
// 3rd param of translate3d() cannot be a percentage
if (!validUnit(a, FLength, CSSStrictMode))
return 0;
- } else if (info.type() == WebKitCSSTransformValue::TranslateZTransformOperation && !argNumber) {
+ } else if (info.type() == CSSTransformValue::TranslateZTransformOperation && !argNumber) {
// 1st param of translateZ() cannot be a percentage
if (!validUnit(a, FLength, CSSStrictMode))
return 0;
- } else if (info.type() == WebKitCSSTransformValue::PerspectiveTransformOperation && !argNumber) {
+ } else if (info.type() == CSSTransformValue::PerspectiveTransformOperation && !argNumber) {
// 1st param of perspective() must be a non-negative number (deprecated) or length.
if (!validUnit(a, FNumber | FLength | FNonNeg, CSSStrictMode))
return 0;
@@ -8009,45 +8068,45 @@
return transformValue.release();
}
-bool CSSParser::isBlendMode(int ident)
+bool CSSParser::isBlendMode(CSSValueID valueID)
{
- return (ident >= CSSValueMultiply && ident <= CSSValueLuminosity)
- || ident == CSSValueNormal
- || ident == CSSValueOverlay;
+ return (valueID >= CSSValueMultiply && valueID <= CSSValueLuminosity)
+ || valueID == CSSValueNormal
+ || valueID == CSSValueOverlay;
}
-bool CSSParser::isCompositeOperator(int ident)
+bool CSSParser::isCompositeOperator(CSSValueID valueID)
{
// FIXME: Add CSSValueDestination and CSSValueLighter when the Compositing spec updates.
- return ident >= CSSValueClear && ident <= CSSValueXor;
+ return valueID >= CSSValueClear && valueID <= CSSValueXor;
}
-static void filterInfoForName(const CSSParserString& name, WebKitCSSFilterValue::FilterOperationType& filterType, unsigned& maximumArgumentCount)
+static void filterInfoForName(const CSSParserString& name, CSSFilterValue::FilterOperationType& filterType, unsigned& maximumArgumentCount)
{
if (equalIgnoringCase(name, "grayscale("))
- filterType = WebKitCSSFilterValue::GrayscaleFilterOperation;
+ filterType = CSSFilterValue::GrayscaleFilterOperation;
else if (equalIgnoringCase(name, "sepia("))
- filterType = WebKitCSSFilterValue::SepiaFilterOperation;
+ filterType = CSSFilterValue::SepiaFilterOperation;
else if (equalIgnoringCase(name, "saturate("))
- filterType = WebKitCSSFilterValue::SaturateFilterOperation;
+ filterType = CSSFilterValue::SaturateFilterOperation;
else if (equalIgnoringCase(name, "hue-rotate("))
- filterType = WebKitCSSFilterValue::HueRotateFilterOperation;
+ filterType = CSSFilterValue::HueRotateFilterOperation;
else if (equalIgnoringCase(name, "invert("))
- filterType = WebKitCSSFilterValue::InvertFilterOperation;
+ filterType = CSSFilterValue::InvertFilterOperation;
else if (equalIgnoringCase(name, "opacity("))
- filterType = WebKitCSSFilterValue::OpacityFilterOperation;
+ filterType = CSSFilterValue::OpacityFilterOperation;
else if (equalIgnoringCase(name, "brightness("))
- filterType = WebKitCSSFilterValue::BrightnessFilterOperation;
+ filterType = CSSFilterValue::BrightnessFilterOperation;
else if (equalIgnoringCase(name, "contrast("))
- filterType = WebKitCSSFilterValue::ContrastFilterOperation;
+ filterType = CSSFilterValue::ContrastFilterOperation;
else if (equalIgnoringCase(name, "blur("))
- filterType = WebKitCSSFilterValue::BlurFilterOperation;
+ filterType = CSSFilterValue::BlurFilterOperation;
else if (equalIgnoringCase(name, "drop-shadow(")) {
- filterType = WebKitCSSFilterValue::DropShadowFilterOperation;
+ filterType = CSSFilterValue::DropShadowFilterOperation;
maximumArgumentCount = 4; // x-offset, y-offset, blur-radius, color -- spread and inset style not allowed.
}
else if (equalIgnoringCase(name, "custom("))
- filterType = WebKitCSSFilterValue::CustomFilterOperation;
+ filterType = CSSFilterValue::CustomFilterOperation;
}
static bool acceptCommaOperator(CSSParserValueList* argsList)
@@ -8060,7 +8119,7 @@
return true;
}
-PassRefPtr<WebKitCSSArrayFunctionValue> CSSParser::parseCustomFilterArrayFunction(CSSParserValue* value)
+PassRefPtr<CSSArrayFunctionValue> CSSParser::parseCustomFilterArrayFunction(CSSParserValue* value)
{
ASSERT(value->unit == CSSParserValue::Function && value->function);
@@ -8072,7 +8131,7 @@
return 0;
// array() values are comma separated.
- RefPtr<WebKitCSSArrayFunctionValue> arrayFunction = WebKitCSSArrayFunctionValue::create();
+ RefPtr<CSSArrayFunctionValue> arrayFunction = CSSArrayFunctionValue::create();
while (true) {
// We parse pairs <Value, Comma> at each step.
CSSParserValue* currentParserValue = arrayArgsParserValueList->current();
@@ -8095,7 +8154,7 @@
return arrayFunction;
}
-PassRefPtr<WebKitCSSMixFunctionValue> CSSParser::parseMixFunction(CSSParserValue* value)
+PassRefPtr<CSSMixFunctionValue> CSSParser::parseMixFunction(CSSParserValue* value)
{
ASSERT(value->unit == CSSParserValue::Function && value->function);
@@ -8110,7 +8169,7 @@
if (numArgs < 1 || numArgs > 3)
return 0;
- RefPtr<WebKitCSSMixFunctionValue> mixFunction = WebKitCSSMixFunctionValue::create();
+ RefPtr<CSSMixFunctionValue> mixFunction = CSSMixFunctionValue::create();
bool hasBlendMode = false;
bool hasAlphaCompositing = false;
@@ -8122,7 +8181,7 @@
if (!argNumber) {
if (arg->unit == CSSPrimitiveValue::CSS_URI) {
KURL shaderURL = completeURL(arg->string);
- value = WebKitCSSShaderValue::create(shaderURL.string());
+ value = CSSShaderValue::create(shaderURL.string());
}
} else if (argNumber == 1 || argNumber == 2) {
if (!hasBlendMode && isBlendMode(arg->id)) {
@@ -8217,7 +8276,7 @@
return paramList;
}
-PassRefPtr<WebKitCSSFilterValue> CSSParser::parseCustomFilterFunctionWithAtRuleReferenceSyntax(CSSParserValue* value)
+PassRefPtr<CSSFilterValue> CSSParser::parseCustomFilterFunctionWithAtRuleReferenceSyntax(CSSParserValue* value)
{
//
// Custom filter function "at-rule reference" syntax:
@@ -8239,7 +8298,7 @@
if (arg->unit != CSSPrimitiveValue::CSS_IDENT)
return 0;
- RefPtr<WebKitCSSFilterValue> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::CustomFilterOperation);
+ RefPtr<CSSFilterValue> filterValue = CSSFilterValue::create(CSSFilterValue::CustomFilterOperation);
RefPtr<CSSValue> filterName = createPrimitiveStringValue(arg);
filterValue->append(filterName);
@@ -8260,7 +8319,7 @@
}
// FIXME: The custom filters "inline" syntax is deprecated. We will remove it eventually.
-PassRefPtr<WebKitCSSFilterValue> CSSParser::parseCustomFilterFunctionWithInlineSyntax(CSSParserValue* value)
+PassRefPtr<CSSFilterValue> CSSParser::parseCustomFilterFunctionWithInlineSyntax(CSSParserValue* value)
{
//
// Custom filter function "inline" syntax:
@@ -8288,7 +8347,7 @@
if (!argsList)
return 0;
- RefPtr<WebKitCSSFilterValue> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::CustomFilterOperation);
+ RefPtr<CSSFilterValue> filterValue = CSSFilterValue::create(CSSFilterValue::CustomFilterOperation);
// 1. Parse the shader URLs: <vertex-shader>[wsp<fragment-shader>]
RefPtr<CSSValueList> shadersList = CSSValueList::createSpaceSeparated();
@@ -8300,7 +8359,7 @@
value = cssValuePool().createIdentifierValue(CSSValueNone);
else if (arg->unit == CSSPrimitiveValue::CSS_URI) {
KURL shaderURL = completeURL(arg->string);
- value = WebKitCSSShaderValue::create(shaderURL.string());
+ value = CSSShaderValue::create(shaderURL.string());
hadAtLeastOneCustomShader = true;
} else if (argsList->currentIndex() == 1 && arg->unit == CSSParserValue::Function) {
if (!(value = parseMixFunction(arg)))
@@ -8365,7 +8424,7 @@
return filterValue;
}
-PassRefPtr<WebKitCSSFilterValue> CSSParser::parseCustomFilterFunction(CSSParserValue* value)
+PassRefPtr<CSSFilterValue> CSSParser::parseCustomFilterFunction(CSSParserValue* value)
{
ASSERT(value->function);
@@ -8405,11 +8464,11 @@
return list.release();
}
-PassRefPtr<WebKitCSSShaderValue> CSSParser::parseFilterRuleSrcUriAndFormat(CSSParserValueList* valueList)
+PassRefPtr<CSSShaderValue> CSSParser::parseFilterRuleSrcUriAndFormat(CSSParserValueList* valueList)
{
CSSParserValue* value = valueList->current();
ASSERT(value && value->unit == CSSPrimitiveValue::CSS_URI);
- RefPtr<WebKitCSSShaderValue> shaderValue = WebKitCSSShaderValue::create(completeURL(value->string));
+ RefPtr<CSSShaderValue> shaderValue = CSSShaderValue::create(completeURL(value->string));
value = valueList->next();
if (value && value->unit == CSSParserValue::Function && equalIgnoringCase(value->function->name, "format(")) {
@@ -8437,7 +8496,7 @@
if (value->unit != CSSPrimitiveValue::CSS_URI)
return false;
- RefPtr<WebKitCSSShaderValue> shaderValue = parseFilterRuleSrcUriAndFormat(m_valueList.get());
+ RefPtr<CSSShaderValue> shaderValue = parseFilterRuleSrcUriAndFormat(m_valueList.get());
if (!shaderValue)
return false;
srcList->append(shaderValue.release());
@@ -8467,18 +8526,18 @@
}
-PassRefPtr<WebKitCSSFilterValue> CSSParser::parseBuiltinFilterArguments(CSSParserValueList* args, WebKitCSSFilterValue::FilterOperationType filterType)
+PassRefPtr<CSSFilterValue> CSSParser::parseBuiltinFilterArguments(CSSParserValueList* args, CSSFilterValue::FilterOperationType filterType)
{
- RefPtr<WebKitCSSFilterValue> filterValue = WebKitCSSFilterValue::create(filterType);
+ RefPtr<CSSFilterValue> filterValue = CSSFilterValue::create(filterType);
ASSERT(args);
switch (filterType) {
- case WebKitCSSFilterValue::GrayscaleFilterOperation:
- case WebKitCSSFilterValue::SepiaFilterOperation:
- case WebKitCSSFilterValue::SaturateFilterOperation:
- case WebKitCSSFilterValue::InvertFilterOperation:
- case WebKitCSSFilterValue::OpacityFilterOperation:
- case WebKitCSSFilterValue::ContrastFilterOperation: {
+ case CSSFilterValue::GrayscaleFilterOperation:
+ case CSSFilterValue::SepiaFilterOperation:
+ case CSSFilterValue::SaturateFilterOperation:
+ case CSSFilterValue::InvertFilterOperation:
+ case CSSFilterValue::OpacityFilterOperation:
+ case CSSFilterValue::ContrastFilterOperation: {
// One optional argument, 0-1 or 0%-100%, if missing use 100%.
if (args->size() > 1)
return 0;
@@ -8491,8 +8550,8 @@
double amount = value->fValue;
// Saturate and Contrast allow values over 100%.
- if (filterType != WebKitCSSFilterValue::SaturateFilterOperation
- && filterType != WebKitCSSFilterValue::ContrastFilterOperation) {
+ if (filterType != CSSFilterValue::SaturateFilterOperation
+ && filterType != CSSFilterValue::ContrastFilterOperation) {
double maxAllowed = value->unit == CSSPrimitiveValue::CSS_PERCENTAGE ? 100.0 : 1.0;
if (amount > maxAllowed)
return 0;
@@ -8502,7 +8561,7 @@
}
break;
}
- case WebKitCSSFilterValue::BrightnessFilterOperation: {
+ case CSSFilterValue::BrightnessFilterOperation: {
// One optional argument, if missing use 100%.
if (args->size() > 1)
return 0;
@@ -8516,7 +8575,7 @@
}
break;
}
- case WebKitCSSFilterValue::HueRotateFilterOperation: {
+ case CSSFilterValue::HueRotateFilterOperation: {
// hue-rotate() takes one optional angle.
if (args->size() > 1)
return 0;
@@ -8530,7 +8589,7 @@
}
break;
}
- case WebKitCSSFilterValue::BlurFilterOperation: {
+ case CSSFilterValue::BlurFilterOperation: {
// Blur takes a single length. Zero parameters are allowed.
if (args->size() > 1)
return 0;
@@ -8544,7 +8603,7 @@
}
break;
}
- case WebKitCSSFilterValue::DropShadowFilterOperation: {
+ case CSSFilterValue::DropShadowFilterOperation: {
// drop-shadow() takes a single shadow.
RefPtr<CSSValueList> shadowValueList = parseShadow(args, CSSPropertyWebkitFilter);
if (!shadowValueList || shadowValueList->length() != 1)
@@ -8570,28 +8629,28 @@
if (value->unit != CSSPrimitiveValue::CSS_URI && (value->unit != CSSParserValue::Function || !value->function))
return 0;
- WebKitCSSFilterValue::FilterOperationType filterType = WebKitCSSFilterValue::UnknownFilterOperation;
+ CSSFilterValue::FilterOperationType filterType = CSSFilterValue::UnknownFilterOperation;
// See if the specified primitive is one we understand.
if (value->unit == CSSPrimitiveValue::CSS_URI) {
- RefPtr<WebKitCSSFilterValue> referenceFilterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::ReferenceFilterOperation);
+ RefPtr<CSSFilterValue> referenceFilterValue = CSSFilterValue::create(CSSFilterValue::ReferenceFilterOperation);
list->append(referenceFilterValue);
- referenceFilterValue->append(WebKitCSSSVGDocumentValue::create(value->string));
+ referenceFilterValue->append(CSSSVGDocumentValue::create(value->string));
} else {
const CSSParserString name = value->function->name;
unsigned maximumArgumentCount = 1;
filterInfoForName(name, filterType, maximumArgumentCount);
- if (filterType == WebKitCSSFilterValue::UnknownFilterOperation)
+ if (filterType == CSSFilterValue::UnknownFilterOperation)
return 0;
- if (filterType == WebKitCSSFilterValue::CustomFilterOperation) {
+ if (filterType == CSSFilterValue::CustomFilterOperation) {
// Make sure parsing fails if custom filters are disabled.
if (!m_context.isCSSCustomFilterEnabled)
return 0;
- RefPtr<WebKitCSSFilterValue> filterValue = parseCustomFilterFunction(value);
+ RefPtr<CSSFilterValue> filterValue = parseCustomFilterFunction(value);
if (!filterValue)
return 0;
list->append(filterValue.release());
@@ -8601,7 +8660,7 @@
if (!args)
return 0;
- RefPtr<WebKitCSSFilterValue> filterValue = parseBuiltinFilterArguments(args, filterType);
+ RefPtr<CSSFilterValue> filterValue = parseBuiltinFilterArguments(args, filterType);
if (!filterValue)
return 0;
@@ -8780,20 +8839,22 @@
void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important)
{
-#if ENABLE(CSS3_TEXT)
// The text-decoration-line property takes priority over text-decoration, unless the latter has important priority set.
if (propId == CSSPropertyTextDecoration && !important && m_currentShorthand == CSSPropertyInvalid) {
for (unsigned i = 0; i < m_parsedProperties.size(); ++i) {
- if (m_parsedProperties[i].id() == CSSPropertyWebkitTextDecorationLine)
+ if (m_parsedProperties[i].id() == CSSPropertyTextDecorationLine)
return;
}
}
-#endif // CSS3_TEXT
addProperty(propId, value, important);
}
bool CSSParser::parseTextDecoration(CSSPropertyID propId, bool important)
{
+ if (propId == CSSPropertyTextDecorationLine
+ && !RuntimeEnabledFeatures::css3TextDecorationsEnabled())
+ return false;
+
CSSParserValue* value = m_valueList->current();
if (value->id == CSSValueNone) {
addTextDecorationProperty(propId, cssValuePool().createIdentifierValue(CSSValueNone), important);
@@ -8806,13 +8867,11 @@
while (isValid && value) {
switch (value->id) {
case CSSValueBlink:
-#if ENABLE(CSS3_TEXT)
- // Blink value is not accepted by -webkit-text-decoration-line.
- isValid = propId != CSSPropertyWebkitTextDecorationLine;
+ // Blink value is not accepted by text-decoration-line.
+ isValid = propId != CSSPropertyTextDecorationLine;
if (isValid)
list->append(cssValuePool().createIdentifierValue(value->id));
break;
-#endif // CSS3_TEXT
case CSSValueUnderline:
case CSSValueOverline:
case CSSValueLineThrough:
@@ -9331,6 +9390,18 @@
}
template <typename CharacterType>
+static inline bool isEqualToCSSCaseSensitiveIdentifier(CharacterType* string, const char* constantString)
+{
+ ASSERT(*constantString);
+
+ do {
+ if (*string++ != *constantString++)
+ return false;
+ } while (*constantString);
+ return true;
+}
+
+template <typename CharacterType>
static CharacterType* checkAndSkipEscape(CharacterType* currentCharacter)
{
// Returns with 0, if escape check is failed. Otherwise
@@ -10248,7 +10319,7 @@
if (length < sizeof("-webkit-var-*") - 1)
return false;
CharacterType* name = tokenStart<CharacterType>();
- return name[11] == '-' && isIdentifierStartAfterDash(name + 12) && isEqualToCSSIdentifier(name + 1, "webkit-var");
+ return name[11] == '-' && isIdentifierStartAfterDash(name + 12) && isEqualToCSSCaseSensitiveIdentifier(name + 1, "webkit-var");
}
@@ -10298,22 +10369,13 @@
}
m_token = FUNCTION;
- bool shouldSkipParenthesis = true;
- if (!hasEscape) {
- bool detected = detectFunctionTypeToken<SrcCharacterType>(result - tokenStart<SrcCharacterType>());
- if (!detected && m_parsingMode == MediaQueryMode) {
- // ... and(max-width: 480px) ... looks like a function, but in fact it is not,
- // so run more detection code in the MediaQueryMode.
- detectMediaQueryToken<SrcCharacterType>(result - tokenStart<SrcCharacterType>());
- shouldSkipParenthesis = false;
- }
- }
+ if (!hasEscape)
+ detectFunctionTypeToken<SrcCharacterType>(result - tokenStart<SrcCharacterType>());
- if (LIKELY(shouldSkipParenthesis)) {
- ++currentCharacter<SrcCharacterType>();
- ++result;
- ++yylval->string.m_length;
- }
+ // Skip parenthesis
+ ++currentCharacter<SrcCharacterType>();
+ ++result;
+ ++yylval->string.m_length;
if (token() == URI) {
m_token = FUNCTION;
@@ -10777,6 +10839,11 @@
return createFloatingMediaQuery(MediaQuery::None, "all", expressions);
}
+MediaQuery* CSSParser::createFloatingNotAllQuery()
+{
+ return createFloatingMediaQuery(MediaQuery::Not, "all", sinkFloatingMediaQueryExpList(createFloatingMediaQueryExpList()));
+}
+
PassOwnPtr<MediaQuery> CSSParser::sinkFloatingMediaQuery(MediaQuery* query)
{
ASSERT_UNUSED(query, query == m_floatingMediaQuery);
@@ -11541,14 +11608,14 @@
}
template <typename CharacterType>
-static int cssValueKeywordID(const CharacterType* valueKeyword, unsigned length)
+static CSSValueID cssValueKeywordID(const CharacterType* valueKeyword, unsigned length)
{
char buffer[maxCSSValueKeywordLength + 1 + 1]; // 1 to turn "apple"/"khtml" into "webkit", 1 for null character
for (unsigned i = 0; i != length; ++i) {
CharacterType c = valueKeyword[i];
if (c == 0 || c >= 0x7F)
- return 0; // illegal character
+ return CSSValueInvalid; // illegal character
buffer[i] = WTF::toASCIILower(c);
}
buffer[length] = '\0';
@@ -11564,16 +11631,16 @@
}
const Value* hashTableEntry = findValue(buffer, length);
- return hashTableEntry ? hashTableEntry->id : 0;
+ return hashTableEntry ? static_cast<CSSValueID>(hashTableEntry->id) : CSSValueInvalid;
}
-int cssValueKeywordID(const CSSParserString& string)
+CSSValueID cssValueKeywordID(const CSSParserString& string)
{
unsigned length = string.length();
if (!length)
- return 0;
+ return CSSValueInvalid;
if (length > maxCSSValueKeywordLength)
- return 0;
+ return CSSValueInvalid;
return string.is8Bit() ? cssValueKeywordID(string.characters8(), length) : cssValueKeywordID(string.characters16(), length);
}
diff --git a/Source/core/css/CSSParser.h b/Source/core/css/CSSParser.h
index e7099ae..b29d5a6 100644
--- a/Source/core/css/CSSParser.h
+++ b/Source/core/css/CSSParser.h
@@ -24,7 +24,9 @@
#define CSSParser_h
#include "CSSPropertyNames.h"
+#include "CSSValueKeywords.h"
#include "core/css/CSSCalculationValue.h"
+#include "core/css/CSSFilterValue.h"
#include "core/css/CSSGradientValue.h"
#include "core/css/CSSParserMode.h"
#include "core/css/CSSParserValues.h"
@@ -32,21 +34,23 @@
#include "core/css/CSSPropertySourceData.h"
#include "core/css/CSSSelector.h"
#include "core/css/MediaQuery.h"
-#include "core/css/WebKitCSSFilterValue.h"
#include "core/page/UseCounter.h"
#include "core/platform/graphics/Color.h"
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/OwnArrayPtr.h>
-#include <wtf/text/AtomicString.h>
-#include <wtf/Vector.h>
+#include "wtf/HashMap.h"
+#include "wtf/HashSet.h"
+#include "wtf/OwnArrayPtr.h"
+#include "wtf/Vector.h"
+#include "wtf/text/AtomicString.h"
namespace WebCore {
class AnimationParseContext;
+class CSSArrayFunctionValue;
class CSSBorderImageSliceValue;
+class CSSMixFunctionValue;
class CSSPrimitiveValue;
class CSSSelectorList;
+class CSSShaderValue;
class CSSValue;
class CSSValueList;
class CSSBasicShape;
@@ -64,10 +68,6 @@
class StyleSheetContents;
class StyledElement;
-class WebKitCSSArrayFunctionValue;
-class WebKitCSSMixFunctionValue;
-class WebKitCSSShaderValue;
-
struct CSSParserLocation;
class CSSParser {
@@ -98,7 +98,7 @@
static bool parseColor(RGBA32& color, const String&, bool strict = false);
static bool parseSystemColor(RGBA32& color, const String&, Document*);
static PassRefPtr<CSSValueList> parseFontFaceValue(const AtomicString&);
- PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(int ident, CSSParserValue*);
+ PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(CSSValueID ident, CSSParserValue*);
bool parseDeclaration(MutableStylePropertySet*, const String&, SourceDataHandler*, StyleSheetContents* contextStyleSheet);
static PassRefPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(const String&, Element*);
PassOwnPtr<MediaQuery> parseMediaQuery(const String&);
@@ -177,6 +177,7 @@
PassRefPtr<CSSBasicShape> parseBasicShapeCircle(CSSParserValueList* args);
PassRefPtr<CSSBasicShape> parseBasicShapeEllipse(CSSParserValueList* args);
PassRefPtr<CSSBasicShape> parseBasicShapePolygon(CSSParserValueList* args);
+ PassRefPtr<CSSBasicShape> parseBasicShapeInsetRectangle(CSSParserValueList* args);
bool parseFont(bool important);
PassRefPtr<CSSValueList> parseFontFamily();
@@ -235,19 +236,19 @@
PassRefPtr<CSSValue> parseImageSet(CSSParserValueList*);
PassRefPtr<CSSValueList> parseFilter();
- PassRefPtr<WebKitCSSFilterValue> parseBuiltinFilterArguments(CSSParserValueList*, WebKitCSSFilterValue::FilterOperationType);
- PassRefPtr<WebKitCSSMixFunctionValue> parseMixFunction(CSSParserValue*);
- PassRefPtr<WebKitCSSArrayFunctionValue> parseCustomFilterArrayFunction(CSSParserValue*);
+ PassRefPtr<CSSFilterValue> parseBuiltinFilterArguments(CSSParserValueList*, CSSFilterValue::FilterOperationType);
+ PassRefPtr<CSSMixFunctionValue> parseMixFunction(CSSParserValue*);
+ PassRefPtr<CSSArrayFunctionValue> parseCustomFilterArrayFunction(CSSParserValue*);
PassRefPtr<CSSValueList> parseCustomFilterTransform(CSSParserValueList*);
PassRefPtr<CSSValueList> parseCustomFilterParameters(CSSParserValueList*);
- PassRefPtr<WebKitCSSFilterValue> parseCustomFilterFunctionWithAtRuleReferenceSyntax(CSSParserValue*);
- PassRefPtr<WebKitCSSFilterValue> parseCustomFilterFunctionWithInlineSyntax(CSSParserValue*);
- PassRefPtr<WebKitCSSFilterValue> parseCustomFilterFunction(CSSParserValue*);
+ PassRefPtr<CSSFilterValue> parseCustomFilterFunctionWithAtRuleReferenceSyntax(CSSParserValue*);
+ PassRefPtr<CSSFilterValue> parseCustomFilterFunctionWithInlineSyntax(CSSParserValue*);
+ PassRefPtr<CSSFilterValue> parseCustomFilterFunction(CSSParserValue*);
bool parseFilterRuleSrc();
- PassRefPtr<WebKitCSSShaderValue> parseFilterRuleSrcUriAndFormat(CSSParserValueList*);
+ PassRefPtr<CSSShaderValue> parseFilterRuleSrcUriAndFormat(CSSParserValueList*);
- static bool isBlendMode(int ident);
- static bool isCompositeOperator(int ident);
+ static bool isBlendMode(CSSValueID);
+ static bool isCompositeOperator(CSSValueID);
PassRefPtr<CSSValueList> parseTransform();
PassRefPtr<CSSValue> parseTransformValue(CSSParserValue*);
@@ -320,6 +321,7 @@
PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > > sinkFloatingMediaQueryExpList(Vector<OwnPtr<MediaQueryExp> >*);
MediaQuery* createFloatingMediaQuery(MediaQuery::Restrictor, const String&, PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > >);
MediaQuery* createFloatingMediaQuery(PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > >);
+ MediaQuery* createFloatingNotAllQuery();
PassOwnPtr<MediaQuery> sinkFloatingMediaQuery(MediaQuery*);
Vector<RefPtr<StyleKeyframe> >* createFloatingKeyframeVector();
@@ -664,7 +666,7 @@
CSSPropertyID cssPropertyID(const CSSParserString&);
CSSPropertyID cssPropertyID(const String&);
-int cssValueKeywordID(const CSSParserString&);
+CSSValueID cssValueKeywordID(const CSSParserString&);
class ShorthandScope {
WTF_MAKE_FAST_ALLOCATED;
diff --git a/Source/core/css/CSSParserMode.h b/Source/core/css/CSSParserMode.h
index 4ca5f54..0a0c106 100644
--- a/Source/core/css/CSSParserMode.h
+++ b/Source/core/css/CSSParserMode.h
@@ -41,7 +41,10 @@
CSSQuirksMode,
CSSStrictMode,
// SVG should always be in strict mode. For SVG attributes, the rules differ to strict sometimes.
- SVGAttributeMode
+ SVGAttributeMode,
+ // User agent style sheet should always be in strict mode. Enables internal
+ // only properties and values.
+ UASheetMode
};
inline CSSParserMode strictToCSSParserMode(bool inStrictMode)
@@ -51,7 +54,7 @@
inline bool isStrictParserMode(CSSParserMode cssParserMode)
{
- return cssParserMode == CSSStrictMode || cssParserMode == SVGAttributeMode;
+ return cssParserMode == CSSStrictMode || cssParserMode == SVGAttributeMode || cssParserMode == UASheetMode;
}
struct CSSParserContext {
diff --git a/Source/core/css/CSSParserValues.cpp b/Source/core/css/CSSParserValues.cpp
index de470d5..de0364b 100644
--- a/Source/core/css/CSSParserValues.cpp
+++ b/Source/core/css/CSSParserValues.cpp
@@ -67,7 +67,7 @@
return CSSPrimitiveValue::createIdentifier(id);
if (unit == CSSParserValue::Operator) {
- RefPtr<CSSPrimitiveValue> primitiveValue = CSSPrimitiveValue::createIdentifier(iValue);
+ RefPtr<CSSPrimitiveValue> primitiveValue = CSSPrimitiveValue::createParserOperator(iValue);
primitiveValue->setPrimitiveType(CSSPrimitiveValue::CSS_PARSER_OPERATOR);
return primitiveValue;
}
@@ -79,6 +79,8 @@
CSSPrimitiveValue::UnitTypes primitiveUnit = static_cast<CSSPrimitiveValue::UnitTypes>(unit);
switch (primitiveUnit) {
case CSSPrimitiveValue::CSS_IDENT:
+ case CSSPrimitiveValue::CSS_PROPERTY_ID:
+ case CSSPrimitiveValue::CSS_VALUE_ID:
return CSSPrimitiveValue::create(string, CSSPrimitiveValue::CSS_PARSER_IDENTIFIER);
case CSSPrimitiveValue::CSS_NUMBER:
return CSSPrimitiveValue::create(fValue, isInt ? CSSPrimitiveValue::CSS_PARSER_INTEGER : CSSPrimitiveValue::CSS_NUMBER);
@@ -147,6 +149,7 @@
CSSParserSelector::CSSParserSelector(const QualifiedName& tagQName)
: m_selector(adoptPtr(new CSSSelector(tagQName)))
+ , m_functionArgumentSelector(0)
{
}
diff --git a/Source/core/css/CSSParserValues.h b/Source/core/css/CSSParserValues.h
index 46c0c3d..7d90ef4 100644
--- a/Source/core/css/CSSParserValues.h
+++ b/Source/core/css/CSSParserValues.h
@@ -21,11 +21,12 @@
#ifndef CSSParserValues_h
#define CSSParserValues_h
+#include "CSSValueKeywords.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSSelector.h"
#include "core/css/CSSValueList.h"
-#include <wtf/text/AtomicString.h>
-#include <wtf/text/WTFString.h>
+#include "wtf/text/AtomicString.h"
+#include "wtf/text/WTFString.h"
namespace WebCore {
@@ -126,7 +127,7 @@
struct CSSParserFunction;
struct CSSParserValue {
- int id;
+ CSSValueID id;
bool isInt;
union {
double fValue;
@@ -239,7 +240,7 @@
inline void CSSParserValue::setFromNumber(double value, int unit)
{
- id = 0;
+ id = CSSValueInvalid;
isInt = false;
fValue = value;
this->unit = unit;
diff --git a/Source/core/css/CSSPrimitiveValue.cpp b/Source/core/css/CSSPrimitiveValue.cpp
index 13db75e..ddcf81a 100644
--- a/Source/core/css/CSSPrimitiveValue.cpp
+++ b/Source/core/css/CSSPrimitiveValue.cpp
@@ -93,6 +93,8 @@
case CSSPrimitiveValue::CSS_COUNTER:
case CSSPrimitiveValue::CSS_COUNTER_NAME:
case CSSPrimitiveValue::CSS_IDENT:
+ case CSSPrimitiveValue::CSS_PROPERTY_ID:
+ case CSSPrimitiveValue::CSS_VALUE_ID:
case CSSPrimitiveValue::CSS_PAIR:
case CSSPrimitiveValue::CSS_PARSER_HEXCOLOR:
case CSSPrimitiveValue::CSS_PARSER_IDENTIFIER:
@@ -164,6 +166,9 @@
unsigned short CSSPrimitiveValue::primitiveType() const
{
+ if (m_primitiveUnitType == CSS_PROPERTY_ID || m_primitiveUnitType == CSS_VALUE_ID)
+ return CSS_IDENT;
+
if (m_primitiveUnitType != CSSPrimitiveValue::CSS_CALC)
return m_primitiveUnitType;
@@ -186,30 +191,51 @@
return CSSPrimitiveValue::CSS_UNKNOWN;
}
-static const AtomicString& valueOrPropertyName(int valueOrPropertyID)
+static const AtomicString& propertyName(CSSPropertyID propertyID)
{
- ASSERT_ARG(valueOrPropertyID, valueOrPropertyID >= 0);
- ASSERT_ARG(valueOrPropertyID, valueOrPropertyID < numCSSValueKeywords || (valueOrPropertyID >= firstCSSProperty && valueOrPropertyID < firstCSSProperty + numCSSProperties));
+ ASSERT_ARG(propertyID, propertyID >= 0);
+ ASSERT_ARG(propertyID, (propertyID >= firstCSSProperty && propertyID < firstCSSProperty + numCSSProperties));
- if (valueOrPropertyID < 0)
+ if (propertyID < 0)
return nullAtom;
- if (valueOrPropertyID < numCSSValueKeywords) {
- static AtomicString* keywordStrings = new AtomicString[numCSSValueKeywords]; // Leaked intentionally.
- AtomicString& keywordString = keywordStrings[valueOrPropertyID];
- if (keywordString.isNull())
- keywordString = getValueName(valueOrPropertyID);
- return keywordString;
- }
-
- return getPropertyNameAtomicString(static_cast<CSSPropertyID>(valueOrPropertyID));
+ return getPropertyNameAtomicString(propertyID);
}
-CSSPrimitiveValue::CSSPrimitiveValue(int ident)
+static const AtomicString& valueName(CSSValueID valueID)
+{
+ ASSERT_ARG(valueID, valueID >= 0);
+ ASSERT_ARG(valueID, valueID < numCSSValueKeywords);
+
+ if (valueID < 0)
+ return nullAtom;
+
+ static AtomicString* keywordStrings = new AtomicString[numCSSValueKeywords]; // Leaked intentionally.
+ AtomicString& keywordString = keywordStrings[valueID];
+ if (keywordString.isNull())
+ keywordString = getValueName(valueID);
+ return keywordString;
+}
+
+CSSPrimitiveValue::CSSPrimitiveValue(CSSValueID valueID)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
- m_value.ident = ident;
+ m_primitiveUnitType = CSS_VALUE_ID;
+ m_value.valueID = valueID;
+}
+
+CSSPrimitiveValue::CSSPrimitiveValue(CSSPropertyID propertyID)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_PROPERTY_ID;
+ m_value.propertyID = propertyID;
+}
+
+CSSPrimitiveValue::CSSPrimitiveValue(int parserOperator)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_PARSER_OPERATOR;
+ m_value.parserOperator = parserOperator;
}
CSSPrimitiveValue::CSSPrimitiveValue(double num, UnitTypes type)
@@ -241,36 +267,36 @@
{
switch (length.type()) {
case Auto:
- m_primitiveUnitType = CSS_IDENT;
- m_value.ident = CSSValueAuto;
+ m_primitiveUnitType = CSS_VALUE_ID;
+ m_value.valueID = CSSValueAuto;
break;
case WebCore::Fixed:
m_primitiveUnitType = CSS_PX;
m_value.num = length.value();
break;
case Intrinsic:
- m_primitiveUnitType = CSS_IDENT;
- m_value.ident = CSSValueIntrinsic;
+ m_primitiveUnitType = CSS_VALUE_ID;
+ m_value.valueID = CSSValueIntrinsic;
break;
case MinIntrinsic:
- m_primitiveUnitType = CSS_IDENT;
- m_value.ident = CSSValueMinIntrinsic;
+ m_primitiveUnitType = CSS_VALUE_ID;
+ m_value.valueID = CSSValueMinIntrinsic;
break;
case MinContent:
- m_primitiveUnitType = CSS_IDENT;
- m_value.ident = CSSValueWebkitMinContent;
+ m_primitiveUnitType = CSS_VALUE_ID;
+ m_value.valueID = CSSValueWebkitMinContent;
break;
case MaxContent:
- m_primitiveUnitType = CSS_IDENT;
- m_value.ident = CSSValueWebkitMaxContent;
+ m_primitiveUnitType = CSS_VALUE_ID;
+ m_value.valueID = CSSValueWebkitMaxContent;
break;
case FillAvailable:
- m_primitiveUnitType = CSS_IDENT;
- m_value.ident = CSSValueWebkitFillAvailable;
+ m_primitiveUnitType = CSS_VALUE_ID;
+ m_value.valueID = CSSValueWebkitFillAvailable;
break;
case FitContent:
- m_primitiveUnitType = CSS_IDENT;
- m_value.ident = CSSValueWebkitFitContent;
+ m_primitiveUnitType = CSS_VALUE_ID;
+ m_value.valueID = CSSValueWebkitFitContent;
break;
case Percent:
m_primitiveUnitType = CSS_PERCENTAGE;
@@ -418,6 +444,8 @@
case CSS_UNICODE_RANGE:
case CSS_PARSER_OPERATOR:
case CSS_PARSER_IDENTIFIER:
+ case CSS_PROPERTY_ID:
+ case CSS_VALUE_ID:
break;
}
m_primitiveUnitType = 0;
@@ -725,8 +753,10 @@
case CSS_URI:
case CSS_VARIABLE_NAME:
return m_value.string;
- case CSS_IDENT:
- return valueOrPropertyName(m_value.ident);
+ case CSS_VALUE_ID:
+ return valueName(m_value.valueID);
+ case CSS_PROPERTY_ID:
+ return propertyName(m_value.propertyID);
default:
ec = INVALID_ACCESS_ERR;
break;
@@ -743,8 +773,10 @@
case CSS_URI:
case CSS_VARIABLE_NAME:
return m_value.string;
- case CSS_IDENT:
- return valueOrPropertyName(m_value.ident);
+ case CSS_VALUE_ID:
+ return valueName(m_value.valueID);
+ case CSS_PROPERTY_ID:
+ return propertyName(m_value.propertyID);
default:
break;
}
@@ -922,8 +954,11 @@
case CSS_URI:
text = "url(" + quoteCSSURLIfNeeded(m_value.string) + ")";
break;
- case CSS_IDENT:
- text = valueOrPropertyName(m_value.ident);
+ case CSS_VALUE_ID:
+ text = valueName(m_value.valueID);
+ break;
+ case CSS_PROPERTY_ID:
+ text = propertyName(m_value.propertyID);
break;
case CSS_ATTR: {
StringBuilder result;
@@ -1005,7 +1040,7 @@
text = getPairValue()->cssText();
break;
case CSS_PARSER_OPERATOR: {
- char c = static_cast<char>(m_value.ident);
+ char c = static_cast<char>(m_value.parserOperator);
text = String(&c, 1U);
break;
}
@@ -1164,8 +1199,11 @@
case CSS_DPCM:
result = CSSPrimitiveValue::create(m_value.num, static_cast<UnitTypes>(m_primitiveUnitType));
break;
- case CSS_IDENT:
- result = CSSPrimitiveValue::createIdentifier(m_value.ident);
+ case CSS_PROPERTY_ID:
+ result = CSSPrimitiveValue::createIdentifier(m_value.propertyID);
+ break;
+ case CSS_VALUE_ID:
+ result = CSSPrimitiveValue::createIdentifier(m_value.valueID);
break;
case CSS_RGBCOLOR:
result = CSSPrimitiveValue::createColor(m_value.rgbcolor);
@@ -1221,8 +1259,10 @@
case CSS_VMAX:
case CSS_DIMENSION:
return m_value.num == other.m_value.num;
- case CSS_IDENT:
- return valueOrPropertyName(m_value.ident) == valueOrPropertyName(other.m_value.ident);
+ case CSS_PROPERTY_ID:
+ return propertyName(m_value.propertyID) == propertyName(other.m_value.propertyID);
+ case CSS_VALUE_ID:
+ return valueName(m_value.valueID) == valueName(other.m_value.valueID);
case CSS_STRING:
case CSS_URI:
case CSS_ATTR:
@@ -1242,7 +1282,7 @@
case CSS_PAIR:
return m_value.pair && other.m_value.pair && m_value.pair->equals(*other.m_value.pair);
case CSS_PARSER_OPERATOR:
- return m_value.ident == other.m_value.ident;
+ return m_value.valueID == other.m_value.valueID;
case CSS_CALC:
return m_value.calc && other.m_value.calc && m_value.calc->equals(*other.m_value.calc);
case CSS_SHAPE:
diff --git a/Source/core/css/CSSPrimitiveValue.h b/Source/core/css/CSSPrimitiveValue.h
index 2284218..f3a350b 100644
--- a/Source/core/css/CSSPrimitiveValue.h
+++ b/Source/core/css/CSSPrimitiveValue.h
@@ -22,11 +22,13 @@
#ifndef CSSPrimitiveValue_h
#define CSSPrimitiveValue_h
+#include "CSSPropertyNames.h"
+#include "CSSValueKeywords.h"
#include "core/css/CSSValue.h"
#include "core/platform/graphics/Color.h"
-#include <wtf/Forward.h>
-#include <wtf/MathExtras.h>
-#include <wtf/PassRefPtr.h>
+#include "wtf/Forward.h"
+#include "wtf/MathExtras.h"
+#include "wtf/PassRefPtr.h"
namespace WebCore {
@@ -128,6 +130,9 @@
CSS_CALC_PERCENTAGE_WITH_NUMBER = 114,
CSS_CALC_PERCENTAGE_WITH_LENGTH = 115,
CSS_VARIABLE_NAME = 116,
+
+ CSS_PROPERTY_ID = 117,
+ CSS_VALUE_ID = 118
};
// This enum follows the CSSParser::Units enum augmented with UNIT_FREQUENCY for frequencies.
@@ -160,7 +165,6 @@
|| m_primitiveUnitType == CSS_REMS
|| m_primitiveUnitType == CSS_CHS;
}
- bool isIdent() const { return m_primitiveUnitType == CSS_IDENT; }
bool isLength() const
{
unsigned short type = primitiveType();
@@ -189,8 +193,11 @@
bool isVariableName() const { return primitiveType() == CSS_VARIABLE_NAME; }
bool isViewportPercentageLength() const { return m_primitiveUnitType >= CSS_VW && m_primitiveUnitType <= CSS_VMAX; }
bool isFlex() const { return primitiveType() == CSS_FR; }
+ bool isValueID() const { return m_primitiveUnitType == CSS_VALUE_ID; }
- static PassRefPtr<CSSPrimitiveValue> createIdentifier(int identifier) { return adoptRef(new CSSPrimitiveValue(identifier)); }
+ static PassRefPtr<CSSPrimitiveValue> createIdentifier(CSSValueID valueID) { return adoptRef(new CSSPrimitiveValue(valueID)); }
+ static PassRefPtr<CSSPrimitiveValue> createIdentifier(CSSPropertyID propertyID) { return adoptRef(new CSSPrimitiveValue(propertyID)); }
+ static PassRefPtr<CSSPrimitiveValue> createParserOperator(int parserOperator) { return adoptRef(new CSSPrimitiveValue(parserOperator)); }
static PassRefPtr<CSSPrimitiveValue> createColor(unsigned rgbValue) { return adoptRef(new CSSPrimitiveValue(rgbValue)); }
static PassRefPtr<CSSPrimitiveValue> create(double value, UnitTypes type) { return adoptRef(new CSSPrimitiveValue(value, type)); }
static PassRefPtr<CSSPrimitiveValue> create(const String& value, UnitTypes type) { return adoptRef(new CSSPrimitiveValue(value, type)); }
@@ -292,7 +299,8 @@
CSSCalcValue* cssCalcValue() const { return m_primitiveUnitType != CSS_CALC ? 0 : m_value.calc; }
- int getIdent() const { return m_primitiveUnitType == CSS_IDENT ? m_value.ident : 0; }
+ CSSPropertyID getPropertyID() const { return m_primitiveUnitType == CSS_PROPERTY_ID ? m_value.propertyID : CSSPropertyInvalid; }
+ CSSValueID getValueID() const { return m_primitiveUnitType == CSS_VALUE_ID ? m_value.valueID : CSSValueInvalid; }
template<typename T> inline operator T() const; // Defined in CSSPrimitiveValueMappings.h
@@ -314,8 +322,10 @@
void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
private:
- // FIXME: int vs. unsigned overloading is too subtle to distinguish the color and identifier cases.
- CSSPrimitiveValue(int ident);
+ CSSPrimitiveValue(CSSValueID);
+ CSSPrimitiveValue(CSSPropertyID);
+ // FIXME: int vs. unsigned overloading is too subtle to distinguish the color and operator cases.
+ CSSPrimitiveValue(int parserOperator);
CSSPrimitiveValue(unsigned color); // RGB value
CSSPrimitiveValue(const Length&);
CSSPrimitiveValue(const String&, UnitTypes);
@@ -351,7 +361,9 @@
double computeLengthDouble(RenderStyle* currentStyle, RenderStyle* rootStyle, float multiplier, bool computingFontSize);
union {
- int ident;
+ CSSPropertyID propertyID;
+ CSSValueID valueID;
+ int parserOperator;
double num;
StringImpl* string;
Counter* counter;
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h
index 2b335bb..0e1e9fa 100644
--- a/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/Source/core/css/CSSPrimitiveValueMappings.h
@@ -34,7 +34,6 @@
#include "core/css/CSSCalculationValue.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSReflectionDirection.h"
-#include "core/platform/graphics/ColorSpace.h"
#include "core/platform/graphics/FontDescription.h"
#include "core/platform/graphics/FontSmoothingMode.h"
#include "core/platform/graphics/GraphicsTypes.h"
@@ -142,25 +141,25 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CSSReflectionDirection e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case ReflectionAbove:
- m_value.ident = CSSValueAbove;
+ m_value.valueID = CSSValueAbove;
break;
case ReflectionBelow:
- m_value.ident = CSSValueBelow;
+ m_value.valueID = CSSValueBelow;
break;
case ReflectionLeft:
- m_value.ident = CSSValueLeft;
+ m_value.valueID = CSSValueLeft;
break;
case ReflectionRight:
- m_value.ident = CSSValueRight;
+ m_value.valueID = CSSValueRight;
}
}
template<> inline CSSPrimitiveValue::operator CSSReflectionDirection() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAbove:
return ReflectionAbove;
case CSSValueBelow:
@@ -169,6 +168,8 @@
return ReflectionLeft;
case CSSValueRight:
return ReflectionRight;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -178,13 +179,13 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColumnSpan columnSpan)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (columnSpan) {
case ColumnSpanAll:
- m_value.ident = CSSValueAll;
+ m_value.valueID = CSSValueAll;
break;
case ColumnSpanNone:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
}
}
@@ -195,11 +196,13 @@
if (m_primitiveUnitType == CSS_NUMBER && m_value.num == 1)
return ColumnSpanNone;
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAll:
return ColumnSpanAll;
case CSSValueNone:
return ColumnSpanNone;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -210,24 +213,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(PrintColorAdjust value)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (value) {
case PrintColorAdjustExact:
- m_value.ident = CSSValueExact;
+ m_value.valueID = CSSValueExact;
break;
case PrintColorAdjustEconomy:
- m_value.ident = CSSValueEconomy;
+ m_value.valueID = CSSValueEconomy;
break;
}
}
template<> inline CSSPrimitiveValue::operator PrintColorAdjust() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueEconomy:
return PrintColorAdjustEconomy;
case CSSValueExact:
return PrintColorAdjustExact;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -238,51 +243,51 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBorderStyle e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case BNONE:
- m_value.ident = CSSValueNone;
- break;
- case BHIDDEN:
- m_value.ident = CSSValueHidden;
- break;
- case INSET:
- m_value.ident = CSSValueInset;
- break;
- case GROOVE:
- m_value.ident = CSSValueGroove;
- break;
- case RIDGE:
- m_value.ident = CSSValueRidge;
- break;
- case OUTSET:
- m_value.ident = CSSValueOutset;
- break;
- case DOTTED:
- m_value.ident = CSSValueDotted;
- break;
- case DASHED:
- m_value.ident = CSSValueDashed;
- break;
- case SOLID:
- m_value.ident = CSSValueSolid;
- break;
- case DOUBLE:
- m_value.ident = CSSValueDouble;
- break;
+ case BNONE:
+ m_value.valueID = CSSValueNone;
+ break;
+ case BHIDDEN:
+ m_value.valueID = CSSValueHidden;
+ break;
+ case INSET:
+ m_value.valueID = CSSValueInset;
+ break;
+ case GROOVE:
+ m_value.valueID = CSSValueGroove;
+ break;
+ case RIDGE:
+ m_value.valueID = CSSValueRidge;
+ break;
+ case OUTSET:
+ m_value.valueID = CSSValueOutset;
+ break;
+ case DOTTED:
+ m_value.valueID = CSSValueDotted;
+ break;
+ case DASHED:
+ m_value.valueID = CSSValueDashed;
+ break;
+ case SOLID:
+ m_value.valueID = CSSValueSolid;
+ break;
+ case DOUBLE:
+ m_value.valueID = CSSValueDouble;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EBorderStyle() const
{
- if (m_value.ident == CSSValueAuto) // Valid for CSS outline-style
+ if (m_value.valueID == CSSValueAuto) // Valid for CSS outline-style
return DOTTED;
- return (EBorderStyle)(m_value.ident - CSSValueNone);
+ return (EBorderStyle)(m_value.valueID - CSSValueNone);
}
template<> inline CSSPrimitiveValue::operator OutlineIsAuto() const
{
- if (m_value.ident == CSSValueAuto)
+ if (m_value.valueID == CSSValueAuto)
return AUTO_ON;
return AUTO_OFF;
}
@@ -290,82 +295,84 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CompositeOperator e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case CompositeClear:
- m_value.ident = CSSValueClear;
- break;
- case CompositeCopy:
- m_value.ident = CSSValueCopy;
- break;
- case CompositeSourceOver:
- m_value.ident = CSSValueSourceOver;
- break;
- case CompositeSourceIn:
- m_value.ident = CSSValueSourceIn;
- break;
- case CompositeSourceOut:
- m_value.ident = CSSValueSourceOut;
- break;
- case CompositeSourceAtop:
- m_value.ident = CSSValueSourceAtop;
- break;
- case CompositeDestinationOver:
- m_value.ident = CSSValueDestinationOver;
- break;
- case CompositeDestinationIn:
- m_value.ident = CSSValueDestinationIn;
- break;
- case CompositeDestinationOut:
- m_value.ident = CSSValueDestinationOut;
- break;
- case CompositeDestinationAtop:
- m_value.ident = CSSValueDestinationAtop;
- break;
- case CompositeXOR:
- m_value.ident = CSSValueXor;
- break;
- case CompositePlusDarker:
- m_value.ident = CSSValuePlusDarker;
- break;
- case CompositePlusLighter:
- m_value.ident = CSSValuePlusLighter;
- break;
- case CompositeDifference:
- ASSERT_NOT_REACHED();
- break;
+ case CompositeClear:
+ m_value.valueID = CSSValueClear;
+ break;
+ case CompositeCopy:
+ m_value.valueID = CSSValueCopy;
+ break;
+ case CompositeSourceOver:
+ m_value.valueID = CSSValueSourceOver;
+ break;
+ case CompositeSourceIn:
+ m_value.valueID = CSSValueSourceIn;
+ break;
+ case CompositeSourceOut:
+ m_value.valueID = CSSValueSourceOut;
+ break;
+ case CompositeSourceAtop:
+ m_value.valueID = CSSValueSourceAtop;
+ break;
+ case CompositeDestinationOver:
+ m_value.valueID = CSSValueDestinationOver;
+ break;
+ case CompositeDestinationIn:
+ m_value.valueID = CSSValueDestinationIn;
+ break;
+ case CompositeDestinationOut:
+ m_value.valueID = CSSValueDestinationOut;
+ break;
+ case CompositeDestinationAtop:
+ m_value.valueID = CSSValueDestinationAtop;
+ break;
+ case CompositeXOR:
+ m_value.valueID = CSSValueXor;
+ break;
+ case CompositePlusDarker:
+ m_value.valueID = CSSValuePlusDarker;
+ break;
+ case CompositePlusLighter:
+ m_value.valueID = CSSValuePlusLighter;
+ break;
+ case CompositeDifference:
+ ASSERT_NOT_REACHED();
+ break;
}
}
template<> inline CSSPrimitiveValue::operator CompositeOperator() const
{
- switch (m_value.ident) {
- case CSSValueClear:
- return CompositeClear;
- case CSSValueCopy:
- return CompositeCopy;
- case CSSValueSourceOver:
- return CompositeSourceOver;
- case CSSValueSourceIn:
- return CompositeSourceIn;
- case CSSValueSourceOut:
- return CompositeSourceOut;
- case CSSValueSourceAtop:
- return CompositeSourceAtop;
- case CSSValueDestinationOver:
- return CompositeDestinationOver;
- case CSSValueDestinationIn:
- return CompositeDestinationIn;
- case CSSValueDestinationOut:
- return CompositeDestinationOut;
- case CSSValueDestinationAtop:
- return CompositeDestinationAtop;
- case CSSValueXor:
- return CompositeXOR;
- case CSSValuePlusDarker:
- return CompositePlusDarker;
- case CSSValuePlusLighter:
- return CompositePlusLighter;
+ switch (m_value.valueID) {
+ case CSSValueClear:
+ return CompositeClear;
+ case CSSValueCopy:
+ return CompositeCopy;
+ case CSSValueSourceOver:
+ return CompositeSourceOver;
+ case CSSValueSourceIn:
+ return CompositeSourceIn;
+ case CSSValueSourceOut:
+ return CompositeSourceOut;
+ case CSSValueSourceAtop:
+ return CompositeSourceAtop;
+ case CSSValueDestinationOver:
+ return CompositeDestinationOver;
+ case CSSValueDestinationIn:
+ return CompositeDestinationIn;
+ case CSSValueDestinationOut:
+ return CompositeDestinationOut;
+ case CSSValueDestinationAtop:
+ return CompositeDestinationAtop;
+ case CSSValueXor:
+ return CompositeXOR;
+ case CSSValuePlusDarker:
+ return CompositePlusDarker;
+ case CSSValuePlusLighter:
+ return CompositePlusLighter;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -375,210 +382,211 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case NoControlPart:
- m_value.ident = CSSValueNone;
- break;
- case CheckboxPart:
- m_value.ident = CSSValueCheckbox;
- break;
- case RadioPart:
- m_value.ident = CSSValueRadio;
- break;
- case PushButtonPart:
- m_value.ident = CSSValuePushButton;
- break;
- case SquareButtonPart:
- m_value.ident = CSSValueSquareButton;
- break;
- case ButtonPart:
- m_value.ident = CSSValueButton;
- break;
- case ButtonBevelPart:
- m_value.ident = CSSValueButtonBevel;
- break;
- case InnerSpinButtonPart:
- m_value.ident = CSSValueInnerSpinButton;
- break;
- case ListboxPart:
- m_value.ident = CSSValueListbox;
- break;
- case ListItemPart:
- m_value.ident = CSSValueListitem;
- break;
- case MediaEnterFullscreenButtonPart:
- m_value.ident = CSSValueMediaEnterFullscreenButton;
- break;
- case MediaExitFullscreenButtonPart:
- m_value.ident = CSSValueMediaExitFullscreenButton;
- break;
- case MediaPlayButtonPart:
- m_value.ident = CSSValueMediaPlayButton;
- break;
- case MediaOverlayPlayButtonPart:
- m_value.ident = CSSValueMediaOverlayPlayButton;
- break;
- case MediaMuteButtonPart:
- m_value.ident = CSSValueMediaMuteButton;
- break;
- case MediaSeekBackButtonPart:
- m_value.ident = CSSValueMediaSeekBackButton;
- break;
- case MediaSeekForwardButtonPart:
- m_value.ident = CSSValueMediaSeekForwardButton;
- break;
- case MediaRewindButtonPart:
- m_value.ident = CSSValueMediaRewindButton;
- break;
- case MediaReturnToRealtimeButtonPart:
- m_value.ident = CSSValueMediaReturnToRealtimeButton;
- break;
- case MediaToggleClosedCaptionsButtonPart:
- m_value.ident = CSSValueMediaToggleClosedCaptionsButton;
- break;
- case MediaSliderPart:
- m_value.ident = CSSValueMediaSlider;
- break;
- case MediaSliderThumbPart:
- m_value.ident = CSSValueMediaSliderthumb;
- break;
- case MediaVolumeSliderContainerPart:
- m_value.ident = CSSValueMediaVolumeSliderContainer;
- break;
- case MediaVolumeSliderPart:
- m_value.ident = CSSValueMediaVolumeSlider;
- break;
- case MediaVolumeSliderMuteButtonPart:
- m_value.ident = CSSValueMediaVolumeSliderMuteButton;
- break;
- case MediaVolumeSliderThumbPart:
- m_value.ident = CSSValueMediaVolumeSliderthumb;
- break;
- case MediaControlsBackgroundPart:
- m_value.ident = CSSValueMediaControlsBackground;
- break;
- case MediaControlsFullscreenBackgroundPart:
- m_value.ident = CSSValueMediaControlsFullscreenBackground;
- break;
- case MediaFullScreenVolumeSliderPart:
- m_value.ident = CSSValueMediaFullscreenVolumeSlider;
- break;
- case MediaFullScreenVolumeSliderThumbPart:
- m_value.ident = CSSValueMediaFullscreenVolumeSliderThumb;
- break;
- case MediaCurrentTimePart:
- m_value.ident = CSSValueMediaCurrentTimeDisplay;
- break;
- case MediaTimeRemainingPart:
- m_value.ident = CSSValueMediaTimeRemainingDisplay;
- break;
- case MenulistPart:
- m_value.ident = CSSValueMenulist;
- break;
- case MenulistButtonPart:
- m_value.ident = CSSValueMenulistButton;
- break;
- case MenulistTextPart:
- m_value.ident = CSSValueMenulistText;
- break;
- case MenulistTextFieldPart:
- m_value.ident = CSSValueMenulistTextfield;
- break;
- case MeterPart:
- m_value.ident = CSSValueMeter;
- break;
- case RelevancyLevelIndicatorPart:
- m_value.ident = CSSValueRelevancyLevelIndicator;
- break;
- case ContinuousCapacityLevelIndicatorPart:
- m_value.ident = CSSValueContinuousCapacityLevelIndicator;
- break;
- case DiscreteCapacityLevelIndicatorPart:
- m_value.ident = CSSValueDiscreteCapacityLevelIndicator;
- break;
- case RatingLevelIndicatorPart:
- m_value.ident = CSSValueRatingLevelIndicator;
- break;
- case ProgressBarPart:
- m_value.ident = CSSValueProgressBar;
- break;
- case ProgressBarValuePart:
- m_value.ident = CSSValueProgressBarValue;
- break;
- case SliderHorizontalPart:
- m_value.ident = CSSValueSliderHorizontal;
- break;
- case SliderVerticalPart:
- m_value.ident = CSSValueSliderVertical;
- break;
- case SliderThumbHorizontalPart:
- m_value.ident = CSSValueSliderthumbHorizontal;
- break;
- case SliderThumbVerticalPart:
- m_value.ident = CSSValueSliderthumbVertical;
- break;
- case CaretPart:
- m_value.ident = CSSValueCaret;
- break;
- case SearchFieldPart:
- m_value.ident = CSSValueSearchfield;
- break;
- case SearchFieldDecorationPart:
- m_value.ident = CSSValueSearchfieldDecoration;
- break;
- case SearchFieldResultsDecorationPart:
- m_value.ident = CSSValueSearchfieldResultsDecoration;
- break;
- case SearchFieldCancelButtonPart:
- m_value.ident = CSSValueSearchfieldCancelButton;
- break;
- case TextFieldPart:
- m_value.ident = CSSValueTextfield;
- break;
- case TextAreaPart:
- m_value.ident = CSSValueTextarea;
- break;
- case CapsLockIndicatorPart:
- m_value.ident = CSSValueCapsLockIndicator;
- break;
- case InputSpeechButtonPart:
+ case NoControlPart:
+ m_value.valueID = CSSValueNone;
+ break;
+ case CheckboxPart:
+ m_value.valueID = CSSValueCheckbox;
+ break;
+ case RadioPart:
+ m_value.valueID = CSSValueRadio;
+ break;
+ case PushButtonPart:
+ m_value.valueID = CSSValuePushButton;
+ break;
+ case SquareButtonPart:
+ m_value.valueID = CSSValueSquareButton;
+ break;
+ case ButtonPart:
+ m_value.valueID = CSSValueButton;
+ break;
+ case ButtonBevelPart:
+ m_value.valueID = CSSValueButtonBevel;
+ break;
+ case InnerSpinButtonPart:
+ m_value.valueID = CSSValueInnerSpinButton;
+ break;
+ case ListboxPart:
+ m_value.valueID = CSSValueListbox;
+ break;
+ case ListItemPart:
+ m_value.valueID = CSSValueListitem;
+ break;
+ case MediaEnterFullscreenButtonPart:
+ m_value.valueID = CSSValueMediaEnterFullscreenButton;
+ break;
+ case MediaExitFullscreenButtonPart:
+ m_value.valueID = CSSValueMediaExitFullscreenButton;
+ break;
+ case MediaPlayButtonPart:
+ m_value.valueID = CSSValueMediaPlayButton;
+ break;
+ case MediaOverlayPlayButtonPart:
+ m_value.valueID = CSSValueMediaOverlayPlayButton;
+ break;
+ case MediaMuteButtonPart:
+ m_value.valueID = CSSValueMediaMuteButton;
+ break;
+ case MediaSeekBackButtonPart:
+ m_value.valueID = CSSValueMediaSeekBackButton;
+ break;
+ case MediaSeekForwardButtonPart:
+ m_value.valueID = CSSValueMediaSeekForwardButton;
+ break;
+ case MediaRewindButtonPart:
+ m_value.valueID = CSSValueMediaRewindButton;
+ break;
+ case MediaReturnToRealtimeButtonPart:
+ m_value.valueID = CSSValueMediaReturnToRealtimeButton;
+ break;
+ case MediaToggleClosedCaptionsButtonPart:
+ m_value.valueID = CSSValueMediaToggleClosedCaptionsButton;
+ break;
+ case MediaSliderPart:
+ m_value.valueID = CSSValueMediaSlider;
+ break;
+ case MediaSliderThumbPart:
+ m_value.valueID = CSSValueMediaSliderthumb;
+ break;
+ case MediaVolumeSliderContainerPart:
+ m_value.valueID = CSSValueMediaVolumeSliderContainer;
+ break;
+ case MediaVolumeSliderPart:
+ m_value.valueID = CSSValueMediaVolumeSlider;
+ break;
+ case MediaVolumeSliderMuteButtonPart:
+ m_value.valueID = CSSValueMediaVolumeSliderMuteButton;
+ break;
+ case MediaVolumeSliderThumbPart:
+ m_value.valueID = CSSValueMediaVolumeSliderthumb;
+ break;
+ case MediaControlsBackgroundPart:
+ m_value.valueID = CSSValueMediaControlsBackground;
+ break;
+ case MediaControlsFullscreenBackgroundPart:
+ m_value.valueID = CSSValueMediaControlsFullscreenBackground;
+ break;
+ case MediaFullScreenVolumeSliderPart:
+ m_value.valueID = CSSValueMediaFullscreenVolumeSlider;
+ break;
+ case MediaFullScreenVolumeSliderThumbPart:
+ m_value.valueID = CSSValueMediaFullscreenVolumeSliderThumb;
+ break;
+ case MediaCurrentTimePart:
+ m_value.valueID = CSSValueMediaCurrentTimeDisplay;
+ break;
+ case MediaTimeRemainingPart:
+ m_value.valueID = CSSValueMediaTimeRemainingDisplay;
+ break;
+ case MenulistPart:
+ m_value.valueID = CSSValueMenulist;
+ break;
+ case MenulistButtonPart:
+ m_value.valueID = CSSValueMenulistButton;
+ break;
+ case MenulistTextPart:
+ m_value.valueID = CSSValueMenulistText;
+ break;
+ case MenulistTextFieldPart:
+ m_value.valueID = CSSValueMenulistTextfield;
+ break;
+ case MeterPart:
+ m_value.valueID = CSSValueMeter;
+ break;
+ case RelevancyLevelIndicatorPart:
+ m_value.valueID = CSSValueRelevancyLevelIndicator;
+ break;
+ case ContinuousCapacityLevelIndicatorPart:
+ m_value.valueID = CSSValueContinuousCapacityLevelIndicator;
+ break;
+ case DiscreteCapacityLevelIndicatorPart:
+ m_value.valueID = CSSValueDiscreteCapacityLevelIndicator;
+ break;
+ case RatingLevelIndicatorPart:
+ m_value.valueID = CSSValueRatingLevelIndicator;
+ break;
+ case ProgressBarPart:
+ m_value.valueID = CSSValueProgressBar;
+ break;
+ case ProgressBarValuePart:
+ m_value.valueID = CSSValueProgressBarValue;
+ break;
+ case SliderHorizontalPart:
+ m_value.valueID = CSSValueSliderHorizontal;
+ break;
+ case SliderVerticalPart:
+ m_value.valueID = CSSValueSliderVertical;
+ break;
+ case SliderThumbHorizontalPart:
+ m_value.valueID = CSSValueSliderthumbHorizontal;
+ break;
+ case SliderThumbVerticalPart:
+ m_value.valueID = CSSValueSliderthumbVertical;
+ break;
+ case CaretPart:
+ m_value.valueID = CSSValueCaret;
+ break;
+ case SearchFieldPart:
+ m_value.valueID = CSSValueSearchfield;
+ break;
+ case SearchFieldDecorationPart:
+ m_value.valueID = CSSValueSearchfieldDecoration;
+ break;
+ case SearchFieldResultsDecorationPart:
+ m_value.valueID = CSSValueSearchfieldResultsDecoration;
+ break;
+ case SearchFieldCancelButtonPart:
+ m_value.valueID = CSSValueSearchfieldCancelButton;
+ break;
+ case TextFieldPart:
+ m_value.valueID = CSSValueTextfield;
+ break;
+ case TextAreaPart:
+ m_value.valueID = CSSValueTextarea;
+ break;
+ case CapsLockIndicatorPart:
+ m_value.valueID = CSSValueCapsLockIndicator;
+ break;
+ case InputSpeechButtonPart:
#if ENABLE(INPUT_SPEECH)
- m_value.ident = CSSValueWebkitInputSpeechButton;
+ m_value.valueID = CSSValueWebkitInputSpeechButton;
#endif
- break;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator ControlPart() const
{
- if (m_value.ident == CSSValueNone)
+ if (m_value.valueID == CSSValueNone)
return NoControlPart;
- else
- return ControlPart(m_value.ident - CSSValueCheckbox + 1);
+ return ControlPart(m_value.valueID - CSSValueCheckbox + 1);
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBackfaceVisibility e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case BackfaceVisibilityVisible:
- m_value.ident = CSSValueVisible;
+ m_value.valueID = CSSValueVisible;
break;
case BackfaceVisibilityHidden:
- m_value.ident = CSSValueHidden;
+ m_value.valueID = CSSValueHidden;
break;
}
}
template<> inline CSSPrimitiveValue::operator EBackfaceVisibility() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueVisible:
return BackfaceVisibilityVisible;
case CSSValueHidden:
return BackfaceVisibilityHidden;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -589,29 +597,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillAttachment e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case ScrollBackgroundAttachment:
- m_value.ident = CSSValueScroll;
- break;
- case LocalBackgroundAttachment:
- m_value.ident = CSSValueLocal;
- break;
- case FixedBackgroundAttachment:
- m_value.ident = CSSValueFixed;
- break;
+ case ScrollBackgroundAttachment:
+ m_value.valueID = CSSValueScroll;
+ break;
+ case LocalBackgroundAttachment:
+ m_value.valueID = CSSValueLocal;
+ break;
+ case FixedBackgroundAttachment:
+ m_value.valueID = CSSValueFixed;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EFillAttachment() const
{
- switch (m_value.ident) {
- case CSSValueScroll:
- return ScrollBackgroundAttachment;
- case CSSValueLocal:
- return LocalBackgroundAttachment;
- case CSSValueFixed:
- return FixedBackgroundAttachment;
+ switch (m_value.valueID) {
+ case CSSValueScroll:
+ return ScrollBackgroundAttachment;
+ case CSSValueLocal:
+ return LocalBackgroundAttachment;
+ case CSSValueFixed:
+ return FixedBackgroundAttachment;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -621,38 +631,40 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillBox e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case BorderFillBox:
- m_value.ident = CSSValueBorderBox;
- break;
- case PaddingFillBox:
- m_value.ident = CSSValuePaddingBox;
- break;
- case ContentFillBox:
- m_value.ident = CSSValueContentBox;
- break;
- case TextFillBox:
- m_value.ident = CSSValueText;
- break;
+ case BorderFillBox:
+ m_value.valueID = CSSValueBorderBox;
+ break;
+ case PaddingFillBox:
+ m_value.valueID = CSSValuePaddingBox;
+ break;
+ case ContentFillBox:
+ m_value.valueID = CSSValueContentBox;
+ break;
+ case TextFillBox:
+ m_value.valueID = CSSValueText;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EFillBox() const
{
- switch (m_value.ident) {
- case CSSValueBorder:
- case CSSValueBorderBox:
- return BorderFillBox;
- case CSSValuePadding:
- case CSSValuePaddingBox:
- return PaddingFillBox;
- case CSSValueContent:
- case CSSValueContentBox:
- return ContentFillBox;
- case CSSValueText:
- case CSSValueWebkitText:
- return TextFillBox;
+ switch (m_value.valueID) {
+ case CSSValueBorder:
+ case CSSValueBorderBox:
+ return BorderFillBox;
+ case CSSValuePadding:
+ case CSSValuePaddingBox:
+ return PaddingFillBox;
+ case CSSValueContent:
+ case CSSValueContentBox:
+ return ContentFillBox;
+ case CSSValueText:
+ case CSSValueWebkitText:
+ return TextFillBox;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -662,34 +674,36 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillRepeat e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case RepeatFill:
- m_value.ident = CSSValueRepeat;
- break;
- case NoRepeatFill:
- m_value.ident = CSSValueNoRepeat;
- break;
- case RoundFill:
- m_value.ident = CSSValueRound;
- break;
- case SpaceFill:
- m_value.ident = CSSValueSpace;
- break;
+ case RepeatFill:
+ m_value.valueID = CSSValueRepeat;
+ break;
+ case NoRepeatFill:
+ m_value.valueID = CSSValueNoRepeat;
+ break;
+ case RoundFill:
+ m_value.valueID = CSSValueRound;
+ break;
+ case SpaceFill:
+ m_value.valueID = CSSValueSpace;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EFillRepeat() const
{
- switch (m_value.ident) {
- case CSSValueRepeat:
- return RepeatFill;
- case CSSValueNoRepeat:
- return NoRepeatFill;
- case CSSValueRound:
- return RoundFill;
- case CSSValueSpace:
- return SpaceFill;
+ switch (m_value.valueID) {
+ case CSSValueRepeat:
+ return RepeatFill;
+ case CSSValueNoRepeat:
+ return NoRepeatFill;
+ case CSSValueRound:
+ return RoundFill;
+ case CSSValueSpace:
+ return SpaceFill;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -699,26 +713,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxPack e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case Start:
- m_value.ident = CSSValueStart;
+ m_value.valueID = CSSValueStart;
break;
case Center:
- m_value.ident = CSSValueCenter;
+ m_value.valueID = CSSValueCenter;
break;
case End:
- m_value.ident = CSSValueEnd;
+ m_value.valueID = CSSValueEnd;
break;
case Justify:
- m_value.ident = CSSValueJustify;
+ m_value.valueID = CSSValueJustify;
break;
}
}
template<> inline CSSPrimitiveValue::operator EBoxPack() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueStart:
return Start;
case CSSValueEnd:
@@ -727,6 +741,8 @@
return Center;
case CSSValueJustify:
return Justify;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -736,39 +752,41 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxAlignment e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case BSTRETCH:
- m_value.ident = CSSValueStretch;
- break;
- case BSTART:
- m_value.ident = CSSValueStart;
- break;
- case BCENTER:
- m_value.ident = CSSValueCenter;
- break;
- case BEND:
- m_value.ident = CSSValueEnd;
- break;
- case BBASELINE:
- m_value.ident = CSSValueBaseline;
- break;
+ case BSTRETCH:
+ m_value.valueID = CSSValueStretch;
+ break;
+ case BSTART:
+ m_value.valueID = CSSValueStart;
+ break;
+ case BCENTER:
+ m_value.valueID = CSSValueCenter;
+ break;
+ case BEND:
+ m_value.valueID = CSSValueEnd;
+ break;
+ case BBASELINE:
+ m_value.valueID = CSSValueBaseline;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EBoxAlignment() const
{
- switch (m_value.ident) {
- case CSSValueStretch:
- return BSTRETCH;
- case CSSValueStart:
- return BSTART;
- case CSSValueEnd:
- return BEND;
- case CSSValueCenter:
- return BCENTER;
- case CSSValueBaseline:
- return BBASELINE;
+ switch (m_value.valueID) {
+ case CSSValueStretch:
+ return BSTRETCH;
+ case CSSValueStart:
+ return BSTART;
+ case CSSValueEnd:
+ return BEND;
+ case CSSValueCenter:
+ return BCENTER;
+ case CSSValueBaseline:
+ return BBASELINE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -778,24 +796,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxDecorationBreak e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case DSLICE:
- m_value.ident = CSSValueSlice;
+ m_value.valueID = CSSValueSlice;
break;
case DCLONE:
- m_value.ident = CSSValueClone;
+ m_value.valueID = CSSValueClone;
break;
}
}
template<> inline CSSPrimitiveValue::operator EBoxDecorationBreak() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueSlice:
return DSLICE;
case CSSValueClone:
return DCLONE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -805,26 +825,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(BackgroundEdgeOrigin e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case TopEdge:
- m_value.ident = CSSValueTop;
+ m_value.valueID = CSSValueTop;
break;
case RightEdge:
- m_value.ident = CSSValueRight;
+ m_value.valueID = CSSValueRight;
break;
case BottomEdge:
- m_value.ident = CSSValueBottom;
+ m_value.valueID = CSSValueBottom;
break;
case LeftEdge:
- m_value.ident = CSSValueLeft;
+ m_value.valueID = CSSValueLeft;
break;
}
}
template<> inline CSSPrimitiveValue::operator BackgroundEdgeOrigin() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueTop:
return TopEdge;
case CSSValueRight:
@@ -833,6 +853,8 @@
return BottomEdge;
case CSSValueLeft:
return LeftEdge;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -842,24 +864,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxSizing e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case BORDER_BOX:
- m_value.ident = CSSValueBorderBox;
+ m_value.valueID = CSSValueBorderBox;
break;
case CONTENT_BOX:
- m_value.ident = CSSValueContentBox;
+ m_value.valueID = CSSValueContentBox;
break;
}
}
template<> inline CSSPrimitiveValue::operator EBoxSizing() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueBorderBox:
return BORDER_BOX;
case CSSValueContentBox:
return CONTENT_BOX;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -869,24 +893,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxDirection e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case BNORMAL:
- m_value.ident = CSSValueNormal;
- break;
- case BREVERSE:
- m_value.ident = CSSValueReverse;
- break;
+ case BNORMAL:
+ m_value.valueID = CSSValueNormal;
+ break;
+ case BREVERSE:
+ m_value.valueID = CSSValueReverse;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EBoxDirection() const
{
- switch (m_value.ident) {
- case CSSValueNormal:
- return BNORMAL;
- case CSSValueReverse:
- return BREVERSE;
+ switch (m_value.valueID) {
+ case CSSValueNormal:
+ return BNORMAL;
+ case CSSValueReverse:
+ return BREVERSE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -896,24 +922,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxLines e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case SINGLE:
- m_value.ident = CSSValueSingle;
- break;
- case MULTIPLE:
- m_value.ident = CSSValueMultiple;
- break;
+ case SINGLE:
+ m_value.valueID = CSSValueSingle;
+ break;
+ case MULTIPLE:
+ m_value.valueID = CSSValueMultiple;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EBoxLines() const
{
- switch (m_value.ident) {
- case CSSValueSingle:
- return SINGLE;
- case CSSValueMultiple:
- return MULTIPLE;
+ switch (m_value.valueID) {
+ case CSSValueSingle:
+ return SINGLE;
+ case CSSValueMultiple:
+ return MULTIPLE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -923,26 +951,28 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxOrient e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case HORIZONTAL:
- m_value.ident = CSSValueHorizontal;
- break;
- case VERTICAL:
- m_value.ident = CSSValueVertical;
- break;
+ case HORIZONTAL:
+ m_value.valueID = CSSValueHorizontal;
+ break;
+ case VERTICAL:
+ m_value.valueID = CSSValueVertical;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EBoxOrient() const
{
- switch (m_value.ident) {
- case CSSValueHorizontal:
- case CSSValueInlineAxis:
- return HORIZONTAL;
- case CSSValueVertical:
- case CSSValueBlockAxis:
- return VERTICAL;
+ switch (m_value.valueID) {
+ case CSSValueHorizontal:
+ case CSSValueInlineAxis:
+ return HORIZONTAL;
+ case CSSValueVertical:
+ case CSSValueBlockAxis:
+ return VERTICAL;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -952,34 +982,36 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECaptionSide e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case CAPLEFT:
- m_value.ident = CSSValueLeft;
- break;
- case CAPRIGHT:
- m_value.ident = CSSValueRight;
- break;
- case CAPTOP:
- m_value.ident = CSSValueTop;
- break;
- case CAPBOTTOM:
- m_value.ident = CSSValueBottom;
- break;
+ case CAPLEFT:
+ m_value.valueID = CSSValueLeft;
+ break;
+ case CAPRIGHT:
+ m_value.valueID = CSSValueRight;
+ break;
+ case CAPTOP:
+ m_value.valueID = CSSValueTop;
+ break;
+ case CAPBOTTOM:
+ m_value.valueID = CSSValueBottom;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator ECaptionSide() const
{
- switch (m_value.ident) {
- case CSSValueLeft:
- return CAPLEFT;
- case CSSValueRight:
- return CAPRIGHT;
- case CSSValueTop:
- return CAPTOP;
- case CSSValueBottom:
- return CAPBOTTOM;
+ switch (m_value.valueID) {
+ case CSSValueLeft:
+ return CAPLEFT;
+ case CSSValueRight:
+ return CAPRIGHT;
+ case CSSValueTop:
+ return CAPTOP;
+ case CSSValueBottom:
+ return CAPBOTTOM;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -989,34 +1021,36 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EClear e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case CNONE:
- m_value.ident = CSSValueNone;
- break;
- case CLEFT:
- m_value.ident = CSSValueLeft;
- break;
- case CRIGHT:
- m_value.ident = CSSValueRight;
- break;
- case CBOTH:
- m_value.ident = CSSValueBoth;
- break;
+ case CNONE:
+ m_value.valueID = CSSValueNone;
+ break;
+ case CLEFT:
+ m_value.valueID = CSSValueLeft;
+ break;
+ case CRIGHT:
+ m_value.valueID = CSSValueRight;
+ break;
+ case CBOTH:
+ m_value.valueID = CSSValueBoth;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EClear() const
{
- switch (m_value.ident) {
- case CSSValueNone:
- return CNONE;
- case CSSValueLeft:
- return CLEFT;
- case CSSValueRight:
- return CRIGHT;
- case CSSValueBoth:
- return CBOTH;
+ switch (m_value.valueID) {
+ case CSSValueNone:
+ return CNONE;
+ case CSSValueLeft:
+ return CLEFT;
+ case CSSValueRight:
+ return CRIGHT;
+ case CSSValueBoth:
+ return CBOTH;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1026,214 +1060,214 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECursor e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case CURSOR_AUTO:
- m_value.ident = CSSValueAuto;
- break;
- case CURSOR_CROSS:
- m_value.ident = CSSValueCrosshair;
- break;
- case CURSOR_DEFAULT:
- m_value.ident = CSSValueDefault;
- break;
- case CURSOR_POINTER:
- m_value.ident = CSSValuePointer;
- break;
- case CURSOR_MOVE:
- m_value.ident = CSSValueMove;
- break;
- case CURSOR_CELL:
- m_value.ident = CSSValueCell;
- break;
- case CURSOR_VERTICAL_TEXT:
- m_value.ident = CSSValueVerticalText;
- break;
- case CURSOR_CONTEXT_MENU:
- m_value.ident = CSSValueContextMenu;
- break;
- case CURSOR_ALIAS:
- m_value.ident = CSSValueAlias;
- break;
- case CURSOR_COPY:
- m_value.ident = CSSValueCopy;
- break;
- case CURSOR_NONE:
- m_value.ident = CSSValueNone;
- break;
- case CURSOR_PROGRESS:
- m_value.ident = CSSValueProgress;
- break;
- case CURSOR_NO_DROP:
- m_value.ident = CSSValueNoDrop;
- break;
- case CURSOR_NOT_ALLOWED:
- m_value.ident = CSSValueNotAllowed;
- break;
- case CURSOR_WEBKIT_ZOOM_IN:
- m_value.ident = CSSValueWebkitZoomIn;
- break;
- case CURSOR_WEBKIT_ZOOM_OUT:
- m_value.ident = CSSValueWebkitZoomOut;
- break;
- case CURSOR_E_RESIZE:
- m_value.ident = CSSValueEResize;
- break;
- case CURSOR_NE_RESIZE:
- m_value.ident = CSSValueNeResize;
- break;
- case CURSOR_NW_RESIZE:
- m_value.ident = CSSValueNwResize;
- break;
- case CURSOR_N_RESIZE:
- m_value.ident = CSSValueNResize;
- break;
- case CURSOR_SE_RESIZE:
- m_value.ident = CSSValueSeResize;
- break;
- case CURSOR_SW_RESIZE:
- m_value.ident = CSSValueSwResize;
- break;
- case CURSOR_S_RESIZE:
- m_value.ident = CSSValueSResize;
- break;
- case CURSOR_W_RESIZE:
- m_value.ident = CSSValueWResize;
- break;
- case CURSOR_EW_RESIZE:
- m_value.ident = CSSValueEwResize;
- break;
- case CURSOR_NS_RESIZE:
- m_value.ident = CSSValueNsResize;
- break;
- case CURSOR_NESW_RESIZE:
- m_value.ident = CSSValueNeswResize;
- break;
- case CURSOR_NWSE_RESIZE:
- m_value.ident = CSSValueNwseResize;
- break;
- case CURSOR_COL_RESIZE:
- m_value.ident = CSSValueColResize;
- break;
- case CURSOR_ROW_RESIZE:
- m_value.ident = CSSValueRowResize;
- break;
- case CURSOR_TEXT:
- m_value.ident = CSSValueText;
- break;
- case CURSOR_WAIT:
- m_value.ident = CSSValueWait;
- break;
- case CURSOR_HELP:
- m_value.ident = CSSValueHelp;
- break;
- case CURSOR_ALL_SCROLL:
- m_value.ident = CSSValueAllScroll;
- break;
- case CURSOR_WEBKIT_GRAB:
- m_value.ident = CSSValueWebkitGrab;
- break;
- case CURSOR_WEBKIT_GRABBING:
- m_value.ident = CSSValueWebkitGrabbing;
- break;
+ case CURSOR_AUTO:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case CURSOR_CROSS:
+ m_value.valueID = CSSValueCrosshair;
+ break;
+ case CURSOR_DEFAULT:
+ m_value.valueID = CSSValueDefault;
+ break;
+ case CURSOR_POINTER:
+ m_value.valueID = CSSValuePointer;
+ break;
+ case CURSOR_MOVE:
+ m_value.valueID = CSSValueMove;
+ break;
+ case CURSOR_CELL:
+ m_value.valueID = CSSValueCell;
+ break;
+ case CURSOR_VERTICAL_TEXT:
+ m_value.valueID = CSSValueVerticalText;
+ break;
+ case CURSOR_CONTEXT_MENU:
+ m_value.valueID = CSSValueContextMenu;
+ break;
+ case CURSOR_ALIAS:
+ m_value.valueID = CSSValueAlias;
+ break;
+ case CURSOR_COPY:
+ m_value.valueID = CSSValueCopy;
+ break;
+ case CURSOR_NONE:
+ m_value.valueID = CSSValueNone;
+ break;
+ case CURSOR_PROGRESS:
+ m_value.valueID = CSSValueProgress;
+ break;
+ case CURSOR_NO_DROP:
+ m_value.valueID = CSSValueNoDrop;
+ break;
+ case CURSOR_NOT_ALLOWED:
+ m_value.valueID = CSSValueNotAllowed;
+ break;
+ case CURSOR_WEBKIT_ZOOM_IN:
+ m_value.valueID = CSSValueWebkitZoomIn;
+ break;
+ case CURSOR_WEBKIT_ZOOM_OUT:
+ m_value.valueID = CSSValueWebkitZoomOut;
+ break;
+ case CURSOR_E_RESIZE:
+ m_value.valueID = CSSValueEResize;
+ break;
+ case CURSOR_NE_RESIZE:
+ m_value.valueID = CSSValueNeResize;
+ break;
+ case CURSOR_NW_RESIZE:
+ m_value.valueID = CSSValueNwResize;
+ break;
+ case CURSOR_N_RESIZE:
+ m_value.valueID = CSSValueNResize;
+ break;
+ case CURSOR_SE_RESIZE:
+ m_value.valueID = CSSValueSeResize;
+ break;
+ case CURSOR_SW_RESIZE:
+ m_value.valueID = CSSValueSwResize;
+ break;
+ case CURSOR_S_RESIZE:
+ m_value.valueID = CSSValueSResize;
+ break;
+ case CURSOR_W_RESIZE:
+ m_value.valueID = CSSValueWResize;
+ break;
+ case CURSOR_EW_RESIZE:
+ m_value.valueID = CSSValueEwResize;
+ break;
+ case CURSOR_NS_RESIZE:
+ m_value.valueID = CSSValueNsResize;
+ break;
+ case CURSOR_NESW_RESIZE:
+ m_value.valueID = CSSValueNeswResize;
+ break;
+ case CURSOR_NWSE_RESIZE:
+ m_value.valueID = CSSValueNwseResize;
+ break;
+ case CURSOR_COL_RESIZE:
+ m_value.valueID = CSSValueColResize;
+ break;
+ case CURSOR_ROW_RESIZE:
+ m_value.valueID = CSSValueRowResize;
+ break;
+ case CURSOR_TEXT:
+ m_value.valueID = CSSValueText;
+ break;
+ case CURSOR_WAIT:
+ m_value.valueID = CSSValueWait;
+ break;
+ case CURSOR_HELP:
+ m_value.valueID = CSSValueHelp;
+ break;
+ case CURSOR_ALL_SCROLL:
+ m_value.valueID = CSSValueAllScroll;
+ break;
+ case CURSOR_WEBKIT_GRAB:
+ m_value.valueID = CSSValueWebkitGrab;
+ break;
+ case CURSOR_WEBKIT_GRABBING:
+ m_value.valueID = CSSValueWebkitGrabbing;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator ECursor() const
{
- if (m_value.ident == CSSValueCopy)
+ if (m_value.valueID == CSSValueCopy)
return CURSOR_COPY;
- if (m_value.ident == CSSValueNone)
+ if (m_value.valueID == CSSValueNone)
return CURSOR_NONE;
- return static_cast<ECursor>(m_value.ident - CSSValueAuto);
+ return static_cast<ECursor>(m_value.valueID - CSSValueAuto);
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDisplay e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case INLINE:
- m_value.ident = CSSValueInline;
- break;
- case BLOCK:
- m_value.ident = CSSValueBlock;
- break;
- case LIST_ITEM:
- m_value.ident = CSSValueListItem;
- break;
- case RUN_IN:
- m_value.ident = CSSValueRunIn;
- break;
- case COMPACT:
- m_value.ident = CSSValueCompact;
- break;
- case INLINE_BLOCK:
- m_value.ident = CSSValueInlineBlock;
- break;
- case TABLE:
- m_value.ident = CSSValueTable;
- break;
- case INLINE_TABLE:
- m_value.ident = CSSValueInlineTable;
- break;
- case TABLE_ROW_GROUP:
- m_value.ident = CSSValueTableRowGroup;
- break;
- case TABLE_HEADER_GROUP:
- m_value.ident = CSSValueTableHeaderGroup;
- break;
- case TABLE_FOOTER_GROUP:
- m_value.ident = CSSValueTableFooterGroup;
- break;
- case TABLE_ROW:
- m_value.ident = CSSValueTableRow;
- break;
- case TABLE_COLUMN_GROUP:
- m_value.ident = CSSValueTableColumnGroup;
- break;
- case TABLE_COLUMN:
- m_value.ident = CSSValueTableColumn;
- break;
- case TABLE_CELL:
- m_value.ident = CSSValueTableCell;
- break;
- case TABLE_CAPTION:
- m_value.ident = CSSValueTableCaption;
- break;
- case BOX:
- m_value.ident = CSSValueWebkitBox;
- break;
- case INLINE_BOX:
- m_value.ident = CSSValueWebkitInlineBox;
- break;
- case FLEX:
- m_value.ident = CSSValueWebkitFlex;
- break;
- case INLINE_FLEX:
- m_value.ident = CSSValueWebkitInlineFlex;
- break;
- case GRID:
- m_value.ident = CSSValueWebkitGrid;
- break;
- case INLINE_GRID:
- m_value.ident = CSSValueWebkitInlineGrid;
- break;
- case LAZY_BLOCK:
- m_value.ident = CSSValueLazyBlock;
- break;
- case NONE:
- m_value.ident = CSSValueNone;
- break;
+ case INLINE:
+ m_value.valueID = CSSValueInline;
+ break;
+ case BLOCK:
+ m_value.valueID = CSSValueBlock;
+ break;
+ case LIST_ITEM:
+ m_value.valueID = CSSValueListItem;
+ break;
+ case RUN_IN:
+ m_value.valueID = CSSValueRunIn;
+ break;
+ case COMPACT:
+ m_value.valueID = CSSValueCompact;
+ break;
+ case INLINE_BLOCK:
+ m_value.valueID = CSSValueInlineBlock;
+ break;
+ case TABLE:
+ m_value.valueID = CSSValueTable;
+ break;
+ case INLINE_TABLE:
+ m_value.valueID = CSSValueInlineTable;
+ break;
+ case TABLE_ROW_GROUP:
+ m_value.valueID = CSSValueTableRowGroup;
+ break;
+ case TABLE_HEADER_GROUP:
+ m_value.valueID = CSSValueTableHeaderGroup;
+ break;
+ case TABLE_FOOTER_GROUP:
+ m_value.valueID = CSSValueTableFooterGroup;
+ break;
+ case TABLE_ROW:
+ m_value.valueID = CSSValueTableRow;
+ break;
+ case TABLE_COLUMN_GROUP:
+ m_value.valueID = CSSValueTableColumnGroup;
+ break;
+ case TABLE_COLUMN:
+ m_value.valueID = CSSValueTableColumn;
+ break;
+ case TABLE_CELL:
+ m_value.valueID = CSSValueTableCell;
+ break;
+ case TABLE_CAPTION:
+ m_value.valueID = CSSValueTableCaption;
+ break;
+ case BOX:
+ m_value.valueID = CSSValueWebkitBox;
+ break;
+ case INLINE_BOX:
+ m_value.valueID = CSSValueWebkitInlineBox;
+ break;
+ case FLEX:
+ m_value.valueID = CSSValueWebkitFlex;
+ break;
+ case INLINE_FLEX:
+ m_value.valueID = CSSValueWebkitInlineFlex;
+ break;
+ case GRID:
+ m_value.valueID = CSSValueGrid;
+ break;
+ case INLINE_GRID:
+ m_value.valueID = CSSValueInlineGrid;
+ break;
+ case LAZY_BLOCK:
+ m_value.valueID = CSSValueLazyBlock;
+ break;
+ case NONE:
+ m_value.valueID = CSSValueNone;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EDisplay() const
{
- if (m_value.ident == CSSValueNone)
+ if (m_value.valueID == CSSValueNone)
return NONE;
- EDisplay display = static_cast<EDisplay>(m_value.ident - CSSValueInline);
+ EDisplay display = static_cast<EDisplay>(m_value.valueID - CSSValueInline);
ASSERT(display >= INLINE && display <= NONE);
return display;
}
@@ -1241,24 +1275,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EEmptyCell e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case SHOW:
- m_value.ident = CSSValueShow;
- break;
- case HIDE:
- m_value.ident = CSSValueHide;
- break;
+ case SHOW:
+ m_value.valueID = CSSValueShow;
+ break;
+ case HIDE:
+ m_value.valueID = CSSValueHide;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EEmptyCell() const
{
- switch (m_value.ident) {
- case CSSValueShow:
- return SHOW;
- case CSSValueHide:
- return HIDE;
+ switch (m_value.valueID) {
+ case CSSValueShow:
+ return SHOW;
+ case CSSValueHide:
+ return HIDE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1268,32 +1304,32 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EAlignItems e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case AlignAuto:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
case AlignFlexStart:
- m_value.ident = CSSValueFlexStart;
+ m_value.valueID = CSSValueFlexStart;
break;
case AlignFlexEnd:
- m_value.ident = CSSValueFlexEnd;
+ m_value.valueID = CSSValueFlexEnd;
break;
case AlignCenter:
- m_value.ident = CSSValueCenter;
+ m_value.valueID = CSSValueCenter;
break;
case AlignStretch:
- m_value.ident = CSSValueStretch;
+ m_value.valueID = CSSValueStretch;
break;
case AlignBaseline:
- m_value.ident = CSSValueBaseline;
+ m_value.valueID = CSSValueBaseline;
break;
}
}
template<> inline CSSPrimitiveValue::operator EAlignItems() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAuto:
return AlignAuto;
case CSSValueFlexStart:
@@ -1306,6 +1342,8 @@
return AlignStretch;
case CSSValueBaseline:
return AlignBaseline;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1315,29 +1353,29 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EJustifyContent e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case JustifyFlexStart:
- m_value.ident = CSSValueFlexStart;
+ m_value.valueID = CSSValueFlexStart;
break;
case JustifyFlexEnd:
- m_value.ident = CSSValueFlexEnd;
+ m_value.valueID = CSSValueFlexEnd;
break;
case JustifyCenter:
- m_value.ident = CSSValueCenter;
+ m_value.valueID = CSSValueCenter;
break;
case JustifySpaceBetween:
- m_value.ident = CSSValueSpaceBetween;
+ m_value.valueID = CSSValueSpaceBetween;
break;
case JustifySpaceAround:
- m_value.ident = CSSValueSpaceAround;
+ m_value.valueID = CSSValueSpaceAround;
break;
}
}
template<> inline CSSPrimitiveValue::operator EJustifyContent() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueFlexStart:
return JustifyFlexStart;
case CSSValueFlexEnd:
@@ -1348,6 +1386,8 @@
return JustifySpaceBetween;
case CSSValueSpaceAround:
return JustifySpaceAround;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1357,26 +1397,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexDirection e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case FlowRow:
- m_value.ident = CSSValueRow;
+ m_value.valueID = CSSValueRow;
break;
case FlowRowReverse:
- m_value.ident = CSSValueRowReverse;
+ m_value.valueID = CSSValueRowReverse;
break;
case FlowColumn:
- m_value.ident = CSSValueColumn;
+ m_value.valueID = CSSValueColumn;
break;
case FlowColumnReverse:
- m_value.ident = CSSValueColumnReverse;
+ m_value.valueID = CSSValueColumnReverse;
break;
}
}
template<> inline CSSPrimitiveValue::operator EFlexDirection() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueRow:
return FlowRow;
case CSSValueRowReverse:
@@ -1385,6 +1425,8 @@
return FlowColumn;
case CSSValueColumnReverse:
return FlowColumnReverse;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1394,32 +1436,32 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EAlignContent e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case AlignContentFlexStart:
- m_value.ident = CSSValueFlexStart;
+ m_value.valueID = CSSValueFlexStart;
break;
case AlignContentFlexEnd:
- m_value.ident = CSSValueFlexEnd;
+ m_value.valueID = CSSValueFlexEnd;
break;
case AlignContentCenter:
- m_value.ident = CSSValueCenter;
+ m_value.valueID = CSSValueCenter;
break;
case AlignContentSpaceBetween:
- m_value.ident = CSSValueSpaceBetween;
+ m_value.valueID = CSSValueSpaceBetween;
break;
case AlignContentSpaceAround:
- m_value.ident = CSSValueSpaceAround;
+ m_value.valueID = CSSValueSpaceAround;
break;
case AlignContentStretch:
- m_value.ident = CSSValueStretch;
+ m_value.valueID = CSSValueStretch;
break;
}
}
template<> inline CSSPrimitiveValue::operator EAlignContent() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueFlexStart:
return AlignContentFlexStart;
case CSSValueFlexEnd:
@@ -1432,6 +1474,8 @@
return AlignContentSpaceAround;
case CSSValueStretch:
return AlignContentStretch;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1441,29 +1485,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexWrap e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case FlexNoWrap:
- m_value.ident = CSSValueNowrap;
+ m_value.valueID = CSSValueNowrap;
break;
case FlexWrap:
- m_value.ident = CSSValueWrap;
+ m_value.valueID = CSSValueWrap;
break;
case FlexWrapReverse:
- m_value.ident = CSSValueWrapReverse;
+ m_value.valueID = CSSValueWrapReverse;
break;
}
}
template<> inline CSSPrimitiveValue::operator EFlexWrap() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNowrap:
return FlexNoWrap;
case CSSValueWrap:
return FlexWrap;
case CSSValueWrapReverse:
return FlexWrapReverse;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1473,30 +1519,32 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFloat e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case NoFloat:
- m_value.ident = CSSValueNone;
- break;
- case LeftFloat:
- m_value.ident = CSSValueLeft;
- break;
- case RightFloat:
- m_value.ident = CSSValueRight;
- break;
+ case NoFloat:
+ m_value.valueID = CSSValueNone;
+ break;
+ case LeftFloat:
+ m_value.valueID = CSSValueLeft;
+ break;
+ case RightFloat:
+ m_value.valueID = CSSValueRight;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EFloat() const
{
- switch (m_value.ident) {
- case CSSValueLeft:
- return LeftFloat;
- case CSSValueRight:
- return RightFloat;
- case CSSValueNone:
- case CSSValueCenter: // Non-standard CSS value
- return NoFloat;
+ switch (m_value.valueID) {
+ case CSSValueLeft:
+ return LeftFloat;
+ case CSSValueRight:
+ return RightFloat;
+ case CSSValueNone:
+ case CSSValueCenter: // Non-standard CSS value.
+ return NoFloat;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1506,29 +1554,29 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineBreak e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case LineBreakAuto:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
case LineBreakLoose:
- m_value.ident = CSSValueLoose;
+ m_value.valueID = CSSValueLoose;
break;
case LineBreakNormal:
- m_value.ident = CSSValueNormal;
+ m_value.valueID = CSSValueNormal;
break;
case LineBreakStrict:
- m_value.ident = CSSValueStrict;
+ m_value.valueID = CSSValueStrict;
break;
case LineBreakAfterWhiteSpace:
- m_value.ident = CSSValueAfterWhiteSpace;
+ m_value.valueID = CSSValueAfterWhiteSpace;
break;
}
}
template<> inline CSSPrimitiveValue::operator LineBreak() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAuto:
return LineBreakAuto;
case CSSValueLoose:
@@ -1539,6 +1587,8 @@
return LineBreakStrict;
case CSSValueAfterWhiteSpace:
return LineBreakAfterWhiteSpace;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1548,24 +1598,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStylePosition e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case OUTSIDE:
- m_value.ident = CSSValueOutside;
- break;
- case INSIDE:
- m_value.ident = CSSValueInside;
- break;
+ case OUTSIDE:
+ m_value.valueID = CSSValueOutside;
+ break;
+ case INSIDE:
+ m_value.valueID = CSSValueInside;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EListStylePosition() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueOutside:
return OUTSIDE;
case CSSValueInside:
return INSIDE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1575,290 +1627,292 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStyleType e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case Afar:
- m_value.ident = CSSValueAfar;
+ m_value.valueID = CSSValueAfar;
break;
case Amharic:
- m_value.ident = CSSValueAmharic;
+ m_value.valueID = CSSValueAmharic;
break;
case AmharicAbegede:
- m_value.ident = CSSValueAmharicAbegede;
+ m_value.valueID = CSSValueAmharicAbegede;
break;
case ArabicIndic:
- m_value.ident = CSSValueArabicIndic;
+ m_value.valueID = CSSValueArabicIndic;
break;
case Armenian:
- m_value.ident = CSSValueArmenian;
+ m_value.valueID = CSSValueArmenian;
break;
case Asterisks:
- m_value.ident = CSSValueAsterisks;
+ m_value.valueID = CSSValueAsterisks;
break;
case BinaryListStyle:
- m_value.ident = CSSValueBinary;
+ m_value.valueID = CSSValueBinary;
break;
case Bengali:
- m_value.ident = CSSValueBengali;
+ m_value.valueID = CSSValueBengali;
break;
case Cambodian:
- m_value.ident = CSSValueCambodian;
+ m_value.valueID = CSSValueCambodian;
break;
case Circle:
- m_value.ident = CSSValueCircle;
+ m_value.valueID = CSSValueCircle;
break;
case CjkEarthlyBranch:
- m_value.ident = CSSValueCjkEarthlyBranch;
+ m_value.valueID = CSSValueCjkEarthlyBranch;
break;
case CjkHeavenlyStem:
- m_value.ident = CSSValueCjkHeavenlyStem;
+ m_value.valueID = CSSValueCjkHeavenlyStem;
break;
case CJKIdeographic:
- m_value.ident = CSSValueCjkIdeographic;
+ m_value.valueID = CSSValueCjkIdeographic;
break;
case DecimalLeadingZero:
- m_value.ident = CSSValueDecimalLeadingZero;
+ m_value.valueID = CSSValueDecimalLeadingZero;
break;
case DecimalListStyle:
- m_value.ident = CSSValueDecimal;
+ m_value.valueID = CSSValueDecimal;
break;
case Devanagari:
- m_value.ident = CSSValueDevanagari;
+ m_value.valueID = CSSValueDevanagari;
break;
case Disc:
- m_value.ident = CSSValueDisc;
+ m_value.valueID = CSSValueDisc;
break;
case Ethiopic:
- m_value.ident = CSSValueEthiopic;
+ m_value.valueID = CSSValueEthiopic;
break;
case EthiopicAbegede:
- m_value.ident = CSSValueEthiopicAbegede;
+ m_value.valueID = CSSValueEthiopicAbegede;
break;
case EthiopicAbegedeAmEt:
- m_value.ident = CSSValueEthiopicAbegedeAmEt;
+ m_value.valueID = CSSValueEthiopicAbegedeAmEt;
break;
case EthiopicAbegedeGez:
- m_value.ident = CSSValueEthiopicAbegedeGez;
+ m_value.valueID = CSSValueEthiopicAbegedeGez;
break;
case EthiopicAbegedeTiEr:
- m_value.ident = CSSValueEthiopicAbegedeTiEr;
+ m_value.valueID = CSSValueEthiopicAbegedeTiEr;
break;
case EthiopicAbegedeTiEt:
- m_value.ident = CSSValueEthiopicAbegedeTiEt;
+ m_value.valueID = CSSValueEthiopicAbegedeTiEt;
break;
case EthiopicHalehameAaEr:
- m_value.ident = CSSValueEthiopicHalehameAaEr;
+ m_value.valueID = CSSValueEthiopicHalehameAaEr;
break;
case EthiopicHalehameAaEt:
- m_value.ident = CSSValueEthiopicHalehameAaEt;
+ m_value.valueID = CSSValueEthiopicHalehameAaEt;
break;
case EthiopicHalehameAmEt:
- m_value.ident = CSSValueEthiopicHalehameAmEt;
+ m_value.valueID = CSSValueEthiopicHalehameAmEt;
break;
case EthiopicHalehameGez:
- m_value.ident = CSSValueEthiopicHalehameGez;
+ m_value.valueID = CSSValueEthiopicHalehameGez;
break;
case EthiopicHalehameOmEt:
- m_value.ident = CSSValueEthiopicHalehameOmEt;
+ m_value.valueID = CSSValueEthiopicHalehameOmEt;
break;
case EthiopicHalehameSidEt:
- m_value.ident = CSSValueEthiopicHalehameSidEt;
+ m_value.valueID = CSSValueEthiopicHalehameSidEt;
break;
case EthiopicHalehameSoEt:
- m_value.ident = CSSValueEthiopicHalehameSoEt;
+ m_value.valueID = CSSValueEthiopicHalehameSoEt;
break;
case EthiopicHalehameTiEr:
- m_value.ident = CSSValueEthiopicHalehameTiEr;
+ m_value.valueID = CSSValueEthiopicHalehameTiEr;
break;
case EthiopicHalehameTiEt:
- m_value.ident = CSSValueEthiopicHalehameTiEt;
+ m_value.valueID = CSSValueEthiopicHalehameTiEt;
break;
case EthiopicHalehameTig:
- m_value.ident = CSSValueEthiopicHalehameTig;
+ m_value.valueID = CSSValueEthiopicHalehameTig;
break;
case Footnotes:
- m_value.ident = CSSValueFootnotes;
+ m_value.valueID = CSSValueFootnotes;
break;
case Georgian:
- m_value.ident = CSSValueGeorgian;
+ m_value.valueID = CSSValueGeorgian;
break;
case Gujarati:
- m_value.ident = CSSValueGujarati;
+ m_value.valueID = CSSValueGujarati;
break;
case Gurmukhi:
- m_value.ident = CSSValueGurmukhi;
+ m_value.valueID = CSSValueGurmukhi;
break;
case Hangul:
- m_value.ident = CSSValueHangul;
+ m_value.valueID = CSSValueHangul;
break;
case HangulConsonant:
- m_value.ident = CSSValueHangulConsonant;
+ m_value.valueID = CSSValueHangulConsonant;
break;
case Hebrew:
- m_value.ident = CSSValueHebrew;
+ m_value.valueID = CSSValueHebrew;
break;
case Hiragana:
- m_value.ident = CSSValueHiragana;
+ m_value.valueID = CSSValueHiragana;
break;
case HiraganaIroha:
- m_value.ident = CSSValueHiraganaIroha;
+ m_value.valueID = CSSValueHiraganaIroha;
break;
case Kannada:
- m_value.ident = CSSValueKannada;
+ m_value.valueID = CSSValueKannada;
break;
case Katakana:
- m_value.ident = CSSValueKatakana;
+ m_value.valueID = CSSValueKatakana;
break;
case KatakanaIroha:
- m_value.ident = CSSValueKatakanaIroha;
+ m_value.valueID = CSSValueKatakanaIroha;
break;
case Khmer:
- m_value.ident = CSSValueKhmer;
+ m_value.valueID = CSSValueKhmer;
break;
case Lao:
- m_value.ident = CSSValueLao;
+ m_value.valueID = CSSValueLao;
break;
case LowerAlpha:
- m_value.ident = CSSValueLowerAlpha;
+ m_value.valueID = CSSValueLowerAlpha;
break;
case LowerArmenian:
- m_value.ident = CSSValueLowerArmenian;
+ m_value.valueID = CSSValueLowerArmenian;
break;
case LowerGreek:
- m_value.ident = CSSValueLowerGreek;
+ m_value.valueID = CSSValueLowerGreek;
break;
case LowerHexadecimal:
- m_value.ident = CSSValueLowerHexadecimal;
+ m_value.valueID = CSSValueLowerHexadecimal;
break;
case LowerLatin:
- m_value.ident = CSSValueLowerLatin;
+ m_value.valueID = CSSValueLowerLatin;
break;
case LowerNorwegian:
- m_value.ident = CSSValueLowerNorwegian;
+ m_value.valueID = CSSValueLowerNorwegian;
break;
case LowerRoman:
- m_value.ident = CSSValueLowerRoman;
+ m_value.valueID = CSSValueLowerRoman;
break;
case Malayalam:
- m_value.ident = CSSValueMalayalam;
+ m_value.valueID = CSSValueMalayalam;
break;
case Mongolian:
- m_value.ident = CSSValueMongolian;
+ m_value.valueID = CSSValueMongolian;
break;
case Myanmar:
- m_value.ident = CSSValueMyanmar;
+ m_value.valueID = CSSValueMyanmar;
break;
case NoneListStyle:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
case Octal:
- m_value.ident = CSSValueOctal;
+ m_value.valueID = CSSValueOctal;
break;
case Oriya:
- m_value.ident = CSSValueOriya;
+ m_value.valueID = CSSValueOriya;
break;
case Oromo:
- m_value.ident = CSSValueOromo;
+ m_value.valueID = CSSValueOromo;
break;
case Persian:
- m_value.ident = CSSValuePersian;
+ m_value.valueID = CSSValuePersian;
break;
case Sidama:
- m_value.ident = CSSValueSidama;
+ m_value.valueID = CSSValueSidama;
break;
case Somali:
- m_value.ident = CSSValueSomali;
+ m_value.valueID = CSSValueSomali;
break;
case Square:
- m_value.ident = CSSValueSquare;
+ m_value.valueID = CSSValueSquare;
break;
case Telugu:
- m_value.ident = CSSValueTelugu;
+ m_value.valueID = CSSValueTelugu;
break;
case Thai:
- m_value.ident = CSSValueThai;
+ m_value.valueID = CSSValueThai;
break;
case Tibetan:
- m_value.ident = CSSValueTibetan;
+ m_value.valueID = CSSValueTibetan;
break;
case Tigre:
- m_value.ident = CSSValueTigre;
+ m_value.valueID = CSSValueTigre;
break;
case TigrinyaEr:
- m_value.ident = CSSValueTigrinyaEr;
+ m_value.valueID = CSSValueTigrinyaEr;
break;
case TigrinyaErAbegede:
- m_value.ident = CSSValueTigrinyaErAbegede;
+ m_value.valueID = CSSValueTigrinyaErAbegede;
break;
case TigrinyaEt:
- m_value.ident = CSSValueTigrinyaEt;
+ m_value.valueID = CSSValueTigrinyaEt;
break;
case TigrinyaEtAbegede:
- m_value.ident = CSSValueTigrinyaEtAbegede;
+ m_value.valueID = CSSValueTigrinyaEtAbegede;
break;
case UpperAlpha:
- m_value.ident = CSSValueUpperAlpha;
+ m_value.valueID = CSSValueUpperAlpha;
break;
case UpperArmenian:
- m_value.ident = CSSValueUpperArmenian;
+ m_value.valueID = CSSValueUpperArmenian;
break;
case UpperGreek:
- m_value.ident = CSSValueUpperGreek;
+ m_value.valueID = CSSValueUpperGreek;
break;
case UpperHexadecimal:
- m_value.ident = CSSValueUpperHexadecimal;
+ m_value.valueID = CSSValueUpperHexadecimal;
break;
case UpperLatin:
- m_value.ident = CSSValueUpperLatin;
+ m_value.valueID = CSSValueUpperLatin;
break;
case UpperNorwegian:
- m_value.ident = CSSValueUpperNorwegian;
+ m_value.valueID = CSSValueUpperNorwegian;
break;
case UpperRoman:
- m_value.ident = CSSValueUpperRoman;
+ m_value.valueID = CSSValueUpperRoman;
break;
case Urdu:
- m_value.ident = CSSValueUrdu;
+ m_value.valueID = CSSValueUrdu;
break;
}
}
template<> inline CSSPrimitiveValue::operator EListStyleType() const
{
- switch (m_value.ident) {
- case CSSValueNone:
- return NoneListStyle;
- default:
- return static_cast<EListStyleType>(m_value.ident - CSSValueDisc);
+ switch (m_value.valueID) {
+ case CSSValueNone:
+ return NoneListStyle;
+ default:
+ return static_cast<EListStyleType>(m_value.valueID - CSSValueDisc);
}
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarginCollapse e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case MCOLLAPSE:
- m_value.ident = CSSValueCollapse;
- break;
- case MSEPARATE:
- m_value.ident = CSSValueSeparate;
- break;
- case MDISCARD:
- m_value.ident = CSSValueDiscard;
- break;
+ case MCOLLAPSE:
+ m_value.valueID = CSSValueCollapse;
+ break;
+ case MSEPARATE:
+ m_value.valueID = CSSValueSeparate;
+ break;
+ case MDISCARD:
+ m_value.valueID = CSSValueDiscard;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EMarginCollapse() const
{
- switch (m_value.ident) {
- case CSSValueCollapse:
- return MCOLLAPSE;
- case CSSValueSeparate:
- return MSEPARATE;
- case CSSValueDiscard:
- return MDISCARD;
+ switch (m_value.valueID) {
+ case CSSValueCollapse:
+ return MCOLLAPSE;
+ case CSSValueSeparate:
+ return MSEPARATE;
+ case CSSValueDiscard:
+ return MDISCARD;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1868,34 +1922,36 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarqueeBehavior e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case MNONE:
- m_value.ident = CSSValueNone;
- break;
- case MSCROLL:
- m_value.ident = CSSValueScroll;
- break;
- case MSLIDE:
- m_value.ident = CSSValueSlide;
- break;
- case MALTERNATE:
- m_value.ident = CSSValueAlternate;
- break;
+ case MNONE:
+ m_value.valueID = CSSValueNone;
+ break;
+ case MSCROLL:
+ m_value.valueID = CSSValueScroll;
+ break;
+ case MSLIDE:
+ m_value.valueID = CSSValueSlide;
+ break;
+ case MALTERNATE:
+ m_value.valueID = CSSValueAlternate;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EMarqueeBehavior() const
{
- switch (m_value.ident) {
- case CSSValueNone:
- return MNONE;
- case CSSValueScroll:
- return MSCROLL;
- case CSSValueSlide:
- return MSLIDE;
- case CSSValueAlternate:
- return MALTERNATE;
+ switch (m_value.valueID) {
+ case CSSValueNone:
+ return MNONE;
+ case CSSValueScroll:
+ return MSCROLL;
+ case CSSValueSlide:
+ return MSLIDE;
+ case CSSValueAlternate:
+ return MALTERNATE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1905,24 +1961,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(RegionOverflow e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case AutoRegionOverflow:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
case BreakRegionOverflow:
- m_value.ident = CSSValueBreak;
+ m_value.valueID = CSSValueBreak;
break;
}
}
template<> inline CSSPrimitiveValue::operator RegionOverflow() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAuto:
return AutoRegionOverflow;
case CSSValueBreak:
return BreakRegionOverflow;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1932,51 +1990,53 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarqueeDirection e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case MFORWARD:
- m_value.ident = CSSValueForwards;
- break;
- case MBACKWARD:
- m_value.ident = CSSValueBackwards;
- break;
- case MAUTO:
- m_value.ident = CSSValueAuto;
- break;
- case MUP:
- m_value.ident = CSSValueUp;
- break;
- case MDOWN:
- m_value.ident = CSSValueDown;
- break;
- case MLEFT:
- m_value.ident = CSSValueLeft;
- break;
- case MRIGHT:
- m_value.ident = CSSValueRight;
- break;
+ case MFORWARD:
+ m_value.valueID = CSSValueForwards;
+ break;
+ case MBACKWARD:
+ m_value.valueID = CSSValueBackwards;
+ break;
+ case MAUTO:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case MUP:
+ m_value.valueID = CSSValueUp;
+ break;
+ case MDOWN:
+ m_value.valueID = CSSValueDown;
+ break;
+ case MLEFT:
+ m_value.valueID = CSSValueLeft;
+ break;
+ case MRIGHT:
+ m_value.valueID = CSSValueRight;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EMarqueeDirection() const
{
- switch (m_value.ident) {
- case CSSValueForwards:
- return MFORWARD;
- case CSSValueBackwards:
- return MBACKWARD;
- case CSSValueAuto:
- return MAUTO;
- case CSSValueAhead:
- case CSSValueUp: // We don't support vertical languages, so AHEAD just maps to UP.
- return MUP;
- case CSSValueReverse:
- case CSSValueDown: // REVERSE just maps to DOWN, since we don't do vertical text.
- return MDOWN;
- case CSSValueLeft:
- return MLEFT;
- case CSSValueRight:
- return MRIGHT;
+ switch (m_value.valueID) {
+ case CSSValueForwards:
+ return MFORWARD;
+ case CSSValueBackwards:
+ return MBACKWARD;
+ case CSSValueAuto:
+ return MAUTO;
+ case CSSValueAhead:
+ case CSSValueUp: // We don't support vertical languages, so AHEAD just maps to UP.
+ return MUP;
+ case CSSValueReverse:
+ case CSSValueDown: // REVERSE just maps to DOWN, since we don't do vertical text.
+ return MDOWN;
+ case CSSValueLeft:
+ return MLEFT;
+ case CSSValueRight:
+ return MRIGHT;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -1986,54 +2046,51 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EOverflow e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case OVISIBLE:
- m_value.ident = CSSValueVisible;
- break;
- case OHIDDEN:
- m_value.ident = CSSValueHidden;
- break;
- case OSCROLL:
- m_value.ident = CSSValueScroll;
- break;
- case OAUTO:
- m_value.ident = CSSValueAuto;
- break;
- case OMARQUEE:
- m_value.ident = CSSValueWebkitMarquee;
- break;
- case OOVERLAY:
- m_value.ident = CSSValueOverlay;
- break;
- case OPAGEDX:
- m_value.ident = CSSValueWebkitPagedX;
- break;
- case OPAGEDY:
- m_value.ident = CSSValueWebkitPagedY;
- break;
+ case OVISIBLE:
+ m_value.valueID = CSSValueVisible;
+ break;
+ case OHIDDEN:
+ m_value.valueID = CSSValueHidden;
+ break;
+ case OSCROLL:
+ m_value.valueID = CSSValueScroll;
+ break;
+ case OAUTO:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case OOVERLAY:
+ m_value.valueID = CSSValueOverlay;
+ break;
+ case OPAGEDX:
+ m_value.valueID = CSSValueWebkitPagedX;
+ break;
+ case OPAGEDY:
+ m_value.valueID = CSSValueWebkitPagedY;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EOverflow() const
{
- switch (m_value.ident) {
- case CSSValueVisible:
- return OVISIBLE;
- case CSSValueHidden:
- return OHIDDEN;
- case CSSValueScroll:
- return OSCROLL;
- case CSSValueAuto:
- return OAUTO;
- case CSSValueWebkitMarquee:
- return OMARQUEE;
- case CSSValueOverlay:
- return OOVERLAY;
- case CSSValueWebkitPagedX:
- return OPAGEDX;
- case CSSValueWebkitPagedY:
- return OPAGEDY;
+ switch (m_value.valueID) {
+ case CSSValueVisible:
+ return OVISIBLE;
+ case CSSValueHidden:
+ return OHIDDEN;
+ case CSSValueScroll:
+ return OSCROLL;
+ case CSSValueAuto:
+ return OAUTO;
+ case CSSValueOverlay:
+ return OOVERLAY;
+ case CSSValueWebkitPagedX:
+ return OPAGEDX;
+ case CSSValueWebkitPagedY:
+ return OPAGEDY;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2043,31 +2100,33 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPageBreak e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case PBAUTO:
- m_value.ident = CSSValueAuto;
- break;
- case PBALWAYS:
- m_value.ident = CSSValueAlways;
- break;
- case PBAVOID:
- m_value.ident = CSSValueAvoid;
- break;
+ case PBAUTO:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case PBALWAYS:
+ m_value.valueID = CSSValueAlways;
+ break;
+ case PBAVOID:
+ m_value.valueID = CSSValueAvoid;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EPageBreak() const
{
- switch (m_value.ident) {
- case CSSValueAuto:
- return PBAUTO;
- case CSSValueLeft:
- case CSSValueRight:
- case CSSValueAlways:
- return PBALWAYS; // CSS2.1: "Conforming user agents may map left/right to always."
- case CSSValueAvoid:
- return PBAVOID;
+ switch (m_value.valueID) {
+ case CSSValueAuto:
+ return PBAUTO;
+ case CSSValueLeft:
+ case CSSValueRight:
+ case CSSValueAlways:
+ return PBALWAYS; // CSS2.1: "Conforming user agents may map left/right to always."
+ case CSSValueAvoid:
+ return PBAVOID;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2077,39 +2136,41 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case StaticPosition:
- m_value.ident = CSSValueStatic;
- break;
- case RelativePosition:
- m_value.ident = CSSValueRelative;
- break;
- case AbsolutePosition:
- m_value.ident = CSSValueAbsolute;
- break;
- case FixedPosition:
- m_value.ident = CSSValueFixed;
- break;
- case StickyPosition:
- m_value.ident = CSSValueSticky;
- break;
+ case StaticPosition:
+ m_value.valueID = CSSValueStatic;
+ break;
+ case RelativePosition:
+ m_value.valueID = CSSValueRelative;
+ break;
+ case AbsolutePosition:
+ m_value.valueID = CSSValueAbsolute;
+ break;
+ case FixedPosition:
+ m_value.valueID = CSSValueFixed;
+ break;
+ case StickyPosition:
+ m_value.valueID = CSSValueSticky;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EPosition() const
{
- switch (m_value.ident) {
- case CSSValueStatic:
- return StaticPosition;
- case CSSValueRelative:
- return RelativePosition;
- case CSSValueAbsolute:
- return AbsolutePosition;
- case CSSValueFixed:
- return FixedPosition;
- case CSSValueSticky:
- return StickyPosition;
+ switch (m_value.valueID) {
+ case CSSValueStatic:
+ return StaticPosition;
+ case CSSValueRelative:
+ return RelativePosition;
+ case CSSValueAbsolute:
+ return AbsolutePosition;
+ case CSSValueFixed:
+ return FixedPosition;
+ case CSSValueSticky:
+ return StickyPosition;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2119,37 +2180,39 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EResize e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case RESIZE_BOTH:
- m_value.ident = CSSValueBoth;
- break;
- case RESIZE_HORIZONTAL:
- m_value.ident = CSSValueHorizontal;
- break;
- case RESIZE_VERTICAL:
- m_value.ident = CSSValueVertical;
- break;
- case RESIZE_NONE:
- m_value.ident = CSSValueNone;
- break;
+ case RESIZE_BOTH:
+ m_value.valueID = CSSValueBoth;
+ break;
+ case RESIZE_HORIZONTAL:
+ m_value.valueID = CSSValueHorizontal;
+ break;
+ case RESIZE_VERTICAL:
+ m_value.valueID = CSSValueVertical;
+ break;
+ case RESIZE_NONE:
+ m_value.valueID = CSSValueNone;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EResize() const
{
- switch (m_value.ident) {
- case CSSValueBoth:
- return RESIZE_BOTH;
- case CSSValueHorizontal:
- return RESIZE_HORIZONTAL;
- case CSSValueVertical:
- return RESIZE_VERTICAL;
- case CSSValueAuto:
- ASSERT_NOT_REACHED(); // Depends on settings, thus should be handled by the caller.
- return RESIZE_NONE;
- case CSSValueNone:
- return RESIZE_NONE;
+ switch (m_value.valueID) {
+ case CSSValueBoth:
+ return RESIZE_BOTH;
+ case CSSValueHorizontal:
+ return RESIZE_HORIZONTAL;
+ case CSSValueVertical:
+ return RESIZE_VERTICAL;
+ case CSSValueAuto:
+ ASSERT_NOT_REACHED(); // Depends on settings, thus should be handled by the caller.
+ return RESIZE_NONE;
+ case CSSValueNone:
+ return RESIZE_NONE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2159,24 +2222,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETableLayout e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case TAUTO:
- m_value.ident = CSSValueAuto;
- break;
- case TFIXED:
- m_value.ident = CSSValueFixed;
- break;
+ case TAUTO:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case TFIXED:
+ m_value.valueID = CSSValueFixed;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator ETableLayout() const
{
- switch (m_value.ident) {
- case CSSValueFixed:
- return TFIXED;
- case CSSValueAuto:
- return TAUTO;
+ switch (m_value.valueID) {
+ case CSSValueFixed:
+ return TFIXED;
+ case CSSValueAuto:
+ return TAUTO;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2186,48 +2251,48 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAlign e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case TASTART:
- m_value.ident = CSSValueStart;
+ m_value.valueID = CSSValueStart;
break;
case TAEND:
- m_value.ident = CSSValueEnd;
+ m_value.valueID = CSSValueEnd;
break;
case LEFT:
- m_value.ident = CSSValueLeft;
+ m_value.valueID = CSSValueLeft;
break;
case RIGHT:
- m_value.ident = CSSValueRight;
+ m_value.valueID = CSSValueRight;
break;
case CENTER:
- m_value.ident = CSSValueCenter;
+ m_value.valueID = CSSValueCenter;
break;
case JUSTIFY:
- m_value.ident = CSSValueJustify;
+ m_value.valueID = CSSValueJustify;
break;
case WEBKIT_LEFT:
- m_value.ident = CSSValueWebkitLeft;
+ m_value.valueID = CSSValueWebkitLeft;
break;
case WEBKIT_RIGHT:
- m_value.ident = CSSValueWebkitRight;
+ m_value.valueID = CSSValueWebkitRight;
break;
case WEBKIT_CENTER:
- m_value.ident = CSSValueWebkitCenter;
+ m_value.valueID = CSSValueWebkitCenter;
break;
}
}
template<> inline CSSPrimitiveValue::operator ETextAlign() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueWebkitAuto: // Legacy -webkit-auto. Eqiuvalent to start.
case CSSValueStart:
return TASTART;
case CSSValueEnd:
return TAEND;
default:
- return static_cast<ETextAlign>(m_value.ident - CSSValueLeft);
+ return static_cast<ETextAlign>(m_value.valueID - CSSValueLeft);
}
}
@@ -2235,35 +2300,35 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextAlignLast e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case TextAlignLastStart:
- m_value.ident = CSSValueStart;
+ m_value.valueID = CSSValueStart;
break;
case TextAlignLastEnd:
- m_value.ident = CSSValueEnd;
+ m_value.valueID = CSSValueEnd;
break;
case TextAlignLastLeft:
- m_value.ident = CSSValueLeft;
+ m_value.valueID = CSSValueLeft;
break;
case TextAlignLastRight:
- m_value.ident = CSSValueRight;
+ m_value.valueID = CSSValueRight;
break;
case TextAlignLastCenter:
- m_value.ident = CSSValueCenter;
+ m_value.valueID = CSSValueCenter;
break;
case TextAlignLastJustify:
- m_value.ident = CSSValueJustify;
+ m_value.valueID = CSSValueJustify;
break;
case TextAlignLastAuto:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
}
}
template<> inline CSSPrimitiveValue::operator TextAlignLast() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAuto:
return TextAlignLastAuto;
case CSSValueStart:
@@ -2278,6 +2343,8 @@
return TextAlignLastCenter;
case CSSValueJustify:
return TextAlignLastJustify;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2287,7 +2354,7 @@
template<> inline CSSPrimitiveValue::operator TextDecoration() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNone:
return TextDecorationNone;
case CSSValueUnderline:
@@ -2298,16 +2365,17 @@
return TextDecorationLineThrough;
case CSSValueBlink:
return TextDecorationBlink;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
return TextDecorationNone;
}
-#if ENABLE(CSS3_TEXT)
template<> inline CSSPrimitiveValue::operator TextDecorationStyle() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueSolid:
return TextDecorationStyleSolid;
case CSSValueDouble:
@@ -2318,25 +2386,28 @@
return TextDecorationStyleDashed;
case CSSValueWavy:
return TextDecorationStyleWavy;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
return TextDecorationStyleSolid;
}
+#if ENABLE(CSS3_TEXT)
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextUnderlinePosition e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case TextUnderlinePositionAuto:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
case TextUnderlinePositionAlphabetic:
- m_value.ident = CSSValueAlphabetic;
+ m_value.valueID = CSSValueAlphabetic;
break;
case TextUnderlinePositionUnder:
- m_value.ident = CSSValueUnder;
+ m_value.valueID = CSSValueUnder;
break;
}
@@ -2345,13 +2416,15 @@
template<> inline CSSPrimitiveValue::operator TextUnderlinePosition() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAuto:
return TextUnderlinePositionAuto;
case CSSValueAlphabetic:
return TextUnderlinePositionAlphabetic;
case CSSValueUnder:
return TextUnderlinePositionUnder;
+ default:
+ break;
}
// FIXME: Implement support for 'under left' and 'under right' values.
@@ -2364,34 +2437,36 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextSecurity e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case TSNONE:
- m_value.ident = CSSValueNone;
- break;
- case TSDISC:
- m_value.ident = CSSValueDisc;
- break;
- case TSCIRCLE:
- m_value.ident = CSSValueCircle;
- break;
- case TSSQUARE:
- m_value.ident = CSSValueSquare;
- break;
+ case TSNONE:
+ m_value.valueID = CSSValueNone;
+ break;
+ case TSDISC:
+ m_value.valueID = CSSValueDisc;
+ break;
+ case TSCIRCLE:
+ m_value.valueID = CSSValueCircle;
+ break;
+ case TSSQUARE:
+ m_value.valueID = CSSValueSquare;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator ETextSecurity() const
{
- switch (m_value.ident) {
- case CSSValueNone:
- return TSNONE;
- case CSSValueDisc:
- return TSDISC;
- case CSSValueCircle:
- return TSCIRCLE;
- case CSSValueSquare:
- return TSSQUARE;
+ switch (m_value.valueID) {
+ case CSSValueNone:
+ return TSNONE;
+ case CSSValueDisc:
+ return TSDISC;
+ case CSSValueCircle:
+ return TSCIRCLE;
+ case CSSValueSquare:
+ return TSSQUARE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2401,34 +2476,36 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextTransform e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case CAPITALIZE:
- m_value.ident = CSSValueCapitalize;
- break;
- case UPPERCASE:
- m_value.ident = CSSValueUppercase;
- break;
- case LOWERCASE:
- m_value.ident = CSSValueLowercase;
- break;
- case TTNONE:
- m_value.ident = CSSValueNone;
- break;
+ case CAPITALIZE:
+ m_value.valueID = CSSValueCapitalize;
+ break;
+ case UPPERCASE:
+ m_value.valueID = CSSValueUppercase;
+ break;
+ case LOWERCASE:
+ m_value.valueID = CSSValueLowercase;
+ break;
+ case TTNONE:
+ m_value.valueID = CSSValueNone;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator ETextTransform() const
{
- switch (m_value.ident) {
- case CSSValueCapitalize:
- return CAPITALIZE;
- case CSSValueUppercase:
- return UPPERCASE;
- case CSSValueLowercase:
- return LOWERCASE;
- case CSSValueNone:
- return TTNONE;
+ switch (m_value.valueID) {
+ case CSSValueCapitalize:
+ return CAPITALIZE;
+ case CSSValueUppercase:
+ return UPPERCASE;
+ case CSSValueLowercase:
+ return LOWERCASE;
+ case CSSValueNone:
+ return TTNONE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2438,32 +2515,32 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUnicodeBidi e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case UBNormal:
- m_value.ident = CSSValueNormal;
+ m_value.valueID = CSSValueNormal;
break;
case Embed:
- m_value.ident = CSSValueEmbed;
+ m_value.valueID = CSSValueEmbed;
break;
case Override:
- m_value.ident = CSSValueBidiOverride;
+ m_value.valueID = CSSValueBidiOverride;
break;
case Isolate:
- m_value.ident = CSSValueWebkitIsolate;
+ m_value.valueID = CSSValueWebkitIsolate;
break;
case IsolateOverride:
- m_value.ident = CSSValueWebkitIsolateOverride;
+ m_value.valueID = CSSValueWebkitIsolateOverride;
break;
case Plaintext:
- m_value.ident = CSSValueWebkitPlaintext;
+ m_value.valueID = CSSValueWebkitPlaintext;
break;
}
}
template<> inline CSSPrimitiveValue::operator EUnicodeBidi() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNormal:
return UBNormal;
case CSSValueEmbed:
@@ -2476,6 +2553,8 @@
return IsolateOverride;
case CSSValueWebkitPlaintext:
return Plaintext;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2485,29 +2564,33 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserDrag e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case DRAG_AUTO:
- m_value.ident = CSSValueAuto;
- break;
- case DRAG_NONE:
- m_value.ident = CSSValueNone;
- break;
- case DRAG_ELEMENT:
- m_value.ident = CSSValueElement;
- break;
+ case DRAG_AUTO:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case DRAG_NONE:
+ m_value.valueID = CSSValueNone;
+ break;
+ case DRAG_ELEMENT:
+ m_value.valueID = CSSValueElement;
+ break;
+ default:
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EUserDrag() const
{
- switch (m_value.ident) {
- case CSSValueAuto:
- return DRAG_AUTO;
- case CSSValueNone:
- return DRAG_NONE;
- case CSSValueElement:
- return DRAG_ELEMENT;
+ switch (m_value.valueID) {
+ case CSSValueAuto:
+ return DRAG_AUTO;
+ case CSSValueNone:
+ return DRAG_NONE;
+ case CSSValueElement:
+ return DRAG_ELEMENT;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2517,29 +2600,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserModify e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case READ_ONLY:
- m_value.ident = CSSValueReadOnly;
- break;
- case READ_WRITE:
- m_value.ident = CSSValueReadWrite;
- break;
- case READ_WRITE_PLAINTEXT_ONLY:
- m_value.ident = CSSValueReadWritePlaintextOnly;
- break;
+ case READ_ONLY:
+ m_value.valueID = CSSValueReadOnly;
+ break;
+ case READ_WRITE:
+ m_value.valueID = CSSValueReadWrite;
+ break;
+ case READ_WRITE_PLAINTEXT_ONLY:
+ m_value.valueID = CSSValueReadWritePlaintextOnly;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EUserModify() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueReadOnly:
return READ_ONLY;
case CSSValueReadWrite:
return READ_WRITE;
case CSSValueReadWritePlaintextOnly:
return READ_WRITE_PLAINTEXT_ONLY;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2549,31 +2634,33 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserSelect e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case SELECT_NONE:
- m_value.ident = CSSValueNone;
- break;
- case SELECT_TEXT:
- m_value.ident = CSSValueText;
- break;
- case SELECT_ALL:
- m_value.ident = CSSValueAll;
- break;
+ case SELECT_NONE:
+ m_value.valueID = CSSValueNone;
+ break;
+ case SELECT_TEXT:
+ m_value.valueID = CSSValueText;
+ break;
+ case SELECT_ALL:
+ m_value.valueID = CSSValueAll;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EUserSelect() const
{
- switch (m_value.ident) {
- case CSSValueAuto:
- return SELECT_TEXT;
- case CSSValueNone:
- return SELECT_NONE;
- case CSSValueText:
- return SELECT_TEXT;
- case CSSValueAll:
- return SELECT_ALL;
+ switch (m_value.valueID) {
+ case CSSValueAuto:
+ return SELECT_TEXT;
+ case CSSValueNone:
+ return SELECT_NONE;
+ case CSSValueText:
+ return SELECT_TEXT;
+ case CSSValueAll:
+ return SELECT_ALL;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2583,43 +2670,43 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVerticalAlign a)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (a) {
case TOP:
- m_value.ident = CSSValueTop;
+ m_value.valueID = CSSValueTop;
break;
case BOTTOM:
- m_value.ident = CSSValueBottom;
+ m_value.valueID = CSSValueBottom;
break;
case MIDDLE:
- m_value.ident = CSSValueMiddle;
+ m_value.valueID = CSSValueMiddle;
break;
case BASELINE:
- m_value.ident = CSSValueBaseline;
+ m_value.valueID = CSSValueBaseline;
break;
case TEXT_BOTTOM:
- m_value.ident = CSSValueTextBottom;
+ m_value.valueID = CSSValueTextBottom;
break;
case TEXT_TOP:
- m_value.ident = CSSValueTextTop;
+ m_value.valueID = CSSValueTextTop;
break;
case SUB:
- m_value.ident = CSSValueSub;
+ m_value.valueID = CSSValueSub;
break;
case SUPER:
- m_value.ident = CSSValueSuper;
+ m_value.valueID = CSSValueSuper;
break;
case BASELINE_MIDDLE:
- m_value.ident = CSSValueWebkitBaselineMiddle;
+ m_value.valueID = CSSValueWebkitBaselineMiddle;
break;
case LENGTH:
- m_value.ident = CSSValueInvalid;
+ m_value.valueID = CSSValueInvalid;
}
}
template<> inline CSSPrimitiveValue::operator EVerticalAlign() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueTop:
return TOP;
case CSSValueBottom:
@@ -2638,6 +2725,8 @@
return SUPER;
case CSSValueWebkitBaselineMiddle:
return BASELINE_MIDDLE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2647,29 +2736,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVisibility e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case VISIBLE:
- m_value.ident = CSSValueVisible;
- break;
- case HIDDEN:
- m_value.ident = CSSValueHidden;
- break;
- case COLLAPSE:
- m_value.ident = CSSValueCollapse;
- break;
+ case VISIBLE:
+ m_value.valueID = CSSValueVisible;
+ break;
+ case HIDDEN:
+ m_value.valueID = CSSValueHidden;
+ break;
+ case COLLAPSE:
+ m_value.valueID = CSSValueCollapse;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EVisibility() const
{
- switch (m_value.ident) {
- case CSSValueHidden:
- return HIDDEN;
- case CSSValueVisible:
- return VISIBLE;
- case CSSValueCollapse:
- return COLLAPSE;
+ switch (m_value.valueID) {
+ case CSSValueHidden:
+ return HIDDEN;
+ case CSSValueVisible:
+ return VISIBLE;
+ case CSSValueCollapse:
+ return COLLAPSE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2679,44 +2770,46 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWhiteSpace e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case NORMAL:
- m_value.ident = CSSValueNormal;
- break;
- case PRE:
- m_value.ident = CSSValuePre;
- break;
- case PRE_WRAP:
- m_value.ident = CSSValuePreWrap;
- break;
- case PRE_LINE:
- m_value.ident = CSSValuePreLine;
- break;
- case NOWRAP:
- m_value.ident = CSSValueNowrap;
- break;
- case KHTML_NOWRAP:
- m_value.ident = CSSValueWebkitNowrap;
- break;
+ case NORMAL:
+ m_value.valueID = CSSValueNormal;
+ break;
+ case PRE:
+ m_value.valueID = CSSValuePre;
+ break;
+ case PRE_WRAP:
+ m_value.valueID = CSSValuePreWrap;
+ break;
+ case PRE_LINE:
+ m_value.valueID = CSSValuePreLine;
+ break;
+ case NOWRAP:
+ m_value.valueID = CSSValueNowrap;
+ break;
+ case KHTML_NOWRAP:
+ m_value.valueID = CSSValueWebkitNowrap;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EWhiteSpace() const
{
- switch (m_value.ident) {
- case CSSValueWebkitNowrap:
- return KHTML_NOWRAP;
- case CSSValueNowrap:
- return NOWRAP;
- case CSSValuePre:
- return PRE;
- case CSSValuePreWrap:
- return PRE_WRAP;
- case CSSValuePreLine:
- return PRE_LINE;
- case CSSValueNormal:
- return NORMAL;
+ switch (m_value.valueID) {
+ case CSSValueWebkitNowrap:
+ return KHTML_NOWRAP;
+ case CSSValueNowrap:
+ return NOWRAP;
+ case CSSValuePre:
+ return PRE;
+ case CSSValuePreWrap:
+ return PRE_WRAP;
+ case CSSValuePreLine:
+ return PRE_LINE;
+ case CSSValueNormal:
+ return NORMAL;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2726,29 +2819,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWordBreak e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case NormalWordBreak:
- m_value.ident = CSSValueNormal;
- break;
- case BreakAllWordBreak:
- m_value.ident = CSSValueBreakAll;
- break;
- case BreakWordBreak:
- m_value.ident = CSSValueBreakWord;
- break;
+ case NormalWordBreak:
+ m_value.valueID = CSSValueNormal;
+ break;
+ case BreakAllWordBreak:
+ m_value.valueID = CSSValueBreakAll;
+ break;
+ case BreakWordBreak:
+ m_value.valueID = CSSValueBreakWord;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EWordBreak() const
{
- switch (m_value.ident) {
- case CSSValueBreakAll:
- return BreakAllWordBreak;
- case CSSValueBreakWord:
- return BreakWordBreak;
- case CSSValueNormal:
- return NormalWordBreak;
+ switch (m_value.valueID) {
+ case CSSValueBreakAll:
+ return BreakAllWordBreak;
+ case CSSValueBreakWord:
+ return BreakWordBreak;
+ case CSSValueNormal:
+ return NormalWordBreak;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2758,24 +2853,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EOverflowWrap e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case NormalOverflowWrap:
- m_value.ident = CSSValueNormal;
- break;
- case BreakOverflowWrap:
- m_value.ident = CSSValueBreakWord;
- break;
+ case NormalOverflowWrap:
+ m_value.valueID = CSSValueNormal;
+ break;
+ case BreakOverflowWrap:
+ m_value.valueID = CSSValueBreakWord;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EOverflowWrap() const
{
- switch (m_value.ident) {
- case CSSValueBreakWord:
- return BreakOverflowWrap;
- case CSSValueNormal:
- return NormalOverflowWrap;
+ switch (m_value.valueID) {
+ case CSSValueBreakWord:
+ return BreakOverflowWrap;
+ case CSSValueNormal:
+ return NormalOverflowWrap;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2785,24 +2882,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextDirection e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case LTR:
- m_value.ident = CSSValueLtr;
- break;
- case RTL:
- m_value.ident = CSSValueRtl;
- break;
+ case LTR:
+ m_value.valueID = CSSValueLtr;
+ break;
+ case RTL:
+ m_value.valueID = CSSValueRtl;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator TextDirection() const
{
- switch (m_value.ident) {
- case CSSValueLtr:
- return LTR;
- case CSSValueRtl:
- return RTL;
+ switch (m_value.valueID) {
+ case CSSValueLtr:
+ return LTR;
+ case CSSValueRtl:
+ return RTL;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2812,26 +2911,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WritingMode e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case TopToBottomWritingMode:
- m_value.ident = CSSValueHorizontalTb;
+ m_value.valueID = CSSValueHorizontalTb;
break;
case RightToLeftWritingMode:
- m_value.ident = CSSValueVerticalRl;
+ m_value.valueID = CSSValueVerticalRl;
break;
case LeftToRightWritingMode:
- m_value.ident = CSSValueVerticalLr;
+ m_value.valueID = CSSValueVerticalLr;
break;
case BottomToTopWritingMode:
- m_value.ident = CSSValueHorizontalBt;
+ m_value.valueID = CSSValueHorizontalBt;
break;
}
}
template<> inline CSSPrimitiveValue::operator WritingMode() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueHorizontalTb:
return TopToBottomWritingMode;
case CSSValueVerticalRl:
@@ -2840,6 +2939,8 @@
return LeftToRightWritingMode;
case CSSValueHorizontalBt:
return BottomToTopWritingMode;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2849,24 +2950,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextCombine e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case TextCombineNone:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
case TextCombineHorizontal:
- m_value.ident = CSSValueHorizontal;
+ m_value.valueID = CSSValueHorizontal;
break;
}
}
template<> inline CSSPrimitiveValue::operator TextCombine() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNone:
return TextCombineNone;
case CSSValueHorizontal:
return TextCombineHorizontal;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2876,24 +2979,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(RubyPosition position)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (position) {
case RubyPositionBefore:
- m_value.ident = CSSValueBefore;
+ m_value.valueID = CSSValueBefore;
break;
case RubyPositionAfter:
- m_value.ident = CSSValueAfter;
+ m_value.valueID = CSSValueAfter;
break;
}
}
template<> inline CSSPrimitiveValue::operator RubyPosition() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueBefore:
return RubyPositionBefore;
case CSSValueAfter:
return RubyPositionAfter;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2903,24 +3008,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisPosition position)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (position) {
case TextEmphasisPositionOver:
- m_value.ident = CSSValueOver;
+ m_value.valueID = CSSValueOver;
break;
case TextEmphasisPositionUnder:
- m_value.ident = CSSValueUnder;
+ m_value.valueID = CSSValueUnder;
break;
}
}
template<> inline CSSPrimitiveValue::operator TextEmphasisPosition() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueOver:
return TextEmphasisPositionOver;
case CSSValueUnder:
return TextEmphasisPositionUnder;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2930,24 +3037,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOverflow overflow)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (overflow) {
case TextOverflowClip:
- m_value.ident = CSSValueClip;
+ m_value.valueID = CSSValueClip;
break;
case TextOverflowEllipsis:
- m_value.ident = CSSValueEllipsis;
+ m_value.valueID = CSSValueEllipsis;
break;
}
}
template<> inline CSSPrimitiveValue::operator TextOverflow() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueClip:
return TextOverflowClip;
case CSSValueEllipsis:
return TextOverflowEllipsis;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2957,24 +3066,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisFill fill)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (fill) {
case TextEmphasisFillFilled:
- m_value.ident = CSSValueFilled;
+ m_value.valueID = CSSValueFilled;
break;
case TextEmphasisFillOpen:
- m_value.ident = CSSValueOpen;
+ m_value.valueID = CSSValueOpen;
break;
}
}
template<> inline CSSPrimitiveValue::operator TextEmphasisFill() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueFilled:
return TextEmphasisFillFilled;
case CSSValueOpen:
return TextEmphasisFillOpen;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -2984,35 +3095,35 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisMark mark)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (mark) {
case TextEmphasisMarkDot:
- m_value.ident = CSSValueDot;
+ m_value.valueID = CSSValueDot;
break;
case TextEmphasisMarkCircle:
- m_value.ident = CSSValueCircle;
+ m_value.valueID = CSSValueCircle;
break;
case TextEmphasisMarkDoubleCircle:
- m_value.ident = CSSValueDoubleCircle;
+ m_value.valueID = CSSValueDoubleCircle;
break;
case TextEmphasisMarkTriangle:
- m_value.ident = CSSValueTriangle;
+ m_value.valueID = CSSValueTriangle;
break;
case TextEmphasisMarkSesame:
- m_value.ident = CSSValueSesame;
+ m_value.valueID = CSSValueSesame;
break;
case TextEmphasisMarkNone:
case TextEmphasisMarkAuto:
case TextEmphasisMarkCustom:
ASSERT_NOT_REACHED();
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
}
}
template<> inline CSSPrimitiveValue::operator TextEmphasisMark() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNone:
return TextEmphasisMarkNone;
case CSSValueDot:
@@ -3025,6 +3136,8 @@
return TextEmphasisMarkTriangle;
case CSSValueSesame:
return TextEmphasisMarkSesame;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3034,26 +3147,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOrientation e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case TextOrientationSideways:
- m_value.ident = CSSValueSideways;
+ m_value.valueID = CSSValueSideways;
break;
case TextOrientationSidewaysRight:
- m_value.ident = CSSValueSidewaysRight;
+ m_value.valueID = CSSValueSidewaysRight;
break;
case TextOrientationVerticalRight:
- m_value.ident = CSSValueVerticalRight;
+ m_value.valueID = CSSValueVerticalRight;
break;
case TextOrientationUpright:
- m_value.ident = CSSValueUpright;
+ m_value.valueID = CSSValueUpright;
break;
}
}
template<> inline CSSPrimitiveValue::operator TextOrientation() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueSideways:
return TextOrientationSideways;
case CSSValueSidewaysRight:
@@ -3062,6 +3175,8 @@
return TextOrientationVerticalRight;
case CSSValueUpright:
return TextOrientationUpright;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3071,64 +3186,66 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case PE_NONE:
- m_value.ident = CSSValueNone;
- break;
- case PE_STROKE:
- m_value.ident = CSSValueStroke;
- break;
- case PE_FILL:
- m_value.ident = CSSValueFill;
- break;
- case PE_PAINTED:
- m_value.ident = CSSValuePainted;
- break;
- case PE_VISIBLE:
- m_value.ident = CSSValueVisible;
- break;
- case PE_VISIBLE_STROKE:
- m_value.ident = CSSValueVisiblestroke;
- break;
- case PE_VISIBLE_FILL:
- m_value.ident = CSSValueVisiblefill;
- break;
- case PE_VISIBLE_PAINTED:
- m_value.ident = CSSValueVisiblepainted;
- break;
- case PE_AUTO:
- m_value.ident = CSSValueAuto;
- break;
- case PE_ALL:
- m_value.ident = CSSValueAll;
- break;
+ case PE_NONE:
+ m_value.valueID = CSSValueNone;
+ break;
+ case PE_STROKE:
+ m_value.valueID = CSSValueStroke;
+ break;
+ case PE_FILL:
+ m_value.valueID = CSSValueFill;
+ break;
+ case PE_PAINTED:
+ m_value.valueID = CSSValuePainted;
+ break;
+ case PE_VISIBLE:
+ m_value.valueID = CSSValueVisible;
+ break;
+ case PE_VISIBLE_STROKE:
+ m_value.valueID = CSSValueVisiblestroke;
+ break;
+ case PE_VISIBLE_FILL:
+ m_value.valueID = CSSValueVisiblefill;
+ break;
+ case PE_VISIBLE_PAINTED:
+ m_value.valueID = CSSValueVisiblepainted;
+ break;
+ case PE_AUTO:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case PE_ALL:
+ m_value.valueID = CSSValueAll;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EPointerEvents() const
{
- switch (m_value.ident) {
- case CSSValueAll:
- return PE_ALL;
- case CSSValueAuto:
- return PE_AUTO;
- case CSSValueNone:
- return PE_NONE;
- case CSSValueVisiblepainted:
- return PE_VISIBLE_PAINTED;
- case CSSValueVisiblefill:
- return PE_VISIBLE_FILL;
- case CSSValueVisiblestroke:
- return PE_VISIBLE_STROKE;
- case CSSValueVisible:
- return PE_VISIBLE;
- case CSSValuePainted:
- return PE_PAINTED;
- case CSSValueFill:
- return PE_FILL;
- case CSSValueStroke:
- return PE_STROKE;
+ switch (m_value.valueID) {
+ case CSSValueAll:
+ return PE_ALL;
+ case CSSValueAuto:
+ return PE_AUTO;
+ case CSSValueNone:
+ return PE_NONE;
+ case CSSValueVisiblepainted:
+ return PE_VISIBLE_PAINTED;
+ case CSSValueVisiblefill:
+ return PE_VISIBLE_FILL;
+ case CSSValueVisiblestroke:
+ return PE_VISIBLE_STROKE;
+ case CSSValueVisible:
+ return PE_VISIBLE;
+ case CSSValuePainted:
+ return PE_PAINTED;
+ case CSSValueFill:
+ return PE_FILL;
+ case CSSValueStroke:
+ return PE_STROKE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3138,32 +3255,34 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontDescription::Kerning kerning)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (kerning) {
case FontDescription::AutoKerning:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
return;
case FontDescription::NormalKerning:
- m_value.ident = CSSValueNormal;
+ m_value.valueID = CSSValueNormal;
return;
case FontDescription::NoneKerning:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
return;
}
ASSERT_NOT_REACHED();
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
}
template<> inline CSSPrimitiveValue::operator FontDescription::Kerning() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAuto:
return FontDescription::AutoKerning;
case CSSValueNormal:
return FontDescription::NormalKerning;
case CSSValueNone:
return FontDescription::NoneKerning;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3173,29 +3292,29 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmoothingMode smoothing)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (smoothing) {
case AutoSmoothing:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
return;
case NoSmoothing:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
return;
case Antialiased:
- m_value.ident = CSSValueAntialiased;
+ m_value.valueID = CSSValueAntialiased;
return;
case SubpixelAntialiased:
- m_value.ident = CSSValueSubpixelAntialiased;
+ m_value.valueID = CSSValueSubpixelAntialiased;
return;
}
ASSERT_NOT_REACHED();
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
}
template<> inline CSSPrimitiveValue::operator FontSmoothingMode() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAuto:
return AutoSmoothing;
case CSSValueNone:
@@ -3204,6 +3323,8 @@
return Antialiased;
case CSSValueSubpixelAntialiased:
return SubpixelAntialiased;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3213,44 +3334,44 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontWeight weight)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (weight) {
case FontWeight900:
- m_value.ident = CSSValue900;
+ m_value.valueID = CSSValue900;
return;
case FontWeight800:
- m_value.ident = CSSValue800;
+ m_value.valueID = CSSValue800;
return;
case FontWeight700:
- m_value.ident = CSSValue700;
+ m_value.valueID = CSSValue700;
return;
case FontWeight600:
- m_value.ident = CSSValue600;
+ m_value.valueID = CSSValue600;
return;
case FontWeight500:
- m_value.ident = CSSValue500;
+ m_value.valueID = CSSValue500;
return;
case FontWeight400:
- m_value.ident = CSSValue400;
+ m_value.valueID = CSSValue400;
return;
case FontWeight300:
- m_value.ident = CSSValue300;
+ m_value.valueID = CSSValue300;
return;
case FontWeight200:
- m_value.ident = CSSValue200;
+ m_value.valueID = CSSValue200;
return;
case FontWeight100:
- m_value.ident = CSSValue100;
+ m_value.valueID = CSSValue100;
return;
}
ASSERT_NOT_REACHED();
- m_value.ident = CSSValueNormal;
+ m_value.valueID = CSSValueNormal;
}
template<> inline CSSPrimitiveValue::operator FontWeight() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueBold:
return FontWeightBold;
case CSSValueNormal:
@@ -3273,6 +3394,8 @@
return FontWeight200;
case CSSValue100:
return FontWeight100;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3282,29 +3405,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontItalic italic)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (italic) {
case FontItalicOff:
- m_value.ident = CSSValueNormal;
+ m_value.valueID = CSSValueNormal;
return;
case FontItalicOn:
- m_value.ident = CSSValueItalic;
+ m_value.valueID = CSSValueItalic;
return;
}
ASSERT_NOT_REACHED();
- m_value.ident = CSSValueNormal;
+ m_value.valueID = CSSValueNormal;
}
template<> inline CSSPrimitiveValue::operator FontItalic() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueOblique:
// FIXME: oblique is the same as italic for the moment...
case CSSValueItalic:
return FontItalicOn;
case CSSValueNormal:
return FontItalicOff;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
return FontItalicOff;
@@ -3313,27 +3438,29 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmallCaps smallCaps)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (smallCaps) {
case FontSmallCapsOff:
- m_value.ident = CSSValueNormal;
+ m_value.valueID = CSSValueNormal;
return;
case FontSmallCapsOn:
- m_value.ident = CSSValueSmallCaps;
+ m_value.valueID = CSSValueSmallCaps;
return;
}
ASSERT_NOT_REACHED();
- m_value.ident = CSSValueNormal;
+ m_value.valueID = CSSValueNormal;
}
template<> inline CSSPrimitiveValue::operator FontSmallCaps() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueSmallCaps:
return FontSmallCapsOn;
case CSSValueNormal:
return FontSmallCapsOff;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
return FontSmallCapsOff;
@@ -3342,98 +3469,70 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextRenderingMode e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case AutoTextRendering:
- m_value.ident = CSSValueAuto;
- break;
- case OptimizeSpeed:
- m_value.ident = CSSValueOptimizespeed;
- break;
- case OptimizeLegibility:
- m_value.ident = CSSValueOptimizelegibility;
- break;
- case GeometricPrecision:
- m_value.ident = CSSValueGeometricprecision;
- break;
+ case AutoTextRendering:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case OptimizeSpeed:
+ m_value.valueID = CSSValueOptimizespeed;
+ break;
+ case OptimizeLegibility:
+ m_value.valueID = CSSValueOptimizelegibility;
+ break;
+ case GeometricPrecision:
+ m_value.valueID = CSSValueGeometricprecision;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator TextRenderingMode() const
{
- switch (m_value.ident) {
- case CSSValueAuto:
- return AutoTextRendering;
- case CSSValueOptimizespeed:
- return OptimizeSpeed;
- case CSSValueOptimizelegibility:
- return OptimizeLegibility;
- case CSSValueGeometricprecision:
- return GeometricPrecision;
+ switch (m_value.valueID) {
+ case CSSValueAuto:
+ return AutoTextRendering;
+ case CSSValueOptimizespeed:
+ return OptimizeSpeed;
+ case CSSValueOptimizelegibility:
+ return OptimizeLegibility;
+ case CSSValueGeometricprecision:
+ return GeometricPrecision;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
return AutoTextRendering;
}
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColorSpace space)
- : CSSValue(PrimitiveClass)
-{
- m_primitiveUnitType = CSS_IDENT;
- switch (space) {
- case ColorSpaceDeviceRGB:
- m_value.ident = CSSValueDefault;
- break;
- case ColorSpaceSRGB:
- m_value.ident = CSSValueSrgb;
- break;
- case ColorSpaceLinearRGB:
- // CSS color correction does not support linearRGB yet.
- ASSERT_NOT_REACHED();
- m_value.ident = CSSValueDefault;
- break;
- }
-}
-
-template<> inline CSSPrimitiveValue::operator ColorSpace() const
-{
- switch (m_value.ident) {
- case CSSValueDefault:
- return ColorSpaceDeviceRGB;
- case CSSValueSrgb:
- return ColorSpaceSRGB;
- }
-
- ASSERT_NOT_REACHED();
- return ColorSpaceDeviceRGB;
-}
-
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Hyphens hyphens)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (hyphens) {
case HyphensNone:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
case HyphensManual:
- m_value.ident = CSSValueManual;
+ m_value.valueID = CSSValueManual;
break;
case HyphensAuto:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
}
}
template<> inline CSSPrimitiveValue::operator Hyphens() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNone:
return HyphensNone;
case CSSValueManual:
return HyphensManual;
case CSSValueAuto:
return HyphensAuto;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3443,29 +3542,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineSnap gridSnap)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (gridSnap) {
case LineSnapNone:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
case LineSnapBaseline:
- m_value.ident = CSSValueBaseline;
+ m_value.valueID = CSSValueBaseline;
break;
case LineSnapContain:
- m_value.ident = CSSValueContain;
+ m_value.valueID = CSSValueContain;
break;
}
}
template<> inline CSSPrimitiveValue::operator LineSnap() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNone:
return LineSnapNone;
case CSSValueBaseline:
return LineSnapBaseline;
case CSSValueContain:
return LineSnapContain;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3475,24 +3576,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineAlign lineAlign)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (lineAlign) {
case LineAlignNone:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
case LineAlignEdges:
- m_value.ident = CSSValueEdges;
+ m_value.valueID = CSSValueEdges;
break;
}
}
template<> inline CSSPrimitiveValue::operator LineAlign() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNone:
return LineAlignNone;
case CSSValueEdges:
return LineAlignEdges;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3502,36 +3605,38 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ESpeak e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case SpeakNone:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
case SpeakNormal:
- m_value.ident = CSSValueNormal;
+ m_value.valueID = CSSValueNormal;
break;
case SpeakSpellOut:
- m_value.ident = CSSValueSpellOut;
+ m_value.valueID = CSSValueSpellOut;
break;
case SpeakDigits:
- m_value.ident = CSSValueDigits;
+ m_value.valueID = CSSValueDigits;
break;
case SpeakLiteralPunctuation:
- m_value.ident = CSSValueLiteralPunctuation;
+ m_value.valueID = CSSValueLiteralPunctuation;
break;
case SpeakNoPunctuation:
- m_value.ident = CSSValueNoPunctuation;
+ m_value.valueID = CSSValueNoPunctuation;
break;
}
}
template<> inline CSSPrimitiveValue::operator Order() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueLogical:
return LogicalOrder;
case CSSValueVisual:
return VisualOrder;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3541,20 +3646,20 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Order e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case LogicalOrder:
- m_value.ident = CSSValueLogical;
+ m_value.valueID = CSSValueLogical;
break;
case VisualOrder:
- m_value.ident = CSSValueVisual;
+ m_value.valueID = CSSValueVisual;
break;
}
}
template<> inline CSSPrimitiveValue::operator ESpeak() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNone:
return SpeakNone;
case CSSValueNormal:
@@ -3567,6 +3672,8 @@
return SpeakLiteralPunctuation;
case CSSValueNoPunctuation:
return SpeakNoPunctuation;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3576,62 +3683,62 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(BlendMode blendMode)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (blendMode) {
case BlendModeNormal:
- m_value.ident = CSSValueNormal;
+ m_value.valueID = CSSValueNormal;
break;
case BlendModeMultiply:
- m_value.ident = CSSValueMultiply;
+ m_value.valueID = CSSValueMultiply;
break;
case BlendModeScreen:
- m_value.ident = CSSValueScreen;
+ m_value.valueID = CSSValueScreen;
break;
case BlendModeOverlay:
- m_value.ident = CSSValueOverlay;
+ m_value.valueID = CSSValueOverlay;
break;
case BlendModeDarken:
- m_value.ident = CSSValueDarken;
+ m_value.valueID = CSSValueDarken;
break;
case BlendModeLighten:
- m_value.ident = CSSValueLighten;
+ m_value.valueID = CSSValueLighten;
break;
case BlendModeColorDodge:
- m_value.ident = CSSValueColorDodge;
+ m_value.valueID = CSSValueColorDodge;
break;
case BlendModeColorBurn:
- m_value.ident = CSSValueColorBurn;
+ m_value.valueID = CSSValueColorBurn;
break;
case BlendModeHardLight:
- m_value.ident = CSSValueHardLight;
+ m_value.valueID = CSSValueHardLight;
break;
case BlendModeSoftLight:
- m_value.ident = CSSValueSoftLight;
+ m_value.valueID = CSSValueSoftLight;
break;
case BlendModeDifference:
- m_value.ident = CSSValueDifference;
+ m_value.valueID = CSSValueDifference;
break;
case BlendModeExclusion:
- m_value.ident = CSSValueExclusion;
+ m_value.valueID = CSSValueExclusion;
break;
case BlendModeHue:
- m_value.ident = CSSValueHue;
+ m_value.valueID = CSSValueHue;
break;
case BlendModeSaturation:
- m_value.ident = CSSValueSaturation;
+ m_value.valueID = CSSValueSaturation;
break;
case BlendModeColor:
- m_value.ident = CSSValueColor;
+ m_value.valueID = CSSValueColor;
break;
case BlendModeLuminosity:
- m_value.ident = CSSValueLuminosity;
+ m_value.valueID = CSSValueLuminosity;
break;
}
}
template<> inline CSSPrimitiveValue::operator BlendMode() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNormal:
return BlendModeNormal;
case CSSValueMultiply:
@@ -3664,6 +3771,8 @@
return BlendModeColor;
case CSSValueLuminosity:
return BlendModeLuminosity;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3673,29 +3782,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineCap e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case ButtCap:
- m_value.ident = CSSValueButt;
- break;
- case RoundCap:
- m_value.ident = CSSValueRound;
- break;
- case SquareCap:
- m_value.ident = CSSValueSquare;
- break;
+ case ButtCap:
+ m_value.valueID = CSSValueButt;
+ break;
+ case RoundCap:
+ m_value.valueID = CSSValueRound;
+ break;
+ case SquareCap:
+ m_value.valueID = CSSValueSquare;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator LineCap() const
{
- switch (m_value.ident) {
- case CSSValueButt:
- return ButtCap;
- case CSSValueRound:
- return RoundCap;
- case CSSValueSquare:
- return SquareCap;
+ switch (m_value.valueID) {
+ case CSSValueButt:
+ return ButtCap;
+ case CSSValueRound:
+ return RoundCap;
+ case CSSValueSquare:
+ return SquareCap;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3705,29 +3816,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineJoin e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case MiterJoin:
- m_value.ident = CSSValueMiter;
- break;
- case RoundJoin:
- m_value.ident = CSSValueRound;
- break;
- case BevelJoin:
- m_value.ident = CSSValueBevel;
- break;
+ case MiterJoin:
+ m_value.valueID = CSSValueMiter;
+ break;
+ case RoundJoin:
+ m_value.valueID = CSSValueRound;
+ break;
+ case BevelJoin:
+ m_value.valueID = CSSValueBevel;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator LineJoin() const
{
- switch (m_value.ident) {
- case CSSValueMiter:
- return MiterJoin;
- case CSSValueRound:
- return RoundJoin;
- case CSSValueBevel:
- return BevelJoin;
+ switch (m_value.valueID) {
+ case CSSValueMiter:
+ return MiterJoin;
+ case CSSValueRound:
+ return RoundJoin;
+ case CSSValueBevel:
+ return BevelJoin;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3737,24 +3850,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WindRule e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case RULE_NONZERO:
- m_value.ident = CSSValueNonzero;
- break;
- case RULE_EVENODD:
- m_value.ident = CSSValueEvenodd;
- break;
+ case RULE_NONZERO:
+ m_value.valueID = CSSValueNonzero;
+ break;
+ case RULE_EVENODD:
+ m_value.valueID = CSSValueEvenodd;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator WindRule() const
{
- switch (m_value.ident) {
- case CSSValueNonzero:
- return RULE_NONZERO;
- case CSSValueEvenodd:
- return RULE_EVENODD;
+ switch (m_value.valueID) {
+ case CSSValueNonzero:
+ return RULE_NONZERO;
+ case CSSValueEvenodd:
+ return RULE_EVENODD;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3765,74 +3880,76 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EAlignmentBaseline e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case AB_AUTO:
- m_value.ident = CSSValueAuto;
- break;
- case AB_BASELINE:
- m_value.ident = CSSValueBaseline;
- break;
- case AB_BEFORE_EDGE:
- m_value.ident = CSSValueBeforeEdge;
- break;
- case AB_TEXT_BEFORE_EDGE:
- m_value.ident = CSSValueTextBeforeEdge;
- break;
- case AB_MIDDLE:
- m_value.ident = CSSValueMiddle;
- break;
- case AB_CENTRAL:
- m_value.ident = CSSValueCentral;
- break;
- case AB_AFTER_EDGE:
- m_value.ident = CSSValueAfterEdge;
- break;
- case AB_TEXT_AFTER_EDGE:
- m_value.ident = CSSValueTextAfterEdge;
- break;
- case AB_IDEOGRAPHIC:
- m_value.ident = CSSValueIdeographic;
- break;
- case AB_ALPHABETIC:
- m_value.ident = CSSValueAlphabetic;
- break;
- case AB_HANGING:
- m_value.ident = CSSValueHanging;
- break;
- case AB_MATHEMATICAL:
- m_value.ident = CSSValueMathematical;
- break;
+ case AB_AUTO:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case AB_BASELINE:
+ m_value.valueID = CSSValueBaseline;
+ break;
+ case AB_BEFORE_EDGE:
+ m_value.valueID = CSSValueBeforeEdge;
+ break;
+ case AB_TEXT_BEFORE_EDGE:
+ m_value.valueID = CSSValueTextBeforeEdge;
+ break;
+ case AB_MIDDLE:
+ m_value.valueID = CSSValueMiddle;
+ break;
+ case AB_CENTRAL:
+ m_value.valueID = CSSValueCentral;
+ break;
+ case AB_AFTER_EDGE:
+ m_value.valueID = CSSValueAfterEdge;
+ break;
+ case AB_TEXT_AFTER_EDGE:
+ m_value.valueID = CSSValueTextAfterEdge;
+ break;
+ case AB_IDEOGRAPHIC:
+ m_value.valueID = CSSValueIdeographic;
+ break;
+ case AB_ALPHABETIC:
+ m_value.valueID = CSSValueAlphabetic;
+ break;
+ case AB_HANGING:
+ m_value.valueID = CSSValueHanging;
+ break;
+ case AB_MATHEMATICAL:
+ m_value.valueID = CSSValueMathematical;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EAlignmentBaseline() const
{
- switch (m_value.ident) {
- case CSSValueAuto:
- return AB_AUTO;
- case CSSValueBaseline:
- return AB_BASELINE;
- case CSSValueBeforeEdge:
- return AB_BEFORE_EDGE;
- case CSSValueTextBeforeEdge:
- return AB_TEXT_BEFORE_EDGE;
- case CSSValueMiddle:
- return AB_MIDDLE;
- case CSSValueCentral:
- return AB_CENTRAL;
- case CSSValueAfterEdge:
- return AB_AFTER_EDGE;
- case CSSValueTextAfterEdge:
- return AB_TEXT_AFTER_EDGE;
- case CSSValueIdeographic:
- return AB_IDEOGRAPHIC;
- case CSSValueAlphabetic:
- return AB_ALPHABETIC;
- case CSSValueHanging:
- return AB_HANGING;
- case CSSValueMathematical:
- return AB_MATHEMATICAL;
+ switch (m_value.valueID) {
+ case CSSValueAuto:
+ return AB_AUTO;
+ case CSSValueBaseline:
+ return AB_BASELINE;
+ case CSSValueBeforeEdge:
+ return AB_BEFORE_EDGE;
+ case CSSValueTextBeforeEdge:
+ return AB_TEXT_BEFORE_EDGE;
+ case CSSValueMiddle:
+ return AB_MIDDLE;
+ case CSSValueCentral:
+ return AB_CENTRAL;
+ case CSSValueAfterEdge:
+ return AB_AFTER_EDGE;
+ case CSSValueTextAfterEdge:
+ return AB_TEXT_AFTER_EDGE;
+ case CSSValueIdeographic:
+ return AB_IDEOGRAPHIC;
+ case CSSValueAlphabetic:
+ return AB_ALPHABETIC;
+ case CSSValueHanging:
+ return AB_HANGING;
+ case CSSValueMathematical:
+ return AB_MATHEMATICAL;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3842,24 +3959,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBorderCollapse e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case BSEPARATE:
- m_value.ident = CSSValueSeparate;
+ m_value.valueID = CSSValueSeparate;
break;
case BCOLLAPSE:
- m_value.ident = CSSValueCollapse;
+ m_value.valueID = CSSValueCollapse;
break;
}
}
template<> inline CSSPrimitiveValue::operator EBorderCollapse() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueSeparate:
return BSEPARATE;
case CSSValueCollapse:
return BCOLLAPSE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3869,24 +3988,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBorderFit e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case BorderFitBorder:
- m_value.ident = CSSValueBorder;
+ m_value.valueID = CSSValueBorder;
break;
case BorderFitLines:
- m_value.ident = CSSValueLines;
+ m_value.valueID = CSSValueLines;
break;
}
}
template<> inline CSSPrimitiveValue::operator EBorderFit() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueBorder:
return BorderFitBorder;
case CSSValueLines:
return BorderFitLines;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3896,26 +4017,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EImageRendering e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case ImageRenderingAuto:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
case ImageRenderingOptimizeSpeed:
- m_value.ident = CSSValueOptimizespeed;
+ m_value.valueID = CSSValueOptimizespeed;
break;
case ImageRenderingOptimizeQuality:
- m_value.ident = CSSValueOptimizequality;
+ m_value.valueID = CSSValueOptimizequality;
break;
case ImageRenderingOptimizeContrast:
- m_value.ident = CSSValueWebkitOptimizeContrast;
+ m_value.valueID = CSSValueWebkitOptimizeContrast;
break;
}
}
template<> inline CSSPrimitiveValue::operator EImageRendering() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAuto:
return ImageRenderingAuto;
case CSSValueOptimizespeed:
@@ -3924,6 +4045,8 @@
return ImageRenderingOptimizeQuality;
case CSSValueWebkitOptimizeContrast:
return ImageRenderingOptimizeContrast;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3933,24 +4056,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETransformStyle3D e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case TransformStyle3DFlat:
- m_value.ident = CSSValueFlat;
+ m_value.valueID = CSSValueFlat;
break;
case TransformStyle3DPreserve3D:
- m_value.ident = CSSValuePreserve3d;
+ m_value.valueID = CSSValuePreserve3d;
break;
}
}
template<> inline CSSPrimitiveValue::operator ETransformStyle3D() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueFlat:
return TransformStyle3DFlat;
case CSSValuePreserve3d:
return TransformStyle3DPreserve3D;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3960,29 +4085,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColumnAxis e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case HorizontalColumnAxis:
- m_value.ident = CSSValueHorizontal;
+ m_value.valueID = CSSValueHorizontal;
break;
case VerticalColumnAxis:
- m_value.ident = CSSValueVertical;
+ m_value.valueID = CSSValueVertical;
break;
case AutoColumnAxis:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
}
}
template<> inline CSSPrimitiveValue::operator ColumnAxis() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueHorizontal:
return HorizontalColumnAxis;
case CSSValueVertical:
return VerticalColumnAxis;
case CSSValueAuto:
return AutoColumnAxis;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -3992,24 +4119,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColumnProgression e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case NormalColumnProgression:
- m_value.ident = CSSValueNormal;
+ m_value.valueID = CSSValueNormal;
break;
case ReverseColumnProgression:
- m_value.ident = CSSValueReverse;
+ m_value.valueID = CSSValueReverse;
break;
}
}
template<> inline CSSPrimitiveValue::operator ColumnProgression() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNormal:
return NormalColumnProgression;
case CSSValueReverse:
return ReverseColumnProgression;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4019,32 +4148,32 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WrapFlow wrapFlow)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (wrapFlow) {
case WrapFlowAuto:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
case WrapFlowBoth:
- m_value.ident = CSSValueBoth;
+ m_value.valueID = CSSValueBoth;
break;
case WrapFlowStart:
- m_value.ident = CSSValueStart;
+ m_value.valueID = CSSValueStart;
break;
case WrapFlowEnd:
- m_value.ident = CSSValueEnd;
+ m_value.valueID = CSSValueEnd;
break;
case WrapFlowMaximum:
- m_value.ident = CSSValueMaximum;
+ m_value.valueID = CSSValueMaximum;
break;
case WrapFlowClear:
- m_value.ident = CSSValueClear;
+ m_value.valueID = CSSValueClear;
break;
}
}
template<> inline CSSPrimitiveValue::operator WrapFlow() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAuto:
return WrapFlowAuto;
case CSSValueBoth:
@@ -4057,6 +4186,8 @@
return WrapFlowMaximum;
case CSSValueClear:
return WrapFlowClear;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4066,24 +4197,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WrapThrough wrapThrough)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (wrapThrough) {
case WrapThroughWrap:
- m_value.ident = CSSValueWrap;
+ m_value.valueID = CSSValueWrap;
break;
case WrapThroughNone:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
}
}
template<> inline CSSPrimitiveValue::operator WrapThrough() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueWrap:
return WrapThroughWrap;
case CSSValueNone:
return WrapThroughNone;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4092,13 +4225,15 @@
template<> inline CSSPrimitiveValue::operator GridAutoFlow() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNone:
return AutoFlowNone;
case CSSValueColumn:
return AutoFlowColumn;
case CSSValueRow:
return AutoFlowRow;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4109,16 +4244,16 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(GridAutoFlow flow)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (flow) {
case AutoFlowNone:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
case AutoFlowColumn:
- m_value.ident = CSSValueColumn;
+ m_value.valueID = CSSValueColumn;
break;
case AutoFlowRow:
- m_value.ident = CSSValueRow;
+ m_value.valueID = CSSValueRow;
break;
}
}
@@ -4147,7 +4282,7 @@
return Length(getDoubleValue(), Percent);
if ((supported & FractionConversion) && isNumber())
return Length(getDoubleValue() * 100.0, Percent);
- if ((supported & AutoConversion) && getIdent() == CSSValueAuto)
+ if ((supported & AutoConversion) && getValueID() == CSSValueAuto)
return Length(Auto);
if ((supported & CalculatedConversion) && isCalculated())
return Length(cssCalcValue()->toCalcValue(style, rootStyle, multiplier));
@@ -4159,29 +4294,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBufferedRendering e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case BR_AUTO:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
case BR_DYNAMIC:
- m_value.ident = CSSValueDynamic;
+ m_value.valueID = CSSValueDynamic;
break;
case BR_STATIC:
- m_value.ident = CSSValueStatic;
+ m_value.valueID = CSSValueStatic;
break;
}
}
template<> inline CSSPrimitiveValue::operator EBufferedRendering() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAuto:
return BR_AUTO;
case CSSValueDynamic:
return BR_DYNAMIC;
case CSSValueStatic:
return BR_STATIC;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4191,29 +4328,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorInterpolation e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case CI_AUTO:
- m_value.ident = CSSValueAuto;
- break;
- case CI_SRGB:
- m_value.ident = CSSValueSrgb;
- break;
- case CI_LINEARRGB:
- m_value.ident = CSSValueLinearrgb;
- break;
+ case CI_AUTO:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case CI_SRGB:
+ m_value.valueID = CSSValueSrgb;
+ break;
+ case CI_LINEARRGB:
+ m_value.valueID = CSSValueLinearrgb;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EColorInterpolation() const
{
- switch (m_value.ident) {
- case CSSValueSrgb:
- return CI_SRGB;
- case CSSValueLinearrgb:
- return CI_LINEARRGB;
- case CSSValueAuto:
- return CI_AUTO;
+ switch (m_value.valueID) {
+ case CSSValueSrgb:
+ return CI_SRGB;
+ case CSSValueLinearrgb:
+ return CI_LINEARRGB;
+ case CSSValueAuto:
+ return CI_AUTO;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4223,29 +4362,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorRendering e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case CR_AUTO:
- m_value.ident = CSSValueAuto;
- break;
- case CR_OPTIMIZESPEED:
- m_value.ident = CSSValueOptimizespeed;
- break;
- case CR_OPTIMIZEQUALITY:
- m_value.ident = CSSValueOptimizequality;
- break;
+ case CR_AUTO:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case CR_OPTIMIZESPEED:
+ m_value.valueID = CSSValueOptimizespeed;
+ break;
+ case CR_OPTIMIZEQUALITY:
+ m_value.valueID = CSSValueOptimizequality;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EColorRendering() const
{
- switch (m_value.ident) {
- case CSSValueOptimizespeed:
- return CR_OPTIMIZESPEED;
- case CSSValueOptimizequality:
- return CR_OPTIMIZEQUALITY;
- case CSSValueAuto:
- return CR_AUTO;
+ switch (m_value.valueID) {
+ case CSSValueOptimizespeed:
+ return CR_OPTIMIZESPEED;
+ case CSSValueOptimizequality:
+ return CR_OPTIMIZEQUALITY;
+ case CSSValueAuto:
+ return CR_AUTO;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4255,74 +4396,76 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDominantBaseline e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case DB_AUTO:
- m_value.ident = CSSValueAuto;
- break;
- case DB_USE_SCRIPT:
- m_value.ident = CSSValueUseScript;
- break;
- case DB_NO_CHANGE:
- m_value.ident = CSSValueNoChange;
- break;
- case DB_RESET_SIZE:
- m_value.ident = CSSValueResetSize;
- break;
- case DB_CENTRAL:
- m_value.ident = CSSValueCentral;
- break;
- case DB_MIDDLE:
- m_value.ident = CSSValueMiddle;
- break;
- case DB_TEXT_BEFORE_EDGE:
- m_value.ident = CSSValueTextBeforeEdge;
- break;
- case DB_TEXT_AFTER_EDGE:
- m_value.ident = CSSValueTextAfterEdge;
- break;
- case DB_IDEOGRAPHIC:
- m_value.ident = CSSValueIdeographic;
- break;
- case DB_ALPHABETIC:
- m_value.ident = CSSValueAlphabetic;
- break;
- case DB_HANGING:
- m_value.ident = CSSValueHanging;
- break;
- case DB_MATHEMATICAL:
- m_value.ident = CSSValueMathematical;
- break;
+ case DB_AUTO:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case DB_USE_SCRIPT:
+ m_value.valueID = CSSValueUseScript;
+ break;
+ case DB_NO_CHANGE:
+ m_value.valueID = CSSValueNoChange;
+ break;
+ case DB_RESET_SIZE:
+ m_value.valueID = CSSValueResetSize;
+ break;
+ case DB_CENTRAL:
+ m_value.valueID = CSSValueCentral;
+ break;
+ case DB_MIDDLE:
+ m_value.valueID = CSSValueMiddle;
+ break;
+ case DB_TEXT_BEFORE_EDGE:
+ m_value.valueID = CSSValueTextBeforeEdge;
+ break;
+ case DB_TEXT_AFTER_EDGE:
+ m_value.valueID = CSSValueTextAfterEdge;
+ break;
+ case DB_IDEOGRAPHIC:
+ m_value.valueID = CSSValueIdeographic;
+ break;
+ case DB_ALPHABETIC:
+ m_value.valueID = CSSValueAlphabetic;
+ break;
+ case DB_HANGING:
+ m_value.valueID = CSSValueHanging;
+ break;
+ case DB_MATHEMATICAL:
+ m_value.valueID = CSSValueMathematical;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator EDominantBaseline() const
{
- switch (m_value.ident) {
- case CSSValueAuto:
- return DB_AUTO;
- case CSSValueUseScript:
- return DB_USE_SCRIPT;
- case CSSValueNoChange:
- return DB_NO_CHANGE;
- case CSSValueResetSize:
- return DB_RESET_SIZE;
- case CSSValueIdeographic:
- return DB_IDEOGRAPHIC;
- case CSSValueAlphabetic:
- return DB_ALPHABETIC;
- case CSSValueHanging:
- return DB_HANGING;
- case CSSValueMathematical:
- return DB_MATHEMATICAL;
- case CSSValueCentral:
- return DB_CENTRAL;
- case CSSValueMiddle:
- return DB_MIDDLE;
- case CSSValueTextAfterEdge:
- return DB_TEXT_AFTER_EDGE;
- case CSSValueTextBeforeEdge:
- return DB_TEXT_BEFORE_EDGE;
+ switch (m_value.valueID) {
+ case CSSValueAuto:
+ return DB_AUTO;
+ case CSSValueUseScript:
+ return DB_USE_SCRIPT;
+ case CSSValueNoChange:
+ return DB_NO_CHANGE;
+ case CSSValueResetSize:
+ return DB_RESET_SIZE;
+ case CSSValueIdeographic:
+ return DB_IDEOGRAPHIC;
+ case CSSValueAlphabetic:
+ return DB_ALPHABETIC;
+ case CSSValueHanging:
+ return DB_HANGING;
+ case CSSValueMathematical:
+ return DB_MATHEMATICAL;
+ case CSSValueCentral:
+ return DB_CENTRAL;
+ case CSSValueMiddle:
+ return DB_MIDDLE;
+ case CSSValueTextAfterEdge:
+ return DB_TEXT_AFTER_EDGE;
+ case CSSValueTextBeforeEdge:
+ return DB_TEXT_BEFORE_EDGE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4332,26 +4475,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EShapeRendering e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case SR_AUTO:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
case SR_OPTIMIZESPEED:
- m_value.ident = CSSValueOptimizespeed;
+ m_value.valueID = CSSValueOptimizespeed;
break;
case SR_CRISPEDGES:
- m_value.ident = CSSValueCrispedges;
+ m_value.valueID = CSSValueCrispedges;
break;
case SR_GEOMETRICPRECISION:
- m_value.ident = CSSValueGeometricprecision;
+ m_value.valueID = CSSValueGeometricprecision;
break;
}
}
template<> inline CSSPrimitiveValue::operator EShapeRendering() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueAuto:
return SR_AUTO;
case CSSValueOptimizespeed:
@@ -4360,6 +4503,8 @@
return SR_CRISPEDGES;
case CSSValueGeometricprecision:
return SR_GEOMETRICPRECISION;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4369,29 +4514,31 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAnchor e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case TA_START:
- m_value.ident = CSSValueStart;
- break;
- case TA_MIDDLE:
- m_value.ident = CSSValueMiddle;
- break;
- case TA_END:
- m_value.ident = CSSValueEnd;
- break;
+ case TA_START:
+ m_value.valueID = CSSValueStart;
+ break;
+ case TA_MIDDLE:
+ m_value.valueID = CSSValueMiddle;
+ break;
+ case TA_END:
+ m_value.valueID = CSSValueEnd;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator ETextAnchor() const
{
- switch (m_value.ident) {
- case CSSValueStart:
- return TA_START;
- case CSSValueMiddle:
- return TA_MIDDLE;
- case CSSValueEnd:
- return TA_END;
+ switch (m_value.valueID) {
+ case CSSValueStart:
+ return TA_START;
+ case CSSValueMiddle:
+ return TA_MIDDLE;
+ case CSSValueEnd:
+ return TA_END;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4401,32 +4548,32 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(SVGWritingMode e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
- case WM_LRTB:
- m_value.ident = CSSValueLrTb;
- break;
- case WM_LR:
- m_value.ident = CSSValueLr;
- break;
- case WM_RLTB:
- m_value.ident = CSSValueRlTb;
- break;
- case WM_RL:
- m_value.ident = CSSValueRl;
- break;
- case WM_TBRL:
- m_value.ident = CSSValueTbRl;
- break;
- case WM_TB:
- m_value.ident = CSSValueTb;
- break;
+ case WM_LRTB:
+ m_value.valueID = CSSValueLrTb;
+ break;
+ case WM_LR:
+ m_value.valueID = CSSValueLr;
+ break;
+ case WM_RLTB:
+ m_value.valueID = CSSValueRlTb;
+ break;
+ case WM_RL:
+ m_value.valueID = CSSValueRl;
+ break;
+ case WM_TBRL:
+ m_value.valueID = CSSValueTbRl;
+ break;
+ case WM_TB:
+ m_value.valueID = CSSValueTb;
+ break;
}
}
template<> inline CSSPrimitiveValue::operator SVGWritingMode() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueLrTb:
return WM_LRTB;
case CSSValueLr:
@@ -4439,6 +4586,8 @@
return WM_TBRL;
case CSSValueTb:
return WM_TB;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4448,24 +4597,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVectorEffect e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case VE_NONE:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
case VE_NON_SCALING_STROKE:
- m_value.ident = CSSValueNonScalingStroke;
+ m_value.valueID = CSSValueNonScalingStroke;
break;
}
}
template<> inline CSSPrimitiveValue::operator EVectorEffect() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNone:
return VE_NONE;
case CSSValueNonScalingStroke:
return VE_NON_SCALING_STROKE;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4475,24 +4626,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMaskType e)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case MT_LUMINANCE:
- m_value.ident = CSSValueLuminance;
+ m_value.valueID = CSSValueLuminance;
break;
case MT_ALPHA:
- m_value.ident = CSSValueAlpha;
+ m_value.valueID = CSSValueAlpha;
break;
}
}
template<> inline CSSPrimitiveValue::operator EMaskType() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueLuminance:
return MT_LUMINANCE;
case CSSValueAlpha:
return MT_ALPHA;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
@@ -4502,24 +4655,26 @@
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TouchAction t)
: CSSValue(PrimitiveClass)
{
- m_primitiveUnitType = CSS_IDENT;
+ m_primitiveUnitType = CSS_VALUE_ID;
switch (t) {
case TouchActionNone:
- m_value.ident = CSSValueNone;
+ m_value.valueID = CSSValueNone;
break;
case TouchActionAuto:
- m_value.ident = CSSValueAuto;
+ m_value.valueID = CSSValueAuto;
break;
}
}
template<> inline CSSPrimitiveValue::operator TouchAction() const
{
- switch (m_value.ident) {
+ switch (m_value.valueID) {
case CSSValueNone:
return TouchActionNone;
case CSSValueAuto:
return TouchActionAuto;
+ default:
+ break;
}
ASSERT_NOT_REACHED();
diff --git a/Source/core/css/CSSProperties.in b/Source/core/css/CSSProperties.in
index e945fb0..c842848 100644
--- a/Source/core/css/CSSProperties.in
+++ b/Source/core/css/CSSProperties.in
@@ -2,15 +2,31 @@
// should use this for make_css_property_names.py
// Note: Mandatory blank line to skip parameter parsing phase
+background-attachment custom_all
+background-blend-mode custom_all
+background-clip custom_all
+background-color custom_all
+background-image custom_all
+background-origin custom_all
+background-position-x custom_all
+background-position-y custom_all
+background-repeat-x custom_all
+background-repeat-y custom_all
+background-size custom_all
+border-bottom-color custom_all
border-bottom-style type_name=EBorderStyle, initial=initialBorderStyle
border-collapse
+border-left-color custom_all
border-left-style type_name=EBorderStyle, initial=initialBorderStyle
+border-right-color custom_all
border-right-style type_name=EBorderStyle, initial=initialBorderStyle
+border-top-color custom_all
border-top-style type_name=EBorderStyle, initial=initialBorderStyle
bottom apply_type=length, initial=initialOffset, use_auto
box-sizing
caption-side
clear
+color custom_all
empty-cells type_name=EEmptyCell
float type_name=EFloat, name_for_methods=Floating
height apply_type=length, initial=initialSize, use_auto, use_intrinsic
@@ -28,6 +44,7 @@
min-width apply_type=length, initial=initialMinSize, use_auto, use_intrinsic
mix-blend-mode type_name=BlendMode, name_for_methods=BlendMode
opacity type_name=float
+outline-color custom_all
overflow-wrap
overflow-x type_name=EOverflow
overflow-y type_name=EOverflow
@@ -44,6 +61,8 @@
speak
table-layout
tab-size type_name=unsigned
+text-decoration-color custom_all
+text-decoration-style type_name=TextDecorationStyle
text-overflow type_name=TextOverflow
text-transform
top apply_type=length, initial=initialOffset, use_auto
@@ -55,13 +74,19 @@
word-break
// UAs must treat 'word-wrap' as an alternate name for the 'overflow-wrap' property. So using the same handlers.
word-wrap name_for_methods=OverflowWrap
+zoom custom_all
-webkit-align-content
-webkit-align-items
-webkit-align-self type_name=EAlignItems
-webkit-appearance type_name=ControlPart
-webkit-backface-visibility
+-webkit-background-clip use_handlers_for=CSSPropertyBackgroundClip
+-webkit-background-composite custom_all
+-webkit-background-origin use_handlers_for=CSSPropertyBackgroundOrigin
+-webkit-background-size use_handlers_for=CSSPropertyBackgroundSize
-webkit-border-fit
+-webkit-border-image initial=initialNinePieceImage, custom_value
-webkit-box-align type_name=EBoxAlignment
-webkit-box-decoration-break
-webkit-box-direction
@@ -71,12 +96,12 @@
-webkit-box-ordinal-group type_name=unsigned int
-webkit-box-orient
-webkit-box-pack
--webkit-color-correction type_name=ColorSpace, name_for_methods=ColorSpace
-webkit-column-axis type_name=ColumnAxis
-webkit-column-break-after type_name=EPageBreak, initial=initialPageBreak
-webkit-column-break-before type_name=EPageBreak, initial=initialPageBreak
-webkit-column-break-inside type_name=EPageBreak, initial=initialPageBreak
-webkit-column-progression type_name=ColumnProgression
+-webkit-column-rule-color custom_all
-webkit-column-rule-style type_name=EBorderStyle, initial=initialBorderStyle
-webkit-column-span type_name=ColumnSpan
-webkit-flex-basis apply_type=length, use_auto
@@ -84,7 +109,10 @@
-webkit-flex-grow type_name=float
-webkit-flex-shrink type_name=float
-webkit-flex-wrap
--webkit-grid-auto-flow type_name=GridAutoFlow
+grid-auto-flow type_name=GridAutoFlow
+-webkit-hyphenate-limit-after type_name=short, name_for_methods=HyphenationLimitAfter, custom_value
+-webkit-hyphenate-limit-before type_name=short, name_for_methods=HyphenationLimitBefore, custom_value
+-webkit-hyphenate-limit-lines type_name=short, name_for_methods=HyphenationLimitLines, custom_value
-webkit-hyphens type_name=Hyphens
-webkit-justify-content
-webkit-line-align type_name=LineAlign
@@ -96,7 +124,19 @@
-webkit-margin-bottom-collapse type_name=EMarginCollapse, name_for_methods=MarginAfterCollapse
-webkit-margin-top-collapse type_name=EMarginCollapse, name_for_methods=MarginBeforeCollapse
-webkit-marquee-direction
+-webkit-marquee-increment custom_value
+-webkit-marquee-repetition type_name=int, name_for_methods=MarqueeLoopCount, custom_value
-webkit-marquee-style name_for_methods=MarqueeBehavior
+-webkit-mask-box-image initial=initialNinePieceImage, custom_value
+-webkit-mask-clip custom_all
+-webkit-mask-composite custom_all
+-webkit-mask-image custom_all
+-webkit-mask-origin custom_all
+-webkit-mask-position-x custom_all
+-webkit-mask-position-y custom_all
+-webkit-mask-repeat-x custom_all
+-webkit-mask-repeat-y custom_all
+-webkit-mask-size custom_all
-webkit-order type_name=int
-webkit-perspective-origin-x apply_type=length
-webkit-perspective-origin-y apply_type=length
@@ -111,9 +151,11 @@
-webkit-shape-padding apply_type=length
-webkit-text-align-last type_name=TextAlignLast, condition=CSS3_TEXT
-webkit-text-combine type_name=TextCombine
--webkit-text-decoration-style type_name=TextDecorationStyle, condition=CSS3_TEXT
+-webkit-text-emphasis-color custom_all
-webkit-text-emphasis-position type_name=TextEmphasisPosition
+-webkit-text-fill-color custom_all
-webkit-text-security
+-webkit-text-stroke-color custom_all
-webkit-transform-origin-x apply_type=length
-webkit-transform-origin-y apply_type=length
-webkit-transform-style name_for_methods=TransformStyle3D
diff --git a/Source/core/css/CSSProperty.cpp b/Source/core/css/CSSProperty.cpp
index 782b7f4..a42cde4 100644
--- a/Source/core/css/CSSProperty.cpp
+++ b/Source/core/css/CSSProperty.cpp
@@ -303,6 +303,7 @@
case CSSPropertyTextAlign:
case CSSPropertyTextAnchor:
case CSSPropertyTextDecoration:
+ case CSSPropertyTextDecorationLine:
case CSSPropertyTextIndent:
case CSSPropertyTextRendering:
case CSSPropertyTextShadow:
@@ -313,7 +314,6 @@
case CSSPropertyWebkitBorderHorizontalSpacing:
case CSSPropertyWebkitBorderVerticalSpacing:
case CSSPropertyWebkitBoxDirection:
- case CSSPropertyWebkitColorCorrection:
case CSSPropertyWebkitFontFeatureSettings:
case CSSPropertyWebkitFontKerning:
case CSSPropertyWebkitFontSmoothing:
@@ -339,7 +339,6 @@
case CSSPropertyWebkitTapHighlightColor:
case CSSPropertyWebkitTextCombine:
#if ENABLE(CSS3_TEXT)
- case CSSPropertyWebkitTextDecorationLine:
case CSSPropertyWebkitTextAlignLast:
case CSSPropertyWebkitTextUnderlinePosition:
#endif // CSS3_TEXT
@@ -471,6 +470,8 @@
case CSSPropertyStopColor:
case CSSPropertyStopOpacity:
case CSSPropertyTableLayout:
+ case CSSPropertyTextDecorationStyle:
+ case CSSPropertyTextDecorationColor:
case CSSPropertyTextLineThroughColor:
case CSSPropertyTextLineThroughMode:
case CSSPropertyTextLineThroughStyle:
@@ -566,17 +567,18 @@
case CSSPropertyWebkitFlexShrink:
case CSSPropertyWebkitFlexWrap:
case CSSPropertyWebkitFontSizeDelta:
- case CSSPropertyWebkitGridAfter:
- case CSSPropertyWebkitGridAutoColumns:
- case CSSPropertyWebkitGridAutoFlow:
- case CSSPropertyWebkitGridAutoRows:
- case CSSPropertyWebkitGridBefore:
- case CSSPropertyWebkitGridColumn:
- case CSSPropertyWebkitGridColumns:
- case CSSPropertyWebkitGridEnd:
- case CSSPropertyWebkitGridRow:
- case CSSPropertyWebkitGridRows:
- case CSSPropertyWebkitGridStart:
+ case CSSPropertyGridAfter:
+ case CSSPropertyGridAutoColumns:
+ case CSSPropertyGridAutoFlow:
+ case CSSPropertyGridAutoRows:
+ case CSSPropertyGridBefore:
+ case CSSPropertyGridColumn:
+ case CSSPropertyGridColumns:
+ case CSSPropertyGridEnd:
+ case CSSPropertyGridRow:
+ case CSSPropertyGridRows:
+ case CSSPropertyGridStart:
+ case CSSPropertyGridArea:
case CSSPropertyWebkitJustifyContent:
case CSSPropertyWebkitLineClamp:
case CSSPropertyWebkitLogicalHeight:
@@ -627,10 +629,6 @@
case CSSPropertyWebkitPerspectiveOrigin:
case CSSPropertyWebkitPerspectiveOriginX:
case CSSPropertyWebkitPerspectiveOriginY:
-#if ENABLE(CSS3_TEXT)
- case CSSPropertyWebkitTextDecorationStyle:
- case CSSPropertyWebkitTextDecorationColor:
-#endif // CSS3_TEXT
case CSSPropertyWebkitTransform:
case CSSPropertyWebkitTransformOrigin:
case CSSPropertyWebkitTransformOriginX:
diff --git a/Source/core/css/CSSPropertyNames.in b/Source/core/css/CSSPropertyNames.in
index 2a18d74..2b6042c 100644
--- a/Source/core/css/CSSPropertyNames.in
+++ b/Source/core/css/CSSPropertyNames.in
@@ -156,6 +156,9 @@
tab-size
text-align
text-decoration
+text-decoration-line
+text-decoration-style
+text-decoration-color
text-indent
text-line-through-color
text-line-through-mode
@@ -246,7 +249,6 @@
-webkit-box-pack
-webkit-box-reflect
-webkit-box-shadow
--webkit-color-correction
-webkit-column-axis
-webkit-column-break-after
-webkit-column-break-before
@@ -275,17 +277,18 @@
-webkit-flex-wrap
-webkit-justify-content
-webkit-font-size-delta
--webkit-grid-auto-columns
--webkit-grid-auto-rows
--webkit-grid-columns
--webkit-grid-rows
--webkit-grid-start
--webkit-grid-end
--webkit-grid-before
--webkit-grid-after
--webkit-grid-column
--webkit-grid-row
--webkit-grid-auto-flow
+grid-auto-columns
+grid-auto-rows
+grid-columns
+grid-rows
+grid-start
+grid-end
+grid-before
+grid-after
+grid-column
+grid-row
+grid-auto-flow
+grid-area
-webkit-highlight
-webkit-hyphenate-character
-webkit-hyphenate-limit-after
@@ -352,9 +355,6 @@
-webkit-ruby-position
-webkit-text-combine
-epub-text-combine alias_for=-webkit-text-combine
--webkit-text-decoration-line condition=CSS3_TEXT
--webkit-text-decoration-style condition=CSS3_TEXT
--webkit-text-decoration-color condition=CSS3_TEXT
-webkit-text-align-last condition=CSS3_TEXT
-webkit-text-underline-position condition=CSS3_TEXT
-webkit-text-decorations-in-effect
diff --git a/Source/core/css/WebKitCSSRegionRule.cpp b/Source/core/css/CSSRegionRule.cpp
similarity index 88%
rename from Source/core/css/WebKitCSSRegionRule.cpp
rename to Source/core/css/CSSRegionRule.cpp
index 704c912..7a34ab1 100644
--- a/Source/core/css/WebKitCSSRegionRule.cpp
+++ b/Source/core/css/CSSRegionRule.cpp
@@ -30,23 +30,23 @@
#include "config.h"
-#include "core/css/WebKitCSSRegionRule.h"
+#include "core/css/CSSRegionRule.h"
#include "RuntimeEnabledFeatures.h"
#include "core/css/CSSParser.h"
#include "core/css/CSSRuleList.h"
#include "core/css/StyleRule.h"
-#include <wtf/MemoryInstrumentationVector.h>
-#include <wtf/text/StringBuilder.h>
+#include "wtf/MemoryInstrumentationVector.h"
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
-WebKitCSSRegionRule::WebKitCSSRegionRule(StyleRuleRegion* regionRule, CSSStyleSheet* parent)
+CSSRegionRule::CSSRegionRule(StyleRuleRegion* regionRule, CSSStyleSheet* parent)
: CSSGroupingRule(regionRule, parent)
{
ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled());
}
-String WebKitCSSRegionRule::cssText() const
+String CSSRegionRule::cssText() const
{
StringBuilder result;
result.appendLiteral("@-webkit-region ");
diff --git a/Source/core/css/WebKitCSSRegionRule.h b/Source/core/css/CSSRegionRule.h
similarity index 81%
rename from Source/core/css/WebKitCSSRegionRule.h
rename to Source/core/css/CSSRegionRule.h
index 7a65eb5..f6f82e1 100644
--- a/Source/core/css/WebKitCSSRegionRule.h
+++ b/Source/core/css/CSSRegionRule.h
@@ -28,8 +28,8 @@
* SUCH DAMAGE.
*/
-#ifndef WebKitCSSRegionRule_h
-#define WebKitCSSRegionRule_h
+#ifndef CSSRegionRule_h
+#define CSSRegionRule_h
#include "core/css/CSSGroupingRule.h"
@@ -37,17 +37,17 @@
class StyleRuleRegion;
-class WebKitCSSRegionRule : public CSSGroupingRule {
+class CSSRegionRule : public CSSGroupingRule {
public:
- static PassRefPtr<WebKitCSSRegionRule> create(StyleRuleRegion* rule, CSSStyleSheet* sheet) { return adoptRef(new WebKitCSSRegionRule(rule, sheet)); }
+ static PassRefPtr<CSSRegionRule> create(StyleRuleRegion* rule, CSSStyleSheet* sheet) { return adoptRef(new CSSRegionRule(rule, sheet)); }
virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_REGION_RULE; }
virtual String cssText() const OVERRIDE;
private:
- WebKitCSSRegionRule(StyleRuleRegion*, CSSStyleSheet* parent);
+ CSSRegionRule(StyleRuleRegion*, CSSStyleSheet* parent);
};
}
-#endif // WebKitCSSRegionRule_h
+#endif // CSSRegionRule_h
diff --git a/Source/core/css/WebKitCSSRegionRule.idl b/Source/core/css/CSSRegionRule.idl
similarity index 92%
rename from Source/core/css/WebKitCSSRegionRule.idl
rename to Source/core/css/CSSRegionRule.idl
index 2dfbf39..0b264a3 100644
--- a/Source/core/css/WebKitCSSRegionRule.idl
+++ b/Source/core/css/CSSRegionRule.idl
@@ -28,8 +28,9 @@
*/
[
- EnabledAtRuntime=cssRegions
-] interface WebKitCSSRegionRule : CSSRule {
+ EnabledAtRuntime=cssRegions,
+ InterfaceName=WebKitCSSRegionRule
+] interface CSSRegionRule : CSSRule {
readonly attribute CSSRuleList cssRules;
};
diff --git a/Source/core/css/WebKitCSSSVGDocumentValue.cpp b/Source/core/css/CSSSVGDocumentValue.cpp
similarity index 81%
rename from Source/core/css/WebKitCSSSVGDocumentValue.cpp
rename to Source/core/css/CSSSVGDocumentValue.cpp
index a7afd99..d372374 100644
--- a/Source/core/css/WebKitCSSSVGDocumentValue.cpp
+++ b/Source/core/css/CSSSVGDocumentValue.cpp
@@ -24,7 +24,7 @@
#include "config.h"
-#include "core/css/WebKitCSSSVGDocumentValue.h"
+#include "core/css/CSSSVGDocumentValue.h"
#include "core/css/CSSParser.h"
#include "core/dom/Document.h"
@@ -36,18 +36,18 @@
namespace WebCore {
-WebKitCSSSVGDocumentValue::WebKitCSSSVGDocumentValue(const String& url)
- : CSSValue(WebKitCSSSVGDocumentClass)
+CSSSVGDocumentValue::CSSSVGDocumentValue(const String& url)
+ : CSSValue(CSSSVGDocumentClass)
, m_url(url)
, m_loadRequested(false)
{
}
-WebKitCSSSVGDocumentValue::~WebKitCSSSVGDocumentValue()
+CSSSVGDocumentValue::~CSSSVGDocumentValue()
{
}
-CachedDocument* WebKitCSSSVGDocumentValue::load(CachedResourceLoader* loader)
+CachedDocument* CSSSVGDocumentValue::load(CachedResourceLoader* loader)
{
ASSERT(loader);
@@ -61,17 +61,17 @@
return m_document.get();
}
-String WebKitCSSSVGDocumentValue::customCssText() const
+String CSSSVGDocumentValue::customCssText() const
{
return quoteCSSStringIfNeeded(m_url);
}
-bool WebKitCSSSVGDocumentValue::equals(const WebKitCSSSVGDocumentValue& other) const
+bool CSSSVGDocumentValue::equals(const CSSSVGDocumentValue& other) const
{
return m_url == other.m_url;
}
-void WebKitCSSSVGDocumentValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+void CSSSVGDocumentValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
info.addMember(m_url, "url");
diff --git a/Source/core/css/WebKitCSSSVGDocumentValue.h b/Source/core/css/CSSSVGDocumentValue.h
similarity index 81%
rename from Source/core/css/WebKitCSSSVGDocumentValue.h
rename to Source/core/css/CSSSVGDocumentValue.h
index c6af8c6..fdb5631 100644
--- a/Source/core/css/WebKitCSSSVGDocumentValue.h
+++ b/Source/core/css/CSSSVGDocumentValue.h
@@ -22,8 +22,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebKitCSSSVGDocumentValue_h
-#define WebKitCSSSVGDocumentValue_h
+#ifndef CSSSVGDocumentValue_h
+#define CSSSVGDocumentValue_h
#include "core/css/CSSValue.h"
#include "core/loader/cache/CachedDocument.h"
@@ -33,10 +33,10 @@
class CachedResourceLoader;
-class WebKitCSSSVGDocumentValue : public CSSValue {
+class CSSSVGDocumentValue : public CSSValue {
public:
- static PassRefPtr<WebKitCSSSVGDocumentValue> create(const String& url) { return adoptRef(new WebKitCSSSVGDocumentValue(url)); }
- ~WebKitCSSSVGDocumentValue();
+ static PassRefPtr<CSSSVGDocumentValue> create(const String& url) { return adoptRef(new CSSSVGDocumentValue(url)); }
+ ~CSSSVGDocumentValue();
CachedDocument* cachedSVGDocument() const { return m_document.get(); }
CachedDocument* load(CachedResourceLoader*);
@@ -44,12 +44,12 @@
String customCssText() const;
const String& url() const { return m_url; }
bool loadRequested() const { return m_loadRequested; }
- bool equals(const WebKitCSSSVGDocumentValue&) const;
+ bool equals(const CSSSVGDocumentValue&) const;
void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
private:
- WebKitCSSSVGDocumentValue(const String& url);
+ CSSSVGDocumentValue(const String& url);
String m_url;
CachedResourceHandle<CachedDocument> m_document;
@@ -58,4 +58,4 @@
} // namespace WebCore
-#endif // WebKitCSSSVGDocumentValue_h
+#endif // CSSSVGDocumentValue_h
diff --git a/Source/core/css/WebKitCSSShaderValue.cpp b/Source/core/css/CSSShaderValue.cpp
similarity index 82%
rename from Source/core/css/WebKitCSSShaderValue.cpp
rename to Source/core/css/CSSShaderValue.cpp
index 23b49d0..d3db8e1 100644
--- a/Source/core/css/WebKitCSSShaderValue.cpp
+++ b/Source/core/css/CSSShaderValue.cpp
@@ -29,7 +29,7 @@
#include "config.h"
-#include "core/css/WebKitCSSShaderValue.h"
+#include "core/css/CSSShaderValue.h"
#include "core/css/CSSParser.h"
#include "core/dom/Document.h"
@@ -42,23 +42,23 @@
namespace WebCore {
-WebKitCSSShaderValue::WebKitCSSShaderValue(const String& url)
- : CSSValue(WebKitCSSShaderClass)
+CSSShaderValue::CSSShaderValue(const String& url)
+ : CSSValue(CSSShaderClass)
, m_url(url)
, m_accessedShader(false)
{
}
-WebKitCSSShaderValue::~WebKitCSSShaderValue()
+CSSShaderValue::~CSSShaderValue()
{
}
-KURL WebKitCSSShaderValue::completeURL(CachedResourceLoader* loader) const
+KURL CSSShaderValue::completeURL(CachedResourceLoader* loader) const
{
return loader->document()->completeURL(m_url);
}
-StyleCachedShader* WebKitCSSShaderValue::cachedShader(CachedResourceLoader* loader)
+StyleCachedShader* CSSShaderValue::cachedShader(CachedResourceLoader* loader)
{
ASSERT(loader);
@@ -73,7 +73,7 @@
return (m_shader && m_shader->isCachedShader()) ? static_cast<StyleCachedShader*>(m_shader.get()) : 0;
}
-StyleShader* WebKitCSSShaderValue::cachedOrPendingShader()
+StyleShader* CSSShaderValue::cachedOrPendingShader()
{
if (!m_shader)
m_shader = StylePendingShader::create(this);
@@ -81,7 +81,7 @@
return m_shader.get();
}
-String WebKitCSSShaderValue::customCssText() const
+String CSSShaderValue::customCssText() const
{
StringBuilder result;
result.appendLiteral("url(");
@@ -95,17 +95,17 @@
return result.toString();
}
-bool WebKitCSSShaderValue::equals(const WebKitCSSShaderValue& other) const
+bool CSSShaderValue::equals(const CSSShaderValue& other) const
{
return m_url == other.m_url;
}
-void WebKitCSSShaderValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+void CSSShaderValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
info.addMember(m_url, "url");
info.addMember(m_format, "format");
}
-
+
} // namespace WebCore
diff --git a/Source/core/css/WebKitCSSShaderValue.h b/Source/core/css/CSSShaderValue.h
similarity index 77%
rename from Source/core/css/WebKitCSSShaderValue.h
rename to Source/core/css/CSSShaderValue.h
index 773eb6e..07387cf 100644
--- a/Source/core/css/WebKitCSSShaderValue.h
+++ b/Source/core/css/CSSShaderValue.h
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef WebKitCSSShaderValue_h
-#define WebKitCSSShaderValue_h
+#ifndef CSSShaderValue_h
+#define CSSShaderValue_h
#include "core/css/CSSValue.h"
@@ -39,10 +39,10 @@
class StyleCachedShader;
class StyleShader;
-class WebKitCSSShaderValue : public CSSValue {
+class CSSShaderValue : public CSSValue {
public:
- static PassRefPtr<WebKitCSSShaderValue> create(const String& url) { return adoptRef(new WebKitCSSShaderValue(url)); }
- ~WebKitCSSShaderValue();
+ static PassRefPtr<CSSShaderValue> create(const String& url) { return adoptRef(new CSSShaderValue(url)); }
+ ~CSSShaderValue();
const String& format() const { return m_format; }
void setFormat(const String& format) { m_format = format; }
@@ -53,12 +53,12 @@
String customCssText() const;
- bool equals(const WebKitCSSShaderValue&) const;
+ bool equals(const CSSShaderValue&) const;
void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
private:
- WebKitCSSShaderValue(const String& url);
+ CSSShaderValue(const String& url);
String m_url;
String m_format;
@@ -67,14 +67,14 @@
};
// This will catch anyone doing an unnecessary cast.
-WebKitCSSShaderValue* toWebKitCSSShaderValue(const WebKitCSSShaderValue*);
+CSSShaderValue* toCSSShaderValue(const CSSShaderValue*);
-inline WebKitCSSShaderValue* toWebKitCSSShaderValue(CSSValue* value)
+inline CSSShaderValue* toCSSShaderValue(CSSValue* value)
{
- return value->isWebKitCSSShaderValue() ? static_cast<WebKitCSSShaderValue*>(value) : 0;
+ return value->isCSSShaderValue() ? static_cast<CSSShaderValue*>(value) : 0;
}
} // namespace WebCore
-#endif // WebKitCSSShaderValue_h
+#endif // CSSShaderValue_h
diff --git a/Source/core/css/CSSStyleDeclaration.cpp b/Source/core/css/CSSStyleDeclaration.cpp
index de30643..538e17e 100644
--- a/Source/core/css/CSSStyleDeclaration.cpp
+++ b/Source/core/css/CSSStyleDeclaration.cpp
@@ -43,141 +43,4 @@
namespace WebCore {
-// FIXME: Next two functions look lifted verbatim from JSCSSStyleDeclarationCustom. Please remove duplication.
-
-// Check for a CSS prefix.
-// Passed prefix is all lowercase.
-// First character of the prefix within the property name may be upper or lowercase.
-// Other characters in the prefix within the property name must be lowercase.
-// The prefix within the property name must be followed by a capital letter.
-static bool hasCSSPropertyNamePrefix(const String& propertyName, const char* prefix)
-{
-#ifndef NDEBUG
- ASSERT(*prefix);
- for (const char* p = prefix; *p; ++p)
- ASSERT(isASCIILower(*p));
- ASSERT(propertyName.length());
-#endif
-
- if (toASCIILower(propertyName[0]) != prefix[0])
- return false;
-
- unsigned length = propertyName.length();
- for (unsigned i = 1; i < length; ++i) {
- if (!prefix[i])
- return isASCIIUpper(propertyName[i]);
- if (propertyName[i] != prefix[i])
- return false;
- }
- return false;
-}
-
-// When getting properties on CSSStyleDeclarations, the name used from
-// Javascript and the actual name of the property are not the same, so
-// we have to do the following translation. The translation turns upper
-// case characters into lower case characters and inserts dashes to
-// separate words.
-//
-// Example: 'backgroundPositionY' -> 'background-position-y'
-//
-// Also, certain prefixes such as 'pos', 'css-' and 'pixel-' are stripped
-// and the hadPixelOrPosPrefix out parameter is used to indicate whether or
-// not the property name was prefixed with 'pos-' or 'pixel-'.
-CSSPropertyInfo* CSSStyleDeclaration::cssPropertyInfo(const String& propertyName)
-{
- typedef HashMap<String, CSSPropertyInfo*> CSSPropertyInfoMap;
- DEFINE_STATIC_LOCAL(CSSPropertyInfoMap, map, ());
- CSSPropertyInfo* propInfo = map.get(propertyName);
- if (!propInfo) {
- unsigned length = propertyName.length();
- bool hadPixelOrPosPrefix = false;
- if (!length)
- return 0;
-
- StringBuilder builder;
- builder.reserveCapacity(length);
-
- unsigned i = 0;
-
- if (hasCSSPropertyNamePrefix(propertyName, "css"))
- i += 3;
- else if (hasCSSPropertyNamePrefix(propertyName, "pixel")) {
- i += 5;
- hadPixelOrPosPrefix = true;
- } else if (hasCSSPropertyNamePrefix(propertyName, "pos")) {
- i += 3;
- hadPixelOrPosPrefix = true;
- } else if (hasCSSPropertyNamePrefix(propertyName, "webkit"))
- builder.append('-');
- else if (isASCIIUpper(propertyName[0]))
- return 0;
-
- builder.append(toASCIILower(propertyName[i++]));
-
- for (; i < length; ++i) {
- UChar c = propertyName[i];
- if (!isASCIIUpper(c))
- builder.append(c);
- else {
- builder.append('-');
- builder.append(toASCIILower(c));
- }
- }
-
- String propName = builder.toString();
- CSSPropertyID propertyID = cssPropertyID(propName);
- if (propertyID && RuntimeCSSEnabled::isCSSPropertyEnabled(propertyID)) {
- propInfo = new CSSPropertyInfo();
- propInfo->hadPixelOrPosPrefix = hadPixelOrPosPrefix;
- propInfo->propID = propertyID;
- map.add(propertyName, propInfo);
- }
- }
- return propInfo;
-}
-
-void CSSStyleDeclaration::anonymousNamedGetter(const AtomicString& name, bool& returnValue1Enabled, String& returnValue1, bool& returnValue2Enabled, float& returnValue2)
-{
- // Search the style declaration.
- CSSPropertyInfo* propInfo = cssPropertyInfo(name);
-
- // Do not handle non-property names.
- if (!propInfo)
- return;
-
- RefPtr<CSSValue> cssValue = getPropertyCSSValueInternal(static_cast<CSSPropertyID>(propInfo->propID));
- if (cssValue) {
- if (propInfo->hadPixelOrPosPrefix && cssValue->isPrimitiveValue()) {
- returnValue2Enabled = true;
- returnValue2 = static_cast<CSSPrimitiveValue*>(cssValue.get())->getFloatValue(CSSPrimitiveValue::CSS_PX);
- return;
- }
- returnValue1Enabled = true;
- returnValue1 = cssValue->cssText();
- return;
- }
-
- String result = getPropertyValueInternal(static_cast<CSSPropertyID>(propInfo->propID));
- if (result.isNull())
- result = ""; // convert null to empty string.
-
- returnValue1 = result;
- returnValue1Enabled = true;
-}
-
-bool CSSStyleDeclaration::anonymousNamedSetter(const AtomicString& propertyName, const String& value, ExceptionCode& ec)
-{
- String propertyValue = value;
- CSSPropertyInfo* propInfo = CSSStyleDeclaration::cssPropertyInfo(propertyName);
- if (!propInfo)
- return false;
-
- if (propInfo->hadPixelOrPosPrefix)
- propertyValue.append("px");
-
- this->setPropertyInternal(static_cast<CSSPropertyID>(propInfo->propID), propertyValue, false, ec);
-
- return true;
-}
-
} // namespace WebCore
diff --git a/Source/core/css/CSSStyleDeclaration.h b/Source/core/css/CSSStyleDeclaration.h
index c80bf0b..69939ce 100644
--- a/Source/core/css/CSSStyleDeclaration.h
+++ b/Source/core/css/CSSStyleDeclaration.h
@@ -37,12 +37,6 @@
typedef int ExceptionCode;
-class CSSPropertyInfo {
-public:
- CSSPropertyID propID;
- bool hadPixelOrPosPrefix;
-};
-
class CSSStyleDeclaration : public ScriptWrappable {
WTF_MAKE_NONCOPYABLE(CSSStyleDeclaration); WTF_MAKE_FAST_ALLOCATED;
public:
@@ -77,10 +71,6 @@
virtual CSSStyleSheet* parentStyleSheet() const { return 0; }
virtual void reportMemoryUsage(MemoryObjectInfo*) const = 0;
- void anonymousNamedGetter(const AtomicString& name, bool&, String&, bool&, float&);
- bool anonymousNamedSetter(const AtomicString& name, const String& value, ExceptionCode&);
-
- static CSSPropertyInfo* cssPropertyInfo(const String& propertyName);
protected:
CSSStyleDeclaration()
diff --git a/Source/core/css/CSSStyleDeclaration.idl b/Source/core/css/CSSStyleDeclaration.idl
index 2d96596..c94f081 100644
--- a/Source/core/css/CSSStyleDeclaration.idl
+++ b/Source/core/css/CSSStyleDeclaration.idl
@@ -20,7 +20,6 @@
// Introduced in DOM Level 2:
[
- CustomEnumerateProperty,
DependentLifetime
] interface CSSStyleDeclaration {
[TreatReturnedNullStringAs=Null, TreatNullAs=NullString, SetterRaisesException] attribute DOMString cssText;
@@ -35,8 +34,8 @@
readonly attribute unsigned long length;
getter DOMString item([Default=Undefined] optional unsigned long index);
- [ImplementedAs=anonymousNamedGetter, TreatReturnedNullStringAs=Null] getter (DOMString or float) (DOMString name);
- [ImplementedAs=anonymousNamedSetter, RaisesException] setter void (DOMString propertyName, [TreatNullAs=NullString] DOMString propertyValue);
+ [Custom, CustomEnumerateProperty] getter (DOMString or float) (DOMString name);
+ [Custom] setter void (DOMString propertyName, [TreatNullAs=NullString] DOMString propertyValue);
readonly attribute CSSRule parentRule;
};
diff --git a/Source/core/css/CSSToStyleMap.cpp b/Source/core/css/CSSToStyleMap.cpp
index 4b45996..156b4c2 100644
--- a/Source/core/css/CSSToStyleMap.cpp
+++ b/Source/core/css/CSSToStyleMap.cpp
@@ -72,7 +72,7 @@
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueFixed:
layer->setAttachment(FixedBackgroundAttachment);
break;
@@ -190,16 +190,16 @@
}
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == CSSValueContain)
+ if (primitiveValue->getValueID() == CSSValueContain)
layer->setSizeType(Contain);
- else if (primitiveValue->getIdent() == CSSValueCover)
+ else if (primitiveValue->getValueID() == CSSValueCover)
layer->setSizeType(Cover);
else
layer->setSizeType(SizeLength);
LengthSize b = FillLayer::initialFillSizeLength(layer->type());
- if (value->isInitialValue() || primitiveValue->getIdent() == CSSValueContain || primitiveValue->getIdent() == CSSValueCover) {
+ if (value->isInitialValue() || primitiveValue->getValueID() == CSSValueContain || primitiveValue->getValueID() == CSSValueCover) {
layer->setSizeLength(b);
return;
}
@@ -322,7 +322,7 @@
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueNormal:
layer->setDirection(CSSAnimationData::AnimationDirectionNormal);
break;
@@ -335,6 +335,8 @@
case CSSValueAlternateReverse:
layer->setDirection(CSSAnimationData::AnimationDirectionAlternateReverse);
break;
+ default:
+ break;
}
}
@@ -363,7 +365,7 @@
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueNone:
layer->setFillMode(AnimationFillModeNone);
break;
@@ -376,6 +378,8 @@
case CSSValueBoth:
layer->setFillMode(AnimationFillModeBoth);
break;
+ default:
+ break;
}
}
@@ -390,7 +394,7 @@
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == CSSValueInfinite)
+ if (primitiveValue->getValueID() == CSSValueInfinite)
animation->setIterationCount(CSSAnimationData::IterationCountInfinite);
else
animation->setIterationCount(primitiveValue->getFloatValue());
@@ -407,7 +411,7 @@
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == CSSValueNone)
+ if (primitiveValue->getValueID() == CSSValueNone)
layer->setIsNoneAnimation(true);
else
layer->setName(primitiveValue->getStringValue());
@@ -424,7 +428,7 @@
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- EAnimPlayState playState = (primitiveValue->getIdent() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
+ EAnimPlayState playState = (primitiveValue->getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
layer->setPlayState(playState);
}
@@ -440,15 +444,15 @@
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == CSSValueAll) {
+ if (primitiveValue->getValueID() == CSSValueAll) {
animation->setAnimationMode(CSSAnimationData::AnimateAll);
animation->setProperty(CSSPropertyInvalid);
- } else if (primitiveValue->getIdent() == CSSValueNone) {
+ } else if (primitiveValue->getValueID() == CSSValueNone) {
animation->setAnimationMode(CSSAnimationData::AnimateNone);
animation->setProperty(CSSPropertyInvalid);
} else {
animation->setAnimationMode(CSSAnimationData::AnimateSingleProperty);
- animation->setProperty(static_cast<CSSPropertyID>(primitiveValue->getIdent()));
+ animation->setProperty(primitiveValue->getPropertyID());
}
}
@@ -461,7 +465,7 @@
if (value->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueLinear:
animation->setTimingFunction(LinearTimingFunction::create());
break;
@@ -483,6 +487,8 @@
case CSSValueStepEnd:
animation->setTimingFunction(StepsTimingFunction::create(1, false));
break;
+ default:
+ break;
}
return;
}
@@ -607,28 +613,28 @@
box.m_top = Length(slices->top()->getIntValue(), Relative);
else if (slices->top()->isPercentage())
box.m_top = Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->top()->getIdent() != CSSValueAuto)
+ else if (slices->top()->getValueID() != CSSValueAuto)
box.m_top = slices->top()->computeLength<Length>(style(), rootElementStyle(), zoom);
if (slices->right()->isNumber())
box.m_right = Length(slices->right()->getIntValue(), Relative);
else if (slices->right()->isPercentage())
box.m_right = Length(slices->right()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->right()->getIdent() != CSSValueAuto)
+ else if (slices->right()->getValueID() != CSSValueAuto)
box.m_right = slices->right()->computeLength<Length>(style(), rootElementStyle(), zoom);
if (slices->bottom()->isNumber())
box.m_bottom = Length(slices->bottom()->getIntValue(), Relative);
else if (slices->bottom()->isPercentage())
box.m_bottom = Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->bottom()->getIdent() != CSSValueAuto)
+ else if (slices->bottom()->getValueID() != CSSValueAuto)
box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElementStyle(), zoom);
if (slices->left()->isNumber())
box.m_left = Length(slices->left()->getIntValue(), Relative);
else if (slices->left()->isPercentage())
box.m_left = Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
- else if (slices->left()->getIdent() != CSSValueAuto)
+ else if (slices->left()->getValueID() != CSSValueAuto)
box.m_left = slices->left()->computeLength<Length>(style(), rootElementStyle(), zoom);
return box;
@@ -644,8 +650,8 @@
if (!pair || !pair->first() || !pair->second())
return;
- int firstIdentifier = pair->first()->getIdent();
- int secondIdentifier = pair->second()->getIdent();
+ CSSValueID firstIdentifier = pair->first()->getValueID();
+ CSSValueID secondIdentifier = pair->second()->getValueID();
ENinePieceImageRule horizontalRule;
switch (firstIdentifier) {
diff --git a/Source/core/css/WebKitCSSTransformValue.cpp b/Source/core/css/CSSTransformValue.cpp
similarity index 73%
rename from Source/core/css/WebKitCSSTransformValue.cpp
rename to Source/core/css/CSSTransformValue.cpp
index 6719d9e..20f291d 100644
--- a/Source/core/css/WebKitCSSTransformValue.cpp
+++ b/Source/core/css/CSSTransformValue.cpp
@@ -24,12 +24,12 @@
*/
#include "config.h"
-#include "core/css/WebKitCSSTransformValue.h"
+#include "core/css/CSSTransformValue.h"
#include "core/css/CSSValueList.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/WTFString.h>
+#include "wtf/PassRefPtr.h"
+#include "wtf/text/WTFString.h"
namespace WebCore {
@@ -59,43 +59,43 @@
"matrix3d("
};
-static inline String transformValueToCssString(WebKitCSSTransformValue::TransformOperationType operation, const String& value)
+static inline String transformValueToCssString(CSSTransformValue::TransformOperationType operation, const String& value)
{
- if (operation != WebKitCSSTransformValue::UnknownTransformOperation) {
+ if (operation != CSSTransformValue::UnknownTransformOperation) {
ASSERT_WITH_SECURITY_IMPLICATION(static_cast<size_t>(operation) < WTF_ARRAY_LENGTH(transformNamePrefixes));
return transformNamePrefixes[operation] + value + ")";
}
return String();
}
-WebKitCSSTransformValue::WebKitCSSTransformValue(TransformOperationType op)
- : CSSValueList(WebKitCSSTransformClass, CommaSeparator)
+CSSTransformValue::CSSTransformValue(TransformOperationType op)
+ : CSSValueList(CSSTransformClass, CommaSeparator)
, m_type(op)
{
}
-String WebKitCSSTransformValue::customCssText() const
+String CSSTransformValue::customCssText() const
{
return transformValueToCssString(m_type, CSSValueList::customCssText());
}
-String WebKitCSSTransformValue::customSerializeResolvingVariables(const HashMap<AtomicString, String>& variables) const
+String CSSTransformValue::customSerializeResolvingVariables(const HashMap<AtomicString, String>& variables) const
{
return transformValueToCssString(m_type, CSSValueList::customSerializeResolvingVariables(variables));
}
-WebKitCSSTransformValue::WebKitCSSTransformValue(const WebKitCSSTransformValue& cloneFrom)
+CSSTransformValue::CSSTransformValue(const CSSTransformValue& cloneFrom)
: CSSValueList(cloneFrom)
, m_type(cloneFrom.m_type)
{
}
-PassRefPtr<WebKitCSSTransformValue> WebKitCSSTransformValue::cloneForCSSOM() const
+PassRefPtr<CSSTransformValue> CSSTransformValue::cloneForCSSOM() const
{
- return adoptRef(new WebKitCSSTransformValue(*this));
+ return adoptRef(new CSSTransformValue(*this));
}
-void WebKitCSSTransformValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+void CSSTransformValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
CSSValueList::reportDescendantMemoryUsage(memoryObjectInfo);
diff --git a/Source/core/css/WebKitCSSTransformValue.h b/Source/core/css/CSSTransformValue.h
similarity index 80%
rename from Source/core/css/WebKitCSSTransformValue.h
rename to Source/core/css/CSSTransformValue.h
index c35cde7..635a608 100644
--- a/Source/core/css/WebKitCSSTransformValue.h
+++ b/Source/core/css/CSSTransformValue.h
@@ -23,16 +23,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebKitCSSTransformValue_h
-#define WebKitCSSTransformValue_h
+#ifndef CSSTransformValue_h
+#define CSSTransformValue_h
#include "core/css/CSSValueList.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
namespace WebCore {
-class WebKitCSSTransformValue : public CSSValueList {
+class CSSTransformValue : public CSSValueList {
public:
// NOTE: these have to match the values in the IDL
enum TransformOperationType {
@@ -60,24 +60,24 @@
Matrix3DTransformOperation
};
- static PassRefPtr<WebKitCSSTransformValue> create(TransformOperationType type)
+ static PassRefPtr<CSSTransformValue> create(TransformOperationType type)
{
- return adoptRef(new WebKitCSSTransformValue(type));
+ return adoptRef(new CSSTransformValue(type));
}
String customCssText() const;
- bool equals(const WebKitCSSTransformValue& other) const { return m_type == other.m_type && CSSValueList::equals(other); }
+ bool equals(const CSSTransformValue& other) const { return m_type == other.m_type && CSSValueList::equals(other); }
String customSerializeResolvingVariables(const HashMap<AtomicString, String>&) const;
TransformOperationType operationType() const { return m_type; }
-
- PassRefPtr<WebKitCSSTransformValue> cloneForCSSOM() const;
+
+ PassRefPtr<CSSTransformValue> cloneForCSSOM() const;
void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
private:
- WebKitCSSTransformValue(TransformOperationType);
- WebKitCSSTransformValue(const WebKitCSSTransformValue& cloneFrom);
+ CSSTransformValue(TransformOperationType);
+ CSSTransformValue(const CSSTransformValue& cloneFrom);
TransformOperationType m_type;
};
diff --git a/Source/core/css/WebKitCSSTransformValue.idl b/Source/core/css/CSSTransformValue.idl
similarity index 95%
rename from Source/core/css/WebKitCSSTransformValue.idl
rename to Source/core/css/CSSTransformValue.idl
index 97a5430..f6a3942 100644
--- a/Source/core/css/WebKitCSSTransformValue.idl
+++ b/Source/core/css/CSSTransformValue.idl
@@ -27,8 +27,9 @@
*/
[
- DoNotCheckConstants
-] interface WebKitCSSTransformValue : CSSValueList {
+ DoNotCheckConstants,
+ InterfaceName=WebKitCSSTransformValue
+] interface CSSTransformValue : CSSValueList {
// OperationTypes
diff --git a/Source/core/css/CSSValue.cpp b/Source/core/css/CSSValue.cpp
index 802cd93..ed5befa 100644
--- a/Source/core/css/CSSValue.cpp
+++ b/Source/core/css/CSSValue.cpp
@@ -27,12 +27,14 @@
#include "config.h"
#include "core/css/CSSValue.h"
+#include "core/css/CSSArrayFunctionValue.h"
#include "core/css/CSSAspectRatioValue.h"
#include "core/css/CSSBorderImageSliceValue.h"
#include "core/css/CSSCalculationValue.h"
#include "core/css/CSSCanvasValue.h"
#include "core/css/CSSCrossfadeValue.h"
#include "core/css/CSSCursorImageValue.h"
+#include "core/css/CSSFilterValue.h"
#include "core/css/CSSFontFaceSrcValue.h"
#include "core/css/CSSFunctionValue.h"
#include "core/css/CSSGradientValue.h"
@@ -41,21 +43,19 @@
#include "core/css/CSSInheritedValue.h"
#include "core/css/CSSInitialValue.h"
#include "core/css/CSSLineBoxContainValue.h"
+#include "core/css/CSSMixFunctionValue.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSReflectValue.h"
+#include "core/css/CSSSVGDocumentValue.h"
+#include "core/css/CSSShaderValue.h"
#include "core/css/CSSTimingFunctionValue.h"
+#include "core/css/CSSTransformValue.h"
#include "core/css/CSSUnicodeRangeValue.h"
#include "core/css/CSSValueList.h"
#include "core/css/CSSVariableValue.h"
#include "core/css/FontFeatureValue.h"
#include "core/css/FontValue.h"
#include "core/css/ShadowValue.h"
-#include "core/css/WebKitCSSArrayFunctionValue.h"
-#include "core/css/WebKitCSSFilterValue.h"
-#include "core/css/WebKitCSSMixFunctionValue.h"
-#include "core/css/WebKitCSSSVGDocumentValue.h"
-#include "core/css/WebKitCSSShaderValue.h"
-#include "core/css/WebKitCSSTransformValue.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
#include "core/svg/SVGColor.h"
#include "core/svg/SVGPaint.h"
@@ -222,14 +222,14 @@
case CalculationClass:
static_cast<const CSSCalcValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
return;
- case WebKitCSSArrayFunctionValueClass:
- static_cast<const WebKitCSSArrayFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
+ case CSSArrayFunctionValueClass:
+ static_cast<const CSSArrayFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
return;
- case WebKitCSSMixFunctionValueClass:
- static_cast<const WebKitCSSMixFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
+ case CSSMixFunctionValueClass:
+ static_cast<const CSSMixFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
return;
- case WebKitCSSShaderClass:
- static_cast<const WebKitCSSShaderValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
+ case CSSShaderClass:
+ static_cast<const CSSShaderValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
return;
case VariableClass:
static_cast<const CSSVariableValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
@@ -240,8 +240,8 @@
case SVGPaintClass:
static_cast<const SVGPaint*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
return;
- case WebKitCSSSVGDocumentClass:
- static_cast<const WebKitCSSSVGDocumentValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
+ case CSSSVGDocumentClass:
+ static_cast<const CSSSVGDocumentValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
return;
case ValueListClass:
toCSSValueList(this)->reportDescendantMemoryUsage(memoryObjectInfo);
@@ -249,11 +249,11 @@
case ImageSetClass:
static_cast<const CSSImageSetValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
return;
- case WebKitCSSFilterClass:
- static_cast<const WebKitCSSFilterValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
+ case CSSFilterClass:
+ static_cast<const CSSFilterValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
return;
- case WebKitCSSTransformClass:
- static_cast<const WebKitCSSTransformValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
+ case CSSTransformClass:
+ static_cast<const CSSTransformValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
return;
}
ASSERT_NOT_REACHED();
@@ -318,30 +318,30 @@
return compareCSSValues<CSSUnicodeRangeValue>(*this, other);
case ValueListClass:
return compareCSSValues<CSSValueList>(*this, other);
- case WebKitCSSTransformClass:
- return compareCSSValues<WebKitCSSTransformValue>(*this, other);
+ case CSSTransformClass:
+ return compareCSSValues<CSSTransformValue>(*this, other);
case LineBoxContainClass:
return compareCSSValues<CSSLineBoxContainValue>(*this, other);
case CalculationClass:
return compareCSSValues<CSSCalcValue>(*this, other);
case ImageSetClass:
return compareCSSValues<CSSImageSetValue>(*this, other);
- case WebKitCSSFilterClass:
- return compareCSSValues<WebKitCSSFilterValue>(*this, other);
- case WebKitCSSArrayFunctionValueClass:
- return compareCSSValues<WebKitCSSArrayFunctionValue>(*this, other);
- case WebKitCSSMixFunctionValueClass:
- return compareCSSValues<WebKitCSSMixFunctionValue>(*this, other);
- case WebKitCSSShaderClass:
- return compareCSSValues<WebKitCSSShaderValue>(*this, other);
+ case CSSFilterClass:
+ return compareCSSValues<CSSFilterValue>(*this, other);
+ case CSSArrayFunctionValueClass:
+ return compareCSSValues<CSSArrayFunctionValue>(*this, other);
+ case CSSMixFunctionValueClass:
+ return compareCSSValues<CSSMixFunctionValue>(*this, other);
+ case CSSShaderClass:
+ return compareCSSValues<CSSShaderValue>(*this, other);
case VariableClass:
return compareCSSValues<CSSVariableValue>(*this, other);
case SVGColorClass:
return compareCSSValues<SVGColor>(*this, other);
case SVGPaintClass:
return compareCSSValues<SVGPaint>(*this, other);
- case WebKitCSSSVGDocumentClass:
- return compareCSSValues<WebKitCSSSVGDocumentValue>(*this, other);
+ case CSSSVGDocumentClass:
+ return compareCSSValues<CSSSVGDocumentValue>(*this, other);
default:
ASSERT_NOT_REACHED();
return false;
@@ -406,30 +406,30 @@
return static_cast<const CSSUnicodeRangeValue*>(this)->customCssText();
case ValueListClass:
return toCSSValueList(this)->customCssText();
- case WebKitCSSTransformClass:
- return static_cast<const WebKitCSSTransformValue*>(this)->customCssText();
+ case CSSTransformClass:
+ return static_cast<const CSSTransformValue*>(this)->customCssText();
case LineBoxContainClass:
return static_cast<const CSSLineBoxContainValue*>(this)->customCssText();
case CalculationClass:
return static_cast<const CSSCalcValue*>(this)->customCssText();
case ImageSetClass:
return static_cast<const CSSImageSetValue*>(this)->customCssText();
- case WebKitCSSFilterClass:
- return static_cast<const WebKitCSSFilterValue*>(this)->customCssText();
- case WebKitCSSArrayFunctionValueClass:
- return static_cast<const WebKitCSSArrayFunctionValue*>(this)->customCssText();
- case WebKitCSSMixFunctionValueClass:
- return static_cast<const WebKitCSSMixFunctionValue*>(this)->customCssText();
- case WebKitCSSShaderClass:
- return static_cast<const WebKitCSSShaderValue*>(this)->customCssText();
+ case CSSFilterClass:
+ return static_cast<const CSSFilterValue*>(this)->customCssText();
+ case CSSArrayFunctionValueClass:
+ return static_cast<const CSSArrayFunctionValue*>(this)->customCssText();
+ case CSSMixFunctionValueClass:
+ return static_cast<const CSSMixFunctionValue*>(this)->customCssText();
+ case CSSShaderClass:
+ return static_cast<const CSSShaderValue*>(this)->customCssText();
case VariableClass:
return static_cast<const CSSVariableValue*>(this)->value();
case SVGColorClass:
return static_cast<const SVGColor*>(this)->customCssText();
case SVGPaintClass:
return static_cast<const SVGPaint*>(this)->customCssText();
- case WebKitCSSSVGDocumentClass:
- return static_cast<const WebKitCSSSVGDocumentValue*>(this)->customCssText();
+ case CSSSVGDocumentClass:
+ return static_cast<const CSSSVGDocumentValue*>(this)->customCssText();
}
ASSERT_NOT_REACHED();
return String();
@@ -444,8 +444,8 @@
return static_cast<const CSSReflectValue*>(this)->customSerializeResolvingVariables(variables);
case ValueListClass:
return toCSSValueList(this)->customSerializeResolvingVariables(variables);
- case WebKitCSSTransformClass:
- return static_cast<const WebKitCSSTransformValue*>(this)->customSerializeResolvingVariables(variables);
+ case CSSTransformClass:
+ return static_cast<const CSSTransformValue*>(this)->customSerializeResolvingVariables(variables);
default:
return cssText();
}
@@ -527,8 +527,8 @@
case ValueListClass:
delete toCSSValueList(this);
return;
- case WebKitCSSTransformClass:
- delete static_cast<WebKitCSSTransformValue*>(this);
+ case CSSTransformClass:
+ delete static_cast<CSSTransformValue*>(this);
return;
case LineBoxContainClass:
delete static_cast<CSSLineBoxContainValue*>(this);
@@ -539,17 +539,17 @@
case ImageSetClass:
delete static_cast<CSSImageSetValue*>(this);
return;
- case WebKitCSSFilterClass:
- delete static_cast<WebKitCSSFilterValue*>(this);
+ case CSSFilterClass:
+ delete static_cast<CSSFilterValue*>(this);
return;
- case WebKitCSSArrayFunctionValueClass:
- delete static_cast<WebKitCSSArrayFunctionValue*>(this);
+ case CSSArrayFunctionValueClass:
+ delete static_cast<CSSArrayFunctionValue*>(this);
return;
- case WebKitCSSMixFunctionValueClass:
- delete static_cast<WebKitCSSMixFunctionValue*>(this);
+ case CSSMixFunctionValueClass:
+ delete static_cast<CSSMixFunctionValue*>(this);
return;
- case WebKitCSSShaderClass:
- delete static_cast<WebKitCSSShaderValue*>(this);
+ case CSSShaderClass:
+ delete static_cast<CSSShaderValue*>(this);
return;
case VariableClass:
delete static_cast<CSSVariableValue*>(this);
@@ -560,8 +560,8 @@
case SVGPaintClass:
delete static_cast<SVGPaint*>(this);
return;
- case WebKitCSSSVGDocumentClass:
- delete static_cast<WebKitCSSSVGDocumentValue*>(this);
+ case CSSSVGDocumentClass:
+ delete static_cast<CSSSVGDocumentValue*>(this);
return;
}
ASSERT_NOT_REACHED();
@@ -577,14 +577,14 @@
case ImageClass:
case CursorImageClass:
return toCSSImageValue(this)->cloneForCSSOM();
- case WebKitCSSFilterClass:
- return static_cast<const WebKitCSSFilterValue*>(this)->cloneForCSSOM();
- case WebKitCSSArrayFunctionValueClass:
- return static_cast<const WebKitCSSArrayFunctionValue*>(this)->cloneForCSSOM();
- case WebKitCSSMixFunctionValueClass:
- return static_cast<const WebKitCSSMixFunctionValue*>(this)->cloneForCSSOM();
- case WebKitCSSTransformClass:
- return static_cast<const WebKitCSSTransformValue*>(this)->cloneForCSSOM();
+ case CSSFilterClass:
+ return static_cast<const CSSFilterValue*>(this)->cloneForCSSOM();
+ case CSSArrayFunctionValueClass:
+ return static_cast<const CSSArrayFunctionValue*>(this)->cloneForCSSOM();
+ case CSSMixFunctionValueClass:
+ return static_cast<const CSSMixFunctionValue*>(this)->cloneForCSSOM();
+ case CSSTransformClass:
+ return static_cast<const CSSTransformValue*>(this)->cloneForCSSOM();
case ImageSetClass:
return static_cast<const CSSImageSetValue*>(this)->cloneForCSSOM();
case SVGColorClass:
diff --git a/Source/core/css/CSSValue.h b/Source/core/css/CSSValue.h
index 0de2548..de94d0d 100644
--- a/Source/core/css/CSSValue.h
+++ b/Source/core/css/CSSValue.h
@@ -83,17 +83,17 @@
bool isCubicBezierTimingFunctionValue() const { return m_classType == CubicBezierTimingFunctionClass; }
bool isLinearTimingFunctionValue() const { return m_classType == LinearTimingFunctionClass; }
bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingFunctionClass; }
- bool isWebKitCSSTransformValue() const { return m_classType == WebKitCSSTransformClass; }
+ bool isCSSTransformValue() const { return m_classType == CSSTransformClass; }
bool isCSSLineBoxContainValue() const { return m_classType == LineBoxContainClass; }
bool isCalculationValue() const {return m_classType == CalculationClass; }
- bool isWebKitCSSFilterValue() const { return m_classType == WebKitCSSFilterClass; }
- bool isWebKitCSSArrayFunctionValue() const { return m_classType == WebKitCSSArrayFunctionValueClass; }
- bool isWebKitCSSMixFunctionValue() const { return m_classType == WebKitCSSMixFunctionValueClass; }
- bool isWebKitCSSShaderValue() const { return m_classType == WebKitCSSShaderClass; }
+ bool isCSSFilterValue() const { return m_classType == CSSFilterClass; }
+ bool isCSSArrayFunctionValue() const { return m_classType == CSSArrayFunctionValueClass; }
+ bool isCSSMixFunctionValue() const { return m_classType == CSSMixFunctionValueClass; }
+ bool isCSSShaderValue() const { return m_classType == CSSShaderClass; }
bool isVariableValue() const { return m_classType == VariableClass; }
bool isSVGColor() const { return m_classType == SVGColorClass || m_classType == SVGPaintClass; }
bool isSVGPaint() const { return m_classType == SVGPaintClass; }
- bool isWebKitCSSSVGDocumentValue() const { return m_classType == WebKitCSSSVGDocumentClass; }
+ bool isCSSSVGDocumentValue() const { return m_classType == CSSSVGDocumentClass; }
bool isCSSOMSafe() const { return m_isCSSOMSafe; }
bool isSubtypeExposedToCSSOM() const
@@ -148,21 +148,21 @@
UnicodeRangeClass,
LineBoxContainClass,
CalculationClass,
- WebKitCSSShaderClass,
+ CSSShaderClass,
VariableClass,
// SVG classes.
SVGColorClass,
SVGPaintClass,
- WebKitCSSSVGDocumentClass,
+ CSSSVGDocumentClass,
// List class types must appear after ValueListClass.
ValueListClass,
ImageSetClass,
- WebKitCSSFilterClass,
- WebKitCSSArrayFunctionValueClass,
- WebKitCSSMixFunctionValueClass,
- WebKitCSSTransformClass,
+ CSSFilterClass,
+ CSSArrayFunctionValueClass,
+ CSSMixFunctionValueClass,
+ CSSTransformClass,
// Do not append non-list class types here.
};
diff --git a/Source/core/css/CSSValueKeywords.in b/Source/core/css/CSSValueKeywords.in
index f13c08d..0314815 100644
--- a/Source/core/css/CSSValueKeywords.in
+++ b/Source/core/css/CSSValueKeywords.in
@@ -2,6 +2,10 @@
// CSS value names
//
+// The mode argument is used to limit the keyword to be used only for certain
+// CSSParserModes. Values that have the prefix -internal- are automatically
+// only for UASheetMode.
+
inherit
initial
//
@@ -162,12 +166,16 @@
window
windowframe
windowtext
--webkit-focus-ring-color
-currentcolor
+-internal-active-list-box-selection
+-internal-active-list-box-selection-text
+-internal-inactive-list-box-selection
+-internal-inactive-list-box-selection-text
+-webkit-focus-ring-color mode=QuirksOrUASheet
+currentcolor mode=QuirksOrUASheet
+grey
//
// colors in non strict mode
-grey
--webkit-text
+-webkit-text mode=QuirksOrUASheet
//
// CSS_PROP_BACKGROUND_REPEAT:
//
@@ -334,8 +342,8 @@
-webkit-inline-box
-webkit-flex
-webkit-inline-flex
--webkit-grid
--webkit-inline-grid
+grid
+inline-grid
lazy-block
//none
//
@@ -433,7 +441,6 @@
local
loud
lower
--webkit-marquee
mix
no-close-quote
no-open-quote
@@ -453,7 +460,7 @@
thick
thin
underline
-wavy condition=CSS3_TEXT
+wavy
-webkit-nowrap
// CSS3 Values
@@ -826,10 +833,6 @@
economy
exact
-// -webkit-color-correction
-//default
-sRGB
-
// (-webkit-view-mode:) media feature:
floating
fullscreen
@@ -937,7 +940,7 @@
// -webkit-line-align
edges
-alphabetic condition=SVG
+alphabetic
// position
sticky
diff --git a/Source/core/css/CSSValuePool.cpp b/Source/core/css/CSSValuePool.cpp
index 4c5d8ef..eaf8555 100644
--- a/Source/core/css/CSSValuePool.cpp
+++ b/Source/core/css/CSSValuePool.cpp
@@ -48,9 +48,9 @@
{
}
-PassRefPtr<CSSPrimitiveValue> CSSValuePool::createIdentifierValue(int ident)
+PassRefPtr<CSSPrimitiveValue> CSSValuePool::createIdentifierValue(CSSValueID ident)
{
- if (ident <= 0 || ident >= numCSSValueKeywords)
+ if (ident <= 0)
return CSSPrimitiveValue::createIdentifier(ident);
if (!m_identifierValueCache[ident])
@@ -58,6 +58,11 @@
return m_identifierValueCache[ident];
}
+PassRefPtr<CSSPrimitiveValue> CSSValuePool::createIdentifierValue(CSSPropertyID ident)
+{
+ return CSSPrimitiveValue::createIdentifier(ident);
+}
+
PassRefPtr<CSSPrimitiveValue> CSSValuePool::createColorValue(unsigned rgbValue)
{
// These are the empty and deleted values of the hash table.
@@ -131,20 +136,4 @@
return value;
}
-void CSSValuePool::drain()
-{
- m_colorValueCache.clear();
- m_fontFaceValueCache.clear();
- m_fontFamilyValueCache.clear();
-
- for (int i = 0; i < numCSSValueKeywords; ++i)
- m_identifierValueCache[i] = 0;
-
- for (int i = 0; i < maximumCacheableIntegerValue; ++i) {
- m_pixelValueCache[i] = 0;
- m_percentValueCache[i] = 0;
- m_numberValueCache[i] = 0;
- }
-}
-
}
diff --git a/Source/core/css/CSSValuePool.h b/Source/core/css/CSSValuePool.h
index 2d4d7d1..2cb1c2e 100644
--- a/Source/core/css/CSSValuePool.h
+++ b/Source/core/css/CSSValuePool.h
@@ -26,13 +26,14 @@
#ifndef CSSValuePool_h
#define CSSValuePool_h
+#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
#include "core/css/CSSInheritedValue.h"
#include "core/css/CSSInitialValue.h"
#include "core/css/CSSPrimitiveValue.h"
-#include <wtf/HashMap.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/AtomicStringHash.h>
+#include "wtf/HashMap.h"
+#include "wtf/RefPtr.h"
+#include "wtf/text/AtomicStringHash.h"
namespace WebCore {
@@ -46,14 +47,13 @@
PassRefPtr<CSSInheritedValue> createInheritedValue() { return m_inheritedValue; }
PassRefPtr<CSSInitialValue> createImplicitInitialValue() { return m_implicitInitialValue; }
PassRefPtr<CSSInitialValue> createExplicitInitialValue() { return m_explicitInitialValue; }
- PassRefPtr<CSSPrimitiveValue> createIdentifierValue(int identifier);
+ PassRefPtr<CSSPrimitiveValue> createIdentifierValue(CSSValueID identifier);
+ PassRefPtr<CSSPrimitiveValue> createIdentifierValue(CSSPropertyID identifier);
PassRefPtr<CSSPrimitiveValue> createColorValue(unsigned rgbValue);
PassRefPtr<CSSPrimitiveValue> createValue(double value, CSSPrimitiveValue::UnitTypes);
PassRefPtr<CSSPrimitiveValue> createValue(const String& value, CSSPrimitiveValue::UnitTypes type) { return CSSPrimitiveValue::create(value, type); }
template<typename T> static PassRefPtr<CSSPrimitiveValue> createValue(T value) { return CSSPrimitiveValue::create(value); }
- void drain();
-
private:
CSSValuePool();
diff --git a/Source/core/css/WebKitCSSViewportRule.cpp b/Source/core/css/CSSViewportRule.cpp
similarity index 83%
rename from Source/core/css/WebKitCSSViewportRule.cpp
rename to Source/core/css/CSSViewportRule.cpp
index 55c9ea5..3d6afeb 100644
--- a/Source/core/css/WebKitCSSViewportRule.cpp
+++ b/Source/core/css/CSSViewportRule.cpp
@@ -29,7 +29,7 @@
*/
#include "config.h"
-#include "core/css/WebKitCSSViewportRule.h"
+#include "core/css/CSSViewportRule.h"
#if ENABLE(CSS_DEVICE_ADAPTATION)
@@ -37,31 +37,31 @@
#include "core/css/StylePropertySet.h"
#include "core/css/StyleRule.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
-#include <wtf/text/StringBuilder.h>
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
-WebKitCSSViewportRule::WebKitCSSViewportRule(StyleRuleViewport* viewportRule, CSSStyleSheet* sheet)
+CSSViewportRule::CSSViewportRule(StyleRuleViewport* viewportRule, CSSStyleSheet* sheet)
: CSSRule(sheet)
, m_viewportRule(viewportRule)
{
}
-WebKitCSSViewportRule::~WebKitCSSViewportRule()
+CSSViewportRule::~CSSViewportRule()
{
if (m_propertiesCSSOMWrapper)
m_propertiesCSSOMWrapper->clearParentRule();
}
-CSSStyleDeclaration* WebKitCSSViewportRule::style() const
+CSSStyleDeclaration* CSSViewportRule::style() const
{
if (!m_propertiesCSSOMWrapper)
- m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_viewportRule->mutableProperties(), const_cast<WebKitCSSViewportRule*>(this));
+ m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_viewportRule->mutableProperties(), const_cast<CSSViewportRule*>(this));
return m_propertiesCSSOMWrapper.get();
}
-String WebKitCSSViewportRule::cssText() const
+String CSSViewportRule::cssText() const
{
StringBuilder result;
result.appendLiteral("@-webkit-viewport { ");
@@ -76,7 +76,7 @@
return result.toString();
}
-void WebKitCSSViewportRule::reattach(StyleRuleBase* rule)
+void CSSViewportRule::reattach(StyleRuleBase* rule)
{
ASSERT(rule);
ASSERT_WITH_SECURITY_IMPLICATION(rule->isViewportRule());
@@ -86,7 +86,7 @@
m_propertiesCSSOMWrapper->reattach(m_viewportRule->mutableProperties());
}
-void WebKitCSSViewportRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+void CSSViewportRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
CSSRule::reportMemoryUsage(memoryObjectInfo);
diff --git a/Source/core/css/WebKitCSSViewportRule.h b/Source/core/css/CSSViewportRule.h
similarity index 83%
rename from Source/core/css/WebKitCSSViewportRule.h
rename to Source/core/css/CSSViewportRule.h
index f275f4c..d800e16 100644
--- a/Source/core/css/WebKitCSSViewportRule.h
+++ b/Source/core/css/CSSViewportRule.h
@@ -28,8 +28,8 @@
* SUCH DAMAGE.
*/
-#ifndef WebKitCSSViewportRule_h
-#define WebKitCSSViewportRule_h
+#ifndef CSSViewportRule_h
+#define CSSViewportRule_h
#if ENABLE(CSS_DEVICE_ADAPTATION)
@@ -41,13 +41,13 @@
class StyleRuleViewport;
class StyleRuleCSSStyleDeclaration;
-class WebKitCSSViewportRule: public CSSRule {
+class CSSViewportRule: public CSSRule {
public:
- static PassRefPtr<WebKitCSSViewportRule> create(StyleRuleViewport* viewportRule, CSSStyleSheet* sheet)
+ static PassRefPtr<CSSViewportRule> create(StyleRuleViewport* viewportRule, CSSStyleSheet* sheet)
{
- return adoptRef(new WebKitCSSViewportRule(viewportRule, sheet));
+ return adoptRef(new CSSViewportRule(viewportRule, sheet));
}
- ~WebKitCSSViewportRule();
+ ~CSSViewportRule();
virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_VIEWPORT_RULE; }
virtual String cssText() const OVERRIDE;
@@ -57,7 +57,7 @@
CSSStyleDeclaration* style() const;
private:
- WebKitCSSViewportRule(StyleRuleViewport*, CSSStyleSheet*);
+ CSSViewportRule(StyleRuleViewport*, CSSStyleSheet*);
RefPtr<StyleRuleViewport> m_viewportRule;
mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
@@ -65,6 +65,6 @@
} // namespace WebCore
-#endif // WebKitCSSViewportRule_h
+#endif // CSSViewportRule_h
#endif // ENABLE(CSS_DEVICE_ADAPTATION)
diff --git a/Source/core/css/WebKitCSSViewportRule.idl b/Source/core/css/CSSViewportRule.idl
similarity index 92%
rename from Source/core/css/WebKitCSSViewportRule.idl
rename to Source/core/css/CSSViewportRule.idl
index f2cc09f..c4e69e1 100644
--- a/Source/core/css/WebKitCSSViewportRule.idl
+++ b/Source/core/css/CSSViewportRule.idl
@@ -28,7 +28,8 @@
*/
[
- Conditional=CSS_DEVICE_ADAPTATION
-] interface WebKitCSSViewportRule : CSSRule {
+ Conditional=CSS_DEVICE_ADAPTATION,
+ InterfaceName=WebKitCSSViewportRule
+] interface CSSViewportRule : CSSRule {
readonly attribute CSSStyleDeclaration style;
};
diff --git a/Source/core/css/Counter.h b/Source/core/css/Counter.h
index c3878e7..e099897 100644
--- a/Source/core/css/Counter.h
+++ b/Source/core/css/Counter.h
@@ -22,7 +22,7 @@
#define Counter_h
#include "core/css/CSSPrimitiveValue.h"
-#include <wtf/text/WTFString.h>
+#include "wtf/text/WTFString.h"
namespace WebCore {
@@ -37,7 +37,7 @@
String listStyle() const { return m_listStyle ? m_listStyle->getStringValue() : String(); }
String separator() const { return m_separator ? m_separator->getStringValue() : String(); }
- int listStyleIdent() const { return m_listStyle ? m_listStyle->getIdent() : 0; }
+ CSSValueID listStyleIdent() const { return m_listStyle ? m_listStyle->getValueID() : CSSValueInvalid; }
void setIdentifier(PassRefPtr<CSSPrimitiveValue> identifier) { m_identifier = identifier; }
void setListStyle(PassRefPtr<CSSPrimitiveValue> listStyle) { m_listStyle = listStyle; }
diff --git a/Source/core/css/DeprecatedStyleBuilder.cpp b/Source/core/css/DeprecatedStyleBuilder.cpp
index 866ab61..5ebfc57 100644
--- a/Source/core/css/DeprecatedStyleBuilder.cpp
+++ b/Source/core/css/DeprecatedStyleBuilder.cpp
@@ -32,6 +32,7 @@
#include "core/css/CSSPrimitiveValueMappings.h"
#include "core/css/CSSToStyleMap.h"
#include "core/css/CSSValueList.h"
+#include "core/css/FontSize.h"
#include "core/css/Pair.h"
#include "core/css/Rect.h"
#include "core/css/resolver/StyleResolver.h"
@@ -152,7 +153,7 @@
}
};
-template <typename NumberType, NumberType (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(NumberType), NumberType (*initialFunction)(), int idMapsToMinusOne = CSSValueAuto>
+template <typename NumberType, NumberType (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(NumberType), NumberType (*initialFunction)(), CSSValueID idMapsToMinusOne = CSSValueAuto>
class ApplyPropertyNumber {
public:
static void setValue(RenderStyle* style, NumberType value) { (style->*setterFunction)(value); }
@@ -162,7 +163,7 @@
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == idMapsToMinusOne)
+ if (primitiveValue->getValueID() == idMapsToMinusOne)
setValue(styleResolver->style(), -1);
else
setValue(styleResolver->style(), primitiveValue->getValue<NumberType>(CSSPrimitiveValue::CSS_NUMBER));
@@ -186,7 +187,7 @@
};
enum AutoValueType {Number = 0, ComputeLength};
-template <typename T, T (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(T), bool (RenderStyle::*hasAutoFunction)() const, void (RenderStyle::*setAutoFunction)(), AutoValueType valueType = Number, int autoIdentity = CSSValueAuto>
+template <typename T, T (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(T), bool (RenderStyle::*hasAutoFunction)() const, void (RenderStyle::*setAutoFunction)(), AutoValueType valueType = Number, CSSValueID autoIdentity = CSSValueAuto>
class ApplyPropertyAuto {
public:
static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); }
@@ -210,7 +211,7 @@
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == autoIdentity)
+ if (primitiveValue->getValueID() == autoIdentity)
setAuto(styleResolver->style());
else if (valueType == Number)
setValue(styleResolver->style(), *primitiveValue);
@@ -257,7 +258,7 @@
Length left = convertToLength(styleResolver, rect->left());
styleResolver->style()->setClip(top, right, bottom, left);
styleResolver->style()->setHasClip(true);
- } else if (primitiveValue->getIdent() == CSSValueAuto) {
+ } else if (primitiveValue->getValueID() == CSSValueAuto) {
styleResolver->style()->setClip(Length(), Length(), Length(), Length());
styleResolver->style()->setHasClip(false);
}
@@ -266,56 +267,6 @@
static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
};
-enum ColorInherit {NoInheritFromParent = 0, InheritFromParent};
-Color defaultInitialColor();
-Color defaultInitialColor() { return Color(); }
-template <ColorInherit inheritColorFromParent,
- Color (RenderStyle::*getterFunction)() const,
- void (RenderStyle::*setterFunction)(const Color&),
- void (RenderStyle::*visitedLinkSetterFunction)(const Color&),
- Color (RenderStyle::*defaultFunction)() const,
- Color (*initialFunction)() = &defaultInitialColor>
-class ApplyPropertyColor {
-public:
- static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
- {
- // Visited link style can never explicitly inherit from parent visited link style so no separate getters are needed.
- Color color = (styleResolver->parentStyle()->*getterFunction)();
- applyColorValue(styleResolver, color.isValid() ? color : (styleResolver->parentStyle()->*defaultFunction)());
- }
-
- static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
- {
- applyColorValue(styleResolver, initialFunction());
- }
-
- static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
- {
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (inheritColorFromParent && primitiveValue->getIdent() == CSSValueCurrentcolor)
- applyInheritValue(propertyID, styleResolver);
- else {
- if (styleResolver->applyPropertyToRegularStyle())
- (styleResolver->style()->*setterFunction)(styleResolver->colorFromPrimitiveValue(primitiveValue));
- if (styleResolver->applyPropertyToVisitedLinkStyle())
- (styleResolver->style()->*visitedLinkSetterFunction)(styleResolver->colorFromPrimitiveValue(primitiveValue, /* forVisitedLink */ true));
- }
- }
-
- static void applyColorValue(StyleResolver* styleResolver, const Color& color)
- {
- if (styleResolver->applyPropertyToRegularStyle())
- (styleResolver->style()->*setterFunction)(color);
- if (styleResolver->applyPropertyToVisitedLinkStyle())
- (styleResolver->style()->*visitedLinkSetterFunction)(color);
- }
-
- static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
-};
-
template <TextDirection (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(TextDirection), TextDirection (*initialFunction)()>
class ApplyPropertyDirection {
public:
@@ -334,72 +285,6 @@
}
};
-enum LengthAuto { AutoDisabled = 0, AutoEnabled };
-enum LengthLegacyIntrinsic { LegacyIntrinsicDisabled = 0, LegacyIntrinsicEnabled };
-enum LengthIntrinsic { IntrinsicDisabled = 0, IntrinsicEnabled };
-enum LengthNone { NoneDisabled = 0, NoneEnabled };
-enum LengthUndefined { UndefinedDisabled = 0, UndefinedEnabled };
-template <Length (RenderStyle::*getterFunction)() const,
- void (RenderStyle::*setterFunction)(Length),
- Length (*initialFunction)(),
- LengthAuto autoEnabled = AutoDisabled,
- LengthLegacyIntrinsic legacyIntrinsicEnabled = LegacyIntrinsicDisabled,
- LengthIntrinsic intrinsicEnabled = IntrinsicDisabled,
- LengthNone noneEnabled = NoneDisabled,
- LengthUndefined noneUndefined = UndefinedDisabled>
-class ApplyPropertyLength {
-public:
- static void setValue(RenderStyle* style, Length value) { (style->*setterFunction)(value); }
- static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
- {
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (noneEnabled && primitiveValue->getIdent() == CSSValueNone) {
- if (noneUndefined)
- setValue(styleResolver->style(), Length(Undefined));
- else
- setValue(styleResolver->style(), Length());
- }
- if (legacyIntrinsicEnabled) {
- if (primitiveValue->getIdent() == CSSValueIntrinsic)
- setValue(styleResolver->style(), Length(Intrinsic));
- else if (primitiveValue->getIdent() == CSSValueMinIntrinsic)
- setValue(styleResolver->style(), Length(MinIntrinsic));
- }
- if (intrinsicEnabled) {
- if (primitiveValue->getIdent() == CSSValueWebkitMinContent)
- setValue(styleResolver->style(), Length(MinContent));
- else if (primitiveValue->getIdent() == CSSValueWebkitMaxContent)
- setValue(styleResolver->style(), Length(MaxContent));
- else if (primitiveValue->getIdent() == CSSValueWebkitFillAvailable)
- setValue(styleResolver->style(), Length(FillAvailable));
- else if (primitiveValue->getIdent() == CSSValueWebkitFitContent)
- setValue(styleResolver->style(), Length(FitContent));
- }
-
- if (autoEnabled && primitiveValue->getIdent() == CSSValueAuto)
- setValue(styleResolver->style(), Length());
- else if (primitiveValue->isLength()) {
- Length length = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
- length.setQuirk(primitiveValue->isQuirkValue());
- setValue(styleResolver->style(), length);
- } else if (primitiveValue->isPercentage())
- setValue(styleResolver->style(), Length(primitiveValue->getDoubleValue(), Percent));
- else if (primitiveValue->isCalculatedPercentageWithLength())
- setValue(styleResolver->style(), Length(primitiveValue->cssCalcValue()->toCalcValue(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom())));
- else if (primitiveValue->isViewportPercentageLength())
- setValue(styleResolver->style(), primitiveValue->viewportPercentageLength());
- }
-
- static PropertyHandler createHandler()
- {
- PropertyHandler handler = ApplyPropertyDefaultBase<Length, getterFunction, Length, setterFunction, Length, initialFunction>::createHandler();
- return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
- }
-};
-
enum StringIdentBehavior { NothingMapsToNull = 0, MapNoneToNull, MapAutoToNull };
template <StringIdentBehavior identBehavior, const AtomicString& (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(const AtomicString&), const AtomicString& (*initialFunction)()>
class ApplyPropertyString {
@@ -410,8 +295,8 @@
if (!value->isPrimitiveValue())
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if ((identBehavior == MapNoneToNull && primitiveValue->getIdent() == CSSValueNone)
- || (identBehavior == MapAutoToNull && primitiveValue->getIdent() == CSSValueAuto))
+ if ((identBehavior == MapNoneToNull && primitiveValue->getValueID() == CSSValueNone)
+ || (identBehavior == MapAutoToNull && primitiveValue->getValueID() == CSSValueAuto))
setValue(styleResolver->style(), nullAtom);
else
setValue(styleResolver->style(), primitiveValue->getStringValue());
@@ -474,94 +359,6 @@
}
};
-template <typename T>
-struct FillLayerAccessorTypes {
- typedef T Setter;
- typedef T Getter;
-};
-
-template <>
-struct FillLayerAccessorTypes<StyleImage*> {
- typedef PassRefPtr<StyleImage> Setter;
- typedef StyleImage* Getter;
-};
-
-template <typename T,
- CSSPropertyID propertyId,
- EFillLayerType fillLayerType,
- FillLayer* (RenderStyle::*accessLayersFunction)(),
- const FillLayer* (RenderStyle::*layersFunction)() const,
- bool (FillLayer::*testFunction)() const,
- typename FillLayerAccessorTypes<T>::Getter (FillLayer::*getFunction)() const,
- void (FillLayer::*setFunction)(typename FillLayerAccessorTypes<T>::Setter),
- void (FillLayer::*clearFunction)(),
- typename FillLayerAccessorTypes<T>::Getter (*initialFunction)(EFillLayerType),
- void (CSSToStyleMap::*mapFillFunction)(CSSPropertyID, FillLayer*, CSSValue*)>
-class ApplyPropertyFillLayer {
-public:
- static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
- {
- FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
- FillLayer* prevChild = 0;
- const FillLayer* currParent = (styleResolver->parentStyle()->*layersFunction)();
- while (currParent && (currParent->*testFunction)()) {
- if (!currChild) {
- /* Need to make a new layer.*/
- currChild = new FillLayer(fillLayerType);
- prevChild->setNext(currChild);
- }
- (currChild->*setFunction)((currParent->*getFunction)());
- prevChild = currChild;
- currChild = prevChild->next();
- currParent = currParent->next();
- }
-
- while (currChild) {
- /* Reset any remaining layers to not have the property set. */
- (currChild->*clearFunction)();
- currChild = currChild->next();
- }
- }
-
- static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
- {
- FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
- (currChild->*setFunction)((*initialFunction)(fillLayerType));
- for (currChild = currChild->next(); currChild; currChild = currChild->next())
- (currChild->*clearFunction)();
- }
-
- static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
- {
- FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
- FillLayer* prevChild = 0;
- if (value->isValueList() && !value->isImageSetValue()) {
- /* Walk each value and put it into a layer, creating new layers as needed. */
- CSSValueList* valueList = toCSSValueList(value);
- for (unsigned int i = 0; i < valueList->length(); i++) {
- if (!currChild) {
- /* Need to make a new layer to hold this value */
- currChild = new FillLayer(fillLayerType);
- prevChild->setNext(currChild);
- }
- (styleResolver->styleMap()->*mapFillFunction)(propertyId, currChild, valueList->itemWithoutBoundsCheck(i));
- prevChild = currChild;
- currChild = currChild->next();
- }
- } else {
- (styleResolver->styleMap()->*mapFillFunction)(propertyId, currChild, value);
- currChild = currChild->next();
- }
- while (currChild) {
- /* Reset all remaining layers to not have the property set. */
- (currChild->*clearFunction)();
- currChild = currChild->next();
- }
- }
-
- static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
-};
-
enum ComputeLengthNormal {NormalDisabled = 0, NormalEnabled};
enum ComputeLengthThickness {ThicknessDisabled = 0, ThicknessEnabled};
enum ComputeLengthSVGZoom {SVGZoomDisabled = 0, SVGZoomEnabled};
@@ -583,17 +380,17 @@
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- int ident = primitiveValue->getIdent();
+ CSSValueID valueID = primitiveValue->getValueID();
T length;
- if (normalEnabled && ident == CSSValueNormal) {
+ if (normalEnabled && valueID == CSSValueNormal) {
length = 0;
- } else if (thicknessEnabled && ident == CSSValueThin) {
+ } else if (thicknessEnabled && valueID == CSSValueThin) {
length = 1;
- } else if (thicknessEnabled && ident == CSSValueMedium) {
+ } else if (thicknessEnabled && valueID == CSSValueMedium) {
length = 3;
- } else if (thicknessEnabled && ident == CSSValueThick) {
+ } else if (thicknessEnabled && valueID == CSSValueThick) {
length = 5;
- } else if (ident == CSSValueInvalid) {
+ } else if (valueID == CSSValueInvalid) {
float zoom = (svgZoomEnabled && styleResolver->useSVGZoomRules()) ? 1.0f : styleResolver->style()->effectiveZoom();
// Any original result that was >= 1 should not be allowed to fall below 1.
@@ -670,7 +467,7 @@
// We need to adjust the size to account for the generic family change from monospace to non-monospace.
if (fontDescription.keywordSize() && fontDescription.useFixedDefaultSize())
- styleResolver->setFontSize(fontDescription, styleResolver->fontSizeForKeyword(styleResolver->document(), CSSValueXxSmall + fontDescription.keywordSize() - 1, false));
+ styleResolver->setFontSize(fontDescription, FontSize::fontSizeForKeyword(styleResolver->document(), CSSValueXxSmall + fontDescription.keywordSize() - 1, false));
fontDescription.setGenericFamily(initialDesc.genericFamily());
if (!initialDesc.firstFamily().familyIsEmpty())
fontDescription.setFamily(initialDesc.firstFamily());
@@ -702,7 +499,7 @@
if (contentValue->isString())
face = contentValue->getStringValue();
else if (settings) {
- switch (contentValue->getIdent()) {
+ switch (contentValue->getValueID()) {
case CSSValueWebkitBody:
face = settings->standardFontFamily();
break;
@@ -730,6 +527,8 @@
face = pictographFamily;
fontDescription.setGenericFamily(FontDescription::PictographFamily);
break;
+ default:
+ break;
}
}
@@ -753,7 +552,7 @@
// If currFamily is non-zero then we set at least one family on this description.
if (currFamily) {
if (fontDescription.keywordSize() && fontDescription.useFixedDefaultSize() != oldFamilyUsedFixedDefaultSize)
- styleResolver->setFontSize(fontDescription, styleResolver->fontSizeForKeyword(styleResolver->document(), CSSValueXxSmall + fontDescription.keywordSize() - 1, !oldFamilyUsedFixedDefaultSize));
+ styleResolver->setFontSize(fontDescription, FontSize::fontSizeForKeyword(styleResolver->document(), CSSValueXxSmall + fontDescription.keywordSize() - 1, !oldFamilyUsedFixedDefaultSize));
styleResolver->setFontDescription(fontDescription);
}
@@ -799,7 +598,7 @@
static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
{
FontDescription fontDescription = styleResolver->style()->fontDescription();
- float size = styleResolver->fontSizeForKeyword(styleResolver->document(), CSSValueMedium, fontDescription.useFixedDefaultSize());
+ float size = FontSize::fontSizeForKeyword(styleResolver->document(), CSSValueMedium, fontDescription.useFixedDefaultSize());
if (size < 0)
return;
@@ -828,9 +627,9 @@
parentIsAbsoluteSize = styleResolver->parentStyle()->fontDescription().isAbsoluteSize();
}
- if (int ident = primitiveValue->getIdent()) {
+ if (CSSValueID valueID = primitiveValue->getValueID()) {
// Keywords are being used.
- switch (ident) {
+ switch (valueID) {
case CSSValueXxSmall:
case CSSValueXSmall:
case CSSValueSmall:
@@ -839,8 +638,8 @@
case CSSValueXLarge:
case CSSValueXxLarge:
case CSSValueWebkitXxxLarge:
- size = styleResolver->fontSizeForKeyword(styleResolver->document(), ident, fontDescription.useFixedDefaultSize());
- fontDescription.setKeywordSize(ident - CSSValueXxSmall + 1);
+ size = FontSize::fontSizeForKeyword(styleResolver->document(), valueID, fontDescription.useFixedDefaultSize());
+ fontDescription.setKeywordSize(valueID - CSSValueXxSmall + 1);
break;
case CSSValueLarger:
size = largerFontSize(parentSize);
@@ -852,7 +651,7 @@
return;
}
- fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize && (ident == CSSValueLarger || ident == CSSValueSmaller));
+ fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize && (valueID == CSSValueLarger || valueID == CSSValueSmaller));
} else {
fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize
|| !(primitiveValue->isPercentage() || primitiveValue->isFontRelativeLength()));
@@ -891,7 +690,7 @@
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
FontDescription fontDescription = styleResolver->fontDescription();
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueInvalid:
ASSERT_NOT_REACHED();
break;
@@ -951,7 +750,7 @@
ASSERT(item->isPrimitiveValue());
if (item->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueNoCommonLigatures:
commonLigaturesState = FontDescription::DisabledLigaturesState;
break;
@@ -980,7 +779,7 @@
#if !ASSERT_DISABLED
else {
ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue());
- ASSERT(toCSSPrimitiveValue(value)->getIdent() == CSSValueNormal);
+ ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNormal);
}
#endif
@@ -998,28 +797,6 @@
};
enum BorderImageType { BorderImage = 0, BorderMask };
-template <BorderImageType borderImageType,
- CSSPropertyID property,
- const NinePieceImage& (RenderStyle::*getterFunction)() const,
- void (RenderStyle::*setterFunction)(const NinePieceImage&)>
-class ApplyPropertyBorderImage {
-public:
- static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
- {
- NinePieceImage image;
- if (borderImageType == BorderMask)
- image.setMaskDefaults();
- styleResolver->styleMap()->mapNinePieceImage(property, value, image);
- (styleResolver->style()->*setterFunction)(image);
- }
-
- static PropertyHandler createHandler()
- {
- PropertyHandler handler = ApplyPropertyDefaultBase<const NinePieceImage&, getterFunction, const NinePieceImage&, setterFunction, NinePieceImage, &RenderStyle::initialNinePieceImage>::createHandler();
- return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
- }
-};
-
enum BorderImageModifierType { Outset, Repeat, Slice, Width };
template <BorderImageType type, BorderImageModifierType modifier>
class ApplyPropertyBorderImageModifier {
@@ -1197,13 +974,13 @@
styleResolver->style()->addCursor(styleResolver->styleImage(CSSPropertyCursor, image), image->hotSpot());
} else if (item->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
- if (primitiveValue->isIdent())
+ if (primitiveValue->isValueID())
styleResolver->style()->setCursor(*primitiveValue);
}
}
} else if (value->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->isIdent() && styleResolver->style()->cursor() != ECursor(*primitiveValue))
+ if (primitiveValue->isValueID() && styleResolver->style()->cursor() != ECursor(*primitiveValue))
styleResolver->style()->setCursor(*primitiveValue);
}
}
@@ -1220,7 +997,7 @@
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() != CSSValueWebkitMatchParent)
+ if (primitiveValue->getValueID() != CSSValueWebkitMatchParent)
styleResolver->style()->setTextAlign(*primitiveValue);
else if (styleResolver->parentStyle()->textAlign() == TASTART)
styleResolver->style()->setTextAlign(styleResolver->parentStyle()->isLeftToRightDirection() ? LEFT : RIGHT);
@@ -1254,59 +1031,6 @@
}
};
-class ApplyPropertyMarqueeIncrement {
-public:
- static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
- {
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent()) {
- switch (primitiveValue->getIdent()) {
- case CSSValueSmall:
- styleResolver->style()->setMarqueeIncrement(Length(1, Fixed)); // 1px.
- break;
- case CSSValueNormal:
- styleResolver->style()->setMarqueeIncrement(Length(6, Fixed)); // 6px. The WinIE default.
- break;
- case CSSValueLarge:
- styleResolver->style()->setMarqueeIncrement(Length(36, Fixed)); // 36px.
- break;
- }
- } else {
- Length marqueeLength = styleResolver->convertToIntLength(primitiveValue, styleResolver->style(), styleResolver->rootElementStyle());
- if (!marqueeLength.isUndefined())
- styleResolver->style()->setMarqueeIncrement(marqueeLength);
- }
- }
- static PropertyHandler createHandler()
- {
- PropertyHandler handler = ApplyPropertyLength<&RenderStyle::marqueeIncrement, &RenderStyle::setMarqueeIncrement, &RenderStyle::initialMarqueeIncrement>::createHandler();
- return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
- }
-};
-
-class ApplyPropertyMarqueeRepetition {
-public:
- static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
- {
- if (!value->isPrimitiveValue())
- return;
-
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == CSSValueInfinite)
- styleResolver->style()->setMarqueeLoopCount(-1); // -1 means repeat forever.
- else if (primitiveValue->isNumber())
- styleResolver->style()->setMarqueeLoopCount(primitiveValue->getIntValue());
- }
- static PropertyHandler createHandler()
- {
- PropertyHandler handler = ApplyPropertyDefault<int, &RenderStyle::marqueeLoopCount, int, &RenderStyle::setMarqueeLoopCount, int, &RenderStyle::initialMarqueeLoopCount>::createHandler();
- return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
- }
-};
-
class ApplyPropertyMarqueeSpeed {
public:
static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
@@ -1315,8 +1039,8 @@
return;
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (int ident = primitiveValue->getIdent()) {
- switch (ident) {
+ if (CSSValueID valueID = primitiveValue->getValueID()) {
+ switch (valueID) {
case CSSValueSlow:
styleResolver->style()->setMarqueeSpeed(500); // 500 msec.
break;
@@ -1326,6 +1050,8 @@
case CSSValueFast:
styleResolver->style()->setMarqueeSpeed(10); // 10msec. Super fast.
break;
+ default:
+ break;
}
} else if (primitiveValue->isTime())
styleResolver->style()->setMarqueeSpeed(primitiveValue->computeTime<int, CSSPrimitiveValue::Milliseconds>());
@@ -1377,7 +1103,7 @@
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
Length lineHeight;
- if (primitiveValue->getIdent() == CSSValueNormal)
+ if (primitiveValue->getValueID() == CSSValueNormal)
lineHeight = RenderStyle::initialLineHeight();
else if (primitiveValue->isLength()) {
double multiplier = styleResolver->style()->effectiveZoom();
@@ -1429,7 +1155,7 @@
if (!pageSizeName)
return false;
- switch (pageSizeName->getIdent()) {
+ switch (pageSizeName->getValueID()) {
case CSSValueA5:
width = a5Width;
height = a5Height;
@@ -1467,7 +1193,7 @@
}
if (pageOrientation) {
- switch (pageOrientation->getIdent()) {
+ switch (pageOrientation->getValueID()) {
case CSSValueLandscape:
std::swap(width, height);
break;
@@ -1522,7 +1248,7 @@
pageSizeType = PAGE_SIZE_RESOLVED;
width = height = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
} else {
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case 0:
return;
case CSSValueAuto:
@@ -1581,7 +1307,7 @@
continue;
CSSPrimitiveValue* value = toCSSPrimitiveValue(item);
- if (value->getIdent() == CSSValueFilled || value->getIdent() == CSSValueOpen)
+ if (value->getValueID() == CSSValueFilled || value->getValueID() == CSSValueOpen)
styleResolver->style()->setTextEmphasisFill(*value);
else
styleResolver->style()->setTextEmphasisMark(*value);
@@ -1603,7 +1329,7 @@
styleResolver->style()->setTextEmphasisCustomMark(nullAtom);
- if (primitiveValue->getIdent() == CSSValueFilled || primitiveValue->getIdent() == CSSValueOpen) {
+ if (primitiveValue->getValueID() == CSSValueFilled || primitiveValue->getValueID() == CSSValueOpen) {
styleResolver->style()->setTextEmphasisFill(*primitiveValue);
styleResolver->style()->setTextEmphasisMark(TextEmphasisMarkAuto);
} else {
@@ -1724,7 +1450,7 @@
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
EResize r = RESIZE_NONE;
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case 0:
return;
case CSSValueAuto:
@@ -1753,7 +1479,7 @@
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent())
+ if (primitiveValue->getValueID())
return styleResolver->style()->setVerticalAlign(*primitiveValue);
styleResolver->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()));
@@ -1802,59 +1528,6 @@
}
};
-class ApplyPropertyZoom {
-private:
- static void resetEffectiveZoom(StyleResolver* styleResolver)
- {
- // Reset the zoom in effect. This allows the setZoom method to accurately compute a new zoom in effect.
- styleResolver->setEffectiveZoom(styleResolver->parentStyle() ? styleResolver->parentStyle()->effectiveZoom() : RenderStyle::initialZoom());
- }
-
-public:
- static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
- {
- resetEffectiveZoom(styleResolver);
- styleResolver->setZoom(styleResolver->parentStyle()->zoom());
- }
-
- static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
- {
- resetEffectiveZoom(styleResolver);
- styleResolver->setZoom(RenderStyle::initialZoom());
- }
-
- static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
- {
- ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue());
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-
- if (primitiveValue->getIdent() == CSSValueNormal) {
- resetEffectiveZoom(styleResolver);
- styleResolver->setZoom(RenderStyle::initialZoom());
- } else if (primitiveValue->getIdent() == CSSValueReset) {
- styleResolver->setEffectiveZoom(RenderStyle::initialZoom());
- styleResolver->setZoom(RenderStyle::initialZoom());
- } else if (primitiveValue->getIdent() == CSSValueDocument) {
- float docZoom = styleResolver->rootElementStyle() ? styleResolver->rootElementStyle()->zoom() : RenderStyle::initialZoom();
- styleResolver->setEffectiveZoom(docZoom);
- styleResolver->setZoom(docZoom);
- } else if (primitiveValue->isPercentage()) {
- resetEffectiveZoom(styleResolver);
- if (float percent = primitiveValue->getFloatValue())
- styleResolver->setZoom(percent / 100.0f);
- } else if (primitiveValue->isNumber()) {
- resetEffectiveZoom(styleResolver);
- if (float number = primitiveValue->getFloatValue())
- styleResolver->setZoom(number);
- }
- }
-
- static PropertyHandler createHandler()
- {
- return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
- }
-};
-
class ApplyPropertyDisplay {
private:
static inline bool isValidDisplayValue(StyleResolver* styleResolver, EDisplay displayPropertyValue)
@@ -1904,7 +1577,7 @@
{
if (value->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == CSSValueNone)
+ if (primitiveValue->getValueID() == CSSValueNone)
setValue(styleResolver->style(), 0);
else if (primitiveValue->isShape()) {
setValue(styleResolver->style(), ShapeClipPathOperation::create(basicShapeForValue(styleResolver, primitiveValue->getShapeValue())));
@@ -1927,19 +1600,22 @@
class ApplyPropertyExclusionShape {
public:
static void setValue(RenderStyle* style, PassRefPtr<ExclusionShapeValue> value) { (style->*setterFunction)(value); }
- static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
+ static void applyValue(CSSPropertyID property, StyleResolver* styleResolver, CSSValue* value)
{
if (value->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- if (primitiveValue->getIdent() == CSSValueAuto)
+ if (primitiveValue->getValueID() == CSSValueAuto)
setValue(styleResolver->style(), 0);
// FIXME Bug 102571: Layout for the value 'outside-shape' is not yet implemented
- else if (primitiveValue->getIdent() == CSSValueOutsideShape)
+ else if (primitiveValue->getValueID() == CSSValueOutsideShape)
setValue(styleResolver->style(), ExclusionShapeValue::createOutsideValue());
else if (primitiveValue->isShape()) {
RefPtr<ExclusionShapeValue> shape = ExclusionShapeValue::createShapeValue(basicShapeForValue(styleResolver, primitiveValue->getShapeValue()));
setValue(styleResolver->style(), shape.release());
}
+ } else if (value->isImageValue()) {
+ RefPtr<ExclusionShapeValue> shape = ExclusionShapeValue::createImageValue(styleResolver->styleImage(property, value));
+ setValue(styleResolver->style(), shape.release());
}
}
static PropertyHandler createHandler()
@@ -1986,7 +1662,7 @@
ASSERT(valueList->length() <= 2);
CSSPrimitiveValue* eachLineValue = toCSSPrimitiveValue(valueList->item(1));
if (eachLineValue) {
- ASSERT(eachLineValue->getIdent() == CSSValueWebkitEachLine);
+ ASSERT(eachLineValue->getValueID() == CSSValueWebkitEachLine);
styleResolver->style()->setTextIndentLine(TextIndentEachLine);
} else
styleResolver->style()->setTextIndentLine(TextIndentFirstLine);
@@ -2011,18 +1687,6 @@
m_propertyMap[i] = PropertyHandler();
// Please keep CSS property list in alphabetical order.
- setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSToStyleMap::mapFillAttachment>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundBlendMode, ApplyPropertyFillLayer<BlendMode, CSSPropertyBackgroundBlendMode, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isBlendModeSet, &FillLayer::blendMode, &FillLayer::setBlendMode, &FillLayer::clearBlendMode, &FillLayer::initialFillBlendMode, &CSSToStyleMap::mapFillBlendMode>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, &RenderStyle::invalidColor>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSToStyleMap::mapFillImage>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
- setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
- setPropertyHandler(CSSPropertyBorderBottomColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color>::createHandler());
setPropertyHandler(CSSPropertyBorderBottomLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
setPropertyHandler(CSSPropertyBorderBottomRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
@@ -2031,16 +1695,12 @@
setPropertyHandler(CSSPropertyBorderImageSlice, ApplyPropertyBorderImageModifier<BorderImage, Slice>::createHandler());
setPropertyHandler(CSSPropertyBorderImageSource, ApplyPropertyBorderImageSource<CSSPropertyBorderImageSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource, &RenderStyle::initialBorderImageSource>::createHandler());
setPropertyHandler(CSSPropertyBorderImageWidth, ApplyPropertyBorderImageModifier<BorderImage, Width>::createHandler());
- setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler());
setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
- setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler());
setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
- setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color>::createHandler());
setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
setPropertyHandler(CSSPropertyClip, ApplyPropertyClip::createHandler());
- setPropertyHandler(CSSPropertyColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, &RenderStyle::invalidColor, RenderStyle::initialColor>::createHandler());
setPropertyHandler(CSSPropertyCounterIncrement, ApplyPropertyCounter<Increment>::createHandler());
setPropertyHandler(CSSPropertyCounterReset, ApplyPropertyCounter<Reset>::createHandler());
setPropertyHandler(CSSPropertyCursor, ApplyPropertyCursor::createHandler());
@@ -2055,7 +1715,6 @@
setPropertyHandler(CSSPropertyLineHeight, ApplyPropertyLineHeight::createHandler());
setPropertyHandler(CSSPropertyListStyleImage, ApplyPropertyStyleImage<&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage>::createHandler());
setPropertyHandler(CSSPropertyOrphans, ApplyPropertyAuto<short, &RenderStyle::orphans, &RenderStyle::setOrphans, &RenderStyle::hasAutoOrphans, &RenderStyle::setHasAutoOrphans>::createHandler());
- setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler());
setPropertyHandler(CSSPropertyOutlineOffset, ApplyPropertyComputeLength<int, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset, &RenderStyle::initialOutlineOffset>::createHandler());
setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
setPropertyHandler(CSSPropertyOutlineWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth, &RenderStyle::initialOutlineWidth, NormalDisabled, ThicknessEnabled>::createHandler());
@@ -2063,9 +1722,9 @@
setPropertyHandler(CSSPropertySize, ApplyPropertyPageSize::createHandler());
setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
+ setPropertyHandler(CSSPropertyTextDecorationLine, ApplyPropertyTextDecoration::createHandler());
+
#if ENABLE(CSS3_TEXT)
- setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler());
- setPropertyHandler(CSSPropertyWebkitTextDecorationColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textDecorationColor, &RenderStyle::setTextDecorationColor, &RenderStyle::setVisitedLinkTextDecorationColor, &RenderStyle::color>::createHandler());
setPropertyHandler(CSSPropertyWebkitTextUnderlinePosition, ApplyPropertyTextUnderlinePosition::createHandler());
#endif // CSS3_TEXT
setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyTextIndent::createHandler());
@@ -2080,16 +1739,10 @@
setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &CSSAnimationData::playState, &CSSAnimationData::setPlayState, &CSSAnimationData::isPlayStateSet, &CSSAnimationData::clearPlayState, &CSSAnimationData::initialAnimationPlayState, &CSSToStyleMap::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &CSSAnimationData::timingFunction, &CSSAnimationData::setTimingFunction, &CSSAnimationData::isTimingFunctionSet, &CSSAnimationData::clearTimingFunction, &CSSAnimationData::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
setPropertyHandler(CSSPropertyWebkitAspectRatio, ApplyPropertyAspectRatio::createHandler());
- setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
- setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
- setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
- setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
setPropertyHandler(CSSPropertyWebkitBorderHorizontalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing, &RenderStyle::initialHorizontalBorderSpacing>::createHandler());
- setPropertyHandler(CSSPropertyWebkitBorderImage, ApplyPropertyBorderImage<BorderImage, CSSPropertyWebkitBorderImage, &RenderStyle::borderImage, &RenderStyle::setBorderImage>::createHandler());
setPropertyHandler(CSSPropertyWebkitBorderVerticalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing, &RenderStyle::initialVerticalBorderSpacing>::createHandler());
setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler());
setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler());
- setPropertyHandler(CSSPropertyWebkitColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler());
setPropertyHandler(CSSPropertyWebkitColumnRuleWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth, &RenderStyle::initialColumnRuleWidth, NormalDisabled, ThicknessEnabled>::createHandler());
setPropertyHandler(CSSPropertyWebkitColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlowFrom, ApplyPropertyString<MapNoneToNull, &RenderStyle::regionThread, &RenderStyle::setRegionThread, &RenderStyle::initialRegionThread>::createHandler());
@@ -2099,33 +1752,15 @@
setPropertyHandler(CSSPropertyWebkitFontVariantLigatures, ApplyPropertyFontVariantLigatures::createHandler());
setPropertyHandler(CSSPropertyWebkitHighlight, ApplyPropertyString<MapNoneToNull, &RenderStyle::highlight, &RenderStyle::setHighlight, &RenderStyle::initialHighlight>::createHandler());
setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, ApplyPropertyString<MapAutoToNull, &RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString>::createHandler());
- setPropertyHandler(CSSPropertyWebkitHyphenateLimitAfter, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitAfter, &RenderStyle::setHyphenationLimitAfter, &RenderStyle::initialHyphenationLimitAfter>::createHandler());
- setPropertyHandler(CSSPropertyWebkitHyphenateLimitBefore, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitBefore, &RenderStyle::setHyphenationLimitBefore, &RenderStyle::initialHyphenationLimitBefore>::createHandler());
- setPropertyHandler(CSSPropertyWebkitHyphenateLimitLines, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitLines, &RenderStyle::setHyphenationLimitLines, &RenderStyle::initialHyphenationLimitLines, CSSValueNoLimit>::createHandler());
setPropertyHandler(CSSPropertyWebkitLineGrid, ApplyPropertyString<MapNoneToNull, &RenderStyle::lineGrid, &RenderStyle::setLineGrid, &RenderStyle::initialLineGrid>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMarqueeIncrement, ApplyPropertyMarqueeIncrement::createHandler());
- setPropertyHandler(CSSPropertyWebkitMarqueeRepetition, ApplyPropertyMarqueeRepetition::createHandler());
setPropertyHandler(CSSPropertyWebkitMarqueeSpeed, ApplyPropertyMarqueeSpeed::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskBoxImage, ApplyPropertyBorderImage<BorderMask, CSSPropertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImage>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskBoxImageOutset, ApplyPropertyBorderImageModifier<BorderMask, Outset>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskBoxImageRepeat, ApplyPropertyBorderImageModifier<BorderMask, Repeat>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskBoxImageSlice, ApplyPropertyBorderImageModifier<BorderMask, Slice>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskBoxImageSource, ApplyPropertyBorderImageSource<CSSPropertyWebkitMaskBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImageSource, &RenderStyle::initialMaskBoxImageSource>::createHandler());
setPropertyHandler(CSSPropertyWebkitMaskBoxImageWidth, ApplyPropertyBorderImageModifier<BorderMask, Width>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSToStyleMap::mapFillImage>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
- setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitPerspectiveOriginX, CSSPropertyWebkitPerspectiveOriginY>::createHandler());
- setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler());
setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
- setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler());
- setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler());
setPropertyHandler(CSSPropertyWebkitTransformOriginZ, ApplyPropertyComputeLength<float, &RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ>::createHandler());
setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &CSSAnimationData::delay, &CSSAnimationData::setDelay, &CSSAnimationData::isDelaySet, &CSSAnimationData::clearDelay, &CSSAnimationData::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &CSSAnimationData::duration, &CSSAnimationData::setDuration, &CSSAnimationData::isDurationSet, &CSSAnimationData::clearDuration, &CSSAnimationData::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
@@ -2137,7 +1772,6 @@
setPropertyHandler(CSSPropertyWidows, ApplyPropertyAuto<short, &RenderStyle::widows, &RenderStyle::setWidows, &RenderStyle::hasAutoWidows, &RenderStyle::setHasAutoWidows>::createHandler());
setPropertyHandler(CSSPropertyWordSpacing, ApplyPropertyComputeLength<int, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
- setPropertyHandler(CSSPropertyZoom, ApplyPropertyZoom::createHandler());
}
diff --git a/Source/core/css/WebKitFontFamilyNames.in b/Source/core/css/FontFamilyNames.in
similarity index 100%
rename from Source/core/css/WebKitFontFamilyNames.in
rename to Source/core/css/FontFamilyNames.in
diff --git a/Source/core/css/FontSize.cpp b/Source/core/css/FontSize.cpp
new file mode 100644
index 0000000..88b12b3
--- /dev/null
+++ b/Source/core/css/FontSize.cpp
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
+ * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
+ * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2011. All rights reserved.
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "core/css/FontSize.h"
+
+#include "CSSValueKeywords.h"
+#include "core/dom/Document.h"
+#include "core/page/Settings.h"
+
+namespace WebCore {
+
+float FontSize::getComputedSizeFromSpecifiedSize(Document* document, float zoomFactor, bool isAbsoluteSize, float specifiedSize, ESmartMinimumForFontSize useSmartMinimumForFontSize)
+{
+ // Text with a 0px font size should not be visible and therefore needs to be
+ // exempt from minimum font size rules. Acid3 relies on this for pixel-perfect
+ // rendering. This is also compatible with other browsers that have minimum
+ // font size settings (e.g. Firefox).
+ if (fabsf(specifiedSize) < std::numeric_limits<float>::epsilon())
+ return 0.0f;
+
+ // We support two types of minimum font size. The first is a hard override that applies to
+ // all fonts. This is "minSize." The second type of minimum font size is a "smart minimum"
+ // that is applied only when the Web page can't know what size it really asked for, e.g.,
+ // when it uses logical sizes like "small" or expresses the font-size as a percentage of
+ // the user's default font setting.
+
+ // With the smart minimum, we never want to get smaller than the minimum font size to keep fonts readable.
+ // However we always allow the page to set an explicit pixel size that is smaller,
+ // since sites will mis-render otherwise (e.g., http://www.gamespot.com with a 9px minimum).
+
+ Settings* settings = document->settings();
+ if (!settings)
+ return 1.0f;
+
+ int minSize = settings->minimumFontSize();
+ int minLogicalSize = settings->minimumLogicalFontSize();
+ float zoomedSize = specifiedSize * zoomFactor;
+
+ // Apply the hard minimum first. We only apply the hard minimum if after zooming we're still too small.
+ if (zoomedSize < minSize)
+ zoomedSize = minSize;
+
+ // Now apply the "smart minimum." This minimum is also only applied if we're still too small
+ // after zooming. The font size must either be relative to the user default or the original size
+ // must have been acceptable. In other words, we only apply the smart minimum whenever we're positive
+ // doing so won't disrupt the layout.
+ if (useSmartMinimumForFontSize && zoomedSize < minLogicalSize && (specifiedSize >= minLogicalSize || !isAbsoluteSize))
+ zoomedSize = minLogicalSize;
+
+ // Also clamp to a reasonable maximum to prevent insane font sizes from causing crashes on various
+ // platforms (I'm looking at you, Windows.)
+ return std::min(maximumAllowedFontSize, zoomedSize);
+}
+
+const int fontSizeTableMax = 16;
+const int fontSizeTableMin = 9;
+const int totalKeywords = 8;
+
+// WinIE/Nav4 table for font sizes. Designed to match the legacy font mapping system of HTML.
+static const int quirksFontSizeTable[fontSizeTableMax - fontSizeTableMin + 1][totalKeywords] =
+{
+ { 9, 9, 9, 9, 11, 14, 18, 28 },
+ { 9, 9, 9, 10, 12, 15, 20, 31 },
+ { 9, 9, 9, 11, 13, 17, 22, 34 },
+ { 9, 9, 10, 12, 14, 18, 24, 37 },
+ { 9, 9, 10, 13, 16, 20, 26, 40 }, // fixed font default (13)
+ { 9, 9, 11, 14, 17, 21, 28, 42 },
+ { 9, 10, 12, 15, 17, 23, 30, 45 },
+ { 9, 10, 13, 16, 18, 24, 32, 48 } // proportional font default (16)
+};
+// HTML 1 2 3 4 5 6 7
+// CSS xxs xs s m l xl xxl
+// |
+// user pref
+
+// Strict mode table matches MacIE and Mozilla's settings exactly.
+static const int strictFontSizeTable[fontSizeTableMax - fontSizeTableMin + 1][totalKeywords] =
+{
+ { 9, 9, 9, 9, 11, 14, 18, 27 },
+ { 9, 9, 9, 10, 12, 15, 20, 30 },
+ { 9, 9, 10, 11, 13, 17, 22, 33 },
+ { 9, 9, 10, 12, 14, 18, 24, 36 },
+ { 9, 10, 12, 13, 16, 20, 26, 39 }, // fixed font default (13)
+ { 9, 10, 12, 14, 17, 21, 28, 42 },
+ { 9, 10, 13, 15, 18, 23, 30, 45 },
+ { 9, 10, 13, 16, 18, 24, 32, 48 } // proportional font default (16)
+};
+// HTML 1 2 3 4 5 6 7
+// CSS xxs xs s m l xl xxl
+// |
+// user pref
+
+// For values outside the range of the table, we use Todd Fahrner's suggested scale
+// factors for each keyword value.
+static const float fontSizeFactors[totalKeywords] = { 0.60f, 0.75f, 0.89f, 1.0f, 1.2f, 1.5f, 2.0f, 3.0f };
+
+float FontSize::fontSizeForKeyword(Document* document, int keyword, bool shouldUseFixedDefaultSize)
+{
+ Settings* settings = document->settings();
+ if (!settings)
+ return 1.0f;
+
+ bool quirksMode = document->inQuirksMode();
+ int mediumSize = shouldUseFixedDefaultSize ? settings->defaultFixedFontSize() : settings->defaultFontSize();
+ if (mediumSize >= fontSizeTableMin && mediumSize <= fontSizeTableMax) {
+ // Look up the entry in the table.
+ int row = mediumSize - fontSizeTableMin;
+ int col = (keyword - CSSValueXxSmall);
+ return quirksMode ? quirksFontSizeTable[row][col] : strictFontSizeTable[row][col];
+ }
+
+ // Value is outside the range of the table. Apply the scale factor instead.
+ float minLogicalSize = std::max(settings->minimumLogicalFontSize(), 1);
+ return std::max(fontSizeFactors[keyword - CSSValueXxSmall] * mediumSize, minLogicalSize);
+}
+
+
+
+template<typename T>
+static int findNearestLegacyFontSize(int pixelFontSize, const T* table, int multiplier)
+{
+ // Ignore table[0] because xx-small does not correspond to any legacy font size.
+ for (int i = 1; i < totalKeywords - 1; i++) {
+ if (pixelFontSize * 2 < (table[i] + table[i + 1]) * multiplier)
+ return i;
+ }
+ return totalKeywords - 1;
+}
+
+int FontSize::legacyFontSize(Document* document, int pixelFontSize, bool shouldUseFixedDefaultSize)
+{
+ Settings* settings = document->settings();
+ if (!settings)
+ return 1;
+
+ bool quirksMode = document->inQuirksMode();
+ int mediumSize = shouldUseFixedDefaultSize ? settings->defaultFixedFontSize() : settings->defaultFontSize();
+ if (mediumSize >= fontSizeTableMin && mediumSize <= fontSizeTableMax) {
+ int row = mediumSize - fontSizeTableMin;
+ return findNearestLegacyFontSize<int>(pixelFontSize, quirksMode ? quirksFontSizeTable[row] : strictFontSizeTable[row], 1);
+ }
+
+ return findNearestLegacyFontSize<float>(pixelFontSize, fontSizeFactors, mediumSize);
+}
+
+} // namespace WebCore
diff --git a/Source/core/css/FontSize.h b/Source/core/css/FontSize.h
new file mode 100644
index 0000000..3c309f3
--- /dev/null
+++ b/Source/core/css/FontSize.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef FontSize_h
+#define FontSize_h
+
+#include "core/platform/graphics/FontDescription.h"
+
+namespace WebCore {
+
+class Document;
+
+enum ESmartMinimumForFontSize { DoNotUseSmartMinimumForFontSize, UseSmartMinimumForFontFize };
+
+class FontSize {
+private:
+ FontSize()
+ {
+ }
+
+public:
+ static float getComputedSizeFromSpecifiedSize(Document*, float zoomFactor, bool isAbsoluteSize, float specifiedSize, ESmartMinimumForFontSize = UseSmartMinimumForFontFize);
+
+ // Given a CSS keyword in the range (xx-small to -webkit-xxx-large), this function will return
+ // the correct font size scaled relative to the user's default (medium).
+ static float fontSizeForKeyword(Document*, int keyword, bool shouldUseFixedDefaultSize);
+
+ // Given a font size in pixel, this function will return legacy font size between 1 and 7.
+ static int legacyFontSize(Document*, int pixelFontSize, bool shouldUseFixedDefaultSize);
+};
+
+} // namespace WebCore
+
+#endif // FontSize_h
diff --git a/Source/core/css/InspectorCSSOMWrappers.cpp b/Source/core/css/InspectorCSSOMWrappers.cpp
index 8877e00..a84449a 100644
--- a/Source/core/css/InspectorCSSOMWrappers.cpp
+++ b/Source/core/css/InspectorCSSOMWrappers.cpp
@@ -33,12 +33,12 @@
#include "core/css/CSSHostRule.h"
#include "core/css/CSSImportRule.h"
#include "core/css/CSSMediaRule.h"
+#include "core/css/CSSRegionRule.h"
#include "core/css/CSSRule.h"
#include "core/css/CSSStyleRule.h"
#include "core/css/CSSStyleSheet.h"
#include "core/css/CSSSupportsRule.h"
#include "core/css/StyleSheetContents.h"
-#include "core/css/WebKitCSSRegionRule.h"
#include "core/dom/DocumentStyleSheetCollection.h"
#include <wtf/MemoryInstrumentationHashMap.h>
@@ -77,7 +77,7 @@
collect(static_cast<CSSSupportsRule*>(cssRule));
break;
case CSSRule::WEBKIT_REGION_RULE:
- collect(static_cast<WebKitCSSRegionRule*>(cssRule));
+ collect(static_cast<CSSRegionRule*>(cssRule));
break;
case CSSRule::HOST_RULE:
collect(static_cast<CSSHostRule*>(cssRule));
diff --git a/Source/core/css/MediaFeatureNames.cpp b/Source/core/css/MediaFeatureNames.cpp
index 9c1e92a..2db2bd9 100644
--- a/Source/core/css/MediaFeatureNames.cpp
+++ b/Source/core/css/MediaFeatureNames.cpp
@@ -38,16 +38,9 @@
void init()
{
- static bool initialized;
- if (!initialized) {
- // Use placement new to initialize the globals.
-
- AtomicString::init();
#define INITIALIZE_GLOBAL(name, str) new (NotNull, (void*)&name##MediaFeature) AtomicString(str, AtomicString::ConstructFromLiteral);
- CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(INITIALIZE_GLOBAL)
+ CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(INITIALIZE_GLOBAL)
#undef INITIALIZE_GLOBAL
- initialized = true;
- }
}
} // namespace MediaFeatureNames
diff --git a/Source/core/css/MediaList.cpp b/Source/core/css/MediaList.cpp
index d6ec554..6e650fd 100644
--- a/Source/core/css/MediaList.cpp
+++ b/Source/core/css/MediaList.cpp
@@ -35,61 +35,41 @@
namespace WebCore {
/* MediaList is used to store 3 types of media related entities which mean the same:
- * Media Queries, Media Types and Media Descriptors.
- * Currently MediaList always tries to parse media queries and if parsing fails,
- * tries to fallback to Media Descriptors if m_fallbackToDescriptor flag is set.
- * Slight problem with syntax error handling:
- * CSS 2.1 Spec (http://www.w3.org/TR/CSS21/media.html)
- * specifies that failing media type parsing is a syntax error
- * CSS 3 Media Queries Spec (http://www.w3.org/TR/css3-mediaqueries/)
- * specifies that failing media query is a syntax error
- * HTML 4.01 spec (http://www.w3.org/TR/REC-html40/present/styles.html#adef-media)
- * specifies that Media Descriptors should be parsed with forward-compatible syntax
- * DOM Level 2 Style Sheet spec (http://www.w3.org/TR/DOM-Level-2-Style/)
- * talks about MediaList.mediaText and refers
- * - to Media Descriptors of HTML 4.0 in context of StyleSheet
- * - to Media Types of CSS 2.0 in context of CSSMediaRule and CSSImportRule
*
- * These facts create situation where same (illegal) media specification may result in
- * different parses depending on whether it is media attr of style element or part of
- * css @media rule.
- * <style media="screen and resolution > 40dpi"> ..</style> will be enabled on screen devices where as
- * @media screen and resolution > 40dpi {..} will not.
- * This gets more counter-intuitive in JavaScript:
- * document.styleSheets[0].media.mediaText = "screen and resolution > 40dpi" will be ok and
- * enabled, while
- * document.styleSheets[0].cssRules[0].media.mediaText = "screen and resolution > 40dpi" will
- * throw SYNTAX_ERR exception.
+ * Media Queries, Media Types and Media Descriptors.
+ *
+ * Media queries, as described in the Media Queries Level 3 specification, build on
+ * the mechanism outlined in HTML4. The syntax of media queries fit into the media
+ * type syntax reserved in HTML4. The media attribute of HTML4 also exists in XHTML
+ * and generic XML. The same syntax can also be used inside the @media and @import
+ * rules of CSS.
+ *
+ * However, the parsing rules for media queries are incompatible with those of HTML4
+ * and are consistent with those of media queries used in CSS.
+ *
+ * HTML5 (at the moment of writing still work in progress) references the Media Queries
+ * specification directly and thus updates the rules for HTML.
+ *
+ * CSS 2.1 Spec (http://www.w3.org/TR/CSS21/media.html)
+ * CSS 3 Media Queries Spec (http://www.w3.org/TR/css3-mediaqueries/)
*/
MediaQuerySet::MediaQuerySet()
- : m_fallbackToDescriptor(false)
+ : m_parserMode(MediaQueryNormalMode)
, m_lastLine(0)
{
}
-MediaQuerySet::MediaQuerySet(const String& mediaString, bool fallbackToDescriptor)
- : m_fallbackToDescriptor(fallbackToDescriptor)
+MediaQuerySet::MediaQuerySet(const String& mediaString, MediaQueryParserMode mode)
+ : m_parserMode(mode)
, m_lastLine(0)
{
- bool success = parse(mediaString);
- // FIXME: parsing can fail. The problem with failing constructor is that
- // we would need additional flag saying MediaList is not valid
- // Parse can fail only when fallbackToDescriptor == false, i.e when HTML4 media descriptor
- // forward-compatible syntax is not in use.
- // DOMImplementationCSS seems to mandate that media descriptors are used
- // for both html and svg, even though svg:style doesn't use media descriptors
- // Currently the only places where parsing can fail are
- // creating <svg:style>, creating css media / import rules from js
-
- // FIXME: This doesn't make much sense.
- if (!success)
- parse("invalid");
+ set(mediaString);
}
MediaQuerySet::MediaQuerySet(const MediaQuerySet& o)
: RefCounted<MediaQuerySet>()
- , m_fallbackToDescriptor(o.m_fallbackToDescriptor)
+ , m_parserMode(o.m_parserMode)
, m_lastLine(o.m_lastLine)
, m_queries(o.m_queries.size())
{
@@ -101,23 +81,7 @@
{
}
-static String parseMediaDescriptor(const String& string)
-{
- // http://www.w3.org/TR/REC-html40/types.html#type-media-descriptors
- // "Each entry is truncated just before the first character that isn't a
- // US ASCII letter [a-zA-Z] (ISO 10646 hex 41-5a, 61-7a), digit [0-9] (hex 30-39),
- // or hyphen (hex 2d)."
- unsigned length = string.length();
- unsigned i = 0;
- for (; i < length; ++i) {
- unsigned short c = string[i];
- if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '1' && c <= '9') || (c == '-')))
- break;
- }
- return string.left(i);
-}
-
-PassOwnPtr<MediaQuery> MediaQuerySet::parseMediaQuery(const String& queryString)
+PassOwnPtr<MediaQuery> MediaQuerySet::parseMediaQuery(const String& queryString, MediaQueryParserMode mode)
{
CSSParser parser(CSSStrictMode);
OwnPtr<MediaQuery> parsedQuery = parser.parseMediaQuery(queryString);
@@ -125,20 +89,23 @@
if (parsedQuery)
return parsedQuery.release();
- if (m_fallbackToDescriptor) {
- String medium = parseMediaDescriptor(queryString);
- if (!medium.isNull())
- return adoptPtr(new MediaQuery(MediaQuery::None, medium, nullptr));
+ switch (mode) {
+ case MediaQueryNormalMode:
+ return adoptPtr(new MediaQuery(MediaQuery::None, "not all", nullptr));
+ case MediaQueryStrictMode:
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
}
-
- return adoptPtr(new MediaQuery(MediaQuery::None, "not all", nullptr));
+ return nullptr;
}
-bool MediaQuerySet::parse(const String& mediaString)
+void MediaQuerySet::parseMediaQueryList(const String& mediaString, MediaQueryParserMode mode, Vector<OwnPtr<MediaQuery> >& result)
{
if (mediaString.isEmpty()) {
- m_queries.clear();
- return true;
+ result.clear();
+ return;
}
Vector<String> list;
@@ -146,42 +113,79 @@
// other allowed matching pairs such as (), [], {}, "", and ''.
mediaString.split(',', /* allowEmptyEntries */ true, list);
- Vector<OwnPtr<MediaQuery> > result;
result.reserveInitialCapacity(list.size());
for (unsigned i = 0; i < list.size(); ++i) {
String queryString = list[i].stripWhiteSpace();
- if (OwnPtr<MediaQuery> parsedQuery = parseMediaQuery(queryString))
+ OwnPtr<MediaQuery> parsedQuery = parseMediaQuery(queryString, mode);
+ if (parsedQuery)
result.uncheckedAppend(parsedQuery.release());
}
+}
+bool MediaQuerySet::set(const String& mediaString)
+{
+ Vector<OwnPtr<MediaQuery> > result;
+ parseMediaQueryList(mediaString, parserMode(), result);
m_queries.swap(result);
return true;
}
bool MediaQuerySet::add(const String& queryString)
{
- if (OwnPtr<MediaQuery> parsedQuery = parseMediaQuery(queryString)) {
- m_queries.append(parsedQuery.release());
+ // To "parse a media query" for a given string means to follow "the parse
+ // a media query list" steps and return "null" if more than one media query
+ // is returned, or else the returned media query.
+ Vector<OwnPtr<MediaQuery> > queries;
+ parseMediaQueryList(queryString, MediaQueryStrictMode, queries);
+
+ // Only continue if exactly one media query is found, as described above.
+ if (queries.size() != 1)
return true;
+
+ OwnPtr<MediaQuery> newQuery = queries[0].release();
+ ASSERT(newQuery);
+
+ // If comparing with any of the media queries in the collection of media
+ // queries returns true terminate these steps.
+ for (size_t i = 0; i < m_queries.size(); ++i) {
+ MediaQuery* query = m_queries[i].get();
+ if (*query == *newQuery)
+ return true;
}
- return false;
+
+ m_queries.append(newQuery.release());
+ return true;
}
bool MediaQuerySet::remove(const String& queryStringToRemove)
{
- OwnPtr<MediaQuery> parsedQuery = parseMediaQuery(queryStringToRemove);
- if (!parsedQuery)
- return false;
+ // To "parse a media query" for a given string means to follow "the parse
+ // a media query list" steps and return "null" if more than one media query
+ // is returned, or else the returned media query.
+ Vector<OwnPtr<MediaQuery> > queries;
+ parseMediaQueryList(queryStringToRemove, MediaQueryStrictMode, queries);
+ // Only continue if exactly one media query is found, as described above.
+ if (queries.size() != 1)
+ return true;
+
+ OwnPtr<MediaQuery> newQuery = queries[0].release();
+ ASSERT(newQuery);
+
+ // Remove any media query from the collection of media queries for which
+ // comparing with the media query returns true.
+ bool found = false;
for (size_t i = 0; i < m_queries.size(); ++i) {
MediaQuery* query = m_queries[i].get();
- if (*query == *parsedQuery) {
+ if (*query == *newQuery) {
m_queries.remove(i);
- return true;
+ --i;
+ found = true;
}
}
- return false;
+
+ return found;
}
void MediaQuerySet::addMediaQuery(PassOwnPtr<MediaQuery> mediaQuery)
@@ -228,15 +232,12 @@
{
}
-void MediaList::setMediaText(const String& value, ExceptionCode& ec)
+void MediaList::setMediaText(const String& value)
{
CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule);
- bool success = m_mediaQueries->parse(value);
- if (!success) {
- ec = SYNTAX_ERR;
- return;
- }
+ m_mediaQueries->set(value);
+
if (m_parentStyleSheet)
m_parentStyleSheet->didMutate();
}
@@ -268,10 +269,10 @@
bool success = m_mediaQueries->add(medium);
if (!success) {
- // FIXME: Should this really be INVALID_CHARACTER_ERR?
ec = INVALID_CHARACTER_ERR;
return;
}
+
if (m_parentStyleSheet)
m_parentStyleSheet->didMutate();
}
diff --git a/Source/core/css/MediaList.h b/Source/core/css/MediaList.h
index cc69035..554cba4 100644
--- a/Source/core/css/MediaList.h
+++ b/Source/core/css/MediaList.h
@@ -36,6 +36,11 @@
class MediaList;
class MediaQuery;
+enum MediaQueryParserMode {
+ MediaQueryNormalMode,
+ MediaQueryStrictMode,
+};
+
class MediaQuerySet : public RefCounted<MediaQuerySet> {
public:
static PassRefPtr<MediaQuerySet> create()
@@ -44,15 +49,11 @@
}
static PassRefPtr<MediaQuerySet> create(const String& mediaString)
{
- return adoptRef(new MediaQuerySet(mediaString, false));
- }
- static PassRefPtr<MediaQuerySet> createAllowingDescriptionSyntax(const String& mediaString)
- {
- return adoptRef(new MediaQuerySet(mediaString, true));
+ return adoptRef(new MediaQuerySet(mediaString, MediaQueryNormalMode));
}
~MediaQuerySet();
- bool parse(const String&);
+ bool set(const String&);
bool add(const String&);
bool remove(const String&);
@@ -71,13 +72,16 @@
private:
MediaQuerySet();
- MediaQuerySet(const String& mediaQuery, bool fallbackToDescription);
+ MediaQuerySet(const String& mediaQuery, MediaQueryParserMode);
MediaQuerySet(const MediaQuerySet&);
- PassOwnPtr<MediaQuery> parseMediaQuery(const String&);
+ PassOwnPtr<MediaQuery> parseMediaQuery(const String&, MediaQueryParserMode);
+ void parseMediaQueryList(const String&, MediaQueryParserMode, Vector<OwnPtr<MediaQuery> >& result);
- unsigned m_fallbackToDescriptor : 1; // true if failed media query parsing should fallback to media description parsing.
- signed m_lastLine : 31;
+ MediaQueryParserMode parserMode() const { return static_cast<MediaQueryParserMode>(m_parserMode); }
+
+ unsigned m_parserMode : 2;
+ unsigned m_lastLine : 30;
Vector<OwnPtr<MediaQuery> > m_queries;
};
@@ -100,7 +104,7 @@
void appendMedium(const String& newMedium, ExceptionCode&);
String mediaText() const { return m_mediaQueries->mediaText(); }
- void setMediaText(const String&, ExceptionCode&);
+ void setMediaText(const String&);
// Not part of CSSOM.
CSSRule* parentRule() const { return m_parentRule; }
diff --git a/Source/core/css/MediaList.idl b/Source/core/css/MediaList.idl
index 29cc41a..1aba7ce 100644
--- a/Source/core/css/MediaList.idl
+++ b/Source/core/css/MediaList.idl
@@ -27,7 +27,7 @@
[
] interface MediaList {
- [TreatNullAs=NullString, TreatReturnedNullStringAs=Null, SetterRaisesException] attribute DOMString mediaText;
+ [TreatNullAs=NullString, TreatReturnedNullStringAs=Null] attribute DOMString mediaText;
readonly attribute unsigned long length;
[TreatReturnedNullStringAs=Null] getter DOMString item([Default=Undefined] optional unsigned long index);
diff --git a/Source/core/css/MediaQuery.cpp b/Source/core/css/MediaQuery.cpp
index f5a322a..117774d 100644
--- a/Source/core/css/MediaQuery.cpp
+++ b/Source/core/css/MediaQuery.cpp
@@ -80,7 +80,6 @@
return codePointCompare(a->serialize(), b->serialize()) < 0;
}
-
MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > > exprs)
: m_restrictor(r)
, m_mediaType(mediaType.lower())
@@ -94,18 +93,19 @@
nonCopyingSort(m_expressions->begin(), m_expressions->end(), expressionCompare);
- // remove all duplicated expressions
- String key;
+ // Remove all duplicated expressions.
+ MediaQueryExp* key = 0;
for (int i = m_expressions->size() - 1; i >= 0; --i) {
+ MediaQueryExp* exp = m_expressions->at(i).get();
- // if not all of the expressions is valid the media query must be ignored.
+ // If not all of the expressions are valid the media query must be ignored.
if (!m_ignored)
- m_ignored = !m_expressions->at(i)->isValid();
+ m_ignored = !exp->isValid();
- if (m_expressions->at(i)->serialize() == key)
+ if (key && *exp == *key)
m_expressions->remove(i);
else
- key = m_expressions->at(i)->serialize();
+ key = exp;
}
}
diff --git a/Source/core/css/MediaQueryEvaluator.cpp b/Source/core/css/MediaQueryEvaluator.cpp
index 97b6248..2ded0b5 100644
--- a/Source/core/css/MediaQueryEvaluator.cpp
+++ b/Source/core/css/MediaQueryEvaluator.cpp
@@ -236,7 +236,7 @@
int width = viewportSize(view).width();
int height = viewportSize(view).height();
if (value && value->isPrimitiveValue()) {
- const int id = toCSSPrimitiveValue(value)->getIdent();
+ const CSSValueID id = toCSSPrimitiveValue(value)->getValueID();
if (width > height) // Square viewport is portrait.
return CSSValueLandscape == id;
return CSSValuePortrait == id;
@@ -585,7 +585,7 @@
if (!value)
return true;
- return toCSSPrimitiveValue(value)->getIdent() == CSSValueWindowed;
+ return toCSSPrimitiveValue(value)->getValueID() == CSSValueWindowed;
}
enum PointerDeviceType { TouchPointer, MousePointer, NoPointer, UnknownPointer };
@@ -642,7 +642,7 @@
if (!value->isPrimitiveValue())
return false;
- const int id = toCSSPrimitiveValue(value)->getIdent();
+ const CSSValueID id = toCSSPrimitiveValue(value)->getValueID();
return (pointer == NoPointer && id == CSSValueNone)
|| (pointer == TouchPointer && id == CSSValueCoarse)
|| (pointer == MousePointer && id == CSSValueFine);
@@ -663,8 +663,7 @@
// If a platform interface supplies progressive/interlace info for TVs in the
// future, it needs to be handled here. For now, assume a modern TV with
// progressive display.
- const int id = toCSSPrimitiveValue(value)->getIdent();
- return id == CSSValueProgressive;
+ return toCSSPrimitiveValue(value)->getValueID() == CSSValueProgressive;
}
static void createFunctionMap()
diff --git a/Source/core/css/MediaQueryExp.cpp b/Source/core/css/MediaQueryExp.cpp
index 128c436..1af4b57 100644
--- a/Source/core/css/MediaQueryExp.cpp
+++ b/Source/core/css/MediaQueryExp.cpp
@@ -51,7 +51,7 @@
|| mediaFeature == MediaFeatureNames::scanMediaFeature;
}
-static inline bool featureWithValidIdent(const AtomicString& mediaFeature, int ident)
+static inline bool featureWithValidIdent(const AtomicString& mediaFeature, CSSValueID ident)
{
if (mediaFeature == MediaFeatureNames::orientationMediaFeature)
return ident == CSSValuePortrait || ident == CSSValueLandscape;
@@ -210,7 +210,7 @@
// Media features that use CSSValueIDs.
if (featureWithCSSValueID(mediaFeature, value)) {
m_value = CSSPrimitiveValue::createIdentifier(value->id);
- if (!featureWithValidIdent(mediaFeature, toCSSPrimitiveValue(m_value.get())->getIdent()))
+ if (!featureWithValidIdent(mediaFeature, toCSSPrimitiveValue(m_value.get())->getValueID()))
m_value.clear();
}
@@ -279,9 +279,6 @@
String MediaQueryExp::serialize() const
{
- if (!m_serializationCache.isNull())
- return m_serializationCache;
-
StringBuilder result;
result.append("(");
result.append(m_mediaFeature.lower());
@@ -291,15 +288,13 @@
}
result.append(")");
- const_cast<MediaQueryExp*>(this)->m_serializationCache = result.toString();
- return m_serializationCache;
+ return result.toString();
}
void MediaQueryExp::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
info.addMember(m_mediaFeature, "mediaFeature");
- info.addMember(m_serializationCache, "serializationCache");
info.addMember(m_value, "value");
}
diff --git a/Source/core/css/MediaQueryExp.h b/Source/core/css/MediaQueryExp.h
index 620e597..5d15a8c 100644
--- a/Source/core/css/MediaQueryExp.h
+++ b/Source/core/css/MediaQueryExp.h
@@ -71,7 +71,6 @@
AtomicString m_mediaFeature;
RefPtr<CSSValue> m_value;
bool m_isValid;
- String m_serializationCache;
};
} // namespace
diff --git a/Source/core/css/PseudoStyleRequest.h b/Source/core/css/PseudoStyleRequest.h
new file mode 100644
index 0000000..97ff599
--- /dev/null
+++ b/Source/core/css/PseudoStyleRequest.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef PseudoStyleRequest_h
+#define PseudoStyleRequest_h
+
+#include "core/platform/ScrollTypes.h"
+#include "core/rendering/style/RenderStyleConstants.h"
+
+namespace WebCore {
+
+class RenderScrollbar;
+
+class PseudoStyleRequest {
+public:
+ PseudoStyleRequest(PseudoId pseudoId, RenderScrollbar* scrollbar = 0, ScrollbarPart scrollbarPart = NoPart)
+ : pseudoId(pseudoId)
+ , scrollbarPart(scrollbarPart)
+ , scrollbar(scrollbar)
+ {
+ }
+
+ PseudoId pseudoId;
+ ScrollbarPart scrollbarPart;
+ RenderScrollbar* scrollbar;
+};
+
+} // namespace WebCore
+
+#endif // PseudoStyleRequest_h
diff --git a/Source/core/css/RuleSet.cpp b/Source/core/css/RuleSet.cpp
index 627e43c..580a004 100644
--- a/Source/core/css/RuleSet.cpp
+++ b/Source/core/css/RuleSet.cpp
@@ -34,6 +34,7 @@
#include <wtf/MemoryInstrumentationVector.h>
#include "HTMLNames.h"
#include "core/css/CSSFontSelector.h"
+#include "core/css/CSSKeyframesRule.h"
#include "core/css/CSSSelector.h"
#include "core/css/CSSSelectorList.h"
#include "core/css/MediaQueryEvaluator.h"
@@ -43,7 +44,6 @@
#include "core/css/StyleRule.h"
#include "core/css/StyleRuleImport.h"
#include "core/css/StyleSheetContents.h"
-#include "core/css/WebKitCSSKeyframesRule.h"
#include "core/css/resolver/StyleResolver.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
#include "weborigin/SecurityOrigin.h"
diff --git a/Source/core/css/SVGCSSParser.cpp b/Source/core/css/SVGCSSParser.cpp
index 6085823..1a38d25 100644
--- a/Source/core/css/SVGCSSParser.cpp
+++ b/Source/core/css/SVGCSSParser.cpp
@@ -44,7 +44,7 @@
if (!value)
return false;
- int id = value->id;
+ CSSValueID id = value->id;
bool valid_primitive = false;
RefPtr<CSSValue> parsedValue;
diff --git a/Source/core/css/SVGCSSStyleSelector.cpp b/Source/core/css/SVGCSSStyleSelector.cpp
index ace386b..912ddd9 100644
--- a/Source/core/css/SVGCSSStyleSelector.cpp
+++ b/Source/core/css/SVGCSSStyleSelector.cpp
@@ -133,8 +133,8 @@
if (!primitiveValue)
break;
- if (primitiveValue->getIdent()) {
- switch (primitiveValue->getIdent()) {
+ if (primitiveValue->getValueID()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueBaseline:
svgstyle->setBaselineShift(BS_BASELINE);
break;
@@ -535,7 +535,7 @@
ASSERT(orientation != -1);
svgstyle->setGlyphOrientationVertical((EGlyphOrientation) orientation);
- } else if (primitiveValue->getIdent() == CSSValueAuto)
+ } else if (primitiveValue->getValueID() == CSSValueAuto)
svgstyle->setGlyphOrientationVertical(GO_AUTO);
break;
diff --git a/Source/core/css/SVGCSSValueKeywords.in b/Source/core/css/SVGCSSValueKeywords.in
index ad23956..3fd3642 100644
--- a/Source/core/css/SVGCSSValueKeywords.in
+++ b/Source/core/css/SVGCSSValueKeywords.in
@@ -176,7 +176,7 @@
// CSS_PROP_STOP_OPACITY
// CSS_PROP_COLOR_INTERPOLATION
//auto
-//sRGB
+sRGB
linearRGB
// CSS_PROP_COLOR_INTERPOLATION_FILTERS
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index cde1613..7195749 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -494,7 +494,8 @@
if (!selector->parseNth())
break;
if (Element* parentElement = element->parentElement()) {
- int count = 1 + siblingTraversalStrategy.countElementsBefore(element);
+ // FIXME: We should always have the index passed in to avoid needing countElementsBefore.
+ int count = context.childIndex ? context.childIndex : 1 + siblingTraversalStrategy.countElementsBefore(element);
if (m_mode == ResolvingStyle) {
RenderStyle* childStyle = context.elementStyle ? context.elementStyle : element->renderStyle();
element->setChildIndex(count);
@@ -527,7 +528,8 @@
parentElement->setChildrenAffectedByBackwardPositionalRules();
if (!parentElement->isFinishedParsingChildren())
return false;
- int count = 1 + siblingTraversalStrategy.countElementsAfter(element);
+ // FIXME: We should always have the index passed in to avoid needing countElementsAfter.
+ int count = context.childIndex ? context.childIndex : 1 + siblingTraversalStrategy.countElementsAfter(element);
if (selector->matchNth(count))
return true;
}
diff --git a/Source/core/css/SelectorChecker.h b/Source/core/css/SelectorChecker.h
index 2b192e7..30b7f9e 100644
--- a/Source/core/css/SelectorChecker.h
+++ b/Source/core/css/SelectorChecker.h
@@ -58,7 +58,7 @@
struct SelectorCheckingContext {
// Initial selector constructor
- SelectorCheckingContext(const CSSSelector* selector, Element* element, VisitedMatchType visitedMatchType)
+ SelectorCheckingContext(const CSSSelector* selector, Element* element, VisitedMatchType visitedMatchType, int childIndex = 0)
: selector(selector)
, element(element)
, scope(0)
@@ -71,6 +71,7 @@
, hasScrollbarPseudo(false)
, hasSelectionPseudo(false)
, behaviorAtBoundary(DoesNotCrossBoundary)
+ , childIndex(childIndex)
{ }
const CSSSelector* selector;
@@ -85,6 +86,7 @@
bool hasScrollbarPseudo;
bool hasSelectionPseudo;
BehaviorAtBoundary behaviorAtBoundary;
+ int childIndex;
};
template<typename SiblingTraversalStrategy>
diff --git a/Source/core/css/SiblingTraversalStrategies.h b/Source/core/css/SiblingTraversalStrategies.h
index 660a6c5..f4e185b 100644
--- a/Source/core/css/SiblingTraversalStrategies.h
+++ b/Source/core/css/SiblingTraversalStrategies.h
@@ -79,14 +79,11 @@
inline int DOMSiblingTraversalStrategy::countElementsBefore(Element* element) const
{
int count = 0;
- for (const Element* sibling = element->previousElementSibling(); sibling; sibling = sibling->previousElementSibling()) {
- unsigned index = sibling->childIndex();
- if (index) {
- count += index;
- break;
- }
- count++;
- }
+ // We can't use the same early return as is present in countElementsAfter due
+ // to the order we resolve style; if a new element is inserted into the middle,
+ // we'd end up using a stale cached childIndex.
+ for (const Element* sibling = element->previousElementSibling(); sibling; sibling = sibling->previousElementSibling())
+ ++count;
return count;
}
@@ -105,8 +102,16 @@
inline int DOMSiblingTraversalStrategy::countElementsAfter(Element* element) const
{
int count = 0;
- for (const Element* sibling = element->nextElementSibling(); sibling; sibling = sibling->nextElementSibling())
+ // We can use an early return here because we resolve style from lastChild to
+ // firstChild, so we're guaranteed to not have stale cached childIndices.
+ for (const Element* sibling = element->nextElementSibling(); sibling; sibling = sibling->nextElementSibling()) {
+ unsigned index = sibling->childIndex();
+ if (index) {
+ count += index;
+ break;
+ }
++count;
+ }
return count;
}
diff --git a/Source/core/css/StyleMedia.cpp b/Source/core/css/StyleMedia.cpp
index f425c87..6f003f7 100644
--- a/Source/core/css/StyleMedia.cpp
+++ b/Source/core/css/StyleMedia.cpp
@@ -67,7 +67,7 @@
RefPtr<RenderStyle> rootStyle = styleResolver->styleForElement(documentElement, 0 /*defaultParent*/, DisallowStyleSharing, MatchOnlyUserAgentRules);
RefPtr<MediaQuerySet> media = MediaQuerySet::create();
- if (!media->parse(query))
+ if (!media->set(query))
return false;
MediaQueryEvaluator screenEval(type(), m_frame, rootStyle.get());
diff --git a/Source/core/css/StylePropertySerializer.cpp b/Source/core/css/StylePropertySerializer.cpp
index 0450b7d..c132da4 100644
--- a/Source/core/css/StylePropertySerializer.cpp
+++ b/Source/core/css/StylePropertySerializer.cpp
@@ -340,10 +340,12 @@
return getShorthandValue(webkitFlexShorthand());
case CSSPropertyWebkitFlexFlow:
return getShorthandValue(webkitFlexFlowShorthand());
- case CSSPropertyWebkitGridColumn:
- return getShorthandValue(webkitGridColumnShorthand());
- case CSSPropertyWebkitGridRow:
- return getShorthandValue(webkitGridRowShorthand());
+ case CSSPropertyGridColumn:
+ return getShorthandValue(gridColumnShorthand());
+ case CSSPropertyGridRow:
+ return getShorthandValue(gridRowShorthand());
+ case CSSPropertyGridArea:
+ return getShorthandValue(gridAreaShorthand());
case CSSPropertyFont:
return fontValue();
case CSSPropertyMargin:
@@ -594,8 +596,8 @@
if (value->isImplicitInitialValue() || yValue->isImplicitInitialValue())
continue;
- int xId = toCSSPrimitiveValue(value.get())->getIdent();
- int yId = toCSSPrimitiveValue(yValue.get())->getIdent();
+ CSSValueID xId = toCSSPrimitiveValue(value.get())->getValueID();
+ CSSValueID yId = toCSSPrimitiveValue(yValue.get())->getValueID();
if (xId != yId) {
if (xId == CSSValueRepeat && yId == CSSValueNoRepeat) {
useRepeatXShorthand = true;
diff --git a/Source/core/css/StylePropertySet.cpp b/Source/core/css/StylePropertySet.cpp
index e95154c..3ae5c7f 100644
--- a/Source/core/css/StylePropertySet.cpp
+++ b/Source/core/css/StylePropertySet.cpp
@@ -275,7 +275,13 @@
*toReplace = CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.shorthandID(), property.metadata().m_implicit);
}
-bool MutableStylePropertySet::setProperty(CSSPropertyID propertyID, int identifier, bool important)
+bool MutableStylePropertySet::setProperty(CSSPropertyID propertyID, CSSValueID identifier, bool important)
+{
+ setProperty(CSSProperty(propertyID, cssValuePool().createIdentifierValue(identifier), important));
+ return true;
+}
+
+bool MutableStylePropertySet::setProperty(CSSPropertyID propertyID, CSSPropertyID identifier, bool important)
{
setProperty(CSSProperty(propertyID, cssValuePool().createIdentifierValue(identifier), important));
return true;
diff --git a/Source/core/css/StylePropertySet.h b/Source/core/css/StylePropertySet.h
index 067b5aa..65af447 100644
--- a/Source/core/css/StylePropertySet.h
+++ b/Source/core/css/StylePropertySet.h
@@ -192,7 +192,8 @@
void setProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important = false);
// These do not. FIXME: This is too messy, we can do better.
- bool setProperty(CSSPropertyID, int identifier, bool important = false);
+ bool setProperty(CSSPropertyID, CSSValueID identifier, bool important = false);
+ bool setProperty(CSSPropertyID, CSSPropertyID identifier, bool important = false);
void appendPrefixingVariantProperty(const CSSProperty&);
void setPrefixingVariantProperty(const CSSProperty&);
void setProperty(const CSSProperty&, CSSProperty* slot = 0);
diff --git a/Source/core/css/StylePropertyShorthand.cpp b/Source/core/css/StylePropertyShorthand.cpp
index 89ffe35..494b217 100644
--- a/Source/core/css/StylePropertyShorthand.cpp
+++ b/Source/core/css/StylePropertyShorthand.cpp
@@ -365,26 +365,36 @@
return webkitMarginCollapseLonghands;
}
-const StylePropertyShorthand& webkitGridColumnShorthand()
+const StylePropertyShorthand& gridColumnShorthand()
{
- static const CSSPropertyID webkitGridColumnProperties[] = {
- CSSPropertyWebkitGridStart,
- CSSPropertyWebkitGridEnd
+ static const CSSPropertyID gridColumnProperties[] = {
+ CSSPropertyGridStart,
+ CSSPropertyGridEnd
};
- DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitGridColumnLonghands, (webkitGridColumnProperties, WTF_ARRAY_LENGTH(webkitGridColumnProperties)));
- return webkitGridColumnLonghands;
-
+ DEFINE_STATIC_LOCAL(StylePropertyShorthand, gridColumnLonghands, (gridColumnProperties, WTF_ARRAY_LENGTH(gridColumnProperties)));
+ return gridColumnLonghands;
}
-const StylePropertyShorthand& webkitGridRowShorthand()
+const StylePropertyShorthand& gridRowShorthand()
{
- static const CSSPropertyID webkitGridRowProperties[] = {
- CSSPropertyWebkitGridBefore,
- CSSPropertyWebkitGridAfter
+ static const CSSPropertyID gridRowProperties[] = {
+ CSSPropertyGridBefore,
+ CSSPropertyGridAfter
};
- DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitGridRowLonghands, (webkitGridRowProperties, WTF_ARRAY_LENGTH(webkitGridRowProperties)));
- return webkitGridRowLonghands;
+ DEFINE_STATIC_LOCAL(StylePropertyShorthand, gridRowLonghands, (gridRowProperties, WTF_ARRAY_LENGTH(gridRowProperties)));
+ return gridRowLonghands;
+}
+const StylePropertyShorthand& gridAreaShorthand()
+{
+ static const CSSPropertyID gridAreaProperties[] = {
+ CSSPropertyGridStart,
+ CSSPropertyGridBefore,
+ CSSPropertyGridEnd,
+ CSSPropertyGridAfter
+ };
+ DEFINE_STATIC_LOCAL(StylePropertyShorthand, gridAreaLonghands, (gridAreaProperties, WTF_ARRAY_LENGTH(gridAreaProperties)));
+ return gridAreaLonghands;
}
const StylePropertyShorthand& webkitMarqueeShorthand()
@@ -536,10 +546,12 @@
return webkitFlexShorthand();
case CSSPropertyWebkitFlexFlow:
return webkitFlexFlowShorthand();
- case CSSPropertyWebkitGridColumn:
- return webkitGridColumnShorthand();
- case CSSPropertyWebkitGridRow:
- return webkitGridRowShorthand();
+ case CSSPropertyGridColumn:
+ return gridColumnShorthand();
+ case CSSPropertyGridRow:
+ return gridRowShorthand();
+ case CSSPropertyGridArea:
+ return gridAreaShorthand();
case CSSPropertyWebkitMarginCollapse:
return webkitMarginCollapseShorthand();
case CSSPropertyWebkitMarquee:
diff --git a/Source/core/css/StylePropertyShorthand.h b/Source/core/css/StylePropertyShorthand.h
index 2ae9356..5cdfec1 100644
--- a/Source/core/css/StylePropertyShorthand.h
+++ b/Source/core/css/StylePropertyShorthand.h
@@ -91,8 +91,9 @@
const StylePropertyShorthand& webkitColumnRuleShorthand();
const StylePropertyShorthand& webkitFlexFlowShorthand();
const StylePropertyShorthand& webkitFlexShorthand();
-const StylePropertyShorthand& webkitGridColumnShorthand();
-const StylePropertyShorthand& webkitGridRowShorthand();
+const StylePropertyShorthand& gridColumnShorthand();
+const StylePropertyShorthand& gridRowShorthand();
+const StylePropertyShorthand& gridAreaShorthand();
const StylePropertyShorthand& webkitMarginCollapseShorthand();
const StylePropertyShorthand& webkitMarqueeShorthand();
const StylePropertyShorthand& webkitMaskShorthand();
diff --git a/Source/core/css/StyleRule.cpp b/Source/core/css/StyleRule.cpp
index 41cda8c..14e0aa8 100644
--- a/Source/core/css/StyleRule.cpp
+++ b/Source/core/css/StyleRule.cpp
@@ -24,23 +24,23 @@
#include "RuntimeEnabledFeatures.h"
#include "core/css/CSSCharsetRule.h"
+#include "core/css/CSSFilterRule.h"
#include "core/css/CSSFontFaceRule.h"
#include "core/css/CSSHostRule.h"
#include "core/css/CSSImportRule.h"
+#include "core/css/CSSKeyframeRule.h"
+#include "core/css/CSSKeyframesRule.h"
#include "core/css/CSSMediaRule.h"
#include "core/css/CSSPageRule.h"
+#include "core/css/CSSRegionRule.h"
#include "core/css/CSSStyleRule.h"
#include "core/css/CSSSupportsRule.h"
#include "core/css/CSSUnknownRule.h"
+#include "core/css/CSSViewportRule.h"
#include "core/css/StylePropertySet.h"
#include "core/css/StyleRuleImport.h"
-#include "core/css/WebKitCSSFilterRule.h"
-#include "core/css/WebKitCSSKeyframeRule.h"
-#include "core/css/WebKitCSSKeyframesRule.h"
-#include "core/css/WebKitCSSRegionRule.h"
-#include "core/css/WebKitCSSViewportRule.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
-#include <wtf/MemoryInstrumentationVector.h>
+#include "wtf/MemoryInstrumentationVector.h"
namespace WebCore {
@@ -212,13 +212,13 @@
rule = CSSSupportsRule::create(static_cast<StyleRuleSupports*>(self), parentSheet);
break;
case Region:
- rule = WebKitCSSRegionRule::create(static_cast<StyleRuleRegion*>(self), parentSheet);
+ rule = CSSRegionRule::create(static_cast<StyleRuleRegion*>(self), parentSheet);
break;
case Import:
rule = CSSImportRule::create(static_cast<StyleRuleImport*>(self), parentSheet);
break;
case Keyframes:
- rule = WebKitCSSKeyframesRule::create(static_cast<StyleRuleKeyframes*>(self), parentSheet);
+ rule = CSSKeyframesRule::create(static_cast<StyleRuleKeyframes*>(self), parentSheet);
break;
#if ENABLE(CSS_DEVICE_ADAPTATION)
case Viewport:
@@ -229,7 +229,7 @@
rule = CSSHostRule::create(static_cast<StyleRuleHost*>(self), parentSheet);
break;
case Filter:
- rule = WebKitCSSFilterRule::create(static_cast<StyleRuleFilter*>(self), parentSheet);
+ rule = CSSFilterRule::create(static_cast<StyleRuleFilter*>(self), parentSheet);
break;
case Unknown:
case Charset:
diff --git a/Source/core/css/StyleSheetContents.cpp b/Source/core/css/StyleSheetContents.cpp
index 6324aac..094d169 100644
--- a/Source/core/css/StyleSheetContents.cpp
+++ b/Source/core/css/StyleSheetContents.cpp
@@ -332,7 +332,7 @@
RefPtr<StyleSheetContents> protect(this);
// Avoid |this| being deleted by scripts that run via
- // ScriptableDocumentParser::executeScriptsWaitingForStylesheets().
+ // ScriptableDocumentParser::executeScriptsWaitingForResources().
// See <rdar://problem/6622300>.
RefPtr<StyleSheetContents> protector(this);
StyleSheetContents* parentSheet = parentStyleSheet();
diff --git a/Source/core/css/StyleSheetList.cpp b/Source/core/css/StyleSheetList.cpp
index 4b040e3..226206e 100644
--- a/Source/core/css/StyleSheetList.cpp
+++ b/Source/core/css/StyleSheetList.cpp
@@ -80,4 +80,12 @@
return 0;
}
+CSSStyleSheet* StyleSheetList::anonymousNamedGetter(const AtomicString& name)
+{
+ HTMLStyleElement* item = getNamedItem(name);
+ if (!item)
+ return 0;
+ return item->sheet();
+}
+
} // namespace WebCore
diff --git a/Source/core/css/StyleSheetList.h b/Source/core/css/StyleSheetList.h
index c052841..9963e30 100644
--- a/Source/core/css/StyleSheetList.h
+++ b/Source/core/css/StyleSheetList.h
@@ -21,6 +21,7 @@
#ifndef StyleSheetList_h
#define StyleSheetList_h
+#include "core/css/CSSStyleSheet.h"
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
#include <wtf/PassRefPtr.h>
@@ -45,6 +46,7 @@
Document* document() { return m_document; }
void detachFromDocument();
+ CSSStyleSheet* anonymousNamedGetter(const AtomicString&);
private:
StyleSheetList(Document*);
diff --git a/Source/core/css/StyleSheetList.idl b/Source/core/css/StyleSheetList.idl
index b4681ab..390e2c9 100644
--- a/Source/core/css/StyleSheetList.idl
+++ b/Source/core/css/StyleSheetList.idl
@@ -24,6 +24,6 @@
] interface StyleSheetList {
readonly attribute unsigned long length;
getter StyleSheet item([Default=Undefined] optional unsigned long index);
- [Custom] getter StyleSheet (DOMString name);
+ [ImplementedAs=anonymousNamedGetter, NotEnumerable] getter CSSStyleSheet (DOMString name);
};
diff --git a/Source/core/css/html.css b/Source/core/css/html.css
index acf0657..e9e331a 100644
--- a/Source/core/css/html.css
+++ b/Source/core/css/html.css
@@ -85,7 +85,6 @@
marquee {
display: inline-block;
- overflow: -webkit-marquee
}
address {
@@ -440,7 +439,7 @@
display: inline-block;
-webkit-flex: none;
-webkit-user-modify: read-only !important;
- margin-left: 2px;
+ -webkit-margin-start: 2px;
}
input[type="search"]::-webkit-search-cancel-button {
@@ -829,8 +828,6 @@
box-sizing: border-box;
}
-#if defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR
-
input[type="color"] {
-webkit-appearance: square-button;
width: 44px;
@@ -853,8 +850,6 @@
-webkit-user-modify: read-only !important;
}
-#endif // defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR
-
#if defined(ENABLE_CALENDAR_PICKER) && ENABLE_CALENDAR_PICKER
input::-webkit-calendar-picker-indicator {
display: inline-block;
diff --git a/Source/core/css/mediaControls.css b/Source/core/css/mediaControls.css
index 58093e4..872f595 100644
--- a/Source/core/css/mediaControls.css
+++ b/Source/core/css/mediaControls.css
@@ -189,14 +189,6 @@
color: inherit;
}
-audio::-webkit-media-controls-closed-captions-container, video::-webkit-media-controls-closed-captions-container {
- display: none;
-}
-
-audio::-webkit-media-controls-closed-captions-track-list, video::-webkit-media-controls-closed-captions-track-list {
- display: none;
-}
-
audio::-webkit-media-controls-volume-slider-mute-button, video::-webkit-media-controls-volume-slider-mute-button {
-webkit-appearance: media-volume-slider-mute-button;
display: none;
@@ -246,11 +238,36 @@
padding: 2px 2px;
}
+video::-webkit-media-text-track-region {
+ position: absolute;
+ line-height: 5.33vh;
+ writing-mode: horizontal-tb;
+ background: rgba(0, 0, 0, 0.8);
+ color: rgba(255, 255, 255, 1);
+ word-wrap: break-word;
+ overflow-wrap: break-word;
+ overflow: hidden;
+}
+
+video::-webkit-media-text-track-region-container {
+ position: relative;
+
+ display: -webkit-flex;
+ -webkit-flex-flow: column;
+ -webkit-flex-direction: column;
+}
+
+video::-webkit-media-text-track-region-container.scrolling {
+ -webkit-transition: top 433ms linear;
+}
+
+
video::-webkit-media-text-track-display {
position: absolute;
overflow: hidden;
white-space: pre-wrap;
-webkit-box-sizing: border-box;
+ -webkit-flex: 0 0 auto;
}
video::cue(:future) {
diff --git a/Source/core/css/resolver/FilterOperationResolver.cpp b/Source/core/css/resolver/FilterOperationResolver.cpp
index 9cdd4e4..d2c8e45 100644
--- a/Source/core/css/resolver/FilterOperationResolver.cpp
+++ b/Source/core/css/resolver/FilterOperationResolver.cpp
@@ -29,12 +29,13 @@
#include "config.h"
#include "core/css/resolver/FilterOperationResolver.h"
+
+#include "core/css/CSSFilterValue.h"
+#include "core/css/CSSMixFunctionValue.h"
#include "core/css/CSSParser.h"
#include "core/css/CSSPrimitiveValueMappings.h"
+#include "core/css/CSSShaderValue.h"
#include "core/css/ShadowValue.h"
-#include "core/css/WebKitCSSFilterValue.h"
-#include "core/css/WebKitCSSMixFunctionValue.h"
-#include "core/css/WebKitCSSShaderValue.h"
#include "core/css/resolver/TransformBuilder.h"
#include "core/platform/graphics/filters/custom/CustomFilterArrayParameter.h"
#include "core/platform/graphics/filters/custom/CustomFilterConstants.h"
@@ -56,34 +57,34 @@
}
-static FilterOperation::OperationType filterOperationForType(WebKitCSSFilterValue::FilterOperationType type)
+static FilterOperation::OperationType filterOperationForType(CSSFilterValue::FilterOperationType type)
{
switch (type) {
- case WebKitCSSFilterValue::ReferenceFilterOperation:
+ case CSSFilterValue::ReferenceFilterOperation:
return FilterOperation::REFERENCE;
- case WebKitCSSFilterValue::GrayscaleFilterOperation:
+ case CSSFilterValue::GrayscaleFilterOperation:
return FilterOperation::GRAYSCALE;
- case WebKitCSSFilterValue::SepiaFilterOperation:
+ case CSSFilterValue::SepiaFilterOperation:
return FilterOperation::SEPIA;
- case WebKitCSSFilterValue::SaturateFilterOperation:
+ case CSSFilterValue::SaturateFilterOperation:
return FilterOperation::SATURATE;
- case WebKitCSSFilterValue::HueRotateFilterOperation:
+ case CSSFilterValue::HueRotateFilterOperation:
return FilterOperation::HUE_ROTATE;
- case WebKitCSSFilterValue::InvertFilterOperation:
+ case CSSFilterValue::InvertFilterOperation:
return FilterOperation::INVERT;
- case WebKitCSSFilterValue::OpacityFilterOperation:
+ case CSSFilterValue::OpacityFilterOperation:
return FilterOperation::OPACITY;
- case WebKitCSSFilterValue::BrightnessFilterOperation:
+ case CSSFilterValue::BrightnessFilterOperation:
return FilterOperation::BRIGHTNESS;
- case WebKitCSSFilterValue::ContrastFilterOperation:
+ case CSSFilterValue::ContrastFilterOperation:
return FilterOperation::CONTRAST;
- case WebKitCSSFilterValue::BlurFilterOperation:
+ case CSSFilterValue::BlurFilterOperation:
return FilterOperation::BLUR;
- case WebKitCSSFilterValue::DropShadowFilterOperation:
+ case CSSFilterValue::DropShadowFilterOperation:
return FilterOperation::DROP_SHADOW;
- case WebKitCSSFilterValue::CustomFilterOperation:
+ case CSSFilterValue::CustomFilterOperation:
return FilterOperation::CUSTOM;
- case WebKitCSSFilterValue::UnknownFilterOperation:
+ case CSSFilterValue::UnknownFilterOperation:
return FilterOperation::NONE;
}
return FilterOperation::NONE;
@@ -94,7 +95,7 @@
return codePointCompareLessThan(a->name(), b->name());
}
-static StyleShader* cachedOrPendingStyleShaderFromValue(WebKitCSSShaderValue* value, StyleResolverState& state)
+static StyleShader* cachedOrPendingStyleShaderFromValue(CSSShaderValue* value, StyleResolverState& state)
{
StyleShader* shader = value->cachedOrPendingShader();
if (shader && shader->isPendingShader())
@@ -104,8 +105,8 @@
static StyleShader* styleShader(CSSValue* value, StyleResolverState& state)
{
- if (value->isWebKitCSSShaderValue())
- return cachedOrPendingStyleShaderFromValue(static_cast<WebKitCSSShaderValue*>(value), state);
+ if (value->isCSSShaderValue())
+ return cachedOrPendingStyleShaderFromValue(static_cast<CSSShaderValue*>(value), state);
return 0;
}
@@ -163,14 +164,14 @@
if (!values->length())
return 0;
- if (parameterValue->isWebKitCSSArrayFunctionValue())
+ if (parameterValue->isCSSArrayFunctionValue())
return parseCustomFilterArrayParameter(name, values);
// If the first value of the list is a transform function,
// then we could safely assume that all the remaining items
// are transforms. parseCustomFilterTransformParameter will
// return 0 if that assumption is incorrect.
- if (values->itemWithoutBoundsCheck(0)->isWebKitCSSTransformValue())
+ if (values->itemWithoutBoundsCheck(0)->isCSSTransformValue())
return parseCustomFilterTransformParameter(name, values, state);
// We can have only arrays of booleans or numbers, so use the first value to choose between those two.
@@ -204,9 +205,8 @@
String name = primitiveValue->getStringValue();
// Do not allow duplicate parameter names.
- if (knownParameterNames.contains(name))
+ if (!knownParameterNames.add(name).isNewEntry)
return false;
- knownParameterNames.add(name);
iterator.advance();
@@ -225,14 +225,14 @@
return true;
}
-static PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithAtRuleReferenceSyntax(WebKitCSSFilterValue* filterValue)
+static PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithAtRuleReferenceSyntax(CSSFilterValue* filterValue)
{
// FIXME: Implement style resolution for the custom filter at-rule reference syntax.
UNUSED_PARAM(filterValue);
return 0;
}
-static PassRefPtr<CustomFilterProgram> lookupCustomFilterProgram(WebKitCSSShaderValue* vertexShader, WebKitCSSShaderValue* fragmentShader,
+static PassRefPtr<CustomFilterProgram> lookupCustomFilterProgram(CSSShaderValue* vertexShader, CSSShaderValue* fragmentShader,
CustomFilterProgramType programType, const CustomFilterProgramMixSettings& mixSettings, CustomFilterMeshType meshType,
StyleCustomFilterProgramCache* customFilterProgramCache, StyleResolverState& state)
{
@@ -251,7 +251,7 @@
return program.release();
}
-static PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithInlineSyntax(WebKitCSSFilterValue* filterValue, StyleCustomFilterProgramCache* customFilterProgramCache, StyleResolverState& state)
+static PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithInlineSyntax(CSSFilterValue* filterValue, StyleCustomFilterProgramCache* customFilterProgramCache, StyleResolverState& state)
{
CSSValue* shadersValue = filterValue->itemWithoutBoundsCheck(0);
ASSERT_WITH_SECURITY_IMPLICATION(shadersValue->isValueList());
@@ -260,27 +260,27 @@
unsigned shadersListLength = shadersList->length();
ASSERT(shadersListLength);
- WebKitCSSShaderValue* vertexShader = toWebKitCSSShaderValue(shadersList->itemWithoutBoundsCheck(0));
- WebKitCSSShaderValue* fragmentShader = 0;
+ CSSShaderValue* vertexShader = toCSSShaderValue(shadersList->itemWithoutBoundsCheck(0));
+ CSSShaderValue* fragmentShader = 0;
CustomFilterProgramType programType = PROGRAM_TYPE_BLENDS_ELEMENT_TEXTURE;
CustomFilterProgramMixSettings mixSettings;
if (shadersListLength > 1) {
CSSValue* fragmentShaderOrMixFunction = shadersList->itemWithoutBoundsCheck(1);
- if (fragmentShaderOrMixFunction->isWebKitCSSMixFunctionValue()) {
- WebKitCSSMixFunctionValue* mixFunction = static_cast<WebKitCSSMixFunctionValue*>(fragmentShaderOrMixFunction);
+ if (fragmentShaderOrMixFunction->isCSSMixFunctionValue()) {
+ CSSMixFunctionValue* mixFunction = static_cast<CSSMixFunctionValue*>(fragmentShaderOrMixFunction);
CSSValueListIterator iterator(mixFunction);
ASSERT(mixFunction->length());
- fragmentShader = toWebKitCSSShaderValue(iterator.value());
+ fragmentShader = toCSSShaderValue(iterator.value());
iterator.advance();
ASSERT(mixFunction->length() <= 3);
while (iterator.hasMore()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.value());
- if (CSSParser::isBlendMode(primitiveValue->getIdent()))
+ if (CSSParser::isBlendMode(primitiveValue->getValueID()))
mixSettings.blendMode = *primitiveValue;
- else if (CSSParser::isCompositeOperator(primitiveValue->getIdent()))
+ else if (CSSParser::isCompositeOperator(primitiveValue->getValueID()))
mixSettings.compositeOperator = *primitiveValue;
else
ASSERT_NOT_REACHED();
@@ -288,7 +288,7 @@
}
} else {
programType = PROGRAM_TYPE_NO_ELEMENT_TEXTURE;
- fragmentShader = toWebKitCSSShaderValue(fragmentShaderOrMixFunction);
+ fragmentShader = toCSSShaderValue(fragmentShaderOrMixFunction);
}
}
@@ -329,7 +329,7 @@
if (iterator.hasMore() && iterator.isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.value());
- if (primitiveValue->getIdent() == CSSValueDetached) {
+ if (primitiveValue->getValueID() == CSSValueDetached) {
meshType = MeshTypeDetached;
iterator.advance();
}
@@ -354,7 +354,7 @@
return CustomFilterOperation::create(program.release(), parameterList, meshRows, meshColumns, meshType);
}
-static PassRefPtr<CustomFilterOperation> createCustomFilterOperation(WebKitCSSFilterValue* filterValue, StyleCustomFilterProgramCache* customFilterProgramCache, StyleResolverState& state)
+static PassRefPtr<CustomFilterOperation> createCustomFilterOperation(CSSFilterValue* filterValue, StyleCustomFilterProgramCache* customFilterProgramCache, StyleResolverState& state)
{
ASSERT(filterValue->length());
bool isAtRuleReferenceSyntax = filterValue->itemWithoutBoundsCheck(0)->isPrimitiveValue();
@@ -371,7 +371,7 @@
if (inValue->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(inValue);
- if (primitiveValue->getIdent() == CSSValueNone)
+ if (primitiveValue->getValueID() == CSSValueNone)
return true;
}
@@ -382,10 +382,10 @@
FilterOperations operations;
for (CSSValueListIterator i = inValue; i.hasMore(); i.advance()) {
CSSValue* currValue = i.value();
- if (!currValue->isWebKitCSSFilterValue())
+ if (!currValue->isCSSFilterValue())
continue;
- WebKitCSSFilterValue* filterValue = static_cast<WebKitCSSFilterValue*>(i.value());
+ CSSFilterValue* filterValue = static_cast<CSSFilterValue*>(i.value());
FilterOperation::OperationType operationType = filterOperationForType(filterValue->operationType());
if (operationType == FilterOperation::VALIDATED_CUSTOM) {
@@ -406,10 +406,10 @@
continue;
CSSValue* argument = filterValue->itemWithoutBoundsCheck(0);
- if (!argument->isWebKitCSSSVGDocumentValue())
+ if (!argument->isCSSSVGDocumentValue())
continue;
- WebKitCSSSVGDocumentValue* svgDocumentValue = static_cast<WebKitCSSSVGDocumentValue*>(argument);
+ CSSSVGDocumentValue* svgDocumentValue = static_cast<CSSSVGDocumentValue*>(argument);
KURL url = state.document()->completeURL(svgDocumentValue->url());
RefPtr<ReferenceFilterOperation> operation = ReferenceFilterOperation::create(svgDocumentValue->url(), url.fragmentIdentifier(), operationType);
@@ -439,9 +439,9 @@
CSSPrimitiveValue* firstValue = filterValue->length() && filterValue->itemWithoutBoundsCheck(0)->isPrimitiveValue() ? toCSSPrimitiveValue(filterValue->itemWithoutBoundsCheck(0)) : 0;
switch (filterValue->operationType()) {
- case WebKitCSSFilterValue::GrayscaleFilterOperation:
- case WebKitCSSFilterValue::SepiaFilterOperation:
- case WebKitCSSFilterValue::SaturateFilterOperation: {
+ case CSSFilterValue::GrayscaleFilterOperation:
+ case CSSFilterValue::SepiaFilterOperation:
+ case CSSFilterValue::SaturateFilterOperation: {
double amount = 1;
if (filterValue->length() == 1) {
amount = firstValue->getDoubleValue();
@@ -452,7 +452,7 @@
operations.operations().append(BasicColorMatrixFilterOperation::create(amount, operationType));
break;
}
- case WebKitCSSFilterValue::HueRotateFilterOperation: {
+ case CSSFilterValue::HueRotateFilterOperation: {
double angle = 0;
if (filterValue->length() == 1)
angle = firstValue->computeDegrees();
@@ -460,11 +460,11 @@
operations.operations().append(BasicColorMatrixFilterOperation::create(angle, operationType));
break;
}
- case WebKitCSSFilterValue::InvertFilterOperation:
- case WebKitCSSFilterValue::BrightnessFilterOperation:
- case WebKitCSSFilterValue::ContrastFilterOperation:
- case WebKitCSSFilterValue::OpacityFilterOperation: {
- double amount = (filterValue->operationType() == WebKitCSSFilterValue::BrightnessFilterOperation) ? 0 : 1;
+ case CSSFilterValue::InvertFilterOperation:
+ case CSSFilterValue::BrightnessFilterOperation:
+ case CSSFilterValue::ContrastFilterOperation:
+ case CSSFilterValue::OpacityFilterOperation: {
+ double amount = (filterValue->operationType() == CSSFilterValue::BrightnessFilterOperation) ? 0 : 1;
if (filterValue->length() == 1) {
amount = firstValue->getDoubleValue();
if (firstValue->isPercentage())
@@ -474,7 +474,7 @@
operations.operations().append(BasicComponentTransferFilterOperation::create(amount, operationType));
break;
}
- case WebKitCSSFilterValue::BlurFilterOperation: {
+ case CSSFilterValue::BlurFilterOperation: {
Length stdDeviation = Length(0, Fixed);
if (filterValue->length() >= 1)
stdDeviation = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
@@ -484,7 +484,7 @@
operations.operations().append(BlurFilterOperation::create(stdDeviation, operationType));
break;
}
- case WebKitCSSFilterValue::DropShadowFilterOperation: {
+ case CSSFilterValue::DropShadowFilterOperation: {
if (filterValue->length() != 1)
return false;
@@ -502,7 +502,7 @@
operations.operations().append(DropShadowFilterOperation::create(location, blur, color.isValid() ? color : Color::transparent, operationType));
break;
}
- case WebKitCSSFilterValue::UnknownFilterOperation:
+ case CSSFilterValue::UnknownFilterOperation:
default:
ASSERT_NOT_REACHED();
break;
diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
index 9c17d55..9ec0ed8 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -93,7 +93,7 @@
target->setParent(scopeResolver);
break;
}
- if (e->isShadowRoot() || e->isDocumentNode()) {
+ if (e->isDocumentNode()) {
bool dummy;
ScopedStyleResolver* scopeResolver = addScopedStyleResolver(e, dummy);
target->setParent(scopeResolver);
@@ -110,44 +110,24 @@
m_cache.clear();
}
-void ScopedStyleTree::resolveScopeStyles(const Element* element, Vector<std::pair<ScopedStyleResolver*, bool>, 8>& resolvers)
+void ScopedStyleTree::resolveScopeStyles(const Element* element, Vector<ScopedStyleResolver*, 8>& resolvers)
{
- ScopedStyleResolver* scopeResolver = scopedResolverFor(element);
- if (!scopeResolver)
- return;
-
- bool applyAuthorStylesOfElementTreeScope = element->treeScope()->applyAuthorStyles();
- bool applyAuthorStyles = m_cache.authorStyleBoundsIndex == m_cache.scopeResolverBoundsIndex ? applyAuthorStylesOfElementTreeScope : false;
-
- for ( ; scopeResolver; scopeResolver = scopeResolver->parent()) {
- resolvers.append(std::pair<ScopedStyleResolver*, bool>(scopeResolver, applyAuthorStyles));
- if (scopeResolver->scope()->isShadowRoot()) {
- if (scopeResolver->parent()->scope()->isInShadowTree())
- applyAuthorStyles = applyAuthorStyles && toShadowRoot(scopeResolver->scope())->applyAuthorStyles();
- else
- applyAuthorStyles = applyAuthorStylesOfElementTreeScope;
- }
- }
+ for (ScopedStyleResolver* scopeResolver = scopedResolverFor(element); scopeResolver; scopeResolver = scopeResolver->parent())
+ resolvers.append(scopeResolver);
}
-inline ScopedStyleResolver* ScopedStyleTree::enclosingScopedStyleResolverFor(const ContainerNode* scope, int& authorStyleBoundsIndex)
+inline ScopedStyleResolver* ScopedStyleTree::enclosingScopedStyleResolverFor(const ContainerNode* scope)
{
- for (; scope; scope = scope->parentOrShadowHostNode()) {
+ for (; scope; scope = scope->parentOrShadowHostNode())
if (ScopedStyleResolver* scopeStyleResolver = scopedStyleResolverFor(scope))
return scopeStyleResolver;
- if (scope->isShadowRoot() && !toShadowRoot(scope)->applyAuthorStyles())
- --authorStyleBoundsIndex;
- }
return 0;
}
void ScopedStyleTree::resolveStyleCache(const ContainerNode* scope)
{
- int authorStyleBoundsIndex = 0;
- m_cache.scopeResolver = enclosingScopedStyleResolverFor(scope, authorStyleBoundsIndex);
- m_cache.scopeResolverBoundsIndex = authorStyleBoundsIndex;
+ m_cache.scopeResolver = enclosingScopedStyleResolverFor(scope);
m_cache.nodeForScopeStyles = scope;
- m_cache.authorStyleBoundsIndex = 0;
}
void ScopedStyleTree::pushStyleCache(const ContainerNode* scope, const ContainerNode* parent)
@@ -160,31 +140,20 @@
return;
}
- if (scope->isShadowRoot() && !toShadowRoot(scope)->applyAuthorStyles())
- ++m_cache.authorStyleBoundsIndex;
-
ScopedStyleResolver* scopeResolver = scopedStyleResolverFor(scope);
- if (scopeResolver) {
+ if (scopeResolver)
m_cache.scopeResolver = scopeResolver;
- m_cache.scopeResolverBoundsIndex = m_cache.authorStyleBoundsIndex;
- }
m_cache.nodeForScopeStyles = scope;
}
void ScopedStyleTree::popStyleCache(const ContainerNode* scope)
{
- if (cacheIsValid(scope)) {
- bool needUpdateBoundsIndex = scope->isShadowRoot() && !toShadowRoot(scope)->applyAuthorStyles();
+ if (!cacheIsValid(scope))
+ return;
- if (m_cache.scopeResolver && m_cache.scopeResolver->scope() == scope) {
- m_cache.scopeResolver = m_cache.scopeResolver->parent();
- if (needUpdateBoundsIndex)
- --m_cache.scopeResolverBoundsIndex;
- }
- if (needUpdateBoundsIndex)
- --m_cache.authorStyleBoundsIndex;
- m_cache.nodeForScopeStyles = scope->parentOrShadowHostNode();
- }
+ if (m_cache.scopeResolver && m_cache.scopeResolver->scope() == scope)
+ m_cache.scopeResolver = m_cache.scopeResolver->parent();
+ m_cache.nodeForScopeStyles = scope->parentOrShadowHostNode();
}
void ScopedStyleTree::collectFeaturesTo(RuleFeatureSet& features)
diff --git a/Source/core/css/resolver/ScopedStyleResolver.h b/Source/core/css/resolver/ScopedStyleResolver.h
index 50b8776..12715e5 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.h
+++ b/Source/core/css/resolver/ScopedStyleResolver.h
@@ -27,7 +27,10 @@
#ifndef ScopedStyleResolver_h
#define ScopedStyleResolver_h
+#include "core/css/CSSKeyframeRule.h"
+#include "core/css/CSSKeyframesRule.h"
#include "core/css/CSSRuleList.h"
+#include "core/css/CSSSVGDocumentValue.h"
#include "core/css/CSSToStyleMap.h"
#include "core/css/CSSValueList.h"
#include "core/css/DocumentRuleSets.h"
@@ -38,9 +41,6 @@
#include "core/css/SelectorChecker.h"
#include "core/css/SelectorFilter.h"
#include "core/css/SiblingTraversalStrategies.h"
-#include "core/css/WebKitCSSSVGDocumentValue.h"
-#include "core/css/WebKitCSSKeyframeRule.h"
-#include "core/css/WebKitCSSKeyframesRule.h"
#include "core/css/resolver/ViewportStyleResolver.h"
#include "core/platform/LinkHash.h"
#include "core/platform/ScrollTypes.h"
@@ -119,7 +119,7 @@
bool hasOnlyScopeResolverForDocument() const { return m_scopeResolverForDocument && m_authorStyles.size() == 1; }
ScopedStyleResolver* scopedStyleResolverForDocument() { return m_scopeResolverForDocument; }
- void resolveScopeStyles(const Element*, Vector<std::pair<ScopedStyleResolver*, bool>, 8>& resolvers);
+ void resolveScopeStyles(const Element*, Vector<ScopedStyleResolver*, 8>&);
ScopedStyleResolver* scopedResolverFor(const Element*);
void pushStyleCache(const ContainerNode* scope, const ContainerNode* parent);
@@ -133,7 +133,7 @@
bool cacheIsValid(const ContainerNode* parent) const { return parent && parent == m_cache.nodeForScopeStyles; }
void resolveStyleCache(const ContainerNode* scope);
- ScopedStyleResolver* enclosingScopedStyleResolverFor(const ContainerNode* scope, int& authorStyleBoundsIndex);
+ ScopedStyleResolver* enclosingScopedStyleResolverFor(const ContainerNode* scope);
private:
HashMap<const ContainerNode*, OwnPtr<ScopedStyleResolver> > m_authorStyles;
@@ -141,16 +141,12 @@
struct ScopeStyleCache {
ScopedStyleResolver* scopeResolver;
- int scopeResolverBoundsIndex;
const ContainerNode* nodeForScopeStyles;
- int authorStyleBoundsIndex;
void clear()
{
scopeResolver = 0;
- scopeResolverBoundsIndex = 0;
nodeForScopeStyles = 0;
- authorStyleBoundsIndex = 0;
}
};
ScopeStyleCache m_cache;
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
new file mode 100644
index 0000000..b09f8e5
--- /dev/null
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "CSSValueKeywords.h"
+#include "StyleBuilderFunctions.h"
+#include "core/css/resolver/StyleResolver.h"
+
+namespace WebCore {
+
+static void resetEffectiveZoom(StyleResolver* styleResolver)
+{
+ // Reset the zoom in effect. This allows the setZoom method to accurately compute a new zoom in effect.
+ styleResolver->setEffectiveZoom(styleResolver->parentStyle() ? styleResolver->parentStyle()->effectiveZoom() : RenderStyle::initialZoom());
+}
+
+void StyleBuilderFunctions::applyInitialCSSPropertyZoom(StyleResolver* styleResolver)
+{
+ resetEffectiveZoom(styleResolver);
+ styleResolver->setZoom(RenderStyle::initialZoom());
+}
+
+void StyleBuilderFunctions::applyInheritCSSPropertyZoom(StyleResolver* styleResolver)
+{
+ resetEffectiveZoom(styleResolver);
+ styleResolver->setZoom(styleResolver->parentStyle()->zoom());
+}
+
+void StyleBuilderFunctions::applyValueCSSPropertyZoom(StyleResolver* styleResolver, CSSValue* value)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue());
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+
+ if (primitiveValue->getValueID() == CSSValueNormal) {
+ resetEffectiveZoom(styleResolver);
+ styleResolver->setZoom(RenderStyle::initialZoom());
+ } else if (primitiveValue->getValueID() == CSSValueReset) {
+ styleResolver->setEffectiveZoom(RenderStyle::initialZoom());
+ styleResolver->setZoom(RenderStyle::initialZoom());
+ } else if (primitiveValue->getValueID() == CSSValueDocument) {
+ float docZoom = styleResolver->rootElementStyle() ? styleResolver->rootElementStyle()->zoom() : RenderStyle::initialZoom();
+ styleResolver->setEffectiveZoom(docZoom);
+ styleResolver->setZoom(docZoom);
+ } else if (primitiveValue->isPercentage()) {
+ resetEffectiveZoom(styleResolver);
+ if (float percent = primitiveValue->getFloatValue())
+ styleResolver->setZoom(percent / 100.0f);
+ } else if (primitiveValue->isNumber()) {
+ resetEffectiveZoom(styleResolver);
+ if (float number = primitiveValue->getFloatValue())
+ styleResolver->setZoom(number);
+ }
+}
+
+} // namespace WebCore
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 02f06a1..20c1fc9 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -30,12 +30,12 @@
#include "core/css/resolver/StyleResolver.h"
#include "CSSPropertyNames.h"
+#include "FontFamilyNames.h"
#include "HTMLNames.h"
#include "MathMLNames.h"
#include "RuntimeEnabledFeatures.h"
#include "SVGNames.h"
#include "UserAgentStyleSheets.h"
-#include "WebKitFontFamilyNames.h"
#include "XMLNames.h"
#include "core/animation/AnimatableValue.h"
#include "core/animation/Animation.h"
@@ -46,13 +46,17 @@
#include "core/css/CSSFontFaceRule.h"
#include "core/css/CSSFontSelector.h"
#include "core/css/CSSImageSetValue.h"
+#include "core/css/CSSKeyframeRule.h"
+#include "core/css/CSSKeyframesRule.h"
#include "core/css/CSSLineBoxContainValue.h"
#include "core/css/CSSPageRule.h"
#include "core/css/CSSParser.h"
#include "core/css/CSSPrimitiveValueMappings.h"
#include "core/css/CSSReflectValue.h"
+#include "core/css/CSSSVGDocumentValue.h"
#include "core/css/CSSSelector.h"
#include "core/css/CSSSelectorList.h"
+#include "core/css/CSSShaderValue.h"
#include "core/css/CSSStyleRule.h"
#include "core/css/CSSSupportsRule.h"
#include "core/css/CSSTimingFunctionValue.h"
@@ -62,6 +66,7 @@
#include "core/css/DeprecatedStyleBuilder.h"
#include "core/css/ElementRuleCollector.h"
#include "core/css/FontFeatureValue.h"
+#include "core/css/FontSize.h"
#include "core/css/FontValue.h"
#include "core/css/MediaList.h"
#include "core/css/MediaQueryEvaluator.h"
@@ -77,12 +82,6 @@
#include "core/css/StyleRuleImport.h"
#include "core/css/StyleSheetContents.h"
#include "core/css/StyleSheetList.h"
-#include "core/css/WebKitCSSKeyframeRule.h"
-#include "core/css/WebKitCSSKeyframesRule.h"
-#include "core/css/WebKitCSSMixFunctionValue.h"
-#include "core/css/WebKitCSSRegionRule.h"
-#include "core/css/WebKitCSSSVGDocumentValue.h"
-#include "core/css/WebKitCSSShaderValue.h"
#include "core/css/resolver/FilterOperationResolver.h"
#include "core/css/resolver/StyleBuilder.h"
#include "core/css/resolver/TransformBuilder.h"
@@ -453,17 +452,16 @@
return;
}
- Vector<std::pair<ScopedStyleResolver*, bool>, 8> stack;
+ Vector<ScopedStyleResolver*, 8> stack;
m_styleTree.resolveScopeStyles(m_state.element(), stack);
if (stack.isEmpty())
return;
- for (int i = stack.size() - 1; i >= 0; --i) {
- ScopedStyleResolver* scopeResolver = stack.at(i).first;
- bool applyAuthorStyles = stack.at(i).second;
- scopeResolver->matchAuthorRules(collector, includeEmptyRules, applyAuthorStyles);
- }
- matchHostRules(stack.first().first, collector, includeEmptyRules);
+ bool applyAuthorStyles = m_state.element()->treeScope()->applyAuthorStyles();
+ for (int i = stack.size() - 1; i >= 0; --i)
+ stack.at(i)->matchAuthorRules(collector, includeEmptyRules, applyAuthorStyles);
+
+ matchHostRules(stack.first(), collector, includeEmptyRules);
}
void StyleResolver::matchAuthorRules(ElementRuleCollector& collector, bool includeEmptyRules)
@@ -568,10 +566,10 @@
collector.matchedResult().isCacheable = false;
}
-inline void StyleResolver::initElement(Element* e)
+inline void StyleResolver::initElement(Element* e, int childIndex)
{
if (m_state.element() != e) {
- m_state.initElement(e);
+ m_state.initElement(e, childIndex);
if (e && e == e->document()->documentElement()) {
e->document()->setDirectionSetOnDocumentElement(false);
e->document()->setWritingModeSetOnDocumentElement(false);
@@ -608,7 +606,7 @@
RenderStyle* parentStyle = p->renderStyle();
unsigned subcount = 0;
Node* thisCousin = p;
- Node* currentNode = p->previousSibling();
+ Node* currentNode = p->nextSibling();
// Reserve the tries for this level. This effectively makes sure that the algorithm
// will never go deeper than cStyleSearchLevelThreshold levels into recursion.
@@ -626,7 +624,7 @@
}
if (subcount >= cStyleSearchThreshold)
return 0;
- currentNode = currentNode->previousSibling();
+ currentNode = currentNode->nextSibling();
}
currentNode = locateCousinList(thisCousin->parentElement(), visitedNodeCount);
thisCousin = currentNode;
@@ -822,7 +820,7 @@
inline StyledElement* StyleResolver::findSiblingForStyleSharing(Node* node, unsigned& count) const
{
- for (; node; node = node->previousSibling()) {
+ for (; node; node = node->nextSibling()) {
if (!node->isStyledElement())
continue;
if (canShareStyleWithElement(static_cast<StyledElement*>(node)))
@@ -857,16 +855,21 @@
return 0;
if (state.element()->hasActiveAnimations())
return 0;
+ // When a dialog is first shown, its style is mutated to center it in the
+ // viewport. So the styles can't be shared since the viewport position and
+ // size may be different each time a dialog is opened.
+ if (state.element()->hasTagName(dialogTag))
+ return 0;
// Cache whether state.element is affected by any known class selectors.
// FIXME: This shouldn't be a member variable. The style sharing code could be factored out of StyleResolver.
state.setElementAffectedByClassRules(state.element() && state.element()->hasClass() && classNamesAffectedByRules(state.element()->classNames()));
- // Check previous siblings and their cousins.
+ // Check next siblings and their cousins.
unsigned count = 0;
unsigned visitedNodeCount = 0;
StyledElement* shareElement = 0;
- Node* cousinList = state.styledElement()->previousSibling();
+ Node* cousinList = state.styledElement()->nextSibling();
while (cousinList) {
shareElement = findSiblingForStyleSharing(cousinList, count);
if (shareElement)
@@ -969,6 +972,18 @@
}
}
+static float getComputedSizeFromSpecifiedSize(Document* document, RenderStyle* style, bool isAbsoluteSize, float specifiedSize, bool useSVGZoomRules)
+{
+ float zoomFactor = 1.0f;
+ if (!useSVGZoomRules) {
+ zoomFactor = style->effectiveZoom();
+ if (Frame* frame = document->frame())
+ zoomFactor *= frame->textZoomFactor();
+ }
+
+ return FontSize::getComputedSizeFromSpecifiedSize(document, zoomFactor, isAbsoluteSize, specifiedSize);
+}
+
PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document* document, CSSFontSelector* fontSelector)
{
Frame* frame = document->frame();
@@ -1042,10 +1057,10 @@
fontDescription.firstFamily().appendFamily(0);
}
fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
- int size = StyleResolver::fontSizeForKeyword(document, CSSValueMedium, false);
+ int size = FontSize::fontSizeForKeyword(document, CSSValueMedium, false);
fontDescription.setSpecifiedSize(size);
bool useSVGZoomRules = document->isSVGDocument();
- fontDescription.setComputedSize(StyleResolver::getComputedSizeFromSpecifiedSize(document, documentStyle.get(), fontDescription.isAbsoluteSize(), size, useSVGZoomRules));
+ fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(document, documentStyle.get(), fontDescription.isAbsoluteSize(), size, useSVGZoomRules));
} else
fontDescription.setUsePrinterFont(document->printing());
@@ -1069,8 +1084,8 @@
return parentNode && parentNode->isShadowRoot();
}
-PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderStyle* defaultParent,
- StyleSharingBehavior sharingBehavior, RuleMatchingBehavior matchingBehavior, RenderRegion* regionForStyling)
+PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderStyle* defaultParent, StyleSharingBehavior sharingBehavior,
+ RuleMatchingBehavior matchingBehavior, RenderRegion* regionForStyling, int childIndex)
{
// Once an element has a renderer, we don't try to destroy it, since otherwise the renderer
// will vanish if a style recalc happens during loading.
@@ -1085,7 +1100,7 @@
}
StyleResolverState& state = m_state;
- initElement(element);
+ initElement(element, childIndex);
state.initForStyleResolve(document(), element, defaultParent, regionForStyling);
if (sharingBehavior == AllowStyleSharing && !state.distributedToInsertionPoint()) {
RenderStyle* sharedStyle = locateSharedStyle();
@@ -1528,6 +1543,10 @@
if (e && e->hasTagName(legendTag))
style->setDisplay(BLOCK);
+ // Per the spec, position 'static' and 'relative' in the top layer compute to 'absolute'.
+ if (e && e->isInTopLayer() && (style->position() == StaticPosition || style->position() == RelativePosition))
+ style->setPosition(AbsolutePosition);
+
// Absolute/fixed positioned elements, floating elements and the document element need block-like outside display.
if (style->hasOutOfFlowPosition() || style->isFloating() || (e && e->document()->documentElement() == e))
style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloating(), !document()->inQuirksMode()));
@@ -1562,12 +1581,6 @@
style->setFloating(NoFloat);
style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloating(), !document()->inQuirksMode()));
}
-
- // Per the spec, position 'static' and 'relative' in the top layer compute to 'absolute'.
- if (e && e->isInTopLayer() && (style->position() == StaticPosition || style->position() == RelativePosition)) {
- style->setPosition(AbsolutePosition);
- style->setDisplay(BLOCK);
- }
}
// Make sure our z-index value is only applied if the object is positioned.
@@ -1601,17 +1614,19 @@
style->setOverflowY(style->overflowY() == OVISIBLE ? OAUTO : style->overflowY());
}
+ // For now, <marquee> requires an overflow clip to work properly.
+ if (e && e->hasTagName(marqueeTag)) {
+ style->setOverflowX(OHIDDEN);
+ style->setOverflowY(OHIDDEN);
+ }
+
if (doesNotInheritTextDecoration(style, e))
style->setTextDecorationsInEffect(style->textDecoration());
else
style->addToTextDecorationsInEffect(style->textDecoration());
// If either overflow value is not visible, change to auto.
- if (style->overflowX() == OMARQUEE && style->overflowY() != OMARQUEE)
- style->setOverflowY(OMARQUEE);
- else if (style->overflowY() == OMARQUEE && style->overflowX() != OMARQUEE)
- style->setOverflowX(OMARQUEE);
- else if (style->overflowX() == OVISIBLE && style->overflowY() != OVISIBLE) {
+ if (style->overflowX() == OVISIBLE && style->overflowY() != OVISIBLE) {
// FIXME: Once we implement pagination controls, overflow-x should default to hidden
// if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, we'll let it
// default to auto so we can at least scroll through the pages.
@@ -1654,13 +1669,13 @@
if (e && e->isFormControlElement() && style->fontSize() >= 11) {
// Don't apply intrinsic margins to image buttons. The designer knows how big the images are,
// so we have to treat all image buttons as though they were explicitly sized.
- if (!e->hasTagName(inputTag) || !static_cast<HTMLInputElement*>(e)->isImageButton())
+ if (!e->hasTagName(inputTag) || !toHTMLInputElement(e)->isImageButton())
addIntrinsicMargins(style);
}
// Let the theme also have a crack at adjusting the style.
if (style->hasAppearance())
- RenderTheme::defaultTheme()->adjustStyle(this, style, e, m_state.hasUAAppearance(), m_state.borderData(), m_state.backgroundData(), m_state.backgroundColor());
+ RenderTheme::defaultTheme()->adjustStyle(style, e, m_state.hasUAAppearance(), m_state.borderData(), m_state.backgroundData(), m_state.backgroundColor());
// If we have first-letter pseudo style, do not share this style.
if (style->hasPseudoStyle(FIRST_LETTER))
@@ -1848,6 +1863,90 @@
}
}
+static inline bool isValidVisitedLinkProperty(CSSPropertyID id)
+{
+ switch (id) {
+ case CSSPropertyBackgroundColor:
+ case CSSPropertyBorderLeftColor:
+ case CSSPropertyBorderRightColor:
+ case CSSPropertyBorderTopColor:
+ case CSSPropertyBorderBottomColor:
+ case CSSPropertyColor:
+ case CSSPropertyFill:
+ case CSSPropertyOutlineColor:
+ case CSSPropertyStroke:
+ case CSSPropertyWebkitColumnRuleColor:
+#if ENABLE(CSS3_TEXT)
+ case CSSPropertyWebkitTextDecorationColor:
+#endif // CSS3_TEXT
+ case CSSPropertyWebkitTextEmphasisColor:
+ case CSSPropertyWebkitTextFillColor:
+ case CSSPropertyWebkitTextStrokeColor:
+ return true;
+ default:
+ break;
+ }
+
+ return false;
+}
+
+// http://dev.w3.org/csswg/css3-regions/#the-at-region-style-rule
+// FIXME: add incremental support for other region styling properties.
+static inline bool isValidRegionStyleProperty(CSSPropertyID id)
+{
+ switch (id) {
+ case CSSPropertyBackgroundColor:
+ case CSSPropertyColor:
+ return true;
+ default:
+ break;
+ }
+
+ return false;
+}
+
+static inline bool isValidCueStyleProperty(CSSPropertyID id)
+{
+ switch (id) {
+ case CSSPropertyBackground:
+ case CSSPropertyBackgroundAttachment:
+ case CSSPropertyBackgroundClip:
+ case CSSPropertyBackgroundColor:
+ case CSSPropertyBackgroundImage:
+ case CSSPropertyBackgroundOrigin:
+ case CSSPropertyBackgroundPosition:
+ case CSSPropertyBackgroundPositionX:
+ case CSSPropertyBackgroundPositionY:
+ case CSSPropertyBackgroundRepeat:
+ case CSSPropertyBackgroundRepeatX:
+ case CSSPropertyBackgroundRepeatY:
+ case CSSPropertyBackgroundSize:
+ case CSSPropertyColor:
+ case CSSPropertyFont:
+ case CSSPropertyFontFamily:
+ case CSSPropertyFontSize:
+ case CSSPropertyFontStyle:
+ case CSSPropertyFontVariant:
+ case CSSPropertyFontWeight:
+ case CSSPropertyLineHeight:
+ case CSSPropertyOpacity:
+ case CSSPropertyOutline:
+ case CSSPropertyOutlineColor:
+ case CSSPropertyOutlineOffset:
+ case CSSPropertyOutlineStyle:
+ case CSSPropertyOutlineWidth:
+ case CSSPropertyVisibility:
+ case CSSPropertyWhiteSpace:
+ case CSSPropertyTextDecoration:
+ case CSSPropertyTextShadow:
+ case CSSPropertyBorderStyle:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
template <StyleResolver::StyleApplicationPass pass>
void StyleResolver::applyProperties(const StylePropertySet* properties, StyleRule* rule, bool isImportant, bool inheritedOnly, PropertyWhitelistType propertyWhitelistType)
{
@@ -1868,9 +1967,9 @@
}
CSSPropertyID property = current.id();
- if (propertyWhitelistType == PropertyWhitelistRegion && !StyleResolver::isValidRegionStyleProperty(property))
+ if (propertyWhitelistType == PropertyWhitelistRegion && !isValidRegionStyleProperty(property))
continue;
- if (propertyWhitelistType == PropertyWhitelistCue && !StyleResolver::isValidCueStyleProperty(property))
+ if (propertyWhitelistType == PropertyWhitelistCue && !isValidCueStyleProperty(property))
continue;
switch (pass) {
case VariableDefinitions:
@@ -1926,10 +2025,9 @@
}
}
-unsigned StyleResolver::computeMatchedPropertiesHash(const MatchedProperties* properties, unsigned size)
+static unsigned computeMatchedPropertiesHash(const StyleResolver::MatchedProperties* properties, unsigned size)
{
-
- return StringHasher::hashMemory(properties, sizeof(MatchedProperties) * size);
+ return StringHasher::hashMemory(properties, sizeof(StyleResolver::MatchedProperties) * size);
}
bool operator==(const StyleResolver::MatchRanges& a, const StyleResolver::MatchRanges& b)
@@ -2124,89 +2222,6 @@
applyProperty(id, value);
}
-inline bool isValidVisitedLinkProperty(CSSPropertyID id)
-{
- switch (id) {
- case CSSPropertyBackgroundColor:
- case CSSPropertyBorderLeftColor:
- case CSSPropertyBorderRightColor:
- case CSSPropertyBorderTopColor:
- case CSSPropertyBorderBottomColor:
- case CSSPropertyColor:
- case CSSPropertyFill:
- case CSSPropertyOutlineColor:
- case CSSPropertyStroke:
- case CSSPropertyWebkitColumnRuleColor:
-#if ENABLE(CSS3_TEXT)
- case CSSPropertyWebkitTextDecorationColor:
-#endif // CSS3_TEXT
- case CSSPropertyWebkitTextEmphasisColor:
- case CSSPropertyWebkitTextFillColor:
- case CSSPropertyWebkitTextStrokeColor:
- return true;
- default:
- break;
- }
-
- return false;
-}
-
-// http://dev.w3.org/csswg/css3-regions/#the-at-region-style-rule
-// FIXME: add incremental support for other region styling properties.
-inline bool StyleResolver::isValidRegionStyleProperty(CSSPropertyID id)
-{
- switch (id) {
- case CSSPropertyBackgroundColor:
- case CSSPropertyColor:
- return true;
- default:
- break;
- }
-
- return false;
-}
-
-inline bool StyleResolver::isValidCueStyleProperty(CSSPropertyID id)
-{
- switch (id) {
- case CSSPropertyBackground:
- case CSSPropertyBackgroundAttachment:
- case CSSPropertyBackgroundClip:
- case CSSPropertyBackgroundColor:
- case CSSPropertyBackgroundImage:
- case CSSPropertyBackgroundOrigin:
- case CSSPropertyBackgroundPosition:
- case CSSPropertyBackgroundPositionX:
- case CSSPropertyBackgroundPositionY:
- case CSSPropertyBackgroundRepeat:
- case CSSPropertyBackgroundRepeatX:
- case CSSPropertyBackgroundRepeatY:
- case CSSPropertyBackgroundSize:
- case CSSPropertyColor:
- case CSSPropertyFont:
- case CSSPropertyFontFamily:
- case CSSPropertyFontSize:
- case CSSPropertyFontStyle:
- case CSSPropertyFontVariant:
- case CSSPropertyFontWeight:
- case CSSPropertyLineHeight:
- case CSSPropertyOpacity:
- case CSSPropertyOutline:
- case CSSPropertyOutlineColor:
- case CSSPropertyOutlineOffset:
- case CSSPropertyOutlineStyle:
- case CSSPropertyOutlineWidth:
- case CSSPropertyVisibility:
- case CSSPropertyWhiteSpace:
- case CSSPropertyTextDecoration:
- case CSSPropertyTextShadow:
- case CSSPropertyBorderStyle:
- return true;
- default:
- break;
- }
- return false;
-}
// SVG handles zooming in a different way compared to CSS. The whole document is scaled instead
// of each individual length value in the render style / tree. CSSPrimitiveValue::computeLength*()
// multiplies each resolved length with the zoom multiplier - so for SVG we need to disable that.
@@ -2222,12 +2237,12 @@
static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, const StyleResolverState& state, GridLength& workingLength)
{
- if (primitiveValue->getIdent() == CSSValueWebkitMinContent) {
+ if (primitiveValue->getValueID() == CSSValueWebkitMinContent) {
workingLength = Length(MinContent);
return true;
}
- if (primitiveValue->getIdent() == CSSValueWebkitMaxContent) {
+ if (primitiveValue->getValueID() == CSSValueWebkitMaxContent) {
workingLength = Length(MaxContent);
return true;
}
@@ -2278,7 +2293,7 @@
// Handle 'none'.
if (value->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- return primitiveValue->getIdent() == CSSValueNone;
+ return primitiveValue->getValueID() == CSSValueNone;
}
if (!value->isValueList())
@@ -2317,7 +2332,7 @@
if (value->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- ASSERT(primitiveValue->getIdent() == CSSValueAuto);
+ ASSERT(primitiveValue->getValueID() == CSSValueAuto);
return true;
}
@@ -2331,7 +2346,7 @@
CSSValueListIterator it = values;
CSSPrimitiveValue* currentValue = toCSSPrimitiveValue(it.value());
- if (currentValue->getIdent() == CSSValueSpan) {
+ if (currentValue->getValueID() == CSSValueSpan) {
isSpanPosition = true;
it.advance();
currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0;
@@ -2522,14 +2537,14 @@
} else if (contentValue->isCounter()) {
Counter* counterValue = contentValue->getCounterValue();
EListStyleType listStyleType = NoneListStyle;
- int listStyleIdent = counterValue->listStyleIdent();
+ CSSValueID listStyleIdent = counterValue->listStyleIdent();
if (listStyleIdent != CSSValueNone)
listStyleType = static_cast<EListStyleType>(listStyleIdent - CSSValueDisc);
OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(counterValue->identifier(), listStyleType, counterValue->separator()));
state.style()->setContent(counter.release(), didSet);
didSet = true;
} else {
- switch (contentValue->getIdent()) {
+ switch (contentValue->getValueID()) {
case CSSValueOpenQuote:
state.style()->setContent(OPEN_QUOTE, didSet);
didSet = true;
@@ -2582,7 +2597,7 @@
return;
}
if (primitiveValue) {
- if (primitiveValue->getIdent() == CSSValueNone)
+ if (primitiveValue->getValueID() == CSSValueNone)
state.style()->setQuotes(QuotesData::create());
}
return;
@@ -2604,7 +2619,7 @@
state.setLineHeightValue(0);
FontDescription fontDescription;
- RenderTheme::defaultTheme()->systemFont(primitiveValue->getIdent(), fontDescription);
+ RenderTheme::defaultTheme()->systemFont(primitiveValue->getValueID(), fontDescription);
// Double-check and see if the theme did anything. If not, don't bother updating the font.
if (fontDescription.isAbsoluteSize()) {
@@ -2671,8 +2686,9 @@
case CSSPropertyWebkitColumnRule:
case CSSPropertyWebkitFlex:
case CSSPropertyWebkitFlexFlow:
- case CSSPropertyWebkitGridColumn:
- case CSSPropertyWebkitGridRow:
+ case CSSPropertyGridColumn:
+ case CSSPropertyGridRow:
+ case CSSPropertyGridArea:
case CSSPropertyWebkitMarginCollapse:
case CSSPropertyWebkitMarquee:
case CSSPropertyWebkitMask:
@@ -2710,7 +2726,7 @@
int y = item->y->computeLength<int>(state.style(), state.rootElementStyle(), zoomFactor);
int blur = item->blur ? item->blur->computeLength<int>(state.style(), state.rootElementStyle(), zoomFactor) : 0;
int spread = item->spread ? item->spread->computeLength<int>(state.style(), state.rootElementStyle(), zoomFactor) : 0;
- ShadowStyle shadowStyle = item->style && item->style->getIdent() == CSSValueInset ? Inset : Normal;
+ ShadowStyle shadowStyle = item->style && item->style->getValueID() == CSSValueInset ? Inset : Normal;
Color color;
if (item->color)
color = m_state.colorFromPrimitiveValue(item->color.get());
@@ -2756,7 +2772,7 @@
HANDLE_INHERIT_AND_INITIAL(locale, Locale);
if (!primitiveValue)
return;
- if (primitiveValue->getIdent() == CSSValueAuto)
+ if (primitiveValue->getValueID() == CSSValueAuto)
state.style()->setLocale(nullAtom);
else
state.style()->setLocale(primitiveValue->getStringValue());
@@ -2766,23 +2782,23 @@
return;
}
case CSSPropertyWebkitAppRegion: {
- if (!primitiveValue || !primitiveValue->getIdent())
+ if (!primitiveValue || !primitiveValue->getValueID())
return;
- state.style()->setDraggableRegionMode(primitiveValue->getIdent() == CSSValueDrag ? DraggableRegionDrag : DraggableRegionNoDrag);
+ state.style()->setDraggableRegionMode(primitiveValue->getValueID() == CSSValueDrag ? DraggableRegionDrag : DraggableRegionNoDrag);
state.document()->setHasAnnotatedRegions(true);
return;
}
case CSSPropertyWebkitTextStrokeWidth: {
HANDLE_INHERIT_AND_INITIAL(textStrokeWidth, TextStrokeWidth)
float width = 0;
- switch (primitiveValue->getIdent()) {
+ switch (primitiveValue->getValueID()) {
case CSSValueThin:
case CSSValueMedium:
case CSSValueThick: {
double result = 1.0 / 48;
- if (primitiveValue->getIdent() == CSSValueMedium)
+ if (primitiveValue->getValueID() == CSSValueMedium)
result *= 3;
- else if (primitiveValue->getIdent() == CSSValueThick)
+ else if (primitiveValue->getValueID() == CSSValueThick)
result *= 5;
width = CSSPrimitiveValue::create(result, CSSPrimitiveValue::CSS_EMS)->computeLength<float>(state.style(), state.rootElementStyle(), zoomFactor);
break;
@@ -2807,7 +2823,7 @@
if (!primitiveValue)
return;
- if (primitiveValue->getIdent() == CSSValueNone) {
+ if (primitiveValue->getValueID() == CSSValueNone) {
state.style()->setPerspective(0);
return;
}
@@ -2839,7 +2855,7 @@
HANDLE_INHERIT_AND_INITIAL(useTouchOverflowScrolling, UseTouchOverflowScrolling);
if (!primitiveValue)
break;
- state.style()->setUseTouchOverflowScrolling(primitiveValue->getIdent() == CSSValueTouch);
+ state.style()->setUseTouchOverflowScrolling(primitiveValue->getValueID() == CSSValueTouch);
return;
}
#endif
@@ -2923,7 +2939,7 @@
case CSSPropertyWebkitLineBoxContain: {
HANDLE_INHERIT_AND_INITIAL(lineBoxContain, LineBoxContain)
- if (primitiveValue && primitiveValue->getIdent() == CSSValueNone) {
+ if (primitiveValue && primitiveValue->getValueID() == CSSValueNone) {
state.style()->setLineBoxContain(LineBoxContainNone);
return;
}
@@ -2938,7 +2954,7 @@
// CSS Fonts Module Level 3
case CSSPropertyWebkitFontFeatureSettings: {
- if (primitiveValue && primitiveValue->getIdent() == CSSValueNormal) {
+ if (primitiveValue && primitiveValue->getValueID() == CSSValueNormal) {
setFontDescription(state.style()->fontDescription().makeNormalFeatureSettings());
return;
}
@@ -2969,7 +2985,7 @@
state.style()->setFilter(operations);
return;
}
- case CSSPropertyWebkitGridAutoColumns: {
+ case CSSPropertyGridAutoColumns: {
HANDLE_INHERIT_AND_INITIAL(gridAutoColumns, GridAutoColumns);
GridTrackSize trackSize;
if (!createGridTrackSize(value, trackSize, state))
@@ -2977,7 +2993,7 @@
state.style()->setGridAutoColumns(trackSize);
return;
}
- case CSSPropertyWebkitGridAutoRows: {
+ case CSSPropertyGridAutoRows: {
HANDLE_INHERIT_AND_INITIAL(gridAutoRows, GridAutoRows);
GridTrackSize trackSize;
if (!createGridTrackSize(value, trackSize, state))
@@ -2985,7 +3001,7 @@
state.style()->setGridAutoRows(trackSize);
return;
}
- case CSSPropertyWebkitGridColumns: {
+ case CSSPropertyGridColumns: {
if (isInherit) {
m_state.style()->setGridColumns(m_state.parentStyle()->gridColumns());
m_state.style()->setNamedGridColumnLines(m_state.parentStyle()->namedGridColumnLines());
@@ -3005,7 +3021,7 @@
state.style()->setNamedGridColumnLines(namedGridLines);
return;
}
- case CSSPropertyWebkitGridRows: {
+ case CSSPropertyGridRows: {
if (isInherit) {
m_state.style()->setGridRows(m_state.parentStyle()->gridRows());
m_state.style()->setNamedGridRowLines(m_state.parentStyle()->namedGridRowLines());
@@ -3026,7 +3042,7 @@
return;
}
- case CSSPropertyWebkitGridStart: {
+ case CSSPropertyGridStart: {
HANDLE_INHERIT_AND_INITIAL(gridStart, GridStart);
GridPosition startPosition;
if (!createGridPosition(value, startPosition))
@@ -3034,7 +3050,7 @@
state.style()->setGridStart(startPosition);
return;
}
- case CSSPropertyWebkitGridEnd: {
+ case CSSPropertyGridEnd: {
HANDLE_INHERIT_AND_INITIAL(gridEnd, GridEnd);
GridPosition endPosition;
if (!createGridPosition(value, endPosition))
@@ -3043,7 +3059,7 @@
return;
}
- case CSSPropertyWebkitGridBefore: {
+ case CSSPropertyGridBefore: {
HANDLE_INHERIT_AND_INITIAL(gridBefore, GridBefore);
GridPosition beforePosition;
if (!createGridPosition(value, beforePosition))
@@ -3051,7 +3067,7 @@
state.style()->setGridBefore(beforePosition);
return;
}
- case CSSPropertyWebkitGridAfter: {
+ case CSSPropertyGridAfter: {
HANDLE_INHERIT_AND_INITIAL(gridAfter, GridAfter);
GridPosition afterPosition;
if (!createGridPosition(value, afterPosition))
@@ -3160,6 +3176,9 @@
case CSSPropertyTableLayout:
case CSSPropertyTextAlign:
case CSSPropertyTextDecoration:
+ case CSSPropertyTextDecorationLine:
+ case CSSPropertyTextDecorationStyle:
+ case CSSPropertyTextDecorationColor:
case CSSPropertyTextIndent:
case CSSPropertyTextOverflow:
case CSSPropertyTextRendering:
@@ -3198,7 +3217,6 @@
case CSSPropertyWebkitBoxOrdinalGroup:
case CSSPropertyWebkitBoxOrient:
case CSSPropertyWebkitBoxPack:
- case CSSPropertyWebkitColorCorrection:
case CSSPropertyWebkitColumnAxis:
case CSSPropertyWebkitColumnBreakAfter:
case CSSPropertyWebkitColumnBreakBefore:
@@ -3269,9 +3287,6 @@
case CSSPropertyWebkitRubyPosition:
case CSSPropertyWebkitTextCombine:
#if ENABLE(CSS3_TEXT)
- case CSSPropertyWebkitTextDecorationLine:
- case CSSPropertyWebkitTextDecorationStyle:
- case CSSPropertyWebkitTextDecorationColor:
case CSSPropertyWebkitTextAlignLast:
case CSSPropertyWebkitTextUnderlinePosition:
#endif // CSS3_TEXT
@@ -3408,7 +3423,7 @@
// multiplying by our scale factor.
float size;
if (childFont.keywordSize())
- size = fontSizeForKeyword(document(), CSSValueXxSmall + childFont.keywordSize() - 1, childFont.useFixedDefaultSize());
+ size = FontSize::fontSizeForKeyword(document(), CSSValueXxSmall + childFont.keywordSize() - 1, childFont.useFixedDefaultSize());
else {
Settings* settings = documentSettings();
float fixedScaleFactor = (settings && settings->defaultFixedFontSize() && settings->defaultFontSize())
@@ -3436,7 +3451,7 @@
fontDescription.firstFamily().appendFamily(0);
}
fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
- setFontSize(fontDescription, fontSizeForKeyword(document(), CSSValueMedium, false));
+ setFontSize(fontDescription, FontSize::fontSizeForKeyword(document(), CSSValueMedium, false));
m_state.style()->setLineHeight(RenderStyle::initialLineHeight());
m_state.setLineHeightValue(0);
setFontDescription(fontDescription);
@@ -3448,153 +3463,9 @@
fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(document(), m_state.style(), fontDescription.isAbsoluteSize(), size, useSVGZoomRules()));
}
-float StyleResolver::getComputedSizeFromSpecifiedSize(Document* document, RenderStyle* style, bool isAbsoluteSize, float specifiedSize, bool useSVGZoomRules)
-{
- float zoomFactor = 1.0f;
- if (!useSVGZoomRules) {
- zoomFactor = style->effectiveZoom();
- if (Frame* frame = document->frame())
- zoomFactor *= frame->textZoomFactor();
- }
-
- return StyleResolver::getComputedSizeFromSpecifiedSize(document, zoomFactor, isAbsoluteSize, specifiedSize);
-}
-
-float StyleResolver::getComputedSizeFromSpecifiedSize(Document* document, float zoomFactor, bool isAbsoluteSize, float specifiedSize, ESmartMinimumForFontSize useSmartMinimumForFontSize)
-{
- // Text with a 0px font size should not be visible and therefore needs to be
- // exempt from minimum font size rules. Acid3 relies on this for pixel-perfect
- // rendering. This is also compatible with other browsers that have minimum
- // font size settings (e.g. Firefox).
- if (fabsf(specifiedSize) < std::numeric_limits<float>::epsilon())
- return 0.0f;
-
- // We support two types of minimum font size. The first is a hard override that applies to
- // all fonts. This is "minSize." The second type of minimum font size is a "smart minimum"
- // that is applied only when the Web page can't know what size it really asked for, e.g.,
- // when it uses logical sizes like "small" or expresses the font-size as a percentage of
- // the user's default font setting.
-
- // With the smart minimum, we never want to get smaller than the minimum font size to keep fonts readable.
- // However we always allow the page to set an explicit pixel size that is smaller,
- // since sites will mis-render otherwise (e.g., http://www.gamespot.com with a 9px minimum).
-
- Settings* settings = document->settings();
- if (!settings)
- return 1.0f;
-
- int minSize = settings->minimumFontSize();
- int minLogicalSize = settings->minimumLogicalFontSize();
- float zoomedSize = specifiedSize * zoomFactor;
-
- // Apply the hard minimum first. We only apply the hard minimum if after zooming we're still too small.
- if (zoomedSize < minSize)
- zoomedSize = minSize;
-
- // Now apply the "smart minimum." This minimum is also only applied if we're still too small
- // after zooming. The font size must either be relative to the user default or the original size
- // must have been acceptable. In other words, we only apply the smart minimum whenever we're positive
- // doing so won't disrupt the layout.
- if (useSmartMinimumForFontSize && zoomedSize < minLogicalSize && (specifiedSize >= minLogicalSize || !isAbsoluteSize))
- zoomedSize = minLogicalSize;
-
- // Also clamp to a reasonable maximum to prevent insane font sizes from causing crashes on various
- // platforms (I'm looking at you, Windows.)
- return min(maximumAllowedFontSize, zoomedSize);
-}
-
-const int fontSizeTableMax = 16;
-const int fontSizeTableMin = 9;
-const int totalKeywords = 8;
-
-// WinIE/Nav4 table for font sizes. Designed to match the legacy font mapping system of HTML.
-static const int quirksFontSizeTable[fontSizeTableMax - fontSizeTableMin + 1][totalKeywords] =
-{
- { 9, 9, 9, 9, 11, 14, 18, 28 },
- { 9, 9, 9, 10, 12, 15, 20, 31 },
- { 9, 9, 9, 11, 13, 17, 22, 34 },
- { 9, 9, 10, 12, 14, 18, 24, 37 },
- { 9, 9, 10, 13, 16, 20, 26, 40 }, // fixed font default (13)
- { 9, 9, 11, 14, 17, 21, 28, 42 },
- { 9, 10, 12, 15, 17, 23, 30, 45 },
- { 9, 10, 13, 16, 18, 24, 32, 48 } // proportional font default (16)
-};
-// HTML 1 2 3 4 5 6 7
-// CSS xxs xs s m l xl xxl
-// |
-// user pref
-
-// Strict mode table matches MacIE and Mozilla's settings exactly.
-static const int strictFontSizeTable[fontSizeTableMax - fontSizeTableMin + 1][totalKeywords] =
-{
- { 9, 9, 9, 9, 11, 14, 18, 27 },
- { 9, 9, 9, 10, 12, 15, 20, 30 },
- { 9, 9, 10, 11, 13, 17, 22, 33 },
- { 9, 9, 10, 12, 14, 18, 24, 36 },
- { 9, 10, 12, 13, 16, 20, 26, 39 }, // fixed font default (13)
- { 9, 10, 12, 14, 17, 21, 28, 42 },
- { 9, 10, 13, 15, 18, 23, 30, 45 },
- { 9, 10, 13, 16, 18, 24, 32, 48 } // proportional font default (16)
-};
-// HTML 1 2 3 4 5 6 7
-// CSS xxs xs s m l xl xxl
-// |
-// user pref
-
-// For values outside the range of the table, we use Todd Fahrner's suggested scale
-// factors for each keyword value.
-static const float fontSizeFactors[totalKeywords] = { 0.60f, 0.75f, 0.89f, 1.0f, 1.2f, 1.5f, 2.0f, 3.0f };
-
-float StyleResolver::fontSizeForKeyword(Document* document, int keyword, bool shouldUseFixedDefaultSize)
-{
- Settings* settings = document->settings();
- if (!settings)
- return 1.0f;
-
- bool quirksMode = document->inQuirksMode();
- int mediumSize = shouldUseFixedDefaultSize ? settings->defaultFixedFontSize() : settings->defaultFontSize();
- if (mediumSize >= fontSizeTableMin && mediumSize <= fontSizeTableMax) {
- // Look up the entry in the table.
- int row = mediumSize - fontSizeTableMin;
- int col = (keyword - CSSValueXxSmall);
- return quirksMode ? quirksFontSizeTable[row][col] : strictFontSizeTable[row][col];
- }
-
- // Value is outside the range of the table. Apply the scale factor instead.
- float minLogicalSize = max(settings->minimumLogicalFontSize(), 1);
- return max(fontSizeFactors[keyword - CSSValueXxSmall]*mediumSize, minLogicalSize);
-}
-
-template<typename T>
-static int findNearestLegacyFontSize(int pixelFontSize, const T* table, int multiplier)
-{
- // Ignore table[0] because xx-small does not correspond to any legacy font size.
- for (int i = 1; i < totalKeywords - 1; i++) {
- if (pixelFontSize * 2 < (table[i] + table[i + 1]) * multiplier)
- return i;
- }
- return totalKeywords - 1;
-}
-
-int StyleResolver::legacyFontSize(Document* document, int pixelFontSize, bool shouldUseFixedDefaultSize)
-{
- Settings* settings = document->settings();
- if (!settings)
- return 1;
-
- bool quirksMode = document->inQuirksMode();
- int mediumSize = shouldUseFixedDefaultSize ? settings->defaultFixedFontSize() : settings->defaultFontSize();
- if (mediumSize >= fontSizeTableMin && mediumSize <= fontSizeTableMax) {
- int row = mediumSize - fontSizeTableMin;
- return findNearestLegacyFontSize<int>(pixelFontSize, quirksMode ? quirksFontSizeTable[row] : strictFontSizeTable[row], 1);
- }
-
- return findNearestLegacyFontSize<float>(pixelFontSize, fontSizeFactors, mediumSize);
-}
-
bool StyleResolver::colorFromPrimitiveValueIsDerivedFromElement(CSSPrimitiveValue* value)
{
- int ident = value->getIdent();
+ int ident = value->getValueID();
switch (ident) {
case CSSValueWebkitText:
case CSSValueWebkitLink:
@@ -3634,7 +3505,7 @@
if (filterOperation->getOperationType() == FilterOperation::REFERENCE) {
ReferenceFilterOperation* referenceFilter = static_cast<ReferenceFilterOperation*>(filterOperation.get());
- WebKitCSSSVGDocumentValue* value = state.pendingSVGDocuments().get(referenceFilter);
+ CSSSVGDocumentValue* value = state.pendingSVGDocuments().get(referenceFilter);
if (!value)
continue;
CachedDocument* cachedDocument = value->load(cachedResourceLoader);
@@ -3674,11 +3545,11 @@
customFilter->setProgram(styleProgram.release());
else {
if (program->vertexShader() && program->vertexShader()->isPendingShader()) {
- WebKitCSSShaderValue* shaderValue = static_cast<StylePendingShader*>(program->vertexShader())->cssShaderValue();
+ CSSShaderValue* shaderValue = static_cast<StylePendingShader*>(program->vertexShader())->cssShaderValue();
program->setVertexShader(shaderValue->cachedShader(cachedResourceLoader));
}
if (program->fragmentShader() && program->fragmentShader()->isPendingShader()) {
- WebKitCSSShaderValue* shaderValue = static_cast<StylePendingShader*>(program->fragmentShader())->cssShaderValue();
+ CSSShaderValue* shaderValue = static_cast<StylePendingShader*>(program->fragmentShader())->cssShaderValue();
program->setFragmentShader(shaderValue->cachedShader(cachedResourceLoader));
}
m_customFilterProgramCache->add(program);
@@ -3790,6 +3661,14 @@
}
break;
}
+ case CSSPropertyWebkitShapeInside:
+ if (m_state.style()->shapeInside() && m_state.style()->shapeInside()->image() && m_state.style()->shapeInside()->image()->isPendingImage())
+ m_state.style()->shapeInside()->setImage(loadPendingImage(static_cast<StylePendingImage*>(m_state.style()->shapeInside()->image())));
+ break;
+ case CSSPropertyWebkitShapeOutside:
+ if (m_state.style()->shapeOutside() && m_state.style()->shapeOutside()->image() && m_state.style()->shapeOutside()->image()->isPendingImage())
+ m_state.style()->shapeOutside()->setImage(loadPendingImage(static_cast<StylePendingImage*>(m_state.style()->shapeOutside()->image())));
+ break;
default:
ASSERT_NOT_REACHED();
}
diff --git a/Source/core/css/resolver/StyleResolver.h b/Source/core/css/resolver/StyleResolver.h
index f100ae2..003e55d 100644
--- a/Source/core/css/resolver/StyleResolver.h
+++ b/Source/core/css/resolver/StyleResolver.h
@@ -24,17 +24,18 @@
#include "RuntimeEnabledFeatures.h"
#include "core/css/CSSRuleList.h"
+#include "core/css/CSSSVGDocumentValue.h"
#include "core/css/CSSToStyleMap.h"
#include "core/css/CSSValueList.h"
#include "core/css/DocumentRuleSets.h"
#include "core/css/InspectorCSSOMWrappers.h"
#include "core/css/MediaQueryExp.h"
+#include "core/css/PseudoStyleRequest.h"
#include "core/css/RuleFeature.h"
#include "core/css/RuleSet.h"
#include "core/css/SelectorChecker.h"
#include "core/css/SelectorFilter.h"
#include "core/css/SiblingTraversalStrategies.h"
-#include "core/css/WebKitCSSSVGDocumentValue.h"
#include "core/css/resolver/ScopedStyleResolver.h"
#include "core/css/resolver/StyleResolverState.h"
#include "core/css/resolver/ViewportStyleResolver.h"
@@ -51,12 +52,8 @@
namespace WebCore {
-enum ESmartMinimumForFontSize { DoNotUseSmartMinimumForFontSize, UseSmartMinimumForFontFize };
-
class CSSCursorImageValue;
class CSSFontSelector;
-class CSSFontFace;
-class CSSFontFaceRule;
class CSSImageGeneratorValue;
class CSSImageSetValue;
class CSSImageValue;
@@ -68,29 +65,20 @@
class CSSStyleSheet;
class CSSValue;
class ContainerNode;
-class CustomFilterOperation;
-class CustomFilterParameter;
-class CustomFilterParameterList;
-class CustomFilterProgram;
-struct CustomFilterProgramMixSettings;
class DeprecatedStyleBuilder;
class Document;
class Element;
class ElementRuleCollector;
class Frame;
class FrameView;
-class KURL;
class KeyframeList;
class KeyframeValue;
class MediaQueryEvaluator;
class Node;
class RenderRegion;
-class RenderScrollbar;
class RuleData;
class RuleSet;
-class ScopedStyleResolver;
class Settings;
-class StaticCSSRuleList;
class StyleCustomFilterProgramCache;
class StyleImage;
class StyleKeyframe;
@@ -105,10 +93,6 @@
class StyleSheet;
class StyleSheetList;
class StyledElement;
-class ViewportStyleResolver;
-class WebKitCSSFilterValue;
-class WebKitCSSShaderValue;
-class WebKitCSSSVGDocumentValue;
class MediaQueryResult {
WTF_MAKE_NONCOPYABLE(MediaQueryResult); WTF_MAKE_FAST_ALLOCATED;
@@ -139,20 +123,6 @@
MatchOnlyUserAgentRules,
};
-class PseudoStyleRequest {
-public:
- PseudoStyleRequest(PseudoId pseudoId, RenderScrollbar* scrollbar = 0, ScrollbarPart scrollbarPart = NoPart)
- : pseudoId(pseudoId)
- , scrollbarPart(scrollbarPart)
- , scrollbar(scrollbar)
- {
- }
-
- PseudoId pseudoId;
- ScrollbarPart scrollbarPart;
- RenderScrollbar* scrollbar;
-};
-
class MatchRequest {
public:
MatchRequest(RuleSet* ruleSet, bool includeEmptyRules = false, const ContainerNode* scope = 0)
@@ -178,7 +148,13 @@
void popParentShadowRoot(const ShadowRoot*);
PassRefPtr<RenderStyle> styleForElement(Element*, RenderStyle* parentStyle = 0, StyleSharingBehavior = AllowStyleSharing,
- RuleMatchingBehavior = MatchAllRules, RenderRegion* regionForStyling = 0);
+ RuleMatchingBehavior = MatchAllRules, RenderRegion* regionForStyling = 0, int childIndex = 0);
+
+ // childIndex's origin is 1, and avoids unnecessary tree walks to resolve nth/nth-last selectors.
+ PassRefPtr<RenderStyle> styleForElement(Element* element, int childIndex)
+ {
+ return styleForElement(element, 0, AllowStyleSharing, MatchAllRules, 0, childIndex);
+ }
void keyframeStylesForAnimation(Element*, const RenderStyle*, KeyframeList&);
@@ -216,7 +192,7 @@
}
private:
- void initElement(Element*);
+ void initElement(Element*, int childIndex = 0);
RenderStyle* locateSharedStyle();
bool styleSharingCandidateMatchesRuleSet(RuleSet*);
Node* locateCousinList(Element* parent, unsigned& visitedNodeCount) const;
@@ -238,13 +214,6 @@
PassRefPtr<CSSRuleList> styleRulesForElement(Element*, unsigned rulesToInclude = AllButEmptyCSSRules);
PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, PseudoId, unsigned rulesToInclude = AllButEmptyCSSRules);
- // Given a CSS keyword in the range (xx-small to -webkit-xxx-large), this function will return
- // the correct font size scaled relative to the user's default (medium).
- static float fontSizeForKeyword(Document*, int keyword, bool shouldUseFixedDefaultSize);
-
- // Given a font size in pixel, this function will return legacy font size between 1 and 7.
- static int legacyFontSize(Document*, int pixelFontSize, bool shouldUseFixedDefaultSize);
-
public:
void applyPropertyToStyle(CSSPropertyID, CSSValue*, RenderStyle*);
@@ -252,14 +221,8 @@
void updateFont();
void initializeFontStyle(Settings*);
-
- static float getComputedSizeFromSpecifiedSize(Document*, float zoomFactor, bool isAbsoluteSize, float specifiedSize, ESmartMinimumForFontSize = UseSmartMinimumForFontFize);
-
void setFontSize(FontDescription&, float size);
-private:
- static float getComputedSizeFromSpecifiedSize(Document*, RenderStyle*, bool isAbsoluteSize, float specifiedSize, bool useSVGZoomRules);
-
public:
bool useSVGZoomRules();
@@ -373,8 +336,6 @@
template <StyleApplicationPass pass>
void applyAnimatedProperties(const Element* target);
void resolveVariables(CSSPropertyID, CSSValue*, Vector<std::pair<CSSPropertyID, String> >& knownExpressions);
- static bool isValidRegionStyleProperty(CSSPropertyID);
- static bool isValidCueStyleProperty(CSSPropertyID);
void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPage, const String& pageName);
void matchPageRulesForList(Vector<StyleRulePage*>& matchedRules, const Vector<StyleRulePage*>&, bool isLeftPage, bool isFirstPage, const String& pageName);
Settings* documentSettings() { return m_document->settings(); }
@@ -431,7 +392,6 @@
PassRefPtr<StyleImage> loadPendingImage(StylePendingImage*);
void loadPendingImages();
- static unsigned computeMatchedPropertiesHash(const MatchedProperties*, unsigned size);
struct MatchedPropertiesCacheItem {
void reportMemoryUsage(MemoryObjectInfo*) const;
Vector<MatchedProperties> matchedProperties;
diff --git a/Source/core/css/resolver/StyleResolverState.cpp b/Source/core/css/resolver/StyleResolverState.cpp
index fdeae92..9b71aaa 100644
--- a/Source/core/css/resolver/StyleResolverState.cpp
+++ b/Source/core/css/resolver/StyleResolverState.cpp
@@ -45,6 +45,7 @@
void StyleResolverState::clear()
{
m_element = 0;
+ m_childIndex = 0;
m_styledElement = 0;
m_parentStyle = 0;
m_parentNode = 0;
@@ -54,9 +55,10 @@
m_pendingSVGDocuments.clear();
}
-void StyleResolverState::initElement(Element* e)
+void StyleResolverState::initElement(Element* e, int childIndex)
{
m_element = e;
+ m_childIndex = childIndex;
m_styledElement = e && e->isStyledElement() ? static_cast<StyledElement*>(e) : 0;
m_elementLinkState = e ? e->document()->visitedLinkState()->determineLinkState(e) : NotInsideLink;
}
@@ -88,10 +90,10 @@
}
-static Color colorForCSSValue(int cssValueId)
+static Color colorForCSSValue(CSSValueID cssValueId)
{
struct ColorValue {
- int cssValueId;
+ CSSValueID cssValueId;
RGBA32 color;
};
@@ -115,7 +117,7 @@
{ CSSValueTransparent, 0x00000000 },
{ CSSValueWhite, 0xFFFFFFFF },
{ CSSValueYellow, 0xFFFFFF00 },
- { 0, 0 }
+ { CSSValueInvalid, CSSValueInvalid }
};
for (const ColorValue* col = colorValues; col->cssValueId; ++col) {
@@ -130,8 +132,8 @@
if (value->isRGBColor())
return Color(value->getRGBA32Value());
- int ident = value->getIdent();
- switch (ident) {
+ CSSValueID valueID = value->getValueID();
+ switch (valueID) {
case 0:
return Color();
case CSSValueWebkitText:
@@ -145,7 +147,7 @@
case CSSValueCurrentcolor:
return style()->color();
default:
- return colorForCSSValue(ident);
+ return colorForCSSValue(valueID);
}
}
diff --git a/Source/core/css/resolver/StyleResolverState.h b/Source/core/css/resolver/StyleResolverState.h
index 3920e2a..eface43 100644
--- a/Source/core/css/resolver/StyleResolverState.h
+++ b/Source/core/css/resolver/StyleResolverState.h
@@ -24,8 +24,8 @@
#include "CSSPropertyNames.h"
+#include "core/css/CSSSVGDocumentValue.h"
#include "core/css/CSSValueList.h"
-#include "core/css/WebKitCSSSVGDocumentValue.h"
#include "core/dom/Element.h"
#include "core/platform/graphics/Color.h"
#include "core/platform/graphics/filters/FilterOperations.h"
@@ -43,13 +43,14 @@
class StyledElement;
typedef HashMap<CSSPropertyID, RefPtr<CSSValue> > PendingImagePropertyMap;
-typedef HashMap<FilterOperation*, RefPtr<WebKitCSSSVGDocumentValue> > PendingSVGDocumentMap;
+typedef HashMap<FilterOperation*, RefPtr<CSSSVGDocumentValue> > PendingSVGDocumentMap;
class StyleResolverState {
WTF_MAKE_NONCOPYABLE(StyleResolverState);
public:
StyleResolverState()
: m_element(0)
+ , m_childIndex(0)
, m_styledElement(0)
, m_parentNode(0)
, m_parentStyle(0)
@@ -67,7 +68,7 @@
, m_backgroundData(BackgroundFillLayer) { }
public:
- void initElement(Element*);
+ void initElement(Element*, int childIndex);
void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0);
void clear();
@@ -75,6 +76,7 @@
Document* document() const { return m_element->document(); }
Element* element() const { return m_element; }
+ int childIndex() const { return m_childIndex; }
StyledElement* styledElement() const { return m_styledElement; }
void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; }
RenderStyle* style() const { return m_style.get(); }
@@ -122,10 +124,8 @@
bool useSVGZoomRules() const { return m_element && m_element->isSVGElement(); }
private:
- // FIXME(bug 108563): to make it easier to review, these member
- // variables are public. However we should add methods to access
- // these variables.
Element* m_element;
+ int m_childIndex;
RefPtr<RenderStyle> m_style;
StyledElement* m_styledElement;
ContainerNode* m_parentNode;
diff --git a/Source/core/css/resolver/TransformBuilder.cpp b/Source/core/css/resolver/TransformBuilder.cpp
index e57c8e4..f4f1df6 100644
--- a/Source/core/css/resolver/TransformBuilder.cpp
+++ b/Source/core/css/resolver/TransformBuilder.cpp
@@ -30,7 +30,7 @@
#include "core/css/resolver/TransformBuilder.h"
#include "core/css/CSSPrimitiveValueMappings.h"
-#include "core/css/WebKitCSSTransformValue.h"
+#include "core/css/CSSTransformValue.h"
#include "core/platform/graphics/transforms/Matrix3DTransformOperation.h"
#include "core/platform/graphics/transforms/MatrixTransformOperation.h"
#include "core/platform/graphics/transforms/PerspectiveTransformOperation.h"
@@ -56,31 +56,31 @@
return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | CalculatedConversion | FractionConversion | ViewportPercentageConversion>(style, rootStyle, multiplier) : Length(Undefined);
}
-static TransformOperation::OperationType getTransformOperationType(WebKitCSSTransformValue::TransformOperationType type)
+static TransformOperation::OperationType getTransformOperationType(CSSTransformValue::TransformOperationType type)
{
switch (type) {
- case WebKitCSSTransformValue::ScaleTransformOperation: return TransformOperation::SCALE;
- case WebKitCSSTransformValue::ScaleXTransformOperation: return TransformOperation::SCALE_X;
- case WebKitCSSTransformValue::ScaleYTransformOperation: return TransformOperation::SCALE_Y;
- case WebKitCSSTransformValue::ScaleZTransformOperation: return TransformOperation::SCALE_Z;
- case WebKitCSSTransformValue::Scale3DTransformOperation: return TransformOperation::SCALE_3D;
- case WebKitCSSTransformValue::TranslateTransformOperation: return TransformOperation::TRANSLATE;
- case WebKitCSSTransformValue::TranslateXTransformOperation: return TransformOperation::TRANSLATE_X;
- case WebKitCSSTransformValue::TranslateYTransformOperation: return TransformOperation::TRANSLATE_Y;
- case WebKitCSSTransformValue::TranslateZTransformOperation: return TransformOperation::TRANSLATE_Z;
- case WebKitCSSTransformValue::Translate3DTransformOperation: return TransformOperation::TRANSLATE_3D;
- case WebKitCSSTransformValue::RotateTransformOperation: return TransformOperation::ROTATE;
- case WebKitCSSTransformValue::RotateXTransformOperation: return TransformOperation::ROTATE_X;
- case WebKitCSSTransformValue::RotateYTransformOperation: return TransformOperation::ROTATE_Y;
- case WebKitCSSTransformValue::RotateZTransformOperation: return TransformOperation::ROTATE_Z;
- case WebKitCSSTransformValue::Rotate3DTransformOperation: return TransformOperation::ROTATE_3D;
- case WebKitCSSTransformValue::SkewTransformOperation: return TransformOperation::SKEW;
- case WebKitCSSTransformValue::SkewXTransformOperation: return TransformOperation::SKEW_X;
- case WebKitCSSTransformValue::SkewYTransformOperation: return TransformOperation::SKEW_Y;
- case WebKitCSSTransformValue::MatrixTransformOperation: return TransformOperation::MATRIX;
- case WebKitCSSTransformValue::Matrix3DTransformOperation: return TransformOperation::MATRIX_3D;
- case WebKitCSSTransformValue::PerspectiveTransformOperation: return TransformOperation::PERSPECTIVE;
- case WebKitCSSTransformValue::UnknownTransformOperation: return TransformOperation::NONE;
+ case CSSTransformValue::ScaleTransformOperation: return TransformOperation::SCALE;
+ case CSSTransformValue::ScaleXTransformOperation: return TransformOperation::SCALE_X;
+ case CSSTransformValue::ScaleYTransformOperation: return TransformOperation::SCALE_Y;
+ case CSSTransformValue::ScaleZTransformOperation: return TransformOperation::SCALE_Z;
+ case CSSTransformValue::Scale3DTransformOperation: return TransformOperation::SCALE_3D;
+ case CSSTransformValue::TranslateTransformOperation: return TransformOperation::TRANSLATE;
+ case CSSTransformValue::TranslateXTransformOperation: return TransformOperation::TRANSLATE_X;
+ case CSSTransformValue::TranslateYTransformOperation: return TransformOperation::TRANSLATE_Y;
+ case CSSTransformValue::TranslateZTransformOperation: return TransformOperation::TRANSLATE_Z;
+ case CSSTransformValue::Translate3DTransformOperation: return TransformOperation::TRANSLATE_3D;
+ case CSSTransformValue::RotateTransformOperation: return TransformOperation::ROTATE;
+ case CSSTransformValue::RotateXTransformOperation: return TransformOperation::ROTATE_X;
+ case CSSTransformValue::RotateYTransformOperation: return TransformOperation::ROTATE_Y;
+ case CSSTransformValue::RotateZTransformOperation: return TransformOperation::ROTATE_Z;
+ case CSSTransformValue::Rotate3DTransformOperation: return TransformOperation::ROTATE_3D;
+ case CSSTransformValue::SkewTransformOperation: return TransformOperation::SKEW;
+ case CSSTransformValue::SkewXTransformOperation: return TransformOperation::SKEW_X;
+ case CSSTransformValue::SkewYTransformOperation: return TransformOperation::SKEW_Y;
+ case CSSTransformValue::MatrixTransformOperation: return TransformOperation::MATRIX;
+ case CSSTransformValue::Matrix3DTransformOperation: return TransformOperation::MATRIX_3D;
+ case CSSTransformValue::PerspectiveTransformOperation: return TransformOperation::PERSPECTIVE;
+ case CSSTransformValue::UnknownTransformOperation: return TransformOperation::NONE;
}
return TransformOperation::NONE;
}
@@ -97,10 +97,10 @@
for (CSSValueListIterator i = inValue; i.hasMore(); i.advance()) {
CSSValue* currValue = i.value();
- if (!currValue->isWebKitCSSTransformValue())
+ if (!currValue->isCSSTransformValue())
continue;
- WebKitCSSTransformValue* transformValue = static_cast<WebKitCSSTransformValue*>(i.value());
+ CSSTransformValue* transformValue = static_cast<CSSTransformValue*>(i.value());
if (!transformValue->length())
continue;
@@ -117,16 +117,16 @@
CSSPrimitiveValue* firstValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(0));
switch (transformValue->operationType()) {
- case WebKitCSSTransformValue::ScaleTransformOperation:
- case WebKitCSSTransformValue::ScaleXTransformOperation:
- case WebKitCSSTransformValue::ScaleYTransformOperation: {
+ case CSSTransformValue::ScaleTransformOperation:
+ case CSSTransformValue::ScaleXTransformOperation:
+ case CSSTransformValue::ScaleYTransformOperation: {
double sx = 1.0;
double sy = 1.0;
- if (transformValue->operationType() == WebKitCSSTransformValue::ScaleYTransformOperation)
+ if (transformValue->operationType() == CSSTransformValue::ScaleYTransformOperation)
sy = firstValue->getDoubleValue();
else {
sx = firstValue->getDoubleValue();
- if (transformValue->operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) {
+ if (transformValue->operationType() != CSSTransformValue::ScaleXTransformOperation) {
if (transformValue->length() > 1) {
CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
sy = secondValue->getDoubleValue();
@@ -137,18 +137,18 @@
operations.operations().append(ScaleTransformOperation::create(sx, sy, 1.0, getTransformOperationType(transformValue->operationType())));
break;
}
- case WebKitCSSTransformValue::ScaleZTransformOperation:
- case WebKitCSSTransformValue::Scale3DTransformOperation: {
+ case CSSTransformValue::ScaleZTransformOperation:
+ case CSSTransformValue::Scale3DTransformOperation: {
double sx = 1.0;
double sy = 1.0;
double sz = 1.0;
- if (transformValue->operationType() == WebKitCSSTransformValue::ScaleZTransformOperation)
+ if (transformValue->operationType() == CSSTransformValue::ScaleZTransformOperation)
sz = firstValue->getDoubleValue();
- else if (transformValue->operationType() == WebKitCSSTransformValue::ScaleYTransformOperation)
+ else if (transformValue->operationType() == CSSTransformValue::ScaleYTransformOperation)
sy = firstValue->getDoubleValue();
else {
sx = firstValue->getDoubleValue();
- if (transformValue->operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) {
+ if (transformValue->operationType() != CSSTransformValue::ScaleXTransformOperation) {
if (transformValue->length() > 2) {
CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2));
sz = thirdValue->getDoubleValue();
@@ -163,16 +163,16 @@
operations.operations().append(ScaleTransformOperation::create(sx, sy, sz, getTransformOperationType(transformValue->operationType())));
break;
}
- case WebKitCSSTransformValue::TranslateTransformOperation:
- case WebKitCSSTransformValue::TranslateXTransformOperation:
- case WebKitCSSTransformValue::TranslateYTransformOperation: {
+ case CSSTransformValue::TranslateTransformOperation:
+ case CSSTransformValue::TranslateXTransformOperation:
+ case CSSTransformValue::TranslateYTransformOperation: {
Length tx = Length(0, Fixed);
Length ty = Length(0, Fixed);
- if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
+ if (transformValue->operationType() == CSSTransformValue::TranslateYTransformOperation)
ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
else {
tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
- if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
+ if (transformValue->operationType() != CSSTransformValue::TranslateXTransformOperation) {
if (transformValue->length() > 1) {
CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor);
@@ -186,18 +186,18 @@
operations.operations().append(TranslateTransformOperation::create(tx, ty, Length(0, Fixed), getTransformOperationType(transformValue->operationType())));
break;
}
- case WebKitCSSTransformValue::TranslateZTransformOperation:
- case WebKitCSSTransformValue::Translate3DTransformOperation: {
+ case CSSTransformValue::TranslateZTransformOperation:
+ case CSSTransformValue::Translate3DTransformOperation: {
Length tx = Length(0, Fixed);
Length ty = Length(0, Fixed);
Length tz = Length(0, Fixed);
- if (transformValue->operationType() == WebKitCSSTransformValue::TranslateZTransformOperation)
+ if (transformValue->operationType() == CSSTransformValue::TranslateZTransformOperation)
tz = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
- else if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
+ else if (transformValue->operationType() == CSSTransformValue::TranslateYTransformOperation)
ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
else {
tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
- if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
+ if (transformValue->operationType() != CSSTransformValue::TranslateXTransformOperation) {
if (transformValue->length() > 2) {
CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2));
tz = convertToFloatLength(thirdValue, style, rootStyle, zoomFactor);
@@ -215,29 +215,29 @@
operations.operations().append(TranslateTransformOperation::create(tx, ty, tz, getTransformOperationType(transformValue->operationType())));
break;
}
- case WebKitCSSTransformValue::RotateTransformOperation: {
+ case CSSTransformValue::RotateTransformOperation: {
double angle = firstValue->computeDegrees();
operations.operations().append(RotateTransformOperation::create(0, 0, 1, angle, getTransformOperationType(transformValue->operationType())));
break;
}
- case WebKitCSSTransformValue::RotateXTransformOperation:
- case WebKitCSSTransformValue::RotateYTransformOperation:
- case WebKitCSSTransformValue::RotateZTransformOperation: {
+ case CSSTransformValue::RotateXTransformOperation:
+ case CSSTransformValue::RotateYTransformOperation:
+ case CSSTransformValue::RotateZTransformOperation: {
double x = 0;
double y = 0;
double z = 0;
double angle = firstValue->computeDegrees();
- if (transformValue->operationType() == WebKitCSSTransformValue::RotateXTransformOperation)
+ if (transformValue->operationType() == CSSTransformValue::RotateXTransformOperation)
x = 1;
- else if (transformValue->operationType() == WebKitCSSTransformValue::RotateYTransformOperation)
+ else if (transformValue->operationType() == CSSTransformValue::RotateYTransformOperation)
y = 1;
else
z = 1;
operations.operations().append(RotateTransformOperation::create(x, y, z, angle, getTransformOperationType(transformValue->operationType())));
break;
}
- case WebKitCSSTransformValue::Rotate3DTransformOperation: {
+ case CSSTransformValue::Rotate3DTransformOperation: {
if (transformValue->length() < 4)
break;
CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
@@ -250,17 +250,17 @@
operations.operations().append(RotateTransformOperation::create(x, y, z, angle, getTransformOperationType(transformValue->operationType())));
break;
}
- case WebKitCSSTransformValue::SkewTransformOperation:
- case WebKitCSSTransformValue::SkewXTransformOperation:
- case WebKitCSSTransformValue::SkewYTransformOperation: {
+ case CSSTransformValue::SkewTransformOperation:
+ case CSSTransformValue::SkewXTransformOperation:
+ case CSSTransformValue::SkewYTransformOperation: {
double angleX = 0;
double angleY = 0;
double angle = firstValue->computeDegrees();
- if (transformValue->operationType() == WebKitCSSTransformValue::SkewYTransformOperation)
+ if (transformValue->operationType() == CSSTransformValue::SkewYTransformOperation)
angleY = angle;
else {
angleX = angle;
- if (transformValue->operationType() == WebKitCSSTransformValue::SkewTransformOperation) {
+ if (transformValue->operationType() == CSSTransformValue::SkewTransformOperation) {
if (transformValue->length() > 1) {
CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
angleY = secondValue->computeDegrees();
@@ -270,7 +270,7 @@
operations.operations().append(SkewTransformOperation::create(angleX, angleY, getTransformOperationType(transformValue->operationType())));
break;
}
- case WebKitCSSTransformValue::MatrixTransformOperation: {
+ case CSSTransformValue::MatrixTransformOperation: {
if (transformValue->length() < 6)
break;
double a = firstValue->getDoubleValue();
@@ -282,7 +282,7 @@
operations.operations().append(MatrixTransformOperation::create(a, b, c, d, e, f));
break;
}
- case WebKitCSSTransformValue::Matrix3DTransformOperation: {
+ case CSSTransformValue::Matrix3DTransformOperation: {
if (transformValue->length() < 16)
break;
TransformationMatrix matrix(toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(0))->getDoubleValue(),
@@ -304,7 +304,7 @@
operations.operations().append(Matrix3DTransformOperation::create(matrix));
break;
}
- case WebKitCSSTransformValue::PerspectiveTransformOperation: {
+ case CSSTransformValue::PerspectiveTransformOperation: {
Length p = Length(0, Fixed);
if (firstValue->isLength())
p = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
@@ -320,7 +320,7 @@
operations.operations().append(PerspectiveTransformOperation::create(p));
break;
}
- case WebKitCSSTransformValue::UnknownTransformOperation:
+ case CSSTransformValue::UnknownTransformOperation:
ASSERT_NOT_REACHED();
break;
}
diff --git a/Source/core/css/view-source.css b/Source/core/css/view-source.css
index 3825c5f..591a23b 100644
--- a/Source/core/css/view-source.css
+++ b/Source/core/css/view-source.css
@@ -124,10 +124,6 @@
color: rgb(192, 192, 192);
}
-.webkit-html-entity {
- rgb(136, 18, 128);
-}
-
.webkit-html-message-bubble {
box-shadow: black 0px 2px 5px;
border-radius: 9px;