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

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

Issue 251633002: Add support for DocumentFragment.getElementById() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix createElement() calls Created 6 years, 7 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/SVGSVGElement.h ('k') | no next file » | 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 * 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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 view->preserveAspectRatio()->baseValue()->setAlign(preserveAspectRatio() ->currentValue()->align()); 766 view->preserveAspectRatio()->baseValue()->setAlign(preserveAspectRatio() ->currentValue()->align());
767 view->preserveAspectRatio()->baseValue()->setMeetOrSlice(preserveAspectR atio()->currentValue()->meetOrSlice()); 767 view->preserveAspectRatio()->baseValue()->setMeetOrSlice(preserveAspectR atio()->currentValue()->meetOrSlice());
768 } 768 }
769 769
770 if (viewElement->hasAttribute(SVGNames::zoomAndPanAttr)) 770 if (viewElement->hasAttribute(SVGNames::zoomAndPanAttr))
771 view->setZoomAndPan(viewElement->zoomAndPan()); 771 view->setZoomAndPan(viewElement->zoomAndPan());
772 else 772 else
773 view->setZoomAndPan(zoomAndPan()); 773 view->setZoomAndPan(zoomAndPan());
774 } 774 }
775 775
776 // getElementById on SVGSVGElement is restricted to only the child subtree defin ed by the <svg> element.
777 // See http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGSVGElement
778 Element* SVGSVGElement::getElementById(const AtomicString& id) const
779 {
780 Element* element = treeScope().getElementById(id);
781 if (element && element->isDescendantOf(this))
782 return element;
783
784 // Fall back to traversing our subtree. Duplicate ids are allowed, the first found will
785 // be returned.
786 for (Element* element = ElementTraversal::firstWithin(*this); element; eleme nt = ElementTraversal::next(*element, this)) {
787 if (element->getIdAttribute() == id)
788 return element;
789 }
790 return 0;
791 } 776 }
792
793 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGSVGElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698