WebKit-https.git
3 years agoFrameSelection::appearanceUpdateTimerFired should be robust against layout passes...
wenson_hsieh@apple.com [Thu, 29 Mar 2018 23:05:06 +0000 (23:05 +0000)]
FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
https://bugs.webkit.org/show_bug.cgi?id=183395
<rdar://problem/38055732>

Reviewed by Zalan Bujtas.

Source/WebCore:

In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
mitigation by wrapping the Frame in a Ref when firing the appearance update timer, and ensuring that layout is
really up to date before calling updateAppearanceAfterLayoutOrStyleChange() from the timer.

Test: editing/selection/iframe-update-selection-appearance.html

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::appearanceUpdateTimerFired):

LayoutTests:

Add a new layout test that passes if we didn't crash.

* editing/selection/iframe-update-selection-appearance-expected.txt: Added.
* editing/selection/iframe-update-selection-appearance.html: Added.

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

3 years agoVersioning.
jmarcell@apple.com [Thu, 29 Mar 2018 23:02:09 +0000 (23:02 +0000)]
Versioning.

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

3 years agoiOS build fix.
dino@apple.com [Thu, 29 Mar 2018 22:20:54 +0000 (22:20 +0000)]
iOS build fix.

* platform/graphics/cocoa/WebGLLayer.h:

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

3 years agoREGRESSION(r230035): ASSERT(MACH_PORT_VALID(m_sendPort)) hit in IPC::Connection:...
bfulgham@apple.com [Thu, 29 Mar 2018 21:59:54 +0000 (21:59 +0000)]
REGRESSION(r230035): ASSERT(MACH_PORT_VALID(m_sendPort)) hit in IPC::Connection::initializeSendSource()
https://bugs.webkit.org/show_bug.cgi?id=184122
<rdar://problem/39003606>

Reviewed by Chris Dumez.

One of the new assertions added in r230035 begin firing while running tests locally. This was happening
because the WebInspector was attempting to open a new connection to a web process that had already
terminated its mach port connection (a dead port).

We should avoid opening new connections when the port we were given is already dead.

* Platform/IPC/Connection.h:
(IPC::Connection::identifierIsValid): Added.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInitialize): Do not perform initialization on a dead (or null) port.
(IPC::Connection::open): Add some assertions that ports are in a valid state.
(IPC::Connection::sendOutgoingMessage): Assert that the send port is not dead.
(IPC::Connection::receiveSourceEventHandler): Assert that the receive port is valid.
* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::didFinishLaunching): Treat a dead port as a signal that the
child process failed to launch.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didFinishLaunching): Ditto.
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::didFinishLaunching): Ditto.
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::didFinishLaunching): Ditto.
* WebProcess/Plugins/PluginProcessConnectionManager.cpp:
(WebKit::PluginProcessConnectionManager::getPluginProcessConnection): Ditto.
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::establishConnection): Ditto.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureNetworkProcessConnection): Ditto.
(WebKit::WebProcess::ensureWebToStorageProcessConnection): Ditto.

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

3 years agoSubstitute ArchiveFactory::isArchiveMIMEType() for ArchiveFactory::isArchiveMimeType().
dbates@webkit.org [Thu, 29 Mar 2018 21:53:35 +0000 (21:53 +0000)]
Substitute ArchiveFactory::isArchiveMIMEType() for ArchiveFactory::isArchiveMimeType().

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitLoad):
* loader/archive/ArchiveFactory.cpp:
(WebCore::ArchiveFactory::isArchiveMIMEType):
(WebCore::ArchiveFactory::isArchiveMimeType): Deleted.
* loader/archive/ArchiveFactory.h:
* platform/MIMETypeRegistry.h:

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

3 years agoMIMETypeRegistry should return const HashSets
dbates@webkit.org [Thu, 29 Mar 2018 21:49:25 +0000 (21:49 +0000)]
MIMETypeRegistry should return const HashSets
https://bugs.webkit.org/show_bug.cgi?id=184150

Reviewed by Per Arne Vollan.

Only getSupportedNonImageMIMETypes() needs to return a non-const HashSet so that
LegacyWebKit can modify the set of non-image MIME types.

* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
(WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
(WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding):
(WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes):
(WebCore::MIMETypeRegistry::getPDFMIMETypes):
(WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
* platform/MIMETypeRegistry.h:

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

3 years agoUpdate Service Worker feature status.
beidson@apple.com [Thu, 29 Mar 2018 21:15:26 +0000 (21:15 +0000)]
Update Service Worker feature status.
https://bugs.webkit.org/show_bug.cgi?id=184139

Reviewed by Chris Dumez.

* features.json:

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

3 years agoSynchronize SecurityOrigin related scheme registries with NetworkProcess
youenn@apple.com [Thu, 29 Mar 2018 20:36:06 +0000 (20:36 +0000)]
Synchronize SecurityOrigin related scheme registries with NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=184140

Reviewed by Chris Dumez.

Add syncing of scheme registries that are used by SecurityOrigin and ContentSecurityPolicy
so that we can properly use them in NetworkProcess as we do in WebProcess.
The registries that are not synced are:
- URLSchemeAsEmptyDocument
- URLSchemeDomainRelaxationForbidden
- URLSchemeAsCachePartitioned
- URLSchemeAsCanDisplayOnlyIfCanRequest

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::registerURLSchemeAsSecure const):
(WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
(WebKit::NetworkProcess::registerURLSchemeAsLocal const):
(WebKit::NetworkProcess::registerURLSchemeAsNoAccess const):
(WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const):
(WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const):
(WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::registerURLSchemeAsSecure):
(WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
(WebKit::WebProcessPool::registerURLSchemeAsLocal):
(WebKit::WebProcessPool::registerURLSchemeAsNoAccess):
(WebKit::WebProcessPool::registerURLSchemeAsDisplayIsolated):
(WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled):
(WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):

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

3 years agoArrayMode should not try to get the DFG to think it can convert TypedArrays
keith_miller@apple.com [Thu, 29 Mar 2018 19:09:01 +0000 (19:09 +0000)]
ArrayMode should not try to get the DFG to think it can convert TypedArrays
https://bugs.webkit.org/show_bug.cgi?id=184137

Reviewed by Saam Barati.

* dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::fromObserved):

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

3 years agoDrop DOMWindow::frames() / DOMWindow::window() methods
cdumez@apple.com [Thu, 29 Mar 2018 16:52:33 +0000 (16:52 +0000)]
Drop DOMWindow::frames() / DOMWindow::window() methods
https://bugs.webkit.org/show_bug.cgi?id=184112

Reviewed by Daniel Bates.

Drop DOMWindow::frames() / DOMWindow::window() methods as they are just aliases for DOMWindow::self().

* page/DOMWindow.h:
* page/DOMWindow.idl:

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

3 years agoREGRESSION(r229480): ERROR: Unhandled web process message 'WebCookieManager:SetHTTPCo...
bfulgham@apple.com [Thu, 29 Mar 2018 16:28:03 +0000 (16:28 +0000)]
REGRESSION(r229480): ERROR: Unhandled web process message 'WebCookieManager:SetHTTPCookieAcceptPolicy'
https://bugs.webkit.org/show_bug.cgi?id=184124
<rdar://problem/38998971>

Reviewed by Chris Dumez.

Cookie accept policy messages were still being sent to the WebContent process after
I removed cookie access in r229480. The WebContent process no longer recognizes these
messages, and generates logging to that effect.

This patch stops sending these unnecessary messages to the WebContent process. Only the
Network process needs to receive this information.

* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):

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

3 years ago[LayoutReloaded] Decouple formatting state and context lifetime.
zalan@apple.com [Thu, 29 Mar 2018 15:38:54 +0000 (15:38 +0000)]
[LayoutReloaded] Decouple formatting state and context lifetime.
https://bugs.webkit.org/show_bug.cgi?id=184136

Reviewed by Antti Koivisto.

FormattingContext is about the layout logic. We don't need to hold on to it.

* LayoutReloaded/FormattingContext/FloatingContext.js:
(FloatingContext):
(FloatingContext.prototype.computePosition):
(FloatingContext.prototype._positionForClear):
(FloatingContext.prototype._computePositionToAvoidIntrudingFloats):
(FloatingContext.prototype._addFloatingBox):
(FloatingContext.prototype._formattingContext):
(FloatingContext.prototype._formattingState):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext):
* LayoutReloaded/FormattingState/BlockFormattingState.js:
(BlockFormattingState):
* LayoutReloaded/FormattingState/FloatingState.js:
(FloatingState):
(FloatingState.prototype.addFloating):
(FloatingState.prototype.formattingState):
(FloatingState.prototype.formattingContext): Deleted.
* LayoutReloaded/FormattingState/FormattingState.js:
(FormattingState):
(FormattingState.prototype.formattingContext): Deleted.
* LayoutReloaded/FormattingState/InlineFormattingState.js:
(InlineFormattingState):
* LayoutReloaded/LayoutState.js:
(LayoutState.prototype.layout):
(LayoutState.prototype.formattingContext):

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

3 years ago[WPE] Floating point exception in WebEventFactory::createWebWheelEvent
commit-queue@webkit.org [Thu, 29 Mar 2018 15:38:29 +0000 (15:38 +0000)]
[WPE] Floating point exception in WebEventFactory::createWebWheelEvent
https://bugs.webkit.org/show_bug.cgi?id=184037

Patch by Carlos Eduardo Ramalho <cadubentzen@gmail.com> on 2018-03-29
Reviewed by Žan Doberšek.

* Shared/wpe/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebWheelEvent): Use std::copysign() to avoid division by 0.

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

3 years ago[l10n] [pt_BR] Updated Brazilian Portuguese translation
mcatanzaro@igalia.com [Thu, 29 Mar 2018 15:01:48 +0000 (15:01 +0000)]
[l10n] [pt_BR] Updated Brazilian Portuguese translation
https://bugs.webkit.org/show_bug.cgi?id=184132

Patch by Rafael Fontenelle <rafaelff@gnome.org> on 2018-03-29
Rubber-stamped by Michael Catanzaro.

* pt_BR.po:

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

3 years agoThe test http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html...
pvollan@apple.com [Thu, 29 Mar 2018 14:47:08 +0000 (14:47 +0000)]
The test http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html is failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=184134

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoThe test transitions/opacity-transition-zindex.html is timing out on Windows.
pvollan@apple.com [Thu, 29 Mar 2018 14:13:48 +0000 (14:13 +0000)]
The test transitions/opacity-transition-zindex.html is timing out on Windows.
https://bugs.webkit.org/show_bug.cgi?id=184133

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoUnreviewed, rolling out r230062.
commit-queue@webkit.org [Thu, 29 Mar 2018 07:34:58 +0000 (07:34 +0000)]
Unreviewed, rolling out r230062.
https://bugs.webkit.org/show_bug.cgi?id=184128

Broke mac port. web content process crashes while loading any
web page (Requested by rniwa on #webkit).

Reverted changeset:

"MSVC __forceinline slows down JSC release build fivefold
after r229391"
https://bugs.webkit.org/show_bug.cgi?id=184062
https://trac.webkit.org/changeset/230062

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

3 years ago[Web Animations] Stop using internals.pauseTransitionAtTimeOnElement() in favor of...
graouts@webkit.org [Thu, 29 Mar 2018 06:49:27 +0000 (06:49 +0000)]
[Web Animations] Stop using internals.pauseTransitionAtTimeOnElement() in favor of Web Animations API for transitions tests
https://bugs.webkit.org/show_bug.cgi?id=184097

Reviewed by Dean Jackson.

Make 55 tests opt into CSS Animations and CSS Transitions as Web Animations. These tests used the internals.pauseTransitionAtTimeOnElement()
method, but this method should be going away since the Web Animations API allows seeking and pausing. To support this, we make
transition-test-helpers.js use the Web Animations API instead of internals.pauseTransitionAtTimeOnElement() if the tests has opted
into CSS Animations and CSS Transitions as Web Animations and we know it's safe to use these APIs.

Overall, 20 of those tests used to fail with the flag on before this change.

* compositing/animation/animated-composited-inside-hidden.html:
* compositing/animation/computed-style-during-delay.html:
* compositing/reflections/nested-reflection-transition.html:
* compositing/transitions/scale-transition-no-start.html:
* compositing/transitions/singular-scale-transition.html:
* css3/calc/transitions-dependent.html:
* css3/calc/transitions.html:
* transitions/background-position-transitions.html:
* transitions/background-transitions.html:
* transitions/blendmode-transitions.html:
* transitions/border-radius-transition.html:
* transitions/clip-path-path-transitions.html:
* transitions/clip-transition.html:
* transitions/color-transition-all.html:
* transitions/color-transition-rounding.html:
* transitions/cross-fade-background-image.html:
* transitions/cubic-bezier-overflow-color.html:
* transitions/cubic-bezier-overflow-shadow.html:
* transitions/cubic-bezier-overflow-transform.html:
* transitions/default-timing-function.html:
* transitions/delay.html:
* transitions/flex-transitions.html:
* transitions/font-family-during-transition.html:
* transitions/frames-timing-function.html:
* transitions/mask-transitions.html:
* transitions/min-max-width-height-transitions.html:
* transitions/mismatched-shadow-styles.html:
* transitions/mismatched-shadow-transitions.html:
* transitions/mixed-type.html:
* transitions/move-after-transition.html:
* transitions/multiple-background-size-transitions.html:
* transitions/multiple-mask-transitions.html:
* transitions/multiple-shadow-transitions.html:
* transitions/negative-delay.html:
* transitions/opacity-transition-zindex.html:
* transitions/resources/transition-test-helpers.js:
* transitions/shape-outside-transitions.html:
* transitions/shorthand-border-transitions.html:
* transitions/shorthand-transitions.html:
* transitions/steps-timing-function.html:
* transitions/svg-layout-transition.html:
* transitions/svg-text-shadow-transition.html:
* transitions/svg-transitions.html:
* transitions/text-indent-transition.html:
* transitions/transform-op-list-match.html:
* transitions/transform-op-list-no-match.html:
* transitions/transition-end-event-rendering.html:
* transitions/transition-hit-test.html:
* transitions/transition-on-element-with-content.html:
* transitions/transition-shorthand-delay.html:
* transitions/transition-timing-function.html:
* transitions/transition-to-from-auto.html:
* transitions/transition-to-from-undefined.html:
* transitions/visited-link-color.html:
* transitions/zero-duration-in-list.html:
* transitions/zero-duration-with-non-zero-delay-start.html:

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

3 years ago[Web Animations] Implement more CSSPropertyBlendingClient methods
graouts@webkit.org [Thu, 29 Mar 2018 06:48:18 +0000 (06:48 +0000)]
[Web Animations] Implement more CSSPropertyBlendingClient methods
https://bugs.webkit.org/show_bug.cgi?id=184077

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark progressions for WPT tests.

* web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:

Source/WebCore:

We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
CSS Transitions as Web Animations feature.

We also ensure we only run a CSSAnimationController assertion in FrameView::didDestroyRenderTree() if
we're not using the CSS Animations and CSS Transitions as Web Animations feature.

* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
(WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
(WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
(WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
(WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
* animation/KeyframeEffectReadOnly.h:
* page/FrameView.cpp:
(WebCore::FrameView::didDestroyRenderTree):

LayoutTests:

Make 31 tests opt into the CSS Animations and CSS Transitions as Web Animations feature.

* animations/3d/replace-filling-transform.html:
* animations/additive-transform-animations.html:
* animations/animation-direction-reverse-fill-mode-hardware.html:
* animations/combo-transform-rotate+scale.html:
* animations/simultaneous-start-transform.html:
* compositing/animation/layer-for-filling-animation.html:
* compositing/reflections/animation-inside-reflection.html:
* compositing/reflections/nested-reflection-animated.html:
* css3/filters/backdrop/animation.html:
* css3/filters/composited-during-animation.html:
* css3/filters/filter-animation-from-none-hw.html:
* css3/filters/filter-animation-from-none-multi-hw.html:
* css3/filters/filter-animation-from-none-multi.html:
* css3/filters/filter-animation-from-none.html:
* css3/filters/filter-animation-hw.html:
* css3/filters/filter-animation-multi-hw.html:
* css3/filters/filter-animation-multi.html:
* css3/filters/filter-animation.html:
* css3/masking/clip-path-animation.html:
* fast/filter-image/filter-image-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-shape-image-threshold-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-shape-margin-animation.html:
* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* transitions/clip-path-transitions.html:
* transitions/color-transition-premultiplied.html:
* transitions/cross-fade-border-image.html:
* transitions/cubic-bezier-overflow-length.html:
* transitions/cubic-bezier-overflow-svg-length.html:
* transitions/delay.html:
* transitions/longhand-vs-shorthand-initial.html:
* transitions/multiple-background-transitions.html:

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

3 years ago[LayoutReloaded] Introduce FloatingState.
zalan@apple.com [Thu, 29 Mar 2018 05:21:47 +0000 (05:21 +0000)]
[LayoutReloaded] Introduce FloatingState.
https://bugs.webkit.org/show_bug.cgi?id=184126

Reviewed by Antti Koivisto.

It holds the floating state (left/right floating stack) for a given formatting state (Block or Inline).
(FormattingState -> FloatingState/FormattingContext -> FloatingContext)

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext):
* LayoutReloaded/FormattingContext/FloatingContext.js:
(FloatingContext):
(FloatingContext.prototype.computePosition):
(FloatingContext.prototype.bottom):
(FloatingContext.prototype._positionForFloating):
(FloatingContext.prototype._positionForClear):
(FloatingContext.prototype._findInnerMostLeftAndRight):
(FloatingContext.prototype._isEmpty):
(FloatingContext.prototype._floatingState):
(FloatingContext.prototype._formattingContext):
(FloatingContext.prototype._lastFloating):
(FloatingContext.prototype._leftFloatingStack):
(FloatingContext.prototype._rightFloatingStack):
(FloatingContext.prototype._addFloating): Deleted.
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext):
* LayoutReloaded/FormattingState/BlockFormattingState.js:
(BlockFormattingState):
* LayoutReloaded/FormattingState/FloatingState.js: Copied from Tools/LayoutReloaded/FormattingState/InlineFormattingState.js.
(FloatingState):
(FloatingState.prototype.addFloating):
(FloatingState.prototype.leftFloatingStack):
(FloatingState.prototype.rightFloatingStack):
(FloatingState.prototype.lastFloating):
(FloatingState.prototype.formattingContext):
* LayoutReloaded/FormattingState/FormattingState.js:
(FormattingState):
(FormattingState.prototype.floatingState):
* LayoutReloaded/FormattingState/InlineFormattingState.js:
(InlineFormattingState):
* LayoutReloaded/test/index.html:

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

3 years agoAlign XMLHttpRequest's open() / send() / abort() with the latest specification
cdumez@apple.com [Thu, 29 Mar 2018 04:16:26 +0000 (04:16 +0000)]
Align XMLHttpRequest's open() / send() / abort() with the latest specification
https://bugs.webkit.org/show_bug.cgi?id=184108

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/XMLHttpRequest/abort-after-send-expected.txt:
* web-platform-tests/XMLHttpRequest/abort-during-open-expected.txt:
* web-platform-tests/XMLHttpRequest/abort-during-open.worker-expected.txt:
* web-platform-tests/XMLHttpRequest/abort-event-abort-expected.txt:
* web-platform-tests/XMLHttpRequest/abort-event-order-expected.txt:
* web-platform-tests/XMLHttpRequest/open-during-abort-event-expected.txt:
* web-platform-tests/XMLHttpRequest/open-during-abort-expected.txt:
* web-platform-tests/XMLHttpRequest/open-send-during-abort-expected.txt:
* web-platform-tests/XMLHttpRequest/security-consideration.sub-expected.txt:
* web-platform-tests/XMLHttpRequest/send-data-unexpected-tostring-expected.txt:
Rebaseline WPT tests that are now passing.

* web-platform-tests/XMLHttpRequest/open-during-abort-processing-expected.txt:
We now fail the test differently. Our results are consistent with Firefox. I believe this
test does not match the specification so I filed:
https://github.com/w3c/web-platform-tests/issues/10217

Source/WebCore:

Align XMLHttpRequest's open() / send() / abort() with the latest specification:
- https://xhr.spec.whatwg.org

No new tests, rebaselined existing layout tests.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):
Align with https://xhr.spec.whatwg.org/#the-open()-method:
- Change the order of some steps to match the order in the spec. In particular,
  open() no longer resets the state to UNSENT or abort any existing load when it
  fails early due to being passed a bad method.

(WebCore::XMLHttpRequest::createRequest):
Align with https://xhr.spec.whatwg.org/#the-send()-method:
- Use the simpler "upload listener flag" logic from the spec instead of our more
  complex m_uploadEventsAllowed flag. This avoids constructing a SecurityOrigin
  objects on a background thread when XHR is used inside Web Workers, which was
  not thread-safe.
- Set the upload complete flag when the request has no body as per step 9.
- After firing the loadstartEvent, return early if the state is no longer OPEN or
  if the send flag is unset, as per step 11.3.

(WebCore::XMLHttpRequest::abort):
Align with https://xhr.spec.whatwg.org/#the-abort()-method:
- Only set the state to UNSENT if the state is still DONE after firing the error
  events, as per step 3.

(WebCore::XMLHttpRequest::didSendData):
Use new "upload listener flag".

(WebCore::XMLHttpRequest::dispatchErrorEvents):
Align with https://xhr.spec.whatwg.org/#request-error-steps:
- Stop firing a progress event in case of error as this is not as per specification
  and Firefox does not fire those either.

* xml/XMLHttpRequest.h:

LayoutTests:

* http/tests/xmlhttprequest/onloadend-event-after-abort.html:
* http/tests/xmlhttprequest/onloadend-event-after-error.html:
* http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt:
* http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html:
* http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt:
Fix tests that expected a progress event before error/abort event. This is not as
per specification and those tests were also failing in Firefox.

* http/tests/xmlhttprequest/readystatechange-and-abort.html:
Fix test that expected abort() to reset state to UNSENT as this is not as per specification.
This test was failing in both Firefox and Chrome.

* http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldNotDispatchEvent.html:
Re-sync test from Blink. The test was wrongly expecting abort() to reset the state to
UNSENT.

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

3 years ago[LayoutReloaded] Convert floating left/right stack display boxes absolute to the...
zalan@apple.com [Thu, 29 Mar 2018 03:27:58 +0000 (03:27 +0000)]
[LayoutReloaded] Convert floating left/right stack display boxes absolute to the formatting context's root.
https://bugs.webkit.org/show_bug.cgi?id=184123

Reviewed by Antti Koivisto.

1. The left/right floating array should hold the Display.Box (and not the Layout.Box)
2. Clone the Display.Box and convert its rect absolute to the formatting context's root so that we
don't have to keep converting the coordinates while computing the positions.

* LayoutReloaded/DisplayTree/Box.js:
(Display.Box.prototype.clone):
(Display.Box.prototype.setRect):
* LayoutReloaded/FormattingContext/FloatingContext.js:
(FloatingContext.prototype.computePosition):
(FloatingContext.prototype._positionForFloating):
(FloatingContext.prototype._addFloating):
(FloatingContext.prototype._moveToNextVerticalPosition):
(FloatingContext.prototype._availableSpace):
(FloatingContext.prototype._findFloatingAtVerticalPosition):
(FloatingContext.prototype._adjustedFloatingPosition):
(FloatingContext.prototype._bottom):

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

3 years agoConsolidate NSColor to WebCore::Color conversion and fix system colors.
timothy@apple.com [Thu, 29 Mar 2018 02:39:35 +0000 (02:39 +0000)]
Consolidate NSColor to WebCore::Color conversion and fix system colors.

https://bugs.webkit.org/show_bug.cgi?id=184096
rdar://problem/38918925

Reviewed by Tim Horton.

Source/WebCore:

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(CreateCGColorIfDifferent): Use CGColor property on NSColor, don't manually create new CGColor.
* platform/graphics/mac/ColorMac.h:
* platform/graphics/mac/ColorMac.mm:
(WebCore::makeRGBAFromNSColor): Move pattern code from RenderThemeMac's convertNSColorToColor.
Also use nextafter for proper RGBA float conversion.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::color): Use colorFromNSColor.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Use colorFromNSColor.
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::systemColor const): Ditto.
(WebCore::paintAttachmentTitleBackground): Ditto.
(WebCore::convertNSColorToColor): Deleted.

LayoutTests:

* fast/css/apple-system-control-colors-expected.txt: Updated with rgba() colors.
* platform/mac/accessibility/content-editable-as-textarea-expected.txt: Updated with color space.

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

3 years agoThe SVGAnimatedProperty wrappers have to be detached from the referenced values befor...
said@apple.com [Thu, 29 Mar 2018 01:10:13 +0000 (01:10 +0000)]
The SVGAnimatedProperty wrappers have to be detached from the referenced values before the SVGAnimatedType is deleted
https://bugs.webkit.org/show_bug.cgi?id=183972

Reviewed by Daniel Bates.

If the SVGAnimatedType is a list type, e.g. SVGLengthListValues, the wrappers
of the animated properties have to be detached from the items in the list
before it's deleted.

* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::clearAnimatedType):

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

3 years agoMSVC __forceinline slows down JSC release build fivefold after r229391
ross.kirsling@sony.com [Thu, 29 Mar 2018 00:47:57 +0000 (00:47 +0000)]
MSVC __forceinline slows down JSC release build fivefold after r229391
https://bugs.webkit.org/show_bug.cgi?id=184062

Reviewed by Alex Christensen.

Source/JavaScriptCore:

* jit/CCallHelpers.h:
(JSC::CCallHelpers::marshallArgumentRegister):
Exempt MSVC from a single forced inline used within recursive templates.

Source/WebCore:

* platform/graphics/FormatConverter.cpp:
Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.

Source/WTF:

* wtf/Compiler.h:
Add ALWAYS_INLINE_EXCEPT_MSVC to support MSVC optimizer sensitivities.

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

3 years agoUnreviewed iOS build fix after r230060.
cdumez@apple.com [Thu, 29 Mar 2018 00:03:21 +0000 (00:03 +0000)]
Unreviewed iOS build fix after r230060.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

3 years agoUnreviewed, disable new window.open() API tests introduced in r230051 on iOS.
cdumez@apple.com [Wed, 28 Mar 2018 23:46:29 +0000 (23:46 +0000)]
Unreviewed, disable new window.open() API tests introduced in r230051 on iOS.

I will investigate if this is testable on iOS.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

3 years agoMake it possible to override the screen size
zalan@apple.com [Wed, 28 Mar 2018 23:16:50 +0000 (23:16 +0000)]
Make it possible to override the screen size
https://bugs.webkit.org/show_bug.cgi?id=184111
<rdar://problem/38972181>

Reviewed by Tim Horton.

Source/WebCore:

We just call screenSize() atm.

* page/Chrome.cpp:
(WebCore::Chrome::overrideScreenSize const):
* page/Chrome.h:
* page/ChromeClient.h:
* platform/HostWindow.h:
* platform/PlatformScreen.h:
* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenRect):
(WebCore::overrideScreenSize):

Source/WebKit:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::overrideScreenSize):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::overrideScreenSize const):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::overrideScreenSize const):

Source/WebKitLegacy/ios:

* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::overrideScreenSize const):

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

3 years ago[Win] Assertions.h: VC doesn't support GCC extension ##__VA_ARGS__
Hironori.Fujii@sony.com [Wed, 28 Mar 2018 23:14:05 +0000 (23:14 +0000)]
[Win] Assertions.h: VC doesn't support GCC extension ##__VA_ARGS__
https://bugs.webkit.org/show_bug.cgi?id=184076

Reviewed by Alex Christensen.

##__VA_ARGS__ is used to define RELEASE_LOG, RELEASE_LOG_ERROR,
RELEASE_LOG_IF, RELEASE_LOG_ERROR_IF, RELEASE_LOG_WITH_LEVEL,
RELEASE_LOG_WITH_LEVEL_IF and RELEASE_LOG_INFO_IF.

A macro using ##__VA_ARGS__,

  #define foo(format, ...) bar(format, ##__VA_ARGS__)

can be defined without ##__VA_ARGS__:

  #define foo(...) bar(__VA_ARGS__)

* wtf/Assertions.h: Use __VA_ARGS__ instead of ##__VA_ARGS__.

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

3 years agoUnreviewed, rolling out r230005.
commit-queue@webkit.org [Wed, 28 Mar 2018 23:00:51 +0000 (23:00 +0000)]
Unreviewed, rolling out r230005.
https://bugs.webkit.org/show_bug.cgi?id=184115

"it caused a huge regression on iOS" (Requested by saamyjoon
on #webkit).

Reverted changeset:

"memoryStatus() is wrong in certain testing scenarios on iOS"
https://bugs.webkit.org/show_bug.cgi?id=184050
https://trac.webkit.org/changeset/230005

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

3 years agoInclude the 'text' color keyword as a system color.
timothy@apple.com [Wed, 28 Mar 2018 22:50:45 +0000 (22:50 +0000)]
Include the 'text' color keyword as a system color.

https://bugs.webkit.org/show_bug.cgi?id=184113
rdar://problem/38779267

Reviewed by Tim Horton.

* css/StyleColor.cpp:
(WebCore::StyleColor::isColorKeyword): Don't check CSSValueMenu, it is a system color and is included.
(WebCore::StyleColor::isSystemColor): Include CSSValueText. Check CSSValueWebkitFocusRingColor in the range,
since it is immediately after CSSValueAppleSystemYellow.

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

3 years ago[iOS] Multiple select appearance doesn't update when selecting or deselecting rows...
wenson_hsieh@apple.com [Wed, 28 Mar 2018 22:03:04 +0000 (22:03 +0000)]
[iOS] Multiple select appearance doesn't update when selecting or deselecting rows in the picker view
https://bugs.webkit.org/show_bug.cgi?id=184110
<rdar://problem/38796648>

Reviewed by Tim Horton.

Source/WebCore:

HTMLSelectElement::optionSelectedByUser is invoked upon user interaction with a select menu. This currently
takes two separate codepaths, depending on whether or not the menu list appearance is being used to render the
select. If a menu list appearance is used, we call selectOption(), which updates validity, updates the element
renderer, and then dispatches a `change` event if needed.

However, if updateSelectedState() is used, we only update form validity and then dispatch the `change` event
without updating the renderer, leaving it stale.

Test: fast/forms/ios/ipad/multiple-select-updates-renderer.html

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::optionSelectedByUser):

Update the renderer after updating the DOM to reflect the selected option.

LayoutTests:

Adds a new layout test to verify that after tapping on a multiple select and choosing an option, the select's
renderer is updated to reflect its new state.

* fast/forms/ios/ipad/multiple-select-updates-renderer-expected.txt: Added.
* fast/forms/ios/ipad/multiple-select-updates-renderer.html: Added.
* resources/basic-gestures.js:

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

3 years agoSubstitute "strong password confirmation auto fill" for "strong confirmation password...
dbates@webkit.org [Wed, 28 Mar 2018 21:45:40 +0000 (21:45 +0000)]
Substitute "strong password confirmation auto fill" for "strong confirmation password auto fill"
<rdar://problem/36518856>

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::AXAutoFillStrongConfirmationPasswordLabel):

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

3 years agoMark http/tests/preload/download_resources.html as a flaky crash on Windows.
pvollan@apple.com [Wed, 28 Mar 2018 21:39:19 +0000 (21:39 +0000)]
Mark http/tests/preload/download_resources.html as a flaky crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179297

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoWebSocket cookie incorrectly stored
dbates@webkit.org [Wed, 28 Mar 2018 21:27:44 +0000 (21:27 +0000)]
WebSocket cookie incorrectly stored
https://bugs.webkit.org/show_bug.cgi?id=184100
<rdar://problem/37928715>

Reviewed by Brent Fulgham.

Source/WebCore:

A cookie received in a WebSocket response should be stored with respect to the
origin of the WebSocket server in order for it to be sent in a subsequent request.

Also removed a FIXME about implementing support for the long since
deprecated Set-Cookie2 header.

Test: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processBuffer):
* Modules/websockets/WebSocketHandshake.h:

LayoutTests:

* http/tests/websocket/tests/hybi/cookie_wsh.py: Added. Downloaded from
<https://github.com/w3c/pywebsocket/blob/b2e1d11086fdf00b33a0d30c504f227e7d4fa86b/src/example/cookie_wsh.py>.
(_add_set_cookie):
(web_socket_do_extra_handshake):
(web_socket_transfer_data):
* http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior-expected.txt: Added.
* http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html: Added.

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

3 years agoDo process swap when opening a cross-origin URL via window.open(url, '_blank', 'noope...
cdumez@apple.com [Wed, 28 Mar 2018 21:21:43 +0000 (21:21 +0000)]
Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
https://bugs.webkit.org/show_bug.cgi?id=183962
<rdar://problem/38817833>

Reviewed by Brady Eidson.

Source/WebCore:

Pass extra bits of information to the UIProcess via NavigationAction:
- Is it a cross origin navigation caused by window.open()
- Does the navigated frame have an opener

This information is useful to determine on UIProcess side if we want
to swap WebProcess.

* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::setIsCrossOriginWindowOpenNavigation):
(WebCore::FrameLoadRequest::isCrossOriginWindowOpenNavigation const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/NavigationAction.h:
(WebCore::NavigationAction::setIsCrossOriginWindowOpenNavigation):
(WebCore::NavigationAction::isCrossOriginWindowOpenNavigation const):
(WebCore::NavigationAction::setOpener):
(WebCore::NavigationAction::opener const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):

Source/WebKit:

Swap WebProcess on for the initial navigation in a new Window that was opened
via window.open(), when the new URL is cross-origin compared to the opener's
origin. For now, we only swap process if 'noopener' property is set when calling
window.open(). This is because we do not support the remote DOMWindows yet.

* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* UIProcess/API/APINavigation.h:
(API::Navigation::setIsCrossOriginWindowOpenNavigation):
(API::Navigation::isCrossOriginWindowOpenNavigation const):
(API::Navigation::setOpener):
(API::Navigation::opener const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
* UIProcess/WebProcessPool.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONUIDelegate initWithNavigationDelegate:]):
(-[PSONUIDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]):

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

3 years agoAdopt WEBPROCESS_WINDOWSERVER_BLOCKING compiler guard in WebProcess.
pvollan@apple.com [Wed, 28 Mar 2018 21:17:14 +0000 (21:17 +0000)]
Adopt WEBPROCESS_WINDOWSERVER_BLOCKING compiler guard in WebProcess.
https://bugs.webkit.org/show_bug.cgi?id=183959
<rdar://problem/38965719>

Reviewed by Brent Fulgham.

Use the compile guard to guard the call to CGSSetDenyWindowServerConnections.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeProcess):

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

3 years agoAdd Carlos Eduardo Ramalho as contributor
commit-queue@webkit.org [Wed, 28 Mar 2018 21:14:02 +0000 (21:14 +0000)]
Add Carlos Eduardo Ramalho as contributor
https://bugs.webkit.org/show_bug.cgi?id=184082

Patch by Carlos Eduardo Ramalho <cadubentzen@gmail.com> on 2018-03-28
Reviewed by Carlos Alberto Lopez Perez.

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

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

3 years agoMake it possible to disable building the tools with Make
timothy_horton@apple.com [Wed, 28 Mar 2018 21:07:55 +0000 (21:07 +0000)]
Make it possible to disable building the tools with Make
https://bugs.webkit.org/show_bug.cgi?id=184109

Reviewed by Simon Fraser.

* Makefile:

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

3 years agoUnreviewed build fix after r230045.
bfulgham@apple.com [Wed, 28 Mar 2018 21:05:37 +0000 (21:05 +0000)]
Unreviewed build fix after r230045.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm: Add missing include (breaks iOS).

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

3 years agoSkipped imported/mozilla/css-animations/test_keyframeeffect-getkeyframes.html.
jlewis3@apple.com [Wed, 28 Mar 2018 20:45:10 +0000 (20:45 +0000)]
Skipped imported/mozilla/css-animations/test_keyframeeffect-getkeyframes.html.
https://bugs.webkit.org/show_bug.cgi?id=183848

Unreviewed test gardening.

* TestExpectations:

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

3 years agoProtect against invalid mach ports returned by mach_port_request_notification
bfulgham@apple.com [Wed, 28 Mar 2018 20:43:10 +0000 (20:43 +0000)]
Protect against invalid mach ports returned by mach_port_request_notification
https://bugs.webkit.org/show_bug.cgi?id=184106
<rdar://problem/37865316>

Reviewed by Chris Dumez.

Source/WebKit:

* Platform/IPC/Connection.h:
(IPC::Connection::Identifier::Identifier): Use default initializer syntax.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open): Drive-by-fix: Include formatted mach error message in logging.
(IPC::Connection::receiveSourceEventHandler): Check return value from 'mach_port_request_notification'
and clean up if it experienced an error.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess): Ditto.

Source/WebKitLegacy/mac:

* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): Check return value from 'mach_port_request_notification'
and clean up if it experienced an error.
(WebKit::NetscapePluginHostProxy::processRequests): Drive-by-fix: Include formatted mach error message in logging.

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

3 years agoThread safety issue in IDBFactory' shouldThrowSecurityException()
cdumez@apple.com [Wed, 28 Mar 2018 20:36:03 +0000 (20:36 +0000)]
Thread safety issue in IDBFactory' shouldThrowSecurityException()
https://bugs.webkit.org/show_bug.cgi?id=184064

Reviewed by Ryosuke Niwa.

shouldThrowSecurityException() gets called on a non-main thread but
it ended up using the SchemeRegistry via SecurityOrigin::canAccessDatabase()
which calls SecurityOrigin::isLocal().

Since using the SchemeRegistry from the background thread is not safe
(we recently added locks which we're trying to remove), and since SecurityOrigin
methods are often called from background threads, this patch make SecurityOrigin::isLocal()
safe to call from a background thread. To achieve this, we now query the SchemeRegistry
in the SecurityOrigin constructor instead as SecurityOrigin objects are expected to be
constructed on the main thread.

* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::isLocal const): Deleted.
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::isLocal const):

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

3 years agoUnreviewed, rolling out r230033.
ryanhaddad@apple.com [Wed, 28 Mar 2018 20:31:29 +0000 (20:31 +0000)]
Unreviewed, rolling out r230033.

The LayoutTests modified in this change fail an assertion on
WK1.

Reverted changeset:

"[Web Animations] Implement more CSSPropertyBlendingClient
methods"
https://bugs.webkit.org/show_bug.cgi?id=184077
https://trac.webkit.org/changeset/230033

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

3 years agoWebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main...
cdumez@apple.com [Wed, 28 Mar 2018 20:17:04 +0000 (20:17 +0000)]
WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread
https://bugs.webkit.org/show_bug.cgi?id=184068

Reviewed by Youenn Fablet.

WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread,
which is not safe. We now use SecurityOriginData since we only need an origin String and
it is safe to construct a SecurityOriginData on any thread.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveMessage):

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

