WebKit.git
2 years agoDate should use historical data if it's available.
keith_miller@apple.com [Fri, 26 May 2017 00:06:44 +0000 (00:06 +0000)]
Date should use historical data if it's available.
https://bugs.webkit.org/show_bug.cgi?id=172592

Reviewed by Mark Lam.

JSTests:

Remove parts of the date tests that rely on the absence of
historical data in Date.

* mozilla/ecma/Date/15.9.5.31-1.js:
(getTestCases):
* mozilla/ecma/Date/15.9.5.35-1.js:
(getTestCases):

Source/WTF:

The spec previously disallowed using historical data for Dates.
This is no longer the case. Additionally, not using historical
data, when available, seems unfortunate for users. This patch
removes the code dropping historical data.

* wtf/DateMath.cpp:
(WTF::calculateLocalTimeOffset):
(WTF::msToMilliseconds): Deleted.

LayoutTests:

Fix tests to work with historically accurate dates.

* js/dom/date-big-setdate-expected.txt: Removed.
* js/dom/date-big-setdate.html: Removed.
* js/dom/script-tests/date-big-setdate.js: Removed.
* storage/indexeddb/modern/date-basic-expected.txt:
* storage/indexeddb/modern/date-basic-private-expected.txt:
* storage/indexeddb/modern/get-keyrange-expected.txt:
* storage/indexeddb/modern/get-keyrange-private-expected.txt:

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

2 years agoThe default setting of Option::criticalGCMemoryThreshold is too high for iOS
msaboff@apple.com [Fri, 26 May 2017 00:03:13 +0000 (00:03 +0000)]
The default setting of Option::criticalGCMemoryThreshold is too high for iOS
https://bugs.webkit.org/show_bug.cgi?id=172617

Reviewed by Mark Lam.

Reducing criticalGCMemoryThreshold to 0.80 eliminated jetsam on iOS devices
when tested running JetStream.

* runtime/Options.h:

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

2 years agobmalloc: scavenger runs too much on JetStream
msaboff@apple.com [Thu, 25 May 2017 23:11:24 +0000 (23:11 +0000)]
bmalloc: scavenger runs too much on JetStream
https://bugs.webkit.org/show_bug.cgi?id=172373

Reviewed by Geoffrey Garen.

Instruments says that JetStream on macOS spends about 3% of its time in
madvise.

In <https://bugs.webkit.org/show_bug.cgi?id=160098>, Ben saw some
evidence that madvise was the reason that switching to bmalloc for
DFG::Node allocations was a slowdown the first time around.

In <https://bugs.webkit.org/show_bug.cgi?id=172124>, Michael saw that
scavening policy can affect JetStream.

Intuitively, it seems wrong for the heap to idle shrink during hardcore
benchmarking.

The strategy here is to back off in response to any heap growth event,
and to wait 2s instead of 0.5s for heap growth to take place -- but we
scavenge immediately in response to critical memory pressure, to avoid
jetsam.

One hole in this strategy is that a workload with a perfectly
unfragmented heap that allocates and deallocates ~16kB every 2s will
never shrink its heap. This doesn't seem to be a problem in practice.

This looks like a 2% - 4% speedup on JetStream on Mac Pro and MacBook Air.

* bmalloc/AsyncTask.h:
(bmalloc::AsyncTask::willRun):
(bmalloc::AsyncTask::willRunSoon):
(bmalloc::Function>::AsyncTask):
(bmalloc::Function>::run):
(bmalloc::Function>::runSoon):
(bmalloc::Function>::threadRunLoop):
(bmalloc::Function>::runSlowCase): Deleted. Added a "run soon" state
so that execution delay is modeled directly instead of implicitly
through sleep events. This enables the Heap to issue a "run now" event
at any moment in response ot memory pressure.

* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap): Don't call into our own API -- that's a layering
violation.

(bmalloc::Heap::updateMemoryInUseParameters): No need for
m_scavengeSleepDuration anymore.

(bmalloc::Heap::concurrentScavenge): Added a back-off policy when the
heap is growing.
(bmalloc::Heap::scavenge):

(bmalloc::Heap::scavengeSmallPages):
(bmalloc::Heap::scavengeLargeObjects): Don't try to give up in the middle
of a scavenge event. Our new backoff policy supplants that design. Also,
it's easier to profile and understand scavenging behavior if it always
runs to completion once started.

(bmalloc::Heap::scheduleScavenger):
(bmalloc::Heap::scheduleScavengerIfUnderMemoryPressure): Added a
synchronous amortized check for memory pressure. This check has the
benefit that it runs immediately during high rates of heap activity,
so we can detect memory pressure right away and wake the scavenger
instead of waiting for the scavenger to wake up.

(bmalloc::Heap::allocateSmallPage):
(bmalloc::Heap::deallocateSmallLine):
(bmalloc::Heap::splitAndAllocate):
(bmalloc::Heap::tryAllocateLarge):
(bmalloc::Heap::shrinkLarge):
(bmalloc::Heap::deallocateLarge):
* bmalloc/Heap.h:
(bmalloc::Heap::isUnderMemoryPressure):
* bmalloc/Sizes.h:
* bmalloc/VMHeap.h:
(bmalloc::VMHeap::deallocateSmallPage):
* bmalloc/bmalloc.h:
(bmalloc::api::scavenge): Updated for API changes above.

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

2 years agoASSERT(m_websiteDataStore->websiteDataStore().sessionID() == m_sessionID) in PageConf...
cdumez@apple.com [Thu, 25 May 2017 22:33:28 +0000 (22:33 +0000)]
ASSERT(m_websiteDataStore->websiteDataStore().sessionID() == m_sessionID) in PageConfiguration::sessionID()
https://bugs.webkit.org/show_bug.cgi?id=172615
<rdar://problem/32277488>

Reviewed by Brady Eidson.

Fix assertion added in r215923 to take into account the fact that the PageConfiguration's sessionID
is SessionID::legacyPrivateSessionID() when private browsing is enabled, instead of being the
WebsiteDataStore's sessionID.

See code in WebProcessPool::createWebPage():
"""
pageConfiguration->setSessionID(pageConfiguration->preferences()->privateBrowsingEnabled() ? SessionID::legacyPrivateSessionID() : m_websiteDataStore->websiteDataStore().sessionID());
"""

* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::sessionID):

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

2 years agoRegression(r215686): Videos sometimes do not load in iBooks
cdumez@apple.com [Thu, 25 May 2017 22:20:14 +0000 (22:20 +0000)]
Regression(r215686): Videos sometimes do not load in iBooks
https://bugs.webkit.org/show_bug.cgi?id=172604
<rdar://problem/32003717>

Reviewed by Geoffrey Garen.

Before r215686, the loop would have a check at the beginning to check if the
dataRequest's currentOffset was greater than the buffer length and would
cause the function to return early.

This check was dropped in r215686, which caused us in some cases to call
finishLoading / stopLoading() after the loop, even though we did not have
enough data in the buffer to satisfy the data request.

To address the issue, we now return early after the loop if remainingLength
is greater than 0, meaning that we could not satisfy the request. This makes
sure we do not call finishLoading / stopLoading() prematurely.

Note that before r215686, the condition of the while loop was
"while (remainingLength)" so the only way to get out of the loop was to:
1. Get remainingLength to 0, in which case we would fall through and
   potentially call finishLoading / stopLoading() after the loop.
2. Fail the "(data->size() <= [dataRequest currentOffset] - responseOffset)"
   check at the beginning of the loop, meaning that we ran out of data in
   the buffer. This would cause us to return from the function, not fall
   through, so we would not call finishLoading / stopLoading().

No new tests, I do not know how to write a test for this.

* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):

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

2 years agoWeb Inspector: Changing the width of a Sidebar when it's collapsed shouldn't trigger...
drousso@apple.com [Thu, 25 May 2017 22:12:05 +0000 (22:12 +0000)]
Web Inspector: Changing the width of a Sidebar when it's collapsed shouldn't trigger a layout
https://bugs.webkit.org/show_bug.cgi?id=172606

Reviewed by Matt Baker.

* UserInterface/Views/Sidebar.js:
(WebInspector.Sidebar.prototype._recalculateWidth):

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

2 years ago[WebIDL] Use the term 'operation' more consistently
weinig@apple.com [Thu, 25 May 2017 21:35:18 +0000 (21:35 +0000)]
[WebIDL] Use the term 'operation' more consistently
https://bugs.webkit.org/show_bug.cgi?id=172601

Reviewed by Chris Dumez.

We were using the term 'operation', a WebIDL term for function-like
constructs, inconsistently in the code generator. Now, when we use
'operation' when referring to the IDL concept (usually the object the
parser produces) and 'function' when referring to code being generated.

Source/WebCore:

* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/IDLParser.pm:
* bindings/scripts/generate-bindings.pl:

Tools:

* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:

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

2 years ago[WK2][iOS] Add a mach-lookup exception for 'com.apple.lsd.mapdb' to Network sandbox
bfulgham@apple.com [Thu, 25 May 2017 21:31:57 +0000 (21:31 +0000)]
[WK2][iOS] Add a mach-lookup exception for 'com.apple.lsd.mapdb' to Network sandbox
https://bugs.webkit.org/show_bug.cgi?id=172465
<rdar://problem/32332836>

Reviewed by Alex Christensen.

Expand sandbox to allow lookup of the mapdb that contains UTI information used
by the Network process.

* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

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

2 years agoUnreviewed build fix after r217447; only run test where JSC's ObjC API is available.
jer.noble@apple.com [Thu, 25 May 2017 21:26:00 +0000 (21:26 +0000)]
Unreviewed build fix after r217447; only run test where JSC's ObjC API is available.

* TestWebKitAPI/Tests/mac/MediaPlaybackSleepAssertion.mm:

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

2 years agoSyncing script shouldn't schedule a build request when there is a build from another...
rniwa@webkit.org [Thu, 25 May 2017 21:10:09 +0000 (21:10 +0000)]
Syncing script shouldn't schedule a build request when there is a build from another test group in progress
https://bugs.webkit.org/show_bug.cgi?id=172577
<rdar://problem/32395049>

Reviewed by Chris Dumez.

When a buildbot master gets restarted while there is an in-progress build and a pending build, the master will
re-schedule the currently running build, and this can result in multiple build requests from different test
groups being scheduled simultaneously.

sync-buildbot.js was supposed to recover from this state by only processing build requests from one test group
at a time and eventually come back to a state where only a single test group is running per buildbot slave.

We had a test for this particular case but it wasn't testing what it claimed to test. Rewriten the test case
and fixed the bug by explicitly checking this condition and treating it as if there is a pending build already
scheduled in the builder in this case.

* public/api/test-groups.php:
(main): Fixed a regression from r217397. Return the platform ID of the first request when none of the requets
have been processed yet or all of them had failed.
* server-tests/tools-buildbot-triggerable-tests.js: Rewritten a test case intended to cover this bug.
(.assertRequestAndResolve): Added.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Fixed the bug. Avoid scheduling a new request on
this syncer if there is a build in progress for a test group different from that of the new request. Reuse the
code we had to deal with a pending build for this purpose.

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

2 years agoSystem sleeps while playing to wireless target, ending stream.
jer.noble@apple.com [Thu, 25 May 2017 21:05:26 +0000 (21:05 +0000)]
System sleeps while playing to wireless target, ending stream.
https://bugs.webkit.org/show_bug.cgi?id=172541

Reviewed by Eric Carlson.

Source/WebCore:

API test: Tests/mac/MediaPlaybackSleepAssertion.mm

Keep the system from sleeping (but allow the display to sleep) while playing media to a wireless target.

Give the SleepDisabler a Type, either System or Display, which indicates what kind of sleep to disable.
Update HTMLMediaElement::shouldDisableSleep() to differentiate between a video which is playing locally,
one that is playing but not visible, and one that is playing remotely.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
(WebCore::HTMLMediaElement::updateSleepDisabling):
(WebCore::HTMLMediaElement::shouldDisableSleep):
* html/HTMLMediaElement.h:
* platform/SleepDisabler.cpp:
(WebCore::SleepDisabler::create):
(WebCore::SleepDisabler::SleepDisabler):
* platform/SleepDisabler.h:
(WebCore::SleepDisabler::type):
* platform/cocoa/SleepDisablerCocoa.cpp:
(WebCore::SleepDisabler::create):
(WebCore::SleepDisablerCocoa::SleepDisablerCocoa):
(WebCore::SleepDisablerCocoa::~SleepDisablerCocoa):
* platform/cocoa/SleepDisablerCocoa.h:
* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController updatePowerAssertions]):
* platform/spi/cocoa/IOPMLibSPI.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/MediaPlaybackSleepAssertion.html: Added.
* TestWebKitAPI/Tests/mac/MediaPlaybackSleepAssertion.mm: Added.
(-[MediaPlaybackSleepAssertionLoadDelegate webView:didCreateJavaScriptContext:forFrame:]):
(-[MediaPlaybackSleepAssertionPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):
(TestWebKitAPI::simulateKeyDown):
(TestWebKitAPI::hasAssertionType):
(TestWebKitAPI::TEST):

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

2 years agoUnreviewed, rolling out r217423 and r217424.
jlewis3@apple.com [Thu, 25 May 2017 20:58:34 +0000 (20:58 +0000)]
Unreviewed, rolling out r217423 and r217424.
https://bugs.webkit.org/show_bug.cgi?id=172607

These caused an api failure on all testers. (Requested by
mlewis13 on #webkit).

Reverted changesets:

"REGRESSION (r216977): 4 leaks introduced in new
WebKit2_WKHTTPCookieStoreWithoutProcessPool_Test"
https://bugs.webkit.org/show_bug.cgi?id=172558
http://trac.webkit.org/changeset/217423

"REGRESSION (r217423): Fix last-second typo in 'auto'"
http://trac.webkit.org/changeset/217424

Patch by Commit Queue <commit-queue@webkit.org> on 2017-05-25

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

2 years agoDocumentThreadableLoader::redirectReceived() should not rely on the resource's loader
cdumez@apple.com [Thu, 25 May 2017 20:53:49 +0000 (20:53 +0000)]
DocumentThreadableLoader::redirectReceived() should not rely on the resource's loader
https://bugs.webkit.org/show_bug.cgi?id=172578
<rdar://problem/30754582>

Reviewed by Youenn Fablet.

Source/WebCore:

DocumentThreadableLoader::redirectReceived() should not rely on the resource's loader. The rest of the methods do not.
It is unsafe for it to rely on the resource's loader because it gets cleared when the load completes. A CachedRawresource
may be reused from the memory cache once its load has completed.

This would cause crashes in CachedRawResource::didAddClient() when replaying the redirects because it would call
DocumentThreadableLoader::redirectReceived() and potentially not have a loader anymore. To hit this exact code path,
you would need to make repeated XHR to a cacheable simple cross-origin resource that has cacheable redirect.

Test: http/tests/xmlhttprequest/cacheable-cross-origin-redirect-crash.html

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):
* loader/DocumentThreadableLoader.h:

LayoutTests:

Add layout test coverage.

* http/tests/xmlhttprequest/cacheable-cross-origin-redirect-crash-expected.txt: Added.
* http/tests/xmlhttprequest/cacheable-cross-origin-redirect-crash.html: Added.

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

2 years agocom.apple.coremedia.videoencoder XPC service should be allowed by WebProcess sandbox
commit-queue@webkit.org [Thu, 25 May 2017 20:22:51 +0000 (20:22 +0000)]
com.apple.coremedia.videoencoder XPC service should be allowed by WebProcess sandbox
https://bugs.webkit.org/show_bug.cgi?id=172599

Patch by Youenn Fablet <youenn@apple.com> on 2017-05-25
Reviewed by Alex Christensen.

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

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

2 years agoVersioning.
matthew_hanson@apple.com [Thu, 25 May 2017 20:07:19 +0000 (20:07 +0000)]
Versioning.

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

2 years ago[iOS WK2] Avoid setting contentsScale and rasterizationScale on CATransformLayers
simon.fraser@apple.com [Thu, 25 May 2017 19:34:38 +0000 (19:34 +0000)]
[iOS WK2] Avoid setting contentsScale and rasterizationScale on CATransformLayers
https://bugs.webkit.org/show_bug.cgi?id=172569

Reviewed by Dean Jackson.

Setting contentsScale and rasterizationScale on CATransformLayers is a waste of CPU time,
and triggers unwanted logging, so don't do it.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::PlatformCALayerRemote):

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

2 years agoASSERTION FAILED: !needsStyleRecalc() || !document().childNeedsStyleRecalc()
zalan@apple.com [Thu, 25 May 2017 19:22:20 +0000 (19:22 +0000)]
ASSERTION FAILED: !needsStyleRecalc() || !document().childNeedsStyleRecalc()
https://bugs.webkit.org/show_bug.cgi?id=172576
<rdar://problem/32181979>

Reviewed by Brent Fulgham.

Ensure that we clean the subframe's document before start searching for a focusable element.

Covered by existing test.

* page/FocusController.cpp:
(WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):

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

2 years agoCrash on WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance + 1195
jiewen_tan@apple.com [Thu, 25 May 2017 18:50:34 +0000 (18:50 +0000)]
Crash on WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance + 1195
https://bugs.webkit.org/show_bug.cgi?id=172555
<rdar://problem/32004724>

Reviewed by Ryosuke Niwa.

Source/WebCore:

setSelectionWithoutUpdatingAppearance could dispatch a synchronous focusin event,
which could invoke an event handler that deteles the frame. Therefore, add a
protector before the call.

Test: editing/selection/select-iframe-focusin-document-crash.html

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelection):

LayoutTests:

* editing/selection/resources/select-iframe-focusin-document-crash-frame.html: Added.
* editing/selection/select-iframe-focusin-document-crash-expected.txt: Added.
* editing/selection/select-iframe-focusin-document-crash.html: Added.

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

2 years agoOur for-in optimization in the bytecode generator does its static analysis incorrectly
sbarati@apple.com [Thu, 25 May 2017 18:47:38 +0000 (18:47 +0000)]
Our for-in optimization in the bytecode generator does its static analysis incorrectly
https://bugs.webkit.org/show_bug.cgi?id=172532
<rdar://problem/32369452>

Reviewed by Mark Lam.

JSTests:

* stress/for-in-invalidation-for-any-write.js: Added.
(assert):
(test):
(test.i):

Source/JavaScriptCore:

Our static analysis for when a for-in induction variable
is written to tried to its analysis as we generate
bytecode. This has issues, since it does not account for
the dynamic execution path of the program. Let's consider
a program where our old analysis worked:

```
for (let p in o) {
    o[p]; // We can transform this into a fast get_direct_pname
    p = 20;
    o[p]; // We cannot transform this since p has been changed.
}
```

However, our static analysis did not account for loops, which exist
in JavaScript. e.g, it would incorrectly compile this program as:
```
for (let p in o) {
    for (let i = 0; i < 20; ++i) {
        o[p]; // It transforms this to use get_direct_pname even though p will be over-written if we get here from the inner loop back edge!
        p = 20;
        o[p]; // We correctly do not transform this.
    }
}
```

Because of this flaw, I've made the optimization more conservative.
We now optimistically emit code for the optimized access. However,
if a for-in context is *ever* invalidated, before we pop it off
the stack, we rewrite the program's optimized accesses to no longer
be optimized. To do this, each context keeps track of its optimized
accesses.

This patch also adds a new bytecode, op_nop, which is just a no-op.
It was helpful to add this because reverting get_direct_pname to get_by_val
will leave us with an extra instruction word because get_direct_pname is
has a length of 7 where get_by_val has a length of 6. This leaves us with
an extra slot that we fill with an op_nop.

* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitGetByVal):
(JSC::BytecodeGenerator::popIndexedForInScope):
(JSC::BytecodeGenerator::popStructureForInScope):
(JSC::BytecodeGenerator::invalidateForInContextForLocal):
(JSC::StructureForInContext::pop):
(JSC::IndexedForInContext::pop):
* bytecompiler/BytecodeGenerator.h:
(JSC::StructureForInContext::addGetInst):
(JSC::IndexedForInContext::addGetInst):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_nop):
* llint/LowLevelInterpreter.asm:

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

2 years agoEnsure ImageFrameCache does not access its BitmapImage after it is deleted
commit-queue@webkit.org [Thu, 25 May 2017 18:22:48 +0000 (18:22 +0000)]
Ensure ImageFrameCache does not access its BitmapImage after it is deleted
https://bugs.webkit.org/show_bug.cgi?id=172563

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-05-25
Reviewed by Simon Fraser.

A crash may happen if the BitmapImage is deleted while the decoding thread
is still active. Once the current frame finishes decoding, the decoding
thread will make a callOnMainThread() which will access the deleted BitmapImage.

We need to ensure if BitmapImage is deleted, the raw pointer which references
it in ImageFrameCache is cleared. If this is done, nothing else is needed.
All all the accesses to container BitmapImage in ImageFrameCache are guarded
by checking m_image is not null.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::~BitmapImage): Make sure the decoding thread will
not have access to the deleted BitmapImage when it finishes decoding and
make its callOnMainThread().
(WebCore::BitmapImage::destroyDecodedData): Use the function new name.
(WebCore::BitmapImage::internalStartAnimation): Ditto.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::startAsyncDecodingQueue): Protect the sourceURL
for the decoding thread. ImageFrameCache::sourceURL() checks for the value
of m_image which now may change from the main thread.
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::clearImage): Add a new function to clear the
raw pointer m_image when its is deleted.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::resetData): Rename clear() to resetData() for better
code readability. This function deletes the ImageDecoder and creates a new
one if data is not null. The purpose is to delete the decoder raster data.
(WebCore::ImageSource::clear): Deleted.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::clearImage): Wrapper for the ImageFrameCache function.

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

2 years agoAdd some release logging for media elements
commit-queue@webkit.org [Thu, 25 May 2017 17:49:56 +0000 (17:49 +0000)]
Add some release logging for media elements
https://bugs.webkit.org/show_bug.cgi?id=172581

Patch by youenn fablet <youenn@apple.com> on 2017-05-25
Reviewed by Eric Carlson.

No change of behavior.

 Adding logging for getUserMedia, video autoplay and incoming/outgoing webrtc video tracks.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow):
(WebCore::UserMediaRequest::deny):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted):
* platform/Logging.h:
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::OnFrame):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:

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

2 years ago[css-align] Fixed errors in the CSS parsing tests of the "place-XXX" shorthands
jfernandez@igalia.com [Thu, 25 May 2017 17:40:49 +0000 (17:40 +0000)]
[css-align] Fixed errors in the CSS parsing tests of the "place-XXX" shorthands
https://bugs.webkit.org/show_bug.cgi?id=172593

Reviewed by Manuel Rego Casasnovas.

* css3/parse-place-content.html:
* css3/parse-place-items.html:
* css3/parse-place-self.html:

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

2 years ago[CMake][Win] Use WTF_CPU not MSCV_CXX_ARCHITECTURE_ID when determining lib directories
commit-queue@webkit.org [Thu, 25 May 2017 17:40:14 +0000 (17:40 +0000)]
[CMake][Win] Use WTF_CPU not MSCV_CXX_ARCHITECTURE_ID when determining lib directories
https://bugs.webkit.org/show_bug.cgi?id=172570

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-05-25
Reviewed by Per Arne Vollan.

* Source/cmake/OptionsWin.cmake:

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

2 years ago[WebIDL] Do a pass of cleanup in the bindings generator
weinig@apple.com [Thu, 25 May 2017 17:39:57 +0000 (17:39 +0000)]
[WebIDL] Do a pass of cleanup in the bindings generator
https://bugs.webkit.org/show_bug.cgi?id=172566

Reviewed by Chris Dumez.

