WebKit-https.git
14 months agoStrip out more characters when creating permalinks
jonlee@apple.com [Wed, 6 Jun 2018 17:40:42 +0000 (17:40 +0000)]
Strip out more characters when creating permalinks
https://bugs.webkit.org/show_bug.cgi?id=186259

Reviewed by Said Abou-Hallawa.

Tests and suites may have names that make permalinks to the tests less readable when
shared. Expand the set of characters that are stripped out of the names.

* MotionMark/resources/debug-runner/motionmark.js: Refactor to call
stripUnwantedCharactersForURL. For existing links, decode the suite and test names.
* MotionMark/resources/extensions.js:
(Utilities.stripUnwantedCharactersForURL): Rename from stripNonASCIICharacters.
Remove any non-alphanumeric character.

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

14 months agoWrong NSVisualEffectMaterial used for exit full screen overlay in dark mode.
timothy@apple.com [Wed, 6 Jun 2018 16:42:05 +0000 (16:42 +0000)]
Wrong NSVisualEffectMaterial used for exit full screen overlay in dark mode.

https://bugs.webkit.org/show_bug.cgi?id=186350
rdar://problem/39135535

Reviewed by Anders Carlsson.

* platform/mac/WebCoreFullScreenPlaceholderView.mm:
(-[WebCoreFullScreenPlaceholderView initWithFrame:]):
Use the NSVisualEffectMaterialFullScreenUI on macOS 10.14 and don't
set an explicit NSAppearance.

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

14 months agoattenuationFactor should be in range [0,1]
commit-queue@webkit.org [Wed, 6 Jun 2018 16:36:12 +0000 (16:36 +0000)]
attenuationFactor should be in range [0,1]
https://bugs.webkit.org/show_bug.cgi?id=186320
rdar://problem/40821456

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-06-06
Reviewed by Jer Noble.

If attenuationFactor is outside of this range it can cause false positives.

* UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp:
(WebKit::FullscreenTouchSecheuristic::attenuationFactor):

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

14 months agoMove animated resize into the layer tree transaction, and make it asynchronous
timothy_horton@apple.com [Wed, 6 Jun 2018 16:32:26 +0000 (16:32 +0000)]
Move animated resize into the layer tree transaction, and make it asynchronous
https://bugs.webkit.org/show_bug.cgi?id=186130
<rdar://problem/38477288>

Reviewed by Simon Fraser.

* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::setScrollPosition):
(WebKit::RemoteLayerTreeTransaction::dynamicViewportSizeUpdateID const):
(WebKit::RemoteLayerTreeTransaction::setDynamicViewportSizeUpdateID):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode const):
(WebKit::RemoteLayerTreeTransaction::decode):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):
Add scrollPosition to the transaction on all platforms, not just Mac.
Add the optional dynamicViewportSizeUpdateID to the transaction, representing
the most recent dynamicViewportSizeUpdate that commit contains, if any.

* Shared/ios/DynamicViewportSizeUpdate.h:
Added a typedef for DynamicViewportSizeUpdateID, and move the mode enum here.

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget): Deleted.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::didCommitLayerTree):
(WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): Deleted.
(WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::synchronizeDynamicViewportUpdate): Deleted.
Remove dynamicViewportUpdateChangedTarget and synchronizeDynamicViewportUpdate.
Move dynamicViewportSizeUpdateID maintenance into WKWebView.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processDidExit]):
Remove _resizeAnimationTransformTransactionID. We now instead pack
the resize ID inside the transaction, instead of separately sending
back a transaction ID to wait for.

(-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]):
(-[WKWebView _didCommitLayerTree:]):
Added, factored out of _didCommitLayerTree:.
If the transaction includes the result of the most recently-sent resize,
store the requisite adjustments required to counter the new scale and
scroll offset, update the resizeAnimationView, and, if endAnimatedResize
has already been called, call _didCompleteAnimatedResize to tear down
the animation view and put things back together.

Add some code so that if a commit arrives before the resize, we update
the scale of the resize animation view to keep the width fitting.

(activeMaximumUnobscuredSize):
(activeOrientation):
Move these because the code that depends on them moved.

(-[WKWebView _didCompleteAnimatedResize]):
Broken out of _endAnimatedResize. This can now be called from
either endAnimatedResize or _didCommitLayerTreeDuringAnimatedResize,
depending on which is called first.

(-[WKWebView _beginAnimatedResizeWithUpdates:]):
Don't create a new resize view if we still have one. Otherwise, we'll
get the view ordering all wrong when making the second one. This
didn't previously cause trouble, because we don't have a lot of
WKScrollView subviews, but it totally could.

Adopt _initialContentOffsetForScrollView just to make this code more clear.

(-[WKWebView _endAnimatedResize]):
(-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:

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

14 months agoRegions outside of the fullscreen window are exposed during zoom operations
jer.noble@apple.com [Wed, 6 Jun 2018 16:13:31 +0000 (16:13 +0000)]
Regions outside of the fullscreen window are exposed during zoom operations
https://bugs.webkit.org/show_bug.cgi?id=186330
<rdar://problem/34698009>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fullscreen/full-screen-layer-dump.html

Introduce the concept of "requiresBackgroundLayer" to RenderLayerBacking, for use by
RenderFullScreen. Previously, the backgroundLayer in RenderLayerBacking was only used
by the root renderer with fixed backgrounds. Give the RenderFullScreen a background layer
that's approximately 3x as tall and wide as the renderer itself, so nothing is exposed
during pinch operations.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
(WebCore::RenderLayerBacking::updateBackgroundLayer):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderLayerBacking.h:

LayoutTests:

* fullscreen/full-screen-layer-dump-expected.txt: Added.
* fullscreen/full-screen-layer-dump.html: Added.

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

14 months agoSet the AVAssetResourceLoaderRequest's contentType to AVStreamingKeyDeliveryContentKe...
jer.noble@apple.com [Wed, 6 Jun 2018 16:10:47 +0000 (16:10 +0000)]
Set the AVAssetResourceLoaderRequest's contentType to AVStreamingKeyDeliveryContentKeyType in the case of a FPS key request.
https://bugs.webkit.org/show_bug.cgi?id=186328
<rdar://problem/40829228>

Reviewed by Eric Carlson.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):

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

14 months ago[LFC] Add margin computation for floating, replaced elements.
zalan@apple.com [Wed, 6 Jun 2018 15:52:16 +0000 (15:52 +0000)]
[LFC] Add margin computation for floating, replaced elements.
https://bugs.webkit.org/show_bug.cgi?id=186337

Reviewed by Antti Koivisto.

If 'margin-left' or 'margin-right' are computed as 'auto', their used value is '0'.

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):

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

14 months ago[LFC] Add margin computation for floating, no-replaced elements.
zalan@apple.com [Wed, 6 Jun 2018 15:25:38 +0000 (15:25 +0000)]
[LFC] Add margin computation for floating, no-replaced elements.
https://bugs.webkit.org/show_bug.cgi?id=186334

Reviewed by Antti Koivisto.

If 'margin-left', or 'margin-right' are computed as 'auto', their used value is '0'.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):

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

14 months agoUse minimal coverage rect for tiled layers when under memory pressure
antti@apple.com [Wed, 6 Jun 2018 14:50:02 +0000 (14:50 +0000)]
Use minimal coverage rect for tiled layers when under memory pressure
https://bugs.webkit.org/show_bug.cgi?id=186185
<rdar://problem/40713608>

Reviewed by Darin Adler.

We do this for the main content layer already.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):

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

14 months ago[GTK] Unreviewed test gardening
aboya@igalia.com [Wed, 6 Jun 2018 11:18:46 +0000 (11:18 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=186342

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:

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

14 months ago[Web Animations] Only expose CSSAnimation and CSSTransition if the WebAnimationsCSSIn...
graouts@webkit.org [Wed, 6 Jun 2018 08:20:10 +0000 (08:20 +0000)]
[Web Animations] Only expose CSSAnimation and CSSTransition if the WebAnimationsCSSIntegration runtime flag is enabled
https://bugs.webkit.org/show_bug.cgi?id=186305

Reviewed by Dean Jackson.

Source/WebCore:

* animation/CSSAnimation.idl:
* animation/CSSTransition.idl:

Websites/webkit.org:

Add a test for the WebAnimationsCSSIntegration runtime flag.

* experimental-features.html:

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

14 months agoRegression(r232082): Websites get loaded inside of Messages App chat transcript
cdumez@apple.com [Wed, 6 Jun 2018 04:53:35 +0000 (04:53 +0000)]
Regression(r232082): Websites get loaded inside of Messages App chat transcript
https://bugs.webkit.org/show_bug.cgi?id=186331
<rdar://problem/40735446>

Reviewed by Darin Adler.

Source/WebKitLegacy/mac:

r232082 made it so that if the client implements decidePolicyForMIMEType / decidePolicyForNavigationAction
but does not call use / ignore on the listener, then we would do "use" by default.
The intention was to restore pre-AsyncPolicyDelegates behavior and unbreak Box.app. However,
the pre-AsyncPolicyDelegates behavior was only to "use" by default for decidePolicyForMIMEType,
not decidePolicyForNavigationAction. Doing "use" by default for decidePolicyForNavigationAction
is new behavior and it breaks Messages.app. This patch updates r232082 so that we now do call
"use" by default on the listener for decidePolicyForMIMEType and "ignore" by default for other
policy decisions. This should restore pre-AsyncPolicyDelegates behavior. This fixes Messages.app
and Box.app is still working properly.

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
(WebFrameLoaderClient::dispatchWillSubmitForm):
(WebFrameLoaderClient::setUpPolicyListener):
(-[WebFramePolicyListener initWithFrame:policyFunction:defaultPolicy:]):
(-[WebFramePolicyListener initWithFrame:policyFunction:defaultPolicy:appLinkURL:]):
(-[WebFramePolicyListener dealloc]):
(-[WebFramePolicyListener initWithFrame:policyFunction:]): Deleted.
(-[WebFramePolicyListener initWithFrame:policyFunction:appLinkURL:]): Deleted.

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/mac/NoPolicyDelegateResponse.mm:
(-[NoDecidePolicyForNavigationActionDecisionDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):
(-[NoDecidePolicyForNavigationActionDecisionDelegate webView:didStartProvisionalLoadForFrame:]):
(TestWebKitAPI::TEST):
(-[NoPolicyDelegateDecisionDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]): Deleted.
(-[NoPolicyDelegateDecisionDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:]): Deleted.
(-[NoPolicyDelegateDecisionDelegate webView:didFinishLoadForFrame:]): Deleted.

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

14 months agoMove OpenGL display mask to screen data struct.
pvollan@apple.com [Wed, 6 Jun 2018 04:35:12 +0000 (04:35 +0000)]
Move OpenGL display mask to screen data struct.
https://bugs.webkit.org/show_bug.cgi?id=186198
<rdar://problem/40724854>

Reviewed by Brent Fulgham.

Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
window is available, the OpenGL display mask of the main display is used.

Source/WebCore:

No new tests, since testing this requires two Web views in the same WebContent process, displayed on
two different monitors.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer const):
* platform/PlatformScreen.h:
* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const):
(WebCore::ScreenProperties::decode):
(WebCore::ScreenData::encode const):
(WebCore::ScreenData::decode):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
* platform/graphics/ImageBuffer.h:
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::allowOfflineRenderers const):
(WebCore::GraphicsContext3D::setOpenGLDisplayMask): Deleted.
(WebCore::GraphicsContext3D::getOpenGLDisplayMask): Deleted.
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::ensurePlatformContext):
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenProperties):
(WebCore::collectScreenProperties):
(WebCore::setScreenProperties):
(WebCore::screenData):
(WebCore::primaryOpenGLDisplayMask):
(WebCore::displayMaskForDisplay):
(WebCore::getScreenProperties):
(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenRectForDisplay):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::screenColorSpace):
(WebCore::screenSupportsExtendedColor):

Source/WebKit:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::windowScreenDidChange):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::screenPropertiesStateChanged):
(WebKit::displayReconfigurationCallBack):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::openGLDisplayMaskChanged): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setScreenProperties):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

14 months agoREGRESSION (231817): Videos permanently blank out after switching out of a tab and...
jer.noble@apple.com [Wed, 6 Jun 2018 04:25:48 +0000 (04:25 +0000)]
REGRESSION (231817): Videos permanently blank out after switching out of a tab and back in
https://bugs.webkit.org/show_bug.cgi?id=186326
<rdar://problem/40778157>

Reviewed by Eric Carlson.

Source/WebCore:

Check whether the element is visible in the viewport when the web view itself becomes visible, and if so, clear the m_elementIsHiddenUntilVisibleInViewport flag.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::visibilityChanged):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

LayoutTests:

* media/video-buffering-allowed-expected.txt:
* media/video-buffering-allowed.html:

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

14 months ago[LFC] Move inflow, replaced width and margin computation to a dedicated function.
zalan@apple.com [Wed, 6 Jun 2018 04:23:26 +0000 (04:23 +0000)]
[LFC] Move inflow, replaced width and margin computation to a dedicated function.
https://bugs.webkit.org/show_bug.cgi?id=186327

Reviewed by Sam Weinig.

I was searching for the function inFlowReplacedWidthAndMargin() and there was none.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):

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

14 months ago[LFC] Add missing margins for inflow, non replaced block and replaced inline elements
zalan@apple.com [Wed, 6 Jun 2018 03:10:45 +0000 (03:10 +0000)]
[LFC] Add missing margins for inflow, non replaced block and replaced inline elements
https://bugs.webkit.org/show_bug.cgi?id=186332

Reviewed by Darin Adler.

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

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

14 months agoRemove tracksResourceLoadMilestones support
krollin@apple.com [Wed, 6 Jun 2018 01:46:17 +0000 (01:46 +0000)]
Remove tracksResourceLoadMilestones support
https://bugs.webkit.org/show_bug.cgi?id=186329
<rdar://problem/40829898>

Reviewed by Darin Adler.

Remove the mechanism for enabling/disabling the tracking of
resource-load milestones. This was initially added in order to enable
the tracking only for Safari. However, the decision has been made to
enable the tracking for all WebKit clients, so it's now enabled
unconditionally.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
(WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
(WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
(WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
(WebKit::networkActivityTrackingEnabled): Deleted.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::tracksResourceLoadMilestones const): Deleted.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationTracksResourceLoadMilestones): Deleted.
(WKContextConfigurationSetTracksResourceLoadMilestones): Deleted.
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration tracksResourceLoadMilestones]): Deleted.
(-[_WKProcessPoolConfiguration setTracksResourceLoadMilestones:]): Deleted.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):

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

14 months ago[macOS] Spelling errors in the middle of an inserted paragraph are not displayed
wenson_hsieh@apple.com [Wed, 6 Jun 2018 01:44:03 +0000 (01:44 +0000)]
[macOS] Spelling errors in the middle of an inserted paragraph are not displayed
https://bugs.webkit.org/show_bug.cgi?id=185584
<rdar://problem/38676081>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Currently when typing, we only consider the range of adjacent words when determining where to place spelling
correction markers, even though we provide NSSpellChecker with the full context of the sentence (and get back
results encompassing the full range). In macOS Mojave, NSSpellChecker may now return spell checking results that
include correctly spelled words that are misused in the context of the sentence. This means that while typing a
sentence, a different part of the sentence may gain or lose spelling markers as a result.

To support this, WebKit needs to mark or unmark spelling corrections in the full range of the sentence whenever
a full word is typed (since the context of other words within the sentence may have changed, resulting in
different platform spellchecking results). In markMisspellingsAfterTypingToWord, we expand the spell checking
range past the adjacent words so that it encompasses the largest subrange of the full sentence that includes the
start of the typed word, and does not include any position that is under an element with `spellcheck=false`.

This guarantees that we don't erroneously place spelling document markers under elements where spellchecking is
disabled, while allowing for sentence retro corrections when spellchecking is enabled. However, this doesn't
handle the case where an element with spellchecking disabled lies between a sentence retro correction range and
the currently typed word. In the future, we could fix this by refactoring SpellCheckRequest to track a list of
non-contiguous spelling correction ranges — see the FIXME in markMisspellingsAfterTypingToWord for more detail.

Covered by 2 new layout tests, as well as an existing spell-checking test that should now be passing.

Tests: editing/spelling/retro-correction-spelling-markers.html
       editing/spelling/spelling-markers-after-pasting-sentence.html

* editing/Editor.cpp:
(WebCore::Editor::markMisspellingsAfterTypingToWord):
* testing/Internals.h:
* testing/Internals.idl:

Add an internal testing helper to determine whether retro sentence corrections are enabled.

LayoutTests:

Adds 2 new spellchecking tests, and refactors some existing tests.

* editing/spelling/grammar-expected.txt:
* editing/spelling/grammar.html:
* editing/spelling/markers-expected.txt:
* editing/spelling/markers.html:

Tweaked so that these tests pass regardless of whether sentence retro correction is enabled or disabled.

