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

Unified Diff: third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.cpp

Issue 1366903002: Make error-handling for feColorMatrix consistent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/svg/SVGFEColorMatrixElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.cpp b/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.cpp
index 136614c8fabbc106f1015af0497f175511cd294c..8235b8137eff7e4f1e16c45fb00a89dd8b93368a 100644
--- a/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.cpp
@@ -97,37 +97,8 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBui
if (!input1)
return nullptr;
- Vector<float> filterValues;
ColorMatrixType filterType = m_type->currentValue()->enumValue();
-
- // Use defaults if values is empty (SVG 1.1 15.10).
- if (!hasAttribute(SVGNames::valuesAttr)) {
- switch (filterType) {
- case FECOLORMATRIX_TYPE_MATRIX:
- for (size_t i = 0; i < 20; i++)
- filterValues.append((i % 6) ? 0 : 1);
- break;
- case FECOLORMATRIX_TYPE_HUEROTATE:
- filterValues.append(0);
- break;
- case FECOLORMATRIX_TYPE_SATURATE:
- filterValues.append(1);
- break;
- default:
- break;
- }
- } else {
- RefPtrWillBeRawPtr<SVGNumberList> values = m_values->currentValue();
- size_t size = values->length();
-
- if ((filterType == FECOLORMATRIX_TYPE_MATRIX && size != 20)
- || (filterType == FECOLORMATRIX_TYPE_HUEROTATE && size != 1)
- || (filterType == FECOLORMATRIX_TYPE_SATURATE && size != 1))
- return nullptr;
-
- filterValues = values->toFloatVector();
- }
-
+ Vector<float> filterValues = m_values->currentValue()->toFloatVector();
RefPtrWillBeRawPtr<FilterEffect> effect = FEColorMatrix::create(filter, filterType, filterValues);
effect->inputEffects().append(input1);
return effect.release();

Powered by Google App Engine
This is Rietveld 408576698