WebKit-https.git
3 years agoSearchInputType could end up with a mismatched renderer.
zalan@apple.com [Wed, 3 May 2017 23:57:18 +0000 (23:57 +0000)]
SearchInputType could end up with a mismatched renderer.
https://bugs.webkit.org/show_bug.cgi?id=171547
<rdar://problem/31935047>

Reviewed by Antti Koivisto.

Source/WebCore:

Normally we've got the correct renderer by the time we call into SearchInputType.
However, since HTMLInputElement::updateType() eagerly updates the type while the associated renderers are done lazily
(so we don't get them updated until after the next tree update), we could actually end up
with a mismatched renderer (e.g. through form submission).

Test: fast/forms/change-input-type-and-submit-form-crash.html

* html/SearchInputType.cpp:
(WebCore::SearchInputType::addSearchResult):
(WebCore::SearchInputType::didSetValueByUserEdit):

LayoutTests:

* fast/forms/change-input-type-and-submit-form-crash-expected.txt: Added.
* fast/forms/change-input-type-and-submit-form-crash.html: Added.

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

3 years ago[WebCrypto] Add an api test for testing wrapping/unwrapping serialized crypto keys
jiewen_tan@apple.com [Wed, 3 May 2017 23:50:38 +0000 (23:50 +0000)]
[WebCrypto] Add an api test for testing wrapping/unwrapping serialized crypto keys
https://bugs.webkit.org/show_bug.cgi?id=171350
<rdar://problem/28600836>

Patched by Brady Eidson.

Reviewed by Brent Fulgham.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/NavigationClientDefaultCrypto.cpp: Added.
(TestWebKitAPI::runJavaScriptAlert):
(TestWebKitAPI::decidePolicyForNavigationAction):
(TestWebKitAPI::decidePolicyForNavigationResponse):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/navigation-client-default-crypto.html: Added.

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

3 years agoMake the VPIO audio unit a singleton, shared between multiple CaptureSources
jer.noble@apple.com [Wed, 3 May 2017 23:50:18 +0000 (23:50 +0000)]
Make the VPIO audio unit a singleton, shared between multiple CaptureSources
https://bugs.webkit.org/show_bug.cgi?id=171622

Reviewed by Eric Carlson.

Move the implemnetation of CoreAudioCaptureSource into a shared singleton class, CoreAudioSharedUnit,
which will send audio to each of it's client CoreAudioCaptureSources. The first registered client will
define the settings used by the shared unit.

Drive-by fixes: Fix up setUseAVFoundationAudioCapture() to always accept the first value set.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::isProducingData):
(WebCore::CoreAudioSharedUnit::microphoneFormat):
(WebCore::CoreAudioSharedUnit::singleton):
(WebCore::CoreAudioSharedUnit::addClient):
(WebCore::CoreAudioSharedUnit::removeClient):
(WebCore::CoreAudioSharedUnit::addEchoCancellationSource):
(WebCore::CoreAudioSharedUnit::removeEchoCancellationSource):
(WebCore::CoreAudioSharedUnit::preferredIOBufferSize):
(WebCore::CoreAudioSharedUnit::setupAudioUnits):
(WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
(WebCore::CoreAudioSharedUnit::configureSpeakerProc):
(WebCore::CoreAudioSharedUnit::checkTimestamps):
(WebCore::CoreAudioSharedUnit::provideSpeakerData):
(WebCore::CoreAudioSharedUnit::speakerCallback):
(WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
(WebCore::CoreAudioSharedUnit::microphoneCallback):
(WebCore::CoreAudioSharedUnit::cleanupAudioUnits):
(WebCore::CoreAudioSharedUnit::startProducingData):
(WebCore::CoreAudioSharedUnit::stopProducingData):
(WebCore::CoreAudioSharedUnit::suspend):
(WebCore::CoreAudioSharedUnit::defaultInputDevice):
(WebCore::CoreAudioCaptureSource::create):
(WebCore::CoreAudioCaptureSource::factory):
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
(WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
(WebCore::CoreAudioCaptureSource::startProducingData):
(WebCore::CoreAudioCaptureSource::stopProducingData):
(WebCore::CoreAudioCaptureSource::audioSourceProvider):
(WebCore::CoreAudioCaptureSource::preferredSampleRate): Deleted.
(WebCore::CoreAudioCaptureSource::preferredIOBufferSize): Deleted.
(WebCore::CoreAudioCaptureSource::configureMicrophoneProc): Deleted.
(WebCore::CoreAudioCaptureSource::configureSpeakerProc): Deleted.
(WebCore::CoreAudioCaptureSource::checkTimestamps): Deleted.
(WebCore::CoreAudioCaptureSource::provideSpeakerData): Deleted.
(WebCore::CoreAudioCaptureSource::speakerCallback): Deleted.
(WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Deleted.
(WebCore::CoreAudioCaptureSource::microphoneCallback): Deleted.
(WebCore::CoreAudioCaptureSource::cleanupAudioUnits): Deleted.
(WebCore::CoreAudioCaptureSource::defaultInputDevice): Deleted.
(WebCore::CoreAudioCaptureSource::setupAudioUnits): Deleted.
(WebCore::CoreAudioCaptureSource::suspend): Deleted.
(WebCore::CoreAudioCaptureSource::resume): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture):

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

3 years agogetUserMedia() fails because devices list is empty / inactive
jer.noble@apple.com [Wed, 3 May 2017 23:48:35 +0000 (23:48 +0000)]
getUserMedia() fails because devices list is empty / inactive
https://bugs.webkit.org/show_bug.cgi?id=171626

Reviewed by Eric Carlson.

When creating a AVAudioSessionCaptureDevice, set the device's enabled state to true if the port description
has any items in its dataSources property (which is the best analogue to "isActive" we have in AVAudioSession).

Also, when creating the generic list of CaptureDevices, use the copy constructor to ensure the enabled state
gets copied to the new generic device.

* platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
(WebCore::AVAudioSessionCaptureDevice::create):
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
(WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):

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

3 years agoImplement the imageready event to reliably test the async image decoding
commit-queue@webkit.org [Wed, 3 May 2017 23:21:12 +0000 (23:21 +0000)]
Implement the imageready event to reliably test the async image decoding
https://bugs.webkit.org/show_bug.cgi?id=171016

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

The event will be fired for each client of the image. Firing the event
will happen after finishing the decoding and repainting the client.

Existing tests will be modified in a separate patch to use this event.

* dom/Element.cpp:
(WebCore::Element::dispatchWebKitImageReadyEventForTesting):
* dom/Element.h:
* page/Settings.in:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::imageFrameAvailable):

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

3 years agoMark media/modern-media-controls/slider/slider-styles.html as flaky on mac-wk1.
ryanhaddad@apple.com [Wed, 3 May 2017 23:07:24 +0000 (23:07 +0000)]
Mark media/modern-media-controls/slider/slider-styles.html as flaky on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=171629

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoMaintain interaction information URL as a URL, not a string
timothy_horton@apple.com [Wed, 3 May 2017 23:00:02 +0000 (23:00 +0000)]
Maintain interaction information URL as a URL, not a string
https://bugs.webkit.org/show_bug.cgi?id=171623

Reviewed by Simon Fraser.

No new tests, not a behavior change.

* platform/URL.h:

* Shared/ios/InteractionInformationAtPosition.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showAttachmentSheet]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
(-[WKPDFView actionSheetAssistant:performAction:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

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

3 years agoUse the CLoop for CPU(ARM64E).
mark.lam@apple.com [Wed, 3 May 2017 22:36:29 +0000 (22:36 +0000)]
Use the CLoop for CPU(ARM64E).
https://bugs.webkit.org/show_bug.cgi?id=171620
<rdar://problem/31973027>

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* llint/LLIntOfflineAsmConfig.h:
* tools/SigillCrashAnalyzer.cpp:
(JSC::SigillCrashAnalyzer::dumpCodeBlock):

Source/WTF:

* wtf/Platform.h:

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

3 years agoLayoutTest http/tests/inspector/network/fetch-network-data.html is a flaky timeout
commit-queue@webkit.org [Wed, 3 May 2017 22:30:38 +0000 (22:30 +0000)]
LayoutTest http/tests/inspector/network/fetch-network-data.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=166038
<rdar://problem/29488489>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-05-03
Reviewed by Matt Baker.

* platform/mac/TestExpectations:
* http/tests/inspector/network/fetch-network-data.html:
* http/tests/inspector/network/xhr-request-data-encoded-correctly.html:
Use singleFireEventListener instead of awaitEvent so that the follow-up event handlers
can be added synchronously instead of in a microtask. When the microtask happened later
than other incoming events then the follow-up handlers would have been added too late.

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

3 years agoMark imported/w3c/web-platform-tests/html/webappapis/timers/negative-settimeout.html...
ryanhaddad@apple.com [Wed, 3 May 2017 22:26:43 +0000 (22:26 +0000)]
Mark imported/w3c/web-platform-tests/html/webappapis/timers/negative-settimeout.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170699.

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-03

* platform/ios-wk2/TestExpectations:

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

3 years ago[JSC] remove unneeded asyncFunctionTests.yaml
caitp@igalia.com [Wed, 3 May 2017 22:15:57 +0000 (22:15 +0000)]
[JSC] remove unneeded asyncFunctionTests.yaml
https://bugs.webkit.org/show_bug.cgi?id=171611

Reviewed by Yusuke Suzuki.

Async functions have shipped, and those tests are run as part of
JSTests/stress and JSTests/test262.yaml. The file is no longer needed.

* asyncFunctionTests.yaml: Removed.
* stress/async-await-long-loop.js:
* stress/async-await-throw-loop.js:

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

3 years agoUncaught Exception: Can't make a ContentView for an unknown representedObject of...
nvasilyev@apple.com [Wed, 3 May 2017 22:13:26 +0000 (22:13 +0000)]
Uncaught Exception: Can't make a ContentView for an unknown representedObject of type: IndexedDatabase
https://bugs.webkit.org/show_bug.cgi?id=167473
<rdar://problem/30249715>

Reviewed by Matt Baker.

When an indexed database is selected in the Storage navigation sidebar, show its host, security origin, and version.

Previously, selecting an indexed database didn't change the content view. It could lead to a misleading state
when an indexed database is selected in the sidebar, but the content view showed previously selected item such as
Cookies or Local Storage.

* UserInterface/Main.html:
* UserInterface/Views/ContentView.css:
(.content-view .details-section):
(.content-view .details-section > .content):
(.content-view .details-section > .content > .group > .row.simple > .label):
(.content-view .details-section:last-child):
* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.createFromRepresentedObject):
(WebInspector.ContentView.isViewable):
* UserInterface/Views/IndexedDatabaseContentView.css: Added.
(.indexed-database.content-view):
(.indexed-database.content-view .indexed-database-details):
(.indexed-database.content-view .details-section > .header):
* UserInterface/Views/IndexedDatabaseContentView.js: Added.
(WebInspector.IndexedDatabaseContentView):
* UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:
(WebInspector.IndexedDatabaseDetailsSidebarPanel.prototype.inspect):
Don't show the details sidebar for IndexedDB top level item since it has the same content as the content view.

* UserInterface/Views/StorageSidebarPanel.js:
(WebInspector.StorageSidebarPanel._treeSelectionDidChange):
* UserInterface/Views/StorageTabContentView.js:
(WebInspector.StorageTabContentView.prototype.canShowRepresentedObject):
(WebInspector.StorageTabContentView):

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

3 years agoHave WKWebView call _updateVisibleContentRects for the current transaction if possibl...
simon.fraser@apple.com [Wed, 3 May 2017 22:04:18 +0000 (22:04 +0000)]
Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying
https://bugs.webkit.org/show_bug.cgi?id=171619
Source/WebKit2:

Also fixes webkit.org/b/170153 and webkit.org/b/170195

Reviewed by Tim Horton.

In r214391 we started adding the pre-commit handler in a dispatch_async() to ensure that
the handler would always run, since we couldn't reliably test the phase of the current
transaction. Now that problem has been solved (rdar://problem/31253952) we can go back to
checking the transaction phase on newer iOS versions. If we're too late for the current transaction
we still need to dispatch_async() to get into the next one.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
(-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):

Tools:

https://bugs.webkit.org/show_bug.cgi?id=170195

Reviewed by Tim Horton.

Re-enable WebKit2.ResizeWithHiddenContentDoesNotHang.

* TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm:
(TEST):

LayoutTests:

https://bugs.webkit.org/show_bug.cgi?id=170153

Reviewed by Tim Horton.

These tests need to wait a bit for the scrolling state of the document to be updated.

* fast/scrolling/ios/touch-scroll-pointer-events-none.html:
* fast/scrolling/ios/touch-scroll-visibility-hidden.html:
* platform/ios-wk2/TestExpectations:

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

3 years agoREGRESSION (r216129): ASSERTION FAILED: m_process->state() == WebProcessProxy::State...
cdumez@apple.com [Wed, 3 May 2017 21:56:33 +0000 (21:56 +0000)]
REGRESSION (r216129): ASSERTION FAILED: m_process->state() == WebProcessProxy::State::Terminated
https://bugs.webkit.org/show_bug.cgi?id=171616

Reviewed by Brady Eidson.

Stop calling resetStateAfterProcessExited() in WebPageProxy::terminateProcess() as the call to
WebProcessProxy::requestTermination() already causes WebPageProxy::processDidCrash() to be called
after r216129. WebPageProxy::processDidCrash() already takes care of calling
resetStateAfterProcessExited().

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::terminateProcess):

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

3 years agoLink preload HTMLPreloadScanner support
yoav@yoav.ws [Wed, 3 May 2017 21:55:25 +0000 (21:55 +0000)]
Link preload HTMLPreloadScanner support
https://bugs.webkit.org/show_bug.cgi?id=170747

Reviewed by Youenn Fablet.

Source/WebCore:

Test: http/tests/preload/preloadscanner_download_resources.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): Initialize link preload flag.
(WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Create a request only if the type is known (so ignore
preloads with unknown type).
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Add handling for link preload and the `as` attribute.
(WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet): Get LinkRelAttribute as input.
(WebCore::TokenPreloadScanner::StartTagScanner::resourceType): Return an std::optional, in case the preload type is unknown.
(WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload): Return true for the link preload case.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::preload): Return the resource rather than a nullptr if it's already in m_preloads.

LayoutTests:

* http/tests/preload/preloadscanner_download_resources-expected.txt: Added.
* http/tests/preload/preloadscanner_download_resources.html: Added.

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

3 years agoMark http/tests/preload/single_download_preload.html as flaky.
ryanhaddad@apple.com [Wed, 3 May 2017 21:36:50 +0000 (21:36 +0000)]
Mark http/tests/preload/single_download_preload.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171331

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

3 years agoMark perf/object-keys.html as flaky
ryanhaddad@apple.com [Wed, 3 May 2017 21:20:15 +0000 (21:20 +0000)]
Mark perf/object-keys.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=171617

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-03

* platform/ios-wk2/TestExpectations:

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

3 years agoYouTube user agent quirk breaks new YouTube
mcatanzaro@igalia.com [Wed, 3 May 2017 20:51:01 +0000 (20:51 +0000)]
YouTube user agent quirk breaks new YouTube
https://bugs.webkit.org/show_bug.cgi?id=171603

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Our user agent quirk to make YouTube 360 work breaks the new YouTube UI, causing it to
attempt to use the obsolete custom elements v0 API. WebKit only supports the v1 API. We
have to remove this quirk.

Note this does not affect Safari as Apple ports don't use our user agent quirks.

* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):

