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

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

Issue 1378163003: Use initial values for flood/lighting-color/flood-opacity when detached Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/svg/SVGFEFloodElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGFEFloodElement.cpp b/third_party/WebKit/Source/core/svg/SVGFEFloodElement.cpp
index 663a9807fa181a56a8e2a8479bd40289d5304bc2..3f2a25d9ad50e9e15abea316dc97ff526a0236d4 100644
--- a/third_party/WebKit/Source/core/svg/SVGFEFloodElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGFEFloodElement.cpp
@@ -53,16 +53,15 @@ bool SVGFEFloodElement::setFilterEffectAttribute(FilterEffect* effect, const Qua
PassRefPtrWillBeRawPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter* filter)
{
- LayoutObject* layoutObject = this->layoutObject();
- if (!layoutObject)
- return nullptr;
-
- ASSERT(layoutObject->style());
- const SVGComputedStyle& svgStyle = layoutObject->style()->svgStyle();
-
- Color color = svgStyle.floodColor();
- float opacity = svgStyle.floodOpacity();
+ Color color = Color::black;
+ float opacity = 1;
+ if (LayoutObject* layoutObject = this->layoutObject()) {
+ ASSERT(layoutObject->style());
+ const SVGComputedStyle& svgStyle = layoutObject->styleRef().svgStyle();
+ color = svgStyle.floodColor();
+ opacity = svgStyle.floodOpacity();
+ }
return FEFlood::create(filter, color, opacity);
}

Powered by Google App Engine
This is Rietveld 408576698