WebKit-https.git
3 years agoCrashes in WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask.
beidson@apple.com [Mon, 13 Jun 2016 18:56:43 +0000 (18:56 +0000)]
Crashes in WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask.
<rdar://problem/26768449> and https://bugs.webkit.org/show_bug.cgi?id=158696

Reviewed by David Kilzer.

No new tests (Covered by all existing tests in Gmalloc/ASAN configs).

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
(WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):

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

3 years agoFix round-down goof in Air.js's ShuffleCustom.forEachArg
fpizlo@apple.com [Mon, 13 Jun 2016 18:08:36 +0000 (18:08 +0000)]
Fix round-down goof in Air.js's ShuffleCustom.forEachArg
https://bugs.webkit.org/show_bug.cgi?id=158674

Reviewed by Michael Saboff.

x / 3 * 3 is not how you round down to multiples of 3 in JavaScript. You need to do
Math.floor(x / 3) * 3 instead.

This is a benign change, because having extra arguments to a Shuffle is not something we
actually take advantage of yet. But I think it's best to match the original C++ code's
intent.

* Air.js/custom.js:
(const.ShuffleCustom.forEachArg):

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

3 years agoModern IDB: IDBOpenDBRequest objects leak.
beidson@apple.com [Mon, 13 Jun 2016 17:32:50 +0000 (17:32 +0000)]
Modern IDB: IDBOpenDBRequest objects leak.
https://bugs.webkit.org/show_bug.cgi?id=158694

Reviewed by Alex Christensen.

No new tests (Currently have no testing strategy for guaranteeing lifetime of WebCore DOM objects)

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest): At this point we never need the
    request again, so remove it from the map.

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

3 years agoMake sure HTTPHeaderMap gets a move constructor / assignment operator
cdumez@apple.com [Mon, 13 Jun 2016 17:28:29 +0000 (17:28 +0000)]
Make sure HTTPHeaderMap gets a move constructor / assignment operator
https://bugs.webkit.org/show_bug.cgi?id=158695
<rdar://problem/26729511>

Reviewed by Alex Christensen.

Make sure HTTPHeaderMap gets a move constructor / assignment operator.
It was not getting an implicit one because of its user-declared
destructor. This patch drops the user-declared destructor so that
HTTPHeaderMap now gets an implicit move constructor / assignment
operator.

Not having a move constructor / assignment operator is an issue because
we rely on HTTPHeaderMap::isolatedCopy() / WTFMove() since r201623 to
pass HTTPHeaderMap across thread.

* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::~HTTPHeaderMap): Deleted.
* platform/network/HTTPHeaderMap.h:

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

3 years agoUnreviewed, follow up patch for r201964
utatane.tea@gmail.com [Mon, 13 Jun 2016 16:52:37 +0000 (16:52 +0000)]
Unreviewed, follow up patch for r201964
https://bugs.webkit.org/show_bug.cgi?id=158619

Fix typo in the comment.

* runtime/MathCommon.h:
(JSC::toInt32):

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

3 years agoRemove useless parameter from GenerateParametersCheck signature
nael.ouedraogo@crf.canon.fr [Mon, 13 Jun 2016 16:46:04 +0000 (16:46 +0000)]
Remove useless parameter from GenerateParametersCheck signature
https://bugs.webkit.org/show_bug.cgi?id=158692

Reviewed by Chris Dumez.

Remove one parameter which is passed to GenerateParametersCheck
but never used in the caller code.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateParametersCheck):
(GenerateConstructorDefinition):

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

3 years agoStack overflow at RefPtr::release on Windows port since r201782
commit-queue@webkit.org [Mon, 13 Jun 2016 16:27:50 +0000 (16:27 +0000)]
Stack overflow at RefPtr::release on Windows port since r201782
https://bugs.webkit.org/show_bug.cgi?id=158687

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-06-13
Reviewed by Chris Dumez.

RefPtr::release calls RefPtr::RefPtr, and RefPtr::RefPtr calls
RefPtr::release.

RefPtr::RefPtr does not need to call RefPtr::release.

* wtf/RefPtr.h:
(WTF::RefPtr::RefPtr): Do not call RefPtr::release.

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

3 years agoAdd a mechanism for collecting LLINT stats.
mark.lam@apple.com [Mon, 13 Jun 2016 15:53:42 +0000 (15:53 +0000)]
Add a mechanism for collecting LLINT stats.
https://bugs.webkit.org/show_bug.cgi?id=158668

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This patch will add a mechanism for collecting the stats on LLINT opcode
execution counts.  The changes made to enable this are:

1. Refactored how Options availability work so that we can add a new category:
   Configurable (in addition to the pre-existing Normal and Restricted
   availability).
       Normal options - always available.
       Restricted options - only available on debug builds.
       Configurable options - depends on #define flag options.

   This change is necessary so that:
   a. we won't have to rebuild the world when we want to enable that #define flag
      to make that Configurable option available.
   b. when the #define flag is disabled, the option will be invisible to the user.

   With this, we add our first configurable option, JSC_reportLLIntStats, which
   is dependent on the ENABLE_LLINT_STATS flag.  See next.

2. Added the ENABLE_LLINT_STATS flag in LLIntCommon.h.  To enable LLINT stats
   collection, we'll need to set this flag to a non-zero value, and rebuilding
   the project.  By design, this will only require a minimal set of files to
   be rebuilt.

   ENABLE_LLINT_STATS is 0 (i.e. disabled) by default.

3. Added a slow path callback to the LLINT's traceExecution() macro, to call
   _llint_count_opcode(), which in turns counts the opcode.  This callback will
   only be built into the LLINT if ENABLE_LLINT_STATS is non-zero.

4. Added s_opcodeStatsArray to LLInt::Data.  This is where the stats are
   recorded and stored.

5. Added calls to LLInt::Data::dumpStats() in jsc.cpp and DumpRenderTree.mm
   to dump the LLINT stats if enabled.  If enabled, the LLINT stats will be
   sorted and dumped (via dataLog) before the programs terminate.

* interpreter/Interpreter.h:
* jsc.cpp:
(main):
* llint/LLIntCommon.h:
* llint/LLIntData.cpp:
(JSC::LLInt::initialize):
(JSC::LLInt::Data::dumpStats):
* llint/LLIntData.h:
(JSC::LLInt::Data::opcodeStats):
* llint/LLIntOfflineAsmConfig.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::llint_crash):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* runtime/Options.cpp:
(JSC::parse):
(JSC::Options::isAvailable):
(JSC::overrideOptionWithHeuristic):
(JSC::scaleJITPolicy):
(JSC::Options::initialize):
(JSC::Options::setOptionWithoutAlias):
(JSC::Options::dumpAllOptions):
(JSC::Options::dumpOption):
* runtime/Options.h:
(JSC::Option::Option):
(JSC::Option::operator!=):
(JSC::Option::id):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(DumpRenderTreeMain):

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

3 years ago[GTK] Enabling Shadow DOM by default
commit-queue@webkit.org [Mon, 13 Jun 2016 14:10:18 +0000 (14:10 +0000)]
[GTK] Enabling Shadow DOM by default
https://bugs.webkit.org/show_bug.cgi?id=158686

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2016-06-13
Reviewed by Carlos Garcia Campos.

.:

Added support for enabling Shadow DOM by default for GTK.

* Source/cmake/OptionsGTK.cmake:

Tools:

Added support for enabling Shadow DOM by default for GTK.
Changed GTK test expectations for fast/shadow-dom tests (most tests
pass).

* Scripts/webkitperl/FeatureList.pm:

LayoutTests:

Changed GTK test expectations for fast/shadow-dom tests (most tests
pass).

* platform/gtk/TestExpectations:

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

3 years agoImprove code generator for functions with variadic parameters
nael.ouedraogo@crf.canon.fr [Mon, 13 Jun 2016 13:40:26 +0000 (13:40 +0000)]
Improve code generator for functions with variadic parameters
https://bugs.webkit.org/show_bug.cgi?id=158529

Reviewed by Darin Adler.

JS bindings code of functions with variadic parameters is improved.

Functions with variadic parameters are skipped for ObjC and GObject code generators.

* bindings/scripts/CodeGeneratorGObject.pm:
(SkipFunction): Skip functions with variadic parameters.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
* bindings/scripts/CodeGeneratorObjC.pm:
(SkipFunction): Skip functions with variadic parameters.
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_any): Deleted.
(webkit_dom_test_obj_attach_shadow_root): Deleted.
(webkit_dom_test_obj_get_read_only_long_attr): Deleted.
(webkit_dom_test_obj_get_read_only_string_attr): Deleted.
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
(WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:

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

3 years agoUnreviewed test gardening.
peavo@outlook.com [Mon, 13 Jun 2016 09:06:43 +0000 (09:06 +0000)]
Unreviewed test gardening.

Unskip passing fast/workers tests.

* platform/win/TestExpectations:

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

3 years agorun-safari/run-webkit-app fail to quit iOS simulator after Xcode installation
aakash_jain@apple.com [Mon, 13 Jun 2016 03:57:23 +0000 (03:57 +0000)]
run-safari/run-webkit-app fail to quit iOS simulator after Xcode installation
https://bugs.webkit.org/show_bug.cgi?id=158651
rdar://problem/26499824

Reviewed by Daniel Bates.

This change is to make our tools more robust. Sometimes run-safari/run-webkit-app fails
to start the tests as one of the first thing these scripts do is to relaunch iOS Simulators,
and in process call quitIOSSimulator. In case the Simulator is not registered in LaunchServices
for some reason, quitIOSSimulator fails and the script stops. This change will make the scripts
still continue when they fail to quit iOS Simuator, and modify the way Simulator is opened,
so that Simulator is implicitly registered with LaunchServices while opening it.

* Scripts/webkitdirs.pm:
(relaunchIOSSimulator):
Launch iOS Simulator using complete path. Partially reverting http://trac.webkit.org/changeset/184202.
(quitIOSSimulator):
Do not die if quitting ios Simulator fails, so that relaunchIOSSimulator can still
attempt to launch the simulator.
(waitUntilIOSSimulatorDeviceIsInState):
Added a FIXME.

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

3 years agoCleanup RenderBlock::removePositionedObjects
zalan@apple.com [Sun, 12 Jun 2016 20:57:11 +0000 (20:57 +0000)]
Cleanup RenderBlock::removePositionedObjects
https://bugs.webkit.org/show_bug.cgi?id=158670

Reviewed by Simon Fraser.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::insertPositionedObject):
(WebCore::RenderBlock::removePositionedObject):
(WebCore::RenderBlock::removePositionedObjects):
* rendering/RenderBlock.h:

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

3 years agoRemove positioned descendants when RenderBlock is no longer a containing block.
zalan@apple.com [Sun, 12 Jun 2016 20:45:44 +0000 (20:45 +0000)]
Remove positioned descendants when RenderBlock is no longer a containing block.
https://bugs.webkit.org/show_bug.cgi?id=158655
<rdar://problem/26510032>

Reviewed by Simon Fraser.

Normally the RenderView is the containing block for fixed positioned renderers.
However when a renderer acquires some transform related properties, it becomes the containing
block for all the fixed positioned renderers in its descendant tree.
When the last transform related property is removed, the renderer is no longer a containing block
and we need to remove all these positioned renderers from the descendant tracker map (gPositionedDescendantsMap).
They will be inserted back into the tracker map during the next layout (either under the RenderView or
under the next transformed renderer in the ancestor chain).

Source/WebCore:

Test: fast/block/fixed-position-reparent-when-transition-is-removed.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::removePositionedObjectsIfNeeded):

LayoutTests:

* fast/block/fixed-position-reparent-when-transition-is-removed-expected.txt: Added.
* fast/block/fixed-position-reparent-when-transition-is-removed.html: Added.

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

3 years agoCrash in com.apple.WebKit.WebContent at std::__1::__call_once_proxy<std::__1::tuple...
ddkilzer@apple.com [Sun, 12 Jun 2016 13:22:53 +0000 (13:22 +0000)]
Crash in com.apple.WebKit.WebContent at std::__1::__call_once_proxy<std::__1::tuple<CrashReporterSupportLibrary()::$_0&&> >
<https://webkit.org/b/158660>
<rdar://problem/25652686>

Reviewed by Darin Adler.

* bmalloc/Logging.cpp: Switch to use
BSOFT_LINK_PRIVATE_FRAMEWORK() to link
CrashReporterSupport.framework.
* bmalloc/darwin/BSoftLinking.h:
(BSOFT_LINK_PRIVATE_FRAMEWORK): Rename from BSOFT_LINK_FRAMEWORK.
Switch to use /System/Library/PrivateFrameworks/.

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

3 years agoAddressing post-review comments after r201978.
mmaxfield@apple.com [Sun, 12 Jun 2016 01:14:58 +0000 (01:14 +0000)]
Addressing post-review comments after r201978.
https://bugs.webkit.org/show_bug.cgi?id=158649
<rdar://problem/13258122>

Unreviewed.

Source/WebCore:

* platform/graphics/FontCache.cpp:
(WebCore::FontCache::alternateFamilyName):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::platformAlternateFamilyName):

Source/WTF:

* wtf/text/StringCommon.h:
(WTF::equal):
(WTF::naiveEqualWithoutPerformingUnicodeNormalization): Deleted.

Tools:

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

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

3 years agoUnreviewed leak fix after r201863.
ap@apple.com [Sat, 11 Jun 2016 23:44:50 +0000 (23:44 +0000)]
Unreviewed leak fix after r201863.

* DumpRenderTree/mac/DumpRenderTree.mm:
(dumpFramesAsText):

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

3 years agoTighten code to build set of tag names
darin@apple.com [Sat, 11 Jun 2016 23:35:23 +0000 (23:35 +0000)]
Tighten code to build set of tag names
https://bugs.webkit.org/show_bug.cgi?id=158662

Reviewed by Alexey Proskuryakov.

* dom/Element.cpp:
(WebCore::canAttachAuthorShadowRoot): Use an array of pointers that the loader
can initialize as part of loading the library, rather than an array that needs
to be initialized with code at runtime.

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

3 years ago[Win] [EFL] Build fix after r201978.
mmaxfield@apple.com [Sat, 11 Jun 2016 22:55:40 +0000 (22:55 +0000)]
[Win] [EFL] Build fix after r201978.
https://bugs.webkit.org/show_bug.cgi?id=158649
<rdar://problem/13258122>

Unreviewed

* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::platformAlternateFamilyName):
* platform/graphics/win/FontCacheWin.cpp:

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

3 years ago[Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operat...
mmaxfield@apple.com [Sat, 11 Jun 2016 21:48:15 +0000 (21:48 +0000)]
[Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operating systems
https://bugs.webkit.org/show_bug.cgi?id=158649
<rdar://problem/13258122>

Reviewed by Darin Adler.

Source/WebCore:

There are many Chinese websites which hardcode Windows font names.
We should map these to fonts which best match them on Cocoa operating
systems. We can do this by using our existing fallback font name
infrastructure.

Tests: fast/text/chinese-font-name-aliases-2.html
       fast/text/chinese-font-name-aliases.html

* platform/graphics/FontCache.cpp:
(WebCore::FontCache::alternateFamilyName):
(WebCore::alternateFamilyName): Deleted.
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::platformAlternateFamilyName):
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::platformAlternateFamilyName):
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::platformAlternateFamilyName):

Source/WTF:

* wtf/text/StringCommon.h:
(WTF::naiveEqualWithoutPerformingUnicodeNormalization): Added.

Tools:

* TestWebKitAPI/Tests/WTF/WTFString.h:
(TestWebKitAPI::TEST):

LayoutTests:

Because this tests platform-specific font names, the test must
be platform-specific. Because it's a ref test, make two tests which
are mutually-exclusive on Cocoa platforms, and expected to fail
everywhere else.

* fast/text/chinese-font-name-aliases-2-expected.html: Added.
* fast/text/chinese-font-name-aliases-2.html: Added.
* fast/text/chinese-font-name-aliases-expected.html: Added.
* fast/text/chinese-font-name-aliases.html: Added.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

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

3 years agoUnreviewed, rolling out r201967, r201968, and r201972.
commit-queue@webkit.org [Sat, 11 Jun 2016 20:05:55 +0000 (20:05 +0000)]
Unreviewed, rolling out r201967, r201968, and r201972.
https://bugs.webkit.org/show_bug.cgi?id=158665

Caused flaky failures on IndexedDB tests (Requested by ap on
#webkit).

Reverted changesets:

"Vary:Cookie validation doesn't work in private browsing"
https://bugs.webkit.org/show_bug.cgi?id=158616
http://trac.webkit.org/changeset/201967

"Build fix."
http://trac.webkit.org/changeset/201968

"WinCairo build fix attempt."
http://trac.webkit.org/changeset/201972

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

3 years agoMinimize the amount of memcpy done for allocating Error stacks.
mark.lam@apple.com [Sat, 11 Jun 2016 19:58:07 +0000 (19:58 +0000)]
Minimize the amount of memcpy done for allocating Error stacks.
https://bugs.webkit.org/show_bug.cgi?id=158664

Reviewed by Darin Adler.

Currently, Vector<StackFrame> are being copied around multiple times in the
process of creating Error stacks.

This patch avoids this unnecessary copying by:
1. Sizing the StackFrame vector correctly to begin with, and skipping
   undesirable top frames before filling in the vector.
2. Using perfect forwarding or passing by reference to pass the vector data around
   instead of copying the vectors.
3. Changing the Exception object to take a Vector<StackFrame> instead of a
   RefCountedArray<StackFrame>.

This patch has passed the JSC and layout tests.  Benchmarks show that perf is
neutral.

* API/tests/testapi.mm:
(testObjectiveCAPI):
* inspector/ScriptCallStackFactory.cpp:
(Inspector::createScriptCallStackFromException):
* interpreter/Interpreter.cpp:
(JSC::GetStackTraceFunctor::GetStackTraceFunctor):
(JSC::GetStackTraceFunctor::operator()):
(JSC::Interpreter::getStackTrace):
(JSC::Interpreter::stackTraceAsString):
(JSC::findExceptionHandler):
* interpreter/Interpreter.h:
* runtime/Error.cpp:
(JSC::addErrorInfoAndGetBytecodeOffset):
* runtime/Exception.cpp:
(JSC::Exception::finishCreation):
* runtime/Exception.h:
(JSC::Exception::valueOffset):
(JSC::Exception::value):
(JSC::Exception::stack):
(JSC::Exception::didNotifyInspectorOfThrow):
(JSC::Exception::setDidNotifyInspectorOfThrow):

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

3 years agoUnreviewed, skip Air.js. It got unskipped when I renamed it from JSAir.
fpizlo@apple.com [Sat, 11 Jun 2016 19:48:48 +0000 (19:48 +0000)]
Unreviewed, skip Air.js. It got unskipped when I renamed it from JSAir.

* Skipped:

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

3 years agoTests that overflows the stack should not be run with the sampling profiler.
mark.lam@apple.com [Sat, 11 Jun 2016 18:53:58 +0000 (18:53 +0000)]
Tests that overflows the stack should not be run with the sampling profiler.
https://bugs.webkit.org/show_bug.cgi?id=158663

Reviewed by Saam Barati.

The sampling profiler will be sampling the whole stack, and the amount of memory
churn will make this tests time out, especially with debug builds.  Hence,
let's not run the test with the sampling profiler configuration.

* tests/stress/mutual-tail-call-no-stack-overflow.js:
(shouldThrow):

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

3 years agoFixed compilation of LocaleICU with ENABLE(DATE_AND_TIME_INPUT_TYPES)
annulen@yandex.ru [Sat, 11 Jun 2016 18:07:05 +0000 (18:07 +0000)]
Fixed compilation of LocaleICU with ENABLE(DATE_AND_TIME_INPUT_TYPES)
https://bugs.webkit.org/show_bug.cgi?id=158659

Reviewed by Darin Adler.

No new tests needed.

* platform/text/LocaleICU.cpp:
(WebCore::getFormatForSkeleton):
(WebCore::LocaleICU::monthFormat):
(WebCore::LocaleICU::shortMonthFormat):

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

3 years agoWinCairo build fix attempt.
antti@apple.com [Sat, 11 Jun 2016 17:58:51 +0000 (17:58 +0000)]
WinCairo build fix attempt.

* platform/network/NetworkStorageSession.cpp:
* platform/network/NetworkStorageSession.h:
* platform/network/NetworkStorageSessionStub.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::context):
(WebCore::NetworkStorageSession::createPrivateBrowsingSession):
(WebCore::NetworkStorageSession::switchToNewTestingSession):
(WebCore::NetworkStorageSession::~NetworkStorageSession): Deleted.
(WebCore::defaultSession): Deleted.
(WebCore::NetworkStorageSession::defaultStorageSession): Deleted.

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

3 years agoDeleting a CSSOM style rule invalidates any previously-added FontFaces
mmaxfield@apple.com [Sat, 11 Jun 2016 17:52:35 +0000 (17:52 +0000)]
Deleting a CSSOM style rule invalidates any previously-added FontFaces
https://bugs.webkit.org/show_bug.cgi?id=158450

Reviewed by Darin Adler.

Source/WebCore:

This patch has two pieces: updating the CSSOM when the FontFace changes, and
updating the FontFace when the CSSOM changes.

1: Updating the CSSOM when the FontFace changes: CSSFontFaces already have a RefPtr
to their StyleRuleFontFace which represents their CSS-connection. When changing a
property of the CSSFontFace, we simply reach into the StyleRule and update it to
match. Our existing infrastructure of invalidation due to the attribute changes
makes sure that all the necessary updates occur.

2. Updating the FontFace when the CSSOM changes: If the CSSOM changes in a trivial
way (for example, a new @font-face is appended to the end of the last <style>
element), we can handle it directly. However, when something more invasive occurs,
we end up clearing the entire CSSFontSelector, and then adding all the style rules
from scratch. This involves three steps:
    a) CSSFontSelector::buildStarted() is run, which means "we're about to start
       building up all the @font-face rules from scratch." We take this opportunity
       to purge as many fonts as possible. This is valuable because, for example,
       this function gets run when the page gets put into the page cache, so we
       want to destroy as much as possible. Not everything can be purged, however -
       only CSS-connected fonts which have never been inspected by script are
       purgeable. We don't allow fonts inspected by script to be purged because
       purging might result in a font appearing from JavaScript to transition from
       a success -> failure state, which we don't allow.
    b) Upon style recalc (possibly asynchronously) CSSFontSelector::addFontFaceRule()
       is called for each @font-face rule. We actually detect that we're in the
       middle of a style rebuild, and defer this step.
    c) When we're done adding all the font face rules, we call
       CSSFontSelector::buildCompleted(). This is where we compare the newly built-
       up list of font faces with what existed previously (as remembered in
       CSSFontSelector::buildStarted()) in order to detect font faces which were
       deleted from the document. Fonts which were newly added to the document
       are handled naturally.
       Fonts which have a property modified on them are created as if they were new.
       However, instead of simply adding the CSSFontFace, we search for the existing
       CSSFontFace (by CSS connection pointer) and tell the existing FontFace to
       adopt this new CSSFontFace. This means that the JavaScript object will just
       pick up any newly-written values in the CSSOM. It also means that the
       "status" attribute of the JavaScript object is reset, but this is expected
       and allowed by the spec. (For example, if you change the "src" attribute of
       an @font-face block via the CSSOM, all bets are off when you inspect the
       FontFace JS object representing that block.)

Test: fast/text/font-face-set-cssom.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::CSSFontFace):
(WebCore::CSSFontFace::setFamilies):
(WebCore::CSSFontFace::setStyle):
(WebCore::CSSFontFace::setWeight):
(WebCore::CSSFontFace::setUnicodeRange):
(WebCore::CSSFontFace::setVariantLigatures):
(WebCore::CSSFontFace::setVariantPosition):
(WebCore::CSSFontFace::setVariantCaps):
(WebCore::CSSFontFace::setVariantNumeric):
(WebCore::CSSFontFace::setVariantAlternates):
(WebCore::CSSFontFace::setVariantEastAsian):
(WebCore::CSSFontFace::setFeatureSettings):
(WebCore::CSSFontFace::initializeWrapper):
(WebCore::CSSFontFace::wrapper):
(WebCore::CSSFontFace::setWrapper):
(WebCore::CSSFontFace::purgeable):
(WebCore::CSSFontFace::updateStyleIfNeeded):
* css/CSSFontFace.h:
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::remove):
(WebCore::CSSFontFaceSet::containsCSSConnection):
(WebCore::CSSFontFaceSet::purge):
* css/CSSFontFaceSet.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::buildStarted):
(WebCore::CSSFontSelector::buildCompleted):
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSFontSelector.h:
* css/FontFace.cpp:
(WebCore::FontFace::family):
(WebCore::FontFace::style):
(WebCore::FontFace::weight):
(WebCore::FontFace::unicodeRange):
(WebCore::FontFace::variant):
(WebCore::FontFace::featureSettings):
(WebCore::FontFace::adopt):
* css/FontFace.h:

LayoutTests:

* fast/text/font-face-set-cssom-expected.txt: Added.
* fast/text/font-face-set-cssom.html: Added.

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

3 years agoWorkerNavigator is missing some attributes
cdumez@apple.com [Sat, 11 Jun 2016 17:44:20 +0000 (17:44 +0000)]
WorkerNavigator is missing some attributes
https://bugs.webkit.org/show_bug.cgi?id=158593
<rdar://problem/26731334>

Reviewed by Darin Adler.

Source/WebCore:

Add attributes that are missing on WorkerNavigator:
- appCodeName
- hardwareConcurrency
- language
- product
- productSub
- vendor
- vendorSub

Firefox and Chrome already expose those attributes.

Relevant specification:
https://html.spec.whatwg.org/multipage/workers.html#the-workernavigator-object

This patch also refactors the IDL to match the specification more
closely and promote sharing between Navigator and WorkerNavigator.

No new tests, updated existing test.

* CMakeLists.txt:
* DerivedSources.make:
Add new supplemental IDL files.

* page/Navigator.cpp:
* page/Navigator.h:
Moved language() / hardwareConcurrency() from Navigator to NavigatorBase
so that it can be used by NavigatorWorker as well.

* page/NavigatorBase.h:
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::language):
The implementation still calls defaultLanguage() but I updated it to be
thread safe on all platforms.

(WebCore::NavigatorBase::hardwareConcurrency):
Use std::call_once() for thread safety.

* page/Navigator.idl:
* page/NavigatorConcurrentHardware.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
* page/NavigatorID.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
* page/NavigatorLanguage.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
* page/NavigatorOnLine.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
* page/WorkerNavigator.idl:
Move several attributes to their own supplemental interfaces to match
the specification and promote sharing with WorkerNavigator.

* platform/Language.cpp:
(WebCore::userPreferredLanguages):
* platform/Language.h:
Made thread-safe on all platforms.

Source/WTF:

* wtf/PlatformUserPreferredLanguages.h:
* wtf/PlatformUserPreferredLanguagesWin.cpp:
(WTF::platformLanguage):
(WTF::platformUserPreferredLanguages):

Make platformUserPreferredLanguages() thread safe on Windows. The
Mac and Unix implementations are already thread-safe.

LayoutTests:

Improved test coverage for WorkerNavigator.

* fast/workers/resources/worker-navigator.js:

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

3 years agoImplement logging for RELEASE_BASSERT_WITH_MESSAGE() in BAssert.h
ddkilzer@apple.com [Sat, 11 Jun 2016 11:46:19 +0000 (11:46 +0000)]
Implement logging for RELEASE_BASSERT_WITH_MESSAGE() in BAssert.h
<http://webkit.org/b/155992>

Reviewed by Geoff Garen.

* bmalloc/BAssert.h:
(BLOG_ERROR): Add method to always log error messages.
(RELEASE_BASSERT_WITH_MESSAGE): Use BLOG_ERROR() to implement
logging in Debug builds.
* bmalloc/BPlatform.h:
(BPLATFORM_MAC): Add.
(BUSE): Add BUSE() macro.
(BATTRIBUTE_PRINTF): Add.
(BUSE_OS_LOG): Add.
* bmalloc/Logging.cpp:
(bmalloc::reportAssertionFailureWithMessage): Add.  Logs to
stderr.
* bmalloc/Logging.h:
(bmalloc::reportAssertionFailureWithMessage): Add declaration.

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

3 years agoBuild fix.
antti@apple.com [Sat, 11 Jun 2016 11:20:23 +0000 (11:20 +0000)]
Build fix.

* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::switchToNewTestingSession):

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

3 years agoVary:Cookie validation doesn't work in private browsing
antti@apple.com [Sat, 11 Jun 2016 11:09:54 +0000 (11:09 +0000)]
Vary:Cookie validation doesn't work in private browsing
https://bugs.webkit.org/show_bug.cgi?id=158616
Source/WebCore:

rdar://problem/26755067

Reviewed by Darin Adler.

This wasn't implemented because there was no way to get NetworkStorageSession from
a SessionID on WebCore side.

The patch adds a simple WebCore level weak map that allows getting NetworkStorageSessions
from SessionID. This seemed like the cleanest way to do this without a big refactoring
around the currently WebKit2 level SessionTracker.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/network/CacheValidation.cpp:
(WebCore::headerValueForVary):

    Get NetworkStorageSession from SessionID for cookies

(WebCore::verifyVaryingRequestHeaders):
* platform/network/NetworkStorageSession.cpp: Added.

    Add platform independent .cpp for NetworkStorageSession.
    Implement a weak map for SessionID -> NetworkStorageSession.

(WebCore::sessionsMap):
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::~NetworkStorageSession):
(WebCore::NetworkStorageSession::forSessionID):

    Get NetworkStorageSession for sessionID.

* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::sessionID):
(WebCore::NetworkStorageSession::credentialStorage):
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):

    Call to common constructor.

(WebCore::defaultNetworkStorageSession):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):

    Call to common constructor.

(WebCore::defaultSession):
(WebCore::NetworkStorageSession::~NetworkStorageSession): Deleted.

LayoutTests:

Reviewed by Darin Adler.

* http/tests/cache/disk-cache/disk-cache-vary-cookie-expected.txt:
* http/tests/cache/disk-cache/disk-cache-vary-cookie.html:

Exapand the existing test to cover memory cache and private browsing.

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

3 years agoUnreviewed, attempt to fix r201964 failure on Apple ports
utatane.tea@gmail.com [Sat, 11 Jun 2016 06:01:48 +0000 (06:01 +0000)]
Unreviewed, attempt to fix r201964 failure on Apple ports
https://bugs.webkit.org/show_bug.cgi?id=158619

Reviewed by Mark Lam.

Add Private attributes to MathCommon.h.

* JavaScriptCore.xcodeproj/project.pbxproj:

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

3 years agoWeb Inspector: <template> content should not be hidden as Shadow Content
commit-queue@webkit.org [Sat, 11 Jun 2016 05:32:44 +0000 (05:32 +0000)]
Web Inspector: <template> content should not be hidden as Shadow Content
https://bugs.webkit.org/show_bug.cgi?id=158654

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-06-10
Reviewed by Ryosuke Niwa.

* Localizations/en.lproj/localizedStrings.js:
New "Template Content" string.

* UserInterface/Models/DOMNode.js:
(WebInspector.DOMNode):
Don't treat template content as shadow content.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._nodeTitleInfo):
Custom string for template content fragment.

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

3 years ago[JSC] Inline JSC::toInt32 to improve kraken
utatane.tea@gmail.com [Sat, 11 Jun 2016 05:31:48 +0000 (05:31 +0000)]
[JSC] Inline JSC::toInt32 to improve kraken
https://bugs.webkit.org/show_bug.cgi?id=158619

Reviewed by Mark Lam.

Several kraken benchmarks show that JSC::toInt32 is frequently called.
For example, stanford-crypto-pbkdf2 reports that the hottest runtime function is JSC::toInt32.

The data is below (taken by Linux perf tools).
5.50%  jsc      libJavaScriptCore.so.1.0.0  [.] _ZN3JSC7toInt32Ed
3.96%  jsc      libJavaScriptCore.so.1.0.0  [.] _ZN3JSC20arrayProtoFuncConcatEPNS_9ExecStateE
2.48%  jsc      libJavaScriptCore.so.1.0.0  [.] _ZN3JSC19arrayProtoFuncSliceEPNS_9ExecStateE
1.69%  jsc      libJavaScriptCore.so.1.0.0  [.] _ZNK3JSC9Structure27holesMustForwardToPrototypeERNS_2VME

This is because of CommonSlowPaths' bit operations's JSValue::toInt32.
Due to the slow path, in `value | 0`, `value` may be a double number value. In that case, JSC::toInt32 is called.

While JSC::toIn32 is hot, the function itself is very small. It's worth inlining.

This change offers the following kraken improvements.

                                                 baseline                  patched
Kraken:
   audio-beat-detection                       47.492+-1.701             46.657+-1.232           might be 1.0179x faster
   stanford-crypto-aes                        43.669+-0.210      ^      42.862+-0.115         ^ definitely 1.0188x faster
   stanford-crypto-ccm                        45.213+-1.424             44.490+-1.290           might be 1.0162x faster
   stanford-crypto-pbkdf2                    107.665+-0.581      ^     106.229+-0.807         ^ definitely 1.0135x faster

This patch only focused on the call to toInt32 from the runtime functions.
So JSC::toInt32 calls from the baseline / DFG remain.
We ensure that JIT code uses operationToInt32 instead of JSC::toInt32 since JSC::toInt32 is now marked as ALWAYS_INLINE.
Linux perf profiler also finds that this `operationToInt32` is frequently called in the above benchmarks.
It may be good to introduce asm emit for that instead of calling JSC::toInt32 operation in the separated patch.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileValueToInt32):
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::doubleToInt32):
(JSC::FTL::DFG::LowerDFGToB3::sensibleDoubleToInt32):
* runtime/JSCJSValue.cpp:
(JSC::toInt32): Deleted.
* runtime/JSCJSValueInlines.h:
* runtime/MathCommon.cpp:
(JSC::operationToInt32):
* runtime/MathCommon.h:
(JSC::toInt32):

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

3 years agoUse the video element's video box when getting the inline video rect in WebVideoFulls...
adachan@apple.com [Sat, 11 Jun 2016 04:37:06 +0000 (04:37 +0000)]
Use the video element's video box when getting the inline video rect in WebVideoFullscreenManager
https://bugs.webkit.org/show_bug.cgi?id=158351
<rdar://problem/26567938>

Reviewed by Darin Adler.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
Change the visibility of RenderVideo.h and RenderMedia.h since we'll be importing RenderVideo.h from WebKit2.
* rendering/RenderVideo.h:

Source/WebKit2:

* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::inlineVideoFrame):
(WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
(WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
(WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
(WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
(WebKit::clientRectForElement): Deleted.

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

3 years agoFix CMake build.
achristensen@apple.com [Sat, 11 Jun 2016 04:24:27 +0000 (04:24 +0000)]
Fix CMake build.

* PlatformMac.cmake:

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

3 years agoMake it easy to package Air.js
fpizlo@apple.com [Sat, 11 Jun 2016 01:52:58 +0000 (01:52 +0000)]
Make it easy to package Air.js
https://bugs.webkit.org/show_bug.cgi?id=158652

Reviewed by Benjamin Poulain.

If you want to give Air.js to someone, you can now do:

cd PerformanceTests/Air.js
./make_dist.sh

This will create Air.js.tar.gz and a directory called Air.js. If you want to send someone
the benchmark, just send either of those things and tell them to look at index.html.

You may have to edit make_dist.sh for wherever you have Markdown.pl. You can get that from
https://daringfireball.net/projects/markdown/

* Air.js/make_dist.sh: Added.
* Air.js/test.html:

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

3 years agoUnreviewed, make the link to test.html into an actual link.
fpizlo@apple.com [Sat, 11 Jun 2016 01:32:47 +0000 (01:32 +0000)]
Unreviewed, make the link to test.html into an actual link.

* Air.js/README.md:

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

3 years agoFix some text in Air.js/README.md
fpizlo@apple.com [Sat, 11 Jun 2016 01:20:21 +0000 (01:20 +0000)]
Fix some text in Air.js/README.md
https://bugs.webkit.org/show_bug.cgi?id=158650

Reviewed by Benjamin Poulain.

I read the text again and found bugs:

- We never actually say how to run the benchmark. This change adds a blurb about how to run
  it.

- We both say that allocateStack is responsible for the bulk of the running time and that
  we haven't measured where the bulk of the time is spent. This changes the text to say that
  it was a goal to make allocateStack be the hottest part of the benchmark, but that we did
  not measure this.

* Air.js/README.md:

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

3 years agoAdd support for passive event listeners on touch events
benjamin@webkit.org [Sat, 11 Jun 2016 01:18:37 +0000 (01:18 +0000)]
Add support for passive event listeners on touch events
https://bugs.webkit.org/show_bug.cgi?id=158601

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-06-10
Reviewed by Simon Fraser.

Source/WebCore:

This patch wires "passive" state of EventTarget to the delivery of touch
events in WebKit2.

Instead of having a NonFastScrollableRegion, we have a pair of regions
in EventTrackingRegions.
The "asynchronousDispatchRegion" tracks the area for which all event
listeners are passive. For those, events should be dispatched asynchronously.
The "synchronousDispatchRegion" tracks the area for which there is at
least one active event listener. Events have to be dispatched synchronously
for correctness.

Tests: fast/events/touch/ios/tap-with-active-listener-on-elements.html
       fast/events/touch/ios/tap-with-active-listener-on-window.html
       fast/events/touch/ios/tap-with-passive-listener-on-elements.html
       fast/events/touch/ios/tap-with-passive-listener-on-window.html

* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::wheelEventHandlersChanged):
(WebCore::Document::Document): Deleted.
* dom/Document.h:

* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::containsActive):
If a Target has multiple listener for an event type, we want to know
if any of them is active.

* dom/EventListenerMap.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::hasActiveEventListeners):
(WebCore::EventTarget::hasActiveTouchEventListeners):
* dom/EventTarget.h:

* page/DebugPageOverlays.cpp:
(WebCore::NonFastScrollableRegionOverlay::updateRegion):
I did not change the debug overlays.
The NonFastScrollable area is the region for which events needs
synchronous dispatch. Everything else should scroll without delay.

* page/FrameView.cpp:
(WebCore::FrameView::scrollableAreaSetChanged):
* page/Page.cpp:
(WebCore::Page::nonFastScrollableRects):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setEventTrackingRegionsDirty):
(WebCore::AsyncScrollingCoordinator::willCommitTree):
(WebCore::AsyncScrollingCoordinator::updateEventTrackingRegions):
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged):
(WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
(WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionDirty): Deleted.
(WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion): Deleted.
(WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
(WebCore::AsyncScrollingCoordinator::eventTrackingRegionsDirty):
(WebCore::AsyncScrollingCoordinator::nonFastScrollableRegionDirty): Deleted.

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame):
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegions):
(WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame): Deleted.
(WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegion): Deleted.
I intentionally left the Wheel event with synchronous dispatch.
This use case will need its own set of tests.

* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::frameViewEventTrackingRegionsChanged):
(WebCore::ScrollingCoordinator::frameViewNonFastScrollableRegionChanged): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setEventTrackingRegions):
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
(WebCore::ScrollingStateFrameScrollingNode::setNonFastScrollableRegion): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
(WebCore::ScrollingTree::commitNewTreeState):
(WebCore::ScrollingTree::eventTrackingTypeForPoint):
(WebCore::ScrollingTree::isPointInNonFastScrollableRegion): Deleted.
* page/scrolling/ScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
* platform/EventTrackingRegions.h: Added.
(WebCore::EventTrackingRegions::isEmpty):
(WebCore::EventTrackingRegions::trackingTypeForPoint):
(WebCore::operator==):

Source/WebKit2:

* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
(WebKit::dump):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<EventTrackingRegions>::encode):
(IPC::ArgumentCoder<EventTrackingRegions>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::eventTrackingTypeForPoint):
(WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion): Deleted.
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::touchEventTrackingType):
The type is the most restrictive type of all the touch points.
If any touch point needs synchronous tracking, everything has to be synchronous.

(WebKit::WebPageProxy::handleTouchEventSynchronously):
This is a very unfortunate design.

The upper layer dealing with UIKit knows about gesture and when something
can be dispatched asynchrnously because a gesture has started.
This layer knows about tracking and can use that extra inforamtion
to dispatch an event asynchrnously anyway.

In the future, we should refactor this to let WebPageProxy
always decide of the dispatch type. I am just concerned changing
the upper layer while we are stabilizing WebKit.

(WebKit::WebPageProxy::handleTouchEventAsynchronously):
(WebKit::WebPageProxy::handleTouchEvent):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::WebPageProxy): Deleted.
(WebKit::WebPageProxy::shouldStartTrackingTouchEvents): Deleted.
* UIProcess/WebPageProxy.h:

LayoutTests:

* fast/events/touch/ios/tap-with-active-listener-on-elements-expected.txt: Added.
* fast/events/touch/ios/tap-with-active-listener-on-elements.html: Added.
* fast/events/touch/ios/tap-with-active-listener-on-window-expected.txt: Added.
* fast/events/touch/ios/tap-with-active-listener-on-window.html: Added.
* fast/events/touch/ios/tap-with-passive-listener-inside-active-listener-expected.txt: Added.
* fast/events/touch/ios/tap-with-passive-listener-on-elements-expected.txt: Added.
* fast/events/touch/ios/tap-with-passive-listener-on-elements.html: Added.
* fast/events/touch/ios/tap-with-passive-listener-on-window-expected.txt: Added.
* fast/events/touch/ios/tap-with-passive-listener-on-window.html: Added.

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

3 years agoAir.js should have some documentation
fpizlo@apple.com [Sat, 11 Jun 2016 00:48:43 +0000 (00:48 +0000)]
Air.js should have some documentation
https://bugs.webkit.org/show_bug.cgi?id=158648

Reviewed by Keith Miller.

I want to be able to point people at a document if they want to know more about this
benchmark.

* Air.js/README.md: Added.

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

3 years agoREGRESSION(r198177): Cannot paste an image when the pasteboard format is mime type.
enrica@apple.com [Sat, 11 Jun 2016 00:21:16 +0000 (00:21 +0000)]
REGRESSION(r198177): Cannot paste an image when the pasteboard format is mime type.
https://bugs.webkit.org/show_bug.cgi?id=158590
rdar://problem/25471371

Reviewed by Darin Adler.

Source/WebCore:

When creating a fragment from an image resource, the resource needs to
be added to the document loader before setting the src attribute to the
image element, otherwise loading is triggered and the loading fails.
In r198177 the order of the operations was changed causing the bug.
This patch adds support to test the scenario where the image in the pasteboard
is available only as mime type (not WebArchive or RTFD), a situation that occurs
more frequently on iOS.

Test: editing/pasteboard/image-in-iframe.html

* editing/ios/EditorIOS.mm:
(WebCore::Editor::createFragmentForImageResourceAndAddResource):
* editing/mac/EditorMac.mm:
(WebCore::Editor::WebContentReader::readWebArchive):
(WebCore::Editor::WebContentReader::readRTFD):
(WebCore::Editor::WebContentReader::readRTF):
(WebCore::Editor::createFragmentForImageResourceAndAddResource):
* page/Settings.cpp:
(WebCore::Settings::setImagesEnabled):
(WebCore::Settings::setPreferMimeTypeForImages):
(WebCore::Settings::setForcePendingWebGLPolicy):
* page/Settings.h:
(WebCore::Settings::areImagesEnabled):
(WebCore::Settings::preferMimeTypeForImages):
(WebCore::Settings::arePluginsEnabled):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled):
(WebCore::InternalSettings::setPreferMimeTypeForImages):
(WebCore::InternalSettings::setImagesEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests:

* editing/pasteboard/image-in-iframe-expected.txt: Added.
* editing/pasteboard/image-in-iframe.html: Added.

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

3 years agoFix CMake build.
achristensen@apple.com [Sat, 11 Jun 2016 00:20:05 +0000 (00:20 +0000)]
Fix CMake build.

* TestWebKitAPI/PlatformMac.cmake:

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

3 years agoFix WinCairo build after r201943
achristensen@apple.com [Sat, 11 Jun 2016 00:15:11 +0000 (00:15 +0000)]
Fix WinCairo build after r201943

* platform/network/curl/MultipartHandle.cpp:
(WebCore::MultipartHandle::didReceiveResponse):
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::handleLocalReceiveResponse):
(WebCore::headerCallback):
(WebCore::ResourceHandleManager::dispatchSynchronousJob):

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

3 years agoPerformanceTests:
fpizlo@apple.com [Fri, 10 Jun 2016 23:54:33 +0000 (23:54 +0000)]
PerformanceTests:
Rename JSAir to Air.js.

Rubber stamped by Mark Lam.

* Air.js: Copied from PerformanceTests/JSAir.
* Air.js/airjs-tests.yaml: Copied from PerformanceTests/JSAir/jsair-tests.yaml.
* Air.js/benchmark.js: Copied from PerformanceTests/JSAir/benchmark.js.
(Benchmark):
* Air.js/jsair-tests.yaml: Removed.
* Air.js/payload-airjs-ACLj8C.js: Copied from PerformanceTests/JSAir/payload-jsair-ACLj8C.js.
* Air.js/payload-jsair-ACLj8C.js: Removed.
* Air.js/stress-test.js: Copied from PerformanceTests/JSAir/stress-test.js.
* Air.js/test.html: Copied from PerformanceTests/JSAir/test.html.
* Air.js/test.js: Copied from PerformanceTests/JSAir/test.js.
* JSAir: Removed.
* JSAir/all.js: Removed.
* JSAir/allocate_stack.js: Removed.
* JSAir/arg.js: Removed.
* JSAir/basic_block.js: Removed.
* JSAir/benchmark.js: Removed.
* JSAir/code.js: Removed.
* JSAir/custom.js: Removed.
* JSAir/frequented_block.js: Removed.
* JSAir/insertion_set.js: Removed.
* JSAir/inst.js: Removed.
* JSAir/jsair-tests.yaml: Removed.
* JSAir/liveness.js: Removed.
* JSAir/opcode.js: Removed.
* JSAir/payload-gbemu-executeIteration.js: Removed.
* JSAir/payload-imaging-gaussian-blur-gaussianBlur.js: Removed.
* JSAir/payload-jsair-ACLj8C.js: Removed.
* JSAir/payload-typescript-scanIdentifier.js: Removed.
* JSAir/reg.js: Removed.
* JSAir/stack_slot.js: Removed.
* JSAir/stress-test.js: Removed.
* JSAir/strip-hash.rb: Removed.
* JSAir/symbols.js: Removed.
* JSAir/test.html: Removed.
* JSAir/test.js: Removed.
* JSAir/tmp.js: Removed.
* JSAir/tmp_base.js: Removed.
* JSAir/util.js: Removed.

Tools:
Rename JSAir to Air.js

Rubber stamped by Mark Lam.

* Scripts/run-javascriptcore-tests:

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

3 years agoMarking imported/blink/storage/indexeddb/blob-delete-objectstore-db.html as flaky...
ryanhaddad@apple.com [Fri, 10 Jun 2016 23:29:10 +0000 (23:29 +0000)]
Marking imported/blink/storage/indexeddb/blob-delete-objectstore-db.html as flaky on Yosemite Release WK2
https://bugs.webkit.org/show_bug.cgi?id=158639

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoWeb Inspector: heap snapshot comparison view shows nothing if later snapshot is chose...
mattbaker@apple.com [Fri, 10 Jun 2016 23:05:52 +0000 (23:05 +0000)]
Web Inspector: heap snapshot comparison view shows nothing if later snapshot is chosen first
https://bugs.webkit.org/show_bug.cgi?id=158584
<rdar://problem/26727849>

Reviewed by Timothy Hatcher.

ALways compare the the later snapshot to the earlier snapshot,
regardless of selection order.

* UserInterface/Views/HeapAllocationsTimelineView.js:
(WebInspector.HeapAllocationsTimelineView):
(WebInspector.HeapAllocationsTimelineView.prototype._dataGridNodeSelected):
Swap shapshots if the first has a greater identifier than the second.
Drive-by cleanup: null out `_baselineDataGridNode` since it isn't used
after the comparison completes.

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

3 years agoJSC Stress Test failing: jsair-tests.yaml/test.js.ftl-eager-no-cjit
fpizlo@apple.com [Fri, 10 Jun 2016 22:55:01 +0000 (22:55 +0000)]
JSC Stress Test failing: jsair-tests.yaml/test.js.ftl-eager-no-cjit
https://bugs.webkit.org/show_bug.cgi?id=158571

Reviewed by Keith Miller.

PerformanceTests:

Introduce a different harness for run-jsc-stress-tests, which runs for a minimum of 10
iterations and then tries to do any number of "bonus" iterations until it's been running for
two seconds. Since this is the sort of test that isn't really meant to stress anything in
particular, I think it's OK if it is time-limited in this way. The worst case is that some
of its failures will be flaky, but I think that they would have been flaky anyway given the
complexity of the test.

* JSAir/benchmark.js:
(Benchmark):
(Benchmark.prototype.runIteration):
(benchmark): Deleted.
* JSAir/jsair-tests.yaml:
* JSAir/stress-test.js: Added.
(preciseTime):
* JSAir/test.html:
* JSAir/test.js:

Tools:

Unskip the JSAir test.

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

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

3 years agohandleDataURL is only used by curl
achristensen@apple.com [Fri, 10 Jun 2016 22:26:34 +0000 (22:26 +0000)]
handleDataURL is only used by curl
https://bugs.webkit.org/show_bug.cgi?id=158636

Reviewed by Tim Horton.

* CMakeLists.txt:
* platform/network/DataURL.cpp: Removed.
* platform/network/DataURL.h: Removed.
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::ResourceHandleManager::startScheduledJobs):
(WebCore::handleDataURL):
(WebCore::ResourceHandleManager::dispatchSynchronousJob):

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

3 years agoAdd requestExitFullScreen to WKFullScreenWindowController
bdakin@apple.com [Fri, 10 Jun 2016 22:18:04 +0000 (22:18 +0000)]
Add requestExitFullScreen to WKFullScreenWindowController
https://bugs.webkit.org/show_bug.cgi?id=158633
-and corresponding-
rdar://problem/26564036

Reviewed by Tim Horton.

* UIProcess/mac/WKFullScreenWindowController.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController requestExitFullScreen]):

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

3 years agoRe-disable the UserMedia tests which are timing out.
weinig@apple.com [Fri, 10 Jun 2016 22:15:24 +0000 (22:15 +0000)]
Re-disable the UserMedia tests which are timing out.

They used to be accidentally disabled, due to not including
the FeatureDefines correctly, but not we explicitly disable it.

* TestWebKitAPI/Tests/WebKit2/UserMedia.cpp:
(TestWebKitAPI::TEST):

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

3 years agoReduce ResourceResponse copying
achristensen@apple.com [Fri, 10 Jun 2016 22:02:55 +0000 (22:02 +0000)]
Reduce ResourceResponse copying
https://bugs.webkit.org/show_bug.cgi?id=158232

Reviewed by Darin Adler.

Source/WebCore:

No new tests.  No change in behavior except removing an unnecessary copy on cocoa platforms.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didSendData):
(WebCore::ResourceLoader::didReceiveResponse):
* loader/ResourceLoader.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::createResourceHandle):
(WebCore::ApplicationCacheGroup::didReceiveResponse):
* loader/appcache/ApplicationCacheGroup.h:
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::~PlatformMediaResourceClient):
(WebCore::PlatformMediaResourceClient::responseReceived):
(WebCore::PlatformMediaResourceClient::redirectReceived):
(WebCore::PlatformMediaResourceClient::shouldCacheResponse):
(WebCore::PlatformMediaResourceClient::dataSent):
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(ResourceHandleStreamingClient::willSendRequest):
(ResourceHandleStreamingClient::didReceiveResponse):
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::notifyResponseOnSuccess):
(WebCore::BlobResourceHandle::notifyResponseOnError):
(WebCore::BlobResourceHandle::notifyReceiveData):
* platform/network/DataURL.cpp:
(WebCore::handleDataURL):
* platform/network/PingHandle.h:
(WebCore::PingHandle::PingHandle):
* platform/network/ResourceHandleClient.cpp:
(WebCore::ResourceHandleClient::willSendRequestAsync):
(WebCore::ResourceHandleClient::didReceiveResponseAsync):
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didSendData):
(WebCore::ResourceHandleClient::didReceiveResponse):
(WebCore::ResourceHandleClient::didReceiveData):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::ResourceResponseBase):
(WebCore::ResourceResponseBase::includeCertificateInfo):
(WebCore::ResourceResponseBase::suggestedFilename):
(WebCore::ResourceResponseBase::certificateInfo): Deleted.
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::certificateInfo):
(WebCore::ResourceResponseBase::encode):
(WebCore::ResourceResponseBase::decode):
(WebCore::ResourceResponseBase::containsCertificateInfo): Deleted.
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace):
(WebCore::SynchronousLoaderClient::didReceiveResponse):
(WebCore::SynchronousLoaderClient::didReceiveData):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::nextMultipartResponsePartCallback):
(WebCore::sendRequestCallback):

Source/WebKit2:

* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::continueDidReceiveResponse):
(WebKit::NetworkLoad::sharedDidReceiveResponse):
(WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
(WebKit::NetworkLoad::didReceiveChallenge):
(WebKit::NetworkLoad::didReceiveResponseNetworkSession):
(WebKit::NetworkLoad::didReceiveResponseAsync):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::abort):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/PingLoad.h:
* NetworkProcess/cache/NetworkCacheCoders.h:
(WebKit::NetworkCache::Coder<Optional<T>>::encode):
(WebKit::NetworkCache::Coder<Optional<T>>::decode):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTask::didCompleteWithError):
(WebKit::NetworkDataTask::didReceiveResponse):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::url):
(WebKit::WebFrame::certificateInfo):
(WebKit::WebFrame::innerText):

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

3 years agoAdd SPI to disable spellchecking on auto-fillable text fields
rniwa@webkit.org [Fri, 10 Jun 2016 22:00:23 +0000 (22:00 +0000)]
Add SPI to disable spellchecking on auto-fillable text fields
https://bugs.webkit.org/show_bug.cgi?id=158611

Reviewed by Anders Carlsson.

Source/WebCore:

Added a boolean flag m_isSpellCheckingEnabled to HTMLInputElement. This flag defaults to true, and can be set
to false by WebKit2 C API.

* editing/Editor.cpp:
(WebCore::Editor::isSpellCheckingEnabledFor): Fixed a bug that we were calling isSpellCheckingEnabled on
the div inside an input element's shadow tree instead of the input element itself.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement): Initialize m_spellcheckEnabled to true (it's a bit field).
(WebCore::HTMLInputElement::isSpellCheckingEnabled): Added. Return false if m_spellcheckEnabled is false.
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::setSpellcheckEnabled): Added.

Source/WebKit2:

Added WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled to disable spellchecking on a text field.

This is used by WebKit2 client which desires to disable spellchecking and notably autocorrection on
login forms, etc... where such feature would interfere with user's actions.

* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled): Added.
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled): Added.
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:

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

3 years agoIntroduce WTF::UniqueRef
achristensen@apple.com [Fri, 10 Jun 2016 21:26:00 +0000 (21:26 +0000)]
Introduce WTF::UniqueRef
https://bugs.webkit.org/show_bug.cgi?id=158596

Reviewed by Brady Eidson.

Source/WebCore:

No new tests.  No change in behavior.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* loader/EmptyClients.cpp:
(WebCore::fillWithEmptyClients):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::canStartMedia):
(WebCore::Page::editorClient):
(WebCore::Page::plugInClient):
(WebCore::Page::mainFrame):
(WebCore::Page::groupPtr): Deleted.
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

Source/WebKit/win:

* WebView.cpp:
(WebView::initWithFrame):

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldDispatchFakeMouseMoveEvents):

Source/WTF:

WTF::UniqueRef is like a std::unique_ptr that is guaranteed to be non-null.
std::make_unique returns a non-null value that is put into a std::unique_ptr, a type
that could contain null values.  To be able to pass such values around and store them
without wondering if they are null, we now have WTF::UniqueRef which cannot be null.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/UniqueRef.h: Added.
(WTF::makeUniqueRef):
(WTF::UniqueRef::UniqueRef):
(WTF::UniqueRef::get):
(WTF::UniqueRef::operator&):
(WTF::UniqueRef::operator->):

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/UniqueRef.cpp: Added.
(TestWebKitAPI::B::B):
(TestWebKitAPI::C::C):
(TestWebKitAPI::function):
(TestWebKitAPI::TEST):

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

3 years agoAdd an IDB leak test.
beidson@apple.com [Fri, 10 Jun 2016 21:01:55 +0000 (21:01 +0000)]
Add an IDB leak test.
https://bugs.webkit.org/show_bug.cgi?id=158632

Reviewed by Alex Christensen.

* storage/indexeddb/modern/leak-1-expected.txt: Added.
* storage/indexeddb/modern/leak-1.html: Added.
* storage/indexeddb/modern/resources/leak-1.js: Added.

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

3 years agoWeb Inspector: Cleanup InspectorIndexedDBAgent a bit
commit-queue@webkit.org [Fri, 10 Jun 2016 20:59:38 +0000 (20:59 +0000)]
Web Inspector: Cleanup InspectorIndexedDBAgent a bit
https://bugs.webkit.org/show_bug.cgi?id=158598

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-06-10
Reviewed by Darin Adler.

* inspector/InspectorIndexedDBAgent.cpp:

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

3 years agoRefactor TestWebKitAPI to allow just testing WTF
weinig@apple.com [Fri, 10 Jun 2016 20:38:35 +0000 (20:38 +0000)]
Refactor TestWebKitAPI to allow just testing WTF
https://bugs.webkit.org/show_bug.cgi?id=158625

Reviewed by Tim Horton.

Extract all the WTF tests into a new target to allow a faster build / test / fix
cycle when working on WTF bugs and features.

By calling `run-api-tests --wtf-only`, you don't need to have a build of JavaScriptCore/WebCore/etc
to test WTF only changes.

* Scripts/build-api-tests:
* Scripts/run-api-tests:
(buildTestTool):
(testToolPaths):
Add new options to build-api-tests and run-api-tests to only build/run the WTF test runner.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/Configurations/TestWTF.xcconfig: Added.
* TestWebKitAPI/Configurations/TestWTFLibrary.xcconfig: Added.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
Add two new targets, TestWTFLibrary which contains all the WTF tests, and TestWTF,
the test runner that runs the WTF tests.

* TestWebKitAPI/Tests/WTF/RunLoop.cpp:
Use Utilities.h rather than PlatformUtilities.h.

* TestWebKitAPI/Utilities.h: Added.
* TestWebKitAPI/PlatformUtilities.h:
* TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm:
* TestWebKitAPI/cocoa/UtilitiesCocoa.mm: Added.
Move the sleep and run functions into a new Utilities.h/cpp file. This file contains utilities
that don't depend on anything in the WebKit project.

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

3 years agoWeb Inspector: rendering frames timeline "60fps" horizontal guide is mispositioned...
mattbaker@apple.com [Fri, 10 Jun 2016 19:59:20 +0000 (19:59 +0000)]
Web Inspector: rendering frames timeline "60fps" horizontal guide is mispositioned after switching timeline modes
https://bugs.webkit.org/show_bug.cgi?id=158587
<rdar://problem/26728174>

Reviewed by Timothy Hatcher.

When the view mode changes we iterate over all overview graphs, updating
their visibility as needed. Graphs being shown perform layout, even though
the overview's state is in transition: its offset height may still change.

A simple fix is to use TimelineOverviewGraph.height instead of the graph
element's offset height when performing layout.

* UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
(WebInspector.RenderingFrameTimelineOverviewGraph.prototype.layout):

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

3 years agoThe backend should be happy to compile Unreachable even if AI didn't prove it to...
fpizlo@apple.com [Fri, 10 Jun 2016 19:56:18 +0000 (19:56 +0000)]
The backend should be happy to compile Unreachable even if AI didn't prove it to be unreachable
https://bugs.webkit.org/show_bug.cgi?id=158631

Reviewed by Keith Miller.

We've been slowly making the DFG Unreachable opcode behave like a grown-up. When we first
added it, it was a hack for Throw, and we could always rely on AI proving that Unreachable
was not reachable. But then we started using Unreachable as a proper Unreachable opcode,
like Oops in B3 for example, which has a more nuanced meaning: you use it whenever you
emit code that *you* know will not return, and you need some way of terminating the basic
block. The DFG is not a proof-carrying compiler, and it never will be. So, when you have
proved that something is not reachable, you should be able to use Unreachable even if
there is no guarantee that the compiler will later be able to replicate your proof. This
means that the backend may find itself compiling Unreachable because AI did not prove that
it was unreachable.

Prior to this change, we would crash compiling Unreachable because we would rely on AI
preventing us from reaching Unreachable in the backend. But that's silly! We don't want
users of Unreachable to have to also convince AI that their Unreachable is really
Unreachable.

This fixes crashes on real websites. I couldn't work out how to turn them into a reduced
test.

* assembler/AbortReason.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitInvalidationPoint):
(JSC::DFG::SpeculativeJIT::unreachable):
(JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compilePutDynamicVar):
(JSC::FTL::DFG::LowerDFGToB3::compileUnreachable):
(JSC::FTL::DFG::LowerDFGToB3::compareEqObjectOrOtherToObject):

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

3 years agoREGRESSION (r201538): Web Inspector: 1px gap above timeline progress view
mattbaker@apple.com [Fri, 10 Jun 2016 19:42:37 +0000 (19:42 +0000)]
REGRESSION (r201538): Web Inspector: 1px gap above timeline progress view
https://bugs.webkit.org/show_bug.cgi?id=158626

Reviewed by Joseph Pecoraro.

Adjust progress view top position to account for grid border changes.

* UserInterface/Views/TimelineRecordingContentView.css:
(.content-view.timeline-recording > .content-browser .recording-progress):

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

3 years agoWeb Inspector: REGRESSION (r201538): Web Inspector: Border under JS Call Trees conten...
mattbaker@apple.com [Fri, 10 Jun 2016 19:41:46 +0000 (19:41 +0000)]
Web Inspector: REGRESSION (r201538): Web Inspector: Border under JS Call Trees content view is too thick
https://bugs.webkit.org/show_bug.cgi?id=158624
<rdar://problem/26743633>

Reviewed by Joseph Pecoraro.

Remove top border from <th> elements.

* UserInterface/Views/ProfileView.css:
(.profile > .data-grid th): Deleted.

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

3 years agoRemove CommandLine class
andersca@apple.com [Fri, 10 Jun 2016 18:49:57 +0000 (18:49 +0000)]
Remove CommandLine class
https://bugs.webkit.org/show_bug.cgi?id=158628

Reviewed by Tim Horton.

* Shared/CommandLine.h: Removed.
(WebKit::CommandLine::operator[]): Deleted.
* Shared/posix/CommandLinePOSIX.cpp: Removed.
(WebKit::CommandLine::parse): Deleted.
* WebKit2.xcodeproj/project.pbxproj:

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

3 years agoREGRESSION(r201928?) API test WTF.StringOperators failing
beidson@apple.com [Fri, 10 Jun 2016 18:43:11 +0000 (18:43 +0000)]
REGRESSION(r201928?) API test WTF.StringOperators failing
https://bugs.webkit.org/show_bug.cgi?id=158623

Unreviewed, but buddy coded with Alex Christensen.

* TestWebKitAPI/Tests/WTF/CrossThreadTask.cpp:
(TestWebKitAPI::LifetimeLogger::fullName): Only one file in all of TestWebKitAPI is allowed
  to use string concatenation, otherwise the linker will mess up on the symbol related to
  this bizarre WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING macro expansion.

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

3 years ago[GTK] Unreviewed gardening.
clopez@igalia.com [Fri, 10 Jun 2016 18:41:11 +0000 (18:41 +0000)]
[GTK] Unreviewed gardening.

* TestExpectations: shadow-dom tests timeout on the GTK port.
Update the general expectations file to include also Timeout as
an expected failure.
* platform/gtk/TestExpectations: Since r200320 resource-timing feature is a runtime flag and this causes failures.
Remove also one test that has been removed.
* platform/gtk/fast/table/border-collapsing/cached-change-row-border-width-expected.txt: rebaseline after r201234
* platform/gtk/fast/table/border-collapsing/cached-change-tbody-border-width-expected.txt: rebaseline after r201234
* platform/gtk/fast/table/max-width-integer-overflow-expected.txt: rebaseline after r201234

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

3 years agoOrigin header is not included in CORS requests for preloaded cross-origin resources
youenn.fablet@crf.canon.fr [Fri, 10 Jun 2016 18:17:11 +0000 (18:17 +0000)]
Origin header is not included in CORS requests for preloaded cross-origin resources
https://bugs.webkit.org/show_bug.cgi?id=155761
<rdar://problem/25351850>

Reviewed by Alex Christensen.

Source/WebCore:

Making HTML preloader fully aware of crossorigin attribute value.
Introducing CachedResourceRequest::setAsPotentiallyCrossOrigin as a helper routine to activate CORS mode.
Making HTMLLinkElement and HTMLResourcePreloader use that routine.
Making TokenPreloadScanner store the crossorigin attribute value in preload requests.
Making TokenPreloadScanner store the crossorigin attribute value for link elements.

Test: http/tests/security/cross-origin-css-9.html

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::crossOriginModeAllowsCookies):
(WebCore::PreloadRequest::resourceRequest):
* html/parser/HTMLResourcePreloader.h:
(WebCore::PreloadRequest::setCrossOriginMode):
(WebCore::PreloadRequest::PreloadRequest): Deleted.
(WebCore::PreloadRequest::resourceType): Deleted.
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
* loader/cache/CachedResourceRequest.h:

LayoutTests:

* http/tests/security/cross-origin-css-9-expected.txt: Added.
* http/tests/security/cross-origin-css-9.html: Added.
* http/tests/security/resources/get-css-if-origin-header.php: Added.

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

3 years ago[iOS WK2] Rare RELEASE_ASSERT under RemoteLayerTreeDrawingArea::flushLayers()
simon.fraser@apple.com [Fri, 10 Jun 2016 18:01:54 +0000 (18:01 +0000)]
[iOS WK2] Rare RELEASE_ASSERT under RemoteLayerTreeDrawingArea::flushLayers()
https://bugs.webkit.org/show_bug.cgi?id=158622
rdar://problem/26609452

Reviewed by Tim Horton.

It's possible for a CADisplayLink to fire after being paused sometimes, possibly
when an app is running another CADisplayLink whose callback takes some time. When
this happens, RemoteLayerTreeDrawingAreaProxy could erroneously send a second
didUpdate() to the web process between commits, which would clear the m_waitingForBackingStoreSwap
flag too early, and allow a subsequent RemoteLayerTreeDrawingArea::flushLayers()
to proceed when the m_pendingBackingStoreFlusher was still flushing.

Fix by preventing two didUpdates from being sent from the UI process between
commits.

Not easily testable.

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):

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

3 years agoWTF_CrossThreadTask.Basic fails in all non mac ports.
beidson@apple.com [Fri, 10 Jun 2016 17:04:11 +0000 (17:04 +0000)]
WTF_CrossThreadTask.Basic fails in all non mac ports.
https://bugs.webkit.org/show_bug.cgi?id=158612

Reviewed by Alex Christensen.

The test is very sensitive to argument evaluation order which is explicitly undefined in C++.

Instead, we should just count the appropriate events to forget their order.

* TestWebKitAPI/Tests/WTF/CrossThreadTask.cpp:
(TestWebKitAPI::LifetimeLogger::LifetimeLogger):
(TestWebKitAPI::LifetimeLogger::~LifetimeLogger):
(TestWebKitAPI::LifetimeLogger::isolatedCopy):
(TestWebKitAPI::LifetimeLogger::fullName):
(TestWebKitAPI::testFunction):
(TestWebKitAPI::TEST):
(TestWebKitAPI::LifetimeLogger::log): Deleted.
(TestWebKitAPI::LifetimeLogger::takeLogStr): Deleted.

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

3 years agoMarking fast/hidpi/hidpi-3x-device-pixel-ratio.html as failing on ios-simulator
ryanhaddad@apple.com [Fri, 10 Jun 2016 16:45:49 +0000 (16:45 +0000)]
Marking fast/hidpi/hidpi-3x-device-pixel-ratio.html as failing on ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=158618

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

3 years agoErrorEvent / ProgressEvent should be exposed to workers
cdumez@apple.com [Fri, 10 Jun 2016 16:19:44 +0000 (16:19 +0000)]
ErrorEvent / ProgressEvent should be exposed to workers
https://bugs.webkit.org/show_bug.cgi?id=158606

Reviewed by Brady Eidson.

Source/WebCore:

ErrorEvent / ProgressEvent should be exposed to workers:
- https://html.spec.whatwg.org/multipage/webappapis.html#errorevent
- https://xhr.spec.whatwg.org/#interface-progressevent

Firefox and Chrome both already expose those.

No new tests, rebaselined existing test.

* dom/ErrorEvent.idl:
* dom/ProgressEvent.idl:

LayoutTests:

Rebaseline test.

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:

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

3 years agoMessagePort should be exposed to workers
cdumez@apple.com [Fri, 10 Jun 2016 14:47:37 +0000 (14:47 +0000)]
MessagePort should be exposed to workers
https://bugs.webkit.org/show_bug.cgi?id=158607

Reviewed by Brady Eidson.

Source/WebCore:

MessagePort should be exposed to workers:
https://html.spec.whatwg.org/multipage/comms.html#messageport

Firefox and Chrome both already expose it.

No new tests, rebaselined existing test.

* dom/MessagePort.idl:

LayoutTests:

Rebaseline test.

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:

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

3 years agoMove preflight check code outside of DocumentThreadableLoader
youenn.fablet@crf.canon.fr [Fri, 10 Jun 2016 13:26:30 +0000 (13:26 +0000)]
Move preflight check code outside of DocumentThreadableLoader
https://bugs.webkit.org/show_bug.cgi?id=158425

Reviewed by Darin Adler.

Moving preflight check code in its own class.
This allows code to be easier to read, use/reuse and update.

Behavior should be the same as before except in the case of a preflight response
being a 3XX redirect response.
Before this patch, the 3XX response was directly passed to the code processing regular responses.
To keep compatibility with existing tests, a didFailRedirectCheck callback is called.
This should be change to a preflight failure.

Covered by existing tests.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/CrossOriginPreflightChecker.cpp: Added.
(WebCore::CrossOriginPreflightChecker::CrossOriginPreflightChecker):
(WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
(WebCore::CrossOriginPreflightChecker::handleLoadingFailure):
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
(WebCore::CrossOriginPreflightChecker::notifyFinished):
(WebCore::CrossOriginPreflightChecker::startPreflight):
(WebCore::CrossOriginPreflightChecker::doPreflight):
(WebCore::CrossOriginPreflightChecker::redirectReceived):
(WebCore::CrossOriginPreflightChecker::setDefersLoading):
(WebCore::CrossOriginPreflightChecker::isXMLHttpRequest):
* loader/CrossOriginPreflightChecker.h: Added.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::create):
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequestWithPreflight):
(WebCore::DocumentThreadableLoader::setDefersLoading):
(WebCore::DocumentThreadableLoader::clearResource):
(WebCore::DocumentThreadableLoader::didReceiveResponse):
(WebCore::DocumentThreadableLoader::didReceiveData):
(WebCore::DocumentThreadableLoader::notifyFinished):
(WebCore::DocumentThreadableLoader::didFinishLoading):
(WebCore::DocumentThreadableLoader::didFail):
(WebCore::DocumentThreadableLoader::preflightSuccess):
(WebCore::DocumentThreadableLoader::preflightFailure):
(WebCore::DocumentThreadableLoader::loadRequest):
(WebCore::DocumentThreadableLoader::responseReceived): Deleted.
(WebCore::DocumentThreadableLoader::dataReceived): Deleted.
(WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): Deleted.
* loader/DocumentThreadableLoader.h:
(WebCore::DocumentThreadableLoader::options):
(WebCore::DocumentThreadableLoader::isLoading):
(WebCore::DocumentThreadableLoader::document):

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

3 years ago[Threaded Compositor] Content and viewport sizes are mixed
carlosgc@webkit.org [Fri, 10 Jun 2016 12:58:12 +0000 (12:58 +0000)]
[Threaded Compositor] Content and viewport sizes are mixed
https://bugs.webkit.org/show_bug.cgi?id=158564

Reviewed by Žan Doberšek.

Make ThreadedCoordinatedLayerTreeHost::sizeDidChange() update the viewport size for consistency with all other
LayerTreeHost implementations and rename viewportSizeChanged() as contentsSizeChanged() and update the contents
size.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::contentsSizeChanged): Remove ifdefed code here, the drawing area is notified two lines below.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
(WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged): Update the viewport size to the contents size
only when using a fixed layout here instead of in cross-platform code.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged):
(WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
(WebKit::ThreadedCoordinatedLayerTreeHost::viewportSizeChanged): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Call LayerTreeHost::contentsSizeChanged().
(WebKit::DrawingAreaImpl::updateBackingStoreState): Remove ifdefed code for the threadecd compositor since it's
now consistent with all other LayerTreeHost implementations.
* WebProcess/WebPage/LayerTreeHost.h:

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

3 years ago[Threaded Compositor] Make it clear that compositing thread operations are always...
carlosgc@webkit.org [Fri, 10 Jun 2016 12:52:38 +0000 (12:52 +0000)]
[Threaded Compositor] Make it clear that compositing thread operations are always scheduled from the main thread
https://bugs.webkit.org/show_bug.cgi?id=158562

Reviewed by Žan Doberšek.

The code is written as if the compositor thread could also call callOnCompositingRunLoop() which makes the code
confusing. This patch no longer checks if the task was scheduled in the compositing thread, and instead it adds
an ASSERT to ensure it's always called from the main thread as expected. It also adds some more ASSERTS to ensure
and clarify the methods are called from the expected thread.

* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::performTask):
(WebKit::CompositingRunLoop::callOnCompositingRunLoop): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
(WebKit::ThreadedCompositor::setDeviceScaleFactor):
(WebKit::ThreadedCompositor::didChangeViewportSize):
(WebKit::ThreadedCompositor::didChangeViewportAttribute):
(WebKit::ThreadedCompositor::didChangeContentsSize):
(WebKit::ThreadedCompositor::scrollTo):
(WebKit::ThreadedCompositor::scrollBy):
(WebKit::ThreadedCompositor::glContext):
(WebKit::ThreadedCompositor::didChangeVisibleRect):
(WebKit::ThreadedCompositor::renderLayerTree):
(WebKit::ThreadedCompositor::updateSceneState):
(WebKit::ThreadedCompositor::callOnCompositingThread): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:

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

3 years ago[GTK] Browser plugins crash under Wayland
carlosgc@webkit.org [Fri, 10 Jun 2016 12:50:14 +0000 (12:50 +0000)]
[GTK] Browser plugins crash under Wayland
https://bugs.webkit.org/show_bug.cgi?id=157605

Reviewed by Michael Catanzaro.

Fail the initialization of windowed plugins if we don't have a platform implementation.

* WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
(WebKit::NetscapePlugin::platformPostInitialize):

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

3 years agoWebRTC: Imlement MediaEndpointPeerConnection::createAnswer()
adam.bergkvist@ericsson.com [Fri, 10 Jun 2016 09:15:07 +0000 (09:15 +0000)]
WebRTC: Imlement MediaEndpointPeerConnection::createAnswer()
https://bugs.webkit.org/show_bug.cgi?id=158566

Reviewed by Eric Carlson.

Source/WebCore:

Add the MediaEndpointPeerConnection implementation of RTCPeerConnection.createAnswer [1].
createAnswer() creates a 'reply' to an remote offer set with setRemoteDescription(),
completes the offer/answer dialog and brings the RTCPeerConnection back to the 'stable'
signaling state.

[1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#dom-rtcpeerconnection-createanswer

Test: fast/mediastream/RTCPeerConnection-inspect-answer.html

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOfferTask):
Align creation of RTCSessionDescription with createAnswerTask.
(WebCore::MediaEndpointPeerConnection::createAnswer):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
Add Implementation.
* Modules/mediastream/MediaEndpointPeerConnection.h:

LayoutTests:

Add test for RTCPeerConnection.createAnswer.

* fast/mediastream/RTCPeerConnection-inspect-answer-expected.txt: Added.
* fast/mediastream/RTCPeerConnection-inspect-answer.html: Added.
Generate two answers, one with audio only and a second with audio and video, and inspect
the result.
* platform/mac/TestExpectations:
Skip tests for mac that require building with WEB_RTC enabled.

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

3 years ago[css-grid] CRASH when getting the computed style of a grid with only absolutely posit...
svillar@igalia.com [Fri, 10 Jun 2016 07:41:23 +0000 (07:41 +0000)]
[css-grid] CRASH when getting the computed style of a grid with only absolutely positioned children
https://bugs.webkit.org/show_bug.cgi?id=158537

Reviewed by Darin Adler.

Source/WebCore:

Absolute positioning occurs after layout of the grid and its in-flow contents, and does not
contribute to the sizing of any grid tracks or affect the size/configuration of the grid in
any way. This means that we should treat as empty any grid whose only children are
absolutely positioned items.

Since r201510 empty grids are no longer internally represented by a 1x1 matrix. As we were
not considering grids-with-only-absolutely-positioned-children as empty, we were trying to
access some invalid position in the internal representation of the grid triggering an ASSERT
in debug builds and a crash in release.

Test: fast/css-grid-layout/grid-only-abspos-item-computed-style-crash.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridTrackList):

LayoutTests:

* fast/css-grid-layout/grid-only-abspos-item-computed-style-crash-expected.txt: Added.
* fast/css-grid-layout/grid-only-abspos-item-computed-style-crash.html: Added.
* fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt: Adjusted, grid-template
does create explicit tracks so we should return 0px instead of none.
* fast/css-grid-layout/grid-template-shorthand-get-set.html: Ditto.

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

3 years agoDOMException should be exposed to workers
cdumez@apple.com [Fri, 10 Jun 2016 07:37:52 +0000 (07:37 +0000)]
DOMException should be exposed to workers
https://bugs.webkit.org/show_bug.cgi?id=158608

Reviewed by Alex Christensen.

Source/WebCore:

DOMException should be exposed to workers:
https://heycam.github.io/webidl/#es-DOMException-call

Both Firefox and Chrome expose DOMException to workers already.

No new tests, rebaselined existing test.

* dom/DOMCoreException.idl:

LayoutTests:

Rebaseline existing test.

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:

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

3 years agoClean up Visual Studio properties files after switching to CMake.
achristensen@apple.com [Fri, 10 Jun 2016 06:50:34 +0000 (06:50 +0000)]
Clean up Visual Studio properties files after switching to CMake.

* win/tools/WinTools.make: Removed.
* win/tools/vsprops: Removed.
* win/tools/vsprops/FeatureDefines.props: Removed.
* win/tools/vsprops/FeatureDefinesCairo.props: Removed.
* win/tools/vsprops/GStreamer32.props: Removed.
* win/tools/vsprops/GStreamer64.props: Removed.
* win/tools/vsprops/GStreamerCommon.props: Removed.
* win/tools/vsprops/WinCairo.props: Removed.
* win/tools/vsprops/cURL.props: Removed.
* win/tools/vsprops/common.props: Removed.
* win/tools/vsprops/debug.props: Removed.
* win/tools/vsprops/debug_wincairo.props: Removed.
* win/tools/vsprops/debugsuffix.props: Removed.
* win/tools/vsprops/production.props: Removed.
* win/tools/vsprops/release.props: Removed.

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

3 years agoFix CMake build.
achristensen@apple.com [Fri, 10 Jun 2016 06:48:16 +0000 (06:48 +0000)]
Fix CMake build.

* PlatformMac.cmake:

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

3 years agoFix AppleWin build after r201901.
achristensen@apple.com [Fri, 10 Jun 2016 06:36:38 +0000 (06:36 +0000)]
Fix AppleWin build after r201901.
https://bugs.webkit.org/show_bug.cgi?id=119839

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::backingStoreAttached):
(PlatformCALayerWin::userInteractionEnabled):
(PlatformCALayerWin::setUserInteractionEnabled):
(PlatformCALayerWin::geometryFlipped):
* platform/graphics/ca/win/PlatformCALayerWin.h:

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