Tools:

Remove the YouTube quirk test.

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

3 years agoWeb Inspector: 404 Image Load does not appear as a failure in Web Inspector
commit-queue@webkit.org [Wed, 3 May 2017 20:36:27 +0000 (20:36 +0000)]
Web Inspector: 404 Image Load does not appear as a failure in Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=171587
<rdar://problem/13222846>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-05-03
Reviewed by Matt Baker.

Source/WebCore:

* inspector/InspectorPageAgent.h:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceContent):
(WebCore::prepareCachedResourceBuffer): Deleted.
Inline the function to make this less confusing.

(WebCore::InspectorPageAgent::buildObjectForFrameTree):
Treat a DecodeError as a failure.

Source/WebInspectorUI:

* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.createObjectURL):
This may return null if the data is not a Blob. This can happen if we
loaded non-base64Encoded text content for an Image. Such as a 404 response.

(WebInspector.Resource.prototype.hadLoadingError):
Consistent way to check for any kind of loading error.

(WebInspector.Resource.prototype.getImageSize):
Handle failure to create an object URL.

* UserInterface/Views/FontResourceContentView.js:
(WebInspector.FontResourceContentView.prototype.contentAvailable):
* UserInterface/Views/ImageResourceContentView.js:
(WebInspector.ImageResourceContentView.prototype.contentAvailable):
Handle failure to create an object URL.

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

3 years agoDifferent behaviour with the .sort(callback) method (unlike Firefox & Chrome)
keith_miller@apple.com [Wed, 3 May 2017 20:33:01 +0000 (20:33 +0000)]
Different behaviour with the .sort(callback) method (unlike Firefox & Chrome)
https://bugs.webkit.org/show_bug.cgi?id=47825

Reviewed by Saam Barati.

JSTests:

* stress/sorting-boolean-result-comparator.js: Added.
(checkArray):

Source/JavaScriptCore:

This patch makes our sort function match the behavior of Firefox
and Chrome when the result of the comparison function is a
boolean. When we first switched to using merge sort, it regressed
JQuery sorting of DOM nodes by 30%. The regression was do to the
fact that JQuery was using compareDocumentPosition to compare the
locations of objects. Since one of the benchmarks would pass a
reverse sorted list to the sort function we would end up walking
the entire DOM to do comparisons. The solution to this was to
merge based on comparison(right, left) rather than
comparison(left, right). Although, in practice this does nothing
since sort could just as easily receive an already sorted list and
we're back in the same spot.

The downside of sorting with comparison(right, left) is that to
maintain stability when sorting, you only want to merge from right
when the comparison function returns a negative value. This is
where the problem with booleans comes in. Since booleans toNumber
false to 0 and true to 1 both values are "equal". This patch fixes
this by special casing boolean return values.

* builtins/ArrayPrototype.js:
(sort.merge):

LayoutTests:

Fix broken test.

* http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts-expected.txt:

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

3 years agoMark http/tests/xmlhttprequest/supported-xml-content-types.html as flaky.
ryanhaddad@apple.com [Wed, 3 May 2017 20:28:28 +0000 (20:28 +0000)]
Mark http/tests/xmlhttprequest/supported-xml-content-types.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171613

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-03

* platform/ios-wk2/TestExpectations:

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

3 years agoAsync image decoding should be disabled for snapshots, printing and preview
commit-queue@webkit.org [Wed, 3 May 2017 19:43:42 +0000 (19:43 +0000)]
Async image decoding should be disabled for snapshots, printing and preview
https://bugs.webkit.org/show_bug.cgi?id=171467
Source/WebCore:

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

Asynchronous image decoding should only be used for window display where
RenderElements can be repainted and painted. For cases where there is only
one chance to draw the image, synchronous decoding should be used.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):

Tools:

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

Add a API test for snapshotting with large images. Ensure the images are
drawn correctly which implies they should have been synchronously decoded.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/large-red-square-image.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewSnapshot.mm:
(TEST):

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

3 years agoAX: VO skips cells after cell with aria-colspan
n_wang@apple.com [Wed, 3 May 2017 19:33:19 +0000 (19:33 +0000)]
AX: VO skips cells after cell with aria-colspan
https://bugs.webkit.org/show_bug.cgi?id=171579

Reviewed by Chris Fleizach.

Source/WebCore:

We should consider the previous cells' column span value when
calculating the column index.

Test: accessibility/mac/aria-grid-column-span.html

* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::columnIndexRange):

LayoutTests:

* accessibility/mac/aria-grid-column-span-expected.txt: Added.
* accessibility/mac/aria-grid-column-span.html: Added.

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

3 years agoASSERTION FAILED: m_scriptExecutionContext->isContextThread() seen with LayoutTest...
jiewen_tan@apple.com [Wed, 3 May 2017 19:27:09 +0000 (19:27 +0000)]
ASSERTION FAILED: m_scriptExecutionContext->isContextThread() seen with LayoutTest crypto/workers/crypto-random-values-limits-worker.html
https://bugs.webkit.org/show_bug.cgi?id=171462
<rdar://problem/31906859>

Reviewed by Brent Fulgham.

Covered by existing tests.

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::~WorkerGlobalScope):
Clear Crypto early in destruction since its ContextDestructionObserver
destruction makes checks about the WorkerThread.

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

3 years agoHandle KVO updating of the "hasOnlySecureContent" before a page results in an HTTP...
beidson@apple.com [Wed, 3 May 2017 19:27:06 +0000 (19:27 +0000)]
Handle KVO updating of the "hasOnlySecureContent" before a page results in an HTTP auth challenge.
https://bugs.webkit.org/show_bug.cgi?id=171607

Reviewed by Andy Estes.

To test this fix we'd need the combination of an HTTPD inside API tests, so no test for now.

* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::hasOnlySecureContent): If the state is provisional, check the provisional URL instead.

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

3 years agoRenderSearchField should not use isTextField() in SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT
zalan@apple.com [Wed, 3 May 2017 19:17:19 +0000 (19:17 +0000)]
RenderSearchField should not use isTextField() in SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT
https://bugs.webkit.org/show_bug.cgi?id=171608

Reviewed by Simon Fraser.

isTextField() is true for any generic single line text control.

* rendering/RenderObject.h:
(WebCore::RenderObject::isSearchField):
* rendering/RenderSearchField.h:

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

3 years agoRemove ScrollingCoordinator::supportsFixedPositionLayers()
commit-queue@webkit.org [Wed, 3 May 2017 19:02:44 +0000 (19:02 +0000)]
Remove ScrollingCoordinator::supportsFixedPositionLayers()
https://bugs.webkit.org/show_bug.cgi?id=171557

Patch by Frederic Wang <fwang@igalia.com> on 2017-05-03
Reviewed by Simon Fraser.

No new tests, behavior is not changed.

* page/FrameView.cpp:
(WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::synchronousScrollingReasons):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::supportsFixedPositionLayers): Deleted.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
(): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

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

3 years ago[WK2] Extend processDidCrash delegate to let the client know the reason for the crash
cdumez@apple.com [Wed, 3 May 2017 18:54:37 +0000 (18:54 +0000)]
[WK2] Extend processDidCrash delegate to let the client know the reason for the crash
https://bugs.webkit.org/show_bug.cgi?id=171565
<rdar://problem/31204417>

Reviewed by Sam Weinig.

Source/WebKit2:

Extend processDidCrash delegate to let the client know the reason for the crash. This
is needed by some clients to distinguish actual crashes from terminations due to
resource limits.

