summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/style
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/rendering/style
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/rendering/style')
-rw-r--r--WebCore/rendering/style/RenderStyle.cpp65
-rw-r--r--WebCore/rendering/style/RenderStyle.h22
-rw-r--r--WebCore/rendering/style/RenderStyleConstants.h12
-rw-r--r--WebCore/rendering/style/StyleRareInheritedData.cpp18
-rw-r--r--WebCore/rendering/style/StyleRareInheritedData.h9
-rw-r--r--WebCore/rendering/style/StyleRareNonInheritedData.h2
6 files changed, 122 insertions, 6 deletions
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp
index 0ea3673..37ed391 100644
--- a/WebCore/rendering/style/RenderStyle.cpp
+++ b/WebCore/rendering/style/RenderStyle.cpp
@@ -402,7 +402,10 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
rareInheritedData->textSecurity != other->rareInheritedData->textSecurity ||
rareInheritedData->hyphens != other->rareInheritedData->hyphens ||
rareInheritedData->hyphenationString != other->rareInheritedData->hyphenationString ||
- rareInheritedData->hyphenationLocale != other->rareInheritedData->hyphenationLocale)
+ rareInheritedData->hyphenationLocale != other->rareInheritedData->hyphenationLocale ||
+ rareInheritedData->textEmphasisMark != other->rareInheritedData->textEmphasisMark ||
+ rareInheritedData->textEmphasisPosition != other->rareInheritedData->textEmphasisPosition ||
+ rareInheritedData->textEmphasisCustomMark != other->rareInheritedData->textEmphasisCustomMark)
return StyleDifferenceLayout;
if (!rareInheritedData->shadowDataEquivalent(*other->rareInheritedData.get()))
@@ -553,7 +556,9 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
rareNonInheritedData->userDrag != other->rareNonInheritedData->userDrag ||
rareNonInheritedData->m_borderFit != other->rareNonInheritedData->m_borderFit ||
rareInheritedData->textFillColor != other->rareInheritedData->textFillColor ||
- rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor)
+ rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor ||
+ rareInheritedData->textEmphasisColor != other->rareInheritedData->textEmphasisColor ||
+ rareInheritedData->textEmphasisFill != other->rareInheritedData->textEmphasisFill)
return StyleDifferenceRepaint;
#if USE(ACCELERATED_COMPOSITING)
@@ -842,6 +847,47 @@ const AtomicString& RenderStyle::hyphenString() const
return hyphenMinusString;
}
+const AtomicString& RenderStyle::textEmphasisMarkString() const
+{
+ switch (textEmphasisMark()) {
+ case TextEmphasisMarkNone:
+ return nullAtom;
+ case TextEmphasisMarkCustom:
+ return textEmphasisCustomMark();
+ case TextEmphasisMarkDot: {
+ DEFINE_STATIC_LOCAL(AtomicString, filledDotString, (&bullet, 1));
+ DEFINE_STATIC_LOCAL(AtomicString, openDotString, (&whiteBullet, 1));
+ return textEmphasisFill() == TextEmphasisFillFilled ? filledDotString : openDotString;
+ }
+ case TextEmphasisMarkCircle: {
+ DEFINE_STATIC_LOCAL(AtomicString, filledCircleString, (&blackCircle, 1));
+ DEFINE_STATIC_LOCAL(AtomicString, openCircleString, (&whiteCircle, 1));
+ return textEmphasisFill() == TextEmphasisFillFilled ? filledCircleString : openCircleString;
+ }
+ case TextEmphasisMarkDoubleCircle: {
+ DEFINE_STATIC_LOCAL(AtomicString, filledDoubleCircleString, (&fisheye, 1));
+ DEFINE_STATIC_LOCAL(AtomicString, openDoubleCircleString, (&bullseye, 1));
+ return textEmphasisFill() == TextEmphasisFillFilled ? filledDoubleCircleString : openDoubleCircleString;
+ }
+ case TextEmphasisMarkTriangle: {
+ DEFINE_STATIC_LOCAL(AtomicString, filledTriangleString, (&blackUpPointingTriangle, 1));
+ DEFINE_STATIC_LOCAL(AtomicString, openTriangleString, (&whiteUpPointingTriangle, 1));
+ return textEmphasisFill() == TextEmphasisFillFilled ? filledTriangleString : openTriangleString;
+ }
+ case TextEmphasisMarkSesame: {
+ DEFINE_STATIC_LOCAL(AtomicString, filledSesameString, (&sesameDot, 1));
+ DEFINE_STATIC_LOCAL(AtomicString, openSesameString, (&whiteSesameDot, 1));
+ return textEmphasisFill() == TextEmphasisFillFilled ? filledSesameString : openSesameString;
+ }
+ case TextEmphasisMarkAuto:
+ ASSERT_NOT_REACHED();
+ return nullAtom;
+ }
+
+ ASSERT_NOT_REACHED();
+ return nullAtom;
+}
+
#if ENABLE(DASHBOARD_SUPPORT)
const Vector<StyleDashboardRegion>& RenderStyle::initialDashboardRegions()
{
@@ -1067,6 +1113,9 @@ const Color RenderStyle::colorIncludingFallback(int colorProperty, EBorderStyle
case CSSPropertyWebkitColumnRuleColor:
result = columnRuleColor();
break;
+ case CSSPropertyWebkitTextEmphasisColor:
+ result = textEmphasisColor();
+ break;
case CSSPropertyWebkitTextFillColor:
result = textFillColor();
break;
@@ -1408,4 +1457,16 @@ Length RenderStyle::paddingEnd() const
return isLeftToRightDirection() ? paddingBottom() : paddingTop();
}
+TextEmphasisMark RenderStyle::textEmphasisMark() const
+{
+ TextEmphasisMark mark = static_cast<TextEmphasisMark>(rareInheritedData->textEmphasisMark);
+ if (mark != TextEmphasisMarkAuto)
+ return mark;
+
+ if (isHorizontalWritingMode())
+ return TextEmphasisMarkDot;
+
+ return TextEmphasisMarkSesame;
+}
+
} // namespace WebCore
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index e86d595..7e61e46 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -713,6 +713,12 @@ public:
Length transformOriginY() const { return rareNonInheritedData->m_transform->m_y; }
float transformOriginZ() const { return rareNonInheritedData->m_transform->m_z; }
bool hasTransform() const { return !rareNonInheritedData->m_transform->m_operations.operations().isEmpty(); }
+
+ TextEmphasisFill textEmphasisFill() const { return static_cast<TextEmphasisFill>(rareInheritedData->textEmphasisFill); }
+ TextEmphasisMark textEmphasisMark() const;
+ const AtomicString& textEmphasisCustomMark() const { return rareInheritedData->textEmphasisCustomMark; }
+ TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextEmphasisPosition>(rareInheritedData->textEmphasisPosition); }
+ const AtomicString& textEmphasisMarkString() const;
// Return true if any transform related property (currently transform, transformStyle3D or perspective)
// indicates that we are transforming
@@ -1080,6 +1086,11 @@ public:
void setTransformOriginZ(float f) { SET_VAR(rareNonInheritedData.access()->m_transform, m_z, f); }
void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
void setTextCombine(TextCombine v) { SET_VAR(rareNonInheritedData, m_textCombine, v); }
+ void setTextEmphasisColor(const Color& c) { SET_VAR(rareInheritedData, textEmphasisColor, c) }
+ void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); }
+ void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); }
+ void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInheritedData, textEmphasisCustomMark, mark); }
+ void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareInheritedData, textEmphasisPosition, position); }
// End CSS3 Setters
// Apple-specific property setters
@@ -1311,6 +1322,11 @@ public:
static Length initialPerspectiveOriginX() { return Length(50.0, Percent); }
static Length initialPerspectiveOriginY() { return Length(50.0, Percent); }
static Color initialBackgroundColor() { return Color::transparent; }
+ static Color initialTextEmphasisColor() { return TextEmphasisFillFilled; }
+ static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillFilled; }
+ static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; }
+ static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom; }
+ static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver; }
// Keep these at the end.
static LineClampValue initialLineClamp() { return LineClampValue(); }
@@ -1358,6 +1374,7 @@ private:
const Color& color() const { return inherited->color; }
const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
const Color& outlineColor() const { return m_background->outline().color(); }
+ const Color& textEmphasisColor() const { return rareInheritedData->textEmphasisColor; }
const Color& textFillColor() const { return rareInheritedData->textFillColor; }
const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; }
@@ -1382,6 +1399,11 @@ inline int adjustForAbsoluteZoom(int value, const RenderStyle* style)
return roundForImpreciseConversion<int, INT_MAX, INT_MIN>(value / zoomFactor);
}
+inline float adjustFloatForAbsoluteZoom(float value, const RenderStyle* style)
+{
+ return value / style->effectiveZoom();
+}
+
} // namespace WebCore
#endif // RenderStyle_h
diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h
index b8e2079..0839864 100644
--- a/WebCore/rendering/style/RenderStyleConstants.h
+++ b/WebCore/rendering/style/RenderStyleConstants.h
@@ -134,7 +134,7 @@ enum WritingMode {
};
enum TextCombine {
- TextCombineNone, TextCombineCluster, TextCombineUpright
+ TextCombineNone, TextCombineHorizontal
};
enum EFillAttachment {
@@ -290,6 +290,8 @@ enum EListStyleType {
Footnotes,
Hebrew,
Armenian,
+ LowerArmenian,
+ UpperArmenian,
Georgian,
CJKIdeographic,
Hiragana,
@@ -420,7 +422,13 @@ enum ELineClampType { LineClampLineCount, LineClampPercentage };
enum Hyphens { HyphensNone, HyphensManual, HyphensAuto };
enum ESpeak { SpeakNone, SpeakNormal, SpeakSpellOut, SpeakDigits, SpeakLiteralPunctuation, SpeakNoPunctuation };
-
+
+enum TextEmphasisFill { TextEmphasisFillFilled, TextEmphasisFillOpen };
+
+enum TextEmphasisMark { TextEmphasisMarkNone, TextEmphasisMarkAuto, TextEmphasisMarkDot, TextEmphasisMarkCircle, TextEmphasisMarkDoubleCircle, TextEmphasisMarkTriangle, TextEmphasisMarkSesame, TextEmphasisMarkCustom };
+
+enum TextEmphasisPosition { TextEmphasisPositionOver, TextEmphasisPositionUnder };
+
} // namespace WebCore
#endif // RenderStyleConstants_h
diff --git a/WebCore/rendering/style/StyleRareInheritedData.cpp b/WebCore/rendering/style/StyleRareInheritedData.cpp
index af2b555..1fdf0b2 100644
--- a/WebCore/rendering/style/StyleRareInheritedData.cpp
+++ b/WebCore/rendering/style/StyleRareInheritedData.cpp
@@ -60,6 +60,9 @@ StyleRareInheritedData::StyleRareInheritedData()
, colorSpace(ColorSpaceDeviceRGB)
, speak(SpeakNormal)
, hyphens(HyphensManual)
+ , textEmphasisFill(TextEmphasisFillFilled)
+ , textEmphasisMark(TextEmphasisMarkNone)
+ , textEmphasisPosition(TextEmphasisPositionOver)
{
}
@@ -68,6 +71,7 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
, textStrokeColor(o.textStrokeColor)
, textStrokeWidth(o.textStrokeWidth)
, textFillColor(o.textFillColor)
+<<<<<<< HEAD
#ifdef ANDROID_CSS_RING
, ringFillColor(o.ringFillColor)
, ringInnerWidth(o.ringInnerWidth)
@@ -82,6 +86,9 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
#ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
, tapHighlightColor(o.tapHighlightColor)
#endif
+=======
+ , textEmphasisColor(o.textEmphasisColor)
+>>>>>>> webkit.org at r74534 (trunk)
, textShadow(o.textShadow ? new ShadowData(*o.textShadow) : 0)
, highlight(o.highlight)
, cursorData(o.cursorData)
@@ -101,8 +108,12 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
, colorSpace(o.colorSpace)
, speak(o.speak)
, hyphens(o.hyphens)
+ , textEmphasisFill(o.textEmphasisFill)
+ , textEmphasisMark(o.textEmphasisMark)
+ , textEmphasisPosition(o.textEmphasisPosition)
, hyphenationString(o.hyphenationString)
, hyphenationLocale(o.hyphenationLocale)
+ , textEmphasisCustomMark(o.textEmphasisCustomMark)
{
}
@@ -125,6 +136,7 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
return textStrokeColor == o.textStrokeColor
&& textStrokeWidth == o.textStrokeWidth
&& textFillColor == o.textFillColor
+ && textEmphasisColor == o.textEmphasisColor
&& shadowDataEquivalent(o)
&& highlight == o.highlight
&& cursorDataEquivalent(cursorData.get(), o.cursorData.get())
@@ -158,8 +170,12 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
&& colorSpace == o.colorSpace
&& speak == o.speak
&& hyphens == o.hyphens
+ && textEmphasisFill == o.textEmphasisFill
+ && textEmphasisMark == o.textEmphasisMark
+ && textEmphasisPosition == o.textEmphasisPosition
&& hyphenationString == o.hyphenationString
- && hyphenationLocale == o.hyphenationLocale;
+ && hyphenationLocale == o.hyphenationLocale
+ && textEmphasisCustomMark == o.textEmphasisCustomMark;
}
bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const
diff --git a/WebCore/rendering/style/StyleRareInheritedData.h b/WebCore/rendering/style/StyleRareInheritedData.h
index 4ebbf88..e488909 100644
--- a/WebCore/rendering/style/StyleRareInheritedData.h
+++ b/WebCore/rendering/style/StyleRareInheritedData.h
@@ -55,6 +55,7 @@ public:
Color textStrokeColor;
float textStrokeWidth;
Color textFillColor;
+<<<<<<< HEAD
#ifdef ANDROID_CSS_RING
Color ringFillColor;
Length ringInnerWidth;
@@ -69,6 +70,9 @@ public:
#ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
Color tapHighlightColor;
#endif
+=======
+ Color textEmphasisColor;
+>>>>>>> webkit.org at r74534 (trunk)
ShadowData* textShadow; // Our text shadow information for shadowed text drawing.
AtomicString highlight; // Apple-specific extension for custom highlight rendering.
@@ -93,10 +97,15 @@ public:
unsigned colorSpace : 1; // ColorSpace
unsigned speak : 3; // ESpeak
unsigned hyphens : 2; // Hyphens
+ unsigned textEmphasisFill : 1; // TextEmphasisFill
+ unsigned textEmphasisMark : 3; // TextEmphasisMark
+ unsigned textEmphasisPosition : 1; // TextEmphasisPosition
AtomicString hyphenationString;
AtomicString hyphenationLocale;
+ AtomicString textEmphasisCustomMark;
+
private:
StyleRareInheritedData();
StyleRareInheritedData(const StyleRareInheritedData&);
diff --git a/WebCore/rendering/style/StyleRareNonInheritedData.h b/WebCore/rendering/style/StyleRareNonInheritedData.h
index a53eee7..89437f6 100644
--- a/WebCore/rendering/style/StyleRareNonInheritedData.h
+++ b/WebCore/rendering/style/StyleRareNonInheritedData.h
@@ -103,7 +103,7 @@ public:
unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added.
unsigned m_appearance : 6; // EAppearance
unsigned m_borderFit : 1; // EBorderFit
- unsigned m_textCombine : 2; // CSS3 text-combine properties
+ unsigned m_textCombine : 1; // CSS3 text-combine properties
short m_counterIncrement;
short m_counterReset;