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

Unified Diff: third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp

Issue 2609803002: Use ShadowData in DropShadowFilterOperation (Closed)
Patch Set: Fix blend(...) order Created 3 years, 12 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/resolver/FilterOperationResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp b/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp
index c7dde59b21da6ba0d31ee5eca23aafdafd310dbc..74458c84a2802d5bb634b2b560a8820d08d631a5 100644
--- a/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp
@@ -32,8 +32,8 @@
#include "core/css/CSSFunctionValue.h"
#include "core/css/CSSPrimitiveValueMappings.h"
-#include "core/css/CSSShadowValue.h"
#include "core/css/CSSURIValue.h"
+#include "core/css/resolver/StyleBuilderConverter.h"
#include "core/css/resolver/StyleResolverState.h"
#include "core/frame/UseCounter.h"
@@ -200,18 +200,13 @@ FilterOperations FilterOperationResolver::createFilterOperations(
break;
}
case CSSValueDropShadow: {
- const CSSShadowValue& item = toCSSShadowValue(filterValue->item(0));
- IntPoint location(item.x->computeLength<int>(conversionData),
- item.y->computeLength<int>(conversionData));
- int blur =
- item.blur ? item.blur->computeLength<int>(conversionData) : 0;
- Color shadowColor = Color::black;
- if (item.color)
- shadowColor = state.document().textLinkColors().colorFromCSSValue(
- *item.color, state.style()->color());
-
+ ShadowData shadow =
+ StyleBuilderConverter::convertShadow(state, filterValue->item(0));
+ // TODO(fs): Resolve 'currentcolor' when constructing the filter chain.
+ if (shadow.color().isCurrentColor())
+ shadow.overrideColor(state.style()->color());
operations.operations().push_back(
- DropShadowFilterOperation::create(location, blur, shadowColor));
+ DropShadowFilterOperation::create(shadow));
break;
}
default:

Powered by Google App Engine
This is Rietveld 408576698