3 years agoWKWebViewContentProvider shouldn't be a UIScrollViewDelegate
dino@apple.com [Wed, 28 Mar 2018 20:11:47 +0000 (20:11 +0000)]
WKWebViewContentProvider shouldn't be a UIScrollViewDelegate
https://bugs.webkit.org/show_bug.cgi?id=184107
<rdar://problem/38967492>

Reviewed by Tim Horton.

There is no need for this class to be a UIScrollViewDelegate. Instead
the protocol should have an optional method that is effectively
scrollViewDidScroll.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView scrollViewDidScroll:]): Call web_scrollViewDidScroll
if it exists.
* UIProcess/Cocoa/WKWebViewContentProvider.h: Remove UIScrollViewDelegate
and add an optional web_scrollViewDidScroll.
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_scrollViewDidScroll:]): Renamed from scrollViewDidScroll.
(-[WKPDFView scrollViewDidScroll:]): Deleted.
* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView scrollViewDidScroll:]): Deleted.

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

3 years agoEnhance ARM64 probe to support pointer profiling.
mark.lam@apple.com [Wed, 28 Mar 2018 20:05:43 +0000 (20:05 +0000)]
Enhance ARM64 probe to support pointer profiling.
https://bugs.webkit.org/show_bug.cgi?id=184069
<rdar://problem/38939879>

Reviewed by JF Bastien.

* assembler/MacroAssemblerARM64.cpp:
(JSC::MacroAssembler::probe):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::popPair):
(JSC::MacroAssemblerX86Common::pushPair):
* assembler/testmasm.cpp:
(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):
* runtime/PtrTag.h:
(JSC::tagForPtr):

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

3 years ago[Extra zoom mode] Make boosted text autosizing values switchable at runtime
wenson_hsieh@apple.com [Wed, 28 Mar 2018 18:55:40 +0000 (18:55 +0000)]
[Extra zoom mode] Make boosted text autosizing values switchable at runtime
https://bugs.webkit.org/show_bug.cgi?id=184092
<rdar://problem/38939917>

Reviewed by Tim Horton.

Source/WebCore:

In r228697, we introduced a new set of boosted text autosizing constants tuned for extra zoom mode, which are
currently hard-coded as default values in SettingsBase. However, we've since identified cases where clients may
want to opt in or out of boosted text autosizing values and just use the existing values.

This replaces settings to adjust text autosizing constants with a flag to enable or disable boosted text
autosizing; when changed, we update all three text autosizing parameters to their default or boosted values, and
then trigger style recalculation.

Test: TextAutosizingBoost.ChangeAutosizingBoostAtRuntime

* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::shouldEnableTextAutosizingBoostChanged):
(WebCore::SettingsBase::defaultOneLineTextMultiplierCoefficient): Deleted.
(WebCore::SettingsBase::defaultMultiLineTextMultiplierCoefficient): Deleted.
(WebCore::SettingsBase::defaultMaxTextAutosizingScaleIncrease): Deleted.

Changed these to constant values instead of helper functions, and also introduced boosted text autosizing
constants for use in extra zoom mode.

* page/SettingsBase.h:
(WebCore::SettingsBase::oneLineTextMultiplierCoefficient const):
(WebCore::SettingsBase::multiLineTextMultiplierCoefficient const):
(WebCore::SettingsBase::maxTextAutosizingScaleIncrease const):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::extraDefaultStyleSheet):

Tweak the stylesheet to make `-webkit-text-size-adjust: auto` overridable by web content. Adding the !important
is breaking many websites that positioned text such that it is positioned within layout viewport bounds without
text autosizing.

Source/WebKit:

Add a private web view preference to switch between normal and boosted text autosizing mode. By default, we use
normal text autosizing values.

* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setShouldEnableTextAutosizingBoost:]):
(-[WKPreferences _shouldEnableTextAutosizingBoost]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

Add an API test to check that toggling the boosted text autosizing preference causes text to lay out larger than
it would with normal text autosizing.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/ios/TextAutosizingBoost.mm: Added.
(TEST):

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

3 years ago[LayoutReloaded] InlineFormattingContext::_handleText should support runs on multiple...
zalan@apple.com [Wed, 28 Mar 2018 18:40:00 +0000 (18:40 +0000)]
[LayoutReloaded] InlineFormattingContext::_handleText should support runs on multiple lines
https://bugs.webkit.org/show_bug.cgi?id=184101

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext):
(InlineFormattingContext.prototype.layout):
(InlineFormattingContext.prototype._handleText):
(InlineFormattingContext.prototype._createNewLine):
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/simple-multiline-text.html: Added.

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

3 years ago[LayoutReloaded] Add InlineTextBreaker::skipLeadingWhitespaceIfNeeded
zalan@apple.com [Wed, 28 Mar 2018 18:30:15 +0000 (18:30 +0000)]
[LayoutReloaded] Add InlineTextBreaker::skipLeadingWhitespaceIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=184099

Reviewed by Antti Koivisto.

* LayoutReloaded/misc/LayoutReloadedWebKit.patch:

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

3 years agoAvoid uninitialized mach ports
bfulgham@apple.com [Wed, 28 Mar 2018 18:07:00 +0000 (18:07 +0000)]
Avoid uninitialized mach ports
https://bugs.webkit.org/show_bug.cgi?id=184090
<rdar://problem/37261129>

Reviewed by Chris Dumez.

It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
there is a potential for us to try to use invalid ports.

We should always check return values, and ensure that the mach port variables we seek to initialize are
kept in a valid state.

Source/WebCore:

No new tests, no Web-facing behavior change.

* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::attachToAppleGraphicsControl): Initialize masterPort to a default value.

Source/WebKit:

Reviewed by Chris Dumez.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess): Initialize new port to a safe default and
check the return state of the allocation function.
* Platform/IPC/Connection.h:
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open): Ditto.
(IPC::Connection::initializeSendSource): Ditto.
(IPC::readFromMachPort): Ditto.
(IPC::Connection::receiveSourceEventHandler): Ditto.
* Platform/SharedMemory.h:
* Platform/cocoa/SharedMemoryCocoa.cpp:
(WebKit::makeMemoryEntry): Ditto.
* Platform/mac/MachUtilities.cpp:
(setMachPortQueueLength): Ditto.
(setMachExceptionPort): Ditto.
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::createWebProcessConnection): Ditto.
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::createStorageToWebProcessConnection): Ditto.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess): Ditto.
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openFrontendConnection): Ditto.

Source/WebKitLegacy/mac:

Reviewed by Chris Dumez.

* Plugins/Hosted/NetscapePluginHostManager.h:
* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::hostForPlugin): Initialize port to a valid state, ASSERT if an invalid
port is passed to an API function.
(WebKit::NetscapePluginHostManager::spawnPluginHost): Ditto.
(WebKit::NetscapePluginHostManager::initializeVendorPort): Ditto.
* Plugins/Hosted/NetscapePluginHostProxy.h:
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): Ditto.
(WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy): Ditto.
(WebKit::NetscapePluginHostProxy::processRequests): Ditto.
(WKPCStatusText): Ditto.
(WKPCLoadURL): Ditto.
(WKPCCancelLoadURL): Ditto.
(WKPCInvalidateRect): Ditto.
(WKPCGetScriptableNPObjectReply): Ditto.
(WKPCBooleanReply): Ditto.
(WKPCBooleanAndDataReply): Ditto.
(WKPCInstantiatePluginReply): Ditto.
(WKPCGetWindowNPObject): Ditto.
(WKPCGetPluginElementNPObject): Ditto.
(WKPCForgetBrowserObject): Ditto.
(WKPCEvaluate): Ditto.
(WKPCGetStringIdentifier): Ditto.
(WKPCGetIntIdentifier): Ditto.
(WKPCInvoke): Ditto.
(WKPCInvokeDefault): Ditto.
(WKPCConstruct): Ditto.
(WKPCGetProperty): Ditto.
(WKPCSetProperty): Ditto.
(WKPCRemoveProperty): Ditto.
(WKPCHasProperty): Ditto.
(WKPCHasMethod): Ditto.
(WKPCIdentifierInfo): Ditto.
(WKPCEnumerate): Ditto.
(WKPCSetMenuBarVisible): Ditto.
(WKPCSetFullscreenWindowIsShowing): Ditto.
(WKPCSetModal): Ditto.
(WKPCGetCookies): Ditto.
(WKPCGetProxy): Ditto.
(WKPCSetCookies): Ditto.
(WKPCGetAuthenticationInfo): Ditto.
(WKPCConvertPoint): Ditto.
(WKPCLayerHostingModeChanged): Ditto.
(WKPCSetException): Ditto.

Source/WTF:

Reviewed by Chris Dumez.

* wtf/Threading.h: Initialize mach port.

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

3 years agoUnreviewed GTK test gardening.
aboya@igalia.com [Wed, 28 Mar 2018 17:53:21 +0000 (17:53 +0000)]
Unreviewed GTK test gardening.
https://bugs.webkit.org/show_bug.cgi?id=184088

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/wpe/TestExpectations:

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

3 years ago[Web Animations] Implement more CSSPropertyBlendingClient methods
graouts@webkit.org [Wed, 28 Mar 2018 17:37:43 +0000 (17:37 +0000)]
[Web Animations] Implement more CSSPropertyBlendingClient methods
https://bugs.webkit.org/show_bug.cgi?id=184077

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark progressions for WPT tests.

* web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:

Source/WebCore:

We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
CSS Transitions as Web Animations feature.

* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
(WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
(WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
(WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
(WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
* animation/KeyframeEffectReadOnly.h:

LayoutTests:

Make 31 tests opt into the CSS Animations and CSS Transitions as Web Animations feature.

* animations/3d/replace-filling-transform.html:
* animations/additive-transform-animations.html:
* animations/animation-direction-reverse-fill-mode-hardware.html:
* animations/combo-transform-rotate+scale.html:
* animations/simultaneous-start-transform.html:
* compositing/animation/layer-for-filling-animation.html:
* compositing/reflections/animation-inside-reflection.html:
* compositing/reflections/nested-reflection-animated.html:
* css3/filters/backdrop/animation.html:
* css3/filters/composited-during-animation.html:
* css3/filters/filter-animation-from-none-hw.html:
* css3/filters/filter-animation-from-none-multi-hw.html:
* css3/filters/filter-animation-from-none-multi.html:
* css3/filters/filter-animation-from-none.html:
* css3/filters/filter-animation-hw.html:
* css3/filters/filter-animation-multi-hw.html:
* css3/filters/filter-animation-multi.html:
* css3/filters/filter-animation.html:
* css3/masking/clip-path-animation.html:
* fast/filter-image/filter-image-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-shape-image-threshold-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-shape-margin-animation.html:
* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* transitions/clip-path-transitions.html:
* transitions/color-transition-premultiplied.html:
* transitions/cross-fade-border-image.html:
* transitions/cubic-bezier-overflow-length.html:
* transitions/cubic-bezier-overflow-svg-length.html:
* transitions/delay.html:
* transitions/longhand-vs-shorthand-initial.html:
* transitions/multiple-background-transitions.html:

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

3 years agoFails to build webkitgtk+ after git-svn-id: http://svn.webkit.org/repository/webkit...
mcatanzaro@igalia.com [Wed, 28 Mar 2018 16:52:58 +0000 (16:52 +0000)]
Fails to build webkitgtk+ after git-svn-id: svn.webkit.org/repository/webkit/trunk@229877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=184081

Unreviewed, switch to use UNUSED_PARAM()

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

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

3 years ago[Web Animations] Comparing two matching FramesTimingFunction objects fails
graouts@webkit.org [Wed, 28 Mar 2018 16:39:57 +0000 (16:39 +0000)]
[Web Animations] Comparing two matching FramesTimingFunction objects fails
https://bugs.webkit.org/show_bug.cgi?id=184078

Reviewed by Jon Lee.

LayoutTests/imported/w3c:

Mark one progression for the frames() timing function test with the CSS Animations and CSS Transitions as Web Animations flag.

* web-platform-tests/css-timing-1/frames-timing-functions-output-expected.txt:
* web-platform-tests/css-timing-1/frames-timing-functions-output.html:

Source/WebCore:

Fix a stupid mistake in the == operator for FramesTimingFunction. Without a correct check, we would mistakenly interrupt and
restart any transition with a frames() timing function when we check that the Animation objects are similar.

* platform/animation/TimingFunction.h:

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

3 years agoMake use of HAVE(CORE_ANIMATION_RENDER_SERVER) in more places
timothy_horton@apple.com [Wed, 28 Mar 2018 16:10:04 +0000 (16:10 +0000)]
Make use of HAVE(CORE_ANIMATION_RENDER_SERVER) in more places
https://bugs.webkit.org/show_bug.cgi?id=184072
<rdar://problem/38946530>

Reviewed by Dan Bernstein.

* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createForExternalHostingProcess):
* UIProcess/mac/ViewSnapshotStore.h:
* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshot::clearImage):

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

3 years agoRevert an unnecessary workaround when zooming focused form controls
wenson_hsieh@apple.com [Wed, 28 Mar 2018 14:39:01 +0000 (14:39 +0000)]
Revert an unnecessary workaround when zooming focused form controls
https://bugs.webkit.org/show_bug.cgi?id=184067
<rdar://problem/38805254>

Reviewed by Tim Horton.

Reverts an unintended change introduced in r227984.

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

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

3 years ago[GTK][WPE] Remove UpdateAtlas
magomez@igalia.com [Wed, 28 Mar 2018 12:30:10 +0000 (12:30 +0000)]
[GTK][WPE] Remove UpdateAtlas
https://bugs.webkit.org/show_bug.cgi?id=184042

Reviewed by Žan Doberšek.

Source/WebCore:

Remove UpdateAtlas and AreaAllocator classes. Instead of using UpdateAtlas as a cache
of buffers to render tiles with cairo, allocate a new buffer for each tile instead.

Covered by existent tests.

* loader/EmptyClients.h:
* page/ChromeClient.h:
* platform/TextureMapper.cmake:
* platform/graphics/texmap/coordinated/AreaAllocator.cpp: Removed.
* platform/graphics/texmap/coordinated/AreaAllocator.h: Removed.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
* platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
(): Deleted.
* platform/graphics/texmap/coordinated/UpdateAtlas.cpp: Removed.
* platform/graphics/texmap/coordinated/UpdateAtlas.h: Removed.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):

Source/WebKit:

Remove all the code related to UpdateAtlas handling.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
(WebKit::CoordinatedGraphicsScene::commitSceneState):
(WebKit::CoordinatedGraphicsScene::purgeGLResources):
(WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): Deleted.
(WebKit::CoordinatedGraphicsScene::createUpdateAtlas): Deleted.
(WebKit::CoordinatedGraphicsScene::removeUpdateAtlas): Deleted.
(WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): Deleted.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::renderLayerTree):
(WebKit::ThreadedCompositor::releaseUpdateAtlases): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::delegatedScrollRequested):
(WebKit::WebChromeClient::resetUpdateAtlasForTesting): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::resetUpdateAtlasForTesting): Deleted.
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::CompositingCoordinator):
(WebKit::CompositingCoordinator::flushPendingLayerChanges):
(WebKit::CompositingCoordinator::clearPendingStateChanges):
(WebKit::CompositingCoordinator::renderNextFrame):
(WebKit::CompositingCoordinator::purgeBackingStores):
(WebKit::CompositingCoordinator::createUpdateAtlas): Deleted.
(WebKit::CompositingCoordinator::removeUpdateAtlas): Deleted.
(WebKit::CompositingCoordinator::getCoordinatedBuffer): Deleted.
(): Deleted.
(WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): Deleted.
(WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired): Deleted.
(WebKit::CompositingCoordinator::releaseAtlases): Deleted.
(WebKit::CompositingCoordinator::clearUpdateAtlases): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::clearUpdateAtlases): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/LayerTreeHost.h:
(WebKit::LayerTreeHost::setIsDiscardable):

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

