| 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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 markForLayoutAndParentResourceInvalidation(layoutObject); | 694 markForLayoutAndParentResourceInvalidation(layoutObject); |
| 695 return; | 695 return; |
| 696 } | 696 } |
| 697 | 697 |
| 698 if (fragmentIdentifier.startsWith("svgView(")) { | 698 if (fragmentIdentifier.startsWith("svgView(")) { |
| 699 if (!view) | 699 if (!view) |
| 700 view = currentView(); // Create the SVGViewSpec. | 700 view = currentView(); // Create the SVGViewSpec. |
| 701 | 701 |
| 702 view->inheritViewAttributesFromElement(this); | 702 view->inheritViewAttributesFromElement(this); |
| 703 | 703 |
| 704 if (view->parseViewSpec(fragmentIdentifier)) | 704 if (view->parseViewSpec(fragmentIdentifier)) { |
| 705 UseCounter::count(document(), UseCounter::SVGSVGElementFragmentSVGVi
ew); |
| 705 m_useCurrentView = true; | 706 m_useCurrentView = true; |
| 706 else | 707 } else { |
| 707 view->reset(); | 708 view->reset(); |
| 709 } |
| 708 | 710 |
| 709 if (layoutObject && (hadUseCurrentView || m_useCurrentView)) | 711 if (layoutObject && (hadUseCurrentView || m_useCurrentView)) |
| 710 markForLayoutAndParentResourceInvalidation(layoutObject); | 712 markForLayoutAndParentResourceInvalidation(layoutObject); |
| 711 return; | 713 return; |
| 712 } | 714 } |
| 713 | 715 |
| 714 // Spec: If the SVG fragment identifier addresses a 'view' element within an
SVG document (e.g., MyDrawing.svg#MyView | 716 // Spec: If the SVG fragment identifier addresses a 'view' element within an
SVG document (e.g., MyDrawing.svg#MyView |
| 715 // or MyDrawing.svg#xpointer(id('MyView'))) then the closest ancestor 'svg'
element is displayed in the viewport. | 717 // or MyDrawing.svg#xpointer(id('MyView'))) then the closest ancestor 'svg'
element is displayed in the viewport. |
| 716 // Any view specification attributes included on the given 'view' element ov
erride the corresponding view specification | 718 // Any view specification attributes included on the given 'view' element ov
erride the corresponding view specification |
| 717 // attributes on the closest ancestor 'svg' element. | 719 // attributes on the closest ancestor 'svg' element. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 738 markForLayoutAndParentResourceInvalidation(layoutObject); | 740 markForLayoutAndParentResourceInvalidation(layoutObject); |
| 739 | 741 |
| 740 // FIXME: We need to decide which <svg> to focus on, and zoom to it. | 742 // FIXME: We need to decide which <svg> to focus on, and zoom to it. |
| 741 // FIXME: We need to actually "highlight" the viewTarget(s). | 743 // FIXME: We need to actually "highlight" the viewTarget(s). |
| 742 } | 744 } |
| 743 | 745 |
| 744 void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement) | 746 void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement) |
| 745 { | 747 { |
| 746 SVGViewSpec* view = currentView(); | 748 SVGViewSpec* view = currentView(); |
| 747 m_useCurrentView = true; | 749 m_useCurrentView = true; |
| 750 UseCounter::count(document(), UseCounter::SVGSVGElementFragmentSVGViewElemen
t); |
| 748 view->inheritViewAttributesFromElement(this); | 751 view->inheritViewAttributesFromElement(this); |
| 749 view->inheritViewAttributesFromElement(viewElement); | 752 view->inheritViewAttributesFromElement(viewElement); |
| 750 } | 753 } |
| 751 | 754 |
| 752 void SVGSVGElement::finishParsingChildren() | 755 void SVGSVGElement::finishParsingChildren() |
| 753 { | 756 { |
| 754 SVGGraphicsElement::finishParsingChildren(); | 757 SVGGraphicsElement::finishParsingChildren(); |
| 755 | 758 |
| 756 // The outermost SVGSVGElement SVGLoad event is fired through Document::disp
atchWindowLoadEvent. | 759 // The outermost SVGSVGElement SVGLoad event is fired through Document::disp
atchWindowLoadEvent. |
| 757 if (isOutermostSVGSVGElement()) | 760 if (isOutermostSVGSVGElement()) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 769 visitor->trace(m_width); | 772 visitor->trace(m_width); |
| 770 visitor->trace(m_height); | 773 visitor->trace(m_height); |
| 771 visitor->trace(m_translation); | 774 visitor->trace(m_translation); |
| 772 visitor->trace(m_timeContainer); | 775 visitor->trace(m_timeContainer); |
| 773 visitor->trace(m_viewSpec); | 776 visitor->trace(m_viewSpec); |
| 774 SVGGraphicsElement::trace(visitor); | 777 SVGGraphicsElement::trace(visitor); |
| 775 SVGFitToViewBox::trace(visitor); | 778 SVGFitToViewBox::trace(visitor); |
| 776 } | 779 } |
| 777 | 780 |
| 778 } // namespace blink | 781 } // namespace blink |
| OLD | NEW |