* Shared/ProcessCrashReason.h: Added.
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::processDidCrash):
* UIProcess/API/C/WKAPICast.h:
(WebKit::toAPI):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/API/C/WKPageNavigationClient.h:
* UIProcess/API/C/WKProcessCrashReason.h: Added.
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::processDidCrash):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidCrash):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didClose):
(WebKit::WebProcessProxy::requestTermination):
(WebKit::diagnosticLoggingKeyForTerminationReason):
(WebKit::toProcessCrashReason):
(WebKit::WebProcessProxy::terminateProcessDueToResourceLimits):
(WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
(WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
(WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
* UIProcess/WebProcessProxy.h:
* WebKit2.xcodeproj/project.pbxproj:

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/ProcessDidCrashWithReason.cpp: Added.
(TestWebKitAPI::didFinishNavigation):
(TestWebKitAPI::didCrashWithReason):
(TestWebKitAPI::TEST):

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

3 years agoUse PassRefPtr less in CompositeEditCommand
cdumez@apple.com [Wed, 3 May 2017 18:41:47 +0000 (18:41 +0000)]
Use PassRefPtr less in CompositeEditCommand
https://bugs.webkit.org/show_bug.cgi?id=171590

Reviewed by Sam Weinig.

Use PassRefPtr less in CompositeEditCommand.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/ApplyStyleCommand.cpp:
(WebCore::hasNoAttributeOrOnlyStyleAttribute):
(WebCore::isStyleSpanOrSpanWithOnlyStyleAttribute):
(WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
(WebCore::isEmptyFontTag):
(WebCore::ApplyStyleCommand::doApply):
(WebCore::ApplyStyleCommand::applyBlockStyle):
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::dummySpanAncestorForNode):
(WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
(WebCore::ApplyStyleCommand::applyInlineStyle):
(WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
(WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
(WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun):
(WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
(WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes):
(WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
(WebCore::ApplyStyleCommand::removeCSSStyle):
(WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
(WebCore::ApplyStyleCommand::removeInlineStyle):
(WebCore::ApplyStyleCommand::shouldSplitTextElement):
(WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
(WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
(WebCore::ApplyStyleCommand::addBlockStyle):
(WebCore::ApplyStyleCommand::joinChildTextNodes):
* editing/ApplyStyleCommand.h:
(WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::removeChildrenInRange):
(WebCore::CompositeEditCommand::mergeIdenticalElements):
(WebCore::CompositeEditCommand::insertTextIntoNode):
(WebCore::CompositeEditCommand::deleteTextFromNode):
(WebCore::CompositeEditCommand::replaceTextInNode):
(WebCore::CompositeEditCommand::replaceSelectedTextInNode):
(WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
(WebCore::CompositeEditCommand::removeNodeAttribute):
(WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
(WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
(WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
(WebCore::CompositeEditCommand::deleteInsignificantText):
(WebCore::CompositeEditCommand::removePlaceholderAt):
(WebCore::CompositeEditCommand::cleanupAfterDeletion):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/CompositeEditCommand.h:
* editing/DeleteFromTextNodeCommand.cpp:
(WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
(WebCore::DeleteFromTextNodeCommand::doApply):
(WebCore::DeleteFromTextNodeCommand::doUnapply):
(WebCore::DeleteFromTextNodeCommand::getNodesInCommand):
* editing/DeleteFromTextNodeCommand.h:
(WebCore::DeleteFromTextNodeCommand::create):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::deleteTextFromNode):
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
(WebCore::DeleteSelectionCommand::fixupWhitespace):
* editing/DeleteSelectionCommand.h:
* editing/EditingAllInOne.cpp:
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
(WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl):
(WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
(WebCore::EditingStyle::wrappingStyleForSerialization):
(WebCore::styleFromMatchedRulesForElement):
(WebCore::EditingStyle::mergeStyleFromRules):
(WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
(WebCore::EditingStyle::removeStyleFromRulesAndContext):
(WebCore::EditingStyle::removePropertiesInElementDefaultStyle):
* editing/EditingStyle.h:
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::tryIndentingAsListItem):
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
(WebCore::InsertIntoTextNodeCommand::getNodesInCommand):
* editing/InsertIntoTextNodeCommand.h:
(WebCore::InsertIntoTextNodeCommand::create):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::mergeWithNeighboringLists):
(WebCore::InsertListCommand::listifyParagraph):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::performOverwrite):
(WebCore::InsertTextCommand::doApply):
(WebCore::InsertTextCommand::insertTab):
* editing/MergeIdenticalElementsCommand.cpp:
(WebCore::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
(WebCore::MergeIdenticalElementsCommand::doApply):
(WebCore::MergeIdenticalElementsCommand::doUnapply):
(WebCore::MergeIdenticalElementsCommand::getNodesInCommand):
* editing/MergeIdenticalElementsCommand.h:
(WebCore::MergeIdenticalElementsCommand::create):
* editing/RemoveCSSPropertyCommand.cpp: Removed.
* editing/RemoveCSSPropertyCommand.h: Removed.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
(WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendElement):
(WebCore::styleFromMatchedRulesAndInlineDecl):
(WebCore::createMarkupInternal):

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

3 years agoMark http/tests/websocket/tests/hybi/inspector/binary.html as flaky.
ryanhaddad@apple.com [Wed, 3 May 2017 17:54:26 +0000 (17:54 +0000)]
Mark http/tests/websocket/tests/hybi/inspector/binary.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171553

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoDetach frame from document when entering page cache
dbates@webkit.org [Wed, 3 May 2017 17:52:30 +0000 (17:52 +0000)]
Detach frame from document when entering page cache
https://bugs.webkit.org/show_bug.cgi?id=166774
<rdar://problem/29904368>

Reviewed by Chris Dumez.

* TestExpectations: Unskip tests.
* fast/history/page-cache-after-window-open-expected.txt: Update expected result.
* fast/history/page-cache-after-window-open.html: Ditto.
* fast/history/page-cache-with-opener-expected.txt: Ditto.
* fast/history/page-cache-with-opener.html: Update test given its new expected behavior.
* fast/history/resources/page-cache-window-with-opener.html: Ditto.
* http/tests/security/xss-DENIED-click-and-form-submission-from-inactive-domwindow-expected.txt: Added.
* http/tests/security/xss-DENIED-click-and-form-submission-from-inactive-domwindow.html: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window-expected.txt: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window.html: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2-expected.txt: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window3-expected.txt: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window3.html: Added.

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

3 years agoMarking three imported/w3c/web-platform-tests/webrtc test as flaky failures.
ryanhaddad@apple.com [Wed, 3 May 2017 17:51:16 +0000 (17:51 +0000)]
Marking three imported/w3c/web-platform-tests/webrtc test as flaky failures.
https://bugs.webkit.org/show_bug.cgi?id=171605

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-03

* platform/mac-wk2/TestExpectations:

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

3 years agoMarked test http/tests/local/blob/send-sliced-data-blob.html as flaky failure and...
ryanhaddad@apple.com [Wed, 3 May 2017 17:47:08 +0000 (17:47 +0000)]
Marked test http/tests/local/blob/send-sliced-data-blob.html as flaky failure and timeout.
https://bugs.webkit.org/show_bug.cgi?id=171564

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-03

* platform/ios-wk2/TestExpectations:

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

3 years agoAX: Treat cells with ARIA table cell properties as cells
jdiggs@igalia.com [Wed, 3 May 2017 17:18:43 +0000 (17:18 +0000)]
AX: Treat cells with ARIA table cell properties as cells
https://bugs.webkit.org/show_bug.cgi?id=171178

Reviewed by Chris Fleizach.

Source/WebCore:

Add the following checks to heuristics in AccessibilityTable::isDataTable():
1. If the author has provided a valid aria-rowcount or aria-colcount value on
   the table element, expose it as a data table.
2. If the author has provided a valid aria-colindex or aria-rowindex on the
   cell element, expose it as a data table.
3. If the author has provided a valid aria-rowindex on the row element, expose
   it as a data table.
4. If the author has provided a value for aria-colspan or aria-rowspan on a cell,
   expose it as a data table (even though we are supposed to ignore the value for
   the purpose of exposing the span via platform accessibility APIs)

Remove the heuristic that a table with only one cell is "not a good AXTable candidate."
It prevents us from ever doing the above checks.

Test: accessibility/minimal-table-with-aria-is-data-table.html

* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable):

LayoutTests:

* accessibility/minimal-table-with-aria-is-data-table-expected.txt: Added.
* accessibility/minimal-table-with-aria-is-data-table.html: Added.
* platform/gtk/accessibility/minimal-table-with-aria-is-data-table-expected.txt: Added.

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

3 years ago[INTL] Support dashed values in unicode locale extensions
commit-queue@webkit.org [Wed, 3 May 2017 17:17:51 +0000 (17:17 +0000)]
[INTL] Support dashed values in unicode locale extensions
https://bugs.webkit.org/show_bug.cgi?id=171480

Patch by Andy VanWagoner <thetalecrafter@gmail.com> on 2017-05-03
Reviewed by JF Bastien.

Source/JavaScriptCore:

Implements the UnicodeExtensionSubtags operation and updates the ResolveLocale operation to use it.
This fixes locale extensions with values that include '-'. The following calendars work now:
ethiopic-amete-alem
islamic-umalqura
islamic-tbla
islamic-civil
islamic-rgsa

While updating IntlObject, the comments containing spec text were replaced with a single url at the
top of each function pointing to the relevant part of ECMA-402.

* runtime/IntlObject.cpp:
(JSC::unicodeExtensionSubTags): Added.
(JSC::resolveLocale): Updated to latest standard.

LayoutTests:

Added tests for calendar locale extensions that contain '-'.

* js/intl-datetimeformat-expected.txt:
* js/script-tests/intl-datetimeformat.js:

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

3 years ago[Cairo] Handle extended colors in gradients
carlosgc@webkit.org [Wed, 3 May 2017 17:06:37 +0000 (17:06 +0000)]
[Cairo] Handle extended colors in gradients
https://bugs.webkit.org/show_bug.cgi?id=171596

Reviewed by Michael Catanzaro.

Check if every gradient color step is an extended color and use asExtended() instead of getRGBA() in such case.

Fixes: css3/color/gradients.html

* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::Gradient::platformGradient):

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

3 years agoAbandon the current load once the provisional loader detaches from the frame
dbates@webkit.org [Wed, 3 May 2017 16:58:04 +0000 (16:58 +0000)]
Abandon the current load once the provisional loader detaches from the frame
https://bugs.webkit.org/show_bug.cgi?id=171577
<rdar://problem/31581227>

Source/WebCore:

Reviewed by Brent Fulgham and Brady Eidson.

We detach all child frames as part of setting our document loader to the provisional
document loader when committing a load for a frame. Detaching child frames invokes
the unload event handler on the child frames that can run arbitrary JavaScript script.
Among other things, such script can initiate a new load in the frame whose current
load is being committed. We should stop processing the current load as soon as we
detect that updating our document loader has started a new provisional load.

Test: fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::transitionToCommitted):

LayoutTests:

Reviewed by Brent Fulgham.

* fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash-expected.txt: Added.
* fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash.html: Added.

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

3 years agoCleanup: Remove out-of-date comment and null check from DocumentLoader::detachFromFrame()
dbates@webkit.org [Wed, 3 May 2017 16:52:42 +0000 (16:52 +0000)]
Cleanup: Remove out-of-date comment and null check from DocumentLoader::detachFromFrame()
https://bugs.webkit.org/show_bug.cgi?id=171604

Reviewed by Brady Eidson.

We no longer want to passively allow DocumentLoader::detachFromFrame() to be called twice.
It does not make sense to be called twice and should never be called twice. A release assert
in DocumentLoader::cancelPolicyCheckIfNeeded() (added in r187558) called by DocumentLoader::detachFromFrame()
enforces this invariant. Therefore we can remove the null check of DocumentLoader::m_frame
and the comment that explains the purpose of this null check from DocumentLoader::detachFromFrame().

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::detachFromFrame):

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

3 years agoUnreviewed attempt to fix the Windows build after r216117.
ryanhaddad@apple.com [Wed, 3 May 2017 16:28:47 +0000 (16:28 +0000)]
Unreviewed attempt to fix the Windows build after r216117.
https://bugs.webkit.org/show_bug.cgi?id=171601

* css/CSSAllInOne.cpp:

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

3 years agoRename StyleInvalidationAnalysis to Style::Invalidator
antti@apple.com [Wed, 3 May 2017 14:04:21 +0000 (14:04 +0000)]
Rename StyleInvalidationAnalysis to Style::Invalidator
https://bugs.webkit.org/show_bug.cgi?id=171601

Reviewed by Žan Doberšek.

Also move it to the 'style' directory.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/StyleInvalidationAnalysis.cpp: Removed.
* css/StyleInvalidationAnalysis.h: Removed.
* dom/ExtensionStyleSheets.cpp:
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::AttributeChangeInvalidation::invalidateDescendants):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::invalidateDescendantStyle):
* style/StyleInvalidator.cpp: Copied from Source/WebCore/css/StyleInvalidationAnalysis.cpp.
(WebCore::Style::Invalidator::Invalidator):
(WebCore::Style::Invalidator::invalidateIfNeeded):
(WebCore::Style::Invalidator::invalidateStyleForTree):
(WebCore::Style::Invalidator::invalidateStyle):
(WebCore::shouldDirtyAllStyle): Deleted.
(WebCore::StyleInvalidationAnalysis::StyleInvalidationAnalysis): Deleted.
(WebCore::StyleInvalidationAnalysis::invalidateIfNeeded): Deleted.
(WebCore::StyleInvalidationAnalysis::invalidateStyleForTree): Deleted.
(WebCore::StyleInvalidationAnalysis::invalidateStyle): Deleted.
* style/StyleInvalidator.h: Copied from Source/WebCore/css/StyleInvalidationAnalysis.h.
(WebCore::StyleInvalidationAnalysis::dirtiesAllStyle): Deleted.
(WebCore::StyleInvalidationAnalysis::hasShadowPseudoElementRulesInAuthorSheet): Deleted.
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::analyzeStyleSheetChange):

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

3 years agoUnreviewed GTK+ gardening. Update expectations of several tests.
carlosgc@webkit.org [Wed, 3 May 2017 12:47:38 +0000 (12:47 +0000)]
Unreviewed GTK+ gardening. Update expectations of several tests.

* platform/gtk/TestExpectations:

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

3 years agoUnreviewed GTK+ gardening. Rebaseline inspector resource size tests.
carlosgc@webkit.org [Wed, 3 May 2017 10:18:33 +0000 (10:18 +0000)]
Unreviewed GTK+ gardening. Rebaseline inspector resource size tests.

Libsoup doesn't provide the required information to fill all those size metrics.

* platform/gtk/http/tests/inspector/network/resource-sizes-memory-cache-expected.txt: Added.
* platform/gtk/http/tests/inspector/network/resource-sizes-network-expected.txt: Added.

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

3 years ago[GTK] Add GTK+ implementation of WebAutomationSession
carlosgc@webkit.org [Wed, 3 May 2017 08:55:56 +0000 (08:55 +0000)]
[GTK] Add GTK+ implementation of WebAutomationSession
https://bugs.webkit.org/show_bug.cgi?id=171431

Reviewed by Michael Catanzaro.

Add platform dependent methods for GTK+ to synthesize events.

* PlatformGTK.cmake:
* UIProcess/API/gtk/WebKitUIClient.cpp: Always resize the window for web views controlled by automation.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
(WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
(WebKit::WebAutomationSession::performMouseInteraction):
(WebKit::WebAutomationSession::performKeyboardInteractions):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added.
(WebKit::modifiersToEventState):
(WebKit::mouseButtonToGdkButton):
(WebKit::doMouseEvent):
(WebKit::doMotionEvent):
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
(WebKit::doKeyStrokeEvent):
(WebKit::keyCodeForVirtualKey):
(WebKit::WebAutomationSession::platformSimulateKeyStroke):
(WebKit::WebAutomationSession::platformSimulateKeySequence):
(WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):

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

3 years agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release.
carlosgc@webkit.org [Wed, 3 May 2017 08:30:58 +0000 (08:30 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release.

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit2:

* gtk/NEWS: Add release notes for 2.17.1.

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

3 years ago[Soup] Add request headers to network load metrics
carlosgc@webkit.org [Wed, 3 May 2017 07:15:41 +0000 (07:15 +0000)]
[Soup] Add request headers to network load metrics
https://bugs.webkit.org/show_bug.cgi?id=171545

Reviewed by Sergio Villar Senin.

This will make the headers to appear in the web inspector.

Fixes: http/tests/inspector/network/resource-request-headers.html

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::didGetHeaders):

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

3 years agocheck-webkit-style should also keep js-test-post[-async].js in sync
ddkilzer@apple.com [Wed, 3 May 2017 03:59:24 +0000 (03:59 +0000)]
check-webkit-style should also keep js-test-post[-async].js in sync
<https://webkit.org/b/171568>

Reviewed by Joseph Pecoraro.

* Scripts/webkitpy/style/checker.py:
(_NEVER_SKIPPED_JS_FILES): Add new list that just contains
JavaScript files not to be skipped.
(_NEVER_SKIPPED_FILES): Update to use _NEVER_SKIPPED_JS_FILES.
(CheckerDispatcher._create_checker): Update to use
_NEVER_SKIPPED_JS_FILES.

* Scripts/webkitpy/style/checkers/jstest.py:
(ALL_JS_TEST_FUNCTION_FILES): Rename from ALL_JS_TEST_FILES.
This is the list of files containing functions that need to be
kept in sync.
(KEEP_JS_TEST_FILES_IN_SYNC): Change to list-of-lists format so
we can keep more sets of files in sync between
LayoutTests/resources and LayoutTests/http/tests/resources.
(JSTestChecker.check): Update to use KEEP_JS_TEST_FILES_IN_SYNC
as list of lists.  Update for ALL_JS_TEST_FUNCTION_FILES rename.
(JSTestChecker.check_js_test_files): Add 'file_group' argument
for list of files to check instead of using
KEEP_JS_TEST_FILES_IN_SYNC.
(JSTestChecker.check_js_test_functions): Update for
ALL_JS_TEST_FUNCTION_FILES rename.

* Scripts/webkitpy/style/checkers/jstest_unittest.py:
(JSTestCheckerTestCase):
(JSTestCheckerTestCase.test_map_functions_to_dict):
- Add test case for map_functions_to_dict() in jstest.py.

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

3 years agoBuild fix after r216078
commit-queue@webkit.org [Wed, 3 May 2017 02:48:49 +0000 (02:48 +0000)]
Build fix after r216078
https://bugs.webkit.org/show_bug.cgi?id=171554

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-05-02
Reviewed by Saam Barati.

* API/tests/testapi.c:

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

3 years agoews should indicate in logs when it fails to fetch the attachment
aakash_jain@apple.com [Wed, 3 May 2017 02:48:25 +0000 (02:48 +0000)]
ews should indicate in logs when it fails to fetch the attachment
https://bugs.webkit.org/show_bug.cgi?id=171583

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla.fetch_attachment): Added log statement.

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

3 years agoTypo in AVAudioSessionCaptureDeviceManager.mm
commit-queue@webkit.org [Wed, 3 May 2017 00:11:11 +0000 (00:11 +0000)]
Typo in AVAudioSessionCaptureDeviceManager.mm
https://bugs.webkit.org/show_bug.cgi?id=171572

Patch by Andrew Gold <agold@apple.com> on 2017-05-02
Reviewed by Jer Noble.

We attempt to call +[AVAudioSession sharedSession], but the actual method is
called +[AVAudioSession sharedInstance].

* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
(WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):

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

3 years agoSource/WebCore:
dbates@webkit.org [Tue, 2 May 2017 23:15:19 +0000 (23:15 +0000)]
Source/WebCore:
Improve scrolling tree logging
https://bugs.webkit.org/show_bug.cgi?id=171574

Patch by Simon Fraser <simon.fraser@apple.com> on 2017-05-02
Reviewed by Tim Horton.

Make a call to showScrollingStateTree() print debugging-related information like node and layer IDs.
Required fixing scrolling state tree nodes to respect ScrollingStateTreeAsTextBehavior, and fixing
fixed and sticky nodes to call super.

Also enhance compositing logging to show layer IDs, and to log for layer scrolling tree registration.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::scrollingStateTreeAsText):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::dumpProperties):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::dumpProperties):
(WebCore::ScrollingStateNode::scrollingStateTreeAsText):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::dumpProperties):
* page/scrolling/ScrollingStateTree.cpp:
(showScrollingStateTree):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeState):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

Source/WTF:
Fix the build after <https://trac.webkit.org/changeset/216102>
(https://bugs.webkit.org/show_bug.cgi?id=170925)

Export into global scope ASCIICaseInsensitiveStringViewHashTranslator.

Also fix indentation of member functions of ASCIICaseInsensitiveStringViewHashTranslator.

* wtf/text/StringHash.h:

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

3 years agoFix the build after <https://trac.webkit.org/changeset/216102>
dbates@webkit.org [Tue, 2 May 2017 23:07:35 +0000 (23:07 +0000)]
Fix the build after <https://trac.webkit.org/changeset/216102>
(https://bugs.webkit.org/show_bug.cgi?id=170925)

Export into global scope ASCIICaseInsensitiveStringViewHashTranslator.

Also fix indentation of member functions of ASCIICaseInsensitiveStringViewHashTranslator.

* wtf/text/StringHash.h:

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

3 years agoDynamically added position:fixed element is in the wrong place
simon.fraser@apple.com [Tue, 2 May 2017 23:06:13 +0000 (23:06 +0000)]
Dynamically added position:fixed element is in the wrong place
https://bugs.webkit.org/show_bug.cgi?id=170280
rdar://problem/31374008

Reviewed by Tim Horton.

Source/WebKit2:

Layers for position:fixed elements have their positions reconciled after scrolls
via AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions() and GraphicsLayerCA::syncPosition(),
which updates the GraphicsLayer's position, but does not push it to the PlatformCALayer.

This bug was a case where a position:fixed element gained a fixed ancestor, so had a GraphicsLayerCA whose
position had been updated via syncPosition() in the past. A subsequent layout updated the GraphicsLayerCA position,
but to a value that was the same as its pre-sync position, so the PlatformCALayerRemote's position didn't change,
but there was no signal to the UI process to restore the layer's pre-scrolled position.

Fix by avoiding the early return in PlatformCALayerRemote::setPosition(), to ensure that GraphicsLayerCA
geometry updates in the web process always send new positions to the UI process.

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

LayoutTests:

* scrollingcoordinator/ios/nested-fixed-layer-positions-expected.html: Added.
* scrollingcoordinator/ios/nested-fixed-layer-positions.html: Added.

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

3 years agoImprove scrolling tree logging
simon.fraser@apple.com [Tue, 2 May 2017 23:06:09 +0000 (23:06 +0000)]
Improve scrolling tree logging
https://bugs.webkit.org/show_bug.cgi?id=171574

Reviewed by Tim Horton.

Make a call to showScrollingStateTree() print debugging-related information like node and layer IDs.
Required fixing scrolling state tree nodes to respect ScrollingStateTreeAsTextBehavior, and fixing
fixed and sticky nodes to call super.

Also enhance compositing logging to show layer IDs, and to log for layer scrolling tree registration.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::scrollingStateTreeAsText):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::dumpProperties):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::dumpProperties):
(WebCore::ScrollingStateNode::scrollingStateTreeAsText):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::dumpProperties):
* page/scrolling/ScrollingStateTree.cpp:
(showScrollingStateTree):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeState):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

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

3 years agoUsing StringView.split() instead of String.split() in some places
dbates@webkit.org [Tue, 2 May 2017 22:51:40 +0000 (22:51 +0000)]
Using StringView.split() instead of String.split() in some places
https://bugs.webkit.org/show_bug.cgi?id=170925

Reviewed by Darin Adler.

Source/WebCore:

Replace some uses of String.split() with StringView.split() (added in r211087) as the latter
avoids the need to allocate an intermediary Vector of substrings. Instead StringView.split()
returns an iterator for traversing the substrings.

No functionality changed. So, no new tests.

* accessibility/AccessibilityObject.cpp: Convert some typedefs to modern C++ using declarations.
(WebCore::ASCIICaseInsensitiveStringViewHashTranslator::hash): Added.
(WebCore::ASCIICaseInsensitiveStringViewHashTranslator::equal): Added.
(WebCore::AccessibilityObject::ariaRoleToWebCoreRole): Modified code to use StringView.split().
(WebCore::AccessibilityObject::elementsFromAttribute): Ditto.
* dom/TreeScope.cpp:
(WebCore::TreeScope::getElementById): Added.
* dom/TreeScope.h:
* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::LinkRelAttribute): Modified code to use StringView.split().
* html/parser/XSSAuditor.cpp:
(WebCore::semicolonSeparatedValueContainsJavaScriptURL): Ditto.
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::createSession): Ditto.
* platform/network/CacheValidation.cpp:
(WebCore::collectVaryingRequestHeaders): Simplify code by using the String.split(UChar, Vector<String>&) overload.
* svg/SVGAnimationElement.cpp:
(WebCore::parseKeyTimes): Modified code to use StringView.split().
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Ditto.
* testing/Internals.cpp:
(WebCore::Internals::setMediaSessionRestrictions): Ditto.
(WebCore::Internals::setMediaElementRestrictions): Ditto.
(WebCore::Internals::setAudioContextRestrictions): Ditto.
(WebCore::Internals::setPageMuted): Ditto.
* testing/Internals.h:

Source/WTF:

Add HashMap::get() overload that takes a HashTranslator.

* wtf/HashMap.h:

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

3 years ago[GTK] Drop coordinated surfaces from the compositing thread as soon as possible
yoon@igalia.com [Tue, 2 May 2017 22:50:46 +0000 (22:50 +0000)]
[GTK] Drop coordinated surfaces from the compositing thread as soon as possible
https://bugs.webkit.org/show_bug.cgi?id=171544

Reviewed by Žan Doberšek.

Source/WebCore:

* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
Remove atlasesToRemove from the GraphicsState. It is not a commit
state anymore.

Source/WebKit2:

Released coordinated surface from the main thread didn't be freed until
next commit message because the deletion of coordinated surfaces is
considered as a part of scene state.  We need to release corresponding
surfaces whenever the compositing coordinator drops update atlases to
reduce memory usages.

No new tests, only an optimization.

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
Remove atlasesToRemove from the GraphicsState. it is not a commit
state anymore.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::syncUpdateAtlases):
(WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases):
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::CompositingCoordinator::releaseAtlases): Pass the list of
released update atlases to the compositing thread right after cleaning
up deactivated update atlases.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::clearPendingStateChanges):
(WebKit::CompositingCoordinator::removeUpdateAtlas):
(WebKit::CompositingCoordinator::releaseAtlases):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases):
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:

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

