WebKit-https.git
2 years agoUnreviewed, rolling out r219024.
jlewis3@apple.com [Mon, 3 Jul 2017 16:57:25 +0000 (16:57 +0000)]
Unreviewed, rolling out r219024.

This patch cause 3 didferent test to fail.

Reverted changeset:

"REGRESSION(r215096) Queries of URLs with non-special schemes
should not percent-encode single quotes"
https://bugs.webkit.org/show_bug.cgi?id=174051
http://trac.webkit.org/changeset/219024

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

2 years agoUnreviewed, rolling out r219030.
jlewis3@apple.com [Mon, 3 Jul 2017 16:56:05 +0000 (16:56 +0000)]
Unreviewed, rolling out r219030.

This was a rebaseline of a test that was broken with revision
r219024

Reverted changeset:

"Rebase test after r219024"
https://bugs.webkit.org/show_bug.cgi?id=174051
http://trac.webkit.org/changeset/219030

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

2 years agoDrop ResourceLoadStatisticsStore's statisticsLock
bfulgham@apple.com [Mon, 3 Jul 2017 16:02:45 +0000 (16:02 +0000)]
Drop ResourceLoadStatisticsStore's statisticsLock
https://bugs.webkit.org/show_bug.cgi?id=174080

Patch by Chris Dumez <cdumez@apple.com> on 2017-07-03
Reviewed by Brent Fulgham.

Source/WebKit2:

Drop ResourceLoadStatisticsStore's statisticsLock. It added complexity and was only needed
do that the SPI exposed to WebKitTestRunner would query the store synchronously from the
main thread. Instead, I made the SPI asynchronous and make sure we always access the store
from the same background thread. As a result, there is no longer any need for locking.

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _resourceLoadStatisticsIsPrevalentResource:completionHandler:]):
(-[WKWebsiteDataStore _resourceLoadStatisticsHadUserInteraction:completionHandler:]):
(-[WKWebsiteDataStore _resourceLoadStatisticsIsGrandfathered:completionHandler:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::isPrevalentResource):
(WebKit::ResourceLoadStatisticsStore::isGrandFathered):
(WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain):
(WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
(WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
(WebKit::ResourceLoadStatisticsStore::clearInMemory):
(WebKit::ResourceLoadStatisticsStore::mergeStatistics):
(WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
(WebKit::ResourceLoadStatisticsStore::processStatistics):
(WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
(WebKit::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
(WebKit::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
(WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
* UIProcess/Storage/ResourceLoadStatisticsStore.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
(WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
(WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
(WebKit::WebResourceLoadStatisticsStore::clearInMemoryData):
(WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
* UIProcess/WebResourceLoadStatisticsStore.h:

Tools:

Port WebKitTestRunner to new Asynchronous Cocoa SPI.

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::isStatisticsPrevalentResource):
(WTR::TestController::isStatisticsHasHadUserInteraction):
(WTR::TestController::isStatisticsGrandfathered):

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

2 years agoPasting single words copied to UIPasteboard inserts URLs in editable areas
wenson_hsieh@apple.com [Mon, 3 Jul 2017 11:26:36 +0000 (11:26 +0000)]
Pasting single words copied to UIPasteboard inserts URLs in editable areas
https://bugs.webkit.org/show_bug.cgi?id=174082
<rdar://problem/33046992>

Reviewed by Tim Horton.

Source/WebCore:

Currently, our heuristics for coercing plain text to URLs when reading URLs off of the UIPasteboard allows URLs
to be created as long as -[UIPasteboard valuesForPasteboardType:inItemSet:] returns a non-null NSURL. However,
UIPasteboard automatically coerces any NSString into an NSURL if it initializes an NSURL via +URLWithString:.
Thus, single-word strings such as "hello" that are written to the pasteboard as "public.utf8-plain-text" can
be read back as NSURLs for "public.url". This currently causes bugs in shipping software: e.g. copying and
pasting a single word from an editable input or textarea and pasting into a rich contenteditable area using
WebKit1 inserts a link. However, when combined with another change in WebKit that attempts to read "public.url"
before "public.text" when reading plain text from the pasteboard, this now also affects pasting in plain text
areas, where pasted plain-text strings that are not URLs will paste as URL-encoded strings anyways (for
instance, replacing "[hello]" with "%5Bhello%5D").

To fix this, and existing issues with pasting single words in contenteditables, we make
PlatformPasteboard::readString and PlatformPasteboard::readURL only accept a coerced NSURL as an URL if it also
parses as a valid URL in WebKit (otherwise, we return an empty string).

Tests:
    UIPasteboardTests.DoNotPastePlainTextAsURL
    UIPasteboardTests.PastePlainTextAsURL
    UIPasteboardTests.PasteURLWithPlainTextAsURL

* platform/PlatformPasteboard.h:
* platform/ios/AbstractPasteboard.h:
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::allowReadingURLAtIndex):

Allow an URL to be read if either (1) an URL was explicitly specified in the UIPasteboard, or (2) the "proposed"
URL returned from -valuesForPasteboardType: is valid.

(WebCore::PlatformPasteboard::readString):
(WebCore::PlatformPasteboard::readURL):

Consult allowReadingURLAtIndex here (in the case of ::readString, only if the given pasteboard type is
"public.url").

* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard itemProviders]):
(-[WebItemProviderPasteboard setItemProviders:]):

Source/WebKit2:

Add a hook to WKPreferences to allow programatic pasting.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setDOMPasteAllowed:]):
(-[WKPreferences _domPasteAllowed]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

Adds 3 new unit tests to UIPasteboardTests to test cases of pasting plain text and URLs.

* TestWebKitAPI/Tests/ios/UIPasteboardTests.mm:
(TestWebKitAPI::setUpWebViewForPasteboardTests):
(TestWebKitAPI::TEST):

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

2 years agoUnreviewed GTK+ and WPE build fix when building with GCC 4.9.
zandobersek@gmail.com [Mon, 3 Jul 2017 10:58:41 +0000 (10:58 +0000)]
Unreviewed GTK+ and WPE build fix when building with GCC 4.9.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::renderNextFrame): Don't use brace-list
initialization to override the m_forceRepaintAsync struct. Instead, manually
assign the OptionalCallbackID() value to the m_forceRepaintAsync.callbackID
member variable, and override the m_forceRepaintAsync.needsFreshFlush member
variable with `false`.

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

2 years agoRemove an unused function export
commit-queue@webkit.org [Mon, 3 Jul 2017 10:11:20 +0000 (10:11 +0000)]
Remove an unused function export
https://bugs.webkit.org/show_bug.cgi?id=174084

Patch by Daewoong Jang <daewoong.jang@navercorp.com> on 2017-07-03
Reviewed by Yusuke Suzuki.

* wtf/Threading.h:

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

2 years ago[ThreadedCompositor] Update and retrieve scene attributes under a Lock
zandobersek@gmail.com [Mon, 3 Jul 2017 09:56:45 +0000 (09:56 +0000)]
[ThreadedCompositor] Update and retrieve scene attributes under a Lock
https://bugs.webkit.org/show_bug.cgi?id=173762

Reviewed by Carlos Garcia Campos.

Instead of dispatching separate tasks on the composition run loop, update
various scene attributes by locking a common lock object and updating the
appropriate attribute.

In ThreadedCompositor::renderLayerTree(), where these attributes are used
in scene composition, the lock is again obtained and the attributes copied
into local variables, releasing the lock afterwards. The attribute values
in local copies are then used for that renderLayerTree() invocation.

This approach is more efficient than dispatching separate tasks that can
race against renderLayerTree() dispatches.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::ThreadedCompositor):
(WebKit::m_displayRefreshMonitor):
(WebKit::ThreadedCompositor::setScaleFactor):
(WebKit::ThreadedCompositor::setScrollPosition):
(WebKit::ThreadedCompositor::setViewportSize):
(WebKit::ThreadedCompositor::setDrawsBackground):
(WebKit::ThreadedCompositor::renderLayerTree):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:

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

2 years agoExpose WebPreferences for viewport-fit and constant() properties
timothy_horton@apple.com [Mon, 3 Jul 2017 09:00:49 +0000 (09:00 +0000)]
Expose WebPreferences for viewport-fit and constant() properties
https://bugs.webkit.org/show_bug.cgi?id=174072
<rdar://problem/33096639>

Reviewed by Ryosuke Niwa.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences viewportFitEnabled]):
(-[WebPreferences setViewportFitEnabled:]):
(-[WebPreferences constantPropertiesEnabled]):
(-[WebPreferences setConstantPropertiesEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

2 years agoUnreviewed, annotate dont--reserve-huge-capacity-lexer.js with $memoryLimited
utatane.tea@gmail.com [Mon, 3 Jul 2017 08:42:59 +0000 (08:42 +0000)]
Unreviewed, annotate dont--reserve-huge-capacity-lexer.js with $memoryLimited

It requires too much memory.

* stress/dont-reserve-huge-capacity-lexer.js:

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

2 years ago[GCrypt] Implement CryptoKeyEC SPKI exports
zandobersek@gmail.com [Mon, 3 Jul 2017 07:46:09 +0000 (07:46 +0000)]
[GCrypt] Implement CryptoKeyEC SPKI exports
https://bugs.webkit.org/show_bug.cgi?id=173646

Reviewed by Jiewen Tan.

Source/WebCore:

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

Implement libgcrypt-based support for SPKI exports of EC keys.

Initially, the ECParameters structure is created so that it will be later embedded
into the SubjectPublicKeyInfo structure. First the root element of this structure
is written into, specifying namedCurve as the chosen member (even if other choices
are not really available). We then write out the object identifier into this
namedCurve member that properly represents this key's curve type.

The SubjectPublicKeyInfo structure is created next. We write out id-ecPublicKey
identifier as the chosen algorithm identifier. Web Crypto specification demands
that the id-ecDH identifier is used in case of ECDH keys, but no existing test in
the W3C test suite expects this, so this should be revisited later. Data of the
previously-constructed ECParameters structure is written out into the
AlgorithmIdentifier's parameters member.

The `q` MPI data is then retrieved. Its size is validated, as well as the first
byte of data in order to ensure the MPI represents an uncompressed EC point.
The data is then written into the subjectPublicKey member.

Finally the encoded SubjectPublicKeyInfo structure data is extracted and returned
from the platformExportSpki() function, completion the export operation.

* crypto/gcrypt/CryptoKeyECGCrypt.cpp:
(WebCore::curveIdentifier):
(WebCore::CryptoKeyEC::platformExportSpki):

Source/WebCore/PAL:

No new tests -- covered by existing Web Crypto tests.

Add three new libtasn1 utility functions.

createStructure() is a simple wrapper around asn1_create_element(), creating a new
ASN.1 structure for the specified definition that's listed in WebCrypto.asn. The
existing decodeStructure() is modified to use this new addition.

encodedData() retrieves the ASN.1-encoded data of the specified element that's
located in the passed-in asn1_node. This is used when retrieving SPKI or PKCS#8
data from filled-out ASN.1 structures.

writeElement() writes the provided data to the given asn1_node object under the
specified element, using the given size. True is returned if this operation was
successful.

* pal/crypto/tasn1/Utilities.cpp:
(PAL::TASN1::createStructure):
(PAL::TASN1::decodeStructure):
(PAL::TASN1::encodedData):
(PAL::TASN1::writeElement):
* pal/crypto/tasn1/Utilities.h:

LayoutTests:

* platform/gtk/TestExpectations:
Unskip tests that cover SPKI exports of EC keys.

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

2 years ago[WebIDL] Remove special casing for RegExp which is no longer required by the spec
commit-queue@webkit.org [Mon, 3 Jul 2017 03:42:35 +0000 (03:42 +0000)]
[WebIDL] Remove special casing for RegExp which is no longer required by the spec
https://bugs.webkit.org/show_bug.cgi?id=174025

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

LayoutTests/imported/w3c:

* web-platform-tests/FileAPI/blob/Blob-constructor-expected.txt:
Update results to passing.

Source/WebCore:

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
(GenerateOverloadDispatcher):
Remove special casing.

* bindings/scripts/IDLParser.pm:
(parseNonAnyType):
Remove parsing of RegExp.

* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
Update test results.

LayoutTests:

* fast/files/blob-constructor-expected.txt:
* fast/files/blob-constructor.html:
* fast/files/file-constructor-expected.txt:
* fast/files/file-constructor.html:
Update tests/results for change in conversions of RegExp.

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

2 years agoWTF::Thread should have the threads stack bounds.
utatane.tea@gmail.com [Mon, 3 Jul 2017 00:50:54 +0000 (00:50 +0000)]
WTF::Thread should have the threads stack bounds.
https://bugs.webkit.org/show_bug.cgi?id=173975

Reviewed by Mark Lam.

Source/JavaScriptCore:

There is a site in JSC that try to walk another thread's stack.
Currently, stack bounds are stored in WTFThreadData which is located
in TLS. Thus, only the thread itself can access its own WTFThreadData.
We workaround this situation by holding StackBounds in MachineThread in JSC,
but StackBounds should be put in WTF::Thread instead.

This patch moves StackBounds from WTFThreadData to WTF::Thread. StackBounds
information is tightly coupled with Thread. Thus putting it in WTF::Thread
is natural choice.

* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::MachineThread::MachineThread):
(JSC::MachineThreads::MachineThread::captureStack):
* heap/MachineStackMarker.h:
(JSC::MachineThreads::MachineThread::stackBase):
(JSC::MachineThreads::MachineThread::stackEnd):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::updateStackLimits):
(JSC::VM::committedStackByteCount):
* runtime/VM.h:
(JSC::VM::isSafeToRecurse):
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
* runtime/VMInlines.h:
(JSC::VM::ensureStackCapacityFor):
* runtime/VMTraps.cpp:
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPatternConstructor::isSafeToRecurse):

Source/WTF:

We move StackBounds from WTFThreadData to WTF::Thread.
One important thing is that we should make valid StackBounds
visible to Thread::create() caller. When the caller get
WTF::Thread from Thread::create(), this WTF::Thread should
have a valid StackBounds. But StackBounds information can be
retrived only in the WTF::Thread's thread itself.

* wtf/StackBounds.h:
(WTF::StackBounds::emptyBounds):
(WTF::StackBounds::StackBounds):
* wtf/StackStats.cpp:
(WTF::StackStats::PerThreadStats::PerThreadStats):
* wtf/Threading.cpp:
(WTF::threadEntryPoint):
(WTF::Thread::create):
(WTF::Thread::currentMayBeNull):
(WTF::Thread::initialize):
* wtf/Threading.h:
(WTF::Thread::stack):
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
(WTF::Thread::current):
(WTF::initializeCurrentThreadEvenIfNonWTFCreated): Deleted.
(WTF::Thread::currentMayBeNull): Deleted.
* wtf/ThreadingWin.cpp:
(WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
(WTF::Thread::initializeCurrentThreadInternal):
(WTF::Thread::current):
* wtf/WTFThreadData.cpp:
(WTF::WTFThreadData::WTFThreadData):
* wtf/WTFThreadData.h:
(WTF::WTFThreadData::stack): Deleted.

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

2 years agoAdd API test for all parts of WebKit1 API related to favicons.
beidson@apple.com [Sun, 2 Jul 2017 19:38:57 +0000 (19:38 +0000)]
Add API test for all parts of WebKit1 API related to favicons.
https://bugs.webkit.org/show_bug.cgi?id=174069

Reviewed by Andy Estes.

These two API tests cover all WebKit1 API related to icons.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/WebViewIconLoading.mm: Added.
(mainResourceData):
(defaultFaviconData):
(customFaviconData):
(imageFromData):
(+[IconLoadingProtocol canInitWithRequest:]):
(+[IconLoadingProtocol canonicalRequestForRequest:]):
(-[IconLoadingProtocol startLoading]):
(-[IconLoadingProtocol stopLoading]):
(-[IconLoadingFrameLoadDelegate webView:didReceiveIcon:forFrame:]):
(-[MainFrameIconKVO observeValueForKeyPath:ofObject:change:context:]):
(TestWebKitAPI::TEST):

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

2 years agoRealtimeOutgoingVideoSource should pass frame timestamp
commit-queue@webkit.org [Sun, 2 Jul 2017 18:43:23 +0000 (18:43 +0000)]
RealtimeOutgoingVideoSource should pass frame timestamp
https://bugs.webkit.org/show_bug.cgi?id=174055

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

Covered by manual testing since this only affects video encoding quality.

* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendFrame):

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

2 years agoExpose viewport-fit value to UIKit via viewport arguments dictionary
timothy_horton@apple.com [Sun, 2 Jul 2017 06:48:02 +0000 (06:48 +0000)]
Expose viewport-fit value to UIKit via viewport arguments dictionary
https://bugs.webkit.org/show_bug.cgi?id=174071
<rdar://problem/33096620>

Reviewed by Wenson Hsieh.

Source/WebKit/ios:

* WebCoreSupport/WebChromeClientIOS.mm:
(nameForViewportFitValue):
(dictionaryForViewportArguments):
Make use of the named constants we already have for these; the code
that reads this dictionary uses them, so we might as well!

Add viewport-fit -> { auto, contain, cover } to the dictionary.

* WebKit.iOS.exp:

Source/WebKit/mac:

* History/WebHistoryItem.mm:
* History/WebHistoryItemPrivate.h:
Add another dictionary key and three values.

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

2 years ago<rdar://problem/33096441> r219055 broke non-iOS builds.
mitz@apple.com [Sun, 2 Jul 2017 04:40:34 +0000 (04:40 +0000)]
<rdar://problem/33096441> r219055 broke non-iOS builds.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::lookupFallbackFont):

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

2 years ago[iOS] Remove code only needed when building for iOS 9.x
mitz@apple.com [Sun, 2 Jul 2017 02:06:40 +0000 (02:06 +0000)]
[iOS] Remove code only needed when building for iOS 9.x
https://bugs.webkit.org/show_bug.cgi?id=174068

Reviewed by Tim Horton.

Source/bmalloc:

* bmalloc/BPlatform.h:
* bmalloc/VMAllocate.h:
(bmalloc::vmPageSizePhysical):

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
* jit/ExecutableAllocator.cpp:
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::isDataDetectorLink):
(WebCore::DataDetection::shouldCancelDefaultAction):
(WebCore::constructURLStringForResult):
(WebCore::DataDetection::detectContentInRange):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::vmPageSize):
* platform/cocoa/DataDetectorsCoreSoftLink.h:
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
* platform/graphics/FontPlatformData.cpp:
* platform/graphics/FontPlatformData.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(layerContentsFormat):
(PlatformCALayerCocoa::updateContentsFormat):
(PlatformCALayerCocoa::backingStoreBytesPerPixel):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::extendedSRGBColorSpaceRef):
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::drawPDFPage):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::lookupFallbackFont):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::variantCapsSupportsCharacterForSynthesis):
(WebCore::Font::platformWidthForGlyph):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::ctFont):
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::sinkIntoImage):
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::setTimebase):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::systemFontModificationAttributes):
(WebCore::systemFontDescriptor):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):
* platform/ios/LegacyTileGridTile.mm:
(WebCore::LegacyTileGridTile::LegacyTileGridTile):
* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenSupportsExtendedColor):
* platform/ios/RemoteCommandListenerIOS.mm:
(WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
(WebCore::RemoteCommandListenerIOS::~RemoteCommandListenerIOS):
(WebCore::RemoteCommandListenerIOS::updateSupportedCommands):
* platform/spi/cf/CFNetworkSPI.h:
* platform/spi/cg/CoreGraphicsSPI.h:
* platform/spi/cocoa/DataDetectorsCoreSPI.h:
* platform/spi/cocoa/QuartzCoreSPI.h:
* platform/spi/mac/AVFoundationSPI.h:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
* Configurations/WebKit.xcconfig:
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView dealloc]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession setSuggestions:]):
(-[WKFormInputSession invalidate]):
(-[WKContentView insertTextSuggestion:]):
(contentTypeFromFieldName):
(-[WKContentView textInputTraits]):
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
* config.h:

Source/WTF:

* wtf/Platform.h:
* wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
* wtf/spi/darwin/dyldSPI.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration):
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(-[HIDEventGenerator _createIOHIDEventType:]):

WebKitLibraries:

* WebKitPrivateFrameworkStubs/iOS/9: Removed.
* WebKitPrivateFrameworkStubs/iOS/9/AppSupport.framework: Removed.
* WebKitPrivateFrameworkStubs/iOS/9/AppSupport.framework/AppSupport.tbd: Removed.
* WebKitPrivateFrameworkStubs/iOS/9/AssertionServices.framework: Removed.
* WebKitPrivateFrameworkStubs/iOS/9/AssertionServices.framework/AssertionServices.tbd: Removed.
* WebKitPrivateFrameworkStubs/iOS/9/CorePDF.framework: Removed.
* WebKitPrivateFrameworkStubs/iOS/9/CorePDF.framework/CorePDF.tbd: Removed.
* WebKitPrivateFrameworkStubs/iOS/9/GraphicsServices.framework: Removed.
* WebKitPrivateFrameworkStubs/iOS/9/GraphicsServices.framework/GraphicsServices.tbd: Removed.
* WebKitPrivateFrameworkStubs/iOS/9/IOSurface.framework: Removed.
* WebKitPrivateFrameworkStubs/iOS/9/IOSurface.framework/IOSurface.tbd: Removed.

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

2 years agoREGRESSION(r218371): Reeder's default font is Times instead of San Francisco
mmaxfield@apple.com [Sat, 1 Jul 2017 23:29:07 +0000 (23:29 +0000)]
REGRESSION(r218371): Reeder's default font is Times instead of San Francisco
https://bugs.webkit.org/show_bug.cgi?id=173617
<rdar://problem/32969819>

Reviewed by Simon Fraser.

Source/WebCore:

On systems where USE_PLATFORM_SYSTEM_FALLBACK_LIST is set to true, the code in
platformFontWithFamilySpecialCase() is still used when @font-face blocks specify
src:local(system-ui), which made the assertion erroneously fire.

Unfortunately, our architecture is such that an @font-face block represents a
single entry in the font-family fallback list, which means it would be quite
difficult to make local(system-ui) in an @font-face block expand at the level
of the font cascade. So, this patch simply reverts to the previous behavior for
local(system-ui) (which doesn't include the entire Core Text cascade list).
This means that "font-family: system-ui" and "src: local(system-ui)" have
different behavior, which is undesirable, but architecturally difficult to
solve. I've added some FIXMEs to the code in the relevant places and filed
https://bugs.webkit.org/show_bug.cgi?id=174023.

Test: fast/text/font-face-local-system.html

* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontCascadeDescription::effectiveFamilyAt):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::systemFontDescriptor):
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):

LayoutTests:

* fast/text/font-face-local-system-expected.html: Added.
* fast/text/font-face-local-system.html: Added.

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

2 years ago[JSC] WTFGetBacktrace can return numberOfFrames == 0 in some architectures
ticaiolima@gmail.com [Sat, 1 Jul 2017 21:42:43 +0000 (21:42 +0000)]
[JSC] WTFGetBacktrace can return numberOfFrames == 0 in some architectures
https://bugs.webkit.org/show_bug.cgi?id=172768

Reviewed by Mark Lam.

In some architectures, like ARMv6 running on a Raspberry pi, the
backtrace function from "execinfo.h" is returning 0. In
that case, the RELEASE_ASSERT in StackTrace::captureStackTrace
fails causing a runtime crash.
This patch is adding a guard for the case described above to
avoid a runtime crash in such case.

* wtf/StackTrace.cpp:
(WTF::StackTrace::captureStackTrace):

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

2 years agoWhen setting a custom cookie storage location on a WKWebsiteDataStore, cookies aren...
beidson@apple.com [Sat, 1 Jul 2017 21:37:54 +0000 (21:37 +0000)]
When setting a custom cookie storage location on a WKWebsiteDataStore, cookies aren't actually removed.
<rdar://problem/32410662> and https://bugs.webkit.org/show_bug.cgi?id=174035

Reviewed by Alex Christensen.

Source/WebKit2:

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _terminateNetworkProcess]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess): Take an optional WebsiteDataStore. If one is passed in,
  send it to either the existing or new network process.
* UIProcess/WebProcessPool.h:

* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters): Resolve paths first.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm:

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

2 years agoFrame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
rniwa@webkit.org [Sat, 1 Jul 2017 21:26:31 +0000 (21:26 +0000)]
Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
https://bugs.webkit.org/show_bug.cgi?id=174004

Reviewed by Simon Fraser.

Source/WebCore:

Made FrameLoader and NavigationScheduler UniqueRef in Frame so that we can forward declare them,
and forward declared IntPoint and IntRect to avoid including FrameLoader.h, IntRect.h,
and NavigationScheduler.h in Frame.h

* Modules/mediastream/MediaStream.cpp:
* Modules/webaudio/AudioContext.cpp:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Avoid calling loader().mixedContentChecker().canRunInsecureContent(~)
on a nullptr even though this used to work because we weren't de-referencing it.
* bindings/js/ScriptController.cpp:
* dom/Document.cpp:
* dom/EventDispatcher.cpp:
* editing/Editor.cpp:
* editing/cocoa/EditorCocoa.mm:
* editing/ios/EditorIOS.mm:
* editing/mac/EditorMac.mm:
* history/CachedPage.cpp:
* html/HTMLObjectElement.cpp:
* html/parser/HTMLDocumentParser.cpp:
(WebCore::DocumentLoader::~DocumentLoader): Check !isLoading() before accessing frameLoader to avoid
accessing m_frame->loader() inside ~FrameLoader.
* html/parser/XSSAuditor.cpp:
* html/parser/XSSAuditorDelegate.cpp:
* inspector/InspectorInstrumentation.h:
* loader/CrossOriginPreflightChecker.cpp:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setOpener): Avoid accessing this FrameLoader via m_opener->loader() when it's
this FrameLoader inside ~FrameLoader since UniqueRef<FrameLoader> is clears itself before calling
the destructor of FrameLoader.
* loader/ImageLoader.cpp:
* loader/LinkLoader.cpp:
* loader/SubframeLoader.cpp:
* loader/appcache/ApplicationCacheGroup.cpp:
* loader/appcache/DOMApplicationCache.cpp:
* mathml/MathMLElement.cpp:
* page/DOMWindow.cpp:
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::init): Moved here from Frame.h
(WebCore::Frame::setDocument):
* page/Frame.h:
(WebCore::Frame::loader):
(WebCore::Frame::navigationScheduler):
* page/History.cpp:
* page/Location.cpp:
* page/PerformanceLogging.cpp:
* page/PerformanceNavigation.cpp:
* page/UserContentProvider.cpp:
* page/ios/FrameIOS.mm:
(WebCore::Frame::initWithSimpleHTMLDocument):
* plugins/PluginInfoProvider.cpp:
* replay/ReplayInputCreationMethods.cpp:
* replay/UserInputBridge.cpp:
* xml/XSLTProcessorLibxslt.cpp:
* xml/parser/XMLDocumentParserLibxml2.cpp:

Source/WebKit/mac:

* WebCoreSupport/WebPluginInfoProvider.mm:

Source/WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::transitionToCommittedForNewPage):

Source/WebKit2:

* WebProcess/Plugins/WebPluginInfoProvider.cpp:
* WebProcess/WebPage/WebInspector.cpp:

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

2 years ago[macOS] Remove code only needed when building for OS X Yosemite
mitz@apple.com [Sat, 1 Jul 2017 21:12:04 +0000 (21:12 +0000)]
[macOS] Remove code only needed when building for OS X Yosemite
https://bugs.webkit.org/show_bug.cgi?id=174067

Reviewed by Tim Horton.

Source/bmalloc:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/JavaScriptCore:

* API/WebKitAvailability.h:
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/ThirdParty/libwebrtc:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility):
* html/HTMLCanvasElement.cpp:
* page/WheelEventDeltaFilter.cpp:
(WebCore::WheelEventDeltaFilter::create):
* page/mac/WheelEventDeltaFilterMac.h:
* page/mac/WheelEventDeltaFilterMac.mm:
* page/scrolling/ScrollingMomentumCalculator.cpp:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(replacementDataFromDecisionInfo):
(WebCore::NetworkExtensionContentFilter::initialize):
(WebCore::NetworkExtensionContentFilter::willSendRequest):
(WebCore::NetworkExtensionContentFilter::responseReceived):
(WebCore::NetworkExtensionContentFilter::addData):
(WebCore::NetworkExtensionContentFilter::finishedAddingData):
(WebCore::NetworkExtensionContentFilter::unblockHandler):
* platform/graphics/ComplexTextController.h:
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(PlatformCAAnimationCocoa::setTimingFunction):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::platformAlternateFamilyName):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::sinkIntoImage):
* platform/graphics/cocoa/WebGPULayer.mm:
(-[WebGPULayer initWithGPUDevice:]):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
* platform/graphics/mac/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContext3D:]):
* platform/mac/BlacklistUpdater.mm:
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenSupportsExtendedColor):
* platform/mac/ValidationBubbleMac.mm:
(WebCore::ValidationBubble::ValidationBubble):
* platform/mac/WebGLBlacklist.mm:
(WebCore::WebGLBlacklist::create):
* platform/network/cocoa/WebCoreNSURLSession.h:
* platform/network/cocoa/WebCoreNSURLSession.mm:
* platform/network/mac/CertificateInfoMac.mm:
(WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
* platform/network/mac/CookieJarMac.mm:
(WebCore::setCookiesFromDOM):
* platform/spi/cf/CFNetworkSPI.h:
* platform/spi/cg/CoreGraphicsSPI.h:
* platform/spi/cocoa/NEFilterSourceSPI.h:
* platform/spi/cocoa/NSURLConnectionSPI.h:
* platform/spi/cocoa/QuartzCoreSPI.h:
* platform/spi/mac/NSScrollingInputFilterSPI.h:
* platform/spi/mac/NSScrollingMomentumCalculatorSPI.h:
* platform/spi/mac/TUCallSPI.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::levelIndicatorFor):
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::appendKERNTable):
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebKit/mac:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:
* Plugins/WebBasePluginPackage.mm:
(-[WebBasePluginPackage getPluginInfoFromPLists]):
* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::show):
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::startWindowDrag):
(-[WebInspectorWindowController window]):
* WebView/WebView.mm:
(-[WebView _animationControllerForDictionaryLookupPopupInfo:]):

Source/WebKit2:

* Configurations/Base.xcconfig:
* Configurations/BaseTarget.xcconfig:
* Configurations/BaseXPCService.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/NetworkService.xcconfig:
* Configurations/PluginService.32.xcconfig:
* Configurations/PluginService.64.xcconfig:
* Configurations/Version.xcconfig:
* Configurations/WebContentService.xcconfig:
* Configurations/WebKit.xcconfig:
* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Removed.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* Platform/IPC/Connection.h:
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate):
(IPC::Connection::platformInitialize):
(IPC::Connection::open):
(IPC::Connection::exceptionSourceEventHandler): Deleted.
(IPC::Connection::setShouldCloseConnectionOnMachExceptions): Deleted.
* Platform/mac/LayerHostingContext.h:
* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createFencePort):
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Removed.
* PluginProcess/mac/PluginControllerProxyMac.mm:
(WebKit::PluginControllerProxy::updateLayerHostingContext):
* PluginProcess/mac/PluginProcessShim.mm:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* Shared/ChildProcess.h:
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::getPluginInfoFromPropertyLists):
(WebKit::NetscapePluginModule::getPluginInfo):
(WebKit::contentsOfPropertyListAtURL): Deleted.
(WebKit::getMIMETypesFromPluginBundle): Deleted.
* Shared/Plugins/PluginProcessCreationParameters.cpp:
(WebKit::PluginProcessCreationParameters::encode):
(WebKit::PluginProcessCreationParameters::decode):
* Shared/Plugins/PluginProcessCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::setSharedHTTPCookieStorage):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
(fixUpBotchedPageUIClient): Deleted.
* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::didFinishLaunching):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
(WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateLayer):
(WebKit::WebViewImpl::startWindowDrag):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted.
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::didFinishLaunching):
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformInitializePluginProcess):
(WebKit::PluginProcessProxy::createPropertyListFile): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setTopContentInset):
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::rootViewToWindow):
(WebKit::PageClientImpl::startWindowDrag):
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::createFrontendWindow):
(WebKit::WebInspectorProxy::platformStartWindowDrag):
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Removed.
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
(WebKit::addAnimationToLayer):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
* WebProcess/com.apple.WebProcess.sb.in:

Source/WTF:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* wtf/Platform.h:
* wtf/mac/AppKitCompatibilityDeclarations.h:
* wtf/spi/cocoa/SecuritySPI.h:
* wtf/text/TextBreakIterator.cpp:

