Changeset 24777 in webkit
- Timestamp:
- Jul 30, 2007 10:28:03 AM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r24776 r24777 1 2007-07-30 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Darin. 4 5 <rdar://problem/4942372> REGRESSION: Anchor links in Mail don't work anymore 6 7 Make it possible for KURL to handle addig fragments to non-hierarchical URLs 8 such as mailto: and cid:. 9 10 * platform/KURL.cpp: 11 (WebCore::KURL::init): 12 If the base URL is not hierarchical but the relative URL is a fragment, then 13 allow parsing it. 14 15 (WebCore::KURL::parse): 16 If the URL is not hierarchical, set the fragment start and end positions correctly. 17 1 18 2007-07-30 Simon Hausmann <hausmann@kde.org> 2 19 -
trunk/WebCore/platform/KURL.cpp
r24462 r24777 1 1 /* 2 * Copyright (C) 2004 Apple Computer,Inc. All rights reserved.2 * Copyright (C) 2004, 2007 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER,INC. ``AS IS'' AND ANY13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 14 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 349 349 parse(str, (allASCII && !strippedStart && (charsToChopOffEnd == 0)) ? &rel : 0); 350 350 } else { 351 // If the base is empty or opaque (e.g. data: or javascript:), then the URL is invalid. 351 // If the base is empty or opaque (e.g. data: or javascript:), then the URL is invalid 352 // unless the relative URL is a single fragment. 352 353 if (!base.isHierarchical()) { 353 m_isValid = false; 354 if (str[0] == '#') { 355 DeprecatedString newURL = base.urlString.left(base.queryEndPos) + str; 356 parse(newURL.ascii(), &newURL); 357 } else 358 m_isValid = false; 359 354 360 if (strBuffer) 355 361 fastFree(strBuffer); … … 1054 1060 1055 1061 if (!hierarchical) { 1056 while (url[pathEnd] != '\0' && url[pathEnd] != '?' ) {1062 while (url[pathEnd] != '\0' && url[pathEnd] != '?' && url[pathEnd] != '#') 1057 1063 pathEnd++; 1058 } 1059 queryStart = queryEnd = pathEnd; 1060 1061 while (url[queryEnd] != '\0') { 1062 queryEnd++; 1063 } 1064 1065 fragmentStart = fragmentEnd = queryEnd; 1064 1065 queryStart = pathEnd; 1066 queryEnd = queryStart; 1067 if (url[queryStart] == '?') { 1068 while (url[queryEnd] != '\0' && url[queryEnd] != '#') 1069 queryEnd++; 1070 } 1071 1072 fragmentStart = queryEnd; 1073 fragmentEnd = fragmentStart; 1074 if (url[fragmentStart] == '#') { 1075 fragmentStart++; 1076 fragmentEnd = fragmentStart; 1077 while (url[fragmentEnd] != '\0') 1078 fragmentEnd++; 1079 } 1066 1080 } 1067 1081 else { … … 1083 1097 fragmentStart++; 1084 1098 fragmentEnd = fragmentStart; 1085 while (url[fragmentEnd] != '\0') {1099 while (url[fragmentEnd] != '\0') { 1086 1100 fragmentEnd++; 1087 1101 }
Note: See TracChangeset
for help on using the changeset viewer.