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

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

Issue 1375793003: Update error-handling for fe*Lighting and feTurbulence (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/SVGFESpecularLightingElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.cpp b/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.cpp
index 9184b4300fb25a1e4f9df2c1c185d66cb1f8e3cd..09f2cc530576208c59ab9401c2cb3f218c6daf29 100644
--- a/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.cpp
@@ -132,10 +132,6 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilt
if (!input1)
return nullptr;
- SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this);
- if (!lightNode)
- return nullptr;
-
LayoutObject* layoutObject = this->layoutObject();
if (!layoutObject)
return nullptr;
@@ -143,9 +139,15 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilt
ASSERT(layoutObject->style());
Color color = layoutObject->style()->svgStyle().lightingColor();
- RefPtr<LightSource> lightSource = lightNode->lightSource(filter);
- RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, m_surfaceScale->currentValue()->value(), m_specularConstant->currentValue()->value(),
- m_specularExponent->currentValue()->value(), lightSource.release());
+ const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this);
+ RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter) : nullptr;
+
+ RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter,
+ color,
+ m_surfaceScale->currentValue()->value(),
+ m_specularConstant->currentValue()->value(),
+ m_specularExponent->currentValue()->value(),
+ lightSource.release());
effect->inputEffects().append(input1);
return effect.release();
}

Powered by Google App Engine
This is Rietveld 408576698