Tools:

* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
* DumpRenderTree/mac/DumpRenderTree.mm:
(setDefaultsToConsistentValuesForTesting):
* DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:
(-[DumpRenderTreeDraggingInfo resetSpringLoading]):
* MiniBrowser/Configurations/Base.xcconfig:
* MiniBrowser/Configurations/DebugRelease.xcconfig:
* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/DebugRelease.xcconfig:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm:
* TestWebKitAPI/Tests/mac/DragAndDropPasteboardTests.mm:
* TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/mac/StringTruncator.mm:
(TestWebKitAPI::TEST):
* WebKitTestRunner/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/DebugRelease.xcconfig:
* WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:
(WTR::InjectedBundle::platformInitialize):
* WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm:
(-[WebKitTestRunnerDraggingInfo resetSpringLoading]):

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

2 years agoReplace ResourceLoadStatisticsStore C API with Cocoa SPI
cdumez@apple.com [Sat, 1 Jul 2017 16:10:07 +0000 (16:10 +0000)]
Replace ResourceLoadStatisticsStore C API with Cocoa SPI
https://bugs.webkit.org/show_bug.cgi?id=174060

Reviewed by Brent Fulgham.

Source/WebKit2:

Replace ResourceLoadStatisticsStore C API by Cocoa SPI. The new Cocoa SPI is on
WKWebsiteDataStore, which allows us to get rid of the WebResourceLoadStatisticsManager
singleton as the SPI can now interact directly with the WebResourceLoadStatisticsStore.

* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: Removed.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h: Removed.
Drop old C API.

* UIProcess/WebResourceLoadStatisticsManager.cpp: Removed.
* UIProcess/WebResourceLoadStatisticsManager.h: Removed.
Drop WebResourceLoadStatisticsManager singleton which was only required by the
C API. This is because the C API was global, rather than working on a specific
store.

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
Add new Cocoa SPI on WKWebsiteDataStore. This is only used for testing.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
Stop registering the store with the WebResourceLoadStatisticsManager singleton,
as this singleton is gone.

* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::resourceLoadStatistics):
Add new getter to retrieve the WebResourceLoadStatisticsStore from the
WebsiteDataStore. This is needed by the new Cocoa SPI.

* WebKit2.xcodeproj/project.pbxproj:
Drop some files.

Tools:

Port WebKitTestRunner over to the new Cocoa SPI.

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsNotifyPagesWhenDataRecordsWereScanned):
(WTR::TestRunner::setStatisticsNotifyPagesWhenTelemetryWasCaptured):
Drop calls to the WKResourceLoadStatisticsStore C API here. Those were
no-ops since this code runs in the WebContent process, not the
UIProcess.

* WebKitTestRunner/TestController.cpp:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:

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

2 years agoAdd a warning if WEBGL2 is enabled without WEBGL
commit-queue@webkit.org [Sat, 1 Jul 2017 14:28:12 +0000 (14:28 +0000)]
Add a warning if WEBGL2 is enabled without WEBGL
https://bugs.webkit.org/show_bug.cgi?id=174054

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-07-01
Reviewed by Sam Weinig.

* wtf/FeatureDefines.h:

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

2 years agoUnreviewed, build fix for GCC
utatane.tea@gmail.com [Sat, 1 Jul 2017 09:36:35 +0000 (09:36 +0000)]
Unreviewed, build fix for GCC
https://bugs.webkit.org/show_bug.cgi?id=174034

* b3/testb3.cpp:
(JSC::B3::testDoubleLiteralComparison):

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

2 years agoForce crashWithInfo to be out of line.
keith_miller@apple.com [Sat, 1 Jul 2017 06:24:44 +0000 (06:24 +0000)]
Force crashWithInfo to be out of line.
https://bugs.webkit.org/show_bug.cgi?id=174028

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Update DFG_ASSERT macro to call CRASH_WITH_SECURITY_IMPLICATION_AND_INFO.

* dfg/DFGGraph.cpp:
(JSC::DFG::logDFGAssertionFailure):
(JSC::DFG::Graph::logAssertionFailure):
(JSC::DFG::crash): Deleted.
(JSC::DFG::Graph::handleAssertionFailure): Deleted.
* dfg/DFGGraph.h:

Source/WTF:

The first pass at making crashes hold information about why they
were crashing had the problem that it would inline the assertion.
This meant that clang could coalesce DFG_ASSERTS with other
assertion failures in the same function. This patch moves it out
of line to help fix that issue.

* wtf/Assertions.cpp:
(WTFCrashWithInfo):
* wtf/Assertions.h:
(WTF::isIntegralType):

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

2 years agoIf an image appears more than once on a page, decoding for painting one instance...
commit-queue@webkit.org [Sat, 1 Jul 2017 06:23:31 +0000 (06:23 +0000)]
If an image appears more than once on a page, decoding for painting one instance repaints them all
https://bugs.webkit.org/show_bug.cgi?id=169944

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

Source/WebCore:

Make the Image::draw*() and GraphicsContext::draw*() functions return an
ImageDrawResult which indicates whether the image is drawn or has requested
an asynchronous image decoding.

If the image requested an asynchronous image decoding, the issuer of the
Image::draw(), which is of type CachedImageClient, will add itself to a
set of m_pendingImageDrawingClients, which owned by CachedImage.

When receiving the imageFrameAvailable() notification for a lrage image
from the decoding thread, CachedImage will loop through the clients that
are only in m_pendingImageDrawingClients to ask them to repaint their
rectangles.

Test: fast/images/async-image-multiple-clients-repaint.html

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didRemoveClient):
(WebCore::CachedImage::addPendingImageDrawingClient):
(WebCore::CachedImage::allClientsRemoved):
(WebCore::CachedImage::clear):
(WebCore::CachedImage::imageFrameAvailable):
* loader/cache/CachedImage.h:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::draw):
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/GeneratedImage.h:
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::draw):
* platform/graphics/GradientImage.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
(WebCore::GraphicsContext::drawTiledImage):
* platform/graphics/GraphicsContext.h:
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/Image.h:
* platform/graphics/ImageTypes.h:
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::draw):
* platform/graphics/NamedImageGeneratedImage.h:
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::draw):
* platform/graphics/cg/PDFDocumentImage.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawForContainer):
(WebCore::SVGImage::draw):
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::draw):
* svg/graphics/SVGImageForContainer.h:

LayoutTests:

* fast/images/async-image-multiple-clients-repaint-expected.txt: Added.
* fast/images/async-image-multiple-clients-repaint.html: Added.
* platform/ios-simulator/fast/images: Added.
* platform/ios-simulator/fast/images/async-image-multiple-clients-repaint-expected.txt: Added.

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

2 years agoRun webgl tests on iOS ports
jbedard@apple.com [Sat, 1 Jul 2017 05:57:41 +0000 (05:57 +0000)]
Run webgl tests on iOS ports
https://bugs.webkit.org/show_bug.cgi?id=173000

Unreviewed test gardening.

* platform/ios/TestExpectations: Enable webgl, fast/canvas/webgl and http/tests/webgl.

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

2 years ago[JSC] Use AbstractMacroAssembler::random instead of holding WeakRandom in JIT
utatane.tea@gmail.com [Sat, 1 Jul 2017 05:24:30 +0000 (05:24 +0000)]
[JSC] Use AbstractMacroAssembler::random instead of holding WeakRandom in JIT
https://bugs.webkit.org/show_bug.cgi?id=174053

Reviewed by Geoffrey Garen.

We already have AbstractMacroAssembler::random() function. Use it instead.

* jit/JIT.cpp:
(JSC::JIT::JIT):
(JSC::JIT::compileWithoutLinking):
* jit/JIT.h:

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

2 years ago[WTF] Drop SymbolRegistry::keyForSymbol
utatane.tea@gmail.com [Sat, 1 Jul 2017 05:09:40 +0000 (05:09 +0000)]
[WTF] Drop SymbolRegistry::keyForSymbol
https://bugs.webkit.org/show_bug.cgi?id=174052

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* runtime/SymbolConstructor.cpp:
(JSC::symbolConstructorKeyFor):

Source/WTF:

Since we can know whether a given symbol is registered by checking RegisteredSymbolImpl,
we do not need to query key string for a given symbol by using SymbolRegistry::keyForSymbol.

* wtf/text/SymbolImpl.h:
(WTF::SymbolImpl::extractFoldedString): Deleted.
* wtf/text/SymbolRegistry.cpp:
(WTF::SymbolRegistry::keyForSymbol): Deleted.
* wtf/text/SymbolRegistry.h:

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

2 years agoWeb Inspector: Type token background color in debugger looks poor
commit-queue@webkit.org [Sat, 1 Jul 2017 05:06:40 +0000 (05:06 +0000)]
Web Inspector: Type token background color in debugger looks poor
https://bugs.webkit.org/show_bug.cgi?id=174063

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-06-30
Reviewed by Devin Rousso.

* UserInterface/Views/TextEditor.css:
CodeMirror widgets do not get range styles like our (.execution-range-highlight).
Make a best effort to carry over the styles to widgets. It isn't perfect, but it
covers all common situations unless a selection ends inside the widget. The
ultimate solution would be to get the expected range styles.

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

2 years agoAdd a WebRTC example for a blog post
jonlee@apple.com [Sat, 1 Jul 2017 04:53:14 +0000 (04:53 +0000)]
Add a WebRTC example for a blog post
https://bugs.webkit.org/show_bug.cgi?id=174049

Reviewed by Youenn Fablet.

Example does a typical WebRTC video call, but uses canvas to do some image effects.
Image effects will last for 30 seconds.
After that time, the video stream is directly sent.
This illustrates using RTCPeerConnection, replaceTrack and canvas capture.

* blog-files/webrtc/pc-with-effects/LICENSE: Added.
* blog-files/webrtc/pc-with-effects/glfx.js: Added.
* blog-files/webrtc/pc-with-effects/index.html: Added.
* blog-files/webrtc/pc-with-effects/main.css: Added.
* blog-files/webrtc/pc-with-effects/main.js: Added.

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

2 years agoREGRESSION(r214194): Safari leaves a popup window open opened during before unload
rniwa@webkit.org [Sat, 1 Jul 2017 03:39:09 +0000 (03:39 +0000)]
REGRESSION(r214194): Safari leaves a popup window open opened during before unload
https://bugs.webkit.org/show_bug.cgi?id=174016

Reviewed by Chris Dumez.

Address Dan's review comments.

* loader/NavigationDisabler.h:
(WebCore::NavigationDisabler::NavigationDisabler):
(WebCore::NavigationDisabler::~NavigationDisabler):

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

2 years agoB3ReduceStrength should reduce EqualOrUnordered over const float input
sbarati@apple.com [Sat, 1 Jul 2017 03:35:47 +0000 (03:35 +0000)]
B3ReduceStrength should reduce EqualOrUnordered over const float input
https://bugs.webkit.org/show_bug.cgi?id=174039

Reviewed by Michael Saboff.

We perform this folding for ConstDoubleValue. It is simply
an oversight that we didn't do it for ConstFloatValue.

* b3/B3ConstFloatValue.cpp:
(JSC::B3::ConstFloatValue::equalOrUnorderedConstant):
* b3/B3ConstFloatValue.h:
* b3/testb3.cpp:
(JSC::B3::testFloatEqualOrUnorderedFolding):
(JSC::B3::testFloatEqualOrUnorderedFoldingNaN):
(JSC::B3::testFloatEqualOrUnorderedDontFold):
(JSC::B3::run):

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

2 years agoUnreviewed mac build fix.
megan_gardner@apple.com [Sat, 1 Jul 2017 03:24:59 +0000 (03:24 +0000)]
Unreviewed mac build fix.

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

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

2 years agoUnreviewed mac build fix.
megan_gardner@apple.com [Sat, 1 Jul 2017 03:08:31 +0000 (03:08 +0000)]
Unreviewed mac build fix.

* UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
* UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:

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

2 years agoWeb Inspector: AsyncStackTrace nodes can be corrupted when truncating
mattbaker@apple.com [Sat, 1 Jul 2017 02:56:04 +0000 (02:56 +0000)]
Web Inspector: AsyncStackTrace nodes can be corrupted when truncating
https://bugs.webkit.org/show_bug.cgi?id=173840
<rdar://problem/30840820>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

When truncating an asynchronous stack trace, the parent chain is traversed
until a locked node is found. The path from this node to the root is shared
by more than one stack trace, and cannot be safely modified. Starting at
the first locked node, the path is cloned and becomes a new stack trace tree.

However, the clone operation initialized each new AsyncStackTrace node with
the original node's parent. This would increment the child count of the original
node. When cloning nodes, new nodes should not have their parent set until the
next node up the parent chain is cloned.

* inspector/AsyncStackTrace.cpp:
(Inspector::AsyncStackTrace::truncate):

LayoutTests:

Add a test for truncating a branching asynchronous stack trace.

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

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

2 years agoAdd API to get WKActivatedElementInfo
megan_gardner@apple.com [Sat, 1 Jul 2017 02:25:59 +0000 (02:25 +0000)]
Add API to get WKActivatedElementInfo
https://bugs.webkit.org/show_bug.cgi?id=174001
<rdar://problem/29165518>

Source/WebKit2:

Adding a way to get a WKActivatedElementInfo for a point on a WKWebView.

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView requestActivatedElementAtPosition:completionBlock:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
(+[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]):
(-[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]):
* UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:

Tools:

Tests for now SPI to get activatedElementInfo.

Reviewed by Tim Horton.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKRequestActivatedElementInfo.mm: Added.
(TestWebKitAPI::TEST):

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

2 years ago[iOS DnD] Text indicators for dragged links should always be legible if the link...
wenson_hsieh@apple.com [Sat, 1 Jul 2017 01:44:46 +0000 (01:44 +0000)]
[iOS DnD] Text indicators for dragged links should always be legible if the link is legible
https://bugs.webkit.org/show_bug.cgi?id=173860
<rdar://problem/32974385>

Reviewed by Tim Horton.

Currently, TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges ensures that links backed by a
RenderReplaced element don't render blank text indicators by additionally forcing the
TextIndicatorOptionPaintAllContent option in order to capture the RenderReplaced content. If estimated
background color is requested, this patch adds an additional path for "upgrading" the text indicator to paint
all content: if the text color is not legible against the estimated background color, then it is likely that the
background color estimate failed or the link itself was not legible in the first place; in the former case, to
ensure that the link is still legible, we upgrade the given TextIndicatorOptions to paint all contents in the
range.

There is currently no way to test this, and also no simple way to introduce infrastructure to test text
indicators.

* page/TextIndicator.cpp:
(WebCore::estimatedTextColorsForRange):

Estimates all text colors that appear in a range by iterating over the text node renderers and consulting their
render styles.

(WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary):

If foreground text color is deemed not legible, force TextIndicatorOptionPaintAllContent instead of
TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges.

(WebCore::initializeIndicator):
* rendering/TextPaintStyle.cpp:
(WebCore::textColorIsLegibleAgainstBackgroundColor):
(WebCore::adjustColorForVisibilityOnBackground):

Allow other parts of WebCore to check the legibility of text against a background color.

* rendering/TextPaintStyle.h:

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

2 years agoSkip a test on ARM64 platform since we run out of address space.
msaboff@apple.com [Sat, 1 Jul 2017 01:20:01 +0000 (01:20 +0000)]
Skip a test on ARM64 platform since we run out of address space.

Rubber stamped by Saam Barati.

* stress/dont-reserve-huge-capacity-lexer.js:

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

2 years agoRegExp's anchored with .* with \g flag can return wrong match start for strings...
msaboff@apple.com [Sat, 1 Jul 2017 01:16:59 +0000 (01:16 +0000)]
RegExp's  anchored with .* with \g flag can return wrong match start for strings with multiple matches
https://bugs.webkit.org/show_bug.cgi?id=174044

Reviewed by Oliver Hunt.

JSTests:

New regression test.

* stress/regress-174044.js: Added.
(test1):
(test2):

Source/JavaScriptCore:

The .* enclosure optimization didn't respect that we can start matching from a non-zero
index.  This optimization treats /.*<some-terms>.*/ by first matching the <some-terms> and
then finding the extent of the match by going back to the beginning of the line and going
forward to the end of the line.  The code that went back to the beginning of the line
checked for an index of 0 instead of comparing the index to the start position.  This start
position is passed as the initial index.

Added another temporary register to the YARR JIT to contain the start position for
platforms that have spare registers.

