WebKit-https.git
3 years agoCorrect the line numbers in GTK's scheme-about.any-expected.txt.
commit-queue@webkit.org [Tue, 1 Aug 2017 13:13:43 +0000 (13:13 +0000)]
Correct the line numbers in GTK's scheme-about.any-expected.txt.
https://bugs.webkit.org/show_bug.cgi?id=175017

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-01
Reviewed by Sam Weinig.

The code fix landed in r220050.

* platform/gtk/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.any-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220093 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GCrypt] Gather crypto constants in a single location
zandobersek@gmail.com [Tue, 1 Aug 2017 11:49:51 +0000 (11:49 +0000)]
[GCrypt] Gather crypto constants in a single location
https://bugs.webkit.org/show_bug.cgi?id=174091

Reviewed by Jiewen Tan.

Gather common constants used across the libgcrypt-specific Web Crypto
implementations in a single place -- in the GCryptUtilities.h header,
inside the CryptoConstants namespace. The various ASN.1 object identifiers
and other helper values are placed inside, in the std::array<uint8_t, N>
container.

Additionally, CryptoConstants::matches() helper function is provided. It
compares the provided data-and-size pair with the given std::array
container and returns true if the std::memcmp() call returns 0.

Changes in CryptoKeyEC and CryptoKeyRSA consist mostly of switching to the
use of CryptoConstants::matches() and the CryptoConstants data arrays, as
well as some whitespace cleanup.

Additionallity in CryptoKeyEC, the helper functions covering various curve
attributes are reordered, renamed and reorganized for simplicity.

No new tests -- no changes in behavior.

* crypto/gcrypt/CryptoKeyECGCrypt.cpp:
(WebCore::curveIdentifier):
(WebCore::curveSize):
(WebCore::curveUncompressedFieldElementSize):
(WebCore::curveUncompressedPointSize):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPublic):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::supportedAlgorithmIdentifier):
(WebCore::curveForIdentifier):
(WebCore::CryptoKeyEC::platformImportSpki):
(WebCore::CryptoKeyEC::platformExportRaw):
(WebCore::CryptoKeyEC::platformAddFieldElements):
(WebCore::CryptoKeyEC::platformExportSpki):
(WebCore::CryptoKeyEC::platformExportPkcs8):
(WebCore::uncompressedPointSizeForCurve): Deleted.
(WebCore::uncompressedFieldElementSizeForCurve): Deleted.
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::supportedAlgorithmIdentifier):
(WebCore::CryptoKeyRSA::importPkcs8):
(WebCore::CryptoKeyRSA::exportSpki):
(WebCore::CryptoKeyRSA::exportPkcs8):
* crypto/gcrypt/GCryptUtilities.h:
(WebCore::CryptoConstants::matches):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220092 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[CMake] WebKitFS.cmake depends on options set in Option cmake files that are included...
mcatanzaro@igalia.com [Tue, 1 Aug 2017 08:08:56 +0000 (08:08 +0000)]
[CMake] WebKitFS.cmake depends on options set in Option cmake files that are included later
https://bugs.webkit.org/show_bug.cgi?id=174855

Reviewed by Carlos Garcia Campos.

.:

Create derived sources directories in WebKitCommon.cmake instead of WebKitFS.cmake, which is
too soon. I tried changing the include order, but other stuff in WebKitFS.cmake really is
needed before including the port options file.

* Source/cmake/WebKitCommon.cmake:
* Source/cmake/WebKitFS.cmake:

Source/WebDriver:

Don't create derived sources directory here anymore.

* PlatformGTK.cmake:

Source/WebKit:

Don't create derived sources directory here anymore.

* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220091 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUse LazyNeverDestroyed instead of DEFINE_GLOBAL for MediaFeatureNames
commit-queue@webkit.org [Tue, 1 Aug 2017 06:42:51 +0000 (06:42 +0000)]
Use LazyNeverDestroyed instead of DEFINE_GLOBAL for MediaFeatureNames
https://bugs.webkit.org/show_bug.cgi?id=175008

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-07-31
Reviewed by Alex Christensen.

No new tests because no behavior change.

Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.

* css/MediaFeatureNames.cpp:
(WebCore::MediaFeatureNames::init): Do not include
<wtf/StaticConstructors.h>. Use LazyNeverDestroyed instead of
DEFINE_GLOBAL. Call LazyNeverDestroyed::construct instead of
placement new.
* css/MediaFeatureNames.h: Use LazyNeverDestroyed.
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::evaluate const): Dereference with ->.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220090 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUse LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
commit-queue@webkit.org [Tue, 1 Aug 2017 06:40:04 +0000 (06:40 +0000)]
Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
https://bugs.webkit.org/show_bug.cgi?id=175010

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-07-31
Reviewed by Alex Christensen.

No new tests because no behavior change.

Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.

* dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
* dom/QualifiedName.cpp:
(WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
instead of placement new.
* dom/QualifiedName.h: Use LazyNeverDestroyed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220089 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoRemove some obsolete expected failures blamed on the threaded compositor.
commit-queue@webkit.org [Tue, 1 Aug 2017 06:37:49 +0000 (06:37 +0000)]
Remove some obsolete expected failures blamed on the threaded compositor.
https://bugs.webkit.org/show_bug.cgi?id=174982

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-07-31
Reviewed by Sergio Villar Senin.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220088 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFix JSCOnly ARM buildbots after r220047
ossy@webkit.org [Tue, 1 Aug 2017 05:28:05 +0000 (05:28 +0000)]
Fix JSCOnly ARM buildbots after r220047
https://bugs.webkit.org/show_bug.cgi?id=174993

Reviewed by Saam Barati.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(BuildAndRemoteJSCTestsFactory.__init__):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220087 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoSpeedometer 2.0: Remove <base> from Angular 4 test
commit-queue@webkit.org [Tue, 1 Aug 2017 00:39:16 +0000 (00:39 +0000)]
Speedometer 2.0: Remove <base> from Angular 4 test
https://bugs.webkit.org/show_bug.cgi?id=175004

Patch by Mathias Bynens <mathias@qiwi.be> on 2017-07-31
Reviewed by Ryosuke Niwa.

* Speedometer/resources/todomvc/architecture-examples/angular/dist/index.html: Remove <base>.
* Speedometer/resources/todomvc/architecture-examples/angular/src/index.html: Remove <base>.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220086 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoSupport quirk for letting media autoplay if the user interacted with at least one...
mrajca@apple.com [Tue, 1 Aug 2017 00:39:06 +0000 (00:39 +0000)]
Support quirk for letting media autoplay if the user interacted with at least one media element.
https://bugs.webkit.org/show_bug.cgi?id=175005
<rdar://problem/33476038>

Reviewed by Eric Carlson.

If the user has interacted with at least one media element, let other media elements auto-play
as a quirk.

* dom/Document.cpp:
(WebCore::Document::updateIsPlayingMedia):
* dom/Document.h:
(WebCore::Document::noteUserInteractionWithMediaElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
* html/MediaElementSession.cpp:
(WebCore::needsDocumentLevelMediaUserGestureQuirk):
(WebCore::MediaElementSession::playbackPermitted const):
* page/MediaProducer.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220085 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAX: CFEqual is failing on text markers with exact same data
n_wang@apple.com [Tue, 1 Aug 2017 00:18:00 +0000 (00:18 +0000)]
AX: CFEqual is failing on text markers with exact same data
https://bugs.webkit.org/show_bug.cgi?id=175002
<rdar://problem/33636985>

Reviewed by Chris Fleizach.

We should zero the memory of the TextMarkerData instance so that it
can be tested for byte-equivalence.

Made sure this change won't break any of the existing tests.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
(WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220084 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAdded some UNLIKELYs to operationOptimize().
mark.lam@apple.com [Mon, 31 Jul 2017 23:30:38 +0000 (23:30 +0000)]
Added some UNLIKELYs to operationOptimize().
https://bugs.webkit.org/show_bug.cgi?id=174976

Reviewed by JF Bastien.

* jit/JITOperations.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220081 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoBuild fix. Fixed a typo. task.id() isn't a thing in this function.
rniwa@webkit.org [Mon, 31 Jul 2017 23:30:25 +0000 (23:30 +0000)]
Build fix. Fixed a typo. task.id() isn't a thing in this function.

* public/v3/models/test-group.js:
(TestGroup.createWithCustomConfiguration):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220080 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFixed some comment typos.
mark.lam@apple.com [Mon, 31 Jul 2017 22:59:40 +0000 (22:59 +0000)]
Fixed some comment typos.

Not reviewed.

* bmalloc/PerProcess.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220079 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMake more things LLInt constexprs
keith_miller@apple.com [Mon, 31 Jul 2017 22:47:04 +0000 (22:47 +0000)]
Make more things LLInt constexprs
https://bugs.webkit.org/show_bug.cgi?id=174994

Reviewed by Saam Barati.

This patch makes more const values in the LLInt constexprs.
It also deletes all of the no longer necessary static_asserts in
LLIntData.cpp. Finally, it fixes a typo in parser.rb.

* interpreter/ShadowChicken.h:
(JSC::ShadowChicken::Packet::tailMarker):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LowLevelInterpreter.asm:
* offlineasm/generate_offset_extractor.rb:
* offlineasm/parser.rb:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220078 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoPropagate user gesture tokens when script elements are loaded.
mrajca@apple.com [Mon, 31 Jul 2017 22:34:47 +0000 (22:34 +0000)]
Propagate user gesture tokens when script elements are loaded.
https://bugs.webkit.org/show_bug.cgi?id=174959

Reviewed by Eric Carlson.

Propagate user gesture tokens when script elements are loaded (i.e. between the time an
element is created and its onload handler is invoked).

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::ScriptElement):
(WebCore::ScriptElement::dispatchLoadEventRespectingUserGestureIndicator):
(WebCore::ScriptElement::executeScriptAndDispatchEvent):
(WebCore::ScriptElement::executePendingScript):
* dom/ScriptElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220077 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, test gardening
jiewen_tan@apple.com [Mon, 31 Jul 2017 21:45:47 +0000 (21:45 +0000)]
Unreviewed, test gardening

* platform/mac-highsierra/TestExpectations:
* platform/mac-highsierra/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/test_pbkdf2_long_empty.https-expected.txt: Added.
* platform/mac-highsierra/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/test_pbkdf2_short_empty.https-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220076 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoSkipped http/tests/media/video-play-stall.html.
jlewis3@apple.com [Mon, 31 Jul 2017 21:43:02 +0000 (21:43 +0000)]
Skipped  http/tests/media/video-play-stall.html.
https://bugs.webkit.org/show_bug.cgi?id=174988

Unreviewed test gardening.
* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220075 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() may not be able to
dbates@webkit.org [Mon, 31 Jul 2017 21:26:26 +0000 (21:26 +0000)]
WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() may not be able to
determine page that initiated navigation
https://bugs.webkit.org/show_bug.cgi?id=174531

Remove a comment from WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
about determining the originating page independently from the originating frame. There
does not seem to be much value to fixing this. We can always revisit this issue if we
discover a strong motivating example. See <https://bugs.webkit.org/show_bug.cgi?id=174531#c1>
for more details.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220074 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, rolling out r220048.
jlewis3@apple.com [Mon, 31 Jul 2017 20:31:05 +0000 (20:31 +0000)]
Unreviewed, rolling out r220048.

This revision caused multiple crashes in fast/images. See
webkit.org/b/174990

Reverted changeset:

"RenderImageResourceStyleImage::image() should return the
nullImage() if the image is not available"
https://bugs.webkit.org/show_bug.cgi?id=174874
http://trac.webkit.org/changeset/220048

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220073 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoDo not mark all web-platform tests as slow, as this increases time spent on layout...
pvollan@apple.com [Mon, 31 Jul 2017 18:36:54 +0000 (18:36 +0000)]
Do not mark all web-platform tests as slow, as this increases time spent on layout tests.
Only mark individual web-platform tests as slow.

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220072 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoRemove unnecessary exceptions from storage code
commit-queue@webkit.org [Mon, 31 Jul 2017 18:05:09 +0000 (18:05 +0000)]
Remove unnecessary exceptions from storage code
https://bugs.webkit.org/show_bug.cgi?id=174572

Patch by Sam Weinig <sam@webkit.org> on 2017-07-31
Reviewed by Chris Dumez.

Source/WebCore:

Remove checks for canAccessStorage() and the exceptions they would cause.
These were used for Storage in ephemeral sessions, but they are now supported.
Add checks for a null frame to functions that can mutate the storage, as the
frame is needed for that, and it retains our existing behavior for disconnected
frames. By removing these checks / exceptions, we can fully generate Storage.idl.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSStorageCustom.cpp: Removed.
Remove JSStorageCustom.cpp

* loader/EmptyClients.cpp:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::sessionStorage):
(WebCore::DOMWindow::localStorage):
* storage/StorageArea.h:
Remove canAccessStorage.

* storage/Storage.cpp:
(WebCore::Storage::length):
(WebCore::Storage::key):
(WebCore::Storage::getItem):
(WebCore::Storage::setItem):
(WebCore::Storage::removeItem):
(WebCore::Storage::clear):
(WebCore::Storage::contains):
(WebCore::Storage::isSupportedPropertyName):
(WebCore::Storage::supportedPropertyNames):
* storage/Storage.h:
* storage/Storage.idl:
Remove canAccessStorage checks and corresponding exceptions. Add supportedPropertyNames
to allow the removal of the [CustomGetOwnPropertyNames].

Source/WebKit:

* WebProcess/Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::canAccessStorage): Deleted.
* WebProcess/Storage/StorageAreaImpl.h:
* WebProcess/Storage/StorageNamespaceImpl.cpp:
Remove canAccessStorage. It is no longer called.

Source/WebKitLegacy:

* Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::canAccessStorage): Deleted.
* Storage/StorageAreaImpl.h:
Remove canAccessStorage. It is no longer called.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220071 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, update test262 results for optional catch binding
utatane.tea@gmail.com [Mon, 31 Jul 2017 17:42:00 +0000 (17:42 +0000)]
Unreviewed, update test262 results for optional catch binding

* test262.yaml:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220070 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, rolling out r220060.
jlewis3@apple.com [Mon, 31 Jul 2017 16:32:16 +0000 (16:32 +0000)]
Unreviewed, rolling out r220060.

This broke our internal builds. Contact reviewer of patch for
more information.

Reverted changeset:

"Merge WTFThreadData to Thread::current"
https://bugs.webkit.org/show_bug.cgi?id=174716
http://trac.webkit.org/changeset/220060

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220069 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[JSC] Support optional catch binding
utatane.tea@gmail.com [Mon, 31 Jul 2017 16:15:32 +0000 (16:15 +0000)]
[JSC] Support optional catch binding
https://bugs.webkit.org/show_bug.cgi?id=174981

Reviewed by Saam Barati.

JSTests:

* stress/optional-catch-binding-syntax.js: Added.
(testSyntax):
(testSyntaxError):
(catch.catch):
* stress/optional-catch-binding.js: Added.
(shouldBe):
(throwException):

Source/JavaScriptCore:

This patch implements optional catch binding proposal[1], which is now stage 3.
This proposal adds a new `catch` brace with no error value binding.

    ```
        try {
            ...
        } catch {
            ...
        }
    ```

Sometimes we do not need to get error value actually. For example, the function returns
boolean which means whether the function succeeds.

    ```
    function parse(result) // -> bool
    {
         try {
             parseInner(result);
         } catch {
             return false;
         }
         return true;
    }
    ```

In the above case, we are not interested in the actual error value. Without this syntax,
we always need to introduce a binding for an error value that is just ignored.

[1]: https://michaelficarra.github.io/optional-catch-binding-proposal/

* bytecompiler/NodesCodegen.cpp:
(JSC::TryNode::emitBytecode):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseTryStatement):

LayoutTests:

Rebaseline existing tests.

* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:
* sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T4-expected.txt:
* sputnik/Conformance/12_Statement/12.14_The_try_Statement/S12.14_A16_T4.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220068 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMany web-platform tests are slow on Windows.
pvollan@apple.com [Mon, 31 Jul 2017 15:13:26 +0000 (15:13 +0000)]
Many web-platform tests are slow on Windows.

Unreviewed test gardening, mark web-platform tests as slow.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220067 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMerge WTFThreadData to Thread::current
utatane.tea@gmail.com [Mon, 31 Jul 2017 11:23:41 +0000 (11:23 +0000)]
Merge WTFThreadData to Thread::current
https://bugs.webkit.org/show_bug.cgi?id=174716

Reviewed by Sam Weinig.

Source/JavaScriptCore:

Use Thread::current() instead.

* API/JSContext.mm:
(+[JSContext currentContext]):
(+[JSContext currentThis]):
(+[JSContext currentCallee]):
(+[JSContext currentArguments]):
(-[JSContext beginCallbackWithData:calleeValue:thisValue:argumentCount:arguments:]):
(-[JSContext endCallbackWithData:]):
* heap/Heap.cpp:
(JSC::Heap::requestCollection):
* runtime/Completion.cpp:
(JSC::checkSyntax):
(JSC::checkModuleSyntax):
(JSC::evaluate):
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
(JSC::linkAndEvaluateModule):
(JSC::importModule):
* runtime/Identifier.cpp:
(JSC::Identifier::checkCurrentAtomicStringTable):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):
(JSC::JSLock::willReleaseLock):
(JSC::JSLock::dropAllLocks):
(JSC::JSLock::grabAllLocks):
* runtime/JSLock.h:
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::updateStackLimits):
(JSC::VM::committedStackByteCount):
* runtime/VM.h:
(JSC::VM::isSafeToRecurse const):
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
* runtime/VMInlines.h:
(JSC::VM::ensureStackCapacityFor):
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPatternConstructor::isSafeToRecurse const):

Source/WebCore:

Use Thread::current() instead.

* fileapi/AsyncFileStream.cpp:
* platform/ThreadGlobalData.cpp:
(WebCore::ThreadGlobalData::ThreadGlobalData):
* platform/graphics/cocoa/WebCoreDecompressionSession.h:
* platform/ios/wak/WebCoreThread.mm:
(StartWebThread):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):

Source/WTF:

We placed thread specific data in WTFThreadData previously. But now, we have a new good place
to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
before calling WTF::initializeThreading.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/LockAlgorithm.h:
* wtf/LockAlgorithmInlines.h:
* wtf/MainThread.h:
* wtf/ParkingLot.cpp:
* wtf/StackStats.cpp:
(WTF::StackStats::PerThreadStats::PerThreadStats):
(WTF::StackStats::CheckPoint::CheckPoint):
(WTF::StackStats::CheckPoint::~CheckPoint):
(WTF::StackStats::probe):
(WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
* wtf/ThreadHolder.cpp:
(WTF::ThreadHolder::initializeCurrent):
* wtf/ThreadHolder.h:
(WTF::ThreadHolder::ThreadHolder):
(WTF::ThreadHolder::currentMayBeNull):
(WTF::ThreadHolder::current):
* wtf/ThreadHolderPthreads.cpp:
(WTF::ThreadHolder::initialize):
(WTF::ThreadHolder::destruct):
(WTF::ThreadHolder::current): Deleted.
* wtf/ThreadHolderWin.cpp:
(WTF::ThreadHolder::currentDying):
(WTF::ThreadHolder::initialize):
(WTF::ThreadHolder::current): Deleted.
* wtf/Threading.cpp:
(WTF::Thread::initializeInThread):
(WTF::Thread::entryPoint):
(WTF::Thread::didExit):
(WTF::initializeThreading):
(WTF::Thread::currentMayBeNull): Deleted.
* wtf/Threading.h:
(WTF::Thread::atomicStringTable):
(WTF::Thread::setCurrentAtomicStringTable):
(WTF::Thread::stackStats):
(WTF::Thread::savedStackPointerAtVMEntry):
(WTF::Thread::setSavedStackPointerAtVMEntry):
(WTF::Thread::savedLastStackTop):
(WTF::Thread::setSavedLastStackTop):
(WTF::Thread::current):
* wtf/ThreadingPrimitives.h:
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::createCurrentThread):
(WTF::Thread::current): Deleted.
* wtf/ThreadingWin.cpp:
(WTF::Thread::createCurrentThread):
(WTF::Thread::current): Deleted.
* wtf/WTFThreadData.cpp: Removed.
* wtf/WTFThreadData.h: Removed.
* wtf/text/AtomicString.cpp:
* wtf/text/AtomicStringImpl.cpp:
(WTF::stringTable):
* wtf/text/AtomicStringTable.cpp:
(WTF::AtomicStringTable::create):
* wtf/text/AtomicStringTable.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220060 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GTK] Layout test fast/css/image-set-unprefixed.html is failing
commit-queue@webkit.org [Mon, 31 Jul 2017 11:09:35 +0000 (11:09 +0000)]
[GTK] Layout test fast/css/image-set-unprefixed.html is failing
https://bugs.webkit.org/show_bug.cgi?id=163975

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-07-31
Reviewed by Žan Doberšek.

Remove obsolete expectation for image-set-unprefixed.html.

It appears to have started passing with the test change in r209543.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220059 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoCreated a bool pretty printer at WTF for debugging purposes
calvaris@igalia.com [Mon, 31 Jul 2017 09:14:58 +0000 (09:14 +0000)]
Created a bool pretty printer at WTF for debugging purposes
https://bugs.webkit.org/show_bug.cgi?id=174893

Reviewed by Darin Adler.

Source/WebCore:

Use WTF::boolPrettyPrinter in debugging messages.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::seek):

Source/WTF:

* wtf/PrintStream.cpp:
(WTF::printInternal): The overload taking bool uses boolForPrinting
* wtf/PrintStream.h:
(WTF::boolForPrinting): Converts a bool in "true" or "false".

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220058 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GTK] Layout Tests fast/dom/{Element,Range}/getClientRects.html are failing
commit-queue@webkit.org [Mon, 31 Jul 2017 09:07:41 +0000 (09:07 +0000)]
[GTK] Layout Tests fast/dom/{Element,Range}/getClientRects.html are failing
https://bugs.webkit.org/show_bug.cgi?id=141700

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-07-31
Reviewed by Sam Weinig.

Add gtk-specific expectations for getClientRects tests.

Since these expectations depend on text metrics, it is unsurprising that they
are platform-dependent.

* platform/gtk/TestExpectations:
* platform/gtk/fast/dom/Element/getClientRects-expected.txt: Added.
* platform/gtk/fast/dom/Range/getClientRects-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220057 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoVersioning.
bshafiei@apple.com [Mon, 31 Jul 2017 08:20:18 +0000 (08:20 +0000)]
Versioning.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220056 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed. Suppress the -Wextra compiler warning when building with GCC 6.3.0,
zandobersek@gmail.com [Mon, 31 Jul 2017 06:59:59 +0000 (06:59 +0000)]
Unreviewed. Suppress the -Wextra compiler warning when building with GCC 6.3.0,
explicitly initializing the RefCounted<> base class in the
FetchHeaders(const FetchHeaders&) constructor.

Note that while that's the signature of the copy constructor for the FetchHeaders
class, the base RefCounted<> class is not copyable, so the default RefCounted<>
constructor is used, but the FetchHeaders resources are normally copied into the
new object from the one that's passed in.

* Modules/fetch/FetchHeaders.h:
(WebCore::FetchHeaders::FetchHeaders):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220054 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[WTF] Introduce Private Symbols
utatane.tea@gmail.com [Mon, 31 Jul 2017 04:57:15 +0000 (04:57 +0000)]
[WTF] Introduce Private Symbols
https://bugs.webkit.org/show_bug.cgi?id=174935

Reviewed by Darin Adler.

Source/JavaScriptCore:

Use SymbolImpl::isPrivate().

* builtins/BuiltinNames.cpp:
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::isPrivateName): Deleted.
* builtins/BuiltinUtils.h:
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::lookup):
* runtime/CommonIdentifiers.cpp:
(JSC::CommonIdentifiers::isPrivateName): Deleted.
* runtime/CommonIdentifiers.h:
* runtime/ExceptionHelpers.cpp:
(JSC::createUndefinedVariableError):
* runtime/Identifier.h:
(JSC::Identifier::isPrivateName):
* runtime/IdentifierInlines.h:
(JSC::identifierToSafePublicJSValue):
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorAssign):
(JSC::defineProperties):
(JSC::setIntegrityLevel):
(JSC::testIntegrityLevel):
(JSC::ownPropertyKeys):
* runtime/PrivateName.h:
(JSC::PrivateName::PrivateName):
* runtime/PropertyName.h:
(JSC::PropertyName::isPrivateName):
* runtime/ProxyObject.cpp:
(JSC::performProxyGet):
(JSC::ProxyObject::performInternalMethodGetOwnProperty):
(JSC::ProxyObject::performHasProperty):
(JSC::ProxyObject::performPut):
(JSC::ProxyObject::performDelete):
(JSC::ProxyObject::performDefineOwnProperty):

Source/WTF:

Upcoming proposal of class fields[1] requires private fields.
The simple way to implement it is adding a property with a private symbol.
Currently, we have private symbols for internal properties. They are usual
Symbols managed by the hash table. So basically private symbols are statically
created in BuiltinNames. However this new proposal encourages users to create
such private symbols more and more.

So, this patch introduces notion of "Private" into WTF SymbolImpl. This patch
adds PrivateSymbolImpl. This is SymbolImpl with "Private" flag. We do not need
to look up the symbol from the hash table to check whether the given symbol
is a private one.

[1]: https://github.com/tc39/proposal-class-fields

* wtf/text/StringImpl.h:
* wtf/text/SymbolImpl.cpp:
(WTF::PrivateSymbolImpl::create):
(WTF::PrivateSymbolImpl::createNullSymbol):
* wtf/text/SymbolImpl.h:
(WTF::SymbolImpl::isPrivate):
(WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
(WTF::SymbolImpl::SymbolImpl):
(WTF::PrivateSymbolImpl::PrivateSymbolImpl):

Tools:

* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220053 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoRemove code in HTMLObjectElement attribute parsing that forces style resolution and...
darin@apple.com [Sun, 30 Jul 2017 21:44:01 +0000 (21:44 +0000)]
Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout
https://bugs.webkit.org/show_bug.cgi?id=130653

Reviewed by Antti Koivisto.

Source/WebCore:

Also fixes a bug where load events are delivered prematurely in some cases
when an object, embed, frame, or iframe element is still loading.

* dom/Document.cpp:
(WebCore::Document::loadEventDelayTimerFired): Added a call to
FrameLoader::checkLoadComplete. Goes along with the change to
FrameLoader::checkLoadCompleteForThisFrame, which now respects the
isDelayingLoadEvent flag.

* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::HTMLAppletElement): Removed the createdByParser argument,
no longer needed by the base class.
(WebCore::HTMLAppletElement::create): Added call to finishCreating, which is now part of
the process of creating any object in a class derived from HTMLPlugInImageElement.
(WebCore::HTMLAppletElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
is only called when it's becoming false; avoids a false/true/false round trip that can
cause trouble.
* html/HTMLAppletElement.h: Updated for the above.

* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::HTMLEmbedElement): Removed the createdByParser argument,
no longer needed by the base class.
(WebCore::HTMLEmbedElement::create): Added call to finishCreating, which is now part of
the process of creating any object in a class derived from HTMLPlugInImageElement.
(WebCore::HTMLEmbedElement::parseAttribute): Changed srcAttr to call
updateImageLoaderWithNewURLSoon to do the image loading logic.
(WebCore::HTMLEmbedElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
is only called when it's becoming false; avoids a false/true/false round trip that can
cause trouble.
* html/HTMLEmbedElement.h: Updated for the above.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState): Call setShouldDelayLoadEvent(false) when
transitioning to HAVE_CURRENT_DATA (or beyond), even if we have already fired a loadeddata
event in the past. This matches what the HTML specification calls for, but only if you
read it carefully. Without this change, and with the more complete implementation of
load event delay below, one of the regression tests hangs because are permanently stuck
dealying load events. Also added a FIXME about other code that likely has a similar
problem; the symptom is likely to be subtle and minor, though.

* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::HTMLObjectElement): Removed the createdByParser argument,
no longer needed by the base class.
(WebCore::HTMLObjectElement::create): Added call to finishCreating, which is now part of
the process of creating any object in a class derived from HTMLPlugInImageElement.
(WebCore::HTMLObjectElement::parseAttribute): Changed dataAttr to use
updateImageLoaderWithNewURLSoon. Explicitly call scheduleUpdateForAfterStyleResolution
since just calling invalidateStyleAndRenderersForSubtree alone is no longer sufficient.
(WebCore::HTMLObjectElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
is only called when it's becoming false; avoids a false/true/false round trip that can
cause trouble.
(WebCore::HTMLObjectElement::childrenChanged): Added calls to the new
scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
(WebCore::HTMLObjectElement::renderFallbackContent): Remove the call to
updateStyleIfNeeded. This is the main change that the title of this bug refers to.
* html/HTMLObjectElement.h: Updated for the above. Also removed the
clearUseFallbackContent function because it's clearer to set the data member in
line at the single call site in HTMLObjectElement::parseAttribute.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Removed the createdByParser
argument; no need to set an m_needsWidgetUpdate flag differently for parser cases now.
(WebCore::HTMLPlugInImageElement::finshCreating): Added. To be called after creating
an element to do work that can't be done in a constructor.
(WebCore::HTMLPlugInImageElement::didRecalcStyle): Added. Calls the new
scheduleUpdateForAfterStyleResolution function.
(WebCore::HTMLPlugInImageElement::didAttachRenderers): Moved all the logic from this
function into scheduleUpdateForAfterStyleResolution. Also added a call through to the base
class; cleans things up, even though it's just an assertion.
(WebCore::HTMLPlugInImageElement::willDetachRenderers): Removed the call to
setNeedsWidgetUpdate(true) here; no longer needed because the new logic already
does the right thing in this case.
(WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary): Deleted. Now handled by
updateAfterStyleResolution instead.
(WebCore::HTMLPlugInImageElement::finishParsingChildren): Deleted. Handling updates
after parsing all the children now comes naturally out of the new implementation.
(WebCore::HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution): Added.
Schedules a call to updateAfterStyleResolution when needed, and equally importantly,
increments the load event delay count to make sure that loads that are part of that
update can participate in decision about whether it's time for the load event.
(WebCore::HTMLPlugInImageElement::updateAfterStyleResolution): Added.
Combines updateWidgetIfNecessary and startLoadingImage, and also deals with the new
m_needsImageReload boolean in cases where no actual loading is done.
(WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Update load event delay
count when moving an element that is in the middle of loading. This lets the
updateAfterStyleResolution function do the right thing even when the element is
moved without leaving anything stuck in a strange state.
(WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension): Call the new
scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
(WebCore::HTMLPlugInImageElement::startLoadingImage): Deleted. Now handled by
updateAfterStyleResolution instead.
(WebCore::HTMLPlugInImageElement::updateImageLoaderWithNewURLSoon): Added. Does all
the right things for when an image URL is changed; for use by the concrete derived classes.
* html/HTMLPlugInImageElement.h: Updated for above changes. Also made m_imageLoader
private rather than protected, and added the two new boolean data members.

* html/HTMLTagNames.in: Removed unneeded constructorNeedsCreatedByParser flags for
applet, embed, and object.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::isLoadingInAPISense): Return true if the document is
delaying a load event.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame): Don't do any work if
isDelayingLoadEvent is true; otherwise this function can have a side effect of
triggering the load event.
(WebCore::FrameLoader::detachFromParent): Schedule a checkLoadComplete here, too, not
just a checkCompleted. This is relevant if the frame we are detaching was delaying
a load event because it no longer will be and so the load might be complete.

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didFinishLoadForFrame): Omit now-unneeded "shouldDump" argument
when calling frameDidChangeLocation.
(WTR::InjectedBundlePage::frameDidChangeLocation): Removed "shouldDump" argument. This was
causing WebKitTestRunner to not dump anything in cases where DumpRenderTree will dump, and
thus causing mysterious failures of a couple of tests. There are two remaining issues:
1) WebKitTestRunner won't run its dump code if there is no "page", and there is no such
consideration in DumpRenderTree and 2) Both DumpRenderTree and WebKitTestRunner share the
same logic flaw that causes "top loading frame" to get set to one of the subframes in
tests where  the following sequence occurs: test calls waitUntilDone, main frame finishes
loading, subframe starts loading. It would be good to clean that up some day, but for now
this patch makes the two work identically rather than changing both.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Updated for change above.

LayoutTests:

* fast/text/international/embed-bidi-style-in-isolate-crash.html: Removed onerror attribute
in the audio element in this test. The error event does fire during the test, which causes
the test to fail. Before, the test was prematurely exiting before the load failed, preventing
the test from failing, but also meaning we didn't finish running the test.

* imported/blink/fast/dom/Window/open-window-features-fuzz.html: Use waitUntilDone and
notifyDone to prevent the test from exiting prematurely. Use a URL that won't trigger loading
outside the web browser; the URL is not what mattered to this test. Before, the test was
prematurely exiting before the test ran. Note also, that I don't think this is testing
much effectively; not sure we are getting any benefit from this test since before it was
not really running to completion anyway.

* media/event-queue-crash-expected.txt: Updated expectations to expect syntax error. Before
there was a race and often the test exited before the syntax error could be logged.

* platform/mac/TestExpectations: Removed flakiness expectation from the
media/event-queue-crash.html test. What made it flaky was a race with the load event,
and that race should be fixed by the change to FrameLoader::checkLoadCompleteForThisFrame.
The same race existed on all platforms, not just Mac, so this flakiness expectation should
be in the main TextExpectations file if anywhere. But I believe it is not needed at all.
For media/modern-media-controls/media-documents/background-color-and-centering.html,
added image failure expectation because under modern WebKit on Mac the image now captures
the upper left hand corner of the controls overlay. Still seems to pass on iOS and the bug
this was created for was iOS-specific, so should be OK for now.

