WebKit-https.git
2 years agoRelease assert in ScriptController::canExecuteScripts via WebCore::SVGUseElement...
rniwa@webkit.org [Thu, 28 Jun 2018 21:00:45 +0000 (21:00 +0000)]
Release assert in ScriptController::canExecuteScripts via WebCore::SVGUseElement::insertedIntoAncestor
https://bugs.webkit.org/show_bug.cgi?id=187137
<rdar://problem/41081885>

Reviewed by Zalan Bujtas.

The bug was caused by SVGUseElement::notifyFinished firing a DOM event via SVGUseElement::updateExternalDocument
inside SVGUseElement::insertedIntoAncestor. Ideally, we make every call to notifyFinished asynchronous
but simply delay the call to updateExternalDocument() until didFinishInsertingNode() for now.

No new tests since the failure is caught with the newly added assertion in notifyFinished by existing SVG tests
such as svg/batik/filters/filterRegions.svg and svg/batik/text/smallFonts.svg. Unfortunately, I could not
construct a test case which hits this release assertion since the real crash happens when the cached resource
had an error but in the all cases I could find, the resource response with an error results in a reload or
an asynchronous failure callback.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::didAddClient): Added a FIXME.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::insertedIntoAncestor): Delay the call to updateExternalDocument.
(WebCore::SVGUseElement::didFinishInsertingNode): Invoke updateExternalDocument.
(WebCore::SVGUseElement::notifyFinished): Added an assertion.
* svg/SVGUseElement.h:

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

2 years agoUnreviewed attempt to fix Win Cairo build after r233310.
cdumez@apple.com [Thu, 28 Jun 2018 20:59:19 +0000 (20:59 +0000)]
Unreviewed attempt to fix Win Cairo build after r233310.

* UIProcess/WebResourceLoadStatisticsStore.h:

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

2 years agoTeach Windows EWS bots to use WEBKIT_API_KEY.
lforschler@apple.com [Thu, 28 Jun 2018 20:58:20 +0000 (20:58 +0000)]
Teach Windows EWS bots to use WEBKIT_API_KEY.

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

2 years agoUnreviewed attempt to fix Win Cairo build after r233310.
cdumez@apple.com [Thu, 28 Jun 2018 20:52:06 +0000 (20:52 +0000)]
Unreviewed attempt to fix Win Cairo build after r233310.

* UIProcess/WebResourceLoadStatisticsStore.h:

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

2 years agoUnreviewed, rolling out r233309.
cdumez@apple.com [Thu, 28 Jun 2018 20:17:34 +0000 (20:17 +0000)]
Unreviewed, rolling out r233309.

Invalidates previous database model without versioning

Reverted changeset:

"Fix encoding / decoding issues in ResourceLoadStatistics"
https://bugs.webkit.org/show_bug.cgi?id=186890
https://trac.webkit.org/changeset/233309

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

2 years agoSplit memory store logic out of WebResourceLoadStatisticsStore to clarify threading...
cdumez@apple.com [Thu, 28 Jun 2018 20:09:21 +0000 (20:09 +0000)]
Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
https://bugs.webkit.org/show_bug.cgi?id=187055
<rdar://problem/41584026>

Unreviewed, temporarily disable main thread assertion added to flushAndDestroyPersistentStore()
in r233310, until Bug 187143 is fixed.

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

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

2 years ago[ews-build] Add support for WebKitPy-Tests-EWS
aakash_jain@apple.com [Thu, 28 Jun 2018 19:52:32 +0000 (19:52 +0000)]
[ews-build] Add support for WebKitPy-Tests-EWS
https://bugs.webkit.org/show_bug.cgi?id=187148

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/factories.py: Added WebKitPyFactory.
* BuildSlaveSupport/ews-build/steps.py: Added build step RunWebKitPyTests.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
* BuildSlaveSupport/ews-build/config.json: Updated to use CamelCase.

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

2 years agoAdd sandbox to microdone plugin
youenn@apple.com [Thu, 28 Jun 2018 19:42:24 +0000 (19:42 +0000)]
Add sandbox to microdone plugin
https://bugs.webkit.org/show_bug.cgi?id=187149
rdar://problem/41538057

Reviewed by Brent Fulgham.

* Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari: Added.
* WebKit.xcodeproj/project.pbxproj:

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

2 years agoWeb Inspector: REGRESSION(r223770): "Open Link" context menu action on a linkified...
bburg@apple.com [Thu, 28 Jun 2018 19:14:47 +0000 (19:14 +0000)]
Web Inspector: REGRESSION(r223770): "Open Link" context menu action on a linkified URL doesn't work
https://bugs.webkit.org/show_bug.cgi?id=187146
<rdar://problem/41369591>

Reviewed by Joseph Pecoraro.

When Web Inspector's page receives a navigation request, it's supposed to redirect any
non-Inspector navigations to be loaded in the inspected page. When I refactored to use
modern a policy delegate, the one line that redirects the loads was left out.

No new tests, because inspector tests can't navigate the inspector or inspected pages.

* UIProcess/mac/WKInspectorViewController.mm:
(-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):

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

2 years agoFocus ring color does not honor dark mode or system accent color.
timothy@apple.com [Thu, 28 Jun 2018 18:51:07 +0000 (18:51 +0000)]
Focus ring color does not honor dark mode or system accent color.
https://bugs.webkit.org/show_bug.cgi?id=187144
rdar://problem/41105081

Reviewed by Tim Horton.

Pass the focus ring color through to the GraphicsContext methods that draw it.

* platform/graphics/GraphicsContext.h:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRingAtTime):
(WebCore::drawFocusRing):
(WebCore::drawFocusRingToContext):
(WebCore::drawFocusRingToContextAtTime):
(WebCore::GraphicsContext::drawFocusRing):
(WebCore::GraphicsContext::focusRingColor): Deleted.
* platform/mac/ThemeMac.mm:
(WebCore::drawCellFocusRingWithFrameAtTime):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):

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

2 years agoCrash when _topConstraint is null in element fullscreen.
commit-queue@webkit.org [Thu, 28 Jun 2018 18:36:48 +0000 (18:36 +0000)]
Crash when _topConstraint is null in element fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=187075

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-06-28
Reviewed by Eric Carlson.

NSArray can't contain a null pointer, so check for null before creating an array from a pointer.
Use the recommended +deactivateConstraints: instead of -removeConstraints:.

* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController showUI]):
(-[WKFullScreenViewController hideUI]):

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

2 years agoFix the iOS build following r233299
dbates@webkit.org [Thu, 28 Jun 2018 17:35:34 +0000 (17:35 +0000)]
Fix the iOS build following r233299
(https://bugs.webkit.org/show_bug.cgi?id=183744)

Only build lldbWebKitTester on Mac as that is the only supported platform at the time of writing.

* Makefile:

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

2 years agoUnreviewed gardening; media/video-buffering-allowed.html is flakey due to not complet...
jer.noble@apple.com [Thu, 28 Jun 2018 17:24:01 +0000 (17:24 +0000)]
Unreviewed gardening; media/video-buffering-allowed.html is flakey due to not completing in time.

Remove the artificial early timeout (1s) in this test.

* media/video-buffering-allowed.html:

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

2 years agoREGRESSION (r232040): Cursor jumping in Safari text fields
commit-queue@webkit.org [Thu, 28 Jun 2018 17:12:05 +0000 (17:12 +0000)]
REGRESSION (r232040): Cursor jumping in Safari text fields
https://bugs.webkit.org/show_bug.cgi?id=187142
<rdar://problem/41397577>

Patch by Aditya Keerthi <akeerthi@apple.com> on 2018-06-28
Reviewed by Tim Horton.

Source/WebCore:

r232040 enabled click events to fire on nodes that are already being edited in
iOS. This resulted FrameSelection::setSelection being called twice. One call
originated from the UIWKTextInteractionAssistant, which snaps the caret to word
boundaries. The other call originates from handleMousePressEvent in EventHandler,
and uses character boundaries. Consequently, we see the caret jumping around.

To fix this issue, an early return was added in the handleMousePressEvent
codepath, which prevents FrameSelection::setSelection from being called when
clicking on a node that is already being edited. This ensures that the
UIWKTextInteractionAssistant codepath is the only influence on the caret position.

Test: fast/events/ios/click-selectionchange-once.html

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick):

LayoutTests:

Added test to ensure that the 'selectionchange' event is only fired once per
click in an editable node.

* fast/events/ios/click-selectionchange-once-expected.txt: Added.
* fast/events/ios/click-selectionchange-once.html: Added.

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

2 years agoSplit memory store logic out of WebResourceLoadStatisticsStore to clarify threading...
cdumez@apple.com [Thu, 28 Jun 2018 17:07:36 +0000 (17:07 +0000)]
Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
https://bugs.webkit.org/show_bug.cgi?id=187055
<rdar://problem/41584026>

Reviewed by Brent Fulgham.

Split memory store logic out of WebResourceLoadStatisticsStore and into a ResourceLoadStatisticsMemoryStore class
to clarify the threading model. Previously, some of the methods of the WebResourceLoadStatisticsStore had to be
called on the main thread and some of them on the background queue, which was confusing and error prone. Now,
all WebResourceLoadStatisticsStore methods (except for IPC ones which will be addressed in a follow-up) are called
on the main thread. The ResourceLoadStatisticsMemoryStore objects is constructed / used and destroyed on the
background queue, similarly to the ResourceLoadStatisticsPersistentStore. The WebResourceLoadStatisticsStore
objects merely proxies calls from WebKit to those persistent / memory stores and takes care of hopping back and
forth between the background thread and the work queue.

While spliting code code, I found several instances where we were calling completion handlers on the wrong thread.
I fixed those in this patch now that the model is clearer.

We can likely clean up (organize the code a bit better) in a follow-up). This patch takes care of splitting the
code as it was. Code that was called on the background queue was moved to ResourceLoadStatisticsMemoryStore class
and code that was called on the main thread stays in WebResourceLoadStatisticsStore.

* CMakeLists.txt:
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm.
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp: Added.
(WebKit::appendWithDelimiter):
(WebKit::OperatingDate::fromWallTime):
(WebKit::OperatingDate::today):
(WebKit::OperatingDate::secondsSinceEpoch const):
(WebKit::OperatingDate::operator== const):
(WebKit::OperatingDate::operator< const):
(WebKit::OperatingDate::operator<= const):
(WebKit::OperatingDate::OperatingDate):
(WebKit::mergeOperatingDates):
(WebKit::pruneResources):
(WebKit::computeImportance):
(WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
(WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore):
(WebKit::ResourceLoadStatisticsMemoryStore::setPersistentStorage):
(WebKit::ResourceLoadStatisticsMemoryStore::calculateAndSubmitTelemetry):
(WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry):
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
(WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
(WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
(WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
(WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary):
(WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest):
(WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
(WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::logNonRecentUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
(WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
(WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo):
(WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
(WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
(WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveCookiePartitionFree):
(WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
(WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved):
(WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain):
(WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
(WebKit::ResourceLoadStatisticsMemoryStore::mergeWithDataFromDecoder):
(WebKit::ResourceLoadStatisticsMemoryStore::clear):
(WebKit::ResourceLoadStatisticsMemoryStore::wasAccessedAsFirstPartyDueToUserInteraction):
(WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldPartitionCookies):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockCookies):
(WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
(WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioning):
(WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioningForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::clearPartitioningStateForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::resetCookiePartitioningState):
(WebKit::ResourceLoadStatisticsMemoryStore::processStatistics const):
(WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
(WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
(WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary):
(WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const):
(WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries):
(WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo):
(WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
(WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues):
(WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent):
(WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
(WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
(WebKit::ResourceLoadStatisticsMemoryStore::removeAllStorageAccess):
* UIProcess/ResourceLoadStatisticsMemoryStore.h: Added.
(WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
(WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled):
(WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled):
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
(WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
(WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
(WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
* UIProcess/ResourceLoadStatisticsPersistentStorage.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
(WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
(WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
(WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
(WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
(WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setLastSeen):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
(WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
(WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler):
(WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
(WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
(WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
(WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
(WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::sortedPrevalentResourceTelemetry):
(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
* UIProcess/WebResourceLoadStatisticsTelemetry.h:
* WebKit.xcodeproj/project.pbxproj:

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

2 years agoFix encoding / decoding issues in ResourceLoadStatistics
cdumez@apple.com [Thu, 28 Jun 2018 17:07:31 +0000 (17:07 +0000)]
Fix encoding / decoding issues in ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=186890

Reviewed by Brent Fulgham.

* loader/ResourceLoadStatistics.cpp:
(WebCore::encodeHashCountedSet):
(WebCore::encodeHashSet):
Do not return early if the container we're trying to encode is empty. Instead,
have the encoder encode an empty array. This is important for encoding / decoding
to be fully symmetric. Otherwise, when trying to decode one of these empty containers,
the decoder would fail (silently since we were ignoring decoding errors). Worse, the
decoder might succeed but actually be decoding the *next* container in the file, since
we have several HashCountedSets / HashSets encoded one after another.

(WebCore::decodeHashCountedSet):
(WebCore::decodeHashSet):
Return a boolean to indicate if the decoding suceeded or not.

(WebCore::ResourceLoadStatistics::decode):
Check for container decoding errors and return false when decoding fails.
Otherwise, we would just silently keep going.

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

2 years agoCookie API: cookie creation time is wrong
sihui_liu@apple.com [Thu, 28 Jun 2018 17:03:24 +0000 (17:03 +0000)]
Cookie API: cookie creation time is wrong
https://bugs.webkit.org/show_bug.cgi?id=187101

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by API test: WebKit.WKHTTPCookieStoreCreationTime.

* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):

Tools:

Add test coverage: make sure the cookie creation time returned is the same as set.

* TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
(TEST):

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

2 years ago[LFC] Add Display::Box::nonCollapsedMarginBox for verification purposes.
zalan@apple.com [Thu, 28 Jun 2018 15:42:42 +0000 (15:42 +0000)]
[LFC] Add Display::Box::nonCollapsedMarginBox for verification purposes.
https://bugs.webkit.org/show_bug.cgi?id=187140

Reviewed by Antti Koivisto.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::nonCollapsedMarginBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setVerticalNonCollapsedMargin):

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

2 years agoThe lldb vector summary provider always shows zero capacity
simon.fraser@apple.com [Thu, 28 Jun 2018 15:37:04 +0000 (15:37 +0000)]
The lldb vector summary provider always shows zero capacity
https://bugs.webkit.org/show_bug.cgi?id=187132

Reviewed by Daniel Bates.

WTFVectorProvider in lldb_webkit.py was calling GetChildMemberWithName('m_capacity')
on the buffer instead of the valobj.

* lldb/lldbWebKitTester/main.cpp:
(testSummaryProviders):
* lldb/lldb_webkit.py:
(WTFVectorProvider.update):
* lldb/lldb_webkit_unittest.py:
(TestSummaryProviders.serial_test_WTFString_SummaryProvider_16bit_string):
(TestSummaryProviders):
(TestSummaryProviders.serial_test_WTFVectorProvider_empty_vector):
(TestSummaryProviders.serial_test_WTFVectorProvider_vector_size_and_capacity):

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

2 years ago[GTK] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) when...
mcatanzaro@igalia.com [Thu, 28 Jun 2018 15:35:42 +0000 (15:35 +0000)]
[GTK] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) when dragging file into webview
https://bugs.webkit.org/show_bug.cgi?id=175602

Reviewed by Carlos Garcia Campos.

We check using the GdkDragContext to ensure the DroppingContext is still alive (present in
m_droppingContexts), but access it via the pointer to the DroppingContext that could be
dangling. This happens on every drag. I can't actually reproduce the original assertion
since I'm currently working with an asan build, but I imagine it's probably the same issue
that I'm fixing here.

* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::dragLeave):

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

2 years ago[LFC] The margin bottom of the document element does not collapse with its last inflo...
zalan@apple.com [Thu, 28 Jun 2018 14:35:13 +0000 (14:35 +0000)]
[LFC] The margin bottom of the document element does not collapse with its last inflow child's bottom margin.
https://bugs.webkit.org/show_bug.cgi?id=187135

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):

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

2 years agoSwitch OS(FUCHSIA) to using JSCOnly
abarth@webkit.org [Thu, 28 Jun 2018 08:02:29 +0000 (08:02 +0000)]
Switch OS(FUCHSIA) to using JSCOnly
https://bugs.webkit.org/show_bug.cgi?id=187133

Reviewed by Yusuke Suzuki.

.:

Rather than creating a Fuchsia port, OS(FUCHSIA) now uses the JSCOnly
port.

* CMakeLists.txt: Set the WTF_OS_FUCHSIA flag
* Source/cmake/OptionsFuchsia.cmake: Removed.
* Source/cmake/OptionsJSCOnly.cmake: Temporarily disable ICU for
OS(FUCHSIA). We'll get ICU wired in, but I'd like to work through the
other compile errors first.

Tools:

Switch Fuchsia from being a port to just being an OS. We now use a
CMAKE_TOOLCHAIN_FILE to configure the toolchain and the target triple.

* Scripts/webkitdirs.pm: Remove isFuchsia() and clients. Turns out we
can do everything we need using a CMAKE_TOOLCHAIN_FILE via the
--cmakeargs flag.

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

2 years ago[css-masking] Update clip-path box mapping to unified box
krit@webkit.org [Thu, 28 Jun 2018 07:37:28 +0000 (07:37 +0000)]
[css-masking] Update clip-path box mapping to unified box
https://bugs.webkit.org/show_bug.cgi?id=185797

Reviewed by Simon Fraser.

Source/WebCore:

The box mapping for fill-box, stroke-box, view-box on HTML elements
and content-box, padding-box, margin-box, border-box for SVG elements
was aligned with the transform-box CSS property.

Furthermore, the keywords fill changed to fill-box and stroke changed
to stroke-box.

https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box

Update the -webkit-clip-path property.

Tests: svg/clip-path/clip-path-shape-border-box-expected.svg
       svg/clip-path/clip-path-shape-border-box.svg
       svg/clip-path/clip-path-shape-content-box-expected.svg
       svg/clip-path/clip-path-shape-content-box.svg
       svg/clip-path/clip-path-shape-margin-box-expected.svg
       svg/clip-path/clip-path-shape-margin-box.svg
       svg/clip-path/clip-path-shape-padding-box-expected.svg
       svg/clip-path/clip-path-shape-padding-box.svg

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator CSSBoxType const):
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertClipPath):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapeOrBox):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
* rendering/shapes/BoxShape.cpp:
(WebCore::computeRoundedRectForBoxShape):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::setReferenceBoxLogicalSize):
(WebCore::ShapeOutsideInfo::logicalTopOffset const):
(WebCore::ShapeOutsideInfo::logicalLeftOffset const):
* rendering/style/RenderStyleConstants.h:
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):

LayoutTests:

Update existing tests and add new tests to check the slightly different behavior.

* fast/masking/parsing-clip-path-shape-expected.txt:
* fast/masking/parsing-clip-path-shape.html:
* svg/clip-path/clip-path-shape-border-box-expected.svg: Added.
* svg/clip-path/clip-path-shape-border-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-stroke.svg.
* svg/clip-path/clip-path-shape-content-box-expected.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-content-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-fill.svg:
* svg/clip-path/clip-path-shape-margin-box-expected.svg: Added.
* svg/clip-path/clip-path-shape-margin-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-stroke.svg.
* svg/clip-path/clip-path-shape-padding-box-expected.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-padding-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-stroke.svg:

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

2 years agoMake MotionMark's plan file more robust against code changes
rniwa@webkit.org [Thu, 28 Jun 2018 07:27:52 +0000 (07:27 +0000)]
Make MotionMark's plan file more robust against code changes
https://bugs.webkit.org/show_bug.cgi?id=187116
<rdar://problem/41533956>

Reviewed by Saam Barati.

Moved the code to auto-start the test to the load event listener.

* Scripts/webkitpy/benchmark_runner/data/patches/webserver/MotionMark.patch:

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

2 years agoDon't expose new semantic -apple-system color keywords on iOS.
timothy@apple.com [Thu, 28 Jun 2018 04:25:05 +0000 (04:25 +0000)]
Don't expose new semantic -apple-system color keywords on iOS.
https://bugs.webkit.org/show_bug.cgi?id=187080
rdar://problem/41505699

Reviewed by Tim Horton.

* DerivedSources.make: Use gnu++14, since gnu++17 is giving errors on macOS 10.12.
Source/WebCore:

* css/CSSValueKeywords.in: Define new semantic colors only on macOS.

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

2 years agoAdd some tests for lldb_webkit.py
dbates@webkit.org [Thu, 28 Jun 2018 04:19:32 +0000 (04:19 +0000)]
Add some tests for lldb_webkit.py
https://bugs.webkit.org/show_bug.cgi?id=183744

Reviewed by Alexey Proskuryakov.

Adds some tests to ensure we do not regress LLDB pretty-printing of WTF::StringImpl
and WTF::String objects.

The tests make use of the LLDB Python API (lldb.py) and a simple debug-built test
program, lldbWebKitTester, to run. For now, we only support building lldbWebKitTester
on Mac.

* Makefile: Build the simple test tool lldbWebKitTester on Mac.
* Scripts/build-lldbwebkittester: Added.
(buildProjectOrDie):
* Scripts/dump-class-layout: Extract logic to compute the path to the LLDB Python module
from here to Scripts/webkitpy/common/system/systemhost.py so that it can used by both
this script and lldb/lldb_webkit_unittest.py. Also import the lldb module at the top of
the file and take advantage of Python's default error semantics to throw an exception
if the import fails instead of handling it ourself. This has the side effect that we
now always import the LLDB Python module even if this script is invoked with --help.
If this turns out to be a significant annoyance then we can look to dynamically import
the module as we did before this change.
(webkit_build_dir):
(main):
(developer_dir): Deleted.
(import_lldb): Deleted.
* Scripts/webkitpy/common/checkout/scm/scm_unittest.py: Update FIXME comment to reflect
that fact that test-webkitpy does not support class and module fixtures. This is because
test-webkitpy currently implements parallelism by breaking down existing test classes
into individual test methods itself and having each worker run exactly one test method (via
unittest.TestLoader.loadTestsFromName()) at a time. As a result of this reorganization,
setUpModule()/setUpClass() are called for each test method as opposed to once per test
class/test module.
(remove_dir): Ditto.
* Scripts/webkitpy/common/system/systemhost.py:
(SystemHost):
(SystemHost.path_to_lldb_python_directory): Added.
* Scripts/webkitpy/test/main.py:
(_find_lldb_webkit_tester): Returns whether there exists a Debug or Release-built lldbWebKitTester.
(_build_lldb_webkit_tester): Builds lldbWebKitTester. For now, we only support building
lldbWebKitTester on Mac.
(main): Add Tools/lldb to the test search path if the platform has lldb.py.
(Tester.run): Pass a boolean as to whether we will run the lldb_webkit unit tests.
(Tester._run_tests): Modified to take a boolean as to whether to run the lldb_webkit unit tests.
If we will run these tests then build lldbWebKitTester if it has not already been built as the
unit tests depend on this program.
* lldb/lldbWebKitTester/Configurations/Base.xcconfig: Added.
* lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: Added.
* lldb/lldbWebKitTester/Configurations/lldbWebKitTester.xcconfig: Added.
* lldb/lldbWebKitTester/Makefile: Added.
* lldb/lldbWebKitTester/lldbWebKitTester.xcodeproj/project.pbxproj: Added.
* lldb/lldbWebKitTester/main.cpp: Added.
(breakForTestingSummaryProviders):
(utf16String):
(testSummaryProviders):
(main):
* lldb/lldb_webkit_unittest.py: Added.
(destroy_cached_debug_session):
(LLDBDebugSession):
(LLDBDebugSession.setup):
(LLDBDebugSession.tearDown):
(TestSummaryProviders):
(TestSummaryProviders.setUpClass):
(TestSummaryProviders._sbFrame):
(TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_null_string):
(TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_empty_string):
(TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_8bit_string):
(TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_16bit_string):
(TestSummaryProviders.serial_test_WTFString_SummaryProvider_null_string):
(TestSummaryProviders.serial_test_WTFString_SummaryProvider_empty_string):
(TestSummaryProviders.serial_test_WTFString_SummaryProvider_8bit_string):
(TestSummaryProviders.serial_test_WTFString_SummaryProvider_16bit_string):

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

2 years ago[LFC] Compute both the collapsed and the non-collapsed margin values.
zalan@apple.com [Thu, 28 Jun 2018 03:05:16 +0000 (03:05 +0000)]
[LFC] Compute both the collapsed and the non-collapsed margin values.
https://bugs.webkit.org/show_bug.cgi?id=187129

Reviewed by Antti Koivisto.

For validation purposes only at this point.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):

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

2 years ago[LFC] Align inFlowNonReplacedHeightAndMargin() style with the rest of the compute...
zalan@apple.com [Thu, 28 Jun 2018 01:57:15 +0000 (01:57 +0000)]
[LFC] Align inFlowNonReplacedHeightAndMargin() style with the rest of the compute functions.
https://bugs.webkit.org/show_bug.cgi?id=187126

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):

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

2 years agoFix IBeam issues with iPad apps on Mac
megan_gardner@apple.com [Thu, 28 Jun 2018 01:29:44 +0000 (01:29 +0000)]
Fix IBeam issues with iPad apps on Mac
https://bugs.webkit.org/show_bug.cgi?id=186900

Reviewed by Wenson Hsieh.

* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const):
(WebKit::InteractionInformationAtPosition::decode):

Add functionality to determine what a caret rect should be, but as it is
expensive, it should only be done for this platform.

* Shared/ios/InteractionInformationRequest.cpp:
(WebKit::InteractionInformationRequest::isApproximateForRequest):
* Shared/ios/InteractionInformationRequest.h:

As there is no way to premptively request information on hover, we need to use
the last cached information, but only if it is close to the point we are about
to request information for. So having a way to determine if a point is very close
to a previous point is a good idea.

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

UIKit is using this function to determine if we should show an Ibeam or not.
So we need to implement it, at least for this platform.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

Pass up the calculated caret rect, but only for iPad apps on Mac.

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

2 years ago[GTK][WPE] Use LazyNeverDestroyed<XErrorTrapper> to remove static initializers
utatane.tea@gmail.com [Thu, 28 Jun 2018 01:10:37 +0000 (01:10 +0000)]
[GTK][WPE] Use LazyNeverDestroyed<XErrorTrapper> to remove static initializers
https://bugs.webkit.org/show_bug.cgi?id=187089

Reviewed by Michael Catanzaro.

Source/WebCore:

Do not allow copying since XErrorTrapper's logic relies on the address of XErrorTrapper.

* platform/graphics/x11/XErrorTrapper.h:

Source/WebKit:

Use LazyNeverDestroyed<XErrorTrapper> instead of global std::unique_ptr<XErrorTrapper>.
Since this variable's exit time destructor is not important in this code, using
LazyNeverDestroyed<XErrorTrapper> is fine. This removes the last static initializer
of libwebkit2gtk.so.

* PluginProcess/unix/PluginProcessMainUnix.cpp:

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

2 years agoAdd Fuchsia support to build-jsc
abarth@webkit.org [Thu, 28 Jun 2018 01:04:54 +0000 (01:04 +0000)]
Add Fuchsia support to build-jsc
https://bugs.webkit.org/show_bug.cgi?id=187086

Reviewed by Yusuke Suzuki.

.:

Add Fuchsia port to cmake build system. After this patch, the build
errors out due to a missing sysroot.

* CMakeLists.txt:
* Source/cmake/OptionsFuchsia.cmake: Added.

Tools:

Add Fuchsia port to webkitdirs.pm. This patch is sufficient to make
build-jsc kick off a cmake for Fuchsia.

* Scripts/webkitdirs.pm:
(determineSourceDir):
(argumentsForConfiguration):
(determineXcodeSDK):
(findMatchingArguments):
(determinePortName):
(isFuchsia):
(setupAppleWinEnv):
(wrapperPrefixIfNeeded):
(relaunchIOSSimulator):
(debugMiniBrowser):

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

2 years agoMark imported/blink/storage/indexeddb/blob-delete-objectstore-db.html as flaky.
ryanhaddad@apple.com [Thu, 28 Jun 2018 00:25:06 +0000 (00:25 +0000)]
Mark imported/blink/storage/indexeddb/blob-delete-objectstore-db.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=172864

Unreviewed test gardening.

* TestExpectations:

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

2 years agoAdd some more register state information when we crash in repatchPutById
sbarati@apple.com [Thu, 28 Jun 2018 00:18:50 +0000 (00:18 +0000)]
Add some more register state information when we crash in repatchPutById
https://bugs.webkit.org/show_bug.cgi?id=187112

Reviewed by Mark Lam.

This will help us gather info when we end up seeing a ObjectPropertyConditionSet
with an offset that is different than what the put tells us.

* jit/Repatch.cpp:
(JSC::tryCachePutByID):

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

2 years agoRebase LayoutTests/http/tests/contentextensions/subresource-redirect-blocked-expected...
youenn@apple.com [Thu, 28 Jun 2018 00:15:17 +0000 (00:15 +0000)]
Rebase LayoutTests/http/tests/contentextensions/subresource-redirect-blocked-expected.txt after r233269
https://bugs.webkit.org/show_bug.cgi?id=187125

Unreviewed.

* http/tests/contentextensions/subresource-redirect-blocked-expected.txt:

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

2 years ago[LFC] Align inFlowNonReplacedWidthAndMargin() style with the rest of the compute...
zalan@apple.com [Wed, 27 Jun 2018 23:46:54 +0000 (23:46 +0000)]
[LFC] Align inFlowNonReplacedWidthAndMargin() style with the rest of the compute functions.
https://bugs.webkit.org/show_bug.cgi?id=187124

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):

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

2 years agostyle-queue "AttributeError: 'NoneType' object has no attribute 'is_obsolete'" when...
dbates@webkit.org [Wed, 27 Jun 2018 23:43:13 +0000 (23:43 +0000)]
style-queue "AttributeError: 'NoneType' object has no attribute 'is_obsolete'" when processing security patch
https://bugs.webkit.org/show_bug.cgi?id=187120

Reviewed by David Kilzer.

Teach the style queue how to refetch a patch from the status server as we did for non-Style
EWS queues.

* Scripts/webkitpy/tool/bot/stylequeuetask.py:
(StyleQueueTask.validate): Similar to change made to EarlyWarningSystemTask.validate() in r233107,
only check if the bug associated with the patch we are processing is closed if the attachment has a
non-None Bug object.
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem.refetch_patch): Extract logic to refetch a patch from here...
* Scripts/webkitpy/tool/commands/queues.py:
(PatchProcessingQueue._refetch_patch): ... to here.
(StyleQueue.refetch_patch): Turn around and call PatchProcessingQueue._refetch_patch().

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

2 years ago-webkit-clip-path wrong offset for clipPath references
krit@webkit.org [Wed, 27 Jun 2018 23:28:19 +0000 (23:28 +0000)]
-webkit-clip-path wrong offset for clipPath references
https://bugs.webkit.org/show_bug.cgi?id=129246

Reviewed by Simon Fraser.

Source/WebCore:

Compute the correct offset for reference clip-paths by reusing
some of the logic from basic shapes.
Makes reference based clip-path interoperable and follows the
spec.

Test: css3/masking/clip-path-reference-2.html

* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
(WebCore::RenderLayer::computeClipPath const):
(WebCore::RenderLayer::setupClipPath):

LayoutTests:

Add test for reference clip-path offset. Correct a broken test.
All tests in the repo for references are interoperable between Gecko, Blink
and WebKit now.

* css3/masking/clip-path-reference-2-expected.html: Added.
* css3/masking/clip-path-reference-2.html: Added.
* css3/masking/clip-path-reference-userSpaceOnUse-expected.html:
* css3/masking/clip-path-reference-userSpaceOnUse.html:

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

2 years agoUnreviewed, add myself as a WebKit committer.
tzagallo@apple.com [Wed, 27 Jun 2018 23:22:48 +0000 (23:22 +0000)]
Unreviewed, add myself as a WebKit committer.

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

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

2 years agoFix a bug in $vm.callFrame() and apply previously requested renaming of $vm.println...
mark.lam@apple.com [Wed, 27 Jun 2018 23:13:53 +0000 (23:13 +0000)]
Fix a bug in $vm.callFrame() and apply previously requested renaming of $vm.println to print.
https://bugs.webkit.org/show_bug.cgi?id=187119

Reviewed by Keith Miller.

$vm.callFrame()'s JSDollarVMCallFrame::finishCreation()
should be checking for codeBlock instead of !codeBlock
before using the codeBlock.

I also renamed some other "print" functions to use "dump" instead
to match their underlying C++ code that they will call e.g.
CodeBlock::dumpSource().

* tools/JSDollarVM.cpp:
(WTF::JSDollarVMCallFrame::finishCreation):
(JSC::functionDumpSourceFor):
(JSC::functionDumpBytecodeFor):
(JSC::doPrint):
(JSC::functionDataLog):
(JSC::functionPrint):
(JSC::functionDumpCallFrame):
(JSC::functionDumpStack):
(JSC::JSDollarVM::finishCreation):
(JSC::functionPrintSourceFor): Deleted.
(JSC::functionPrintBytecodeFor): Deleted.
(JSC::doPrintln): Deleted.
(JSC::functionPrintln): Deleted.
(JSC::functionPrintCallFrame): Deleted.
(JSC::functionPrintStack): Deleted.
* tools/VMInspector.cpp:
(JSC::DumpFrameFunctor::DumpFrameFunctor):
(JSC::DumpFrameFunctor::operator() const):
(JSC::VMInspector::dumpCallFrame):
(JSC::VMInspector::dumpStack):
(JSC::VMInspector::dumpValue):
(JSC::PrintFrameFunctor::PrintFrameFunctor): Deleted.
(JSC::PrintFrameFunctor::operator() const): Deleted.
(JSC::VMInspector::printCallFrame): Deleted.
(JSC::VMInspector::printStack): Deleted.
(JSC::VMInspector::printValue): Deleted.
* tools/VMInspector.h:

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

2 years agoAdd a sandbox profile for some additional bank plugins
youenn@apple.com [Wed, 27 Jun 2018 22:53:17 +0000 (22:53 +0000)]
Add a sandbox profile for some additional bank plugins
https://bugs.webkit.org/show_bug.cgi?id=187105

Reviewed by Brent Fulgham.

* Resources/PlugInSandboxProfiles/cfca.com.npCryptoKit.CGB.MAC.sb: Added.
* Resources/PlugInSandboxProfiles/cfca.com.npP11CertEnroll.MAC.CGB.sb: Added.
* Resources/PlugInSandboxProfiles/com.apple.BocomSubmitCtrl.sb: Added.
* Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb: Added.
* Resources/PlugInSandboxProfiles/com.apple.NPSafeSubmit.sb: Added.
* Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb: Added.
* Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb: Added.
* Resources/PlugInSandboxProfiles/com.ftsafe.NPAPI-Core-Safe-SoftKeybaord.plugin.rfc1034identifier.sb: Added.
* WebKit.xcodeproj/project.pbxproj:

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

2 years agoBuild fix after r233266
jbedard@apple.com [Wed, 27 Jun 2018 22:49:20 +0000 (22:49 +0000)]
Build fix after r233266
https://bugs.webkit.org/show_bug.cgi?id=187024
<rdar://problem/39759057>

Unreviewed build fix.

* pal/cf/CoreMediaSoftLink.cpp: Do not soft-link CMSampleBufferCallForEachSample for
iOS 12 and up on iPhone device and simulator.
* pal/cf/CoreMediaSoftLink.h: Ditto.

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

2 years agoVersioning.
bshafiei@apple.com [Wed, 27 Jun 2018 22:43:33 +0000 (22:43 +0000)]
Versioning.

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

2 years agoDon't invoke post resolution callbacks when resolving computed style
antti@apple.com [Wed, 27 Jun 2018 22:25:30 +0000 (22:25 +0000)]
Don't invoke post resolution callbacks when resolving computed style
https://bugs.webkit.org/show_bug.cgi?id=187113
<rdar://problem/41365766>

Reviewed by Geoff Garen.

Source/WebCore:

Post-resolution callbacks should only be invoked when we resolve the full document style,
not when resolving computed style for a single element.

Tests: fast/dom/object-computed-style-event.html

* dom/Document.cpp:
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
* dom/Element.cpp:
(WebCore::Element::resolveComputedStyle):

Also ref the ancestor stack to be safe.

* style/StyleTreeResolver.cpp:
(WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler):
(WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):

Add an option to not drain the callback queue on destruction. In this mode we
just block network loads.

* style/StyleTreeResolver.h:

LayoutTests:

* fast/dom/object-computed-style-event-expected.txt: Added.
* fast/dom/object-computed-style-event.html: Added.

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

2 years agoFind on page selection color isn't adapted for dark mode.
timothy@apple.com [Wed, 27 Jun 2018 22:14:53 +0000 (22:14 +0000)]
Find on page selection color isn't adapted for dark mode.
https://bugs.webkit.org/show_bug.cgi?id=187072
rdar://problem/40354841

Reviewed by Tim Horton.

Source/WebCore:

* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Use [NSColor findHighlightColor].
* platform/mac/LocalDefaultSystemAppearance.h:
(WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const): Added.
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Set m_usingDarkAppearance.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintPlatformDocumentMarkers): Use TextPaintPhase::Decoration since this
matches step three of InlineTextBox::paint ("Paint fancy decorations"). This allows TextMatch to
paint a forground and not end up painting during this "fancy decorations" phase.
(WebCore::InlineTextBox::resolveStyleForMarkedText): Set the fillColor for TextMarker to force a
dark text color which will draw over the yellow highlight.
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Added support for TextPaintPhase::Decoration.
Seperate DocumentMarker::TelephoneNumber and DocumentMarker::TextMatch. Have DocumentMarker::TextMatch
support Forground and Background phases.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::platformColorsDidChange):
(WebCore::RenderTheme::activeTextSearchHighlightColor const): Added. Call the platfrom version.
(WebCore::RenderTheme::inactiveTextSearchHighlightColor const): Added. Ditto.
(WebCore::RenderTheme::platformActiveTextSearchHighlightColor const): Added StyleColor::Options.
(WebCore::RenderTheme::platformInactiveTextSearchHighlightColor const): Ditto.
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Added.
(WebCore::RenderThemeMac::platformInactiveTextSearchHighlightColor const): Added.
(WebCore::RenderThemeMac::platformColorsDidChange): Clear new color caches.
(WebCore::RenderThemeMac::systemColor const): Cache system colors by light and dark mode.

LayoutTests:

* fast/css/apple-system-control-colors-expected.txt: Updated.
* fast/text/mark-matches-broken-line-rendering-expected.html: Ditto.
* fast/text/mark-matches-rendering-expected.html: Ditto.

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

2 years agoCrash under SWServer::unregisterServiceWorkerClient()
cdumez@apple.com [Wed, 27 Jun 2018 21:43:41 +0000 (21:43 +0000)]
Crash under SWServer::unregisterServiceWorkerClient()
https://bugs.webkit.org/show_bug.cgi?id=187115
<rdar://problem/41539197>

Reviewed by Youenn Fablet.

Connections are usually destroyed before their SWServer. However, as per crash traces, it is possible
for SWServers to get destroyed while they still have connections. When this happens, the connections
(which are owned by the SWServer) get destroyed with other SWServer data members. In turn, the
connection destructor tries to unregister its clients from the server that is currently being destroyed.

To address the issue, the SWServer destructor now destroys remaining connections early, before SWServer's
other data members get destroyed.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::~SWServer):

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

2 years agoAdd logging to try to diagnose where we get a null structure.
keith_miller@apple.com [Wed, 27 Jun 2018 21:26:46 +0000 (21:26 +0000)]
Add logging to try to diagnose where we get a null structure.
https://bugs.webkit.org/show_bug.cgi?id=187106

Reviewed by Mark Lam.

Add a logging to JSObject::toPrimitive to help diagnose a nullptr
structure crash.

This code should be removed when we fix <rdar://problem/33451840>

* runtime/JSObject.cpp:
(JSC::callToPrimitiveFunction):
* runtime/JSObject.h:
(JSC::JSObject::getPropertySlot):

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

2 years agoNetworkLoadChecker should not need to hard ref NetworkConnectionToWebProcess
youenn@apple.com [Wed, 27 Jun 2018 21:15:23 +0000 (21:15 +0000)]
NetworkLoadChecker should not need to hard ref NetworkConnectionToWebProcess
https://bugs.webkit.org/show_bug.cgi?id=186551

Reviewed by Daniel Bates.

Source/WebCore:

No change of behavior.
Add a way to set the client receiving any CSP warning/error notification.

* page/csp/ContentSecurityPolicy.h:
(WebCore::ContentSecurityPolicy::setClient):

Source/WebKit:

Removed the need for NetworkLoadChecker to reference a NetworkConnectionToWebProcess.
Instead a CSP client is given to NetworkLoadChecker when needed.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::loadPing):
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::check):
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::checkRequest):
(WebKit::NetworkLoadChecker::contentSecurityPolicy):
(WebKit::NetworkLoadChecker::addConsoleMessage): Deleted.
(WebKit::NetworkLoadChecker::sendCSPViolationReport): Deleted.
(WebKit::NetworkLoadChecker::enqueueSecurityPolicyViolationEvent): Deleted.
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
(WebKit::PingLoad::willPerformHTTPRedirection):
* NetworkProcess/PingLoad.h:

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

2 years agowebkit-patch should ignore non-ASCII characters in the status server API key
dbates@webkit.org [Wed, 27 Jun 2018 21:10:20 +0000 (21:10 +0000)]
webkit-patch should ignore non-ASCII characters in the status server API key
https://bugs.webkit.org/show_bug.cgi?id=187107

Reviewed by Lucas Forschler.

The API key should only consists of ASCII characters. If it contains any
non-ASCII characters then log a warning and ignore them.

* Scripts/webkitpy/common/net/statusserver.py:
(StatusServer.set_api_key): Force conversion to ASCII.
* Scripts/webkitpy/tool/main.py:
(WebKitPatch._status_server_api_key): Convert to ASCII, ignoring non-ASCII
characters and logging a warning.

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

2 years ago[LFC] Do not collapse margin with the parent when element has border/padding.
zalan@apple.com [Wed, 27 Jun 2018 20:10:24 +0000 (20:10 +0000)]
[LFC] Do not collapse margin with the parent when element has border/padding.
https://bugs.webkit.org/show_bug.cgi?id=187114

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):

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

2 years agoFix Windows build after r233268.
simon.fraser@apple.com [Wed, 27 Jun 2018 20:01:49 +0000 (20:01 +0000)]
Fix Windows build after r233268.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::hasContents const):
* platform/graphics/ca/win/PlatformCALayerWin.h:

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

2 years agoAdd Cross-Origin-Resource-Policy tests for workers and service workers
youenn@apple.com [Wed, 27 Jun 2018 19:59:17 +0000 (19:59 +0000)]
Add Cross-Origin-Resource-Policy tests for workers and service workers
https://bugs.webkit.org/show_bug.cgi?id=187030

Reviewed by Chris Dumez.

* web-platform-tests/fetch/cross-origin-resource-policy/fetch-in-service-worker-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch-in-service-worker.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.any-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.any.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.any.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/cross-origin-resource-policy/fetch.html.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.any.worker-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.any.worker.html: Added.

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

2 years ago[LFC] Out-of-flow positioned element's height depends on its containing block's height.
zalan@apple.com [Wed, 27 Jun 2018 19:23:13 +0000 (19:23 +0000)]
[LFC] Out-of-flow positioned element's height depends on its containing block's height.
https://bugs.webkit.org/show_bug.cgi?id=187082

Reviewed by Antti Koivisto.

We can't really compute the final height of an out-of-flow element until after its containing block's height is computed.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::updateLayout):
(WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/layouttree/LayoutContainer.h:
(WebCore::Layout::Container::outOfFlowDescendants const):
(WebCore::Layout::Container::outOfFlowDescendants): Deleted.

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

2 years ago[Wincairo] Add support for context menus to non-legacy minibrowser
commit-queue@webkit.org [Wed, 27 Jun 2018 19:19:16 +0000 (19:19 +0000)]
[Wincairo] Add support for context menus to non-legacy minibrowser
https://bugs.webkit.org/show_bug.cgi?id=186815.

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2018-06-27
Reviewed by Ryosuke Niwa.

* UIProcess/WebPageProxy.h:
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::viewWidget):
* UIProcess/win/PageClientImpl.h:
* UIProcess/win/WebContextMenuProxyWin.cpp:
(WebKit::WebContextMenuProxyWin::show):
(WebKit::createMenu):
(WebKit::createMenuItem):
(WebKit::populate):
(WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
(WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
(WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin):
* UIProcess/win/WebContextMenuProxyWin.h:
* UIProcess/win/WebPageProxyWin.cpp:
(WebKit::WebPageProxy::viewWidget):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::wndProc):
(WebKit::WebView::onMenuCommand):
* UIProcess/win/WebView.h:

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

2 years agoDisable content blockers in NetworkLoadChecker except for ping loads
youenn@apple.com [Wed, 27 Jun 2018 18:23:06 +0000 (18:23 +0000)]
Disable content blockers in NetworkLoadChecker except for ping loads
https://bugs.webkit.org/show_bug.cgi?id=187083
<rdar://problem/41440083>

Reviewed by Chris Dumez.

Source/WebCore:

Add internals API to reload a frame without content extensions.

Test: http/tests/contentextensions/reload-without-contentextensions.html

* testing/Internals.cpp:
(WebCore::Internals::reloadWithoutContentExtensions):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
* NetworkProcess/NetworkLoadChecker.h:
(WebKit::NetworkLoadChecker::enableContentExtensionsCheck):
* NetworkProcess/PingLoad.cpp:

LayoutTests:

* http/tests/contentextensions/reload-without-contentextensions-expected.txt: Added.
* http/tests/contentextensions/reload-without-contentextensions.html: Added.
* http/tests/contentextensions/reload-without-contentextensions.html.json: Added.

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

2 years agohttps://hackernoon.com/ uses lots of layer backing store
simon.fraser@apple.com [Wed, 27 Jun 2018 18:22:06 +0000 (18:22 +0000)]
https://hackernoon.com/ uses lots of layer backing store
https://bugs.webkit.org/show_bug.cgi?id=186909
rdar://problem/40257540

Reviewed by Tim Horton.

Source/bmalloc:

Drive-by typo fix.

* bmalloc/Scavenger.cpp:
(bmalloc::dumpStats):

Source/WebCore:

The existing "backing store detached" logic, which was used to eliminate backing store
for compositing layers outside the viewport, had a number of bugs that allowed layers
to have backing store when they should not.

Specifically, any code path that ended up in setNeedsDisplay{InRect}() in PlatformCALayer
could trigger backing store creation on layers that should have never had any.

Rather than monkeypatch all the GraphicsLayerCA call sites that call setNeedsDisplay{InRect}(),
just bail early from the PlatformCALayer* methods that trigger repaints.

Tests didn't catch this because they just dumped the state of the backingStoreAttached flag. To fix this,
create backingStoreAttachedForTesting() which also tests whether the layer has contents.

Test: compositing/backing/backing-store-attachment-outside-viewport.html

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties const):
(showGraphicsLayerTree):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::backingStoreAttachedForTesting const):
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::backingStoreAttachedForTesting const):
(WebCore::GraphicsLayerCA::setNeedsDisplay):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::setNeedsDisplay):
(PlatformCALayerCocoa::setNeedsDisplayInRect):
(PlatformCALayerCocoa::hasContents const):

Source/WebKit:

PlatformCALayerRemote was actually holding onto backing stores for layers with
backing store detached, which could increase memory use. When told that backing stores
are not attached, explicitly throw away the backing, and re-create it (via setNeedsDisplay)
when attached. This is now similar to what PlatformLayerCACocoa does.

* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setNeedsDisplayInRect):
(WebKit::PlatformCALayerRemote::setNeedsDisplay):
(WebKit::PlatformCALayerRemote::hasContents const):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:

LayoutTests:

New test.

* compositing/backing/backing-store-attachment-outside-viewport-expected.txt: Added.
* compositing/backing/backing-store-attachment-outside-viewport.html: Added.

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

2 years agoFix clang static analyzer warnings: Branch condition evaluates to a garbage value
ddkilzer@apple.com [Wed, 27 Jun 2018 18:07:00 +0000 (18:07 +0000)]
Fix clang static analyzer warnings: Branch condition evaluates to a garbage value
<https://webkit.org/b/186968>

Reviewed by Zalan Bujtas.

This patch changes two stack-allocated `bool` variables into
`std::optional<bool>` since the functions that set the variable
may return early without setting it.  It also changes one
stack-allocated pointer to be initialized to `nullptr`.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSTransitionsForElement):
Update for change to CSSPropertyAnimation::getPropertyAtIndex()
argument type.