* yarr/Yarr.h:
* yarr/YarrInterpreter.cpp:
(JSC::Yarr::Interpreter::matchDotStarEnclosure):
(JSC::Yarr::Interpreter::Interpreter):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::generateDotStarEnclosure):
(JSC::Yarr::YarrGenerator::compile):
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPattern::YarrPattern):
* yarr/YarrPattern.h:
(JSC::Yarr::YarrPattern::reset):

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

2 years agoRebase test after r219024
achristensen@apple.com [Sat, 1 Jul 2017 00:51:33 +0000 (00:51 +0000)]
Rebase test after r219024
https://bugs.webkit.org/show_bug.cgi?id=174051

* fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame-expected.txt:
This was an intentional change making URL parsing how it was before r215096 for URLs with non-special schemes.

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

2 years agoUse API instead of SPI for content inset adjustment behavior
timothy_horton@apple.com [Sat, 1 Jul 2017 00:28:33 +0000 (00:28 +0000)]
Use API instead of SPI for content inset adjustment behavior
https://bugs.webkit.org/show_bug.cgi?id=174050

Reviewed by Sam Weinig.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView initWithFrame:]):
(-[WKScrollView setContentInsetAdjustmentBehavior:]):
(-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]):
(-[WKScrollView _setContentInsetAdjustmentBehavior:]): Deleted.
Switch over to the API. The old SPI calls the API internally, so our
override will now cover all callers.

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

2 years agoMarked test imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getKey.html...
jlewis3@apple.com [Fri, 30 Jun 2017 23:38:32 +0000 (23:38 +0000)]
Marked test imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getKey.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=173068

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoB3MoveConstants floatZero() returns the wrong ValueKey
sbarati@apple.com [Fri, 30 Jun 2017 23:38:01 +0000 (23:38 +0000)]
B3MoveConstants floatZero() returns the wrong ValueKey
https://bugs.webkit.org/show_bug.cgi?id=174040

Reviewed by Filip Pizlo.

It had a typo where the ValueKey for floatZero() produces a Double
instead of a Float.

* b3/B3MoveConstants.cpp:

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

2 years agoB3ReduceDoubleToFloat incorrectly reduces operations over two double constants
sbarati@apple.com [Fri, 30 Jun 2017 23:37:01 +0000 (23:37 +0000)]
B3ReduceDoubleToFloat incorrectly reduces operations over two double constants
https://bugs.webkit.org/show_bug.cgi?id=174034
<rdar://problem/30793007>

Reviewed by Filip Pizlo.

B3ReduceDoubleToFloat had a bug in it where it would incorrectly
reduce binary operations over double constants into the same binary
operation over the double constants casted to floats. This is clearly
incorrect as these two things will produce different values. For example:

a = DoubleConst(bitwise_cast<double>(0x8000000000000001ull))
b = DoubleConst(bitwise_cast<double>(0x0000000000000000ull))
c = EqualOrUnordered(@a, @b) // produces 0

into:

a = FloatConst(static_cast<float>(bitwise_cast<double>(0x8000000000000001ull)))
b = FloatConst(static_cast<float>(bitwise_cast<double>(0x0000000000000000ull)))
c = EqualOrUnordered(@a, @b) // produces 1

Which produces a different value for @c.

* b3/B3ReduceDoubleToFloat.cpp:
* b3/testb3.cpp:
(JSC::B3::doubleEq):
(JSC::B3::doubleNeq):
(JSC::B3::doubleGt):
(JSC::B3::doubleGte):
(JSC::B3::doubleLt):
(JSC::B3::doubleLte):
(JSC::B3::testDoubleLiteralComparison):
(JSC::B3::run):

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

2 years agoMove store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore
cdumez@apple.com [Fri, 30 Jun 2017 23:22:58 +0000 (23:22 +0000)]
Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore
https://bugs.webkit.org/show_bug.cgi?id=174038

Reviewed by Brent Fulgham.

Source/WebKit2:

Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore.
WebResourceLoadStatisticsManager is now essentially a proxy to the
WebResourceLoadStatisticsStore to support the current C API.

In a follow-up, I plan to to replace the C API with a Cocoa SPI which works on a
WebResourceLoadStatisticsStore directly instead of requiring a
WebResourceLoadStatisticsManager singleton.

* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerSetMinimumTimeBetweenDataRecordsRemoval):
(WKResourceLoadStatisticsManagerResetToConsistentState):
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: Removed.
* UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
(WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::WebResourceLoadStatisticsManager):
(WebKit::WebResourceLoadStatisticsManager::~WebResourceLoadStatisticsManager):
(WebKit::WebResourceLoadStatisticsManager::setStatisticsStore):
(WebKit::WebResourceLoadStatisticsManager::clearInMemoryStore):
(WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
(WebKit::WebResourceLoadStatisticsManager::logUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsManager::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsManager::clearPrevalentResource):
(WebKit::WebResourceLoadStatisticsManager::setGrandfathered):
(WebKit::WebResourceLoadStatisticsManager::isGrandfathered):
(WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree):
(WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
(WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler):
(WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
(WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler):
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::primaryDomain):
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::fireDataModificationHandler):
(WebKit::WebResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
(WebKit::WebResourceLoadStatisticsStore::fireTelemetryHandler):
(WebKit::WebResourceLoadStatisticsStore::clearInMemory):
(WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent):
(WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
(WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
* WebKit2.xcodeproj/project.pbxproj:

Tools:

Fix typo in API name.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsMinimumTimeBetweenDataRecordsRemoval):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsMinimumTimeBetweenDataRecordsRemoval):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

Fix typo in testRunner API.

* http/tests/loading/resourceLoadStatistics/grandfathering.html:
* http/tests/loading/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html:
* http/tests/loading/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html:
* http/tests/loading/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html:
* http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html:
* http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction.html:
* http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html:

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

2 years agoREGRESSION(r215096) Queries of URLs with non-special schemes should not percent-encod...
achristensen@apple.com [Fri, 30 Jun 2017 23:21:51 +0000 (23:21 +0000)]
REGRESSION(r215096) Queries of URLs with non-special schemes should not percent-encode single quotes
https://bugs.webkit.org/show_bug.cgi?id=174051
<rdar://problem/33002846>

Reviewed by Tim Horton.

Source/WebCore:

In r215096 I added ' to the set of characters to be percent-encoded in queries,
but for interoperability and compatibility we need to do this only for special schemes, like http.

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::isC0Control):
(WebCore::shouldPercentEncodeQueryByte):
(WebCore::URLParser::utf8QueryEncode):
(WebCore::URLParser::encodeQuery):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

2 years agoAttempt to fix the build following <https://trac.webkit.org/changeset/219019>
dbates@webkit.org [Fri, 30 Jun 2017 22:49:00 +0000 (22:49 +0000)]
Attempt to fix the build following <https://trac.webkit.org/changeset/219019>
(https://bugs.webkit.org/show_bug.cgi?id=165160)

Export the FrameLoadRequest move constructor and move operator so that they
can be used from WebKit.

* loader/FrameLoadRequest.h:

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

2 years ago[WebCore] Update AXObjectCache for !HAVE(ACCESSIBILITY)
don.olmstead@sony.com [Fri, 30 Jun 2017 22:47:04 +0000 (22:47 +0000)]
[WebCore] Update AXObjectCache for !HAVE(ACCESSIBILITY)
https://bugs.webkit.org/show_bug.cgi?id=174045

Reviewed by Konstantin Tokarev.

No new tests. No change in behavior.

* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::checkedStateChanged):
(WebCore::AXObjectCache::childrenChanged):
(WebCore::AXObjectCache::deferRecomputeIsIgnored):
(WebCore::AXObjectCache::deferTextChangedIfNeeded):
(WebCore::AXObjectCache::focusAriaModalNodeTimerFired):
(WebCore::AXObjectCache::handleAriaExpandedChange):
(WebCore::AXObjectCache::handleAriaRoleChanged):
(WebCore::AXObjectCache::handleAttributeChanged):
(WebCore::AXObjectCache::handleScrollbarUpdate):
(WebCore::AXObjectCache::liveRegionChangedNotificationPostTimerFired):
(WebCore::AXObjectCache::notificationPostTimerFired):
(WebCore::AXObjectCache::passwordNotificationPostTimerFired):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::AXObjectCache::postNotification):
(WebCore::AXObjectCache::postPlatformNotification):
(WebCore::AXObjectCache::postTextReplacementNotification):
(WebCore::AXObjectCache::postTextReplacementNotificationForTextControl):
(WebCore::AXObjectCache::postTextStateChangeNotification):
(WebCore::AXObjectCache::recomputeIsIgnored):
(WebCore::AXObjectCache::textChanged):
(WebCore::AXObjectCache::updateCacheAfterNodeIsAttached):
(WebCore::AXObjectCache::focusAriaModalNode): Deleted.

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

2 years agoWeb Inspector: Initial search is sometimes performed twice, produces duplicate results
commit-queue@webkit.org [Fri, 30 Jun 2017 22:45:08 +0000 (22:45 +0000)]
Web Inspector: Initial search is sometimes performed twice, produces duplicate results
https://bugs.webkit.org/show_bug.cgi?id=174047

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-06-30
Reviewed by Devin Rousso.

* UserInterface/Views/SearchTabContentView.js:
(WebInspector.SearchTabContentView.prototype.performSearch):
The initial layout of the tab content view was setting state to force a search
which may happen after a delay, however the global search field was causing
its own search to happen. We can clear the flag when a search is being performed
to prevent duplicating the search.

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

2 years ago[WK2] Resource load statistics code is spamming the WebProcess with a test-only message
bfulgham@apple.com [Fri, 30 Jun 2017 22:31:54 +0000 (22:31 +0000)]
[WK2] Resource load statistics code is spamming the WebProcess with a test-only message
https://bugs.webkit.org/show_bug.cgi?id=174048
<rdar://problem/33062376>

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

Fix the telemetry data message send so that it is not generated during normal operations.
This is only meant to be used by WebKitTestRunner.

* UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):

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

2 years agoAttempt to fix the Apple Windows build following <https://trac.webkit.org/changeset...
dbates@webkit.org [Fri, 30 Jun 2017 22:30:40 +0000 (22:30 +0000)]
Attempt to fix the Apple Windows build following <https://trac.webkit.org/changeset/219013>
(https://bugs.webkit.org/show_bug.cgi?id=165160)

Make FrameLoadRequest move constructor and move operator out-of-line so that callers
do not need to include header SecurityOrigin.h.

* loader/FrameLoadRequest.cpp:
* loader/FrameLoadRequest.h:

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

2 years agoAttempt to fix the WPE build following <https://trac.webkit.org/changeset/219013>
dbates@webkit.org [Fri, 30 Jun 2017 22:01:49 +0000 (22:01 +0000)]
Attempt to fix the WPE build following <https://trac.webkit.org/changeset/219013>
(https://bugs.webkit.org/show_bug.cgi?id=165160)

Update the prototype of UIClient::createNewPage() to take a API::FrameInfo& instead of
a WebFrameProxy* and a const WebCore::SecurityOriginData&.

* UIProcess/API/glib/WebKitUIClient.cpp:

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

2 years agoWeb Inspector: Add small delay before showing the progress spinner when loading resources
drousso@apple.com [Fri, 30 Jun 2017 21:57:09 +0000 (21:57 +0000)]
Web Inspector: Add small delay before showing the progress spinner when loading resources
https://bugs.webkit.org/show_bug.cgi?id=173437

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ResourceContentView.js:
(WebInspector.ResourceContentView):
(WebInspector.ResourceContentView.prototype.removeLoadingIndicator): Added.
(WebInspector.ResourceContentView.prototype._contentError):
(WebInspector.ResourceContentView.prototype._hasContent):
Delay the creation of the spinner for 100ms.  If the content is available before then, just
clear the timeout and the spinner will never be created/shown.

We measured an average of 35ms to load and display images with slow cases being around 55ms.
100ms was chosen for the timeout to give some room to allow for abnormally slow loading
while not being too long as to be outright noticable.

* UserInterface/Views/FontResourceContentView.js:
(WebInspector.FontResourceContentView.prototype.contentAvailable):
* UserInterface/Views/ImageResourceContentView.js:
(WebInspector.ImageResourceContentView.prototype.contentAvailable):
* UserInterface/Views/TextResourceContentView.js:
(WebInspector.TextResourceContentView.prototype._contentWillPopulate):
Calls the new protected function removeLoadingIndicator to ensure that the spinner (and any
other element) is removed.

This is necessary because TextResourceContentView effectively has two phases of loading its
content: getting the content and formatting it for display.  The first follows the same path
as the other ResourceContentView subclasses, the second waits for the ContentWillPopulate
event on SourceCodeTextEditor before it actually adds the content as a subview.  In this
case, the spinner should only be removed right before the content is actually added, not
once it's ready.

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

2 years agoStop soft linking with CFNetwork
achristensen@apple.com [Fri, 30 Jun 2017 21:52:53 +0000 (21:52 +0000)]
Stop soft linking with CFNetwork
https://bugs.webkit.org/show_bug.cgi?id=174029

Reviewed by Jer Noble.

Source/WebCore:

We link directly with CFNetwork.  There's no reason to soft link,
and it is causing a problem with linking when doing interesting things with CFNetwork.

* platform/spi/cf/CFNetworkSPI.h:

Source/WebKit2:

* Shared/mac/CookieStorageShim.mm:

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

2 years agoUnreviewed, rolling out r218983.
commit-queue@webkit.org [Fri, 30 Jun 2017 21:47:54 +0000 (21:47 +0000)]
Unreviewed, rolling out r218983.
https://bugs.webkit.org/show_bug.cgi?id=174042

Broke Debugger Call Stack TreeOutline (Requested by drousso on
#webkit).

Reverted changeset:

"Web Inspector: Remove unnecessary hasChildren from
TreeOutline"
https://bugs.webkit.org/show_bug.cgi?id=173986
http://trac.webkit.org/changeset/218983

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

2 years agoWeb Inspector: Default string comparisons to treat numeric characters as numbers
drousso@apple.com [Fri, 30 Jun 2017 21:47:05 +0000 (21:47 +0000)]
Web Inspector: Default string comparisons to treat numeric characters as numbers
https://bugs.webkit.org/show_bug.cgi?id=173984

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Base/Utilities.js:
(String.prototype.extendedLocaleCompare):
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WebInspector.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNames.compare):
* UserInterface/Controllers/ResourceQueryController.js:
(WebInspector.ResourceQueryController.prototype.executeQuery):
* UserInterface/Views/ApplicationCacheFrameContentView.js:
(WebInspector.ApplicationCacheFrameContentView.prototype._sortDataGrid.localeCompare):
* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype._iterateOverProperties):
* UserInterface/Views/CookieStorageContentView.js:
(WebInspector.CookieStorageContentView.prototype._sortDataGrid.localeCompare):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAttributes):
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByNode):
* UserInterface/Views/DOMStorageContentView.js:
(WebInspector.DOMStorageContentView.prototype._sortDataGrid.comparator):
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements):
* UserInterface/Views/FolderizedTreeElement.js:
(WebInspector.FolderizedTreeElement.prototype._compareTreeElementsByMainTitle):
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WebInspector.HeapSnapshotDataGridTree.buildSortComparator):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype.dataGridSortComparator):
* UserInterface/Views/NewTabContentView.js:
(WebInspector.NewTabContentView.prototype._updateShownTabs):
* UserInterface/Views/OverviewTimelineView.js:
(WebInspector.OverviewTimelineView.prototype._compareDataGridNodesByStartTime):
* UserInterface/Views/ProbeDetailsSidebarPanel.js:
(WebInspector.ProbeDetailsSidebarPanel.prototype.inspect):
* UserInterface/Views/QuickConsole.js:
(WebInspector.QuickConsole.prototype._compareExecutionContextPathComponents):
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel.prototype._createNameValueDataGrid.sortDataGrid.comparator):
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._compareTreeElements):
* UserInterface/Views/ResourceTreeElement.js:
(WebInspector.ResourceTreeElement.compareResourceTreeElements):
(WebInspector.ResourceTreeElement.compareFolderAndResourceTreeElements):
* UserInterface/Views/ScriptDetailsTimelineView.js:
(WebInspector.ScriptDetailsTimelineView.prototype.dataGridSortComparator):
* UserInterface/Views/StorageSidebarPanel.js:
(WebInspector.StorageSidebarPanel.prototype._compareTreeElements):
* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.prototype._sortComparator):