* webarchive/loading/video-in-webarchive-expected.txt: Updated. The old result shows evidence
of a premature load event, fixed by the change to FrameLoader::checkLoadCompleteForThisFrame.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220052 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[WK2] Replace RetainPtr<> with auto when adopting allocated ObjC objects in DataInter...
wenson_hsieh@apple.com [Sun, 30 Jul 2017 21:35:17 +0000 (21:35 +0000)]
[WK2] Replace RetainPtr<> with auto when adopting allocated ObjC objects in DataInteractionTests
https://bugs.webkit.org/show_bug.cgi?id=174963

Reviewed by Darin Adler.

Replaces several uses of RetainPtr<>s with auto. Some test cases in this file use auto, while other test cases declare using
RetainPtr<>. This patch changes them to all use auto.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220051 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[WebIDL] Remove JS builtin bindings for FetchRequest, DOMWindowFetch and WorkerGlobal...
weinig@apple.com [Sun, 30 Jul 2017 20:27:19 +0000 (20:27 +0000)]
[WebIDL] Remove JS builtin bindings for FetchRequest, DOMWindowFetch and WorkerGlobalScopeFetch
https://bugs.webkit.org/show_bug.cgi?id=174974

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/mode-same-origin.any-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-about.any-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-blob-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-others-expected.txt:
* web-platform-tests/fetch/api/cors/cors-cookies.any-expected.txt:
* web-platform-tests/fetch/api/policies/referrer-origin-when-cross-origin-expected.txt:
* web-platform-tests/fetch/api/request/request-bad-port-expected.txt:
Update results to have the correct line number for exceptions reported in the console.

Source/WebCore:

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* Modules/fetch/DOMWindowFetch.js: Removed.
* Modules/fetch/FetchRequest.js: Removed.
* Modules/fetch/WorkerGlobalScopeFetch.js: Removed.
Remove builtin files.

* Modules/fetch/DOMWindowFetch.cpp:
(WebCore::DOMWindowFetch::fetch):
* Modules/fetch/DOMWindowFetch.h:
* Modules/fetch/DOMWindowFetch.idl:
* Modules/fetch/WorkerGlobalScopeFetch.cpp:
(WebCore::WorkerGlobalScopeFetch::fetch):
* Modules/fetch/WorkerGlobalScopeFetch.h:
* Modules/fetch/WorkerGlobalScopeFetch.idl:
Remove builtin and instead create FetchRequest in the implementation.

* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::extractBody):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchResponse.cpp:
* Modules/fetch/FetchResponse.h:
Rename FetchBody::BindingDataType to FetchBody::Init to match its IDL naming.

* Modules/fetch/FetchHeaders.cpp:
(WebCore::appendToHeaderMap):
(WebCore::fillHeaderMap):
(WebCore::FetchHeaders::create):
(WebCore::FetchHeaders::fill):
* Modules/fetch/FetchHeaders.h:
Add helpers to implement the fill algorithm for various input types.
Leave the existing fill for now, as it is still used by the FetchResponse
builtin, but will eventually be removed.

* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeOptions):
(WebCore::FetchRequest::initializeWith):
(WebCore::FetchRequest::setBody):
(WebCore::FetchRequest::create):
(WebCore::FetchRequest::setBodyFromInputRequest): Deleted.
* Modules/fetch/FetchRequest.h:
Migrate builtin code to the implementation. This is 1-to-1 re-implementation,
so I did not attempt to fix any conformance issues. That will come in follow up.

* Modules/fetch/FetchRequest.idl:
Replace builtins with an IDL constructor.

* Modules/fetch/FetchRequestInit.h:
* Modules/fetch/FetchRequestInit.idl:
Add missing headers and body to FetchRequestInit.

LayoutTests:

* http/tests/inspector/network/fetch-network-data-expected.txt:
Update results to have the correct line number for exceptions reported in the console.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220050 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAdd URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.
beidson@apple.com [Sun, 30 Jul 2017 17:36:26 +0000 (17:36 +0000)]
Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.
https://bugs.webkit.org/show_bug.cgi?id=174958

Reviewed by Darin Adler.

Source/WebKit:

* UIProcess/API/APIURLSchemeTask.h:

* UIProcess/API/C/WKTestingSupport.cpp:
(WKGetAPIURLSchemeTaskInstanceCount):
(WKGetWebURLSchemeTaskInstanceCount):
* UIProcess/API/C/WKTestingSupport.h:

* UIProcess/WebURLSchemeTask.h:

* WebKit.xcodeproj/project.pbxproj:

Source/WTF:

This patch adds a new template class "InstanceCounted<T>".

For each specialization, "InstanceCounted" will keep track of the total number of
instances in existence.

This makes explicate leak checking in API tests possible.

Since this adds some runtime and storage overhead the code that actually does anything
is only compiled in debug builds.

* WTF.xcodeproj/project.pbxproj:
* wtf/InstanceCounted.h: Added.
(WTF::InstanceCounted::InstanceCounted):
(WTF::InstanceCounted::instanceCount):
(WTF::InstanceCounted::~InstanceCounted):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-leaks.mm: Added.
(-[LeakSchemeHandler webView:startURLSchemeTask:]):
(-[LeakSchemeHandler webView:stopURLSchemeTask:]):
(runUntilTasksInFlight):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220049 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoRenderImageResourceStyleImage::image() should return the nullImage() if the image...
commit-queue@webkit.org [Sun, 30 Jul 2017 07:38:31 +0000 (07:38 +0000)]
RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available
https://bugs.webkit.org/show_bug.cgi?id=174874
<rdar://problem/33530130>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-07-30
Reviewed by Darin Adler.

Source/WebCore:

If an <img> element has image content data for a none cached image, e.g.
-webkit-named-image, RenderImageResourceStyleImage will be created and
attached to the RenderImage. RenderImageResourceStyleImage::m_cachedImage
will be set to null because the m_styleImage->isCachedImage() is false in
this case. When ImageLoader finishes loading the url of the src attribute,
RenderImageResource::setCachedImage() will be called to set m_cachedImage.

A crash will happen when the RenderImage is destroyed. Destroying the
RenderImage calls RenderImageResourceStyleImage::shutdown() which checks
m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image()
which ends up calling CSSNamedImageValue::image() which returns a null pointer
because the size is empty. RenderImageResourceStyleImage::shutdown() calls
image()->stopAnimation() without checking the return value of image().

Like the base class virtual method RenderImageResource::image(),
RenderImageResourceStyleImage::image() should return the nullImage() if
the image is not available.

Test: fast/images/image-element-image-content-data.html

* css/CSSCrossfadeValue.cpp:
* css/CSSFilterImageValue.cpp:
* page/EventHandler.cpp:
* page/PageSerializer.cpp:
* rendering/RenderElement.cpp:
* rendering/RenderImageResource.cpp:
* rendering/RenderImageResourceStyleImage.cpp:
(WebCore::RenderImageResourceStyleImage::initialize):

(WebCore::RenderImageResourceStyleImage::shutdown): Revert back the changes
of r208511 in this function. Add a call to image()->stopAnimation() without
checking the return of image() since it will return the nullImage() if
the image not available. There is no need to check m_cachedImage before
calling image() because image() does not check or access m_cachedImage.

(WebCore::RenderImageResourceStyleImage::image): The base class method
RenderImageResource::image() returns the nullImage() if the image not
available. This is because CachedImage::imageForRenderer() returns
the nullImage() if the image is not available; see CachedImage.h. We should
do the same for the derived class for consistency.

* rendering/style/ContentData.cpp:
* rendering/style/StyleCachedImage.cpp:
* style/StylePendingResources.cpp:

LayoutTests:

* fast/images/image-element-image-content-data-expected.txt: Added.
* fast/images/image-element-image-content-data.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220048 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoLLInt offsets extractor should be able to handle C++ constexprs
keith_miller@apple.com [Sun, 30 Jul 2017 03:01:12 +0000 (03:01 +0000)]
LLInt offsets extractor should be able to handle C++ constexprs
https://bugs.webkit.org/show_bug.cgi?id=174964

Reviewed by Saam Barati.

This patch adds new syntax to the offline asm language. The new keyword,
constexpr, takes the subsequent identifier and maps it to a C++ constexpr
expression. Additionally, if the value is not an identifier you can wrap it in
parentheses. e.g. constexpr (myConstexprFunction() + OBJECT_OFFSET(Foo, bar)),
which will get converted into:
static_cast<int64_t>(myConstexprFunction() + OBJECT_OFFSET(Foo, bar));

This patch also changes the data format the LLIntOffsetsExtractor
binary produces.  Previously, it would produce unsigned values,
after this patch every value is an int64_t.  Using an int64_t is
useful because it means that we can represent any constant needed.
int32_t masks are sign extended then passed then converted to a
negative literal sting in the assembler so it will be the constant
expected.

* llint/LLIntOffsetsExtractor.cpp:
(JSC::LLIntOffsetsExtractor::dummy):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
* offlineasm/asm.rb:
* offlineasm/ast.rb:
* offlineasm/generate_offset_extractor.rb:
* offlineasm/offsets.rb:
* offlineasm/parser.rb:
* offlineasm/transform.rb:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220047 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, build fix for GTK and WPE about StorageProcess renaming
utatane.tea@gmail.com [Sat, 29 Jul 2017 19:51:10 +0000 (19:51 +0000)]
Unreviewed, build fix for GTK and WPE about StorageProcess renaming

.:

* Source/cmake/OptionsWPE.cmake:

Source/WebKit:

* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220046 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, rollout r220044 because it set the bots on fire.
fpizlo@apple.com [Sat, 29 Jul 2017 19:36:47 +0000 (19:36 +0000)]
Unreviewed, rollout r220044 because it set the bots on fire.

It seems that the "-Wunguarded-availability-new" pragma is not widely supported. So, a bunch of the
Mac bots are now unable to build and that includes EWS.

Fixing by rolling it out.

* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
(-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
(-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
(WebCore::SourceBufferPrivateAVFObjC::flush):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220045 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFixed building for macOS 10.12 with the macOS 10.13 SDK.
mitz@apple.com [Sat, 29 Jul 2017 16:25:13 +0000 (16:25 +0000)]
Fixed building for macOS 10.12 with the macOS 10.13 SDK.

Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer
and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available
starting in that release, they have been available as SPI earlier.

* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
(-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
(-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
(WebCore::SourceBufferPrivateAVFObjC::flush):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220044 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoSpeedometer 2.0: Document vanilla/es2015 build process
commit-queue@webkit.org [Sat, 29 Jul 2017 11:38:07 +0000 (11:38 +0000)]
Speedometer 2.0: Document vanilla/es2015 build process
https://bugs.webkit.org/show_bug.cgi?id=174894

Patch by Mathias Bynens <mathias@chromium.org> on 2017-07-29
Reviewed by Ryosuke Niwa.

* Speedometer/resources/todomvc/vanilla-examples/es2015/README.md: Added.
* Speedometer/resources/todomvc/vanilla-examples/es2015/index.html: Made title consistent.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220043 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAX: findMatchingObjects doesn't work when the startObject is ignored
n_wang@apple.com [Sat, 29 Jul 2017 10:27:00 +0000 (10:27 +0000)]
AX: findMatchingObjects doesn't work when the startObject is ignored
https://bugs.webkit.org/show_bug.cgi?id=174965

Reviewed by Chris Fleizach.

Source/WebCore:

findMatchingObjects would return a wrong element if we pass in an ignored
start object. To fix this, we should use the closest accessible sibling as
the start object.

Test: accessibility/mac/search-predicate-from-ignored-element.html

* accessibility/AccessibilityObject.cpp:
(WebCore::appendChildrenToArray):

LayoutTests:

* accessibility/mac/search-predicate-from-ignored-element-expected.txt: Added.
* accessibility/mac/search-predicate-from-ignored-element.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220042 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAX: FKA: Buttons need a visible focus indicator
commit-queue@webkit.org [Sat, 29 Jul 2017 10:00:33 +0000 (10:00 +0000)]
AX: FKA: Buttons need a visible focus indicator
https://bugs.webkit.org/show_bug.cgi?id=171040
<rdar://problem/30922548>

Patch by Aaron Chu <aaron_chu@apple.com> on 2017-07-29
Reviewed by Antoine Quint.

Source/WebCore:

Added a background color for the focus state of the icon buttons in modern media controls.

Test: media/modern-media-controls/button/button-focus-state.html

* Modules/modern-media-controls/controls/button.css:
(button:focus):
(button:focus > picture):
* Modules/modern-media-controls/controls/slider.css:
(.slider > input):

LayoutTests:

* media/modern-media-controls/button/button-focus-state-expected.txt: Added.
* media/modern-media-controls/button/button-focus-state.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac-elcapitan/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220041 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[Mac][WebKit2] WebKit sandbox errors while streaming Netflix
bfulgham@apple.com [Sat, 29 Jul 2017 02:39:38 +0000 (02:39 +0000)]
[Mac][WebKit2] WebKit sandbox errors while streaming Netflix
https://bugs.webkit.org/show_bug.cgi?id=174955
<rdar://problem/33583994>

Reviewed by Alex Christensen.

Wider testing with the stricter sandboxing rules identified three more IOKit properties we need to expose:
- CEAModeID
- CEAPixelRepetition
- IOFBHDMIDongleROM

* WebProcess/com.apple.WebProcess.sb.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220040 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[WebIDL] Remove JS builtin bindings for FetchHeaders
commit-queue@webkit.org [Sat, 29 Jul 2017 02:35:56 +0000 (02:35 +0000)]
[WebIDL] Remove JS builtin bindings for FetchHeaders
https://bugs.webkit.org/show_bug.cgi?id=174905

Patch by Sam Weinig <sam@webkit.org> on 2017-07-28
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/headers/headers-basic-expected.txt:
* web-platform-tests/fetch/api/headers/headers-record-expected.txt:
Update results for more passing tests.

Source/WebCore:

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* Modules/fetch/FetchHeaders.js: Removed.
Remove FetchHeaders.js

* Modules/fetch/FetchHeaders.cpp:
(WebCore::appendToHeaderMap):
(WebCore::FetchHeaders::create):
(WebCore::FetchHeaders::append):
* Modules/fetch/FetchHeaders.h:
(WebCore::FetchHeaders::FetchHeaders):
Add create function for generated constructor.
Add appendToHeaderMap static function which takes the functionality
from the existing append function, and makes it useable in create.

* Modules/fetch/FetchHeaders.idl:
Replace [JSBuiltinConstructor] with real constructor. Keep other builtin
attributes as they are still used by other Fetch code.

* bindings/js/JSDOMConvertRecord.h:
Fix record conversion to work with proxies by changing to use the method table
for getOwnPropertyNames, and undefined values by not excluding undefined values.

LayoutTests:

* fetch/header-constructor-is-array-expected.txt:
* fetch/header-constructor-is-array.html:
Update test to match spec. An array with out a prototype will not yield
a valid Header as it is not iterable.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220039 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, rolling out r219986.
commit-queue@webkit.org [Sat, 29 Jul 2017 00:57:22 +0000 (00:57 +0000)]
Unreviewed, rolling out r219986.
https://bugs.webkit.org/show_bug.cgi?id=174962

"broke PLT on iOS (rdar://problem/33602751)" (Requested by
estes on #webkit).

Reverted changeset:

"Part 1 of: Rename DatabaseProcess to StorageProcess."
https://bugs.webkit.org/show_bug.cgi?id=174879
http://trac.webkit.org/changeset/219986

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220038 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, rolling out r219990.
commit-queue@webkit.org [Sat, 29 Jul 2017 00:52:02 +0000 (00:52 +0000)]
Unreviewed, rolling out r219990.
https://bugs.webkit.org/show_bug.cgi?id=174961

"broke PLT on iOS (rdar://problem/33602751)" (Requested by
estes on #webkit).

Reverted changeset:

"Part 2 of: Rename DatabaseProcess to StorageProcess."
https://bugs.webkit.org/show_bug.cgi?id=174880
http://trac.webkit.org/changeset/219990

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220037 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWeb Inspector: capture an async stack trace when web content calls addEventListener
mattbaker@apple.com [Sat, 29 Jul 2017 00:33:12 +0000 (00:33 +0000)]
Web Inspector: capture an async stack trace when web content calls addEventListener
https://bugs.webkit.org/show_bug.cgi?id=174739
<rdar://problem/33468197>

Reviewed by Brian Burg.

Source/JavaScriptCore:

Allow debugger agents to perform custom logic when asynchronous stack
trace data is cleared. For example, the PageDebuggerAgent would clear
its list of registered listeners for which call stacks have been recorded.

* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::clearAsyncStackTraceData):
* inspector/agents/InspectorDebuggerAgent.h:

Source/WebCore:

Test: inspector/debugger/async-stack-trace.html

Add instrumentation to EventTarget to support showing asynchronous
stack traces when the debugger breaks in a script event listener.

* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
(WebCore::EventTarget::removeEventListener):
(WebCore::EventTarget::fireEventListeners):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didAddEventListenerImpl):
(WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
(WebCore::InspectorInstrumentation::willHandleEventImpl):
(WebCore::InspectorInstrumentation::didHandleEventImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didAddEventListener):
(WebCore::InspectorInstrumentation::willRemoveEventListener):
(WebCore::InspectorInstrumentation::willHandleEvent):
(WebCore::InspectorInstrumentation::didHandleEvent):
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
(WebCore::PageDebuggerAgent::didAddEventListener):
(WebCore::PageDebuggerAgent::willRemoveEventListener):
(WebCore::PageDebuggerAgent::willHandleEvent):
* inspector/PageDebuggerAgent.h:

LayoutTests:

Add test case checking that async stack traces are recorded for addEventListener.

* inspector/debugger/async-stack-trace-expected.txt:
* inspector/debugger/async-stack-trace.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220036 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoDon't add autoplay restrictions to media elements created in response to user gestures.
mrajca@apple.com [Sat, 29 Jul 2017 00:25:49 +0000 (00:25 +0000)]
Don't add autoplay restrictions to media elements created in response to user gestures.
https://bugs.webkit.org/show_bug.cgi?id=174947

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-create-with-user-gesture.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):

LayoutTests:

Skip the test on iOS because "runWithKeyDown" does not work there.

Jer: "Turns out the problem with iOS is that the WKTR EventSender is basically unwritten. It
doesn't support sending mouse, key, or touch events, so our "do this during a user gesture"
helper in video-test.js doesn't work."

* media/video-create-with-user-gesture-expected.txt: Added.
* media/video-create-with-user-gesture.html: Added.
* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220035 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoThe test imported/w3c/web-platform-tests/fetch/api/basic/accept-header.any.html is...
pvollan@apple.com [Fri, 28 Jul 2017 23:21:10 +0000 (23:21 +0000)]
The test imported/w3c/web-platform-tests/fetch/api/basic/accept-header.any.html is slow on Windows.

Unreviewed test gardening, mark test as slow.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220034 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAPI tests that use URLSchemeHandler are failing.
beidson@apple.com [Fri, 28 Jul 2017 23:19:50 +0000 (23:19 +0000)]
API tests that use URLSchemeHandler are failing.
https://bugs.webkit.org/show_bug.cgi?id=174950

Reviewed by Alex Christensen.

Source/WebKit:

Make sure that in all cases where we remove the last task from the page->task map...
...We also remove the map itself.

* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::WebURLSchemeHandler::stopTask):
(WebKit::WebURLSchemeHandler::taskCompleted):
(WebKit::WebURLSchemeHandler::removeTaskFromPageMap):
* UIProcess/WebURLSchemeHandler.h:

Tools:

Fix the NoMIMEType test to be correct.

* TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm:
(-[SchemeHandler initWithData:mimeType:]):
(-[SchemeHandler webView:startURLSchemeTask:]):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220033 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoprepare-ChangeLog should not list added layout tests in PAL ChangeLog
dbates@webkit.org [Fri, 28 Jul 2017 22:31:37 +0000 (22:31 +0000)]
prepare-ChangeLog should not list added layout tests in PAL ChangeLog
https://bugs.webkit.org/show_bug.cgi?id=174876

Reviewed by Alex Christensen.

Do not list added layout tests in the PAL ChangeLog as such tests are unlikely to be related
to a PAL change. Unit tests are more appropriate for PAL changes than layout tests because
they provide a more direct way to test the platform abstraction.

As a side effect of this change we no longer list added layout tests in WebCore/platform/gtk/po/ChangeLog.

* Scripts/prepare-ChangeLog:
(generateNewChangeLogs): Only list added layout tests in the WebCore ChangeLog regardless
of the current working directory.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220032 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, rolling out r220016.
jlewis3@apple.com [Fri, 28 Jul 2017 22:21:02 +0000 (22:21 +0000)]
Unreviewed, rolling out r220016.

Test needs to be unskipped due to configuration change in High
Sierra.

Reverted changeset:

"Marked fast/images/pdf-as-image-with-annotations.html as
image failure."
http://trac.webkit.org/changeset/220016

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220031 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUsing "auto <function()> -> returnType" breaks prepare-ChangeLog
jbedard@apple.com [Fri, 28 Jul 2017 22:04:02 +0000 (22:04 +0000)]
Using "auto <function()> -> returnType" breaks prepare-ChangeLog
https://bugs.webkit.org/show_bug.cgi?id=174930

Unreviewed test fix.

We need to check parentheses before printing 'const' or 'volatile' in the ChangeLog.

* Scripts/prepare-ChangeLog:
(get_function_line_ranges_for_cpp):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220017 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMarked fast/images/pdf-as-image-with-annotations.html as image failure.
jlewis3@apple.com [Fri, 28 Jul 2017 21:58:38 +0000 (21:58 +0000)]
Marked fast/images/pdf-as-image-with-annotations.html as image failure.
<rdar://problem/33550614>

Unreviewed test gardening.

* platform/mac-highsierra/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220016 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMarked multiple iimported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ as...
jlewis3@apple.com [Fri, 28 Jul 2017 21:09:21 +0000 (21:09 +0000)]
Marked multiple iimported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ as failing.
<rdar://problem/33548297>

Unreviewed test gardening.

* platform/mac-highsierra/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220015 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWebMediaSessionHelper calls -[UIApplication beginReceivingRemoteControlEvents] from...
commit-queue@webkit.org [Fri, 28 Jul 2017 21:08:57 +0000 (21:08 +0000)]
WebMediaSessionHelper calls -[UIApplication beginReceivingRemoteControlEvents] from WebThread
https://bugs.webkit.org/show_bug.cgi?id=174934
rdar://problem/33586772

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-28
Reviewed by Eric Carlson.

No new tests because no effect on DOM.

This dispatches a UIKit call to the main thread since it might happen on WebThread in WK1.

* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper initWithCallback:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220014 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMarked imported/w3c/IndexedDB-private-browsing/idbfactory_open12.html as flaky.
jlewis3@apple.com [Fri, 28 Jul 2017 20:49:34 +0000 (20:49 +0000)]
Marked imported/w3c/IndexedDB-private-browsing/idbfactory_open12.html as flaky.
<rdar://problem/33555052>

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:
* platform/mac-highsierra/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220013 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoObjectToStringAdaptiveStructureWatchpoint should not fire if it's dying imminently.
mark.lam@apple.com [Fri, 28 Jul 2017 20:29:09 +0000 (20:29 +0000)]
ObjectToStringAdaptiveStructureWatchpoint should not fire if it's dying imminently.
https://bugs.webkit.org/show_bug.cgi?id=174948
<rdar://problem/33495680>

Reviewed by Filip Pizlo.

JSTests:

* stress/regress-174948.js: Added.

Source/JavaScriptCore:

ObjectToStringAdaptiveStructureWatchpoint is owned by StructureRareData.  If its
owner StructureRareData is already known to be dead (in terms of GC liveness) but
hasn't been destructed yet (i.e. not swept by the GC yet), we should ignore all
requests to fire this watchpoint.

If the GC had the chance to sweep the StructureRareData, thereby destructing the
ObjectToStringAdaptiveStructureWatchpoint, it (the watchpoint) would have removed
itself from the WatchpointSet it was on.  Hence, it would not have been fired.

But since the watchpoint hasn't been destructed yet, it still remains on the
WatchpointSet and needs to guard against being fired in this state.  The fix is
to simply return early if its owner StructureRareData is not live.  This has the
effect of the watchpoint fire being a no-op, which is equivalent to the watchpoint
not firing as we would expect.

This patch also removes some cargo cult copying of watchpoint code which
instantiates a StringFireDetail.  In a few cases, that StringFireDetail is never
used.  This patch removes these unnecessary instantiations.

* bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp:
(JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::fireInternal):
* runtime/StructureRareData.cpp:
(JSC::ObjectToStringAdaptiveStructureWatchpoint::fireInternal):
(JSC::ObjectToStringAdaptiveInferredPropertyValueWatchpoint::handleFire):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220012 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWKURLSchemeTaskImpl instances are being abandoned (except if the task is stopped).
beidson@apple.com [Fri, 28 Jul 2017 20:03:42 +0000 (20:03 +0000)]
WKURLSchemeTaskImpl instances are being abandoned (except if the task is stopped).
<rdar://problem/33568276> and https://bugs.webkit.org/show_bug.cgi?id=174895

Reviewed by Alex Christensen.

There was a lot going on here:
- There was an unbroken cycle between URLSchemeHandlers and URLSchemeTasks
- WKURLSchemeTasks were not destroying their API::URLSchemeTask implementation object
- When a WKWebView was dealloc'ed, it was not cleaning up the related UIProcess tasks
- If the NetworkingProcess crashed, WebProcesses were not cleaning up their tasks
  (and therefore the UIProcess tasks were also not getting cleaned up)
- If a WebProcess crashed, the UIProcess was not cleaning up the related tasks

* UIProcess/API/Cocoa/WKURLSchemeTask.mm:
(-[WKURLSchemeTaskImpl dealloc]): Call API::~URLSchemeTask

* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h:
* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
(WebKit::WebURLSchemeHandlerCocoa::platformTaskCompleted): Clear out the API wrapper map
  so the wrapper and implementation object can both be destroyed.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close): Call stopAllURLSchemeTasks.
(WebKit::WebPageProxy::processDidTerminate): Call stopAllURLSchemeTasks.
(WebKit::WebPageProxy::stopAllURLSchemeTasks):
* UIProcess/WebPageProxy.h:

* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::WebURLSchemeHandler::startTask):
(WebKit::WebURLSchemeHandler::stopAllTasksForPage):
(WebKit::WebURLSchemeHandler::stopTask):
(WebKit::WebURLSchemeHandler::taskCompleted):
* UIProcess/WebURLSchemeHandler.h:

* UIProcess/WebURLSchemeTask.cpp:
(WebKit::WebURLSchemeTask::WebURLSchemeTask):
* UIProcess/WebURLSchemeTask.h:
(WebKit::WebURLSchemeTask::pageID): Store separate from the WebPage so messaging
  is possible even after the WebPage* has been cleared.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::stopAllURLSchemeTasks):
* WebProcess/WebPage/WebPage.h:

* WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
(WebKit::WebURLSchemeHandlerProxy::stopAllTasks):
(WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
(WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
(WebKit::WebURLSchemeHandlerProxy::removeTask):
* WebProcess/WebPage/WebURLSchemeHandlerProxy.h:

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::networkProcessConnectionClosed): Call stopAllURLSchemeTasks
  for each WebPage.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220011 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUsing "auto <function()> -> returnType" breaks prepare-ChangeLog
jfbastien@apple.com [Fri, 28 Jul 2017 18:54:33 +0000 (18:54 +0000)]
Using "auto <function()> -> returnType" breaks prepare-ChangeLog
https://bugs.webkit.org/show_bug.cgi?id=174930

Reviewed by Daniel Bates.

Teach prepare-ChangeLog about C++ auto arrow return, and while I'm
here also teach it about const and volatile overloads. I didn't do
reference and rvalue reference overloads because we don't really
use them, and the current parser throws away those characters and
it doesn't seem worth making it more complex.

* Scripts/prepare-ChangeLog:
(get_function_line_ranges_for_cpp):
* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests-expected.txt:
* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests.cpp:
(Foo::Arrow::arrow):
(Foo::Arrow::otherArrow):
(Foo::Arrow::otherArrow const):
(Foo::Arrow::otherArrow volatile):
(Foo::Arrow::otherArrow const volatile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220010 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[macOS] Reeder's defaults font is Times instead of San Francisco
mmaxfield@apple.com [Fri, 28 Jul 2017 18:36:37 +0000 (18:36 +0000)]
[macOS] Reeder's defaults font is Times instead of San Francisco
https://bugs.webkit.org/show_bug.cgi?id=174885
<rdar://problem/33462483>

Reviewed by Simon Fraser.

Source/WebCore:

Reeder uses explicit dot-prefixed names in its source code. Within Core Text,
dot-prefixed names cannot be matched case insensitively. The solution is to
not case-fold these family names, and to make our caches case sensitive for
these special names.

Tests: fast/text/font-lookup-dot-prefix-case-sensitive-2.html
       fast/text/font-lookup-dot-prefix-case-sensitive.html

* platform/graphics/FontCache.cpp:
(WebCore::FontPlatformDataCacheKey::operator==):
(WebCore::FontPlatformDataCacheKeyHash::hash):
* platform/graphics/FontCascade.cpp:
(WebCore::keysMatch):
(WebCore::computeFontCascadeCacheHash):
* platform/graphics/FontDescription.cpp:
(WebCore::FontCascadeDescription::familyNamesAreEqual):
(WebCore::FontCascadeDescription::familyNameHash):
(WebCore::FontCascadeDescription::foldedFamilyName):
* platform/graphics/FontDescription.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::fontForPostScriptName):

LayoutTests:

* fast/text/font-lookup-dot-prefix-case-sensitive-2-expected.html: Added.
* fast/text/font-lookup-dot-prefix-case-sensitive-2.html: Added.
* fast/text/font-lookup-dot-prefix-case-sensitive-expected-mismatch.html: Added.
* fast/text/font-lookup-dot-prefix-case-sensitive.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220009 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWeb Inspector: Record actions performed on CanvasRenderingContext2D
drousso@apple.com [Fri, 28 Jul 2017 18:22:17 +0000 (18:22 +0000)]
Web Inspector: Record actions performed on CanvasRenderingContext2D
https://bugs.webkit.org/show_bug.cgi?id=174482

Reviewed by Joseph Pecoraro.

Source/WebCore:

Tests: inspector/canvas/recording-2d.html
       inspector/canvas/recording.html

* html/canvas/CanvasRenderingContext2D.idl:
Add CallTracingCallback to interface to record all API calls.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::paint):
If a recording is active, mark the current frame as completed.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
(GenerateAttributeSetterBodyDefinition):
(GenerateImplementationFunctionCall):
(GenerateCallTracerParameter):
(GenerateCallTracer):
* bindings/scripts/test/TestCallTracer.idl:
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::setJSTestCallTracerTestAttributeInterfaceSetter):
(WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter):
(WebCore::jsTestCallTracerTestAttributeWithVariantGetter):
(WebCore::jsTestCallTracerTestAttributeWithVariant):
(WebCore::setJSTestCallTracerTestAttributeWithVariantSetter):
(WebCore::setJSTestCallTracerTestAttributeWithVariant):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument):
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::buildAction):
Change CallTracer IDL generation to flatten any variants so that all types for the
parameters of an action are able to be listed in a single variant. This prevents possible
ambiguity when constructing the variant, as they require that exactly one type be
constructible and a sub-variant might not satisfy that condition. This was only an issue for
older mac SDKs.

* bindings/js/CallTracer.h:
* bindings/js/CallTracer.cpp:
(WebCore::CallTracer::recordCanvasAction):
* bindings/js/CallTracerTypes.h:
* inspector/InspectorCanvasAgent.h:
* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::recordCanvasAction):
* inspector/InspectorInstrumentation.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::recordCanvasAction):
(WebCore::InspectorInstrumentation::recordCanvasActionImpl):
Rename CanvasActionParameterVariant to RecordCanvasActionVariant to match what is expected by
the IDL generator. Also remove unnecessary includes now that they are in CallTracerTypes.h.

* CMakeLists.txt:
* bindings/js/JSBindingsAllInOne.cpp:
Add CallTracer for CMake builds.

LayoutTests:

* inspector/canvas/recording-2d-expected.txt: Added.
* inspector/canvas/recording-2d.html: Added.
* inspector/canvas/recording-expected.txt: Added.
* inspector/canvas/recording.html: Added.
Take a recording of all CanvasRenderingContext2D actions and dump the recorded JSON data.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220008 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GTK] Building with ENABLE_VIDEO=OFF fails
aperez@igalia.com [Fri, 28 Jul 2017 18:06:59 +0000 (18:06 +0000)]
[GTK] Building with ENABLE_VIDEO=OFF fails
https://bugs.webkit.org/show_bug.cgi?id=174940

Reviewed by Alex Christensen.

.:

Code guarded by ENABLE(MEDIA_STREAM) requires the definition of HTMLVideoElement to
be available, which in turn is guarded by ENABLE(VIDEO).

* Source/cmake/WebKitFeatures.cmake: Make ENABLE_MEDIA_STREAM depend on ENABLE_VIDEO.

Tools:

When GStreamer usage is completely disabled at build time, CMake does not query pkg-config for the GStreamer.
This adds missing USE(GSTREAMER) guards in order to make testing code buildable when GStreamer usage is disabled.

* TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:
(methodCallCallback): Add missing USE(GSTREAMER) guard.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220007 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[WebIDL] Split-up and cleanup Fetch IDL files in preparation for removing unnecessary...
commit-queue@webkit.org [Fri, 28 Jul 2017 17:29:12 +0000 (17:29 +0000)]
[WebIDL] Split-up and cleanup Fetch IDL files in preparation for removing unnecessary js builtins
https://bugs.webkit.org/show_bug.cgi?id=174915

Patch by Sam Weinig <sam@webkit.org> on 2017-07-28
Reviewed by Alex Christensen.

- Split FetchRequest enums and Init dictionary out of FetchRequest so they
  can be used from other files like WorkerGlobalScopeFetch and DOMWindowFetch.
