| 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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 | 769 |
| 770 if (renderer && (hadUseCurrentView || m_useCurrentView)) | 770 if (renderer && (hadUseCurrentView || m_useCurrentView)) |
| 771 RenderSVGResource::markForLayoutAndParentResourceInvalidation(render
er); | 771 RenderSVGResource::markForLayoutAndParentResourceInvalidation(render
er); |
| 772 return; | 772 return; |
| 773 } | 773 } |
| 774 | 774 |
| 775 // Spec: If the SVG fragment identifier addresses a ‘view’ element within an
SVG document (e.g., MyDrawing.svg#MyView | 775 // Spec: If the SVG fragment identifier addresses a ‘view’ element within an
SVG document (e.g., MyDrawing.svg#MyView |
| 776 // or MyDrawing.svg#xpointer(id('MyView'))) then the closest ancestor ‘svg’
element is displayed in the viewport. | 776 // or MyDrawing.svg#xpointer(id('MyView'))) then the closest ancestor ‘svg’
element is displayed in the viewport. |
| 777 // Any view specification attributes included on the given ‘view’ element ov
erride the corresponding view specification | 777 // Any view specification attributes included on the given ‘view’ element ov
erride the corresponding view specification |
| 778 // attributes on the closest ancestor ‘svg’ element. | 778 // attributes on the closest ancestor ‘svg’ element. |
| 779 if (anchorNode && anchorNode->hasTagName(SVGNames::viewTag)) { | 779 if (isSVGViewElement(anchorNode)) { |
| 780 SVGViewElement* viewElement = toSVGViewElement(anchorNode); | 780 SVGViewElement& viewElement = toSVGViewElement(*anchorNode); |
| 781 if (!viewElement) | |
| 782 return; | |
| 783 | 781 |
| 784 if (SVGSVGElement* svg = viewElement->ownerSVGElement()) { | 782 if (SVGSVGElement* svg = viewElement.ownerSVGElement()) { |
| 785 svg->inheritViewAttributes(viewElement); | 783 svg->inheritViewAttributes(&viewElement); |
| 786 | 784 |
| 787 if (RenderObject* renderer = svg->renderer()) | 785 if (RenderObject* renderer = svg->renderer()) |
| 788 RenderSVGResource::markForLayoutAndParentResourceInvalidation(re
nderer); | 786 RenderSVGResource::markForLayoutAndParentResourceInvalidation(re
nderer); |
| 789 } | 787 } |
| 790 } | 788 } |
| 791 | 789 |
| 792 // FIXME: We need to decide which <svg> to focus on, and zoom to it. | 790 // FIXME: We need to decide which <svg> to focus on, and zoom to it. |
| 793 // FIXME: We need to actually "highlight" the viewTarget(s). | 791 // FIXME: We need to actually "highlight" the viewTarget(s). |
| 794 } | 792 } |
| 795 | 793 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 Vector<Element*>::const_iterator end = elements.end(); | 832 Vector<Element*>::const_iterator end = elements.end(); |
| 835 for (Vector<Element*>::const_iterator it = elements.begin(); it != end; ++it
) { | 833 for (Vector<Element*>::const_iterator it = elements.begin(); it != end; ++it
) { |
| 836 if ((*it)->isDescendantOf(this)) | 834 if ((*it)->isDescendantOf(this)) |
| 837 return *it; | 835 return *it; |
| 838 } | 836 } |
| 839 | 837 |
| 840 return 0; | 838 return 0; |
| 841 } | 839 } |
| 842 | 840 |
| 843 } | 841 } |
| OLD | NEW |