3 years agoClean up Tools *.vcxproj after switching to CMake.
achristensen@apple.com [Fri, 10 Jun 2016 06:11:26 +0000 (06:11 +0000)]
Clean up Tools *.vcxproj after switching to CMake.

* DumpRenderTree/DumpRenderTree.sln: Removed.
* DumpRenderTree/DumpRenderTree.vcxproj: Removed.
* DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin: Removed.
* DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.def: Removed.
* DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.rc: Removed.
* DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/resource.h: Removed.
* DumpRenderTree/PlatformWin.cmake:
* DumpRenderTree/win/TestNetscapePlugin.def: Copied from DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.def.
* DumpRenderTree/win/TestNetscapePlugin.rc: Copied from DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.rc.
* DumpRenderTree/win/resource.h: Copied from DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/resource.h.
* MiniBrowser/MiniBrowser.vcxproj: Removed.
* MiniBrowser/MiniBrowser.vcxproj/MiniBrowser.ico: Removed.
* MiniBrowser/MiniBrowser.vcxproj/MiniBrowser.rc: Removed.
* MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLib.rc: Removed.
* MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLibResource.h: Removed.
* MiniBrowser/MiniBrowser.vcxproj/MiniBrowserResource.h: Removed.
* MiniBrowser/MiniBrowser.vcxproj/small.ico: Removed.
* MiniBrowser/win/CMakeLists.txt:
* MiniBrowser/win/MiniBrowser.ico: Copied from MiniBrowser/MiniBrowser.vcxproj/MiniBrowser.ico.
* MiniBrowser/win/MiniBrowser.rc: Copied from MiniBrowser/MiniBrowser.vcxproj/MiniBrowser.rc.
* MiniBrowser/win/MiniBrowserLib.rc: Copied from MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLib.rc.
* MiniBrowser/win/MiniBrowserLibResource.h: Copied from MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLibResource.h.
* MiniBrowser/win/MiniBrowserResource.h: Copied from MiniBrowser/MiniBrowser.vcxproj/MiniBrowserResource.h.
* MiniBrowser/win/small.ico: Copied from MiniBrowser/MiniBrowser.vcxproj/small.ico.
* WebKitTestRunner/WebKitTestRunner.sln: Removed.
* win/DLLLauncher/DLLLauncherWinCairo.props: Removed.

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

3 years agoAX: VoiceOver Unable to View Download Progress or Completion Status for Mail Attachments
cfleizach@apple.com [Fri, 10 Jun 2016 06:06:08 +0000 (06:06 +0000)]
AX: VoiceOver Unable to View Download Progress or Completion Status for Mail Attachments
https://bugs.webkit.org/show_bug.cgi?id=158581

Reviewed by Darin Adler.

Source/WebCore:

Update attachment element accessibility so that:
   1) the action name comes first to match UI
   2) on iOS, it has the updates frequently trait

Make sure this test now runs on iOS as well.

Modified tests: accessibility/attachment-element.html

* accessibility/AccessibilityAttachment.cpp:
(WebCore::AccessibilityAttachment::accessibilityText):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
(-[WebAccessibilityObjectWrapper accessibilityTraits]):
(-[WebAccessibilityObjectWrapper accessibilityValue]):
(-[WebAccessibilityObjectWrapper accessibilityIsAttachmentElement]):
(-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):

LayoutTests:

* accessibility/attachment-element-expected.txt:
* accessibility/attachment-element.html:
* accessibility/ios-simulator/attributed-string-for-range-expected.txt:
* platform/ios-simulator/TestExpectations:
* platform/ios-simulator/accessibility/attachment-element-expected.txt: Added.

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

3 years agoClean up JavaScriptCore.vcxproj directory after switching to CMake.
achristensen@apple.com [Fri, 10 Jun 2016 05:53:57 +0000 (05:53 +0000)]
Clean up JavaScriptCore.vcxproj directory after switching to CMake.

* JavaScriptCore.vcxproj/LLInt: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntAssembly: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.make: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.vcxproj: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.pl: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.make: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.vcxproj: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.pl: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractor.vcxproj: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractorCommon.props: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractorDebug.props: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractorProduction.props: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractorRelease.props: Removed.
* JavaScriptCore.vcxproj/jsc: Removed.
* JavaScriptCore.vcxproj/jsc/DLLLauncherMain.cpp: Removed.
* JavaScriptCore.vcxproj/jsc/DLLLauncherWinCairo.props: Removed.
* JavaScriptCore.vcxproj/jsc/jsc.vcxproj: Removed.
* JavaScriptCore.vcxproj/jsc/jsc.vcxproj.filters: Removed.
* JavaScriptCore.vcxproj/jsc/jscCommon.props: Removed.
* JavaScriptCore.vcxproj/jsc/jscDebug.props: Removed.
* JavaScriptCore.vcxproj/jsc/jscLauncher.vcxproj: Removed.
* JavaScriptCore.vcxproj/jsc/jscLauncherPostBuild.cmd: Removed.
* JavaScriptCore.vcxproj/jsc/jscLauncherPreBuild.cmd: Removed.
* JavaScriptCore.vcxproj/jsc/jscLauncherPreLink.cmd: Removed.
* JavaScriptCore.vcxproj/jsc/jscPostBuild.cmd: Removed.
* JavaScriptCore.vcxproj/jsc/jscPreBuild.cmd: Removed.
* JavaScriptCore.vcxproj/jsc/jscPreLink.cmd: Removed.
* JavaScriptCore.vcxproj/jsc/jscProduction.props: Removed.
* JavaScriptCore.vcxproj/jsc/jscRelease.props: Removed.
* JavaScriptCore.vcxproj/testRegExp: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj.filters: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExpCommon.props: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExpDebug.props: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExpLauncher.vcxproj: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExpLauncherPostBuild.cmd: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExpLauncherPreBuild.cmd: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExpLauncherPreLink.cmd: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExpPostBuild.cmd: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExpPreBuild.cmd: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExpPreLink.cmd: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExpProduction.props: Removed.
* JavaScriptCore.vcxproj/testRegExp/testRegExpRelease.props: Removed.
* JavaScriptCore.vcxproj/testapi: Removed.
* JavaScriptCore.vcxproj/testapi/testapi.vcxproj: Removed.
* JavaScriptCore.vcxproj/testapi/testapi.vcxproj.filters: Removed.
* JavaScriptCore.vcxproj/testapi/testapiCommon.props: Removed.
* JavaScriptCore.vcxproj/testapi/testapiCommonCFLite.props: Removed.
* JavaScriptCore.vcxproj/testapi/testapiDebug.props: Removed.
* JavaScriptCore.vcxproj/testapi/testapiDebugCFLite.props: Removed.
* JavaScriptCore.vcxproj/testapi/testapiLauncher.vcxproj: Removed.
* JavaScriptCore.vcxproj/testapi/testapiLauncherPostBuild.cmd: Removed.
* JavaScriptCore.vcxproj/testapi/testapiLauncherPreBuild.cmd: Removed.
* JavaScriptCore.vcxproj/testapi/testapiLauncherPreLink.cmd: Removed.
* JavaScriptCore.vcxproj/testapi/testapiPostBuild.cmd: Removed.
* JavaScriptCore.vcxproj/testapi/testapiPreBuild.cmd: Removed.
* JavaScriptCore.vcxproj/testapi/testapiPreLink.cmd: Removed.
* JavaScriptCore.vcxproj/testapi/testapiProduction.props: Removed.
* JavaScriptCore.vcxproj/testapi/testapiRelease.props: Removed.
* JavaScriptCore.vcxproj/testapi/testapiReleaseCFLite.props: Removed.
* shell/DLLLauncherMain.cpp: Copied from JavaScriptCore.vcxproj/jsc/DLLLauncherMain.cpp.
* shell/PlatformWin.cmake:

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

3 years agoClean up WebCore.vcxproj after switching to CMake.
achristensen@apple.com [Fri, 10 Jun 2016 05:42:28 +0000 (05:42 +0000)]
Clean up WebCore.vcxproj after switching to CMake.

* WebCore.vcxproj/QTMovieWin: Removed.
* WebCore.vcxproj/QTMovieWin/QTMovieWinCairoDebug.props: Removed.
* WebCore.vcxproj/QTMovieWin/QTMovieWinCairoRelease.props: Removed.
* WebCore.vcxproj/QTMovieWin/QTMovieWinCommon.props: Removed.
* WebCore.vcxproj/QTMovieWin/QTMovieWinDebug.props: Removed.
* WebCore.vcxproj/QTMovieWin/QTMovieWinPostBuild.cmd: Removed.
* WebCore.vcxproj/QTMovieWin/QTMovieWinPreBuild.cmd: Removed.
* WebCore.vcxproj/QTMovieWin/QTMovieWinPreLink.cmd: Removed.
* WebCore.vcxproj/QTMovieWin/QTMovieWinProduction.props: Removed.
* WebCore.vcxproj/QTMovieWin/QTMovieWinRelease.props: Removed.
* WebCore.vcxproj/xcopy.excludes: Removed.

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

3 years agoFix Windows build.
achristensen@apple.com [Fri, 10 Jun 2016 05:39:38 +0000 (05:39 +0000)]
Fix Windows build.

* WebKit.resources/resource.h: Removed.
* resource.h: Copied from WebKit.resources/resource.h.

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

3 years agoActually fix Windows build after r201894
achristensen@apple.com [Fri, 10 Jun 2016 05:34:48 +0000 (05:34 +0000)]
Actually fix Windows build after r201894
https://bugs.webkit.org/show_bug.cgi?id=158588

* WebView.cpp:
(WebView::initWithFrame):

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

3 years agoClean up WebKit.vcxproj directory after switching to CMake.
achristensen@apple.com [Fri, 10 Jun 2016 05:33:45 +0000 (05:33 +0000)]
Clean up WebKit.vcxproj directory after switching to CMake.

Source/WebKit:

* PlatformWin.cmake:
* WebKit.vcxproj/Interfaces: Removed.
* WebKit.vcxproj/WebKit: Removed.
* WebKit.vcxproj/WebKit/resource.h: Removed.
* WebKit.vcxproj/WebKitGUID: Removed.
* WebKit.vcxproj/WebKitGUID/WebKitGUID.vcxproj: Removed.
* WebKit.vcxproj/WebKitGUID/WebKitGUID.vcxproj.filters: Removed.
* WebKit.vcxproj/WebKitGUID/WebKitGUIDCommon.props: Removed.
* WebKit.vcxproj/WebKitGUID/WebKitGUIDDebug.props: Removed.
* WebKit.vcxproj/WebKitGUID/WebKitGUIDDebugWinCairo.props: Removed.
* WebKit.vcxproj/WebKitGUID/WebKitGUIDPostBuild.cmd: Removed.
* WebKit.vcxproj/WebKitGUID/WebKitGUIDPreBuild.cmd: Removed.
* WebKit.vcxproj/WebKitGUID/WebKitGUIDProduction.props: Removed.
* WebKit.vcxproj/WebKitGUID/WebKitGUIDRelease.props: Removed.
* WebKit.vcxproj/WebKitGUID/WebKitGUIDReleaseWinCairo.props: Removed.

Source/WebKit/win:

* WebKit.resources/resource.h: Copied from WebKit.vcxproj/WebKit/resource.h.

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

3 years agoHairline borders do not show up on 3x displays.
zalan@apple.com [Fri, 10 Jun 2016 05:27:11 +0000 (05:27 +0000)]
Hairline borders do not show up on 3x displays.
https://bugs.webkit.org/show_bug.cgi?id=158604
<rdar://problem/26511679>

Reviewed by Simon Fraser.

On a 3x display, when we convert a 1/3px hairline border from float
to LayoutUnit and pixel floor the result, we end up with a 0px width border.
It's because float to LayoutUnit is lossy and since the current kFixedPointDenominator % 3 != 0,
flooring LayoutUnit(1/3px) ends up being 0px. (float: 1/3 -> LayoutUnit: (1/3 - 1/kFixedPointDenominator) -> floor: 0)
This patch eliminates the (unnecessary) float -> LayoutUnit - float conversion on border width.

Source/WebCore:

Test: fast/borders/hidpi-3x-input-hairline-border.html

* rendering/BorderEdge.cpp:
(WebCore::BorderEdge::BorderEdge):
* rendering/BorderEdge.h:

LayoutTests:

* fast/borders/hidpi-3x-input-hairline-border-expected-mismatch.html: Added.
* fast/borders/hidpi-3x-input-hairline-border.html: Added.

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

3 years agoUnreviewed, rolling out r201887.
ryanhaddad@apple.com [Fri, 10 Jun 2016 05:24:46 +0000 (05:24 +0000)]
Unreviewed, rolling out r201887.
https://bugs.webkit.org/show_bug.cgi?id=158610

