<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[201898] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/201898">201898</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-06-09 18:42:05 -0700 (Thu, 09 Jun 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>atob() / btoa() API should be exposed to workers
https://bugs.webkit.org/show_bug.cgi?id=158576
<rdar://problem/26729340>
Reviewed by Sam Weinig.
Source/WebCore:
Expose atob() / btoa() API to workers as per:
https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
This aligns our behavior with Firefox and Chrome as well.
Test: fast/workers/atob-btoa.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* page/Base64Utilities.cpp: Added.
(WebCore::Base64Utilities::btoa):
(WebCore::Base64Utilities::atob):
* page/Base64Utilities.h: Added.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::find): Deleted.
(WebCore::DOMWindow::offscreenBuffering): Deleted.
(WebCore::DOMWindow::outerHeight): Deleted.
(WebCore::DOMWindow::outerWidth): Deleted.
* page/DOMWindow.h:
* page/DOMWindow.idl:
* page/WindowBase64.idl: Removed.
* page/WindowOrWorkerGlobalScope.idl: Renamed from Source/WebCore/page/WindowTimers.idl.
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScope.idl:
LayoutTests:
Add test for atob() / btoa() in workers.
* fast/workers/atob-btoa-expected.txt: Added.
* fast/workers/atob-btoa.html: Added.
* fast/workers/resources/worker-atob-btoa.js: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCorePlatformMaccmake">trunk/Source/WebCore/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowh">trunk/Source/WebCore/page/DOMWindow.h</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowidl">trunk/Source/WebCore/page/DOMWindow.idl</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopeh">trunk/Source/WebCore/workers/WorkerGlobalScope.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopeidl">trunk/Source/WebCore/workers/WorkerGlobalScope.idl</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastworkersatobbtoaexpectedtxt">trunk/LayoutTests/fast/workers/atob-btoa-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastworkersatobbtoahtml">trunk/LayoutTests/fast/workers/atob-btoa.html</a></li>
<li><a href="#trunkLayoutTestsfastworkersresourcesworkeratobbtoajs">trunk/LayoutTests/fast/workers/resources/worker-atob-btoa.js</a></li>
<li><a href="#trunkSourceWebCorepageBase64Utilitiescpp">trunk/Source/WebCore/page/Base64Utilities.cpp</a></li>
<li><a href="#trunkSourceWebCorepageBase64Utilitiesh">trunk/Source/WebCore/page/Base64Utilities.h</a></li>
<li><a href="#trunkSourceWebCorepageWindowOrWorkerGlobalScopeidl">trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorepageWindowBase64idl">trunk/Source/WebCore/page/WindowBase64.idl</a></li>
<li><a href="#trunkSourceWebCorepageWindowTimersidl">trunk/Source/WebCore/page/WindowTimers.idl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/LayoutTests/ChangeLog        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-06-09 Chris Dumez <cdumez@apple.com>
+
+ atob() / btoa() API should be exposed to workers
+ https://bugs.webkit.org/show_bug.cgi?id=158576
+ <rdar://problem/26729340>
+
+ Reviewed by Sam Weinig.
+
+ Add test for atob() / btoa() in workers.
+
+ * fast/workers/atob-btoa-expected.txt: Added.
+ * fast/workers/atob-btoa.html: Added.
+ * fast/workers/resources/worker-atob-btoa.js: Added.
+
</ins><span class="cx"> 2016-06-09 Michael Saboff <msaboff@apple.com>
</span><span class="cx">
</span><span class="cx"> ES6: Reusing function name as a parameter name shouldn't throw Syntax Error
</span></span></pre></div>
<a id="trunkLayoutTestsfastworkersatobbtoaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/workers/atob-btoa-expected.txt (0 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/workers/atob-btoa-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/workers/atob-btoa-expected.txt        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+[Worker] tests that atob() / btoa() work in workers.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Starting worker: resources/worker-atob-btoa.js
+PASS [Worker] self.atob("YQ==") is "a"
+PASS [Worker] self.atob("YWI=") is "ab"
+PASS [Worker] self.atob("YWJj") is "abc"
+PASS [Worker] self.atob("YWJjZA==") is "abcd"
+PASS [Worker] self.atob("YWJjZGU=") is "abcde"
+PASS [Worker] self.atob("YWJjZGVm") is "abcdef"
+PASS [Worker] self.btoa("a") is "YQ=="
+PASS [Worker] self.btoa("ab") is "YWI="
+PASS [Worker] self.btoa("abc") is "YWJj"
+PASS [Worker] self.btoa("abcd") is "YWJjZA=="
+PASS [Worker] self.btoa("abcde") is "YWJjZGU="
+PASS [Worker] self.btoa("abcdef") is "YWJjZGVm"
+PASS [Worker] typeof self.btoa is "function"
+PASS [Worker] self.btoa() threw exception TypeError: Not enough arguments.
+PASS [Worker] self.btoa("") is ""
+PASS [Worker] self.btoa(null) is "bnVsbA=="
+PASS [Worker] self.btoa(undefined) is "dW5kZWZpbmVk"
+PASS [Worker] self.btoa(self) is "W29iamVjdCBEZWRpY2F0ZWRXb3JrZXJHbG9iYWxTY29wZV0="
+PASS [Worker] self.btoa("éé") is "6ek="
+PASS [Worker] self.btoa("\u0080\u0081") is "gIE="
+PASS [Worker] self.btoa("тест") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.btoa is 0
+PASS [Worker] typeof self.btoa is "number"
+PASS [Worker] typeof self.atob is "function"
+PASS [Worker] self.atob() threw exception TypeError: Not enough arguments.
+PASS [Worker] self.atob("") is ""
+PASS [Worker] self.atob(null) is "ée"
+PASS [Worker] self.atob(undefined) threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob(" YQ==") is "a"
+PASS [Worker] self.atob("YQ==\u000a") is "a"
+PASS [Worker] self.atob("ab\tcd") is "i·"
+PASS [Worker] self.atob("ab\ncd") is "i·"
+PASS [Worker] self.atob("ab\fcd") is "i·"
+PASS [Worker] self.atob("ab cd") is "i·"
+PASS [Worker] self.atob("ab\t\n\f\r cd") is "i·"
+PASS [Worker] self.atob(" \t\n\f\r ab\t\n\f\r cd\t\n\f\r ") is "i·"
+PASS [Worker] self.atob("ab\t\n\f\r =\t\n\f\r =\t\n\f\r ") is "i"
+PASS [Worker] self.atob(" ") is ""
+PASS [Worker] self.atob(" abcd===") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("abcd=== ") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("abcd ===") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("6ek=") is "éé"
+PASS [Worker] self.atob("6ek") is "éé"
+PASS [Worker] self.atob("gIE=") is ""
+PASS [Worker] self.atob("тест") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("z") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("zz") is "Ï"
+PASS [Worker] self.atob("zzz") is "Ï<"
+PASS [Worker] self.atob("zzz=") is "Ï<"
+PASS [Worker] self.atob("zzz==") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("zzz===") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("zzz====") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("zzz=====") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("zzzz") is "Ï<ó"
+PASS [Worker] self.atob("zzzzz") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("z=zz") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("=") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("==") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("===") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("====") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob("=====") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS [Worker] self.atob is 0
+PASS [Worker] typeof self.atob is "number"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastworkersatobbtoahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/workers/atob-btoa.html (0 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/workers/atob-btoa.html         (rev 0)
+++ trunk/LayoutTests/fast/workers/atob-btoa.html        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+worker = startWorker('resources/worker-atob-btoa.js');
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastworkersresourcesworkeratobbtoajs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/workers/resources/worker-atob-btoa.js (0 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/workers/resources/worker-atob-btoa.js         (rev 0)
+++ trunk/LayoutTests/fast/workers/resources/worker-atob-btoa.js        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+importScripts('../../../resources/js-test-pre.js');
+
+var global = this;
+global.jsTestIsAsync = true;
+
+description("tests that atob() / btoa() work in workers.");
+
+shouldBe('self.atob("YQ==")', '"a"');
+shouldBe('self.atob("YWI=")', '"ab"');
+shouldBe('self.atob("YWJj")', '"abc"');
+shouldBe('self.atob("YWJjZA==")', '"abcd"');
+shouldBe('self.atob("YWJjZGU=")', '"abcde"');
+shouldBe('self.atob("YWJjZGVm")', '"abcdef"');
+shouldBe('self.btoa("a")', '"YQ=="');
+shouldBe('self.btoa("ab")', '"YWI="');
+shouldBe('self.btoa("abc")', '"YWJj"');
+shouldBe('self.btoa("abcd")', '"YWJjZA=="');
+shouldBe('self.btoa("abcde")', '"YWJjZGU="');
+shouldBe('self.btoa("abcdef")', '"YWJjZGVm"');
+
+shouldBe('typeof self.btoa', '"function"');
+shouldThrow('self.btoa()', '"TypeError: Not enough arguments"');
+shouldBe('self.btoa("")', '""');
+shouldBe('self.btoa(null)', '"bnVsbA=="'); // Gets converted to "null" string.
+shouldBe('self.btoa(undefined)', '"dW5kZWZpbmVk"');
+shouldBe('self.btoa(self)', '"W29iamVjdCBEZWRpY2F0ZWRXb3JrZXJHbG9iYWxTY29wZV0="'); // "[object DedicatedWorkerGlobalScope]"
+shouldBe('self.btoa("éé")', '"6ek="');
+shouldBe('self.btoa("\\u0080\\u0081")', '"gIE="');
+shouldThrow('self.btoa("тест")');
+self.btoa = 0;
+shouldBe('self.btoa', '0');
+shouldBe('typeof self.btoa', '"number"');
+
+shouldBe('typeof self.atob', '"function"');
+shouldThrow('self.atob()', '"TypeError: Not enough arguments"');
+shouldBe('self.atob("")', '""');
+shouldBe('self.atob(null)', '"\x9Eée"'); // Gets converted to "null" string.
+shouldThrow('self.atob(undefined)');
+shouldBe('self.atob(" YQ==")', '"a"');
+shouldBe('self.atob("YQ==\\u000a")', '"a"');
+shouldBe('self.atob("ab\\tcd")', '"i·\x1d"');
+shouldBe('self.atob("ab\\ncd")', '"i·\x1d"');
+shouldBe('self.atob("ab\\fcd")', '"i·\x1d"');
+shouldBe('self.atob("ab cd")', '"i·\x1d"');
+shouldBe('self.atob("ab\\t\\n\\f\\r cd")', '"i·\x1d"');
+shouldBe('self.atob(" \\t\\n\\f\\r ab\\t\\n\\f\\r cd\\t\\n\\f\\r ")', '"i·\x1d"');
+shouldBe('self.atob("ab\\t\\n\\f\\r =\\t\\n\\f\\r =\\t\\n\\f\\r ")', '"i"');
+shouldBe('self.atob(" ")', '""');
+shouldThrow('self.atob(" abcd===")');
+shouldThrow('self.atob("abcd=== ")');
+shouldThrow('self.atob("abcd ===")');
+shouldBe('self.atob("6ek=")', '"éé"');
+shouldBe('self.atob("6ek")', '"éé"');
+shouldBe('self.atob("gIE=")', '"\u0080\u0081"');
+shouldThrow('self.atob("тест")');
+shouldThrow('self.atob("z")');
+shouldBe('self.atob("zz")', '"Ï"');
+shouldBe('self.atob("zzz")', '"Ï\u003C"');
+shouldBe('self.atob("zzz=")', '"Ï\u003C"');
+shouldThrow('self.atob("zzz==")'); // excess pad characters.
+shouldThrow('self.atob("zzz===")'); // excess pad characters.
+shouldThrow('self.atob("zzz====")'); // excess pad characters.
+shouldThrow('self.atob("zzz=====")'); // excess pad characters.
+shouldBe('self.atob("zzzz")', '"Ï\u003Có"');
+shouldThrow('self.atob("zzzzz")');
+shouldThrow('self.atob("z=zz")');
+shouldThrow('self.atob("=")');
+shouldThrow('self.atob("==")');
+shouldThrow('self.atob("===")');
+shouldThrow('self.atob("====")');
+shouldThrow('self.atob("=====")');
+self.atob = 0;
+shouldBe('self.atob', '0');
+shouldBe('typeof self.atob', '"number"');
+
+finishJSTest();
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -616,9 +616,8 @@
</span><span class="cx"> page/UserMessageHandlersNamespace.idl
</span><span class="cx"> page/WebKitNamespace.idl
</span><span class="cx"> page/WebKitPoint.idl
</span><del>- page/WindowBase64.idl
</del><span class="cx"> page/WindowEventHandlers.idl
</span><del>- page/WindowTimers.idl
</del><ins>+ page/WindowOrWorkerGlobalScope.idl
</ins><span class="cx"> page/WorkerNavigator.idl
</span><span class="cx">
</span><span class="cx"> plugins/DOMMimeType.idl
</span><span class="lines">@@ -1988,6 +1987,7 @@
</span><span class="cx">
</span><span class="cx"> page/AutoscrollController.cpp
</span><span class="cx"> page/BarProp.cpp
</span><ins>+ page/Base64Utilities.cpp
</ins><span class="cx"> page/CaptionUserPreferences.cpp
</span><span class="cx"> page/Chrome.cpp
</span><span class="cx"> page/ContextMenuContext.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/ChangeLog        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2016-06-09 Chris Dumez <cdumez@apple.com>
+
+ atob() / btoa() API should be exposed to workers
+ https://bugs.webkit.org/show_bug.cgi?id=158576
+ <rdar://problem/26729340>
+
+ Reviewed by Sam Weinig.
+
+ Expose atob() / btoa() API to workers as per:
+ https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
+
+ This aligns our behavior with Firefox and Chrome as well.
+
+ Test: fast/workers/atob-btoa.html
+
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * PlatformMac.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/Base64Utilities.cpp: Added.
+ (WebCore::Base64Utilities::btoa):
+ (WebCore::Base64Utilities::atob):
+ * page/Base64Utilities.h: Added.
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::find): Deleted.
+ (WebCore::DOMWindow::offscreenBuffering): Deleted.
+ (WebCore::DOMWindow::outerHeight): Deleted.
+ (WebCore::DOMWindow::outerWidth): Deleted.
+ * page/DOMWindow.h:
+ * page/DOMWindow.idl:
+ * page/WindowBase64.idl: Removed.
+ * page/WindowOrWorkerGlobalScope.idl: Renamed from Source/WebCore/page/WindowTimers.idl.
+ * workers/WorkerGlobalScope.h:
+ * workers/WorkerGlobalScope.idl:
+
</ins><span class="cx"> 2016-06-09 John Wilander <wilander@apple.com>
</span><span class="cx">
</span><span class="cx"> Restrict HTTP/0.9 responses to default ports and cancel HTTP/0.9 resource loads if the document was loaded with another HTTP protocol
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/DerivedSources.cpp        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -653,9 +653,8 @@
</span><span class="cx"> #include "JSWebKitTransitionEvent.cpp"
</span><span class="cx"> #include "JSWebSocket.cpp"
</span><span class="cx"> #include "JSWheelEvent.cpp"
</span><del>-#include "JSWindowBase64.cpp"
</del><span class="cx"> #include "JSWindowEventHandlers.cpp"
</span><del>-#include "JSWindowTimers.cpp"
</del><ins>+#include "JSWindowOrWorkerGlobalScope.cpp"
</ins><span class="cx"> #include "JSWorker.cpp"
</span><span class="cx"> #include "JSWorkerGlobalScope.cpp"
</span><span class="cx"> #include "JSWorkerGlobalScopeFetch.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/DerivedSources.make        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -525,10 +525,9 @@
</span><span class="cx"> $(WebCore)/page/WebKitNamespace.idl \
</span><span class="cx"> $(WebCore)/page/UserMessageHandlersNamespace.idl \
</span><span class="cx"> $(WebCore)/page/UserMessageHandler.idl \
</span><del>- $(WebCore)/page/WindowBase64.idl \
</del><span class="cx"> $(WebCore)/page/WindowEventHandlers.idl \
</span><del>- $(WebCore)/page/WindowTimers.idl \
</del><span class="cx"> $(WebCore)/page/WorkerNavigator.idl \
</span><ins>+ $(WebCore)/page/WindowOrWorkerGlobalScope.idl \
</ins><span class="cx"> $(WebCore)/plugins/DOMMimeType.idl \
</span><span class="cx"> $(WebCore)/plugins/DOMMimeTypeArray.idl \
</span><span class="cx"> $(WebCore)/plugins/DOMPlugin.idl \
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/PlatformMac.cmake        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -904,9 +904,8 @@
</span><span class="cx"> NonElementParentNode
</span><span class="cx"> ParentNode
</span><span class="cx"> URLUtils
</span><del>- WindowBase64
</del><span class="cx"> WindowEventHandlers
</span><del>- WindowTimers
</del><ins>+ WindowOrWorkerGlobalScope
</ins><span class="cx"> WorkerGlobalScopeIndexedDatabase
</span><span class="cx"> WorkerGlobalScopeNotifications
</span><span class="cx"> XPathNSResolver
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -1658,8 +1658,8 @@
</span><span class="cx">                 439046E712DA25E800AF80A2 /* RenderMathMLScripts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D312DA25E800AF80A2 /* RenderMathMLScripts.cpp */; };
</span><span class="cx">                 439046E812DA25E800AF80A2 /* RenderMathMLScripts.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D412DA25E800AF80A2 /* RenderMathMLScripts.h */; };
</span><span class="cx">                 439046E912DA25E800AF80A2 /* RenderMathMLUnderOver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D512DA25E800AF80A2 /* RenderMathMLUnderOver.cpp */; };
</span><ins>+                439046E912DA25E812AF80AC /* MathOperator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D512DA25E812AF80AC /* MathOperator.cpp */; };
</ins><span class="cx">                 439046EA12DA25E800AF80A2 /* RenderMathMLUnderOver.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D612DA25E800AF80A2 /* RenderMathMLUnderOver.h */; };
</span><del>-                439046E912DA25E812AF80AC /* MathOperator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D512DA25E812AF80AC /* MathOperator.cpp */; };
</del><span class="cx">                 439046EA12DA25E812AF80AC /* MathOperator.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D612DA25E812AF80AC /* MathOperator.h */; };
</span><span class="cx">                 439046EB12DA25E800AF80A9 /* RenderMathMLToken.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */; };
</span><span class="cx">                 439046EC12DA25E800AF80A9 /* RenderMathMLToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D812DA25E800AF80A9 /* RenderMathMLToken.h */; };
</span><span class="lines">@@ -1733,6 +1733,8 @@
</span><span class="cx">                 458FE40A1589DF0B005609E6 /* RenderSearchField.h in Headers */ = {isa = PBXBuildFile; fileRef = 458FE4081589DF0B005609E6 /* RenderSearchField.h */; };
</span><span class="cx">                 45FEA5CF156DDE8C00654101 /* Decimal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45FEA5CD156DDE8C00654101 /* Decimal.cpp */; };
</span><span class="cx">                 45FEA5D0156DDE8C00654101 /* Decimal.h in Headers */ = {isa = PBXBuildFile; fileRef = 45FEA5CE156DDE8C00654101 /* Decimal.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                460BB6151D0A1BF000221812 /* Base64Utilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 460BB6131D0A1BEC00221812 /* Base64Utilities.cpp */; };
+                460BB6161D0A1BF000221812 /* Base64Utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 460BB6141D0A1BEC00221812 /* Base64Utilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 4634592C1AC2271000ECB71C /* PowerObserverMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */; };
</span><span class="cx">                 463EB6221B8789E00096ED51 /* TagCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 463EB6201B8789CB0096ED51 /* TagCollection.cpp */; };
</span><span class="cx">                 463EB6231B8789E00096ED51 /* TagCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 463EB6211B8789CB0096ED51 /* TagCollection.h */; };
</span><span class="lines">@@ -9205,8 +9207,8 @@
</span><span class="cx">                 439046D312DA25E800AF80A2 /* RenderMathMLScripts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLScripts.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 439046D412DA25E800AF80A2 /* RenderMathMLScripts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLScripts.h; sourceTree = "<group>"; };
</span><span class="cx">                 439046D512DA25E800AF80A2 /* RenderMathMLUnderOver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLUnderOver.cpp; sourceTree = "<group>"; };
</span><ins>+                439046D512DA25E812AF80AC /* MathOperator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathOperator.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 439046D612DA25E800AF80A2 /* RenderMathMLUnderOver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLUnderOver.h; sourceTree = "<group>"; };
</span><del>-                439046D512DA25E812AF80AC /* MathOperator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathOperator.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 439046D612DA25E812AF80AC /* MathOperator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathOperator.h; sourceTree = "<group>"; };
</span><span class="cx">                 439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLToken.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 439046D812DA25E800AF80A9 /* RenderMathMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLToken.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -9285,6 +9287,8 @@
</span><span class="cx">                 458FE4081589DF0B005609E6 /* RenderSearchField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSearchField.h; sourceTree = "<group>"; };
</span><span class="cx">                 45FEA5CD156DDE8C00654101 /* Decimal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Decimal.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 45FEA5CE156DDE8C00654101 /* Decimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Decimal.h; sourceTree = "<group>"; };
</span><ins>+                460BB6131D0A1BEC00221812 /* Base64Utilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Base64Utilities.cpp; sourceTree = "<group>"; };
+                460BB6141D0A1BEC00221812 /* Base64Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64Utilities.h; sourceTree = "<group>"; };
</ins><span class="cx">                 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PowerObserverMac.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 463EB6201B8789CB0096ED51 /* TagCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagCollection.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 463EB6211B8789CB0096ED51 /* TagCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagCollection.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -17981,6 +17985,8 @@
</span><span class="cx">                                 BC124EE40C2641CD009E2349 /* BarProp.cpp */,
</span><span class="cx">                                 BC124EE50C2641CD009E2349 /* BarProp.h */,
</span><span class="cx">                                 BC124EE60C2641CD009E2349 /* BarProp.idl */,
</span><ins>+                                460BB6131D0A1BEC00221812 /* Base64Utilities.cpp */,
+                                460BB6141D0A1BEC00221812 /* Base64Utilities.h */,
</ins><span class="cx">                                 072CA86016CB4DC3008AE131 /* CaptionUserPreferences.cpp */,
</span><span class="cx">                                 079D0867162F20E800DB8658 /* CaptionUserPreferences.h */,
</span><span class="cx">                                 079D086A162F21F900DB8658 /* CaptionUserPreferencesMediaAF.cpp */,
</span><span class="lines">@@ -26281,6 +26287,7 @@
</span><span class="cx">                                 A8EA7D2D0A19385500A8EF5F /* HTMLImageElement.h in Headers */,
</span><span class="cx">                                 A8EA7D2B0A19385500A8EF5F /* HTMLImageLoader.h in Headers */,
</span><span class="cx">                                 A81369CC097374F600D74463 /* HTMLInputElement.h in Headers */,
</span><ins>+                                460BB6161D0A1BF000221812 /* Base64Utilities.h in Headers */,
</ins><span class="cx">                                 97BC849B12370A4B000C6161 /* HTMLInputStream.h in Headers */,
</span><span class="cx">                                 93309DE6099E64920056E581 /* HTMLInterchange.h in Headers */,
</span><span class="cx">                                 A81369E4097374F600D74463 /* HTMLKeygenElement.h in Headers */,
</span><span class="lines">@@ -29076,6 +29083,7 @@
</span><span class="cx">                                 CE7B2DB41586ABAD0098B3FA /* AlternativeTextUIController.mm in Sources */,
</span><span class="cx">                                 FD31603D12B0267600C1A359 /* AnalyserNode.cpp in Sources */,
</span><span class="cx">                                 31A795C81888BCB500382F90 /* ANGLEInstancedArrays.cpp in Sources */,
</span><ins>+                                460BB6151D0A1BF000221812 /* Base64Utilities.cpp in Sources */,
</ins><span class="cx">                                 490707E61219C04300D90E51 /* ANGLEWebKitBridge.cpp in Sources */,
</span><span class="cx">                                 49E912AA0EFAC906009D0CAF /* Animation.cpp in Sources */,
</span><span class="cx">                                 316FE1110E6E1DA700BF6088 /* AnimationBase.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorepageBase64Utilitiescpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/Base64Utilities.cpp (0 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Base64Utilities.cpp         (rev 0)
+++ trunk/Source/WebCore/page/Base64Utilities.cpp        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Base64Utilities.h"
+
+#include <wtf/text/Base64.h>
+
+namespace WebCore {
+
+String Base64Utilities::btoa(const String& stringToEncode, ExceptionCode& ec)
+{
+ if (stringToEncode.isNull())
+ return String();
+
+ if (!stringToEncode.containsOnlyLatin1()) {
+ ec = INVALID_CHARACTER_ERR;
+ return String();
+ }
+
+ return base64Encode(stringToEncode.latin1());
+}
+
+String Base64Utilities::atob(const String& encodedString, ExceptionCode& ec)
+{
+ if (encodedString.isNull())
+ return String();
+
+ if (!encodedString.containsOnlyLatin1()) {
+ ec = INVALID_CHARACTER_ERR;
+ return String();
+ }
+
+ Vector<char> out;
+ if (!base64Decode(encodedString, out, Base64ValidatePadding | Base64IgnoreSpacesAndNewLines)) {
+ ec = INVALID_CHARACTER_ERR;
+ return String();
+ }
+
+ return String(out.data(), out.size());
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorepageBase64Utilitiesh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/Base64Utilities.h (0 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Base64Utilities.h         (rev 0)
+++ trunk/Source/WebCore/page/Base64Utilities.h        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "ExceptionCode.h"
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class Base64Utilities {
+public:
+ Base64Utilities() = default;
+
+ String btoa(const String& stringToEncode, ExceptionCode&);
+ String atob(const String& encodedString, ExceptionCode&);
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -109,7 +109,6 @@
</span><span class="cx"> #include <wtf/MathExtras.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/Ref.h>
</span><del>-#include <wtf/text/Base64.h>
</del><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> #if ENABLE(USER_MESSAGE_HANDLERS)
</span><span class="lines">@@ -1137,38 +1136,6 @@
</span><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String DOMWindow::btoa(const String& stringToEncode, ExceptionCode& ec)
-{
- if (stringToEncode.isNull())
- return String();
-
- if (!stringToEncode.containsOnlyLatin1()) {
- ec = INVALID_CHARACTER_ERR;
- return String();
- }
-
- return base64Encode(stringToEncode.latin1());
-}
-
-String DOMWindow::atob(const String& encodedString, ExceptionCode& ec)
-{
- if (encodedString.isNull())
- return String();
-
- if (!encodedString.containsOnlyLatin1()) {
- ec = INVALID_CHARACTER_ERR;
- return String();
- }
-
- Vector<char> out;
- if (!base64Decode(encodedString, out, Base64ValidatePadding | Base64IgnoreSpacesAndNewLines)) {
- ec = INVALID_CHARACTER_ERR;
- return String();
- }
-
- return String(out.data(), out.size());
-}
-
</del><span class="cx"> bool DOMWindow::find(const String& string, bool caseSensitive, bool backwards, bool wrap, bool /*wholeWord*/, bool /*searchInFrames*/, bool /*showDialog*/) const
</span><span class="cx"> {
</span><span class="cx"> if (!isCurrentlyDisplayedInFrame())
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.h (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.h        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/page/DOMWindow.h        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #ifndef DOMWindow_h
</span><span class="cx"> #define DOMWindow_h
</span><span class="cx">
</span><ins>+#include "Base64Utilities.h"
</ins><span class="cx"> #include "ContextDestructionObserver.h"
</span><span class="cx"> #include "EventTarget.h"
</span><span class="cx"> #include "FrameDestructionObserver.h"
</span><span class="lines">@@ -97,6 +98,7 @@
</span><span class="cx"> , public EventTargetWithInlineData
</span><span class="cx"> , public ContextDestructionObserver
</span><span class="cx"> , public FrameDestructionObserver
</span><ins>+ , public Base64Utilities
</ins><span class="cx"> , public Supplementable<DOMWindow> {
</span><span class="cx"> public:
</span><span class="cx"> static Ref<DOMWindow> create(Document* document) { return adoptRef(*new DOMWindow(document)); }
</span><span class="lines">@@ -175,8 +177,6 @@
</span><span class="cx"> void alert(const String& message);
</span><span class="cx"> bool confirm(const String& message);
</span><span class="cx"> String prompt(const String& message, const String& defaultValue);
</span><del>- String btoa(const String& stringToEncode, ExceptionCode&);
- String atob(const String& encodedString, ExceptionCode&);
</del><span class="cx">
</span><span class="cx"> bool find(const String&, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog) const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.idl (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.idl        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/page/DOMWindow.idl        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -231,6 +231,5 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> DOMWindow implements GlobalEventHandlers;
</span><del>-DOMWindow implements WindowBase64;
</del><span class="cx"> DOMWindow implements WindowEventHandlers;
</span><del>-DOMWindow implements WindowTimers;
</del><ins>+DOMWindow implements WindowOrWorkerGlobalScope;
</ins></span></pre></div>
<a id="trunkSourceWebCorepageWindowBase64idl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/page/WindowBase64.idl (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/WindowBase64.idl        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/page/WindowBase64.idl        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2013 Samsung Electronics. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- NoInterfaceObject,
-] interface WindowBase64 {
- [RaisesException] DOMString atob(DOMString string);
- [RaisesException] DOMString btoa(DOMString string);
-};
</del></span></pre></div>
<a id="trunkSourceWebCorepageWindowOrWorkerGlobalScopeidlfromrev201897trunkSourceWebCorepageWindowTimersidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl (from rev 201897, trunk/Source/WebCore/page/WindowTimers.idl) (0 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl         (rev 0)
+++ trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2006-2009, 2013, 1016 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Samsung Electronics. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+ NoInterfaceObject,
+] interface WindowOrWorkerGlobalScope {
+ // Timers.
+ [Custom] long setTimeout(any handler, optional long timeout = 0);
+ void clearTimeout(optional long handle = 0);
+ [Custom] long setInterval(any handler, optional long timeout = 0);
+ void clearInterval(optional long handle = 0);
+
+ // Base64 utility methods.
+ [RaisesException] DOMString atob(DOMString string);
+ [RaisesException] DOMString btoa(DOMString string);
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebCorepageWindowTimersidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/page/WindowTimers.idl (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/WindowTimers.idl        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/page/WindowTimers.idl        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -1,36 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2013 Samsung Electronics. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- NoInterfaceObject,
-] interface WindowTimers {
- [Custom] long setTimeout(any handler, optional long timeout = 0);
- void clearTimeout(optional long handle = 0);
- [Custom] long setInterval(any handler, optional long timeout = 0);
- void clearInterval(optional long handle = 0);
-};
-
</del></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.h (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.h        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.h        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx">
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><ins>+#include "Base64Utilities.h"
</ins><span class="cx"> #include "EventListener.h"
</span><span class="cx"> #include "EventTarget.h"
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="lines">@@ -57,7 +58,7 @@
</span><span class="cx"> class IDBConnectionProxy;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-class WorkerGlobalScope : public RefCounted<WorkerGlobalScope>, public Supplementable<WorkerGlobalScope>, public ScriptExecutionContext, public EventTargetWithInlineData {
</del><ins>+class WorkerGlobalScope : public RefCounted<WorkerGlobalScope>, public Supplementable<WorkerGlobalScope>, public ScriptExecutionContext, public EventTargetWithInlineData, public Base64Utilities {
</ins><span class="cx"> public:
</span><span class="cx"> virtual ~WorkerGlobalScope();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.idl (201897 => 201898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.idl        2016-06-10 01:11:47 UTC (rev 201897)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.idl        2016-06-10 01:42:05 UTC (rev 201898)
</span><span class="lines">@@ -64,4 +64,4 @@
</span><span class="cx"> [Conditional=INDEXED_DATABASE_IN_WORKERS, EnabledAtRuntime=IndexedDBWorkers] attribute IDBVersionChangeEventConstructor IDBVersionChangeEvent;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-WorkerGlobalScope implements WindowTimers;
</del><ins>+WorkerGlobalScope implements WindowOrWorkerGlobalScope;
</ins></span></pre>
</div>
</div>
</body>
</html>