3 years agoMove flaky expectation for svg/animations/getCurrentTime-pause-unpause.html ios-wk1...
ryanhaddad@apple.com [Tue, 2 May 2017 22:24:04 +0000 (22:24 +0000)]
Move flaky expectation for svg/animations/getCurrentTime-pause-unpause.html ios-wk1 to ios TestExpectations file.

Unreviewed test gardening.

* platform/ios-wk1/TestExpectations:
* platform/ios/TestExpectations:

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

3 years agoMark imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker.html...
ryanhaddad@apple.com [Tue, 2 May 2017 22:24:01 +0000 (22:24 +0000)]
Mark imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker.html as flaky on macOS.
https://bugs.webkit.org/show_bug.cgi?id=170907

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoInform clients when viewport-fit state changes, so they can recompute insets
timothy_horton@apple.com [Tue, 2 May 2017 22:17:27 +0000 (22:17 +0000)]
Inform clients when viewport-fit state changes, so they can recompute insets
https://bugs.webkit.org/show_bug.cgi?id=171573
<rdar://problem/31947614>

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didChangeAvoidsUnsafeArea]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
For clients who use setObscuredInsets/setUnobscuredSafeAreaInsets
themselves, we need to let them know when the current state of
viewport-fit changes so that they can recompute the insets.

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

3 years ago[GTK] Recycle textures while handling tiles
yoon@igalia.com [Tue, 2 May 2017 22:15:59 +0000 (22:15 +0000)]
[GTK] Recycle textures while handling tiles
https://bugs.webkit.org/show_bug.cgi?id=171541

Reviewed by Žan Doberšek.

Source/WebCore:

* platform/graphics/texmap/TextureMapperTile.h:
Modified m_texture as a protected member to avoid unnessary
refcountings from the CoordinatedBackingStore.
* platform/graphics/texmap/coordinated/CoordinatedSurface.h:
Use reference instead of RefPtr to pass BitmapTexture

No new tests since there should be no change in behavior.

Source/WebKit2:

* Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
(WebKit::CoordinatedBackingStoreTile::swapBuffers):
Whenever we create new tiles or delete tiles, CoordGfx creates and
deletes textures accordingly.  We should avoid this kind of heavy
operations whenever possible.  This patch modifies to use the texture
pool to reduce texture allocations.  Also this patch reduces number of
resetting textures, which is also expensive operation.
* Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
(WebKit::WebCoordinatedSurface::copyToTexture):
Modified to pass BitmapTexture as a reference.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
(WebKit::ThreadSafeCoordinatedSurface::copyToTexture): Ditto.

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

3 years agoDefer AX cache update when text content changes until after layout is finished.
zalan@apple.com [Tue, 2 May 2017 21:29:13 +0000 (21:29 +0000)]
Defer AX cache update when text content changes until after layout is finished.
https://bugs.webkit.org/show_bug.cgi?id=171429
<rdar://problem/31885984>

Reviewed by Simon Fraser.

Source/WebCore:

When the content of the RenderText changes (even as the result of a text-transform change)
instead of updating the AX cache eagerly (and trigger layout on a half-backed render tree)
we should just defer it until after the subsequent layout is done.

Test: accessibility/crash-while-adding-text-child-with-transform.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::AXObjectCache::recomputeDeferredIsIgnored):
(WebCore::AXObjectCache::deferTextChanged):
(WebCore::AXObjectCache::performDeferredIsIgnoredChange): Deleted.
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::deferTextChanged):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::AXObjectCache::performDeferredIsIgnoredChange): Deleted.
* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks):
* rendering/RenderText.cpp:
(WebCore::RenderText::setText):

LayoutTests:

* accessibility/crash-while-adding-text-child-with-transform-expected.txt: Added.
* accessibility/crash-while-adding-text-child-with-transform.html: Added.

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

3 years agoStop using strcpy() in WebProcess::registerWithStateDumper() in WebProcessCocoa.mm
ddkilzer@apple.com [Tue, 2 May 2017 21:24:58 +0000 (21:24 +0000)]
Stop using strcpy() in WebProcess::registerWithStateDumper() in WebProcessCocoa.mm
<https://webkit.org/b/171520>

Reviewed by Chris Dumez.

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::registerWithStateDumper): Switch from
strcpy() to strlcpy(), removing comment in the process.

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

3 years agoRemove an extraneous call to dispatch_group_async in WebItemProviderPasteboard.mm
wenson_hsieh@apple.com [Tue, 2 May 2017 21:13:04 +0000 (21:13 +0000)]
Remove an extraneous call to dispatch_group_async in WebItemProviderPasteboard.mm
https://bugs.webkit.org/show_bug.cgi?id=171561

Reviewed by Tim Horton.

In -[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:], the lifetime of the dispatch group
`fileLoadingGroup` is already guarded by dispatch_group_enter/leave calls when beginning and concluding an
item provider load, respectively. As such, the call to dispatch_group_async serves no purpose and should be removed.

No new tests, since there is no change in behavior.

* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):

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

3 years agoMediaDevices is not enabled for MobileSafari
commit-queue@webkit.org [Tue, 2 May 2017 21:04:49 +0000 (21:04 +0000)]
MediaDevices is not enabled for MobileSafari
https://bugs.webkit.org/show_bug.cgi?id=171433
<rdar://problem/31923178>

Patch by Andrew Gold <agold@apple.com> on 2017-05-02
Reviewed by Youenn Fablet.

Added the Cocoa API for toggling this feature and removed API for toggling
MediaStreamEnabled since it will always be on.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _mediaDevicesEnabled]):
(-[WKPreferences _setMediaDevicesEnabled:]):
(-[WKPreferences _mediaStreamEnabled]): Deleted.
(-[WKPreferences _setMediaStreamEnabled:]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

3 years ago[LibWebRTC] Set explicitly logging level in debug mode
commit-queue@webkit.org [Tue, 2 May 2017 20:30:03 +0000 (20:30 +0000)]
[LibWebRTC] Set explicitly logging level in debug mode
https://bugs.webkit.org/show_bug.cgi?id=171562

Patch by Youenn Fablet <youenn@apple.com> on 2017-05-02
Reviewed by Eric Carlson.

No change of behavior.

* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::initializePeerConnectionFactoryAndThreads): Setting explictly LibWebRTC logging to Info level for
debug builds if WebRTC channel is on.

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

3 years agoRolling out jstest_unittest.py so it can be reviewed
ddkilzer@apple.com [Tue, 2 May 2017 20:28:50 +0000 (20:28 +0000)]
Rolling out jstest_unittest.py so it can be reviewed

Follow-up fix for:
check-webkit-style should keep JavaScript test functions in sync
<https://webkit.org/b/171424>

* Scripts/webkitpy/style/checkers/jstest_unittest.py: Remove.

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

3 years agocheck-webkit-style should keep JavaScript test functions in sync
ddkilzer@apple.com [Tue, 2 May 2017 20:10:12 +0000 (20:10 +0000)]
check-webkit-style should keep JavaScript test functions in sync
<https://webkit.org/b/171424>

Reviewed by Joseph Pecoraro.

JSTests:

This change makes shouldBe(), shouldNotBe(), shouldNotThrow()
and shouldThrow() in sync with other copies of these methods.

* stress/resources/standalone-pre.js:
(shouldBe): Fix whitespace.  Prefix 'exception' and 'quiet'
variables with underscore.
(shouldThrow): Fix whitespace.

Tools:

Add a new JSTestChecker for check-webkit-style that keeps these
two files in sync:

    LayoutTests/http/tests/resources/js-test-pre.js
    LayoutTests/resources/js-test-pre.js

And keeps implementations of shouldBe(), shouldNotBe(),
shouldNotThrow(), and shouldThrow() in sync across multiple
files (with the ability to add more functions later):

    JSTests/stress/resources/standalone-pre.js
    LayoutTests/http/tests/resources/js-test-pre.js
    LayoutTests/resources/js-test-pre.js
    LayoutTests/resources/js-test.js
    LayoutTests/resources/standalone-pre.js

* Scripts/webkitpy/style/checker.py: Remove unused import.  Add
import for JSTestChecker.
(_NEVER_SKIPPED_FILES): Add array of file names that are never
skipped regardless of other rules.
(_all_categories): Add JSTestChecker categories.
(CheckerDispatcher.should_skip_without_warning): Use
_NEVER_SKIPPED_FILES.
(CheckerDispatcher._create_checker): Return JSTestChecker for
the files to check.

* Scripts/webkitpy/style/checkers/jstest.py: Add.
(map_functions_to_dict): Parse JavaScript source by splitting on
/^function\s+/ regex.  This is good enough for the sanity checks
to keep function implementations in sync.
(strip_blank_lines_and_comments): Strips blank lines and lines
with comments from the end of a chunk of text representing a
function.
(JSTestChecker): New checker.
(JSTestChecker.__init__):
(JSTestChecker.check):
(JSTestChecker.check_js_test_files): Keeps whole files in sync.
(JSTestChecker.check_js_test_functions): Keeps individual
functions in sync.

* Scripts/webkitpy/style/checkers/jstest_unittest.py: Add test
case.
(JSTestTestCase):
(JSTestTestCase.test_map_functions_to_dict):

LayoutTests:

This change attempts to fix all whitespace issues in these two
files (which are now identical and will be kept in sync by
check-webkit-style):

    LayoutTests/http/tests/resources/js-test-pre.js
    LayoutTests/resources/js-test-pre.js

It also syncs the implementation of shouldBe(), shouldNotBe(),
shouldNotThrow() and shouldThrow() across the following files:

    JSTests/stress/resources/standalone-pre.js
    LayoutTests/http/tests/resources/js-test-pre.js
    LayoutTests/resources/js-test-pre.js
    LayoutTests/resources/js-test.js
    LayoutTests/resources/standalone-pre.js