* editing/spelling/retro-correction-spelling-markers-expected.txt: Added.
* editing/spelling/retro-correction-spelling-markers.html: Added.

Tests that typing at the end of a sentence will mark other parts of the sentence as misspellings, if retro
sentence correction is enabled.

* editing/spelling/spelling-changed-text-expected.txt:
* editing/spelling/spelling-changed-text.html:

Tweaked to correctly wait for the marker range to become the expected value.

* editing/spelling/spelling-markers-after-pasting-sentence-expected.txt: Added.
* editing/spelling/spelling-markers-after-pasting-sentence.html: Added.

Tests that after pasting a sentence with misspelled words, those misspelled words will be marked as misspellings.

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

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

14 months agoDataInteractionTests ContentEditableToTextarea and ContentEditableToContentEditable...
wenson_hsieh@apple.com [Wed, 6 Jun 2018 00:50:54 +0000 (00:50 +0000)]
DataInteractionTests ContentEditableToTextarea and ContentEditableToContentEditable are failing on recent iOS 12
https://bugs.webkit.org/show_bug.cgi?id=186325
<rdar://problem/40527850>

Reviewed by Tim Horton.

Tweak these API tests so that they're robust against changes to how NSAttributedStrings are serialized in item
providers ("public.rtf" vs. "com.apple.flat-rtfd"). Across all versions of iOS, just verify that either rich
text type is present in the list of dragged type identifiers, and that the rich text type is placed at a higher
fidelity than plain text.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(checkRichTextTypePrecedesPlainTextType):
(TestWebKitAPI::TEST):
(checkTypeIdentifierPrecedesOtherTypeIdentifier): Deleted.

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

14 months ago[Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other...
darin@apple.com [Wed, 6 Jun 2018 00:18:27 +0000 (00:18 +0000)]
[Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers
https://bugs.webkit.org/show_bug.cgi?id=186324

Reviewed by Anders Carlsson.

Source/WebCore:

* platform/FileMonitor.h: Use OSObjectPtr instead of DispatchPtr.
* platform/cocoa/FileMonitorCocoa.mm:
(WebCore::FileMonitor::FileMonitor): Ditto.

Source/WebKit:

* NetworkProcess/cache/NetworkCacheData.h: Use OSObjectPtr instead of
DispatchPtr and also use an rvalue reference in the constructor.
* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
(WebKit::NetworkCache::Data::Data): Use adoptOSObject, rvalue reference
and WTFMove.
(WebKit::NetworkCache::Data::empty): Use OSObjectPtr.
(WebKit::NetworkCache::Data::data const): Use adoptOSObject.
(WebKit::NetworkCache::Data::subrange const): Ditto.
(WebKit::NetworkCache::concatenate): Ditto.
(WebKit::NetworkCache::Data::adoptMap): Ditto. Also use WTFMove.

* NetworkProcess/cache/NetworkCacheIOChannel.h: Use OSObjectPtr.
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::IOChannel): Use adoptOSObject.
(WebKit::NetworkCache::IOChannel::read): Use OSObjectPtr.

Source/WTF:

* WTF.xcodeproj/project.pbxproj: Removed DispatchPtr.h.
* wtf/BlockPtr.h: Remove unneeded checks for __OBJC__. Added some use
of WTFMove.
* wtf/CMakeLists.txt: Removed DispatchPtr.h.
* wtf/DispatchPtr.h: Removed. We no longer need to support Mavericks.
* wtf/OSObjectPtr.h: Remove unneeded checks for __OBJC__. Added some use
of WTFMove.

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

14 months agoUnreviewed, fix the macOS build with recent SDKs.
ryanhaddad@apple.com [Wed, 6 Jun 2018 00:15:08 +0000 (00:15 +0000)]
Unreviewed, fix the macOS build with recent SDKs.

* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::paintContents):

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

14 months agoAdjust compile and runtime flags to match shippable state of features
bfulgham@apple.com [Tue, 5 Jun 2018 23:31:25 +0000 (23:31 +0000)]
Adjust compile and runtime flags to match shippable state of features
https://bugs.webkit.org/show_bug.cgi?id=186319
<rdar://problem/40352045>

Reviewed by Maciej Stachowiak, Jon Lee, and others.

Source/JavaScriptCore:

This patch revises the compile time and runtime state for various features to match their
suitability for end-user releases.

* Configurations/DebugRelease.xcconfig: Update to match WebKit definition of
WK_RELOCATABLE_FRAMEWORKS so that ENABLE(EXPERIMENTAL_FEATURES) is defined properly for
Cocoa builds.
* Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.
* runtime/Options.h: Only enable INTL_NUMBER_FORMAT_TO_PARTS and INTL_PLURAL_RULES
at runtime for non-production builds.

Source/WebCore:

* Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.

Source/WebCore/PAL:

* Configurations/DebugRelease.xcconfig: Update to match WebKit definition of
WK_RELOCATABLE_FRAMEWORKS so that ENABLE(EXPERIMENTAL_FEATURES) is defined properly for
Cocoa builds.
* Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.

Source/WebKit:

Change the default state of various experimental features so that they are off by default in production
builds, since they are still under development.

Turn 'CacheAPIEnabled' and 'SubresourceIntegrityEnabled' on by default, since both features have been
shipping for a full cycle and have proven to be stable in production.

* Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.
* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

* Configurations/DebugRelease.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.
* Configurations/FeatureDefines.xcconfig: Update to match WebKit definition of
WK_RELOCATABLE_FRAMEWORKS so that ENABLE(EXPERIMENTAL_FEATURES) is defined properly for
Cocoa builds.

Tools:

This patch revises the compile time and runtime state for various features to match their
suitability for end-user releases.

* TestWebKitAPI/Configurations/DebugRelease.xcconfig: Update to match WebKit definition of
WK_RELOCATABLE_FRAMEWORKS so that ENABLE(EXPERIMENTAL_FEATURES) is defined properly for
Cocoa builds.
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.

LayoutTests:

* platform/mac/TestExpectations:
* platform/mac/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-badInput-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-willValidate-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/selection-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/readwrite-readonly-expected.txt: Added.

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

14 months agoTemporarily Skip JSC stress test failures that are consistently occurring.
commit-queue@webkit.org [Tue, 5 Jun 2018 22:57:06 +0000 (22:57 +0000)]
Temporarily Skip JSC stress test failures that are consistently occurring.
https://bugs.webkit.org/show_bug.cgi?id=186283

Unreviewed test gardening.

Patch by David Fenton <david_fenton@apple.com> on 2018-06-05

* executableAllocationFuzz.yaml:
* slowMicrobenchmarks/default-derived-constructor.js:
* stress/put-direct-index-broken-2.js:
* stress/splay-flash-access.js:
* stress/spread-forward-call-varargs-stack-overflow.js:

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

14 months agoWeb Inspector: Tab picker is briefly visible when TabBar initially shown
mattbaker@apple.com [Tue, 5 Jun 2018 22:41:00 +0000 (22:41 +0000)]
Web Inspector: Tab picker is briefly visible when TabBar initially shown
https://bugs.webkit.org/show_bug.cgi?id=186317

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TabBar.js:
(WI.TabBar): Picker should be initially hidden.

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

14 months agoClean up LocalDefaultSystemAppearance and prefers-dark-interface media query
timothy@apple.com [Tue, 5 Jun 2018 22:26:58 +0000 (22:26 +0000)]
Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query

https://bugs.webkit.org/show_bug.cgi?id=186323
rdar://problem/38382252

Reviewed by Tim Horton.

Source/WebCore:

* css/MediaFeatureNames.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersDarkInterfaceEvaluate):
(WebCore::defaultAppearanceEvaluate): Deleted.
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent):
(WebCore::isFeatureValidWithoutValue):
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _defaultAppearance]):
* UIProcess/API/mac/WKView.mm:
(-[WKView _defaultAppearance]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::useDefaultAppearance):

Source/WebKitLegacy/mac:

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

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

14 months ago[iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies...
sihui_liu@apple.com [Tue, 5 Jun 2018 22:09:48 +0000 (22:09 +0000)]
[iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies aren't flushed to file
https://bugs.webkit.org/show_bug.cgi?id=186303
<rdar://problem/40468716>

Reviewed by Geoffrey Garen.

No matter there is an observer or not, cookies in UI process should always be flushed to
file when new process pool is created, such that cookies created via API can be synced to
network process.

* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::HTTPCookieStore):
(API::HTTPCookieStore::registerObserver):
(API::HTTPCookieStore::cookieManagerDestroyed):
(API::HTTPCookieStore::registerForNewProcessPoolNotifications):

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

14 months agosecheuristic should only use touch began and ended, not changed.
commit-queue@webkit.org [Tue, 5 Jun 2018 21:29:05 +0000 (21:29 +0000)]
secheuristic should only use touch began and ended, not changed.
https://bugs.webkit.org/show_bug.cgi?id=186318
rdar://problem/39781486

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-06-05
Reviewed by Jer Noble.

Filter out change events so swiping gestures don't trigger the heuristic.

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

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

14 months ago[Cocoa] More preparation for ARC, focusing on WebKit and smart pointers
darin@apple.com [Tue, 5 Jun 2018 20:58:14 +0000 (20:58 +0000)]
[Cocoa] More preparation for ARC, focusing on WebKit and smart pointers
https://bugs.webkit.org/show_bug.cgi?id=186314

Reviewed by Anders Carlsson.

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Use __bridge for cast.
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::overrideSystemProxies): Ditto.
(WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost): Ditto.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage): Ditto.
(IPC::readFromMachPort): Ditto.

* Platform/mac/StringUtilities.mm:
(WebKit::formattedPhoneNumberString): Use __bridge for cast and
CFBridgingRelease instead of an explicit autorelease.

* Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
(initializeMethods): Use auto instead of an explicit type so that we get
the correct type for the result of protocol_copyProtocolList.

* Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
(-[_WKRemoteObjectRegistry _sendInvocation:interface:]): Added a
bridging cast to void* because that's needed to call _Block_signature
under ARC and harmless outside ARC.

* Shared/API/c/cf/WKStringCF.mm:
(WKStringCreateWithCFString): Use __bridge for cast.
* Shared/API/c/cf/WKURLCF.mm:
(WKURLCreateWithCFURL): Ditto.
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::initializeConnection): Ditto.
* Shared/Cocoa/DataDetectionResult.mm:
(WebKit::DataDetectionResult::encode const): Ditto.
(WebKit::DataDetectionResult::decode): Ditto.
* Shared/Cocoa/WKNSError.mm:
(-[WKNSError _web_createTarget]): Ditto.
* Shared/Cocoa/WKNSURLExtras.mm:
(-[NSURL _web_originalDataAsWTFString]): Ditto.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer): Removed balanced calls to both
adoptOSObject and xpc_retain and instead rely on the assignment
operator just added to OSObjectPtr.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceEventHandler): Use __bridge for cast.
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): Ditto.
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::decode): Ditto.
* Shared/mac/ArgumentCodersMac.mm:
(IPC::isSerializableValue): Ditto.
(IPC::encode): Ditto.
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::encodeNSError): Ditto. Also use CFSTR("")" instead of @""
when we need a CFString.
(IPC::decodeNSError): Ditto.
(IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
(IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
(IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
* Shared/mac/WebHitTestResultData.mm:
(WebKit::WebHitTestResultData::platformEncode const): Ditto.
(WebKit::WebHitTestResultData::platformDecode): Ditto.
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextIsPlugInUpdateAvailable): Ditto.
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController certificateChain]): Ditto.
(didStartProvisionalLoadForFrame): Ditto.
(didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
(didFailProvisionalLoadWithErrorForFrame): Ditto.
(didCommitLoadForFrame): Ditto.
(didFinishLoadForFrame): Ditto.
(didFailLoadWithErrorForFrame): Ditto.
(canAuthenticateAgainstProtectionSpaceInFrame): Ditto.
(didReceiveAuthenticationChallengeInFrame): Ditto.
(didStartProgress): Ditto.
(didChangeProgress): Ditto.
(didFinishProgress): Ditto.
(didChangeBackForwardList): Ditto.
(processDidCrash): Ditto.
(setUpPageLoaderClient): Ditto.
(setUpPagePolicyClient): Ditto.
* UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
(createWKArray): Ditto.
(-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]): Ditto.
(-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Ditto.
* UIProcess/API/Cocoa/WKConnection.mm:
(didReceiveMessage): Ditto.
(didClose): Ditto.
(setUpClient): Ditto.
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(didCreateConnection): Ditto.
(getInjectedBundleInitializationUserData): Ditto.
(setUpInjectedBundleClient): Ditto.
(-[WKProcessGroup _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setProxyConfiguration:]): Ditto.
(-[WKWebsiteDataStore _proxyConfiguration]): Ditto.
* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView _didTakeSnapshot:]): Ditto.

* UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added a missing include.

* UIProcess/Authentication/mac/WebCredentialMac.mm:
(WebKit::chain): Use __bridge for cast.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
Use CFBridgingRelease instead of adoptNS.
(WebKit::privateBrowsingSession): Use __bridge for cast.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::provideDataForPasteboard): Use __bridge for cast.
* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::PluginInfoStore::pluginPathsInDirectory): Ditto.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::recursivelyMapIOSurfaceBackingStore): Ditto.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::beginSwipeGesture): Ditto.
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController enterFullScreen:]): Ditto.
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu): Ditto.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
(didCreatePage): Ditto.
(willDestroyPage): Ditto.
(setUpBundleClient): Ditto.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(didStartProvisionalLoadForFrame): Ditto.
(didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
(didFinishLoadForFrame): Ditto.
(globalObjectIsAvailableForFrame): Ditto.
(didRemoveFrameFromHierarchy): Ditto.
(didCommitLoadForFrame): Ditto.
(didFinishDocumentLoadForFrame): Ditto.
(didFailProvisionalLoadWithErrorForFrame): Ditto.
(didFailLoadWithErrorForFrame): Ditto.
(didSameDocumentNavigationForFrame): Ditto.
(didLayoutForFrame): Ditto.
(didReachLayoutMilestone): Ditto.
(didFirstVisuallyNonEmptyLayoutForFrame): Ditto.
(didHandleOnloadEventsForFrame): Ditto.
(userAgentForURL): Ditto.
(setUpPageLoaderClient): Ditto.
(willSendRequestForFrame): Ditto.
(didInitiateLoadForResource): Ditto.
(didFinishLoadForResource): Ditto.
(didFailLoadForResource): Ditto.
(setUpResourceLoadClient): Ditto.
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::initialize): Ditto.
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::popUpContextMenu): Ditto.

* WebProcess/Plugins/PDF/PDFPlugin.h: Put functions that return NSData inside
an #ifdef __OBJC__ and use __bridge for cast.

* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteDragImage): Use __bridge for cast.

* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::contents const): Added a bridging cast.
(WebKit::PlatformCALayerRemoteCustom::setContents): Use __bridge for cast.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): Ditto.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::setTopOverhangImage): Ditto.
(WebKit::WebPage::setBottomOverhangImage): Ditto.

Source/WTF:

* wtf/BlockPtr.h: Put Block_copy/release calls into #if since they are
not needed under ARC.

* wtf/OSObjectPtr.h: Added constructor and assignment operator so we can
work with OS objects without adopting them.

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

14 months ago[Cocoa] Improve some soft linking compatibility with ARC
darin@apple.com [Tue, 5 Jun 2018 19:13:43 +0000 (19:13 +0000)]
[Cocoa] Improve some soft linking compatibility with ARC
https://bugs.webkit.org/show_bug.cgi?id=186309

Reviewed by Anders Carlsson.

Source/WebCore:

* platform/audio/ios/AudioSessionIOS.mm: Use SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER
for NSString constants.
* platform/audio/ios/MediaSessionManagerIOS.mm: Ditto.
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): Use __bridge for
some bridging casts.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Use
SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER for NSString constants.
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Ditto.
* platform/mediastream/mac/AVCaptureDeviceManager.mm: Ditto.
* platform/mediastream/mac/AVMediaCaptureSource.mm: Ditto.
* platform/mediastream/mac/AVVideoCaptureSource.mm: Ditto.

Source/WTF:

* wtf/cocoa/SoftLinking.h: Updated the SOFT_LINK_CONSTANT family of
macros to use a const type. This increases the chance that they will
work without triggering ARC compilation errors since it's easier to
get the type right for read-only access than for read/write.

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

14 months agoWeb Inspector: Text in "Add New Class" in auto-capitalizes
nvasilyev@apple.com [Tue, 5 Jun 2018 19:07:12 +0000 (19:07 +0000)]
Web Inspector: Text in "Add New Class" in auto-capitalizes
https://bugs.webkit.org/show_bug.cgi?id=186311

Reviewed by Matt Baker.

Disable spellcheck to prevent auto-capitalization.

* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype.initialLayout):

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

14 months agorun-testmem should have a dry run option and an option to parse the stdout of executi...
sbarati@apple.com [Tue, 5 Jun 2018 18:54:10 +0000 (18:54 +0000)]
run-testmem should have a dry run option and an option to parse the stdout of executing the dry run
https://bugs.webkit.org/show_bug.cgi?id=186293