3 years agoREGRESSION(r229998): WebDriver: MiniBrowser is crashing in a lot of tests after r229998
carlosgc@webkit.org [Wed, 28 Mar 2018 10:40:24 +0000 (10:40 +0000)]
REGRESSION(r229998): WebDriver: MiniBrowser is crashing in a lot of tests after r229998
https://bugs.webkit.org/show_bug.cgi?id=184075

Reviewed by Žan Doberšek.

This is because we are using a value after it has been moved.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Save a reference to page in a local variable
before using it when it's also going to be moved in the lambda capture.

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

3 years agoappendQuotedJSONString stops on arithmetic overflow instead of propagating it upwards
rmorisset@apple.com [Wed, 28 Mar 2018 09:36:44 +0000 (09:36 +0000)]
appendQuotedJSONString stops on arithmetic overflow instead of propagating it upwards
https://bugs.webkit.org/show_bug.cgi?id=183894

Reviewed by Saam Barati.

JSTests:

* stress/json-stringified-overflow.js: Added.
(catch):

Source/JavaScriptCore:

Use the return value of appendQuotedJSONString to fail more gracefully when given a string that is too large to handle.

* runtime/JSONObject.cpp:
(JSC::Stringifier::appendStringifiedValue):

Source/WTF:

appendQuotedJSONString now returns a bool indicating whether it succeeded, instead of silently failing when given a string too large
to fit in 4GB.

* wtf/text/StringBuilder.h:
* wtf/text/StringBuilderJSON.cpp:
(WTF::StringBuilder::appendQuotedJSONString):

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

3 years ago[JSC] Move WeakValueRef class to its own file and use it from Objc and GLib
carlosgc@webkit.org [Wed, 28 Mar 2018 09:16:15 +0000 (09:16 +0000)]
[JSC] Move WeakValueRef class to its own file and use it from Objc and GLib
https://bugs.webkit.org/show_bug.cgi?id=184073

Reviewed by Yusuke Suzuki.

We currently have duplicated code in Obj and GLib implementations.

* API/JSManagedValue.mm:
(managedValueHandleOwner):
(-[JSManagedValue initWithValue:]):
* API/JSWeakValue.cpp: Added.
(JSC::JSWeakValue::~JSWeakValue):
(JSC::JSWeakValue::clear):
(JSC::JSWeakValue::isClear const):
(JSC::JSWeakValue::setPrimitive):
(JSC::JSWeakValue::setObject):
(JSC::JSWeakValue::setString):
* API/JSWeakValue.h: Added.
(JSC::JSWeakValue::isSet const):
(JSC::JSWeakValue::isPrimitive const):
(JSC::JSWeakValue::isObject const):
(JSC::JSWeakValue::isString const):
(JSC::JSWeakValue::object const):
(JSC::JSWeakValue::primitive const):
(JSC::JSWeakValue::string const):
* API/glib/JSCWeakValue.cpp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:

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

3 years ago[GLIB] Add JSCWeakValue to JavaScriptCore GLib API
carlosgc@webkit.org [Wed, 28 Mar 2018 06:21:57 +0000 (06:21 +0000)]
[GLIB] Add JSCWeakValue to JavaScriptCore GLib API
https://bugs.webkit.org/show_bug.cgi?id=184041

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

This allows to keep a reference to a JavaSCript value without protecting it, and without having a strong
reference of the context. When the value is cleared the JSCWeakValue::cleared signal is emitted and
jsc_weak_value_get_value() will always return nullptr.

* API/glib/JSCWeakValue.cpp: Added.
(WeakValueRef::~WeakValueRef):
(WeakValueRef::clear):
(WeakValueRef::isClear const):
(WeakValueRef::isSet const):
(WeakValueRef::isPrimitive const):
(WeakValueRef::isObject const):
(WeakValueRef::isString const):
(WeakValueRef::setPrimitive):
(WeakValueRef::setObject):
(WeakValueRef::setString):
(WeakValueRef::object const):
(WeakValueRef::primitive const):
(WeakValueRef::string const):
(weakValueHandleOwner):
(jscWeakValueInitialize):
(jscWeakValueSetProperty):
(jscWeakValueDispose):
(jsc_weak_value_class_init):
(jsc_weak_value_new):
(jsc_weak_value_get_value):
* API/glib/JSCWeakValue.h: Added.
* API/glib/docs/jsc-glib-4.0-sections.txt:
* API/glib/docs/jsc-glib-docs.sgml:
* API/glib/jsc.h:
* GLib.cmake:

Tools:

Add test case for JSCWeakValue.

* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(weakValueClearedCallback):
(testJSCWeakValue):
(main):

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

3 years ago[LayoutReloaded] Start using window.collectTextRuns() to layout text lines in inline...
zalan@apple.com [Wed, 28 Mar 2018 04:52:54 +0000 (04:52 +0000)]
[LayoutReloaded] Start using window.collectTextRuns() to layout text lines in inline formatting context
https://bugs.webkit.org/show_bug.cgi?id=184070

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype._handleText):
(InlineFormattingContext.prototype._commitLine):
* LayoutReloaded/FormattingContext/InlineFormatting/Line.js:
(Line.prototype.addTextLineBox):
(Line):
(Line.prototype.addLineBox): Deleted.
* LayoutReloaded/FormattingState/BlockFormattingState.js:
(BlockFormattingState):
* LayoutReloaded/FormattingState/FormattingState.js:
(FormattingState.prototype.displayBox):
(FormattingState):
(FormattingState.prototype._setFormattingContext): Deleted.
* LayoutReloaded/FormattingState/InlineFormattingState.js:
(InlineFormattingState):
* LayoutReloaded/LayoutTree/Text.js:
(Text.prototype.content):
* LayoutReloaded/Utils.js:
(Utils.textRuns):
(Utils.textRunsForLine):
(Utils._dumpLines.):
(Utils._dumpLines):
* LayoutReloaded/test/simple-inline-text.html:

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

3 years ago[DFG] Remove unnecessary USE(JSVALUE32_64) / USE(JSVALUE64)
utatane.tea@gmail.com [Wed, 28 Mar 2018 03:32:09 +0000 (03:32 +0000)]
[DFG] Remove unnecessary USE(JSVALUE32_64) / USE(JSVALUE64)
https://bugs.webkit.org/show_bug.cgi?id=181292

Reviewed by Saam Barati.

By using JSValueRegs abstraction, we can simplify DFGSpeculativeJIT.cpp code.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnDirectArguments):
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
(JSC::DFG::SpeculativeJIT::compileCreateRest):
(JSC::DFG::SpeculativeJIT::compileArraySlice):
(JSC::DFG::SpeculativeJIT::emitSwitchImm):
(JSC::DFG::SpeculativeJIT::compilePutDynamicVar):
(JSC::DFG::SpeculativeJIT::compilePutAccessorByVal):

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

3 years agoWeb Inspector: Modernize some utility functions
timothy@apple.com [Wed, 28 Mar 2018 02:51:18 +0000 (02:51 +0000)]
Web Inspector: Modernize some utility functions
https://bugs.webkit.org/show_bug.cgi?id=184047

Source/WebInspectorUI:

Reviewed by Matt Baker.

* UserInterface/Base/Utilities.js:
(Node.prototype.enclosingNodeOrSelfWithClass): Use parentElement instead of parentNode, so we don't need to check for document.
(Node.prototype.enclosingNodeOrSelfWithNodeNameInArray): Ditto. Also just toUpperCase input, since nodeName is already upper case.
(String.prototype.escapeCharacters): Use Set and string iteration instead of indexOf and charAt.

LayoutTests:

Rubber-stamped by Matt Baker.

* inspector/unit-tests/string-utilities-expected.txt: Updated.
* inspector/unit-tests/string-utilities.html: Added String.prototype.escapeCharacters test.

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

3 years agoUnreviewed, fix typo in variable name
mcatanzaro@igalia.com [Wed, 28 Mar 2018 02:37:05 +0000 (02:37 +0000)]
Unreviewed, fix typo in variable name

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseCrossingNotifyEvent):

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

3 years agoUnreviewed, rolling out r230008.
mcatanzaro@igalia.com [Wed, 28 Mar 2018 01:36:52 +0000 (01:36 +0000)]
Unreviewed, rolling out r230008.

Lots of HTTP test failures

Reverted changeset:

"Remove unused libsoup ResourceHandle implementation"
https://bugs.webkit.org/show_bug.cgi?id=184048
https://trac.webkit.org/changeset/230008

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

3 years agoSkip http/wpt/service-workers/third-party-registration.html.
ryanhaddad@apple.com [Wed, 28 Mar 2018 00:22:50 +0000 (00:22 +0000)]
Skip http/wpt/service-workers/third-party-registration.html.
https://bugs.webkit.org/show_bug.cgi?id=183860

Unreviewed test gardening.

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

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

3 years agoMake it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded()...
cdumez@apple.com [Wed, 28 Mar 2018 00:12:32 +0000 (00:12 +0000)]
Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
https://bugs.webkit.org/show_bug.cgi?id=184029

Reviewed by Youenn Fablet.

Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
by having it use SecurityOriginData (which is safe to construct on non-main threads) instead of
SecurityOrigin (which isn't).

ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() is already called from non-main thread in
FetchLoader, XHR and WebSocket when used in workers. This wasn't safe.

* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
(WebCore::ContentSecurityPolicy::setUpgradeInsecureRequests):
(WebCore::ContentSecurityPolicy::takeNavigationRequestsToUpgrade):
(WebCore::ContentSecurityPolicy::setInsecureNavigationRequestsToUpgrade):
* page/csp/ContentSecurityPolicy.h:

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

3 years agoAttempt to fix media control layout tests after <https://trac.webkit.org/changeset...
dbates@webkit.org [Tue, 27 Mar 2018 23:54:24 +0000 (23:54 +0000)]
Attempt to fix media control layout tests after <https://trac.webkit.org/changeset/230006/>
(https://bugs.webkit.org/show_bug.cgi?id=179983)

Exempt elements in user agent shadow DOM from having to perform a potentially CORS-
enabled fetch for a mask image to try to fix the following tests from timing out:
    media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
    media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html

* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingImage):

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

3 years agoThe layout test fast/canvas/webgl/read-pixels-test.html is timing out.
pvollan@apple.com [Tue, 27 Mar 2018 23:39:40 +0000 (23:39 +0000)]
The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
https://bugs.webkit.org/show_bug.cgi?id=183923
<rdar://problem/38756869>

Reviewed by Brent Fulgham.

Source/WebCore:

The test is timing out when we do not interact directly with the WindowServer, causing
OpenGL to fall back to software rendering. In this mode, any call to CGLChoosePixelFormat
requesting an accelerated pixel format will fail because it cannot determine which GPU is
connected to the display.

OpenGL treats all GPUs as if they were offline when used in a process (like the WebContent
process) that does not directly control the display.

We can get correct behavior if we tell OpenGL which GPU is currently connected to the
display, and if we instruct CGLChoosePixelFormat to create an offline renderer pixel format
by including the 'kCGLPFAAllowOfflineRenderers' flag in its arguments.

We can use CGLSetVirtualScreen with an OpenGL display mask that tells the OpenGL framework
which GPU it should use.

See https://developer.apple.com/library/content/technotes/tn2229/_index.html#//apple_ref/doc/uid/DTS40008924-CH1-SUBSECTION7
for details on how the virtual screen is found from the OpenGL display mask.

No new tests, covered by existing tests.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::setPixelFormat):
(WebCore::identifyAndSetCurrentGPU):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::setOpenGLDisplayMask):
(WebCore::GraphicsContext3D::allowOfflineRenderers):

