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

Side by Side Diff: Source/core/svg/SVGURIReference.h

Issue 23685007: Have SVGURIReference API deal with Document references, not pointers (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/SVGTextPathElement.cpp ('k') | Source/core/svg/SVGURIReference.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, 2008, 2009 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008, 2009 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 18 matching lines...) Expand all
29 class Element; 29 class Element;
30 30
31 class SVGURIReference { 31 class SVGURIReference {
32 public: 32 public:
33 virtual ~SVGURIReference() { } 33 virtual ~SVGURIReference() { }
34 34
35 bool parseAttribute(const QualifiedName&, const AtomicString&); 35 bool parseAttribute(const QualifiedName&, const AtomicString&);
36 bool isKnownAttribute(const QualifiedName&); 36 bool isKnownAttribute(const QualifiedName&);
37 void addSupportedAttributes(HashSet<QualifiedName>&); 37 void addSupportedAttributes(HashSet<QualifiedName>&);
38 38
39 static String fragmentIdentifierFromIRIString(const String&, Document*); 39 static String fragmentIdentifierFromIRIString(const String&, const Document& );
40 static Element* targetElementFromIRIString(const String&, Document*, String* = 0, Document* = 0); 40 static Element* targetElementFromIRIString(const String&, const Document&, S tring* = 0, Document* = 0);
41 41
42 static inline bool isExternalURIReference(const String& uri, Document* docum ent) 42 static inline bool isExternalURIReference(const String& uri, const Document& document)
43 { 43 {
44 // Fragment-only URIs are always internal 44 // Fragment-only URIs are always internal
45 if (uri.startsWith('#')) 45 if (uri.startsWith('#'))
46 return false; 46 return false;
47 47
48 // If the URI matches our documents URL, we're dealing with a local refe rence. 48 // If the URI matches our documents URL, we're dealing with a local refe rence.
49 ASSERT(document); 49 KURL url = document.completeURL(uri);
50 KURL url = document->completeURL(uri); 50 return !equalIgnoringFragmentIdentifier(url, document.url());
51 return !equalIgnoringFragmentIdentifier(url, document->url());
52 } 51 }
53 52
54 protected: 53 protected:
55 virtual void setHrefBaseValue(const String&, const bool validValue = true) = 0; 54 virtual void setHrefBaseValue(const String&, const bool validValue = true) = 0;
56 }; 55 };
57 56
58 } // namespace WebCore 57 } // namespace WebCore
59 58
60 #endif // SVGURIReference_h 59 #endif // SVGURIReference_h
OLDNEW
« no previous file with comments | « Source/core/svg/SVGTextPathElement.cpp ('k') | Source/core/svg/SVGURIReference.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698