WebKit-https.git
3 years agoAdd missing text after r222226.
zalan@apple.com [Wed, 20 Sep 2017 00:37:14 +0000 (00:37 +0000)]
Add missing text after r222226.

* accessibility/crash-table-recursive-layout.html:

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

3 years agoMarked tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical...
jlewis3@apple.com [Wed, 20 Sep 2017 00:03:04 +0000 (00:03 +0000)]
Marked tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical-then-horizontal.html as flaky on macOS Debug.
https://bugs.webkit.org/show_bug.cgi?id=171839

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoQuiet media player private logging
eric.carlson@apple.com [Tue, 19 Sep 2017 23:28:48 +0000 (23:28 +0000)]
Quiet media player private logging
https://bugs.webkit.org/show_bug.cgi?id=177199

Reviewed by Jer Noble.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):

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

3 years agoAllow modern decoding of Vectors
achristensen@apple.com [Tue, 19 Sep 2017 23:17:48 +0000 (23:17 +0000)]
Allow modern decoding of Vectors
https://bugs.webkit.org/show_bug.cgi?id=177102

Reviewed by Andy Estes.

Source/WebCore:

* Modules/cache/DOMCacheEngine.h:
(WebCore::DOMCacheEngine::CacheInfos::decode):
(WebCore::DOMCacheEngine::CacheIdentifierOperationResult::decode):
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::decode):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/IDBGetAllResult.h:
(WebCore::IDBGetAllResult::decode):
* Modules/indexeddb/IDBGetResult.h:
(WebCore::IDBGetResult::decode):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/IDBKeyRangeData.h:
(WebCore::IDBKeyRangeData::decode):
* Modules/indexeddb/IDBValue.h:
(WebCore::IDBValue::decode):
* Modules/indexeddb/shared/IDBError.h:
* Modules/indexeddb/shared/IDBIterateCursorData.h:
(WebCore::IDBIterateCursorData::decode):
* Modules/indexeddb/shared/IDBRequestData.h:
(WebCore::IDBRequestData::decode):
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::decode):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::decode):
* platform/Cookie.h:
(WebCore::Cookie::decode):
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaTrackConstraintSetMap::decode):
* platform/network/FormData.h:
(WebCore::FormDataElement::decode):
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::decode):
* workers/service/ServiceWorkerRegistrationData.h:
(WebCore::ServiceWorkerRegistrationData::decode):
* workers/service/ServiceWorkerRegistrationKey.h:
(WebCore::ServiceWorkerRegistrationKey::decode):

Source/WebKit:

Rather than allow modern decoding of Vectors of types that only allow legacy decoding,
I just made modern decoders for all types that we need to decode in Vectors.

* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::decode):
* Platform/IPC/ArgumentCoders.cpp:
(IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode):
* Platform/IPC/ArgumentCoders.h:
* Shared/AssistedNodeInformation.cpp:
(WebKit::OptionItem::decode):
* Shared/AssistedNodeInformation.h:
* Shared/CallbackID.h:
(WebKit::CallbackID::decode):
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::PaymentError>::decode):
(IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::decode):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::decode):
(IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
(IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
* Shared/Databases/IndexedDB/WebIDBResult.cpp:
(WebKit::WebIDBResult::decode):
* Shared/FrameInfoData.cpp:
(WebKit::FrameInfoData::decode):
* Shared/Gamepad/GamepadData.cpp:
(WebKit::GamepadData::decode):
* Shared/Gamepad/GamepadData.h:
* Shared/PlatformPopupMenuData.cpp:
(WebKit::PlatformPopupMenuData::decode):
* Shared/PlatformPopupMenuData.h:
* Shared/Plugins/NPIdentifierData.cpp:
(WebKit::NPIdentifierData::decode):
* Shared/Plugins/NPIdentifierData.h:
* Shared/Plugins/NPVariantData.cpp:
(WebKit::NPVariantData::decode):
* Shared/Plugins/NPVariantData.h:
* Shared/RTCNetwork.cpp:
(WebKit::RTCNetwork::IPAddress::decode):
(WebKit::RTCNetwork::SocketAddress::decode):
(WebKit::RTCNetwork::decode):
* Shared/RTCNetwork.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
(WebKit::RemoteLayerTreeTransaction::decode):
* Shared/SessionState.cpp:
(WebKit::HTTPBody::Element::decode):
(WebKit::FrameState::decode):
(WebKit::PageState::decode):
(WebKit::BackForwardListItemState::decode):
(WebKit::BackForwardListState::decode):
* Shared/SessionState.h:
* Shared/WebCompiledContentRuleListData.cpp:
(WebKit::WebCompiledContentRuleListData::decode):
* Shared/WebCompiledContentRuleListData.h:
* Shared/WebContextMenuItemData.cpp:
(WebKit::WebContextMenuItemData::decode):
* Shared/WebContextMenuItemData.h:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::decode):
(IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
(IPC::ArgumentCoder<FloatRect>::decode):
(IPC::ArgumentCoder<FloatQuad>::decode):
(IPC::ArgumentCoder<IntRect>::decode):
(IPC::ArgumentCoder<RecentSearch>::decode):
(IPC::ArgumentCoder<Region::Span>::decode):
(IPC::ArgumentCoder<MimeClassInfo>::decode):
(IPC::ArgumentCoder<PluginInfo>::decode):
(IPC::ArgumentCoder<SelectionRect>::decode):
(IPC::ArgumentCoder<CompositionUnderline>::decode):
(IPC::ArgumentCoder<DictationAlternative>::decode):
(IPC::ArgumentCoder<GrammarDetail>::decode):
(IPC::ArgumentCoder<TextCheckingResult>::decode):
(IPC::ArgumentCoder<BlobPart>::decode):
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
(IPC::ArgumentCoder<MediaConstraints>::decode):
(IPC::ArgumentCoder<CaptureDevice>::decode):
(IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
(IPC::ArgumentCoder<MediaSelectionOption>::decode):
* Shared/WebCoreArgumentCoders.h:
* Shared/WebEvent.h:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPlatformTouchPoint.cpp:
(WebKit::WebPlatformTouchPoint::decode):
* Shared/WebPopupItem.cpp:
(WebKit::WebPopupItem::decode):
* Shared/WebPopupItem.h:
* Shared/WebUserContentControllerDataTypes.cpp:
(WebKit::WebUserScriptData::decode):
(WebKit::WebUserStyleSheetData::decode):
(WebKit::WebScriptMessageHandlerData::decode):
* Shared/WebUserContentControllerDataTypes.h:
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::Entry::decode):
* Shared/WebsiteData/WebsiteData.h:
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::decode):
* Shared/ios/WebPlatformTouchPointIOS.cpp:
(WebKit::WebPlatformTouchPoint::decode):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<KeypressCommand>::decode):
* UIProcess/LegacySessionStateCodingNone.cpp:
(WebKit::decodeLegacySessionState):
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(WebKit::PlatformCAAnimationRemote::KeyframeValue::decode):
(WebKit::PlatformCAAnimationRemote::Properties::decode):

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

3 years agoUpdate bot configuration for iOS 11.
ryanhaddad@apple.com [Tue, 19 Sep 2017 22:17:58 +0000 (22:17 +0000)]
Update bot configuration for iOS 11.
https://bugs.webkit.org/show_bug.cgi?id=177165

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
(BubbleQueueServer):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
(table.queue-grid tr.platform.ios-simulator-10 img.logo): Deleted.
(table.queue-grid tr.platform.ios-10 img.logo): Deleted.
* BuildSlaveSupport/build.webkit.org-config/wkbuild.py:
(_should_file_trigger_build):
* BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py:
(ShouldBuildTest):
(ShouldBuildTest.test_should_build):

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

3 years agoOn iOS, getData can't get text set by setData during copy event
rniwa@webkit.org [Tue, 19 Sep 2017 21:50:03 +0000 (21:50 +0000)]
On iOS, getData can't get text set by setData during copy event
https://bugs.webkit.org/show_bug.cgi?id=176980
<rdar://problem/34453915>

Reviewed by Darin Adler.

Source/WebCore:

The bug was caused by iOS port not implementing Pasteboard::createPrivate(). Rather than implementing this in iOS,
replace its use for copy & paste events by StaticPasteboard Wenson added for input events. This makes read-write
pasteboard platform agnostic and paves the way to make writing to pasteboard in a single IPC in WebKit2.

Also fixed a bug that iOS port's Pasteboard::types returned the list of all supported types instead of ones
actually present in the pasteboard.

This patch also adds a vector of types to StaticPasteboard to maintain the type order.

Tests: editing/pasteboard/dataTransfer-types-is-initially-empty-on-copy.html
       editing/pasteboard/dataTransfer-types-pasting-plaintext.html

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::createForCopyAndPaste): Make StaticPasteboard instead of a private pasteboard.
(WebCore::DataTransfer::createForInputEvent):
* editing/Editor.cpp:
(WebCore::dispatchClipboardEvent): Call newly added commitToPasteboard on StaticPasteboard.
* platform/Pasteboard.h:
(WebCore::Pasteboard::isStatic const):
* platform/PasteboardStrategy.h:
* platform/StaticPasteboard.cpp:
(WebCore::StaticPasteboard::create): Deleted.
(WebCore::StaticPasteboard::StaticPasteboard):
(WebCore::StaticPasteboard::hasData):
(WebCore::StaticPasteboard::types): Deleted. Now simply returns m_type.
(WebCore::StaticPasteboard::readString): Added.
(WebCore::StaticPasteboard::writeString): Added.
(WebCore::StaticPasteboard::clear): Added.
(WebCore::StaticPasteboard::commitToPasteboard): Added.
(isType): Added.
* platform/StaticPasteboard.h:
(WebCore::Pasteboard::isStatic const): Added.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::createPrivate): Deleted.
(WebCore::Pasteboard::writePasteboard): Deleted.
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::createPrivate): Deleted.
(WebCore::Pasteboard::writePasteboard): Deleted.
(WebCore::addHTMLClipboardTypesForCocoaType):
(WebCore::Pasteboard::types): Return the actual list of types in the pasteboard.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::createPrivate): Deleted.
(WebCore::Pasteboard::writePasteboard): Deleted.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::createPrivate): Deleted.
(WebCore::Pasteboard::writePasteboard): Deleted.
* platform/wpe/PasteboardWPE.cpp:
(WebCore::Pasteboard::createPrivate): Deleted.
(WebCore::Pasteboard::writePasteboard): Deleted.

Source/WebKit:

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::copy): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::copy): Deleted.

LayoutTests:

Added regression tests to make sure dataTransfer.types returns an empty list when writing to a pasteboard (copy),
and doesn't contain image types when pasting plain text. Unfortunately, pasting image does result in plain text
content being present in the pasteboard in the form of URL so we can't test that scenario.

Also removed failing expectations from a number of tests that are now passing on iOS.

* editing/pasteboard/dataTransfer-types-is-initially-empty-on-copy-expected.txt: Added.
* editing/pasteboard/dataTransfer-types-is-initially-empty-on-copy.html: Added.
* editing/pasteboard/dataTransfer-types-pasting-plaintext-expected.txt: Added.
* editing/pasteboard/dataTransfer-types-pasting-plaintext.html: Added.
* platform/ios/TestExpectations:

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

3 years agoUse 'owned commit' instead of 'sub commit' whenever refers to a commit owned by anoth...
dewei_zhu@apple.com [Tue, 19 Sep 2017 21:47:41 +0000 (21:47 +0000)]
Use 'owned commit' instead of 'sub commit' whenever refers to a commit owned by another commit.
https://bugs.webkit.org/show_bug.cgi?id=177178

Reviewed by Ryosuke Niwa.

We use both 'owned commit' and 'sub commit' to refer to a commit owned by an another commit. We should use one term instead of two.
Renaming 'subCommit' to 'ownedCommit', 'ownsSubCommit' to 'ownsCommit' and 'sub-commit' to 'owned-commit'.

* browser-tests/commit-log-viewer-tests.js:
* public/api/commits.php:
* public/api/report-commits.php:
* public/include/commit-log-fetcher.php:
* public/v3/components/commit-log-viewer.js:
(CommitLogViewer.prototype._renderCommitList):
* public/v3/components/owned-commit-viewer.js: Renamed from Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js.
(OwnedCommitViewer):
(OwnedCommitViewer.prototype.didConstructShadowTree):
(OwnedCommitViewer.prototype._toggleVisibility):
(OwnedCommitViewer.prototype.render):
(OwnedCommitViewer.prototype._renderOwnedCommitTable):
(OwnedCommitViewer.htmlTemplate):
(OwnedCommitViewer.cssTemplate):
* public/v3/index.html:
* public/v3/models/commit-log.js:
(CommitLog):
(CommitLog.prototype.updateSingleton):
(CommitLog.prototype.ownsCommits):
(CommitLog.prototype.fetchOwnedCommits):
(CommitLog.prototype._buildOwnedCommitMap):
(CommitLog.diffOwnedCommits):
(CommitLog.prototype.ownsSubCommits): Deleted.
(CommitLog.prototype.fetchSubCommits): Deleted.
(CommitLog.prototype._buildSubCommitMap): Deleted.
(CommitLog.diffSubCommits): Deleted.
* server-tests/api-commits-tests.js:
* server-tests/api-report-commits-tests.js:
* server-tests/tools-os-build-fetcher-tests.js:
(return.waitForInvocationPromise.then):
(string_appeared_here.return.waitForInvocationPromise.then):
* tools/js/os-build-fetcher.js:
(prototype._fetchAvailableBuilds):
(prototype._addOwnedCommitsForBuild):
(prototype._addSubCommitsForBuild): Deleted.
* unit-tests/commit-log-tests.js:
(return.commit.fetchOwnedCommits.then):
(return.fetchingPromise.then):
(return.commit.fetchSubCommits.then): Deleted.

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

3 years agoAXObjectCache::performDeferredCacheUpdate is called recursively through FrameView...
zalan@apple.com [Tue, 19 Sep 2017 21:23:18 +0000 (21:23 +0000)]
AXObjectCache::performDeferredCacheUpdate is called recursively through FrameView::layout.
https://bugs.webkit.org/show_bug.cgi?id=176218
<rdar://problem/34205612>

Reviewed by Simon Fraser.

Source/WebCore:

There are certain cases when we might re-enter performDeferredCacheUpdate through recursive
layout calls (see webkit.org/b/177176) and mutate m_deferredTextChangedList multiple times.

Test: accessibility/crash-table-recursive-layout.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:

LayoutTests:

* accessibility/crash-table-recursive-layout-expected.txt: Added.
* accessibility/crash-table-recursive-layout.html: Added.

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

3 years ago[Cocoa] Add an ImageDecoder subclass backed by AVFoundation
jer.noble@apple.com [Tue, 19 Sep 2017 21:15:46 +0000 (21:15 +0000)]
[Cocoa] Add an ImageDecoder subclass backed by AVFoundation
https://bugs.webkit.org/show_bug.cgi?id=176825

Reviewed by Eric Carlson.

Source/WebCore:

Add a new concrete subclass of ImageDecoder which uses AVFoundation to parse and decode
image data.

AVFoundation APIs require prior knowledge of the media data's mime type to determine whether
the media data is decodable, so the mime type information must be passed through from the
CachedResource -> CachedImage -> ImageFrameCache -> ImageSource so as to be available when
creating the ImageDecoder:

(Drive-by fix: the createFrameImageAtIndex() method will mutate internal state, so make it
non-const.)

* loader/cache/CachedImage.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::mimeType const):
* platform/cf/CoreMediaSoftLink.cpp:
* platform/cf/CoreMediaSoftLink.h:
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/Image.cpp:
(WebCore::Image::mimeType const):
(WebCore::Image::expectedContentSize const):
* platform/graphics/Image.h:
* platform/graphics/ImageDecoder.cpp:
(WebCore::ImageDecoder::create):
* platform/graphics/ImageDecoder.h:
(WebCore::ImageDecoder::setExpectedContentSize):
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::mimeType const):
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageObserver.h:
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ensureDecoderAvailable):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::createFrameImageAtIndex):
* platform/graphics/cg/ImageDecoderCG.h:

Add the new class, ImageDecoderAVFObjC:

AVFoundation expects to load all the media data for an AVURLAsset itself. To map between the
provided SharedData and AVURLAsset's requirements, create a delegate object
WebCoreSharedBufferResourceLoaderDelegate, which responds to requests from the AVURLAsset by
extracting data from the SharedData object. Ensure AVURLAsset doesn't load any data outside
this delegate by passing the AVURLAssetReferenceRestrictionsKey /
AVAssetReferenceRestrictionForbidAll key and value in the AVURLAsset creation options.

* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h: Added.
(WebCore::ImageDecoderAVFObjC::create):
(WebCore::ImageDecoderAVFObjC::mimeType const):
(WebCore::ImageDecoderAVFObjC::RotationProperties::isIdentity const):
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: Added.
(SOFT_LINK_CONSTANT):
(-[WebCoreSharedBufferResourceLoaderDelegate initWithParent:]):
(-[WebCoreSharedBufferResourceLoaderDelegate setExpectedContentSize:]):
(-[WebCoreSharedBufferResourceLoaderDelegate updateData:complete:]):
(-[WebCoreSharedBufferResourceLoaderDelegate canFulfillRequest:]):
(-[WebCoreSharedBufferResourceLoaderDelegate enqueueRequest:]):
(-[WebCoreSharedBufferResourceLoaderDelegate fulfillPendingRequests]):
(-[WebCoreSharedBufferResourceLoaderDelegate fulfillRequest:]):
(-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
(-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
(WebCore::customSchemeURL):
(WebCore::imageDecoderAssetOptions):
(WebCore::transformToRotationProperties):
(WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
(WebCore::ImageDecoderAVFObjC::canDecodeType):
(WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
(WebCore::ImageDecoderAVFObjC::readSampleMetadata): Parses the media data using AVSampleCursor to walk
    the media sample table, extracting frame presentation time, decode time, and duration.
(WebCore::ImageDecoderAVFObjC::readTrackMetadata): Reads the affine transform and size information from
    the AVAssetTrack, and transforms the transform into a rotation value.
(WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Decompress the incoming sample data, optionally rotate
    the output, and store the results in the sample data vector.
(WebCore::ImageDecoderAVFObjC::advanceCursor): Wrap around the end of the sample table.
(WebCore::ImageDecoderAVFObjC::setTrack): Reset all sample and track metadata.
(WebCore::ImageDecoderAVFObjC::encodedDataStatus const): Retrieve from sample data.
(WebCore::ImageDecoderAVFObjC::frameCount const): Ditto.
(WebCore::ImageDecoderAVFObjC::repetitionCount const): Ditto.
(WebCore::ImageDecoderAVFObjC::uti const): Ditto.
(WebCore::ImageDecoderAVFObjC::filenameExtension const): Ditto.
(WebCore::ImageDecoderAVFObjC::frameSizeAtIndex const): Ditto.
(WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const): Ditto.
(WebCore::ImageDecoderAVFObjC::frameOrientationAtIndex const): Ditto.
(WebCore::ImageDecoderAVFObjC::frameDurationAtIndex const): Ditto.
(WebCore::ImageDecoderAVFObjC::frameHasAlphaAtIndex const): Ditto.
(WebCore::ImageDecoderAVFObjC::frameAllowSubsamplingAtIndex const): Ditto.
(WebCore::ImageDecoderAVFObjC::frameBytesAtIndex const): Ditto.
(WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): If the sample data has already been
    decompressed, return it. Otherwise, walk through the sample table decompressing frames
    until the desired frame is decoded.
(WebCore::ImageDecoderAVFObjC::setData):
(WebCore::ImageDecoderAVFObjC::clearFrameBufferCache):

Modify WebCoreDecompressionSession so that it can emit frames which have been converted from
YUV -> RGB as part of the decode operation. Also, add a synchronous decoding operation
method, for use in ImageDecoderAVFObjC.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureDecompressionSession):
* platform/graphics/cocoa/WebCoreDecompressionSession.h:
(WebCore::WebCoreDecompressionSession::createOpenGL):
(WebCore::WebCoreDecompressionSession::createRGB):
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession):
(WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
(WebCore::WebCoreDecompressionSession::decodeSample):
(WebCore::WebCoreDecompressionSession::decodeSampleSync):

Other changes:

* WebCore.xcodeproj/project.pbxproj: Add new files to project.
* platform/cocoa/VideoToolboxSoftLink.cpp: Add newly referenced methods.
* platform/cocoa/VideoToolboxSoftLink.h: Ditto.

Source/WTF:

* wtf/Platform.h:

LayoutTests:

* fast/images/animated-image-mp4-expected.txt: Added.
* fast/images/animated-image-mp4.html: Added.
* fast/images/resources/animated-red-green-blue.mp4: Added.
* platform/ios/TestExpectations:

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

3 years agoMarked imported/w3c/web-platform-tests/background-fetch/interfaces-worker.https.html...
jlewis3@apple.com [Tue, 19 Sep 2017 21:11:41 +0000 (21:11 +0000)]
Marked imported/w3c/web-platform-tests/background-fetch/interfaces-worker.https.html as flaky on El Capitan Debug.
https://bugs.webkit.org/show_bug.cgi?id=176486

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years ago[Curl] Move Authentication related tasks into AuthenticationChallenge class
commit-queue@webkit.org [Tue, 19 Sep 2017 20:45:09 +0000 (20:45 +0000)]
[Curl] Move Authentication related tasks into AuthenticationChallenge class
https://bugs.webkit.org/show_bug.cgi?id=177105

Currently those codes are in ResourceHandle or related companion. It will
be reused with NetworkLoadTask so that it should be separated from them.

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-09-19
Reviewed by Alex Christensen.

* platform/Curl.cmake:
* platform/network/curl/AuthenticationChallenge.h:
(WebCore::AuthenticationChallenge::AuthenticationChallenge): Deleted.
(WebCore::AuthenticationChallenge::authenticationClient const): Deleted.
(WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
* platform/network/curl/AuthenticationChallengeCurl.cpp: Added.
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::AuthenticationChallenge::protectionSpaceServerTypeFromURI):
(WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
(WebCore::AuthenticationChallenge::removeLeadingAndTrailingQuotes):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
(WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
(WebCore::removeLeadingAndTrailingQuotes): Deleted.
(WebCore::ResourceHandleCurlDelegate::getProtectionSpace): Deleted.
* platform/network/curl/ResourceHandleCurlDelegate.h:

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

3 years ago[CMake] Add ENABLE_WEB_CRYPTO option and make ENABLE_SUBTLE_CRYPTO depend on it.
clopez@igalia.com [Tue, 19 Sep 2017 20:42:26 +0000 (20:42 +0000)]
[CMake] Add ENABLE_WEB_CRYPTO option and make ENABLE_SUBTLE_CRYPTO depend on it.
https://bugs.webkit.org/show_bug.cgi?id=177180

Reviewed by Michael Catanzaro.

This adds a ENABLE_WEB_CRYPTO flag and makes ENABLE_SUBTLE_CRYPTO depend on it.
The GTK and WPE ports enable them and set ENABLE_WEB_CRYPTO to public.

* Source/cmake/OptionsGTK.cmake: Set both features to ON and ENABLE_WEB_CRYPTO to public. No change in behaviour for GTK.
* Source/cmake/OptionsWPE.cmake: Do like on the GTK port. The public flag is now ENABLE_WEB_CRYPTO.
* Source/cmake/WebKitFeatures.cmake: Add the definition of ENABLE_WEB_CRYPTO and make ENABLE_SUBTLE_CRYPTO depend on it.

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

3 years agoDo not mutate RenderText content during layout.
zalan@apple.com [Tue, 19 Sep 2017 20:28:29 +0000 (20:28 +0000)]
Do not mutate RenderText content during layout.
https://bugs.webkit.org/show_bug.cgi?id=176219
<rdar://problem/34205724>

Reviewed by David Hyatt.

Source/WebCore:

Update combined text when the style/content change as opposed to lazily, during layout.
-content mutation during layout might make the inline tree go out of sync.

Test: fast/text/international/dynamic-text-combine-crash.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::styleDidChange):
(WebCore::RenderCombineText::setRenderedText):
(WebCore::RenderCombineText::combineTextIfNeeded):
(WebCore::RenderCombineText::combineText): Deleted.
* rendering/RenderCombineText.h:
* rendering/RenderText.h:
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::skipLeadingWhitespace):

LayoutTests:

* fast/text/international/dynamic-text-combine-crash.html: Added.
* fast/text/text-combine-crash-expected.txt:

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

3 years agocreateMarkupInternal should protect its pointer to the Range's common ancestor
wenson_hsieh@apple.com [Tue, 19 Sep 2017 20:25:47 +0000 (20:25 +0000)]
createMarkupInternal should protect its pointer to the Range's common ancestor
https://bugs.webkit.org/show_bug.cgi?id=177033
<rdar://problem/34265390>

Reviewed by Tim Horton.

Source/WebCore:

Adds basic safeguarding to codepaths hit while executing an outdent command.

Test: editing/execCommand/outdent-with-media-query-listener-in-iframe.html

* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::outdentRegion):

Avoid an infinite loop if endOfCurrentParagraph is a null position.

* editing/markup.cpp:
(WebCore::createMarkupInternal):

Protect the raw pointer to the Range's common ancestor node.

LayoutTests:

Adds a test that removes the common ancestor node of a range in the middle of executing an outdent.

* editing/execCommand/outdent-with-media-query-listener-in-iframe-expected.txt: Added.
* editing/execCommand/outdent-with-media-query-listener-in-iframe.html: Added.

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

3 years agoPerformance Dashboard backend should support A/B testing for owned components.
dewei_zhu@apple.com [Tue, 19 Sep 2017 20:14:45 +0000 (20:14 +0000)]
Performance Dashboard backend should support A/B testing for owned components.
https://bugs.webkit.org/show_bug.cgi?id=175978

Reviewed by Ryosuke Niwa.

Add backend change for Performance Dashboard to support A/B testing for owned components.
Added 'commitset_commit_owner' and 'commitset_requires_build' columns to 'commit_set_items' table.
'commitset_commit_owner' referrs to determine a commit with owner.
'commitset_requires_build' indicates whether a root build is required.
This will be set true whenever commit_set_item specifies a patch file,
or commit_set_item is commit with owner commit,
or any other commit from same repository and in same build-request group requires build.
SQL for updating existing database:
    'BEGIN;
        ALTER TABLE commit_set_items ADD COLUMN commitset_commit_owner integer REFERENCES commits DEFAULT NULL, ADD COLUMN commitset_requires_build boolean DEFAULT FALSE;
        UPDATE commit_set_items SET commitset_requires_build = TRUE WHERE commitset_patch_file IS NOT NULL;
        UPDATE commit_set_items SET commitset_requires_build = TRUE WHERE commitset_set IN (SELECT requests1.request_commit_set FROM build_requests as requests1 JOIN build_requests as requests2 ON requests1.request_group = requests2.request_group JOIN commit_set_items as item ON item.commitset_set = requests2.request_commit_set  WHERE item.commitset_patch_file IS NOT NULL);
        ALTER TABLE commit_set_items ADD CONSTRAINT commitset_item_with_patch_must_requires_build CHECK (commitset_patch_file IS NULL OR commitset_requires_build = TRUE),
            ADD CONSTRAINT commitset_item_with_owned_commit_must_requires_build CHECK (commitset_commit_owner IS NULL OR commitset_requires_build = TRUE);
    END;'

* init-database.sql: Updated 'commit_set_items' table.
* public/admin/triggerables.php: Only top level repository should show on triggerables page.
* public/include/build-requests-fetcher.php: Added 'commitOwner' and 'requireBuild' to 'revision_items'. Added 'commitOwner' field to a commit.
* public/include/db.php: Should be able to insert boolean value to database without explicted convert to 't' or 'f'.
* public/privileged-api/create-test-group.php:
    Added logic to process 'commitOwner' and 'requireBuild' in 'commit_set_items'.
    Removed a 'FIXME' that has been addressed before this commit.
* public/v3/models/build-request.js:
(BuildRequest.constructBuildRequestsFromData): Set 'commitOwner' field for a commit set item.
* public/v3/models/commit-set.js:
(CommitSet): Added maps for repository to commit owner and whether a repository requires builds.
(CommitSet.prototype.updateSingleton):
(CommitSet.prototype._updateFromObject):
(CommitSet.prototype.ownerRevisionForRepository): Returns owner revision for a given repository in current commit set.
(CommitSet.prototype.requiresBuildForRepository): Returns whether a repository need to build.
(CommitSet.prototype.equals): Equality check should include 2 new maps.
(CustomCommitSet): CustomCommitSet should be able to store commit with an owner commit.
(CustomCommitSet.prototype.setRevisionForRepository): Added each revision list entry should have 'ownerRevision'(null by default).
(CustomCommitSet.prototype.equals): Equality check should also check the equality of 'ownerRevision'.
(CustomCommitSet.prototype.ownerRevisionForRepository): Returns a owner revision for a given repository.
* public/v3/models/repository.js:
(Repository.prototype.findOwnedRepositoryByName): Return an repository owned by current repository with a given name.
* public/v3/models/test-group.js: Added 'ownerRevision' field in each entry of revisionSet.
* server-tests/api-build-requests-tests.js: Added tests.
* server-tests/privileged-api-create-test-group-tests.js: Added tests.
* server-tests/privileged-api-upload-file-tests.js: Fix unit tests by setting'requires_build' field to be true when updating commit_set_item which has a patch..
* server-tests/resources/mock-data.js: Added mock build requests with commit sets contain owned commits.
(MockData.jscRepositoryId): Returns id for JavaScriptsCore repository.
(MockData.addMockConfiguration): Added mock JavaScriptCore and owned JavaScriptCore repositories and commits associated with them.
(MockData.ownedJSCRepositoryId): Added a JavaScriptCore repository with WebKit as owner.
(MockData.addMockConfiguration): Added mock data for test cases those require a commit with a owner commit.
(MockData.addTestGroupWithOwnedCommits): Added mock data for analysis tasks, the build requires of which contains owned commits.
(MockData.set addAnotherTriggerable): Added another triggerable which has mac, webkit and javascript core repositories as triggerable repository group.
(MockData.set addAnotherMockTestGroup): Added another mock test group.
* tools/js/v3-models.js: Import CustomCommitSet.
* unit-tests/resources/mock-v3-models.js: Added an owned webkit repository.
* unit-tests/commit-set-tests.js: Added unit tests CustomCommitSet.

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

3 years agoUnreviewed, rolling out r222217 and r222214.
ryanhaddad@apple.com [Tue, 19 Sep 2017 20:09:09 +0000 (20:09 +0000)]
Unreviewed, rolling out r222217 and r222214.
This change introduced two LayoutTest failures.
https://bugs.webkit.org/show_bug.cgi?id=177026

Source/WebCore:

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::styleDidChange):
(WebCore::RenderCombineText::setRenderedText):
(WebCore::RenderCombineText::combineText):
(WebCore::RenderCombineText::combineTextIfNeeded): Deleted.
* rendering/RenderCombineText.h:
* rendering/RenderText.cpp:
* rendering/RenderText.h:
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::skipLeadingWhitespace):

LayoutTests:

* fast/text/international/dynamic-text-combine-crash-expected.txt: Removed.
* fast/text/international/dynamic-text-combine-crash.html: Removed.
* fast/text/text-combine-crash-expected.txt:

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

3 years agoAttempt to fix Linux build.
zalan@apple.com [Tue, 19 Sep 2017 19:32:01 +0000 (19:32 +0000)]
Attempt to fix Linux build.

* rendering/RenderText.cpp:

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

3 years agoWeb Inspector: Adopt named groups in complex regexes
commit-queue@webkit.org [Tue, 19 Sep 2017 18:46:35 +0000 (18:46 +0000)]
Web Inspector: Adopt named groups in complex regexes
https://bugs.webkit.org/show_bug.cgi?id=177117

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

* UserInterface/Base/URLUtilities.js:
(parseSecurityOrigin):
(parseDataURL):
(parseURL):
* UserInterface/Models/Color.js:
(WI.Color.fromString):

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

3 years agoPrimitive protocol should have capital name
fpizlo@apple.com [Tue, 19 Sep 2017 18:28:25 +0000 (18:28 +0000)]
Primitive protocol should have capital name
https://bugs.webkit.org/show_bug.cgi?id=177097

Reviewed by JF Bastien.

As soon as I started programming in WSL, I found that I preferred to capitalize protocol names. So, my
early decision to call the primitive protocol "primitive" instead of "Primitive" seems absurd now. This
change reverses that decision.

Aesthetically, this is a slight improvement. For example:

    struct Bar<T:Primitive> {
        Foo<device T^> f;
    }

This makes more sense since all of the non-keyword type identifiers are capital.

The one place where this is an aesthetic regression is native primitive typedefs, which now look like:

    native Primitive typedef bool;

I'm happy with that tradeoff, since native typedefs are only in the standard library. Users don't see
this.

* WebGPUShadingLanguageRI/AddressSpace.js:
(protocolSuffix):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/NativeType.js:
(NativeType.prototype.toString):
(NativeType):
* WebGPUShadingLanguageRI/Parse.js:
(parseNative):
* WebGPUShadingLanguageRI/StandardLibrary.js:
* WebGPUShadingLanguageRI/Test.js:
(TEST_passNullAndNotNullFullPoly):
(TEST_passNullAndNotNullFullPolyReverse):

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

3 years agoDo not mutate RenderText content during layout.
zalan@apple.com [Tue, 19 Sep 2017 18:07:57 +0000 (18:07 +0000)]
Do not mutate RenderText content during layout.
https://bugs.webkit.org/show_bug.cgi?id=176219
<rdar://problem/34205724>

Reviewed by David Hyatt.

Source/WebCore:

Update combined text when the style/content change as opposed to lazily, during layout.
-content mutation during layout might make the inline tree go out of sync.

Test: fast/text/international/dynamic-text-combine-crash.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::styleDidChange):
(WebCore::RenderCombineText::setRenderedText):
(WebCore::RenderCombineText::combineTextIfNeeded):
(WebCore::RenderCombineText::combineText): Deleted.
* rendering/RenderCombineText.h:
* rendering/RenderText.h:
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::skipLeadingWhitespace):

