summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--LayoutTests/fast/url/file-http-base-expected.txt3
-rw-r--r--LayoutTests/fast/url/mailto-expected.txt2
-rw-r--r--LayoutTests/fast/url/relative-expected.txt6
-rw-r--r--LayoutTests/fast/url/script-tests/file-http-base.js3
-rw-r--r--LayoutTests/fast/url/script-tests/segments-from-data-url.js110
-rw-r--r--LayoutTests/fast/url/script-tests/segments.js145
-rw-r--r--LayoutTests/fast/url/script-tests/standard-url.js30
-rw-r--r--LayoutTests/fast/url/script-tests/trivial-segments.js2
-rw-r--r--LayoutTests/fast/url/segments-expected.txt147
-rw-r--r--LayoutTests/fast/url/segments-from-data-url-expected.txt118
-rw-r--r--LayoutTests/fast/url/segments.html3
-rw-r--r--LayoutTests/fast/url/standard-url-expected.txt27
-rw-r--r--LayoutTests/fast/url/trivial-segments-expected.txt2
-rw-r--r--Source/WebCore/WebCore.exp.in1
-rw-r--r--Source/WebCore/fileapi/DOMFileSystemBase.cpp2
-rw-r--r--Source/WebCore/html/HTMLAnchorElement.cpp5
-rw-r--r--Source/WebCore/loader/FrameLoader.cpp3
-rw-r--r--Source/WebCore/page/Location.cpp18
-rw-r--r--Source/WebCore/page/Location.h4
-rw-r--r--Source/WebCore/platform/KURL.cpp43
-rw-r--r--Source/WebCore/platform/KURL.h4
-rw-r--r--Source/WebCore/platform/KURLGoogle.cpp17
-rw-r--r--Source/WebCore/platform/graphics/android/fonts/GlyphMapAndroid.cpp45
-rw-r--r--Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp3
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp10
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp7
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp4
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TransferQueue.h1
-rw-r--r--Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp4
-rw-r--r--Source/WebCore/platform/qt/KURLQt.cpp1
-rw-r--r--Source/WebCore/platform/win/ClipboardWin.cpp2
-rw-r--r--Source/WebCore/rendering/RenderBlock.cpp2
-rw-r--r--Source/WebCore/rendering/RenderBox.cpp2
-rw-r--r--Source/WebCore/rendering/RenderBox.h2
-rw-r--r--Source/WebCore/rendering/RenderReplaced.cpp8
-rw-r--r--Source/WebCore/rendering/RenderReplaced.h2
-rw-r--r--Source/WebCore/rendering/RenderWidget.cpp4
-rw-r--r--Source/WebCore/workers/WorkerLocation.cpp7
-rw-r--r--Source/WebCore/workers/WorkerLocation.h4
-rw-r--r--Source/WebKit/android/jni/WebCoreJni.cpp4
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp27
-rw-r--r--Source/WebKit/android/nav/WebView.cpp12
-rw-r--r--Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp2
-rw-r--r--Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp12
-rw-r--r--Source/WebKit/efl/ewk/ewk_frame.cpp4
-rw-r--r--Source/WebKit/efl/ewk/ewk_view.cpp6
-rw-r--r--Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp2
-rw-r--r--Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp4
-rw-r--r--Source/WebKit/gtk/webkit/webkitwebview.cpp2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp12
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp4
52 files changed, 531 insertions, 365 deletions
diff --git a/LayoutTests/fast/url/file-http-base-expected.txt b/LayoutTests/fast/url/file-http-base-expected.txt
index afd3131..f9169cd 100644
--- a/LayoutTests/fast/url/file-http-base-expected.txt
+++ b/LayoutTests/fast/url/file-http-base-expected.txt
@@ -20,7 +20,8 @@ PASS canonicalize('file:///foo/bar.txt') is 'file:///foo/bar.txt'
FAIL canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') should be file://7:////foo/bar.html. Was file:////7:////foo/bar.html.
PASS canonicalize('file:filer/home\\me') is 'file://filer/home/me'
FAIL canonicalize('file:///C:/foo/../../../bar.html') should be file:///C:/bar.html. Was file:///bar.html.
-FAIL canonicalize('file:///C:/asdf#\xc2') should be file:///C:/asdf#�. Was file:///C:/asdf#%C2.
+FAIL canonicalize('file:///C:/asdf#\xc2') should be file:///C:/asdf#Â. Was file:///C:/asdf#%C2.
+FAIL canonicalize('file:///C:/asdf#Â') should be file:///C:/asdf#Â. Was file:///C:/asdf#%C2.
PASS canonicalize('file:///home/me') is 'file:///home/me'
FAIL canonicalize('file:c:\\foo\\bar.html') should be file:///c:/foo/bar.html. Was file://c:/foo/bar.html.
FAIL canonicalize('file:c|//foo\\bar.html') should be file:///c%7C//foo/bar.html. Was file://c|//foo/bar.html.
diff --git a/LayoutTests/fast/url/mailto-expected.txt b/LayoutTests/fast/url/mailto-expected.txt
index cd318f9..dc49e91 100644
--- a/LayoutTests/fast/url/mailto-expected.txt
+++ b/LayoutTests/fast/url/mailto-expected.txt
@@ -8,7 +8,7 @@ PASS canonicalize('mailto:addr1@foo.com') is 'mailto:addr1@foo.com'
PASS canonicalize('mailto:addr1 ') is 'mailto:addr1'
PASS canonicalize('mailto:addr1?to=jon') is 'mailto:addr1?to=jon'
PASS canonicalize('mailto:addr1,addr2') is 'mailto:addr1,addr2'
-FAIL canonicalize('mailto:addr1, addr2') should be mailto:addr1, addr2. Was mailto:addr1,%20addr2.
+PASS canonicalize('mailto:addr1, addr2') is 'mailto:addr1, addr2'
PASS canonicalize('mailto:addr1%2caddr2') is 'mailto:addr1%2caddr2'
PASS canonicalize('mailto:𐌀') is 'mailto:%F0%90%8C%80'
PASS canonicalize('mailto:addr1?') is 'mailto:addr1?'
diff --git a/LayoutTests/fast/url/relative-expected.txt b/LayoutTests/fast/url/relative-expected.txt
index 8ee781c..7f93285 100644
--- a/LayoutTests/fast/url/relative-expected.txt
+++ b/LayoutTests/fast/url/relative-expected.txt
@@ -13,9 +13,9 @@ PASS canonicalize(' . ') is 'http://foo/'
PASS canonicalize(' ') is 'http://foo/bar'
PASS canonicalize('http:path') is 'http://host/path'
PASS canonicalize('http:path') is 'http://host/a/path'
-FAIL canonicalize('http:/path') should be http://host/path. Was http:/path.
+FAIL canonicalize('http:/path') should be http://host/path. Was http://path/.
FAIL canonicalize('HTTP:/path') should be http://host/path. Was http:/path.
-FAIL canonicalize('https:host2') should be https://host2/. Was https:host2.
+PASS canonicalize('https:host2') is 'https://host2/'
PASS canonicalize('htto:/host2') is 'htto:/host2'
PASS canonicalize('/b/c/d') is 'http://host/b/c/d'
PASS canonicalize('\\b\\c\\d') is 'http://host/b/c/d'
@@ -42,7 +42,7 @@ FAIL canonicalize('baz.html') should be . Was baz.html.
PASS canonicalize('data:baz') is 'data:baz'
PASS canonicalize('data:/base') is 'data:/base'
PASS canonicalize('http://host/') is 'http://host/'
-FAIL canonicalize('http:host') should be http://host/. Was http:host.
+PASS canonicalize('http:host') is 'http://host/'
PASS canonicalize('./asd:fgh') is 'http://foo/asd:fgh'
PASS canonicalize(':foo') is 'http://foo/:foo'
PASS canonicalize(' hello world') is 'http://foo/hello%20world'
diff --git a/LayoutTests/fast/url/script-tests/file-http-base.js b/LayoutTests/fast/url/script-tests/file-http-base.js
index ca9e734..00965b8 100644
--- a/LayoutTests/fast/url/script-tests/file-http-base.js
+++ b/LayoutTests/fast/url/script-tests/file-http-base.js
@@ -36,7 +36,8 @@ cases = [
// Make sure relative paths can't go above the "C:"
["file:///C:/foo/../../../bar.html", "file:///C:/bar.html"],
// Busted refs shouldn't make the whole thing fail.
- ["file:///C:/asdf#\\xc2", "file:///C:/asdf#\\xef\\xbf\\xbd"],
+ ["file:///C:/asdf#\\xc2", "file:///C:/asdf#\\xc2"],
+ ["file:///C:/asdf#\xc2", "file:///C:/asdf#\xc2"],
// Unix-style paths
["file:///home/me", "file:///home/me"],
diff --git a/LayoutTests/fast/url/script-tests/segments-from-data-url.js b/LayoutTests/fast/url/script-tests/segments-from-data-url.js
index 5c4ae02..9be7142 100644
--- a/LayoutTests/fast/url/script-tests/segments-from-data-url.js
+++ b/LayoutTests/fast/url/script-tests/segments-from-data-url.js
@@ -3,71 +3,71 @@ description("Test URL segmentation");
cases = [
// [URL, [SCHEME, HOST, PORT, PATH, QUERY, REF]]
["http://user:pass@foo:21/bar;par?b#c", ["http:","foo","21","/bar;par","?b","#c"]],
- ["http:foo.com", ["http:","foo.com","0","/","",""]],
- ["\\t :foo.com \\n", [":","","0","","",""]],
- [" foo.com ", [":","","0","","",""]],
- ["a:\\t foo.com", ["a:","","0"," foo.com","",""]],
+ ["http:foo.com", ["http:","foo.com","","/","",""]],
+ ["\\t :foo.com \\n", [":","","","","",""]],
+ [" foo.com ", [":","","","","",""]],
+ ["a:\\t foo.com", ["a:","",""," foo.com","",""]],
["http://f:21/ b ? d # e ", ["http:","f","21","/%20b%20","?%20d%20","# e"]],
- ["http://f:/c", ["http:","f","0","/c","",""]],
+ ["http://f:/c", ["http:","f","","/c","",""]],
["http://f:0/c", ["http:","f","0","/c","",""]],
["http://f:00000000000000/c", ["http:","f","0","/c","",""]],
["http://f:00000000000000000000080/c", ["http:","f","0","/c","",""]],
- ["http://f:b/c", [":","","0","","",""]],
- ["http://f: /c", [":","","0","","",""]],
- ["http://f:\\n/c", [":","","0","","",""]],
- ["http://f:fifty-two/c", [":","","0","","",""]],
+ ["http://f:b/c", [":","","","","",""]],
+ ["http://f: /c", [":","","","","",""]],
+ ["http://f:\\n/c", [":","","","","",""]],
+ ["http://f:fifty-two/c", [":","","","","",""]],
["http://f:999999/c", [":","","0","","",""]],
- ["http://f: 21 / b ? d # e ", [":","","0","","",""]],
- ["", ["data:","","0","text/plain,baseURL","",""]],
- [" \\t", ["data:","","0","text/plain,baseURL","",""]],
- [":foo.com/", [":","","0","","",""]],
- [":foo.com\\\\", [":","","0","","",""]],
- [":", [":","","0","","",""]],
- [":a", [":","","0","","",""]],
- [":/", [":","","0","","",""]],
- [":\\\\", [":","","0","","",""]],
- [":#", [":","","0","","",""]],
- ["#", [":","","0","","",""]],
- ["#/", [":","","0","","",""]],
- ["#\\\\", [":","","0","","",""]],
- ["#;?", [":","","0","","",""]],
- ["?", [":","","0","","",""]],
- ["/", [":","","0","","",""]],
- [":23", [":","","0","","",""]],
- ["/:23", ["data:","","0","/:23","",""]],
- ["//", [":","","0","","",""]],
- ["::", [":","","0","","",""]],
- ["::23", [":","","0","","",""]],
- ["foo://", ["foo:","","0","//","",""]],
+ ["http://f: 21 / b ? d # e ", [":","","","","",""]],
+ ["", ["data:","","","text/plain,baseURL","",""]],
+ [" \\t", ["data:","","","text/plain,baseURL","",""]],
+ [":foo.com/", [":","","","","",""]],
+ [":foo.com\\\\", [":","","","","",""]],
+ [":", [":","","","","",""]],
+ [":a", [":","","","","",""]],
+ [":/", [":","","","","",""]],
+ [":\\\\", [":","","","","",""]],
+ [":#", [":","","","","",""]],
+ ["#", [":","","","","",""]],
+ ["#/", [":","","","","",""]],
+ ["#\\\\", [":","","","","",""]],
+ ["#;?", [":","","","","",""]],
+ ["?", [":","","","","",""]],
+ ["/", [":","","","","",""]],
+ [":23", [":","","","","",""]],
+ ["/:23", ["data:","","","/:23","",""]],
+ ["//", [":","","","","",""]],
+ ["::", [":","","","","",""]],
+ ["::23", [":","","","","",""]],
+ ["foo://", ["foo:","","","//","",""]],
["http://a:b@c:29/d", ["http:","c","29","/d","",""]],
["http::@c:29", ["http:","c","29","/","",""]],
["http://&a:foo(b]c@d:2/", ["http:","d","2","/","",""]],
["http://::@c@d:2", ["http:","d","2","/","",""]],
- ["http://foo.com:b@d/", ["http:","d","0","/","",""]],
- ["http://foo.com/\\\\@", ["http:","foo.com","0","//@","",""]],
- ["http:\\\\\\\\foo.com\\\\", ["http:","foo.com","0","/","",""]],
- ["http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\", ["http:","a","0","/b:c/d@foo.com/","",""]],
- ["foo:/", ["foo:","","0","/","",""]],
- ["foo:/bar.com/", ["foo:","","0","/bar.com/","",""]],
- ["foo://///////", ["foo:","","0","/////////","",""]],
- ["foo://///////bar.com/", ["foo:","","0","/////////bar.com/","",""]],
- ["foo:////://///", ["foo:","","0","////://///","",""]],
- ["c:/foo", ["c:","","0","/foo","",""]],
- ["//foo/bar", [":","","0","","",""]],
- ["http://foo/path;a??e#f#g", ["http:","foo","0","/path;a","??e","#f#g"]],
- ["http://foo/abcd?efgh?ijkl", ["http:","foo","0","/abcd","?efgh?ijkl",""]],
- ["http://foo/abcd#foo?bar", ["http:","foo","0","/abcd","","#foo?bar"]],
- ["[61:24:74]:98", ["data:","","0","text/[61:24:74]:98","",""]],
+ ["http://foo.com:b@d/", ["http:","d","","/","",""]],
+ ["http://foo.com/\\\\@", ["http:","foo.com","","//@","",""]],
+ ["http:\\\\\\\\foo.com\\\\", ["http:","foo.com","","/","",""]],
+ ["http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\", ["http:","a","","/b:c/d@foo.com/","",""]],
+ ["foo:/", ["foo:","","","/","",""]],
+ ["foo:/bar.com/", ["foo:","","","/bar.com/","",""]],
+ ["foo://///////", ["foo:","","","/////////","",""]],
+ ["foo://///////bar.com/", ["foo:","","","/////////bar.com/","",""]],
+ ["foo:////://///", ["foo:","","","////://///","",""]],
+ ["c:/foo", ["c:","","","/foo","",""]],
+ ["//foo/bar", [":","","","","",""]],
+ ["http://foo/path;a??e#f#g", ["http:","foo","","/path;a","??e","#f#g"]],
+ ["http://foo/abcd?efgh?ijkl", ["http:","foo","","/abcd","?efgh?ijkl",""]],
+ ["http://foo/abcd#foo?bar", ["http:","foo","","/abcd","","#foo?bar"]],
+ ["[61:24:74]:98", ["data:","","","text/[61:24:74]:98","",""]],
["http://[61:27]:98", [":","","0","","",""]],
- ["http:[61:27]/:foo", [":","","0","","",""]],
- ["http://[1::2]:3:4", [":","","0","","",""]],
- ["http://2001::1", [":","","0","","",""]],
- ["http://[2001::1", [":","","0","","",""]],
- ["http://2001::1]", [":","","0","","",""]],
- ["http://2001::1]:80", [":","","0","","",""]],
- ["http://[2001::1]", ["http:","[2001::1]","0","/","",""]],
- ["http://[2001::1]:80", ["http:","[2001::1]","0","/","",""]],
- ["http://[[::]]", [":","","0","","",""]],
+ ["http:[61:27]/:foo", [":","","","","",""]],
+ ["http://[1::2]:3:4", [":","","","","",""]],
+ ["http://2001::1", [":","","","","",""]],
+ ["http://[2001::1", [":","","","","",""]],
+ ["http://2001::1]", [":","","","","",""]],
+ ["http://2001::1]:80", [":","","","","",""]],
+ ["http://[2001::1]", ["http:","[2001::1]","","/","",""]],
+ ["http://[2001::1]:80", ["http:","[2001::1]","","/","",""]],
+ ["http://[[::]]", [":","","","","",""]],
];
var originalBaseURL = canonicalize(".");
diff --git a/LayoutTests/fast/url/script-tests/segments.js b/LayoutTests/fast/url/script-tests/segments.js
index c621da1..a83cb61 100644
--- a/LayoutTests/fast/url/script-tests/segments.js
+++ b/LayoutTests/fast/url/script-tests/segments.js
@@ -1,73 +1,104 @@
description("Test URL segmentation");
-cases = [
+cases = [
// [URL, [SCHEME, HOST, PORT, PATH, QUERY, REF]]
["http://user:pass@foo:21/bar;par?b#c", ["http:","foo","21","/bar;par","?b","#c"]],
- ["http:foo.com", ["http:","example.org","0","/foo/foo.com","",""]],
- ["\\t :foo.com \\n", ["http:","example.org","0","/foo/:foo.com","",""]],
- [" foo.com ", ["http:","example.org","0","/foo/foo.com","",""]],
- ["a:\\t foo.com", ["a:","","0"," foo.com","",""]],
+ ["http:foo.com", ["http:","example.org","","/foo/foo.com","",""]],
+ ["\\t :foo.com \\n", ["http:","example.org","","/foo/:foo.com","",""]],
+ [" foo.com ", ["http:","example.org","","/foo/foo.com","",""]],
+ ["a:\\t foo.com", ["a:","",""," foo.com","",""]],
["http://f:21/ b ? d # e ", ["http:","f","21","/%20b%20","?%20d%20","# e"]],
- ["http://f:/c", ["http:","f","0","/c","",""]],
+ ["http://f:/c", ["http:","f","","/c","",""]],
["http://f:0/c", ["http:","f","0","/c","",""]],
["http://f:00000000000000/c", ["http:","f","0","/c","",""]],
["http://f:00000000000000000000080/c", ["http:","f","0","/c","",""]],
- ["http://f:b/c", [":","","0","","",""]],
- ["http://f: /c", [":","","0","","",""]],
- ["http://f:\\n/c", [":","","0","","",""]],
- ["http://f:fifty-two/c", [":","","0","","",""]],
+ ["http://f:b/c", [":","","","","",""]],
+ ["http://f: /c", [":","","","","",""]],
+ ["http://f:\\n/c", [":","","","","",""]],
+ ["http://f:fifty-two/c", [":","","","","",""]],
["http://f:999999/c", [":","","0","","",""]],
- ["http://f: 21 / b ? d # e ", [":","","0","","",""]],
- ["", ["http:","example.org","0","/foo/bar","",""]],
- [" \\t", ["http:","example.org","0","/foo/bar","",""]],
- [":foo.com/", ["http:","example.org","0","/foo/:foo.com/","",""]],
- [":foo.com\\\\", ["http:","example.org","0","/foo/:foo.com/","",""]],
- [":", ["http:","example.org","0","/foo/:","",""]],
- [":a", ["http:","example.org","0","/foo/:a","",""]],
- [":/", ["http:","example.org","0","/foo/:/","",""]],
- [":\\\\", ["http:","example.org","0","/foo/:/","",""]],
- [":#", ["http:","example.org","0","/foo/:","",""]],
- ["#", ["http:","example.org","0","/foo/bar","",""]],
- ["#/", ["http:","example.org","0","/foo/bar","","#/"]],
- ["#\\\\", ["http:","example.org","0","/foo/bar","","#\\\\"]],
- ["#;?", ["http:","example.org","0","/foo/bar","","#;?"]],
- ["?", ["http:","example.org","0","/foo/bar","",""]],
- ["/", ["http:","example.org","0","/","",""]],
- [":23", ["http:","example.org","0","/foo/:23","",""]],
- ["/:23", ["http:","example.org","0","/:23","",""]],
- ["//", [":","","0","","",""]],
- ["::", ["http:","example.org","0","/foo/::","",""]],
- ["::23", ["http:","example.org","0","/foo/::23","",""]],
- ["foo://", ["foo:","","0","//","",""]],
+ ["http://f: 21 / b ? d # e ", [":","","","","",""]],
+ ["", ["http:","example.org","","/foo/bar","",""]],
+ [" \\t", ["http:","example.org","","/foo/bar","",""]],
+ [":foo.com/", ["http:","example.org","","/foo/:foo.com/","",""]],
+ [":foo.com\\\\", ["http:","example.org","","/foo/:foo.com/","",""]],
+ [":", ["http:","example.org","","/foo/:","",""]],
+ [":a", ["http:","example.org","","/foo/:a","",""]],
+ [":/", ["http:","example.org","","/foo/:/","",""]],
+ [":\\\\", ["http:","example.org","","/foo/:/","",""]],
+ [":#", ["http:","example.org","","/foo/:","",""]],
+ ["#", ["http:","example.org","","/foo/bar","",""]],
+ ["#/", ["http:","example.org","","/foo/bar","","#/"]],
+ ["#\\\\", ["http:","example.org","","/foo/bar","","#\\\\"]],
+ ["#;?", ["http:","example.org","","/foo/bar","","#;?"]],
+ ["?", ["http:","example.org","","/foo/bar","",""]],
+ ["/", ["http:","example.org","","/","",""]],
+ [":23", ["http:","example.org","","/foo/:23","",""]],
+ ["/:23", ["http:","example.org","","/:23","",""]],
+ ["//", [":","","","","",""]],
+ ["::", ["http:","example.org","","/foo/::","",""]],
+ ["::23", ["http:","example.org","","/foo/::23","",""]],
+ ["foo://", ["foo:","","","//","",""]],
["http://a:b@c:29/d", ["http:","c","29","/d","",""]],
- ["http::@c:29", ["http:","example.org","0","/foo/:@c:29","",""]],
+ ["http::@c:29", ["http:","example.org","","/foo/:@c:29","",""]],
["http://&a:foo(b]c@d:2/", ["http:","d","2","/","",""]],
["http://::@c@d:2", ["http:","d","2","/","",""]],
- ["http://foo.com:b@d/", ["http:","d","0","/","",""]],
- ["http://foo.com/\\\\@", ["http:","foo.com","0","//@","",""]],
- ["http:\\\\\\\\foo.com\\\\", ["http:","foo.com","0","/","",""]],
- ["http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\", ["http:","a","0","/b:c/d@foo.com/","",""]],
- ["foo:/", ["foo:","","0","/","",""]],
- ["foo:/bar.com/", ["foo:","","0","/bar.com/","",""]],
- ["foo://///////", ["foo:","","0","/////////","",""]],
- ["foo://///////bar.com/", ["foo:","","0","/////////bar.com/","",""]],
- ["foo:////://///", ["foo:","","0","////://///","",""]],
- ["c:/foo", ["c:","","0","/foo","",""]],
- ["//foo/bar", ["http:","foo","0","/bar","",""]],
- ["http://foo/path;a??e#f#g", ["http:","foo","0","/path;a","??e","#f#g"]],
- ["http://foo/abcd?efgh?ijkl", ["http:","foo","0","/abcd","?efgh?ijkl",""]],
- ["http://foo/abcd#foo?bar", ["http:","foo","0","/abcd","","#foo?bar"]],
- ["[61:24:74]:98", ["http:","example.org","0","/foo/[61:24:74]:98","",""]],
+ ["http://foo.com:b@d/", ["http:","d","","/","",""]],
+ ["http://foo.com/\\\\@", ["http:","foo.com","","//@","",""]],
+ ["http:\\\\\\\\foo.com\\\\", ["http:","foo.com","","/","",""]],
+ ["http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\", ["http:","a","","/b:c/d@foo.com/","",""]],
+ ["foo:/", ["foo:","","","/","",""]],
+ ["foo:/bar.com/", ["foo:","","","/bar.com/","",""]],
+ ["foo://///////", ["foo:","","","/////////","",""]],
+ ["foo://///////bar.com/", ["foo:","","","/////////bar.com/","",""]],
+ ["foo:////://///", ["foo:","","","////://///","",""]],
+ ["c:/foo", ["c:","","","/foo","",""]],
+ ["//foo/bar", ["http:","foo","","/bar","",""]],
+ ["http://foo/path;a??e#f#g", ["http:","foo","","/path;a","??e","#f#g"]],
+ ["http://foo/abcd?efgh?ijkl", ["http:","foo","","/abcd","?efgh?ijkl",""]],
+ ["http://foo/abcd#foo?bar", ["http:","foo","","/abcd","","#foo?bar"]],
+ ["[61:24:74]:98", ["http:","example.org","","/foo/[61:24:74]:98","",""]],
["http://[61:27]:98", [":","","0","","",""]],
- ["http:[61:27]/:foo", ["http:","example.org","0","/foo/[61:27]/:foo","",""]],
- ["http://[1::2]:3:4", [":","","0","","",""]],
- ["http://2001::1", [":","","0","","",""]],
- ["http://[2001::1", [":","","0","","",""]],
- ["http://2001::1]", [":","","0","","",""]],
- ["http://2001::1]:80", [":","","0","","",""]],
- ["http://[2001::1]", ["http:","[2001::1]","0","/","",""]],
- ["http://[2001::1]:80", ["http:","[2001::1]","0","/","",""]],
- ["http://[[::]]", [":","","0","","",""]],
+ ["http:[61:27]/:foo", ["http:","example.org","","/foo/[61:27]/:foo","",""]],
+ ["http://[1::2]:3:4", [":","","","","",""]],
+ ["http://2001::1", [":","","","","",""]],
+ ["http://[2001::1", [":","","","","",""]],
+ ["http://2001::1]", [":","","","","",""]],
+ ["http://2001::1]:80", [":","","","","",""]],
+ ["http://[2001::1]", ["http:","[2001::1]","","/","",""]],
+ ["http://[2001::1]:80", ["http:","[2001::1]","","/","",""]],
+ ["http://[[::]]", [":","","","","",""]],
+ ["http:/example.com/", ["http:","example.org","","/example.com/","",""]],
+ ["ftp:/example.com/", ["ftp:","example.com","","/","",""]],
+ ["https:/example.com/", ["https:","example.com","","/","",""]],
+ ["madeupscheme:/example.com/", ["madeupscheme:","","","/example.com/","",""]],
+ ["file:/example.com/", ["file:","","","/example.com/","",""]],
+ ["ftps:/example.com/", ["ftps:","","","/example.com/","",""]],
+ ["gopher:/example.com/", ["gopher:","example.com","","/","",""]],
+ ["ws:/example.com/", ["ws:","example.com","","/","",""]],
+ ["wss:/example.com/", ["wss:","example.com","","/","",""]],
+ ["data:/example.com/", ["data:","","","/example.com/","",""]],
+ ["javascript:/example.com/", ["javascript:","","","/example.com/","",""]],
+ ["mailto:/example.com/", ["mailto:","","","/example.com/","",""]],
+ ["http:example.com/", ["http:","example.org","","/foo/example.com/","",""]],
+ ["ftp:example.com/", ["ftp:","example.com","","/","",""]],
+ ["https:example.com/", ["https:","example.com","","/","",""]],
+ ["madeupscheme:example.com/", ["madeupscheme:","","","example.com/","",""]],
+ ["file:example.com/", ["file:","","","/example.com/","",""]],
+ ["ftps:example.com/", ["ftps:","","","example.com/","",""]],
+ ["gopher:example.com/", ["gopher:","example.com","","/","",""]],
+ ["ws:example.com/", ["ws:","example.com","","/","",""]],
+ ["wss:example.com/", ["wss:","example.com","","/","",""]],
+ ["data:example.com/", ["data:","","","example.com/","",""]],
+ ["javascript:example.com/", ["javascript:","","","example.com/","",""]],
+ ["mailto:example.com/", ["mailto:","","","example.com/","",""]],
+
+ ["/a/b/c", ["http:","example.org","","/a/b/c","",""]],
+ ["/a/ /c", ["http:","example.org","","/a/%20/c","",""]],
+ ["/a%2fc", ["http:","example.org","","/a%2fc","",""]],
+ ["/a/%2f/c", ["http:","example.org","","/a/%2f/c","",""]],
+
+ ["#\u03B2", ["http:","example.org","","/foo/bar","","#\u03B2"]],
];
var originalBaseURL = canonicalize(".");
diff --git a/LayoutTests/fast/url/script-tests/standard-url.js b/LayoutTests/fast/url/script-tests/standard-url.js
index 03808a8..5611faa 100644
--- a/LayoutTests/fast/url/script-tests/standard-url.js
+++ b/LayoutTests/fast/url/script-tests/standard-url.js
@@ -1,8 +1,10 @@
description("Canonicalization of standard URLs");
-cases = [
+cases = [
["http://www.google.com/foo?bar=baz#", "http://www.google.com/foo?bar=baz#"],
+ ["http://www.google.com/foo?bar=baz# \u00bb", "http://www.google.com/foo?bar=baz# \u00bb"],
["http://[www.google.com]/", "http://[www.google.com]/"],
+ ["http://www.google.com", "http://www.google.com/"],
// Disabled because whitespace gets treated different in this API.
// ["ht\ttp:@www.google.com:80/;p?#", "ht%09tp://www.google.com:80/;p?#"],
["http:////////user:@google.com:99?foo", "http://user@google.com:99/?foo"],
@@ -35,6 +37,32 @@ cases = [
["wss://foo:81/", "wss://foo:81/"],
["wss://foo:443/", "wss://foo/"],
["wss://foo:815/", "wss://foo:815/"],
+ ["http:/example.com/", "http://example.com/"],
+ ["ftp:/example.com/", "ftp://example.com/"],
+ ["https:/example.com/", "https://example.com/"],
+ ["madeupscheme:/example.com/", "madeupscheme:/example.com/"],
+ ["file:/example.com/", "file://localhost/example.com/"],
+ ["ftps:/example.com/", "ftps:/example.com/"],
+ ["gopher:/example.com/", "gopher://example.com/"],
+ ["ws:/example.com/", "ws://example.com/"],
+ ["wss:/example.com/", "wss://example.com/"],
+ ["data:/example.com/", "data:/example.com/"],
+ ["javascript:/example.com/", "javascript:/example.com/"],
+ ["mailto:/example.com/", "mailto:/example.com/"],
+ ["http:example.com/", "http://example.com/"],
+ ["ftp:example.com/", "ftp://example.com/"],
+ ["https:example.com/", "https://example.com/"],
+ ["madeupscheme:example.com/", "madeupscheme:example.com/"],
+ ["ftps:example.com/", "ftps:example.com/"],
+ ["gopher:example.com/", "gopher://example.com/"],
+ ["ws:example.com/", "ws://example.com/"],
+ ["wss:example.com/", "wss://example.com/"],
+ ["data:example.com/", "data:example.com/"],
+ ["javascript:example.com/", "javascript:example.com/"],
+ ["mailto:example.com/", "mailto:example.com/"],
+ // Escaping of non hierarchical URLs
+ ["javascript:alert(\\t 1 \\n\\r)", "javascript:alert( 1 )"],
+ ['javascript:alert(" \1 \u03B2 ")', 'javascript:alert(" %01 %CE%B2 ")'],
];
for (var i = 0; i < cases.length; ++i) {
diff --git a/LayoutTests/fast/url/script-tests/trivial-segments.js b/LayoutTests/fast/url/script-tests/trivial-segments.js
index 81edfd1..c19551b 100644
--- a/LayoutTests/fast/url/script-tests/trivial-segments.js
+++ b/LayoutTests/fast/url/script-tests/trivial-segments.js
@@ -2,7 +2,7 @@ description("Test basic features of URL segmentation");
cases = [
// [URL, [SCHEME, HOST, PORT, PATH, QUERY, REF]]
- ["http://example.com/", ["http:", "example.com", "0", "/", "", ""]],
+ ["http://example.com/", ["http:", "example.com", "", "/", "", ""]],
];
var originalBaseURL = canonicalize(".");
diff --git a/LayoutTests/fast/url/segments-expected.txt b/LayoutTests/fast/url/segments-expected.txt
index 659be5f..76e49aa 100644
--- a/LayoutTests/fast/url/segments-expected.txt
+++ b/LayoutTests/fast/url/segments-expected.txt
@@ -4,71 +4,100 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS segments('http://user:pass@foo:21/bar;par?b#c') is '["http:","foo","21","/bar;par","?b","#c"]'
-PASS segments('http:foo.com') is '["http:","example.org","0","/foo/foo.com","",""]'
-PASS segments('\t :foo.com \n') is '["http:","example.org","0","/foo/:foo.com","",""]'
-PASS segments(' foo.com ') is '["http:","example.org","0","/foo/foo.com","",""]'
-PASS segments('a:\t foo.com') is '["a:","","0"," foo.com","",""]'
-FAIL segments('http://f:21/ b ? d # e ') should be ["http:","f","21","/%20b%20","?%20d%20","# e"]. Was ["http:","f","21","/ b ","?%20d%20","# e"].
-PASS segments('http://f:/c') is '["http:","f","0","/c","",""]'
+PASS segments('http:foo.com') is '["http:","example.org","","/foo/foo.com","",""]'
+PASS segments('\t :foo.com \n') is '["http:","example.org","","/foo/:foo.com","",""]'
+PASS segments(' foo.com ') is '["http:","example.org","","/foo/foo.com","",""]'
+PASS segments('a:\t foo.com') is '["a:","",""," foo.com","",""]'
+PASS segments('http://f:21/ b ? d # e ') is '["http:","f","21","/%20b%20","?%20d%20","# e"]'
+PASS segments('http://f:/c') is '["http:","f","","/c","",""]'
PASS segments('http://f:0/c') is '["http:","f","0","/c","",""]'
PASS segments('http://f:00000000000000/c') is '["http:","f","0","/c","",""]'
FAIL segments('http://f:00000000000000000000080/c') should be ["http:","f","0","/c","",""]. Was ["http:","f","80","/c","",""].
-PASS segments('http://f:b/c') is '[":","","0","","",""]'
-PASS segments('http://f: /c') is '[":","","0","","",""]'
-PASS segments('http://f:\n/c') is '[":","","0","","",""]'
-PASS segments('http://f:fifty-two/c') is '[":","","0","","",""]'
+PASS segments('http://f:b/c') is '[":","","","","",""]'
+PASS segments('http://f: /c') is '[":","","","","",""]'
+PASS segments('http://f:\n/c') is '[":","","","","",""]'
+PASS segments('http://f:fifty-two/c') is '[":","","","","",""]'
FAIL segments('http://f:999999/c') should be [":","","0","","",""]. Was ["http:","f","65535","/c","",""].
-PASS segments('http://f: 21 / b ? d # e ') is '[":","","0","","",""]'
-PASS segments('') is '["http:","example.org","0","/foo/bar","",""]'
-PASS segments(' \t') is '["http:","example.org","0","/foo/bar","",""]'
-PASS segments(':foo.com/') is '["http:","example.org","0","/foo/:foo.com/","",""]'
-PASS segments(':foo.com\\') is '["http:","example.org","0","/foo/:foo.com/","",""]'
-PASS segments(':') is '["http:","example.org","0","/foo/:","",""]'
-PASS segments(':a') is '["http:","example.org","0","/foo/:a","",""]'
-PASS segments(':/') is '["http:","example.org","0","/foo/:/","",""]'
-PASS segments(':\\') is '["http:","example.org","0","/foo/:/","",""]'
-PASS segments(':#') is '["http:","example.org","0","/foo/:","",""]'
-PASS segments('#') is '["http:","example.org","0","/foo/bar","",""]'
-PASS segments('#/') is '["http:","example.org","0","/foo/bar","","#/"]'
-PASS segments('#\\') is '["http:","example.org","0","/foo/bar","","#\\\\"]'
-PASS segments('#;?') is '["http:","example.org","0","/foo/bar","","#;?"]'
-PASS segments('?') is '["http:","example.org","0","/foo/bar","",""]'
-PASS segments('/') is '["http:","example.org","0","/","",""]'
-PASS segments(':23') is '["http:","example.org","0","/foo/:23","",""]'
-PASS segments('/:23') is '["http:","example.org","0","/:23","",""]'
-FAIL segments('//') should be [":","","0","","",""]. Was ["http:","","0","/","",""].
-PASS segments('::') is '["http:","example.org","0","/foo/::","",""]'
-PASS segments('::23') is '["http:","example.org","0","/foo/::23","",""]'
-PASS segments('foo://') is '["foo:","","0","//","",""]'
+PASS segments('http://f: 21 / b ? d # e ') is '[":","","","","",""]'
+PASS segments('') is '["http:","example.org","","/foo/bar","",""]'
+PASS segments(' \t') is '["http:","example.org","","/foo/bar","",""]'
+PASS segments(':foo.com/') is '["http:","example.org","","/foo/:foo.com/","",""]'
+PASS segments(':foo.com\\') is '["http:","example.org","","/foo/:foo.com/","",""]'
+PASS segments(':') is '["http:","example.org","","/foo/:","",""]'
+PASS segments(':a') is '["http:","example.org","","/foo/:a","",""]'
+PASS segments(':/') is '["http:","example.org","","/foo/:/","",""]'
+PASS segments(':\\') is '["http:","example.org","","/foo/:/","",""]'
+PASS segments(':#') is '["http:","example.org","","/foo/:","",""]'
+PASS segments('#') is '["http:","example.org","","/foo/bar","",""]'
+PASS segments('#/') is '["http:","example.org","","/foo/bar","","#/"]'
+PASS segments('#\\') is '["http:","example.org","","/foo/bar","","#\\\\"]'
+PASS segments('#;?') is '["http:","example.org","","/foo/bar","","#;?"]'
+PASS segments('?') is '["http:","example.org","","/foo/bar","",""]'
+PASS segments('/') is '["http:","example.org","","/","",""]'
+PASS segments(':23') is '["http:","example.org","","/foo/:23","",""]'
+PASS segments('/:23') is '["http:","example.org","","/:23","",""]'
+FAIL segments('//') should be [":","","","","",""]. Was ["http:","","","/","",""].
+PASS segments('::') is '["http:","example.org","","/foo/::","",""]'
+PASS segments('::23') is '["http:","example.org","","/foo/::23","",""]'
+PASS segments('foo://') is '["foo:","","","//","",""]'
PASS segments('http://a:b@c:29/d') is '["http:","c","29","/d","",""]'
-PASS segments('http::@c:29') is '["http:","example.org","0","/foo/:@c:29","",""]'
-FAIL segments('http://&a:foo(b]c@d:2/') should be ["http:","d","2","/","",""]. Was [":","","0","","",""].
-FAIL segments('http://::@c@d:2') should be ["http:","d","2","/","",""]. Was [":","","0","","",""].
-PASS segments('http://foo.com:b@d/') is '["http:","d","0","/","",""]'
-PASS segments('http://foo.com/\\@') is '["http:","foo.com","0","//@","",""]'
-PASS segments('http:\\\\foo.com\\') is '["http:","foo.com","0","/","",""]'
-PASS segments('http:\\\\a\\b:c\\d@foo.com\\') is '["http:","a","0","/b:c/d@foo.com/","",""]'
-PASS segments('foo:/') is '["foo:","","0","/","",""]'
-PASS segments('foo:/bar.com/') is '["foo:","","0","/bar.com/","",""]'
-PASS segments('foo://///////') is '["foo:","","0","/////////","",""]'
-PASS segments('foo://///////bar.com/') is '["foo:","","0","/////////bar.com/","",""]'
-PASS segments('foo:////://///') is '["foo:","","0","////://///","",""]'
-PASS segments('c:/foo') is '["c:","","0","/foo","",""]'
-PASS segments('//foo/bar') is '["http:","foo","0","/bar","",""]'
-PASS segments('http://foo/path;a??e#f#g') is '["http:","foo","0","/path;a","??e","#f#g"]'
-PASS segments('http://foo/abcd?efgh?ijkl') is '["http:","foo","0","/abcd","?efgh?ijkl",""]'
-PASS segments('http://foo/abcd#foo?bar') is '["http:","foo","0","/abcd","","#foo?bar"]'
-PASS segments('[61:24:74]:98') is '["http:","example.org","0","/foo/[61:24:74]:98","",""]'
+PASS segments('http::@c:29') is '["http:","example.org","","/foo/:@c:29","",""]'
+FAIL segments('http://&a:foo(b]c@d:2/') should be ["http:","d","2","/","",""]. Was [":","","","","",""].
+FAIL segments('http://::@c@d:2') should be ["http:","d","2","/","",""]. Was [":","","","","",""].
+PASS segments('http://foo.com:b@d/') is '["http:","d","","/","",""]'
+PASS segments('http://foo.com/\\@') is '["http:","foo.com","","//@","",""]'
+PASS segments('http:\\\\foo.com\\') is '["http:","foo.com","","/","",""]'
+PASS segments('http:\\\\a\\b:c\\d@foo.com\\') is '["http:","a","","/b:c/d@foo.com/","",""]'
+PASS segments('foo:/') is '["foo:","","","/","",""]'
+PASS segments('foo:/bar.com/') is '["foo:","","","/bar.com/","",""]'
+PASS segments('foo://///////') is '["foo:","","","/////////","",""]'
+PASS segments('foo://///////bar.com/') is '["foo:","","","/////////bar.com/","",""]'
+PASS segments('foo:////://///') is '["foo:","","","////://///","",""]'
+PASS segments('c:/foo') is '["c:","","","/foo","",""]'
+PASS segments('//foo/bar') is '["http:","foo","","/bar","",""]'
+PASS segments('http://foo/path;a??e#f#g') is '["http:","foo","","/path;a","??e","#f#g"]'
+PASS segments('http://foo/abcd?efgh?ijkl') is '["http:","foo","","/abcd","?efgh?ijkl",""]'
+PASS segments('http://foo/abcd#foo?bar') is '["http:","foo","","/abcd","","#foo?bar"]'
+PASS segments('[61:24:74]:98') is '["http:","example.org","","/foo/[61:24:74]:98","",""]'
FAIL segments('http://[61:27]:98') should be [":","","0","","",""]. Was ["http:","[61:27]","98","/","",""].
-PASS segments('http:[61:27]/:foo') is '["http:","example.org","0","/foo/[61:27]/:foo","",""]'
-PASS segments('http://[1::2]:3:4') is '[":","","0","","",""]'
-PASS segments('http://2001::1') is '[":","","0","","",""]'
-PASS segments('http://[2001::1') is '[":","","0","","",""]'
-PASS segments('http://2001::1]') is '[":","","0","","",""]'
-PASS segments('http://2001::1]:80') is '[":","","0","","",""]'
-PASS segments('http://[2001::1]') is '["http:","[2001::1]","0","/","",""]'
-PASS segments('http://[2001::1]:80') is '["http:","[2001::1]","0","/","",""]'
-PASS segments('http://[[::]]') is '[":","","0","","",""]'
+PASS segments('http:[61:27]/:foo') is '["http:","example.org","","/foo/[61:27]/:foo","",""]'
+PASS segments('http://[1::2]:3:4') is '[":","","","","",""]'
+PASS segments('http://2001::1') is '[":","","","","",""]'
+PASS segments('http://[2001::1') is '[":","","","","",""]'
+PASS segments('http://2001::1]') is '[":","","","","",""]'
+PASS segments('http://2001::1]:80') is '[":","","","","",""]'
+PASS segments('http://[2001::1]') is '["http:","[2001::1]","","/","",""]'
+PASS segments('http://[2001::1]:80') is '["http:","[2001::1]","","/","",""]'
+PASS segments('http://[[::]]') is '[":","","","","",""]'
+FAIL segments('http:/example.com/') should be ["http:","example.org","","/example.com/","",""]. Was ["http:","example.com","","/","",""].
+PASS segments('ftp:/example.com/') is '["ftp:","example.com","","/","",""]'
+PASS segments('https:/example.com/') is '["https:","example.com","","/","",""]'
+PASS segments('madeupscheme:/example.com/') is '["madeupscheme:","","","/example.com/","",""]'
+PASS segments('file:/example.com/') is '["file:","","","/example.com/","",""]'
+PASS segments('ftps:/example.com/') is '["ftps:","","","/example.com/","",""]'
+PASS segments('gopher:/example.com/') is '["gopher:","example.com","","/","",""]'
+PASS segments('ws:/example.com/') is '["ws:","example.com","","/","",""]'
+PASS segments('wss:/example.com/') is '["wss:","example.com","","/","",""]'
+PASS segments('data:/example.com/') is '["data:","","","/example.com/","",""]'
+PASS segments('javascript:/example.com/') is '["javascript:","","","/example.com/","",""]'
+PASS segments('mailto:/example.com/') is '["mailto:","","","/example.com/","",""]'
+PASS segments('http:example.com/') is '["http:","example.org","","/foo/example.com/","",""]'
+PASS segments('ftp:example.com/') is '["ftp:","example.com","","/","",""]'
+PASS segments('https:example.com/') is '["https:","example.com","","/","",""]'
+PASS segments('madeupscheme:example.com/') is '["madeupscheme:","","","example.com/","",""]'
+FAIL segments('file:example.com/') should be ["file:","","","/example.com/","",""]. Was ["file:","","","example.com/","",""].
+PASS segments('ftps:example.com/') is '["ftps:","","","example.com/","",""]'
+PASS segments('gopher:example.com/') is '["gopher:","example.com","","/","",""]'
+PASS segments('ws:example.com/') is '["ws:","example.com","","/","",""]'
+PASS segments('wss:example.com/') is '["wss:","example.com","","/","",""]'
+PASS segments('data:example.com/') is '["data:","","","example.com/","",""]'
+PASS segments('javascript:example.com/') is '["javascript:","","","example.com/","",""]'
+PASS segments('mailto:example.com/') is '["mailto:","","","example.com/","",""]'
+PASS segments('/a/b/c') is '["http:","example.org","","/a/b/c","",""]'
+PASS segments('/a/ /c') is '["http:","example.org","","/a/%20/c","",""]'
+PASS segments('/a%2fc') is '["http:","example.org","","/a%2fc","",""]'
+PASS segments('/a/%2f/c') is '["http:","example.org","","/a/%2f/c","",""]'
+FAIL segments('#β') should be ["http:","example.org","","/foo/bar","","#β"]. Was ["http:","example.org","","/foo/bar","","#%CE%B2"].
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/url/segments-from-data-url-expected.txt b/LayoutTests/fast/url/segments-from-data-url-expected.txt
index b97e489..c64aefc 100644
--- a/LayoutTests/fast/url/segments-from-data-url-expected.txt
+++ b/LayoutTests/fast/url/segments-from-data-url-expected.txt
@@ -4,71 +4,71 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS segments('http://user:pass@foo:21/bar;par?b#c') is '["http:","foo","21","/bar;par","?b","#c"]'
-FAIL segments('http:foo.com') should be ["http:","foo.com","0","/","",""]. Was ["http:","","0","foo.com","",""].
-PASS segments('\t :foo.com \n') is '[":","","0","","",""]'
-PASS segments(' foo.com ') is '[":","","0","","",""]'
-PASS segments('a:\t foo.com') is '["a:","","0"," foo.com","",""]'
-FAIL segments('http://f:21/ b ? d # e ') should be ["http:","f","21","/%20b%20","?%20d%20","# e"]. Was ["http:","f","21","/ b ","?%20d%20","# e"].
-PASS segments('http://f:/c') is '["http:","f","0","/c","",""]'
+PASS segments('http:foo.com') is '["http:","foo.com","","/","",""]'
+PASS segments('\t :foo.com \n') is '[":","","","","",""]'
+PASS segments(' foo.com ') is '[":","","","","",""]'
+PASS segments('a:\t foo.com') is '["a:","",""," foo.com","",""]'
+PASS segments('http://f:21/ b ? d # e ') is '["http:","f","21","/%20b%20","?%20d%20","# e"]'
+PASS segments('http://f:/c') is '["http:","f","","/c","",""]'
PASS segments('http://f:0/c') is '["http:","f","0","/c","",""]'
PASS segments('http://f:00000000000000/c') is '["http:","f","0","/c","",""]'
FAIL segments('http://f:00000000000000000000080/c') should be ["http:","f","0","/c","",""]. Was ["http:","f","80","/c","",""].
-PASS segments('http://f:b/c') is '[":","","0","","",""]'
-PASS segments('http://f: /c') is '[":","","0","","",""]'
-PASS segments('http://f:\n/c') is '[":","","0","","",""]'
-PASS segments('http://f:fifty-two/c') is '[":","","0","","",""]'
+PASS segments('http://f:b/c') is '[":","","","","",""]'
+PASS segments('http://f: /c') is '[":","","","","",""]'
+PASS segments('http://f:\n/c') is '[":","","","","",""]'
+PASS segments('http://f:fifty-two/c') is '[":","","","","",""]'
FAIL segments('http://f:999999/c') should be [":","","0","","",""]. Was ["http:","f","65535","/c","",""].
-PASS segments('http://f: 21 / b ? d # e ') is '[":","","0","","",""]'
-FAIL segments('') should be ["data:","","0","text/plain,baseURL","",""]. Was [":","","0","","",""].
-FAIL segments(' \t') should be ["data:","","0","text/plain,baseURL","",""]. Was [":","","0","","",""].
-PASS segments(':foo.com/') is '[":","","0","","",""]'
-PASS segments(':foo.com\\') is '[":","","0","","",""]'
-PASS segments(':') is '[":","","0","","",""]'
-PASS segments(':a') is '[":","","0","","",""]'
-PASS segments(':/') is '[":","","0","","",""]'
-PASS segments(':\\') is '[":","","0","","",""]'
-PASS segments(':#') is '[":","","0","","",""]'
-FAIL segments('#') should be [":","","0","","",""]. Was ["data:","","0","text/plain,baseURL","",""].
-FAIL segments('#/') should be [":","","0","","",""]. Was ["data:","","0","text/plain,baseURL","","#/"].
-FAIL segments('#\\') should be [":","","0","","",""]. Was ["data:","","0","text/plain,baseURL","","#\\"].
-FAIL segments('#;?') should be [":","","0","","",""]. Was ["data:","","0","text/plain,baseURL","","#;?"].
-PASS segments('?') is '[":","","0","","",""]'
-PASS segments('/') is '[":","","0","","",""]'
-PASS segments(':23') is '[":","","0","","",""]'
-FAIL segments('/:23') should be ["data:","","0","/:23","",""]. Was [":","","0","","",""].
-PASS segments('//') is '[":","","0","","",""]'
-PASS segments('::') is '[":","","0","","",""]'
-PASS segments('::23') is '[":","","0","","",""]'
-PASS segments('foo://') is '["foo:","","0","//","",""]'
+PASS segments('http://f: 21 / b ? d # e ') is '[":","","","","",""]'
+FAIL segments('') should be ["data:","","","text/plain,baseURL","",""]. Was [":","","","","",""].
+FAIL segments(' \t') should be ["data:","","","text/plain,baseURL","",""]. Was [":","","","","",""].
+PASS segments(':foo.com/') is '[":","","","","",""]'
+PASS segments(':foo.com\\') is '[":","","","","",""]'
+PASS segments(':') is '[":","","","","",""]'
+PASS segments(':a') is '[":","","","","",""]'
+PASS segments(':/') is '[":","","","","",""]'
+PASS segments(':\\') is '[":","","","","",""]'
+PASS segments(':#') is '[":","","","","",""]'
+FAIL segments('#') should be [":","","","","",""]. Was ["data:","","","text/plain,baseURL","",""].
+FAIL segments('#/') should be [":","","","","",""]. Was ["data:","","","text/plain,baseURL","","#/"].
+FAIL segments('#\\') should be [":","","","","",""]. Was ["data:","","","text/plain,baseURL","","#\\"].
+FAIL segments('#;?') should be [":","","","","",""]. Was ["data:","","","text/plain,baseURL","","#;?"].
+PASS segments('?') is '[":","","","","",""]'
+PASS segments('/') is '[":","","","","",""]'
+PASS segments(':23') is '[":","","","","",""]'
+FAIL segments('/:23') should be ["data:","","","/:23","",""]. Was [":","","","","",""].
+PASS segments('//') is '[":","","","","",""]'
+PASS segments('::') is '[":","","","","",""]'
+PASS segments('::23') is '[":","","","","",""]'
+PASS segments('foo://') is '["foo:","","","//","",""]'
PASS segments('http://a:b@c:29/d') is '["http:","c","29","/d","",""]'
-FAIL segments('http::@c:29') should be ["http:","c","29","/","",""]. Was ["http:","","0",":@c:29","",""].
-FAIL segments('http://&a:foo(b]c@d:2/') should be ["http:","d","2","/","",""]. Was [":","","0","","",""].
-FAIL segments('http://::@c@d:2') should be ["http:","d","2","/","",""]. Was [":","","0","","",""].
-PASS segments('http://foo.com:b@d/') is '["http:","d","0","/","",""]'
-PASS segments('http://foo.com/\\@') is '["http:","foo.com","0","//@","",""]'
-PASS segments('http:\\\\foo.com\\') is '["http:","foo.com","0","/","",""]'
-PASS segments('http:\\\\a\\b:c\\d@foo.com\\') is '["http:","a","0","/b:c/d@foo.com/","",""]'
-PASS segments('foo:/') is '["foo:","","0","/","",""]'
-PASS segments('foo:/bar.com/') is '["foo:","","0","/bar.com/","",""]'
-PASS segments('foo://///////') is '["foo:","","0","/////////","",""]'
-PASS segments('foo://///////bar.com/') is '["foo:","","0","/////////bar.com/","",""]'
-PASS segments('foo:////://///') is '["foo:","","0","////://///","",""]'
-PASS segments('c:/foo') is '["c:","","0","/foo","",""]'
-PASS segments('//foo/bar') is '[":","","0","","",""]'
-PASS segments('http://foo/path;a??e#f#g') is '["http:","foo","0","/path;a","??e","#f#g"]'
-PASS segments('http://foo/abcd?efgh?ijkl') is '["http:","foo","0","/abcd","?efgh?ijkl",""]'
-PASS segments('http://foo/abcd#foo?bar') is '["http:","foo","0","/abcd","","#foo?bar"]'
-FAIL segments('[61:24:74]:98') should be ["data:","","0","text/[61:24:74]:98","",""]. Was [":","","0","","",""].
+PASS segments('http::@c:29') is '["http:","c","29","/","",""]'
+FAIL segments('http://&a:foo(b]c@d:2/') should be ["http:","d","2","/","",""]. Was [":","","","","",""].
+FAIL segments('http://::@c@d:2') should be ["http:","d","2","/","",""]. Was [":","","","","",""].
+PASS segments('http://foo.com:b@d/') is '["http:","d","","/","",""]'
+PASS segments('http://foo.com/\\@') is '["http:","foo.com","","//@","",""]'
+PASS segments('http:\\\\foo.com\\') is '["http:","foo.com","","/","",""]'
+PASS segments('http:\\\\a\\b:c\\d@foo.com\\') is '["http:","a","","/b:c/d@foo.com/","",""]'
+PASS segments('foo:/') is '["foo:","","","/","",""]'
+PASS segments('foo:/bar.com/') is '["foo:","","","/bar.com/","",""]'
+PASS segments('foo://///////') is '["foo:","","","/////////","",""]'
+PASS segments('foo://///////bar.com/') is '["foo:","","","/////////bar.com/","",""]'
+PASS segments('foo:////://///') is '["foo:","","","////://///","",""]'
+PASS segments('c:/foo') is '["c:","","","/foo","",""]'
+PASS segments('//foo/bar') is '[":","","","","",""]'
+PASS segments('http://foo/path;a??e#f#g') is '["http:","foo","","/path;a","??e","#f#g"]'
+PASS segments('http://foo/abcd?efgh?ijkl') is '["http:","foo","","/abcd","?efgh?ijkl",""]'
+PASS segments('http://foo/abcd#foo?bar') is '["http:","foo","","/abcd","","#foo?bar"]'
+FAIL segments('[61:24:74]:98') should be ["data:","","","text/[61:24:74]:98","",""]. Was [":","","","","",""].
FAIL segments('http://[61:27]:98') should be [":","","0","","",""]. Was ["http:","[61:27]","98","/","",""].
-FAIL segments('http:[61:27]/:foo') should be [":","","0","","",""]. Was ["http:","","0","[61:27]/:foo","",""].
-PASS segments('http://[1::2]:3:4') is '[":","","0","","",""]'
-PASS segments('http://2001::1') is '[":","","0","","",""]'
-PASS segments('http://[2001::1') is '[":","","0","","",""]'
-PASS segments('http://2001::1]') is '[":","","0","","",""]'
-PASS segments('http://2001::1]:80') is '[":","","0","","",""]'
-PASS segments('http://[2001::1]') is '["http:","[2001::1]","0","/","",""]'
-PASS segments('http://[2001::1]:80') is '["http:","[2001::1]","0","/","",""]'
-PASS segments('http://[[::]]') is '[":","","0","","",""]'
+FAIL segments('http:[61:27]/:foo') should be [":","","","","",""]. Was ["http:","[61:27]","","/:foo","",""].
+PASS segments('http://[1::2]:3:4') is '[":","","","","",""]'
+PASS segments('http://2001::1') is '[":","","","","",""]'
+PASS segments('http://[2001::1') is '[":","","","","",""]'
+PASS segments('http://2001::1]') is '[":","","","","",""]'
+PASS segments('http://2001::1]:80') is '[":","","","","",""]'
+PASS segments('http://[2001::1]') is '["http:","[2001::1]","","/","",""]'
+PASS segments('http://[2001::1]:80') is '["http:","[2001::1]","","/","",""]'
+PASS segments('http://[[::]]') is '[":","","","","",""]'
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/url/segments.html b/LayoutTests/fast/url/segments.html
index 5cc2f82..96aa871 100644
--- a/LayoutTests/fast/url/segments.html
+++ b/LayoutTests/fast/url/segments.html
@@ -1,6 +1,7 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<!DOCTYPE html>
<html>
<head>
+<meta charset="utf-8">
<link rel="stylesheet" href="../js/resources/js-test-style.css">
<script src="../js/resources/js-test-pre.js"></script>
<script src="resources/utilities.js"></script>
diff --git a/LayoutTests/fast/url/standard-url-expected.txt b/LayoutTests/fast/url/standard-url-expected.txt
index 5312e07..d274059 100644
--- a/LayoutTests/fast/url/standard-url-expected.txt
+++ b/LayoutTests/fast/url/standard-url-expected.txt
@@ -4,7 +4,9 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS canonicalize('http://www.google.com/foo?bar=baz#') is 'http://www.google.com/foo?bar=baz#'
+FAIL canonicalize('http://www.google.com/foo?bar=baz# »') should be http://www.google.com/foo?bar=baz# ». Was http://www.google.com/foo?bar=baz# %BB.
PASS canonicalize('http://[www.google.com]/') is 'http://[www.google.com]/'
+PASS canonicalize('http://www.google.com') is 'http://www.google.com/'
FAIL canonicalize('http:////////user:@google.com:99?foo') should be http://user@google.com:99/?foo. Was http://////user:@google.com:99?foo.
FAIL canonicalize('http://192.0x00A80001') should be http://192.168.0.1/. Was http://192.0x00A80001/.
FAIL canonicalize('http://www/foo%2Ehtml') should be http://www/foo.html. Was http://www/foo%2Ehtml.
@@ -30,6 +32,31 @@ PASS canonicalize('wss://foo:80/') is 'wss://foo:80/'
PASS canonicalize('wss://foo:81/') is 'wss://foo:81/'
PASS canonicalize('wss://foo:443/') is 'wss://foo/'
PASS canonicalize('wss://foo:815/') is 'wss://foo:815/'
+PASS canonicalize('http:/example.com/') is 'http://example.com/'
+PASS canonicalize('ftp:/example.com/') is 'ftp://example.com/'
+PASS canonicalize('https:/example.com/') is 'https://example.com/'
+PASS canonicalize('madeupscheme:/example.com/') is 'madeupscheme:/example.com/'
+FAIL canonicalize('file:/example.com/') should be file://localhost/example.com/. Was file:///example.com/.
+PASS canonicalize('ftps:/example.com/') is 'ftps:/example.com/'
+PASS canonicalize('gopher:/example.com/') is 'gopher://example.com/'
+PASS canonicalize('ws:/example.com/') is 'ws://example.com/'
+PASS canonicalize('wss:/example.com/') is 'wss://example.com/'
+PASS canonicalize('data:/example.com/') is 'data:/example.com/'
+PASS canonicalize('javascript:/example.com/') is 'javascript:/example.com/'
+PASS canonicalize('mailto:/example.com/') is 'mailto:/example.com/'
+PASS canonicalize('http:example.com/') is 'http://example.com/'
+PASS canonicalize('ftp:example.com/') is 'ftp://example.com/'
+PASS canonicalize('https:example.com/') is 'https://example.com/'
+PASS canonicalize('madeupscheme:example.com/') is 'madeupscheme:example.com/'
+PASS canonicalize('ftps:example.com/') is 'ftps:example.com/'
+PASS canonicalize('gopher:example.com/') is 'gopher://example.com/'
+PASS canonicalize('ws:example.com/') is 'ws://example.com/'
+PASS canonicalize('wss:example.com/') is 'wss://example.com/'
+PASS canonicalize('data:example.com/') is 'data:example.com/'
+PASS canonicalize('javascript:example.com/') is 'javascript:example.com/'
+PASS canonicalize('mailto:example.com/') is 'mailto:example.com/'
+PASS canonicalize('javascript:alert(\t 1 \n\r)') is 'javascript:alert( 1 )'
+PASS canonicalize('javascript:alert("  β ")') is 'javascript:alert(" %01 %CE%B2 ")'
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/url/trivial-segments-expected.txt b/LayoutTests/fast/url/trivial-segments-expected.txt
index 882ff73..4f384fc 100644
--- a/LayoutTests/fast/url/trivial-segments-expected.txt
+++ b/LayoutTests/fast/url/trivial-segments-expected.txt
@@ -3,7 +3,7 @@ Test basic features of URL segmentation
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS segments('http://example.com/') is '["http:","example.com","0","/","",""]'
+PASS segments('http://example.com/') is '["http:","example.com","","/","",""]'
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in
index f110846..c6c76bf 100644
--- a/Source/WebCore/WebCore.exp.in
+++ b/Source/WebCore/WebCore.exp.in
@@ -1595,7 +1595,6 @@ __ZN7WebCore17HTMLPlugInElement11getNPObjectEv
__ZNK7WebCore14SecurityOrigin9canAccessEPKS0_
__ZNK7WebCore4KURL10protocolIsEPKc
__ZNK7WebCore4KURL7hasPathEv
-__ZNK7WebCore4KURL9prettyURLEv
#endif
#if ENABLE(ORIENTATION_EVENTS)
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/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp
index 4636f20..b05e7f5 100644
--- a/Source/WebCore/html/HTMLAnchorElement.cpp
+++ b/Source/WebCore/html/HTMLAnchorElement.cpp
@@ -405,7 +405,10 @@ void HTMLAnchorElement::setPathname(const String& value)
String HTMLAnchorElement::port() const
{
- return String::number(href().port());
+ if (href().hasPort())
+ return String::number(href().port());
+
+ return "";
}
void HTMLAnchorElement::setPort(const String& value)
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 4835a83..fb68a09 100644
--- a/Source/WebCore/page/Location.cpp
+++ b/Source/WebCore/page/Location.cpp
@@ -63,8 +63,7 @@ String Location::href() const
if (!m_frame)
return String();
- const KURL& url = this->url();
- return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/";
+ return url().string();
}
String Location::protocol() const
@@ -83,7 +82,7 @@ String Location::host() const
// Note: this is the IE spec. The NS spec swaps the two, it says
// "The hostname property is the concatenation of the host and port properties, separated by a colon."
const KURL& url = this->url();
- return url.port() ? url.host() + ":" + String::number(url.port()) : url.host();
+ return url.hasPort() ? url.host() + ":" + String::number(url.port()) : url.host();
}
String Location::hostname() const
@@ -100,7 +99,7 @@ String Location::port() const
return String();
const KURL& url = this->url();
- return url.port() ? String::number(url.port()) : "";
+ return url.hasPort() ? String::number(url.port()) : "";
}
String Location::pathname() const
@@ -147,15 +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();
- return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/";
-}
-
void Location::setHref(const String& urlString, DOMWindow* activeWindow, DOMWindow* firstWindow)
{
if (!m_frame)
@@ -199,7 +189,7 @@ void Location::setPort(const String& portString, DOMWindow* activeWindow, DOMWin
return;
KURL url = m_frame->document()->url();
int port = portString.toInt();
- if (port < 0 || port > 0xFFFF)
+ if (port < 0 || port > 0xFFFF || portString.isEmpty())
url.removePort();
else
url.setPort(port);
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 88ad3d9..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)
@@ -866,7 +866,7 @@ void KURL::setPath(const String& s)
parse(m_string.left(m_portEnd) + encodeWithURLEscapeSequences(path) + m_string.substring(m_pathEnd));
}
-String KURL::prettyURL() const
+String KURL::deprecatedString() const
{
if (!m_isValid)
return m_string;
@@ -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;
@@ -1137,6 +1137,23 @@ static inline bool hostPortIsEmptyButCredentialsArePresent(int hostStart, int po
return userEndChar == '@' && hostStart == portEnd;
}
+static bool isNonFileHierarchicalScheme(const char* scheme, size_t schemeLength)
+{
+ switch (schemeLength) {
+ case 2:
+ return equal("ws", 2, scheme, schemeLength);
+ case 3:
+ return equal("ftp", 3, scheme, schemeLength) || equal("wss", 3, scheme, schemeLength);
+ case 4:
+ return equal("http", 4, scheme, schemeLength);
+ case 5:
+ return equal("https", 5, scheme, schemeLength);
+ case 6:
+ return equal("gopher", 6, scheme, schemeLength);
+ }
+ return false;
+}
+
void KURL::parse(const char* url, const String* originalString)
{
if (!url || url[0] == '\0') {
@@ -1173,6 +1190,7 @@ void KURL::parse(const char* url, const String* originalString)
int portEnd;
bool hierarchical = url[schemeEnd + 1] == '/';
+ bool hasSecondSlash = hierarchical && url[schemeEnd + 2] == '/';
bool isFile = schemeEnd == 4
&& matchLetter(url[0], 'f')
@@ -1186,12 +1204,15 @@ void KURL::parse(const char* url, const String* originalString)
&& matchLetter(url[3], 'p')
&& (url[4] == ':' || (matchLetter(url[4], 's') && url[5] == ':'));
- if (hierarchical && url[schemeEnd + 2] == '/') {
+ if ((hierarchical && hasSecondSlash) || isNonFileHierarchicalScheme(url, schemeEnd)) {
// The part after the scheme is either a net_path or an abs_path whose first path segment is empty.
// Attempt to find an authority.
-
// FIXME: Authority characters may be scanned twice, and it would be nice to be faster.
- userStart += 2;
+
+ if (hierarchical)
+ userStart++;
+ if (hasSecondSlash)
+ userStart++;
userEnd = userStart;
int colonPos = 0;
@@ -1394,12 +1415,14 @@ void KURL::parse(const char* url, const String* originalString)
m_userStart = m_userEnd = m_passwordEnd = m_hostEnd = m_portEnd = p - buffer.data();
// For canonicalization, ensure we have a '/' for no path.
- // Do this only for hierarchical URL with protocol http or https.
- if (m_protocolInHTTPFamily && hierarchical && pathEnd == pathStart)
+ // Do this only for URL with protocol http or https.
+ if (m_protocolInHTTPFamily && pathEnd == pathStart)
*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);
@@ -1425,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/KURL.h b/Source/WebCore/platform/KURL.h
index db2dd42..192c10b 100644
--- a/Source/WebCore/platform/KURL.h
+++ b/Source/WebCore/platform/KURL.h
@@ -152,7 +152,9 @@ public:
String baseAsString() const;
- String prettyURL() const;
+ // This function is only used by location.href. It's likely we shouldn't
+ // use it for that purpose, but more study is necessary before we remove it.
+ String deprecatedString() const;
String fileSystemPath() const;
// Returns true if the current URL's protocol is the same as the null-
diff --git a/Source/WebCore/platform/KURLGoogle.cpp b/Source/WebCore/platform/KURLGoogle.cpp
index 0d11b99..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);
}
@@ -670,16 +669,12 @@ void KURL::setPort(unsigned short i)
{
KURLGooglePrivate::Replacements replacements;
String portStr;
- if (i) {
- portStr = String::number(i);
- replacements.SetPort(
- reinterpret_cast<const url_parse::UTF16Char*>(portStr.characters()),
- url_parse::Component(0, portStr.length()));
- } else {
- // Clear any existing port when it is set to 0.
- replacements.ClearPort();
- }
+ portStr = String::number(i);
+ replacements.SetPort(
+ reinterpret_cast<const url_parse::UTF16Char*>(portStr.characters()),
+ url_parse::Component(0, portStr.length()));
+
m_url.replaceComponents(replacements);
}
@@ -772,7 +767,7 @@ void KURL::setPath(const String& path)
// On Mac, this just seems to return the same URL, but with "/foo/bar" for
// file: URLs instead of file:///foo/bar. We don't bother with any of this,
// at least for now.
-String KURL::prettyURL() const
+String KURL::deprecatedString() const
{
if (!m_url.m_isValid)
return String();
diff --git a/Source/WebCore/platform/graphics/android/fonts/GlyphMapAndroid.cpp b/Source/WebCore/platform/graphics/android/fonts/GlyphMapAndroid.cpp
index a327b79..b9798e6 100644
--- a/Source/WebCore/platform/graphics/android/fonts/GlyphMapAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/fonts/GlyphMapAndroid.cpp
@@ -44,12 +44,12 @@ namespace WebCore {
#define NO_BREAK_SPACE_UNICHAR 0xA0
-static int substituteWithVerticalGlyphs(const FontPlatformData& platformData, uint16_t* glyphs, unsigned bufferLength)
+static HB_Error substituteWithVerticalGlyphs(const FontPlatformData& platformData, uint16_t* glyphs, unsigned bufferLength)
{
HB_FaceRec_* hbFace = platformData.harfbuzzFace();
if (!hbFace->gsub) {
// if there is no GSUB table, treat it as not covered
- return 0Xffff;
+ return static_cast<HB_Error>(0Xffff);
}
HB_Buffer buffer;
@@ -60,13 +60,19 @@ static int substituteWithVerticalGlyphs(const FontPlatformData& platformData, ui
HB_UShort scriptIndex;
HB_UShort featureIndex;
- HB_GSUB_Select_Script(hbFace->gsub, HB_MAKE_TAG('D', 'F', 'L', 'T'), &scriptIndex);
+ HB_Error error = HB_GSUB_Select_Script(hbFace->gsub, HB_MAKE_TAG('D', 'F', 'L', 'T'), &scriptIndex);
+ if (error) {
+ if (error != HB_Err_Not_Covered)
+ return error;
+ scriptIndex = HB_Script_Common; // Set script to common script.
+ }
+
HB_GSUB_Select_Feature(hbFace->gsub, HB_MAKE_TAG('v', 'e', 'r', 't'), scriptIndex, 0xffff, &featureIndex);
HB_GSUB_Add_Feature(hbFace->gsub, featureIndex, 1);
HB_GSUB_Select_Feature(hbFace->gsub, HB_MAKE_TAG('v', 'r', 't', '2'), scriptIndex, 0xffff, &featureIndex);
HB_GSUB_Add_Feature(hbFace->gsub, featureIndex, 1);
- int error = HB_GSUB_Apply_String(hbFace->gsub, buffer);
+ error = HB_GSUB_Apply_String(hbFace->gsub, buffer);
if (!error) {
for (unsigned i = 0; i < bufferLength; ++i)
glyphs[i] = static_cast<Glyph>(buffer->out_string[i].gindex);
@@ -74,6 +80,14 @@ static int substituteWithVerticalGlyphs(const FontPlatformData& platformData, ui
return error;
}
+static void convertToVerticalForms(UChar* src, UChar* dest, unsigned bufferLength) {
+ for (unsigned i = 0; i < bufferLength; ++i) {
+ dest[i] = VerticalTextMap::getVerticalForm(src[i]);
+ if (!dest[i])
+ dest[i] = src[i];
+ }
+}
+
bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
{
if (SkUTF16_IsHighSurrogate(buffer[bufferLength-1])) {
@@ -92,11 +106,7 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
if (fontData->platformData().orientation() == Vertical && !fontData->hasVerticalGlyphs()) {
// Convert to vertical form if there is no vertical glyphs.
- for (unsigned i = 0; i < bufferLength; ++i) {
- vTextBuffer[i] = VerticalTextMap::getVerticalForm(buffer[i]);
- if (!vTextBuffer[i])
- vTextBuffer[i] = buffer[i];
- }
+ convertToVerticalForms(buffer, vTextBuffer, bufferLength);
textBuffer = vTextBuffer;
}
@@ -111,11 +121,22 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
for (unsigned i = 0; i < bufferLength; ++i) {
if (!Font::isCJKIdeograph(textBuffer[i])) {
lookVariants = true;
- continue;
+ break;
+ }
+ }
+ if (lookVariants) {
+ if (substituteWithVerticalGlyphs(fontData->platformData(), glyphs, bufferLength)) {
+ // Convert text to vertical forms if substituteWithVerticalGlyphs() fails to access vert tables.
+ convertToVerticalForms(buffer, vTextBuffer, bufferLength);
+ textBuffer = vTextBuffer;
+
+ unsigned count = paint.textToGlyphs(textBuffer, bufferLength << 1, glyphs);
+ if (count != length) {
+ SkDebugf("%s count != length\n", __FUNCTION__);
+ return false;
+ }
}
}
- if (lookVariants)
- substituteWithVerticalGlyphs(fontData->platformData(), glyphs, bufferLength);
}
unsigned allGlyphs = 0; // track if any of the glyphIDs are non-zero
diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
index 81427b8..a02759d 100644
--- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
@@ -884,7 +884,8 @@ void LayerAndroid::onDraw(SkCanvas* canvas, SkScalar opacity,
return;
}
- if (masksToBounds() || !m_content)
+ // only continue drawing if layer is drawable
+ if (!m_content && !m_imageCRC)
return;
// we just have this save/restore for opacity...
diff --git a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
index 26bd55d..9435065 100644
--- a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
@@ -578,16 +578,6 @@ void GLUtils::createTextureWithBitmap(GLuint texture, const SkBitmap& bitmap, GL
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
-
- // The following is a workaround -- remove when EGLImage texture upload is fixed.
- GLuint fboID;
- glGenFramebuffers(1, &fboID);
- glBindFramebuffer(GL_FRAMEBUFFER, fboID);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
- glCheckFramebufferStatus(GL_FRAMEBUFFER); // should return GL_FRAMEBUFFER_COMPLETE
-
- glBindFramebuffer(GL_FRAMEBUFFER, 0); // rebind the standard FBO
- glDeleteFramebuffers(1, &fboID);
}
void GLUtils::updateTextureWithBitmap(GLuint texture, const SkBitmap& bitmap,
diff --git a/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp
index 2510d52..a58a1d2 100644
--- a/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp
@@ -274,8 +274,8 @@ int TileGrid::nbTextures(IntRect& area, float scale)
}
void TileGrid::drawGL(const IntRect& visibleArea, float opacity,
- const TransformationMatrix* transform,
- const Color* background)
+ const TransformationMatrix* transform,
+ const Color* background)
{
m_area = computeTilesArea(visibleArea, m_scale);
if (m_area.width() == 0 || m_area.height() == 0)
@@ -322,7 +322,8 @@ void TileGrid::drawGL(const IntRect& visibleArea, float opacity,
drawn++;
}
- if (semiOpaqueBaseSurface)
+ // log tile information for base, high res tiles
+ if (m_isBaseSurface && background)
TilesManager::instance()->getProfiler()->nextTile(tile, invScale, tileInView);
}
diff --git a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp
index af19f30..a330b41 100644
--- a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp
@@ -203,7 +203,6 @@ void TransferQueue::blitTileFromQueue(GLuint fboID, TileTexture* destTex,
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
ALOGV("Error: glCheckFramebufferStatus failed");
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
return;
}
@@ -426,7 +425,6 @@ void TransferQueue::updateDirtyTiles()
// dynamic switch possible. Moving this out from the loop can save some
// milli-seconds.
if (usedFboForUpload) {
- glBindFramebuffer(GL_FRAMEBUFFER, 0); // rebind the standard FBO
restoreGLState();
GLUtils::checkGlError("updateDirtyTiles");
}
@@ -593,6 +591,7 @@ void TransferQueue::cleanupPendingDiscard()
void TransferQueue::saveGLState()
{
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING, m_GLStateBeforeBlit.bufferId);
glGetIntegerv(GL_VIEWPORT, m_GLStateBeforeBlit.viewport);
glGetBooleanv(GL_SCISSOR_TEST, m_GLStateBeforeBlit.scissor);
glGetBooleanv(GL_DEPTH_TEST, m_GLStateBeforeBlit.depth);
@@ -616,6 +615,7 @@ void TransferQueue::setGLStateForCopy(int width, int height)
void TransferQueue::restoreGLState()
{
+ glBindFramebuffer(GL_FRAMEBUFFER, m_GLStateBeforeBlit.bufferId[0]);
glViewport(m_GLStateBeforeBlit.viewport[0],
m_GLStateBeforeBlit.viewport[1],
m_GLStateBeforeBlit.viewport[2],
diff --git a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.h b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.h
index 65ff116..d1024a4 100644
--- a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.h
+++ b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.h
@@ -40,6 +40,7 @@ class Tile;
class TileTexture;
struct GLState {
+ GLint bufferId[1];
GLint viewport[4];
GLboolean scissor[1];
GLboolean depth[1];
diff --git a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index dc22fca..ec04035 100644
--- a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -180,9 +180,9 @@ static void ensureSessionIsInitialized(SoupSession* session)
g_object_set_data(G_OBJECT(session), "webkit-init", reinterpret_cast<void*>(0xdeadbeef));
}
-void ResourceHandle::prepareForURL(const KURL &url)
+void ResourceHandle::prepareForURL(const KURL& url)
{
- GOwnPtr<SoupURI> soupURI(soup_uri_new(url.prettyURL().utf8().data()));
+ GOwnPtr<SoupURI> soupURI(soup_uri_new(url.string().utf8().data()));
if (!soupURI)
return;
soup_session_prepare_for_uri(ResourceHandle::defaultSession(), soupURI.get());
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/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index a90bf69..42d68a0 100644
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -191,7 +191,7 @@ void RenderBlock::destroy()
childBox->remove();
}
}
- } else if (isInline() && parent())
+ } else if (parent())
parent()->dirtyLinesFromChangedChild(this);
}
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index fb1dd2c..9c40d5b 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -3260,7 +3260,7 @@ bool RenderBox::shrinkToAvoidFloats() const
bool RenderBox::avoidsFloats() const
{
- return isReplaced() || hasOverflowClip() || isHR() || isLegend() || isWritingModeRoot();
+ return isReplaced() || hasOverflowClip() || isHR() || isLegend() || isWritingModeRoot() || isDeprecatedFlexItem();
}
void RenderBox::addShadowOverflow()
diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h
index 1bee989..a5dc1b2 100644
--- a/Source/WebCore/rendering/RenderBox.h
+++ b/Source/WebCore/rendering/RenderBox.h
@@ -378,6 +378,8 @@ public:
virtual void markForPaginationRelayoutIfNeeded() { }
bool isWritingModeRoot() const { return !parent() || parent()->style()->writingMode() != style()->writingMode(); }
+
+ bool isDeprecatedFlexItem() const { return !isInline() && !isFloatingOrPositioned() && parent() && parent()->isFlexibleBox(); }
virtual int lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp
index c27d336..09a7944 100644
--- a/Source/WebCore/rendering/RenderReplaced.cpp
+++ b/Source/WebCore/rendering/RenderReplaced.cpp
@@ -57,6 +57,14 @@ RenderReplaced::~RenderReplaced()
{
}
+void RenderReplaced::destroy()
+{
+ if (!documentBeingDestroyed() && parent())
+ parent()->dirtyLinesFromChangedChild(this);
+
+ RenderBox::destroy();
+}
+
void RenderReplaced::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderBox::styleDidChange(diff, oldStyle);
diff --git a/Source/WebCore/rendering/RenderReplaced.h b/Source/WebCore/rendering/RenderReplaced.h
index d6ebba6..29fc71c 100644
--- a/Source/WebCore/rendering/RenderReplaced.h
+++ b/Source/WebCore/rendering/RenderReplaced.h
@@ -32,6 +32,8 @@ public:
RenderReplaced(Node*, const IntSize& intrinsicSize);
virtual ~RenderReplaced();
+ virtual void destroy();
+
protected:
virtual void layout();
diff --git a/Source/WebCore/rendering/RenderWidget.cpp b/Source/WebCore/rendering/RenderWidget.cpp
index 894d689..97444cd 100644
--- a/Source/WebCore/rendering/RenderWidget.cpp
+++ b/Source/WebCore/rendering/RenderWidget.cpp
@@ -125,6 +125,10 @@ void RenderWidget::destroy()
document()->axObjectCache()->childrenChanged(this->parent());
document()->axObjectCache()->remove(this);
}
+
+ if (!documentBeingDestroyed() && parent())
+ parent()->dirtyLinesFromChangedChild(this);
+
remove();
if (m_hasCounterNodeMap)
diff --git a/Source/WebCore/workers/WorkerLocation.cpp b/Source/WebCore/workers/WorkerLocation.cpp
index b934abd..319a528 100644
--- a/Source/WebCore/workers/WorkerLocation.cpp
+++ b/Source/WebCore/workers/WorkerLocation.cpp
@@ -36,7 +36,7 @@ namespace WebCore {
String WorkerLocation::href() const
{
- return m_url.hasPath() ? m_url.prettyURL() : m_url.prettyURL() + "/";
+ return m_url.string();
}
String WorkerLocation::protocol() const
@@ -74,11 +74,6 @@ String WorkerLocation::hash() const
return m_url.fragmentIdentifier().isEmpty() ? "" : "#" + m_url.fragmentIdentifier();
}
-String WorkerLocation::toString() const
-{
- return m_url.hasPath() ? m_url.prettyURL() : m_url.prettyURL() + "/";
-}
-
} // 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) { }
diff --git a/Source/WebKit/android/jni/WebCoreJni.cpp b/Source/WebKit/android/jni/WebCoreJni.cpp
index 6dfc9f1..72ded59 100644
--- a/Source/WebKit/android/jni/WebCoreJni.cpp
+++ b/Source/WebKit/android/jni/WebCoreJni.cpp
@@ -118,8 +118,10 @@ jobject intRectToRect(JNIEnv* env, const WebCore::IntRect& rect)
ALOG_ASSERT(rectClass, "Could not find android/graphics/Rect");
jmethodID rectInit = env->GetMethodID(rectClass, "<init>", "(IIII)V");
ALOG_ASSERT(rectInit, "Could not find init method on Rect");
- return env->NewObject(rectClass, rectInit, rect.x(), rect.y(),
+ jobject jrect = env->NewObject(rectClass, rectInit, rect.x(), rect.y(),
rect.maxX(), rect.maxY());
+ env->DeleteLocalRef(rectClass);
+ return jrect;
}
jobjectArray intRectVectorToRectArray(JNIEnv* env, Vector<WebCore::IntRect>& rects)
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 0b5989d..ae00941 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -108,6 +108,7 @@
#include "ResourceRequest.h"
#include "RuntimeEnabledFeatures.h"
#include "SchemeRegistry.h"
+#include "ScopedLocalRef.h"
#include "ScriptController.h"
#include "SelectionController.h"
#include "SelectText.h"
@@ -3336,12 +3337,14 @@ jobject WebViewCore::createTextFieldInitData(Node* node)
{
JNIEnv* env = JSC::Bindings::getJNIEnv();
TextFieldInitDataGlue* classDef = m_textFieldInitDataGlue;
- jclass clazz = env->FindClass("android/webkit/WebViewCore$TextFieldInitData");
- jobject initData = env->NewObject(clazz, classDef->m_constructor);
+ ScopedLocalRef<jclass> clazz(env,
+ env->FindClass("android/webkit/WebViewCore$TextFieldInitData"));
+ jobject initData = env->NewObject(clazz.get(), classDef->m_constructor);
env->SetIntField(initData, classDef->m_fieldPointer,
reinterpret_cast<int>(node));
- env->SetObjectField(initData, classDef->m_text,
+ ScopedLocalRef<jstring> inputText(env,
wtfStringToJstring(env, getInputText(node), true));
+ env->SetObjectField(initData, classDef->m_text, inputText.get());
env->SetIntField(initData, classDef->m_type, getInputType(node));
env->SetBooleanField(initData, classDef->m_isSpellCheckEnabled,
isSpellCheckEnabled(node));
@@ -3355,16 +3358,18 @@ jobject WebViewCore::createTextFieldInitData(Node* node)
isTextInput(document->previousFocusableNode(node, tabEvent.get())));
env->SetBooleanField(initData, classDef->m_isAutoCompleteEnabled,
isAutoCompleteEnabled(node));
- env->SetObjectField(initData, classDef->m_name,
+ ScopedLocalRef<jstring> fieldName(env,
wtfStringToJstring(env, getFieldName(node), false));
- env->SetObjectField(initData, classDef->m_name,
+ env->SetObjectField(initData, classDef->m_name, fieldName.get());
+ ScopedLocalRef<jstring> label(env,
wtfStringToJstring(env, requestLabel(document->frame(), node), false));
+ env->SetObjectField(initData, classDef->m_name, label.get());
env->SetIntField(initData, classDef->m_maxLength, getMaxLength(node));
LayerAndroid* layer = 0;
int layerId = platformLayerIdFromNode(node, &layer);
IntRect bounds = absoluteContentRect(node, layer);
- env->SetObjectField(initData, classDef->m_contentBounds,
- intRectToRect(env, bounds));
+ ScopedLocalRef<jobject> jbounds(env, intRectToRect(env, bounds));
+ env->SetObjectField(initData, classDef->m_contentBounds, jbounds.get());
env->SetIntField(initData, classDef->m_nodeLayerId, layerId);
IntRect contentRect;
RenderTextControl* rtc = toRenderTextControl(node);
@@ -3373,8 +3378,8 @@ jobject WebViewCore::createTextFieldInitData(Node* node)
contentRect.setHeight(rtc->scrollHeight());
contentRect.move(-rtc->scrollLeft(), -rtc->scrollTop());
}
- env->SetObjectField(initData, classDef->m_contentRect,
- intRectToRect(env, contentRect));
+ ScopedLocalRef<jobject> jcontentRect(env, intRectToRect(env, contentRect));
+ env->SetObjectField(initData, classDef->m_contentRect, jcontentRect.get());
return initData;
}
@@ -3389,9 +3394,9 @@ void WebViewCore::initEditField(Node* node)
int end = 0;
getSelectionOffsets(node, start, end);
SelectText* selectText = createSelectText(focusedFrame()->selection()->selection());
+ ScopedLocalRef<jobject> initData(env, createTextFieldInitData(node));
env->CallVoidMethod(javaObject.get(), m_javaGlue->m_initEditField,
- start, end, reinterpret_cast<int>(selectText),
- createTextFieldInitData(node));
+ start, end, reinterpret_cast<int>(selectText), initData.get());
checkException(env);
}
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 44ad1c5..22598eb 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -711,13 +711,17 @@ class GLDrawFunctor : Functor {
int titlebarHeight = webViewRect.height() - viewRect.height();
uirenderer::DrawGlInfo* info = reinterpret_cast<uirenderer::DrawGlInfo*>(data);
- WebCore::IntRect localViewRect = viewRect;
- if (info->isLayer)
- localViewRect.move(-1 * localViewRect.x(), -1 * localViewRect.y());
-
WebCore::IntRect clip(info->clipLeft, info->clipTop,
info->clipRight - info->clipLeft,
info->clipBottom - info->clipTop);
+
+ WebCore::IntRect localViewRect = viewRect;
+ if (info->isLayer) {
+ // When webview is on a layer, we need to use the viewport relative
+ // to the FBO, rather than the screen(which will use viewRect).
+ localViewRect.setX(clip.x());
+ localViewRect.setY(info->height - clip.y() - clip.height());
+ }
bool shouldDraw = (messageId == uirenderer::DrawGlInfo::kModeDraw);
TilesManager::instance()->shader()->setWebViewMatrix(info->transform, info->isLayer);
int returnFlags = (*wvInstance.*funcPtr)(localViewRect, &inval, webViewRect,
diff --git a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
index ce2ac1b..6459887 100644
--- a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
@@ -360,7 +360,7 @@ void ChromeClientEfl::mouseDidMoveOverElement(const HitTestResult& hit, unsigned
if (!url.isEmpty() && url != m_hoveredLinkURL) {
const char* link[2];
TextDirection dir;
- CString urlStr = url.prettyURL().utf8();
+ CString urlStr = url.string().utf8();
CString titleStr = hit.title(dir).utf8();
link[0] = urlStr.data();
link[1] = titleStr.data();
diff --git a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index 9a409f2..021188a 100644
--- a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -209,7 +209,7 @@ void FrameLoaderClientEfl::dispatchDidCancelAuthenticationChallenge(DocumentLoad
void FrameLoaderClientEfl::dispatchWillSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& coreRequest, const ResourceResponse& coreResponse)
{
- CString url = coreRequest.url().prettyURL().utf8();
+ CString url = coreRequest.url().string().utf8();
DBG("Resource url=%s", url.data());
Ewk_Frame_Resource_Request request = { 0, identifier };
@@ -236,7 +236,7 @@ bool FrameLoaderClientEfl::shouldUseCredentialStorage(DocumentLoader*, unsigned
void FrameLoaderClientEfl::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest& coreRequest)
{
- CString url = coreRequest.url().prettyURL().utf8();
+ CString url = coreRequest.url().string().utf8();
DBG("Resource url=%s", url.data());
Ewk_Frame_Resource_Request request = { 0, identifier };
@@ -309,7 +309,7 @@ void FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction(FramePolicyFu
ASSERT(m_frame);
// if not acceptNavigationRequest - look at Qt -> PolicyIgnore;
// FIXME: do proper check and only reset forms when on PolicyIgnore
- char* url = strdup(resourceRequest.url().prettyURL().utf8().data());
+ char* url = strdup(resourceRequest.url().string().utf8().data());
Ewk_Frame_Resource_Request request = { url, 0 };
Eina_Bool ret = ewk_view_navigation_policy_decision(m_view, &request);
free(url);
@@ -764,7 +764,7 @@ void FrameLoaderClientEfl::download(ResourceHandle*, const ResourceRequest& requ
if (!m_view)
return;
- CString url = request.url().prettyURL().utf8();
+ CString url = request.url().string().utf8();
Ewk_Download download;
download.url = url.data();
@@ -784,7 +784,7 @@ enum {
ResourceError FrameLoaderClientEfl::cancelledError(const ResourceRequest& request)
{
- ResourceError error("Error", -999, request.url().prettyURL(),
+ ResourceError error("Error", -999, request.url().string(),
"Request cancelled");
error.setIsCancellation(true);
return error;
@@ -792,7 +792,7 @@ ResourceError FrameLoaderClientEfl::cancelledError(const ResourceRequest& reques
ResourceError FrameLoaderClientEfl::blockedError(const ResourceRequest& request)
{
- return ResourceError("Error", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),
+ return ResourceError("Error", WebKitErrorCannotUseRestrictedPort, request.url().string(),
"Request blocked");
}
diff --git a/Source/WebKit/efl/ewk/ewk_frame.cpp b/Source/WebKit/efl/ewk/ewk_frame.cpp
index 4e52b56..e865d39 100644
--- a/Source/WebKit/efl/ewk/ewk_frame.cpp
+++ b/Source/WebKit/efl/ewk/ewk_frame.cpp
@@ -1162,7 +1162,7 @@ Ewk_Hit_Test* ewk_frame_hit_test_new(const Evas_Object* o, int x, int y)
hit_test->frame = kit(result.innerNonSharedNode()->document()->frame());
hit_test->link.text = eina_stringshare_add(result.textContent().utf8().data());
- hit_test->link.url = eina_stringshare_add(result.absoluteLinkURL().prettyURL().utf8().data());
+ hit_test->link.url = eina_stringshare_add(result.absoluteLinkURL().string().utf8().data());
hit_test->link.title = eina_stringshare_add(result.titleDisplayString().utf8().data());
hit_test->link.target_frame = kit(result.targetFrame());
@@ -2014,7 +2014,7 @@ Eina_Bool ewk_frame_uri_changed(Evas_Object* o)
{
EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
- WTF::CString uri(sd->frame->document()->url().prettyURL().utf8());
+ WTF::CString uri(sd->frame->document()->url().string().utf8());
INF("uri=%s", uri.data());
if (!uri.data()) {
diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp
index a6749de..f830426 100644
--- a/Source/WebKit/efl/ewk/ewk_view.cpp
+++ b/Source/WebKit/efl/ewk/ewk_view.cpp
@@ -577,7 +577,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd)
priv->page_settings->setUsesEncodingDetector(true);
url = priv->page_settings->userStyleSheetLocation();
- priv->settings.user_stylesheet = eina_stringshare_add(url.prettyURL().utf8().data());
+ priv->settings.user_stylesheet = eina_stringshare_add(url.string().utf8().data());
priv->settings.encoding_default = eina_stringshare_add
(priv->page_settings->defaultTextEncodingName().utf8().data());
@@ -4077,7 +4077,7 @@ WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object* o, Evas_Objec
{
DBG("o=%p, frame=%p, name=%s, ownerElement=%p, url=%s, referrer=%s",
o, frame, name.utf8().data(), ownerElement,
- url.prettyURL().utf8().data(), referrer.utf8().data());
+ url.string().utf8().data(), referrer.utf8().data());
EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
@@ -4109,7 +4109,7 @@ WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Obj
{
DBG("o=%p, frame=%p, size=%dx%d, element=%p, url=%s, mimeType=%s",
o, frame, pluginSize.width(), pluginSize.height(), element,
- url.prettyURL().utf8().data(), mimeType.utf8().data());
+ url.string().utf8().data(), mimeType.utf8().data());
EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
sd->changed.frame_rect = EINA_TRUE;
diff --git a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 9f21139..4ee9c1a 100644
--- a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -549,7 +549,7 @@ void ChromeClient::mouseDidMoveOverElement(const HitTestResult& hit, unsigned mo
if (!url.isEmpty() && url != m_hoveredLinkURL) {
TextDirection dir;
CString titleString = hit.title(dir).utf8();
- CString urlString = url.prettyURL().utf8();
+ CString urlString = url.string().utf8();
g_signal_emit_by_name(m_webView, "hovering-over-link", titleString.data(), urlString.data());
m_hoveredLinkURL = url;
}
diff --git a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 539675a..de85a67 100644
--- a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -895,7 +895,7 @@ void FrameLoaderClient::dispatchDidChangeLocationWithinPage()
{
WebKitWebFramePrivate* priv = m_frame->priv;
g_free(priv->uri);
- priv->uri = g_strdup(core(m_frame)->document()->url().prettyURL().utf8().data());
+ priv->uri = g_strdup(core(m_frame)->document()->url().string().utf8().data());
g_object_notify(G_OBJECT(m_frame), "uri");
WebKitWebView* webView = getViewFromFrame(m_frame);
if (m_frame == webkit_web_view_get_main_frame(webView))
@@ -986,7 +986,7 @@ void FrameLoaderClient::dispatchDidCommitLoad()
WebKitWebFramePrivate* priv = m_frame->priv;
g_free(priv->uri);
- priv->uri = g_strdup(core(m_frame)->loader()->activeDocumentLoader()->url().prettyURL().utf8().data());
+ priv->uri = g_strdup(core(m_frame)->loader()->activeDocumentLoader()->url().string().utf8().data());
g_free(priv->title);
priv->title = NULL;
g_object_notify(G_OBJECT(m_frame), "uri");
diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp
index 85ad904..3b9ebe3 100644
--- a/Source/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp
@@ -5034,7 +5034,7 @@ WebKitHitTestResult* webkit_web_view_get_hit_test_result(WebKitWebView* webView,
G_CONST_RETURN gchar* webkit_web_view_get_icon_uri(WebKitWebView* webView)
{
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
- String iconURL = iconDatabase().synchronousIconURLForPageURL(core(webView)->mainFrame()->document()->url().prettyURL());
+ String iconURL = iconDatabase().synchronousIconURLForPageURL(core(webView)->mainFrame()->document()->url().string());
webView->priv->iconURI = iconURL.utf8();
return webView->priv->iconURI.data();
}
diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index ea2c826..f30e0f8 100644
--- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -497,7 +497,7 @@ void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsign
lastHoverURL = result.absoluteLinkURL();
lastHoverTitle = result.title(dir);
lastHoverContent = result.textContent();
- emit m_webPage->linkHovered(lastHoverURL.prettyURL(),
+ emit m_webPage->linkHovered(lastHoverURL.string(),
lastHoverTitle, lastHoverContent);
}
}
diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index d083f8f..c35cf3b 100644
--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -797,7 +797,7 @@ void FrameLoaderClientQt::updateGlobalHistory()
QWebHistoryInterface* history = QWebHistoryInterface::defaultInterface();
WebCore::DocumentLoader* loader = m_frame->loader()->documentLoader();
if (history)
- history->addHistoryEntry(loader->urlForHistory().prettyURL());
+ history->addHistoryEntry(loader->urlForHistory().string());
if (dumpHistoryCallbacks) {
printf("WebView navigated to url \"%s\" with title \"%s\" with HTTP equivalent method \"%s\". The navigation was %s and was %s%s.\n",
@@ -921,7 +921,7 @@ void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const c
WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request)
{
- ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(),
+ ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().string(),
QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8));
error.setIsCancellation(true);
return error;
@@ -941,7 +941,7 @@ enum {
WebCore::ResourceError FrameLoaderClientQt::blockedError(const WebCore::ResourceRequest& request)
{
- return ResourceError("WebKitErrorDomain", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),
+ return ResourceError("WebKitErrorDomain", WebKitErrorCannotUseRestrictedPort, request.url().string(),
QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8));
}
@@ -1345,7 +1345,7 @@ void FrameLoaderClientQt::transferLoadingResourceFromPage(unsigned long, Documen
ObjectContentType FrameLoaderClientQt::objectContentType(const KURL& url, const String& mimeTypeIn, bool shouldPreferPlugInsForImages)
{
- // qDebug()<<" ++++++++++++++++ url is "<<url.prettyURL()<<", mime = "<<mimeTypeIn;
+ // qDebug()<<" ++++++++++++++++ url is "<<url.string()<<", mime = "<<mimeTypeIn;
QFileInfo fi(url.path());
String extension = fi.suffix();
if (mimeTypeIn == "application/x-qt-plugin" || mimeTypeIn == "application/x-qt-styled-widget")
@@ -1508,8 +1508,8 @@ private:
PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames,
const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
- // qDebug()<<"------ Creating plugin in FrameLoaderClientQt::createPlugin for "<<url.prettyURL() << mimeType;
- // qDebug()<<"------\t url = "<<url.prettyURL();
+ // qDebug()<<"------ Creating plugin in FrameLoaderClientQt::createPlugin for "<<url.string() << mimeType;
+ // qDebug()<<"------\t url = "<<url.string();
if (!m_webFrame)
return 0;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp
index 61c2a3a..ace9599 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp
@@ -51,7 +51,7 @@ enum {
ResourceError cancelledError(const ResourceRequest& request)
{
- ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(),
+ ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().string(),
QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8));
error.setIsCancellation(true);
return error;
@@ -59,7 +59,7 @@ ResourceError cancelledError(const ResourceRequest& request)
ResourceError blockedError(const ResourceRequest& request)
{
- return ResourceError("WebKit", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),
+ return ResourceError("WebKit", WebKitErrorCannotUseRestrictedPort, request.url().string(),
QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8));
}