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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 SVGElement::InvalidationGuard invalidationGuard(this); 69 SVGElement::InvalidationGuard invalidationGuard(this);
70 invalidate(); 70 invalidate();
71 return; 71 return;
72 } 72 }
73 73
74 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); 74 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
75 } 75 }
76 76
77 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuil der* filterBuilder, Filter* filter) 77 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuil der* filterBuilder, Filter* filter)
78 { 78 {
79 LayoutObject* layoutObject = this->layoutObject(); 79 Color color = Color::black;
80 if (!layoutObject) 80 float opacity = 1;
81 return nullptr; 81 if (LayoutObject* layoutObject = this->layoutObject()) {
82 ASSERT(layoutObject->style());
83 const SVGComputedStyle& svgStyle = layoutObject->styleRef().svgStyle();
82 84
83 ASSERT(layoutObject->style()); 85 color = svgStyle.floodColor();
84 const SVGComputedStyle& svgStyle = layoutObject->style()->svgStyle(); 86 opacity = svgStyle.floodOpacity();
85 87 }
86 Color color = svgStyle.floodColor();
87 float opacity = svgStyle.floodOpacity();
88 88
89 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value())); 89 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value()));
90 if (!input1) 90 if (!input1)
91 return nullptr; 91 return nullptr;
92 92
93 // Clamp std.dev. to non-negative. (See SVGFEGaussianBlurElement::build) 93 // Clamp std.dev. to non-negative. (See SVGFEGaussianBlurElement::build)
94 float stdDevX = std::max(0.0f, stdDeviationX()->currentValue()->value()); 94 float stdDevX = std::max(0.0f, stdDeviationX()->currentValue()->value());
95 float stdDevY = std::max(0.0f, stdDeviationY()->currentValue()->value()); 95 float stdDevY = std::max(0.0f, stdDeviationY()->currentValue()->value());
96 RefPtrWillBeRawPtr<FilterEffect> effect = FEDropShadow::create(filter, stdDe vX, stdDevY, m_dx->currentValue()->value(), m_dy->currentValue()->value(), color , opacity); 96 RefPtrWillBeRawPtr<FilterEffect> effect = FEDropShadow::create(filter, stdDe vX, stdDevY, m_dx->currentValue()->value(), m_dy->currentValue()->value(), color , opacity);
97 effect->inputEffects().append(input1); 97 effect->inputEffects().append(input1);
98 return effect.release(); 98 return effect.release();
99 } 99 }
100 100
101 } // namespace blink 101 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698