* editing/ios/EditorIOS.mm:
(WebCore::Editor::writeImageToPasteboard): Initialize
`cachedImage` stack pointer to nullptr since getImage() has an
early return that doesn't set `cachedImage`.
* editing/mac/EditorMac.mm:
(WebCore::Editor::writeImageToPasteboard): Ditto.

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimation::getPropertyAtIndex):
* page/animation/CSSPropertyAnimation.h:
(WebCore::CSSPropertyAnimation::getPropertyAtIndex):
- Change method to take `std::optional<bool>` instead of `bool`
  as second argument since the method may return early without
  setting `isShorthand`.

* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions): Update for
change to CSSPropertyAnimation::getPropertyAtIndex() argument
type.

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection): Also
rename local `emphasisMarkIsOver` to `emphasisMarkIsAbove` to
match other call sites.
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
- Update for change to InlineTextBox::emphasisMarkExistsAndIsAbove()
  argument type.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
- Change method to take `std::optional<bool>` instead of `bool`
  as second argument since the method may return early without
  setting `above`.
(WebCore::InlineTextBox::paintMarkedTextForeground):
- Update for change to InlineTextBox::emphasisMarkExistsAndIsAbove()
  argument type.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
- Change method to take `std::optional<bool>` instead of `bool`.

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