- Split JSDOMBindingCaller.h into four new files to allow for less
  header inclusion (one includes a bunch of promise stuff that usually
  isn't needed):
    - JSDOMCastedThisErrorBehavior (with shared casting enum)
    - JSDOMAttribute (for attribute getting / setting)
    - JSDOMOperation (for normal operations)
    - JSDOMOperationReturningPromise (for operations returning promises, obviously).

  In addition to separating the files, rename to be more consistent with modern
  bindings conventions (new classes are IDLAttribute, IDLOperation, and
  IDLOperationReturningPromise) and simplify function names
    - 'callOperation' becomes 'call'
    - 'attribute' becomes 'get'
    - 'setAttribute' becomes 'set'

- Remove extra generated trampoline function for operations returning promises
  by making JSDOMOperationReturningPromise handle all the promise related overhead.

- Make [Custom] operations returning promises go through the normal IDLOperationReturningPromise
  code path (simplifying JSReadableStreamSource and JSSubtleCrypto). Added [ReturnsOwnPromise]
  extended attribute to allow some functions that want to retain specialized behavior to do so

- Swap order of trampoline and implementation of operation, to avoid the need for
  a forward declaration and make reading more straightforward.

* WebCore.xcodeproj/project.pbxproj:
Add / remove files.

* bindings/js/JSDOMBindingCaller.h: Removed.

* bindings/js/JSDOMCastedThisErrorBehavior.h: Added.
Shared header for enum needed by JSDOMAttribute, JSDOMOperation and JSDOMOperationReturningPromise.

* bindings/js/JSDOMAttribute.h: Added.
* bindings/js/JSDOMOperation.h: Added.
* bindings/js/JSDOMOperationReturningPromise.h: Added.
Split out JSDOMBindingCaller implementations into own classes / files. Simplify
naming.

* bindings/js/JSDOMPromiseDeferred.h:
(WebCore::callPromiseFunction):
Add a variant of callPromiseFunction that takes a lambda.

* bindings/js/JSEventTargetCustom.h:
(WebCore::IDLOperation<JSEventTarget>::call):
Update operation specialization to use new class.

* bindings/js/JSReadableStreamSourceCustom.cpp:
* bindings/js/JSSubtleCryptoCustom.cpp:
Simplify now that the callPromiseFunction is called for us.

* crypto/WebKitSubtleCrypto.idl:
* css/FontFace.idl:
* dom/CustomElementRegistry.idl:
Add [ReturnsOwnPromise] to retain custom promise behavior.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
Update header generation to account for custom functions that return promises now
having a Ref<DeferredPromise>&& parameter.

(GenerateImplementation):
- Update for new naming of cast functions.
- Use AddToImplIncludes (and pass in conditional) rather than using $implIncludes
  directly, #includes to be grouped correctly.
- Remove dead $inAppleCopyright code (it was moved to GenerateOperationDefinition
  earlier).

(GenerateOperationDefinition):
- Use $codeGenerator->IsPromiseType() rather than directly comparing to "Promise" string.
- Restructure code to allow trampoline (the code that calls IDLOperation) to come after
  the main operation implementation (the part that calls into the impl).
- Support custom functions returning promises (and the [ReturnsOwnPromise] variant).

(GenerateImplementationIterableFunctions):
Update for name change to IDLOperation.

* bindings/scripts/IDLAttributes.json:
Add [ReturnsOwnPromise].

* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results.

* bindings/scripts/test/TestObj.idl:
Add additional test cases for operations returning promises.

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

2 years ago[Win] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key)
utatane.tea@gmail.com [Thu, 25 May 2017 17:18:57 +0000 (17:18 +0000)]
[Win] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key)
https://bugs.webkit.org/show_bug.cgi?id=172586

Reviewed by Brent Fulgham.

In ThreadHolder for Windows, we need to construct HashMap<ThreadIdentifier, ThreadHolder*>.
The problem is that ThreadHolder::platformInitialize touches Thread::id() even before Thread
is not established. In that case, id() returns incorrect value.

But, calling ThreadHolder::initialize() after waiting for completion of Thread::establish() is
not a good idea. Since we already have NewThreadContext->creationMutex, we can wait for completion
of Thread::establish() easily. However, if we do so, Thread::create() returns RefPtr<Thread> that
may not call ThreadHolder::initialize() in its thread yet. In that case, ThreadHolder::get() fails.
Thus, Windows WTF::waitForThreadCompletion implementation becomes broken. We can add a new mutex
to wait for completion of ThreadHolder::initialize in the creator of the thread (like a ping-pong!).
But it overly complicates the implementation.

The following is overly complicated initialization phase.

Creator -> AC mutex(1) -------> establishment -> RL mutex(1) ----------------------> AC mutex(2) ->

                       Thread -----------------> AC mutex(1) -> ThreadHolder init -> RL mutex(2) ->

So, instead, in this patch, we just use Thread::currentID(). When calling ThreadHolder::initialize(),
we pass ThreadIdentifier by using Thread::currentID(). This implementation works great because,

1. ThreadHolder::initialize requires ThreadIdentifier only in Windows environment because Pthread
   ThreadHolder does not create HashMap<>. And this is used for obsolete Threading APIs. Thus this
   hack will be removed in the near future.

2. In Windows, Thread::currentID() can return a valid value without using ThreadHolder. And it does
   not require Thread establishment. So, calling currentID() to initialize ThreadHolder is ok in
   Windows.

* wtf/ThreadHolder.cpp:
(WTF::ThreadHolder::initialize): Deleted.
* wtf/ThreadHolder.h:
* wtf/ThreadHolderPthreads.cpp:
(WTF::ThreadHolder::initialize):
* wtf/ThreadHolderWin.cpp:
(WTF::ThreadHolder::initialize):
(WTF::ThreadHolder::platformInitialize): Deleted.
* wtf/ThreadingWin.cpp:
(WTF::wtfThreadEntryPoint):

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

2 years agoClang warns about (intended) returning pointer to stack location in WTF/wtf/Threading...
aperez@igalia.com [Thu, 25 May 2017 17:07:15 +0000 (17:07 +0000)]
Clang warns about (intended) returning pointer to stack location in WTF/wtf/ThreadingPthreads.cpp
https://bugs.webkit.org/show_bug.cgi?id=172595

Reviewed by Mark Lam.

* wtf/ThreadingPthreads.cpp: Use a #pragma to silence Clang warning about returning a
pointer to the stack (which is intended)

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

2 years agoUnreviewed, rolling out r217409.
jlewis3@apple.com [Thu, 25 May 2017 17:06:40 +0000 (17:06 +0000)]
Unreviewed, rolling out r217409.

The revision caused api failures

Reverted changeset:

"_WKUserStyleSheet leaks string data"
https://bugs.webkit.org/show_bug.cgi?id=172583
http://trac.webkit.org/changeset/217409

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

2 years agoObjectToStringAdaptiveInferredPropertyValueWatchpoint should not reinstall itself...
mark.lam@apple.com [Thu, 25 May 2017 17:03:13 +0000 (17:03 +0000)]
ObjectToStringAdaptiveInferredPropertyValueWatchpoint should not reinstall itself nor handleFire if it's dying shortly.
https://bugs.webkit.org/show_bug.cgi?id=172548
<rdar://problem/31458393>

Reviewed by Filip Pizlo.

JSTests:

* stress/regress-172548.patch: Added.

Source/JavaScriptCore:

Consider the following scenario:

1. A ObjectToStringAdaptiveInferredPropertyValueWatchpoint O1, watches for
   structure transitions, e.g. structure S2 transitioning to structure S3.
   In this case, O1 would be installed in S2's watchpoint set.
2. When the structure transition happens, structure S2 will fire watchpoint O1.
3. O1's handler will normally re-install itself in the watchpoint set of the new
   "transitioned to" structure S3.
4. "Installation" here requires writing into the StructureRareData SD3 of the new
   structure S3.  If SD3 does not exist yet, the installation process will trigger
   the allocation of StructureRareData SD3.
5. It is possible that the Structure S1, and StructureRareData SD1 that owns the
   ObjectToStringAdaptiveInferredPropertyValueWatchpoint O1 is no longer reachable
   by the GC, and therefore will be collected soon.
6. The allocation of SD3 in (4) may trigger the sweeping of the StructureRareData
   SD1.  This, in turn, triggers the deletion of the
   ObjectToStringAdaptiveInferredPropertyValueWatchpoint O1.

After O1 is deleted in (6) and SD3 is allocated in (4), execution continues in
AdaptiveInferredPropertyValueWatchpointBase::fire() where O1 gets installed in
structure S3's watchpoint set.  This is obviously incorrect because O1 is already
deleted.  The result is that badness happens later when S3's watchpoint set fires
its watchpoints and accesses the deleted O1.

The fix is to enhance AdaptiveInferredPropertyValueWatchpointBase::fire() to
check if "this" is still valid before proceeding to re-install itself or to
invoke its handleFire() method.

ObjectToStringAdaptiveInferredPropertyValueWatchpoint (which extends
AdaptiveInferredPropertyValueWatchpointBase) will override its isValid() method,
and return false its owner StructureRareData is no longer reachable by the GC.
This ensures that it won't be deleted while it's installed to any watchpoint set.

Additional considerations and notes:
1. In the above, I talked about the ObjectToStringAdaptiveInferredPropertyValueWatchpoint
   being installed in watchpoint sets.  What actually happens is that
   ObjectToStringAdaptiveInferredPropertyValueWatchpoint has 2 members
   (m_structureWatchpoint and m_propertyWatchpoint) which may be installed in
   watchpoint sets.  The ObjectToStringAdaptiveInferredPropertyValueWatchpoint is
   not itself a Watchpoint object.

   But for brevity, in the above, I refer to the ObjectToStringAdaptiveInferredPropertyValueWatchpoint
   instead of its Watchpoint members.  The description of the issue is still
   accurate given the life-cycle of the Watchpoint members are embedded in the
   enclosing ObjectToStringAdaptiveInferredPropertyValueWatchpoint object, and
   hence, they share the same life-cycle.

2. The top of AdaptiveInferredPropertyValueWatchpointBase::fire() removes its
   m_structureWatchpoint and m_propertyWatchpoint if they have been added to any
   watchpoint sets.  This is safe to do even if the owner StructureRareData is no
   longer reachable by the GC.

   This is because the only way we can get to AdaptiveInferredPropertyValueWatchpointBase::fire()
   is if its Watchpoint members are still installed in some watchpoint set that
   fired.  This means that the AdaptiveInferredPropertyValueWatchpointBase
   instance has not been deleted yet, because its destructor will automatically
   remove the Watchpoint members from any watchpoint sets.

* bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp:
(JSC::AdaptiveInferredPropertyValueWatchpointBase::fire):
(JSC::AdaptiveInferredPropertyValueWatchpointBase::isValid):
* bytecode/AdaptiveInferredPropertyValueWatchpointBase.h:
* heap/FreeList.cpp:
(JSC::FreeList::contains):
* heap/FreeList.h:
* heap/HeapCell.h:
* heap/HeapCellInlines.h:
(JSC::HeapCell::isLive):
* heap/MarkedAllocator.h:
(JSC::MarkedAllocator::isFreeListedCell):
* heap/MarkedBlock.h:
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::isFreeListedCell):
* runtime/StructureRareData.cpp:
(JSC::ObjectToStringAdaptiveInferredPropertyValueWatchpoint::isValid):

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

2 years ago[ATK] Expose doc-footnote ARIA role with ATK_ROLE_FOOTNOTE
csaavedra@igalia.com [Thu, 25 May 2017 16:55:38 +0000 (16:55 +0000)]
[ATK] Expose doc-footnote ARIA role with ATK_ROLE_FOOTNOTE
https://bugs.webkit.org/show_bug.cgi?id=172355

Patch by Joanmarie Diggs <jdiggs@igalia.com> on 2017-05-25
Reviewed by Chris Fleizach.

* accessibility/gtk/xml-roles-exposed-expected.txt: Updated.
* platform/gtk/accessibility/roles-exposed-expected.txt: Updated.

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

2 years agoSome <chrono> and ProgressTracker cleanup
simon.fraser@apple.com [Thu, 25 May 2017 16:54:18 +0000 (16:54 +0000)]
Some <chrono> and ProgressTracker cleanup
https://bugs.webkit.org/show_bug.cgi?id=172582

