summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/fileapi/DOMFileSystemBase.cpp2
-rw-r--r--Source/WebCore/loader/FrameLoader.cpp3
-rw-r--r--Source/WebCore/page/Location.cpp14
-rw-r--r--Source/WebCore/page/Location.h4
-rw-r--r--Source/WebCore/platform/KURL.cpp10
-rw-r--r--Source/WebCore/platform/KURLGoogle.cpp1
-rw-r--r--Source/WebCore/platform/qt/KURLQt.cpp1
-rw-r--r--Source/WebCore/platform/win/ClipboardWin.cpp2
-rw-r--r--Source/WebCore/workers/WorkerLocation.cpp9
-rw-r--r--Source/WebCore/workers/WorkerLocation.h4
10 files changed, 16 insertions, 34 deletions
diff --git a/Source/WebCore/fileapi/DOMFileSystemBase.cpp b/Source/WebCore/fileapi/DOMFileSystemBase.cpp
index eafb815..5a2627f 100644
--- a/Source/WebCore/fileapi/DOMFileSystemBase.cpp
+++ b/Source/WebCore/fileapi/DOMFileSystemBase.cpp
@@ -63,7 +63,7 @@ bool DOMFileSystemBase::crackFileSystemURL(const KURL& url, AsyncFileSystem::Typ
return false;
KURL originURL(ParsedURLString, url.path());
- String path = originURL.path();
+ String path = decodeURLEscapeSequences(originURL.path());
if (path.isEmpty() || path[0] != '/')
return false;
path = path.substring(1);
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index f999fdb..670cf1f 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -993,7 +993,8 @@ void FrameLoader::loadArchive(PassRefPtr<Archive> prpArchive)
ObjectContentType FrameLoader::defaultObjectContentType(const KURL& url, const String& mimeTypeIn, bool shouldPreferPlugInsForImages)
{
String mimeType = mimeTypeIn;
- String extension = url.path().substring(url.path().reverseFind('.') + 1);
+ String decodedPath = decodeURLEscapeSequences(url.path());
+ String extension = decodedPath.substring(decodedPath.reverseFind('.') + 1);
// We don't use MIMETypeRegistry::getMIMETypeForPath() because it returns "application/octet-stream" upon failure
if (mimeType.isEmpty())
diff --git a/Source/WebCore/page/Location.cpp b/Source/WebCore/page/Location.cpp
index 9528437..fb68a09 100644
--- a/Source/WebCore/page/Location.cpp
+++ b/Source/WebCore/page/Location.cpp
@@ -63,9 +63,7 @@ String Location::href() const
if (!m_frame)
return String();
- const KURL& url = this->url();
- // FIXME: Stop using deprecatedString(): https://bugs.webkit.org/show_bug.cgi?id=30225
- return url.hasPath() ? url.deprecatedString() : url.deprecatedString() + "/";
+ return url().string();
}
String Location::protocol() const
@@ -148,16 +146,6 @@ String Location::getParameter(const String& name) const
return parameters.get(name);
}
-String Location::toString() const
-{
- if (!m_frame)
- return String();
-
- const KURL& url = this->url();
- // FIXME: Stop using deprecatedString(): https://bugs.webkit.org/show_bug.cgi?id=30225
- return url.hasPath() ? url.deprecatedString() : url.deprecatedString() + "/";
-}
-
void Location::setHref(const String& urlString, DOMWindow* activeWindow, DOMWindow* firstWindow)
{
if (!m_frame)
diff --git a/Source/WebCore/page/Location.h b/Source/WebCore/page/Location.h
index 1b68cee..0e89ecf 100644
--- a/Source/WebCore/page/Location.h
+++ b/Source/WebCore/page/Location.h
@@ -29,9 +29,9 @@
#ifndef Location_h
#define Location_h
-#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -71,7 +71,7 @@ public:
String hash() const;
String origin() const;
- String toString() const;
+ String toString() const { return href(); }
String getParameter(const String&) const;
diff --git a/Source/WebCore/platform/KURL.cpp b/Source/WebCore/platform/KURL.cpp
index 7c952a2..234d749 100644
--- a/Source/WebCore/platform/KURL.cpp
+++ b/Source/WebCore/platform/KURL.cpp
@@ -708,7 +708,7 @@ String KURL::query() const
String KURL::path() const
{
- return decodeURLEscapeSequences(m_string.substring(m_portEnd, m_pathEnd - m_portEnd));
+ return m_string.substring(m_portEnd, m_pathEnd - m_portEnd);
}
bool KURL::setProtocol(const String& s)
@@ -996,7 +996,7 @@ static void appendEscapingBadChars(char*& buffer, const char* strStart, size_t l
buffer = p;
}
-static void escapeAndAppendFragment(char*& buffer, const char* strStart, size_t length)
+static void escapeAndAppendNonHierarchicalPart(char*& buffer, const char* strStart, size_t length)
{
char* p = buffer;
@@ -1420,7 +1420,9 @@ void KURL::parse(const char* url, const String* originalString)
*p++ = '/';
// add path, escaping bad characters
- if (!hierarchical || !hasSlashDotOrDotDot(url))
+ if (!hierarchical)
+ escapeAndAppendNonHierarchicalPart(p, url + pathStart, pathEnd - pathStart);
+ else if (!hasSlashDotOrDotDot(url))
appendEscapingBadChars(p, url + pathStart, pathEnd - pathStart);
else {
CharBuffer pathBuffer(pathEnd - pathStart + 1);
@@ -1446,7 +1448,7 @@ void KURL::parse(const char* url, const String* originalString)
// add fragment, escaping bad characters
if (fragmentEnd != queryEnd) {
*p++ = '#';
- escapeAndAppendFragment(p, url + fragmentStart, fragmentEnd - fragmentStart);
+ escapeAndAppendNonHierarchicalPart(p, url + fragmentStart, fragmentEnd - fragmentStart);
}
m_fragmentEnd = p - buffer.data();
diff --git a/Source/WebCore/platform/KURLGoogle.cpp b/Source/WebCore/platform/KURLGoogle.cpp
index 7bb1d53..54bcf16 100644
--- a/Source/WebCore/platform/KURLGoogle.cpp
+++ b/Source/WebCore/platform/KURLGoogle.cpp
@@ -593,7 +593,6 @@ String KURL::query() const
String KURL::path() const
{
- // Note: KURL.cpp unescapes here.
return m_url.componentString(m_url.m_parsed.path);
}
diff --git a/Source/WebCore/platform/qt/KURLQt.cpp b/Source/WebCore/platform/qt/KURLQt.cpp
index f6d2a86..674a933 100644
--- a/Source/WebCore/platform/qt/KURLQt.cpp
+++ b/Source/WebCore/platform/qt/KURLQt.cpp
@@ -50,4 +50,3 @@ String KURL::fileSystemPath() const
}
}
-
diff --git a/Source/WebCore/platform/win/ClipboardWin.cpp b/Source/WebCore/platform/win/ClipboardWin.cpp
index 0b5a3d3..2e56cbc 100644
--- a/Source/WebCore/platform/win/ClipboardWin.cpp
+++ b/Source/WebCore/platform/win/ClipboardWin.cpp
@@ -191,7 +191,7 @@ static HGLOBAL createGlobalHDropContent(const KURL& url, String& fileName, Share
WCHAR filePath[MAX_PATH];
if (url.isLocalFile()) {
- String localPath = url.path();
+ String localPath = decodeURLEscapeSequences(url.path());
// windows does not enjoy a leading slash on paths
if (localPath[0] == '/')
localPath = localPath.substring(1);
diff --git a/Source/WebCore/workers/WorkerLocation.cpp b/Source/WebCore/workers/WorkerLocation.cpp
index 33aebbb..319a528 100644
--- a/Source/WebCore/workers/WorkerLocation.cpp
+++ b/Source/WebCore/workers/WorkerLocation.cpp
@@ -36,8 +36,7 @@ namespace WebCore {
String WorkerLocation::href() const
{
- // FIXME: Stop using deprecatedString(): https://bugs.webkit.org/show_bug.cgi?id=30225
- return m_url.hasPath() ? m_url.deprecatedString() : m_url.deprecatedString() + "/";
+ return m_url.string();
}
String WorkerLocation::protocol() const
@@ -75,12 +74,6 @@ String WorkerLocation::hash() const
return m_url.fragmentIdentifier().isEmpty() ? "" : "#" + m_url.fragmentIdentifier();
}
-String WorkerLocation::toString() const
-{
- // FIXME: Stop using deprecatedString(): https://bugs.webkit.org/show_bug.cgi?id=30225
- return m_url.hasPath() ? m_url.deprecatedString() : m_url.deprecatedString() + "/";
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/workers/WorkerLocation.h b/Source/WebCore/workers/WorkerLocation.h
index 5200e35..692c0e3 100644
--- a/Source/WebCore/workers/WorkerLocation.h
+++ b/Source/WebCore/workers/WorkerLocation.h
@@ -30,10 +30,10 @@
#if ENABLE(WORKERS)
#include "KURL.h"
-#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -57,7 +57,7 @@ namespace WebCore {
String search() const;
String hash() const;
- String toString() const;
+ String toString() const { return href(); }
private:
WorkerLocation(const KURL& url) : m_url(url) { }