2 years agoEnable WebKit iOS 12 build
jbedard@apple.com [Wed, 27 Jun 2018 18:02:56 +0000 (18:02 +0000)]
Enable WebKit iOS 12 build
https://bugs.webkit.org/show_bug.cgi?id=187024
<rdar://problem/39759057>

Reviewed by David Kilzer.

Source/WebCore/PAL:

* pal/cf/CoreMediaSoftLink.cpp: Condition some CoreMedia functions on version.
* pal/cf/CoreMediaSoftLink.h: Ditto.
* pal/spi/cocoa/NSXPCConnectionSPI.h: Use XPCSPI.h instead of xpc.h.
* pal/spi/ios/QuickLookSPI.h: QLItem adopts QLPreviewItem.
* pal/spi/ios/SystemPreviewSPI.h: Fix compiler errors.

Source/WebKit:

* Platform/spi/ios/PDFKitSPI.h: Added PDFKit SPI.
* Platform/spi/ios/UIKitSPI.h: Add new UIKit SPI and UICompositingMode enumeration.
* UIProcess/ios/WKPDFView.mm: Use PDFKitSPI header.
* UIProcess/ios/WKSystemPreviewView.mm: Use CoreGraphicsSPI.h.
* UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Use QuartzCoreSPI.h.

Source/WTF:

* wtf/spi/darwin/XPCSPI.h: Add endpoint and connection declarations.

Tools:

* Scripts/configure-xcode-for-ios-development:
(copyMissingHeadersFromSDKToSDKIfNeeded): Copy launch.h into embedded SDKs.

WebKitLibraries:

* WebKitPrivateFrameworkStubs/iOS/12: Added.

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

2 years agoCSS Animation Triggers is not an experimental feature, should be globally off by...
timothy_horton@apple.com [Wed, 27 Jun 2018 17:59:37 +0000 (17:59 +0000)]
CSS Animation Triggers is not an experimental feature, should be globally off by default

Reviewed by Dean Jackson.

* Shared/WebPreferences.yaml:

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

2 years agoPromote the Secure Context API feature from experimental-yet-on-by-default to always-on
timothy_horton@apple.com [Wed, 27 Jun 2018 17:41:09 +0000 (17:41 +0000)]
Promote the Secure Context API feature from experimental-yet-on-by-default to always-on

Reviewed by Dan Bates.

* Shared/WebPreferences.yaml:
Secure Context API is on by default, it's not experimental anymore.

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

2 years agoMake Link Preload an on-by-default feature
timothy_horton@apple.com [Wed, 27 Jun 2018 17:38:27 +0000 (17:38 +0000)]
Make Link Preload an on-by-default feature
https://bugs.webkit.org/show_bug.cgi?id=187104

Reviewed by Ryosuke Niwa.

* Shared/WebPreferences.yaml:
This should be on, not experimental. It already shipped on in the past.

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

2 years ago[WSL] Add a control-flow stack to the execution rules in WSL.ott
rmorisset@apple.com [Wed, 27 Jun 2018 17:01:33 +0000 (17:01 +0000)]
[WSL] Add a control-flow stack to the execution rules in WSL.ott
https://bugs.webkit.org/show_bug.cgi?id=186310

Rubberstamped by Filip Pizlo.

The goal of this is to enable (future) rules about uniform control flow for barriers.
It required adding two new special construct: Join(s) and JoinExpr(e) whose only role is to pop the last element of the stack.

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

2 years agoRegression(r233208): Completion handler does not get called on GTK port
cdumez@apple.com [Wed, 27 Jun 2018 16:36:42 +0000 (16:36 +0000)]
Regression(r233208): Completion handler does not get called on GTK port
https://bugs.webkit.org/show_bug.cgi?id=187099

Reviewed by Antti Koivisto.

Make sure UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler's completion handler
gets called on non-COCOA ports.

* UIProcess/WebResourceLoadStatisticsStore.h:

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

2 years ago[LFC] Move formatting context root layout logic to a dedicated function.
zalan@apple.com [Wed, 27 Jun 2018 16:18:00 +0000 (16:18 +0000)]
[LFC] Move formatting context root layout logic to a dedicated function.
https://bugs.webkit.org/show_bug.cgi?id=187097

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
* layout/blockformatting/BlockFormattingContext.h:

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

2 years ago[LFC] Compute static position for out-of-flow elements only when required.
zalan@apple.com [Wed, 27 Jun 2018 16:13:48 +0000 (16:13 +0000)]
[LFC] Compute static position for out-of-flow elements only when required.
https://bugs.webkit.org/show_bug.cgi?id=187096

Reviewed by Antti Koivisto.

Computing static position for out-of-flow elements could be somewhat expensive, so let's not do it unless we actually need it.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPositionForOutOfFlowPositioned): Deleted.

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

2 years ago[GTK][WPE] Update expectations for WebDriver tests.
Ms2ger@igalia.com [Wed, 27 Jun 2018 16:13:43 +0000 (16:13 +0000)]
[GTK][WPE] Update expectations for WebDriver tests.
https://bugs.webkit.org/show_bug.cgi?id=187098

Unreviewed gardening.

* TestExpectations.json:

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

2 years agoAX: [iOS] Remove the ability to set keyboard focus when VoiceOver takes focus
n_wang@apple.com [Wed, 27 Jun 2018 16:10:21 +0000 (16:10 +0000)]
AX: [iOS] Remove the ability to set keyboard focus when VoiceOver takes focus
https://bugs.webkit.org/show_bug.cgi?id=187076

Reviewed by Chris Fleizach.

Source/WebCore:

We shouldn't set keyboard focus when assistive technology takes focus since
this is causing website incompatibility issues by causing focus to be lost.

Test: accessibility/ios-simulator/accessibility-focus-do-not-set-focus.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):

LayoutTests:

* accessibility/ios-simulator/accessibility-focus-do-not-set-focus-expected.txt: Added.
* accessibility/ios-simulator/accessibility-focus-do-not-set-focus.html: Added.
* accessibility/ios-simulator/dom-focus-fires-on-correct-element-expected.txt: Removed.
* accessibility/ios-simulator/dom-focus-fires-on-correct-element.html: Removed.

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

2 years ago[WSL] Fix minor formatting issues in the grammar section
rmorisset@apple.com [Wed, 27 Jun 2018 15:14:45 +0000 (15:14 +0000)]
[WSL] Fix minor formatting issues in the grammar section
https://bugs.webkit.org/show_bug.cgi?id=186310

Rubberstamped by Filip Pizlo.

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

2 years agoMIME type subclass check should guard against small strings
mcatanzaro@igalia.com [Wed, 27 Jun 2018 15:07:10 +0000 (15:07 +0000)]
MIME type subclass check should guard against small strings
https://bugs.webkit.org/show_bug.cgi?id=186977

Reviewed by Carlos Garcia Campos.

Sadly, this code is duplicated between two different files because it is not good.

* xdgmime/README.webkit:
* xdgmime/src/xdgmime.c:
(ends_with):
(xdg_mime_is_super_type):
* xdgmime/src/xdgmimecache.c:
(ends_with):
(is_super_type):

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

2 years ago[WSL] Put the full grammar in the Sphinx document
rmorisset@apple.com [Wed, 27 Jun 2018 15:04:07 +0000 (15:04 +0000)]
[WSL] Put the full grammar in the Sphinx document
https://bugs.webkit.org/show_bug.cgi?id=186310

Rubberstamped by Filip Pizlo.

Put the grammar's production rules in the Sphinx document, along with a few comments and the rules for desugaring.
Also includes a bit of clean-up of the antlr rules.

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

2 years agoDFG's compileReallocatePropertyStorage() and compileAllocatePropertyStorage() slow...
mark.lam@apple.com [Wed, 27 Jun 2018 11:19:46 +0000 (11:19 +0000)]
DFG's compileReallocatePropertyStorage() and compileAllocatePropertyStorage() slow paths should also clear unused properties.
https://bugs.webkit.org/show_bug.cgi?id=187091
<rdar://problem/41395624>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/regress-187091.js: Added.

Source/JavaScriptCore:

Previously, when compileReallocatePropertyStorage() and compileAllocatePropertyStorage()
take their slow paths, the slow path would jump back to the fast path right after
the emitted code which clears the unused property values.  As a result, the
unused properties are not initialized.  We've fixed this by adding the slow path
generators before we emit the code to clear the unused properties.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):

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

2 years ago[JSC] ArrayPatternNode::emitDirectBinding does not return assignment target value...
utatane.tea@gmail.com [Wed, 27 Jun 2018 10:05:50 +0000 (10:05 +0000)]
[JSC] ArrayPatternNode::emitDirectBinding does not return assignment target value if dst is nullptr
https://bugs.webkit.org/show_bug.cgi?id=185943

Reviewed by Mark Lam.

JSTests:

* stress/direct-binding-return-result.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

ArrayPatternNode::emitDirectBinding should return a register with an assignment target instead of filling
the result with undefined if `dst` is nullptr. While `dst == ignoredResult()` means we do not require
the result, `dst == nullptr` just means "dst is required, but a register for dst is not allocated.".
This patch fixes emitDirectBinding to return an appropriate value with an allocated register for dst.

ArrayPatternNode::emitDirectBinding() should be removed later since it does not follow array spreading protocol,
but it should be done in a separate patch since it would be performance sensitive.

* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayPatternNode::emitDirectBinding):

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

2 years agoMove clearChildNeedsStyleRecalc into resetStyleForNonRenderedDescendants.
emilio@crisal.io [Wed, 27 Jun 2018 09:34:25 +0000 (09:34 +0000)]
Move clearChildNeedsStyleRecalc into resetStyleForNonRenderedDescendants.
https://bugs.webkit.org/show_bug.cgi?id=186881

Reviewed by Antti Koivisto.

Every caller does this already.

No new tests, no change in behavior.

* style/StyleTreeResolver.cpp:
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveComposedTree):

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

2 years agoWhen trying to print a very long email on iOS, the print preview is blank
timothy_horton@apple.com [Wed, 27 Jun 2018 08:27:40 +0000 (08:27 +0000)]
When trying to print a very long email on iOS, the print preview is blank
https://bugs.webkit.org/show_bug.cgi?id=187077
<rdar://problem/41107013>

Reviewed by Timothy Hatcher.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
ChildProcessProxy::sendSync has a (surprising) default timeout of 1 second,
(as opposed to Connection::sendSync's default timeout of ∞ seconds).
The printing path already waits ∞ seconds for the final PDF, but currently
uses the default 1 second timeout for page count computation. If page
count computation takes more than 1 second, the preview will be blank.
Since the print preview is generated asynchronously, we really want
to wait until it's done, and not give up after 1 second.

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

2 years ago[GTK][WPE] Remove gflags from libwebrtc build
utatane.tea@gmail.com [Wed, 27 Jun 2018 08:19:05 +0000 (08:19 +0000)]
[GTK][WPE] Remove gflags from libwebrtc build
https://bugs.webkit.org/show_bug.cgi?id=187078

Reviewed by Alejandro G. Castro.

gflags is used only in libyuv unit tests. So the Apple ports do not build & link it.
GTK and WPE can do the same thing: not building gflags. By doing so, we can achieve
the following results.

1. Remove static initializers defined for gflags.
2. Reduce binary size.

* CMakeLists.txt:

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

2 years ago[GStreamer] Coverity scan issues
tpopela@redhat.com [Wed, 27 Jun 2018 08:16:59 +0000 (08:16 +0000)]
[GStreamer] Coverity scan issues
https://bugs.webkit.org/show_bug.cgi?id=187087

Reviewed by Xabier Rodriguez-Calvar.

Fix uninitialized members.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:

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

2 years ago[GCrypt] Move definitions of GCryptUtilities helpers into a separate source file
zandobersek@gmail.com [Wed, 27 Jun 2018 08:13:10 +0000 (08:13 +0000)]
[GCrypt] Move definitions of GCryptUtilities helpers into a separate source file
https://bugs.webkit.org/show_bug.cgi?id=187033

Reviewed by Michael Catanzaro.

Move the GCryptUtilities helpers that operate on libgcrypt values and
constants into a separate source file. This limits a bit the amount of
inlining the compiler might feel compelled to do, and the resulting
shared library is 8kB smaller in size.

* crypto/gcrypt/GCryptUtilities.cpp: Copied from Source/WebCore/crypto/gcrypt/GCryptUtilities.h.
(WebCore::hmacAlgorithm):
(WebCore::digestAlgorithm):
(WebCore::hashCryptoDigestAlgorithm):
(WebCore::mpiLength):
(WebCore::mpiData):
(WebCore::mpiZeroPrefixedData):
(WebCore::mpiSignedData):
* crypto/gcrypt/GCryptUtilities.h:
(WebCore::hmacAlgorithm): Deleted.
(WebCore::digestAlgorithm): Deleted.
(WebCore::hashCryptoDigestAlgorithm): Deleted.
(WebCore::mpiLength): Deleted.
(WebCore::mpiData): Deleted.
(WebCore::mpiZeroPrefixedData): Deleted.
(WebCore::mpiSignedData): Deleted.
* platform/SourcesGCrypt.txt:

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

2 years ago[iPad apps on macOS] Unable to interact with video elements that have started playing
wenson_hsieh@apple.com [Wed, 27 Jun 2018 05:06:51 +0000 (05:06 +0000)]
[iPad apps on macOS] Unable to interact with video elements that have started playing
https://bugs.webkit.org/show_bug.cgi?id=187073
<rdar://problem/40591107>

Reviewed by Tim Horton.

Source/WebCore/PAL:

Define an SPI method on CALayer. See WebKit ChangeLog for more detail.

* pal/spi/cocoa/QuartzCoreSPI.h:

Source/WebKit:

On iOS, we currently force remote hosting contexts to be non-interactive by passing in `kCAContextIgnoresHitTest`
when creating the CAContext. However, this flag is not respected by CoreAnimation when running iOS apps on macOS.
This means all HID events dispatched over a video that has been played (which causes WebKit to insert a
CALayerHost-backed WKRemoteView in the view hierarchy) will be routed to the context ID of the video's CAContext
rather than the context ID of the key window containing the WKWebView.

This subsequently causes all gesture recognizers (hover, touch, tap, long press) to fail recognition when
running iOS apps on macOS. To address this, we set a flag on WKRemoteView's CALayerHost to prevent hit-testing
to the remote layer. This allows us to avoid routing HID events to the wrong context, and instead target the
main UIWindow.

Manually verified that click, touch, and mouseenter/mouseleave events are dispatched when interacting over a
video element.

* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(-[WKRemoteView initWithFrame:contextID:]):

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

2 years ago[JSC] Pass VM& to functions more
utatane.tea@gmail.com [Wed, 27 Jun 2018 05:01:29 +0000 (05:01 +0000)]
[JSC] Pass VM& to functions more
https://bugs.webkit.org/show_bug.cgi?id=186241

Reviewed by Mark Lam.

Source/JavaScriptCore:

This patch threads VM& to functions requiring VM& more.

* API/JSObjectRef.cpp:
(JSObjectIsConstructor):
* bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp:
(JSC::AdaptiveInferredPropertyValueWatchpointBase::install):
(JSC::AdaptiveInferredPropertyValueWatchpointBase::fire):
(JSC::AdaptiveInferredPropertyValueWatchpointBase::StructureWatchpoint::fireInternal):
(JSC::AdaptiveInferredPropertyValueWatchpointBase::PropertyWatchpoint::fireInternal):
* bytecode/AdaptiveInferredPropertyValueWatchpointBase.h:
* bytecode/CodeBlockJettisoningWatchpoint.cpp:
(JSC::CodeBlockJettisoningWatchpoint::fireInternal):
* bytecode/CodeBlockJettisoningWatchpoint.h:
* bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp:
(JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::install):
(JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::fireInternal):
* bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h:
* bytecode/StructureStubClearingWatchpoint.cpp:
(JSC::StructureStubClearingWatchpoint::fireInternal):
* bytecode/StructureStubClearingWatchpoint.h:
* bytecode/Watchpoint.cpp:
(JSC::Watchpoint::fire):
(JSC::WatchpointSet::fireAllWatchpoints):
* bytecode/Watchpoint.h:
* dfg/DFGAdaptiveInferredPropertyValueWatchpoint.cpp:
(JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::handleFire):
* dfg/DFGAdaptiveInferredPropertyValueWatchpoint.h:
* dfg/DFGAdaptiveStructureWatchpoint.cpp:
(JSC::DFG::AdaptiveStructureWatchpoint::install):
(JSC::DFG::AdaptiveStructureWatchpoint::fireInternal):
* dfg/DFGAdaptiveStructureWatchpoint.h:
* dfg/DFGDesiredWatchpoints.cpp:
(JSC::DFG::AdaptiveStructureWatchpointAdaptor::add):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::setupGetByIdPrototypeCache):
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::tryInitializeSpeciesWatchpoint):
(JSC::ArrayPrototypeAdaptiveInferredPropertyWatchpoint::handleFire):
* runtime/ECMAScriptSpecInternalFunctions.cpp:
(JSC::esSpecIsConstructor):
* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::AllocationProfileClearingWatchpoint::fireInternal):
* runtime/FunctionRareData.h:
* runtime/InferredStructureWatchpoint.cpp:
(JSC::InferredStructureWatchpoint::fireInternal):
* runtime/InferredStructureWatchpoint.h:
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::createSubclassStructureSlow):
* runtime/InternalFunction.h:
(JSC::InternalFunction::createSubclassStructure):
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::isConstructor const):
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::isConstructor):
(JSC::JSCell::methodTable const):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/ObjectPropertyChangeAdaptiveWatchpoint.h:
(JSC::ObjectPropertyChangeAdaptiveWatchpoint::ObjectPropertyChangeAdaptiveWatchpoint):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::finishCreation):
* runtime/ReflectObject.cpp:
(JSC::reflectObjectConstruct):
* runtime/StructureRareData.cpp:
(JSC::StructureRareData::setObjectToStringValue):
(JSC::ObjectToStringAdaptiveStructureWatchpoint::install):
(JSC::ObjectToStringAdaptiveStructureWatchpoint::fireInternal):
(JSC::ObjectToStringAdaptiveInferredPropertyValueWatchpoint::handleFire):