Reviewed by Sam Weinig.

Remove some unnecessary <chrono> includes.
Convert some std::chrono to use MonotonicTime/Seconds.
Clean up ProgressTracker.
Some #pragma once.

* dom/Document.h:
* loader/ProgressTracker.cpp:
(WebCore::ProgressTracker::ProgressTracker):
(WebCore::ProgressTracker::reset):
(WebCore::ProgressTracker::progressStarted):
(WebCore::ProgressTracker::finalProgressComplete):
(WebCore::ProgressTracker::incrementProgress):
* loader/ProgressTracker.h:
* page/Settings.h:
* platform/SearchPopupMenu.h:
* platform/Timer.h:
* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::IOSurfacePool::markOlderSurfacesPurgeable):
* platform/graphics/cg/IOSurfacePool.h:
(WebCore::IOSurfacePool::CachedSurfaceDetails::resetLastUseTime):
* platform/network/PlatformCookieJar.h:

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

2 years ago[ATK] Expose doc-footnote ARIA role with ATK_ROLE_FOOTNOTE
jdiggs@igalia.com [Thu, 25 May 2017 16:43:23 +0000 (16:43 +0000)]
[ATK] Expose doc-footnote ARIA role with ATK_ROLE_FOOTNOTE
https://bugs.webkit.org/show_bug.cgi?id=172355

Reviewed by Chris Fleizach.

Source/WebCore:

Add a new FootnoteRole accessibility role to WebCore and map it to
ATK_ROLE_FOOTNOTE for WebKitGtk and NSAccessibilityGroupRole with
a subrole of AXApplicationGroup for the Mac port.

No new tests because we already have coverage for this role.
The existing test expectations were updated to reflect the
new mapping of doc-footnote to ATK_ROLE_FOOTNOTE.

* accessibility/AccessibilityObject.cpp:
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::computedRoleString):
* accessibility/AccessibilityObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):

Tools:

Add map ATK_ROLE_FOOTNOTE to "AXFootnote" and bump jhbuild minimum
versions of atk, at-spi2-core, and at-spi2-atk to 2.25.2 (the earliest
releases which support the new platform footnote accessibility role.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
* gtk/jhbuild.modules:

LayoutTests:

* accessibility/gtk/xml-roles-exposed-expected.txt: Updated.
* platform/gtk/accessibility/roles-exposed-expected.txt: Updated.

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

2 years ago[GTK] [WebCrypto] Mark new WebCryptoAPI test failures after last WPT sync
clopez@igalia.com [Thu, 25 May 2017 16:24:31 +0000 (16:24 +0000)]
[GTK] [WebCrypto] Mark new WebCryptoAPI test failures after last WPT sync

Unreviewed GTK gardening.

* platform/gtk/TestExpectations:

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

2 years agoREGRESSION (r217423): Fix last-second typo in 'auto'
ddkilzer@apple.com [Thu, 25 May 2017 15:57:26 +0000 (15:57 +0000)]
REGRESSION (r217423): Fix last-second typo in 'auto'

* TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:
(WebKit2_WKHTTPCookieStoreWithoutProcessPool_Test): Fix typo.

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

2 years agoREGRESSION (r216977): 4 leaks introduced in new WebKit2_WKHTTPCookieStoreWithoutProce...
ddkilzer@apple.com [Thu, 25 May 2017 15:54:29 +0000 (15:54 +0000)]
REGRESSION (r216977): 4 leaks introduced in new WebKit2_WKHTTPCookieStoreWithoutProcessPool_Test
<https://webkit.org/b/172558>

Reviewed by Sam Weinig.

* TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:
(WebKit2_WKHTTPCookieStoreWithoutProcessPool_Test): Fix the leaks.

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

2 years ago[macOS WK2 Debug] Layout Test webrtc/video.html is crashing.
commit-queue@webkit.org [Thu, 25 May 2017 15:50:38 +0000 (15:50 +0000)]
[macOS WK2 Debug] Layout Test webrtc/video.html is crashing.
https://bugs.webkit.org/show_bug.cgi?id=172560
<rdar://problem/32392611>

Patch by youenn fablet <youenn@apple.com> on 2017-05-25
Reviewed by Eric Carlson.

webrtc/multiple-video.html is no longer crashing.

Allow autoplay only from going to not capture to capture, and not the reverse.
Renamed HTMLMediaElement::mediaStreamCaptureStateChanged to mediaStreamCaptureStarted.

* dom/Document.cpp:
(WebCore::Document::mediaStreamCaptureStateChanged):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaStreamCaptureStateChanged): Deleted.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::mediaStreamCaptureStarted):

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

2 years ago[GTK] Update baseline
csaavedra@igalia.com [Thu, 25 May 2017 15:43:54 +0000 (15:43 +0000)]
[GTK] Update baseline

Unreviewed gardening. Update after r217272.
* platform/gtk/fast/text/font-style-parse-expected.txt:

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

2 years agoREGRESSION (r217416): Using #pragma once in WTFString.h broke the build
ddkilzer@apple.com [Thu, 25 May 2017 15:22:33 +0000 (15:22 +0000)]
REGRESSION (r217416): Using #pragma once in WTFString.h broke the build

* wtf/text/WTFString.h: Switch back to #ifndef/#define/#endif.

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

2 years agoBaseline of number inputs not right.
hyatt@apple.com [Thu, 25 May 2017 14:56:27 +0000 (14:56 +0000)]
Baseline of number inputs not right.
https://bugs.webkit.org/show_bug.cgi?id=172237

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/forms/baseline-of-number-inputs.html

* css/html.css:
(input::-webkit-inner-spin-button):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::computeLogicalHeightLimit): Deleted.
(WebCore::RenderSearchField::centerContainerIfNeeded): Deleted.
* rendering/RenderSearchField.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::centerRenderer):
(WebCore::RenderTextControlSingleLine::layout):
(WebCore::RenderTextControlSingleLine::computeLogicalHeightLimit): Deleted.
* rendering/RenderTextControlSingleLine.h:
(WebCore::RenderTextControlSingleLine::centerContainerIfNeeded): Deleted.

LayoutTests:

* fast/forms/baseline-of-number-inputs-expected.html: Added.
* fast/forms/baseline-of-number-inputs.html: Added.

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

2 years ago[Win] Update expectations for layout tests.
pvollan@apple.com [Thu, 25 May 2017 14:37:10 +0000 (14:37 +0000)]
[Win] Update expectations for layout tests.
https://bugs.webkit.org/show_bug.cgi?id=172437

Unreviewed test gardening, update test expectations for failing tests.

* platform/win/TestExpectations:

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

2 years agoMake a change to force a build on the Apple bots
ddkilzer@apple.com [Thu, 25 May 2017 13:46:38 +0000 (13:46 +0000)]
Make a change to force a build on the Apple bots

* wtf/text/WTFString.h: Use #pragma once.

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

2 years ago[WPE] Unreviewed gardening
csaavedra@igalia.com [Thu, 25 May 2017 13:36:44 +0000 (13:36 +0000)]
[WPE] Unreviewed gardening

Update rebaseline after r216817.

* platform/wpe/fast/transforms/bounding-rect-zoom-expected.txt:

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

2 years ago[GTK] Web Inspector: Add ListStylePositionInside.svg and ListStylePositionOutside.svg
commit-queue@webkit.org [Thu, 25 May 2017 12:26:42 +0000 (12:26 +0000)]
[GTK] Web Inspector: Add ListStylePositionInside.svg and ListStylePositionOutside.svg
https://bugs.webkit.org/show_bug.cgi?id=172574

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-25
Reviewed by Michael Catanzaro.

Add more free icons for the Web Inspector of GTK+ port.

* UserInterface/Images/gtk/ListStylePositionInside.svg: Added.
* UserInterface/Images/gtk/ListStylePositionOutside.svg: Added.

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

2 years ago[GTK] Web Inspector: Add new icons AnimationPlayStatePaused.svg and AnimationPlayStat...
commit-queue@webkit.org [Thu, 25 May 2017 12:24:17 +0000 (12:24 +0000)]
[GTK] Web Inspector: Add new icons AnimationPlayStatePaused.svg and AnimationPlayStateRunning.svg
https://bugs.webkit.org/show_bug.cgi?id=172579

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-25
Reviewed by Michael Catanzaro.

Add more free icons for the Web Inspector of GTK+ port.

* UserInterface/Images/gtk/AnimationPlayStatePaused.svg: Added.
* UserInterface/Images/gtk/AnimationPlayStateRunning.svg: Added.

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

2 years ago[Win] Update expectations for layout tests.
pvollan@apple.com [Thu, 25 May 2017 11:45:52 +0000 (11:45 +0000)]
[Win] Update expectations for layout tests.
https://bugs.webkit.org/show_bug.cgi?id=172437

Unreviewed test gardening, update test expectations for failing tests.

* platform/win/TestExpectations:

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

2 years ago[css-grid] Fix behavior of positioned items without specific dimensions
rego@igalia.com [Thu, 25 May 2017 10:06:45 +0000 (10:06 +0000)]
[css-grid] Fix behavior of positioned items without specific dimensions
https://bugs.webkit.org/show_bug.cgi?id=172117

Reviewed by Sergio Villar Senin.

Source/WebCore:

Currently positioned items that doesn't have specific dimensions
are not properly sized. This patch fixes the issues with them.

The patch removes the extraInline|BlockOffsets from RenderBox,
so now RenderGrid is responsible of setting the location of the positioned item.
This will be useful to add alignment support for positioned items later.
It also removes grid specific logic from RenderBox.

RenderBox::computeInlineStaticDistance() was modified too.
The problem here was that the containing block of the positioned gird items
is the grid area (and not the grid container). The method didn't know
anything about grid, so it was using the grid container causing wrong values
when resolving "auto" in both left and right offset properties.

Note that after this patch we match Chrome and Firefox behavior on these cases.

Test: fast/css-grid-layout/positioned-grid-items-sizing.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
(WebCore::computeInlineStaticDistance):
(WebCore::RenderBox::computePositionedLogicalWidth):
(WebCore::RenderBox::computePositionedLogicalHeight):
* rendering/RenderBox.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutPositionedObject):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):

LayoutTests:

* fast/css-grid-layout/positioned-grid-items-sizing-expected.html: Added.
* fast/css-grid-layout/positioned-grid-items-sizing.html: Added.

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

2 years ago[WPE] Build fix after r217404
csaavedra@igalia.com [Thu, 25 May 2017 09:57:47 +0000 (09:57 +0000)]
[WPE] Build fix after r217404

Unreviewed

* PlatformWPE.cmake: Include missing cairo cmake file.

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

2 years ago_WKUserStyleSheet leaks string data
commit-queue@webkit.org [Thu, 25 May 2017 09:04:42 +0000 (09:04 +0000)]
_WKUserStyleSheet leaks string data
https://bugs.webkit.org/show_bug.cgi?id=172583
<rdar://problem/32395209>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-05-25
Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
(-[_WKUserStyleSheet dealloc]):

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

2 years agoREGRESSION(r217390): "Broke internal Production builds that ran run-jsc-stress-tests...
ddkilzer@apple.com [Thu, 25 May 2017 07:40:02 +0000 (07:40 +0000)]
REGRESSION(r217390): "Broke internal Production builds that ran run-jsc-stress-tests" (Requested by ddkilzer on #webkit).
<https://bugs.webkit.org/show_bug.cgi?id=172584>

* fast/regex/:
* fast/regex/script-tests:
- Rollback changes in r217390 for Bug 172423 to these
  directories.

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

2 years agoResourceResponses for data URLs have their Source marked as Unknown
cdumez@apple.com [Thu, 25 May 2017 04:18:52 +0000 (04:18 +0000)]
ResourceResponses for data URLs have their Source marked as Unknown
https://bugs.webkit.org/show_bug.cgi?id=172573
<rdar://problem/31786198>

Reviewed by Geoffrey Garen.

Source/WebCore:

ResourceResponses for data URLs have their Source marked as Unknown.

Now set their source to Network to maintain previous behavior when
we used to decode those data URLs on Network process side.

Test: fast/url/data-url-source.html

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::loadDataURL):