Source/WebKit:

Send OpenGL display mask to the WebContent process when the display ID is changing.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::windowScreenDidChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::openGLDisplayMaskChanged):

Source/WTF:

Add compile guard for blocking of the WindowServer in the WebProcess.

* wtf/FeatureDefines.h:

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

3 years agoMove request checking out of PingLoad for future reuse in NetworkLoad
youenn@apple.com [Tue, 27 Mar 2018 23:26:35 +0000 (23:26 +0000)]
Move request checking out of PingLoad for future reuse in NetworkLoad
https://bugs.webkit.org/show_bug.cgi?id=183865

Reviewed by Chris Dumez.

Source/WebKit:

Introduce NetworkLoadChecker as a way to validate requests before sending them in the network process.
Validation encompasses: CORS checks, CSP and Content Extensions on both main request and redirected requests if any.

Make PingLoad use NetworkLoadChecker. Future patch should make NetworkLoad to use it as well whenever needed.

Make NetworkCORSPreflightChecker takes a CompletionHandler instead of a Function.
Ensure this callback is called even if preflight is not completed by returning a Canceled error.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
(WebKit::NetworkCORSPreflightChecker::returnResult):
(WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
(WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
(WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkLoadChecker.cpp: Added.
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::check):
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::returnError):
(WebKit::NetworkLoadChecker::checkRequest):
(WebKit::NetworkLoadChecker::checkCORSRequest):
(WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
(WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
(WebKit::NetworkLoadChecker::contentSecurityPolicy const):
(WebKit::NetworkLoadChecker::contentExtensionsBackend):
(WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
* NetworkProcess/NetworkLoadChecker.h: Added.
(WebKit::NetworkLoadChecker::setCSPResponseHeaders):
(WebKit::NetworkLoadChecker::setContentExtensionRuleLists):
(WebKit::NetworkLoadChecker::url const):
(WebKit::NetworkLoadChecker::storedCredentialsPolicy const):
(WebKit::NetworkLoadChecker::isChecking const):
(WebKit::NetworkLoadChecker::isRedirected const):
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
(WebKit::PingLoad::~PingLoad):
(WebKit::PingLoad::willPerformHTTPRedirection):
(WebKit::PingLoad::didReceiveChallenge):
(WebKit::PingLoad::wasBlocked):
(WebKit::PingLoad::cannotShowURL):
(WebKit::PingLoad::timeoutTimerFired):
(WebKit::PingLoad::currentURL const):
* NetworkProcess/PingLoad.h:
* WebKit.xcodeproj/project.pbxproj:

LayoutTests:

* http/wpt/beacon/cors/cors-preflight-cookie-expected.txt:
* http/wpt/beacon/cors/cors-preflight-cookie.html:

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

3 years agohttps://bugs.webkit.org/show_bug.cgi?id=183876
eric.carlson@apple.com [Tue, 27 Mar 2018 23:16:33 +0000 (23:16 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=183876
<rdar://problem/38726459>

Unreviewed, fix for the test added in r229995 in the iOS simulator.

* TestWebKitAPI/Tests/WebKitCocoa/AVFoundationPreference.mm:
(TestWebKitAPI::AVFoundationPref::testWithPreference):

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

3 years ago[WebAuthN] Implement authenticatorGetAssertion
jiewen_tan@apple.com [Tue, 27 Mar 2018 22:42:45 +0000 (22:42 +0000)]
[WebAuthN] Implement authenticatorGetAssertion
https://bugs.webkit.org/show_bug.cgi?id=183881
<rdar://problem/37258628>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch does the following few things:
1) It implements the spec: https://www.w3.org/TR/webauthn/#op-get-assertion as of 5 December 2017.
2) It tweaks encoding/decoding of PublicKeyCredentialRequestOptions such that options can be passed
between UI and Web processes.
3) It refines the way how LocalAuthenticator::makeCredential find intersection between
excludeCredentialDescriptorList and existing credentials in the authenticator, such that it is faster.
Basically, it takes the CredentialID from the list and treat it as an ASCII string and put it into a
HashSet<String>. It should not matter if a duplicated CredentialID is added. If the hash set is not
empty, the algorithm then queries Keychain for all CredentialIDs related to the current RP ID once.
For every queried CredentialID, the algorithm then treats it as an ASCII string as well and look for
a match in the hash set to produce the intersetction. The new way is also employed in
LocalAuthenticator::getAssertion as well.
4) It abstracts the way to produce authData and thus reorders a bit of code in
LocalAuthenticator::makeCredential.

Covered by API tests.

* Modules/webauthn/AuthenticatorManager.cpp:
(WebCore::AuthenticatorManager::create const):
(WebCore::AuthenticatorManager::discoverFromExternalSource const):
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
(WebCore::PublicKeyCredentialRequestOptions::encode const):
(WebCore::PublicKeyCredentialRequestOptions::decode):
* Modules/webauthn/cocoa/LocalAuthenticator.h:
* Modules/webauthn/cocoa/LocalAuthenticator.mm:
(WebCore::LocalAuthenticatorInternal::buildAuthData):
(WebCore::LocalAuthenticatorInternal::produceHashSet):
(WebCore::LocalAuthenticator::makeCredential):
(WebCore::LocalAuthenticator::getAssertion):
(WebCore::LocalAuthenticator::issueClientCertificate const):
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
(WebKit::WebCredentialsMessengerProxy::makeCredential):
(WebKit::WebCredentialsMessengerProxy::getAssertion):
(WebKit::WebCredentialsMessengerProxy::getAssertionReply):
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
* WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
(WebKit::WebCredentialsMessenger::getAssertion):
(WebKit::WebCredentialsMessenger::getAssertionReply):
* WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:

Tools:

* TestWebKitAPI/Tests/ios/LocalAuthenticator.mm:
(TestWebKitAPI::getTestKey):
(TestWebKitAPI::addTestKeyToKeychain):
(TestWebKitAPI::LAEvaluatePolicyFailedSwizzler::evaluatePolicyFailed):
(TestWebKitAPI::LAEvaluatePolicyPassedSwizzler::evaluatePolicyPassed):
(TestWebKitAPI::LAEvaluateAccessControlFailedSwizzler::LAEvaluateAccessControlFailedSwizzler):
(TestWebKitAPI::LAEvaluateAccessControlFailedSwizzler::evaluateAccessControlFailed):
(TestWebKitAPI::LAEvaluateAccessControlPassedSwizzler::LAEvaluateAccessControlPassedSwizzler):
(TestWebKitAPI::LAEvaluateAccessControlPassedSwizzler::evaluateAccessControlPassed):
(TestWebKitAPI::TEST):

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

3 years agoREGRESSION(r229937): WebDriver tests no longer run, test runner hangs when launching...
bburg@apple.com [Tue, 27 Mar 2018 22:36:29 +0000 (22:36 +0000)]
REGRESSION(r229937): WebDriver tests no longer run, test runner hangs when launching wpt web server
https://bugs.webkit.org/show_bug.cgi?id=184056
<rdar://problem/38925058>

Reviewed by Timothy Hatcher and Youenn Fablet.

Tools:

* Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py:
(WebDriverW3CWebServer.start):
The config key used in upstream WPT has changed from 'host' to 'browser_host'.

WebDriverTests:

* imported/w3c/config.json:
The config key used in upstream WPT has changed from 'host' to 'browser_host'.

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

3 years agoUpdate my email address in contributors.json and scripts
timothy@hatcher.name [Tue, 27 Mar 2018 22:30:22 +0000 (22:30 +0000)]
Update my email address in contributors.json and scripts
https://bugs.webkit.org/show_bug.cgi?id=184054

Patch by Timothy Hatcher <timothy@hatcher.name> on 2018-03-27

* Scripts/validate-committer-lists:
(CommitterListFromGit):
* Scripts/webkitpy/common/config/contributors.json:

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

3 years agoAvoid constructing SecurityOrigin objects from non-main threads
cdumez@apple.com [Tue, 27 Mar 2018 22:01:03 +0000 (22:01 +0000)]
Avoid constructing SecurityOrigin objects from non-main threads
https://bugs.webkit.org/show_bug.cgi?id=184024

Reviewed by Youenn Fablet.

Source/WebCore:

Avoid constructing SecurityOrigin objects from non-main threads as much as possible
as it is not safe. This patch gets rid of most offending cases but not all of them
yet, which is why I haven't added a ASSERT(isMainThread()) to the SecurityOrigin
constructor yet.

For example, ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() currently
gets called from non-main threads and construct a SecurityOrigin. Fixing this
will require some refactoring that would have made this patch much larger.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::matchRegistration):
* page/EventSource.cpp:
(WebCore::EventSource::didReceiveResponse):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
* testing/Internals.cpp:
(WebCore::Internals::hasServiceWorkerRegistration):
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScope.h:
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::origin const):
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::getRegistrations):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::create):
(WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
* workers/service/ServiceWorkerProvider.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::createWorkerGlobalScope):
(WebCore::fireMessageEvent):
(WebCore::ServiceWorkerThread::postMessageToServiceWorker):
* workers/service/context/ServiceWorkerThread.h:

Source/WebKit:

Avoid constructing SecurityOrigin objects from non-main threads as much as possible.

* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
(WebKit::WebSWClientConnection::matchRegistration):
(WebKit::WebSWClientConnection::getRegistrations):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWOriginTable.cpp:
(WebKit::WebSWOriginTable::contains const):
* WebProcess/Storage/WebSWOriginTable.h:

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

3 years agoRemove unused libsoup ResourceHandle implementation
achristensen@apple.com [Tue, 27 Mar 2018 21:16:41 +0000 (21:16 +0000)]
Remove unused libsoup ResourceHandle implementation
https://bugs.webkit.org/show_bug.cgi?id=184048

Reviewed by Michael Catanzaro.

This code is unused since r228901 so let's remove it!

* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::~ResourceHandle):
(WebCore::ResourceHandleInternal::soupSession):
(WebCore::ResourceHandle::cancelledOrClientless):
(WebCore::ResourceHandle::ensureReadBuffer):
(WebCore::ResourceHandle::currentStreamPosition const):
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
(WebCore::ResourceHandle::didStartRequest):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::releaseForDownload):
(WebCore::ResourceHandle::sendPendingRequest):
(WebCore::ResourceHandle::cancel):
(WebCore::ResourceHandle::shouldUseCredentialStorage):
(WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::receivedCancellation):
(WebCore::ResourceHandle::receivedChallengeRejection):
(WebCore::ResourceHandle::platformSetDefersLoading):
(WebCore::sessionFromContext): Deleted.
(WebCore::ResourceHandle::create): Deleted.
(WebCore::ResourceHandle::ResourceHandle): Deleted.
(WebCore::isAuthenticationFailureStatusCode): Deleted.
(WebCore::tlsErrorsChangedCallback): Deleted.
(WebCore::gotHeadersCallback): Deleted.
(WebCore::applyAuthenticationToRequest): Deleted.
(WebCore::restartedCallback): Deleted.
(WebCore::shouldRedirect): Deleted.
(WebCore::shouldRedirectAsGET): Deleted.
(WebCore::continueAfterWillSendRequest): Deleted.
(WebCore::doRedirect): Deleted.
(WebCore::redirectSkipCallback): Deleted.
(WebCore::wroteBodyDataCallback): Deleted.
(WebCore::cleanupSoupRequestOperation): Deleted.
(WebCore::nextMultipartResponsePartCallback): Deleted.
(WebCore::sendRequestCallback): Deleted.
(WebCore::continueAfterDidReceiveResponse): Deleted.
(WebCore::startingCallback): Deleted.
(WebCore::networkEventCallback): Deleted.
(WebCore::createSoupMessageForHandleAndRequest): Deleted.
(WebCore::createSoupRequestAndMessageForHandle): Deleted.
(WebCore::ResourceHandle::timeoutFired): Deleted.
(WebCore::waitingToSendRequest): Deleted.
(WebCore::readCallback): Deleted.

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

3 years agoMove online state detection from the WebProcess to the NetworkProcess
cdumez@apple.com [Tue, 27 Mar 2018 21:02:25 +0000 (21:02 +0000)]
Move online state detection from the WebProcess to the NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=183989
<rdar://problem/37093299>

Reviewed by Youenn Fablet.