Source/WebCore:

* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):

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

2 years agoUnreviewed, rolling out r233232.
commit-queue@webkit.org [Wed, 27 Jun 2018 04:45:06 +0000 (04:45 +0000)]
Unreviewed, rolling out r233232.
https://bugs.webkit.org/show_bug.cgi?id=187081

"This is breaking launching some plugins" (Requested by youenn
on #webkit).

Reverted changeset:

"Remove quarantine for Webex plugin"
https://bugs.webkit.org/show_bug.cgi?id=187050
https://trac.webkit.org/changeset/233232

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

2 years agoRearrange some WebPreferences; move two experimental prefs into the experimental...
timothy_horton@apple.com [Wed, 27 Jun 2018 04:36:49 +0000 (04:36 +0000)]
Rearrange some WebPreferences; move two experimental prefs into the experimental section

* Shared/WebPreferences.yaml:

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

2 years agoeval() is wrong about the LiteralParser never throwing any exceptions.
mark.lam@apple.com [Wed, 27 Jun 2018 03:10:18 +0000 (03:10 +0000)]
eval() is wrong about the LiteralParser never throwing any exceptions.
https://bugs.webkit.org/show_bug.cgi?id=187074
<rdar://problem/41461099>

Reviewed by Saam Barati.

JSTests:

* stress/regress-187074.js: Added.

Source/JavaScriptCore:

Added the missing exception check, and removed an erroneous assertion.

* interpreter/Interpreter.cpp:
(JSC::eval):

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

2 years agoCSSGradientValue's color stops vector wastes 12KB on theverge.com
simon.fraser@apple.com [Wed, 27 Jun 2018 03:03:50 +0000 (03:03 +0000)]
CSSGradientValue's color stops vector wastes 12KB on theverge.com
https://bugs.webkit.org/show_bug.cgi?id=186988

Reviewed by Sam Weinig.

Shrink the color stops vector when we're done parsing the stops.

* css/CSSGradientValue.h:
(WebCore::CSSGradientValue::doneAddingStops):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
(WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
(WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):

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

2 years agoDeal better with the network process crashing on startup
cdumez@apple.com [Wed, 27 Jun 2018 02:10:58 +0000 (02:10 +0000)]
Deal better with the network process crashing on startup
https://bugs.webkit.org/show_bug.cgi?id=187065
<rdar://problem/41451622>

Reviewed by Geoffrey Garen.

Source/WebKit:

When a network process crashes on startup, we would not attempt to relaunch it. If there were web
processes waiting for a connection to this network process, we would send them an invalid connection
identifier which would cause them to forcefully crash.

Instead, we now apply the same policy whether a network process crashes on startup or later:
- We attempt to relaunch the network process
- If there were pending connections from WebContent processes, we ask the new Network process instead.

As a result, WebContent processes no longer crash in this case. Instead, they wait for a valid
connection to the network process.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _makeNextNetworkProcessLaunchFailForTesting]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
(WebKit::NetworkProcessProxy::didFinishLaunching):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::networkProcessCrashed):
* UIProcess/WebProcessPool.h:

Tools:

Add layout test coverage.

* TestWebKitAPI/Tests/WebKit/NetworkProcessCrashWithPendingConnection.mm:
(-[MonitorWebContentCrashNavigationDelegate _webView:webContentProcessDidTerminateWithReason:]):
(-[MonitorWebContentCrashNavigationDelegate webView:didFinishNavigation:]):
(TestWebKitAPI::TEST):

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

2 years agoRemove static initializers more
utatane.tea@gmail.com [Wed, 27 Jun 2018 01:58:06 +0000 (01:58 +0000)]
Remove static initializers more
https://bugs.webkit.org/show_bug.cgi?id=186969

Reviewed by Michael Catanzaro.

Source/WebCore:

This patch removes static initializers more. They typically exists in GTK port.

No behavior change.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/ResourceUsageData.cpp: Removed.
* page/ResourceUsageData.h:
Remove ResourceUsageData constructors since default constructors are enough.

(WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
* platform/gtk/PasteboardHelper.cpp:
(WebCore::markupPrefix):
(WebCore::removeMarkupPrefix):
(WebCore::PasteboardHelper::fillSelectionData):
Use NeverDestroyed<> and static functions.

* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::defaultVolumeCapability):
(WebCore::GStreamerAudioCaptureSource::capabilities const):
CapabilityValueOrRange's constructor is not constexpr.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::initialAcceptLanguages):
(WebCore::proxySettings):
(WebCore::SoupNetworkSession::SoupNetworkSession):
(WebCore::SoupNetworkSession::setupProxy):
(WebCore::SoupNetworkSession::setProxySettings):
(WebCore::SoupNetworkSession::setInitialAcceptLanguages):
Use NeverDestroyed<> and static functions.

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::assignedUrlsCache):
(WTR::dumpResourceURL):
(WTR::InjectedBundlePage::resetAfterTest):
(WTR::InjectedBundlePage::didInitiateLoadForResource):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
(WTR::AccessibilityNotificationHandler::setNotificationFunctionCallback):
(WTR::AccessibilityNotificationHandler::removeAccessibilityNotificationHandler):
(WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks):
(WTR::AccessibilityNotificationHandler::disconnectAccessibilityCallbacks):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::stringAttributeValue):
Use NeverDestroyed<> and static functions.

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

2 years agoImport wpt CORP tests
youenn@apple.com [Wed, 27 Jun 2018 01:29:12 +0000 (01:29 +0000)]
Import wpt CORP tests
https://bugs.webkit.org/show_bug.cgi?id=187027

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/common/get-host-info.sub.js:
* web-platform-tests/fetch/cross-origin-resource-policy/fetch-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch-in-iframe-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch-in-iframe.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/iframe-loads-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/iframe-loads.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/image-loads-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/image-loads.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/resources/green.png: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/resources/hello.py: Added.
(main):
* web-platform-tests/fetch/cross-origin-resource-policy/resources/iframe.py: Added.
(main):
* web-platform-tests/fetch/cross-origin-resource-policy/resources/iframeFetch.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/resources/image.py: Added.
(main):
* web-platform-tests/fetch/cross-origin-resource-policy/resources/redirect.py: Added.
(main):
* web-platform-tests/fetch/cross-origin-resource-policy/resources/script.py: Added.
(main):
* web-platform-tests/fetch/cross-origin-resource-policy/resources/w3c-import.log: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.any-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.any.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.any.js: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.any.worker-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.any.worker.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.https.window.js: Added.
(promise_test.t.return.new.Promise):
(promise_test.t.finally):
* web-platform-tests/fetch/cross-origin-resource-policy/script-loads-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/script-loads.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/syntax.any-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/syntax.any.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/syntax.any.js: Added.
(string_appeared_here.forEach.incorrectHeaderValue.promise_test.t.return.fetch.crossOriginURL.encodeURIComponent):
* web-platform-tests/fetch/cross-origin-resource-policy/syntax.any.worker-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/syntax.any.worker.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/w3c-import.log: Added.

LayoutTests:

Skipping tests for WK1.

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

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

2 years agoREGRESSION (r231479): Unable to buy Odeon cinema tickets in STP (bogus 'X-Frame-Optio...
dbates@webkit.org [Wed, 27 Jun 2018 01:23:09 +0000 (01:23 +0000)]
REGRESSION (r231479): Unable to buy Odeon cinema tickets in STP (bogus 'X-Frame-Options' to 'SAMEORIGIN')
https://bugs.webkit.org/show_bug.cgi?id=186090
<rdar://problem/40692595>

Reviewed by Andy Estes.

Source/WebCore:

Fix up Content Security Policy logic for checking the frame ancestors now that we
exclude the frame that initiated the load request.

Test: http/tests/security/XFrameOptions/cross-origin-iframe-post-form-to-parent-same-origin-x-frame-options-page-allow.html

* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowFrameAncestors const):
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkFrameAncestors):

Source/WebKit:

Fixes an issue where a page P delivered with "X-Frame-Options: SAMEORIGIN" loaded in a sub-
frame would be blocked if we were redirected to it in response to the cross-origin POST
request regardless of whether P is same-origin with its parent document.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Compare the origin
of the top frame's document as opposed to the source origin. The latter represents the
origin of the document that initiated the navigation, which can be cross-origin, and
should not be considered when applying "X-Frame-Options: SAMEORIGIN". This check exists
as a performance optimization to avoid traversing over all frame ancestors only to find
out that the innermost frame (the one that made this request) is cross-origin with the
top-most frame.
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Exclude the origin of the
frame that is making the load request from the list of ancestor origins. This makes the
X-Frame-Options algorithm in WebKit2 match the logic we do in FrameLoader::shouldInterruptLoadForXFrameOptions().