- Add missing FetchResponseInit. Currently unused but will be in a subsequent patch.
- Add and update comments about missing properties and functions.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* Modules/fetch/DOMWindowFetch.idl:
* Modules/fetch/FetchBody.idl:
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchHeaders.h:
* Modules/fetch/FetchHeaders.idl:
* Modules/fetch/FetchReferrerPolicy.h: Added.
* Modules/fetch/FetchReferrerPolicy.idl: Added.
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchRequest.idl:
* Modules/fetch/FetchRequestCache.h: Added.
* Modules/fetch/FetchRequestCache.idl: Added.
* Modules/fetch/FetchRequestCredentials.h: Added.
* Modules/fetch/FetchRequestCredentials.idl: Added.
* Modules/fetch/FetchRequestInit.h: Added.
* Modules/fetch/FetchRequestInit.idl: Added.
* Modules/fetch/FetchRequestMode.h: Added.
* Modules/fetch/FetchRequestMode.idl: Added.
* Modules/fetch/FetchRequestRedirect.h: Added.
* Modules/fetch/FetchRequestRedirect.idl: Added.
* Modules/fetch/FetchResponse.h:
* Modules/fetch/FetchResponse.idl:
* Modules/fetch/WorkerGlobalScopeFetch.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220006 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoThe test imported/w3c/web-platform-tests/cors/allow-headers.htm is slow on Windows.
pvollan@apple.com [Fri, 28 Jul 2017 17:28:05 +0000 (17:28 +0000)]
The test imported/w3c/web-platform-tests/cors/allow-headers.htm is slow on Windows.

Unreviewed test gardening, mark test as slow.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220005 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoWeb Inspector: Cleanup unused/invalid parameters for TreeElements
drousso@apple.com [Fri, 28 Jul 2017 17:27:43 +0000 (17:27 +0000)]
Web Inspector: Cleanup unused/invalid parameters for TreeElements
https://bugs.webkit.org/show_bug.cgi?id=173987

Reviewed by Brian Burg.

* UserInterface/Views/TreeElement.js:
* UserInterface/Views/GeneralTreeElement.js:

* UserInterface/Views/ApplicationCacheFrameTreeElement.js:
* UserInterface/Views/BreakpointTreeElement.js:
* UserInterface/Views/CSSStyleSheetTreeElement.js:
* UserInterface/Views/CallFrameTreeElement.js:
* UserInterface/Views/ContentFlowTreeElement.js:
* UserInterface/Views/DOMNodeTreeElement.js:
* UserInterface/Views/DatabaseTableTreeElement.js:
* UserInterface/Views/DatabaseTreeElement.js:
* UserInterface/Views/FolderTreeElement.js:
* UserInterface/Views/FolderizedTreeElement.js:
* UserInterface/Views/FrameTreeElement.js:
* UserInterface/Views/IndexedDatabaseObjectStoreIndexTreeElement.js:
* UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js:
* UserInterface/Views/IndexedDatabaseTreeElement.js:
* UserInterface/Views/IssueTreeElement.js:
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
* UserInterface/Views/ProfileNodeTreeElement.js:
* UserInterface/Views/ResourceTreeElement.js:
* UserInterface/Views/ScriptTreeElement.js:
* UserInterface/Views/SearchResultTreeElement.js:
* UserInterface/Views/SourceCodeTreeElement.js:
* UserInterface/Views/SourceMapResourceTreeElement.js:
* UserInterface/Views/StorageTreeElement.js:
* UserInterface/Views/TimelineRecordTreeElement.js:
* UserInterface/Views/TypeTreeElement.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220004 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoREGRESSION(r216944): Fallback fonts erroneously visible when the primary font is...
mmaxfield@apple.com [Fri, 28 Jul 2017 17:06:29 +0000 (17:06 +0000)]
REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading
https://bugs.webkit.org/show_bug.cgi?id=174772
<rdar://problem/33267643>

Reviewed by Simon Fraser.

Source/WebCore:

During a font load, we try pretty hard to find a font to use that isn't the
last resort font (which happens to be Times). We do this by iterating through
all the fonts in the font-family list, as well as through all the relevant
@font-face blocks which share the requested font family name.

Unfortunately, if we find one of these fallback fonts, we were simply using it
directly, which means that it was being drawn as visible (because the
visibility setting lives inside the Font object). Instead, we should carry the
invisibility setting from the interstitial font to this used fallback font.

This patch is an extension of r219221, which fixed the problem only for system
fallback fonts. This patch adopts the same methodology to all fallback fonts.

Test: http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html

* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForVariant):
(WebCore::glyphPageFromFontRanges):
* platform/graphics/FontRanges.cpp:
(WebCore::FontRanges::glyphDataForCharacter):

LayoutTests:

* http/tests/webfont/font-loading-system-fallback-visibility-FontRanges-expected.html: Added.
* http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220003 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoREGRESSION(r125147): Layout Test svg/dom/SVGScriptElement/script-change-externalResou...
pvollan@apple.com [Fri, 28 Jul 2017 16:52:35 +0000 (16:52 +0000)]
REGRESSION(r125147): Layout Test svg/dom/SVGScriptElement/script-change-externalResourcesRequired-while-loading.svg is failing
https://bugs.webkit.org/show_bug.cgi?id=93589

Unreviewed test gardening, this test is also a flaky timeout on Windows.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220002 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoFix typo in scrollPositionChangedViaDelegatedScrolling
fred.wang@free.fr [Fri, 28 Jul 2017 15:38:04 +0000 (15:38 +0000)]
Fix typo in scrollPositionChangedViaDelegatedScrolling
https://bugs.webkit.org/show_bug.cgi?id=174937

Patch by Frederic Wang <fwang@igalia.cpm> on 2017-07-28
Reviewed by Wenson Hsieh.

Source/WebCore:

No new tests, fix typo in the inUserInteraction parameter.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
* page/scrolling/ScrollingTree.h:

Source/WebKit:

* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220001 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[WPE] Implement EventSenderProxy in WTR
csaavedra@igalia.com [Fri, 28 Jul 2017 10:27:03 +0000 (10:27 +0000)]
[WPE] Implement EventSenderProxy in WTR
https://bugs.webkit.org/show_bug.cgi?id=173419

Reviewed by Žan Doberšek.

Add the implementation of EventSenderProxy to the WTR. This
allows us to extend the coverage of the test suite in WKWPE.

.:

* Source/cmake/FindLibxkbcommon.cmake: Added.

Tools:

* WebKitTestRunner/EventSenderProxy.h:
* WebKitTestRunner/PlatformWPE.cmake: Add dependency on
libxkbcommon needed to deal with key events.
* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:
(WTR::EventSenderProxy::EventSenderProxy):
(WTR::senderButtonToWPEButton):
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::mouseScrollBy):
(WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSenderProxy::leapForward):
(WTR::wkEventModifiersToWPE):
(WTR::getXKBKeySymForKeyRef):
(WTR::EventSenderProxy::keyDown):
(WTR::EventSenderProxy::addTouchPoint):
(WTR::EventSenderProxy::updateTouchPoint):
(WTR::EventSenderProxy::setTouchModifier):
(WTR::EventSenderProxy::setTouchPointRadius):
(WTR::EventSenderProxy::getUpdatedTouchEvents):
(WTR::EventSenderProxy::removeUpdatedTouchEvents):
(WTR::EventSenderProxy::prepareAndDispatchTouchEvent):
(WTR::EventSenderProxy::touchStart):
(WTR::EventSenderProxy::touchMove):
(WTR::EventSenderProxy::touchEnd):
(WTR::EventSenderProxy::touchCancel):
(WTR::EventSenderProxy::clearTouchPoints):
(WTR::EventSenderProxy::releaseTouchPoint):
(WTR::EventSenderProxy::cancelTouchPoint):

LayoutTests:

* platform/wpe/TestExpectations: Unskip fast/events tests, marking failures
that are related to features not yet implemented in WPE. Also remove other
tests that are now passing thanks to having event injection.
* platform/wpe/fast/dom/HTMLTableColElement/resize-table-using-col-width-expected.txt: Update.
* platform/wpe/fast/dynamic/layer-hit-test-crash-expected.txt: Update.
* platform/wpe/fast/events/clientXY-in-zoom-and-scroll-expected.txt: Added.
* platform/wpe/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.txt: Update.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220000 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed. Bumping the patch version for WPEWebKit library to 20170728.
zandobersek@gmail.com [Fri, 28 Jul 2017 07:53:17 +0000 (07:53 +0000)]
Unreviewed. Bumping the patch version for WPEWebKit library to 20170728.

* Source/cmake/OptionsWPE.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219999 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[iOS DnD] [WK1] Snapshots generated using -[DOMRange renderImageForcingBlackText...
wenson_hsieh@apple.com [Fri, 28 Jul 2017 07:31:06 +0000 (07:31 +0000)]
[iOS DnD] [WK1] Snapshots generated using -[DOMRange renderImageForcingBlackText:] are upside down
https://bugs.webkit.org/show_bug.cgi?id=174928
<rdar://problem/33584280>

Reviewed by Tim Horton.

Pulls the implementation of createDragImageForRange out into DragImageIOS, and use TextIndicator to generate a
snapshot instead of FrameSelection's snapshotting utilities. This makes snapshotting a DOMRange behave the same
way as snapshotting a dragged selection.

No way of testing TextIndicator-based snapshotting yet.

* platform/DragImage.cpp:

Guard createDragImageForRange for !PLATFORM(IOS).

* platform/ios/DragImageIOS.mm:
(WebCore::createDragImageForSelection):

Add a FIXME to point out that having an additional context flip inside the UIGraphicsImageRenderer block results
in an upside-down drag image being returned from createDragImageFromImage. This image is being flipped elsewhere
in drag initiation code, which eventually results in the correct orientation; we'll need further investigation
to remove this extraneous flip.

(WebCore::createDragImageForRange):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219998 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoASSERTION FAILED: candidate->op() == PhantomCreateRest || candidate->op() == PhantomD...
utatane.tea@gmail.com [Fri, 28 Jul 2017 07:25:57 +0000 (07:25 +0000)]
ASSERTION FAILED: candidate->op() == PhantomCreateRest || candidate->op() == PhantomDirectArguments || candidate->op() == PhantomClonedArguments || candidate->op() == PhantomSpread || candidate->op() == PhantomNewArrayWithSpread
https://bugs.webkit.org/show_bug.cgi?id=174900

Reviewed by Saam Barati.

JSTests:

* stress/arguments-elimination-candidate-listings-should-respect-pseudo-terminals.js: Added.
(sideEffect):
(args):
(test):

Source/JavaScriptCore:

In the arguments elimination phase, due to high cost of AI, we intentionally do not run AI.
Instead, we use ForceOSRExit etc. (pseudo terminals) not to look into unreachable nodes.
The problem is that even transforming phase also checks this pseudo terminals.

    BB1
    1: ForceOSRExit
    2: CreateDirectArguments

    BB2
    3: GetButterfly(@2)
    4: ForceOSRExit

In the above case, @2 is not converted to PhantomDirectArguments. But @3 is processed. And the assertion fires.

In this patch, we do not list candidates up after seeing pseudo terminals in basic blocks.

* dfg/DFGArgumentsEliminationPhase.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219997 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoRemove Web prefix from WebVideoFullscreen and WebPlaybackSession classes.
commit-queue@webkit.org [Fri, 28 Jul 2017 07:25:39 +0000 (07:25 +0000)]
Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes.
https://bugs.webkit.org/show_bug.cgi?id=174437

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-28
Reviewed by Darin Adler.

Source/WebCore:

No new tests because no behavior change.

Remove redundant Web- prefix from classes in WebCore namespace.

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
* html/HTMLVideoElement.cpp:
* platform/cocoa/PlaybackSessionInterface.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionInterface.h.
(WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
* platform/cocoa/PlaybackSessionModel.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h.
(WebCore::PlaybackSessionModel::~PlaybackSessionModel):
(WebCore::PlaybackSessionModelClient::~PlaybackSessionModelClient):
(WebCore::PlaybackSessionModelClient::externalPlaybackChanged):
* platform/cocoa/PlaybackSessionModelMediaElement.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h.
* platform/cocoa/PlaybackSessionModelMediaElement.mm: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm.
* platform/cocoa/VideoFullscreenChangeObserver.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h.
(WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver):
* platform/cocoa/VideoFullscreenModel.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h.
(WebCore::VideoFullscreenModel::~VideoFullscreenModel):
(WebCore::VideoFullscreenModelClient::~VideoFullscreenModelClient):
* platform/cocoa/VideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h.
(WebCore::VideoFullscreenModelVideoElement::create):
* platform/cocoa/VideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
* platform/ios/PlaybackSessionInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.h.
* platform/ios/PlaybackSessionInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.mm.
* platform/ios/VideoFullscreenInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h.
* platform/ios/VideoFullscreenInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm.
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
* platform/mac/PlaybackSessionInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.h.
* platform/mac/PlaybackSessionInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm.
* platform/mac/VideoFullscreenInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h.
* platform/mac/VideoFullscreenInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm.
* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:

Source/WebKit:

Remove redundant Web- prefix from classes in WebKit namespace.

* DerivedSources.make:
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h.
* UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in.
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: Added.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm.
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: Removed.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateMediaTouchBar):
* UIProcess/WebPageProxy.cpp:
(WebKit::m_weakPtrFactory):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::playbackSessionManager):
(WebKit::WebPageProxy::videoFullscreenManager):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::playbackSessionManager):
(WebKit::WebPage::videoFullscreenManager):
* WebProcess/WebPage/WebPage.h:
* WebProcess/cocoa/PlaybackSessionManager.h: Renamed from Source/WebKit/WebProcess/cocoa/WebPlaybackSessionManager.h.
* WebProcess/cocoa/PlaybackSessionManager.messages.in: Renamed from Source/WebKit/WebProcess/cocoa/WebPlaybackSessionManager.messages.in.
* WebProcess/cocoa/PlaybackSessionManager.mm: Added.
* WebProcess/cocoa/VideoFullscreenManager.h: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.h.
(WebKit::VideoFullscreenInterfaceContext::create):
* WebProcess/cocoa/VideoFullscreenManager.messages.in: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.messages.in.
* WebProcess/cocoa/VideoFullscreenManager.mm: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.mm.
* WebProcess/cocoa/WebPlaybackSessionManager.mm: Removed.

Source/WebKitLegacy/mac:

Remove redundant Web- prefix from classes in WebKit namespace.

* WebView/WebView.mm:
(-[WebView _setUpPlaybackControlsManagerForMediaElement:]):
* WebView/WebViewData.h:
* WebView/WebViewData.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219996 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[CMake] Re-add the StorageProcess executable target
zandobersek@gmail.com [Fri, 28 Jul 2017 05:49:05 +0000 (05:49 +0000)]
[CMake] Re-add the StorageProcess executable target
https://bugs.webkit.org/show_bug.cgi?id=174929

Reviewed by Carlos Garcia Campos.

Re-add the StorageProcess executable target that was removed in r219960.
Back then it was still named DatabaseProcess, but the name changed in
the following patches.

* CMakeLists.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219995 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[WTF] Drop Thread initialization wait in some platforms by introducing StackBounds...
utatane.tea@gmail.com [Fri, 28 Jul 2017 05:11:19 +0000 (05:11 +0000)]
[WTF] Drop Thread initialization wait in some platforms by introducing StackBounds::newThreadStackBounds(PlatformThreadHandle&)
https://bugs.webkit.org/show_bug.cgi?id=174303

Reviewed by Mark Lam.

Currently, the caller thread of Thread::create() need to wait for completion of the initialization of the target thread.
This is because we need to initialize Thread::m_stack in the target thread. Before this patch, a target thread's
StackBounds can only be retrieved by the target thread itself. However, this potentially causes context-switching between
the caller and the target threads and hurts efficiency of creating threads.

Fortunately, in some platforms (including major platforms except for Windows), we can get StackBounds of a target
thread from a caller thread. This allows us to avoid waiting for completion of thread initialization.

In this patch, we introduce HAVE_STACK_BOUNDS_FOR_NEW_THREAD and StackBounds::newThreadStackBounds. When creating
a new thread, we will use StackBounds::newThreadStackBounds to get StackBounds if possible. As a result, we
do not need to wait for completion of thread initialization to ensure m_stack field of Thread is initialized.

While some documents claim that it is possible on Windows to get the StackBounds of another thread[1], the method relies on
undocumented Windows NT APIs (NtQueryInformationThread, NtReadVirtualMemory etc.). So in this patch, we just
use the conservative approach simply waiting for completion of thread initialization.

[1]: https://stackoverflow.com/questions/3918375/how-to-get-thread-stack-information-on-windows