Reviewed by Mark Lam.

This makes it easier to execute run-testmem on a device that doesn't have ruby
on it. run-testmem now has a --dry option that will output commands to execute
in bash. To run on a device that doesn't have ruby, just put its output into
a bash script, and copy the PerformanceTests/testmem directory onto that device,
and execute the bash script. Running that bash script will give you raw output.
Make a file with that output and pass it into run-testmem using the --parse option.
run-testmem will parse the raw output and compute the benchmark score.

* Scripts/run-testmem:

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

14 months agoServiceWorker registration should store any script fetched through importScripts
youenn@apple.com [Tue, 5 Jun 2018 18:50:41 +0000 (18:50 +0000)]
ServiceWorker registration should store any script fetched through importScripts
https://bugs.webkit.org/show_bug.cgi?id=182444
<rdar://problem/37164835>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/registration-mime-types.https-expected.txt:

Source/WebCore:

Covered by added test http/wpt/service-workers/persistent-importScripts.html.

Update importScripts implementation to look for/update the resource map in case of service worker scope.
This resource map is stored persistently and sent when running the service worker.

Add support to persistent storage of this resource map.
This requires updating the schema database.
The schema version is bumped to 2 and we delete any data related to old registrations.

When updating the service worker, the resource map is currently flushed so that all scripts will be retrieved from the network.

Did some limited refactoring to put more loading handling in WorkerScriptLoader.

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::script):
* workers/WorkerScriptLoader.h:
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy const):
(WebCore::ServiceWorkerContextData::ImportedScript::encode const):
(WebCore::ServiceWorkerContextData::ImportedScript::decode):
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::scriptResource const):
(WebCore::ServiceWorkerGlobalScope::setScriptResource):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/context/SWContextManager.h:
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::v1RecordsTableSchema):
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::installContextData):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::setScriptResource):
* workers/service/server/SWServerToContextConnection.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::m_scriptResourceMap):
(WebCore::SWServerWorker::contextData const):
(WebCore::SWServerWorker::setScriptResource):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

Add C API to kill storage process.
In case a Storage Process is closed or crashed, ensure that all its related service worker processes also exit.

* StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
* UIProcess/API/C/WKContext.cpp:
(WKContextTerminateStorageProcess):
* UIProcess/API/C/WKContextPrivate.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::webToStorageProcessConnectionClosed):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::setScriptResource):
* WebProcess/Storage/WebSWContextManagerConnection.h:

Source/WTF:

* wtf/persistence/PersistentCoders.h:

Tools:

Add support to crash the storage process from Internals.

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

LayoutTests:

* http/wpt/service-workers/persistent-importScripts-expected.txt: Added.
* http/wpt/service-workers/persistent-importScripts.html: Added.
* http/wpt/service-workers/resources/persistent-importScripts-script.py: Added.
* http/wpt/service-workers/resources/persistent-importScripts-worker.js: Added.
* http/wpt/service-workers/resources/routines.js: Added.

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

14 months agoRevise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
bfulgham@apple.com [Tue, 5 Jun 2018 18:14:00 +0000 (18:14 +0000)]
Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
https://bugs.webkit.org/show_bug.cgi?id=186286
<rdar://problem/40782992>

Reviewed by Dan Bernstein.

Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
change this flag when preparing for a production release.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
whether experimental features should be enabled, and use it to properly define the
feature flag.

Source/WebCore:

* Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
whether experimental features should be enabled, and use it to properly define the
feature flag.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
whether experimental features should be enabled, and use it to properly define the
feature flag.

Source/WebKit:

* Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine whether
experimental features should be enabled, and use it to properly define the feature flag.
* Shared/WebPreferencesDefaultValues.h:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
whether experimental features should be enabled, and use it to properly define the
feature flag.

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to
determine whether experimental features should be enabled, and use it to properly define
the feature flag.

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

14 months agoAdd a grammar (in antlr4 format) to the WSL spec.
rmorisset@apple.com [Tue, 5 Jun 2018 18:06:53 +0000 (18:06 +0000)]
Add a grammar (in antlr4 format) to the WSL spec.
https://bugs.webkit.org/show_bug.cgi?id=186310

Rubberstamped by Filip Pizlo

It is just the raw rules, without much comments and no typesetting.
Compiles to any of Java/JS/C++/etc.. with antlr4 (requires a JDK)

It does not exactly match the parser of the current js implementation of WSL, it:
- Accepts negative literals
- Reserves keywords fallthrough/auto
- Refuses '_' as a valid identifier
- Accepts several capitalizations for Null/True/False
- Accepts variable declarations at the top-level
- Correctly parses ternary expressions
- Forbids empty extension list for protocols
- Does not allow a space between '[' and ']' in type suffixes
- Correctly parses nested generics
- Accepts a 'fallthrough;' statement (for switches)
- Refuses chained relational operator (e.g. x < y < z)
- Generally a completely different structure for parsing effectful expressions, although it probably accepts about the same language
- Currently only accepts literals and identifiers as constexpr (while the js parser accepts way too much, including '(x += 42)')
There are probably more differences that I missed. The js parser will probably have to be mostly rewritten to follow the spec more closely (and fix all the bugs).
I will try to see if it can be automatically derived from the antlr4 grammar.

* WebGPUShadingLanguageRI/SpecWork/WSL.g4: Added.

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

14 months ago[Cocoa] Update some JavaScriptCore code to be more ready for ARC
darin@apple.com [Tue, 5 Jun 2018 17:25:00 +0000 (17:25 +0000)]
[Cocoa] Update some JavaScriptCore code to be more ready for ARC
https://bugs.webkit.org/show_bug.cgi?id=186301

Reviewed by Anders Carlsson.

* API/JSContext.mm:
(-[JSContext evaluateScript:withSourceURL:]): Use __bridge for typecast.
(-[JSContext setName:]): Removed unnecessary call to copy, since the
JSStringCreateWithCFString function already reads the characters out
of the string and does not retain the string, so there is no need to
make an immutable copy. And used __bridge for typecast.
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::receivedProxyApplicationSetupMessage):
Ditto.

* inspector/remote/cocoa/RemoteInspectorXPCConnection.mm:
(Inspector::RemoteInspectorXPCConnection::deserializeMessage):
Use CFBridgingRelease instead of autorelease for a CF dictionary that
we return as an NSDictionary.

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

14 months agoUnreviewed build fix after r232511.
bfulgham@apple.com [Tue, 5 Jun 2018 16:28:19 +0000 (16:28 +0000)]
Unreviewed build fix after r232511.
https://bugs.webkit.org/show_bug.cgi?id=186304

* platform/ios/WebItemProviderPasteboard.mm: Add missing include.

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

14 months agoFix the iOS build after r232496
bfulgham@apple.com [Tue, 5 Jun 2018 16:16:02 +0000 (16:16 +0000)]
Fix the iOS build after r232496
https://bugs.webkit.org/show_bug.cgi?id=186304

Patch by Antoine Quint <graouts@apple.com> on 2018-06-05
Reviewed by Brent Fulgham.

The changes in r232496 changed the InputType::element() signature from HTMLInputElement&
to HTMLInputElement* and some call sites did not expect that.

* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue):
(WebCore::BaseChooserOnlyDateAndTimeInputType::didChooseValue):
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::accessKeyAction):
(WebCore::BaseChooserOnlyDateAndTimeInputType::isMouseFocusable const):
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::setValueAsDate const):
(WebCore::BaseDateAndTimeInputType::valueAsDouble const):
(WebCore::BaseDateAndTimeInputType::setValueAsDecimal const):
(WebCore::BaseDateAndTimeInputType::typeMismatch const):
(WebCore::BaseDateAndTimeInputType::serializeWithComponents const):
(WebCore::BaseDateAndTimeInputType::localizeValue const):
(WebCore::BaseDateAndTimeInputType::visibleValue const):
(WebCore::BaseDateAndTimeInputType::valueMissing const):
(WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const):
* html/DateInputType.cpp:
(WebCore::DateInputType::createStepRange const):
* html/DateTimeLocalInputType.cpp:
(WebCore::DateTimeLocalInputType::createStepRange const):
* html/MonthInputType.cpp:
(WebCore::MonthInputType::valueAsDate const):
(WebCore::MonthInputType::createStepRange const):
* html/TimeInputType.cpp:
(WebCore::TimeInputType::createStepRange const):
* html/WeekInputType.cpp:
(WebCore::WeekInputType::createStepRange const):

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

14 months agoSimplify and remove some unused video element code (helpful for ARC-compatibility)
darin@apple.com [Tue, 5 Jun 2018 16:14:38 +0000 (16:14 +0000)]
Simplify and remove some unused video element code (helpful for ARC-compatibility)
https://bugs.webkit.org/show_bug.cgi?id=186258

Reviewed by Daniel Bates.

Source/WebCore:

My main mission was to remove the PlatformMedia struct, which had a union
of Objective-C object pointers in it, which doesn't work in ARC. However, I
found some other unused code to remove and simple mistakes to fix.

* Modules/mediasource/VideoPlaybackQuality.cpp:
(WebCore::VideoPlaybackQuality::create): Use unsigned instead of unsigned long,
since IDL "unsigned long" really means unsigned.
(WebCore::VideoPlaybackQuality::VideoPlaybackQuality): Ditto.
* Modules/mediasource/VideoPlaybackQuality.h: Updated for the above.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::platformMedia const): Deleted.
* html/HTMLMediaElement.h: Updated for the above.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::MediaPlayer): Moved initialization of many data members
to the class definition.
(WebCore::MediaPlayer::load): Use nullptr instead of 0.
(WebCore::MediaPlayer::platformMedia const): Deleted.
(WebCore::MediaPlayer::videoPlaybackQualityMetrics): Updated name of return type.
(WebCore::MediaPlayer::objCAVFoundationAVPlayer const): Added. Replaces
platformMedia for the one case where it was being used.
* platform/graphics/MediaPlayer.h: Removed unneeded includes. Re-sorted things.
Updated for the above. Removed PlatformMedia struct and NoPlatformMedia constant.
Removed explicit constructor in MediaEngineSupportParameters. Renamed
PlatformVideoPlaybackQualityMetrics struct to VideoPlaybackQualityMetrics,
removed its constructor, and changed types from unsigned long to unsigned.
Un-nested #if statements. Removed some Chromium-specific comments.

* platform/graphics/MediaPlayerPrivate.h: Removed unneeded includes and
forward declarations. Removed platformMedia. Updated return type for
videoPlaybackQualityMetrics. Added objCAVFoundationAVPlayer.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
Removed platformMedia.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::platformMedia const): Deleted.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
Updated for the above.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
Added override of objCAVFoundationAVPlayer. Removed platformMedia.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const): Deleted.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
Removed platformMedia. Updated return type for videoPlaybackQualityMetrics.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformMedia const): Deleted.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
Updated return type, changed to use aggregate initialization instead of
calling a constructor, and added casts to unsigned.

* platform/graphics/cocoa/WebCoreDecompressionSession.h: Switched from
unsigned long to unsigned for frame counts and from long to int for
quality of service tier.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::platformMedia): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Updated for the above.

* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
Removed videoPlaybackQualityMetrics since it was overriding a derived function
without changing its behavior, and the type has changed.

* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::load): Pass two references.
(WebCore::MockMediaPlayerMediaSource::videoPlaybackQualityMetrics):
Updated return type.
* platform/mock/mediasource/MockMediaPlayerMediaSource.h: Updated for the above.

* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::create): Return a Ref, take references.
(WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Moved most data
member initialization into the class definition. Take references.
(WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate): Use a modern for loop.
(WebCore::MockMediaSourcePrivate::durationChanged): Update since m_player is a
reference.
(WebCore::MockMediaSourcePrivate::markEndOfStream): Ditto.
(WebCore::MockMediaSourcePrivate::readyState): Ditto.
(WebCore::MockMediaSourcePrivate::setReadyState): Ditto.
(WebCore::MockMediaSourcePrivate::waitForSeekCompleted): Ditto.
(WebCore::MockMediaSourcePrivate::seekCompleted): Ditto.
(WebCore::MockMediaSourcePrivate::removeSourceBuffer): Use Vector::removeFirst
instead of find/remove pairs.
(WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState): Ditto.
(WebCore::MockMediaSourcePrivate::seekToTime): Use modern for loop.
(WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics): Updated return
type, changed to use aggregate initialization instead of calling a constructor.
* platform/mock/mediasource/MockMediaSourcePrivate.h: Updated for the above.

* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::readyState): Updated since player is now
a reference.
(WebCore::MockSourceBufferPrivate::setReadyState): Ditto.

Source/WebKitLegacy/mac:

* WebView/WebVideoFullscreenController.h: Removed some unneeded includes and
forward declarations. Removed methods that don't need to be public.

* WebView/WebVideoFullscreenController.mm: Added additional includes. Removed
#if COMPILER(CLANG) since that's all we use on Mac. Moved fields into an
unnamed category in here and also replaced the HUDWindowControllerDelegate
with the unnamed category. Removed unused NSWindow category defining the
isOnActiveSpace, which is not called anywhere in this file at this time.
(-[WebVideoFullscreenController setupVideoOverlay:]): Deleted. Moved the code
into setVideoElement.
(-[WebVideoFullscreenController windowDidLoad]): Slightly rearranged the code
and removed unneeded typecast.
(-[WebVideoFullscreenController videoElement]): Updated to not rely on a
using statement at the top of the file.
(-[WebVideoFullscreenController setVideoElement:]): Added a comment about
the many side effects and special considerations that this method that sounds
like a setter has. Updated code to use the new
MediaPlayer::objCAVFoundationAVPlayer function instead of the old
HTMLVideoElement::platformMedia function. Also straightened out the logic a
bit and added some FIXME comments about small problems noticed but not fixed.
(-[WebVideoFullscreenController delegate]): Deleted. Was never called.
(-[WebVideoFullscreenController setDelegate:]): Deleted. Was never called.
(-[WebVideoFullscreenController windowDidExitFullscreen]): Removed unneeded
typecast. Removed call to updatePowerAssertions method.
(-[WebVideoFullscreenController windowDidEnterFullscreen]): Removed call to
updatePowerAssertions method.
(-[WebVideoFullscreenController updatePowerAssertions]): Deleted. This method
set _displaySleepEnabler to nullptr, but nothing was ever setting it to anything
else, so this was dead code that did nothing.
(-[WebVideoFullscreenController rateChanged:]): Removed call to
updatePowerAssertions method.

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

14 months ago[Cocoa] Improve smart pointer support for ARC (OSObjectPtr/DispatchPtr)
darin@apple.com [Tue, 5 Jun 2018 16:12:47 +0000 (16:12 +0000)]
[Cocoa] Improve smart pointer support for ARC (OSObjectPtr/DispatchPtr)
https://bugs.webkit.org/show_bug.cgi?id=186300

Reviewed by Daniel Bates.

Source/WebCore:

* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: Removed unnecessary
include of OSObjectPtr.h.
* platform/ios/WebItemProviderPasteboard.mm: Ditto.

Source/WTF:

* wtf/DispatchPtr.h: Don't call dispatch_retain or dispatch_release
since ARC will automatically do it for us in the same places we are
doing it here.

* wtf/OSObjectPtr.h:
(WTF::retainOSObject): Don't call os_retain since ARC will do it.
(WTF::releaseOSObject): Don't call os_release since ARC will do it.

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

14 months agoAX: Implement support for new blockquote, caption, and paragraph ARIA roles
jdiggs@igalia.com [Tue, 5 Jun 2018 15:55:06 +0000 (15:55 +0000)]
AX: Implement support for new blockquote, caption, and paragraph ARIA roles
https://bugs.webkit.org/show_bug.cgi?id=186274

Reviewed by Chris Fleizach.

Source/WebCore:

Add the three new ARIA roles to the internal rolemap so that they are treated in
the same fashion as their HTML element counterparts. Also ensure that an element
with an explicit caption role does not get pruned from the macOS accessibility tree.

No new tests. Instead add the roles to the existing role-exposure tests.

* accessibility/AccessibilityObject.cpp:
(WebCore::initializeRoleMap):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):

LayoutTests:

Add the three ARIA roles to the existing role-exposure tests and update
expectations accordingly. Also update several additional GTK tests because
the mapping of these ARIA roles results in new object attributes appearing
for native HTML blockquote, paragraph, and caption elements.

* accessibility/gtk/object-attributes-expected.txt:
* accessibility/gtk/xml-roles-exposed-expected.txt:
* accessibility/gtk/xml-roles-exposed.html:
* accessibility/roles-computedRoleString-expected.txt:
* accessibility/roles-computedRoleString.html:
* accessibility/roles-exposed.html:
* inspector/dom/hideHighlight-expected.txt:
* platform/gtk/accessibility/roles-computedRoleString-expected.txt:
* platform/gtk/accessibility/roles-exposed-expected.txt:
* platform/gtk/accessibility/table-one-cell-expected.txt:
* platform/mac/accessibility/roles-computedRoleString-expected.txt:
* platform/mac/accessibility/roles-exposed-expected.txt:

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