LayoutTests:

Add a test to ensure that we allow a same-origin page with "X-Frame-Options: SAMEORIGIN" to
load as a result of a redirected cross-origin POST request.

* http/tests/security/XFrameOptions/cross-origin-iframe-post-form-to-parent-same-origin-x-frame-options-page-allow-expected.txt: Added.
* http/tests/security/XFrameOptions/cross-origin-iframe-post-form-to-parent-same-origin-x-frame-options-page-allow.html: Added.
* http/tests/security/XFrameOptions/resources/post-form-to-x-frame-options-parent-same-origin-allow.html: Added.
* http/tests/security/XFrameOptions/resources/x-frame-options-parent-same-origin-allow.cgi:

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

2 years agoJSImmutableButterfly can't be allocated from a subspace with HeapCell::Kind::Auxiliary
sbarati@apple.com [Wed, 27 Jun 2018 01:08:25 +0000 (01:08 +0000)]
JSImmutableButterfly can't be allocated from a subspace with HeapCell::Kind::Auxiliary
https://bugs.webkit.org/show_bug.cgi?id=186878
<rdar://problem/40568659>

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This patch fixes a bug in our JSImmutableButterfly implementation uncovered by
our stress GC bots. Before this patch, JSImmutableButterfly was allocated
with HeapCell::Kind::Auxiliary. This is wrong. Things that are JSCells can't
be allocated from HeapCell::Kind::Auxiliary. This patch adds a new HeapCell::Kind
called JSCellWithInteriorPointers. It behaves like JSCell in all ways, except
conservative scan knows to treat it like a butterfly in when we we may be
pointing into the middle of it.

The way we were crashing on the stress GC bots is that our conservative marking
won't do cell visiting for things that are Auxiliary. This meant that if the
stack were the only thing pointing to a JSImmutableButterfly when a GC took place,
that JSImmutableButterfly would not be visited. This is now fixed.

* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayNode::emitBytecode):
* debugger/Debugger.cpp:
* heap/ConservativeRoots.cpp:
(JSC::ConservativeRoots::genericAddPointer):
* heap/Heap.cpp:
(JSC::GatherHeapSnapshotData::operator() const):
(JSC::RemoveDeadHeapSnapshotNodes::operator() const):
(JSC::Heap::globalObjectCount):
(JSC::Heap::objectTypeCounts):
(JSC::Heap::deleteAllCodeBlocks):
* heap/HeapCell.cpp:
(WTF::printInternal):
* heap/HeapCell.h:
(JSC::isJSCellKind):
(JSC::hasInteriorPointers):
* heap/HeapUtil.h:
(JSC::HeapUtil::findGCObjectPointersForMarking):
(JSC::HeapUtil::isPointerGCObjectJSCell):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::didAddToDirectory):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
* runtime/JSGlobalObject.cpp:
* runtime/JSImmutableButterfly.h:
(JSC::JSImmutableButterfly::subspaceFor):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* tools/CellProfile.h:
(JSC::CellProfile::CellProfile):
(JSC::CellProfile::isJSCell const):
* tools/HeapVerifier.cpp:
(JSC::HeapVerifier::validateCell):

LayoutTests:

Make these test not susceptible to conservative scan leaks by ensuring at least
one object gets collected when we allocate many of them. Before, these were just
testing that a fixed number of objects were collected.

* editing/selection/navigation-clears-editor-state-expected.txt:
* editing/selection/navigation-clears-editor-state.html:
* fast/dom/reference-cycle-leaks.html:
* fast/misc/resources/test-observegc.js:
* fast/misc/test-observegc-expected.txt:
* platform/mac-wk2/plugins/refcount-leaks-expected.txt:
* plugins/refcount-leaks-expected.txt:
* plugins/refcount-leaks.html:

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

2 years ago[ews-build] Add support for compiling WebKit
aakash_jain@apple.com [Wed, 27 Jun 2018 01:07:27 +0000 (01:07 +0000)]
[ews-build] Add support for compiling WebKit
https://bugs.webkit.org/show_bug.cgi?id=187019

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(CompileWebKit): Added, class to compile WebKit.
(CleanBuild): Added, class to clean up the build.
(KillOldProcesses): Added, class to kill old processes.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
* BuildSlaveSupport/ews-build/config.json: Renamed ios-11-simulator to ios-simulator-11, to match with build.webkit.org code.
Added configuration, architecture which is required for compiling. Renamed Release to release as the tools expect lower-case release.
* BuildSlaveSupport/ews-build/factories.py: Added BuildFactory.
* BuildSlaveSupport/ews-build/loadConfig.py: Renamed configuraton value to lower-case as tools expect lower-case values.
* BuildSlaveSupport/ews-build/loadConfig_unittest.py: Ditto.

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

2 years agoSkip some unnecessary work in Interpreter::getStackTrace().
mark.lam@apple.com [Wed, 27 Jun 2018 00:43:25 +0000 (00:43 +0000)]
Skip some unnecessary work in Interpreter::getStackTrace().
https://bugs.webkit.org/show_bug.cgi?id=187070

Reviewed by Michael Saboff.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::getStackTrace):

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

2 years ago[iOS] Rebaseline two webanimations tests after r233164
commit-queue@webkit.org [Wed, 27 Jun 2018 00:41:30 +0000 (00:41 +0000)]
[iOS] Rebaseline two webanimations tests after r233164
https://bugs.webkit.org/show_bug.cgi?id=187071

Unreviewed gardening

Patch by Truitt Savell <tsavell@apple.com> on 2018-06-26

* platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* platform/ios/webanimations/opacity-animation-yields-compositing-span-expected.txt: Added.

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

2 years agoRemove quarantine for Webex plugin
youenn@apple.com [Wed, 27 Jun 2018 00:31:43 +0000 (00:31 +0000)]
Remove quarantine for Webex plugin
https://bugs.webkit.org/show_bug.cgi?id=187050
rdar://problem/41478189

Reviewed by Brent Fulgham.

Update the Plugin Info.plist to not do quarantine of downloaded files by default.
Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.

* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
* PluginProcess/PluginProcess.h:
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::shouldOverrideQuarantine):
* Shared/ChildProcess.h:
(WebKit::ChildProcess::shouldOverrideQuarantine):
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::initializeSandbox):

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

2 years agoEnsure element fullscreen animation is always visible.
commit-queue@webkit.org [Wed, 27 Jun 2018 00:25:47 +0000 (00:25 +0000)]
Ensure element fullscreen animation is always visible.
https://bugs.webkit.org/show_bug.cgi?id=187068
rdar://problem/36187369

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-06-26
Reviewed by Eric Carlson.

The fullscreen animation is important for communicating to users that they are no longer in inline mode.
If fullscreen animation's inline rect is not visible, animate from a point in the middle of the screen.

* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(WebKit::safeInlineRect):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):

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

2 years agoAdd a sandbox profile for com.google.o1dbrowserplugin plugin
youenn@apple.com [Wed, 27 Jun 2018 00:22:01 +0000 (00:22 +0000)]
Add a sandbox profile for com.google.o1dbrowserplugin plugin
https://bugs.webkit.org/show_bug.cgi?id=187067

Reviewed by Brent Fulgham.

* Resources/PlugInSandboxProfiles/com.google.o1dbrowserplugin.sb: Added.
* WebKit.xcodeproj/project.pbxproj:

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

2 years ago[ews-build] Add support for WebKitPerl-Tests-EWS
aakash_jain@apple.com [Wed, 27 Jun 2018 00:16:48 +0000 (00:16 +0000)]
[ews-build] Add support for WebKitPerl-Tests-EWS
https://bugs.webkit.org/show_bug.cgi?id=187023

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/config.json: Added WebKitPerl-tests-EWS.
* BuildSlaveSupport/ews-build/factories.py: Added WebKitPerlFactory.
* BuildSlaveSupport/ews-build/steps.py: Added build step RunWebKitPerlTests.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-test.

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

2 years ago[build.webkit.org] Rename badly named variable kls to schedulerType
aakash_jain@apple.com [Wed, 27 Jun 2018 00:10:23 +0000 (00:10 +0000)]
[build.webkit.org] Rename badly named variable kls to schedulerType
https://bugs.webkit.org/show_bug.cgi?id=186926

Reviewed by Lucas Forschler.

* BuildSlaveSupport/build.webkit.org-config/loadConfig.py:
(loadBuilderConfig): Renamed kls to schedulerType.

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

2 years agoPromote two more experimental features to traditional features
timothy_horton@apple.com [Tue, 26 Jun 2018 23:22:52 +0000 (23:22 +0000)]
Promote two more experimental features to traditional features
https://bugs.webkit.org/show_bug.cgi?id=187063

Reviewed by Dean Jackson.

* Shared/WebPreferences.yaml:
Promote some shipped/default-on features to non-experimental.

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

2 years agoRollout macOS sandbox change in r232276
bfulgham@apple.com [Tue, 26 Jun 2018 22:28:19 +0000 (22:28 +0000)]
Rollout macOS sandbox change in r232276
https://bugs.webkit.org/show_bug.cgi?id=186904
<rdar://problem/41350969>

Patch by Jiewen Tan <jiewen_tan@apple.com> on 2018-06-26
Reviewed by Brent Fulgham.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:

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

2 years agoTap highlight displayed when tapping a field that is already focussed
commit-queue@webkit.org [Tue, 26 Jun 2018 22:20:59 +0000 (22:20 +0000)]
Tap highlight displayed when tapping a field that is already focussed
https://bugs.webkit.org/show_bug.cgi?id=187004
<rdar://problem/41428008>
Patch by Aditya Keerthi <akeerthi@apple.com> on 2018-06-26
Reviewed by Tim Horton.

In the case where fast-clicking is enabled, _singleTapCommited: could be invoked
before the tap highlight request, causing _potentialTapInProgress to be set to NO.
This results in the early return for preventing multiple tap highlights on an
assisted node to be skipped. Since a tap highlight should never be shown for an
input field that is already focussed, _potentialTapInProgress can be removed from
the early return condition.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):

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

2 years agoREGRESSION (r232314): Flaky Test: imported/w3c/web-platform-tests/streams/piping...
ryanhaddad@apple.com [Tue, 26 Jun 2018 22:18:12 +0000 (22:18 +0000)]
REGRESSION (r232314): Flaky Test: imported/w3c/web-platform-tests/streams/piping/error-propagation-forward.html
https://bugs.webkit.org/show_bug.cgi?id=186161

Unreviewed gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-06-26

* TestExpectations:

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

2 years agoSimplify NetworkStorageSession::getAllStorageAccessEntries()
cdumez@apple.com [Tue, 26 Jun 2018 21:42:33 +0000 (21:42 +0000)]
Simplify NetworkStorageSession::getAllStorageAccessEntries()
https://bugs.webkit.org/show_bug.cgi?id=187016

Reviewed by Youenn Fablet.

Iterate over the HashMaps' values instead of iterating over their keys and then looking them
up in the HashMap.

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

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