LayoutTests:

* fast/text/international/dynamic-text-combine-crash.html: Added.
* fast/text/text-combine-crash-expected.txt:

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

3 years agoMarked http/tests/websocket/tests/hybi/handshake-ok-with-legacy-websocket-response...
jlewis3@apple.com [Tue, 19 Sep 2017 17:56:41 +0000 (17:56 +0000)]
Marked http/tests/websocket/tests/hybi/handshake-ok-with-legacy-websocket-response-headers.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=176240

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

3 years agoExpose WKPageRef as a private property on WKWebView on Mac
achristensen@apple.com [Tue, 19 Sep 2017 17:45:06 +0000 (17:45 +0000)]
Expose WKPageRef as a private property on WKWebView on Mac
https://bugs.webkit.org/show_bug.cgi?id=177022
<rdar://problem/34342762>

Reviewed by Andy Estes.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _pageRefForTransitionToWKWebView]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

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

3 years agoMake _WKProcessPoolConfiguration.allowsCellularAccess actually work on iOS
achristensen@apple.com [Tue, 19 Sep 2017 17:41:42 +0000 (17:41 +0000)]
Make _WKProcessPoolConfiguration.allowsCellularAccess actually work on iOS
https://bugs.webkit.org/show_bug.cgi?id=177124

Reviewed by Andy Estes.

The boolean added in r213747 was getting lost in two places:
1. The API::ProcessPoolConfiguration gets copied before it's used, so we need to set the bool on the copy.
2. The bool was not getting copied from that ProcessPoolConfiguration to the NetworkProcessCreationParameters
to be sent to the NetworkProcess to be given to the NSURLSessionConfiguration in NetworkSessionCocoa.mm.

These two problems were fixed and verified manually with a customized iOS app on my phone.
Unfortunately, this cannot be tested well with our current test infrastructure.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):

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

3 years agoCannot put typedefs of templated structs inside structs
fpizlo@apple.com [Tue, 19 Sep 2017 16:38:37 +0000 (16:38 +0000)]
Cannot put typedefs of templated structs inside structs
https://bugs.webkit.org/show_bug.cgi?id=177123

Reviewed by Michael Saboff.

Ever since I wrote the generic type instantiation code in WSL, it had a bizarre stink to it. I
did not know what it was, until I met this test case:

    struct Foo { int2 x; }

The problem was that Type has a getter called instantiatedType, which invoked
InstantiateImmediates. That's great. Where we went wrong was that TypeRef overrode
instantiatedType, and then InstantiateImmediates called TypeRef.instantiatedType from its
visitTypeRef. What a mess. None of that was necessary for anything, and it was just wrong. This
patch fixes it so that:

- Type has an instantiatedType getter, which does InstantiateImmediates. I didn't change this.
  This was the only part of the status quo that really made sense.

- TypeRef no longer overrides instantiatedType.

- InstantianteImmediates.prototype.visitTypeRef now does what TypeRef's instantiatedType would
  have done.

And voila! This test case passes and so do all of the other test cases.

The reason why that specific test case did not work was that the use of a TypeDef (int2) for
a generic type instantiation (vec2<int>) caused there to be two TypeRef's in a row, sorta like
this, if we could use wrap() to denote a TypeRef that just wrapped another type:

    wrap(vec2<int>)

We would call instantiatedType on this monstrosity. Since TypeRef overrode instantiatedType,
we would stop there because that TypeRef has no type arguments - it's just a wrapper. Well,
actually, we'd do something a bit stranger than stopping there - there's more to the story -
but the effect was the same. Now we do InstantiateImmediates, which recursively builds a new
type. This chews through the wrapper and then instantiates the wrapped type, as we want it to.
Also, this approach no longer has the stink. instantiatedType isn't overriden by anyone
anymore!

* WebGPUShadingLanguageRI/Checker.js:
* WebGPUShadingLanguageRI/InstantiateImmediates.js:
(InstantiateImmediates.prototype.visitTypeRef):
(InstantiateImmediates.prototype.visitReferenceType): Deleted.
* WebGPUShadingLanguageRI/Test.js:
(TEST_instantiateStructInStructWithInt2):
* WebGPUShadingLanguageRI/TypeRef.js:
(TypeRef.wrap):
(TypeRef.prototype.setTypeAndArguments):
(TypeRef.prototype.toString):
(TypeRef):
(TypeRef.prototype.get instantiatedType): Deleted.

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

3 years agoREGRESSION(r214494): Web Inspector: Ignore cache button does not work in Network tab
commit-queue@webkit.org [Tue, 19 Sep 2017 16:03:09 +0000 (16:03 +0000)]
REGRESSION(r214494): Web Inspector: Ignore cache button does not work in Network tab
https://bugs.webkit.org/show_bug.cgi?id=177114
<rdar://problem/34505265>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-09-19
Reviewed by Brian Burg.

* UserInterface/Base/Main.js:
(WI.loaded):
We need to register the settings change handler regardless of what the
initial value of the setting is.

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

3 years agowebrtc/video-rotation.html is failing and now occasionally times out.
commit-queue@webkit.org [Tue, 19 Sep 2017 15:53:01 +0000 (15:53 +0000)]
webrtc/video-rotation.html is failing and now occasionally times out.
https://bugs.webkit.org/show_bug.cgi?id=175305

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

* TestExpectations: Marking test as passing.
* webrtc/video-rotation-expected.txt:
* webrtc/video-rotation.html: Removing unneded subtest. Purpose of the test is checking that rotation change video size.

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

3 years agoLayoutTest webrtc/video-getParameters.html is failing
commit-queue@webkit.org [Tue, 19 Sep 2017 15:51:50 +0000 (15:51 +0000)]
LayoutTest webrtc/video-getParameters.html is failing
https://bugs.webkit.org/show_bug.cgi?id=170148

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

* TestExpectations: Marking test as passing.
* webrtc/video-getParameters.html: Further sanitizing parameters against changes.

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

3 years ago[Win] WebKit fails to build with 64-bit Perl.
pvollan@apple.com [Tue, 19 Sep 2017 15:00:16 +0000 (15:00 +0000)]
[Win] WebKit fails to build with 64-bit Perl.
https://bugs.webkit.org/show_bug.cgi?id=177106

Reviewed by Brent Fulgham.

Visual Studio is installed in the 32-bit program files folder.

* Scripts/webkitdirs.pm:
(programFilesPathX86):
(visualStudioInstallDir):
(msBuildInstallDir):

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

3 years ago[GTK] The binding code of Media Source Extension of AudioTrack, VideoTrack and TextTr...
nael.ouedraogo@crf.canon.fr [Tue, 19 Sep 2017 09:00:15 +0000 (09:00 +0000)]
[GTK] The binding code of Media Source Extension of AudioTrack, VideoTrack and TextTrack is not generated
https://bugs.webkit.org/show_bug.cgi?id=174620

Reviewed by Michael Catanzaro.

LayoutTests/imported/w3c:

Fix WPT test that checks MSE interfaces. This test failed since webm is not supported for MSE in GTK port.
Already merged in WPT repository (https://github.com/w3c/web-platform-tests/pull/6531).

* web-platform-tests/media-source/interfaces.html:

Source/WebCore:

Add AudioTrackMediaSource, VideoTrackMediaSource and TextTrackMediaSource IDL files in CMakeLists. Fix WPT test
that checks MSE interfaces. This test failed since webm is not supported for MSE in GTK port. PR already merged
in WPT repository.

Remove skipped test that is now passing in TestExpectation. Modify expected file for GTK (same as mac).

* CMakeLists.txt:

LayoutTests:

Add AudioTrackMediaSource, VideoTrackMediaSource and TextTrackMediaSource IDL files in CMakeLists. Fix WPT test
that checks MSE interfaces. This test failed since webm is not supported for MSE in GTK port. PR already merged
in WPT repository.

Remove skipped test that is now passing in TestExpectation. Modify expected file for GTK (same as mac).

* platform/gtk/TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/media-source/interfaces-expected.txt: Added.

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

3 years agoWebDriver: wrong key name for capabilities in new session response
carlosgc@webkit.org [Tue, 19 Sep 2017 06:41:42 +0000 (06:41 +0000)]
WebDriver: wrong key name for capabilities in new session response
https://bugs.webkit.org/show_bug.cgi?id=177074

Reviewed by Brian Burg.

We are using "value", it should be "capabilities".
https://w3c.github.io/webdriver/webdriver-spec.html#new-session

* WebDriverService.cpp:
(WebDriver::WebDriverService::newSession):

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

3 years agoWebDriver: HTTP responses should include Cache-Control header with no-cache value
carlosgc@webkit.org [Tue, 19 Sep 2017 06:40:01 +0000 (06:40 +0000)]
WebDriver: HTTP responses should include Cache-Control header with no-cache value
https://bugs.webkit.org/show_bug.cgi?id=177073

Reviewed by Sergio Villar Senin.

6.3 Processing Model.
Set the response’s header with name and value with the following values:

Content-Type "application/json; charset=utf-8"
Cache-Control "no-cache"

https://w3c.github.io/webdriver/webdriver-spec.html#dfn-send-a-response

We were setting the Content-Type, but not the Cache-Control. This is checked by all WPT WebDriver tests.

* soup/HTTPServerSoup.cpp:
(WebDriver::HTTPServer::listen): Add Cache-Control header.

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

3 years ago[Harfbuzz] adjustSelectionRectForComplexText() should also pass the character range...
carlosgc@webkit.org [Tue, 19 Sep 2017 06:35:27 +0000 (06:35 +0000)]
[Harfbuzz] adjustSelectionRectForComplexText() should also pass the character range when shaping
https://bugs.webkit.org/show_bug.cgi?id=177049

Reviewed by Michael Catanzaro.

Now that the shaper support receiving a range we should use that also in
adjustSelectionRectForComplexText(). This will ensure consistent results with
getGlyphsAndAdvancesForComplexText().

* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::adjustSelectionRectForComplexText const):

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

3 years ago[WSL] Cannot put templated structs inside structs
fpizlo@apple.com [Tue, 19 Sep 2017 04:15:56 +0000 (04:15 +0000)]
[WSL] Cannot put templated structs inside structs
https://bugs.webkit.org/show_bug.cgi?id=177120

Reviewed by Myles Maxfield.

It turns out that we still need to instantiate structs even if not passing type arguments,
since its fields may need to be instantiated.

This makes Myles's test case pass. When writing the test case, I encountered parser bugs, and
I fixed them.

* WebGPUShadingLanguageRI/CallFunction.js:
(callFunction):
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitReferenceType):
* WebGPUShadingLanguageRI/FuncInstantiator.js:
(FuncInstantiator.prototype.getUnique):
(FuncInstantiator):
* WebGPUShadingLanguageRI/Parse.js:
(parseSuffixOperator):
(parsePossibleSuffix):
(parsePostIncrement):
* WebGPUShadingLanguageRI/StructType.js:
(StructType.prototype.instantiate):
* WebGPUShadingLanguageRI/Test.js:
(checkNumber):
(checkEnum):
(TEST_instantiateStructInStruct):
* WebGPUShadingLanguageRI/TypeRef.js:
(TypeRef.prototype.get instantiatedType):
(TypeRef.prototype.get isPrimitive):

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

3 years agoWSL should support enum
fpizlo@apple.com [Tue, 19 Sep 2017 03:44:25 +0000 (03:44 +0000)]
WSL should support enum
https://bugs.webkit.org/show_bug.cgi?id=176977

Reviewed by Myles Maxfield.

This implements enum. Enums members are referenced Java-style. For example, if we have an enum like:

    enum Bank {
        GP,
        FP
    }

Then you refer to the members by saying Bank.GP and Bank.FP.

Also adds a hack that makes operator- on a literal fold the literal. This fixes two issues:

- Lets you use negative literals in constexprs.
- Means that negative literals also get literal type unification.

WSL's constexpr support is really thin, but I think it's all we really need for now.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitEnumType):
(Checker.prototype.visitEnumLiteral):
* WebGPUShadingLanguageRI/ConstexprFolder.js: Added.
(ConstexprFolder.prototype.visitCallExpression):
(ConstexprFolder.prototype.visitTypeOrVariableRef):
(ConstexprFolder):
* WebGPUShadingLanguageRI/CreateLiteral.js:
(createLiteral.GenericLiteral.prototype.get valueForSelectedType):
(createLiteral.GenericLiteral.prototype.get negConstexpr):
* WebGPUShadingLanguageRI/DoubleLiteral.js:
(let.DoubleLiteral.createLiteral.negConstexpr):
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype.visitEnumLiteral):
* WebGPUShadingLanguageRI/EnumLiteral.js: Added.
(EnumLiteral):
(EnumLiteral.prototype.get member):
(EnumLiteral.prototype.get type):
(EnumLiteral.prototype.get isConstexpr):
(EnumLiteral.prototype.unifyImpl):
(EnumLiteral.prototype.toString):
* WebGPUShadingLanguageRI/EnumMember.js: Added.
(EnumMember):
(EnumMember.prototype.get origin):
(EnumMember.prototype.get name):
(EnumMember.prototype.toString):
* WebGPUShadingLanguageRI/EnumType.js: Added.
(EnumType):
(EnumType.prototype.add):
(EnumType.prototype.get origin):
(EnumType.prototype.get name):
(EnumType.prototype.get baseType):
(EnumType.prototype.get memberNames):
(EnumType.prototype.memberByName):
(EnumType.prototype.get members):
(EnumType.prototype.get memberMap):
(EnumType.prototype.get isPrimitive):
(EnumType.prototype.populateDefaultValue):
(EnumType.prototype.get size):
(EnumType.prototype.toString):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitGenericLiteral):
(Evaluator.prototype.visitEnumLiteral):
* WebGPUShadingLanguageRI/FloatLiteral.js:
(let.FloatLiteral.createLiteral.negConstexpr):
* WebGPUShadingLanguageRI/FoldConstexprs.js: Added.
(foldConstexprs):
* WebGPUShadingLanguageRI/IntLiteral.js:
(let.IntLiteral.createLiteral.negConstexpr):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/NameResolver.js:
(NameResolver.prototype.visitProtocolDecl):
* WebGPUShadingLanguageRI/Parse.js:
(parseConstexpr):
(parsePossibleSuffix):
(parseEnumMember):
(parseEnumType):
(parse):
* WebGPUShadingLanguageRI/Prepare.js:
(prepare):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitEnumType):
(Rewriter.prototype.visitEnumMember):
(Rewriter.prototype.visitEnumLiteral):
* WebGPUShadingLanguageRI/StructType.js:
(StructType.prototype.get origin):
(StructType.prototype.instantiate):
* WebGPUShadingLanguageRI/SynthesizeEnumFunctions.js: Added.
(synthesizeEnumFunctions):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
(checkEnum):
(TEST_simpleEnum):
(TEST_enumWithManualValues):
(TEST_enumWithoutZero):
(TEST_enumConstexprGenericFunction):
(TEST_enumConstexprGenericStruct):
* WebGPUShadingLanguageRI/UintLiteral.js:
(let.UintLiteral.createLiteral.negConstexpr):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitProtocolDecl):

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

3 years agoWSL prepare() should cache the parsed standard library
fpizlo@apple.com [Tue, 19 Sep 2017 03:19:22 +0000 (03:19 +0000)]
WSL prepare() should cache the parsed standard library
https://bugs.webkit.org/show_bug.cgi?id=177118

Reviewed by Myles Maxfield.

The execution time of Test.js is too damn high!

So I made it 2x faster by caching the parsed standard library.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/CloneProgram.js: Added.
(cloneProgram):
* WebGPUShadingLanguageRI/Prepare.js:
(let.prepare):
(prepare): Deleted.
* WebGPUShadingLanguageRI/StatementCloner.js: Added.
(StatementCloner.prototype.visitFuncDef):
(StatementCloner.prototype.visitNativeFunc):
(StatementCloner.prototype.visitNativeType):
(StatementCloner.prototype.visitTypeDef):
(StatementCloner.prototype.visitStructType):
(StatementCloner.prototype.visitConstexprTypeParameter):
(StatementCloner.prototype.visitProtocolDecl):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
(doTest):

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

3 years ago[WebGL] VideoTextureCopierCV doesn't correctly restore vertex attribute state
dino@apple.com [Tue, 19 Sep 2017 02:55:33 +0000 (02:55 +0000)]
[WebGL] VideoTextureCopierCV doesn't correctly restore vertex attribute state
https://bugs.webkit.org/show_bug.cgi?id=176771
<rdar://problem/34386621>

Reviewed by Antoine Quint.

Source/WebCore:

The OpenGL context in VideoTextureCopierCV wasn't being restored to
the state it had before rendering a video to a texture. Specifically
the vertex attribute values were never recorded by the state saver.

Update the existing test of VideoTextureCopierCV so that it is
explicitly doing something different from the WebCore code, which
means that state will have to be correctly restored for the test
to pass.

* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Make sure
to record the vertex attribute state once we know the location of the position attribute.
(WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
(WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
(WebCore::VideoTextureCopierCV::GC3DStateSaver::saveVertexAttribState): Save all the
applicable vertex attribute state information.
* platform/graphics/cv/VideoTextureCopierCV.h: GC3DStateSaver can use a reference
to the GC3D rather than a pointer.

LayoutTests:

Tweak this test to make sure it does something different from
the code in WebCore to render a video into a texture, thus
ensuring that we're testing state is correctly restored.

* fast/canvas/webgl/texImage2D-video-flipY-true.html:

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

3 years ago[WebGL] accelerated texImage2D for video doesn't respect flipY
dino@apple.com [Tue, 19 Sep 2017 02:52:38 +0000 (02:52 +0000)]
[WebGL] accelerated texImage2D for video doesn't respect flipY
https://bugs.webkit.org/show_bug.cgi?id=176491
<rdar://problem/33833511>

Reviewed by Jer Noble.

(Take 3 - this was rolled out due to a test failure)

Source/WebCore:

Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
back to software or fail to upload texture data. Fix this by intercepting
the texImage2D call, checking the orientation of the video, and running
a small shader program to flip it if necessary.

While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
none of our media decoders support video with alpha, so unfortunately
this will have no visible change.

Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
       fast/canvas/webgl/texImage2D-video-flipY-true.html

* platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
which is used to check the orientation of the source video.
* platform/cocoa/CoreVideoSoftLink.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
now handle flipped or premultiplied requests.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.

* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
simply framebuffer.
(WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
if they were created.
(WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
and the vertex buffer for drawing. Also records the location of the uniforms.
(WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
framebuffer object, and render the video texture into that framebuffer using a
shader that can flip the coordinates.
(WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
the state of the user's GraphicsContext3D while we're intercepting calls.
(WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
* platform/graphics/cv/VideoTextureCopierCV.h:

* platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
compilation and attribute access. This avoids going through ANGLE.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::compileShader):
(WebCore::GraphicsContext3D::compileShaderDirect):
(WebCore::GraphicsContext3D::getAttribLocationDirect):

LayoutTests:

Test that exercises UNPACK_FLIP_Y_WEBGL for video on the accelerated
path.

* fast/canvas/webgl/resources/orientation-flipped.mp4: Added.
* fast/canvas/webgl/resources/orientation-normal.mp4: Added.
* fast/canvas/webgl/texImage2D-video-flipY-false-expected.txt: Added.
* fast/canvas/webgl/texImage2D-video-flipY-false.html: Added.
* fast/canvas/webgl/texImage2D-video-flipY-true-expected.txt: Added.
* fast/canvas/webgl/texImage2D-video-flipY-true.html: Added.
* platform/ios/TestExpectations: This test is macOS only.
* platform/mac/TestExpectations: Mark an existing WebGL test as flakey, while
  a bug exposed here is investigated.

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

3 years agoMake ImageFrame::duration() return Seconds instead of float
commit-queue@webkit.org [Tue, 19 Sep 2017 02:45:32 +0000 (02:45 +0000)]
Make ImageFrame::duration() return Seconds instead of float
https://bugs.webkit.org/show_bug.cgi?id=177103

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

ScalableImageDecoder stores milliseconds for the duration of its ImageFrames.
But ImageFrameCache store seconds for the duration of its ImageFrames.
To fix this issue use Seconds for the ImageFrame duration.

* platform/graphics/BitmapImage.h:
* platform/graphics/ImageDecoder.h:
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::setDuration):
(WebCore::ImageFrame::duration const):
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::frameDurationAtIndex):
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::frameDurationAtIndex):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::frameDurationAtIndex const):
* platform/graphics/cg/ImageDecoderCG.h:
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameDurationAtIndex const):
* platform/image-decoders/ScalableImageDecoder.h:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::frameComplete):
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::readChunks):
(WebCore::PNGImageDecoder::frameHeader): Deleted.
(WebCore::PNGImageDecoder::init): Deleted.
(WebCore::PNGImageDecoder::clearFrameBufferCache): Deleted.
(WebCore::PNGImageDecoder::initFrameBuffer): Deleted.
(WebCore::PNGImageDecoder::frameComplete): Deleted.
(WebCore::PNGImageDecoder::processingStart): Deleted.
(WebCore::PNGImageDecoder::processingFinish): Deleted.
(WebCore::PNGImageDecoder::fallbackNotAnimated): Deleted.

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

3 years ago[Win] Compile error in InbandTextTrackPrivateAVCF::readNativeSampleBuffer.
pvollan@apple.com [Tue, 19 Sep 2017 01:56:34 +0000 (01:56 +0000)]
[Win] Compile error in InbandTextTrackPrivateAVCF::readNativeSampleBuffer.
https://bugs.webkit.org/show_bug.cgi?id=177108

Reviewed by Brent Fulgham.

The InbandTextTrackPrivateAVF::m_sampleInputBuffer is private and not accessible in this method.

* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:

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

3 years ago[CMake] Rename WebKit target to WebKitLegacy and rename WebKit2 target to WebKit
mcatanzaro@igalia.com [Tue, 19 Sep 2017 00:29:31 +0000 (00:29 +0000)]
[CMake] Rename WebKit target to WebKitLegacy and rename WebKit2 target to WebKit
https://bugs.webkit.org/show_bug.cgi?id=174558

Reviewed by Alex Christensen.

.:

* CMakeLists.txt:
* Source/PlatformGTK.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/WebKitCommon.cmake:
* Source/cmake/WebKitFS.cmake:

Source/WebDriver:

* CMakeLists.txt:

Source/WebKit:

* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* Shared/gtk/WebKitWaylandProtocol.xml: Renamed from Source/WebKit/Shared/gtk/WebKit2WaylandProtocol.xml.
* UIProcess/gtk/WaylandCompositor.cpp:
* WebProcess/gtk/WaylandCompositorDisplay.cpp:

Source/WebKitLegacy:

With help from Stephan Szabo, thanks!

* CMakeLists.txt:
* PlatformMac.cmake:
* PlatformWin.cmake:

Tools:

With help from Stephan Szabo, thanks!

* DumpRenderTree/PlatformMac.cmake:
* DumpRenderTree/PlatformWin.cmake:
* DumpRenderTree/win/AccessibilityControllerWin.cpp:
* DumpRenderTree/win/DRTDesktopNotificationPresenter.h:
* DumpRenderTree/win/DumpRenderTree.cpp:
* DumpRenderTree/win/EditingDelegate.h:
* DumpRenderTree/win/EventSender.cpp:
* DumpRenderTree/win/FrameLoadDelegate.cpp:
* DumpRenderTree/win/FrameLoadDelegate.h:
* DumpRenderTree/win/GCControllerWin.cpp:
* DumpRenderTree/win/HistoryDelegate.cpp:
* DumpRenderTree/win/HistoryDelegate.h:
* DumpRenderTree/win/PolicyDelegate.h:
* DumpRenderTree/win/ResourceLoadDelegate.cpp:
* DumpRenderTree/win/ResourceLoadDelegate.h:
* DumpRenderTree/win/TestRunnerWin.cpp:
* DumpRenderTree/win/TextInputControllerWin.cpp:
* DumpRenderTree/win/UIDelegate.cpp:
* DumpRenderTree/win/UIDelegate.h:
* DumpRenderTree/win/WorkQueueItemWin.cpp:
* MiniBrowser/gtk/CMakeLists.txt:
* MiniBrowser/mac/CMakeLists.txt:
* MiniBrowser/win/AccessibilityDelegate.cpp:
* MiniBrowser/win/AccessibilityDelegate.h:
* MiniBrowser/win/CMakeLists.txt:
* MiniBrowser/win/Common.cpp:
* MiniBrowser/win/DOMDefaultImpl.h:
* MiniBrowser/win/MiniBrowser.cpp:
* MiniBrowser/win/MiniBrowser.h:
* MiniBrowser/win/MiniBrowserWebHost.cpp:
* MiniBrowser/win/MiniBrowserWebHost.h:
* MiniBrowser/win/PageLoadTestClient.h:
* MiniBrowser/win/PrintWebUIDelegate.cpp:
* MiniBrowser/win/PrintWebUIDelegate.h:
* MiniBrowser/win/ResourceLoadDelegate.cpp:
* MiniBrowser/win/ResourceLoadDelegate.h:
* MiniBrowser/win/WebDownloadDelegate.h:
* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWPE.cmake:
* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/Tests/WebKitLegacy/win/ScaleWebView.cpp:
* TestWebKitAPI/Tests/WebKitLegacy/win/WebViewDestruction.cpp:
* TestWebKitAPI/glib/CMakeLists.txt:
* WebKitTestRunner/CMakeLists.txt:
* WebKitTestRunner/PlatformGTK.cmake:
* WebKitTestRunner/PlatformWPE.cmake:

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

3 years agoUnreviewed test gardening for macOS.
ryanhaddad@apple.com [Tue, 19 Sep 2017 00:19:59 +0000 (00:19 +0000)]
Unreviewed test gardening for macOS.

* platform/mac-elcapitan/editing/mac/attributed-string/font-style-variant-effect-expected.txt: Copied from LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-style-variant-effect-expected.txt.
* platform/mac-sierra/editing/mac/attributed-string/font-style-variant-effect-expected.txt:
* platform/mac/TestExpectations:
* platform/mac/fast/loader/file-url-mimetypes-3-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

3 years agoMark fast/css/display-contents-style-update.html as a failure on Windows.
pvollan@apple.com [Mon, 18 Sep 2017 23:44:29 +0000 (23:44 +0000)]
Mark fast/css/display-contents-style-update.html as a failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177109

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoFill out vector types in WSL's standard library
mmaxfield@apple.com [Mon, 18 Sep 2017 23:42:18 +0000 (23:42 +0000)]
Fill out vector types in WSL's standard library
https://bugs.webkit.org/show_bug.cgi?id=177063

Reviewed by Filip Pizlo.

Now that we have struct types, operator&[], and operator==, fill out a few of the builtin vector types in the
standard library. This patch creates three new types: vec2, vec3, and vec4, each of which takes a type
argument, so you can say vec4<float>. This patch also adds typedefs of int4, uint4, float4, and double4 (along
with their 2- and 3- length siblings).

This patch does not include the swizzling operators, so you can't say float4.yzw.

* WebGPUShadingLanguageRI/StandardLibrary.js:
(operator.T.vec2.T):
(bool.operator.T.Equatable):
(thread.T.operator.T):
(operator.T.vec3.T):
(operator.T.vec4.T):
* WebGPUShadingLanguageRI/Test.js:
(TEST_builtinVectors):

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

3 years agoSupport min() and max() in calc()
timothy_horton@apple.com [Mon, 18 Sep 2017 23:36:20 +0000 (23:36 +0000)]
Support min() and max() in calc()
https://bugs.webkit.org/show_bug.cgi?id=167000
<rdar://problem/30153481>

Reviewed by David Hyatt.
Patch originally by Myles Maxfield.

Source/WebCore:

Add two new toplevel functions to CSS, min() and max(), which take an
arbirary number of arguments and resolve to the minimum and maximum of
the resolved value of the arguments, respectively. It is also possible
to use min() and max() inside calc(), and to use calc()-like math
inside min() and max().

* css/CSSCalculationValue.cpp:
(WebCore::determineCategory):
min and max operators don't use determineCategory; we have a specific
implementation for them in createMinOrMax.

(WebCore::resolvedTypeForMinOrMax):
The spec says that min() and max() should be marked as invalid if they
have values of more than one type, but that percentages should resolve
against the destination type before making this determination. So,
if the destination type is length, percent turns into percent-length,
and similarly for number.

(WebCore::isIntegerResult):
Add an n-way implementation of isIntegerResult.

(WebCore::isSamePair):
(WebCore::CSSCalcOperation::createMinOrMax): Create a min() or max()
operation, as long as the types of arguments are all the same. Allow
lengths to upgrade the whole operation to percent-length, and numbers
to percent-number, which will cause us to use CalculationValue and friends
in order to do proper resolution of all of the parameters instead of
just comparing their numeric values.

(WebCore::CSSCalcOperation::createCalcExpression):
(WebCore::CSSCalcOperation::doubleValue):
(WebCore::CSSCalcOperation::computeLengthPx):
(WebCore::CSSCalcOperation::customCSSText):
(WebCore::CSSCalcOperation::primitiveType):
(WebCore::CSSCalcOperation::CSSCalcOperation):
(WebCore::CSSCalcOperation::evaluate):
(WebCore::CSSCalcOperation::evaluateOperator):
Adapt to child counts greater than two.

(WebCore::CSSCalcOperation::buildCssText):
Add support for min() and max().

(WebCore::CSSCalcExpressionNodeParser::parseCalc):
parseCalc now accepts a CSSValueID parameter indicating which calc function
it should parse (calc, webkit-calc, min, or max), and delegates to either
parseValueExpression or parseMinMaxExpression.

(WebCore::CSSCalcExpressionNodeParser::operatorValue):
(WebCore::CSSCalcExpressionNodeParser::parseValue):
If min() or max() are found while parsing a value (i.e. nested inside
either calc or themselves), use parseMinMaxExpression on that subtree.

(WebCore::CSSCalcExpressionNodeParser::parseValueTerm):
(WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
(WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.

(WebCore::CSSCalcExpressionNodeParser::parseMinMaxExpression):
Added. Parse an arbitrary number of comma-and-whitespace-separated children.

(WebCore::createBlendHalf):
Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.

(WebCore::createCSS):
Build the CSSCalcOperation for the platform-independent min and max operations.

(WebCore::CSSCalcValue::create):
Pass the function being parsed and the destination calc category for the
property being parsed for into create, and then into the parser so that
it can know which function it is parsing for, and what kind of result it
needs (as previously mentioned above in resolvedTypeForMinOrMax).

* css/CSSCalculationValue.h:
* css/CSSValueKeywords.in:
Add min and max functions as CSS keywords.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLength):
(WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
* platform/Length.cpp:
(WebCore::convertTo100PercentMinusLength):
Adapt to the CalcExpressionOperation constructor taking a vector of
arguments instead of two.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::CalcParser):
Store and pass the specific function being parsed down into CSSCalcValue.

(WebCore::CSSPropertyParserHelpers::consumeInteger):
(WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
(WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
(WebCore::CSSPropertyParserHelpers::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):
(WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
(WebCore::CSSPropertyParserHelpers::consumeAngle):
(WebCore::CSSPropertyParserHelpers::consumeTime):
Pass the destination type into each calc parser.

* platform/CalculationValue.cpp:
(WebCore::CalcExpressionOperation::evaluate const):
(WebCore::CalcExpressionOperation::operator== const):
(WebCore::CalcExpressionOperation::dump const):
(WebCore::operator<<):
(WebCore::CalcExpressionBinaryOperation::evaluate const): Deleted.
(WebCore::CalcExpressionBinaryOperation::operator== const): Deleted.
(WebCore::CalcExpressionBinaryOperation::dump const): Deleted.
* platform/CalculationValue.h:
(WebCore::CalcExpressionOperation::CalcExpressionOperation):
(WebCore::operator==):
(WebCore::toCalcExpressionOperation):
(WebCore::CalcExpressionBinaryOperation::CalcExpressionBinaryOperation): Deleted.
(WebCore::toCalcExpressionBinaryOperation): Deleted.
Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.
Adjust to having n>2 children.
Support min() and max() operators in various places.

LayoutTests:

* css3/calc/minmax-errors-expected.txt:
* css3/calc/minmax-errors.html:
* css3/calc/simple-minmax-expected.txt:
* css3/calc/simple-minmax.html:
Revive previously-unused tests for an earlier never-implemented version
of this feature, and add a bunch more interesting test cases from reading the spec.

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

3 years agoMark imported/blink/fast/events/panScroll-panIcon.html as flaky on Windows.
pvollan@apple.com [Mon, 18 Sep 2017 23:32:28 +0000 (23:32 +0000)]
Mark imported/blink/fast/events/panScroll-panIcon.html as flaky on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177077

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoWeb Inspector: RemoteObject.resolveNode should return a Promise
mattbaker@apple.com [Mon, 18 Sep 2017 23:14:47 +0000 (23:14 +0000)]
Web Inspector: RemoteObject.resolveNode should return a Promise
https://bugs.webkit.org/show_bug.cgi?id=177042

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

Update RemoteObject.resolveNode to return a promise instead of taking a
callback. If the promise is fulfilled, `remoteObject` will be non-null.

* UserInterface/Controllers/DOMTreeManager.js:
(WI.DOMTreeManager.prototype.inspectNodeObject.nodeAvailable):
(WI.DOMTreeManager.prototype.inspectNodeObject):
(WI.DOMTreeManager.prototype.getNodeContentFlowInfo.domNodeResolved): Deleted.

* UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype.toggleClass.WI.RemoteObject.resolveNode.then):
(WI.DOMNode.prototype.toggleClass):
(WI.DOMNode.prototype.scrollIntoView.WI.RemoteObject.resolveNode.then):
(WI.DOMNode.prototype.scrollIntoView):
(WI.DOMNode.prototype.toggleClass.resolvedNode.inspectedPage_node_toggleClass): Deleted.
(WI.DOMNode.prototype.toggleClass.resolvedNode): Deleted.
(WI.DOMNode.prototype.scrollIntoView.resolvedNode.inspectedPage_node_scrollIntoView): Deleted.
(WI.DOMNode.prototype.scrollIntoView.resolvedNode): Deleted.

* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.resolveNode):

* UserInterface/Views/BoxModelDetailsSectionRow.js:
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput.WI.RemoteObject.resolveNode.then):
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput):
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput.resolvedNode.toggleInlineStyleProperty): Deleted.
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput.resolvedNode.didToggle): Deleted.
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput.resolvedNode): Deleted.
* UserInterface/Views/CanvasDetailsSidebarPanel.js:

* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):

* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WI.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.nodeResolved.inspectedPage_node_collectPrototypes): Deleted.
(WI.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.nodeResolved): Deleted.
(WI.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.nodePrototypesReady): Deleted.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._createTooltipForNode.WI.RemoteObject.resolveNode.then):
(WI.DOMTreeElement.prototype._createTooltipForNode):
(WI.DOMTreeElement.prototype._createTooltipForNode.resolvedNode.dimensions): Deleted.
(WI.DOMTreeElement.prototype._createTooltipForNode.resolvedNode): Deleted.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype._hideElement.injectStyleAndToggleClass):
(WI.DOMTreeOutline.prototype._hideElement):
(WI.DOMTreeOutline):
(WI.DOMTreeOutline.prototype._hideElement.resolvedNode.injectStyleAndToggleClass): Deleted.
(WI.DOMTreeOutline.prototype._hideElement.resolvedNode): Deleted.

LayoutTests:

Updated tests to use promises instead of callbacks.

* inspector/dom/highlightNode.html:

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

3 years ago[Curl] Move error generation task into ResourceError
commit-queue@webkit.org [Mon, 18 Sep 2017 23:02:23 +0000 (23:02 +0000)]
[Curl] Move error generation task into ResourceError
https://bugs.webkit.org/show_bug.cgi?id=176963

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-09-18
Reviewed by Alex Christensen.

* platform/Curl.cmake:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::errorDescription):
(WebCore::CurlHandle::errorDescription const):
* platform/network/curl/CurlContext.h:
* platform/network/curl/ResourceError.h:
(WebCore::ResourceError::setSslErrors):
(WebCore::ResourceError::hasSSLConnectError const): Deleted.
(WebCore::ResourceError::doPlatformIsolatedCopy): Deleted.
* platform/network/curl/ResourceErrorCurl.cpp: Added.
(WebCore::ResourceError::httpError):
(WebCore::ResourceError::sslError):
(WebCore::ResourceError::hasSSLConnectError const):
(WebCore::ResourceError::doPlatformIsolatedCopy):
(WebCore::ResourceError::platformCompare):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::notifyFail):
(WebCore::ResourceHandleCurlDelegate::didFail):
* platform/network/curl/ResourceHandleCurlDelegate.h:

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

3 years agoErrorInstance and Exception need destroy methods
fpizlo@apple.com [Mon, 18 Sep 2017 22:41:04 +0000 (22:41 +0000)]
ErrorInstance and Exception need destroy methods
https://bugs.webkit.org/show_bug.cgi?id=177095

Reviewed by Saam Barati.

When I made ErrorInstance and Exception into JSDestructibleObjects, I forgot to make them
follow that type's protocol.

* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::destroy): Implement this to fix leaks.
* runtime/ErrorInstance.h:
* runtime/Exception.h: Change how this is declared now that this is a DestructibleObject.

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

3 years agoWSL needs to annotate vertex shaders and fragment shaders
mmaxfield@apple.com [Mon, 18 Sep 2017 22:39:30 +0000 (22:39 +0000)]
WSL needs to annotate vertex shaders and fragment shaders
https://bugs.webkit.org/show_bug.cgi?id=177066

Reviewed by Filip Pizlo.

Metal Shading Language requires annotating vertex and fragment shaders, so this information needs to be in
the source WSL file.

* WebGPUShadingLanguageRI/Func.js:
(Func):
(Func.prototype.get shaderType):
* WebGPUShadingLanguageRI/FuncDef.js:
(FuncDef):
* WebGPUShadingLanguageRI/NativeFunc.js:
(NativeFunc):
* WebGPUShadingLanguageRI/Parse.js:
(parseFuncDecl):
(parseProtocolFuncDecl):
(parseFuncDef):
(parseNativeFunc):
* WebGPUShadingLanguageRI/ResolveOverloadImpl.js:
(resolveOverloadImpl):
* WebGPUShadingLanguageRI/Test.js:

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

3 years agoWSL should know that constexpr parameters are not lvalues
fpizlo@apple.com [Mon, 18 Sep 2017 22:36:28 +0000 (22:36 +0000)]
WSL should know that constexpr parameters are not lvalues
https://bugs.webkit.org/show_bug.cgi?id=177104

Reviewed by Saam Barati.

This should be an error:

    void foo<int x>()
    {
        x = 42;
    }

Previously, it wasn't, because VariableRef always thought that it was an LValue. This patch
teaches the type checker that not all VariableRefs are LValues.

* WebGPUShadingLanguageRI/ConstexprTypeParameter.js:
(ConstexprTypeParameter.prototype.get varIsLValue):
* WebGPUShadingLanguageRI/FuncParameter.js:
(FuncParameter.prototype.get varIsLValue):
* WebGPUShadingLanguageRI/Test.js:
(TEST_nonArrayRefArrayLengthSucceed):
(TEST_nonArrayRefArrayLengthFail):
(TEST_nonArrayRefArrayLength): Deleted.
(TEST_assignLength): Deleted.
* WebGPUShadingLanguageRI/VariableDecl.js:
(VariableDecl.prototype.get varIsLValue):
* WebGPUShadingLanguageRI/VariableRef.js:
(VariableRef.prototype.get isLValue):

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

3 years ago[Cocoa] Upstream sandbox-related WebKitSystemInterface functions
aestes@apple.com [Mon, 18 Sep 2017 22:35:38 +0000 (22:35 +0000)]
[Cocoa] Upstream sandbox-related WebKitSystemInterface functions
https://bugs.webkit.org/show_bug.cgi?id=177047

Reviewed by Daniel Bates.

Source/WebKit:

* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
* Platform/spi/mac/QuarantineSPI.h: Added.
* Shared/SandboxExtension.h:
(): Deleted.
* Shared/mac/ChildProcessMac.mm:
(WebKit::enableSandboxStyleFileQuarantine):
(WebKit::ChildProcess::initializeSandbox):
* Shared/mac/SandboxExtensionMac.mm:
(WebKit::SandboxExtensionImpl::create):
(WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
(WebKit::SandboxExtensionImpl::~SandboxExtensionImpl):
(WebKit::SandboxExtensionImpl::consume):
(WebKit::SandboxExtensionImpl::invalidate):
(WebKit::SandboxExtensionImpl::getSerializedFormat):
(WebKit::SandboxExtension::Handle::Handle):
(WebKit::SandboxExtension::Handle::~Handle):
(WebKit::SandboxExtension::Handle::encode const):
(WebKit::SandboxExtension::Handle::decode):
(WebKit::SandboxExtension::createHandleWithoutResolvingPath):
(WebKit::SandboxExtension::createHandleForReadWriteDirectory):
(WebKit::SandboxExtension::createHandleForTemporaryFile):
(WebKit::SandboxExtension::createHandleForGenericExtension):
(WebKit::SandboxExtension::SandboxExtension):
(WebKit::SandboxExtension::~SandboxExtension):
(WebKit::SandboxExtension::revoke):
(WebKit::SandboxExtension::consume):
(WebKit::SandboxExtension::consumePermanently):
(WebKit::wkSandboxExtensionType): Deleted.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::didChooseFilesForOpenPanel):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::processDidFinishLaunching):
(WebKit::WebProcessPool::resumeDownload):
(WebKit::WebProcessPool::startMemorySampler):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):

Source/WTF:

* wtf/spi/darwin/SandboxSPI.h:

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

3 years agoWeb Inspector: make Canvas recording tests more human readable
webkit@devinrousso.com [Mon, 18 Sep 2017 22:27:05 +0000 (22:27 +0000)]
Web Inspector: make Canvas recording tests more human readable
https://bugs.webkit.org/show_bug.cgi?id=176441

Reviewed by Joseph Pecoraro.

* TestExpectations:

* inspector/canvas/resources/recording-utilities.js: Added.
(TestPage.registerInitializer):
Create common functions for requesting and printing a recording.

* inspector/canvas/recording-2d-expected.txt:
* inspector/canvas/recording-2d.html:

* inspector/canvas/recording-webgl-expected.txt:
* inspector/canvas/recording-webgl.html:

* inspector/canvas/recording-webgl-snapshots-expected.txt:
* inspector/canvas/recording-webgl-snapshots.html:

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

3 years agoWeb Inspector: introduce an AppController class and shared instance of it
bburg@apple.com [Mon, 18 Sep 2017 21:33:41 +0000 (21:33 +0000)]
Web Inspector: introduce an AppController class and shared instance of it
https://bugs.webkit.org/show_bug.cgi?id=177024

Reviewed by Matt Baker.

WebInspectorUI currently has an app controller singleton that's distributed
among many properties on the WI object, which also serves as a namespace for
classes, enums, and other frontend objects. The singleton should be a proper
class so that we can think more easily about what state is global.

In the process of moving pieces of Main.js into AppController, I intend to move
most UI related code into a view controller class for the top level view.
AppController really shouldn't be doing anything to the view hierarchy or DOM.
It is yet to be determined how responsibility for global DOM events, such as
those for keyboard shortcuts, will be handled.

This larger refactoring project will let us more easily do things like connect
to multiple debuggables in the same Inspector instance, and switch between views
of different debuggable targets. Even if this never comes to pass, the code will
be a lot easier to reason about and maintain in the future.

For the first patch, introduce {AppController, TestAppController} <: AppControllerBase.
Shared code goes in the base class. In the Main.html and Test.html files, first
construct the AppController and then call .initialize() to avoid cyclic dependencies
on the global singleton WI.sharedApp.

* UserInterface/Main.html:
* UserInterface/Test.html:
* UserInterface/Test/Test.js:
(WI.loaded):
* UserInterface/Base/Main.js:
(WI.loaded):
Move some shared code out of here into AppControllerBase.constructor.
Eventually WI.loaded should not exist, and its code will move elsewhere.

(WI.contentLoaded):
Adopt global reference.

* UserInterface/Controllers/AppControllerBase.js: Copied from Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js.
(WI.AppControllerBase):
(WI.AppControllerBase.prototype.get hasExtraDomains):
(WI.AppControllerBase.prototype.get debuggableType):
(WI.AppControllerBase.prototype.initialize):

* UserInterface/Controllers/AppController.js: New.
(WI.AppController):
(WI.AppController.prototype.get hasExtraDomains):
(WI.AppController.prototype.get debuggableType):
(WI.AppController.prototype.activateExtraDomains):

* UserInterface/Test/TestAppController.js: New.
(WI.TestAppController):
(WI.TestAppController.prototype.get hasExtraDomains):
(WI.TestAppController.prototype.get debuggableType):

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.defaultTimelineTypes):
(WI.TimelineManager.availableTimelineTypes):
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStarted):
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStopped):
(WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.sourceCodeTimelinesSupported):
* UserInterface/Protocol/InspectorObserver.js:
(WI.InspectorObserver.prototype.inspect):
(WI.InspectorObserver.prototype.activateExtraDomains):
(WI.InspectorObserver):
* UserInterface/Protocol/MainTarget.js:
(WI.MainTarget):
(WI.MainTarget.prototype.get displayName):
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel):
(WI.ResourceSidebarPanel.prototype.initialLayout):
(WI.ResourceSidebarPanel.prototype._addScript):
(WI.ResourceSidebarPanel.prototype._extraDomainsActivated):
* UserInterface/Views/Toolbar.js:
Use WI.sharedApp.{debuggableType, hasExtraDomains}.

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

3 years agoUnreviewed, rolling out r222170.
ryanhaddad@apple.com [Mon, 18 Sep 2017 21:04:58 +0000 (21:04 +0000)]
Unreviewed, rolling out r222170.

The API test added with this change is failing.

Reverted changeset:

"Allow WTF::map to use any class that is iterable and has a
size getter"
https://bugs.webkit.org/show_bug.cgi?id=177026
http://trac.webkit.org/changeset/222170

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

3 years agoAdd a section in WSL's documentation about how API objects and WSL interact
mmaxfield@apple.com [Mon, 18 Sep 2017 21:03:31 +0000 (21:03 +0000)]
Add a section in WSL's documentation about how API objects and WSL interact
https://bugs.webkit.org/show_bug.cgi?id=177089

Reviewed by Filip Pizlo.

No global variables; entry points accept arguments. Buffers are array references ([]),
and texture and sampler opaque types exist. Data is passed between stages in return
values.

* WebGPUShadingLanguageRI/WSL.md:

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

3 years agoAnother WK1 unflake attempt.
antti@apple.com [Mon, 18 Sep 2017 21:01:30 +0000 (21:01 +0000)]
Another WK1 unflake attempt.

* transitions/transition-display-property-2.html:

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

3 years ago[Curl] Forward declare SSL context
don.olmstead@sony.com [Mon, 18 Sep 2017 20:48:49 +0000 (20:48 +0000)]
[Curl] Forward declare SSL context

Unreviewed build fix after r222147. OpenSSL's SHA1 declaration conflicts with WTF's.

No new tests. No change in behavior.

* platform/network/curl/CurlSSLHandle.h:
* platform/network/curl/CurlSSLVerifier.cpp:
* platform/network/curl/CurlSSLVerifier.h:

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

3 years agogetData('text/plain') doesn't work on iOS 10
rniwa@webkit.org [Mon, 18 Sep 2017 20:38:15 +0000 (20:38 +0000)]
getData('text/plain') doesn't work on iOS 10
https://bugs.webkit.org/show_bug.cgi?id=177034

Reviewed by Wenson Hsieh.

Source/WebCore:

The bug was caused by the mispatch of UTI between reading & writing plain text.
Use kUTTypeText (instead of kUTTypePlainText) to read from UIPasteboard on iOS 10.

Re-enabled tests were passing on iOS 11 and continues to pass after this code change.

Tests: editing/pasteboard/clipboard-event.html
       editing/pasteboard/datatransfer-items-paste-plaintext.html
       editing/pasteboard/get-data-text-plain-paste.html

* platform/ios/PasteboardIOS.mm:
(WebCore::cocoaTypeFromHTMLClipboardType):

LayoutTests:

Removed the failing test expectations from tests that now pass on iOS.

* platform/ios/TestExpectations:

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

3 years ago[JSC] Consider dropping JSObjectSetPrototype feature for JSGlobalObject
utatane.tea@gmail.com [Mon, 18 Sep 2017 20:06:34 +0000 (20:06 +0000)]
[JSC] Consider dropping JSObjectSetPrototype feature for JSGlobalObject
https://bugs.webkit.org/show_bug.cgi?id=177070

Reviewed by Saam Barati.

Due to the security reason, our global object is immutable prototype exotic object.
It prevents users from injecting proxies into the prototype chain of the global object[1].
But our JSC API does not respect this attribute, and allows users to change [[Prototype]]
of the global object after instantiating it.

This patch removes this feature. Once global object is instantiated, we cannot change [[Prototype]]
of the global object. It drops JSGlobalObject::resetPrototype use, which involves GlobalThis
edge cases.

[1]: https://github.com/tc39/ecma262/commit/935dad4283d045bc09c67a259279772d01b3d33d

* API/JSObjectRef.cpp:
(JSObjectSetPrototype):
* API/tests/CustomGlobalObjectClassTest.c:
(globalObjectSetPrototypeTest):

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

3 years agoWeb Inspector: console.assert messages shouldn't end in an exclamation point
mattbaker@apple.com [Mon, 18 Sep 2017 19:35:18 +0000 (19:35 +0000)]
Web Inspector: console.assert messages shouldn't end in an exclamation point
https://bugs.webkit.org/show_bug.cgi?id=177054

Reviewed by Joseph Pecoraro.

* UserInterface/Base/EventListener.js:
* UserInterface/Base/EventListenerSet.js:
(WI.EventListenerSet.prototype.register):
Drive-by: make assertions the same in both.
* UserInterface/Views/LayoutTimelineView.js:
(WI.LayoutTimelineView.prototype._processPendingRecords):

* UserInterface/Views/Resizer.js:
(WI.Resizer.prototype._currentPosition):

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

3 years agoUnreviewed, fix typo.
fpizlo@apple.com [Mon, 18 Sep 2017 19:14:10 +0000 (19:14 +0000)]
Unreviewed, fix typo.

* WebGPUShadingLanguageRI/WSL.md:

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

3 years agoWSL cannot use typedefs of arrays
fpizlo@apple.com [Mon, 18 Sep 2017 18:57:29 +0000 (18:57 +0000)]
WSL cannot use typedefs of arrays
https://bugs.webkit.org/show_bug.cgi?id=177061

Reviewed by Saam Barati.

This test case didn't work before because of a missing visit call in Checker.

* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitTypeRef):
* WebGPUShadingLanguageRI/Test.js:
(TEST_typedefArray):

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

3 years agoWeb Inspector: REGRESSION(r221901): Single frame recordings don't reset the recording...
webkit@devinrousso.com [Mon, 18 Sep 2017 18:56:39 +0000 (18:56 +0000)]
Web Inspector: REGRESSION(r221901): Single frame recordings don't reset the recording navigation item
https://bugs.webkit.org/show_bug.cgi?id=176893

Reviewed by Matt Baker.

* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.recordingFinished):
Set the `_recordingCanvas` to null whenever a recording has finished and been sent to the
frontend. It is also necessary to do this inside `stopRecording`, as it is possible for the
user to start and stop a recording before any actions are recorded, meaning that no
recording would be sent to the frontend and this function will never get called.

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

3 years agoAllow WTF::map to use any class that is iterable and has a size getter
commit-queue@webkit.org [Mon, 18 Sep 2017 18:52:10 +0000 (18:52 +0000)]
Allow WTF::map to use any class that is iterable and has a size getter
https://bugs.webkit.org/show_bug.cgi?id=177026

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-18
Reviewed by Darin Adler.

Source/WebCore:

No change of behavior.
Using WTF::map to go from maps to vectors.

* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::resourceList):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchAllPendingUnloadEvents):

Source/WTF:

Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
Adding the possibility to pass a non const container reference and a lambda taking non const references as well.

* wtf/Vector.h:
(WTF::MapFunctionInspector::acceptsReference):
(WTF::Mapper::map):
(WTF::map):

Tools:

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

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

3 years agoFigure out how WSL will support field overloads like float4.xz and friends
fpizlo@apple.com [Mon, 18 Sep 2017 18:51:52 +0000 (18:51 +0000)]
Figure out how WSL will support field overloads like float4.xz and friends
https://bugs.webkit.org/show_bug.cgi?id=177031

Reviewed by JF Bastien.

WSL needs to support getters and setters, so that we can do things like:

    float4 vec;
    vec.zx = float2(1, 2);
    // z = 1, x = 2

There's no way to express this float4.zx returning a pointer to something, since it's doing swizzling.
It could return a crazy smart pointer, but that sounds like a lot of work. So, I decided to go for
lvalue emulation instead.

The idea of lvalue emulation is that when we try to make an lvalue work for an assignment or RMW
operation (like += and friends), we consider the possibility that we have to first load the value using
a getter and then store it with a setter. This patch makes this work recursively, so that this will
work:

    float4 vec;
    vec.zwx.y = 42;
    // now w is 42

This works because we decompose it automatically:

    float4 vec;
    float3 tmp = vec.zwx;
    tmp.y = 42;
    vec.zwx = tmp;

This'll work to any depth.

To check if this works, this patch adds two substantial new tests called TEST_genericAccessors() and
TEST_bitSubscriptAccessor(). This tests that this stuff works with a lot of generic types, and that it's
possible to turn integers into bitvectors using subscript overloading. This patch also adds smaller unit
tests also.

Oh, and it's now possible to get an array's length.

* WebGPUShadingLanguageRI/AddressSpace.js:
(needsPrimitiveProtocol):
(protocolSuffix):
* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/AnonymousVariable.js: Added.
(AnonymousVariable):
(AnonymousVariable.prototype.get origin):
(AnonymousVariable.prototype.get name):
(AnonymousVariable.prototype.toString):
* WebGPUShadingLanguageRI/ArrayRefType.js:
(ArrayRefType.prototype.argumentForAndOverload):
(ArrayRefType.prototype.argumentTypeForAndOverload):
* WebGPUShadingLanguageRI/ArrayType.js:
(ArrayType.prototype.argumentForAndOverload):
(ArrayType.prototype.argumentTypeForAndOverload):
(ArrayType):
* WebGPUShadingLanguageRI/Assignment.js:
(Assignment):
* WebGPUShadingLanguageRI/CallAssignment.js: Removed.
* WebGPUShadingLanguageRI/CallExpression.js:
(CallExpression.resolve):
(CallExpression.prototype.resolve):
(CallExpression.prototype.resolveToOverload):
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProgram):
(Checker.prototype.visitFuncDef):
(Checker.prototype.visitNativeFunc):
(Checker.prototype.visitProtocolDecl):
(Checker.prototype.visitIdentityExpression):
(Checker.prototype.visitReadModifyWriteExpression):
(Checker.prototype.visitAnonymousVariable):
(Checker.prototype.visitMakeArrayRefExpression):
(Checker.prototype._finishVisitingPropertyAccess):
(Checker.prototype.visitDotExpression):
(Checker.prototype.visitIndexExpression):
(Checker.prototype.visitCallExpression):
(Checker):
(Checker.prototype.visitProtocolDecl.NoticeTypeVariable.prototype.visitTypeRef): Deleted.
(Checker.prototype.visitProtocolDecl.NoticeTypeVariable.prototype.visitVariableRef): Deleted.
(Checker.prototype.visitProtocolDecl.NoticeTypeVariable): Deleted.
(Checker.prototype.visitProtocolDecl.set throw): Deleted.
* WebGPUShadingLanguageRI/CommaExpression.js:
* WebGPUShadingLanguageRI/DotExpression.js:
(DotExpression):
(DotExpression.prototype.get struct):
(DotExpression.prototype.get getFuncName):
(DotExpression.prototype.get andFuncName):
(DotExpression.prototype.get setFuncName):
* WebGPUShadingLanguageRI/EBuffer.js:
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype.visitAnonymousVariable):
(EBufferBuilder.prototype.visitLetExpression): Deleted.
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitIdentityExpression):
(Evaluator.prototype.visitMakePtrExpression):
(Evaluator.prototype.visitAnonymousVariable):
(Evaluator.prototype.visitDotExpression): Deleted.
(Evaluator.prototype.visitLetExpression): Deleted.
* WebGPUShadingLanguageRI/ExpressionFinder.js:
(ExpressionFinder.prototype.visitReadModifyWriteExpression):
(ExpressionFinder.prototype.visitIdentityExpression):
* WebGPUShadingLanguageRI/ForLoop.js:
(ForLoop.prototype.toString):
(ForLoop):
* WebGPUShadingLanguageRI/Func.js:
(Func):
* WebGPUShadingLanguageRI/FuncInstantiator.js:
(FuncInstantiator.prototype.getUnique.InstantiationSubstitution.prototype.visitCallExpression):
(FuncInstantiator.prototype.getUnique.InstantiationSubstitution):
(FuncInstantiator.prototype.getUnique.Instantiate.prototype.visitFuncDef):
(FuncInstantiator.prototype.getUnique.Instantiate.prototype.visitNativeFunc):
(FuncInstantiator.prototype.getUnique.Instantiate):
(FuncInstantiator.prototype.getUnique):
(FuncInstantiator):
* WebGPUShadingLanguageRI/IdentityExpression.js: Added.
(IdentityExpression):
(IdentityExpression.prototype.get target):
(IdentityExpression.prototype.get unifyNode):
(IdentityExpression.prototype.get isConstexpr):
(IdentityExpression.prototype.get isLValue):
(IdentityExpression.prototype.get addressSpace):
(IdentityExpression.prototype.toString):
* WebGPUShadingLanguageRI/IndexExpression.js: Added.
(IndexExpression):
(IndexExpression.prototype.get array):
(IndexExpression.prototype.get index):
(IndexExpression.prototype.get isLValue):
(IndexExpression.prototype.get addressSpace):
(IndexExpression.prototype.get getFuncName):
(IndexExpression.prototype.get andFuncName):
(IndexExpression.prototype.get setFuncName):
(IndexExpression.prototype.toString):
* WebGPUShadingLanguageRI/InferTypesForCall.js:
(inferTypesForCall):
* WebGPUShadingLanguageRI/Inline.js:
(_inlineFunction):
* WebGPUShadingLanguageRI/Inliner.js:
(Inliner.prototype.visitCallExpression):
(Inliner.prototype.visitDotExpression): Deleted.
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/LetExpression.js: Removed.
* WebGPUShadingLanguageRI/MakeArrayRefExpression.js:
(MakeArrayRefExpression.prototype.becomeConvertPtrToArrayRefExpression): Deleted.
* WebGPUShadingLanguageRI/NameContext.js:
(NameContext):
(NameContext.prototype.add):
(NameContext.prototype.doStatement):
(NameContext.prototype.handleDefining): Deleted.
(NameContext.prototype.isDefined): Deleted.
(NameContext.prototype.define): Deleted.
(NameContext.prototype.defineAll): Deleted.
* WebGPUShadingLanguageRI/NameResolver.js:
(NameResolver.prototype.doStatement):
(NameResolver.prototype.visitProtocolDecl):
(NameResolver.prototype.visitProgram): Deleted.
* WebGPUShadingLanguageRI/NativeFunc.js:
(NativeFunc):
* WebGPUShadingLanguageRI/NativeFuncInstance.js:
(NativeFuncInstance):
(NativeFuncInstance.prototype.get implementationData):
* WebGPUShadingLanguageRI/Node.js:
(Node.prototype.visit):
(Node.visit):
(Node.unify): Deleted.
* WebGPUShadingLanguageRI/NormalUsePropertyResolver.js: Added.
(NormalUsePropertyResolver.prototype.visitDotExpression):
(NormalUsePropertyResolver.prototype.visitIndexExpression):
(NormalUsePropertyResolver):
* WebGPUShadingLanguageRI/Parse.js:
(finishParsingPostIncrement):
(parsePossibleSuffix):
(finishParsingPreIncrement):
(genericParseCommaExpression):
(parseFuncName):
* WebGPUShadingLanguageRI/Prepare.js:
(prepare):
* WebGPUShadingLanguageRI/Program.js:
(Program):
(Program.prototype.get globalNameContext):
(Program.prototype.add):
* WebGPUShadingLanguageRI/PropertyAccessExpression.js: Added.
(PropertyAccessExpression):
(PropertyAccessExpression.prototype.get resultType):
(PropertyAccessExpression.prototype.rewriteAfterCloning):
(PropertyAccessExpression.prototype.updateCallsAfterChangingBase):
(PropertyAccessExpression.prototype.emitGet):
(PropertyAccessExpression.prototype.emitSet):
* WebGPUShadingLanguageRI/PropertyResolver.js: Added.
(PropertyResolver.prototype._visitPropertyAccess):
(PropertyResolver.prototype.visitDotExpression):
(PropertyResolver.prototype.visitIndexExpression):
(PropertyResolver.prototype._handleReadModifyWrite):
(PropertyResolver.prototype.visitReadModifyWriteExpression):
(PropertyResolver.prototype.visitAssignment):
(PropertyResolver.visitMakePtrExpression):
(PropertyResolver.prototype.visitMakeArrayRefExpression):
(PropertyResolver):
* WebGPUShadingLanguageRI/PtrType.js:
(PtrType.prototype.argumentForAndOverload):
(PtrType.prototype.argumentTypeForAndOverload):
(PtrType.prototype.returnTypeFromAndOverload):
* WebGPUShadingLanguageRI/ReadModifyWriteExpression.js: Added.
(ReadModifyWriteExpression):
(ReadModifyWriteExpression.prototype.get lValue):
(ReadModifyWriteExpression.prototype.oldValueRef):
(ReadModifyWriteExpression.prototype.newValueRef):
(ReadModifyWriteExpression.prototype.toString):
* WebGPUShadingLanguageRI/ResolveNames.js:
(createNameResolver):
(resolveNamesInTypes):
(resolveNamesInProtocols):
(resolveNamesInFunctions):
(resolveNames): Deleted.
* WebGPUShadingLanguageRI/ResolveOverloadImpl.js:
(resolveOverloadImpl):
* WebGPUShadingLanguageRI/ResolveProperties.js: Added.
(resolveProperties):
* WebGPUShadingLanguageRI/ResolveTypeDefs.js:
(resolveTypeDefsInTypes):
(resolveTypeDefsInProtocols):
(resolveTypeDefsInFunctions):
(resolveTypeDefs): Deleted.
* WebGPUShadingLanguageRI/ReturnChecker.js:
(ReturnChecker.prototype._isBoolCastFromLiteralTrue):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter):
(Rewriter.prototype.visitVariableDecl):
(Rewriter.prototype.visitTypeRef):
(Rewriter.prototype.visitAssignment):
(Rewriter.prototype.visitReadModifyWriteExpression):
(Rewriter.prototype.visitDereferenceExpression):
(Rewriter.prototype._handlePropertyAccessExpression):
(Rewriter.prototype.visitDotExpression):
(Rewriter.prototype.visitIndexExpression):
(Rewriter.prototype.visitReturn):
(Rewriter.prototype.visitGenericLiteralType):
(Rewriter.prototype.visitNullType):
(Rewriter.prototype.processDerivedCallData):
(Rewriter.prototype.visitCallExpression):
(Rewriter.prototype.visitFunctionLikeBlock):
(Rewriter.prototype.visitIfStatement):
(Rewriter.prototype.visitForLoop):
(Rewriter.prototype.visitAnonymousVariable):
(Rewriter.prototype.visitIdentityExpression):
(Rewriter.prototype.visitLetExpression): Deleted.
* WebGPUShadingLanguageRI/StandardLibrary.js:
* WebGPUShadingLanguageRI/StructLayoutBuilder.js:
(StructLayoutBuilder.prototype.visitNativeFuncInstance):
(StructLayoutBuilder):
* WebGPUShadingLanguageRI/StructType.js:
(StructType.prototype.instantiate):
* WebGPUShadingLanguageRI/Substitution.js:
(Substitution.prototype.get map):
* WebGPUShadingLanguageRI/SuffixCallAssignment.js: Removed.
* WebGPUShadingLanguageRI/SynthesizeStructAccessors.js: Added.
(synthesizeStructAccessors.createTypeParameters):
(synthesizeStructAccessors.):
(synthesizeStructAccessors.createFieldType):
(synthesizeStructAccessors.createTypeRef):
(synthesizeStructAccessors.setupAnder):
(synthesizeStructAccessors):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
(checkNumber):
(TEST_simpleProtocol):
(TEST_assignLength):
(TEST_simpleSetter):
(TEST_genericAccessors):
* WebGPUShadingLanguageRI/Type.js:
(Type.prototype.get isRef):
(Type.prototype.argumentForAndOverload):
(Type.prototype.argumentTypeForAndOverload):
(Type.prototype.returnTypeFromAndOverload):
(Type):
* WebGPUShadingLanguageRI/TypeParameterRewriter.js: Added.
(TypeParameterRewriter.prototype.visitConstexprTypeParameter):
(TypeParameterRewriter.prototype.visitTypeVariable):
(TypeParameterRewriter):
* WebGPUShadingLanguageRI/TypeVariableTracker.js: Added.
(TypeVariableTracker):
* WebGPUShadingLanguageRI/Value.js:
(Value.prototype.become):
(Value):
* WebGPUShadingLanguageRI/VariableRef.js:
(VariableRef.prototype.get unifyNode):
(VariableRef.prototype.get addressSpace):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitNativeFuncInstance):
(Visitor.prototype.visitProtocolDecl):
(Visitor): Deleted.
* WebGPUShadingLanguageRI/VisitorBase.js: Removed.

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

3 years agoAlways update display: contents styles in RenderTreeUpdater.
commit-queue@webkit.org [Mon, 18 Sep 2017 18:26:57 +0000 (18:26 +0000)]
Always update display: contents styles in RenderTreeUpdater.
https://bugs.webkit.org/show_bug.cgi?id=177065

Patch by Emilio Cobos Álvarez <emilio@crisal.io> on 2017-09-18
Reviewed by Antti Koivisto.

Source/WebCore:

Otherwise we keep an old style around, making following style updates wrong.

Test: fast/css/display-contents-style-update.html

* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):

LayoutTests:

* fast/css/display-contents-style-update-expected.html: Added.
* fast/css/display-contents-style-update.html: Added.

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

3 years agoAvoid style resolution when clearing focused element.
antti@apple.com [Mon, 18 Sep 2017 18:23:22 +0000 (18:23 +0000)]
Avoid style resolution when clearing focused element.
https://bugs.webkit.org/show_bug.cgi?id=176224
<rdar://problem/34206409>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: fast/dom/focus-style-resolution.html

* dom/Document.cpp:
(WebCore::Document::setFocusedElement):

    Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch.
    Style resolution may dispatch events.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didBlur):

    Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur.

LayoutTests:

* fast/dom/focus-style-resolution-expected.txt: Added.
* fast/dom/focus-style-resolution.html: Added.

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

3 years agoRolling out the previous to land again with a test.
antti@apple.com [Mon, 18 Sep 2017 18:21:17 +0000 (18:21 +0000)]
Rolling out the previous to land again with a test.

* dom/Document.cpp:
(WebCore::Document::setFocusedElement):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didBlur):

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

3 years ago[Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemIn...
aestes@apple.com [Mon, 18 Sep 2017 18:17:18 +0000 (18:17 +0000)]
[Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemInterface
https://bugs.webkit.org/show_bug.cgi?id=177048

Reviewed by Alex Christensen.

Source/WebKit:

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):
(IPC::readFromMachPort):
* Platform/cocoa/CrashReporter.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
* Platform/cocoa/CrashReporter.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
(WebKit::setCrashReportApplicationSpecificInformation):
* Platform/spi/Cocoa/CrashReporterClientSPI.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
* Shared/Cocoa/ChildProcessCocoa.mm:
(WebKit::ChildProcess::didReceiveInvalidMessage):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::_WKSetCrashReportApplicationSpecificInformation):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* WebKitTestRunner/cocoa/CrashReporterInfo.mm:
(WTR::setCrashReportApplicationSpecificInformationToURL):

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

3 years agoAvoid style resolution when clearing focused element.
antti@apple.com [Mon, 18 Sep 2017 18:14:52 +0000 (18:14 +0000)]
Avoid style resolution when clearing focused element.
https://bugs.webkit.org/show_bug.cgi?id=176224
<rdar://problem/34206409>

Reviewed by Zalan Bujtas.

Test: fast/dom/focus-style-resolution.html

* dom/Document.cpp:
(WebCore::Document::setFocusedElement):

    Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch.
    Style resolution may dispatch events.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didBlur):

    Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur.

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

3 years ago[WK1] Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing.
pvollan@apple.com [Mon, 18 Sep 2017 18:01:48 +0000 (18:01 +0000)]
[WK1] Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing.
https://bugs.webkit.org/show_bug.cgi?id=177071

Reviewed by Brent Fulgham.

The Page pointer in the history controller's frame is null. Add a null pointer check before
accessing the page.

No new tests, covered by exiting tests.

* loader/HistoryController.cpp:
(WebCore::HistoryController::updateForStandardLoad):
(WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
(WebCore::HistoryController::updateForClientRedirect):

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

3 years agoTry to unflake a test.
antti@apple.com [Mon, 18 Sep 2017 17:54:08 +0000 (17:54 +0000)]
Try to unflake a test.

Unreviewed.

* transitions/transition-display-property-2.html:

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

3 years agoMove baseline for editing/mac/attributed-string/font-style-variant-effect.html to...
ryanhaddad@apple.com [Mon, 18 Sep 2017 17:23:53 +0000 (17:23 +0000)]
Move baseline for editing/mac/attributed-string/font-style-variant-effect.html to mac-sierra.

Unreviewed test gardening.

* platform/mac-sierra/editing/mac/attributed-string/font-style-variant-effect-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/editing/mac/attributed-string/font-style-variant-effect-expected.txt.
* platform/win/TestExpectations: Drive by fix for an accidental commit.

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

3 years agobuild-webkit spawns fewer subprocesses than ninja uses by default
timothy_horton@apple.com [Mon, 18 Sep 2017 16:54:44 +0000 (16:54 +0000)]
build-webkit spawns fewer subprocesses than ninja uses by default
https://bugs.webkit.org/show_bug.cgi?id=177057

Reviewed by Alex Christensen.

* Scripts/build-webkit:
By default, ninja will parallelize over (cores + 2) jobs. build-webkit
specifies -j(cores), which overrides this. Remove our override if building
with ninja; just let it do its own thing. In my testing, this minor
change is the difference between ~10% idle CPU time and 0.

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

3 years agoLand a patch to verify svn->git update is working.
lforschler@apple.com [Mon, 18 Sep 2017 16:53:33 +0000 (16:53 +0000)]
Land a patch to verify svn->git update is working.

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

3 years agoMark http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl as a failure...
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:39 +0000 (16:26 +0000)]
Mark http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl as a failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177072

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoMark fast/events/beforeunload-dom-manipulation-crash.html as a crash on Windows.
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:37 +0000 (16:26 +0000)]
Mark fast/events/beforeunload-dom-manipulation-crash.html as a crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177071

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoMark http/tests/security/video-cross-origin-caching.html as a flaky crash on Windows.
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:35 +0000 (16:26 +0000)]
Mark http/tests/security/video-cross-origin-caching.html as a flaky crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=160447

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoUpdate my status.
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:33 +0000 (16:26 +0000)]
Update my status.

Unreviewed.

* Scripts/webkitpy/common/config/contributors.json:

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

3 years agoREGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html...
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:31 +0000 (16:26 +0000)]
REGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html is failing since r221974
https://bugs.webkit.org/show_bug.cgi?id=177036

Reviewed by Michael Catanzaro.

In r221974 I rewrote the characterIndexForXPosition implementation without taking into account that there can be
multiple glyphs for the same character, so we can't simply do index++ and index-- to get the next and previous
character index.

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition): Always get the character index from
m_glyphToCharacterIndexes array.

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

3 years agoStart working on WSL documentation
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:29 +0000 (16:26 +0000)]
Start working on WSL documentation
https://bugs.webkit.org/show_bug.cgi?id=177064

Reviewed by Mylex Maxfield.

This is a work in progress. I'd like to check it in and then keep adding to it.

* WebGPUShadingLanguageRI/WSL.md: Added.

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

3 years agoWSL needs to understand && and ||
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:13 +0000 (16:26 +0000)]
WSL needs to understand && and ||
https://bugs.webkit.org/show_bug.cgi?id=177062

Reviewed by Filip Pizlo.

Very similar to LogicalNot.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/Checker.js:
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Lexer.js:
(Lexer.prototype.next):
(Lexer):
* WebGPUShadingLanguageRI/LogicalExpression.js: Added.
(LogicalExpression):
(LogicalExpression.prototype.get text):
(LogicalExpression.prototype.get left):
(LogicalExpression.prototype.get right):
(LogicalExpression.prototype.toString):
* WebGPUShadingLanguageRI/Parse.js:
(parseLeftLogicalExpression):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitProtocolDecl):

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

3 years agoVirtualize ImageDecoder
jer.noble@apple.com [Mon, 18 Sep 2017 16:24:59 +0000 (16:24 +0000)]
Virtualize ImageDecoder
https://bugs.webkit.org/show_bug.cgi?id=176118

Reviewed by Eric Carlson.

Add an explicit, abstract base class ImageDecoder, and convert ImageDecoderCG to a true
subclass. This will allow multiple ImageDecoder subclasses to exist simultaneously at
runtime.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/ImageDecoders.cmake:
* platform/graphics/ImageDecoder.cpp: Added.
(WebCore::ImageDecoder::create):
(WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
* platform/graphics/ImageDecoder.h: Added.
(WebCore::ImageDecoder::isSizeAvailable):
(WebCore::ImageDecoder::isAllDataReceived const):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::ImageDecoderCG):
(WebCore::ImageDecoderCG::bytesDecodedToDetermineProperties):
(WebCore::ImageDecoderCG::uti const):
(WebCore::ImageDecoderCG::filenameExtension const):
(WebCore::ImageDecoderCG::encodedDataStatus const):
(WebCore::ImageDecoderCG::frameCount const):
(WebCore::ImageDecoderCG::repetitionCount const):
(WebCore::ImageDecoderCG::hotSpot const):
(WebCore::ImageDecoderCG::frameSizeAtIndex const):
(WebCore::ImageDecoderCG::frameIsCompleteAtIndex const):
(WebCore::ImageDecoderCG::frameOrientationAtIndex const):
(WebCore::ImageDecoderCG::frameDurationAtIndex const):
(WebCore::ImageDecoderCG::frameAllowSubsamplingAtIndex const):
(WebCore::ImageDecoderCG::frameHasAlphaAtIndex const):
(WebCore::ImageDecoderCG::frameBytesAtIndex const):
(WebCore::ImageDecoderCG::createFrameImageAtIndex const):
(WebCore::ImageDecoderCG::setData):
(WebCore::ImageDecoder::ImageDecoder): Deleted.
(WebCore::ImageDecoder::bytesDecodedToDetermineProperties): Deleted.
(WebCore::ImageDecoder::uti const): Deleted.
(WebCore::ImageDecoder::filenameExtension const): Deleted.
(WebCore::ImageDecoder::encodedDataStatus const): Deleted.
(WebCore::ImageDecoder::frameCount const): Deleted.
(WebCore::ImageDecoder::repetitionCount const): Deleted.
(WebCore::ImageDecoder::hotSpot const): Deleted.
(WebCore::ImageDecoder::frameSizeAtIndex const): Deleted.
(WebCore::ImageDecoder::frameIsCompleteAtIndex const): Deleted.
(WebCore::ImageDecoder::frameOrientationAtIndex const): Deleted.
(WebCore::ImageDecoder::frameDurationAtIndex const): Deleted.
(WebCore::ImageDecoder::frameAllowSubsamplingAtIndex const): Deleted.
(WebCore::ImageDecoder::frameHasAlphaAtIndex const): Deleted.
(WebCore::ImageDecoder::frameBytesAtIndex const): Deleted.
(WebCore::ImageDecoder::createFrameImageAtIndex const): Deleted.
(WebCore::ImageDecoder::setData): Deleted.
* platform/graphics/cg/ImageDecoderCG.h:
(WebCore::ImageDecoderCG::create):
(WebCore::ImageDecoder::create): Deleted.
(WebCore::ImageDecoder::isSizeAvailable): Deleted.
(WebCore::ImageDecoder::isAllDataReceived const): Deleted.
(WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoderDirect2D::ImageDecoderDirect2D):
(WebCore::ImageDecoderDirect2D::systemImagingFactory):
(WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties):
(WebCore::ImageDecoderDirect2D::filenameExtension const):
(WebCore::ImageDecoderDirect2D::isSizeAvailable const):
(WebCore::ImageDecoderDirect2D::encodedDataStatus const):
(WebCore::ImageDecoderDirect2D::size const):
(WebCore::ImageDecoderDirect2D::frameCount const):
(WebCore::ImageDecoderDirect2D::repetitionCount const):
(WebCore::ImageDecoderDirect2D::hotSpot const):
(WebCore::ImageDecoderDirect2D::frameSizeAtIndex const):
(WebCore::ImageDecoderDirect2D::frameIsCompleteAtIndex const):
(WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
(WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
(WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
(WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
(WebCore::ImageDecoderDirect2D::frameBytesAtIndex const):
(WebCore::ImageDecoderDirect2D::setTargetContext):
(WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const):
(WebCore::ImageDecoderDirect2D::setData):
* platform/graphics/win/ImageDecoderDirect2D.h:
(WebCore::ImageDecoderDirect2D::create):
(WebCore::ImageDecoder::create): Deleted.
(WebCore::ImageDecoder::isAllDataReceived const): Deleted.
(WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
* platform/image-decoders/ScalableImageDecoder.cpp: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.cpp.
(WebCore::ScalableImageDecoder::create):
(WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
(WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
(WebCore::ScalableImageDecoder::frameBytesAtIndex const):
(WebCore::ScalableImageDecoder::frameDurationAtIndex const):
(WebCore::ScalableImageDecoder::createFrameImageAtIndex):
(WebCore::ScalableImageDecoder::prepareScaleDataIfNecessary):
(WebCore::ScalableImageDecoder::upperBoundScaledX):
(WebCore::ScalableImageDecoder::lowerBoundScaledX):
(WebCore::ScalableImageDecoder::upperBoundScaledY):
(WebCore::ScalableImageDecoder::lowerBoundScaledY):
(WebCore::ScalableImageDecoder::scaledY):
* platform/image-decoders/ScalableImageDecoder.h: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.h.
(WebCore::ScalableImageDecoder::ScalableImageDecoder):
(WebCore::ScalableImageDecoder::~ScalableImageDecoder):
(WebCore::ScalableImageDecoder::premultiplyAlpha const):
(WebCore::ScalableImageDecoder::isAllDataReceived const):
(WebCore::ScalableImageDecoder::size const):
(WebCore::ScalableImageDecoder::scaledSize):
(WebCore::ScalableImageDecoder::setSize):
(WebCore::ScalableImageDecoder::setIgnoreGammaAndColorProfile):
(WebCore::ScalableImageDecoder::ignoresGammaAndColorProfile const):
(WebCore::ScalableImageDecoder::rgbColorProfile):
(WebCore::ScalableImageDecoder::subsamplingLevelForScale):
(WebCore::ScalableImageDecoder::inputDeviceColorProfile):
(WebCore::ScalableImageDecoder::setFailed):
(WebCore::ScalableImageDecoder::failed const):
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::BMPImageDecoder):
(WebCore::BMPImageDecoder::setData):
(WebCore::BMPImageDecoder::setFailed):
* platform/image-decoders/bmp/BMPImageDecoder.h:
* platform/image-decoders/bmp/BMPImageReader.h:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::GIFImageDecoder):
(WebCore::GIFImageDecoder::setData):
(WebCore::GIFImageDecoder::setSize):
(WebCore::GIFImageDecoder::setFailed):
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::ICOImageDecoder):
(WebCore::ICOImageDecoder::setData):
(WebCore::ICOImageDecoder::size):
(WebCore::ICOImageDecoder::setSize):
(WebCore::ICOImageDecoder::setFailed):
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::JPEGImageDecoder):
(WebCore::JPEGImageDecoder::setSize):
(WebCore::JPEGImageDecoder::setFailed):
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageReader::decode):
(WebCore::PNGImageDecoder::PNGImageDecoder):
(WebCore::PNGImageDecoder::setSize):
(WebCore::PNGImageDecoder::frameBufferAtIndex):
(WebCore::PNGImageDecoder::setFailed):
* platform/image-decoders/png/PNGImageDecoder.h:
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::WEBPImageDecoder):
(WebCore::WEBPImageDecoder::decode):
* platform/image-decoders/webp/WEBPImageDecoder.h:

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

3 years ago[Mac] Upstream miscellaneous WebKitSystemInterface functions
aestes@apple.com [Mon, 18 Sep 2017 16:21:29 +0000 (16:21 +0000)]
[Mac] Upstream miscellaneous WebKitSystemInterface functions
https://bugs.webkit.org/show_bug.cgi?id=177029

Reviewed by Alex Christensen.

Source/WebCore:

* Configurations/WebCore.xcconfig: Used -force_load of libPAL instead of -ObjC. This forces
the linker to load both Objective-C and C PAL symbols in WebCore. This change is needed for
PAL::popUpMenu(), which is used by WebKit and WebKitLegacy but not WebCore.
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::contextMenuItemTagSearchWeb):
* platform/cocoa/ScrollController.mm:
(WebCore::elasticDeltaForTimeDelta):
(WebCore::elasticDeltaForReboundDelta):
(WebCore::reboundDeltaForElasticDelta):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/mac/CursorMac.mm:
(WebCore::WKCoreCursor_coreCursorType):
(WebCore::createCoreCursorClass):
(WebCore::coreCursorClass):
(WebCore::cursor):
(WebCore::Cursor::ensurePlatformCursor const):
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintTextArea):

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/PlatformMac.cmake:
* pal/spi/cf/CFUtilitiesSPI.h:
* pal/spi/cocoa/LaunchServicesSPI.h: Renamed from Source/WebCore/PAL/pal/spi/ios/LaunchServicesSPI.h.
* pal/spi/mac/HIServicesSPI.h:
* pal/spi/mac/NSCellSPI.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/spi/mac/NSMenuSPI.h:
* pal/spi/mac/NSScrollViewSPI.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/spi/mac/NSScrollerImpSPI.h:
* pal/system/cf/DefaultSearchProvider.cpp: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
(PAL::defaultSearchProviderDisplayName):
* pal/system/cf/DefaultSearchProvider.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/system/mac/PopupMenu.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/system/mac/PopupMenu.mm: Added.
(PAL::popUpMenu):

Source/WebKit:

* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::initializeProcessName):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::initializeProcessName):
* StorageProcess/mac/StorageProcessMac.mm:
(WebKit::StorageProcess::initializeProcessName):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::trackingAreaOptions):
(WebKit::WebViewImpl::mightBeginScrollWhileInactive):
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu):
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::popUpContextMenu):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::handleContextMenuEvent):
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::updateActivePages):

Source/WebKitLegacy/mac:

* DefaultDelegates/WebDefaultContextMenuDelegate.mm:
(-[WebDefaultUIDelegate menuItemWithTag:target:representedObject:]):
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::show):
* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
* WebView/WebHTMLView.mm:
(-[WebHTMLView setDataSource:]):
(-[WebHTMLView attachRootLayer:]):
* WebView/WebView.mm:
(-[WebView _needsAdobeFrameReloadingQuirk]):
(-[WebView _needsLinkElementTextCSSQuirk]):
(-[WebView _needsIsLoadingInAPISenseQuirk]):
(-[WebView _needsFrameLoadDelegateRetainQuirk]):
(-[WebView _preferencesChanged:]):

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