* wtf/Platform.h:
* wtf/StackBounds.cpp:
(WTF::StackBounds::newThreadStackBounds):
(WTF::StackBounds::currentThreadStackBoundsInternal):
(WTF::StackBounds::initialize): Deleted.
* wtf/StackBounds.h:
(WTF::StackBounds::currentThreadStackBounds):
(WTF::StackBounds::StackBounds):
* wtf/Threading.cpp:
(WTF::Thread::NewThreadContext::NewThreadContext):
(WTF::Thread::entryPoint):
(WTF::Thread::create):
(WTF::Thread::initialize): Deleted.
* wtf/Threading.h:
* wtf/ThreadingPrimitives.h:
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
(WTF::wtfThreadEntryPoint):
(WTF::Thread::establishHandle):
(WTF::Thread::initializeCurrentThreadInternal):
(WTF::Thread::current):
* wtf/ThreadingWin.cpp:
(WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
(WTF::Thread::initializeCurrentThreadInternal):
(WTF::Thread::current):
* wtf/win/MainThreadWin.cpp:
(WTF::initializeMainThreadPlatform):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219994 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoSpeedometer 2.0: Document Angular 4 build process
commit-queue@webkit.org [Fri, 28 Jul 2017 04:44:45 +0000 (04:44 +0000)]
Speedometer 2.0: Document Angular 4 build process
https://bugs.webkit.org/show_bug.cgi?id=174896

Patch by Mathias Bynens <mathias@chromium.org> on 2017-07-27
Reviewed by Ryosuke Niwa.

This patch documents the build process for the Angular 4 example, pins the dependencies (so
that builds are deterministic), and updates the generated files accordingly.

* Speedometer/resources/todomvc/architecture-examples/angular/README.md: Added.
* Speedometer/resources/todomvc/architecture-examples/angular/dist/*: Update per build instructions.
* Speedometer/resources/todomvc/architecture-examples/angular/e2e/app.e2e-spec.ts: Removed unused file.
* Speedometer/resources/todomvc/architecture-examples/angular/e2e/app.po.ts: Removed unused file.
* Speedometer/resources/todomvc/architecture-examples/angular/e2e/tsconfig.e2e.json: Removed unused file.
* Speedometer/resources/todomvc/architecture-examples/angular/package.json: Remove unneeded scripts.
* Speedometer/resources/todomvc/architecture-examples/angular/package-lock.json: Added to pin dependencies.
* Speedometer/resources/todomvc/architecture-examples/angular/src/app/app.component.ts: Updated.
* Speedometer/resources/todomvc/architecture-examples/angular/src/environments/environment.ts: Updated.
* Speedometer/resources/todomvc/architecture-examples/angular/src/index.html: Made title consistent.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219993 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoDon't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr.
commit-queue@webkit.org [Fri, 28 Jul 2017 04:41:14 +0000 (04:41 +0000)]
Don't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr.
https://bugs.webkit.org/show_bug.cgi?id=174850
rdar://problem/33449903

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-27
Reviewed by Jon Lee.

This change removes playsinlineAttr from MediaDocument so that it doesn't override the setting
from _allowsMediaDocumentInlinePlayback. In its place is an update to requiresFullscreenForVideoPlayback
that implements the details of exactly which media documents are still allowed to play inlne.

Media documents always use a video element; but when there are no video tracks, it has behavior like
an audio element. See media-controller.js isAudio().

This change preserves this behavior with respect to fullscreen requirements for media document by
mirroring the isAudio() check in requiresFullscreenForVideoPlayback.

* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219992 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoMediaDocument fullscreen pinch gesture should trigger navigate back.
commit-queue@webkit.org [Fri, 28 Jul 2017 04:20:53 +0000 (04:20 +0000)]
MediaDocument fullscreen pinch gesture should trigger navigate back.
https://bugs.webkit.org/show_bug.cgi?id=174914

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-27
Reviewed by Jon Lee.

No new tests because only effect is from interaction with platform.

For media documents, pressing the "done" button on fullscreen video navigates back
to the previous page. The same should happen for other gestures that pause playback
when returning to inline. This allows the gesture to have the same behavior as the
button.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219991 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoPart 2 of: Rename DatabaseProcess to StorageProcess.
beidson@apple.com [Fri, 28 Jul 2017 03:32:33 +0000 (03:32 +0000)]
Part 2 of: Rename DatabaseProcess to StorageProcess.
https://bugs.webkit.org/show_bug.cgi?id=174880

Reviewed by Andy Estes.

Source/WebKit:

Rename some more variables, classes, etc. to reflect the change.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs):
(WebKit::NetworkProcess::didgrantSandboxExtensionsToStorageProcessForBlobs):
(WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
(WebKit::NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:

* Shared/ProcessExecutablePath.h:
* Shared/gtk/ProcessExecutablePathGtk.cpp:
(WebKit::executablePathOfStorageProcess):
(WebKit::executablePathOfDatabaseProcess): Deleted.
* Shared/wpe/ProcessExecutablePathWPE.cpp:
(WebKit::executablePathOfStorageProcess):
(WebKit::executablePathOfDatabaseProcess): Deleted.

* StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::putOrAdd):

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::initializeWebsiteDataStore):
(WebKit::StorageProcess::postStorageTask):
(WebKit::StorageProcess::performNextStorageTask):
(WebKit::StorageProcess::createStorageToWebProcessConnection):
(WebKit::StorageProcess::fetchWebsiteData):
(WebKit::StorageProcess::postDatabaseTask): Deleted.
(WebKit::StorageProcess::performNextDatabaseTask): Deleted.
(WebKit::StorageProcess::createDatabaseToWebProcessConnection): Deleted.
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* StorageProcess/mac/StorageProcessMac.mm:
(WebKit::StorageProcess::initializeProcessName):

* UIProcess/API/C/WKContext.cpp:
(WKContextGetDatabaseProcessIdentifier):

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _terminateStorageProcess]):
(-[WKProcessPool _storageProcessIdentifier]):
(-[WKProcessPool _terminateDatabaseProcess]): Deleted.
(-[WKProcessPool _databaseProcessIdentifier]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
* UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp:
(WebKit::ProcessLauncher::launchProcess):

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:

* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getLaunchOptions):
(WebKit::StorageProcessProxy::getStorageProcessConnection):
(WebKit::StorageProcessProxy::didClose):
(WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
(WebKit::StorageProcessProxy::didFinishLaunching):
(WebKit::StorageProcessProxy::getDatabaseProcessConnection): Deleted.
(WebKit::StorageProcessProxy::didCreateDatabaseToWebProcessConnection): Deleted.
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.messages.in:

* UIProcess/WebContextClient.cpp:
(WebKit::WebContextClient::storageProcessDidCrash):
(WebKit::WebContextClient::databaseProcessDidCrash): Deleted.
* UIProcess/WebContextClient.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::getStorageProcessConnection):
(WebKit::WebProcessPool::storageProcessCrashed):
(WebKit::WebProcessPool::pageAddedToProcess):
(WebKit::WebProcessPool::storageProcessIdentifier):
(WebKit::WebProcessPool::terminateStorageProcess):
(WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Deleted.
(WebKit::WebProcessPool::getDatabaseProcessConnection): Deleted.
(WebKit::WebProcessPool::databaseProcessCrashed): Deleted.
(WebKit::WebProcessPool::databaseProcessIdentifier): Deleted.
(WebKit::WebProcessPool::terminateDatabaseProcess): Deleted.
* UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToStorageProcessRelaunchingIfNecessary):
(WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): Deleted.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getStorageProcessConnection):
(WebKit::WebProcessProxy::getDatabaseProcessConnection): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::storageProcessParameters):
(WebKit::WebsiteDataStore::databaseProcessParameters): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):

* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
(WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection):
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
(WebKit::WebToStorageProcessConnection::didClose):
(WebKit::WebToStorageProcessConnection::didReceiveInvalidMessage):
(WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
(WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection): Deleted.
(WebKit::WebToDatabaseProcessConnection::~WebToDatabaseProcessConnection): Deleted.
(WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted.
(WebKit::WebToDatabaseProcessConnection::didClose): Deleted.
(WebKit::WebToDatabaseProcessConnection::didReceiveInvalidMessage): Deleted.
(WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): Deleted.
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::create):
(WebKit::WebToDatabaseProcessConnection::create): Deleted.
(WebKit::WebToDatabaseProcessConnection::connection): Deleted.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::webToStorageProcessConnectionClosed):
(WebKit::WebProcess::webToStorageProcessConnection):
(WebKit::WebProcess::ensureWebToStorageProcessConnection):
(WebKit::WebProcess::webToDatabaseProcessConnectionClosed): Deleted.
(WebKit::WebProcess::webToDatabaseProcessConnection): Deleted.
(WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Deleted.
* WebProcess/WebProcess.h:

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/IDBDeleteRecovery.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IDBIndexUpgradeToV2.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBPersistence.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/ResourceLoadStatistics.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219990 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[ES] Add support finally to Promise
gskachkov@gmail.com [Fri, 28 Jul 2017 02:38:41 +0000 (02:38 +0000)]
[ES] Add support finally to Promise
https://bugs.webkit.org/show_bug.cgi?id=174503

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

Add support `finally` method to Promise according
to the https://bugs.webkit.org/show_bug.cgi?id=174503
Current spec on STAGE 3
https://github.com/tc39/proposal-promise-finally

* builtins/PromisePrototype.js:
(finally):
(const.valueThunk):
(globalPrivate.getThenFinally):
(const.thrower):
(globalPrivate.getCatchFinally):
* runtime/JSPromisePrototype.cpp:

LayoutTests:

* js/Promise-types-expected.txt:
* js/script-tests/Promise-types.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219989 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUpdate lock benchmarks
jfbastien@apple.com [Fri, 28 Jul 2017 02:17:37 +0000 (02:17 +0000)]
Update lock benchmarks
https://bugs.webkit.org/show_bug.cgi?id=174907

Reviewed by Filip Pizlo.

* benchmarks/ConditionSpeedTest.cpp:
(main):
* benchmarks/LockFairnessTest.cpp:
* benchmarks/LockSpeedTest.cpp:
* benchmarks/ToyLocks.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219988 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAX: A11Y: Zoom no longer follows keyboard insertion point in safari
n_wang@apple.com [Thu, 27 Jul 2017 23:46:53 +0000 (23:46 +0000)]
AX: A11Y: Zoom no longer follows keyboard insertion point in safari
https://bugs.webkit.org/show_bug.cgi?id=174869

Reviewed by David Kilzer.

There was a recent change by denying XPC services access by default.
In UAZoomChangeFocus we need to send message to HIServices, so let's
allow the connection to XPC services for that.

* WebProcess/com.apple.WebProcess.sb.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219987 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoPart 1 of: Rename DatabaseProcess to StorageProcess.
beidson@apple.com [Thu, 27 Jul 2017 23:08:34 +0000 (23:08 +0000)]
Part 1 of: Rename DatabaseProcess to StorageProcess.
https://bugs.webkit.org/show_bug.cgi?id=174879

Reviewed by Andy Estes.

.:

* Source/cmake/OptionsWPE.cmake:
* Source/cmake/gtksymbols.filter:

Source/WebKit:

This patch is all about renaming source files and renaming the process itself (touching build system files, etc etc).

Some renaming in actual code did result (Some class/struct names, method names, etc)

Part 2 (174880) will go through and update all references in code itself from "Database" to "Storage"

* CMakeLists.txt:
* Configurations/Storage-iOS.entitlements: Renamed from Source/WebKit/Configurations/Databases-iOS.entitlements.
* Configurations/StorageService.xcconfig: Renamed from Source/WebKit/Configurations/DatabaseService.xcconfig.
* Configurations/WebKit.xcconfig:
* DerivedSources.make:
* Platform/ExtraPrivateSymbolsForTAPI.h:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:

* Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Renamed from Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb.

* Shared/Storage/StorageProcessCreationParameters.cpp: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.cpp.
(WebKit::StorageProcessCreationParameters::StorageProcessCreationParameters):
(WebKit::StorageProcessCreationParameters::encode):
(WebKit::StorageProcessCreationParameters::decode):
* Shared/Storage/StorageProcessCreationParameters.h: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.h.

* StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist.
* StorageProcess/EntryPoint/mac/XPCService/StorageServiceEntryPoint.mm: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm.
(StorageServiceInitializer):
* StorageProcess/EntryPoint/unix/StorageProcessMain.cpp: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
(main):

* StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp.
* StorageProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h.
* StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in.

* StorageProcess/StorageProcess.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.cpp.
* StorageProcess/StorageProcess.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.h.
* StorageProcess/StorageProcess.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.messages.in.

* StorageProcess/StorageToWebProcessConnection.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.cpp.
* StorageProcess/StorageToWebProcessConnection.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.h.
* StorageProcess/StorageToWebProcessConnection.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.messages.in.

* StorageProcess/gtk/StorageProcessMainGtk.cpp: Renamed from Source/WebKit/DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp.
(WebKit::StorageProcessMainUnix):
* StorageProcess/ios/StorageProcessIOS.mm: Renamed from Source/WebKit/DatabaseProcess/ios/DatabaseProcessIOS.mm.
(WebKit::StorageProcess::initializeProcess):
(WebKit::StorageProcess::initializeProcessName):
(WebKit::StorageProcess::initializeSandbox):
* StorageProcess/mac/StorageProcessMac.mm: Renamed from Source/WebKit/DatabaseProcess/mac/DatabaseProcessMac.mm.
(WebKit::StorageProcess::initializeProcess):
(WebKit::StorageProcess::initializeProcessName):
(WebKit::StorageProcess::initializeSandbox):

* StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Copied from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in.
* StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Renamed from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in.

* StorageProcess/unix/StorageProcessMainUnix.h: Renamed from Source/WebKit/DatabaseProcess/unix/DatabaseProcessMainUnix.h.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):

* UIProcess/Storage/StorageProcessProxy.cpp: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.cpp.
* UIProcess/Storage/StorageProcessProxy.h: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.h.
* UIProcess/Storage/StorageProcessProxy.messages.in: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.messages.in.

* UIProcess/WebContextSupplement.h:
(WebKit::WebContextSupplement::processDidClose):

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::databaseProcessCrashed):
(WebKit::WebProcessPool::pageAddedToProcess):
* UIProcess/WebProcessPool.h:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::databaseProcessParameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:

* WebKit.xcodeproj/project.pbxproj:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
* WebProcess/Databases/WebDatabaseProvider.cpp:

* WebProcess/Storage/WebToStorageProcessConnection.cpp: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.cpp.
* WebProcess/Storage/WebToStorageProcessConnection.h: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.h.

* WebProcess/WebProcess.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219986 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoPDF page number indicator is very flashy when scrolling
timothy_horton@apple.com [Thu, 27 Jul 2017 17:06:11 +0000 (17:06 +0000)]
PDF page number indicator is very flashy when scrolling
https://bugs.webkit.org/show_bug.cgi?id=174882
<rdar://problem/23760981>

Reviewed by Andy Estes.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKPDFPageNumberIndicator.mm:
(-[WKPDFPageNumberIndicator initWithFrame:]):
Increase the backdrop rendering resolution to reduce flashiness.
It's still not perfect, but it's quite visibly better.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219985 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAdd ability to only run specific tests in run-javascriptcore-tests.
mark.lam@apple.com [Thu, 27 Jul 2017 16:48:48 +0000 (16:48 +0000)]
Add ability to only run specific tests in run-javascriptcore-tests.
https://bugs.webkit.org/show_bug.cgi?id=174884

Reviewed by Saam Barati.

For example, if we only want to run testapi, we can do so as follows:
    $ run-javascriptcore-tests --testapi

Previously, specifying --testapi effectively does nothing because we run all tests
by default.  Only --no-testapi had the effect of disabling the test set.  This
old behavior for --testapi is not very useful or meaningful.  We're now changing
it to mean that we will only run that test.

With this change, we can also run more than one set of tests.  For example, if we
only want to run testmasm and testair, we can do so as follows:
    $ run-javascriptcore-tests --testmasm --testair

By default, if no specific test option is specified, run-javascriptcore-tests will
run all tests.

Note that the jsc stress tests (--jsc-stress) are a different set of tests than
the mozilla tests (--mozilla-tests) even though both are run via the lower level
run-jsc-stress-tests test harness.  Hence, if you only specify one of the tests,
the other set will not run.  For example, the following only runs the mozilla tests:
    $ run-javascriptcore-tests --mozilla-tests

Note also that --jit-stress-tests is not for choosing a different set of tests.
Instead, it is used for determining whether we run JIT'ed test configurations
on the jsc stress tests and mozilla tests.  As a result, specifying
--jit-stress-tests will not omit other tests.  For example, the following still
runs all tests:
    $ run-javascriptcore-tests --jit-stress-tests

* Scripts/run-javascriptcore-tests:
(defaultStringForTestState):
(enableTestOrNot):
(runJSCStressTests):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219984 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoAX: VoiceOver silent or skipping over time values on media player.
commit-queue@webkit.org [Thu, 27 Jul 2017 14:53:04 +0000 (14:53 +0000)]
AX: VoiceOver silent or skipping over time values on media player.
https://bugs.webkit.org/show_bug.cgi?id=174324
<rdar://problem/32021784>

Patch by Aaron Chu <aaron_chu@apple.com> on 2017-07-27
Reviewed by Antoine Quint.

Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing.

Source/WebCore:

Test Updated: media/modern-media-controls/time-label/time-label.html
Test Added: media/modern-media-controls/time-label/ios-time-label.html

* Modules/modern-media-controls/controls/time-label.js:

LayoutTests:

Updated time-label.html to test role attribute on mac.
Added ios-time-label.html to run time-label test without testing for role since accessibilityController does not expose a role property on iOS.

* media/modern-media-controls/time-label/ios-time-label-expected.txt: Copied from LayoutTests/media/modern-media-controls/time-label/time-label-expected.txt.
* media/modern-media-controls/time-label/ios-time-label.html: Copied from LayoutTests/media/modern-media-controls/time-label/time-label.html.
* media/modern-media-controls/time-label/time-label-expected.txt:
* media/modern-media-controls/time-label/time-label.html:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219983 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUnreviewed, build fix for CLoop
utatane.tea@gmail.com [Thu, 27 Jul 2017 13:00:23 +0000 (13:00 +0000)]
Unreviewed, build fix for CLoop
https://bugs.webkit.org/show_bug.cgi?id=171637

* domjit/DOMJITGetterSetter.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219982 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoHoist DOM binding attribute getter prologue into JavaScriptCore taking advantage...
utatane.tea@gmail.com [Thu, 27 Jul 2017 12:35:49 +0000 (12:35 +0000)]
Hoist DOM binding attribute getter prologue into JavaScriptCore taking advantage of DOMJIT / CheckSubClass
https://bugs.webkit.org/show_bug.cgi?id=171637

Reviewed by Darin Adler.

JSTests:

* stress/domjit-getter-complex-with-incorrect-object.js:
(i.shouldThrow):
* stress/domjit-getter-type-check.js: Copied from JSTests/stress/domjit-getter-complex-with-incorrect-object.js.
(shouldBe):
(i.shouldThrow):

Source/JavaScriptCore:

Each DOM attribute getter has the code to perform ClassInfo check. But it is largely duplicate and causes code bloating.
In this patch, we move ClassInfo check from WebCore to JSC and reduce code size.

We introduce DOMAnnotation which has ClassInfo* and DOMJIT::GetterSetter*. If the getter is not DOMJIT getter, this
DOMJIT::GetterSetter becomes nullptr. We support such a CustomAccessorGetter in all the JIT tiers.

In IC, we drop CheckSubClass completely since IC's Structure check subsumes it. We do not enable this optimization for
op_get_by_id_with_this case yet.
In DFG and FTL, we emit CheckSubClass node. Which is typically removed by CheckStructure leading to CheckSubClass.

And we add DOMAttributeGetterSetter, which is derived class of CustomGetterSetter. It holds DOMAnnotation and perform
ClassInfo check.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
* bytecode/GetByIdVariant.cpp:
(JSC::GetByIdVariant::GetByIdVariant):
(JSC::GetByIdVariant::operator=):
(JSC::GetByIdVariant::attemptToMerge):
(JSC::GetByIdVariant::dumpInContext):
* bytecode/GetByIdVariant.h:
(JSC::GetByIdVariant::customAccessorGetter):
(JSC::GetByIdVariant::domAttribute):
(JSC::GetByIdVariant::domJIT): Deleted.
* bytecode/GetterSetterAccessCase.cpp:
(JSC::GetterSetterAccessCase::create):
(JSC::GetterSetterAccessCase::GetterSetterAccessCase):
(JSC::GetterSetterAccessCase::emitDOMJITGetter):
* bytecode/GetterSetterAccessCase.h:
(JSC::GetterSetterAccessCase::domAttribute):
(JSC::GetterSetterAccessCase::customAccessor):
(JSC::GetterSetterAccessCase::domJIT): Deleted.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::instantiateLexicalVariables):
* create_hash_table:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::blessCallDOMGetter):
(JSC::DFG::ByteCodeParser::handleDOMJITGetter):
(JSC::DFG::ByteCodeParser::handleGetById):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCallDOMGetter):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callCustomGetter):
* domjit/DOMJITGetterSetter.h:
(JSC::DOMJIT::GetterSetter::GetterSetter):
(JSC::DOMJIT::GetterSetter::getter):
(JSC::DOMJIT::GetterSetter::compiler):
(JSC::DOMJIT::GetterSetter::resultType):
(JSC::DOMJIT::GetterSetter::~GetterSetter): Deleted.
(JSC::DOMJIT::GetterSetter::setter): Deleted.
(JSC::DOMJIT::GetterSetter::thisClassInfo): Deleted.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter):
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
* jsc.cpp:
(WTF::DOMJITGetter::DOMJITAttribute::DOMJITAttribute):
(WTF::DOMJITGetter::DOMJITAttribute::callDOMGetter):
(WTF::DOMJITGetter::customGetter):
(WTF::DOMJITGetter::finishCreation):
(WTF::DOMJITGetterComplex::DOMJITAttribute::DOMJITAttribute):
(WTF::DOMJITGetterComplex::DOMJITAttribute::callDOMGetter):
(WTF::DOMJITGetterComplex::customGetter):
(WTF::DOMJITGetterComplex::finishCreation):
(WTF::DOMJITGetter::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT): Deleted.
(WTF::DOMJITGetter::DOMJITNodeDOMJIT::slowCall): Deleted.
(WTF::DOMJITGetter::domJITNodeGetterSetter): Deleted.
(WTF::DOMJITGetterComplex::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT): Deleted.
(WTF::DOMJITGetterComplex::DOMJITNodeDOMJIT::slowCall): Deleted.
(WTF::DOMJITGetterComplex::domJITNodeGetterSetter): Deleted.
* runtime/CustomGetterSetter.h:
(JSC::CustomGetterSetter::create):
(JSC::CustomGetterSetter::setter):
(JSC::CustomGetterSetter::CustomGetterSetter):
(): Deleted.
* runtime/DOMAnnotation.h: Added.
(JSC::operator==):
(JSC::operator!=):
* runtime/DOMAttributeGetterSetter.cpp: Added.
* runtime/DOMAttributeGetterSetter.h: Copied from Source/JavaScriptCore/runtime/CustomGetterSetter.h.
(JSC::isDOMAttributeGetterSetter):
* runtime/Error.cpp:
(JSC::throwDOMAttributeGetterTypeError):
* runtime/Error.h:
(JSC::throwVMDOMAttributeGetterTypeError):
* runtime/JSCustomGetterSetterFunction.cpp:
(JSC::JSCustomGetterSetterFunction::customGetterSetterFunctionCall):
* runtime/JSObject.cpp:
(JSC::JSObject::putInlineSlow):
(JSC::JSObject::deleteProperty):
(JSC::JSObject::getOwnStaticPropertySlot):
(JSC::JSObject::reifyAllStaticProperties):
(JSC::JSObject::fillGetterPropertySlot):
(JSC::JSObject::findPropertyHashEntry): Deleted.
* runtime/JSObject.h:
(JSC::JSObject::getOwnNonIndexPropertySlot):
(JSC::JSObject::fillCustomGetterPropertySlot):
* runtime/Lookup.cpp:
(JSC::setUpStaticFunctionSlot):
* runtime/Lookup.h:
(JSC::HashTableValue::domJIT):
(JSC::getStaticPropertySlotFromTable):
(JSC::putEntry):
(JSC::lookupPut):
(JSC::reifyStaticProperty):
(JSC::reifyStaticProperties):
Each static property table has a new field ClassInfo*. It indicates that which ClassInfo check DOMAttribute registered in
this static property table requires.

* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
* runtime/PropertyName.h:
* runtime/PropertySlot.cpp:
(JSC::PropertySlot::customGetter):
(JSC::PropertySlot::customAccessorGetter):
* runtime/PropertySlot.h:
(JSC::PropertySlot::domAttribute):
(JSC::PropertySlot::setCustom):
(JSC::PropertySlot::setCacheableCustom):
(JSC::PropertySlot::getValue):
(JSC::PropertySlot::domJIT): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

Source/WebCore:

We use DOMAttribute. When DOMAttribute is specified, ClassInfo check is performed by JSC side.
So, we can drop ClassInfo check from the actual function.

We also simplify DOMJIT::GetterSetter to make it smaller size.

WebCore size comparison
    Before: 48443292
    After:  48087800 (0.7% reduction)

Speedometer Scores show 0.8% improvement.
    Before: 158.9 +- 0.46
    After:  160.2 +- 0.36

Dromaeo DOM core Scores show 5.8% improvement.
                                Before                   After
    Total Score:         8424.12runs/s ±1.38%     8911.60runs/s ±1.47%
      DOM Attributes    12627.27runs/s ±1.87%    14023.17runs/s ±1.87%
      DOM Modification   1207.82runs/s ±2.48%     1204.21runs/s ±3.05%
      DOM Query         68068.82runs/s ±0.63%    74273.38runs/s ±0.69%
      DOM Traversal      1240.07runs/s ±1.96%     1256.64runs/s ±1.77%

Performance improvement can be explained by the following optimizations.

1. Type checks are typically eliminated in all the JIT tiers. IC / DFG / FTL can
   drop type checks since get_by_id operation already performs a structure check
   which subsumes this type check.
2. Direct getter call by CallDOMGetter without creating IC in DFG and FTL.

* bindings/js/JSDOMAttribute.h:
(WebCore::IDLAttribute::get):
Add CastedThisErrorBehavior::Assert case. When this is specified, we perform casting without using jsDynamicCast.

* bindings/scripts/CodeGeneratorJS.pm:
(IsAcceleratedDOMAttribute):
(GetJSCAttributesForAttribute):
(GenerateHeader):
(GeneratePropertiesHashTable):
(GenerateImplementation):
(GenerateAttributeGetterTrampolineDefinition):
(GenerateAttributeGetterDefinition):
(GenerateCallbackImplementationContent):
(GenerateHashTableValueArray):
(GenerateHashTable):
(GenerateConstructorHelperMethods):
Update CodeGeneratorJS to emit DOMAttribute. And DOMJIT::GetterSetter becomes changed to be smaller size.

* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::JSInterfaceNamePrototype::finishCreation):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::JSMapLikePrototype::finishCreation):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::JSReadOnlyMapLikePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObjectPrototype::finishCreation):
(WebCore::jsTestActiveDOMObjectExcitingAttr):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::JSTestCEReactionsPrototype::finishCreation):
(WebCore::jsTestCEReactionsAttributeWithCEReactions):
(WebCore::jsTestCEReactionsReflectAttributeWithCEReactions):
(WebCore::jsTestCEReactionsStringifierAttribute):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::JSTestCEReactionsStringifierPrototype::finishCreation):
(WebCore::jsTestCEReactionsStringifierValue):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::JSTestCallTracerPrototype::finishCreation):
(WebCore::jsTestCallTracerTestAttributeInterface):
(WebCore::jsTestCallTracerTestAttributeSpecified):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::JSTestCallbackInterfaceConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJITPrototype::finishCreation):
(WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITAnyAttr): Deleted.
(WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITBooleanAttr): Deleted.
(WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITByteAttr): Deleted.
(WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITOctetAttr): Deleted.
(WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITShortAttr): Deleted.
(WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr): Deleted.
(WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITLongAttr): Deleted.
(WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr): Deleted.
(WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITLongLongAttr): Deleted.
(WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr): Deleted.
(WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITFloatAttr): Deleted.
(WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr): Deleted.
(WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITDoubleAttr): Deleted.
(WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr): Deleted.
(WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITDomStringAttr): Deleted.
(WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITByteStringAttr): Deleted.
(WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr): Deleted.
(WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITNodeAttr): Deleted.
(WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr): Deleted.
(WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr): Deleted.
(WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr): Deleted.
(WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr): Deleted.
(WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr): Deleted.
(WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr): Deleted.
(WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr): Deleted.
(WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr): Deleted.
(WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr): Deleted.
(WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr): Deleted.
(WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr): Deleted.
(WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr): Deleted.
(WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr): Deleted.
(WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr): Deleted.
(WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr): Deleted.
(WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr): Deleted.
(WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr): Deleted.
* bindings/scripts/test/JS/JSTestDOMJIT.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorPrototype::finishCreation):
(WebCore::jsTestEventConstructorAttr1):
(WebCore::jsTestEventConstructorAttr2):
(WebCore::jsTestEventConstructorAttr3):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTargetPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestExceptionPrototype::finishCreation):
(WebCore::jsTestExceptionName):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
(WebCore::jsTestGenerateIsReachableASecretAttribute):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::jsTestGlobalObjectRegularAttribute):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestIndexedSetterNoIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::JSTestIndexedSetterThrowingExceptionPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestIndexedSetterWithIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::initializeProperties):
(WebCore::JSTestInterfacePrototype::finishCreation):
(WebCore::jsTestInterfaceImplementsStr1):
(WebCore::jsTestInterfaceImplementsStr2):
(WebCore::jsTestInterfaceImplementsStr3):
(WebCore::jsTestInterfaceImplementsNode):
(WebCore::jsTestInterfaceSupplementalStr1):
(WebCore::jsTestInterfaceSupplementalStr2):
(WebCore::jsTestInterfaceSupplementalStr3):
(WebCore::jsTestInterfaceSupplementalNode):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
(WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::JSTestIterablePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
(WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
(WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListenerPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::JSTestNamedDeleterNoIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::JSTestNamedDeleterThrowingExceptionPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::JSTestNamedDeleterWithIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::JSTestNamedGetterCallWithPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::JSTestNamedGetterNoIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::JSTestNamedGetterWithIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedSetterNoIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::JSTestNamedSetterThrowingExceptionPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedSetterWithIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetterPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation):
(WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation):
(WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodePrototype::finishCreation):
(WebCore::jsTestNodeName):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::initializeProperties):
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjReadOnlyLongAttr):
(WebCore::jsTestObjReadOnlyStringAttr):
(WebCore::jsTestObjReadOnlyTestObjAttr):
(WebCore::jsTestObjEnumAttr):
(WebCore::jsTestObjByteAttr):
(WebCore::jsTestObjOctetAttr):
(WebCore::jsTestObjShortAttr):
(WebCore::jsTestObjClampedShortAttr):
(WebCore::jsTestObjEnforceRangeShortAttr):
(WebCore::jsTestObjUnsignedShortAttr):
(WebCore::jsTestObjLongAttr):
(WebCore::jsTestObjLongLongAttr):
(WebCore::jsTestObjUnsignedLongLongAttr):
(WebCore::jsTestObjStringAttr):
(WebCore::jsTestObjUsvstringAttr):
(WebCore::jsTestObjTestObjAttr):
(WebCore::jsTestObjTestNullableObjAttr):
(WebCore::jsTestObjUnforgeableAttr):
(WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
(WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString):
(WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString):
(WebCore::jsTestObjStringLongRecordAttr):
(WebCore::jsTestObjUsvstringLongRecordAttr):
(WebCore::jsTestObjStringObjRecordAttr):
(WebCore::jsTestObjStringNullableObjRecordAttr):
(WebCore::jsTestObjDictionaryAttr):
(WebCore::jsTestObjNullableDictionaryAttr):
(WebCore::jsTestObjAnnotatedTypeInUnionAttr):
(WebCore::jsTestObjAnnotatedTypeInSequenceAttr):
(WebCore::jsTestObjImplementationEnumAttr):
(WebCore::jsTestObjXMLObjAttr):
(WebCore::jsTestObjCreate):
(WebCore::jsTestObjReflectedStringAttr):
(WebCore::jsTestObjReflectedUSVStringAttr):
(WebCore::jsTestObjReflectedIntegralAttr):
(WebCore::jsTestObjReflectedUnsignedIntegralAttr):
(WebCore::jsTestObjReflectedBooleanAttr):
(WebCore::jsTestObjReflectedURLAttr):
(WebCore::jsTestObjReflectedUSVURLAttr):
(WebCore::jsTestObjReflectedCustomIntegralAttr):
(WebCore::jsTestObjReflectedCustomBooleanAttr):
(WebCore::jsTestObjReflectedCustomURLAttr):
(WebCore::jsTestObjEnabledAtRuntimeAttribute):
(WebCore::jsTestObjEnabledBySettingAttribute):
(WebCore::jsTestObjTypedArrayAttr):
(WebCore::jsTestObjAttributeWithGetterException):
(WebCore::jsTestObjAttributeWithSetterException):
(WebCore::jsTestObjStringAttrWithGetterException):
(WebCore::jsTestObjStringAttrWithSetterException):
(WebCore::jsTestObjCustomAttr):
(WebCore::jsTestObjOnfoo):
(WebCore::jsTestObjOnwebkitfoo):
(WebCore::jsTestObjWithScriptStateAttribute):
(WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAttribute):
(WebCore::jsTestObjWithScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::jsTestObjConditionalAttr1):
(WebCore::jsTestObjConditionalAttr2):
(WebCore::jsTestObjConditionalAttr3):
(WebCore::jsTestObjCachedAttribute1):
(WebCore::jsTestObjCachedAttribute2):
(WebCore::jsTestObjAnyAttribute):
(WebCore::jsTestObjObjectAttribute):
(WebCore::jsTestObjContentDocument):
(WebCore::jsTestObjMutablePoint):
(WebCore::jsTestObjStrawberry):
(WebCore::jsTestObjDescription):
(WebCore::jsTestObjId):
(WebCore::jsTestObjHash):
(WebCore::jsTestObjReplaceableAttribute):
(WebCore::jsTestObjNullableDoubleAttribute):
(WebCore::jsTestObjNullableLongAttribute):
(WebCore::jsTestObjNullableBooleanAttribute):
(WebCore::jsTestObjNullableStringAttribute):
(WebCore::jsTestObjNullableLongSettableAttribute):
(WebCore::jsTestObjNullableStringSettableAttribute):
(WebCore::jsTestObjNullableUSVStringSettableAttribute):
(WebCore::jsTestObjNullableByteStringSettableAttribute):
(WebCore::jsTestObjNullableStringValue):
(WebCore::jsTestObjAttribute):
(WebCore::jsTestObjAttributeWithReservedEnumType):
(WebCore::jsTestObjPutForwardsAttribute):
(WebCore::jsTestObjPutForwardsNullableAttribute):
(WebCore::jsTestObjStringifierAttribute):
(WebCore::jsTestObjConditionallyReadWriteAttribute):
(WebCore::jsTestObjConditionalAndConditionallyReadWriteAttribute):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::JSTestOverloadedConstructorsWithSequencePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltinsPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::JSTestPluginInterfacePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::JSTestPromiseRejectionEventPrototype::finishCreation):
(WebCore::jsTestPromiseRejectionEventReason):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::JSTestSerializationPrototype::finishCreation):
(WebCore::jsTestSerializationFirstStringAttribute):
(WebCore::jsTestSerializationSecondLongAttribute):
(WebCore::jsTestSerializationThirdUnserializableAttribute):
(WebCore::jsTestSerializationFourthUnrestrictedDoubleAttribute):
(WebCore::jsTestSerializationFifthLongAttribute):
(WebCore::jsTestSerializationSixthTypedefAttribute):
(WebCore::jsTestSerializationSeventhDirectlySerializableAttribute):
(WebCore::jsTestSerializationEighthIndirectlyAttribute):
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
(WebCore::JSTestSerializationIndirectInheritancePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
(WebCore::JSTestSerializationInheritPrototype::finishCreation):
(WebCore::jsTestSerializationInheritInheritLongAttribute):
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
(WebCore::JSTestSerializationInheritFinalPrototype::finishCreation):
(WebCore::jsTestSerializationInheritFinalFinalLongAttributeFoo):
(WebCore::jsTestSerializationInheritFinalFinalLongAttributeBar):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation):
(WebCore::jsTestSerializedScriptValueInterfaceValue):
(WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
(WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
(WebCore::jsTestSerializedScriptValueInterfacePorts):
(WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::JSTestStringifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::JSTestStringifierAnonymousOperationPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::JSTestStringifierNamedOperationPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::JSTestStringifierOperationImplementedAsPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::JSTestStringifierOperationNamedToStringPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::JSTestStringifierReadOnlyAttributePrototype::finishCreation):
(WebCore::jsTestStringifierReadOnlyAttributeIdentifier):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::JSTestStringifierReadWriteAttributePrototype::finishCreation):
(WebCore::jsTestStringifierReadWriteAttributeIdentifier):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::initializeProperties):
(WebCore::JSTestTypedefsPrototype::finishCreation):
(WebCore::jsTestTypedefsUnsignedLongLongAttr):
(WebCore::jsTestTypedefsSerializedScriptValue):
(WebCore::jsTestTypedefsAttributeWithClamp):
(WebCore::jsTestTypedefsAttributeWithClampInTypedef):
(WebCore::jsTestTypedefsAttrWithGetterException):
(WebCore::jsTestTypedefsAttrWithSetterException):
(WebCore::jsTestTypedefsStringAttrWithGetterException):
(WebCore::jsTestTypedefsStringAttrWithSetterException):
(WebCore::jsTestTypedefsBufferSourceAttr):
(WebCore::jsTestTypedefsDomTimeStampAttr):
They are binding test rebaselines.

* domjit/DOMJITIDLTypeFilter.h:
* domjit/JSDocumentDOMJIT.cpp:
(WebCore::compileDocumentDocumentElementAttribute):
(WebCore::compileDocumentBodyAttribute):
(WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): Deleted.
(WebCore::DocumentBodyDOMJIT::callDOMGetter): Deleted.
* domjit/JSNodeDOMJIT.cpp:
(WebCore::compileNodeFirstChildAttribute):
(WebCore::compileNodeLastChildAttribute):
(WebCore::compileNodeNextSiblingAttribute):
(WebCore::compileNodePreviousSiblingAttribute):
(WebCore::compileNodeParentNodeAttribute):
(WebCore::compileNodeNodeTypeAttribute):
(WebCore::compileNodeOwnerDocumentAttribute):
(WebCore::NodeFirstChildDOMJIT::callDOMGetter): Deleted.
(WebCore::NodeLastChildDOMJIT::callDOMGetter): Deleted.
(WebCore::NodeNextSiblingDOMJIT::callDOMGetter): Deleted.
(WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): Deleted.
(WebCore::NodeParentNodeDOMJIT::callDOMGetter): Deleted.
(WebCore::NodeNodeTypeDOMJIT::callDOMGetter): Deleted.
(WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted.
DOMJIT::GetterSetter becomes smaller constexpr data.

LayoutTests:

* js/dom/dom-getters-type-check-expected.txt: Added.
* js/dom/dom-getters-type-check.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219981 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GStreamer][EME] Not having a key id buffer should not always error
calvaris@igalia.com [Thu, 27 Jul 2017 10:39:21 +0000 (10:39 +0000)]
[GStreamer][EME] Not having a key id buffer should not always error
https://bugs.webkit.org/show_bug.cgi?id=174889

Reviewed by Žan Doberšek.

In r219946 we introduced a hard requirement for a key id buffer
that does not happen for all CDMs.

* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorSetupCipher): Check for key id buffer
and error if we didn't get it.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace): Soften the
requirement for key id buffer.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219980 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GStreamer][EME] Fix phony debug output in player base for supported key system
calvaris@igalia.com [Thu, 27 Jul 2017 10:18:18 +0000 (10:18 +0000)]
[GStreamer][EME] Fix phony debug output in player base for supported key system
https://bugs.webkit.org/show_bug.cgi?id=174888

Reviewed by Žan Doberšek.

The debug output was returning always false because that method
was not checking anything before. Now it is and should reflect it.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219979 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[EME][GStreamer] Add barebones CDM interface implementations for ClearKey
zandobersek@gmail.com [Thu, 27 Jul 2017 08:55:09 +0000 (08:55 +0000)]
[EME][GStreamer] Add barebones CDM interface implementations for ClearKey
https://bugs.webkit.org/show_bug.cgi?id=174887

Reviewed by Xabier Rodriguez-Calvar.

Add empty ClearKey derivations of CDMFactory, CDMPrivate and CDMInstance
classes. These will be enhanced as the implementation progresses.

ClearKey is added to CDMInstance::ImplementationType, and the
CDMInstanceClearKey::implementationType() override returns that value.
Type traits specialization for the CDMInstanceClearKey class is also
added, utilizing the CDMInstance::ImplementationType::ClearKey value.

The implementation file is added to the WPE build, along with the
necessary inclusion directory.

* PlatformWPE.cmake:
* platform/encryptedmedia/CDMInstance.h:
* platform/encryptedmedia/clearkey/CDMClearKey.cpp: Added.
(WebCore::CDMFactoryClearKey::createCDM):
(WebCore::CDMFactoryClearKey::supportsKeySystem):
(WebCore::CDMPrivateClearKey::supportsInitDataType):
(WebCore::CDMPrivateClearKey::supportsConfiguration):
(WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions):
(WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration):
(WebCore::CDMPrivateClearKey::supportsRobustness):
(WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement):
(WebCore::CDMPrivateClearKey::persistentStateRequirement):
(WebCore::CDMPrivateClearKey::distinctiveIdentifiersAreUniquePerOriginAndClearable):
(WebCore::CDMPrivateClearKey::createInstance):
(WebCore::CDMPrivateClearKey::loadAndInitialize):
(WebCore::CDMPrivateClearKey::supportsServerCertificates):
(WebCore::CDMPrivateClearKey::supportsSessions):
(WebCore::CDMPrivateClearKey::supportsInitData):
(WebCore::CDMPrivateClearKey::sanitizeResponse):
(WebCore::CDMPrivateClearKey::sanitizeSessionId):
(WebCore::CDMInstanceClearKey::initializeWithConfiguration):
(WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed):
(WebCore::CDMInstanceClearKey::setPersistentStateAllowed):
(WebCore::CDMInstanceClearKey::setServerCertificate):
(WebCore::CDMInstanceClearKey::requestLicense):
(WebCore::CDMInstanceClearKey::updateLicense):
(WebCore::CDMInstanceClearKey::loadSession):
(WebCore::CDMInstanceClearKey::closeSession):
(WebCore::CDMInstanceClearKey::removeSessionData):
(WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage):
* platform/encryptedmedia/clearkey/CDMClearKey.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219978 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[EME] Allow CDMInstance type traits specialization
zandobersek@gmail.com [Thu, 27 Jul 2017 08:13:55 +0000 (08:13 +0000)]
[EME] Allow CDMInstance type traits specialization
https://bugs.webkit.org/show_bug.cgi?id=174886

Reviewed by Xabier Rodriguez-Calvar.

Allow using the trait-based type casting for the CDMInstance class and its
derivatives. ImplementationType enumeration values are to be used and
returned from the new implementationType() virtual method. This method is
leveraged in the type trait specialization that enables using is<>() and
downcast<>() helpers for CDMInstance objects.

This will allow differentiating between CDMInstance implementations once
the media playback pipeline has to retrieve any key information that's
necessary for playback of encrypted content.

MockCDMInstance class overrides the implementationType() method, returning
the ImplementationType::Mock value. Type trait specializations for this
class aren't added since they're not needed anywhere at this point.

* platform/encryptedmedia/CDMInstance.h:
* testing/MockCDMFactory.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219977 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[GCrypt] Key serialization support
zandobersek@gmail.com [Thu, 27 Jul 2017 08:13:02 +0000 (08:13 +0000)]
[GCrypt] Key serialization support
https://bugs.webkit.org/show_bug.cgi?id=173883

Reviewed by Jiewen Tan.

Source/WebCore:

Implement crypto key serialization for platforms that use libgcrypt.

Despite the function names and the existing implementation for the Mac port,
we don't perform the KEK wrapping and unwrapping due to the review feedback
advising against it.

Instead the passed-in key data is simply copied and returned as the result of
the 'wrapping' operation, and similarly the passed-in serialized data is simply
copied and returned as the result of the 'unwrapping' operation.

No new tests -- related tests are now passing and are unskipped.

* crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
(WebCore::getDefaultWebCryptoMasterKey):
(WebCore::wrapSerializedCryptoKey):
(WebCore::unwrapSerializedCryptoKey):

LayoutTests:

* platform/wpe/TestExpectations: Unskip the crypto/worker/ tests that
utilize key serialization and are now passing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219976 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoResourceLoadStatistics API tests fail on El Capitan.
beidson@apple.com [Thu, 27 Jul 2017 02:47:20 +0000 (02:47 +0000)]
ResourceLoadStatistics API tests fail on El Capitan.
https://bugs.webkit.org/show_bug.cgi?id=174877

Reviewed by Chris Dumez.

Always install the testing callback.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219974 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoREGRESSION (r211160): Can't pinch to zoom unlocked encrypted PDFs in WKWebView
timothy_horton@apple.com [Thu, 27 Jul 2017 01:49:44 +0000 (01:49 +0000)]
REGRESSION (r211160): Can't pinch to zoom unlocked encrypted PDFs in WKWebView
https://bugs.webkit.org/show_bug.cgi?id=174881
<rdar://problem/33556312>

Reviewed by Andy Estes.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _hidePasswordView]):
WKPasswordView saves and restores a bunch of scroll view properties, including
those relating to zoom limits. The restoration happens in -[WKPasswordView hide],
which is never called. Instead, the code added in r211160 just calls
removeFromSuperview after unlocking, never restoring the old zoom limits,
causing the then fully unlocked PDF to not be zoomable. Fix this by calling
-hide instead of -removeFromSuperview (which -hide also calls).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219973 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoUncaught Exception: undefined is not an object (evaluating 'this._memoryRow.value...
drousso@apple.com [Thu, 27 Jul 2017 00:13:20 +0000 (00:13 +0000)]
Uncaught Exception: undefined is not an object (evaluating 'this._memoryRow.value = Number.bytesToString(this._canvas.memoryCost)')
https://bugs.webkit.org/show_bug.cgi?id=174823

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WebInspector.CanvasDetailsSidebarPanel.prototype._refreshIdentitySection):
(WebInspector.CanvasDetailsSidebarPanel.prototype._refreshSourceSection):
(WebInspector.CanvasDetailsSidebarPanel.prototype._refreshAttributesSection):
(WebInspector.CanvasDetailsSidebarPanel.prototype._refreshCSSCanvasSection):
(WebInspector.CanvasDetailsSidebarPanel.prototype._formatMemoryRow):
Early return if the view has not called initialLayout, as the rows might not have been
constructed yet.

* UserInterface/Views/View.js:
(WebInspector.View.prototype.get didInitialLayout): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219972 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years agoImplement new TextMetrics, returned by canvas measureText()
commit-queue@webkit.org [Wed, 26 Jul 2017 23:53:26 +0000 (23:53 +0000)]
Implement new TextMetrics, returned by canvas measureText()
https://bugs.webkit.org/show_bug.cgi?id=82798
Source/WebCore:

<rdar://problem/11159332>

Patch by Arnaud Renevier  <a.renevier@sisa.samsung.com> and Fujii Hironori <Hironori.Fujii@sony.com> on 2017-07-26
Reviewed by Dean Jackson.

The specification: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-measuretext

Add new attributes to TextMetrics.

Add a new method textOffset() of CanvasRenderingContext2D by
extracting from drawTextInternal() to use the same horizontal and
vertical offsets of a text in both drawTextInternal() and
measureText().

Test: fast/canvas/canvas-measureText-2.html

* html/TextMetrics.h:
(WebCore::TextMetrics::actualBoundingBoxLeft):
(WebCore::TextMetrics::setActualBoundingBoxLeft):
(WebCore::TextMetrics::actualBoundingBoxRight):
(WebCore::TextMetrics::setActualBoundingBoxRight):
(WebCore::TextMetrics::fontBoundingBoxAscent):
(WebCore::TextMetrics::setFontBoundingBoxAscent):
(WebCore::TextMetrics::fontBoundingBoxDescent):
(WebCore::TextMetrics::setFontBoundingBoxDescent):
(WebCore::TextMetrics::actualBoundingBoxAscent):
(WebCore::TextMetrics::setActualBoundingBoxAscent):
(WebCore::TextMetrics::actualBoundingBoxDescent):
(WebCore::TextMetrics::setActualBoundingBoxDescent):
(WebCore::TextMetrics::emHeightAscent):
(WebCore::TextMetrics::setEmHeightAscent):
(WebCore::TextMetrics::emHeightDescent):
(WebCore::TextMetrics::setEmHeightDescent):
(WebCore::TextMetrics::hangingBaseline):
(WebCore::TextMetrics::setHangingBaseline):
(WebCore::TextMetrics::alphabeticBaseline):
(WebCore::TextMetrics::setAlphabeticBaseline):
(WebCore::TextMetrics::ideographicBaseline):
(WebCore::TextMetrics::setIdeographicBaseline):
Added getters and setters.
(WebCore::TextMetrics::TextMetrics): Deleted.
* html/TextMetrics.idl: Added new attributes.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
Changed the return value type to a const reference of FontMetrics
not to copy it.
(WebCore::CanvasRenderingContext2D::FontProxy::width):
Added the second arguemnt of GlyphOverflow type.
(WebCore::CanvasRenderingContext2D::measureText): Calculate and
set the new attributes of TextMetrics.
(WebCore::CanvasRenderingContext2D::textOffset): Extracted from drawTextInternal.
(WebCore::CanvasRenderingContext2D::drawTextInternal): Removed the
offset calculation code and call textOffset.
* html/canvas/CanvasRenderingContext2D.h: Added the method
declaration of textOffset. Change types of fontMetrics and width
methods.
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::floatWidthForComplexText): Added a dummy
implementation of calculating GlyphOverflow.

LayoutTests:

Patch by Arnaud Renevier  <a.renevier@sisa.samsung.com> and Fujii Hironori <Hironori.Fujii@sony.com> on 2017-07-26
Reviewed by Dean Jackson.

Create a test that checks that:
     - ascent + descent is greater than zero
     - actualBoundingBoxLeft + actualBoundingBoxRight is somewhere
       quite close to width
     - when baseline is top, emHeightAscent is 0 (respectively
       bottom/emHeightDescent)
     - when baseline is hanging, hangingBaseline in 0 (respectively
       alphabetic and ideographic)
     - order of different vertical measures (for example,
       emHeightAscent is always higher that alphabeticBaseline)

* fast/canvas/canvas-measureText-2-expected.txt: Added.
* fast/canvas/canvas-measureText-2.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219970 268f45cc-cd09-0410-ab3c-d52691b4dbfc