This change caused LayoutTest crashes under GuardMalloc and
ASan (Requested by ryanhaddad on #webkit).

Reverted changeset:

"Deleting a CSSOM style rule invalidates any previously-added
FontFaces"
https://bugs.webkit.org/show_bug.cgi?id=158450
http://trac.webkit.org/changeset/201887

Patch by Commit Queue <commit-queue@webkit.org> on 2016-06-09

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

3 years agoUnreviewed build fix after r201894
achristensen@apple.com [Fri, 10 Jun 2016 05:17:48 +0000 (05:17 +0000)]
Unreviewed build fix after r201894
https://bugs.webkit.org/show_bug.cgi?id=158588

* WebCoreSupport/WebEditorClient.cpp:
(WebEditorClient::~WebEditorClient):
(WebEditorClient::isContinuousSpellCheckingEnabled):
(WebEditorClient::pageDestroyed): Deleted.
* WebCoreSupport/WebEditorClient.h:
* WebView.cpp:
(WebView::initWithFrame):

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

3 years agoAdd testing support for 3x device scale factor.
zalan@apple.com [Fri, 10 Jun 2016 03:31:00 +0000 (03:31 +0000)]
Add testing support for 3x device scale factor.
https://bugs.webkit.org/show_bug.cgi?id=158597

Reviewed by Simon Fraser.

Set 3x device scale factor on the test canvas when the test url is prefixed with hidpi-3x-.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(changeWindowScaleIfNeeded):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::updateWindowScaleForTest):
* WebKitTestRunner/TestOptions.cpp:
(WTR::deviceScaleFactorForTest):
(WTR::TestOptions::TestOptions):
(WTR::isHiDPITestPath): Deleted.
* WebKitTestRunner/TestOptions.h:

LayoutTests:

* fast/hidpi/hidpi-3x-device-pixel-ratio-expected.txt: Added.
* fast/hidpi/hidpi-3x-device-pixel-ratio.html: Added.

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

3 years agoAddress Darin's review comment on r201898.
cdumez@apple.com [Fri, 10 Jun 2016 03:20:01 +0000 (03:20 +0000)]
Address Darin's review comment on r201898.
https://bugs.webkit.org/show_bug.cgi?id=158576

Reviewed by Darin Adler.

* page/Base64Utilities.h:

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

3 years agoREGRESSION(r201823) editing/selection/selection-in-iframe-removed-crash.html is flaky
rniwa@webkit.org [Fri, 10 Jun 2016 02:45:34 +0000 (02:45 +0000)]
REGRESSION(r201823) editing/selection/selection-in-iframe-removed-crash.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=158569

Commit the test fix that was supposed to be landed as a part of r201823,
and remove the flaky test expectation.

* editing/selection/selection-in-iframe-removed-crash.html:
* platform/mac/TestExpectations:

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

3 years ago[iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none;
commit-queue@webkit.org [Fri, 10 Jun 2016 02:06:30 +0000 (02:06 +0000)]
[iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none;
https://bugs.webkit.org/show_bug.cgi?id=119839
<rdar://problem/9671514>

Patch by Antoine Quint <graouts@apple.com> on 2016-06-09
Reviewed by Simon Fraser.

Source/WebCore:

Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off
user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch.

Test: fast/scrolling/ios/touch-scroll-pointer-events-none.html

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::userInteractionEnabled):
(WebCore::GraphicsLayer::setUserInteractionEnabled):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setUserInteractionEnabled):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateUserInteractionEnabled):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::userInteractionEnabled):
(PlatformCALayerCocoa::setUserInteractionEnabled):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterDescendants):

Source/WebKit2:

Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off
user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch.

* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::dumpChangedLayers):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::userInteractionEnabled):
(WebKit::PlatformCALayerRemote::setUserInteractionEnabled):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

LayoutTests:

* fast/scrolling/ios/touch-scroll-pointer-events-none-expected.txt: Added.
* fast/scrolling/ios/touch-scroll-pointer-events-none.html: Added.

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

3 years agoRare failure in stress/v8-deltablue-strict.js.ftl-eager
fpizlo@apple.com [Fri, 10 Jun 2016 02:03:33 +0000 (02:03 +0000)]
Rare failure in stress/v8-deltablue-strict.js.ftl-eager
https://bugs.webkit.org/show_bug.cgi?id=158591

Reviewed by Saam Barati.

This is a simple and sensible fix to an amazing compiler bug that previously only
manifested rarely in the v8-deltablue-strict test. It required on average 1000 runs while
the system was under load for the bug to manifest. Fortunately, the bug is 100% repro with
concurrent JIT disabled in the new "constant-fold-multi-get-by-offset-to-get-by-offset-on-
prototype-and-sink-allocation.js" test.

The problem here is that we were allowing ourselves to be super sloppy with the meaning of
the two children of GetByOffset, and to a lesser extent, PutByOffset. The first two
children of these nodes have these meanings:

child1: the storage from which to load (or to which to store)
child2: the logical object base

Normally, child1 == child2, but child1 may point to a node that vends the storage pointer
in case we are using multiple indirections to get to the property. That's fairly common.

Where this gets nutty is that we don't validate the behavior of child1. Previously, the
DFG::Validate phase would accept code that had child1 point to one object and child2 point
to another object. That's bad because then, analyses will assume that we're loading from
one object while we are actually loading from another. One of the fixes is to make
Validate smarter about this, so that future problems with this get caught sooner.

The actual bug was in ConstantFoldingPhase. When we first wrote ConstantFoldingPhase's
logic for converting GetByIds and MultiGetByOffsets to GetByOffset, we assumed that this
was only for non-prototype loads. This was becuase the logic was originally written based
on a static GetByIdStatus analysis, which does not handle prototypes. So, as a shortcut,
we would convert the GetById (or MultiGetByOffset) to a GetByOffset by doing this
shuffling of children:

child1 got the storage pointer, which might be a new GetButterfly node that we created.
child2 got the old value of child1.

The bug was introduced when I later made it possible for a monomorphic prototype
MultiGetByOffset to be converted to a GetByOffset. Then this algorithm would mean that:

child1 got either a pointer to the prototype or a storage pointer derived from the
    prototype.
child2 got the old value of child1, which was a pointer to the base object (i.e. not the
    prototype).

This happens super rarely because most prototype loads that we can statically reason about
also happen to load constants, so we don't convert to GetByOffset at all. You need the
strange combination of a MultiGetByOffset (not GetById or GetByOffset) on some prototypes
and some static reasoning about the base so that we can convert it to a GetByOffset, but
not enough static reasoning that we can convert it to a constant.

Even if the bad thing happened, then this is not enough for it to cause symptons. If we
did nothing else - like none of the other optimizations succeeded - then this would
be OK because the backend will emit code based on child1, which is right. But disaster
strikes when the code otherwise looks sane enough for ObjectAllocationSinkingPhase to kick
in. This phase operates on child2, as any good phase should: child1 is only interesting
for knowing *how* to load, not *what* we are loading. The phase is right to ignore child1.

So the phase would assume that we are loading the prototype property ("f" in the new test
or "addToGraph" in deltablue) from the sunken base object allocation in the inlined
constructor. The base object has no such property, but the phase conservatively assumes
that it does indeed have such a property. That's just how the phase does things: it is
very abstract and general, so it assumes that the set of properties on an allocation is
the set of properties that accesses to the allocation speak of. Clearly, this GetByOffset
was speaking of the property as being on the allocation. When sinking completed, it would
convert the GetByOffset to the sunken (a.k.a. promoted) property. But nobody stored to
this property on the allocation, so we'd get the bottom value, which is 1927. Why 1927? I
don't remember anymore, but apparently I chose it. It helped here - when I started seeing
that value come up, it took a quick grep to realize that this was the object allocation
sinking phase's bottom value.

The real fix to the bug is to make Node::convertToGetByOffset() take an explicit new base
since its clients will use it to potentially create a load on a different object than the
base of the original operation, as in the relatively new
MultiGetByOffset(prototype)->GetByOffset optimization. As far as I know, the PutByOffset
code did not have the same bug because we don't have any optimizations that turn a PutById
or MultiPutByOffset into a PutByOffset on anything but the base object. But the logical
bug is definitely there: there's code in ConstantFoldingPhase that claims to be able to
convert any node to a PutByOffset on any base, but it actually silently reuses the
original node's child1 as the logical base (i.e. child2). This patch makes all of this
stuff explicit. You can't make this mistake anymore.

* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::emitGetByOffset):
(JSC::DFG::ConstantFoldingPhase::emitPutByOffset):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToGetStack):
(JSC::DFG::Node::convertToGetByOffset):
(JSC::DFG::Node::convertToMultiGetByOffset):
(JSC::DFG::Node::convertToPutByOffset):
* dfg/DFGValidate.cpp:
* tests/stress/constant-fold-multi-get-by-offset-to-get-by-offset-on-prototype-and-sink-allocation.js: Added.
(ThingA):
(ThingB):
(foo):
(bar):
* tests/stress/sink-to-impossible-multi-get-by-offset-on-prototypes.js: Added.
(ThingA):
(ThingB):
(ThingC):
(bar):
(foo):

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

3 years agoWorkerNavigator property should exist on WorkerGlobalScope
cdumez@apple.com [Fri, 10 Jun 2016 01:54:13 +0000 (01:54 +0000)]
WorkerNavigator property should exist on WorkerGlobalScope
https://bugs.webkit.org/show_bug.cgi?id=158574
<rdar://problem/26725108>

Reviewed by Darin Adler.

Source/WebCore:

WorkerNavigator property should exist on WorkerGlobalScope:
https://html.spec.whatwg.org/multipage/workers.html#the-workernavigator-object

Fixing this gets the number of failures on http://w3c-test.org/workers/interfaces.worker
from 34 to 23.

No new tests, rebaselined existing test.

* page/WorkerNavigator.idl:

LayoutTests:

Rebaseline existing test now that WorkerNavigator is exposed to workers.

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:

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

3 years agoatob() / btoa() API should be exposed to workers
cdumez@apple.com [Fri, 10 Jun 2016 01:42:05 +0000 (01:42 +0000)]
atob() / btoa() API should be exposed to workers
https://bugs.webkit.org/show_bug.cgi?id=158576
<rdar://problem/26729340>

Reviewed by Sam Weinig.

Source/WebCore:

Expose atob() / btoa() API to workers as per:
https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope

This aligns our behavior with Firefox and Chrome as well.

Test: fast/workers/atob-btoa.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* page/Base64Utilities.cpp: Added.
(WebCore::Base64Utilities::btoa):
(WebCore::Base64Utilities::atob):
* page/Base64Utilities.h: Added.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::find): Deleted.
(WebCore::DOMWindow::offscreenBuffering): Deleted.
(WebCore::DOMWindow::outerHeight): Deleted.
(WebCore::DOMWindow::outerWidth): Deleted.
* page/DOMWindow.h:
* page/DOMWindow.idl:
* page/WindowBase64.idl: Removed.
* page/WindowOrWorkerGlobalScope.idl: Renamed from Source/WebCore/page/WindowTimers.idl.
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScope.idl:

LayoutTests:

Add test for atob() / btoa() in workers.

* fast/workers/atob-btoa-expected.txt: Added.
* fast/workers/atob-btoa.html: Added.
* fast/workers/resources/worker-atob-btoa.js: Added.

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

3 years agoRemove OriginAndDatabases.cpp, it's unused
andersca@apple.com [Fri, 10 Jun 2016 01:11:47 +0000 (01:11 +0000)]
Remove OriginAndDatabases.cpp, it's unused
https://bugs.webkit.org/show_bug.cgi?id=158595

Reviewed by Sam Weinig.

* CMakeLists.txt:
* Shared/OriginAndDatabases.cpp: Removed.
(WebKit::OriginAndDatabases::encode): Deleted.
(WebKit::OriginAndDatabases::decode): Deleted.
* Shared/OriginAndDatabases.h: Removed.
* WebKit2.xcodeproj/project.pbxproj:

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

3 years agoMake some methods const.
mark.lam@apple.com [Fri, 10 Jun 2016 00:42:19 +0000 (00:42 +0000)]
Make some methods const.
https://bugs.webkit.org/show_bug.cgi?id=158594

Reviewed by Benjamin Poulain.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::columnNumberForBytecodeOffset):
(JSC::CodeBlock::expressionRangeForBytecodeOffset):
* bytecode/CodeBlock.h:
* bytecode/ExpressionRangeInfo.h:
(JSC::ExpressionRangeInfo::encodeFatColumnMode):
(JSC::ExpressionRangeInfo::decodeFatLineMode):
(JSC::ExpressionRangeInfo::decodeFatColumnMode):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::lineNumberForBytecodeOffset):
(JSC::UnlinkedCodeBlock::getLineAndColumn):
(JSC::UnlinkedCodeBlock::expressionRangeForBytecodeOffset):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::createRareDataIfNecessary):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::isOpcode):
(JSC::StackFrame::computeLineAndColumn):
(JSC::StackFrame::toString):
* interpreter/Interpreter.h:
(JSC::StackFrame::isNative):

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

3 years agoRestrict HTTP/0.9 responses to default ports and cancel HTTP/0.9 resource loads if...
bfulgham@apple.com [Fri, 10 Jun 2016 00:21:16 +0000 (00:21 +0000)]
Restrict HTTP/0.9 responses to default ports and cancel HTTP/0.9 resource loads if the document was loaded with another HTTP protocol
https://bugs.webkit.org/show_bug.cgi?id=158589
<rdar://problem/25757454>

Patch by John Wilander <wilander@apple.com> on 2016-06-09
Reviewed by Brent Fulgham.

No new tests. Our layout test environment does not allow for headerless responses
nor does it allow you to set an explicit HTTP/0.9 status header in PHP. I have
manually tested this change with a Python socket setup doing both headerless and
HTTP/0.9 header tests for positive and negative cases.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
    Cancel loads if the request was made to a non-default port.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveResponse):
    Cancel loads if the request was made to a non-default port or if the document
    was loaded with another protocol. Cancelation is handled as a fail so as to
    fire the onerror event and allow sites to handle it gracefully.

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