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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 // Any view specification attributes included on the given ‘view’ element ov
erride the corresponding view specification | 706 // Any view specification attributes included on the given ‘view’ element ov
erride the corresponding view specification |
707 // attributes on the closest ancestor ‘svg’ element. | 707 // attributes on the closest ancestor ‘svg’ element. |
708 if (isSVGViewElement(anchorNode)) { | 708 if (isSVGViewElement(anchorNode)) { |
709 SVGViewElement& viewElement = toSVGViewElement(*anchorNode); | 709 SVGViewElement& viewElement = toSVGViewElement(*anchorNode); |
710 | 710 |
711 if (SVGSVGElement* svg = viewElement.ownerSVGElement()) { | 711 if (SVGSVGElement* svg = viewElement.ownerSVGElement()) { |
712 svg->inheritViewAttributes(&viewElement); | 712 svg->inheritViewAttributes(&viewElement); |
713 | 713 |
714 if (RenderObject* renderer = svg->renderer()) | 714 if (RenderObject* renderer = svg->renderer()) |
715 markForLayoutAndParentResourceInvalidation(renderer); | 715 markForLayoutAndParentResourceInvalidation(renderer); |
| 716 |
| 717 return; |
716 } | 718 } |
717 } | 719 } |
718 | 720 |
| 721 // If we previously had a view and didn't get a new one, we need to |
| 722 // layout again. |
| 723 if (renderer && hadUseCurrentView) |
| 724 markForLayoutAndParentResourceInvalidation(renderer); |
| 725 |
719 // FIXME: We need to decide which <svg> to focus on, and zoom to it. | 726 // FIXME: We need to decide which <svg> to focus on, and zoom to it. |
720 // FIXME: We need to actually "highlight" the viewTarget(s). | 727 // FIXME: We need to actually "highlight" the viewTarget(s). |
721 } | 728 } |
722 | 729 |
723 void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement) | 730 void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement) |
724 { | 731 { |
725 SVGViewSpec* view = currentView(); | 732 SVGViewSpec* view = currentView(); |
726 m_useCurrentView = true; | 733 m_useCurrentView = true; |
727 | 734 |
728 if (viewElement->hasAttribute(SVGNames::viewBoxAttr)) | 735 if (viewElement->hasAttribute(SVGNames::viewBoxAttr)) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 visitor->trace(m_width); | 771 visitor->trace(m_width); |
765 visitor->trace(m_height); | 772 visitor->trace(m_height); |
766 visitor->trace(m_translation); | 773 visitor->trace(m_translation); |
767 visitor->trace(m_timeContainer); | 774 visitor->trace(m_timeContainer); |
768 visitor->trace(m_viewSpec); | 775 visitor->trace(m_viewSpec); |
769 SVGGraphicsElement::trace(visitor); | 776 SVGGraphicsElement::trace(visitor); |
770 SVGFitToViewBox::trace(visitor); | 777 SVGFitToViewBox::trace(visitor); |
771 } | 778 } |
772 | 779 |
773 } // namespace blink | 780 } // namespace blink |
OLD | NEW |