14 months ago[LFC] Merge width and margin computation for block-level, replaced elements in normal...
zalan@apple.com [Tue, 5 Jun 2018 14:05:47 +0000 (14:05 +0000)]
[LFC] Merge width and margin computation for block-level, replaced elements in normal flow
https://bugs.webkit.org/show_bug.cgi?id=186270

Reviewed by Sam Weinig.

https://www.w3.org/TR/CSS22/visudet.html#block-replaced-width
10.3.4 Block-level, replaced elements in normal flow

The used value of 'width' is determined as for inline replaced elements.
Then the rules for non-replaced block-level elements are applied to determine the margins.

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

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

14 months agoimport-w3c-tests should rely on <meta name="flags"> to detect CSS manual tests
fred.wang@free.fr [Tue, 5 Jun 2018 09:18:09 +0000 (09:18 +0000)]
import-w3c-tests should rely on <meta name="flags"> to detect CSS manual tests
https://bugs.webkit.org/show_bug.cgi?id=186261

Patch by Frederic Wang <fwang@igalia.com> on 2018-06-04
Reviewed by Youenn Fablet.

* Scripts/webkitpy/w3c/test_parser.py:
(TestParser.is_wpt_manualtest): Add code to detect whether a file is a manual test
from its <meta name="flags"> tags. This is based on SourceFile::content_is_css_manual from
the WPT repository.
* Scripts/webkitpy/w3c/test_parser_unittest.py: Add a test to verify whether files with
<meta name="flags"> are manual or non-manual according to CSS WG rules.

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

14 months ago[GStreamer][MSE] MediaPlayerPrivateGStreamerMSE.h includes and forward declares Playb...
eocanha@igalia.com [Tue, 5 Jun 2018 06:44:59 +0000 (06:44 +0000)]
[GStreamer][MSE] MediaPlayerPrivateGStreamerMSE.h includes and forward declares PlaybackPipeline
https://bugs.webkit.org/show_bug.cgi?id=186190

Reviewed by Xabier Rodriguez-Calvar.

This is just a compilation improvement.

* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:

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

14 months ago[WPE] WebDriver: stop making mandatory to provide a browser path if wpe:browserOption...
carlosgc@webkit.org [Tue, 5 Jun 2018 05:38:56 +0000 (05:38 +0000)]
[WPE] WebDriver: stop making mandatory to provide a browser path if wpe:browserOptions is present in capabilities
https://bugs.webkit.org/show_bug.cgi?id=186264

Reviewed by Žan Doberšek.

Everything should be optional. Do not consider invalid to not provide a browser binary when wpe:browserOptions
is present.

* wpe/WebDriverServiceWPE.cpp:
(WebDriver::WebDriverService::platformParseCapabilities const):

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

14 months agoFixed building ImageDiff with the default build system in the Xcode 10 developer...
mitz@apple.com [Tue, 5 Jun 2018 04:40:44 +0000 (04:40 +0000)]
Fixed building ImageDiff with the default build system in the Xcode 10 developer beta.

* ImageDiff/cg/Configurations/Base.xcconfig: Use #include? to include
  HaveInternalSDK.xcconfig, since it may not be preent.

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

14 months agoFixed building with a shared build directory with XCBuild, which is the default build...
mitz@apple.com [Tue, 5 Jun 2018 04:21:27 +0000 (04:21 +0000)]
Fixed building with a shared build directory with XCBuild, which is the default build system
in the Xcode 10 developer beta.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Changed the reference to the
  built libWTF.a to be relative to the built products directory.

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

14 months ago[Cocoa] Update more code to be more ARC-compatible to prepare for future ARC adoption
darin@apple.com [Tue, 5 Jun 2018 04:13:38 +0000 (04:13 +0000)]
[Cocoa] Update more code to be more ARC-compatible to prepare for future ARC adoption
https://bugs.webkit.org/show_bug.cgi?id=186245

Reviewed by Daniel Bates.

* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertToNSArray): Explicitly cast to WebAccessibilityObjectWrapperBase so we don't
make method calls on WebAccessibilityObjectWrapper, a forward-declared class.
(-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]): Use CFAutorelease
for the CGPathRef return value instead of Objective-C autorelease. Another option
would be to use RetainPtr for the return type instead.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXObjectIsTextMarker): Use __bridge for bridging typecast.
(AXObjectIsTextMarkerRange): Ditto.
(AXTextMarkerRange): Ditto.
(AXTextMarkerRangeStart): Ditto.
(AXTextMarkerRangeEnd): Ditto.
(isTextMarkerIgnored): Ditto.
(accessibilityObjectForTextMarker): Ditto.
(-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]): Ditto.
(-[WebAccessibilityObjectWrapper visiblePositionForTextMarker:]): Ditto.
(visiblePositionForStartOfTextMarkerRange): Ditto.
(visiblePositionForEndOfTextMarkerRange): Ditto.
(AXAttributeStringSetFont): Ditto. Also use @{} syntax to make NSDictionary
and @() to make NSNumber.
(AXAttributeStringSetColor): Use __bridge for bridging typecast, rearranging
code so that the typecasts are on function arguments, not local variables,
which makes lifetimes clearer.
(AXAttributeStringSetElement): Use __bridge for bridging typecast.
(WebTransformCGPathToNSBezierPath):
(-[WebAccessibilityObjectWrapper bezierPathFromPath:]): Added a bridging
typecast when passing an NSBezierPath through as a void* context argument;
silent conversion to void* is not compatible with ARC.
(createAccessibilityRoleMap): Use __unsafe_unretained for a table of
NSString constants.

* bindings/js/ScriptControllerMac.mm:
(WebCore::ScriptController::createScriptInstanceForWidget): Use __bridge
for bridging typecast.

* bridge/objc/objc_class.mm:
(JSC::Bindings::ObjcClass::classForIsA): Added bridging typecasts
to convert a Class into a CFTypeRef.
(JSC::Bindings::ObjcClass::methodNamed const): Use __bridge for bridging
typecast.
(JSC::Bindings::ObjcClass::fieldNamed const): Ditto.
* bridge/objc/objc_instance.mm:
(ObjcInstance::invokeObjcMethod): Ditto.
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcField::valueFromInstance const): Ditto.
(JSC::Bindings::ObjcField::setValueToInstance const): Ditto.
* bridge/objc/objc_utility.mm:
(JSC::Bindings::convertObjcValueToValue): Ditto. Also add a missing const
to make it clearer to the compiler that the code is correct.
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::createAndStoreMasterKey): Ditto.
(WebCore::findMasterKey): Ditto.
* editing/cocoa/DataDetection.mm:
(WebCore::detectItemAtPositionWithRange): Ditto.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::fontAttributesForSelectionStart const): Ditto.
* editing/cocoa/HTMLConverter.mm:
(_font): Ditto.
(fileWrapperForElement): Ditto.
* fileapi/FileCocoa.mm:
(WebCore::File::shouldReplaceFile): Ditto.
* loader/archive/cf/LegacyWebArchiveMac.mm:
(WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Ditto.
* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Ditto.
(createContentCrossfadeAnimation): Ditto.
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::localizedString): Ditto.
* platform/cocoa/SharedBufferCocoa.mm:
(WebCore::SharedBuffer::create): Ditto.
(WebCore::SharedBuffer::append): Ditto.
* platform/graphics/FontPlatformData.h:
(WebCore::toCTFont): Ditto.
(WebCore::toNSFont): Ditto.
* platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
(WebCore::assetTrackMeetsHardwareDecodeRequirements): Ditto.
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage): Ditto.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::MediaDescriptionAVFObjC::MediaDescriptionAVFObjC): Ditto.
(WebCore::bufferWasConsumedCallback): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
(WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage): Ditto.
(WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer): Ditto.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::create): Ditto.
(PlatformCALayer::platformCALayer): Ditto.
(PlatformCALayerCocoa::superlayer const): Ditto.
(PlatformCALayerCocoa::contents const): Ditto.
(PlatformCALayerCocoa::setContents): Ditto.
* platform/graphics/cocoa/IOSurface.h: Ditto.
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
(TextTrackRepresentationCocoa::update): Ditto.
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample): Ditto.
(WebCore::WebCoreDecompressionSession::resetQosTier): Ditto.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer display]): Ditto.
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::nsImage): Ditto.
(WebCore::BitmapImage::snapshotNSImage): Ditto.
* platform/graphics/mac/WebLayer.mm:
(-[WebLayer drawInContext:]): Ditto.
(-[WebSimpleLayer setNeedsDisplay]): Ditto.
(-[WebSimpleLayer setNeedsDisplayInRect:]): Ditto.
(-[WebSimpleLayer display]): Ditto.
(-[WebSimpleLayer drawInContext:]): Ditto.

* platform/mac/CursorMac.mm:
(WebCore::cursor): Mark pointer __strong to match the globals it points to.

* platform/mac/FileSystemMac.mm:
(WebCore::FileSystem::setMetadataURL): Use RetainPtr instead of autorelease.

* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::bufferForType): Use __bridge for bridging
typecast.
* platform/mac/PlatformSpeechSynthesizerMac.mm:
(WebCore::speechSynthesisGetVoiceIdentifiers): Ditto.
(WebCore::speechSynthesisGetDefaultVoiceIdentifierForLocale): Ditto.

* platform/mac/PluginBlacklist.h: Use RetainPtr instead of explicit retain
and release for NSDictionary and NSSet.
* platform/mac/PluginBlacklist.mm:
(WebCore::PluginBlacklist::create): Use __bridge for bridging typecast.
(WebCore::PluginBlacklist::~PluginBlacklist): Remove explicit CFRelease calls.
(WebCore::PluginBlacklist::PluginBlacklist): Add adoptNS calls and remove
explciit CFRetain/release pairs.

* platform/mac/PublicSuffixMac.mm:
(WebCore::isPublicSuffix): Use __bridge for bridging typecast.
* platform/mac/RemoteCommandListenerMac.mm:
(WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Ditto.
* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::jsValueWithDictionaryInContext): Ditto.
* platform/mac/URLMac.mm:
(WebCore::URL::URL): Ditto.
(WebCore::URL::createCFURL const): Ditto.

* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::collectRangesThatNeedMapping): Mark pointer __strong to match the
local variable it eventually points to.
(WebCore::stringByTrimmingWhitespace): Use __bridge for bridging typecast.
(WebCore::URLByTruncatingOneCharacterBeforeComponent): Use
CFBridgingRelease instead of autorelease, reducing typecasts.
(WebCore::URLByRemovingComponentAndSubsequentCharacter): Ditto.
(WebCore::userVisibleString): Use __bridge for bridging typecast.
(WebCore::isUserVisibleURL): Ditto.

* platform/mac/WebGLBlacklist.mm:
(WebCore::WebGLBlacklist::create): Use __bridge for bridging typecast.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setPreset): Ditto.
(WebCore::AVVideoCaptureSource::setupCaptureSession): Ditto. Also use @()
instead of NSNumber.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Ditto.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody): Ditto.

* platform/network/cocoa/ResourceResponseCocoa.mm: Use CFStringRef and
CFSTR for constant string array commonHeaderFields rather than using
NSString * and then relying on implicit bridging conversion.

* platform/network/mac/CertificateInfoMac.mm:
(WebCore::CertificateInfo::dump const): Use __bridge for bridging typecast.
* platform/network/mac/FormDataStreamMac.mm:
(WebCore::createHTTPBodyNSInputStream): Ditto.
(WebCore::httpBodyFromStream): Ditto.
* platform/network/mac/ResourceErrorMac.mm:
(WebCore::ResourceError::ResourceError): Ditto.
(WebCore::ResourceError::cfError const): Ditto.

* rendering/RenderThemeMac.mm:
(-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
Use CFSTR("") instead of @"" for a string that is passed to CFDIctionaryRef.
(WebCore::AttachmentLayout::layOutTitle): Use __bridge for bridging typecast.
(WebCore::AttachmentLayout::layOutSubtitle): Ditto.

* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::createCFURLResponseFromResponseData): Use __bridge for
bridging typecast.
(WebCoreTestSupport::supportedNonImageMIMETypes): Deleted.
(WebCoreTestSupport::convertWebResourceDataToString): Use the
MIMETypeRegistry::isSupportedNonImageMIMEType function directly instead of
building a CFArray out of MIMETypeRegistry::getSupportedNonImageMIMETypes
and using CFArrayContainsValue. This is both much more direct and much more
efficient as well.

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

14 months ago[Win] REGRESSION(r232486) 'WebCore::RenderTheme::activeListBoxSelectionBackgroundColo...
timothy@apple.com [Tue, 5 Jun 2018 04:12:47 +0000 (04:12 +0000)]
[Win] REGRESSION(r232486) 'WebCore::RenderTheme::activeListBoxSelectionBackgroundColor': function does not take 0 arguments
https://bugs.webkit.org/show_bug.cgi?id=186296

Unreviewed build fix.

* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::paint):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):

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

14 months agoRename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
cdumez@apple.com [Tue, 5 Jun 2018 04:11:49 +0000 (04:11 +0000)]
Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
https://bugs.webkit.org/show_bug.cgi?id=186287
<rdar://problem/40783352>

Reviewed by Youenn Fablet.

Source/WebCore:

Tests: http/wpt/cross-origin-window-policy/allow-postmessage-from-deny.html
       http/wpt/cross-origin-window-policy/allow-postmessage.html
       http/wpt/cross-origin-window-policy/cross-origin-window-policy-header.html
       http/wpt/cross-origin-window-policy/navigation-from-opener-via-open-target.html
       http/wpt/cross-origin-window-policy/navigation-from-subframe-via-anchor-target.html

* bindings/js/JSDOMBindingSecurity.cpp:
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginWindowPolicy):
* bindings/js/JSDOMBindingSecurity.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::effectiveCrossOriginWindowPolicyForAccess):
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::addCrossOriginWindowPropertyNames):
(WebCore::addScopedChildrenIndexes):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
(GetCrossOriginsOptionsFromExtendedAttributeValue):
(GenerateAttributeSetterBodyDefinition):
(GenerateOperationBodyDefinition):
* bindings/scripts/IDLAttributes.json:
* dom/Document.cpp:
(WebCore::Document::canNavigate):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* page/AbstractDOMWindow.cpp:
(WebCore::AbstractDOMWindow::AbstractDOMWindow):
* page/AbstractDOMWindow.h:
(WebCore::AbstractDOMWindow::crossOriginWindowPolicy):
(WebCore::AbstractDOMWindow::setCrossOriginWindowPolicy):
* page/DOMWindow.idl:
* page/Settings.yaml:
* platform/network/HTTPHeaderNames.in:
* platform/network/HTTPParsers.cpp:
(WebCore::parseCrossOriginWindowPolicyHeader):
* platform/network/HTTPParsers.h:

Source/WebKit:

