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

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

Issue 249313005: Allow fragment navigation from <svg:a> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More test tweaks. Created 6 years, 8 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 | « LayoutTests/svg/hixie/links/003-expected.txt ('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, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2010 Apple Inc. All rights reserved.
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 if (isLinkClick(event)) { 147 if (isLinkClick(event)) {
148 String url = stripLeadingAndTrailingHTMLSpaces(hrefString()); 148 String url = stripLeadingAndTrailingHTMLSpaces(hrefString());
149 149
150 if (url[0] == '#') { 150 if (url[0] == '#') {
151 Element* targetElement = treeScope().getElementById(AtomicString (url.substring(1))); 151 Element* targetElement = treeScope().getElementById(AtomicString (url.substring(1)));
152 if (targetElement && isSVGSMILElement(*targetElement)) { 152 if (targetElement && isSVGSMILElement(*targetElement)) {
153 toSVGSMILElement(targetElement)->beginByLinkActivation(); 153 toSVGSMILElement(targetElement)->beginByLinkActivation();
154 event->setDefaultHandled(); 154 event->setDefaultHandled();
155 return; 155 return;
156 } 156 }
157 // Only allow navigation to internal <view> anchors.
158 if (targetElement && !isSVGViewElement(*targetElement))
159 return;
160 } 157 }
161 158
162 AtomicString target(m_svgTarget->currentValue()->value()); 159 AtomicString target(m_svgTarget->currentValue()->value());
163 if (target.isEmpty() && fastGetAttribute(XLinkNames::showAttr) == "n ew") 160 if (target.isEmpty() && fastGetAttribute(XLinkNames::showAttr) == "n ew")
164 target = AtomicString("_blank", AtomicString::ConstructFromLiter al); 161 target = AtomicString("_blank", AtomicString::ConstructFromLiter al);
165 event->setDefaultHandled(); 162 event->setDefaultHandled();
166 163
167 LocalFrame* frame = document().frame(); 164 LocalFrame* frame = document().frame();
168 if (!frame) 165 if (!frame)
169 return; 166 return;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 return page->chrome().client().tabsToLinks(); 200 return page->chrome().client().tabsToLinks();
204 return false; 201 return false;
205 } 202 }
206 203
207 bool SVGAElement::willRespondToMouseClickEvents() 204 bool SVGAElement::willRespondToMouseClickEvents()
208 { 205 {
209 return isLink() || SVGGraphicsElement::willRespondToMouseClickEvents(); 206 return isLink() || SVGGraphicsElement::willRespondToMouseClickEvents();
210 } 207 }
211 208
212 } // namespace WebCore 209 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/svg/hixie/links/003-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698