Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2394273006: Add CSS support for text-decoration-skip (Closed)
Patch Set: Basic test for parsing, readback and inheritance added Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index fec10203173ff8cebf0275591c6d2c04a838e830..5b3292d347fe214a74d3cfa6aabb875d0a0aaf84 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -1121,6 +1121,19 @@ static CSSValue* valueForTextDecorationStyle(
return CSSInitialValue::create();
}
+static CSSValue* valueForTextDecorationSkip(
+ TextDecorationSkip textDecorationSkip) {
+ CSSValueList* list = CSSValueList::createSpaceSeparated();
+ if (textDecorationSkip & TextDecorationSkipObjects)
+ list->append(*CSSIdentifierValue::create(CSSValueObjects));
+ if (textDecorationSkip & TextDecorationSkipInk)
+ list->append(*CSSIdentifierValue::create(CSSValueInk));
+
+ if (!list->length())
+ return CSSIdentifierValue::create(CSSValueObjects);
Timothy Loh 2016/10/11 00:00:33 Maybe better to DCHECK(list->length()) for now ins
drott 2016/10/11 07:15:27 Done.
+ return list;
+}
+
static CSSValue* touchActionFlagsToCSSValue(TouchAction touchAction) {
CSSValueList* list = CSSValueList::createSpaceSeparated();
if (touchAction == TouchActionAuto) {
@@ -2674,6 +2687,8 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
// Fall through.
case CSSPropertyTextDecorationLine:
return renderTextDecorationFlagsToCSSValue(style.getTextDecoration());
+ case CSSPropertyTextDecorationSkip:
+ return valueForTextDecorationSkip(style.getTextDecorationSkip());
case CSSPropertyTextDecorationStyle:
return valueForTextDecorationStyle(style.getTextDecorationStyle());
case CSSPropertyTextDecorationColor:

Powered by Google App Engine
This is Rietveld 408576698