| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "core/rendering/svg/RenderSVGResource.h" | 44 #include "core/rendering/svg/RenderSVGResource.h" |
| 45 #include "core/rendering/svg/RenderSVGRoot.h" | 45 #include "core/rendering/svg/RenderSVGRoot.h" |
| 46 #include "core/rendering/svg/RenderSVGViewportContainer.h" | 46 #include "core/rendering/svg/RenderSVGViewportContainer.h" |
| 47 #include "core/svg/SVGAngle.h" | 47 #include "core/svg/SVGAngle.h" |
| 48 #include "core/svg/SVGElementInstance.h" | 48 #include "core/svg/SVGElementInstance.h" |
| 49 #include "core/svg/SVGNumberTearOff.h" | 49 #include "core/svg/SVGNumberTearOff.h" |
| 50 #include "core/svg/SVGPreserveAspectRatio.h" | 50 #include "core/svg/SVGPreserveAspectRatio.h" |
| 51 #include "core/svg/SVGRectTearOff.h" | 51 #include "core/svg/SVGRectTearOff.h" |
| 52 #include "core/svg/SVGTransform.h" | 52 #include "core/svg/SVGTransform.h" |
| 53 #include "core/svg/SVGTransformList.h" | 53 #include "core/svg/SVGTransformList.h" |
| 54 #include "core/svg/SVGTransformTearOff.h" |
| 54 #include "core/svg/SVGViewElement.h" | 55 #include "core/svg/SVGViewElement.h" |
| 55 #include "core/svg/SVGViewSpec.h" | 56 #include "core/svg/SVGViewSpec.h" |
| 56 #include "core/svg/animation/SMILTimeContainer.h" | 57 #include "core/svg/animation/SMILTimeContainer.h" |
| 57 #include "platform/FloatConversion.h" | 58 #include "platform/FloatConversion.h" |
| 58 #include "platform/LengthFunctions.h" | 59 #include "platform/LengthFunctions.h" |
| 59 #include "platform/geometry/FloatRect.h" | 60 #include "platform/geometry/FloatRect.h" |
| 60 #include "platform/transforms/AffineTransform.h" | 61 #include "platform/transforms/AffineTransform.h" |
| 61 #include "wtf/StdLibExtras.h" | 62 #include "wtf/StdLibExtras.h" |
| 62 | 63 |
| 63 namespace WebCore { | 64 namespace WebCore { |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 SVGAngle SVGSVGElement::createSVGAngle() | 421 SVGAngle SVGSVGElement::createSVGAngle() |
| 421 { | 422 { |
| 422 return SVGAngle(); | 423 return SVGAngle(); |
| 423 } | 424 } |
| 424 | 425 |
| 425 PassRefPtr<SVGPointTearOff> SVGSVGElement::createSVGPoint() | 426 PassRefPtr<SVGPointTearOff> SVGSVGElement::createSVGPoint() |
| 426 { | 427 { |
| 427 return SVGPointTearOff::create(SVGPoint::create(), 0, PropertyIsNotAnimVal); | 428 return SVGPointTearOff::create(SVGPoint::create(), 0, PropertyIsNotAnimVal); |
| 428 } | 429 } |
| 429 | 430 |
| 430 SVGMatrix SVGSVGElement::createSVGMatrix() | 431 PassRefPtr<SVGMatrixTearOff> SVGSVGElement::createSVGMatrix() |
| 431 { | 432 { |
| 432 return SVGMatrix(); | 433 return SVGMatrixTearOff::create(AffineTransform()); |
| 433 } | 434 } |
| 434 | 435 |
| 435 PassRefPtr<SVGRectTearOff> SVGSVGElement::createSVGRect() | 436 PassRefPtr<SVGRectTearOff> SVGSVGElement::createSVGRect() |
| 436 { | 437 { |
| 437 return SVGRectTearOff::create(SVGRect::create(), 0, PropertyIsNotAnimVal); | 438 return SVGRectTearOff::create(SVGRect::create(), 0, PropertyIsNotAnimVal); |
| 438 } | 439 } |
| 439 | 440 |
| 440 SVGTransform SVGSVGElement::createSVGTransform() | 441 PassRefPtr<SVGTransformTearOff> SVGSVGElement::createSVGTransform() |
| 441 { | 442 { |
| 442 return SVGTransform(SVGTransform::SVG_TRANSFORM_MATRIX); | 443 return SVGTransformTearOff::create(SVGTransform::create(SVG_TRANSFORM_MATRIX
), 0, PropertyIsNotAnimVal); |
| 443 } | 444 } |
| 444 | 445 |
| 445 SVGTransform SVGSVGElement::createSVGTransformFromMatrix(const SVGMatrix& matrix
) | 446 PassRefPtr<SVGTransformTearOff> SVGSVGElement::createSVGTransformFromMatrix(Pass
RefPtr<SVGMatrixTearOff> matrix) |
| 446 { | 447 { |
| 447 return SVGTransform(static_cast<const AffineTransform&>(matrix)); | 448 // FIXME: remove after nbarth@'s [StrictTypeChecking] patch |
| 449 if (!matrix) |
| 450 return 0; |
| 451 |
| 452 return SVGTransformTearOff::create(SVGTransform::create(matrix->value()), 0,
PropertyIsNotAnimVal); |
| 448 } | 453 } |
| 449 | 454 |
| 450 AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGElement::CTMScop
e mode) const | 455 AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGElement::CTMScop
e mode) const |
| 451 { | 456 { |
| 452 AffineTransform viewBoxTransform; | 457 AffineTransform viewBoxTransform; |
| 453 if (!hasEmptyViewBox()) { | 458 if (!hasEmptyViewBox()) { |
| 454 FloatSize size = currentViewportSize(); | 459 FloatSize size = currentViewportSize(); |
| 455 viewBoxTransform = viewBoxToViewTransform(size.width(), size.height()); | 460 viewBoxTransform = viewBoxToViewTransform(size.width(), size.height()); |
| 456 } | 461 } |
| 457 | 462 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 ASSERT(renderer()); | 701 ASSERT(renderer()); |
| 697 return renderer()->style()->height(); | 702 return renderer()->style()->height(); |
| 698 } | 703 } |
| 699 | 704 |
| 700 AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float vie
wHeight) const | 705 AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float vie
wHeight) const |
| 701 { | 706 { |
| 702 if (!m_useCurrentView || !m_viewSpec) | 707 if (!m_useCurrentView || !m_viewSpec) |
| 703 return SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), m_p
reserveAspectRatio->currentValue(), viewWidth, viewHeight); | 708 return SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), m_p
reserveAspectRatio->currentValue(), viewWidth, viewHeight); |
| 704 | 709 |
| 705 AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(currentViewBox
Rect(), m_viewSpec->preserveAspectRatio()->currentValue(), viewWidth, viewHeight
); | 710 AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(currentViewBox
Rect(), m_viewSpec->preserveAspectRatio()->currentValue(), viewWidth, viewHeight
); |
| 706 const SVGTransformList& transformList = m_viewSpec->transformBaseValue(); | 711 RefPtr<SVGTransformList> transformList = m_viewSpec->transform(); |
| 707 if (transformList.isEmpty()) | 712 if (transformList->isEmpty()) |
| 708 return ctm; | 713 return ctm; |
| 709 | 714 |
| 710 AffineTransform transform; | 715 AffineTransform transform; |
| 711 if (transformList.concatenate(transform)) | 716 if (transformList->concatenate(transform)) |
| 712 ctm *= transform; | 717 ctm *= transform; |
| 713 | 718 |
| 714 return ctm; | 719 return ctm; |
| 715 } | 720 } |
| 716 | 721 |
| 717 void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element*
anchorNode) | 722 void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element*
anchorNode) |
| 718 { | 723 { |
| 719 RenderObject* renderer = this->renderer(); | 724 RenderObject* renderer = this->renderer(); |
| 720 SVGViewSpec* view = m_viewSpec.get(); | 725 SVGViewSpec* view = m_viewSpec.get(); |
| 721 if (view) | 726 if (view) |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 continue; | 810 continue; |
| 806 | 811 |
| 807 Element* element = toElement(node); | 812 Element* element = toElement(node); |
| 808 if (element->getIdAttribute() == id) | 813 if (element->getIdAttribute() == id) |
| 809 return element; | 814 return element; |
| 810 } | 815 } |
| 811 return 0; | 816 return 0; |
| 812 } | 817 } |
| 813 | 818 |
| 814 } | 819 } |
| OLD | NEW |