| 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 * Copyright (C) 2014 Google, Inc. | 5 * Copyright (C) 2014 Google, Inc. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 synthesizedViewBoxSize.setHeight( | 575 synthesizedViewBoxSize.setHeight( |
| 576 height()->currentValue()->scaleByPercentage( | 576 height()->currentValue()->scaleByPercentage( |
| 577 currentViewportSize().height())); | 577 currentViewportSize().height())); |
| 578 return FloatRect(FloatPoint(), synthesizedViewBoxSize); | 578 return FloatRect(FloatPoint(), synthesizedViewBoxSize); |
| 579 } | 579 } |
| 580 | 580 |
| 581 SVGPreserveAspectRatio* SVGSVGElement::currentPreserveAspectRatio() const { | 581 SVGPreserveAspectRatio* SVGSVGElement::currentPreserveAspectRatio() const { |
| 582 if (m_viewSpec) | 582 if (m_viewSpec) |
| 583 return m_viewSpec->preserveAspectRatio(); | 583 return m_viewSpec->preserveAspectRatio(); |
| 584 | 584 |
| 585 if (!viewBox()->currentValue()->isValid() && shouldSynthesizeViewBox()) { | 585 if (!hasValidViewBox() && shouldSynthesizeViewBox()) { |
| 586 // If no viewBox is specified and we're embedded through SVGImage, then | 586 // If no (valid) viewBox is specified and we're embedded through SVGImage, |
| 587 // synthesize a pAR with the value 'none'. | 587 // then synthesize a pAR with the value 'none'. |
| 588 SVGPreserveAspectRatio* synthesizedPAR = SVGPreserveAspectRatio::create(); | 588 SVGPreserveAspectRatio* synthesizedPAR = SVGPreserveAspectRatio::create(); |
| 589 synthesizedPAR->setAlign( | 589 synthesizedPAR->setAlign( |
| 590 SVGPreserveAspectRatio::kSvgPreserveaspectratioNone); | 590 SVGPreserveAspectRatio::kSvgPreserveaspectratioNone); |
| 591 return synthesizedPAR; | 591 return synthesizedPAR; |
| 592 } | 592 } |
| 593 return preserveAspectRatio()->currentValue(); | 593 return preserveAspectRatio()->currentValue(); |
| 594 } | 594 } |
| 595 | 595 |
| 596 FloatSize SVGSVGElement::currentViewportSize() const { | 596 FloatSize SVGSVGElement::currentViewportSize() const { |
| 597 if (!layoutObject()) | 597 if (!layoutObject()) |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 visitor->trace(m_width); | 727 visitor->trace(m_width); |
| 728 visitor->trace(m_height); | 728 visitor->trace(m_height); |
| 729 visitor->trace(m_translation); | 729 visitor->trace(m_translation); |
| 730 visitor->trace(m_timeContainer); | 730 visitor->trace(m_timeContainer); |
| 731 visitor->trace(m_viewSpec); | 731 visitor->trace(m_viewSpec); |
| 732 SVGGraphicsElement::trace(visitor); | 732 SVGGraphicsElement::trace(visitor); |
| 733 SVGFitToViewBox::trace(visitor); | 733 SVGFitToViewBox::trace(visitor); |
| 734 } | 734 } |
| 735 | 735 |
| 736 } // namespace blink | 736 } // namespace blink |
| OLD | NEW |