summaryrefslogtreecommitdiffstats
path: root/WebCore/css/CSSComputedStyleDeclaration.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-05 14:36:32 +0100
committerBen Murdoch <benm@google.com>2011-05-10 15:38:30 +0100
commitf05b935882198ccf7d81675736e3aeb089c5113a (patch)
tree4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /WebCore/css/CSSComputedStyleDeclaration.cpp
parent60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff)
downloadexternal_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'WebCore/css/CSSComputedStyleDeclaration.cpp')
-rw-r--r--WebCore/css/CSSComputedStyleDeclaration.cpp45
1 files changed, 39 insertions, 6 deletions
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index 43edc2d..2df86b6 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -360,6 +360,13 @@ inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value
return CSSPrimitiveValue::create(value / style->effectiveZoom(), CSSPrimitiveValue::CSS_NUMBER);
}
+static PassRefPtr<CSSValue> zoomAdjustedPixelValueForLength(const Length& length, const RenderStyle* style)
+{
+ if (length.isFixed())
+ return zoomAdjustedPixelValue(length.value(), style);
+ return CSSPrimitiveValue::create(length);
+}
+
static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection, const RenderStyle* style)
{
if (!reflection)
@@ -1089,7 +1096,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyHeight:
if (renderer)
return zoomAdjustedPixelValue(sizingBox(renderer).height(), style.get());
- return CSSPrimitiveValue::create(style->height());
+ return zoomAdjustedPixelValueForLength(style->height(), style.get());
case CSSPropertyWebkitHighlight:
if (style->highlight() == nullAtom)
return CSSPrimitiveValue::createIdentifier(CSSValueNone);
@@ -1253,6 +1260,30 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return renderTextDecorationFlagsToCSSValue(style->textDecorationsInEffect());
case CSSPropertyWebkitTextFillColor:
return currentColorOrValidColor(style.get(), style->textFillColor());
+ case CSSPropertyWebkitTextEmphasisColor:
+ return currentColorOrValidColor(style.get(), style->textEmphasisColor());
+ case CSSPropertyWebkitTextEmphasisPosition:
+ return CSSPrimitiveValue::create(style->textEmphasisPosition());
+ case CSSPropertyWebkitTextEmphasisStyle:
+ switch (style->textEmphasisMark()) {
+ case TextEmphasisMarkNone:
+ return CSSPrimitiveValue::createIdentifier(CSSValueNone);
+ case TextEmphasisMarkCustom:
+ return CSSPrimitiveValue::create(style->textEmphasisCustomMark(), CSSPrimitiveValue::CSS_STRING);
+ case TextEmphasisMarkAuto:
+ ASSERT_NOT_REACHED();
+ // Fall through
+ case TextEmphasisMarkDot:
+ case TextEmphasisMarkCircle:
+ case TextEmphasisMarkDoubleCircle:
+ case TextEmphasisMarkTriangle:
+ case TextEmphasisMarkSesame: {
+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ list->append(CSSPrimitiveValue::create(style->textEmphasisFill()));
+ list->append(CSSPrimitiveValue::create(style->textEmphasisMark()));
+ return list.release();
+ }
+ }
case CSSPropertyTextIndent:
return CSSPrimitiveValue::create(style->textIndent());
case CSSPropertyTextShadow:
@@ -1332,7 +1363,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyWidth:
if (renderer)
return zoomAdjustedPixelValue(sizingBox(renderer).width(), style.get());
- return CSSPrimitiveValue::create(style->width());
+ return zoomAdjustedPixelValueForLength(style->width(), style.get());
case CSSPropertyWordBreak:
return CSSPrimitiveValue::create(style->wordBreak());
case CSSPropertyWordSpacing:
@@ -1504,8 +1535,9 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
list->append(zoomAdjustedPixelValue(style->perspectiveOriginY().calcMinValue(box.height()), style.get()));
}
else {
- list->append(CSSPrimitiveValue::create(style->perspectiveOriginX()));
- list->append(CSSPrimitiveValue::create(style->perspectiveOriginY()));
+ list->append(zoomAdjustedPixelValueForLength(style->perspectiveOriginX(), style.get()));
+ list->append(zoomAdjustedPixelValueForLength(style->perspectiveOriginY(), style.get()));
+
}
return list.release();
}
@@ -1548,8 +1580,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
if (style->transformOriginZ() != 0)
list->append(zoomAdjustedPixelValue(style->transformOriginZ(), style.get()));
} else {
- list->append(CSSPrimitiveValue::create(style->transformOriginX()));
- list->append(CSSPrimitiveValue::create(style->transformOriginY()));
+ list->append(zoomAdjustedPixelValueForLength(style->transformOriginX(), style.get()));
+ list->append(zoomAdjustedPixelValueForLength(style->transformOriginY(), style.get()));
if (style->transformOriginZ() != 0)
list->append(zoomAdjustedPixelValue(style->transformOriginZ(), style.get()));
}
@@ -1609,6 +1641,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
break;
/* Unimplemented CSS 3 properties (including CSS3 shorthand properties) */
+ case CSSPropertyWebkitTextEmphasis:
case CSSPropertyTextLineThrough:
case CSSPropertyTextLineThroughColor:
case CSSPropertyTextLineThroughMode: