atob() / btoa() API should be exposed to workers
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jun 2016 01:42:05 +0000 (01:42 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jun 2016 01:42:05 +0000 (01:42 +0000)
commitd078d459f0632ec8d6bff818699be34579a9ec72
treed59d7129168d7d99a2e04edaae49ba691a98394b
parent61cf7d74eeb01e5f72a9b36ec61c02b5637199b6
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/workers/atob-btoa-expected.txt [new file with mode: 0644]
LayoutTests/fast/workers/atob-btoa.html [new file with mode: 0644]
LayoutTests/fast/workers/resources/worker-atob-btoa.js [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/PlatformMac.cmake
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/Base64Utilities.cpp [new file with mode: 0644]
Source/WebCore/page/Base64Utilities.h [new file with mode: 0644]
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DOMWindow.h
Source/WebCore/page/DOMWindow.idl
Source/WebCore/page/WindowBase64.idl [deleted file]
Source/WebCore/page/WindowOrWorkerGlobalScope.idl [moved from Source/WebCore/page/WindowTimers.idl with 86% similarity]
Source/WebCore/workers/WorkerGlobalScope.h
Source/WebCore/workers/WorkerGlobalScope.idl