| OLD | NEW |
| 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, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 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 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 bool SVGURIReference::isKnownAttribute(const QualifiedName& attrName) | 41 bool SVGURIReference::isKnownAttribute(const QualifiedName& attrName) |
| 42 { | 42 { |
| 43 return attrName.matches(XLinkNames::hrefAttr); | 43 return attrName.matches(XLinkNames::hrefAttr); |
| 44 } | 44 } |
| 45 | 45 |
| 46 String SVGURIReference::fragmentIdentifierFromIRIString(const String& url, const
Document& document) | 46 String SVGURIReference::fragmentIdentifierFromIRIString(const String& url, const
Document& document) |
| 47 { | 47 { |
| 48 size_t start = url.find('#'); | 48 size_t start = url.find('#'); |
| 49 if (start == notFound) | 49 if (start == kNotFound) |
| 50 return emptyString(); | 50 return emptyString(); |
| 51 | 51 |
| 52 KURL base = start ? KURL(document.baseURI(), url.substring(0, start)) : docu
ment.baseURI(); | 52 KURL base = start ? KURL(document.baseURI(), url.substring(0, start)) : docu
ment.baseURI(); |
| 53 if (equalIgnoringFragmentIdentifier(base, document.url())) | 53 if (equalIgnoringFragmentIdentifier(base, document.url())) |
| 54 return url.substring(start + 1); | 54 return url.substring(start + 1); |
| 55 | 55 |
| 56 return emptyString(); | 56 return emptyString(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 static inline KURL urlFromIRIStringWithFragmentIdentifier(const String& url, con
st Document& document, String& fragmentIdentifier) | 59 static inline KURL urlFromIRIStringWithFragmentIdentifier(const String& url, con
st Document& document, String& fragmentIdentifier) |
| 60 { | 60 { |
| 61 size_t startOfFragmentIdentifier = url.find('#'); | 61 size_t startOfFragmentIdentifier = url.find('#'); |
| 62 if (startOfFragmentIdentifier == notFound) | 62 if (startOfFragmentIdentifier == kNotFound) |
| 63 return KURL(); | 63 return KURL(); |
| 64 | 64 |
| 65 // Exclude the '#' character when determining the fragmentIdentifier. | 65 // Exclude the '#' character when determining the fragmentIdentifier. |
| 66 fragmentIdentifier = url.substring(startOfFragmentIdentifier + 1); | 66 fragmentIdentifier = url.substring(startOfFragmentIdentifier + 1); |
| 67 if (startOfFragmentIdentifier) { | 67 if (startOfFragmentIdentifier) { |
| 68 KURL base(document.baseURI(), url.substring(0, startOfFragmentIdentifier
)); | 68 KURL base(document.baseURI(), url.substring(0, startOfFragmentIdentifier
)); |
| 69 return KURL(base, url.substring(startOfFragmentIdentifier)); | 69 return KURL(base, url.substring(startOfFragmentIdentifier)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 return KURL(document.baseURI(), url.substring(startOfFragmentIdentifier)); | 72 return KURL(document.baseURI(), url.substring(startOfFragmentIdentifier)); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 98 | 98 |
| 99 return document.getElementById(id); | 99 return document.getElementById(id); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void SVGURIReference::addSupportedAttributes(HashSet<QualifiedName>& supportedAt
tributes) | 102 void SVGURIReference::addSupportedAttributes(HashSet<QualifiedName>& supportedAt
tributes) |
| 103 { | 103 { |
| 104 supportedAttributes.add(XLinkNames::hrefAttr); | 104 supportedAttributes.add(XLinkNames::hrefAttr); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } | 107 } |
| OLD | NEW |