* Shared/WebPreferences.yaml:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::frameBecameRemote):

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences crossOriginWindowPolicySupportEnabled]):
(-[WebPreferences setCrossOriginWindowPolicySupportEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::crossOriginWindowPolicySupportEnabled):
(WebPreferences::setCrossOriginWindowPolicySupportEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):

LayoutTests:

* http/wpt/cross-origin-options/allow-postmessage-expected.txt: Removed.
* http/wpt/cross-origin-options/allow-postmessage-from-deny-expected.txt: Removed.
* http/wpt/cross-origin-options/allow-postmessage-from-deny.html.headers: Removed.
* http/wpt/cross-origin-options/cross-origin-options-header-expected.txt: Removed.
* http/wpt/cross-origin-options/navigation-from-opener-via-open-target-expected.txt: Removed.
* http/wpt/cross-origin-options/navigation-from-subframe-via-anchor-target-expected.txt: Removed.
* http/wpt/cross-origin-options/resources/cross-origin-options-allow-postmessage-pong.html.headers: Removed.
* http/wpt/cross-origin-window-policy/allow-postmessage-expected.txt: Added.
* http/wpt/cross-origin-window-policy/allow-postmessage-from-deny-expected.txt: Added.
* http/wpt/cross-origin-window-policy/allow-postmessage-from-deny.html: Renamed from LayoutTests/http/wpt/cross-origin-options/allow-postmessage-from-deny.html.
* http/wpt/cross-origin-window-policy/allow-postmessage-from-deny.html.headers: Added.
* http/wpt/cross-origin-window-policy/allow-postmessage.html: Renamed from LayoutTests/http/wpt/cross-origin-options/allow-postmessage.html.
* http/wpt/cross-origin-window-policy/cross-origin-window-policy-header-expected.txt: Added.
* http/wpt/cross-origin-window-policy/cross-origin-window-policy-header.html: Renamed from LayoutTests/http/wpt/cross-origin-options/cross-origin-options-header.html.
* http/wpt/cross-origin-window-policy/navigation-from-opener-via-open-target-expected.txt: Added.
* http/wpt/cross-origin-window-policy/navigation-from-opener-via-open-target.html: Renamed from LayoutTests/http/wpt/cross-origin-options/navigation-from-opener-via-open-target.html.
* http/wpt/cross-origin-window-policy/navigation-from-subframe-via-anchor-target-expected.txt: Added.
* http/wpt/cross-origin-window-policy/navigation-from-subframe-via-anchor-target.html: Renamed from LayoutTests/http/wpt/cross-origin-options/navigation-from-subframe-via-anchor-target.html.
* http/wpt/cross-origin-window-policy/resources/cross-origin-window-policy-allow-postmessage-pong.html: Renamed from LayoutTests/http/wpt/cross-origin-options/resources/cross-origin-options-allow-postmessage-pong.html.
* http/wpt/cross-origin-window-policy/resources/cross-origin-window-policy-allow-postmessage-pong.html.headers: Added.
* http/wpt/cross-origin-window-policy/resources/destination.html: Renamed from LayoutTests/http/wpt/cross-origin-options/resources/destination.html.
* http/wpt/cross-origin-window-policy/resources/navigate-parent-via-anchor.html: Renamed from LayoutTests/http/wpt/cross-origin-options/resources/navigate-parent-via-anchor.html.
* http/wpt/cross-origin-window-policy/resources/navigation-from-subframe-frame.py: Renamed from LayoutTests/http/wpt/cross-origin-options/resources/navigation-from-subframe-frame.py.
(main):
* http/wpt/cross-origin-window-policy/resources/serve-cross-origin-window-policy-header.py: Renamed from LayoutTests/http/wpt/cross-origin-options/resources/serve-cross-origin-options-header.py.
(main):
* http/wpt/cross-origin-window-policy/resources/utils.js: Renamed from LayoutTests/http/wpt/cross-origin-options/resources/utils.js.

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

14 months agoTypo in MockBugzillaQueries.fetch_attachment_ids_from_review_queue()
dbates@webkit.org [Tue, 5 Jun 2018 04:04:36 +0000 (04:04 +0000)]
Typo in MockBugzillaQueries.fetch_attachment_ids_from_review_queue()
https://bugs.webkit.org/show_bug.cgi?id=186290

Reviewed by Aakash Jain.

Although the usefulness of the code in MockBugzillaQueries.fetch_attachment_ids_from_review_queue() is
questionable we should fix a typo when calling this mocked function with argument since.

* Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:
(MockBugzillaQueries.fetch_attachment_ids_from_review_queue):

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

14 months agoFixed building with the macOS Mojave seed SDK.
mitz@apple.com [Tue, 5 Jun 2018 02:52:11 +0000 (02:52 +0000)]
Fixed building with the macOS Mojave seed SDK.

* TestWebKitAPI/Tests/mac/MediaPlaybackSleepAssertion.mm:

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

14 months agoREGRESSION(r231291): InputType should hold a WeakPtr to its HTMLInputElement
bfulgham@apple.com [Tue, 5 Jun 2018 02:31:25 +0000 (02:31 +0000)]
REGRESSION(r231291): InputType should hold a WeakPtr to its HTMLInputElement
https://bugs.webkit.org/show_bug.cgi?id=186096
<rdar://problem/40651015>

Reviewed by Ryosuke Niwa.

Now that the InputType may be kept alive as part of in-flight form submissions, we
shouldn't assume that the referenced HTMLInputElement is still valid before using it.

The only time we should be lacking a referencing element is in cases where the InputType
is changing, either through a change in the HTMLInputElement's type attribute. In those
cases we should check for a valid HTMLInputElement. In other cases, we should ASSERT.

* html/BaseButtonInputType.cpp:
(WebCore::BaseButtonInputType::createInputRenderer):
(WebCore::BaseButtonInputType::setValue):
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::saveFormControlState const):
(WebCore::BaseCheckableInputType::restoreFormControlState):
(WebCore::BaseCheckableInputType::appendFormData const):
(WebCore::BaseCheckableInputType::handleKeydownEvent):
(WebCore::BaseCheckableInputType::accessKeyAction):
(WebCore::BaseCheckableInputType::setValue):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Add a nullptr check
here, since this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
* html/BaseClickableWithKeyInputType.cpp:
(WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
(WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
(WebCore::BaseClickableWithKeyInputType::accessKeyAction):
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::attributeChanged): Add a nullptr check
here, since this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
* html/BaseTextInputType.cpp:
(WebCore::BaseTextInputType::patternMismatch const):
* html/CheckboxInputType.cpp:
(WebCore::CheckboxInputType::valueMissing const):
(WebCore::CheckboxInputType::willDispatchClick):
(WebCore::CheckboxInputType::didDispatchClick):
(WebCore::CheckboxInputType::shouldAppearIndeterminate const):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::valueAsColor const):
(WebCore::ColorInputType::createShadowSubtree):
(WebCore::ColorInputType::handleDOMActivateEvent):
(WebCore::ColorInputType::didChooseColor):
(WebCore::ColorInputType::updateColorSwatch):
(WebCore::ColorInputType::shadowColorSwatch const):
(WebCore::ColorInputType::elementRectRelativeToRootView const):
(WebCore::ColorInputType::shouldShowSuggestions const):
(WebCore::ColorInputType::suggestions const):
* html/EmailInputType.cpp:
(WebCore::EmailInputType::typeMismatchFor const):
(WebCore::EmailInputType::typeMismatch const):
(WebCore::EmailInputType::typeMismatchText const):
(WebCore::EmailInputType::sanitizeValue const):
* html/FileInputType.cpp:
(WebCore::FileInputType::appendFormData const):
(WebCore::FileInputType::attributeChanged): Add a nullptr check here, since
this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
(WebCore::FileInputType::valueMissing const):
(WebCore::FileInputType::valueMissingText const):
(WebCore::FileInputType::handleDOMActivateEvent):
(WebCore::FileInputType::createInputRenderer):
(WebCore::FileInputType::setValue):
(WebCore::FileInputType::createShadowSubtree):
(WebCore::FileInputType::disabledAttributeChanged):
(WebCore::FileInputType::multipleAttributeChanged):
(WebCore::FileInputType::allowsDirectories const):
(WebCore::FileInputType::setFiles):
(WebCore::FileInputType::iconLoaded):
(WebCore::FileInputType::receiveDroppedFiles):
(WebCore::FileInputType::defaultToolTip const):
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::weakPtrFactory const):
* html/HiddenInputType.cpp:
(WebCore::HiddenInputType::saveFormControlState const):
(WebCore::HiddenInputType::restoreFormControlState):
(WebCore::HiddenInputType::setValue):
(WebCore::HiddenInputType::appendFormData const):
* html/ImageInputType.cpp:
(WebCore::ImageInputType::appendFormData const):
(WebCore::ImageInputType::handleDOMActivateEvent):
(WebCore::ImageInputType::createInputRenderer):
(WebCore::ImageInputType::altAttributeChanged):
(WebCore::ImageInputType::srcAttributeChanged):
(WebCore::ImageInputType::attach):
(WebCore::ImageInputType::height const):
(WebCore::ImageInputType::width const):
* html/InputType.cpp:
(WebCore::InputType::saveFormControlState const):
(WebCore::InputType::restoreFormControlState):
(WebCore::InputType::isFormDataAppendable const):
(WebCore::InputType::appendFormData const):
(WebCore::InputType::sizeShouldIncludeDecoration const):
(WebCore::InputType::validationMessage const):
(WebCore::InputType::createInputRenderer):
(WebCore::InputType::blur):
(WebCore::InputType::destroyShadowSubtree):
(WebCore::InputType::dispatchSimulatedClickIfActive const):
(WebCore::InputType::chrome const):
(WebCore::InputType::isKeyboardFocusable const):
(WebCore::InputType::isMouseFocusable const):
(WebCore::InputType::accessKeyAction):
(WebCore::InputType::setValue):
(WebCore::InputType::visibleValue const):
(WebCore::InputType::applyStep):
(WebCore::InputType::stepUpFromRenderer):
* html/InputType.h:
(WebCore::InputType::InputType):
(WebCore::InputType::element const):
* html/NumberInputType.cpp:
(WebCore::NumberInputType::attributeChanged): Add a nullptr check here, since
this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
(WebCore::NumberInputType::setValue):
(WebCore::NumberInputType::valueAsDouble const):
(WebCore::NumberInputType::setValueAsDouble const):
(WebCore::NumberInputType::setValueAsDecimal const):
(WebCore::NumberInputType::typeMismatch const):
(WebCore::NumberInputType::createStepRange const):
(WebCore::NumberInputType::sizeShouldIncludeDecoration const):
(WebCore::NumberInputType::decorationWidth const):
(WebCore::NumberInputType::localizeValue const):
(WebCore::NumberInputType::visibleValue const):
(WebCore::NumberInputType::convertFromVisibleValue const):
(WebCore::NumberInputType::hasBadInput const):
(WebCore::NumberInputType::minOrMaxAttributeChanged):
(WebCore::NumberInputType::stepAttributeChanged):
* html/RadioInputType.cpp:
(WebCore::RadioInputType::valueMissing const):
(WebCore::RadioInputType::handleKeydownEvent):
(WebCore::RadioInputType::handleKeyupEvent):
(WebCore::RadioInputType::isKeyboardFocusable const):
(WebCore::RadioInputType::shouldSendChangeEventAfterCheckedChanged):
(WebCore::RadioInputType::willDispatchClick):
(WebCore::RadioInputType::didDispatchClick):
(WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::attributeChanged): Add a nullptr check here, since
this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
(WebCore::RangeInputType::valueAsDouble const):
(WebCore::RangeInputType::setValueAsDecimal const):
(WebCore::RangeInputType::createStepRange const):
(WebCore::RangeInputType::handleMouseDownEvent):
(WebCore::RangeInputType::handleTouchEvent):
(WebCore::RangeInputType::handleKeydownEvent):
(WebCore::RangeInputType::createShadowSubtree):
(WebCore::RangeInputType::sliderTrackElement const):
(WebCore::RangeInputType::createInputRenderer):
(WebCore::RangeInputType::accessKeyAction):
(WebCore::RangeInputType::minOrMaxAttributeChanged):
(WebCore::RangeInputType::setValue):
(WebCore::RangeInputType::updateTickMarkValues):
* html/ResetInputType.cpp:
(WebCore::ResetInputType::handleDOMActivateEvent):
* html/SearchInputType.cpp:
(WebCore::SearchInputType::addSearchResult):
(WebCore::SearchInputType::maxResultsAttributeChanged):
(WebCore::SearchInputType::createInputRenderer):
(WebCore::SearchInputType::createShadowSubtree):
(WebCore::SearchInputType::handleKeydownEvent):
(WebCore::SearchInputType::startSearchEventTimer):
(WebCore::SearchInputType::searchEventTimerFired):
(WebCore::SearchInputType::searchEventsShouldBeDispatched const):
(WebCore::SearchInputType::didSetValueByUserEdit):
(WebCore::SearchInputType::sizeShouldIncludeDecoration const):
* html/SubmitInputType.cpp:
(WebCore::SubmitInputType::appendFormData const):
(WebCore::SubmitInputType::handleDOMActivateEvent):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::attributeChanged): Add a nullptr check here, since
this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
(WebCore::TextFieldInputType::isKeyboardFocusable const):
(WebCore::TextFieldInputType::isMouseFocusable const):
(WebCore::TextFieldInputType::valueMissing const):
(WebCore::TextFieldInputType::setValue):
(WebCore::TextFieldInputType::handleKeydownEvent):
(WebCore::TextFieldInputType::handleKeydownEventForSpinButton):
(WebCore::TextFieldInputType::forwardEvent):
(WebCore::TextFieldInputType::elementDidBlur):
(WebCore::TextFieldInputType::handleFocusEvent):
(WebCore::TextFieldInputType::handleBlurEvent):
(WebCore::TextFieldInputType::createInputRenderer):
(WebCore::TextFieldInputType::shouldHaveSpinButton const):
(WebCore::TextFieldInputType::shouldHaveCapsLockIndicator const):
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
(WebCore::TextFieldInputType::updatePlaceholderText):
(WebCore::TextFieldInputType::appendFormData const):
(WebCore::TextFieldInputType::subtreeHasChanged):
(WebCore::TextFieldInputType::didSetValueByUserEdit):
(WebCore::TextFieldInputType::updateInnerTextValue):
(WebCore::TextFieldInputType::focusAndSelectSpinButtonOwner):
(WebCore::TextFieldInputType::shouldSpinButtonRespondToMouseEvents):
(WebCore::TextFieldInputType::shouldSpinButtonRespondToWheelEvents):
(WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
(WebCore::TextFieldInputType::shouldDrawAutoFillButton const):
(WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
(WebCore::TextFieldInputType::createContainer):
(WebCore::TextFieldInputType::createAutoFillButton):
(WebCore::TextFieldInputType::updateAutoFillButton):
* html/URLInputType.cpp:
(WebCore::URLInputType::typeMismatch const):

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

14 months agoRemove missing files from JavaScriptCore Xcode project
keith_miller@apple.com [Tue, 5 Jun 2018 02:29:05 +0000 (02:29 +0000)]
Remove missing files from JavaScriptCore Xcode project
https://bugs.webkit.org/show_bug.cgi?id=186297

Reviewed by Saam Barati.

* JavaScriptCore.xcodeproj/project.pbxproj:

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

14 months agoAdd test for CoW conversions in the DFG/FTL
keith_miller@apple.com [Tue, 5 Jun 2018 02:17:18 +0000 (02:17 +0000)]
Add test for CoW conversions in the DFG/FTL
https://bugs.webkit.org/show_bug.cgi?id=186295

Reviewed by Saam Barati.

JSTests:

* stress/arrayprofile-should-not-convert-get-by-val-cow.js: Added.
(assertEq):
(withArrayArgInt32):
(withArrayLiteralInt32):
(withArrayArgDouble):
(withArrayLiteralDouble):
(withArrayArgContiguous):
(withArrayLiteralContiguous):
(test):

Source/JavaScriptCore:

Add a function to $vm that returns a JSString containing the
dataLog dump of the indexingMode of an Object.

* tools/JSDollarVM.cpp:
(JSC::functionIndexingMode):
(JSC::JSDollarVM::finishCreation):

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

14 months agoUnreviewed iOS build fix with recent SDKs.
cdumez@apple.com [Tue, 5 Jun 2018 01:45:48 +0000 (01:45 +0000)]
Unreviewed iOS build fix with recent SDKs.

* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):

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

14 months agoRestored code signing behavior when WK_USE_RESTRICTED_ENTITLEMENTS isn’t set.
mitz@apple.com [Tue, 5 Jun 2018 01:29:46 +0000 (01:29 +0000)]
Restored code signing behavior when WK_USE_RESTRICTED_ENTITLEMENTS isn’t set.

* Configurations/DebugRelease.xcconfig: Use ad-hoc code signing when
  WK_USE_RESTRICTED_ENTITLEMENTS isn’t set.

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

14 months agoRemoved a reference to a file that was deleted in r231190.
mitz@apple.com [Tue, 5 Jun 2018 01:25:14 +0000 (01:25 +0000)]
Removed a reference to a file that was deleted in r231190.

* WebKit.xcodeproj/project.pbxproj: Removed the reference to WebProcessShim.xcconfig.

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

14 months agoSet the activeLength of all ScratchBuffers to zero when exiting the VM
sbarati@apple.com [Tue, 5 Jun 2018 01:12:58 +0000 (01:12 +0000)]
Set the activeLength of all ScratchBuffers to zero when exiting the VM
https://bugs.webkit.org/show_bug.cgi?id=186284
<rdar://problem/40780738>

Reviewed by Keith Miller.

Simon recently found instances where we leak global objects from the
ScratchBuffer. Yusuke found that we forgot to set the active length
back to zero when doing catch OSR entry in the DFG/FTL. His solution
to this was adding a node that cleared the active length. This is
a good node to have, but it's not a complete solution: the DFG/FTL
could OSR exit before that node executes, which would cause us to leak
the data in it.

This patch makes it so that we set each scratch buffer's active length
to zero on VM exit. This helps prevent leaks for JS code that eventually
exits the VM (which is essentially all code on the web and all API users).

* runtime/VM.cpp:
(JSC::VM::clearScratchBuffers):
* runtime/VM.h:
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::~VMEntryScope):

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

14 months agoMade PAL build with the macOS Mojave SDK.
mitz@apple.com [Tue, 5 Jun 2018 01:03:16 +0000 (01:03 +0000)]
Made PAL build with the macOS Mojave SDK.

* pal/cf/CoreMediaSoftLink.cpp:
* pal/cf/CoreMediaSoftLink.h:

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

14 months agoMoved the corresponding expected results for the tests moved in r232430.
rniwa@webkit.org [Tue, 5 Jun 2018 00:32:36 +0000 (00:32 +0000)]
Moved the corresponding expected results for the tests moved in r232430.

