| Index: Source/core/svg/SVGLengthContext.cpp
|
| diff --git a/Source/core/svg/SVGLengthContext.cpp b/Source/core/svg/SVGLengthContext.cpp
|
| index 7fed6c20b7ad3dc05f658e311614e6d8e4ac4d66..0f4b7bee928b13745646bb2f76681146a8d0e94c 100644
|
| --- a/Source/core/svg/SVGLengthContext.cpp
|
| +++ b/Source/core/svg/SVGLengthContext.cpp
|
| @@ -47,43 +47,54 @@ SVGLengthContext::SVGLengthContext(const SVGElement* context, const FloatRect& v
|
| {
|
| }
|
|
|
| -FloatRect SVGLengthContext::resolveRectangle(const SVGElement* context, SVGUnitTypes::SVGUnitType type, const FloatRect& viewport, const SVGLength& x, const SVGLength& y, const SVGLength& width, const SVGLength& height)
|
| +FloatRect SVGLengthContext::resolveRectangle(const SVGElement* context, SVGUnitTypes::SVGUnitType type, const FloatRect& viewport, PassRefPtr<SVGLength> passX, PassRefPtr<SVGLength> passY, PassRefPtr<SVGLength> passWidth, PassRefPtr<SVGLength> passHeight)
|
| {
|
| + RefPtr<SVGLength> x = passX;
|
| + RefPtr<SVGLength> y = passY;
|
| + RefPtr<SVGLength> width = passWidth;
|
| + RefPtr<SVGLength> height = passHeight;
|
| +
|
| ASSERT(type != SVGUnitTypes::SVG_UNIT_TYPE_UNKNOWN);
|
| if (type == SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) {
|
| SVGLengthContext lengthContext(context);
|
| - return FloatRect(x.value(lengthContext), y.value(lengthContext), width.value(lengthContext), height.value(lengthContext));
|
| + return FloatRect(x->value(lengthContext), y->value(lengthContext), width->value(lengthContext), height->value(lengthContext));
|
| }
|
|
|
| SVGLengthContext lengthContext(context, viewport);
|
| - return FloatRect(x.value(lengthContext) + viewport.x(),
|
| - y.value(lengthContext) + viewport.y(),
|
| - width.value(lengthContext),
|
| - height.value(lengthContext));
|
| + return FloatRect(
|
| + x->value(lengthContext) + viewport.x(),
|
| + y->value(lengthContext) + viewport.y(),
|
| + width->value(lengthContext),
|
| + height->value(lengthContext));
|
| }
|
|
|
| -FloatPoint SVGLengthContext::resolvePoint(const SVGElement* context, SVGUnitTypes::SVGUnitType type, const SVGLength& x, const SVGLength& y)
|
| +FloatPoint SVGLengthContext::resolvePoint(const SVGElement* context, SVGUnitTypes::SVGUnitType type, PassRefPtr<SVGLength> passX, PassRefPtr<SVGLength> passY)
|
| {
|
| + RefPtr<SVGLength> x = passX;
|
| + RefPtr<SVGLength> y = passY;
|
| +
|
| ASSERT(type != SVGUnitTypes::SVG_UNIT_TYPE_UNKNOWN);
|
| if (type == SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) {
|
| SVGLengthContext lengthContext(context);
|
| - return FloatPoint(x.value(lengthContext), y.value(lengthContext));
|
| + return FloatPoint(x->value(lengthContext), y->value(lengthContext));
|
| }
|
|
|
| // FIXME: valueAsPercentage() won't be correct for eg. cm units. They need to be resolved in user space and then be considered in objectBoundingBox space.
|
| - return FloatPoint(x.valueAsPercentage(), y.valueAsPercentage());
|
| + return FloatPoint(x->valueAsPercentage(), y->valueAsPercentage());
|
| }
|
|
|
| -float SVGLengthContext::resolveLength(const SVGElement* context, SVGUnitTypes::SVGUnitType type, const SVGLength& x)
|
| +float SVGLengthContext::resolveLength(const SVGElement* context, SVGUnitTypes::SVGUnitType type, PassRefPtr<SVGLength> passX)
|
| {
|
| + RefPtr<SVGLength> x = passX;
|
| +
|
| ASSERT(type != SVGUnitTypes::SVG_UNIT_TYPE_UNKNOWN);
|
| if (type == SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) {
|
| SVGLengthContext lengthContext(context);
|
| - return x.value(lengthContext);
|
| + return x->value(lengthContext);
|
| }
|
|
|
| // FIXME: valueAsPercentage() won't be correct for eg. cm units. They need to be resolved in user space and then be considered in objectBoundingBox space.
|
| - return x.valueAsPercentage();
|
| + return x->valueAsPercentage();
|
| }
|
|
|
| float SVGLengthContext::convertValueToUserUnits(float value, SVGLengthMode mode, SVGLengthType fromUnit, ExceptionState& exceptionState) const
|
|
|