Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGSVGElement.cpp

Issue 1471963007: Count usage of #svgView(...) and plain SVG <view> targets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing expected file Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698