LayoutTests:

Add layout test coverage.

* fast/url/data-url-source-expected.txt: Added.
* fast/url/data-url-source.html: Added.

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

2 years ago[Win] An assertion fails if the custom cursor image isn't loaded yet
commit-queue@webkit.org [Thu, 25 May 2017 03:54:08 +0000 (03:54 +0000)]
[Win] An assertion fails if the custom cursor image isn't loaded yet
https://bugs.webkit.org/show_bug.cgi?id=172209

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-24
Reviewed by Said Abou-Hallawa.

Source/WebCore:

Test: fast/css/crash-on-custom-cursor-when-loading.html

A custom cursor image can be zero dimension if it is loading or
decoding. Cursor::ensurePlatformCursor of Windows port should
handle such case properly.

* platform/win/CursorWin.cpp:
(WebCore::Cursor::ensurePlatformCursor): Load a stock cursor if
the custom cursor image has zero dimension. Do not do null-check
of the return value of createSharedCursor() because it never
returns null.

LayoutTests:

Windows port have the same issue Qt port had had several years ago
(Bug 68223). I'd like to reuse the test case. But, current CSS
parser rejects invalid 'cursor' property value which consists of
a single URL but no keywords.

* fast/css/crash-on-custom-cursor-when-loading.html: Fix invalid
'cursor' property by appending a fallback keyword.

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

2 years agoIncrease the headerpad for WebKit XPC Services
commit-queue@webkit.org [Thu, 25 May 2017 03:39:24 +0000 (03:39 +0000)]
Increase the headerpad for WebKit XPC Services
https://bugs.webkit.org/show_bug.cgi?id=172571

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-05-24
Reviewed by Dan Bernstein.

* Configurations/BaseXPCService.xcconfig:
Increase the headerpad to make room for additional dyld commands.

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

2 years ago[CMake] Consolidate CMake code related to Cairo
commit-queue@webkit.org [Thu, 25 May 2017 02:16:33 +0000 (02:16 +0000)]
[CMake] Consolidate CMake code related to Cairo
https://bugs.webkit.org/show_bug.cgi?id=172568

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-05-24
Reviewed by Alex Christensen.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWinCairo.cmake:

Source/WebCore:

No new tests. No change in behavior.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* PlatformWinCairo.cmake:
* config.h:
* platform/Cairo.cmake: Added.
* platform/GStreamer.cmake:
* platform/ImageDecoders.cmake:

Tools:

* DumpRenderTree/config.h:
* TestWebKitAPI/config.h:

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

2 years agoOpening an analysis task from the queue page is broken
rniwa@webkit.org [Wed, 24 May 2017 23:54:43 +0000 (23:54 +0000)]
Opening an analysis task from the queue page is broken
https://bugs.webkit.org/show_bug.cgi?id=172559
<rdar://problem/32389708>

Rubber-stamped by Chris Dumez.

Fix the bug that opening the analysis task page from the queue page results in multiple assertion failures
as well as the list of test groups in the analysis task page not getting updated.

* public/v3/models/build-request.js:
(BuildRequest.prototype.updateSingleton): Because /api/build-requests/ do not include test groups, it's
possible for testGroup to be dynamically updated upon loading an analysis task page. Update _testGroup in
such instances instead of asserting that it doesn't happen.

* public/v3/models/data-model.js:
(DataModelObject.cachedFetch): Because various code to create model objects from the result of a JSON API
modify the fetched content in irreversible manner, e.g. `object.platform = Platform.findById(object.platform)`
we must return a fresh new content each time even if the result had been cached.

* public/v3/models/test-group.js:
(TestGroup.prototype.platform): Return this._platform as that's not available.

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskPage):
(AnalysisTaskPage.prototype._resetVariables): Extracted from the constructor.
(AnalysisTaskPage.prototype.updateFromSerializedState): Reset all instance variables when opening a new
analysis task page. This would avoid showing the stale result even when fetching new test groups had failed.

* unit-tests/test-groups-tests.js: Added a test case for fetching the same test group twice. This used to hit
a problem in BuildRequest.constructBuildRequestsFromData which overrode platform property of each raw content
with a Platform model object because in the case of a cached fetch, we end up trying to look up the platform
again using the result of stringifying the Platform object instead of the platform ID included in the original
fetched content.
(sampleTestGroup): Added "platform" as included in the JSON API's response now.

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

2 years agoThe commit log viewer can overlap the analysis results viewer
rniwa@webkit.org [Wed, 24 May 2017 23:52:06 +0000 (23:52 +0000)]
The commit log viewer can overlap the analysis results viewer
https://bugs.webkit.org/show_bug.cgi?id=172534

Rubber-stamped by Chris Dumez.

Allocate the padding on the right for the commit log viewer, and add a horizontal scrollbar
to the analysis results viewer instead of letting it expand beneath the commit log viewer.

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskResultsPane.htmlTemplate):
(AnalysisTaskResultsPane.cssTemplate):

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

2 years agoREGRESSION (r206481): Don't assume frameCount() is larger than or equal to the size...
commit-queue@webkit.org [Wed, 24 May 2017 23:13:50 +0000 (23:13 +0000)]
REGRESSION (r206481): Don't assume frameCount() is larger than or equal to the size of the image frame cache
https://bugs.webkit.org/show_bug.cgi?id=172552

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-05-24
Reviewed by Geoffrey Garen.

If an image with many cached ImageFrames is cached but its encoded data is
freed, then the same image is reused, the encoded data will be fetched.
But the initial frameCount() might be less than the current size of the
ImageFrames cache.

This was causing an assertion in the debug build and crash in the release
build. Vector::grow() does not handle the case where the new size is smaller
than the current size safely.

* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::growFrames):

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

2 years agonavigator.webdriver should return false if the page is not controlled by automation
commit-queue@webkit.org [Wed, 24 May 2017 23:05:53 +0000 (23:05 +0000)]
navigator.webdriver should return false if the page is not controlled by automation
https://bugs.webkit.org/show_bug.cgi?id=171997

Patch by Sergey Shekyan <shekyan@gmail.com> on 2017-05-24
Reviewed by Chris Dumez.

Per WebDriver Specification at https://www.w3.org/TR/webdriver/#interface

Test: js/dom/navigator-webdriver.html
Rebaseled fast/dom/navigator-detached-no-crash.html

* Modules/webdriver/NavigatorWebDriver.cpp:
(WebCore::NavigatorWebDriver::NavigatorWebDriver):
(WebCore::NavigatorWebDriver::isControlledByAutomation):
(WebCore::NavigatorWebDriver::from):
(WebCore::NavigatorWebDriver::webdriver):
(WebCore::JSNavigator::webdriver): Deleted.
* Modules/webdriver/NavigatorWebDriver.h:
* Modules/webdriver/NavigatorWebDriver.idl:

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

2 years agoMerge split script tests
ap@apple.com [Wed, 24 May 2017 22:53:00 +0000 (22:53 +0000)]
Merge split script tests
https://bugs.webkit.org/show_bug.cgi?id=172423

Reviewed by Sam Weinig.

In the past, many tests were being split into HTML and JS parts for no good reason.
This makes it hard to see what those tests are doing.

This is first part of the change, only including files where JS and HTML counterparts
have matching names. Custom cases will be completed in a follow-up.

Long change list omitted.

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

2 years ago[GTK] Provide details on javascript exception
commit-queue@webkit.org [Wed, 24 May 2017 21:59:58 +0000 (21:59 +0000)]
[GTK] Provide details on javascript exception
https://bugs.webkit.org/show_bug.cgi?id=161187

Patch by David Keijser <keijser@gmail.com> on 2017-05-24
Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewRunJavaScriptCallback):
(webkit_web_view_run_javascript):
(resourcesStreamReadCallback):

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

2 years agoUnreviewed, suppress deprecation warnings to fix the build.
ryanhaddad@apple.com [Wed, 24 May 2017 21:35:11 +0000 (21:35 +0000)]
Unreviewed, suppress deprecation warnings to fix the build.

Source/WebCore:

* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::linearRGBColorSpaceRef):

Source/WebKit2:

* Shared/mac/ColorSpaceData.mm:
(WebKit::ColorSpaceData::decode):

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

2 years agoMark http/tests/xmlhttprequest/xmlhttprequest-50ms-download-dispatch.html as failing...
ryanhaddad@apple.com [Wed, 24 May 2017 21:35:07 +0000 (21:35 +0000)]
Mark http/tests/xmlhttprequest/xmlhttprequest-50ms-download-dispatch.html as failing on iOS.
https://bugs.webkit.org/show_bug.cgi?id=172547

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

2 years ago[GTK] Web Inspector: Add new GTK+ icons for garbage collect and clean buttons in...
commit-queue@webkit.org [Wed, 24 May 2017 20:28:17 +0000 (20:28 +0000)]
[GTK] Web Inspector: Add new GTK+ icons for garbage collect and clean buttons in Console
https://bugs.webkit.org/show_bug.cgi?id=167356

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-24
Reviewed by Michael Catanzaro.

* UserInterface/Images/gtk/NavigationItemClear.svg: Aligned for 16x16 dimension.
* UserInterface/Images/gtk/NavigationItemGarbageCollect.svg: Added.
* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView): Removed the Clear image dimension's conditional expression.
* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView): Ditto.
* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView): Ditto.

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

2 years agoSycning script build fix after r217378.
rniwa@webkit.org [Wed, 24 May 2017 19:43:39 +0000 (19:43 +0000)]
Sycning script build fix after r217378.

* tools/sync-buildbot.js:
(syncLoop):

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

2 years agoDisable memory kill mechanisms when running with FastMalloc disabled.
akling@apple.com [Wed, 24 May 2017 19:32:26 +0000 (19:32 +0000)]
Disable memory kill mechanisms when running with FastMalloc disabled.
https://bugs.webkit.org/show_bug.cgi?id=172550
<rdar://problem/32181908>

Reviewed by Antti Koivisto.

If someone is using WebKit with a non-standard allocator, they are likely trying to debug
or test something, and suddenly getting killed is not gonna help with that.

* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor):

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

2 years agoPlumb additional image metadata to item providers when beginning data interaction...
wenson_hsieh@apple.com [Wed, 24 May 2017 19:01:43 +0000 (19:01 +0000)]
Plumb additional image metadata to item providers when beginning data interaction on an image
https://bugs.webkit.org/show_bug.cgi?id=172536
<rdar://problem/32371300>

Reviewed by Beth Dakin.

Source/WebCore:

Plumb suggestedName (the last path component of the image's source URL) and size (the actual size of the image)
to item providers when beginning data interaction on an image.

Augments existing unit tests to cover these changes -- see DataInteractionTests.

* editing/ios/EditorIOS.mm:
(WebCore::Editor::writeImageToPasteboard):
* platform/Pasteboard.h:
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::writeObjectRepresentations):
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderRegistrationInfoList init]):
(-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
(temporaryFileURLForDataInteractionContent):

Source/WebKit2:

Boilerplate plumbing to send suggestedName over IPC.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<PasteboardImage>::encode):
(IPC::ArgumentCoder<PasteboardImage>::decode):

Tools:

Tweak existing image data interaction tests to check for suggested name and estimated size on the generated
source item providers.

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

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

2 years agoCoreAudioCaptureSource is ducking system sound
eric.carlson@apple.com [Wed, 24 May 2017 18:56:49 +0000 (18:56 +0000)]
CoreAudioCaptureSource is ducking system sound
https://bugs.webkit.org/show_bug.cgi?id=172512

Reviewed by Youenn Fablet.

Manual testing.

* Configurations/WebCore.xcconfig: Adding CoreAudio as framework for iOS.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioSharedUnit::defaultOutputDevice):
* platform/spi/cf/CoreAudioSPI.h: Added.

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

2 years ago[WPE] Rebaseline test
csaavedra@igalia.com [Wed, 24 May 2017 18:54:00 +0000 (18:54 +0000)]
[WPE] Rebaseline test

Unreviewed gardening after a series of changes to dom static properties.

* platform/wpe/js/dom/dom-static-property-for-in-iteration-expected.txt:

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

