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