Changeset 73219 in webkit
- Timestamp:
- Dec 2, 2010, 4:36:15 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r73218 r73219 1 2010-12-02 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 Test parsing of the text-emphasis CSS properties 6 https://bugs.webkit.org/show_bug.cgi?id=48539 7 8 * fast/css/parsing-text-emphasis-expected.txt: Added. 9 * fast/css/parsing-text-emphasis.html: Added. 10 1 11 2010-12-02 Victor Wang <victorw@chromium.org> 2 12 -
trunk/WebCore/ChangeLog
r73217 r73219 1 2010-12-02 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 CSS support for the text-emphasis properties 6 https://bugs.webkit.org/show_bug.cgi?id=48539 7 8 Test: fast/css/parsing-text-emphasis.html 9 10 * css/CSSComputedStyleDeclaration.cpp: 11 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added text-emphasis-color, 12 text-emphasis-position and text-emphasis-style. Left the text-emphasis shorthand unsupported. 13 * css/CSSParser.cpp: 14 (WebCore::CSSParser::parseValue): Parse the properties. 15 (WebCore::CSSParser::parseTextEmphasisStyle): Added. 16 * css/CSSParser.h: 17 * css/CSSPrimitiveValueMappings.h: 18 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added TextEmphasisPosition, TextEmphasisFill 19 and TextEmphasisMark mappings. 20 (WebCore::CSSPrimitiveValue::operator TextEmphasisPosition): Added. 21 (WebCore::CSSPrimitiveValue::operator TextEmphasisFill): Added. 22 (WebCore::CSSPrimitiveValue::operator TextEmphasisMark): Added. 23 * css/CSSPropertyLonghand.cpp: 24 (WebCore::initShorthandMap): Added the text-emphasis shorthand. 25 * css/CSSPropertyNames.in: Added -webkit-text-emphasis, -webkit-text-emphasis-color, 26 -webkit-text-emphasis-position, and -webkit-text-emphasis-style. 27 * css/CSSStyleSelector.cpp: 28 (WebCore::isValidVisitedLinkProperty): Added text-emphasis-color. 29 (WebCore::CSSStyleSelector::applyProperty): Handle the properties. 30 * css/CSSValueKeywords.in: Added 'over' and 'under' for text-emphasis-position. Added 'dot', 31 'double-circle', 'triangle', 'sesame', 'filled' and 'open' for text-emphasis-style. 32 * rendering/style/RenderStyle.cpp: 33 (WebCore::RenderStyle::colorIncludingFallback): Handle text-emphasis-color. 34 (WebCore::RenderStyle::textEmphasisMark): Added. Maps the fake 'auto' value to 'dot' or 35 'sesame' based on writing direction. 36 * rendering/style/RenderStyle.h: Added accessors. 37 (WebCore::InheritedFlags::textEmphasisFill): 38 (WebCore::InheritedFlags::textEmphasisCustomMark): 39 (WebCore::InheritedFlags::textEmphasisPosition): 40 (WebCore::InheritedFlags::setTextEmphasisColor): 41 (WebCore::InheritedFlags::setTextEmphasisFill): 42 (WebCore::InheritedFlags::setTextEmphasisMark): 43 (WebCore::InheritedFlags::setTextEmphasisCustomMark): 44 (WebCore::InheritedFlags::setTextEmphasisPosition): 45 (WebCore::InheritedFlags::initialTextEmphasisColor): 46 (WebCore::InheritedFlags::initialTextEmphasisFill): 47 (WebCore::InheritedFlags::initialTextEmphasisMark): 48 (WebCore::InheritedFlags::initialTextEmphasisCustomMark): 49 (WebCore::InheritedFlags::initialTextEmphasisPosition): 50 (WebCore::InheritedFlags::textEmphasisColor): 51 * rendering/style/RenderStyleConstants.h: 52 * rendering/style/StyleRareInheritedData.cpp: 53 (WebCore::StyleRareInheritedData::StyleRareInheritedData): 54 (WebCore::StyleRareInheritedData::operator==): 55 * rendering/style/StyleRareInheritedData.h: 56 1 57 2010-12-02 Chris Marrin <cmarrin@apple.com> 2 58 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r72500 r73219 1219 1219 case CSSPropertyWebkitTextFillColor: 1220 1220 return currentColorOrValidColor(style.get(), style->textFillColor()); 1221 case CSSPropertyWebkitTextEmphasisColor: 1222 return currentColorOrValidColor(style.get(), style->textEmphasisColor()); 1223 case CSSPropertyWebkitTextEmphasisPosition: 1224 return CSSPrimitiveValue::create(style->textEmphasisPosition()); 1225 case CSSPropertyWebkitTextEmphasisStyle: 1226 switch (style->textEmphasisMark()) { 1227 case TextEmphasisMarkNone: 1228 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1229 case TextEmphasisMarkCustom: 1230 return CSSPrimitiveValue::create(style->textEmphasisCustomMark(), CSSPrimitiveValue::CSS_STRING); 1231 case TextEmphasisMarkAuto: 1232 ASSERT_NOT_REACHED(); 1233 // Fall through 1234 case TextEmphasisMarkDot: 1235 case TextEmphasisMarkCircle: 1236 case TextEmphasisMarkDoubleCircle: 1237 case TextEmphasisMarkTriangle: 1238 case TextEmphasisMarkSesame: { 1239 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1240 list->append(CSSPrimitiveValue::create(style->textEmphasisFill())); 1241 list->append(CSSPrimitiveValue::create(style->textEmphasisMark())); 1242 return list.release(); 1243 } 1244 } 1221 1245 case CSSPropertyTextIndent: 1222 1246 return CSSPrimitiveValue::create(style->textIndent()); … … 1556 1580 1557 1581 /* Unimplemented CSS 3 properties (including CSS3 shorthand properties) */ 1582 case CSSPropertyWebkitTextEmphasis: 1558 1583 case CSSPropertyTextLineThrough: 1559 1584 case CSSPropertyTextLineThroughColor: -
trunk/WebCore/css/CSSParser.cpp
r72776 r73219 828 828 case CSSPropertyTextOverlineColor: 829 829 case CSSPropertyWebkitColumnRuleColor: 830 case CSSPropertyWebkitTextEmphasisColor: 830 831 case CSSPropertyWebkitTextFillColor: 831 832 case CSSPropertyWebkitTextStrokeColor: … … 1782 1783 validPrimitive = true; 1783 1784 break; 1785 1786 case CSSPropertyWebkitTextEmphasis: { 1787 const int properties[] = { CSSPropertyWebkitTextEmphasisStyle, CSSPropertyWebkitTextEmphasisColor }; 1788 return parseShorthand(propId, properties, WTF_ARRAY_LENGTH(properties), important); 1789 } 1790 1791 case CSSPropertyWebkitTextEmphasisPosition: 1792 if (id == CSSValueOver || id == CSSValueUnder) 1793 validPrimitive = true; 1794 break; 1795 1796 case CSSPropertyWebkitTextEmphasisStyle: 1797 return parseTextEmphasisStyle(important); 1784 1798 1785 1799 #if ENABLE(SVG) … … 5081 5095 } 5082 5096 5097 bool CSSParser::parseTextEmphasisStyle(bool important) 5098 { 5099 unsigned valueListSize = m_valueList->size(); 5100 5101 RefPtr<CSSPrimitiveValue> fill; 5102 RefPtr<CSSPrimitiveValue> shape; 5103 5104 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueList->next()) { 5105 if (value->unit == CSSPrimitiveValue::CSS_STRING) { 5106 if (fill || shape || (valueListSize != 1 && !inShorthand())) 5107 return false; 5108 addProperty(CSSPropertyWebkitTextEmphasisStyle, CSSPrimitiveValue::create(value->string, CSSPrimitiveValue::CSS_STRING), important); 5109 m_valueList->next(); 5110 return true; 5111 } 5112 5113 if (value->id == CSSValueNone) { 5114 if (fill || shape || (valueListSize != 1 && !inShorthand())) 5115 return false; 5116 addProperty(CSSPropertyWebkitTextEmphasisStyle, CSSPrimitiveValue::createIdentifier(CSSValueNone), important); 5117 m_valueList->next(); 5118 return true; 5119 } 5120 5121 if (value->id == CSSValueOpen || value->id == CSSValueFilled) { 5122 if (fill) 5123 return false; 5124 fill = CSSPrimitiveValue::createIdentifier(value->id); 5125 } else if (value->id == CSSValueDot || value->id == CSSValueCircle || value->id == CSSValueDoubleCircle || value->id == CSSValueTriangle || value->id == CSSValueSesame) { 5126 if (shape) 5127 return false; 5128 shape = CSSPrimitiveValue::createIdentifier(value->id); 5129 } else if (!inShorthand()) 5130 return false; 5131 else 5132 break; 5133 } 5134 5135 if (fill && shape) { 5136 RefPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated(); 5137 parsedValues->append(fill.release()); 5138 parsedValues->append(shape.release()); 5139 addProperty(CSSPropertyWebkitTextEmphasisStyle, parsedValues.release(), important); 5140 return true; 5141 } 5142 if (fill) { 5143 addProperty(CSSPropertyWebkitTextEmphasisStyle, fill.release(), important); 5144 return true; 5145 } 5146 if (shape) { 5147 addProperty(CSSPropertyWebkitTextEmphasisStyle, shape.release(), important); 5148 return true; 5149 } 5150 5151 return false; 5152 } 5153 5083 5154 static inline int yyerror(const char*) { return 1; } 5084 5155 -
trunk/WebCore/css/CSSParser.h
r72776 r73219 162 162 bool parsePerspectiveOrigin(int propId, int& propId1, int& propId2, RefPtr<CSSValue>&, RefPtr<CSSValue>&); 163 163 164 bool parseTextEmphasisStyle(bool important); 165 164 166 int yyparse(); 165 167 -
trunk/WebCore/css/CSSPrimitiveValueMappings.h
r71218 r73219 2073 2073 } 2074 2074 2075 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisPosition position) 2076 : m_type(CSS_IDENT) 2077 , m_hasCachedCSSText(false) 2078 { 2079 switch (position) { 2080 case TextEmphasisPositionOver: 2081 m_value.ident = CSSValueOver; 2082 break; 2083 case TextEmphasisPositionUnder: 2084 m_value.ident = CSSValueUnder; 2085 break; 2086 } 2087 } 2088 2089 template<> inline CSSPrimitiveValue::operator TextEmphasisPosition() const 2090 { 2091 switch (m_value.ident) { 2092 case CSSValueOver: 2093 return TextEmphasisPositionOver; 2094 case CSSValueUnder: 2095 return TextEmphasisPositionUnder; 2096 default: 2097 ASSERT_NOT_REACHED(); 2098 return TextEmphasisPositionOver; 2099 } 2100 } 2101 2102 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisFill fill) 2103 : m_type(CSS_IDENT) 2104 , m_hasCachedCSSText(false) 2105 { 2106 switch (fill) { 2107 case TextEmphasisFillFilled: 2108 m_value.ident = CSSValueFilled; 2109 break; 2110 case TextEmphasisFillOpen: 2111 m_value.ident = CSSValueOpen; 2112 break; 2113 } 2114 } 2115 2116 template<> inline CSSPrimitiveValue::operator TextEmphasisFill() const 2117 { 2118 switch (m_value.ident) { 2119 case CSSValueFilled: 2120 return TextEmphasisFillFilled; 2121 case CSSValueOpen: 2122 return TextEmphasisFillOpen; 2123 default: 2124 ASSERT_NOT_REACHED(); 2125 return TextEmphasisFillFilled; 2126 } 2127 } 2128 2129 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisMark mark) 2130 : m_type(CSS_IDENT) 2131 , m_hasCachedCSSText(false) 2132 { 2133 switch (mark) { 2134 case TextEmphasisMarkDot: 2135 m_value.ident = CSSValueDot; 2136 break; 2137 case TextEmphasisMarkCircle: 2138 m_value.ident = CSSValueCircle; 2139 break; 2140 case TextEmphasisMarkDoubleCircle: 2141 m_value.ident = CSSValueDoubleCircle; 2142 break; 2143 case TextEmphasisMarkTriangle: 2144 m_value.ident = CSSValueTriangle; 2145 break; 2146 case TextEmphasisMarkSesame: 2147 m_value.ident = CSSValueSesame; 2148 break; 2149 case TextEmphasisMarkNone: 2150 case TextEmphasisMarkAuto: 2151 case TextEmphasisMarkCustom: 2152 ASSERT_NOT_REACHED(); 2153 m_value.ident = CSSValueNone; 2154 break; 2155 } 2156 } 2157 2158 template<> inline CSSPrimitiveValue::operator TextEmphasisMark() const 2159 { 2160 switch (m_value.ident) { 2161 case CSSValueNone: 2162 return TextEmphasisMarkNone; 2163 case CSSValueDot: 2164 return TextEmphasisMarkDot; 2165 case CSSValueCircle: 2166 return TextEmphasisMarkCircle; 2167 case CSSValueDoubleCircle: 2168 return TextEmphasisMarkDoubleCircle; 2169 case CSSValueTriangle: 2170 return TextEmphasisMarkTriangle; 2171 case CSSValueSesame: 2172 return TextEmphasisMarkSesame; 2173 default: 2174 ASSERT_NOT_REACHED(); 2175 return TextEmphasisMarkNone; 2176 } 2177 } 2178 2075 2179 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e) 2076 2180 : m_type(CSS_IDENT) -
trunk/WebCore/css/CSSPropertyLonghand.cpp
r72500 r73219 208 208 SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyWebkitTransformOrigin, transformOriginProperties); 209 209 210 static const int textEmphasisProperties[] = { 211 CSSPropertyWebkitTextEmphasisColor, 212 CSSPropertyWebkitTextEmphasisStyle 213 }; 214 SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyWebkitTextEmphasis, textEmphasisProperties); 215 210 216 #undef SET_SHORTHAND_MAP_ENTRY 211 217 } -
trunk/WebCore/css/CSSPropertyNames.in
r72116 r73219 279 279 -webkit-text-combine 280 280 -webkit-text-decorations-in-effect 281 -webkit-text-emphasis 282 -webkit-text-emphasis-color 283 -webkit-text-emphasis-position 284 -webkit-text-emphasis-style 281 285 -webkit-text-fill-color 282 286 -webkit-text-security -
trunk/WebCore/css/CSSStyleSelector.cpp
r72814 r73219 3035 3035 case CSSPropertyOutlineColor: 3036 3036 case CSSPropertyWebkitColumnRuleColor: 3037 case CSSPropertyWebkitTextEmphasisColor: 3037 3038 case CSSPropertyWebkitTextFillColor: 3038 3039 case CSSPropertyWebkitTextStrokeColor: … … 3512 3513 case CSSPropertyWebkitColumnRuleColor: 3513 3514 case CSSPropertyWebkitTextStrokeColor: 3515 case CSSPropertyWebkitTextEmphasisColor: 3514 3516 case CSSPropertyWebkitTextFillColor: { 3515 3517 Color col; … … 3524 3526 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyWebkitColumnRuleColor, columnRuleColor, color, ColumnRuleColor) 3525 3527 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyWebkitTextStrokeColor, textStrokeColor, color, TextStrokeColor) 3528 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyWebkitTextEmphasisColor, textEmphasisColor, color, TextEmphasisColor) 3526 3529 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyWebkitTextFillColor, textFillColor, color, TextFillColor) 3527 3530 return; … … 3566 3569 case CSSPropertyWebkitTextStrokeColor: 3567 3570 m_style->setTextStrokeColor(col); 3571 break; 3572 case CSSPropertyWebkitTextEmphasisColor: 3573 m_style->setTextEmphasisColor(col); 3568 3574 break; 3569 3575 case CSSPropertyWebkitTextFillColor: … … 5523 5529 case CSSPropertyWebkitTextDecorationsInEffect: 5524 5530 case CSSPropertyWebkitTextStroke: 5531 case CSSPropertyWebkitTextEmphasis: 5525 5532 return; 5526 5533 #if ENABLE(WCSS) … … 5555 5562 case CSSPropertyWebkitTextCombine: 5556 5563 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(textCombine, TextCombine) 5564 return; 5565 5566 case CSSPropertyWebkitTextEmphasisPosition: 5567 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(textEmphasisPosition, TextEmphasisPosition) 5568 return; 5569 5570 case CSSPropertyWebkitTextEmphasisStyle: 5571 HANDLE_INHERIT_AND_INITIAL(textEmphasisFill, TextEmphasisFill) 5572 HANDLE_INHERIT_AND_INITIAL(textEmphasisMark, TextEmphasisMark) 5573 HANDLE_INHERIT_AND_INITIAL(textEmphasisCustomMark, TextEmphasisCustomMark) 5574 if (isInherit || isInitial) 5575 return; 5576 5577 if (value->isValueList()) { 5578 CSSValueList* list = static_cast<CSSValueList*>(value); 5579 ASSERT(list->length() == 2); 5580 if (list->length() != 2) 5581 return; 5582 for (unsigned i = 0; i < 2; ++i) { 5583 ASSERT(list->itemWithoutBoundsCheck(i)->isPrimitiveValue()); 5584 CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(list->itemWithoutBoundsCheck(i)); 5585 if (value->getIdent() == CSSValueFilled || value->getIdent() == CSSValueOpen) 5586 m_style->setTextEmphasisFill(*value); 5587 else 5588 m_style->setTextEmphasisMark(*value); 5589 } 5590 m_style->setTextEmphasisCustomMark(nullAtom); 5591 return; 5592 } 5593 5594 if (!primitiveValue) 5595 return; 5596 5597 if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_STRING) { 5598 m_style->setTextEmphasisFill(TextEmphasisFillFilled); 5599 m_style->setTextEmphasisMark(TextEmphasisMarkCustom); 5600 m_style->setTextEmphasisCustomMark(primitiveValue->getStringValue()); 5601 return; 5602 } 5603 5604 m_style->setTextEmphasisCustomMark(nullAtom); 5605 5606 if (primitiveValue->getIdent() == CSSValueFilled || primitiveValue->getIdent() == CSSValueOpen) { 5607 m_style->setTextEmphasisFill(*primitiveValue); 5608 m_style->setTextEmphasisMark(TextEmphasisMarkAuto); 5609 } else { 5610 m_style->setTextEmphasisFill(TextEmphasisFillFilled); 5611 m_style->setTextEmphasisMark(*primitiveValue); 5612 } 5613 5557 5614 return; 5558 5615 -
trunk/WebCore/css/CSSValueKeywords.in
r71218 r73219 769 769 cluster 770 770 upright 771 772 # -webkit-text-emphasis-position 773 over 774 under 775 776 # -webkit-text-emphasis-style 777 filled 778 open 779 dot 780 # circle 781 double-circle 782 triangle 783 sesame -
trunk/WebCore/rendering/style/RenderStyle.cpp
r71700 r73219 403 403 rareInheritedData->hyphens != other->rareInheritedData->hyphens || 404 404 rareInheritedData->hyphenationString != other->rareInheritedData->hyphenationString || 405 rareInheritedData->hyphenationLocale != other->rareInheritedData->hyphenationLocale) 405 rareInheritedData->hyphenationLocale != other->rareInheritedData->hyphenationLocale || 406 rareInheritedData->textEmphasisMark != other->rareInheritedData->textEmphasisMark || 407 rareInheritedData->textEmphasisPosition != other->rareInheritedData->textEmphasisPosition || 408 rareInheritedData->textEmphasisCustomMark != other->rareInheritedData->textEmphasisCustomMark) 406 409 return StyleDifferenceLayout; 407 410 … … 554 557 rareNonInheritedData->m_borderFit != other->rareNonInheritedData->m_borderFit || 555 558 rareInheritedData->textFillColor != other->rareInheritedData->textFillColor || 556 rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor) 559 rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor || 560 rareInheritedData->textEmphasisColor != other->rareInheritedData->textEmphasisColor || 561 rareInheritedData->textEmphasisFill != other->rareInheritedData->textEmphasisFill) 557 562 return StyleDifferenceRepaint; 558 563 … … 1068 1073 result = columnRuleColor(); 1069 1074 break; 1075 case CSSPropertyWebkitTextEmphasisColor: 1076 result = textEmphasisColor(); 1077 break; 1070 1078 case CSSPropertyWebkitTextFillColor: 1071 1079 result = textFillColor(); … … 1409 1417 } 1410 1418 1419 TextEmphasisMark RenderStyle::textEmphasisMark() const 1420 { 1421 TextEmphasisMark mark = static_cast<TextEmphasisMark>(rareInheritedData->textEmphasisMark); 1422 if (mark != TextEmphasisMarkAuto) 1423 return mark; 1424 1425 if (isHorizontalWritingMode()) 1426 return TextEmphasisMarkDot; 1427 1428 return TextEmphasisMarkSesame; 1429 } 1430 1411 1431 } // namespace WebCore -
trunk/WebCore/rendering/style/RenderStyle.h
r73189 r73219 714 714 float transformOriginZ() const { return rareNonInheritedData->m_transform->m_z; } 715 715 bool hasTransform() const { return !rareNonInheritedData->m_transform->m_operations.operations().isEmpty(); } 716 717 TextEmphasisFill textEmphasisFill() const { return static_cast<TextEmphasisFill>(rareInheritedData->textEmphasisFill); } 718 TextEmphasisMark textEmphasisMark() const; 719 const AtomicString& textEmphasisCustomMark() const { return rareInheritedData->textEmphasisCustomMark; } 720 TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextEmphasisPosition>(rareInheritedData->textEmphasisPosition); } 716 721 717 722 // Return true if any transform related property (currently transform, transformStyle3D or perspective) … … 1065 1070 void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); } 1066 1071 void setTextCombine(TextCombine v) { SET_VAR(rareNonInheritedData, m_textCombine, v); } 1072 void setTextEmphasisColor(const Color& c) { SET_VAR(rareInheritedData, textEmphasisColor, c) } 1073 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); } 1074 void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); } 1075 void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInheritedData, textEmphasisCustomMark, mark); } 1076 void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareInheritedData, textEmphasisPosition, position); } 1067 1077 // End CSS3 Setters 1068 1078 … … 1277 1287 static Length initialPerspectiveOriginY() { return Length(50.0, Percent); } 1278 1288 static Color initialBackgroundColor() { return Color::transparent; } 1289 static Color initialTextEmphasisColor() { return TextEmphasisFillFilled; } 1290 static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillFilled; } 1291 static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; } 1292 static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom; } 1293 static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver; } 1279 1294 1280 1295 // Keep these at the end. … … 1309 1324 const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); } 1310 1325 const Color& outlineColor() const { return m_background->outline().color(); } 1326 const Color& textEmphasisColor() const { return rareInheritedData->textEmphasisColor; } 1311 1327 const Color& textFillColor() const { return rareInheritedData->textFillColor; } 1312 1328 const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; } -
trunk/WebCore/rendering/style/RenderStyleConstants.h
r71218 r73219 421 421 422 422 enum ESpeak { SpeakNone, SpeakNormal, SpeakSpellOut, SpeakDigits, SpeakLiteralPunctuation, SpeakNoPunctuation }; 423 423 424 enum TextEmphasisFill { TextEmphasisFillFilled, TextEmphasisFillOpen }; 425 426 enum TextEmphasisMark { TextEmphasisMarkNone, TextEmphasisMarkAuto, TextEmphasisMarkDot, TextEmphasisMarkCircle, TextEmphasisMarkDoubleCircle, TextEmphasisMarkTriangle, TextEmphasisMarkSesame, TextEmphasisMarkCustom }; 427 428 enum TextEmphasisPosition { TextEmphasisPositionOver, TextEmphasisPositionUnder }; 429 424 430 } // namespace WebCore 425 431 -
trunk/WebCore/rendering/style/StyleRareInheritedData.cpp
r70143 r73219 47 47 , speak(SpeakNormal) 48 48 , hyphens(HyphensManual) 49 , textEmphasisFill(TextEmphasisFillFilled) 50 , textEmphasisMark(TextEmphasisMarkNone) 51 , textEmphasisPosition(TextEmphasisPositionOver) 49 52 { 50 53 } … … 55 58 , textStrokeWidth(o.textStrokeWidth) 56 59 , textFillColor(o.textFillColor) 60 , textEmphasisColor(o.textEmphasisColor) 57 61 , textShadow(o.textShadow ? new ShadowData(*o.textShadow) : 0) 58 62 , highlight(o.highlight) … … 74 78 , speak(o.speak) 75 79 , hyphens(o.hyphens) 80 , textEmphasisFill(o.textEmphasisFill) 81 , textEmphasisMark(o.textEmphasisMark) 82 , textEmphasisPosition(o.textEmphasisPosition) 76 83 , hyphenationString(o.hyphenationString) 77 84 , hyphenationLocale(o.hyphenationLocale) 85 , textEmphasisCustomMark(o.textEmphasisCustomMark) 78 86 { 79 87 } … … 98 106 && textStrokeWidth == o.textStrokeWidth 99 107 && textFillColor == o.textFillColor 108 && textEmphasisColor == o.textEmphasisColor 100 109 && shadowDataEquivalent(o) 101 110 && highlight == o.highlight … … 117 126 && speak == o.speak 118 127 && hyphens == o.hyphens 128 && textEmphasisFill == o.textEmphasisFill 129 && textEmphasisMark == o.textEmphasisMark 130 && textEmphasisPosition == o.textEmphasisPosition 119 131 && hyphenationString == o.hyphenationString 120 && hyphenationLocale == o.hyphenationLocale; 132 && hyphenationLocale == o.hyphenationLocale 133 && textEmphasisCustomMark == o.textEmphasisCustomMark; 121 134 } 122 135 -
trunk/WebCore/rendering/style/StyleRareInheritedData.h
r68680 r73219 56 56 float textStrokeWidth; 57 57 Color textFillColor; 58 Color textEmphasisColor; 58 59 59 60 ShadowData* textShadow; // Our text shadow information for shadowed text drawing. … … 80 81 unsigned speak : 3; // ESpeak 81 82 unsigned hyphens : 2; // Hyphens 83 unsigned textEmphasisFill : 1; // TextEmphasisFill 84 unsigned textEmphasisMark : 3; // TextEmphasisMark 85 unsigned textEmphasisPosition : 1; // TextEmphasisPosition 82 86 83 87 AtomicString hyphenationString; 84 88 AtomicString hyphenationLocale; 89 90 AtomicString textEmphasisCustomMark; 85 91 86 92 private:
Note:
See TracChangeset
for help on using the changeset viewer.