Only interesting (non-whitespace) changes are listed below.

* http/tests/resources/js-test-pre.js: Copy from resources/js-test-pre.js.
(shouldBe): Prefix 'exception' and 'quiet' variables with
underscore.
(shouldNotBe): Ditto.

* resources/js-test-pre.js:
(shouldBe): Prefix 'exception' and 'quiet' variables with
underscore.
(shouldNotBe): Ditto.

* resources/js-test.js:
(shouldBe): Prefix 'quiet' variable with underscore.  Use
stringify() when printing '_bv' value.

* resources/standalone-pre.js:
(shouldBe): Prefix 'exception' and 'quiet' variables with
underscore.
(shouldNotBe): Ditto.

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

3 years agoAX: Update implementation of aria-orientation
jdiggs@igalia.com [Tue, 2 May 2017 20:07:16 +0000 (20:07 +0000)]
AX: Update implementation of aria-orientation
https://bugs.webkit.org/show_bug.cgi?id=171166

Reviewed by Chris Fleizach.

Source/WebCore:

Update AccessibilityRenderObject::orientation() to be consistent with what is
in the ARIA 1.1 spec. Also add an isTreeGrid() convenience method to be consistent
with what we do for other roles.

Test: accessibility/aria-orientation.html

* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::isARIATreeGridRow):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isTreeGrid):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::orientation):

Tools:

Return "AXUnknownOrientation" when ATK_STATE_VERTICAL and ATK_STATE_HORIZONTAL
are both absent from the state set. Before we were returning an empty string
which was not consistent with what the Mac port does, thus making shared tests
harder.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::orientation):

LayoutTests:

Moved the mac aria-orientation.html test to the shared tests and add several
new test cases to it. Update the orientation-related assertion in two tests
to reflect the ARIA 1.1 behavior.

* accessibility/aria-orientation-expected.txt: Renamed from LayoutTests/accessibility/mac/aria-orientation-expected.txt.
* accessibility/aria-orientation.html: Renamed from LayoutTests/accessibility/mac/aria-orientation.html.
* accessibility/mac/slider-supports-actions.html: Updated.
* accessibility/gtk/combobox-descendants-orientation-crash-expected.txt: Updated.

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

3 years agoREGRESSION (r211382): Partial right-to-left text runs are painted at an offset (break...
mmaxfield@apple.com [Tue, 2 May 2017 19:35:25 +0000 (19:35 +0000)]
REGRESSION (r211382): Partial right-to-left text runs are painted at an offset (breaks Find indicators, Look Up, and custom ::selection style)
https://bugs.webkit.org/show_bug.cgi?id=169517
<rdar://problem/30652443>

Reviewed by Dean Jackson.

Source/WebCore:

FontCascade::getGlyphsAndAdvancesForComplexText() is tasked with calculating paint advances for a
subrange of RTL text. It does this by creating a ComplexTextController, telling it to iterate to
the beginning of the subrange (outputting to a GlyphBuffer), then telling it to iterate to the end
of the subrange (outputting to another GlyphBuffer). Because the text is RTL, the sum of the
advances gathered so far is the distance from the right edge of the text to the left edge of the
subrange (because we advance in logical order). Therefore, the x-coordinate we are at now is the
total width minus the sum of both of the GlyphBuffers. For some reason, when I wrote this code I
forgot to add in the contribution from the first GlyphBuffer. Unfortunately, this particular
codepath is rarely hit in practice and completely untested, which made me miss it when I wrote it.

Test: fast/text/complex-text-selection.html

* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):

LayoutTests:

* fast/text/complex-text-selection-expected.html: Added.
* fast/text/complex-text-selection.html: Added.
* platform/ios/TestExpectations:

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

3 years ago[Mac] WK1: http/tests/inspector/network/resource-sizes tests are failing
joepeck@webkit.org [Tue, 2 May 2017 19:22:42 +0000 (19:22 +0000)]
[Mac] WK1: http/tests/inspector/network/resource-sizes tests are failing

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:
Skip these tests on WebKit1. They depend on the NSURLSession
loading path which is not used in WebKit1.

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

3 years agoUnreviewed, fix pedantic C compilers.
fpizlo@apple.com [Tue, 2 May 2017 19:14:58 +0000 (19:14 +0000)]
Unreviewed, fix pedantic C compilers.

* API/tests/testapi.c:
(markingConstraint):
(testMarkingConstraints):

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

3 years agoUnreviewed, fix cmake build.
fpizlo@apple.com [Tue, 2 May 2017 19:13:03 +0000 (19:13 +0000)]
Unreviewed, fix cmake build.

* CMakeLists.txt:

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

3 years ago[macOS] Flaky Crash under EventTarget::fireEventListeners on imported/blink/paint...
cdumez@apple.com [Tue, 2 May 2017 19:03:58 +0000 (19:03 +0000)]
[macOS] Flaky Crash under EventTarget::fireEventListeners on imported/blink/paint/deprecatedpaintlayer/non-self-painting-layer-overrides-visibility.html
https://bugs.webkit.org/show_bug.cgi?id=171406
<rdar://problem/30945281>

Reviewed by Eric Carlson.

Source/WebCore:

I was unfortunately unable to reproduce the flaky crash locally. However, the crash trace
indicates that one of the EventTarget::scriptExecutionContext() overrides is returning a
stale ScriptExecutionContext pointer. Since a GenericEventQueue is involved, the EventTarget
is likely a media-related object. I therefore audited media classes that override
EventTarget::scriptExecutionContext() and found several that look unsafe. I am fixing those
by having them override ContextDestructionObserver, instead of having a raw
ScriptExecutionContext pointer member. This makes sure the pointer gets nulled out whenever
the scriptexecutioncontext gets destroyed, ensuring that those classes's
EventTarget::scriptExecutionContext() overrides can never return a stale pointer.

* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::SourceBufferList):
* Modules/mediasource/SourceBufferList.h:
* html/track/TextTrack.cpp:
(WebCore::TextTrack::TextTrack):
* html/track/TextTrack.h:
* html/track/TrackListBase.cpp:
(TrackListBase::TrackListBase):
* html/track/TrackListBase.h:

LayoutTests:

Unskip test.

* platform/mac/TestExpectations:

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

3 years agoDocument style resolvers should share user rulesets
antti@apple.com [Tue, 2 May 2017 19:02:43 +0000 (19:02 +0000)]
Document style resolvers should share user rulesets
https://bugs.webkit.org/show_bug.cgi?id=171549

Reviewed by Andreas Kling.

Large user stylesheets (like those used by ad blockers) can end up using lots of memory if
a document uses large number of shadow trees. User style is inherently per-document and
the resulting rulesets can be shared between the document and the shadow trees.

* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::DocumentRuleSets):
(WebCore::DocumentRuleSets::userStyle):

    Return per-document user style for shadow trees.

(WebCore::DocumentRuleSets::collectFeatures):
* css/DocumentRuleSets.h:
(WebCore::DocumentRuleSets::setUsesSharedUserStyle):
(WebCore::DocumentRuleSets::userStyle): Deleted.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::initializeUserStyle):

    Separate user style initialization from construction.

* css/StyleResolver.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):

    Don't initialize user style for user agents shadow trees.

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

3 years agoMarked test svg/animations/animated-svg-image-removed-from-document-paused.html as...
ryanhaddad@apple.com [Tue, 2 May 2017 18:46:38 +0000 (18:46 +0000)]
Marked test svg/animations/animated-svg-image-removed-from-document-paused.html as flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=171559

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-02

* platform/ios-wk2/TestExpectations:

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

3 years agoMarked test imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/setRemoteDescrip...
ryanhaddad@apple.com [Tue, 2 May 2017 18:45:18 +0000 (18:45 +0000)]
Marked test imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/setRemoteDescription.html as flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=170818

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-02

* platform/mac-wk2/TestExpectations:

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

3 years agoREGRESSION (r213036): Crash in -[WKContentView _webTouchEventsRecognized:] when a...
aestes@apple.com [Tue, 2 May 2017 18:43:33 +0000 (18:43 +0000)]
REGRESSION (r213036): Crash in -[WKContentView _webTouchEventsRecognized:] when a touch event arrives after a WebPageProxy has been invalidated
https://bugs.webkit.org/show_bug.cgi?id=171539
<rdar://problem/31614982>

Reviewed by Tim Horton.

Prior to r213036, the layer tree transaction at last touch start was tracked by
WebPageProxy::handleTouchEventSynchronously(), which would ask the drawing area proxy for
its most recent transaction ID after ensuring that the WebPageProxy was valid.

r213036 moved the tracking up to -[WKContentView _webTouchEventsRecognized:], but failed to
check if _page was valid before asking for its drawing area proxy's last transaction ID; the
drawing area proxy is set to null on WebPageProxy invalidation.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _webTouchEventsRecognized:]): Added an early return if _page isn't valid.

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

3 years agoFont Loading API specifies font is loaded but sizing of font after load reports incon...
mmaxfield@apple.com [Tue, 2 May 2017 18:02:50 +0000 (18:02 +0000)]
Font Loading API specifies font is loaded but sizing of font after load reports inconsistent values
https://bugs.webkit.org/show_bug.cgi?id=168533

Reviewed by Zalan Bujtas.

Source/WebCore:

Previously, we were marking all local() fonts as immediately successful,
regardless of whether or not they were present on the system. Instead, we
should use the load() function to make this determination and mark the font
as failed if it doesn't exist. (This is, after all, the whole point of the
load() function). This brings us in-line with Firefox's and Chrome's
behavior.

Test: fast/text/font-loading-local.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::pump): Remote loading requires the FontSelector,
but it isn't available for local fonts. Now that load() is called for both
local and remote fonts, the ASSERT() should be lowered into the load()
function and scoped to just the case where we have a remote font.
(WebCore::CSSFontFace::font): Ditto.
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::CSSFontFaceSource): Don't immediatley set
the success/failure state for local fonts.
(WebCore::CSSFontFaceSource::load): Move loading logic from font() to
load(). None of this code is new; it just is moved.
(WebCore::CSSFontFaceSource::font): Delete code moved to load().
* css/CSSFontFaceSource.h:
* css/FontFace.cpp:
(WebCore::FontFace::create):

LayoutTests:

* fast/text/font-loading-local-expected.txt: Added.
* fast/text/font-loading-local.html: Added.
* fast/text/web-font-load-fallback-during-loading.html:

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

3 years agoJSC C API should expose GC marking constraints and weak references
fpizlo@apple.com [Tue, 2 May 2017 18:00:23 +0000 (18:00 +0000)]
JSC C API should expose GC marking constraints and weak references
https://bugs.webkit.org/show_bug.cgi?id=171554

Reviewed by Geoffrey Garen.

This exposes an API that lets you participate in the GC's fixpoint. You can ask the GC
what is marked and you can tell the GC to mark things. The constraint callback cannot
do a whole lot, but it can query marking state and it can dereference weak references.

Additionally, this exposes a very simple weak reference API in C.

* API/JSMarkingConstraintPrivate.cpp: Added.
(JSC::isMarked):
(JSC::mark):
(JSContextGroupRegisterMarkingConstraint):
* API/JSMarkingConstraintPrivate.h: Added.
* API/JSWeakPrivate.cpp: Added.
(OpaqueJSWeak::OpaqueJSWeak):
(JSWeakCreate):
(JSWeakRetain):
(JSWeakRelease):
(JSWeakGetObject):
* API/JSWeakPrivate.h: Added.
* API/tests/testapi.c:
(markingConstraint):
(testMarkingConstraints):
(main):
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/SlotVisitor.h:
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::appendHiddenUnbarriered):
(JSC::SlotVisitor::appendHidden):

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

3 years agoMake "PAL/pal" and "PAL/pal/crypto" directories private
commit-queue@webkit.org [Tue, 2 May 2017 18:00:22 +0000 (18:00 +0000)]
Make "PAL/pal" and "PAL/pal/crypto" directories private
https://bugs.webkit.org/show_bug.cgi?id=171524

Patch by Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com> on 2017-05-02
Reviewed by Myles C. Maxfield.

Make the "PAL/pal" and "PAL/pal/crypto" directories private to force WebCore sources
to include PAL headers in "#include <pal/***.h>" style.

* pal/CMakeLists.txt:

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

3 years agoJSFixedArray::allocationSize() should not allow for allocation failure.
mark.lam@apple.com [Tue, 2 May 2017 17:55:11 +0000 (17:55 +0000)]
JSFixedArray::allocationSize() should not allow for allocation failure.
https://bugs.webkit.org/show_bug.cgi?id=171516

Reviewed by Geoffrey Garen.

Since JSFixedArray::createFromArray() now handles allocation failures by throwing
OutOfMemoryErrors, its helper function allocationSize() (which computes the buffer
size to allocate) should also allow for allocation failure on overflow.

This issue is covered by the stress/js-fixed-array-out-of-memory.js test when
run on 32-bit builds.

* runtime/JSFixedArray.h:
(JSC::JSFixedArray::tryCreate):
(JSC::JSFixedArray::allocationSize):

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

3 years agoSource/WebCore:
commit-queue@webkit.org [Tue, 2 May 2017 17:49:39 +0000 (17:49 +0000)]
Source/WebCore:
Allow media stream based videos with sound to autoplay if the page is already playing sound
https://bugs.webkit.org/show_bug.cgi?id=171447

Patch by Youenn Fablet <youenn@apple.com> on 2017-05-02
Reviewed by Eric Carlson.

Test: http/tests/media/autoplay-if-audio-is-playing.html for ensuring non-mediastream based video will not autoplay.
Manual testing for the autoplay of media stream based videos since such a test should happen without using getUserMedia.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted):

LayoutTests:
Allow media stream based videos with sound autoplay if the page is already playing sound
https://bugs.webkit.org/show_bug.cgi?id=171447

Patch by Youenn Fablet <youenn@apple.com> on 2017-05-02
Reviewed by Eric Carlson.

* http/tests/media/autoplay-if-audio-is-playing-expected.txt: Added.
* http/tests/media/autoplay-if-audio-is-playing.html: Added.
* http/tests/media/resources/test-25fps.mp4: Added.

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

3 years agoUse PassRefPtr less in editing code
cdumez@apple.com [Tue, 2 May 2017 17:41:46 +0000 (17:41 +0000)]
Use PassRefPtr less in editing code
https://bugs.webkit.org/show_bug.cgi?id=171534

Reviewed by Geoffrey Garen.

Use PassRefPtr less in editing code.

* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::AppendNodeCommand):
(WebCore::AppendNodeCommand::getNodesInCommand):
* editing/AppendNodeCommand.h:
(WebCore::AppendNodeCommand::create):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
(WebCore::ApplyStyleCommand::positionToComputeInlineStyleChange):
* editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::insertNodeBefore):
(WebCore::CompositeEditCommand::insertNodeAfter):
(WebCore::CompositeEditCommand::insertNodeAt):
(WebCore::CompositeEditCommand::appendNode):
(WebCore::CompositeEditCommand::moveRemainingSiblingsToNewParent):
(WebCore::CompositeEditCommand::mergeIdenticalElements):
(WebCore::CompositeEditCommand::insertNodeAtTabSpanPosition):
(WebCore::CompositeEditCommand::appendBlockPlaceholder):
(WebCore::CompositeEditCommand::insertBlockPlaceholder):
(WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
(WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt):
(WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/CompositeEditCommand.h:
* editing/CreateLinkCommand.cpp:
(WebCore::CreateLinkCommand::doApply):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
(WebCore::DeleteSelectionCommand::mergeParagraphs):
* editing/FormatBlockCommand.cpp:
(WebCore::FormatBlockCommand::formatRange):
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::tryIndentingAsListItem):
(WebCore::IndentOutdentCommand::indentIntoBlockquote):
(WebCore::IndentOutdentCommand::outdentParagraph):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertLineBreakCommand.h:
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::fixOrphanedListChild):
(WebCore::InsertListCommand::doApplyForSingleParagraph):
(WebCore::InsertListCommand::unlistifyParagraph):
(WebCore::InsertListCommand::listifyParagraph):
* editing/InsertListCommand.h:
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
(WebCore::InsertNodeBeforeCommand::doApply):
(WebCore::InsertNodeBeforeCommand::doUnapply):
(WebCore::InsertNodeBeforeCommand::getNodesInCommand):
* editing/InsertNodeBeforeCommand.h:
(WebCore::InsertNodeBeforeCommand::create):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock):
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/InsertParagraphSeparatorCommand.h:
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::positionInsideTextNode):
(WebCore::InsertTextCommand::insertTab):
* editing/ModifySelectionListLevel.cpp:
(WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeBefore):
(WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeAfter):
(WebCore::ModifySelectionListLevelCommand::appendSiblingNodeRange):
(WebCore::IncreaseSelectionListLevelCommand::doApply):
* editing/RemoveNodePreservingChildrenCommand.cpp:
(WebCore::RemoveNodePreservingChildrenCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
(WebCore::ReplaceSelectionCommand::mergeEndIfNeeded):
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
(WebCore::ReplaceSelectionCommand::insertAsListItems):
* editing/SimplifyMarkupCommand.cpp:
(WebCore::SimplifyMarkupCommand::pruneSubsequentAncestorsToRemove):

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

3 years agoSet Response.blob() type correctly when body is a ReadableStream.
commit-queue@webkit.org [Tue, 2 May 2017 16:58:33 +0000 (16:58 +0000)]
Set Response.blob() type correctly when body is a ReadableStream.
https://bugs.webkit.org/show_bug.cgi?id=171489

Patch by Ben Kelly <ben@wanderview.com> on 2017-05-02
Reviewed by Youenn Fablet

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/response/response-consume-expected.txt:

Source/WebCore:

The Fetch API specification requires setting the blob contentType
using the Content-Type header value, if present.  Currently WebKit
only sets the type on the FetchBodyConsumer when FetchBody::blob()
is called.  Unfortunately, this is never called if the body is
actually a ReadableStream.

This change allows WebKit to pass the "Consume response's body: from
stream to blob" case in the WPT response-consume.html test.

Test: http://w3c-test.org/fetch/api/response/response-consume.html

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::startConsumingStream): Modified to call
FetchBodyConsumer::setContentType() before processing the stream.

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

3 years agoMarked test http/tests/xmlhttprequest/methods-async.html as flaky timeout.
ryanhaddad@apple.com [Tue, 2 May 2017 16:52:51 +0000 (16:52 +0000)]
Marked test http/tests/xmlhttprequest/methods-async.html as flaky timeout.
https://bugs.webkit.org/show_bug.cgi?id=171530

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-02

* platform/ios-wk2/TestExpectations:

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

3 years agoUnreviewed, rolling out r216069.
ryanhaddad@apple.com [Tue, 2 May 2017 16:22:53 +0000 (16:22 +0000)]
Unreviewed, rolling out r216069.

This change broke the build.

Reverted changeset:

"Document style resolvers should share user rulesets"
https://bugs.webkit.org/show_bug.cgi?id=171549
http://trac.webkit.org/changeset/216069

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

3 years agoWeb Automation: generate resizeWindowOfBrowsingContext and moveWindowOfBrowsingContex...
commit-queue@webkit.org [Tue, 2 May 2017 14:33:57 +0000 (14:33 +0000)]
Web Automation: generate resizeWindowOfBrowsingContext and moveWindowOfBrowsingContext for all platforms
https://bugs.webkit.org/show_bug.cgi?id=171107

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2017-05-02
Reviewed by Brian Burg.

The implementation is actually cross-platform, so it could be moved from WebAutomationSessionMac.mm to
WebAutomationSession.cpp and simply return a NotImplemented error for iOS. This will allow to use these methods
in other platforms.

* UIProcess/Automation/Automation.json:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
(WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted.
(WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted.

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

3 years agoDocument style resolvers should share user rulesets
antti@apple.com [Tue, 2 May 2017 14:30:30 +0000 (14:30 +0000)]
Document style resolvers should share user rulesets
https://bugs.webkit.org/show_bug.cgi?id=171549

Reviewed by Andreas Kling.

Large user stylesheets (like those used by ad blockers) can end up using lots of memory if
a document uses large number of shadow trees. User style is inherently per-document and
the resulting rulesets can be shared between the document and the shadow trees.

* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::DocumentRuleSets):
(WebCore::DocumentRuleSets::userStyle):

    Return per-document user style for shadow trees.

(WebCore::DocumentRuleSets::collectFeatures):
* css/DocumentRuleSets.h:
(WebCore::DocumentRuleSets::setUsesSharedUserStyle):
(WebCore::DocumentRuleSets::userStyle): Deleted.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::initializeUserStyle):

    Separate user style initialization from construction.

* css/StyleResolver.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):

    Don't initialize user style for user agents shadow trees.

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

3 years ago[GTK] Remove undefined nativeImage method from the ImageBuffer's header
yoon@igalia.com [Tue, 2 May 2017 10:52:51 +0000 (10:52 +0000)]
[GTK] Remove undefined nativeImage method from the ImageBuffer's header
https://bugs.webkit.org/show_bug.cgi?id=171502

Unreviewed, remove a dead code accidentally committed in r194630.

* platform/graphics/ImageBuffer.h: Remove nativeImage method.
It is accidentally added during a refectorying at r194630, and there is
no definition for this method.

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

3 years ago[GStreamer] Dailymotion live stream videos don't play
carlosgc@webkit.org [Tue, 2 May 2017 10:05:58 +0000 (10:05 +0000)]
[GStreamer] Dailymotion live stream videos don't play
https://bugs.webkit.org/show_bug.cgi?id=170767

Reviewed by Sergio Villar Senin.

The video shows a message saying that an error occurred and nothing is played. There are actually several
problems with dailymotion. The main issue is that URLs are redirected by the server, and GStreamer needs to
know the redirected URL. Once GStreamer knows the redirected URL the error message no longer appears, the video
starts but it always stops after a few seconds. This is because the source receives an early EOS while still
downloading the fragments. The reason of the early EOS is because dailymotion sends a wrong Content-Length header,
something that is expected to happen and we correctly handle that case when receiving the data, by updating the
size accordingly if the bytes received are longer than the expected content length. This particular case
doesn't work well with GStreamer automatic EOS handling, which is the default. At some point, GStreamer detects
that the bytes received are at least the expected ones and emits a GST_EVENT_EOS that the GstUriDownloader
handles finishing the download early. We should always disable automatic EOS, since we know when EOS actually
happens and we already call gst_app_src_end_of_stream(). This patch also emits a GST_EVENT_CUSTOM_DOWNSTREAM_STICKY
event to let GStreamer know about the HTTP headers sent and received.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init): Disable automatic EOS.
(webKitWebSrcGetProperty): Return the redirected URL in case of redirection.
(webKitWebSrcStart): Pass the ResourceRequest to the stream clients.
(webKitWebSrcQueryWithParent): Set the redirected URL in the query in case of redirection.
(webKitWebSrcSetUri): Clear also the redirected URL when setting a new URI.
(StreamingClient::StreamingClient): Use GRefPtr for the source and initialize the request too.
(StreamingClient::~StreamingClient): Remove explicit unref.
(StreamingClient::createReadBuffer):
(StreamingClient::handleResponseReceived): Initialize the redirected URL in case of redirection. Create and push
the HTTP headers event.
(StreamingClient::handleDataReceived):
(StreamingClient::handleNotifyFinished):
(CachedResourceStreamingClient::CachedResourceStreamingClient):
(CachedResourceStreamingClient::responseReceived):
(CachedResourceStreamingClient::accessControlCheckFailed):
(CachedResourceStreamingClient::loadFailed):
(ResourceHandleStreamingClient::ResourceHandleStreamingClient):
(ResourceHandleStreamingClient::didFail):
(ResourceHandleStreamingClient::wasBlocked):
(ResourceHandleStreamingClient::cannotShowURL):

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