LayoutTests:

* inspector/unit-tests/string-utilities.html:
Add tests for String.prototype.extendedLocaleCompare.

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

2 years agoAPI::FrameInfo should know the web page that contains the frame; add API property...
dbates@webkit.org [Fri, 30 Jun 2017 21:35:23 +0000 (21:35 +0000)]
API::FrameInfo should know the web page that contains the frame; add API property webView to WKFrameInfo
https://bugs.webkit.org/show_bug.cgi?id=165160
<rdar://problem/29451999>

Reviewed by Brady Eidson.

Source/WebCore:

Pass the document that is requesting the load to the loader.

* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::openInNewTab): Pass the document when instantiating the FrameLoadRequest.
Also use C++11 brace initialization to instantiate ResourceRequest.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::navigate): Pass the document when instantiating the FrameLoadRequest.
* loader/FrameLoadRequest.cpp:
(WebCore::FrameLoadRequest::FrameLoadRequest): Moved from FrameLoadRequest.h.
(WebCore::FrameLoadRequest::requester): Added.
(WebCore::FrameLoadRequest::requesterSecurityOrigin): Added.
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::FrameLoadRequest): Marked as WEBCORE_EXPORT and modified to take
the document that requested the load.
(WebCore::FrameLoadRequest::requester): Deleted; made out-of-line/moved to FrameLoadRequest.cpp.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected): Pass the document when instantiating the FrameLoadRequest. Also use C++11
brace initialization to instantiate ResourceRequest.
(WebCore::FrameLoader::loadURLIntoChildFrame): Pass the document when instantiating the FrameLoadRequest.
(WebCore::FrameLoader::loadFrameRequest): Substitute FrameLoadRequest::requesterSecurityOrigin() for
FrameLoadRequest::requester() as the former replaces the latter.
(WebCore::FrameLoader::loadURL): Pass the document when instantiating the NavigationAction.
(WebCore::FrameLoader::load): Ditto.
(WebCore::FrameLoader::loadWithDocumentLoader): Pass the document when instantiating the NavigationAction.
Also use C++11 brace initialization syntax to instantiate the NavigationAction.
(WebCore::FrameLoader::reload): Ditto.
(WebCore::FrameLoader::loadPostRequest): Ditto.
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Pass the document when instantiating the NavigationAction.
(WebCore::FrameLoader::loadDifferentDocumentItem): Pass the document when instantiating the NavigationAction.
Also use C++11 brace initialization syntax to instantiate the NavigationAction.
(WebCore::createWindow): Pass the document when instantiating the NavigationAction.
* loader/NavigationAction.cpp:
(WebCore::NavigationAction::NavigationAction): Modified to take the source document.
* loader/NavigationAction.h:
(WebCore::NavigationAction::isEmpty): Consider a NavigationAction empty if does not have a source document
or the associated ResourceRequest has an empty URL.
(WebCore::NavigationAction::sourceDocument): Added.
(WebCore::NavigationAction::NavigationAction): Deleted; made out-of-line/moved to NavigationAction.cpp to
avoid the need to include the header Document.h.
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledURLNavigation::ScheduledURLNavigation): Store the document that scheduled the navigation.
Also use C++11 brace initialization to instantiate in the member initialization list.
(WebCore::ScheduledURLNavigation::initiatingDocument): Added. Retrieves the document that scheduled the navigation.
(WebCore::NavigationScheduler::scheduleLocationChange): Pass the document when instantiating the FrameLoadRequest.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy): Pass the document when instantiating the NavigationAction.
Also use C++11 brace initialization syntax to instantiate the NavigationAction.
* page/ContextMenuController.cpp:
(WebCore::openNewWindow):
(WebCore::ContextMenuController::contextMenuItemSelected): Pass the document when instantiating the FrameLoadRequest.
Also use C++11 brace initialization syntax to instantiate the FrameLoadRequest.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow): Pass the document when instantiating the FrameLoadRequest.

Source/WebKit/ios:

Pass the document that is requesting the load to the loader.

* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):

Source/WebKit/mac:

Pass the document that is requesting the load to the loader.

* WebView/WebPDFView.mm:
(-[WebPDFView PDFViewWillClickOnLink:withURL:]):

Source/WebKit/win:

Pass the document that is requesting the load to the loader.

* Plugins/PluginView.cpp:
(WebCore::PluginView::start):
(WebCore::PluginView::getURLNotify):
(WebCore::PluginView::getURL):
(WebCore::PluginView::handlePost):

Source/WebKit2:

Expose a property on WKFrameInfo to retrieve the WKWebView of the web page that contains the
frame. This will allow an embedding client to know the web view that initiated the navigation
request as well as differentiate between a navigation initiated by web content from one
initiated via API.

The majority of this change is passing the document D that initiated the targeted navigation
or called window.open() through the loading machinery to the FrameLoaderClient. The changes
to pass this information to the FrameLoaderClient when creating a new window are straightforward.
For targeted navigation, the WebKit2 FrameLoaderClient implementation now computes the info
for the originating frame regardless of the navigation type (NavigationAction::type()).
(Currently we only compute the originating frame for hyperlink activated navigations,
form submissions, and form resubmissions). The WebProcess computes the page ID of the page
that contains the originating frame and sends that to the UIProcess so that it can create
an API::FrameInfo for the originating frame and associate the page that contains the frame,
if the navigation was triggered by web content. If the navigation was triggered by API
(e.g. -[WKWebView goBack]) then the created API::FrameInfo does not have an associated page
so that an embedding client can distinguish between a navigation initiated by web content
from a navigation that it initiated via API depending on whether API::FrameInfo::page() is
nullptr. We expose property webView on the Mac and iOS API class WKFrameInfo to return the
WKWebView corresponding to API::FrameInfo::page().

A small change that this patch makes is to have the WebProcess compute the originating frame
info (call WebFrame::info()) and send it over to the UIProcess as opposed to sending the frame
ID of the originating frame and having the UIProcess compute the frame info from it. We do this
because the UIProcess may not be able to compute the frame info for the originating frame if
the window that it was contained in was closed between the time the WebProcess sent the frame
ID to the UIProcess and the UIProcess received it.

* UIProcess/API/APIFrameInfo.cpp:
(API::FrameInfo::create):
(API::FrameInfo::FrameInfo):
(API::FrameInfo::clearPage):
* UIProcess/API/APIFrameInfo.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::createNewPage):
(API::UIClient::createNewPageAsync):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/Cocoa/WKFrameInfo.h:
* UIProcess/API/Cocoa/WKFrameInfo.mm:
(-[WKFrameInfo description]):
(-[WKFrameInfo webView]):
* UIProcess/API/Cocoa/WKUserContentController.mm:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPageCommon):
(WebKit::UIDelegate::UIClient::createNewPage):
(WebKit::UIDelegate::UIClient::createNewPageAsync):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::loadURL):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchCreatePage):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openInNewTab):

Tools:

Add tests to ensure that -[WKFrameInfo webView] is computed correctly for the source and target frame
for navigations and window creation.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/DecidePolicyForNavigationAction.mm: Added. Derived from file ShouldOpenExternalURLsInNewWindowActions.mm.
(-[DecidePolicyForNavigationActionController webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[DecidePolicyForNavigationActionController webView:didFinishNavigation:]):
(-[DecidePolicyForNavigationActionController webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]):
(TEST):

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

2 years agoMake Legacy EME API controlled by RuntimeEnabled setting.
jer.noble@apple.com [Fri, 30 Jun 2017 21:04:11 +0000 (21:04 +0000)]
Make Legacy EME API controlled by RuntimeEnabled setting.
https://bugs.webkit.org/show_bug.cgi?id=173994

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
* runtime/CommonIdentifiers.h:

Source/WebCore:

Add a new RuntimeEnabledFeatures setting to control the availability of the WebKit prefixed EME APIs.

* Configurations/FeatureDefines.xcconfig:
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.idl:
* dom/Element.idl:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
(WebCore::HTMLMediaElement::webkitSetMediaKeys):
(WebCore::HTMLMediaElement::keyAdded):
* html/HTMLMediaElement.idl:
* html/WebKitMediaKeyError.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setLegacyEncryptedMediaAPIEnabled):
(WebCore::RuntimeEnabledFeatures::legacyEncryptedMediaAPIEnabled):

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

Add a new preference used to control WebCore's new RuntimeEnabledFeature setting.

* Configurations/FeatureDefines.xcconfig:
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences legacyEncryptedMediaAPIEnabled]):
(-[WebPreferences setLegacyEncryptedMediaAPIEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Add a new WKWebViewConfiguration property, as well as a new WKPreferences function, both able to control
WebCore's new RuntimeEnabledFeature setting for the Legacy EME API.

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesGetLegacyEncryptedMediaAPIEnabled):
(WKPreferencesSetLegacyEncryptedMediaAPIEnabled):
* UIProcess/API/C/WKPreferencesRef.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _setLegacyEncryptedMediaAPIEnabled:]):
(-[WKWebViewConfiguration _legacyEncryptedMediaAPIEnabled]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

2 years agoREGRESSION (r218757): Touch Bar's media scrubber timeline runs from 00:00 to 00:00...
jer.noble@apple.com [Fri, 30 Jun 2017 21:00:10 +0000 (21:00 +0000)]
REGRESSION (r218757): Touch Bar's media scrubber timeline runs from 00:00 to 00:00 and has no playhead
https://bugs.webkit.org/show_bug.cgi?id=174032

Reviewed by Eric Carlson.

Fix a copypasta error where durationChange notifications were changing the value of muted.

* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
(WebKit::WebPlaybackSessionManagerProxy::durationChanged):

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

2 years agoMove ResourceLoadStatisticsStore to WebKit2/UIProcess
cdumez@apple.com [Fri, 30 Jun 2017 20:54:26 +0000 (20:54 +0000)]
Move ResourceLoadStatisticsStore to WebKit2/UIProcess
https://bugs.webkit.org/show_bug.cgi?id=174033

Reviewed by Brent Fulgham.

Move ResourceLoadStatisticsStore to WebKit2/UIProcess since it is only
used in the WebKit2 UIProcess.

* CMakeLists.txt:
Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* loader/ResourceLoadObserver.cpp:
(WebCore::primaryDomain):
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::primaryDomain):
* loader/ResourceLoadStatistics.h:

Source/WebKit2:

* UIProcess/Storage/ResourceLoadStatisticsStore.cpp: Renamed from Source/WebCore/loader/ResourceLoadStatisticsStore.cpp.
(WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
(WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
(WebKit::ResourceLoadStatisticsStore::clearInMemory):
(WebKit::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
(WebKit::ResourceLoadStatisticsStore::mergeStatistics):
(WebKit::ResourceLoadStatisticsStore::fireDataModificationHandler):
(WebKit::ResourceLoadStatisticsStore::fireTelemetryHandler):
(WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
(WebKit::ResourceLoadStatisticsStore::processStatistics):
(WebKit::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
(WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
(WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved):
(WebKit::ResourceLoadStatisticsStore::dataRecordsWereRemoved):
(WebKit::ResourceLoadStatisticsStore::statisticsLock):
* UIProcess/Storage/ResourceLoadStatisticsStore.h: Renamed from Source/WebCore/loader/ResourceLoadStatisticsStore.h.
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::primaryDomain):
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
* UIProcess/WebResourceLoadStatisticsTelemetry.h:
* WebKit2.xcodeproj/project.pbxproj:

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

2 years agoRan sort-Xcode-project-file.
rniwa@webkit.org [Fri, 30 Jun 2017 20:28:15 +0000 (20:28 +0000)]
Ran sort-Xcode-project-file.

Source/bmalloc:

* bmalloc.xcodeproj/project.pbxproj:

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

* WebKit2.xcodeproj/project.pbxproj:

Source/WTF:

* WTF.xcodeproj/project.pbxproj:

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

2 years agoREGRESSION(r214194): Safari leaves a popup window open opened during before unload
rniwa@webkit.org [Fri, 30 Jun 2017 19:32:41 +0000 (19:32 +0000)]
REGRESSION(r214194): Safari leaves a popup window open opened during before unload
https://bugs.webkit.org/show_bug.cgi?id=174016

Reviewed by Chris Dumez.

Source/WebCore:

The bug was caused by WebKit allowing the opening of a new window via window.open but disallowing
the initial navigation within the newly opened window while a beforeunload event is being dispatched.

Because some websites which opens a window during a beforeunload event relies on the opened page
to communicate back in order to close it. This resulted in a newly opened popup window with about:blank
being left out on those websites.

Fixed the bug by allowing the navigation of a new window as well as an existing another window.
More concretely, we disallow navigations within the same frame tree as the one in which a beforeunload
event is being dispatched, and allow navigations elsewhere (i.e. different window / page).
During the destruction of a frame-less document, disallow all the navigations.

Tests: fast/events/before-unload-navigate-different-window.html
       fast/events/before-unload-open-window.html
       fast/events/before-unload-sibling-frame.html

* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::isNavigationAllowed):
(WebCore::FrameLoader::shouldClose):
* loader/NavigationDisabler.h: Added. Extracted from NavigationScheduler.h
(WebCore::NavigationDisabler::NavigationDisabler): Increment the newly added counter on MainFrame unless
the frame is null (during the destruction of a frameless document) in which case we increment the global
disable count.
(WebCore::NavigationDisabler::~NavigationDisabler): Ditto for decrementation.
(WebCore::NavigationDisabler::isNavigationAllowed): Only allow the navigation when there is no frameless
document in destruction, and none of the frame in the same frame tree as the one given is currently in
the process of dispatching a beforeunload event.
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::shouldScheduleNavigation):
* loader/NavigationScheduler.h:
(WebCore::NavigationDisabler): Moved to NavigationDisabler.h.
* page/MainFrame.h:
(WebCore::MainFrame): Added s_globalNavigationDisableCount.

LayoutTests:

Added regression tests for navigating a new window, a sibling iframe, and another existing window.

* fast/events/before-unload-navigate-different-window-expected.txt: Added.
* fast/events/before-unload-navigate-different-window.html: Added.
* fast/events/before-unload-open-window-expected.txt: Added.
* fast/events/before-unload-open-window.html: Added.
* fast/events/before-unload-sibling-frame-expected.txt: Added.
* fast/events/before-unload-sibling-frame.html: Added.
* fast/events/resources/message-opener.html: Added.
* fast/events/resources/message-top.html: Added.

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

2 years ago[WebIDL] Add support for conditionally read-write attributes
commit-queue@webkit.org [Fri, 30 Jun 2017 19:04:56 +0000 (19:04 +0000)]
[WebIDL] Add support for conditionally read-write attributes
https://bugs.webkit.org/show_bug.cgi?id=173993

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

The MEDIA_SOURCE feature/conditional requires changing a few readonly
attributes into read-write attributes. In the past we handled this with
custom bindings. This patch adds a new extended attribute, ConditionallyReadWrite
which achieves the same result.

* WebCore.xcodeproj/project.pbxproj:
Move a few custom binding to the "GC / Wrapping Only" group.

* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind): Deleted.
(WebCore::JSAudioTrack::setLanguage): Deleted.
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setLanguage): Deleted.
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind): Deleted.
(WebCore::JSVideoTrack::setLanguage): Deleted.
Remove no longer needed custom bindings.

* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
(GenerateImplementation):
(GenerateAttributeSetterDefinition):
(GenerateCallbackImplementationContent):
(GenerateHashTableValueArray):
(GenerateHashTable):
Pipe ConditionallyReadWrite through the generator.

* bindings/scripts/IDLAttributes.json:
Add ConditionallyReadWrite.

* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:
Add tests for ConditionallyReadWrite.

* html/track/AudioTrack.idl:
* html/track/TextTrack.idl:
* html/track/VideoTrack.idl:
Replace [Custom] with [ConditionallyReadWrite].

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

2 years agoUnreviewed, rolling out r218992.
jlewis3@apple.com [Fri, 30 Jun 2017 18:37:59 +0000 (18:37 +0000)]
Unreviewed, rolling out r218992.

The patch broke the iOS device builds.

Reverted changeset:

"DFG_ASSERT should allow stuffing registers before trapping."
https://bugs.webkit.org/show_bug.cgi?id=174005
http://trac.webkit.org/changeset/218992

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

2 years agoResourceLoadObserver does not need a ResourceLoadStatisticsStore
cdumez@apple.com [Fri, 30 Jun 2017 18:18:19 +0000 (18:18 +0000)]
ResourceLoadObserver does not need a ResourceLoadStatisticsStore
https://bugs.webkit.org/show_bug.cgi?id=174013

Reviewed by Brent Fulgham.

ResourceLoadObserver does not need a ResourceLoadStatisticsStore. ResourceLoadStatisticsStore is too complicated for its needs.
ResourceLoadStatisticsStore can then be moved to WebKit2/UIProcess in a follow-up.

Source/WebCore:

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::shared):
(WebCore::ResourceLoadObserver::setNotificationCallback):
(WebCore::ResourceLoadObserver::shouldLog):
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain):
(WebCore::ResourceLoadObserver::takeResourceStatisticsForPrimaryDomain):
(WebCore::ResourceLoadObserver::isPrevalentResource):
(WebCore::ResourceLoadObserver::statisticsForOrigin):
(WebCore::ResourceLoadObserver::takeStatistics):
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatisticsStore.cpp:
* loader/ResourceLoadStatisticsStore.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* testing/Internals.cpp:
(WebCore::Internals::resourceLoadStatisticsForOrigin):

Source/WebKit/mac:

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

Source/WebKit2:

* WebProcess/WebProcess.cpp:
(WebKit::m_webSQLiteDatabaseTracker):
(WebKit::WebProcess::statisticsChangedTimerFired):
* WebProcess/WebProcess.h:

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

2 years agoFollow-up fix for r218996
jbedard@apple.com [Fri, 30 Jun 2017 18:10:37 +0000 (18:10 +0000)]
Follow-up fix for r218996

Unreviewed infrastructure fix.

Repeated calls to 'ios_version' make the log noisy, memoize the function.

* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort): Memoize ios_version().

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

2 years agoASSERTION FAILED: !canAnimate() && !m_currentFrame
commit-queue@webkit.org [Fri, 30 Jun 2017 17:28:20 +0000 (17:28 +0000)]
ASSERTION FAILED: !canAnimate() && !m_currentFrame
https://bugs.webkit.org/show_bug.cgi?id=173089

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

Source/WebCore:

WebCore::BitmapImage::draw() has an assertion which ensures
m_currentFrame is zero in case of async decoding. But, this
assertion failed if an GIF animation image which have finished its
animation was repainted. In that time, m_currentFrame was the last
frame index of the image.

Test: fast/images/animated-gif-paint-after-animation.html

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw): Assert m_currentFrame is zero or the animation finished.
Call requestFrameAsyncDecodingAtIndex with m_currentFrame instead of zero.

LayoutTests:

* fast/images/animated-gif-paint-after-animation-expected.txt: Added.
* fast/images/animated-gif-paint-after-animation.html: Added.
* fast/images/resources/animated-red-green-1000x1000-repeat-1.gif: Added.

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

2 years ago[WK2][iOS][macOS] Update XPC services process launch dictionary
bfulgham@apple.com [Fri, 30 Jun 2017 16:54:11 +0000 (16:54 +0000)]
[WK2][iOS][macOS] Update XPC services process launch dictionary
https://bugs.webkit.org/show_bug.cgi?id=173995
<rdar://problem/32797264>

Reviewed by Alex Christensen.

Update the WebProcess and Plugin Process XPC launch dictionaries to activate
improved ALSR features when launching.

* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:

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

2 years agoRegExpCachedResult::setInput should reify left and right contexts
fpizlo@apple.com [Fri, 30 Jun 2017 16:37:29 +0000 (16:37 +0000)]
RegExpCachedResult::setInput should reify left and right contexts
https://bugs.webkit.org/show_bug.cgi?id=173818

Reviewed by Keith Miller.
JSTests:

* stress/right-left-context-invalidated-by-input.js: Added.
(test.validateContexts):
(test):

Source/JavaScriptCore:

If you don't reify them in setInput, then when you later try to reify them, you'll end up
using indices into an old input string to create a substring of a new input string. That
never goes well.

* runtime/RegExpCachedResult.cpp:
(JSC::RegExpCachedResult::setInput):

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

2 years agoMerge WebResourceLoadStatisticsManager and WebResourceLoadObserver
cdumez@apple.com [Fri, 30 Jun 2017 16:22:42 +0000 (16:22 +0000)]
Merge WebResourceLoadStatisticsManager and WebResourceLoadObserver
https://bugs.webkit.org/show_bug.cgi?id=174008

Reviewed by Brent Fulgham.

Merge WebResourceLoadStatisticsManager and WebResourceLoadObserver. One was basically
a proxy to the other.

* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerSetPrevalentResource):
(WKResourceLoadStatisticsManagerIsPrevalentResource):
(WKResourceLoadStatisticsManagerSetHasHadUserInteraction):
(WKResourceLoadStatisticsManagerIsHasHadUserInteraction):
(WKResourceLoadStatisticsManagerSetGrandfathered):
(WKResourceLoadStatisticsManagerIsGrandfathered):
(WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
(WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction):
(WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree):
(WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval):
(WKResourceLoadStatisticsManagerSetGrandfatheringTime):
(WKResourceLoadStatisticsManagerFireDataModificationHandler):
(WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler):
(WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandlerForOneDomain):
(WKResourceLoadStatisticsManagerFireTelemetryHandler):
(WKResourceLoadStatisticsManagerSetNotifyPagesWhenDataRecordsWereScanned):
(WKResourceLoadStatisticsManagerSetShouldClassifyResourcesBeforeDataRecordsRemoval):
(WKResourceLoadStatisticsManagerSetNotifyPagesWhenTelemetryWasCaptured):
(WKResourceLoadStatisticsManagerSetShouldSubmitTelemetry):
(WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStore):
(WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKResourceLoadStatisticsManagerResetToConsistentState):
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm:
(WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded):
* UIProcess/WebResourceLoadObserver.cpp: Removed.
* UIProcess/WebResourceLoadObserver.h: Removed.
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::primaryDomain):
(WebKit::WebResourceLoadStatisticsManager::shared):
(WebKit::WebResourceLoadStatisticsManager::setStatisticsStore):
(WebKit::WebResourceLoadStatisticsManager::setStatisticsQueue):
(WebKit::WebResourceLoadStatisticsManager::clearInMemoryStore):
(WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
(WebKit::WebResourceLoadStatisticsManager::logUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsManager::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsManager::clearPrevalentResource):
(WebKit::WebResourceLoadStatisticsManager::setGrandfathered):
(WebKit::WebResourceLoadStatisticsManager::isGrandfathered):
(WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree):
(WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
(WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler):
(WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
(WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler):
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
* WebKit2.xcodeproj/project.pbxproj:

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

2 years ago[PAL] Move Sound into PAL
commit-queue@webkit.org [Fri, 30 Jun 2017 16:12:17 +0000 (16:12 +0000)]
[PAL] Move Sound into PAL
https://bugs.webkit.org/show_bug.cgi?id=173999

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-06-30
Reviewed by Alex Christensen.

Source/WebCore:

* Configurations/WebCore.xcconfig:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* WebCore.xcodeproj/project.pbxproj:
* editing/Editor.cpp:
(WebCore::Editor::cut):
(WebCore::Editor::copy):
(WebCore::Editor::performDelete):
* editing/EditorCommand.cpp:
(WebCore::executeSelectToMark):
(WebCore::executeSwapWithMark):
* editing/mac/EditorMac.mm:
(WebCore::Editor::takeFindStringFromSelection):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::beep):
* platform/Sound.h: Removed.

Source/WebCore/PAL:

* Configurations/PAL.xcconfig:
* PAL.xcodeproj/project.pbxproj:
* pal/CMakeLists.txt:
* pal/PlatformGTK.cmake:
* pal/PlatformMac.cmake:
* pal/PlatformWPE.cmake:
* pal/PlatformWin.cmake:
* pal/system/Sound.h: Renamed from Source/WebCore/platform/ios/SoundIOS.mm.
* pal/system/SoundNone.cpp: Renamed from Source/WebCore/platform/wpe/SoundWPE.cpp.
(PAL::systemBeep):
* pal/system/gtk/SoundGtk.cpp: Renamed from Source/WebCore/platform/gtk/SoundGtk.cpp.
* pal/system/mac/SoundMac.mm: Renamed from Source/WebCore/platform/mac/SoundMac.mm.
* pal/system/win/SoundWin.cpp: Renamed from Source/WebCore/platform/win/SoundWin.cpp.

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

2 years ago[iOS DnD] Drag caret rect is incorrectly computed when dropping in editable content...
wenson_hsieh@apple.com [Fri, 30 Jun 2017 16:08:21 +0000 (16:08 +0000)]
[iOS DnD] Drag caret rect is incorrectly computed when dropping in editable content in iframes
https://bugs.webkit.org/show_bug.cgi?id=174017
<rdar://problem/32959782>

Reviewed by Simon Fraser.

Source/WebCore:

We're currenly computing the drag caret rect (for the purposes of presentation at the client layers)
incorrectly, in per-frame document coordinates instead of root view coordinates in the mainframe. This means
drag caret geometry from embedded iframes in the document will show up in the content view with a rect in the
coordinate space of the iframe.

To fix this, we need to convert the drag caret rect to root view coordinates. This patch teaches
DragCaretController to do this, and tweaks WebKit/WebKit2 to use caretRectInRootViewCoordinates.

Test: DataInteractionTests.ExternalSourcePlainTextToIFrame

* editing/FrameSelection.cpp:
(WebCore::DragCaretController::caretRectInRootViewCoordinates):
* editing/FrameSelection.h:

Source/WebKit/mac:

Use root view coordinates when computing the drag caret rect.

* WebView/WebView.mm:
(-[WebView _dataInteractionCaretRect]):

Source/WebKit2:

Send the drag caret rect in root view coordinates over to the UI process.

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

Add basic test plumbing to fetch the current drag caret rect.

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

Tools:

Add a new test verifying that the drag caret is visually contained within the bounds of an iframe. Before these
changes, the caret would appear outside of the iframe.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/contenteditable-in-iframe.html: Added.
* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(checkDragCaretRectIsContainedInRect):
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/DataInteractionSimulator.h:
* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[DataInteractionSimulator _resetSimulatedState]):
(-[DataInteractionSimulator _concludeDataInteractionAndPerformOperationIfNecessary]):
(-[DataInteractionSimulator _advanceProgress]):
(-[DataInteractionSimulator lastKnownDragCaretRect]):

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

2 years ago[WebIDL] Replace use of __is_polymorphic with standard std::is_polymorphic<>::value
commit-queue@webkit.org [Fri, 30 Jun 2017 15:45:59 +0000 (15:45 +0000)]
[WebIDL] Replace use of __is_polymorphic with standard std::is_polymorphic<>::value
https://bugs.webkit.org/show_bug.cgi?id=174012

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

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
Replace __is_polymorphic with standard std::is_polymorphic<>::value. Remove clang
specific guard now that we are using something other compilers support.

* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestStringifier.cpp:
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results.

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

2 years agoAdd support for different versions of iOS when loading test expectations
jbedard@apple.com [Fri, 30 Jun 2017 15:33:16 +0000 (15:33 +0000)]
Add support for different versions of iOS when loading test expectations
https://bugs.webkit.org/show_bug.cgi?id=173774
<rdar://problem/32951132>

Rubber-stamped by Aakash Jain.

When running layout tests, we should support multiple version of iOS the same way we do Mac.

* Scripts/webkitpy/port/ios.py:
(IOSPort.default_baseline_search_path): Add ios-<major version> test expectation.
(IOSPort.test_expectations_file_position): Added new file expectations, increment expected file position.
(IOSPort.ios_version): iOS ports must define a function to retrieve the iOS version.
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort.ios_version): Ask connected devices for implementation.
* Scripts/webkitpy/port/ios_device_unittest.py:
(IOSDeviceTest.test_additional_platform_directory): Skip test until bug 173775 is finished.
(IOSDeviceTest.test_baseline_searchpath): Ditto.
(IOSDeviceTest.test_expectations_ordering): Ditto.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.ios_version): If a runtime is specified, ask the runtime for the iOS version. Otherwise,
ask the platform.

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

2 years agoUpdate expectations for layout tests.
wilander@apple.com [Fri, 30 Jun 2017 15:09:58 +0000 (15:09 +0000)]
Update expectations for layout tests.
https://bugs.webkit.org/show_bug.cgi?id=173940

Unreviewed test gardening, update test expectations for failing tests.

* platform/wk2/TestExpectations:
    http/tests/loading/resourceLoadStatistics/telemetry-generation.html
    is still failing.

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

2 years agoSource/WebCore:
commit-queue@webkit.org [Fri, 30 Jun 2017 15:00:43 +0000 (15:00 +0000)]
Source/WebCore:
       Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
       https://bugs.webkit.org/show_bug.cgi?id=169389

       Reviewed by Alex Christensen.

       Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
       Updated test is showing some more failing but this is due to the fact that we are no longer totally lying on the configuration of the
underlying libwebrtc backend.

Previously, we were creating a libwebrtc peer connection and then setting its configuration.
libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.

ICE candidate pool size is disabled as it is creating issues with running tests on bots.

Patch by Youenn Fablet <youenn@apple.com> on 2017-06-30

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setConfiguration):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::initializeWith):
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
(WebCore::LibWebRTCMediaEndpoint::setConfiguration):
(WebCore::LibWebRTCMediaEndpoint::stop):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::configurationFromMediaEndpointConfiguration):
(WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::createActualPeerConnection):
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:

Source/WebKit2:
Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
https://bugs.webkit.org/show_bug.cgi?id=169389

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

* fast/mediastream/RTCPeerConnection-getConfiguration-expected.txt:

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

2 years agoFontconfig build breaks with glibc 2.15+
commit-queue@webkit.org [Fri, 30 Jun 2017 13:18:39 +0000 (13:18 +0000)]
Fontconfig build breaks with glibc 2.15+
https://bugs.webkit.org/show_bug.cgi?id=174019

Patch by Jacobo Aragunde PĂ©rez <jaragunde@igalia.com> on 2017-06-30
Reviewed by Carlos Alberto Lopez Perez.

Apply patch by Khem Raj adapted to fontconfig 2.11.1.

* wpe/jhbuild.modules:
* wpe/patches/fontconfig-avoid-conflicts-with-integer-width-macros-from-TS-18.patch: Added.

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

2 years agoDFG_ASSERT should allow stuffing registers before trapping.
keith_miller@apple.com [Fri, 30 Jun 2017 08:23:18 +0000 (08:23 +0000)]
DFG_ASSERT should allow stuffing registers before trapping.
https://bugs.webkit.org/show_bug.cgi?id=174005

Reviewed by Mark Lam.

Source/JavaScriptCore:

DFG_ASSERT currently prints error data to stderr before crashing,
which is nice for local development. In the wild, however, we
can't see this information in crash logs. This patch enables
stuffing some of the most useful information from DFG_ASSERTS into
up to five registers right before crashing. The values stuffed
should not impact any logging during local development.

* assembler/AbortReason.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::verifyEdge):
* dfg/DFGGraph.cpp:
(JSC::DFG::logForCrash):
(JSC::DFG::Graph::logAssertionFailure):
(JSC::DFG::crash): Deleted.
(JSC::DFG::Graph::handleAssertionFailure): Deleted.
* dfg/DFGGraph.h:

Source/WTF:

Add new template functions that enable stuffing up to five values
into registers before crashing.

* wtf/Assertions.h:
(CRASH_WITH_INFO):

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

2 years agoTop controls bars should invert with right-to-left user interface layout direction...
commit-queue@webkit.org [Fri, 30 Jun 2017 07:48:37 +0000 (07:48 +0000)]
Top controls bars should invert with right-to-left user interface layout direction locale
https://bugs.webkit.org/show_bug.cgi?id=173989
<rdar://problem/32863552>

Patch by Antoine Quint <graouts@apple.com> on 2017-06-30
Reviewed by Dean Jackson.

Source/WebCore:

When the user interface layout direction is set by the locale to be right-to-left, we now:

    - invert the two top controls bars
    - invert the layout order for the fullscreen / PiP controls bar
    - orient the volume button the opposite direction when presented in a top controls bar

Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl.html

