Title: [198316] trunk/Source/WebCore
- Revision
- 198316
- Author
- [email protected]
- Date
- 2016-03-16 20:36:28 -0700 (Wed, 16 Mar 2016)
Log Message
SVG tear offs should return a const reference if possible
https://bugs.webkit.org/show_bug.cgi?id=153214
Patch by Nikos Andronikos <[email protected]> on 2016-03-16
Reviewed by Alex Christensen.
A smaller change than expected because the returned reference is being copied into a value in additional locations that baseVal and animVal are used.
No new tests as there is no change in behaviour.
* svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
* svg/properties/SVGAnimatedStaticPropertyTearOff.h:
(WebCore::SVGAnimatedStaticPropertyTearOff::baseVal):
(WebCore::SVGAnimatedStaticPropertyTearOff::animVal):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (198315 => 198316)
--- trunk/Source/WebCore/ChangeLog 2016-03-17 02:49:16 UTC (rev 198315)
+++ trunk/Source/WebCore/ChangeLog 2016-03-17 03:36:28 UTC (rev 198316)
@@ -1,3 +1,19 @@
+2016-03-16 Nikos Andronikos <[email protected]>
+
+ SVG tear offs should return a const reference if possible
+ https://bugs.webkit.org/show_bug.cgi?id=153214
+
+ Reviewed by Alex Christensen.
+
+ A smaller change than expected because the returned reference is being copied into a value in additional locations that baseVal and animVal are used.
+
+ No new tests as there is no change in behaviour.
+
+ * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
+ * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
+ (WebCore::SVGAnimatedStaticPropertyTearOff::baseVal):
+ (WebCore::SVGAnimatedStaticPropertyTearOff::animVal):
+
2016-03-16 Chris Dumez <[email protected]>
Unreviewed, partial roll out of r197254.
Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h (198315 => 198316)
--- trunk/Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h 2016-03-17 02:49:16 UTC (rev 198315)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h 2016-03-17 03:36:28 UTC (rev 198316)
@@ -29,9 +29,9 @@
template<typename EnumType>
class SVGAnimatedEnumerationPropertyTearOff final : public SVGAnimatedStaticPropertyTearOff<unsigned> {
public:
- unsigned& baseVal() override
+ const unsigned& baseVal() override
{
- unsigned& baseVal = SVGAnimatedStaticPropertyTearOff::baseVal();
+ const unsigned& baseVal = SVGAnimatedStaticPropertyTearOff::baseVal();
if (baseVal > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue())
return m_outOfRangeEnumValue;
@@ -39,9 +39,9 @@
return baseVal;
}
- unsigned& animVal() override
+ const unsigned& animVal() override
{
- unsigned& animVal = SVGAnimatedStaticPropertyTearOff::animVal();
+ const unsigned& animVal = SVGAnimatedStaticPropertyTearOff::animVal();
if (animVal > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue())
return m_outOfRangeEnumValue;
Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h (198315 => 198316)
--- trunk/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h 2016-03-17 02:49:16 UTC (rev 198315)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h 2016-03-17 03:36:28 UTC (rev 198316)
@@ -31,12 +31,12 @@
public:
typedef PropertyType ContentType;
- virtual PropertyType& baseVal()
+ virtual const PropertyType& baseVal()
{
return m_property;
}
- virtual PropertyType& animVal()
+ virtual const PropertyType& animVal()
{
if (m_animatedProperty)
return *m_animatedProperty;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes