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

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

Issue 23890025: WIP (Introduce WTF::NonNullPtr<T>.) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGElement.cpp ('k') | Source/core/svg/SVGViewSpec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 if (viewElement->hasAttribute(SVGNames::zoomAndPanAttr)) 755 if (viewElement->hasAttribute(SVGNames::zoomAndPanAttr))
756 view->setZoomAndPanBaseValue(viewElement->zoomAndPan()); 756 view->setZoomAndPanBaseValue(viewElement->zoomAndPan());
757 else 757 else
758 view->setZoomAndPanBaseValue(zoomAndPan()); 758 view->setZoomAndPanBaseValue(zoomAndPan());
759 } 759 }
760 760
761 // getElementById on SVGSVGElement is restricted to only the child subtree defin ed by the <svg> element. 761 // getElementById on SVGSVGElement is restricted to only the child subtree defin ed by the <svg> element.
762 // See http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGSVGElement 762 // See http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGSVGElement
763 Element* SVGSVGElement::getElementById(const AtomicString& id) const 763 Element* SVGSVGElement::getElementById(const AtomicString& id) const
764 { 764 {
765 Element* element = treeScope().getElementById(id); 765 Element* element = treeScope()->getElementById(id);
766 if (element && element->isDescendantOf(this)) 766 if (element && element->isDescendantOf(this))
767 return element; 767 return element;
768 768
769 // Fall back to traversing our subtree. Duplicate ids are allowed, the first found will 769 // Fall back to traversing our subtree. Duplicate ids are allowed, the first found will
770 // be returned. 770 // be returned.
771 for (Node* node = firstChild(); node; node = NodeTraversal::next(node, this) ) { 771 for (Node* node = firstChild(); node; node = NodeTraversal::next(node, this) ) {
772 if (!node->isElementNode()) 772 if (!node->isElementNode())
773 continue; 773 continue;
774 774
775 Element* element = toElement(node); 775 Element* element = toElement(node);
776 if (element->getIdAttribute() == id) 776 if (element->getIdAttribute() == id)
777 return element; 777 return element;
778 } 778 }
779 return 0; 779 return 0;
780 } 780 }
781 781
782 } 782 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGElement.cpp ('k') | Source/core/svg/SVGViewSpec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698