diff options
author | Steve Block <steveblock@google.com> | 2012-03-27 18:40:26 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2012-03-28 16:54:59 +0100 |
commit | e48d279609693b4d164199748c93ad791547c649 (patch) | |
tree | 25780dbbd84520d51c0fd174a299121e0d46f5e2 /Source/WebCore/platform | |
parent | c57e584da242d96ba18578a71f4634adc9d1fff6 (diff) | |
download | external_webkit-e48d279609693b4d164199748c93ad791547c649.zip external_webkit-e48d279609693b4d164199748c93ad791547c649.tar.gz external_webkit-e48d279609693b4d164199748c93ad791547c649.tar.bz2 |
Cherry-pick WebKit change r96779 to fix window.location
See http://trac.webkit.org/changeset/96779
Note that a conflict occurred in Source/WebCore/platform/qt/KURLQt.cpp but the
change is not required.
Bug: 2159848
Change-Id: I56e645b2f187302c6f1858c8c6c291209f130cad
Diffstat (limited to 'Source/WebCore/platform')
-rw-r--r-- | Source/WebCore/platform/KURL.cpp | 10 | ||||
-rw-r--r-- | Source/WebCore/platform/KURLGoogle.cpp | 1 | ||||
-rw-r--r-- | Source/WebCore/platform/qt/KURLQt.cpp | 1 | ||||
-rw-r--r-- | Source/WebCore/platform/win/ClipboardWin.cpp | 2 |
4 files changed, 7 insertions, 7 deletions
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); |