2 years agoWeb Inspector: Don't load the active recording until a Timeline view needs to be...
drousso@apple.com [Wed, 24 May 2017 18:53:46 +0000 (18:53 +0000)]
Web Inspector: Don't load the active recording until a Timeline view needs to be shown
https://bugs.webkit.org/show_bug.cgi?id=172467

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineTabContentView.js:
(WebInspector.TimelineTabContentView):
(WebInspector.TimelineTabContentView.prototype.restoreFromCookie):
(WebInspector.TimelineTabContentView.prototype._showTimelineViewForType):
Move the call to `_recordingLoaded` to when a timeline view needs to be shown and only if
`_displayedRecording` isn't already set. This delays the creation of the content view for
the recording to right before it needs to be displayed.

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

2 years agoAdd the support for perf try bots to sync-buildbot.js
rniwa@webkit.org [Wed, 24 May 2017 18:47:01 +0000 (18:47 +0000)]
Add the support for perf try bots to sync-buildbot.js
https://bugs.webkit.org/show_bug.cgi?id=172529

Rubber-stamped by Chris Dumez.

Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot.

Change the buildbot property format in the syncing script's configuration again to use a dictionary
with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots,
and simplified the structure of the configuration by always having "types" and "builders", and
make each entry in "configurations" refer to a list of types, platforms, and builders.

Since now there are build requests to build patches and run tests, "configurations" has been renamed to
"testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations"
specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot
properties for testing is now specified as "testProperties" and ones for building a patch is specified
in newly introduced "buildProperties".

* public/api/build-requests.php:
(update_builds): When a build request to build a patch fails, mark all subsequent requests as failed
since there is no way to run tests without a successful build.