* platform/ios/editing/selection/simple-line-layout-caret-is-gone-expected.txt: Moved from LayoutTests/platform/ios/editing/simple-line-layout-caret-is-gone-expected.txt.
* platform/wincairo/editing/selection/simple-line-layout-caret-is-gone-expected.txt: Moved from LayoutTests/platform/wincairo/editing/simple-line-layout-caret-is-gone-expected.txt.

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

14 months agoAR Badging on transparent thumbnail images makes the glyph look really dark
dino@apple.com [Tue, 5 Jun 2018 00:09:08 +0000 (00:09 +0000)]
AR Badging on transparent thumbnail images makes the glyph look really dark
https://bugs.webkit.org/show_bug.cgi?id=186289
<rdar://problem/40627111>

Reviewed by Anders Carlsson.

Source/WebCore:

Clip out the shape for the drop shadow, so that it isn't visible if
there is transparent pixel data on top of it.

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSystemPreviewBadge):

LayoutTests:

Update the test to exercise more background colors. Include the results for the AR badge.

* system-preview/badge-expected.html: Added.
* system-preview/badge.html:

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

14 months agoSelection color is dark when using Safari in dark mode.
timothy@apple.com [Mon, 4 Jun 2018 23:38:24 +0000 (23:38 +0000)]
Selection color is dark when using Safari in dark mode.

https://bugs.webkit.org/show_bug.cgi?id=186288
rdar://problem/38438625

Reviewed by Simon Fraser.

Pass StyleColor::Options to all of the selection color functions.
Removed supportsSelectionForegroundColors() from RenderThemeMac,
to get the default of true, since the forground colors in dark mode
can be different now. Use new semantic color methods on NSColor.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionColor const):
(WebCore::RenderElement::selectionBackgroundColor const):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::activeSelectionBackgroundColor const):
(WebCore::RenderTheme::inactiveSelectionBackgroundColor const):
(WebCore::RenderTheme::activeSelectionForegroundColor const):
(WebCore::RenderTheme::inactiveSelectionForegroundColor const):
(WebCore::RenderTheme::activeListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::activeListBoxSelectionForegroundColor const):
(WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor const):
(WebCore::RenderTheme::platformActiveSelectionBackgroundColor const):
(WebCore::RenderTheme::platformActiveSelectionForegroundColor const):
(WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderTheme::platformInactiveSelectionForegroundColor const):
(WebCore::RenderTheme::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::platformActiveListBoxSelectionForegroundColor const):
(WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::platformInactiveListBoxSelectionForegroundColor const):
* rendering/RenderTheme.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor const):
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeIOS::platformInactiveSelectionBackgroundColor const):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
* rendering/RenderThemeWin.h:

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

14 months agoUpdate Fetch code to provide more useful exception messages
cdumez@apple.com [Mon, 4 Jun 2018 23:17:52 +0000 (23:17 +0000)]
Update Fetch code to provide more useful exception messages
https://bugs.webkit.org/show_bug.cgi?id=186156

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline tests that have different output.

* web-platform-tests/fetch/api/headers/header-values-expected.txt:
* web-platform-tests/fetch/api/headers/header-values-normalize-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-network-error.https-expected.txt:

Source/WebCore:

Provide more useful error messages in our Loading / Fetch code.

* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::arrayBuffer):
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::json):
(WebCore::FetchBodyOwner::text):
* Modules/fetch/FetchHeaders.cpp:
(WebCore::canWriteHeader):
(WebCore::FetchHeaders::get const):
(WebCore::FetchHeaders::has const):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::setBody):
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::redirect):
(WebCore::FetchResponse::clone):
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
* workers/service/context/ServiceWorkerFetch.h:

Source/WebKit:

Provide more useful error messages in our Loading / Fetch code.

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::didFailFetch):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didFailFetch):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didFail):
(WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
* WebProcess/Storage/ServiceWorkerClientFetch.h:
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
(WebKit::WebServiceWorkerFetchTaskClient::didFail):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:

LayoutTests:

Rebaseline tests that have different output.

* http/tests/workers/service/basic-fetch.https-expected.txt:

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

14 months agoAdd Mojave support to WebKit tools
ap@apple.com [Mon, 4 Jun 2018 22:49:02 +0000 (22:49 +0000)]
Add Mojave support to WebKit tools
https://bugs.webkit.org/show_bug.cgi?id=186282

Reviewed by Daniel Bates.

Tools:

Nightly build support will be added separately.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/Mojave.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/Mojave@2x.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
Added dashboard support.

* BuildSlaveSupport/build.webkit.org-config/wkbuild.py:
* BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py:
Trigger the right build queues on check-in.

* Scripts/webkitpy/common/version_name_map.py:
* Scripts/webkitpy/common/version_name_map_unittest.py:
The main version mapping class updated.

* Scripts/webkitpy/layout_tests/models/test_expectations.py:
* Scripts/webkitpy/port/mac_unittest.py:
Updated for more platforms in unit tests.

* TestResultServer/static-dashboards/flakiness_dashboard.js:
Added the new platform to flakiness dashboard.

LayoutTests:

* platform/mac-mojave: Added an empty directory to avoid breaking scripts.

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

14 months agoJSLock should clear last exception when releasing the lock
keith_miller@apple.com [Mon, 4 Jun 2018 21:51:04 +0000 (21:51 +0000)]
JSLock should clear last exception when releasing the lock
https://bugs.webkit.org/show_bug.cgi?id=186277

Reviewed by Mark Lam.

If we don't clear the last exception we essentially leak the
object and everything referenced by it until another exception is
thrown.

* runtime/JSLock.cpp:
(JSC::JSLock::willReleaseLock):

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

14 months agoWeb Inspector: Cannot copy a link address in Elements tab
mattbaker@apple.com [Mon, 4 Jun 2018 21:49:50 +0000 (21:49 +0000)]
Web Inspector: Cannot copy a link address in Elements tab
https://bugs.webkit.org/show_bug.cgi?id=186281
<rdar://problem/39193355>

Reviewed by Brian Burg.

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

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

14 months agoUpdate Strong Password appearance
dbates@webkit.org [Mon, 4 Jun 2018 21:29:36 +0000 (21:29 +0000)]
Update Strong Password appearance
https://bugs.webkit.org/show_bug.cgi?id=186239
<rdar://problem/38183795>

Reviewed by Brent Fulgham.

Source/WebCore:

Fix up the gradient mask to start half-way through the visible text and size it to the
width of the visible text. Also change the color of the Strong Password label to 80% black.

We achieve sizing of the gradient to the width of the visible text by changing the CSS display
of the inner text element to be an inline-block and specifying "max-width: 100%" so that
its maximum width is less than or equal to the width of its containing block. Additionally,
only apply strong password-specific inner text element styles when the field is not disabled
or read-only and has a strong password appearance. Otherwise these styles, specifically the
display type, will adversely effect rendering of the text when the field is disabled or readonly.

* css/html.css:
(input::-webkit-strong-password-auto-fill-button):
* html/HTMLInputElement.cpp:
(WebCore::autoFillStrongPasswordMaskImage):
(WebCore::HTMLInputElement::createInnerTextStyle):

LayoutTests:

Update expected results as necessary for the change in appearance.

* platform/ios/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt:
* platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt:
* platform/mac/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt:
* platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt:

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

14 months ago[WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag
wenson_hsieh@apple.com [Mon, 4 Jun 2018 21:02:03 +0000 (21:02 +0000)]
[WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag
https://bugs.webkit.org/show_bug.cgi?id=186279

Reviewed by Tim Horton.

Source/WebCore:

Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS). No change in behavior.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::compactMode const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState):
* page/Page.cpp:
(WebCore::relevantViewRect):
* page/SettingsBase.cpp:
(WebCore::SettingsBase::defaultMinimumZoomFontSize):
(WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
* page/ViewportConfiguration.cpp:
(WebCore::platformDeviceWidthOverride):
(WebCore::shouldOverrideShrinkToFitArgument):
(WebCore::needsUpdateAfterChangingDisabledAdaptations):
* platform/LocalizedStrings.cpp:
* platform/LocalizedStrings.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
(-[WebMediaSessionHelper dealloc]):
(-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController initWithFullscreenInterface:]):
(-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController MY_NO_RETURN]):
(-[WebAVPlayerViewController isPictureInPicturePossible]):
(-[WebAVPlayerViewController isPictureInPictureActive]):
(-[WebAVPlayerViewController pictureInPictureActive]):
(-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
(-[WebAVPlayerViewController showsPlaybackControls]):
(-[WebAVPlayerViewController setShowsPlaybackControls:]):
(-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
(-[WebAVPlayerViewController setDelegate:]):
(VideoFullscreenInterfaceAVKit::setupFullscreen):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoFullscreenInterfaceAVKit::doSetup):
(WebCore::supportsPictureInPicture):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::willExitFullscreen):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:

Source/WebCore/PAL:

Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS).

* pal/cf/CoreMediaSoftLink.h:
* pal/spi/cocoa/AVKitSPI.h:

Source/WebKit:

Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS).

* Shared/WebPreferencesDefaultValues.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
* UIProcess/WebProcessProxy.cpp:
* UIProcess/WebProcessProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _willStartScrollingOrZooming]):
(-[WKContentView _didEndScrollingOrZooming]):
(-[WKContentView _startAssistingKeyboard]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView reloadContextViewForPresentedListViewController]):
(-[WKContentView _wheelChangedWithEvent:]):
(-[WKContentView _simulateTextEntered:]):
(-[WKContentView selectFormAccessoryPickerRow:]):
(-[WKContentView formInputLabel]):
(-[WKContentView setTimePickerValueToHour:minute:]):
* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView initWithFrame:]):
(-[WKScrollView addGestureRecognizer:]):
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel platformSupportsPickerViewController]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformPrefersTextLegibilityBasedZoomScaling const):

Tools:

Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS).

* TestWebKitAPI/Tests/ios/RenderingProgressTests.mm:

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

14 months agoDisable keyboard in fullscreen ios.
commit-queue@webkit.org [Mon, 4 Jun 2018 17:26:41 +0000 (17:26 +0000)]
Disable keyboard in fullscreen ios.
https://bugs.webkit.org/show_bug.cgi?id=186058

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-06-04
Reviewed by Jer Noble.

Disallow keyboard in ios fullscreen. This will still allow select keys useful for playback.

* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::supportsFullScreen):

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

14 months agoNetworkCORSPreflightChecker should set the preflight request User-Agent header
youenn@apple.com [Mon, 4 Jun 2018 17:21:17 +0000 (17:21 +0000)]
NetworkCORSPreflightChecker should set the preflight request User-Agent header
https://bugs.webkit.org/show_bug.cgi?id=186254
<rdar://problem/40293504>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/cors/cors-preflight.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight.any.js:
(corsPreflight):
* web-platform-tests/fetch/api/cors/cors-preflight.any.worker-expected.txt:
* web-platform-tests/fetch/api/resources/preflight.py:
(main):

Source/WebKit:

Some servers misbehave if the User-Agent header is not set properly on preflight requests.
Set it to the same value as the request triggering the preflight.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::startPreflight):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):

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

14 months ago[WK1] Add an option to restrict communication to localhost sockets
youenn@apple.com [Mon, 4 Jun 2018 17:20:43 +0000 (17:20 +0000)]
[WK1] Add an option to restrict communication to localhost sockets
https://bugs.webkit.org/show_bug.cgi?id=186249

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Export new symbols used for WK1.

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:

Source/WebCore:

Covered by existing tests.
Set explicitly webrtc socket IP address to 127.0.0.1 in testing mode.
For that purpose, we need WK1 to create a wrapper around a socket factory,
this wrapper being responsible of setting or not the IP address to 127.0.0.1.

* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::prepareSocketAddress):
(WebCore::BasicPacketSocketFactory::BasicPacketSocketFactory):
(WebCore::BasicPacketSocketFactory::setDisableNonLocalhostConnections):
(WebCore::BasicPacketSocketFactory::CreateClientTcpSocket):
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:

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

14 months agoRebaseline editing/style/apply-style-iframe-crash.html on Windows.
pvollan@apple.com [Mon, 4 Jun 2018 16:35:50 +0000 (16:35 +0000)]
Rebaseline editing/style/apply-style-iframe-crash.html on Windows.

Unreviewed test gardening.

* platform/win/editing/style/apply-style-iframe-crash-expected.txt: Added.

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

14 months agoRemove unnecessary MotionMark controllers
jonlee@apple.com [Mon, 4 Jun 2018 16:17:43 +0000 (16:17 +0000)]
Remove unnecessary MotionMark controllers
https://bugs.webkit.org/show_bug.cgi?id=186255

Reviewed by Said Abou-Hallawa.

Get rid of the ramp30 and the fixed-with-a-step controllers, which aren't used for testing
or debugging.

* MotionMark/developer.html: Move the "ramp" option as first, since that is the default
controller for the benchmark.
* MotionMark/resources/debug-runner/motionmark.js:
* MotionMark/resources/runner/motionmark.js: Added missing copyright notice.
* MotionMark/tests/resources/main.js:

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

14 months ago[LFC] Merge width and margin computation for block-level, non-replaced and inline...
zalan@apple.com [Mon, 4 Jun 2018 14:58:38 +0000 (14:58 +0000)]
[LFC] Merge width and margin computation for block-level, non-replaced and inline,replaced element in normal flow
https://bugs.webkit.org/show_bug.cgi?id=186225

Reviewed by Antti Koivisto.

This patch merges the width and horizontal margin computation for
https://www.w3.org/TR/CSS22/visudet.html#inline-replaced-width and https://www.w3.org/TR/CSS22/visudet.html#blockwidth

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

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

14 months ago[LFC] Merge width and horizontal margin computation
zalan@apple.com [Mon, 4 Jun 2018 14:43:57 +0000 (14:43 +0000)]
[LFC] Merge width and horizontal margin computation
https://bugs.webkit.org/show_bug.cgi?id=186217

Reviewed by Antti Koivisto.

We could certainly compute width and maring separately, but to match each steps defined
at https://www.w3.org/TR/CSS22/visudet.html, we should just merge width and horizontal margin computations
(followed by height and vertical margins).
Use 0 computed marings for now.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const): Deleted.
(WebCore::Layout::FormattingContext::computeFloatingWidth const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
(WebCore::Layout::outOfFlowNonReplacedWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth): Deleted.
(WebCore::Layout::floatingNonReplacedWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth): Deleted.
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::initializeRoot):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeMargin const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidth): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::computedMargin): Deleted.
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::marginBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHasValidVerticalMargin):
(WebCore::Display::Box::setHasValidHorizontalMargin):
(WebCore::Display::Box::invalidateMargin):
(WebCore::Display::Box::setHorizontalMargin):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::marginTop const):
(WebCore::Display::Box::marginLeft const):
(WebCore::Display::Box::marginBottom const):
(WebCore::Display::Box::marginRight const):
(WebCore::Display::Box::Edges::Edges): Deleted.
(WebCore::Display::Box::setHasValidMargin): Deleted.
(WebCore::Display::Box::setMargin): Deleted.

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

14 months agoUnreviewed WPE gardening.
zandobersek@gmail.com [Mon, 4 Jun 2018 10:19:06 +0000 (10:19 +0000)]
Unreviewed WPE gardening.

Adding platform-specific baselines for three http/tests/cache/ tests.
Updating baseline for the security/block-test.html test.
Adding failure expectations for a few other failures, linking to existing bugs.

* platform/wpe/TestExpectations:
* platform/wpe/http/tests/cache: Added.
* platform/wpe/http/tests/cache/disk-cache: Added.
* platform/wpe/http/tests/cache/disk-cache/redirect-chain-limits-expected.txt: Added.
* platform/wpe/http/tests/cache/iframe-304-crash-expected.txt: Added.
* platform/wpe/http/tests/cache/network-error-during-revalidation-expected.txt: Added.
* platform/wpe/security/block-test-expected.txt:

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

14 months agoGet rid of UnconditionalFinalizers and WeakReferenceHarvesters
utatane.tea@gmail.com [Mon, 4 Jun 2018 07:42:43 +0000 (07:42 +0000)]
Get rid of UnconditionalFinalizers and WeakReferenceHarvesters
https://bugs.webkit.org/show_bug.cgi?id=180248

Reviewed by Sam Weinig.

As a final step, this patch removes ListableHandler from JSC.
Nobody uses UnconditionalFinalizers and WeakReferenceHarvesters now.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/Heap.h:
* heap/ListableHandler.h: Removed.

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

14 months agoUnreviewed WPE gardening.
zandobersek@gmail.com [Mon, 4 Jun 2018 07:28:35 +0000 (07:28 +0000)]
Unreviewed WPE gardening.

Manage the W3C test failures by rebaselining what can be rebaselined, and adding
failing expectations for the rest of the failures. This mostly addresses the
new CSS Text tests that were imported lately, as well as changes in console logging.