* Modules/modern-media-controls/controls/icon-service.js: Add new RTL variants for the mute and unmute icons.
* Modules/modern-media-controls/controls/inline-media-controls.css: Invert the position of the two top controls
bars when we switch user interface layout direction.
(.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-left,):
(.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-right,):
(.media-controls.inline > .controls-bar.top-left): Deleted.
(.media-controls.inline > .controls-bar.top-right): Deleted.
* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls.prototype.layout): Default to using the LTR variant for the mute button icon since
it should only use the RTL variant in case the locale requires it *and* we display the mute button in a
top controls bar rather than the bottom controls bar (ie. when width becomes constrained).
(InlineMediaControls.prototype._topLeftContainerButtons): Invert the order of the fullscreen and PiP
buttons based on the user interface layout direction.
(InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
(InlineMediaControls):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.set usesLTRUserInterfaceLayoutDirection): Schedule a layout when the user interface
layout direction changes.
* Modules/modern-media-controls/controls/mute-button.js: Add a new "usesRTLIconVariant" property, false by
default, to indicate we want to use the RTL variant of the button's icon.
(MuteButton):
(MuteButton.prototype.get muted):
(MuteButton.prototype.set muted):
(MuteButton.prototype.set usesRTLIconVariant):
(MuteButton.prototype.layout):
* Modules/modern-media-controls/images/iOS/Mute-RTL.svg: Added.
* Modules/modern-media-controls/images/iOS/VolumeHi-RTL.svg: Added.
* Modules/modern-media-controls/images/macOS/Mute-RTL.svg: Added.
* Modules/modern-media-controls/images/macOS/VolumeHi-RTL.svg: Added.
* Modules/modern-media-controls/media/media-controller.js: Use an ivar to track when it's worth notifying the
media controls that the user interface layout direction has changed. This means we won't need to schedule a
layout in case it's set to the current value.
(MediaController):
(MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):

LayoutTests:

Add a new test to check we correctly layout the top controls bars in RTL and rebaseline a
test that now requires an asynchronous assertion.

* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl.html: Added.
* media/modern-media-controls/mute-button/mute-button-expected.txt:
* media/modern-media-controls/mute-button/mute-button.html:
* platform/mac/TestExpectations:

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

2 years agoREGRESSION (High Sierra): Gradient LayoutTests are failing
dino@apple.com [Fri, 30 Jun 2017 07:34:01 +0000 (07:34 +0000)]
REGRESSION (High Sierra): Gradient LayoutTests are failing
https://bugs.webkit.org/show_bug.cgi?id=174015
<rdar://problem/32332022>

Reviewed by Tim Horton.

Add the fudge factor to more of the gradient tests.

* canvas/philip/tests.js:
(_assertPixelWithGradientNoise): Bump the factor up a bit.
* canvas/philip/tests/2d.gradient.interpolate.multiple.html:
* canvas/philip/tests/2d.gradient.interpolate.solid.html:
* canvas/philip/tests/2d.gradient.radial.transform.1.html:
* canvas/philip/tests/2d.gradient.radial.transform.2.html:
* canvas/philip/tests/2d.gradient.radial.transform.3.html:
* canvas/philip/tests/initial.reset.gradient.html:

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

2 years agoBreakingContext::handleReplaced() should use replacedBox instead of m_current.renderer().
zalan@apple.com [Fri, 30 Jun 2017 06:21:04 +0000 (06:21 +0000)]
BreakingContext::handleReplaced() should use replacedBox instead of m_current.renderer().
https://bugs.webkit.org/show_bug.cgi?id=174011

Reviewed by Simon Fraser.

No change in functionality.

* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleReplaced):
* rendering/line/LineWidth.cpp:
(WebCore::LineWidth::applyOverhang):
* rendering/line/LineWidth.h:

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

2 years ago[iOS DnD] Web content process crashes when the selection is moved far offscreen in...
wenson_hsieh@apple.com [Fri, 30 Jun 2017 04:44:53 +0000 (04:44 +0000)]
[iOS DnD] Web content process crashes when the selection is moved far offscreen in dragstart
https://bugs.webkit.org/show_bug.cgi?id=174010
<rdar://problem/32597802>

Reviewed by Tim Horton.

Source/WebCore:

The TextIndicator snapshot generated in createDragImageForSelection is not guaranteed to succeed; this patch
adds a null check following TextIndicator::createWithSelectionInFrame and bails early if the snapshot was not
successful.

Test: DataInteractionTests.DoNotCrashWhenSelectionMovesOffscreenAfterDragStart

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

Tools:

Adds a new API test to ensure that we don't crash trying to dereference a null RefPtr when the TextIndicator
snapshot fails for any reason.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/dragstart-change-selection-offscreen.html: Added.
* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):

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

2 years agoUploadedFile should include the file extension in its url
rniwa@webkit.org [Fri, 30 Jun 2017 04:43:00 +0000 (04:43 +0000)]
UploadedFile should include the file extension in its url
https://bugs.webkit.org/show_bug.cgi?id=174009

Reviewed by Chris Dumez.

Some command line tools such as darwinup use the file extension to determine the file type.
Include the file extension in the URL of an uploaded file to make it work with these tools.

* public/include/uploaded-file-helpers.php:
(format_uploaded_file): Include the file extension.
* public/v3/models/uploaded-file.js:
(UploadedFile):
(UploadedFile.prototype.url): Return the URL with hthe file extension specified. /api/uploaded-file
already supports having the file extension specified.
* server-tests/tools-sync-buildbot-integration-tests.js: Updated test cases.
* unit-tests/buildbot-syncer-tests.js: Ditto.

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

2 years agoAX: Cannot call setValue() on contenteditable or ARIA text controls
cfleizach@apple.com [Fri, 30 Jun 2017 03:43:25 +0000 (03:43 +0000)]
AX: Cannot call setValue() on contenteditable or ARIA text controls
https://bugs.webkit.org/show_bug.cgi?id=173520

Reviewed by Ryosuke Niwa.

Source/WebCore:

Add support for changing the value of a contenteditable and any other aria text control in setValue().

Test: accessibility/mac/set-value-editable-types.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setValue):

Tools:

Add setValue() method to WKTR (already existed in DRT).

* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::setValue):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::setValue):

LayoutTests:

* accessibility/mac/set-value-editable-types-expected.txt: Added.
* accessibility/mac/set-value-editable-types.html: Added.

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

2 years agoAssert that callback ID is not 0 or -1 during encoding and decoding
rniwa@webkit.org [Fri, 30 Jun 2017 03:03:54 +0000 (03:03 +0000)]
Assert that callback ID is not 0 or -1 during encoding and decoding
https://bugs.webkit.org/show_bug.cgi?id=173803

Reviewed by Brady Eidson.

To diagnosing the hang inside Safari (<rdar://problem/32841256>), add assertions for the callback ID
to be not 0 or -1 during encoding and decoding of IPC messages since the latest analysis seems to
indicate the hang is caused by the hash map getting corrupted by the insertion of 0 (empty value).

Wrapped the uint64_t in CallbackID and OptionalCallbackID to add assertions.

* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
* Shared/CallbackID.h: Added.
(WebKit::CallbackID::CallbackID):
(WebKit::CallbackID::operator==):
(WebKit::CallbackID::toInteger):
(WebKit::CallbackID::isValid):
(WebKit::CallbackID::isValidCallbackID): A callback ID is valid when it's neither 0 nor -1.
(WebKit::CallbackID::fromInteger): Create a CallbackID object from potentially unsafe value.
(WebKit::CallbackID::generateID): Generates the next callback ID. Moved from CallbackBase.
(WebKit::CallbackID::encode): Added. Assert that it's neither 0 nor -1.
(WebKit::CallbackID::decode): Ditto.
(WTF::CallbackIDHash::hash):
(WTF::CallbackIDHash::equal):
(WTF::HashTraits<WebKit::CallbackID>::emptyValue):
(WTF::HashTraits<WebKit::CallbackID>::constructDeletedValue):
(WTF::HashTraits<WebKit::CallbackID>::isDeletedValue):
* Shared/OptionalCallbackID.h: Added. Unlike CallbackID, callback ID here can be 0.
(WebKit::OptionalCallbackID::OptionalCallbackID):
(WebKit::OptionalCallbackID::toInteger):
(WebKit::OptionalCallbackID::callbackID): Returns a valid CallbackID object. The caller of
this function must have verified that the ID is neither 0 or -1 before calling this function.
(WebKit::OptionalCallbackID::operator bool):
(WebKit::OptionalCallbackID::isValid):
(WebKit::OptionalCallbackID::isValidCallbackID):
(WebKit::OptionalCallbackID::encode): Since OptionalCallbackID can be 0, only assert that it's not -1.
(WebKit::OptionalCallbackID::decode): Ditto.
* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.h:
* UIProcess/GenericCallback.h:
(WebKit::CallbackBase::callbackID): Returns a CallbackID object instead of uint64_t.
(WebKit::CallbackBase::CallbackBase):
(WebKit::CallbackBase::generateCallbackID): Deleted.
(WebKit::CallbackMap::put): Returns a callback ID. Also added a version that doesn't take activity token
as used in WebCookieManagerProxy
(WebKit::CallbackMap::take): Takes a callback ID.
* UIProcess/WebCookieManagerProxy.cpp: Updated the code as callback maps are merged.
(WebKit::WebCookieManagerProxy::processPoolDestroyed):
(WebKit::WebCookieManagerProxy::processDidClose):
(WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
(WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies):
(WebKit::WebCookieManagerProxy::deleteCookie):
(WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManagerProxy::setCookie):
(WebKit::WebCookieManagerProxy::setCookies):
(WebKit::WebCookieManagerProxy::getAllCookies):
(WebKit::WebCookieManagerProxy::getCookies):
(WebKit::WebCookieManagerProxy::didSetCookies):
(WebKit::WebCookieManagerProxy::didGetCookies):
(WebKit::WebCookieManagerProxy::didDeleteCookies):
(WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::didSetHTTPCookieAcceptPolicy):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebCookieManagerProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setInitialFocus):
(WebKit::WebPageProxy::validateCommand):
(WebKit::WebPageProxy::runJavaScriptInMainFrame):
(WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
(WebKit::WebPageProxy::getSourceForFrame):
(WebKit::WebPageProxy::getContentsAsString):
(WebKit::WebPageProxy::getBytecodeProfile):
(WebKit::WebPageProxy::getSamplingProfilerOutput):
(WebKit::WebPageProxy::getContentsAsMHTMLData):
(WebKit::WebPageProxy::getSelectionOrContentsAsString):
(WebKit::WebPageProxy::getSelectionAsWebArchiveData):
(WebKit::WebPageProxy::getMainResourceDataOfFrame):
(WebKit::WebPageProxy::getResourceDataFromFrame):
(WebKit::WebPageProxy::getWebArchiveOfFrame):
(WebKit::WebPageProxy::forceRepaint):
(WebKit::WebPageProxy::clearLoadDependentCallbacks):
(WebKit::WebPageProxy::voidCallback):
(WebKit::WebPageProxy::dataCallback):
(WebKit::WebPageProxy::imageCallback):
(WebKit::WebPageProxy::stringCallback):
(WebKit::WebPageProxy::invalidateStringCallback):
(WebKit::WebPageProxy::scriptValueCallback):
(WebKit::WebPageProxy::computedPagesCallback):
(WebKit::WebPageProxy::validateCommandCallback):
(WebKit::WebPageProxy::unsignedCallback):
(WebKit::WebPageProxy::editingRangeCallback):
(WebKit::WebPageProxy::machSendRightCallback):
(WebKit::WebPageProxy::rectForCharacterRangeCallback):
(WebKit::WebPageProxy::printFinishedCallback):
(WebKit::WebPageProxy::computePagesForPrinting):
(WebKit::WebPageProxy::drawRectToImage):
(WebKit::WebPageProxy::drawPagesToPDF):
(WebKit::WebPageProxy::drawPagesForPrinting):
(WebKit::WebPageProxy::getMarkedRangeAsync):
(WebKit::WebPageProxy::getSelectedRangeAsync):
(WebKit::WebPageProxy::characterIndexForPointAsync):
(WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
(WebKit::WebPageProxy::takeSnapshot):
(WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
(WebKit::WebPageProxy::getLoadDecisionForIcon):
(WebKit::WebPageProxy::finishedLoadingIcon):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::gestureCallback):
(WebKit::WebPageProxy::touchesCallback):
(WebKit::WebPageProxy::autocorrectionDataCallback):
(WebKit::WebPageProxy::selectionContextCallback):
(WebKit::WebPageProxy::autocorrectionContextCallback):
(WebKit::WebPageProxy::selectionRectsCallback):
(WebKit::WebPageProxy::selectWithGesture):
(WebKit::WebPageProxy::updateSelectionWithTouches):
(WebKit::WebPageProxy::requestAutocorrectionData):
(WebKit::WebPageProxy::applyAutocorrection):
(WebKit::WebPageProxy::executeEditCommand):
(WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
(WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
(WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
(WebKit::WebPageProxy::selectPositionAtPoint):
(WebKit::WebPageProxy::beginSelectionInDirection):
(WebKit::WebPageProxy::updateSelectionWithExtentPoint):
(WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPageProxy::requestDictationContext):
(WebKit::WebPageProxy::requestAutocorrectionContext):
(WebKit::WebPageProxy::getSelectionContext):
(WebKit::WebPageProxy::selectWithTwoTouches):
(WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
(WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
(WebKit::WebPageProxy::moveSelectionByOffset):
(WebKit::WebPageProxy::focusNextAssistedNode):
(WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
(WebKit::WebPageProxy::drawToPDFCallback):
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
(-[WKPrintingView _askPageToComputePageRects]):
(-[WKPrintingView _drawPreview:]):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
(WebKit::WebPageProxy::attributedStringForCharacterRangeCallback):
(WebKit::WebPageProxy::fontAtSelection):
(WebKit::WebPageProxy::fontAtSelectionCallback):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::getHostnamesWithCookies):
(WebKit::WebCookieManager::deleteCookie):
(WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManager::getAllCookies):
(WebKit::WebCookieManager::getCookies):
(WebKit::WebCookieManager::setCookie):
(WebKit::WebCookieManager::setCookies):
(WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
(WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/Cookies/WebCookieManager.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
(WebKit::WebFrameLoaderClient::finishedLoadingIcon):
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::forceRepaintAsync):
(WebKit::AcceleratedDrawingArea::activityStateDidChange):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::forceRepaintAsync):
(WebKit::CoordinatedLayerTreeHost::renderNextFrame):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::forceRepaintAsync):
(WebKit::DrawingArea::activityStateDidChange):
(WebKit::DrawingArea::addTransactionCallbackID):
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/LayerTreeHost.h:
(WebKit::LayerTreeHost::forceRepaintAsync):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::takeSnapshot):
(WebKit::WebPage::validateCommand):
(WebKit::WebPage::setInitialFocus):
(WebKit::WebPage::setActivityState):
(WebKit::WebPage::runJavaScriptInMainFrame):
(WebKit::WebPage::getContentsAsString):
(WebKit::WebPage::getContentsAsMHTMLData):
(WebKit::WebPage::getRenderTreeExternalRepresentation):
(WebKit::WebPage::getSelectionAsWebArchiveData):
(WebKit::WebPage::getSelectionOrContentsAsString):
(WebKit::WebPage::getSourceForFrame):
(WebKit::WebPage::getMainResourceDataOfFrame):
(WebKit::WebPage::getResourceDataFromFrame):
(WebKit::WebPage::getWebArchiveOfFrame):
(WebKit::WebPage::forceRepaint):
(WebKit::WebPage::computePagesForPrinting):
(WebKit::WebPage::drawRectToImage):
(WebKit::WebPage::drawPagesToPDF):
(WebKit::WebPage::drawPagesForPrinting):
(WebKit::WebPage::didFinishPrintOperation):
(WebKit::WebPage::getMarkedRangeAsync):
(WebKit::WebPage::getSelectedRangeAsync):
(WebKit::WebPage::characterIndexForPointAsync):
(WebKit::WebPage::firstRectForCharacterRangeAsync):
(WebKit::WebPage::getBytecodeProfile):
(WebKit::WebPage::getSamplingProfilerOutput):
(WebKit::WebPage::didGetLoadDecisionForIcon):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
(WebKit::WebPrintOperationGtk::WebPrintOperationGtk):
* WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getSelectionContext):
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::updateSelectionWithTouches):
(WebKit::WebPage::selectWithTwoTouches):
(WebKit::WebPage::moveSelectionByOffset):
(WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
(WebKit::WebPage::getRectsAtSelectionOffsetWithText):
(WebKit::WebPage::selectPositionAtPoint):
(WebKit::WebPage::selectPositionAtBoundaryWithDirection):
(WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::WebPage::beginSelectionInDirection):
(WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPage::updateSelectionWithExtentPoint):
(WebKit::WebPage::requestDictationContext):
(WebKit::WebPage::requestAutocorrectionData):
(WebKit::WebPage::applyAutocorrection):
(WebKit::WebPage::executeEditCommandWithCallback):
(WebKit::WebPage::requestAutocorrectionContext):
(WebKit::WebPage::focusNextAssistedNode):
(WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
(WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::forceRepaintAsync):
(WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
(WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
(WebKit::WebPage::fontAtSelection):

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

2 years agoWeb Inspector: Provide a way for creating a new tab but not making it immediately...
drousso@apple.com [Fri, 30 Jun 2017 02:25:02 +0000 (02:25 +0000)]
Web Inspector: Provide a way for creating a new tab but not making it immediately selected
https://bugs.webkit.org/show_bug.cgi?id=173983

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TabBar.js:
(WebInspector.TabBar):
(WebInspector.TabBar.prototype.addTabBarItem):
(WebInspector.TabBar.prototype.insertTabBarItem):
(WebInspector.TabBar.prototype.removeTabBarItem):
(WebInspector.TabBar.prototype._handleClick):
(WebInspector.TabBar.prototype._handleNewTabClick):
* UserInterface/Views/TabBrowser.js:
(WebInspector.TabBrowser.prototype.addTabForContentView):
(WebInspector.TabBrowser.prototype.showTabForContentView):
(WebInspector.TabBrowser.prototype.closeTabForContentView):
* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
(WebInspector._openDefaultTab):
(WebInspector._tryToRestorePendingTabs):
(WebInspector.showNewTabTab):
(WebInspector.createNewTabWithType):
Add `options` dictionaries instead of optional parameters.

(WebInspector.tabContentViewClassForRepresentedObject):
Drive-by fix: remove incorrect placement of WebInspector.Collection check. This function
determines TabContentView classes, not ContentView.

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

2 years agoWeb Inspector: Remove unnecessary hasChildren from TreeOutline
drousso@apple.com [Fri, 30 Jun 2017 02:16:05 +0000 (02:16 +0000)]
Web Inspector: Remove unnecessary hasChildren from TreeOutline
https://bugs.webkit.org/show_bug.cgi?id=173986

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TreeOutline.js:
(WebInspector.TreeOutline):
(WebInspector.TreeOutline.prototype.appendChild):
(WebInspector.TreeOutline.prototype.insertChild):
(WebInspector.TreeOutline.prototype.removeChildAtIndex):
(WebInspector.TreeOutline.prototype.removeChild):
(WebInspector.TreeOutline.prototype.get selectedTreeElementIndex):

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype._checkOutlinesForPendingViewStateCookie):
* UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.get value):

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

2 years agogetBoundingClientRect returns wrong value for combination of page zoom and scroll
simon.fraser@apple.com [Fri, 30 Jun 2017 02:09:09 +0000 (02:09 +0000)]
getBoundingClientRect returns wrong value for combination of page zoom and scroll
https://bugs.webkit.org/show_bug.cgi?id=173841
rdar://problem/32983841

Reviewed by Dean Jackson.

Source/WebCore:

The layout viewport returned by FrameView::layoutViewportRect() is affected by page (Command-+) zooming,
since it's computed using scroll positions, so when we use its origin to convert into client coordinates
(which are zoom-agnostic), we need to account for page zoom, so fix FrameView::documentToClientOffset()
to do this.

Callers of documentToClientOffset() were checked, revealing that event client coordinates were also
wrong with page zoom and are fixed in the same way. It was found that SimulatedClick was using an
entirely wrong rect to compute its location: Element::clientRect() is NOT in client coordinates,
so change this code to use getBoundingClientRect() instead.

Minor refactoring in MouseRelatedEvent to make getting to the FrameView cleaner.

Some geometry types enhanced to have non-mutating scale functions.

Tests: fast/events/simulated-click-zoomed.html
       fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html

* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::init):
(WebCore::MouseRelatedEvent::initCoordinates):
(WebCore::MouseRelatedEvent::frameView):
(WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor):
(WebCore::MouseRelatedEvent::computePageLocation):
(WebCore::MouseRelatedEvent::computeRelativePosition):
(WebCore::pageZoomFactor): Deleted.
(WebCore::frameScaleFactor): Deleted.
* dom/MouseRelatedEvent.h:
(WebCore::MouseRelatedEvent::absoluteLocation):
(WebCore::MouseRelatedEvent::setAbsoluteLocation): Deleted.
* dom/SimulatedClick.cpp:
* page/FrameView.cpp:
(WebCore::FrameView::layoutViewportRect): baseLayoutViewportSize() is the same as the old code.
(WebCore::FrameView::documentToAbsoluteScaleFactor):
(WebCore::FrameView::absoluteToDocumentScaleFactor):
(WebCore::FrameView::absoluteToDocumentPoint):
(WebCore::FrameView::documentToClientOffset):
* page/FrameView.h:
* platform/graphics/FloatPoint.h:
(WebCore::FloatPoint::scale):
(WebCore::FloatPoint::scaled):
* platform/graphics/FloatSize.h:
(WebCore::FloatSize::scaled):
* platform/graphics/LayoutPoint.h:
(WebCore::LayoutPoint::scaled):

Tools:

Make "Zoom In" and "Zoom Out" work correctly in the WebKit1 window. Previously they
always did text zooming.

* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController zoomIn:]):
(-[WK1BrowserWindowController zoomOut:]):
(-[WK1BrowserWindowController canResetZoom]):
(-[WK1BrowserWindowController resetZoom:]):

LayoutTests:

* fast/events/clientXY-in-zoom-and-scroll.html: New baseline for progressed behavior.
* fast/events/simulated-click-zoomed-expected.txt: Added.
* fast/events/simulated-click-zoomed.html: Added.
* fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed-expected.txt: Added.
* fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html: Added.
* platform/ios/TestExpectations:
* platform/mac/fast/events/clientXY-in-zoom-and-scroll-expected.txt:

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

2 years agoUnreviewed, fixing Window's build after r218976
megan_gardner@apple.com [Fri, 30 Jun 2017 01:13:03 +0000 (01:13 +0000)]
Unreviewed, fixing Window's build after r218976

* rendering/ScrollAlignment.cpp:
(WebCore::operator<<):

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

2 years ago[iOS] Don't confuse coordinate spaces when computing the size of PDF snapshots
aestes@apple.com [Fri, 30 Jun 2017 01:01:06 +0000 (01:01 +0000)]
[iOS] Don't confuse coordinate spaces when computing the size of PDF snapshots
https://bugs.webkit.org/show_bug.cgi?id=173996
<rdar://problem/32961028>

Reviewed by Tim Horton.

When computing the printing rect for PDF snapshots, we were getting the width the
WKContentView's bounds and the height from the WKScrollView's contentSize. These sizes are
in different coordinate spaces, leading to incorrect clipping on sites that have a non-1
scale factor.

Fix this by using the WKContentView's bounds for both width and height.

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

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

2 years agoCalculating postCapacity in unshiftCountSlowCase is wrong
sbarati@apple.com [Fri, 30 Jun 2017 00:58:18 +0000 (00:58 +0000)]
Calculating postCapacity in unshiftCountSlowCase is wrong
https://bugs.webkit.org/show_bug.cgi?id=173992
<rdar://problem/32283199>

Reviewed by Keith Miller.

JSTests:

* stress/unshiftCountSlowCase-correct-postCapacity.js: Added.
(temp):

Source/JavaScriptCore:

This patch fixes a bug inside unshiftCountSlowCase where we would use
more memory than we allocated. The bug was when deciding how much extra
space we have after the vector we've allocated. This area is called the
postCapacity. The largest legal postCapacity value we could use is the
space we allocated minus the space we need:
largestPossiblePostCapacity = newStorageCapacity - requiredVectorLength;
However, the code was calculating the postCapacity as:
postCapacity = max(newStorageCapacity - requiredVectorLength, count);

where count is how many elements we're appending. Depending on the inputs,
count could be larger than (newStorageCapacity - requiredVectorLength). This
would cause us to use more memory than we actually allocated.

* runtime/JSArray.cpp:
(JSC::JSArray::unshiftCountSlowCase):

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

2 years agoAdd TextStream operators for Range, VisiblePosition, VisibleSelection, and ScrollAlig...
megan_gardner@apple.com [Fri, 30 Jun 2017 00:55:34 +0000 (00:55 +0000)]
Add TextStream operators for Range, VisiblePosition, VisibleSelection, and ScrollAlignment
https://bugs.webkit.org/show_bug.cgi?id=173997

Reviewed by Simon Fraser.

Adding logging that can be used with TextStream-based LOG_WITH_STREAM.

* dom/Range.cpp:
(WebCore::operator<<):
* dom/Range.h:
* editing/VisiblePosition.h:
* editing/VisibleSelection.cpp:
(WebCore::operator<<):
* editing/VisibleSelection.h:
* rendering/ScrollAlignment.cpp:
(WebCore::operator<<):
* rendering/ScrollAlignment.h:

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

2 years agoWeb Inspector: Cleanup unused/invalid parameters for SidebarPanels
drousso@apple.com [Fri, 30 Jun 2017 00:41:04 +0000 (00:41 +0000)]
Web Inspector: Cleanup unused/invalid parameters for SidebarPanels
https://bugs.webkit.org/show_bug.cgi?id=173985

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SidebarPanel.js:
* UserInterface/Views/NavigationSidebarPanel.js:
* UserInterface/Views/NavigationSidebarPanel.css:
(.sidebar > .panel.navigation > .overflow-shadow.top): Deleted.
* UserInterface/Views/DetailsSidebarPanel.js:

* UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js:
* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
* UserInterface/Views/DOMDetailsSidebarPanel.js:
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
* UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
* UserInterface/Views/ProbeDetailsSidebarPanel.js:
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
* UserInterface/Views/StorageSidebarPanel.js:

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

2 years agoUnreviewed, rolling out r218903.
jlewis3@apple.com [Fri, 30 Jun 2017 00:15:56 +0000 (00:15 +0000)]
Unreviewed, rolling out r218903.

This patch and its fix cause immediate flakiness on all WK2
testers

Reverted changeset:

"Support PeerConnectionStates::BundlePolicy::MaxBundle when
setting rtc configuration"
https://bugs.webkit.org/show_bug.cgi?id=169389
http://trac.webkit.org/changeset/218903

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

2 years agoUnreviewed, rolling out r218963.
jlewis3@apple.com [Fri, 30 Jun 2017 00:14:55 +0000 (00:14 +0000)]
Unreviewed, rolling out r218963.

This patch and its fix cause immediate flakiness on all WK2
testers

Reverted changeset:

"Support PeerConnectionStates::BundlePolicy::MaxBundle when
setting rtc configuration"
https://bugs.webkit.org/show_bug.cgi?id=169389
http://trac.webkit.org/changeset/218963

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

2 years agoSplit ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess
cdumez@apple.com [Thu, 29 Jun 2017 23:40:29 +0000 (23:40 +0000)]
Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=173990

Reviewed by Brent Fulgham.

Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess.
They really have different API and there is therefore close to no code duplication.

Source/WebCore:

* loader/ResourceLoadObserver.cpp:
(WebCore::primaryDomain):
(WebCore::ResourceLoadObserver::setStatisticsQueue):
(WebCore::ResourceLoadObserver::shouldLog):
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::primaryDomain):
* loader/ResourceLoadStatisticsStore.h:
* platform/URL.h:

Source/WebKit2:

* CMakeLists.txt:
* UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm:
(WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded):
* UIProcess/WebResourceLoadObserver.cpp: Added.
(WebKit::primaryDomain):
(WebKit::WebResourceLoadObserver::sharedObserver):
(WebKit::WebResourceLoadObserver::setStatisticsStore):
(WebKit::WebResourceLoadObserver::setStatisticsQueue):
(WebKit::WebResourceLoadObserver::clearInMemoryStore):
(WebKit::WebResourceLoadObserver::clearInMemoryAndPersistentStore):
(WebKit::WebResourceLoadObserver::logUserInteraction):
(WebKit::WebResourceLoadObserver::clearUserInteraction):
(WebKit::WebResourceLoadObserver::hasHadUserInteraction):
(WebKit::WebResourceLoadObserver::setPrevalentResource):
(WebKit::WebResourceLoadObserver::isPrevalentResource):
(WebKit::WebResourceLoadObserver::clearPrevalentResource):
(WebKit::WebResourceLoadObserver::setGrandfathered):
(WebKit::WebResourceLoadObserver::isGrandfathered):
(WebKit::WebResourceLoadObserver::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadObserver::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadObserver::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadObserver::setTimeToLiveCookiePartitionFree):
(WebKit::WebResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval):
(WebKit::WebResourceLoadObserver::setGrandfatheringTime):
(WebKit::WebResourceLoadObserver::fireDataModificationHandler):
(WebKit::WebResourceLoadObserver::fireShouldPartitionCookiesHandler):
(WebKit::WebResourceLoadObserver::fireTelemetryHandler):
* UIProcess/WebResourceLoadObserver.h: Added.
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsManager::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsManager::setHasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::setGrandfathered):
(WebKit::WebResourceLoadStatisticsManager::isGrandfathered):
(WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree):
(WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
(WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler):
(WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
(WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandlerForOneDomain):
(WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler):
(WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
(WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStoreModifiedSinceHours):
(WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
* WebKit2.xcodeproj/project.pbxproj:

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

2 years ago[WebIDL] Remove custom binding for UserMessageHandlersNamespace
commit-queue@webkit.org [Thu, 29 Jun 2017 23:13:26 +0000 (23:13 +0000)]
[WebIDL] Remove custom binding for UserMessageHandlersNamespace
https://bugs.webkit.org/show_bug.cgi?id=173956

Patch by Sam Weinig <sam@webkit.org> on 2017-06-29
Reviewed by Darin Adler.

Source/WebCore:

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

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateNamedGetterLambda):
Add support for calling named getters with additional arguments from [CallWith].

(GenerateAttributeGetterBodyDefinition):
(GenerateAttributeSetterBodyDefinition):
(GenerateCallWithUsingReferences):
(GenerateCallWithUsingPointers):
(GenerateConstructorCallWithUsingPointers):
(GenerateCallWith):
(GenerateParametersCheck):
Update arguments to GenerateCallWith(Using...) to no longer pass an operation,
which was only needed for the no longer used ScriptArguments, pass a thisObject
reference, and optionally pass an indentation.

* bindings/scripts/IDLAttributes.json:
Remove no longer used ScriptArguments and CallStack, add World.

* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjWithScriptArgumentsAndCallStackAttributeGetter): Deleted.
(WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute): Deleted.
(WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttributeSetter): Deleted.
(WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStackBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack): Deleted.
* bindings/scripts/test/TestObj.idl:
Remove tests of ScriptArguments and CallStack.

* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: Added.
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: Added.
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: Added.
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: Added.
* bindings/scripts/test/TestNamedGetterCallWith.idl: Added.
* bindings/scripts/test/TestNamedGetterNoIdentifier.idl: Added.
* bindings/scripts/test/TestNamedGetterWithIdentifier.idl: Added.
Add basic named getter tests and a specific test of named getters using CallWith.

* page/UserMessageHandlersNamespace.cpp:
(WebCore::UserMessageHandlersNamespace::supportedPropertyNames):
(WebCore::UserMessageHandlersNamespace::namedItem):
(WebCore::UserMessageHandlersNamespace::handler): Deleted.
* page/UserMessageHandlersNamespace.h:
Rename handler to namedItem, matching convention and the expectations of the
bindings generator and swap the order of the arguments for the same reason.

* page/UserMessageHandlersNamespace.idl:
Remove CustomGetOwnPropertySlotAndDescriptor, and add the anonymous named getter.

Source/WebKit2:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
(webkit_dom_dom_window_webkit_message_handlers_post_message):
Update for name change.

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

2 years agoAvoid copying ResourceLoadStatistics objects
cdumez@apple.com [Thu, 29 Jun 2017 23:07:48 +0000 (23:07 +0000)]
Avoid copying ResourceLoadStatistics objects
https://bugs.webkit.org/show_bug.cgi?id=173972

Reviewed by Brent Fulgham.

Avoid copying ResourceLoadStatistics objects given that they are big. Make the type move-only
to avoid such mistakes in the future.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation):
* loader/ResourceLoadStatistics.h:
(WebCore::ResourceLoadStatistics::ResourceLoadStatistics):

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