3 years ago[Win] Fix invalid line in TestExpectations.
pvollan@apple.com [Mon, 18 Sep 2017 16:09:25 +0000 (16:09 +0000)]
[Win] Fix invalid line in TestExpectations.

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years ago[Win][PAL] Move WebCoreHeaderDetection.h to PAL
commit-queue@webkit.org [Mon, 18 Sep 2017 15:44:12 +0000 (15:44 +0000)]
[Win][PAL] Move WebCoreHeaderDetection.h to PAL
https://bugs.webkit.org/show_bug.cgi?id=176990

Patch by Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com> on 2017-09-18
Reviewed by Alex Christensen.

.:

Create DerivedSources directory for PAL if WebCore build is enabled.

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

Source/WebCore:

* PlatformWin.cmake:
Stop generating WebCoreHeaderDetection.h in WebCore.

* config.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
Include PALHeaderDetection.h instead of WebCoreHeaderDetection.h

Source/WebCore/PAL:

* AVFoundationSupport.py: Renamed from Source/WebCore/AVFoundationSupport.py.
(lookFor):
(fileContains):

* pal/PlatformWin.cmake:
Add a custom target PAL_PreBuild to generate PALHeaderDetection.h

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

3 years ago[Curl] Create classes dedicated to handle SSL related tasks
commit-queue@webkit.org [Mon, 18 Sep 2017 15:41:15 +0000 (15:41 +0000)]
[Curl] Create classes dedicated to handle SSL related tasks
and separate verifier and certificate management.
https://bugs.webkit.org/show_bug.cgi?id=176910

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-09-18
Reviewed by Alex Christensen.

* platform/Curl.cmake:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::CurlContext):
(WebCore::CurlHandle::setCACertPath):
(WebCore::certificatePath): Deleted.
(WebCore::CurlHandle::enableCAInfoIfExists): Deleted.
(WebCore::CurlHandle::setSslErrors): Deleted.
(WebCore::CurlHandle::getSslErrors): Deleted.
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::sslHandle):
(WebCore::CurlContext::getCertificatePath const): Deleted.
(WebCore::CurlContext::shouldIgnoreSSLErrors const): Deleted.
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::setupRequest):
* platform/network/curl/CurlSSLHandle.cpp: Added.
(WebCore::CurlSSLHandle::CurlSSLHandle):
(WebCore::CurlSSLHandle::getCACertPathEnv):
(WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate):
(WebCore::CurlSSLHandle::isAllowedHTTPSCertificateHost):
(WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate):
(WebCore::CurlSSLHandle::setClientCertificateInfo):
(WebCore::CurlSSLHandle::getSSLClientCertificate):
* platform/network/curl/CurlSSLHandle.h: Renamed from Source/WebCore/platform/network/curl/SSLHandle.h.
(WebCore::CurlSSLHandle::shouldIgnoreSSLErrors const):
(WebCore::CurlSSLHandle::getCACertPath const):
* platform/network/curl/CurlSSLVerifier.cpp: Renamed from Source/WebCore/platform/network/curl/SSLHandle.cpp.
(WebCore::CurlSSLVerifier::setSslCtx):
(WebCore::CurlSSLVerifier::certVerifyCallback):
(WebCore::CurlSSLVerifier::getPemDataFromCtx):
(WebCore::CurlSSLVerifier::convertToSSLCertificateFlags):
* platform/network/curl/CurlSSLVerifier.h: Added.
(WebCore::CurlSSLVerifier::setCurlHandle):
(WebCore::CurlSSLVerifier::setHostName):
(WebCore::CurlSSLVerifier::sslErrors):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
(WebCore::ResourceHandle::setClientCertificateInfo):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
(WebCore::ResourceHandleCurlDelegate::setupRequest):
(WebCore::ResourceHandleCurlDelegate::notifyFail):
(WebCore::ResourceHandleCurlDelegate::willSetupSslCtx):
(WebCore::ResourceHandleCurlDelegate::willSetupSslCtxCallback):
* platform/network/curl/ResourceHandleCurlDelegate.h:

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

3 years agoMark http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl as a failure...
pvollan@apple.com [Mon, 18 Sep 2017 15:29:38 +0000 (15:29 +0000)]
Mark http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl as a failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177072

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoMark fast/events/beforeunload-dom-manipulation-crash.html as a crash on Windows.
pvollan@apple.com [Mon, 18 Sep 2017 15:23:46 +0000 (15:23 +0000)]
Mark fast/events/beforeunload-dom-manipulation-crash.html as a crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177071

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoMark http/tests/security/video-cross-origin-caching.html as a flaky crash on Windows.
pvollan@apple.com [Mon, 18 Sep 2017 15:04:53 +0000 (15:04 +0000)]
Mark http/tests/security/video-cross-origin-caching.html as a flaky crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=160447

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years ago[DFG] Remove ToThis more aggressively
utatane.tea@gmail.com [Mon, 18 Sep 2017 12:47:26 +0000 (12:47 +0000)]
[DFG] Remove ToThis more aggressively
https://bugs.webkit.org/show_bug.cgi?id=177056

Reviewed by Saam Barati.

JSTests:

* stress/generator-with-this-strict.js: Added.
(shouldBe):
(generator):
(target):
* stress/generator-with-this.js: Added.
(shouldBe):
(generator):
(target):

Source/JavaScriptCore:

The variation of toThis() implementation is limited. So, we attempts to implement common toThis operation in AI.
We move scope related toThis to JSScope::toThis. And AI investigates proven value/structure's toThis methods
and attempts to fold/convert to efficient nodes.

We introduces GetGlobalThis, which just loads globalThis from semantic origin's globalObject. Using this,
we can implement JSScope::toThis in DFG. This can avoid costly toThis indirect function pointer call.

Currently, we just emit GetGlobalThis if necessary. We can further convert it to constant if we can put
watchpoint to JSGlobalObject's globalThis change. But we leave it for a future patch for now.

This removes GetGlobalThis from ES6 generators in common cases.

spread-generator.es6      303.1550+-9.5037          290.9337+-8.3487          might be 1.0420x faster

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::isToThisAnIdentity):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToGetGlobalThis):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetGlobalThis):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileGetGlobalThis):
* runtime/JSGlobalLexicalEnvironment.cpp:
(JSC::JSGlobalLexicalEnvironment::toThis): Deleted.
* runtime/JSGlobalLexicalEnvironment.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::toThis): Deleted.
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::addressOfGlobalThis):
* runtime/JSLexicalEnvironment.cpp:
(JSC::JSLexicalEnvironment::toThis): Deleted.
* runtime/JSLexicalEnvironment.h:
* runtime/JSScope.cpp:
(JSC::JSScope::toThis):
* runtime/JSScope.h:
* runtime/StrictEvalActivation.cpp:
(JSC::StrictEvalActivation::toThis): Deleted.
* runtime/StrictEvalActivation.h:

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

3 years agoUpdate my status.
Ms2ger@igalia.com [Mon, 18 Sep 2017 08:10:13 +0000 (08:10 +0000)]
Update my status.

Unreviewed.

* Scripts/webkitpy/common/config/contributors.json:

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

3 years agoREGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html...
carlosgc@webkit.org [Mon, 18 Sep 2017 05:22:33 +0000 (05:22 +0000)]
REGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html is failing since r221974
https://bugs.webkit.org/show_bug.cgi?id=177036

Reviewed by Michael Catanzaro.

In r221974 I rewrote the characterIndexForXPosition implementation without taking into account that there can be
multiple glyphs for the same character, so we can't simply do index++ and index-- to get the next and previous
character index.

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition): Always get the character index from
m_glyphToCharacterIndexes array.

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

3 years agoStart working on WSL documentation
fpizlo@apple.com [Mon, 18 Sep 2017 05:05:56 +0000 (05:05 +0000)]
Start working on WSL documentation
https://bugs.webkit.org/show_bug.cgi?id=177064

Reviewed by Mylex Maxfield.

This is a work in progress. I'd like to check it in and then keep adding to it.

* WebGPUShadingLanguageRI/WSL.md: Added.

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

3 years agoWSL needs to understand && and ||
mmaxfield@apple.com [Mon, 18 Sep 2017 03:39:19 +0000 (03:39 +0000)]
WSL needs to understand && and ||
https://bugs.webkit.org/show_bug.cgi?id=177062

Reviewed by Filip Pizlo.

Very similar to LogicalNot.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/Checker.js:
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Lexer.js:
(Lexer.prototype.next):
(Lexer):
* WebGPUShadingLanguageRI/LogicalExpression.js: Added.
(LogicalExpression):
(LogicalExpression.prototype.get text):
(LogicalExpression.prototype.get left):
(LogicalExpression.prototype.get right):
(LogicalExpression.prototype.toString):
* WebGPUShadingLanguageRI/Parse.js:
(parseLeftLogicalExpression):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitProtocolDecl):

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

3 years agoWSL needs float and double support
mmaxfield@apple.com [Mon, 18 Sep 2017 00:31:53 +0000 (00:31 +0000)]
WSL needs float and double support
https://bugs.webkit.org/show_bug.cgi?id=177058

Reviewed by Filip Pizlo.

Use the existing int and uint types as a model. The types themselves are straighforward. Just like int and uint,
you can't pass a float as a double argument and vice-versa. This patch adds operator+, -, *, and / for floats
and doubles.

Float literals are more complicated. If your number has a "." character in it, it is treated as a float literal.
You can add a suffix of "f" or "d" to force the literal to pretend to be a float or a double. These literals are
able to masquerade as either floats or doubles (unlike an explicit type). However, these literals are not able
to masquerade as ints or uints. There's also a nice check that your float literal can actually fit in a float.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/DoubleLiteral.js: Copied from Tools/WebGPUShadingLanguageRI/Type.js.
(let.DoubleLiteral.createLiteral.createType):
* WebGPUShadingLanguageRI/DoubleLiteralType.js: Copied from Tools/WebGPUShadingLanguageRI/Type.js.
(let.DoubleLiteralType.createLiteralType.verifyAsArgument):
* WebGPUShadingLanguageRI/FloatLiteral.js: Copied from Tools/WebGPUShadingLanguageRI/Type.js.
(let.FloatLiteral.createLiteral.createType):
* WebGPUShadingLanguageRI/FloatLiteralType.js: Copied from Tools/WebGPUShadingLanguageRI/Type.js.
(let.FloatLiteralType.createLiteralType.verifyAsArgument):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/Lexer.js:
(Lexer.prototype.next):
(Lexer):
* WebGPUShadingLanguageRI/NativeType.js:
(NativeType):
(NativeType.prototype.get isFloating):
(NativeType.prototype.set isFloating):
(NativeType.prototype.get isFloat): Deleted.
(NativeType.prototype.set isFloat): Deleted.
* WebGPUShadingLanguageRI/Parse.js:
(parseTerm):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitGenericLiteral):
* WebGPUShadingLanguageRI/StandardLibrary.js:
(uint.operator):
(int.operator):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
(makeFloat):
(makeDouble):
(checkNumber):
(checkFloat):
(checkDouble):
* WebGPUShadingLanguageRI/Type.js:
(Type.prototype.get isFloating):
(Type.prototype.get isFloat): Deleted.

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

3 years agoWeb Inspector: Styles Redesign: support toggling properties
nvasilyev@apple.com [Sun, 17 Sep 2017 20:11:37 +0000 (20:11 +0000)]
Web Inspector: Styles Redesign: support toggling properties
https://bugs.webkit.org/show_bug.cgi?id=176643

Reviewed by Matt Baker.

Source/WebInspectorUI:

Add checkboxes to toggle (comment/uncomment) CSS properties.

* UserInterface/Base/Utilities.js:
(String.prototype.get lineCount):
(String.prototype.get lastLine):
Add string methods that are used by WI.CSSProperty.prototype._updateOwnerStyleText.

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.commentOut):
(WI.CSSProperty.prototype.set text):
(WI.CSSProperty.prototype.get editable):
(WI.CSSProperty.prototype._updateOwnerStyleText):
Add methods necessary for property toggling.

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration):
(WI.CSSStyleDeclaration.prototype.get allVisibleProperties):
Add a getter that is used by SpreadsheetCSSStyleDeclarationEditor.prototype._propertiesToRender.

(WI.CSSStyleDeclaration.prototype.get visibleProperties):
* UserInterface/Models/TextRange.js:
(WI.TextRange.prototype.clone):
(WI.TextRange.prototype.cloneAndModify):
(WI.TextRange.prototype.relativeTo):
Add methods that are used by WI.CSSProperty.prototype._updateOwnerStyleText.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor):
(.spreadsheet-style-declaration-editor .property-toggle):
(.spreadsheet-css-declaration:matches(:hover, :focus) .property-toggle,):
(.spreadsheet-style-declaration-editor .property.disabled,):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.set style):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.get _propertiesToRender):
(WI.SpreadsheetCSSStyleDeclarationEditor):
(WI.SpreadsheetStyleProperty):
(WI.SpreadsheetStyleProperty.prototype.get element):
(WI.SpreadsheetStyleProperty.prototype._update):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.refresh):
(WI.SpreadsheetRulesStyleDetailsPanel):
* UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
(.cm-s-default .cm-comment,):
* UserInterface/Views/Variables.css:
(:root):
Make comment color a CSS variable.

LayoutTests:

Add tests for String.prototype.lineCount and String.prototype.lastLine.

* inspector/unit-tests/string-utilities-expected.txt:
* inspector/unit-tests/string-utilities.html:

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

3 years agoMerge JSLexicalEnvironment and JSEnvironmentRecord
utatane.tea@gmail.com [Sun, 17 Sep 2017 17:28:15 +0000 (17:28 +0000)]
Merge JSLexicalEnvironment and JSEnvironmentRecord
https://bugs.webkit.org/show_bug.cgi?id=175492

Reviewed by Saam Barati.

JSEnvironmentRecord is only inherited by JSLexicalEnvironment.
We can merge JSEnvironmentRecord and JSLexicalEnvironment.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateActivation):
(JSC::FTL::DFG::LowerDFGToB3::compileGetClosureVar):
(JSC::FTL::DFG::LowerDFGToB3::compilePutClosureVar):
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeCreateActivation):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitGetClosureVar):
(JSC::JIT::emitPutClosureVar):
(JSC::JIT::emitScopedArgumentsGetByVal):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitGetClosureVar):
(JSC::JIT::emitPutClosureVar):
* llint/LLIntOffsetsExtractor.cpp:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSEnvironmentRecord.cpp: Removed.
* runtime/JSEnvironmentRecord.h: Removed.
* runtime/JSLexicalEnvironment.cpp:
(JSC::JSLexicalEnvironment::visitChildren):
(JSC::JSLexicalEnvironment::heapSnapshot):
(JSC::JSLexicalEnvironment::getOwnNonIndexPropertyNames):
* runtime/JSLexicalEnvironment.h:
(JSC::JSLexicalEnvironment::subspaceFor):
(JSC::JSLexicalEnvironment::variables):
(JSC::JSLexicalEnvironment::isValidScopeOffset):
(JSC::JSLexicalEnvironment::variableAt):
(JSC::JSLexicalEnvironment::offsetOfVariables):
(JSC::JSLexicalEnvironment::offsetOfVariable):
(JSC::JSLexicalEnvironment::allocationSizeForScopeSize):
(JSC::JSLexicalEnvironment::allocationSize):
(JSC::JSLexicalEnvironment::finishCreationUninitialized):
(JSC::JSLexicalEnvironment::finishCreation):
* runtime/JSModuleEnvironment.cpp:
(JSC::JSModuleEnvironment::create):
* runtime/JSObject.h:
(JSC::JSObject::isEnvironment const):
(JSC::JSObject::isEnvironmentRecord const): Deleted.
* runtime/JSSegmentedVariableObject.h:
* runtime/StringPrototype.cpp:
(JSC::checkObjectCoercible):

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

3 years agohttps://bugs.webkit.org/show_bug.cgi?id=177038
msaboff@apple.com [Sun, 17 Sep 2017 15:39:02 +0000 (15:39 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=177038
Add an option to run-jsc-stress-tests to limit tests variations to a basic set

Reviewed by JF Bastien.

JSTests:

* stress/unshiftCountSlowCase-correct-postCapacity.js: Disabled this test on ARM64 iOS devices
as it dies using too much memory.

Tools:

Added the --basic option that runs defaults tests with the following modes, default, no-llint,
no-cjit-validate-phases, no-cjit-collect-continuously, dfg-eager and for FTL platforms: no-ftl,
ftl-eager-no-cjit and ftl-no-cjit-small-pool.  This takes about half the time as running all
16 modes of a full run.

* Scripts/run-jsc-stress-tests:

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

3 years ago[WPE][GTK] Merge ProcessLauncher[WPE,GTK]
mcatanzaro@igalia.com [Sun, 17 Sep 2017 14:37:31 +0000 (14:37 +0000)]
[WPE][GTK] Merge ProcessLauncher[WPE,GTK]
https://bugs.webkit.org/show_bug.cgi?id=177041

Unreviewed fixup, I broke the size of the argv buffer when experimenting with how to respond
to review comments. Not sure why this didn't blow up everything during testing.

* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):

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