* platform/wpe/TestExpectations:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/XMLHttpRequest/access-control-basic-cors-safelisted-request-headers-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/XMLHttpRequest/access-control-basic-get-fail-non-simple-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/XMLHttpRequest/access-control-basic-post-with-non-cors-safelisted-content-type-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-infinite-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-infinite-sync-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-network-error-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-network-error-sync-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/css: Added.
* platform/wpe/imported/w3c/web-platform-tests/css/css-text: Added.
* platform/wpe/imported/w3c/web-platform-tests/css/css-text/white-space: Added.
* platform/wpe/imported/w3c/web-platform-tests/css/css-text/white-space/seg-break-transformation-001-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/css/css-text/white-space/seg-break-transformation-004-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/css/css-text/white-space/seg-break-transformation-016-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/css/css-text/white-space/seg-break-transformation-017-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/css/css-text/white-space/white-space-collapse-002-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.any-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.any.worker-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/request/request-keepalive-quota-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/security: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/security/embedded-credentials.tentative.sub-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:

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

14 months agoLayoutTests/fast/css/parsing-css-matches-7.html always abandons its Document (disabli...
utatane.tea@gmail.com [Mon, 4 Jun 2018 04:13:42 +0000 (04:13 +0000)]
LayoutTests/fast/css/parsing-css-matches-7.html always abandons its Document (disabling JIT fixes it)
https://bugs.webkit.org/show_bug.cgi?id=186223

Reviewed by Keith Miller.

After preparing catchOSREntryBuffer, we do not clear the active length of this scratch buffer.
It makes this buffer conservative GC root, and allows it to hold GC objects unnecessarily long.

This patch introduces DFG ClearCatchLocals node, which clears catchOSREntryBuffer's active length.
We model ExtractCatchLocal and ClearCatchLocals appropriately in DFG clobberize too to make
this ClearCatchLocals valid.

The existing tests for ExtractCatchLocal just pass.

* dfg/DFGAbstractHeap.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGMayExit.cpp:
* dfg/DFGNodeType.h:
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareCatchOSREntry):
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileClearCatchLocals):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileClearCatchLocals):

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

14 months ago[Wi-Fi Assertions] Resume assertions when NetworkProcess::cancelPrepareToSuspend...
aestes@apple.com [Mon, 4 Jun 2018 04:02:20 +0000 (04:02 +0000)]
[Wi-Fi Assertions] Resume assertions when NetworkProcess::cancelPrepareToSuspend is called
https://bugs.webkit.org/show_bug.cgi?id=186247

Reviewed by Tim Horton.

Since we suspended assertions in prepareToSuspend, we need to resume them if
cancelPrepareToSuspend is called.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::cancelPrepareToSuspend):

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

14 months ago[iOS] Add a needed networking process entitlement
aestes@apple.com [Mon, 4 Jun 2018 04:01:54 +0000 (04:01 +0000)]
[iOS] Add a needed networking process entitlement
https://bugs.webkit.org/show_bug.cgi?id=186246
<rdar://problem/39578861>

Reviewed by Brent Fulgham.

Also sorted the existing entitlements.

* Configurations/Network-iOS.entitlements:

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

14 months ago[Win][MiniBrowser] Remove gMiniBrowser global variable
Hironori.Fujii@sony.com [Mon, 4 Jun 2018 03:26:15 +0000 (03:26 +0000)]
[Win][MiniBrowser] Remove gMiniBrowser global variable
https://bugs.webkit.org/show_bug.cgi?id=186134

Reviewed by Brent Fulgham.

It should not be assumed there is only one main window and one browser
window to support multiple windows properly. gMainWindow and
gMiniBrowser global variables should be removed. This change
removes gMiniBrowser.

* MiniBrowser/win/Common.cpp: Removed gMiniBrowser global variable.
* MiniBrowser/win/Common.h: Ditto.
* MiniBrowser/win/MainWindow.cpp:
(MainWindow::init):
(MainWindow::WndProc):
(EditProc): Post WM_COMMAND if the enter key is pressed in URL bar.
(MainWindow::cachesDialogProc): Renamed from Caches.
(MainWindow::customUserAgentDialogProc): Renamed from CustomUserAgent.
(MainWindow::onURLBarEnter): Extracted from EditProc.
(BackButtonProc): Deleted.
(ForwardButtonProc): Deleted.
(Caches): Renamed to MainWindow::cachesDialogProc.
(CustomUserAgent): Renamed to MainWindow::customUserAgentDialogProc.
* MiniBrowser/win/MainWindow.h: Convert hCacheWnd global variable to a member variable of MainWindow.
* MiniBrowser/win/MiniBrowserLibResource.h:
* MiniBrowser/win/WinMain.cpp:
(wWinMain):

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

14 months agoMore unreviewed GTK test gardening
mcatanzaro@igalia.com [Mon, 4 Jun 2018 02:44:18 +0000 (02:44 +0000)]
More unreviewed GTK test gardening

* platform/gtk/TestExpectations:

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

14 months agoUnreviewed GTK test expectations gardening
mcatanzaro@igalia.com [Sun, 3 Jun 2018 23:14:36 +0000 (23:14 +0000)]
Unreviewed GTK test expectations gardening

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/gtk/editing/selection/simple-line-layout-caret-is-gone-expected.txt: Renamed from LayoutTests/platform/gtk/editing/simple-line-layout-caret-is-gone-expected.txt.
* platform/gtk/editing/style/apply-style-iframe-crash-expected.txt: Renamed from LayoutTests/platform/gtk/editing/apply-style-iframe-crash-expected.txt.

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

14 months agoREGRESSION(r232338): [GTK] Broke a few layout tests
mcatanzaro@igalia.com [Sun, 3 Jun 2018 22:24:18 +0000 (22:24 +0000)]
REGRESSION(r232338): [GTK] Broke a few layout tests
https://bugs.webkit.org/show_bug.cgi?id=186244

Unreviewed, also rollout r232392.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::adjustListboxStyle const): Deleted.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::adjustListboxStyle const): Deleted.
* rendering/RenderThemeGtk.h:

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

14 months agoREGRESSION(r232338): [GTK] Broke a few layout tests
mcatanzaro@igalia.com [Sun, 3 Jun 2018 22:15:21 +0000 (22:15 +0000)]
REGRESSION(r232338): [GTK] Broke a few layout tests
https://bugs.webkit.org/show_bug.cgi?id=186244

Unreviewed, rollout r232338.

* platform/gtk/RenderThemeGadget.cpp:
(WebCore::RenderThemeGadget::RenderThemeGadget):
(WebCore::baseStyleContext): Deleted.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::adjustButtonStyle const):
(WebCore::RenderThemeGtk::adjustTextFieldStyle const):
(WebCore::RenderThemeGtk::adjustSearchFieldStyle const):
(WebCore::styleColor):
(WebCore::RenderThemeGtk::adjustTextAreaStyle const): Deleted.
* rendering/RenderThemeGtk.h:

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

14 months ago[iOS] MediaPlayer.framework is not always available
eric.carlson@apple.com [Sun, 3 Jun 2018 20:22:05 +0000 (20:22 +0000)]
[iOS] MediaPlayer.framework is not always available
https://bugs.webkit.org/show_bug.cgi?id=186220
<rdar://problem/40571286>

Reviewed by Tim Horton.

* platform/ios/RemoteCommandListenerIOS.mm:
(WebCore::RemoteCommandListener::create):

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

14 months ago[Cocoa] Update some code to be more ARC-compatible to prepare for future ARC adoption
darin@apple.com [Sun, 3 Jun 2018 19:46:17 +0000 (19:46 +0000)]
[Cocoa] Update some code to be more ARC-compatible to prepare for future ARC adoption
https://bugs.webkit.org/show_bug.cgi?id=186227

Reviewed by Dan Bernstein.

Source/JavaScriptCore:

* API/JSContext.mm:
(-[JSContext name]): Use CFBridgingRelease instead of autorelease.
* API/JSValue.mm:
(valueToObjectWithoutCopy): Use CFBridgingRelease instead of autorelease.
(containerValueToObject): Use adoptCF instead of autorelease. This is not only more
ARC-compatible, but more efficient.
(valueToString): Use CFBridgingRelease instead of autorelease.

Source/WebCore:

* bridge/objc/objc_instance.mm:
(ObjcInstance::~ObjcInstance): Use @autoreleasepool instead of NSAutoreleasePool.
* platform/ios/wak/WAKView.mm:
(-[WAKView _appendDescriptionToString:atLevel:]): Ditto.

Source/WebKitLegacy/mac:

* Misc/WebKitErrors.m:
(+[NSError _registerWebKitErrors]): Use @autoreleasepool instead of NSAutoreleasePool.
* Plugins/WebPluginDatabase.mm:
(-[WebPluginDatabase refresh]): Ditto.
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::setStatusbarText): Ditto.

Tools:

* DumpRenderTree/mac/AccessibilityCommonMac.mm:
(+[NSString stringWithJSStringRef:]): Use CFBridgingRelease instead of autorelease.
(-[NSString createJSStringRef]): Add __bridge to a bridging typecast.

* DumpRenderTree/mac/AccessibilityControllerMac.mm: Add a missing include.

* DumpRenderTree/mac/AccessibilityNotificationHandler.mm:
(-[NSString createJSStringRef]): Add __bridge to a bridging typecast.
* DumpRenderTree/mac/AccessibilityTextMarkerMac.mm:
(AccessibilityTextMarker::isEqual): Ditto.
(AccessibilityTextMarkerRange::isEqual): Ditto.

* DumpRenderTree/mac/DumpRenderTree.mm:
(-[DumpRenderTree _waitForWebThread]): Use @autoreleasepool instead of NSAutoreleasePool.
(DumpRenderTreeMain): Ditto.
(WebThreadLockAfterDelegateCallbacksHaveCompleted): Ditto.
(runTest): Ditto.

* DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:
(copyFile): Use a std::pair to return both a URL and an error rather than using an
out argument for the NSError.
(-[DumpRenderTreeFilePromiseReceiver receivePromisedFilesAtDestination:options:operationQueue:reader:]):
Updated for the above change.

* DumpRenderTree/mac/DumpRenderTreeWindow.mm:
(-[DumpRenderTreeWindow _addToOpenWindows]): Add __bridge to a bridging typecast.
(-[DumpRenderTreeWindow close]): Ditto.
* DumpRenderTree/mac/LayoutTestHelper.m:
(setDisplayColorProfile): Ditto.

* DumpRenderTree/mac/PolicyDelegate.mm: Add a missing include.

* DumpRenderTree/mac/ResourceLoadDelegate.mm:
(-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
Add __bridge to a bridging typecast.
* DumpRenderTree/mac/TestRunnerMac.mm:
(-[APITestDelegateIPhone initWithTestRunner:utf8Data:baseURL:]): Ditto.
(TestRunner::apiTestNewWindowDataLoadBaseURL): Use @autoreleasepool instead of NSAutoreleasePool.

* DumpRenderTree/mac/TextInputControllerMac.m: Fix a comment.

* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::replaceTextAtRange): Add __bridge to a bridging typecast.
(WTR::UIScriptController::contentsOfUserInterfaceItem const): Ditto.
(WTR::UIScriptController::overridePreference): Ditto.
* DumpRenderTree/mac/WorkQueueItemMac.mm:
(LoadItem::invoke const): Ditto.
(LoadHTMLStringItem::invoke const): Ditto.
(ScriptItem::invoke const): Ditto.

* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(+[NSString stringWithJSStringRef:]): Use CFBridgingRelease instead of autorelease.
(-[NSString createJSStringRef]): Add __bridge to a bridging typecast.

* WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm:
(+[NSString stringWithJSStringRef:]): Use CFBridgingRelease instead of autorelease.
(-[NSString createJSStringRef]): Add __bridge to a bridging typecast.

* WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:
(WTR::AccessibilityController::accessibleElementById): Add __bridge to a bridging typecast.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
(-[NSString createJSStringRef]): Ditto.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm:
(WTR::AccessibilityTextMarker::isEqual): Ditto.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm:
(WTR::AccessibilityTextMarkerRange::isEqual): Ditto.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::setSelectedVisibleTextRange): Ditto.
(WTR::AccessibilityUIElement::lineTextMarkerRangeForTextMarker): Ditto.
(WTR::AccessibilityUIElement::textMarkerRangeLength): Ditto.
(WTR::AccessibilityUIElement::previousTextMarker): Ditto.
(WTR::AccessibilityUIElement::nextTextMarker): Ditto.
(WTR::AccessibilityUIElement::stringForTextMarkerRange): Ditto.
(WTR::AccessibilityUIElement::textMarkerRangeForMarkers): Ditto.
(WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange): Ditto.
(WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange): Ditto.
(WTR::AccessibilityUIElement::accessibilityElementForTextMarker): Ditto.
(WTR::createJSStringRef): Ditto.
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute): Ditto.
(WTR::AccessibilityUIElement::indexForTextMarker): Ditto.
(WTR::AccessibilityUIElement::isTextMarkerValid): Ditto.
(WTR::AccessibilityUIElement::leftWordTextMarkerRangeForTextMarker): Ditto.
(WTR::AccessibilityUIElement::rightWordTextMarkerRangeForTextMarker): Ditto.
(WTR::AccessibilityUIElement::previousWordStartTextMarkerForTextMarker): Ditto.
(WTR::AccessibilityUIElement::nextWordEndTextMarkerForTextMarker): Ditto.
(WTR::AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker): Ditto.
(WTR::AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker): Ditto.
(WTR::AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker): Ditto.
(WTR::AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker): Ditto.
(WTR::AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker): Ditto.
(WTR::AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker): Ditto.
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration): Ditto.
(WTR::TestController::platformContext): Ditto.
(WTR::TestController::platformPreferences): Ditto.
(WTR::TestController::platformAdjustContext): Ditto.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView): Ditto.
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::initializeInjectedBundlePath): Ditto.
(WTR::TestController::initializeTestPluginDirectory): Ditto.
(WTR::TestController::platformConfigureViewForTest): Ditto.

* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::nsString): Use CFBridgingRelease instead of autorelease.
(WTR::UIScriptController::platformPlayBackEventStream): Add __bridge to a bridging
typecast.

* WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm: Add a missing include.

* WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm:
(-[LocalPasteboard setPropertyList:forType:]): Add _bridge to a bridging typecast.
(-[LocalPasteboard setString:forType:]): Ditto.

* WebKitTestRunner/mac/main.mm:
(main): Use @autoreleasepool instead of NSAutoreleasePool.

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

14 months agoMake sure that the fencePort received over IPC has the expected disposition (SEND)
bfulgham@apple.com [Sun, 3 Jun 2018 18:28:07 +0000 (18:28 +0000)]
Make sure that the fencePort received over IPC has the expected disposition (SEND)
https://bugs.webkit.org/show_bug.cgi?id=186211
<rdar://problem/37814171>

Reviewed by Geoffrey Garen.

It is possible (though very unlikely) for a message to be recevied that has the wrong mach port disposition.
If this happens, we shouldn't manipulate the passed mach_port_t or pass it on to other API. We already
drop messages that violate this expectation in the IPC layer, but code handling IPC::Attachment data types
are not checking this value.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setTopContentInsetFenced):
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):

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

14 months ago[WebGL] GL_EXT_robustness utilization should depend on CONTEXT_ROBUST_ACCESS value
zandobersek@gmail.com [Sun, 3 Jun 2018 17:35:41 +0000 (17:35 +0000)]
[WebGL] GL_EXT_robustness utilization should depend on CONTEXT_ROBUST_ACCESS value
https://bugs.webkit.org/show_bug.cgi?id=186187

Reviewed by Carlos Garcia Campos.

Don't utilize the GL_EXT_robustness extension for reading pixels from
the GPU if the underlying OpenGL context did not enable robust access
support upon creation. For EGL contexts, this would be done by passing
EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT and EGL_TRUE key-value pair in the
attribute list passed to eglCreateContext() (as specified in the
EGL_EXT_create_context_robustness extension), but at the moment this
capability is not utilized.

As such, on drivers that implement GL_EXT_robustness support, pixel
reads done in WebGLRenderingContextBase end up using glReadnPixels(),
but that fails to successfully read anything due to the context
rejecting such calls.

GL_EXT_robustness is specific to OpenGL ES versions, so to fix this,
Extensions3DOpenGLES overrides the isEnabled() method. That override
returns false immediately if the inherited isEnabled() implementation
returns false. Otherwise it returns true, unless the tested extension
is GL_EXT_robustness, in which case we now check that the context's
CONTEXT_ROBUST_ACCESS state value is true, meaning the context was
created with robust access support enabled.

No new tests are possible because this is optional driver-provided
functionality that Web content cannot have effect on.

* platform/graphics/Extensions3D.h:
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
(WebCore::Extensions3DOpenGLES::isEnabled):
* platform/graphics/opengl/Extensions3DOpenGLES.h:

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

14 months ago[ESNext][BigInt] Implement support for addition operations
ticaiolima@gmail.com [Sun, 3 Jun 2018 02:22:45 +0000 (02:22 +0000)]
[ESNext][BigInt] Implement support for addition operations
https://bugs.webkit.org/show_bug.cgi?id=179002

Reviewed by Yusuke Suzuki.

JSTests:

* bigIntTests.yaml:
* stress/addition-order-evaluation.js: Added.
* stress/big-int-add-wrapped-value.js: Added.
* stress/big-int-addition-basic.js: Added.
* stress/big-int-addition-jit.js: Added.
* stress/big-int-addition-memory-stress.js: Added.
* stress/big-int-addition-string-coercion.js: Added.
* stress/big-int-addition-to-primitive-precedence.js: Added.
* stress/big-int-addition-to-primitive.js: Added.
* stress/big-int-addition-type-error.js: Added.
* stress/big-int-no-conversion-to-number.js:
* stress/big-int-sub-wrapped-value.js: Added.
* stress/big-int-subtraction-basic.js: Added.
* stress/big-int-subtraction-jit.js: Added.
* stress/big-int-subtraction-type-error.js: Added.
* stress/sub-order-evaluation.js: Added.

Source/JavaScriptCore:

This patch is implementing support to BigInt Operands into binary "+"
and binary "-" operators. Right now, we have limited support to DFG
and FTL JIT layers, but we plan to fix this support in future
patches.

* jit/JITOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::parseInt):
(JSC::JSBigInt::stringToBigInt):
(JSC::JSBigInt::toString):
(JSC::JSBigInt::multiply):
(JSC::JSBigInt::divide):
(JSC::JSBigInt::remainder):
(JSC::JSBigInt::add):
(JSC::JSBigInt::sub):
(JSC::JSBigInt::absoluteAdd):
(JSC::JSBigInt::absoluteSub):
(JSC::JSBigInt::toStringGeneric):
(JSC::JSBigInt::allocateFor):
(JSC::JSBigInt::toNumber const):
(JSC::JSBigInt::getPrimitiveNumber const):
* runtime/JSBigInt.h:
* runtime/JSCJSValueInlines.h:
* runtime/Operations.cpp:
(JSC::jsAddSlowCase):
* runtime/Operations.h:
(JSC::jsSub):

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

14 months agorun-jsc should pass the option to use dollar vm by default
keith_miller@apple.com [Sun, 3 Jun 2018 00:49:13 +0000 (00:49 +0000)]
run-jsc should pass the option to use dollar vm by default
https://bugs.webkit.org/show_bug.cgi?id=186170

Reviewed by Yusuke Suzuki.

* Scripts/run-jsc:

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

14 months agoUnreviewed, rolling out r232275.
cdumez@apple.com [Sat, 2 Jun 2018 23:34:43 +0000 (23:34 +0000)]
Unreviewed, rolling out r232275.

May have caused a ~1% PLT regression on iOS

Reverted changeset:

"Store 0-lifetime stylesheets / scripts into the disk cache
for faster history navigations"
https://bugs.webkit.org/show_bug.cgi?id=186060
https://trac.webkit.org/changeset/232275

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

14 months agoUnreviewed, rolling out r232439.
commit-queue@webkit.org [Sat, 2 Jun 2018 23:03:36 +0000 (23:03 +0000)]
Unreviewed, rolling out r232439.
https://bugs.webkit.org/show_bug.cgi?id=186238

It breaks gtk-linux-32-release (Requested by caiolima on
#webkit).

Reverted changeset:

"[ESNext][BigInt] Implement support for addition operations"
https://bugs.webkit.org/show_bug.cgi?id=179002
https://trac.webkit.org/changeset/232439

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

14 months agoUnreviewed, rolling out r232421.
commit-queue@webkit.org [Sat, 2 Jun 2018 23:02:50 +0000 (23:02 +0000)]
Unreviewed, rolling out r232421.
https://bugs.webkit.org/show_bug.cgi?id=186240

Breaks webkitpy tests (Requested by aakashjain on #webkit).

Reverted changeset:

"Add some tests for lldb_webkit.py"
https://bugs.webkit.org/show_bug.cgi?id=183744
https://trac.webkit.org/changeset/232421

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

14 months agoBaseline op_jtrue emits an insane amount of code
utatane.tea@gmail.com [Sat, 2 Jun 2018 21:13:47 +0000 (21:13 +0000)]
Baseline op_jtrue emits an insane amount of code
https://bugs.webkit.org/show_bug.cgi?id=185708

Reviewed by Filip Pizlo.

JSTests:

* stress/logical-not-masquerades-as-undefined.js: Added.
(shouldBe):
(test):
* stress/logical-not.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

op_jtrue / op_jfalse bloats massive amount of code. This patch attempts to reduce the size of this code by,

1. op_jtrue / op_jfalse immediately jumps if the condition met. We add AssemblyHelpers::branchIf{Truthy,Falsey}
   to jump directly. This tightens the code.

2. Align our emitConvertValueToBoolean implementation to FTL's boolify function. It emits less code.

This reduces the code size of op_jtrue in x64 from 220 bytes to 164 bytes.

[  12] jtrue             arg1, 6(->18)
      0x7f233170162c: mov 0x30(%rbp), %rax
      0x7f2331701630: mov %rax, %rsi
      0x7f2331701633: xor $0x6, %rsi
      0x7f2331701637: test $0xfffffffffffffffe, %rsi
      0x7f233170163e: jnz 0x7f2331701654
      0x7f2331701644: cmp $0x7, %eax
      0x7f2331701647: setz %sil
      0x7f233170164b: movzx %sil, %esi
      0x7f233170164f: jmp 0x7f2331701705
      0x7f2331701654: test %rax, %r14
      0x7f2331701657: jz 0x7f233170169c
      0x7f233170165d: cmp %r14, %rax
      0x7f2331701660: jb 0x7f2331701675
      0x7f2331701666: test %eax, %eax
      0x7f2331701668: setnz %sil
      0x7f233170166c: movzx %sil, %esi
      0x7f2331701670: jmp 0x7f2331701705
      0x7f2331701675: lea (%r14,%rax), %rsi
      0x7f2331701679: movq %rsi, %xmm0
      0x7f233170167e: xorps %xmm1, %xmm1
      0x7f2331701681: ucomisd %xmm1, %xmm0
      0x7f2331701685: jz 0x7f2331701695
      0x7f233170168b: mov $0x1, %esi
      0x7f2331701690: jmp 0x7f2331701705
      0x7f2331701695: xor %esi, %esi
      0x7f2331701697: jmp 0x7f2331701705
      0x7f233170169c: test %rax, %r15
      0x7f233170169f: jnz 0x7f2331701703
      0x7f23317016a5: cmp $0x1, 0x5(%rax)
      0x7f23317016a9: jnz 0x7f23317016c1
      0x7f23317016af: mov 0x8(%rax), %esi
      0x7f23317016b2: test %esi, %esi
      0x7f23317016b4: setnz %sil
      0x7f23317016b8: movzx %sil, %esi
      0x7f23317016bc: jmp 0x7f2331701705
      0x7f23317016c1: test $0x1, 0x6(%rax)
      0x7f23317016c5: jz 0x7f23317016f9
      0x7f23317016cb: mov (%rax), %esi
      0x7f23317016cd: mov $0x7f23315000c8, %rdx
      0x7f23317016d7: mov (%rdx), %rdx
      0x7f23317016da: mov (%rdx,%rsi,8), %rsi
      0x7f23317016de: mov $0x7f2330de0000, %rdx
      0x7f23317016e8: cmp %rdx, 0x18(%rsi)
      0x7f23317016ec: jnz 0x7f23317016f9
      0x7f23317016f2: xor %esi, %esi
      0x7f23317016f4: jmp 0x7f2331701705
      0x7f23317016f9: mov $0x1, %esi
      0x7f23317016fe: jmp 0x7f2331701705
      0x7f2331701703: xor %esi, %esi
      0x7f2331701705: test %esi, %esi
      0x7f2331701707: jnz 0x7f233170171b

[  12] jtrue             arg1, 6(->18)
      0x7f6c8710156c: mov 0x30(%rbp), %rax
      0x7f6c87101570: test %rax, %r15
      0x7f6c87101573: jnz 0x7f6c871015c8
      0x7f6c87101579: cmp $0x1, 0x5(%rax)
      0x7f6c8710157d: jnz 0x7f6c87101592
      0x7f6c87101583: cmp $0x0, 0x8(%rax)
      0x7f6c87101587: jnz 0x7f6c87101623
      0x7f6c8710158d: jmp 0x7f6c87101615
      0x7f6c87101592: test $0x1, 0x6(%rax)
      0x7f6c87101596: jz 0x7f6c87101623
      0x7f6c8710159c: mov (%rax), %esi
      0x7f6c8710159e: mov $0x7f6c86f000e0, %rdx
      0x7f6c871015a8: mov (%rdx), %rdx
      0x7f6c871015ab: mov (%rdx,%rsi,8), %rsi
      0x7f6c871015af: mov $0x7f6c867e0000, %rdx
      0x7f6c871015b9: cmp %rdx, 0x18(%rsi)
      0x7f6c871015bd: jnz 0x7f6c87101623
      0x7f6c871015c3: jmp 0x7f6c87101615
      0x7f6c871015c8: cmp %r14, %rax
      0x7f6c871015cb: jb 0x7f6c871015de
      0x7f6c871015d1: test %eax, %eax
      0x7f6c871015d3: jnz 0x7f6c87101623
      0x7f6c871015d9: jmp 0x7f6c87101615
      0x7f6c871015de: test %rax, %r14
      0x7f6c871015e1: jz 0x7f6c87101602
      0x7f6c871015e7: lea (%r14,%rax), %rsi
      0x7f6c871015eb: movq %rsi, %xmm0
      0x7f6c871015f0: xorps %xmm1, %xmm1
      0x7f6c871015f3: ucomisd %xmm1, %xmm0
      0x7f6c871015f7: jz 0x7f6c87101615
      0x7f6c871015fd: jmp 0x7f6c87101623
      0x7f6c87101602: mov $0x7, %r11
      0x7f6c8710160c: cmp %r11, %rax
      0x7f6c8710160f: jz 0x7f6c87101623

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitBranch):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitBranch):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitConvertValueToBoolean):
(JSC::AssemblyHelpers::branchIfValue):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::branchIfTruthy):
(JSC::AssemblyHelpers::branchIfFalsey):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::addJump):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jtrue):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jtrue):

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

14 months ago[JSC] Remove WeakReferenceHarvester
utatane.tea@gmail.com [Sat, 2 Jun 2018 21:11:19 +0000 (21:11 +0000)]
[JSC] Remove WeakReferenceHarvester
https://bugs.webkit.org/show_bug.cgi?id=186102

Reviewed by Filip Pizlo.

JSTests:

* microbenchmarks/create-many-weak-map.js: Added.

Source/JavaScriptCore:

After several cleanups, now JSWeakMap becomes the last user of WeakReferenceHarvester.
Since JSWeakMap is already managed in IsoSubspace, we can iterate marked JSWeakMap
by using output constraints & Subspace iteration.

This patch removes WeakReferenceHarvester. Instead of managing this linked-list, our
output constraint set iterates marked JSWeakMap by using Subspace.

And we also add locking for JSWeakMap's rehash and output constraint visiting.

Attached microbenchmark does not show any regression.

* API/JSAPIWrapperObject.h:
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/Heap.cpp:
(JSC::Heap::endMarking):
(JSC::Heap::addCoreConstraints):
* heap/Heap.h:
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::addWeakReferenceHarvester): Deleted.
* heap/SlotVisitor.h:
* heap/WeakReferenceHarvester.h: Removed.
* runtime/WeakMapImpl.cpp:
(JSC::WeakMapImpl<WeakMapBucket>::visitChildren):
(JSC::WeakMapImpl<WeakMapBucket<WeakMapBucketDataKey>>::visitOutputConstraints):
(JSC::WeakMapImpl<WeakMapBucket<WeakMapBucketDataKeyValue>>::visitOutputConstraints):
(JSC::WeakMapImpl<WeakMapBucket<WeakMapBucketDataKey>>::visitWeakReferences): Deleted.
(JSC::WeakMapImpl<WeakMapBucket<WeakMapBucketDataKeyValue>>::visitWeakReferences): Deleted.
* runtime/WeakMapImpl.h:
(JSC::WeakMapImpl::WeakMapImpl):
(JSC::WeakMapImpl::finishCreation):
(JSC::WeakMapImpl::rehash):
(JSC::WeakMapImpl::makeAndSetNewBuffer):
(JSC::WeakMapImpl::DeadKeyCleaner::target): Deleted.

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

14 months ago[JSC] Object.create should have intrinsic
utatane.tea@gmail.com [Sat, 2 Jun 2018 21:08:10 +0000 (21:08 +0000)]
[JSC] Object.create should have intrinsic
https://bugs.webkit.org/show_bug.cgi?id=186200

Reviewed by Filip Pizlo.

JSTests:

* microbenchmarks/object-create-null.js: Added.
(test):
* microbenchmarks/object-create-unknown-object-prototype.js: Added.
(test):
* microbenchmarks/object-create-untyped-prototype.js: Added.
(test):
* stress/get-by-pname-only-prototype-properties.js: Added.
(foo):
* stress/object-create-define.js: Added.
(shouldBe):
(test):
* stress/object-create-null-external.js: Added.
(shouldBe):
(test):
* stress/object-create-null.js: Added.
(shouldBe):
(test):
* stress/object-create-prototype.js: Added.
(shouldBe):
(test):
* stress/object-create-undefined.js: Added.
(shouldThrow):
(i.shouldThrow):

Source/JavaScriptCore:

Object.create is used in various JS code. `Object.create(null)` is particularly used
to create empty plain object with null [[Prototype]]. We can find `Object.create(null)`
call in ARES-6/Babylon code.

This patch adds ObjectCreateIntrinsic to JSC. DFG recognizes it and produces ObjectCreate
DFG node. DFG AI and constant folding attempt to convert it to NewObject when prototype
object is null. It offers significant performance boost for `Object.create(null)`.

                                                 baseline                  patched

object-create-null                           53.7940+-1.5297     ^     19.8846+-0.6584        ^ definitely 2.7053x faster
object-create-unknown-object-prototype       38.9977+-1.1364     ^     37.2207+-0.6143        ^ definitely 1.0477x faster
object-create-untyped-prototype              22.5632+-0.6917           22.2539+-0.6876          might be 1.0139x faster

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToNewObject):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileObjectCreate):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileObjectCreate):
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::nullPrototypeObjectStructure const):
* runtime/ObjectConstructor.cpp:

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

14 months ago[ESNext][BigInt] Implement support for addition operations
ticaiolima@gmail.com [Sat, 2 Jun 2018 16:03:51 +0000 (16:03 +0000)]
[ESNext][BigInt] Implement support for addition operations
https://bugs.webkit.org/show_bug.cgi?id=179002

Reviewed by Yusuke Suzuki.

JSTests:

* bigIntTests.yaml:
* stress/addition-order-evaluation.js: Added.
* stress/big-int-add-wrapped-value.js: Added.
* stress/big-int-addition-basic.js: Added.
* stress/big-int-addition-jit.js: Added.
* stress/big-int-addition-memory-stress.js: Added.
* stress/big-int-addition-string-coercion.js: Added.
* stress/big-int-addition-to-primitive-precedence.js: Added.
* stress/big-int-addition-to-primitive.js: Added.
* stress/big-int-addition-type-error.js: Added.
* stress/big-int-no-conversion-to-number.js:
* stress/big-int-sub-wrapped-value.js: Added.
* stress/big-int-subtraction-basic.js: Added.
* stress/big-int-subtraction-jit.js: Added.
* stress/big-int-subtraction-type-error.js: Added.
* stress/sub-order-evaluation.js: Added.

Source/JavaScriptCore:

This patch is implementing support to BigInt Operands into binary "+"
and binary "-" operators. Right now, we have limited support to DFG
and FTL JIT layers, but we plan to fix this support in future
patches.

* jit/JITOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::parseInt):
(JSC::JSBigInt::stringToBigInt):
(JSC::JSBigInt::toString):
(JSC::JSBigInt::multiply):
(JSC::JSBigInt::divide):
(JSC::JSBigInt::remainder):
(JSC::JSBigInt::add):
(JSC::JSBigInt::sub):
(JSC::JSBigInt::absoluteAdd):
(JSC::JSBigInt::absoluteSub):
(JSC::JSBigInt::toStringGeneric):
(JSC::JSBigInt::allocateFor):
(JSC::JSBigInt::toNumber const):
(JSC::JSBigInt::getPrimitiveNumber const):
* runtime/JSBigInt.h:
* runtime/JSCJSValueInlines.h:
* runtime/Operations.cpp:
(JSC::jsAddSlowCase):
* runtime/Operations.h:
(JSC::jsSub):

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

14 months agoMake WKWebView firstResponder after entering or exiting fullscreen.
commit-queue@webkit.org [Sat, 2 Jun 2018 16:03:31 +0000 (16:03 +0000)]
Make WKWebView firstResponder after entering or exiting fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=186088
rdar://problem/40387859

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-06-02
Reviewed by Jer Noble.

Update first responder when WKWebView moves to a new window, otherwise there won't be a first responder.

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

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