* public/api/update-triggerable.php:
(main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was
the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js.

* public/v3/models/build-request.js:
(BuildRequest.prototype.hasCompleted): Added.

* public/v3/models/manifest.js:
(Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and
syncLoop in tools/sync-buildbot.js
(Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually
reset V3 models in syncLoop.

* public/v3/models/uploaded-file.js:
(UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path.

* public/v3/remote.js:
(BrowserRemoteAPI.prototype.url): Added. Constructs the full URL.

* server-tests/api-update-triggerable-tests.js:
(.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call
Manifest.fetch instead.

* server-tests/resources/mock-data.js:
(MockData.resetV3Models): Calls Manifest.reset().
(MockData.addMockConfiguration): Extracted from addMockData.
(MockData.addMockData): Updated per the format change.
(MockData.mockTestSyncConfigWithSingleBuilder): Ditto.
(MockData.mockTestSyncConfigWithTwoBuilders): Ditto.
(MockData.runningBuild): Make buildNumber specifiable.
(MockData.finishedBuild): Ditto.

* server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change.
Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a
repository group that which accepts a patch and not take roots.

* server-tests/tools-sync-buildbot-integration-tests.js: Added.
(createTriggerable): Added.
(createTestGroupWihPatch): Added.
(uploadRoot): Added.
(.assertAndResolveRequest): Added.
(.assertTestBuildHasFailed): Added.

* tools/js/buildbot-syncer.js:
(BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder
is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed
_testConfigurations to _configurations.
(BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't
been set or it's a tester.
(BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder.
(BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder.
(BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this
syncer is a builder. Otherwise returns [].
(BuildbotSyncer.prototype.isTester): Added.
(BuildbotSyncer.prototype.matchesConfiguration):
(BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format.
(BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations.
(BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry,
creates the list of configurations per builder and platform.
(BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision,
roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial
explosion in the number of things that can go wrong. Also parse buildProperties optionally.
(BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of
buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved
type such as "revision" and "patch".
(BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types",
"type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms.

* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.syncOnce):
(BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not
associated with any test.
(BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to
build a patch which has not been completed (pending, scheduled, running, or failed). Since all
requests to build a patch has a negative order, those requests should all show up at the beginning.
(BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when
scheduling the first request to build a patch or the first request to run a test. The first request
to run a test will always have order of 0, so it's a sufficient condition to find such a request.
On the other hand, the first request to build a patch can have a negative order number so we must
explicitly check if it's the first item in the ordered list of requests in the test group.

* tools/remote-server-relay.log: Added.

* tools/sync-buildbot.js:
(syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so
that Triggerable and related objects we have in the memory may not reflect what we just synced to
the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that.

* unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test
exception messages explicitly since allowing any exception was resulting in some tests passing a
result of unrelated parsing error being thrown, etc...
(sampleiOSConfig): Updated per the format change.
(sampleiOSConfigWithExpansions): Ditto.
(smallConfiguration): Ditto.

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

2 years ago[WPE] Rebaseline test
csaavedra@igalia.com [Wed, 24 May 2017 18:40:44 +0000 (18:40 +0000)]
[WPE] Rebaseline test

Unreviewed gardening after a series of changes to dom static properties.

* platform/wpe/js/dom/dom-static-property-for-in-iteration-expected.txt:

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

2 years ago[WPE] Rebaseline test
csaavedra@igalia.com [Wed, 24 May 2017 18:39:05 +0000 (18:39 +0000)]
[WPE] Rebaseline test

Unreviewed gardening after a series of changes to dom static properties.

* platform/wpe/js/dom/dom-static-property-for-in-iteration-expected.txt:

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

2 years ago[WK2] Remove workaround to disable zooming to the focus rect while performing a data...
wenson_hsieh@apple.com [Wed, 24 May 2017 18:38:53 +0000 (18:38 +0000)]
[WK2] Remove workaround to disable zooming to the focus rect while performing a data interaction
https://bugs.webkit.org/show_bug.cgi?id=172546

Reviewed by Beth Dakin.

Removes a now-unnecessary workaround to prevent scrolling when performing a data interaction operation in
editable content.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _displayFormNodeInputView]):

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

2 years agoResource Load Statistics: Change grandfathering default to one hour
wilander@apple.com [Wed, 24 May 2017 17:36:56 +0000 (17:36 +0000)]
Resource Load Statistics: Change grandfathering default to one hour
https://bugs.webkit.org/show_bug.cgi?id=172524
<rdar://problem/32360462>

Reviewed by Brent Fulgham.

Source/WebCore:

Covered by existing test.

* loader/ResourceLoadStatisticsStore.cpp:

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):

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

2 years agoRename DisplaySleepDisabler -> SleepDisabler
jer.noble@apple.com [Wed, 24 May 2017 16:39:57 +0000 (16:39 +0000)]
Rename DisplaySleepDisabler -> SleepDisabler
https://bugs.webkit.org/show_bug.cgi?id=172478

Reviewed by Sam Weinig.

Source/WebCore:

Rename DisplaySleepDisabler to SleepDisabler so that different (i.e., non-Display) sleep types can be
added in a future change.

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateSleepDisabling):
* html/HTMLMediaElement.h:
* platform/SleepDisabler.cpp: Renamed from Source/WebCore/platform/DisplaySleepDisabler.cpp.
(WebCore::SleepDisabler::create):
(WebCore::SleepDisabler::SleepDisabler):
(WebCore::SleepDisabler::~SleepDisabler):
* platform/SleepDisabler.h: Renamed from Source/WebCore/platform/DisplaySleepDisabler.h.
* platform/cocoa/SleepDisablerCocoa.cpp: Renamed from Source/WebCore/platform/cocoa/DisplaySleepDisablerCocoa.cpp.
(WebCore::SleepDisabler::create):
(WebCore::SleepDisablerCocoa::SleepDisablerCocoa):
(WebCore::SleepDisablerCocoa::~SleepDisablerCocoa):
* platform/cocoa/SleepDisablerCocoa.h: Renamed from Source/WebCore/platform/cocoa/DisplaySleepDisablerCocoa.h.
* platform/mac/WebVideoFullscreenController.h:
* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController updatePowerAssertions]):
* CMakeLists.txt:
* PlatformMac.cmake:
* WebCore.order:

Source/WebKit/mac:

* WebView/WebFullScreenController.h:

Source/WebKit2:

* UIProcess/mac/WKFullScreenWindowController.h:
* UIProcess/mac/WKFullScreenWindowController.mm:

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

2 years ago[Win] Create unique network storage session for each DRT.
pvollan@apple.com [Wed, 24 May 2017 16:22:13 +0000 (16:22 +0000)]
[Win] Create unique network storage session for each DRT.
https://bugs.webkit.org/show_bug.cgi?id=172540

Reviewed by Brent Fulgham.

During layout testing, each DRT instance should have its own network storage session.

Source/WebCore:

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

Source/WebKit/win:

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferences.cpp:
(WebPreferences::switchNetworkLoaderToNewTestingSession):
* WebPreferences.h:

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
(prepareConsistentTestingEnvironment):

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

2 years ago[WebIDL] Overloaded functions unnecessarily duplicate argument checks
weinig@apple.com [Wed, 24 May 2017 16:08:31 +0000 (16:08 +0000)]
[WebIDL] Overloaded functions unnecessarily duplicate argument checks
https://bugs.webkit.org/show_bug.cgi?id=172481

Reviewed by Chris Dumez.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePropertiesHashTable):
Update for rename of GetConditionalForFunctionConsideringOverloads.

(AreTypesDistinguishableForOverloadResolution):
Remove unnecessary subroutine isDictionary that can be replaced by
a direct call to $codeGenerator->IsDictionaryType().

(GetConditionalForFunctionConsideringOverloads):
Renamed from getConditionalForFunctionConsideringOverloads.

(GenerateOverloadDispatcher):
Renamed from GenerateOverloadedFunctionOrConstructor. Moved Constructor/Operation/LegacyCaller
specific code out, and into parameters.

(GenerateImplementation):
Moved operation generation out into its own subroutine.

(GenerateOperationDefinition): Added.
Moved from GenerateImplementation.

(GenerateLegacyCallerDefinitions):
Pass function name and signature to GenerateOverloadDispatcher.

(GenerateArgumentsCountCheck):
Don't generate an argument check if this is an overloaded function. The argument
checks happen in the overload dispatcher.

(NeedsExplicitPropagateExceptionCall):
(GenerateParametersCheck):
(GenerateImplementationFunctionCall):
Replace IsReturningPromise with more direct check.

(GenerateConstructorDefinitions):
Pass function name and signature to GenerateOverloadDispatcher.

(getConditionalForFunctionConsideringOverloads): Renamed to GetConditionalForFunctionConsideringOverloads.
(GenerateOverloadedFunctionOrConstructor): Renamed to GenerateOverloadDispatcher.
(IsReturningPromise): Deleted.

* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestInterface.idl:
Update test results.

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

2 years ago[ATK] Gardening needed after r217171
jdiggs@igalia.com [Wed, 24 May 2017 15:40:03 +0000 (15:40 +0000)]
[ATK] Gardening needed after r217171
https://bugs.webkit.org/show_bug.cgi?id=172539

Unreviewed test gardening after r217171.

Add "PASS successfullyParsed is true" and "TEST COMPLETE" lines for
tests with platform-specific expectations.

* accessibility/multiselect-list-reports-active-option-expected.txt:
* accessibility/table-cells-roles-expected.txt:
* platform/gtk/accessibility/aria-checkbox-sends-notification-expected.txt:
* platform/gtk/accessibility/aria-switch-sends-notification-expected.txt:
* platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt:
* platform/gtk/accessibility/menu-list-sends-change-notification-expected.txt:
* platform/gtk/accessibility/table-roles-hierarchy-expected.txt:

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

2 years agoUnreviewed, rolling out r217319.
commit-queue@webkit.org [Wed, 24 May 2017 10:47:44 +0000 (10:47 +0000)]
Unreviewed, rolling out r217319.
https://bugs.webkit.org/show_bug.cgi?id=172538

This patch broke iOS Simulator Debug build (Requested by fredw
on #webkit).

Reverted changeset:

"CoreAudioCaptureSource is ducking system sound"
https://bugs.webkit.org/show_bug.cgi?id=172512
http://trac.webkit.org/changeset/217319

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

2 years ago[WinCairo] AcceleratedCompositingContext.h: error C3668: 'AcceleratedCompositingConte...
commit-queue@webkit.org [Wed, 24 May 2017 09:50:20 +0000 (09:50 +0000)]
[WinCairo] AcceleratedCompositingContext.h: error C3668: 'AcceleratedCompositingContext::paintContents': method with override specifier 'override' did not override any base class methods
https://bugs.webkit.org/show_bug.cgi?id=172535

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-24
Reviewed by Konstantin Tokarev.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::paintContents): Append the fifth argument.
* WebCoreSupport/AcceleratedCompositingContext.h: Ditto.

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

2 years ago[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html...
commit-queue@webkit.org [Wed, 24 May 2017 09:00:59 +0000 (09:00 +0000)]
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409

Unreviewed.

Remove temporary logging which prevents performance bots from reporting useful data.

Patch by Antoine Quint <graouts@apple.com> on 2017-05-24

* page/Page.cpp:
(WebCore::Page::suspendScriptedAnimations):

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

2 years ago[css-grid] Ignore collapsed tracks on content-distribution alignment
jfernandez@igalia.com [Wed, 24 May 2017 08:35:02 +0000 (08:35 +0000)]
[css-grid] Ignore collapsed tracks on content-distribution alignment
https://bugs.webkit.org/show_bug.cgi?id=172493

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

The CSS Box Alignment spec states that we should ignore the collapsed
tracks when computing the Distribution Alignment space to assign to the
different grid tracks.

No new tests, just unskipping the web-platform-tests imported to verify this use case.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateGridPositionsForDirection):

LayoutTests:

Unskip the web-platform-tests related to content-alignment and collapsed tracks.

* TestExpectations:

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

2 years agoRespect image UTIs when writing to item providers when beginning data interaction...
wenson_hsieh@apple.com [Wed, 24 May 2017 07:21:22 +0000 (07:21 +0000)]
Respect image UTIs when writing to item providers when beginning data interaction on an image
https://bugs.webkit.org/show_bug.cgi?id=172436
<rdar://problem/31786569>

Reviewed by Beth Dakin.

Source/WebCore:

Previously, when beginning writing images to the WebItemProviderPasteboard, we would create a new UIImage and
use standard UIImage UIItemProviderWriting utilities to register the image to the pasteboard. This is lossy for
gifs, since UIImage doesn't inherently know how to represent gifs. Instead, register the raw image data directly
to the UTI type corresponding to the MIME type of the image, and use UIImage's item provider writing capability
as a fallback when the raw resourceData is unavailable.

Augments existing unit tests, and also adds a new unit test:
DataInteractionTests.ImageDoesNotUseElementSizeAsEstimatedSize

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::writeObjectRepresentations):

Tools:

Tweaks existing unit tests and adds a new test for image data interaction. See WebCore ChangeLog for more
details.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/apple.gif: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/gif-and-file-input.html: Added.

Create a new test page containing a GIF and a file input.

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

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

2 years ago[Win] Increase test timeout for slow tests.
pvollan@apple.com [Wed, 24 May 2017 06:25:31 +0000 (06:25 +0000)]
[Win] Increase test timeout for slow tests.
https://bugs.webkit.org/show_bug.cgi?id=172449

Reviewed by Alexey Proskuryakov.

Instead of using a fixed timeout of 30 seconds for all tests, we should use the
timeout member in the TestRunner class.

* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::setWaitToDump):

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

2 years agoCoreAudioCaptureSource is ducking system sound
eric.carlson@apple.com [Wed, 24 May 2017 05:39:22 +0000 (05:39 +0000)]
CoreAudioCaptureSource is ducking system sound
https://bugs.webkit.org/show_bug.cgi?id=172512

Reviewed by Youenn Fablet.

Manual testing.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioSharedUnit::defaultOutputDevice):

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

2 years agoResource Load Statistics: Don't include HSTS cache data in website data removal
wilander@apple.com [Wed, 24 May 2017 03:42:41 +0000 (03:42 +0000)]
Resource Load Statistics: Don't include HSTS cache data in website data removal
https://bugs.webkit.org/show_bug.cgi?id=172525
<rdar://problem/32332704>

Reviewed by Brent Fulgham.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::initializeDataTypesToRemove):

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

2 years agoWeb Inspector: content views are not restored on reload if its tree element is filter...
mattbaker@apple.com [Wed, 24 May 2017 01:09:18 +0000 (01:09 +0000)]
Web Inspector: content views are not restored on reload if its tree element is filtered out
https://bugs.webkit.org/show_bug.cgi?id=165744
<rdar://problem/27461323>

Reviewed by Devin Rousso.

By default, NavigationSidebar should get the selected represented object
from its content browser, instead of relying on the tree selection. This
allows a filtered tree selection to persist across page loads.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype.get currentRepresentedObject):
(WebInspector.NavigationSidebarPanel.prototype.saveStateToCookie):
Get the represented object from the content browser instead of relying
on the tree selection (which can be filtered out).

(WebInspector.NavigationSidebarPanel.prototype._updateFilter):
(WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
(WebInspector.NavigationSidebarPanel.prototype._treeElementWasFiltered):
Reselect the represented object's tree element when it is shown due
to a change in the filter state.

(WebInspector.NavigationSidebarPanel.prototype.get hasSelectedElement): Deleted.
Not used.
(WebInspector.NavigationSidebarPanel.prototype.representedObjectWasFiltered): Deleted.
Not used. Replaced by _treeElementWasFiltered.

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

2 years ago[iOS] Speculative fix for a PLT regression
said@apple.com [Wed, 24 May 2017 01:06:25 +0000 (01:06 +0000)]
[iOS] Speculative fix for a PLT regression
<rdar://problem/32361890>

Unreviewed.

Make sure CGImageSourceGetTypeWithData() is called with a buffer which is
32 bytes or more.

* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::ImageDecoder):

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

2 years ago[WebCrypto] Support RSA-PSS
jiewen_tan@apple.com [Wed, 24 May 2017 00:33:23 +0000 (00:33 +0000)]
[WebCrypto] Support RSA-PSS
https://bugs.webkit.org/show_bug.cgi?id=170869
<rdar://problem/31640672>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch implements RSA-PSS according to the spec: https://www.w3.org/TR/WebCryptoAPI/#rsa-pss.
Supported operations include sign, verify, generateKey, importKey and exportKey.

Tests: crypto/subtle/rsa-pss-generate-export-key-jwk-sha1.html
       crypto/subtle/rsa-pss-generate-export-key-jwk-sha224.html
       crypto/subtle/rsa-pss-generate-export-key-jwk-sha256.html
       crypto/subtle/rsa-pss-generate-export-key-jwk-sha384.html
       crypto/subtle/rsa-pss-generate-export-key-jwk-sha512.html
       crypto/subtle/rsa-pss-generate-export-key-pkcs8.html
       crypto/subtle/rsa-pss-generate-export-key-spki.html
       crypto/subtle/rsa-pss-generate-key.html
       crypto/subtle/rsa-pss-import-jwk-private-key.html
       crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages.html
       crypto/subtle/rsa-pss-import-jwk-public-key-sha1.html
       crypto/subtle/rsa-pss-import-jwk-public-key-sha224.html
       crypto/subtle/rsa-pss-import-jwk-public-key-sha256.html
       crypto/subtle/rsa-pss-import-jwk-public-key-sha384.html
       crypto/subtle/rsa-pss-import-jwk-public-key-sha512.html
       crypto/subtle/rsa-pss-import-key-sign-large-salt.html
       crypto/subtle/rsa-pss-import-key-sign.html
       crypto/subtle/rsa-pss-import-key-verify.html
       crypto/subtle/rsa-pss-import-pkcs8-key.html
       crypto/subtle/rsa-pss-import-spki-key-empty-usages.html
       crypto/subtle/rsa-pss-import-spki-key.html
       crypto/workers/subtle/rsa-pss-import-key-sign.html
       crypto/workers/subtle/rsa-pss-import-key-verify.html

* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
* crypto/CryptoAlgorithmParameters.h:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp: Added.
(WebCore::CryptoAlgorithmRSA_PSS::create):
(WebCore::CryptoAlgorithmRSA_PSS::identifier):
(WebCore::CryptoAlgorithmRSA_PSS::sign):
(WebCore::CryptoAlgorithmRSA_PSS::verify):
(WebCore::CryptoAlgorithmRSA_PSS::generateKey):
(WebCore::CryptoAlgorithmRSA_PSS::importKey):
(WebCore::CryptoAlgorithmRSA_PSS::exportKey):
* crypto/algorithms/CryptoAlgorithmRSA_PSS.h: Added.
* crypto/mac/CryptoAlgorithmECDSAMac.cpp:
(WebCore::cryptoDigestAlgorithm): Deleted.
Extract function cryptoDigestAlgorithm to a separate file.
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::cryptoDigestAlgorithm): Deleted.
Extract function cryptoDigestAlgorithm to a separate file.
* crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp: Added.
(WebCore::signRSA_PSS):
(WebCore::verifyRSA_PSS):
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/mac/CryptoDigestAlgorithm.h: Added.
(WebCore::cryptoDigestAlgorithm):
Have cryptoDigestAlgorithm in a separate file.
* crypto/parameters/CryptoAlgorithmRsaPssParams.h: Added.
* crypto/parameters/RsaPssParams.idl: Added.

Source/WTF:

* wtf/Platform.h:
Add a flag to enable RSA-PSS in the future.

LayoutTests:

* TestExpectations:
Skip tests related to RSA-PSS for now.
* crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt:
* crypto/subtle/rsa-generate-key-malformed-parameters.html:
* crypto/subtle/rsa-import-key-malformed-parameters-expected.txt:
* crypto/subtle/rsa-import-key-malformed-parameters.html:
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha1-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha1.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha224-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha224.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha256-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha256.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha384-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha384.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha512-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha512.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-pkcs8-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-pkcs8.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-spki-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-spki.html: Added.
* crypto/subtle/rsa-pss-generate-key-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-key.html: Added.
* crypto/subtle/rsa-pss-import-jwk-private-key-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-private-key.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha1-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha1.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha224-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha224.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha256-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha256.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha384-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha384.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha512-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha512.html: Added.
* crypto/subtle/rsa-pss-import-key-sign-expected.txt: Added.
* crypto/subtle/rsa-pss-import-key-sign-large-salt-expected.txt: Added.
* crypto/subtle/rsa-pss-import-key-sign-large-salt.html: Added.
* crypto/subtle/rsa-pss-import-key-sign.html: Added.
* crypto/subtle/rsa-pss-import-key-verify-expected.txt: Added.
* crypto/subtle/rsa-pss-import-key-verify.html: Added.
* crypto/subtle/rsa-pss-import-pkcs8-key-expected.txt: Added.
* crypto/subtle/rsa-pss-import-pkcs8-key.html: Added.
* crypto/subtle/rsa-pss-import-spki-key-empty-usages-expected.txt: Added.
* crypto/subtle/rsa-pss-import-spki-key-empty-usages.html: Added.
* crypto/subtle/rsa-pss-import-spki-key-expected.txt: Added.
* crypto/subtle/rsa-pss-import-spki-key.html: Added.
* crypto/workers/subtle/resources/rsa-pss-import-key-sign.js: Added.
* crypto/workers/subtle/resources/rsa-pss-import-key-verify.js: Added.
* crypto/workers/subtle/rsa-pss-import-key-sign-expected.txt: Added.
* crypto/workers/subtle/rsa-pss-import-key-sign.html: Added.
* crypto/workers/subtle/rsa-pss-import-key-verify-expected.txt: Added.
* crypto/workers/subtle/rsa-pss-import-key-verify.html: Added.

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

2 years agoWe should not mmap zero bytes for a memory in Wasm
sbarati@apple.com [Wed, 24 May 2017 00:32:12 +0000 (00:32 +0000)]
We should not mmap zero bytes for a memory in Wasm
https://bugs.webkit.org/show_bug.cgi?id=172528
<rdar://problem/32257076>

Reviewed by Mark Lam.

JSTests:

* wasm/js-api/dont-mmap-zero-byte-memory.js: Added.
(testMems):

Source/JavaScriptCore:

This patch fixes a bug where we would call into mmap with zero bytes
when creating a slow WasmMemory with zero initial page size. This fix
is simple: if we don't have any initial bytes, we just call the constructor
in WasmMemory that's meant to handle this case.

* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::create):

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

2 years agoSome async tests ignore jsTestIsAsync when ported from js-test-pre.js / js-test-post...
cdumez@apple.com [Wed, 24 May 2017 00:27:24 +0000 (00:27 +0000)]
Some async tests ignore jsTestIsAsync when ported from js-test-pre.js / js-test-post.js to js-test.js
https://bugs.webkit.org/show_bug.cgi?id=172523

Reviewed by Ryosuke Niwa.

* TestExpectations:
This test used to be flaky because jsTestIsAsync was ignored. It now consistently times out.

* fast/dom/script-charset-update.html:
Port test to js-test.js instead of js-test-pre.js / js-test-post.js now that it works.

* fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events-expected.txt:
Rebaseline test now that it actually runs to the end.

* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
Remove expectation for a test that is now skipped in root TestExpectations file.

* resources/js-test.js:
Call testRunner.waitUntilDone() in the DOMContentLoader event listener if jsTestIsAsync is already
set then, instead of waiting for the load event listener to do so. This is needed because some
tests may decide to complete *before* the load event has fired, such as the test updated in this
patch. We still need to call testRunner.waitUntilDone() in the load event listener as well because
some tests only set jsTestIsAsync in a load event handler.

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

2 years ago[MediaStream] Allow transition from autoplay to play when a capture stream begins.
eric.carlson@apple.com [Wed, 24 May 2017 00:07:21 +0000 (00:07 +0000)]
[MediaStream] Allow transition from autoplay to play when a capture stream begins.
https://bugs.webkit.org/show_bug.cgi?id=172391
<rdar://problem/32304934>

Reviewed by Youenn Fablet.

Manual testing. Regression testing to be added as a follow-up.

* dom/Document.cpp:
(WebCore::Document::updateIsPlayingMedia): Call mediaStreamCaptureStateChanged when capture
state changes.
(WebCore::Document::registerForMediaStreamStateChangeCallbacks):
(WebCore::Document::unregisterForMediaStreamStateChangeCallbacks):
(WebCore::Document::mediaStreamCaptureStateChanged): Call all registered elements.
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::registerWithDocument): Register for capture state changes.
(WebCore::HTMLMediaElement::unregisterWithDocument): Unregister for capture state changes.
(WebCore::HTMLMediaElement::mediaStreamCaptureStateChanged): Attempt autoplay as necessary.
* html/HTMLMediaElement.h:

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

2 years agoReplace autoplay events that fire at navigation with a DidAutoplayMediaPastThreshold...
mrajca@apple.com [Wed, 24 May 2017 00:01:44 +0000 (00:01 +0000)]
Replace autoplay events that fire at navigation with a DidAutoplayMediaPastThreshold event.
https://bugs.webkit.org/show_bug.cgi?id=172138

Reviewed by Alex Christensen.

Source/WebCore:

The current autoplay signals that are fired at navigation may not get delivered to the UIProcess if the WebPage is close()'ed around
this time. This patch simplifies this and just notifies clients if a media element has played past a threshold.

Updated API tests.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playbackProgressTimerFired):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
(WebCore::HTMLMediaElement::userDidInterfereWithAutoplay):
* page/AutoplayEvent.h:

Source/WebKit2:

Updated auto-play event types.

* Shared/WebCoreArgumentCoders.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:

Tools:

Added API tests.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/js-autoplay-audio.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/silence-long.m4a: Added.

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

2 years agoREGRESSION(r217051): Automation sessions fail to complete bootstrap
bburg@apple.com [Wed, 24 May 2017 00:01:41 +0000 (00:01 +0000)]
REGRESSION(r217051): Automation sessions fail to complete bootstrap
https://bugs.webkit.org/show_bug.cgi?id=172513
<rdar://problem/32338354>

Reviewed by Joseph Pecoraro.

The changes to be more strict about typechecking messages were too strict.

* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::receivedSetupMessage):
WIRAutomatically is an optional key in the setup message. In the relay, this key gets copied
into an NSDictionary as NSNull if the key isn't present in a forwarded command.
We need to revert NSNull values to nil, since it's valid to call [nil boolValue] but not
[[NSNull null] boolValue]. We also need to allow for nil in the typecheck for this key.

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

2 years agoRebaseline tests for iOS simulator.
ryanhaddad@apple.com [Wed, 24 May 2017 00:00:09 +0000 (00:00 +0000)]
Rebaseline tests for iOS simulator.

Unreviewed test gardening.

* fast/events/ios/rotation/basic-rotation-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-block-scrolling-state-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-document-scrolling-state-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-scrolling-state-expected.txt:
* fast/events/touch/ios/tap-with-active-touch-end-listener-expected.txt:
* fast/visual-viewport/ios/zoomed-focus-in-fixed-expected.txt:

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

2 years agoASSERT(!m_timeoutTimer.isActive()) hit in BackgroundProcessResponsivenessTimer::respo...
cdumez@apple.com [Tue, 23 May 2017 23:45:41 +0000 (23:45 +0000)]
ASSERT(!m_timeoutTimer.isActive()) hit in BackgroundProcessResponsivenessTimer::responsivenessCheckTimerFired()
https://bugs.webkit.org/show_bug.cgi?id=172509
<rdar://problem/32251578>

Reviewed by Geoffrey Garen.

In the BackgroundProcessResponsivenessTimer class, we have 2 timers:
- m_responsivenessCheckTimer that causes us to do an IPC handshake with
  the WebProcess.
- m_timeoutTimer that is started when we send the IPC message to the
  WebProcess and which is stopped when we get the response from the
  WebProcess. If we do not get the response by the time m_timeoutTimer
  fires, then we mark the process as unresponsive.

As a result, of the behavior above, whenever the BackgroundProcessResponsivenessTimer
is considered "active", there should be one of the 2 timers above that
is active, and only one.

The assertion hit showed that we decided to start the m_responsivenessCheckTimer
timer even though the m_timeoutTimer timer is still active (we are still waiting
for an IPC message from the WebProcess and the process is not considered
unresponsive yet), which is wrong. The reason was that in
BackgroundProcessResponsivenessTimer::updateState(), if we should be active,
we would start the m_responsivenessCheckTimer if m_responsivenessCheckTimer is
not already active, without checking if m_timeoutTimer is active. So if
updateState() was called while the IPC handshake was in process, we would have
both timers running at the same time.

* UIProcess/BackgroundProcessResponsivenessTimer.cpp:
(WebKit::BackgroundProcessResponsivenessTimer::updateState):
(WebKit::BackgroundProcessResponsivenessTimer::isActive):
* UIProcess/BackgroundProcessResponsivenessTimer.h:

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

2 years agoWeb Inspector: Cannot delete a disabled XHR breakpoint
mattbaker@apple.com [Tue, 23 May 2017 22:58:23 +0000 (22:58 +0000)]
Web Inspector: Cannot delete a disabled XHR breakpoint
https://bugs.webkit.org/show_bug.cgi?id=171971
<rdar://problem/32129527>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Controllers/DOMDebuggerManager.js:
(WebInspector.DOMDebuggerManager.prototype.removeXHRBreakpoint):
Dispatch XHRBreakpointRemoved event before removing the breakpoint from
the backend. A disabled breakpoint will have already been removed, and
an enabled breakpoint that fails to get removed from the backend should
be removed from the frontend, to prevent it being resolved in the future.
Drive-by fix: remove spurious dispatch of DOMBreakpointRemoved event.

(WebInspector.DOMDebuggerManager.prototype._detachXHRBreakpoint): Deleted.
Merged with removeXHRBreakpoint to simplify implementation.

LayoutTests:

* inspector/dom-debugger/xhr-breakpoints-expected.txt:
* inspector/dom-debugger/xhr-breakpoints.html:

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

2 years agoSkip crashing css-display-3/display-contents tests.
ryanhaddad@apple.com [Tue, 23 May 2017 22:55:10 +0000 (22:55 +0000)]
Skip crashing css-display-3/display-contents tests.
https://bugs.webkit.org/show_bug.cgi?id=172503

Unreviewed test gardening.

* TestExpectations:

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

2 years agoStop consulting -viewsNeedDisplay when doing layer flushing in WebKit1
simon.fraser@apple.com [Tue, 23 May 2017 21:44:21 +0000 (21:44 +0000)]
Stop consulting -viewsNeedDisplay when doing layer flushing in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=172522
rdar://problem/31071812

Source/WebKit/mac:

Reviewed by Tim Horton.

There's no need to consult -[NSWindow viewsNeedDisplay] on newer OSes. It was
added in r58623, and modified in r61204 for Carbon apps, but with more recent AppKit
versions this synchronization is no longer required.

* WebView/WebView.mm:
(LayerFlushController::flushLayers):

Tools:

Reviewed by Sam Weinig.

Remove NSWindowStyleMaskFullSizeContentView which is no longer referenced in code.
We set this in the .xib file now.

* MiniBrowser/mac/MiniBrowser_Prefix.pch:

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

2 years agoMove css-scoping-1 test suite to WPT
rego@igalia.com [Tue, 23 May 2017 21:33:33 +0000 (21:33 +0000)]
Move css-scoping-1 test suite to WPT
https://bugs.webkit.org/show_bug.cgi?id=172500

Reviewed by Youenn Fablet.

csswg-test repo was merged into web-platform-tests a while ago,
this patch moves the css-scoping-1 test suite to the new path.

* csswg-test/css-scoping-1/w3c-import.log: Removed.
* resources/import-expectations.json:
* web-platform-tests/css/css-scoping-1/OWNERS: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/OWNERS.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-assigned-node-with-rules-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-assigned-node-with-rules.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-functional-rule-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-functional-rule.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-rule-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-rule-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-rule.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-rule.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-with-before-after-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-with-before-after.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-invisible-slot-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-invisible-slot.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-root-hides-children-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-root-hides-children.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-display-override-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-display-override.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-fallback-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-fallback.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-style-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-style-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-style.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-style.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slotted-nested-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slotted-nested.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slotted-rule-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slotted-rule.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-outside-rules-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-outside-rules.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-rules-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-rules.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules.html.
* web-platform-tests/css/css-scoping-1/shadow-cascade-order-001-expected.txt: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/shadow-cascade-order-001-expected.txt.
* web-platform-tests/css/css-scoping-1/shadow-cascade-order-001.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/shadow-cascade-order-001.html.
* web-platform-tests/css/css-scoping-1/w3c-import.log: Added.

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

2 years agoMarked imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic...
jlewis3@apple.com [Tue, 23 May 2017 21:30:37 +0000 (21:30 +0000)]
Marked imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-flex-002-inline.html as failing.
https://bugs.webkit.org/show_bug.cgi?id=172515

Unreviewed test gardening.

* TestExpectations:

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

2 years agoRegression(r215229): ASSERTION FAILED: !m_scriptHash || m_scriptHash == m_script...
cdumez@apple.com [Tue, 23 May 2017 21:06:23 +0000 (21:06 +0000)]
Regression(r215229): ASSERTION FAILED: !m_scriptHash || m_scriptHash == m_script.impl()->hash()
https://bugs.webkit.org/show_bug.cgi?id=171091
<rdar://problem/31752046>

Reviewed by Geoffrey Garen.

* fast/dom/resources/script-with-unicode.js: Added.
* fast/dom/script-charset-update-expected.txt: Added.
* fast/dom/script-charset-update.html: Added.
Add test that was consistently hitting the assertion in debug builds before
r215229 was rolled out.

* fast/loader/cache-encoding-expected.txt:
* fast/loader/cache-encoding.html:
Improve test to check that it is actually getting a SyntaxError the first time,
when it loads the script with the wrong encoding. Apparently this test was not
clear enough because it was updated / disabled in r215229, but was showing a
real bug.

* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
Unskip test was should no longer be flaky now that r215229 has been rolled out.

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