Source/WebCore:

Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
its connected WebProcesses via IPC.

* inspector/agents/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::networkStateChanged):
* loader/LoaderStrategy.h:
* page/Navigator.cpp:
(WebCore::Navigator::onLine const):
* page/Page.cpp:
* platform/network/NetworkStateNotifier.h:
* workers/Worker.cpp:
(WebCore::Worker::Worker):
(WebCore::Worker::notifyFinished):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):

Source/WebKit:

Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
its connected WebProcesses via IPC.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setOnLineState):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::setOnLineState):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Network/NetworkProcessConnection.messages.in:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::isOnLine const):
(WebKit::WebLoaderStrategy::addOnlineStateChangeListener):
(WebKit::WebLoaderStrategy::setOnLineState):
* WebProcess/Network/WebLoaderStrategy.h:

Source/WebKitLegacy:

No change on WebKit1 except that WebResourceLoadScheduler needs to override
2 new virtual functions which forward the calls to the NetworkStateNotifier.

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::isOnLine const):
(WebResourceLoadScheduler::addOnlineStateChangeListener):
* WebCoreSupport/WebResourceLoadScheduler.h:

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

3 years agoCSS mask images should be retrieved using potentially CORS-enabled fetch
dbates@webkit.org [Tue, 27 Mar 2018 20:56:09 +0000 (20:56 +0000)]
CSS mask images should be retrieved using potentially CORS-enabled fetch
https://bugs.webkit.org/show_bug.cgi?id=179983
<rdar://problem/35678149>

Reviewed by Brent Fulgham.

Source/WebCore:

As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor’s Draft, 23 December 2017)
we should fetch CSS mask images using a potentially CORS-enabled fetch.

Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
closely align with the behavior in the spec.

Test: http/tests/security/css-mask-image.html

* page/Settings.yaml: Add a setting for toggle "Anonymous" mode fetching of mask images (defaults: true).
We need this setting to avoid breaking the developer convenience feature that some modern media controls
layout tests employ to load assets from the filesystem as opposed to using the hardcoded data URLs baked
into the WebKit binary.
* style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
(WebCore::Style::loadPendingImage): Ditto.
(WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
a mask image or shape-outside image.

LayoutTests:

Add a test to ensure we do not fetch a cross-origin CSS mask image that does
not allow CORS access.

* http/tests/security/css-mask-image-expected.html: Added.
* http/tests/security/css-mask-image.html: Added.
* http/tests/security/resources/black-square.png: Added.
* http/tests/security/resources/fail-mask.png: Added.
* media/modern-media-controls/resources/media-controls-loader.js: Disable "Anonymous" mode
fetching of mask images to allow modern media controls to load mask assets from the filesystem.

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

3 years agomemoryStatus() is wrong in certain testing scenarios on iOS
sbarati@apple.com [Tue, 27 Mar 2018 20:52:35 +0000 (20:52 +0000)]
memoryStatus() is wrong in certain testing scenarios on iOS
https://bugs.webkit.org/show_bug.cgi?id=184050
<rdar://problem/37959258>

Rubber-stamped by Mark Lam.

This switches us from using "phys_footprint" to using "internal + compressed"
when computing the dirty memory in the current process. There are iOS testing
scenarios where phys_footprint doesn't give us a reliable answer. In my testing,
"internal + compressed" tracks phys_footprint closely (when phys_footprint is
working). They're usually within much less than 1% of each other. We're making
this change to ensure testing in our iOS infrastructure is valid.

I opened a bug to move back to phys_footprint when it's feasible:
https://bugs.webkit.org/show_bug.cgi?id=184050

* bmalloc/AvailableMemory.cpp:
(bmalloc::memoryStatus):

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

3 years agoRenderBox::parent/firstChild/nextSibling/previousSiblingBox() functions should type...
zalan@apple.com [Tue, 27 Mar 2018 20:51:06 +0000 (20:51 +0000)]
RenderBox::parent/firstChild/nextSibling/previousSiblingBox() functions should type check.
https://bugs.webkit.org/show_bug.cgi?id=184032
<rdar://problem/38384984>

Reviewed by Antti Koivisto.

Source/WebCore:

We cannot rely on the correctness of the render tree structure when querying for parent/child/next and previous
sibling since some features (multicolumn/spanners) move subtrees out of their original position (which is highly
undesired and should not be encouraged at all though).
It should also be noted that these functions are not equivalent of typeOfChildren<RenderBox> and the following usage
    for (auto* boxChild = firstChildBox(); boxChild; boxChild = boxChild->nextSiblingBox())
can lead to unexpected result.

Test: fast/multicol/parent-box-when-spanner-is-present.html

* rendering/RenderBox.h:
(WebCore::RenderBox::parentBox const):
(WebCore::RenderBox::firstChildBox const):
(WebCore::RenderBox::lastChildBox const):
(WebCore::RenderBox::previousSiblingBox const):
(WebCore::RenderBox::nextSiblingBox const):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::layout):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::updateLogicalWidth):

LayoutTests:

* fast/multicol/parent-box-when-spanner-is-present-expected.txt: Added.
* fast/multicol/parent-box-when-spanner-is-present.html: Added.

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

3 years ago[Extra zoom mode] Add support for new focused form control overlay behaviors
wenson_hsieh@apple.com [Tue, 27 Mar 2018 20:49:06 +0000 (20:49 +0000)]
[Extra zoom mode] Add support for new focused form control overlay behaviors
https://bugs.webkit.org/show_bug.cgi?id=184043
<rdar://problem/38758727>

Reviewed by Tim Horton.

See below for more details.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _willStartScrollingOrZooming]):
(-[WKContentView _didEndScrollingOrZooming]):

Suppress focused form control navigation while the scroll view is undergoing a scroll or zoom animation (e.g.,
when moving from one focused form control to another).

(-[WKContentView textInputController:didCommitText:withSuggestion:]):

When dismissing an input view controller, allow focused form control navigation only after updating assisted
node information to ensure that focus rects aren't stale as the user begins to navigate between forms.

(-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]):
(-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]):
(-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]):
(-[WKContentView scrollViewForFocusedFormControlController:]):
(-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.

Implement some new focused form overlay delegate hooks to vend the scroll view, as well as the rects of next and
previous focusable form controls.

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

3 years agoFurther refine cookie read/write logging
bfulgham@apple.com [Tue, 27 Mar 2018 20:27:55 +0000 (20:27 +0000)]
Further refine cookie read/write logging
https://bugs.webkit.org/show_bug.cgi?id=184044
<rdar://problem/38915610>

Reviewed by Chris Dumez.

Source/WebCore:

Export 'shouldBlockCookies' so that it can be accessed by the WebKit framework.

* platform/network/NetworkStorageSession.h:

Source/WebKit:

Cookie logging was passing the partition, rather than the first party, when logging, which
prevented logging in cases where partitioning or blocking was active. This patch corrects
these calls so that logging is generated in these cases, too.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Call log routines if needed.
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Ditto.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::escapeIDForJSON): Make available to use in multiple functions.
(WebKit::NetworkResourceLoader::logCookieInformation const): Revise to use shared
convenience functions.
(WebKit::logBlockedCookieInformation): Added.
(WebKit::logCookieInformationInternal): Added.
(WebKit::NetworkResourceLoader::logCookieInformation): Revise to use shared
convenience functions.
* NetworkProcess/NetworkResourceLoader.h:

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

3 years agoWeb Inspector: Command-Shift-left/right arrow keys should not switch tabs when focuse...
nvasilyev@apple.com [Tue, 27 Mar 2018 19:30:59 +0000 (19:30 +0000)]
Web Inspector: Command-Shift-left/right arrow keys should not switch tabs when focused on color picker text fields
https://bugs.webkit.org/show_bug.cgi?id=184028

Reviewed by Timothy Hatcher.

* UserInterface/Views/EditingSupport.js:
(WI.isEventTargetAnEditableField):
Detect <input type="number"> as an editable text field.

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

3 years ago[Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of...
graouts@webkit.org [Tue, 27 Mar 2018 19:19:46 +0000 (19:19 +0000)]
[Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of Web Animations API for animations tests
https://bugs.webkit.org/show_bug.cgi?id=184038

Reviewed by Dean Jackson.

Source/WebCore:

Expose a new method to indicate that the runtime flag for CSS Animations and CSS Transitions as Web Animations is enabled.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests:

Make 48 tests opt into CSS Animations and CSS Transitions as Web Animations. These tests used the internals.pauseAnimationAtTimeOnElement()
method, but this method should be going away since the Web Animations API allows seeking and pausing. To support this, we make
animation-test-helpers.js use the Web Animations API instead of internals.pauseAnimationAtTimeOnElement() if the tests has opted
into CSS Animations and CSS Transitions as Web Animations and we know it's safe to use these APIs.

* animations/3d/matrix-transform-type-animation.html:
* animations/3d/transform-perspective.html:
* animations/animation-callback-timestamp.html:
* animations/animation-direction-reverse-hardware-opacity.html:
* animations/animation-direction-reverse-hardware.html:
* animations/animation-direction-reverse-non-hardware.html:
* animations/animation-direction-reverse-timing-functions-hardware.html:
* animations/animation-direction-reverse-timing-functions.html:
* animations/animation-direction.html:
* animations/animation-hit-test.html:
* animations/animation-offscreen-to-onscreen.html:
* animations/change-keyframes-expected.txt:
* animations/change-keyframes.html:
* animations/cross-fade-background-image.html:
* animations/cross-fade-border-image-source.html:
* animations/cross-fade-list-style-image.html:
* animations/cross-fade-webkit-mask-box-image.html:
* animations/duplicate-keys-expected.html:
* animations/duplicate-keys.html:
* animations/font-variations/font-stretch.html:
* animations/font-variations/font-style.html:
* animations/font-variations/font-variation-settings-order.html:
* animations/font-variations/font-variation-settings-unlike.html:
* animations/font-variations/font-variation-settings.html:
* animations/font-variations/font-weight.html:
* animations/generic-from-to.html:
* animations/import.html:
* animations/keyframe-multiple-timing-functions-transform.html:
* animations/keyframes-comma-separated.html:
* animations/keyframes-infinite-iterations.html:
* animations/keyframes-invalid-keys.html:
* animations/keyframes-out-of-order.html:
* animations/keyframes.html:
* animations/longhand-timing-function.html:
* animations/matrix-anim.html:
* animations/missing-keyframe-properties-repeating.html:
* animations/missing-keyframe-properties.html:
* animations/missing-values-first-keyframe.html:
* animations/missing-values-last-keyframe.html:
* animations/multiple-animations-timing-function.html:
* animations/multiple-animations.html:
* animations/multiple-keyframes.html:
* animations/negative-delay.html:
* animations/pause-crash.html:
* animations/resources/animation-test-helpers.js:
(checkExpectedValue):
(pauseAnimationAtTimeOnElement):
(startTest):
(runAnimationTest):
* animations/simultaneous-start-left.html:
* animations/spring-function.html:
* animations/stacking-context-unchanged-while-running.html:
* animations/timing-functions.html:
* animations/unanimated-style.html:
* animations/unprefixed-keyframes.html:

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

3 years agoMark some CSS animations tests as failing on Windows.
pvollan@apple.com [Tue, 27 Mar 2018 19:02:19 +0000 (19:02 +0000)]
Mark some CSS animations tests as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=183953

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoWeb Automation: support enter/exit fullscreen and hide/restore window operations
bburg@apple.com [Tue, 27 Mar 2018 16:37:43 +0000 (16:37 +0000)]
Web Automation: support enter/exit fullscreen and hide/restore window operations
https://bugs.webkit.org/show_bug.cgi?id=182837
<rdar://problem/37580732>

Reviewed by Tim Horton.

The W3C specification is more explicit about when to exit fullscreen and
restore the window for a browsing context. So, WebKit needs to have support
for performing these operations on behalf of a driver.

Based on prototyping, it is sufficient to use a JavaScript atom to enter
fullscreen mode. This is included in the patch as EnterFullscreen.js and
can be used to implement the §10.7.5 Fullscreen Window command.

Other window operations cannot be peformed from JavaScript, so we need to
delegate these operations to the session client (i.e., Safari).
This patch adds session client callouts for restoring, minimizing, and
switching to a browsing context.

Exiting fullscreen happens implicitly (per specification) when setting a
window frame without an actual frame, or when switching/restoring/minimizing a window.
If needed, a driver can call Set Window Rect in this way to unfullscreen a context.
Similarly, a driver can restore a minimized window using Set Window Rect.

* UIProcess/API/APIAutomationSessionClient.h:
(API::AutomationSessionClient::requestHideWindowOfPage):
(API::AutomationSessionClient::requestRestoreWindowOfPage):
(API::AutomationSessionClient::requestSwitchToPage):
Add new API client methods.

* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
Add new Cocoa API delegate methods.

* UIProcess/Automation/Automation.json:
Make the switch to browsing context command asynchronous, since this functionality
is not always synchronous, and we prefer to use completion handlers in the delegates.

Add new protocol method for hiding the window of a browsing context.
This is expected to minimize/miniaturize a window for desktop window managers.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::switchToBrowsingContext):
Make this function asynchronous. Call out to the session client.

(WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
Follow the steps in the specification to restore window and exit fullscreen.

(WebKit::WebAutomationSession::hideWindowOfBrowsingContext):
Exit fullscreen and call out to the session client.

(WebKit::WebAutomationSession::exitFullscreenWindowForPage):
This is a little strange. Because there is no async API for exiting fullscreen
from C++ code, we hook into willEnterFullScreen and didExitFullScreen and send
out the response if the page exited fullscreen after we requested it to do so.
Because the W3C specification mandates that drivers only process one command at
a time, there will only ever be one callback installed by this method at a time.

(WebKit::WebAutomationSession::restoreWindowForPage):
(WebKit::WebAutomationSession::hideWindowForPage):
Call out to the session client.

(WebKit::WebAutomationSession::didEnterFullScreenForPage):
(WebKit::WebAutomationSession::didExitFullScreenForPage):
Add methods to be called by instrumentation hooks in WebFullScreenManagerProxy.

* UIProcess/Automation/atoms/EnterFullscreen.js: Added.
(enterFullscreen):

* UIProcess/Cocoa/AutomationSessionClient.h:
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::AutomationSessionClient):
(WebKit::AutomationSessionClient::requestSwitchToPage):
(WebKit::AutomationSessionClient::requestHideWindowOfPage):
(WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
(WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
Add boilerplate to convert C++ API client to Objective-C delegate methods.

* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::didExitFullScreen):
Notify the automation session if the page is under automation and
enters or exits fullscreen.

* WebKit.xcodeproj/project.pbxproj:
Add EnterFullscreen.js to the list of WebDriver atoms. These are copied
as WebKit2 private headers and used by driver implementations.

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

3 years ago[GStreamer] Enhance debugging in the BasePlayer
commit-queue@webkit.org [Tue, 27 Mar 2018 16:25:52 +0000 (16:25 +0000)]
[GStreamer] Enhance debugging in the BasePlayer
https://bugs.webkit.org/show_bug.cgi?id=184035

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-03-27
Reviewed by Philippe Normand.

No behaviour changes so no test were added/enabled.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
(WebCore::MediaPlayerPrivateGStreamerBase::setVolume):
(WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
(WebCore::MediaPlayerPrivateGStreamerBase::muted const):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):

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

3 years agoAdd Load16Z for B3 and use it in WebAssembly
utatane.tea@gmail.com [Tue, 27 Mar 2018 16:21:19 +0000 (16:21 +0000)]
Add Load16Z for B3 and use it in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=165884

Reviewed by JF Bastien.

We already support Load16Z in B3. Use it for i32.load16_u / i64.load16_u in WebAssembly.
spec-tests/memory.wast.js already covered this change.

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::emitLoadOp):

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

3 years agoMake AVFoundationEnabled preference available on iOS
eric.carlson@apple.com [Tue, 27 Mar 2018 11:39:53 +0000 (11:39 +0000)]
Make AVFoundationEnabled preference available on iOS
https://bugs.webkit.org/show_bug.cgi?id=183876
<rdar://problem/38726459>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: AVFoundationPref API test.

* html/HTMLAudioElement.idl: There is no need for a runtime setting to enable/disable audio,
there is already settings.mediaEnabled.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad): Fail if there are no media engines registered.
(WebCore::HTMLMediaElement::noneSupported): Return early if m_error has already been set.
(WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Remove a typo.

* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::audioEnabled const): Deleted.
* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* Shared/WebPreferences.yaml: Set AVFoundationEnabled with DEFAULT_AVFOUNDATION_ENABLED.
* Shared/WebPreferencesDefaultValues.h:

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setAVFoundationEnabled:]): Enable for iOS.
(-[WKPreferences _avFoundationEnabled]): Ditto.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/video.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/AVFoundationPreference.mm: Added.
(-[PreferenceTestMessageHandler userContentController:didReceiveScriptMessage:]):
(TestWebKitAPI::AVFoundationPref::SetUp):
(TestWebKitAPI::AVFoundationPref::testWithPreference):
(TestWebKitAPI::TEST_F):