3 years agoAdding logging to RTCPeerConnection to allow WebRTC application debugging
commit-queue@webkit.org [Tue, 2 May 2017 08:55:43 +0000 (08:55 +0000)]
Adding logging to RTCPeerConnection to allow WebRTC application debugging
https://bugs.webkit.org/show_bug.cgi?id=171531

Patch by Youenn Fablet <youenn@apple.com> on 2017-05-02
Reviewed by Jon Lee.

No change of behavior.
This allows easier debugging of webrtc-enabled web pages.

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOfferSucceeded):
(WebCore::PeerConnectionBackend::createOfferFailed):
(WebCore::PeerConnectionBackend::createAnswerSucceeded):
(WebCore::PeerConnectionBackend::createAnswerFailed):
(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateFailed):
(WebCore::PeerConnectionBackend::newICECandidate):
(WebCore::PeerConnectionBackend::doneGatheringCandidates):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::queuedCreateOffer):
(WebCore::RTCPeerConnection::queuedCreateAnswer):
(WebCore::RTCPeerConnection::queuedSetLocalDescription):
(WebCore::RTCPeerConnection::queuedSetRemoteDescription):
(WebCore::RTCPeerConnection::queuedAddIceCandidate):

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

3 years ago[GTK] Crash at WebCore::ResourceHandle::clearClient() when streaming live video from...
carlosgc@webkit.org [Tue, 2 May 2017 08:48:10 +0000 (08:48 +0000)]
[GTK] Crash at WebCore::ResourceHandle::clearClient() when streaming live video from dailymotion
https://bugs.webkit.org/show_bug.cgi?id=169725

Reviewed by Michael Catanzaro.

Make ResourceHandleStreamingClient refcounted and add an invalidate method to do the cleanup in the networking
thread while keeping a reference.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStop): Call invalidate before reseting client pointer.
(webKitWebSrcStart): Ditto.
(ResourceHandleStreamingClient::ResourceHandleStreamingClient): Remove all cleanup code after the run loop run call.
(ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Just detach the thread.
(ResourceHandleStreamingClient::invalidate): Schedule a task on the networking thread to clean up and fiish the
run loop, protecting this.
(ResourceHandleStreamingClient::setDefersLoading): Protect this.
(ResourceHandleStreamingClient::didReceiveResponse): Do nothing if client was invalidated.
(ResourceHandleStreamingClient::didReceiveBuffer): Ditto.
(ResourceHandleStreamingClient::didFinishLoading): Ditto.

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

3 years ago[GTK] Web Inspector: Remove GTK+ icon FontVariantSmallCaps.svg
commit-queue@webkit.org [Tue, 2 May 2017 08:39:14 +0000 (08:39 +0000)]
[GTK] Web Inspector: Remove GTK+ icon FontVariantSmallCaps.svg
https://bugs.webkit.org/show_bug.cgi?id=171542

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-02
Reviewed by Carlos Garcia Campos.

This image is not used and Apple's one was removed in Bug 148720.

* UserInterface/Images/gtk/FontVariantSmallCaps.svg: Removed.

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

3 years ago[GTK] Web Inspector: Remove GTK+ icons AnimationPlayStatePaused.svg and AnimationPlay...
commit-queue@webkit.org [Tue, 2 May 2017 08:27:36 +0000 (08:27 +0000)]
[GTK] Web Inspector: Remove GTK+ icons AnimationPlayStatePaused.svg and AnimationPlayStateRunning.svg
https://bugs.webkit.org/show_bug.cgi?id=171540

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-02
Reviewed by Carlos Garcia Campos.

These images aren't used since r204152 (Bug 160566). Instead,
Plus13.svg and Minus.svg are used.

* UserInterface/Images/gtk/BreakpointActionAdd.svg: Removed.
* UserInterface/Images/gtk/BreakpointActionRemove.svg: Removed.

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

3 years ago[GCrypt] ECDSA signing and verification support
zandobersek@gmail.com [Tue, 2 May 2017 06:49:06 +0000 (06:49 +0000)]
[GCrypt] ECDSA signing and verification support
https://bugs.webkit.org/show_bug.cgi?id=171103

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Implement WebCrypto ECDSA support for configurations that
are using libgcrypt.

For signing, the provided data is first hashed with the specified
digest algorithm and embedded into a data s-expression. It's then
passed to gcry_pk_sign() along with the private key, returning a
sig-val s-expression. The r and s parameters are then retrieved from
that sig-val and their data extracted and concatenated in the output
Vector<>.

For verification, the data is again hashed and embedded into a data
s-expression. The r and s parameters are extracted from the passed-in
signature Vector<> and embedded into a sig-val s-expression. The data
and sig-val s-expressions are then passed to gcry_pk_verify() along
with the public key. The verification succeeds if no error is returned
and fails if the returned error code is GPG_ERR_BAD_SIGNATURE.

* crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
(WebCore::hashCryptoDigestAlgorithm):
(WebCore::hashAlgorithmName):
(WebCore::mpiData):
(WebCore::gcryptSign):
(WebCore::gcryptVerify):
(WebCore::CryptoAlgorithmECDSA::platformSign):
(WebCore::CryptoAlgorithmECDSA::platformVerify):

LayoutTests:

* platform/gtk/TestExpectations: Enable the passing ECDSA tests under
crypto/subtle/. The ECDSA tests that utilize PKCS #8 and SPKI remain
skipped since support for that hasn't landed yet.

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

3 years ago[GCrypt] HKDF bit derivation support
zandobersek@gmail.com [Tue, 2 May 2017 06:37:07 +0000 (06:37 +0000)]
[GCrypt] HKDF bit derivation support
https://bugs.webkit.org/show_bug.cgi?id=171074

Reviewed by Michael Catanzaro.

Source/WebCore:

Implement bit derivation support for the HKDF algorithm for configurations
that use libgcrypt.

libgcrypt doesn't provide HKDF support out of the box, so we have to
implement the two steps manually. In the first one, we retrieve the
pseudo-random key by using the specified MAC algorithm with the salt data
as the key and the key data as the input keying material.

In the expand step, we do the required amount of iterations to derive
a sufficient amount of data, using the same MAC algorithm with the
pseudo-random key from the previous step on the data we compose from the
previous block data, the info data, and the current iteration value. The
resulting blocks are appended together until they can be clipped to the
desired output length.

* crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
(WebCore::macAlgorithmForHashFunction):
(WebCore::gcryptDeriveBits):
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):

LayoutTests:

The crypto/subtle/hkdf-derive-bits-length-limits.html test is added, testing the
corner-case length values for which the bit derivation operation must succeed or
fail for any specified SHA hash algorithm. With HashLen as the algorithm's output
length, the operation should reject for lengths of 0 or above 255 * HashLen * 8.
The operation should resolve for lengths between the two limits, with testing
performed on lengths of 8 (the minimum output length), HashLen * 8 (matching the
output length of the hash algorithm), and 255 * HashLen * 8 (the maximum
derivation output length).

* crypto/subtle/hkdf-derive-bits-length-limits-expected.txt: Added.
* crypto/subtle/hkdf-derive-bits-length-limits.html: Added.
* platform/gtk/TestExpectations: Enable the HKDF tests under crypto/subtle/.

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

3 years ago[GCrypt] ECDH bit derivation support
zandobersek@gmail.com [Tue, 2 May 2017 06:34:03 +0000 (06:34 +0000)]
[GCrypt] ECDH bit derivation support
https://bugs.webkit.org/show_bug.cgi?id=171070

Reviewed by Michael Catanzaro.

Source/WebCore:

Implement bit derivation support for the ECDH algorithm for configurations
that use libgcrypt.

This is done by retrieving the private key data and wrapping it in a new
data s-expression. That's then encrypted with the public key, and the
returned s-expression contains the shared point data. That data is then
decoded into an EC point, from which the x-coordinate is retrieved. This
coordinate data is finally our bit derivation result.

* crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
(WebCore::gcryptDerive):
(WebCore::CryptoAlgorithmECDH::platformDeriveBits):

Source/WebCore/PAL:

Add PAL::GCrypt::HandleDeleter specialization for the
gcry_mpi_point_t type.

* pal/crypto/gcrypt/Handle.h:
(PAL::GCrypt::HandleDeleter<gcry_mpi_point_t>::operator()):

LayoutTests:

The crypto/subtle/ecdh-derive-bits-length-limits.html test is added, testing the
corner-case length values for which the bit derivation operation must succeed or
fail. When specifying 0 as the length, the returned result must match the EC key
size in length. 8, tested as the minimum non-zero value, and the key size for
each key must also correctly resolve and return a resulting ArrayBuffer whose
length in bytes must match the requested length. Derivations for byte-aligned
values should start rejecting immediately for length values that are bigger than
the EC key's length.

* crypto/subtle/ecdh-derive-bits-length-limits-expected.txt: Added.
* crypto/subtle/ecdh-derive-bits-length-limits.html: Added.
* platform/gtk/TestExpectations: Enable Web Crypto ECDH tests under crypto/subtle/
that are passing now that the proper implementation has been added. The remaining
failing ECDH tests use PKCS #8 and SPKI key import/export formats, which are not
supported yet.

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

3 years ago[Xcode] It’s easy to accidentally install a WTF header outside /usr/local/include/wtf
mitz@apple.com [Tue, 2 May 2017 05:30:38 +0000 (05:30 +0000)]
[Xcode] It’s easy to accidentally install a WTF header outside /usr/local/include/wtf
https://bugs.webkit.org/show_bug.cgi?id=171533

Reviewed by Andy Estes.

* WTF.xcodeproj/project.pbxproj: Removed the WTF target’s Headers build phase. Its existence
  was making it easy to accidentally add a header to the target and make it Private, which
  would have Xcode install a copy of it right under /usr/local/include, in addition to the
  copy installed under /usr/local/include/wtf by the Copy WTF Headers target.
  Also got rid of INSTALL_PATH_PREFIX in the script build phase in the Copy WTF Headers
  target, because it is being never set anymore.

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

3 years ago[aarch64][Linux] m_allowScratchRegister assert hit in MacroAssemblerARM64 under B3...
zandobersek@gmail.com [Tue, 2 May 2017 04:32:08 +0000 (04:32 +0000)]
[aarch64][Linux] m_allowScratchRegister assert hit in MacroAssemblerARM64 under B3::Air::CCallSpecial::generate()
https://bugs.webkit.org/show_bug.cgi?id=170672

Reviewed by Filip Pizlo.

In Air::CCallSpecial::admitsStack() we reject admitting the callee argument on
the stack for ARM64 because that can lead to disallowed usage of the scratch
register in MacroAssemblerARM64 when generating a call with an address Arg
in Air::CCallSpecial::generate().

The testLinearScanWithCalleeOnStack test is added to testb3. It reproduces the
original issue by force-spilling everything on the stack and enforcing the use
of the linear scan register allocation by using an optimization level of 1.

* b3/air/AirCCallSpecial.cpp:
(JSC::B3::Air::CCallSpecial::admitsStack):
* b3/testb3.cpp:
(JSC::B3::testLinearScanWithCalleeOnStack):
(JSC::B3::run):

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

3 years agoWTF installs an extra copy of a header outside /usr/local/include/wtf
mitz@apple.com [Tue, 2 May 2017 03:14:28 +0000 (03:14 +0000)]
WTF installs an extra copy of a header outside /usr/local/include/wtf

* WTF.xcodeproj/project.pbxproj: Demoted CPUTime.h from Private to Project.

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

3 years agoREGRESSION: LayoutTest workers/wasm-hashset-many.html is a flaky timeout
sbarati@apple.com [Tue, 2 May 2017 02:04:51 +0000 (02:04 +0000)]
REGRESSION: LayoutTest workers/wasm-hashset-many.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=171449

Unreviewed.

* platform/win/TestExpectations: Skip Wasm tests on Windows.
* workers/wasm-hashset-many-expected.txt:
* workers/wasm-hashset/many-test.js: Make wasm-hashset-many run fewer workers.

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