LayoutTests:

* media/media-error-fired-once-expected.txt: Added.
* media/media-error-fired-once.html: Added.

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

3 years ago[GTK] Layout test editing/deleting/delete-surrogatepair.html crashing with CRITICAL...
Hironori.Fujii@sony.com [Tue, 27 Mar 2018 10:10:41 +0000 (10:10 +0000)]
[GTK] Layout test editing/deleting/delete-surrogatepair.html crashing with CRITICAL **: enchant_dict_check: assertion 'g_utf8_validate(word, len, NULL)' failed
https://bugs.webkit.org/show_bug.cgi?id=176799

Reviewed by Carlos Garcia Campos.

Source/WebCore:

The length of a surrogate-pair UTF-16 character is 2 even though
the number of characters is 1. An incorrect string length was
passed to enchant_dict_check if the string contains a
surrogate-pair character because the length was calculated by
applying UTF-16 character position to UTF-8 string.

No new tests (Covered by existing tests).

* platform/text/enchant/TextCheckerEnchant.cpp:
(WebCore::TextCheckerEnchant::checkSpellingOfWord): Changed the
type of an argument `word` from CString to String. Convert a
substring of the argument into UTF-8.
(WebCore::TextCheckerEnchant::checkSpellingOfString): Pass the
original UTF-16 string to checkSpellingOfWord instead of a
converted UTF-8 string.
* platform/text/enchant/TextCheckerEnchant.h: Changed the type of
an argument `word` from CString to String.

LayoutTests:

* platform/gtk/TestExpectations: Unmarked editing/deleting/delete-surrogatepair.html.

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

3 years ago[JSC] Remove repeated iteration of ElementNode
utatane.tea@gmail.com [Tue, 27 Mar 2018 08:49:41 +0000 (08:49 +0000)]
[JSC] Remove repeated iteration of ElementNode
https://bugs.webkit.org/show_bug.cgi?id=183987

Reviewed by Keith Miller.

BytecodeGenerator repeatedly iterates ElementNode to emit the efficient code.
While it is OK for small arrays, this repeated iteration takes much time
if the array is very large. For example, Kraken's initialization code includes
very large array with numeric literals. This makes bytecode compiling so long.

This patch carefully removes unnecessary iteration when emitting arrays.
This reduces one of Kraken/imaging-darkroom's bytecode compiling from 13.169856 ms
to 9.988050 ms.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitNewArrayBuffer):
(JSC::BytecodeGenerator::emitNewArray):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayNode::emitBytecode):
(JSC::ArrayPatternNode::bindValue const):
(JSC::ArrayPatternNode::emitDirectBinding):

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

3 years agoRemove an unnecessary const_cast from BitmapTextureGL::updateContents().
Ms2ger@igalia.com [Tue, 27 Mar 2018 06:59:12 +0000 (06:59 +0000)]
Remove an unnecessary const_cast from BitmapTextureGL::updateContents().
https://bugs.webkit.org/show_bug.cgi?id=184007

Reviewed by Žan Doberšek.

No new tests.

* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::updateContents):

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

3 years agoAdopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
timothy_horton@apple.com [Tue, 27 Mar 2018 04:07:40 +0000 (04:07 +0000)]
Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
https://bugs.webkit.org/show_bug.cgi?id=184030
<rdar://problem/38895281>

Reviewed by Dan Bernstein.

* Configurations/Base.xcconfig:
Source/WebKit:

* Configurations/BaseTarget.xcconfig:
* Configurations/WebKit.xcconfig:

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

3 years agoAdd and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
timothy_horton@apple.com [Mon, 26 Mar 2018 22:28:39 +0000 (22:28 +0000)]
Add and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
https://bugs.webkit.org/show_bug.cgi?id=184026
<rdar://problem/38883321>

Reviewed by Sam Weinig.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):

Source/WTF:

* wtf/Platform.h:

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

3 years agoJIT callOperation() needs to support operations that return SlowPathReturnType differ...
ross.kirsling@sony.com [Mon, 26 Mar 2018 21:41:13 +0000 (21:41 +0000)]
JIT callOperation() needs to support operations that return SlowPathReturnType differently on Windows.
https://bugs.webkit.org/show_bug.cgi?id=183655

Reviewed by Keith Miller.

* jit/CCallHelpers.h:
(JSC::CCallHelpers::ArgCollection::argCount):
(JSC::CCallHelpers::marshallArgumentRegister):
(JSC::CCallHelpers::setupArgumentsImpl):
On Win64, ensure that argCount always includes GPRs and FPRs and that counting starts from 1 for SlowPathReturnType.

* jit/JIT.h:
(JSC::JIT::callOperation):
(JSC::JIT::is64BitType):
(JSC::JIT::is64BitType<void>):
On Win64, ensure special call is used for SlowPathReturnType.

* jit/JITOperations.h:
Update changed type.

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

3 years agoWe should have SSE4 detection in the X86 MacroAssembler.
utatane.tea@gmail.com [Mon, 26 Mar 2018 21:07:21 +0000 (21:07 +0000)]
We should have SSE4 detection in the X86 MacroAssembler.
https://bugs.webkit.org/show_bug.cgi?id=165363

Reviewed by JF Bastien.

Source/JavaScriptCore:

This patch adds popcnt support to WASM in x86_64 environment.
To use it, we refactor our CPUID feature detection in MacroAssemblerX86Common.
Our spec-tests already cover popcnt.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::supportsCountPopulation):
* assembler/MacroAssemblerX86Common.cpp:
(JSC::MacroAssemblerX86Common::getCPUID):
(JSC::MacroAssemblerX86Common::getCPUIDEx):
(JSC::MacroAssemblerX86Common::collectCPUFeatures):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::countPopulation32):
(JSC::MacroAssemblerX86Common::supportsFloatingPointRounding):
(JSC::MacroAssemblerX86Common::supportsCountPopulation):
(JSC::MacroAssemblerX86Common::supportsAVX):
(JSC::MacroAssemblerX86Common::supportsLZCNT):
(JSC::MacroAssemblerX86Common::supportsBMI1):
(JSC::MacroAssemblerX86Common::isSSE2Present):
(JSC::MacroAssemblerX86Common::updateEax1EcxFlags): Deleted.
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::countPopulation64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::popcnt_rr):
(JSC::X86Assembler::popcnt_mr):
(JSC::X86Assembler::popcntq_rr):
(JSC::X86Assembler::popcntq_mr):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addOp<OpType::I32Popcnt>):
(JSC::Wasm::B3IRGenerator::addOp<OpType::I64Popcnt>):

Source/WTF:

GCC 5 supports clobbering PIC registers in inline ASM [1,2].

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47602
[2]: https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=216154

* wtf/Atomics.h:
(WTF::x86_cpuid):

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

3 years agoDFG should know that CreateThis can be effectful
fpizlo@apple.com [Mon, 26 Mar 2018 21:01:16 +0000 (21:01 +0000)]
DFG should know that CreateThis can be effectful
https://bugs.webkit.org/show_bug.cgi?id=184013

Reviewed by Saam Barati.

JSTests:

* stress/create-this-property-change.js: Added.
(Foo):
(RealBar):
(get if):
* stress/create-this-structure-change-without-cse.js: Added.
(Foo):
(RealBar):
(get if):
* stress/create-this-structure-change.js: Added.
(Foo):
(RealBar):
(get if):

Source/JavaScriptCore:

As shown in the tests added in JSTests, CreateThis can be effectful if the constructor this
is a proxy.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):

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

3 years ago[Extra zoom mode] Refactor input view controller presentation and dismissal helpers
wenson_hsieh@apple.com [Mon, 26 Mar 2018 21:00:30 +0000 (21:00 +0000)]
[Extra zoom mode] Refactor input view controller presentation and dismissal helpers
https://bugs.webkit.org/show_bug.cgi?id=184020
Work towards <rdar://problem/38758727>

Reviewed by Tim Horton.

We currently have separate presentation and dismissal helpers for each type of view controller corresponding to
a focused element type. This is excessive, considering that all of these helpers are only invoked from one place
(either -presentViewControllerForCurrentAssistedNode or -dismissAllInputViewControllers), with the exception of
the focused form control overlay.

This refactoring allows us to then adjust the timing of first responder restoration logic, such that the focused
form control view controller can receive forwarded events from the web view. See below for more detail.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView presentFocusedFormControlViewController:]):
(-[WKContentView dismissFocusedFormControlViewController:]):

Remove logic to restore the web view as first responder.

(-[WKContentView presentViewControllerForCurrentAssistedNode]):
(-[WKContentView dismissAllInputViewControllers]):

Restore first responder after dismissing a view controller that was presented when focusing a form control, only
if the web view was first responder before presentation.

(-[WKContentView presentDatePickerViewController:]): Deleted.
(-[WKContentView dismissDatePickerViewController:]): Deleted.
(-[WKContentView presentTimePickerViewController:]): Deleted.
(-[WKContentView dismissTimePickerViewController:]): Deleted.
(-[WKContentView presentSelectMenuViewController:]): Deleted.
(-[WKContentView dismissSelectMenuViewController:]): Deleted.
(-[WKContentView dismissNumberPadViewController:]): Deleted.
(-[WKContentView presentNumberPadViewController:]): Deleted.
(-[WKContentView presentTextInputViewController:]): Deleted.
(-[WKContentView dismissTextInputViewController:]): Deleted.

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