WebKit-https.git
6 months agoUser agent string override for navigator.userAgent should be site specific quirks
rniwa@webkit.org [Tue, 29 Jan 2019 07:15:00 +0000 (07:15 +0000)]
User agent string override for navigator.userAgent should be site specific quirks
https://bugs.webkit.org/show_bug.cgi?id=193950

Reviewed by Brent Fulgham.

Source/WebCore:

In order to make it possible to toggle the UA string override just for navigator.userAgent via Web Inspector,
we need to put this override behind the site specific quirks. Because WebInspector overrides Page's setting
without updating WKPreferences, there is no way for WKWebView client's to know whether the site specific quirks
had been disabled or not.

* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setCustomJavaScriptUserAgentAsSiteSpecificQuirks):
(WebCore::DocumentLoader::customJavaScriptUserAgentAsSiteSpecificQuirks const):
(WebCore::DocumentLoader::setCustomJavaScriptUserAgent): Deleted.
(WebCore::DocumentLoader::customJavaScriptUserAgent const): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::userAgentForJavaScript const):

Source/WebKit:

Renamed the various member variables, functions, properties and selectors.

* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]): Renamed from setCustomJavaScriptUserAgent.
(-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]): Renamed from customJavaScriptUserAgent.

Tools:

Updated per the _WKWebsitePolicies rename.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[CustomJavaScriptUserAgentDelegate _webView:decidePolicyForNavigationAction:userInfo:decisionHandler:]):

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

6 months agoUnreviewed, rolling out r240630.
commit-queue@webkit.org [Tue, 29 Jan 2019 06:59:13 +0000 (06:59 +0000)]
Unreviewed, rolling out r240630.
https://bugs.webkit.org/show_bug.cgi?id=193958

Broke Apple internal builds (Requested by rniwa on #webkit).

Reverted changeset:

"Add back some includes that got removed at some point."
https://bugs.webkit.org/show_bug.cgi?id=193942
https://trac.webkit.org/changeset/240630

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

6 months agoWeb Inspector: provide a way to edit page WebRTC settings on a remote target
drousso@apple.com [Tue, 29 Jan 2019 06:20:56 +0000 (06:20 +0000)]
Web Inspector: provide a way to edit page WebRTC settings on a remote target
https://bugs.webkit.org/show_bug.cgi?id=193863
<rdar://problem/47572764>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Page.json:
Add more values to the `Setting` enum type:
 - `ICECandidateFilteringEnabled`
 - `MediaCaptureRequiresSecureConnection`
 - `MockCaptureDevicesEnabled`

Source/WebCore:

Test: inspector/page/overrideSetting-ICECandidateFilteringEnabled.html
      inspector/page/overrideSetting-MockCaptureDevicesEnabled.html

* inspector/agents/InspectorPageAgent.cpp:

* page/Settings.yaml:
* page/SettingsBase.h:
* page/SettingsBase.cpp:
(SettingsBase::iceCandidateFilteringEnabledChanged): Added.
(SettingsBase::mockCaptureDevicesEnabledChanged): Added.
* Scripts/GenerateSettings.rb:
* Scripts/SettingsTemplates/Settings.cpp.erb:
Add page-level settings for WebRTC preferences.

* Modules/mediastream/UserMediaController.cpp:
(WebCore::UserMediaController::canCallGetUserMedia):

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):

* testing/Internals.h:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::setMockMediaCaptureDevicesEnabled):
(WebCore::Internals::setMediaCaptureRequiresSecureConnection): Added.

* page/DeprecatedGlobalSettings.h:
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::mockCaptureDevicesEnabled): Deleted.
(WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled): Deleted.
(WebCore::DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection): Deleted.
(WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection): Deleted.

Source/WebInspectorUI:

* UserInterface/Base/Main.js:
(WI.loaded):
(WI.initializeTarget):
(WI._handleDeviceSettingsToolbarButtonClicked):
(WI._handleDeviceSettingsToolbarButtonClicked.createCheckbox):
(WI._handleDeviceSettingsToolbarButtonClicked.createColumns): Deleted.
* UserInterface/Views/Main.css:
(.device-settings-content .container): Added.

* Localizations/en.lproj/localizedStrings.js:

Source/WebKit:

* Shared/WebPreferences.yaml:
Add page-level settings for WebRTC preferences.

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
Add page-level settings for WebRTC preferences.

LayoutTests:

* inspector/page/overrideSetting-ICECandidateFilteringEnabled.html: Added.
* inspector/page/overrideSetting-ICECandidateFilteringEnabled-expected.txt: Added.
* inspector/page/overrideSetting-MockCaptureDevicesEnabled.html: Added.
* inspector/page/overrideSetting-MockCaptureDevicesEnabled-expected.txt: Added.
* platform/mac/TestExpectations:

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

6 months agowebkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless...
jer.noble@apple.com [Tue, 29 Jan 2019 06:11:43 +0000 (06:11 +0000)]
webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic.
https://bugs.webkit.org/show_bug.cgi?id=193923
<rdar://problem/45956595>

Reviewed by Eric Carlson.

The value of webkitCurrentPlaybackTargetIsWireless can change in between when the event is scheduled
and when it's actually dispatched. To make this more deterministic, use a GenericTaskQueue to enqueue
setting m_isPlayingToWirelessTarget and dispatch the changed event in the same run-loop.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
(WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget):
(WebCore::HTMLMediaElement::dispatchEvent):
* html/HTMLMediaElement.h:

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

6 months agoREGRESSION (r240553): Crash in WebCore::ScrollingTree::updateTreeFromStateNode
ryanhaddad@apple.com [Tue, 29 Jan 2019 06:01:17 +0000 (06:01 +0000)]
REGRESSION (r240553): Crash in WebCore::ScrollingTree::updateTreeFromStateNode
https://bugs.webkit.org/show_bug.cgi?id=193955

Unreviewed test gardening.

* platform/ios/TestExpectations: Skip crashing test to unblock EWS.

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

6 months agoRemove unnecessary `using namespace WTF`s (or at least restrict their scope).
ross.kirsling@sony.com [Tue, 29 Jan 2019 06:00:30 +0000 (06:00 +0000)]
Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
https://bugs.webkit.org/show_bug.cgi?id=193941

Reviewed by Alex Christensen.

Source/JavaScriptCore:

* API/JSWeakObjectMapRefPrivate.cpp:
* bytecompiler/NodesCodegen.cpp:
* heap/MachineStackMarker.cpp:
* jit/ExecutableAllocator.cpp:
* jsc.cpp:
* parser/Nodes.cpp:
* runtime/DateConstructor.cpp:
* runtime/DateConversion.cpp:
* runtime/DateInstance.cpp:
* runtime/DatePrototype.cpp:
* runtime/InitializeThreading.cpp:
* runtime/IteratorOperations.cpp:
* runtime/JSDateMath.cpp:
* runtime/JSGlobalObjectFunctions.cpp:
* runtime/StringPrototype.cpp:
* runtime/VM.cpp:
* testRegExp.cpp:
* tools/JSDollarVM.cpp:
* yarr/YarrInterpreter.cpp:
* yarr/YarrJIT.cpp:
* yarr/YarrPattern.cpp:
* yarr/YarrUnicodeProperties.cpp:

Source/WebCore:

* css/CSSBasicShapes.cpp:
* css/CSSPrimitiveValue.cpp:
* css/parser/CSSParser.cpp:
* css/parser/CSSParserSelector.cpp:
* css/parser/CSSPropertyParser.cpp:
* dom/Document.cpp:
* dom/EventListenerMap.cpp:
* dom/EventTarget.cpp:
* editing/Editor.cpp:
* html/HTMLElement.cpp:
* html/HTMLFontElement.cpp:
* html/parser/HTMLTokenizer.cpp:
* html/track/TrackBase.cpp:
* loader/FTPDirectoryParser.cpp:
* loader/TextResourceDecoder.cpp:
* loader/cache/CachedResource.cpp:
* page/ContextMenuController.cpp:
* page/Navigator.cpp:
* platform/Length.cpp:
* platform/cocoa/KeyEventCocoa.mm:
* platform/graphics/FontCascade.cpp:
* platform/graphics/WidthIterator.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/ios/KeyEventIOS.mm:
* platform/mac/KeyEventMac.mm:
* platform/network/HTTPParsers.cpp:
* platform/text/TextCodecUTF8.cpp:
* platform/text/TextEncodingRegistry.cpp:
* platform/win/KeyEventWin.cpp:
* rendering/BidiRun.cpp:
* rendering/FloatingObjects.cpp:
* rendering/RenderBlock.cpp:
* rendering/RenderListMarker.cpp:
* rendering/RenderText.cpp:

Source/WebKit:

* Shared/linux/WebMemorySamplerLinux.cpp:

Source/WebKitLegacy/win:

* Plugins/PluginMessageThrottlerWin.cpp:
* Plugins/PluginView.cpp:
* Plugins/PluginViewWin.cpp:

Tools:

* TestWebKitAPI/Tests/WTF/ConcurrentPtrHashSet.cpp:
* TestWebKitAPI/Tests/WTF/Condition.cpp:
* TestWebKitAPI/Tests/WTF/Lock.cpp:
* TestWebKitAPI/Tests/WTF/MetaAllocator.cpp:
* TestWebKitAPI/Tests/WTF/ParkingLot.cpp:
* TestWebKitAPI/Tests/WTF/RedBlackTree.cpp:
* TestWebKitAPI/Tests/WTF/ScopedLambda.cpp:
* TestWebKitAPI/Tests/WTF/Time.cpp:
* TestWebKitAPI/Tests/WTF/UniqueArray.cpp:
* TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp:
* TestWebKitAPI/Tests/WebCore/Logging.cpp:
* WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm:

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

6 months ago[Win] WebCore/platform/Process.h is conflicting with process.h
Hironori.Fujii@sony.com [Tue, 29 Jan 2019 05:58:00 +0000 (05:58 +0000)]
[Win] WebCore/platform/Process.h is conflicting with process.h
https://bugs.webkit.org/show_bug.cgi?id=193944

Reviewed by Ross Kirsling.

Source/WebCore:

Windows has process.h. Rename Process.h to ProcessIdentifier.h.

No new tests because there is no behavior change.

* Sources.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:
* dom/MessagePortIdentifier.h:
* dom/messageports/MessagePortChannel.h:
* dom/messageports/MessagePortChannelProvider.h:
* dom/messageports/MessagePortChannelRegistry.h:
* history/BackForwardItemIdentifier.h:
* page/GlobalWindowIdentifier.h:
* platform/ProcessIdentifier.cpp: Renamed from Source/WebCore/platform/Process.cpp.
(WebCore::Process::setIdentifier):
(WebCore::Process::identifier):
* platform/ProcessIdentifier.h: Renamed from Source/WebCore/platform/Process.h.

Source/WebKit:

* Shared/ChildProcess.h:
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
* Shared/unix/ChildProcessMain.cpp:
* UIProcess/API/APINavigation.h:
* UIProcess/ChildProcessProxy.h:
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/WebProcessPool.cpp:
* UIProcess/WebProcessProxy.h:

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

6 months agoWeb Inspector: Elements tab should toggle visibility for all selected nodes
mattbaker@apple.com [Tue, 29 Jan 2019 05:21:41 +0000 (05:21 +0000)]
Web Inspector: Elements tab should toggle visibility for all selected nodes
https://bugs.webkit.org/show_bug.cgi?id=193089
<rdar://problem/47009256>

Reviewed by Devin Rousso.

Update "Toggle Visibility" command in DOM tree for multiple selection.
When both visible and hidden elements are selected in the DOM tree,
the toggle command behaves contextually. If one or more elements are
visible, they are hidden, otherwise they are shown. The context menu
shows "Hide Elements" or "Show Elements", respectively.

When only one element is selected, or the context menu target element
is not selected, the command continues to be "Toggle Visibility".

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.get isNodeHidden): Added.
(WI.DOMTreeElement.prototype.toggleElementVisibility.inspectedPage_node_injectStyleAndToggleClass):
(WI.DOMTreeElement.prototype.toggleElementVisibility):
(WI.DOMTreeElement.prototype._populateTagContextMenu):

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline):
(WI.DOMTreeOutline.prototype.toggleSelectedElementsVisibility):  Added.
Provide a public method for toggling the visibility of selected DOM nodes.
Used by the "H" keyboard shortcut and DOMTreeElement context menu.

(WI.DOMTreeOutline.prototype._hideElements):
(WI.DOMTreeOutline.prototype._hideElement): Deleted.
Rename for multiple selection.

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

6 months agoUnreviewed, reorder my emails to fix autocomplete in bugzilla
ysuzuki@apple.com [Tue, 29 Jan 2019 04:49:39 +0000 (04:49 +0000)]
Unreviewed, reorder my emails to fix autocomplete in bugzilla

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

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

6 months ago[JSC] Reduce size of memory used for ShadowChicken
ysuzuki@apple.com [Tue, 29 Jan 2019 04:33:33 +0000 (04:33 +0000)]
[JSC] Reduce size of memory used for ShadowChicken
https://bugs.webkit.org/show_bug.cgi?id=193546

Reviewed by Mark Lam.

This patch lazily instantiate ShadowChicken. We do not need this until we start logging ShadowChicken packets.
The removal of ShadowChicken saves 55KB memory.

* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::create):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::ensureShadowChickenPacket):
* heap/Heap.cpp:
(JSC::Heap::stopThePeriphery):
(JSC::Heap::addCoreConstraints):
* jit/CCallHelpers.cpp:
(JSC::CCallHelpers::ensureShadowChickenPacket):
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_log_shadow_chicken_prologue):
(JSC::JIT::emit_op_log_shadow_chicken_tail):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_log_shadow_chicken_prologue):
(JSC::JIT::emit_op_log_shadow_chicken_tail):
* jit/JITOperations.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::setDebugger):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::setDebugger): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::ensureShadowChicken):
* runtime/VM.h:
(JSC::VM::shadowChicken):
* tools/JSDollarVM.cpp:
(JSC::functionShadowChickenFunctionsOnStack):
(JSC::changeDebuggerModeWhenIdle):

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

6 months agoMove platform-specific files out of WTF root directory.
ross.kirsling@sony.com [Tue, 29 Jan 2019 04:00:08 +0000 (04:00 +0000)]
Move platform-specific files out of WTF root directory.
https://bugs.webkit.org/show_bug.cgi?id=193929

Reviewed by Alex Christensen.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/cf/RunLoopTimerCF.cpp: Renamed from Source/WTF/wtf/RunLoopTimerCF.cpp.
* wtf/cf/SchedulePairCF.cpp: Renamed from Source/WTF/wtf/SchedulePairCF.cpp.
* wtf/mac/SchedulePairMac.mm: Renamed from Source/WTF/wtf/SchedulePairMac.mm.
* wtf/posix/OSAllocatorPOSIX.cpp: Renamed from Source/WTF/wtf/OSAllocatorPosix.cpp.
* wtf/posix/ThreadingPOSIX.cpp: Renamed from Source/WTF/wtf/ThreadingPthreads.cpp.
* wtf/win/CONTRIBUTORS.pthreads-win32: Renamed from Source/WTF/wtf/CONTRIBUTORS.pthreads-win32.
* wtf/win/OSAllocatorWin.cpp: Renamed from Source/WTF/wtf/OSAllocatorWin.cpp.
* wtf/win/ThreadSpecificWin.cpp: Renamed from Source/WTF/wtf/ThreadSpecificWin.cpp.
* wtf/win/ThreadingWin.cpp: Renamed from Source/WTF/wtf/ThreadingWin.cpp.

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

6 months agoUpdate Screen Capture preference
jonlee@apple.com [Tue, 29 Jan 2019 03:36:12 +0000 (03:36 +0000)]
Update Screen Capture preference
https://bugs.webkit.org/show_bug.cgi?id=193947
rdar://problem/47620199

Reviewed by Youenn Fablet.

* Shared/WebPreferences.yaml:

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

6 months agoImplement capture for Pointer Events on iOS
graouts@webkit.org [Tue, 29 Jan 2019 03:15:02 +0000 (03:15 +0000)]
Implement capture for Pointer Events on iOS
https://bugs.webkit.org/show_bug.cgi?id=193917
<rdar://problem/47605689>

Reviewed by Dean Jackson.

Source/WebCore:

We add a new PointerCaptureController object which gets notified upon dispatch of pointer events
to implement implicit pointer capture, dispatch the gotpointercapture and lostpointercaptiure events,
and implement the Element APIs for pointer capture: hasPointerCapture(), setPointerCapture() and
releasePointerCapture().

Tests: pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html
       pointerevents/ios/pointer-events-implicit-capture-release-exception.html
       pointerevents/ios/pointer-events-implicit-capture-release.html
       pointerevents/ios/pointer-events-implicit-capture.html
       pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::setPointerCapture):
(WebCore::Element::releasePointerCapture):
(WebCore::Element::hasPointerCapture):
* dom/Element.h:
* dom/Element.idl:
* dom/EventNames.h:
* dom/PointerEvent.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::pointerCaptureController const):
* page/PointerCaptureController.cpp: Added.
(WebCore::PointerCaptureController::PointerCaptureController):
(WebCore::PointerCaptureController::setPointerCapture):
(WebCore::PointerCaptureController::releasePointerCapture):
(WebCore::PointerCaptureController::hasPointerCapture):
(WebCore::PointerCaptureController::pointerLockWasApplied):
(WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
(WebCore::PointerCaptureController::pointerEventWillBeDispatched):
(WebCore::PointerCaptureController::pointerEventWasDispatched):
(WebCore::PointerCaptureController::processPendingPointerCapture):
* page/PointerCaptureController.h: Added.
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
* page/PointerLockController.h:

LayoutTests:

New tests for implicit pointer capture and the Element APIs related to pointer capture.

* pointerevents/ios/pointer-events-implicit-capture-expected.txt: Added.
* pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down-expected.txt: Added.
* pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html: Added.
* pointerevents/ios/pointer-events-implicit-capture-release-exception-expected.txt: Added.
* pointerevents/ios/pointer-events-implicit-capture-release-exception.html: Added.
* pointerevents/ios/pointer-events-implicit-capture-release-expected.txt: Added.
* pointerevents/ios/pointer-events-implicit-capture-release.html: Added.
* pointerevents/ios/pointer-events-implicit-capture.html: Added.
* pointerevents/ios/pointer-events-set-pointer-capture-exceptions-expected.txt: Added.
* pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html: Added.

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

6 months ago[watchOS] Enable Parental Controls content filtering
aestes@apple.com [Tue, 29 Jan 2019 02:59:08 +0000 (02:59 +0000)]
[watchOS] Enable Parental Controls content filtering
https://bugs.webkit.org/show_bug.cgi?id=193939
<rdar://problem/46641912>

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/Platform.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

6 months agoProduce "pen" Pointer Events if using a stylus (e.g. Apple Pencil)
dino@apple.com [Tue, 29 Jan 2019 02:03:45 +0000 (02:03 +0000)]
Produce "pen" Pointer Events if using a stylus (e.g. Apple Pencil)
https://bugs.webkit.org/show_bug.cgi?id=193945
<rdar://problem/47618922>

Reviewed by Antoine Quint.

Source/WebCore:

Calculate the pressure, tiltX and tiltY values for incoming
Pointer Events, which have values when the PlatformTouchEvent
originated from a stylus.

Test: pointerevents/ios/pointer-events-dispatch-on-stylus.html

* dom/PointerEvent.h: Default to "mouse".
* dom/ios/PointerEventIOS.cpp: Calculate the values.

LayoutTests:

Test for stylus -> "pen" Pointer Events.

* pointerevents/ios/pointer-events-dispatch-on-stylus-expected.txt: Added.
* pointerevents/ios/pointer-events-dispatch-on-stylus.html: Added.
* pointerevents/ios/pointer-events-dispatch-on-touch.html: Test for "touch" type.
* pointerevents/utils.js: Add a new helper for stylus event generation.
(prototype.assertMatchesEvents):
(const.ui.new.UIController.prototype.beginStylus):

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

6 months agoREGRESSION (r236481): Move soft-linking of LocalAuthentication.framework out of Local...
ddkilzer@apple.com [Tue, 29 Jan 2019 01:58:33 +0000 (01:58 +0000)]
REGRESSION (r236481): Move soft-linking of LocalAuthentication.framework out of LocalAuthenticationSoftLink.h
<https://webkit.org/b/193884>

Reviewed by Jiewen Tan.

Source/WebKit:

* SourcesCocoa.txt:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:
- Add LocalAuthenticationSoftLink.mm to the project.

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h:
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h.
- Move soft-linking implementation to
  LocalAuthenticationSoftLink.mm.

Tools:

* Scripts/webkitpy/style/checkers/cpp.py:
(check_language): Add LocalAuthentication to
`frameworks_with_soft_links`.

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

6 months agoAdd back some includes that got removed at some point.
timothy@apple.com [Tue, 29 Jan 2019 01:56:08 +0000 (01:56 +0000)]
Add back some includes that got removed at some point.
https://bugs.webkit.org/show_bug.cgi?id=193942

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:

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

6 months agoUnreviewed, fix the test after r240543 not to use @Error / Error in builtins
ysuzuki@apple.com [Tue, 29 Jan 2019 01:53:16 +0000 (01:53 +0000)]
Unreviewed, fix the test after r240543 not to use @Error / Error in builtins
https://bugs.webkit.org/show_bug.cgi?id=193713

* stress/try-get-by-id-should-spill-registers-dfg.js:
(let.f.createBuiltin):

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

6 months agoMake it easier for non-Apple ports to enable dark mode CSS support.
timothy@apple.com [Tue, 29 Jan 2019 01:51:03 +0000 (01:51 +0000)]
Make it easier for non-Apple ports to enable dark mode CSS support.
https://bugs.webkit.org/show_bug.cgi?id=193882

Reviewed by Megan Gardner.

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::updateBackgroundRecursively): Limit use of system
background color to the Mac platform.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::purgeCaches): Purge m_darkColorCache.
(WebCore::RenderTheme::platformColorsDidChange): Reset m_darkColorCache.
(WebCore::RenderTheme::colorCache const): Added m_darkColorCache.
* rendering/RenderTheme.h:
(WebCore::RenderTheme::colorCache const): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::purgeCaches): Removed m_darkColorCache.
(WebCore::RenderThemeMac::platformColorsDidChange): Deleted.
(WebCore::RenderThemeMac::colorCache const): Deleted.

Source/WebKit:

Make modern WebKit code for dark mode usable by other ports, to match
the WebCore parts that have been cross-platform all along.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/PageClient.h:
(WebKit::PageClient::effectiveAppearanceIsDark const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::useDarkAppearance const):
(WebKit::WebPageProxy::effectiveAppearanceDidChange):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
(WebKit::WebPage::setUseDarkAppearance):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]): Fix some defines.
(-[WebView _effectiveAppearanceIsDark]): Ditto.

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

6 months ago[Cocoa] Add SPI to _WKUserContentExtensionStore to retrieve its underlying WKContentR...
aestes@apple.com [Tue, 29 Jan 2019 01:12:31 +0000 (01:12 +0000)]
[Cocoa] Add SPI to _WKUserContentExtensionStore to retrieve its underlying WKContentRuleListStore
https://bugs.webkit.org/show_bug.cgi?id=193927

Reviewed by Tim Horton.

This is useful for clients migrating from _WKUserContentExtensionStore to the modern
WKContentRuleList* APIs.

* UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
(-[_WKUserContentExtensionStore _contentRuleListStore]):
* UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:

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

6 months ago[Win][WebKitTestRunner] Error: test and reference images have different sizes. Test...
Hironori.Fujii@sony.com [Tue, 29 Jan 2019 00:59:12 +0000 (00:59 +0000)]
[Win][WebKitTestRunner] Error: test and reference images have different sizes. Test image is 784x561, reference image is 800x600
https://bugs.webkit.org/show_bug.cgi?id=193891

Reviewed by Ross Kirsling.

There were three problems in window sizes of WebView and the host window.
1. The sizes of pixel image output were incorrect.
2. The host window is going to appear after window.resize was invoked.
3. window.resize resized only the host window, not WebView.

This change solves them with a following approach.
a. PlatformWebView::PlatformWebView creates the initial host window as zero size.
b. Changes the host window style from WS_OVERLAPPEDWINDOW to WS_POPUP
   as well as DumpRenderTree in order to match the client area and the window area.
c. PlatformWebView::resizeTo simply calls PlatformWebView::setWindowFrame as well as Mac port and GTK port.
d. PlatformWebView::setWindowFrame changes both window sizes.
e. PlatformWebView::setWindowFrame moves the host window to the out side of screen if m_options.shouldShowWebView.

* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::PlatformWebView): Create the host window
and WebView as zero size. Use WS_POPUP instead of WS_OVERLAPPEDWINDOW.
(WTR::PlatformWebView::resizeTo): Calls PlatformWebView::setWindowFrame.
(WTR::PlatformWebView::setWindowFrame): Change both window sizes.

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

6 months agoMove soft-linking of ManagedConfiguration.framework out of ManagedConfigurationSPI.h
ddkilzer@apple.com [Tue, 29 Jan 2019 00:58:13 +0000 (00:58 +0000)]
Move soft-linking of ManagedConfiguration.framework out of ManagedConfigurationSPI.h
<https://webkit.org/b/193868>

Reviewed by Daniel Bates.

* Platform/spi/ios/ManagedConfigurationSPI.h:
- Remove soft-linking code from header.
- Add PLATFORM(IOS_FAMILY) && !PLATFORM(IOSMAC) guard.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView _defineForWebView:]):
- Add soft-linking code formerly in ManagedConfigurationSPI.h.
- Change MCFeatureDefinitionLookupAllowed to use soft-link
  function getMCFeatureDefinitionLookupAllowed() to remove the
  #define.

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

6 months agoREGRESSION (r240348): Loading netflix home page panics device
pvollan@apple.com [Tue, 29 Jan 2019 00:55:59 +0000 (00:55 +0000)]
REGRESSION (r240348): Loading netflix home page panics device
https://bugs.webkit.org/show_bug.cgi?id=193936

Reviewed by Alexey Proskuryakov.

Temporarily enable permissive call filtering.

* WebProcess/com.apple.WebProcess.sb.in:

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

6 months agoVersioning.
alancoon@apple.com [Tue, 29 Jan 2019 00:52:45 +0000 (00:52 +0000)]
Versioning.

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

6 months agoToString node actually does GC.
mark.lam@apple.com [Tue, 29 Jan 2019 00:41:45 +0000 (00:41 +0000)]
ToString node actually does GC.
https://bugs.webkit.org/show_bug.cgi?id=193920
<rdar://problem/46695900>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/dfg-to-string-on-int-does-gc.js: Added.
* stress/dfg-to-string-on-string-object-does-not-gc.js: Added.
* stress/dfg-to-string-on-string-or-string-object-does-not-gc.js: Added.

Source/JavaScriptCore:

Other than for StringObjectUse and StringOrStringObjectUse, ToString and
CallStringConstructor can allocate new JSStrings, and hence, can GC.

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):

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

6 months agosvg/text/select-text-inside-non-static-position.html crashes under ScrollingStateTree...
simon.fraser@apple.com [Tue, 29 Jan 2019 00:15:01 +0000 (00:15 +0000)]
svg/text/select-text-inside-non-static-position.html crashes under ScrollingStateTree::unparentChildrenAndDestroyNode()
https://bugs.webkit.org/show_bug.cgi?id=193930

Reviewed by Tim Horton.

ScrollingStateTree::unparentChildrenAndDestroyNode() should make a copy of the 'children' vector
before iterating, since iteration mutates the array.

Tested by ASan tests.

* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::takeChildren):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):

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

6 months agocss3/filters/blur-filter-page-scroll-self.html crashes under WebCore::ScrollingStateN...
simon.fraser@apple.com [Tue, 29 Jan 2019 00:14:58 +0000 (00:14 +0000)]
css3/filters/blur-filter-page-scroll-self.html crashes under WebCore::ScrollingStateNode::ScrollingStateNode
https://bugs.webkit.org/show_bug.cgi?id=193925

Reviewed by Tim Horton.

Some css3/filters/ tests disable accelerated compositing (which is crazy). Make these
tests not crash by ensuring that unparentNode() and unparentChildrenAndDestroyNode() clears the root
node if it's the node being unparented or destroyed.

Tested by existing tests.

* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::unparentNode):
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):

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

6 months agoVersioning.
alancoon@apple.com [Mon, 28 Jan 2019 23:21:26 +0000 (23:21 +0000)]
Versioning.

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

6 months ago[iOS] Attempting to open a Keynote document to iCloud.com from iCloud Files causes...
commit-queue@webkit.org [Mon, 28 Jan 2019 23:18:03 +0000 (23:18 +0000)]
[iOS] Attempting to open a Keynote document to iCloud.com from iCloud Files causes crash
https://bugs.webkit.org/show_bug.cgi?id=193456
<rdar://problem/47275642>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-28
Reviewed by Brent Fulgham.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
Allow access to iconservices.

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

6 months ago[ews-app] Add method to save Step data to database
aakash_jain@apple.com [Mon, 28 Jan 2019 23:07:36 +0000 (23:07 +0000)]
[ews-app] Add method to save Step data to database
https://bugs.webkit.org/show_bug.cgi?id=193890

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/step.py:
(Step.save_step): Method to save step data.
(Step.update_step): Method to update step data.
(Step.get_existing_step): Method to fetch existing step from database.
(Step.is_valid_result): Method to validate valid step result.

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

6 months ago[iOS] Make Window virtual key code computation match Mac
dbates@webkit.org [Mon, 28 Jan 2019 23:00:41 +0000 (23:00 +0000)]
[iOS] Make Window virtual key code computation match Mac
https://bugs.webkit.org/show_bug.cgi?id=193452

Reviewed by Ryosuke Niwa.

Source/WebCore:

Use the same approach for computing the Windows virtual key code on iOS as we do on Mac for
web compatibility. On Mac, we prefer to compute the  Windows virtual key code from the input
strings of the key event and use the key event's keycode as a last resort.

Test: fast/events/ios/key-events-meta-alt-combinations.html

* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::isKeypadEvent): Added.
(WebCore::windowsKeyCodeForKeyEvent): Added.
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Modified to call
WebCore::windowsKeyCodeForKeyEvent() to compute the Windows virtual key code.

Source/WebKit:

Compute the Windows virtual key code from the WebEvent.

* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::createWebKeyboardEvent):

LayoutTests:

Add a test that ensures we do not regress DOM key events dispatches for combinations
of Option and Command + Option key commands.

* fast/events/ios/key-events-meta-alt-combinations-expected.txt: Added.
* fast/events/ios/key-events-meta-alt-combinations.html: Added.
* fast/events/ios/resources/key-tester.js: Added.
(computeDifference):
(areArraysEqual):
(areKeyCommandsEqual):
(KeyCommand):
(KeyCommand.prototype.toString):
(keyCommandsHasCommand):
(computeSubsets.compareByModifierOrder):
(handleKeyUp):
(handleKeyPress):
(log):
(logKeyEvent):
(displayNameForTest):
(nextKeyPress):
(runTest):
(setUp):

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

6 months ago[ews-app] Add method to save Build data to database
aakash_jain@apple.com [Mon, 28 Jan 2019 23:00:35 +0000 (23:00 +0000)]
[ews-app] Add method to save Build data to database
https://bugs.webkit.org/show_bug.cgi?id=193735

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/build.py:
(Build.save_build): Method to save build information to database.
(Build.get_existing_build): Method to fetch existing build from database.
(Build.is_valid_result): Method to validate build result.
* BuildSlaveSupport/ews-app/ews/common/util.py:
(is_valid_int_id): Method to validate valid id.

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

6 months agoREGRESSION (r240498): Storage Access API prompts result is not remembered
bfulgham@apple.com [Mon, 28 Jan 2019 22:34:22 +0000 (22:34 +0000)]
REGRESSION (r240498): Storage Access API prompts result is not remembered
https://bugs.webkit.org/show_bug.cgi?id=193922
<rdar://problem/47608767>

Reviewed by Chris Dumez.

The refactoring in r240498 bypassed bookkeeping in ResourceLoadStatisticsMemoryStore
that kept track of whether a successful user prompt had been encountered. This
patch corrects this codepath so the user is not prompted repeatedly after approving
use of the Storage Access API.

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): Switch from Move operator to
const reference to allow the method to be called by the NetworkProcess.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::grantStorageAccess): Request access through the WebResourceLoadStatistics
object, rather than jumping directly to the NetworkStorageSession.

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

6 months ago[JSCOnly][WTF] Expose FileSystem.
ross.kirsling@sony.com [Mon, 28 Jan 2019 21:35:09 +0000 (21:35 +0000)]
[JSCOnly][WTF] Expose FileSystem.
https://bugs.webkit.org/show_bug.cgi?id=193789

Reviewed by Don Olmstead.

* wtf/FileSystem.h:
* wtf/PlatformJSCOnly.cmake:
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::getVolumeFreeSpace):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::fileSystemRepresentation):

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

6 months agoRegression(PSON) Crash under WebPageProxy::didStartProgress()
cdumez@apple.com [Mon, 28 Jan 2019 21:19:52 +0000 (21:19 +0000)]
Regression(PSON) Crash under WebPageProxy::didStartProgress()
https://bugs.webkit.org/show_bug.cgi?id=193915
<rdar://problem/47560907>

Reviewed by Alex Christensen.

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
Make sure we destroy the ProvisionalPageProxy if the page gets closed as we do not want to keep receiving
IPC after this or even worse, commit the provisional page.

(WebKit::WebPageProxy::didStartProgress):
Add an assertion in didStartProgress() to make sure we do not receive this IPC after the page has been
closed.

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months agoUnreviewed, rolling out r240351.
commit-queue@webkit.org [Mon, 28 Jan 2019 20:21:39 +0000 (20:21 +0000)]
Unreviewed, rolling out r240351.
https://bugs.webkit.org/show_bug.cgi?id=193918

Causes overlapping Timeline records, as some record types
don't have an endTime (Requested by drousso on #webkit).

Reverted changeset:

"WebInspector: Confusingly nested events in the timeline for
Mutation Observers"
https://bugs.webkit.org/show_bug.cgi?id=192884
https://trac.webkit.org/changeset/240351

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

6 months ago[ews-app] Rename id variables
aakash_jain@apple.com [Mon, 28 Jan 2019 20:08:13 +0000 (20:08 +0000)]
[ews-app] Rename id variables
https://bugs.webkit.org/show_bug.cgi?id=193883

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/build.py:
* BuildSlaveSupport/ews-app/ews/models/buildermapping.py:
* BuildSlaveSupport/ews-app/ews/models/step.py:
* BuildSlaveSupport/ews-app/ews/urls.py:
* BuildSlaveSupport/ews-app/ews/views/patch.py:
* BuildSlaveSupport/ews-app/ews/views/results.py:
* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:

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

6 months agoLimit user-agent interactions based on the touch-action property on iOS
graouts@webkit.org [Mon, 28 Jan 2019 19:58:19 +0000 (19:58 +0000)]
Limit user-agent interactions based on the touch-action property on iOS
https://bugs.webkit.org/show_bug.cgi?id=193447

Unreviewed build fix.

* dom/Element.cpp:
(WebCore::parentCrossingFrameBoundaries):

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

6 months ago[ews-app] Allow certain fields to be empty
aakash_jain@apple.com [Mon, 28 Jan 2019 19:54:48 +0000 (19:54 +0000)]
[ews-app] Allow certain fields to be empty
https://bugs.webkit.org/show_bug.cgi?id=193892

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/build.py:
* BuildSlaveSupport/ews-app/ews/models/step.py:

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

6 months agoREGRESSION(?): Web Inspector: Can have multiple Timelines selected after edit mode
mattbaker@apple.com [Mon, 28 Jan 2019 19:53:20 +0000 (19:53 +0000)]
REGRESSION(?): Web Inspector: Can have multiple Timelines selected after edit mode
https://bugs.webkit.org/show_bug.cgi?id=193808
<rdar://problem/47537734>

Reviewed by Devin Rousso.

* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController.prototype.didRemoveItems):

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._indexesForSubtree):
Fix a bug where no IndexSet was returned when passed a TreeElement with
no children. This caused the Timelines tree selection to be corrupted when
entering and exiting edit mode, as TreeElements are inserted and removed.

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

6 months ago[JSC] RegExpConstructor should not have own IsoSubspace
ysuzuki@apple.com [Mon, 28 Jan 2019 19:52:17 +0000 (19:52 +0000)]
[JSC] RegExpConstructor should not have own IsoSubspace
https://bugs.webkit.org/show_bug.cgi?id=193801

Reviewed by Mark Lam.

This patch finally removes RegExpConstructor's cached data to JSGlobalObject and remove IsoSubspace for RegExpConstructor.
sizeof(RegExpConstructor) != sizeof(InternalFunction), so that we have 16KB memory just for RegExpConstructor. But cached
regexp matching data (e.g. `RegExp.$1`) is per-JSGlobalObject one, and we can move this data to JSGlobalObject and remove
it from RegExpConstructor members.

We introduce RegExpGlobalData, which holds the per-global RegExp matching data. And we perform `performMatch` etc. with
JSGlobalObject instead of RegExpConstructor. This change requires small changes in DFG / FTL's RecordRegExpCachedResult
node since its 1st argument is changed from RegExpConstructor to JSGlobalObject.

We also move emptyRegExp from RegExpPrototype to VM's RegExpCache because it is more natural place to put it.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* dfg/DFGOperations.cpp:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileRecordRegExpCachedResult):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* ftl/FTLAbstractHeapRepository.cpp:
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileRecordRegExpCachedResult):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::regExpGlobalData):
(JSC::JSGlobalObject::regExpGlobalDataOffset):
(JSC::JSGlobalObject::regExpConstructor const): Deleted.
* runtime/RegExpCache.cpp:
(JSC::RegExpCache::initialize):
* runtime/RegExpCache.h:
(JSC::RegExpCache::emptyRegExp const):
* runtime/RegExpCachedResult.cpp:
(JSC::RegExpCachedResult::visitAggregate):
(JSC::RegExpCachedResult::visitChildren): Deleted.
* runtime/RegExpCachedResult.h:
(JSC::RegExpCachedResult::RegExpCachedResult): Deleted.
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::RegExpConstructor):
(JSC::regExpConstructorDollar):
(JSC::regExpConstructorInput):
(JSC::regExpConstructorMultiline):
(JSC::regExpConstructorLastMatch):
(JSC::regExpConstructorLastParen):
(JSC::regExpConstructorLeftContext):
(JSC::regExpConstructorRightContext):
(JSC::setRegExpConstructorInput):
(JSC::setRegExpConstructorMultiline):
(JSC::RegExpConstructor::destroy): Deleted.
(JSC::RegExpConstructor::visitChildren): Deleted.
(JSC::RegExpConstructor::getBackref): Deleted.
(JSC::RegExpConstructor::getLastParen): Deleted.
(JSC::RegExpConstructor::getLeftContext): Deleted.
(JSC::RegExpConstructor::getRightContext): Deleted.
* runtime/RegExpConstructor.h:
(JSC::RegExpConstructor::performMatch): Deleted.
(JSC::RegExpConstructor::recordMatch): Deleted.
* runtime/RegExpGlobalData.cpp: Added.
(JSC::RegExpGlobalData::visitAggregate):
(JSC::RegExpGlobalData::getBackref):
(JSC::RegExpGlobalData::getLastParen):
(JSC::RegExpGlobalData::getLeftContext):
(JSC::RegExpGlobalData::getRightContext):
* runtime/RegExpGlobalData.h: Added.
(JSC::RegExpGlobalData::cachedResult):
(JSC::RegExpGlobalData::setMultiline):
(JSC::RegExpGlobalData::multiline const):
(JSC::RegExpGlobalData::input):
(JSC::RegExpGlobalData::offsetOfCachedResult):
* runtime/RegExpGlobalDataInlines.h: Added.
(JSC::RegExpGlobalData::setInput):
(JSC::RegExpGlobalData::performMatch):
(JSC::RegExpGlobalData::recordMatch):
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::matchGlobal):
* runtime/RegExpObjectInlines.h:
(JSC::RegExpObject::execInline):
(JSC::RegExpObject::matchInline):
(JSC::collectMatches):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
(JSC::regExpProtoFuncSearchFast):
(JSC::RegExpPrototype::visitChildren): Deleted.
* runtime/RegExpPrototype.h:
* runtime/StringPrototype.cpp:
(JSC::removeUsingRegExpSearch):
(JSC::replaceUsingRegExpSearch):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

6 months agoAVStreamSession isn't always available, make a HAVE compile flag for it
eric.carlson@apple.com [Mon, 28 Jan 2019 19:19:20 +0000 (19:19 +0000)]
AVStreamSession isn't always available, make a HAVE compile flag for it
https://bugs.webkit.org/show_bug.cgi?id=193889
<rdar://problem/47452863>

Reviewed by Jer Noble.

Source/WebCore:

No new tests, no functional change.

* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
* page/SettingsBase.h:
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): Fix logging.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:

Use a HashMap to associate CMSampleBuffer with SourceBufferPrivateAVFObjC.

(-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): isEqualTo
-> isEqualToString.
(WebCore::sourceBufferMap):
(WebCore::nextMapID):
(WebCore::bufferWasConsumedCallback):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::append):
(WebCore::SourceBufferPrivateAVFObjC::destroyParser):
(WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
(-[WebBufferConsumedContext initWithParent:]): Deleted.
(-[WebBufferConsumedContext parent]): Deleted.

Source/WTF:

* wtf/FeatureDefines.h:

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

6 months agoUpdate MIME type parser
commit-queue@webkit.org [Mon, 28 Jan 2019 19:11:54 +0000 (19:11 +0000)]
Update MIME type parser
https://bugs.webkit.org/show_bug.cgi?id=180526

Patch by Rob Buis <rbuis@igalia.com> on 2019-01-28
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

Update improved test expectations.

* web-platform-tests/xhr/overridemimetype-blob-expected.txt:

Source/WebCore:

I overlooked step 11.9.3 [1], for Mimesniff we should not
bail out on missing subtype, but keep trying. Note
that Rfc2045 does require bailing out, as before.

Test: ParsedContentType unittest

[1] https://mimesniff.spec.whatwg.org/#parse-a-mime-type

* platform/network/ParsedContentType.cpp:
(WebCore::parseToken):
(WebCore::parseContentType):

Tools:

* TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp:
(TestWebKitAPI::TEST):

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

6 months agoUnreviewed follow-up to r240557, restore a call to makeString
mcatanzaro@igalia.com [Mon, 28 Jan 2019 19:09:40 +0000 (19:09 +0000)]
Unreviewed follow-up to r240557, restore a call to makeString
https://bugs.webkit.org/show_bug.cgi?id=192742
<rdar://problem/46757369>

It works if we add this #include that was missing. I got confused by the error messages and
missed that there were two similarly-named headers.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):

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

6 months agoLimit user-agent interactions based on the touch-action property on iOS
graouts@webkit.org [Mon, 28 Jan 2019 18:35:00 +0000 (18:35 +0000)]
Limit user-agent interactions based on the touch-action property on iOS
https://bugs.webkit.org/show_bug.cgi?id=193447

Unreviewed build fix.

* UIProcess/API/Cocoa/WKWebView.mm:

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

6 months ago[css-logical] Reject unitless length quirk in 'inset' shorthand
commit-queue@webkit.org [Mon, 28 Jan 2019 17:44:22 +0000 (17:44 +0000)]
[css-logical] Reject unitless length quirk in 'inset' shorthand
https://bugs.webkit.org/show_bug.cgi?id=193773

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-28
Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Import WPT tests that check that the unitless length quirk is not
allowed in the 'inset' shorthand.

* resources/import-expectations.json:
* web-platform-tests/quirks/support/test-ref-iframe.js: Added.
(setupIframe):
* web-platform-tests/quirks/support/w3c-import.log: Added.
* web-platform-tests/quirks/unitless-length/excluded-properties-001-expected.txt: Added.
* web-platform-tests/quirks/unitless-length/excluded-properties-001.html: Added.
* web-platform-tests/quirks/unitless-length/excluded-properties-002-expected.txt: Added.
* web-platform-tests/quirks/unitless-length/excluded-properties-002.html: Added.
* web-platform-tests/quirks/unitless-length/excluded-properties-003-expected.txt: Added.
* web-platform-tests/quirks/unitless-length/excluded-properties-003.html: Added.
* web-platform-tests/quirks/unitless-length/limited-quirks-expected.txt: Added.
* web-platform-tests/quirks/unitless-length/limited-quirks.html: Added.
* web-platform-tests/quirks/unitless-length/no-quirks-expected.txt: Added.
* web-platform-tests/quirks/unitless-length/no-quirks.html: Added.
* web-platform-tests/quirks/unitless-length/quirks-expected.txt: Added.
* web-platform-tests/quirks/unitless-length/quirks.html: Added.
* web-platform-tests/quirks/unitless-length/support/common.js: Added.
(onload):
* web-platform-tests/quirks/unitless-length/support/w3c-import.log: Added.
* web-platform-tests/quirks/unitless-length/w3c-import.log: Added.

Source/WebCore:

Even though its longhands ('top', 'right', 'bottom', 'left') accept the
unitless length quirk, the 'inset' shorthand is a new CSS property and
should reject it. This was resolved by the CSS WG in
https://github.com/w3c/csswg-drafts/issues/3525#issuecomment-456902648

Tests: imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html
       imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-002.html
       imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html
       imported/w3c/web-platform-tests/quirks/unitless-length/limited-quirks.html
       imported/w3c/web-platform-tests/quirks/unitless-length/no-quirks.html
       imported/w3c/web-platform-tests/quirks/unitless-length/quirks.html

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):

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

6 months agoLimit user-agent interactions based on the touch-action property on iOS
graouts@webkit.org [Mon, 28 Jan 2019 17:33:38 +0000 (17:33 +0000)]
Limit user-agent interactions based on the touch-action property on iOS
https://bugs.webkit.org/show_bug.cgi?id=193447

Unreviewed build fix.

* UIProcess/ios/WKContentViewInteraction.mm:

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

6 months agoRemove the UIProcess components of the ResourceLoadStatistics code
bfulgham@apple.com [Mon, 28 Jan 2019 17:29:44 +0000 (17:29 +0000)]
Remove the UIProcess components of the ResourceLoadStatistics code
https://bugs.webkit.org/show_bug.cgi?id=193303
<rdar://problem/47160073>

Reviewed by Chris Dumez.

Now that the ResourceLoadStatistics code is running in the NetworkProcess, we can get rid
of the UIProcess copies of these routines.

Tested by existing ResourceLoadStatistics and StorageAccess tests.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
(WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
(WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
(WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
(WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
(WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
(WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
(WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
(WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
(WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
(WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setMaxStatisticsEntries):
(WebKit::WebsiteDataStore::setPruneEntriesDownTo):
(WebKit::WebsiteDataStore::setGrandfatheringTime):
(WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
(WebKit::WebsiteDataStore::isPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
(WebKit::WebsiteDataStore::isVeryPrevalentResource):
(WebKit::WebsiteDataStore::setVeryPrevalentResource):
(WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
(WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
(WebKit::WebsiteDataStore::clearPrevalentResource):
(WebKit::WebsiteDataStore::resetParametersToDefaultValues):
(WebKit::WebsiteDataStore::submitTelemetry):
(WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
(WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::WebsiteDataStore::setLastSeen):
(WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::WebsiteDataStore::hasStorageAccess):
(WebKit::WebsiteDataStore::requestStorageAccess):
(WebKit::WebsiteDataStore::grantStorageAccess):
(WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
(WebKit::WebsiteDataStore::logUserInteraction):
(WebKit::WebsiteDataStore::hasHadUserInteraction):
(WebKit::WebsiteDataStore::clearUserInteraction):
(WebKit::WebsiteDataStore::setGrandfathered):
(WebKit::WebsiteDataStore::webProcessWillOpenConnection):
(WebKit::WebsiteDataStore::webProcessDidCloseConnection):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
(WebKit::WebsiteDataStore::didCreateNetworkProcess):
(WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
(WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Deleted.
(WebKit::WebsiteDataStore::setCacheMaxAgeCap): Deleted.
(WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor): Deleted.
(WebKit::WebsiteDataStore::setAgeCapForClientSideCookies): Deleted.
(WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler): Deleted.
(WebKit::WebsiteDataStore::grantStorageAccessHandler): Deleted.
(WebKit::WebsiteDataStore::removeAllStorageAccessHandler): Deleted.
(WebKit::WebsiteDataStore::removePrevalentDomains): Deleted.
(WebKit::WebsiteDataStore::isGrandfathered): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:

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

6 months ago[LFC][MarginCollapsing][Quirks] Quirk margin values get propagated through margin...
zalan@apple.com [Mon, 28 Jan 2019 16:20:17 +0000 (16:20 +0000)]
[LFC][MarginCollapsing][Quirks] Quirk margin values get propagated through margin collapsing
https://bugs.webkit.org/show_bug.cgi?id=193896

Reviewed by Antti Koivisto.

Source/WebCore:

This patch implements quirk margin value collapsing. There are a few "quirk" rules when it comes to margin collapsing.

1. Collapsed quirk margin values are ignored on quirk containers

    <body>
      <p> p elements have 1em vertical (top/bottom) quirk margin
    </body>

    In quirk mode, <p> and <body> (quirk container) collapses their vertical margins but <p>'s quirk values(1qem -> 16px) are ignored.
    Used vertical margin values on the <body> are top: 8px bottom: 8px.

2. Quirk margin values are turned into non-quirk values when collapsed with non-zero, non-quirk margins.

    <body>
      <div style="margin-top: 1px">
        <p> p elements have 1em vertical (top/bottom) quirk margin
      </div>
    </body>

    When <p>'s vertical margin collapses with the parent <div>,
    - the collapsed before value becomes 16px (max(1qem, 1px)) and this collapsed value is now considered as a non-quirk value
    - the collapsed after value stays 1qem quirk value.

    When <div> collapses with <body>
    - the collapsed before value becomes 16px (max(16px, 8px))
    - the <div>'s quirk after value gets ignored and the collapsed after value stays 8px.
    Used vertical margin values on the <body> are top: 16px (1em) bottom: 8px.

* layout/MarginTypes.h:
(WebCore::Layout::PositiveAndNegativeVerticalMargin::Values::isNonZero const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin):
(WebCore::Layout::hasMarginBeforeQuirkValue): Deleted.
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter): Deleted.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
(WebCore::Layout::computedPositiveAndNegativeMargin):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

6 months ago[LFC][BFC] Remove redundant vertical positioning in BlockFormattingContext::computeFl...
zalan@apple.com [Mon, 28 Jan 2019 15:43:00 +0000 (15:43 +0000)]
[LFC][BFC] Remove redundant vertical positioning in BlockFormattingContext::computeFloatingPosition
https://bugs.webkit.org/show_bug.cgi?id=193872

Reviewed by Antti Koivisto.

This is taken care of by verticalPositionWithMargin() in BlockFormattingContext::computeHeightAndMargin().

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

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

6 months agoAdd missing #include in ScrollingTreeFrameScrollingNode.cpp
commit-queue@webkit.org [Mon, 28 Jan 2019 15:31:49 +0000 (15:31 +0000)]
Add missing #include in ScrollingTreeFrameScrollingNode.cpp
https://bugs.webkit.org/show_bug.cgi?id=193905

Patch by cathie chen <cathiechen@igalia.com> on 2019-01-28
Reviewed by Frédéric Wang.

* page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add
#include "ScrollingStateFrameScrollingNode.h"

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

6 months ago[LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height.
zalan@apple.com [Mon, 28 Jan 2019 15:29:28 +0000 (15:29 +0000)]
[LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height.
https://bugs.webkit.org/show_bug.cgi?id=193894

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):

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

6 months agoLimit user-agent interactions based on the touch-action property on iOS
graouts@webkit.org [Mon, 28 Jan 2019 15:08:54 +0000 (15:08 +0000)]
Limit user-agent interactions based on the touch-action property on iOS
https://bugs.webkit.org/show_bug.cgi?id=193447
<rdar://problem/47283874>

Reviewed by Antti Koivisto and Simon Fraser.

Source/WebCore:

We now compile a list of elements with a non-auto touch-action property that is updated whenever an element has its style changed
or is removed from its document. When the content of that list changes, we inform the scrolling coordinator such that it can compile
a list of TouchActionData structures which hold the touch-action value, the ID of the nearest scroll node and the Region containing
the bounds of each of those elements to send it up to the UI process along with touch regions. Computing the list of allowed touch
actions for a given element accounts for not only the value specified directly on that element's style, but also in its hierarchy,
crossing any frame boundary towards the top-level document's root node.

Tests: pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html
       pointerevents/ios/touch-action-none-on-iframe.html
       pointerevents/ios/touch-action-none-on-parent.html
       pointerevents/ios/touch-action-none.html
       pointerevents/ios/touch-action-pan-x-pan-y.html
       pointerevents/ios/touch-action-pan-x.html
       pointerevents/ios/touch-action-pan-y.html
       pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html
       pointerevents/ios/touch-action-pinch-zoom-prevents-scrolling.html

* WebCore.xcodeproj/project.pbxproj: Update how certain headers are exposed such that they can be used from WebKit.
* dom/Document.cpp:
(WebCore::Document::invalidateRenderingDependentRegions):
(WebCore::Document::nodeWillBeRemoved): Ensure a node that is being removed from this document is no longer listed in its
list of elements with a non-auto touch-action property.
(WebCore::Document::absoluteEventRegionForNode):
(WebCore::Document::absoluteRegionForEventTargets):
(WebCore::Document::updateTouchActionElements): Create a list of elements with a non-auto touch-action property if one doesn't
exist yet and update it to add the given element if it contains a non-auto touch-action, or remove it if it doesn't. If the contents
of that list changed as a result, the scrolling coordinator is informed.
* dom/Document.h:
(WebCore::Document:: const):
* dom/Element.cpp:
(WebCore::parentCrossingFrameBoundaries):
(WebCore::Element::computedTouchActions const): Provide the list of allowed touch actions accounting for the "touch-action" property
specified on this element and all of its hierarchy, crossing frame boundary.
(WebCore::Element::nearestScrollingNodeIDUsingTouchOverflowScrolling const): Provide the ScrollingNodeID, if any, for the nearest scrolling node
for that element. This will allow the UI process to identify which scroll view's behavior to customize to reflect the element's allowed
touch actions.
* dom/Element.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): Compute the region for all elements with a non-auto touch-action property
throughout the provided frame and all of its subframes.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollableAreaParameters::operator== const): Deleted.
* page/scrolling/ScrollingCoordinatorTypes.h: Added.
(WebCore::ScrollableAreaParameters::operator== const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::touchActionDataAtPoint const): Query the list of TouchActionData objects for a match based on the provided point. Right
now the logic is pretty crude, stopping at the first TouchActionData for which the region contains the provided point, but future patches will
account for overlap and nesting.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeNode.h:
* platform/EventTrackingRegions.cpp:
(WebCore::operator==):
* platform/EventTrackingRegions.h:
(WebCore::operator!=):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement): Update the list of elements with a non-auto touch-action property when an element's style changes.

Source/WebKit:

Handle the "none", "pan-x", "pan-y" and "pinch-zoom" values for the touch-action property by querying the scrolling tree whenever a touch begins
to identify whether its point is contained within the region of an element with a non-auto touch-action property. If it is, we use the list of
permitted touch actions such to then customize the behavior of the nearest scroll view to pan or zoom only as instructed.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<TouchActionData>::encode):
(IPC::ArgumentCoder<TouchActionData>::decode):
(IPC::ArgumentCoder<EventTrackingRegions>::encode):
(IPC::ArgumentCoder<EventTrackingRegions>::decode):
(IPC::ArgumentCoder<Region>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Account for panning constraints set on the content view to prevent deceleration
to pan the view if it ought not.
(-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Implement an additional
UIScrollView delegation method to apply the panning constraints set on the content view while panning.
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::touchActionDataAtPoint const):
(WebKit::RemoteScrollingCoordinatorProxy::touchActionDataForScrollNodeID const):
(WebKit::RemoteScrollingCoordinatorProxy::setTouchDataForTouchIdentifier):
(WebKit::RemoteScrollingCoordinatorProxy::clearTouchDataForTouchIdentifier):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Apply the same logic as in WKWebView.
(-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Apply
the same logic as in WKWebView.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::touchActionData const):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isScrollingOrZooming const):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView preventsPanningInXAxis]):
(-[WKContentView preventsPanningInYAxis]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _handleTouchActionsForTouchEvent:]): As we process touches, check whether there are touch actions set for this touch's points' locations. Based
on those touch actions, either setDefaultPrevented on the _touchEventGestureRecognizer if the touch action is "none" or selectively disable panning and zooming.
(-[WKContentView _resetPanningPreventionFlags]):
(-[WKContentView _didEndScrollingOrZooming]):

LayoutTests:

Add a new series of tests that check that the "none", "pan-x", "pan-y" and "pinch-zoom" values have the expected
impact on page panning on iOS.

* pointerevents/ios/touch-action-none-expected.txt: Added.
* pointerevents/ios/touch-action-none-in-overflow-scrolling-touch-expected.txt: Added.
* pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html: Added.
* pointerevents/ios/touch-action-none-on-iframe-expected.txt: Added.
* pointerevents/ios/touch-action-none-on-iframe.html: Added.
* pointerevents/ios/touch-action-none-on-parent-expected.txt: Added.
* pointerevents/ios/touch-action-none-on-parent.html: Added.
* pointerevents/ios/touch-action-none.html: Added.
* pointerevents/ios/touch-action-pan-x-expected.txt: Added.
* pointerevents/ios/touch-action-pan-x-pan-y-expected.txt: Added.
* pointerevents/ios/touch-action-pan-x-pan-y.html: Added.
* pointerevents/ios/touch-action-pan-x.html: Added.
* pointerevents/ios/touch-action-pan-y-expected.txt: Added.
* pointerevents/ios/touch-action-pan-y.html: Added.
* pointerevents/ios/touch-action-pinch-zoom-allows-zooming-expected.txt: Added.
* pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html: Added.
* pointerevents/ios/touch-action-pinch-zoom-prevents-scrolling-expected.txt: Added.
* pointerevents/ios/touch-action-pinch-zoom-prevents-scrolling.html: Added.

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

6 months agoWebUserContentController::removeUserScriptMessageHandlerInternal may deref and delete...
antti@apple.com [Mon, 28 Jan 2019 13:15:03 +0000 (13:15 +0000)]
WebUserContentController::removeUserScriptMessageHandlerInternal may deref and delete itself
https://bugs.webkit.org/show_bug.cgi?id=193901
<rdar://problem/47338669>

Reviewed by David Kilzer.

Don't know how to repro.

* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):

Calling userMessageHandlers.removeFirstMatching() may remove the last ref to this
(because WebUserMessageHandlerDescriptorProxy refs WebUserContentController).
Fix by protecting this over the function.

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

6 months agoWeb Inspector: Add Changes panel to Elements tab
nvasilyev@apple.com [Mon, 28 Jan 2019 09:29:20 +0000 (09:29 +0000)]
Web Inspector: Add Changes panel to Elements tab
https://bugs.webkit.org/show_bug.cgi?id=193803

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Introduce the new experimental Changes Panel. It shows a list of CSS changes
made via Web Inspector, so the changes could be copied to the source files.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:
* UserInterface/Base/Utilities.js:
(Array.diffArrays): Added.

* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager):
(WI.CSSManager.prototype.get modifiedCSSRules):
(WI.CSSManager.prototype.addModifiedCSSRule):
(WI.CSSManager.prototype.removeModifiedCSSRule):
(WI.CSSManager.prototype._mainResourceDidChange):

* UserInterface/Main.html:
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty):
(WI.CSSProperty.prototype.remove):
(WI.CSSProperty.prototype.replaceWithText):
(WI.CSSProperty.prototype.commentOut):
(WI.CSSProperty.prototype.set text):
(WI.CSSProperty.prototype.get modified):
(WI.CSSProperty.prototype.set name):
(WI.CSSProperty.prototype.set rawValue):
(WI.CSSProperty.prototype.get initialState):
(WI.CSSProperty.prototype._updateOwnerStyleText):
(WI.CSSProperty.prototype._markModified):
Mark CSSProperty modified *before* making any changes to copy its initial state.

* UserInterface/Models/CSSRule.js:
(WI.CSSRule):
(WI.CSSRule.prototype.get id):
(WI.CSSRule.prototype.get initialState):
(WI.CSSRule.prototype.get stringId):
(WI.CSSRule.prototype.markModified):

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration):
(WI.CSSStyleDeclaration.prototype.get initialState):
(WI.CSSStyleDeclaration.prototype.get enabledProperties):
(WI.CSSStyleDeclaration.prototype.get properties):
(WI.CSSStyleDeclaration.prototype.set properties):
(WI.CSSStyleDeclaration.prototype.propertyForName):
(WI.CSSStyleDeclaration.prototype.newBlankProperty):
(WI.CSSStyleDeclaration.prototype.markModified):

* UserInterface/Views/ChangesDetailsSidebarPanel.css: Added.
(.sidebar > .panel.changes-panel):
(.sidebar > .panel.changes-panel:not(.empty)):
(.sidebar > .panel.changes-panel.empty):
(.changes-panel ins):
(.changes-panel del):
(.changes-panel del.css-property::before):
(.changes-panel ins.css-property::before):
(@media (prefers-color-scheme: dark)):

* UserInterface/Views/ChangesDetailsSidebarPanel.js: Added.
(WI.ChangesDetailsSidebarPanel):
(WI.ChangesDetailsSidebarPanel.prototype.inspect):
(WI.ChangesDetailsSidebarPanel.prototype.supportsDOMNode):
(WI.ChangesDetailsSidebarPanel.prototype.shown):
(WI.ChangesDetailsSidebarPanel.prototype.detached):
(WI.ChangesDetailsSidebarPanel.prototype.layout):
(WI.ChangesDetailsSidebarPanel.prototype._mainResourceDidChange):

* UserInterface/Views/ElementsTabContentView.js:
(WI.ElementsTabContentView):

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor .property):
(.spreadsheet-style-declaration-editor .property.modified):
(.spreadsheet-style-declaration-editor .property.modified:not(.selected)):
(@media (prefers-color-scheme: dark)):

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.updateStatus):

LayoutTests:

Test newly added Array.diffArrays.

* inspector/unit-tests/array-utilities-expected.txt:
* inspector/unit-tests/array-utilities.html:
Use the old `InspectorTest.log` method since it shows diffs for actual and expected text.

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

6 months agoUnreviewed, fix WPE/GTK debug builds after r240557
mcatanzaro@igalia.com [Mon, 28 Jan 2019 03:03:31 +0000 (03:03 +0000)]
Unreviewed, fix WPE/GTK debug builds after r240557
https://bugs.webkit.org/show_bug.cgi?id=192742
<rdar://problem/46757369>

Also fix an improper format string that was recently added in a different commit.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):

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

6 months agoReplace many uses of String::format with more type-safe alternatives
darin@apple.com [Mon, 28 Jan 2019 01:56:29 +0000 (01:56 +0000)]
Replace many uses of String::format with more type-safe alternatives
https://bugs.webkit.org/show_bug.cgi?id=192742

Reviewed by Mark Lam.

Source/JavaScriptCore:

* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::makeCall): Use makeString.
(Inspector::InjectedScriptBase::makeAsyncCall): Ditto.
* inspector/InspectorBackendDispatcher.cpp:
(Inspector::BackendDispatcher::getPropertyValue): Ditto.
* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::enable): Ditto.
* jsc.cpp:
(FunctionJSCStackFunctor::operator() const): Ditto.

* runtime/CodeCache.cpp:
(JSC::writeCodeBlock): Use makeString's numeric capabilities instead of
using String::number.

* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::initializeDateTimeFormat): Use string concatenation.
* runtime/IntlObject.cpp:
(JSC::canonicalizeLocaleList): Ditto.

Source/WebCore:

A while back, String::format was more efficient than string concatenation,
but that is no longer true, and we should prefer String::number, makeString,
or concatenation with the "+" operator to String::format for new code.

This is not as good for programmers who are fond of printf formatting
style, and in some cases it's a little harder to read the strings
interspersed with variables rather than a format string, but it's better
in a few ways:

- more efficient (I didn't measure the difference, but it's definitely
  slower to use String::Format which calls vsnprintf twice than to use
  the WTF code)
- works in a type-safe way without a need to use a format specifier such
  as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
  subtle differences between platforms
- allows us to use StringView in some cases to sidestep the need to
  allocate temporary WTF::String objects
- does not require converting each WTF::String to a C string, allowing
  us to remove many cases of ".utf8().data()" and similar expressions,
  eliminating the allocation of temporary WTF::CString objects

This patch covers a batch of easiest-to-convert call sites.
Later patches will allow us to deprecate or remove String::format.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
(WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBGetRecordData.cpp:
(WebCore::IDBGetRecordData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString const): Ditto.
(WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::loggingString const): Ditto.
* Modules/webdatabase/Database.cpp:
(WebCore::formatErrorMessage): Ditto.
* Modules/webdatabase/SQLError.h:
(WebCore::SQLError::create): Ditto.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Use makeString.

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

Source/WebKit:

* Shared/WebMemorySampler.cpp:
(WebKit::WebMemorySampler::writeHeaders): Use makeString.

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential): Use string concatentation.

* UIProcess/WebInspectorUtilities.cpp:
(WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
(WebKit::WebProcessPool::startMemorySampler): Ditto.

Source/WebKitLegacy:

* Shared/WebMemorySampler.cpp:
(WebKit::WebMemorySampler::writeHeaders): Use makeString.

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential): Use string concatentation.

* UIProcess/WebInspectorUtilities.cpp:
(WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
(WebKit::WebProcessPool::startMemorySampler): Ditto.

Source/WTF:

* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply): Use makeString.

* wtf/dtoa.cpp:
(WTF::dtoa): Use sprintf instead of String::format in the comments,
since these functions have nothing to do with WTF::String.

Tools:

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::cacheTestRunnerCallback): Use makeString.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveAuthenticationChallenge): Use makeString.
(WTR::TestController::downloadDidFail): Use an ASCIILiteral via the _s syntax.

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

6 months agoRemove a couple of PLATFORM defines intended for watchOS
wenson_hsieh@apple.com [Sun, 27 Jan 2019 23:51:29 +0000 (23:51 +0000)]
Remove a couple of PLATFORM defines intended for watchOS
https://bugs.webkit.org/show_bug.cgi?id=193888

Reviewed by Alexey Proskuryakov.

Remove the use of !PLATFORM(WATCH), since this is true on every platform.

* editing/cocoa/DictionaryLookup.mm:

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

6 months agoUse a load optimizer for some sites
jiewen_tan@apple.com [Sun, 27 Jan 2019 20:44:05 +0000 (20:44 +0000)]
Use a load optimizer for some sites
https://bugs.webkit.org/show_bug.cgi?id=193881
<rdar://problem/46325455>

Reviewed by Brent Fulgham.

Source/WebCore:

Expose FormData::flatten to be used by the load optimizer.

* WebCore.xcodeproj/project.pbxproj:
* platform/network/FormData.h:

Source/WebKit:

We will try to speed up some sites with a dedicated load optimizer. The load optimizer lives
within the WebsiteDataStore as one client instance should have only one and it should live
as long as the client lives. How does the load optimizer work? It intercepts every load in
the navigation state. If a request meets some requirements, it will then fetch the request
from its own cache. Once the fetch succeeds, the original load will be ignored and the
optimizer will display the cached content.

Covered by API tests.

* SourcesCocoa.txt:
* UIProcess/Cocoa/LoadOptimizer.h: Added.
* UIProcess/Cocoa/LoadOptimizer.mm: Added.
* UIProcess/Cocoa/MediaCaptureUtilities.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::tryInterceptNavigation):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::tryAppLink): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::loadOptimizer):
* WebKit.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm: Added.

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

6 months agoWeb Automation: add support for simulating single touches to Automation.performIntera...
bburg@apple.com [Sun, 27 Jan 2019 18:36:11 +0000 (18:36 +0000)]
Web Automation: add support for simulating single touches to Automation.performInteractionSequence
https://bugs.webkit.org/show_bug.cgi?id=193852
<rdar://problem/28360781>

Reviewed by Joseph Pecoraro and Simon Fraser.

This patch makes it possible to simulate touches via the Actions API. The approach is to
use a stripped down version of HIDEventGenerator to send HID events to the UIWindow.
The initial version supports a single touch point; this may be expanded if needed, but
so far it hasn't been an impediment when running desktop-oriented WebDriver test suites.

As part of implementing this support, I went through and added [somewhat obnoxious] ENABLE()
guards so that we don't mistakenly compile mouse support on iOS and touch on Mac,
and vice versa. Each of the interaction methods---touch, mouse, keyboard---can be independently
compiled out. If none is supported (i.e., Windows), then we don't even try to compile
platformSimulate*Interaction methods or SimulatedInputDispatcher. This allows WebAutomationSession
to not include members and code that are never going to be used on a particular platform.

This functionality is covered by existing WebDriver test suites that use Element Click command.
Additional tests that explicitly include 'touch' pointerType will be submitted to WPT later.

* UIProcess/Automation/Automation.json: Update comment.

* UIProcess/Automation/SimulatedInputDispatcher.h:
* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
- Add appropriate guards for code specific to each interaction type.
- Handle SimulatedInputSourceType::Touch and call out to dispatch events.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::WebAutomationSession):
(WebKit::WebAutomationSession::terminate):
(WebKit::WebAutomationSession::willShowJavaScriptDialog):
(WebKit::WebAutomationSession::mouseEventsFlushedForPage):
(WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
(WebKit::WebAutomationSession::willClosePage):
Add appropriate guards for code specific to each interaction type.

(WebKit::WebAutomationSession::isSimulatingUserInteraction const):
Add new hook so that we can detect when a touch simulation is in progress.
We don't rely on checking WebKit's event queue, so use a flag.

(WebKit::WebAutomationSession::simulateTouchInteraction):
(WebKit::WebAutomationSession::performMouseInteraction):
(WebKit::WebAutomationSession::performKeyboardInteractions):
(WebKit::WebAutomationSession::cancelInteractionSequence):
(WebKit::WebAutomationSession::performInteractionSequence):
- Add appropriate guards for code specific to each interaction type.
- Bail out immediately if a requested interaction type is not supported.
- Shim Touch input type to Mouse if mouse is not supported but touches are.
Nearly all WebDriver tests in the wild will be requesting a 'mouse' pointerType,
so this is necessary for compatibility. It's easier to shim at this level than try
to implement platformSimulateMouseInteraction for iOS because
platformSimulateMouseinteraction does not use a completion handler but the iOS
implementation would require that.

(WebKit::WebAutomationSession::platformSimulateMouseInteraction): Deleted.
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Deleted.
- Remove these stubs. Platform methods of this class are no longer being filled
with stubs on unsupported platforms because we expect the command to fail earlier.

* UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
(WebKit::WebAutomationSession::platformSimulateTouchInteraction):
- Add appropriate guards for code specific to each interaction type.
- Implement new platform method to simulate touches. This uses _WKTouchEventGenerator.

* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
Add appropriate guards for code specific to each interaction type.

* UIProcess/_WKTouchEventGenerator.h: Added.
* UIProcess/_WKTouchEventGenerator.mm: Added.
(simpleCurveInterpolation):
(calculateNextCurveLocation):
(delayBetweenMove):
(+[_WKTouchEventGenerator sharedTouchEventGenerator]):
(+[_WKTouchEventGenerator nextEventCallbackID]):
(-[_WKTouchEventGenerator init]):
(-[_WKTouchEventGenerator dealloc]):
(-[_WKTouchEventGenerator _createIOHIDEventType:]):
(-[_WKTouchEventGenerator _sendHIDEvent:]):
(-[_WKTouchEventGenerator _sendMarkerHIDEventWithCompletionBlock:]):
(-[_WKTouchEventGenerator _updateTouchPoints:count:]):
(-[_WKTouchEventGenerator touchDownAtPoints:touchCount:]):
(-[_WKTouchEventGenerator touchDown:touchCount:]):
(-[_WKTouchEventGenerator touchDown:]):
(-[_WKTouchEventGenerator liftUpAtPoints:touchCount:]):
(-[_WKTouchEventGenerator liftUp:touchCount:]):
(-[_WKTouchEventGenerator liftUp:]):
(-[_WKTouchEventGenerator moveToPoints:touchCount:duration:]):
(-[_WKTouchEventGenerator touchDown:completionBlock:]):
(-[_WKTouchEventGenerator liftUp:completionBlock:]):
(-[_WKTouchEventGenerator moveToPoint:duration:completionBlock:]):
(-[_WKTouchEventGenerator receivedHIDEvent:]):
Copied and simplified from HIDEventGenerator in WebKitTestRunner.

* WebKit.xcodeproj/project.pbxproj:
Add _WKTouchEventGenerator.{h,mm} and make it a private header. The client needs to
route received HID events to -receivedHIDEvent: in order to detect when the marker
HID event has been processed (and thus the interaction is completed).

* config.h: Add ENABLE(WEBDRIVER_*_INTERACTIONS) macros here.

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

6 months agoHave composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent...
simon.fraser@apple.com [Sun, 27 Jan 2019 16:58:48 +0000 (16:58 +0000)]
Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
https://bugs.webkit.org/show_bug.cgi?id=193879

Reviewed by Antti Koivisto.

Source/WebCore:

Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node.
This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This
makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger
updates of the scrolling tree node in an iframe.

To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these
nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore
simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we
connect GraphicsLayers together.

RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID.

Tested by existing tests.

* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
* rendering/RenderLayerCompositor.cpp:
(WebCore::frameContentsRenderView):
(WebCore::RenderLayerCompositor::frameContentsCompositor):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::scrollCoordinatedAncestorInParentOfFrame):
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
* rendering/RenderLayerCompositor.h:
* testing/Internals.cpp:
(WebCore::Internals::scrollingStateTreeAsText const):

Source/WebKit:

Need a specialization of dump() for ScrollingStateFrameHostingNode to avoid infinite recursion.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::dump):

LayoutTests:

New test results with FrameHosting nodes.

* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:

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

6 months agoSource/JavaScriptCore:
cfleizach@apple.com [Sun, 27 Jan 2019 08:49:29 +0000 (08:49 +0000)]
Source/JavaScriptCore:
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

In order to improve performance when requesting the accessibility hierarchy, we introduce the idea of a "static accessibility tree" which
could be accessed on a different thread by assistive technologies.
That is accomplished by storing all the data needed to answer accessibility attribute queries in a static object that mirrors the
"live" AccessibilityObjects (which interact with both DOM and Render trees).
These static objects are generally created after layout is done and final tasks are being performed. They are then stored in the static tree
representation and able to be read from anywhere.
Tactically this is done with AXIsolatedTreeNodes inside of an AXIsolatedTree. The TreeNodes implement an AccessibilityObjectInterface shared
with AccessibilityObject.
This allows the wrappers to access either one depending on conditions and platforms without significant code duplication or re-organization.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::createIsolatedAccessibilityTree):
(WebCore::AXObjectCache::generateStaticAccessibilityTreeIfNeeded):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h: Added.
* accessibility/isolatedtree: Added.
* accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
(WebCore::AXIsolatedTree::treeCache):
(WebCore::AXIsolatedTree::AXIsolatedTree):
(WebCore::AXIsolatedTree::create):
(WebCore::AXIsolatedTree::treeForID):
(WebCore::AXIsolatedTree::treeForPageID):
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::rootNode):
(WebCore::AXIsolatedTree::removeNode):
(WebCore::AXIsolatedTree::appendNodeChanges):
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/isolatedtree/AXIsolatedTree.h: Added.
(WebCore::AXIsolatedTree::treeIdentifier const):
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
    To note: we don't mark the attribute map const because even though attributes don't change after initial creation,
    we may copy an existing node and replace specific values.
(WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
(WebCore::AXIsolatedTreeNode::create):
(WebCore::AXIsolatedTreeNode::initializeAttributeData):
(WebCore::AXIsolatedTreeNode::setProperty):
(WebCore::AXIsolatedTreeNode::doubleAttributeValue const):
(WebCore::AXIsolatedTreeNode::unsignedAttributeValue const):
(WebCore::AXIsolatedTreeNode::boolAttributeValue const):
(WebCore::AXIsolatedTreeNode::stringAttributeValue const):
(WebCore::AXIsolatedTreeNode::intAttributeValue const):
* accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::associateIsolatedTreeNode):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
(-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
(-[WebAccessibilityObjectWrapperBase detach]):
(-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
(-[WebAccessibilityObjectWrapperBase axBackingObject]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper role]):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper roleDescription]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* dom/Document.cpp:
(WebCore::Document::pageID const):
* dom/Document.h:

Source/WebCore/PAL:
AX: Introduce isolated accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

* Configurations/FeatureDefines.xcconfig:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):

Source/WebKitLegacy/mac:
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

* Configurations/FeatureDefines.xcconfig:

Tools:
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>

Reviewed by Ryosuke Niwa.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

6 months agoAllow scrolling tree nodes to exist in a detached state
simon.fraser@apple.com [Sun, 27 Jan 2019 02:10:22 +0000 (02:10 +0000)]
Allow scrolling tree nodes to exist in a detached state
https://bugs.webkit.org/show_bug.cgi?id=193754

Reviewed by Zalan Bujtas.

Source/WebCore:

One of the (questionable?) design decisions of the scrolling tree is that the tree implementation
is hidden behind the ScrollingCoordinator interface. That interface only allowed nodes to exist
in a connected state; attachToStateTree() required a non-zero parent for any node that was not
the root.

This makes it impossible to coordinate the hookup of the scrolling tree across frame boundaries;
the scrolling tree has to have been fully constructed in ancestor frames before subframe nodes
can be attached. This is a significant difference from compositing, where a subframe can create
GraphicsLayers which don't have to be parented right away, and actually get parented later via
a compositing update in the parent frame.

We want to be able to hook up the scrolling tree via the same code paths as GraphicsLayer
connection (anything else is too confusing). So we need to be able to instantiate scrolling
tree nodes in a disconnected state, and attach them later.

To achieve this, add the notion of "unparented" nodes to ScrollingCoordinator and the ScrollingStateTree.
Allow clients to create unparented nodes, which can be attached later. ScrollingCoordinator stores
the roots of unparented subtrees in an owning HashMap. Nodes in unparented trees are still referenced
by m_stateNodeMap, so it's possible to find them and set state on them.

Clean up the ScrollingCoordinator interface to remove "state tree" terminology; the state vs. scrolling tree
is really an implementation detail.

This also removes the special-casing of ScrollingNodeType::Subframe nodes which ScrollingStateTree stored
in m_orphanedSubframeNodes; now the unparenting is controlled by the client.

Currently no code creates unparented nodes so there is no behavior change.

* dom/Document.cpp:
(WebCore::Document::setPageCacheState):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::createNode):
(WebCore::AsyncScrollingCoordinator::insertNode):
(WebCore::AsyncScrollingCoordinator::unparentNode):
(WebCore::AsyncScrollingCoordinator::unparentChildrenAndDestroyNode):
(WebCore::AsyncScrollingCoordinator::detachAndDestroySubtree):
(WebCore::AsyncScrollingCoordinator::clearAllNodes):
(WebCore::AsyncScrollingCoordinator::parentOfNode const):
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
(WebCore::AsyncScrollingCoordinator::attachToStateTree): Deleted.
(WebCore::AsyncScrollingCoordinator::detachFromStateTree): Deleted.
(WebCore::AsyncScrollingCoordinator::clearStateTree): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::handleWheelEvent):
(WebCore::ScrollingCoordinator::createNode):
(WebCore::ScrollingCoordinator::insertNode):
(WebCore::ScrollingCoordinator::unparentNode):
(WebCore::ScrollingCoordinator::unparentChildrenAndDestroyNode):
(WebCore::ScrollingCoordinator::detachAndDestroySubtree):
(WebCore::ScrollingCoordinator::clearAllNodes):
(WebCore::ScrollingCoordinator::parentOfNode const):
(WebCore::ScrollingCoordinator::childrenOfNode const):
(WebCore::ScrollingCoordinator::attachToStateTree): Deleted.
(WebCore::ScrollingCoordinator::detachFromStateTree): Deleted.
(WebCore::ScrollingCoordinator::clearStateTree): Deleted.
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::removeFromParent):
(WebCore::ScrollingStateNode::removeChild):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::ScrollingStateTree):
(WebCore::ScrollingStateTree::createUnparentedNode):
(WebCore::ScrollingStateTree::insertNode):
(WebCore::ScrollingStateTree::unparentNode):
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
(WebCore::ScrollingStateTree::detachAndDestroySubtree):
(WebCore::ScrollingStateTree::clear):
(WebCore::ScrollingStateTree::commit):
(WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
(WebCore::ScrollingStateTree::recursiveNodeWillBeRemoved):
(showScrollingStateTree):
(WebCore::ScrollingStateTree::attachNode): Deleted.
(WebCore::ScrollingStateTree::detachNode): Deleted.
* page/scrolling/ScrollingStateTree.h:
(WebCore::ScrollingStateTree::nodeCount const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):

Source/WebKit:

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingCoordinatorTransaction::decode):

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

6 months agoWeb Inspector: handle CSS Color 4 color syntaxes
drousso@apple.com [Sat, 26 Jan 2019 23:54:29 +0000 (23:54 +0000)]
Web Inspector: handle CSS Color 4 color syntaxes
https://bugs.webkit.org/show_bug.cgi?id=193166
<rdar://problem/47062403>

Reviewed by Simon Fraser.

Source/WebInspectorUI:

* UserInterface/Models/Color.js:
(WI.Color.fromString):
(WI.Color.fromString.splitFunctionString): Added.
(WI.Color.fromString.parseFunctionAlpha): Added.
(WI.Color.fromString.parseFunctionComponent): Added.
(WI.Color.fromString.parseHueComponent): Added.
(WI.Color.fromString.parsePercentageComponent): Added.

LayoutTests:

* inspector/model/color.html:
* inspector/model/color-expected.txt:

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

6 months agoWeb Inspector: provide a way to edit the user agent of a remote target
drousso@apple.com [Sat, 26 Jan 2019 22:32:38 +0000 (22:32 +0000)]
Web Inspector: provide a way to edit the user agent of a remote target
https://bugs.webkit.org/show_bug.cgi?id=193862
<rdar://problem/47359292>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Page.json:
Add `overrideUserAgent` command.

Source/WebCore:

Test: inspector/page/overrideUserAgent.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::userAgent const):
(WebCore::FrameLoader::userAgentForJavaScript const):

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::applyUserAgentOverride): Added.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::applyUserAgentOverrideImpl): Added.

* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::overrideUserAgent): Added.
(WebCore::InspectorPageAgent::applyUserAgentOverride): Added.

Source/WebInspectorUI:

* UserInterface/Base/Main.js:
(WI.loaded):
(WI.contentLoaded):
(WI.initializeTarget):
(WI._handleDeviceSettingsToolbarButtonClicked):
(WI._handleDeviceSettingsToolbarButtonClicked.updateActivatedState):
(WI._handleDeviceSettingsToolbarButtonClicked.applyOverriddenUserAgent):
(WI._handleDeviceSettingsToolbarButtonClicked.applyOverriddenSetting):
(WI._handleDeviceSettingsToolbarButtonClicked.createContainer):
(WI._handleDeviceSettingsToolbarButtonClicked.createColumns):
(WI._handleDeviceSettingsToolbarButtonClicked.calculateTargetFrame):
(WI._handleDeviceSettingsToolbarButtonClicked.showUserAgentInput):

* UserInterface/Views/Main.css:
(.device-settings-content):
(.device-settings-content .user-agent-value): Added.
(.device-settings-content .user-agent-value > select): Added.
(.device-settings-content .user-agent-value > input): Added.
(body[dir=ltr] .device-settings-content .user-agent-value > input): Added.
(body[dir=rtl] .device-settings-content .user-agent-value > input): Added.
(.device-settings-content label > input): Added.
(body[dir=ltr] .device-settings-content label > input): Deleted.
(body[dir=rtl] .device-settings-content label > input): Deleted.

* Localizations/en.lproj/localizedStrings.js:

LayoutTests:

* inspector/page/overrideUserAgent.html: Added.
* inspector/page/overrideUserAgent-expected.txt: Added.

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

6 months agoMove scrolling-tree/fixed-inside-frame.html into scrolling tree tests
simon.fraser@apple.com [Sat, 26 Jan 2019 20:00:20 +0000 (20:00 +0000)]
Move scrolling-tree/fixed-inside-frame.html into scrolling tree tests
https://bugs.webkit.org/show_bug.cgi?id=193871

Reviewed by Zalan Bujtas.

Move another test into scrollingcoordinator/scrolling-tree, and now that it runs on iOS,
add iOS results.

* platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt: Copied from LayoutTests/tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt.
* scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt: Renamed from LayoutTests/tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt.
* scrollingcoordinator/scrolling-tree/fixed-inside-frame.html: Renamed from LayoutTests/tiled-drawing/scrolling/frames/fixed-inside-frame.html.
* scrollingcoordinator/scrolling-tree/resources/autoscrolling-frame-with-fixed.html: Renamed from LayoutTests/tiled-drawing/scrolling/frames/resources/autoscrolling-frame-with-fixed.html.

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

6 months agoSource/WebCore:
zalan@apple.com [Sat, 26 Jan 2019 19:24:10 +0000 (19:24 +0000)]
Source/WebCore:
[LFC] The initial values for top/bottom in contentHeightForFormattingContextRoot should not be 0.
https://bugs.webkit.org/show_bug.cgi?id=193867

Reviewed by Antti Koivisto.

The initial content top/bottom value is the border top + padding top.

This is only a problem when the box has float children only. While computing the height using the bottom-most float,
we call "top = std::min(floatTop, top)". With 0 initial top value, this returns an incorrect result when the box
has (top)border/padding.

Test: fast/block/block-only/abs-pos-with-border-padding-and-float-child.html

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):

Tools:
[LFC] The default values for top/bottom in contentHeightForFormattingContextRoot should not be 0.
https://bugs.webkit.org/show_bug.cgi?id=193867

Reviewed by Antti Koivisto.

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:
[LFC] The default values for top/bottom in contentHeightForFormattingContextRoot should not be 0.
https://bugs.webkit.org/show_bug.cgi?id=193867

Reviewed by Antti Koivisto.

* fast/block/block-only/abs-pos-with-border-padding-and-float-child-expected.html: Added.
* fast/block/block-only/abs-pos-with-border-padding-and-float-child.html: Added.

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

6 months ago[LFC][BFC] Ignore last inflow child's collapsed through margin after when computing...
zalan@apple.com [Sat, 26 Jan 2019 15:01:34 +0000 (15:01 +0000)]
[LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height.
https://bugs.webkit.org/show_bug.cgi?id=193865

Reviewed by Antti Koivisto.

Source/WebCore:

Height computation ->
// 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
// ...the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom
// margin does not collapse with the element's bottom margin

<div style="border: 1px solid green">
  <div style="margin-top: 100px;"></div>
</div>

When the child vertical margins collapse through (margin-top = margin-bottom = 100px), the bottom edge of the bottom margin is
the same as the bottom edge of the top margin which is alredy taken into use while positioning so technically the bottom margin value should be ignored.

Test: fast/block/margin-collapse/collapsed-through-child-simple.html

* layout/MarginTypes.h:
(WebCore::Layout::UsedVerticalMargin::isCollapsedThrough const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::hasCollapsedThroughMargin const):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/margin-collapse/collapsed-through-child-simple-expected.html: Added.
* fast/block/margin-collapse/collapsed-through-child-simple.html: Added.

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

6 months ago[LFC][BFC][MarginCollapsing] marginAfterCollapsesWithParentMarginAfter/marginAfterCol...
zalan@apple.com [Sat, 26 Jan 2019 13:13:00 +0000 (13:13 +0000)]
[LFC][BFC][MarginCollapsing] marginAfterCollapsesWithParentMarginAfter/marginAfterCollapsesWithLastInFlowChildMarginAfter should check for border/padding after values.
https://bugs.webkit.org/show_bug.cgi?id=193864

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):

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

6 months ago[LFC] Box::nextInFlowOrFloatingSibling() should always return sibling floats as well.
zalan@apple.com [Sat, 26 Jan 2019 12:44:17 +0000 (12:44 +0000)]
[LFC] Box::nextInFlowOrFloatingSibling() should always return sibling floats as well.
https://bugs.webkit.org/show_bug.cgi?id=193855

Reviewed by Antti Koivisto.

Use iterative algorithm to find next/previous siblings.

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::nextInFlowOrFloatingSibling const):

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

6 months ago[JSC] NativeErrorConstructor should not have own IsoSubspace
ysuzuki@apple.com [Sat, 26 Jan 2019 09:07:25 +0000 (09:07 +0000)]
[JSC] NativeErrorConstructor should not have own IsoSubspace
https://bugs.webkit.org/show_bug.cgi?id=193713

Reviewed by Saam Barati.

JSTests:

Remove @Error use.

* stress/try-get-by-id-should-spill-registers-dfg.js:
(let.f.createBuiltin):

Source/JavaScriptCore:

This removes an additional member in NativeErrorConstructor, and make sizeof(NativeErrorConstructor) == sizeof(InternalFunction).
We also make error constructors lazily allocated by using LazyClassStructure. Since error structures are not accessed from DFG / FTL
threads, this is OK. While TypeError constructor is eagerly allocated because it is touched from our builtin JS as @TypeError, we should
offer some function instead of exposing TypeError constructor in the future, and remove this @TypeError reference. This change removes
IsoSubspace for NativeErrorConstructor in VM. We also remove @Error and @RangeError references for builtins since they are no longer
referenced.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* builtins/BuiltinNames.h:
* interpreter/Interpreter.h:
* runtime/Error.cpp:
(JSC::createEvalError):
(JSC::createRangeError):
(JSC::createReferenceError):
(JSC::createSyntaxError):
(JSC::createTypeError):
(JSC::createURIError):
(WTF::printInternal): Deleted.
* runtime/Error.h:
* runtime/ErrorPrototype.cpp:
(JSC::ErrorPrototype::create):
(JSC::ErrorPrototype::finishCreation):
* runtime/ErrorPrototype.h:
(JSC::ErrorPrototype::create): Deleted.
* runtime/ErrorType.cpp: Added.
(JSC::errorTypeName):
(WTF::printInternal):
* runtime/ErrorType.h: Added.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::initializeErrorConstructor):
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::internalPromiseConstructor const):
(JSC::JSGlobalObject::errorStructure const):
(JSC::JSGlobalObject::evalErrorConstructor const): Deleted.
(JSC::JSGlobalObject::rangeErrorConstructor const): Deleted.
(JSC::JSGlobalObject::referenceErrorConstructor const): Deleted.
(JSC::JSGlobalObject::syntaxErrorConstructor const): Deleted.
(JSC::JSGlobalObject::typeErrorConstructor const): Deleted.
(JSC::JSGlobalObject::URIErrorConstructor const): Deleted.
* runtime/NativeErrorConstructor.cpp:
(JSC::NativeErrorConstructor<errorType>::NativeErrorConstructor):
(JSC::NativeErrorConstructorBase::finishCreation):
(JSC::NativeErrorConstructor<errorType>::constructNativeErrorConstructor):
(JSC::NativeErrorConstructor<errorType>::callNativeErrorConstructor):
(JSC::NativeErrorConstructor::NativeErrorConstructor): Deleted.
(JSC::NativeErrorConstructor::finishCreation): Deleted.
(JSC::NativeErrorConstructor::visitChildren): Deleted.
(JSC::Interpreter::constructWithNativeErrorConstructor): Deleted.
(JSC::Interpreter::callNativeErrorConstructor): Deleted.
* runtime/NativeErrorConstructor.h:
(JSC::NativeErrorConstructorBase::createStructure):
(JSC::NativeErrorConstructorBase::NativeErrorConstructorBase):
* runtime/NativeErrorPrototype.cpp:
(JSC::NativeErrorPrototype::finishCreation): Deleted.
* runtime/NativeErrorPrototype.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::handleBadI64Use):

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

6 months agoREGRESSION (r238818): Snapshot is removed too late after swiping back on Twitter
timothy_horton@apple.com [Sat, 26 Jan 2019 07:29:15 +0000 (07:29 +0000)]
REGRESSION (r238818): Snapshot is removed too late after swiping back on Twitter
https://bugs.webkit.org/show_bug.cgi?id=193860
<rdar://problem/47535022>

Reviewed by Antti Koivisto.

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
(WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
* UIProcess/Cocoa/ViewGestureController.h:
Treat provisional load and same document load the same: they already both
unpause the snapshot removal tracker, request render tree size notifications,
but same-document navigation was missing the call to dispatchAfterEnsuringDrawing
and thus would get stuck waiting for RepaintAfterNavigation.

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

6 months agoNeed a mechanism to override navigator.userAgent
rniwa@webkit.org [Sat, 26 Jan 2019 06:50:58 +0000 (06:50 +0000)]
Need a mechanism to override navigator.userAgent
https://bugs.webkit.org/show_bug.cgi?id=193762
<rdar://problem/47504939>

Reviewed by Brent Fulgham.

Source/WebCore:

Added the ability to specify user agent string just for navigator.userAgent via DocumentLoader.

* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setCustomJavaScriptUserAgent):
(WebCore::DocumentLoader::customJavaScriptUserAgent const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::userAgentForJavaScript const):
* loader/FrameLoader.h:
* page/Navigator.cpp:
(WebCore::Navigator::userAgent const):

Source/WebKit:

This patch adds a new _WKWebsitePolicies SPI to specify the user agent string returned by
navigator.userAgent without affecting the user agent string used to send network requests.

Tests: WebKit.WebsitePoliciesCustomJavaScriptUserAgent
       WebKit.WebsitePoliciesCustomUserAgents

* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setCustomJavaScriptUserAgent:]):
(-[_WKWebsitePolicies customJavaScriptUserAgent]):

Tools:

Added test cases for _WKWebsitePolicies.customJavaScriptUserAgent.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[CustomJavaScriptUserAgentDelegate _webView:decidePolicyForNavigationAction:userInfo:decisionHandler:]):
(-[CustomJavaScriptUserAgentDelegate webView:didFinishNavigation:]):

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

6 months agoWeb Inspector: provide a way to edit page settings on a remote target
drousso@apple.com [Sat, 26 Jan 2019 03:57:17 +0000 (03:57 +0000)]
Web Inspector: provide a way to edit page settings on a remote target
https://bugs.webkit.org/show_bug.cgi?id=193813
<rdar://problem/47359510>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Page.json:
Add `overrideSetting` command with supporting `Setting` enum type.

Source/WebCore:

Test: inspector/page/overrideSetting.html

* page/Settings.yaml:
* Scripts/GenerateSettings.rb:
* Scripts/SettingsTemplates/Settings.cpp.erb:
* Scripts/SettingsTemplates/Settings.h.erb:
Add support for an `inspectorOverride` boolean value for each setting that will take
precedence over the actual `Setting`'s value when set.

* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::overrideSetting): Added.

* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::isRemote const): Added.
* inspector/InspectorFrontendClient.h:
(WebCore::InspectorFrontendClient::isRemote const): Added.
* inspector/InspectorFrontendClientLocal.h:
(WebCore::InspectorFrontendClientLocal::isRemote const): Added.

Source/WebInspectorUI:

Add toolbar button that shows a popover with the target's (page's) settings when clicked.

* UserInterface/Base/Main.js:
(WI.loaded):
(WI.contentLoaded):
(WI.initializeTarget): Added.
(WI._handleDeviceSettingsToolbarButtonClicked): Added.
(WI.didDismissPopover): Added.
* UserInterface/Views/Main.css:
(.device-settings-content): Added.
(.device-settings-content .columns): Added.
(.device-settings-content .columns > .column): Added.
(.device-settings-content .columns > .column + .column): Added.
(body[dir=ltr] .device-settings-content label > input): Added.
(body[dir=rtl] .device-settings-content label > input): Added.

* UserInterface/Views/Popover.js:
(WI.Popover.prototype._update.area):
(WI.Popover.prototype._update):
(WI.Popover.prototype._drawBackground):
(WI.Popover.prototype._bestMetricsForEdge):
(WI.Popover.prototype._drawFrame):
If the best area is negative, treat it as the worst area.
Allow areas to be clamped so long as the clamped edge is not the preferred edge.

* UserInterface/Base/Test.js:
(WI.initializeTarget): Added.

* UserInterface/Images/Device.svg: Added.
* Localizations/en.lproj/localizedStrings.js:

Source/WebKit:

* WebProcess/WebPage/WebInspectorUI.h:
(WebKit::WebInspectorUI::isRemote() const): Added.
* WebProcess/WebPage/RemoteWebInspectorUI.h:
(WebKit::RemoteWebInspectorUI::isRemote() const): Added.

LayoutTests:

* inspector/page/overrideSetting.html: Added.
* inspector/page/overrideSetting-expected.txt: Added.

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

6 months agoDocument::updateMainArticleElementAfterLayout() should be a no-op when no client...
wenson_hsieh@apple.com [Sat, 26 Jan 2019 03:38:57 +0000 (03:38 +0000)]
Document::updateMainArticleElementAfterLayout() should be a no-op when no client depends on knowing the main article element
https://bugs.webkit.org/show_bug.cgi?id=193843

Reviewed by Zalan Bujtas.

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

This function currently does a bit of wasted work after every layout, on clients that don't listen to the
"significant rendered text" layout milestone and therefore don't need to guess the main article element. Simply
don't bother keeping the main article element up to date in this scenario by bailing from
FrameView::updateHasReachedSignificantRenderedTextThreshold if the client doesn't care about the significant
rendered text milestone.

* page/FrameView.cpp:
(WebCore::FrameView::updateHasReachedSignificantRenderedTextThreshold):

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

6 months agoWeb Inspector: Audit: unable to import audits
drousso@apple.com [Sat, 26 Jan 2019 03:24:03 +0000 (03:24 +0000)]
Web Inspector: Audit: unable to import audits
https://bugs.webkit.org/show_bug.cgi?id=193861

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype.async processJSON):

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

6 months ago<video> elements not in the DOM should be allowed to AirPlay
jer.noble@apple.com [Sat, 26 Jan 2019 01:46:50 +0000 (01:46 +0000)]
<video> elements not in the DOM should be allowed to AirPlay
https://bugs.webkit.org/show_bug.cgi?id=193837
Source/WebCore:

<rdar://42559491>

Reviewed by Eric Carlson.

Test: media/airplay-allows-buffering.html

Some websites will switch between <video> elements backed by MSE to one backed by
a media file in order to implement an AirPlay control. But when a <video> element is
removed from the DOM and paused, further buffering is blocked. For some ports (namely
Cocoa ones), this keeps AirPlay from engaging. Relax this buffering restriction for
elements who have been asked to play wirelessly, but whose wireless playback has not
started yet.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::dataBufferingPermitted const):
(WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):

LayoutTests:

Reviewed by Eric Carlson.

* media/airplay-allows-buffering-expected.txt: Added.
* media/airplay-allows-buffering.html: Added.
* platform/ios/TestExpectations:

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

6 months agoFix failing scrollingcoordinator/scrolling-tree/remove-scrolling-role.html
simon.fraser@apple.com [Sat, 26 Jan 2019 01:40:24 +0000 (01:40 +0000)]
Fix failing scrollingcoordinator/scrolling-tree/remove-scrolling-role.html

Test needed different macOS and iOS results. Added window.internals.settings.setAsyncOverflowScrollingEnabled(true)
so the test uses async overflow scrolling in the macOS result.

* platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt.
* scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* scrollingcoordinator/scrolling-tree/remove-scrolling-role.html:

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

6 months agoAdd a scrolling tree test that toggles scrollability on an intermediate iframe
simon.fraser@apple.com [Sat, 26 Jan 2019 01:40:20 +0000 (01:40 +0000)]
Add a scrolling tree test that toggles scrollability on an intermediate iframe
https://bugs.webkit.org/show_bug.cgi?id=193849

Reviewed by Dean Jackson.

* platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/resources/scroll-toggling-frame.html: Added.
* scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling.html: Added.

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

6 months agoWeb Inspector: Uncaught Exception: No node with given id found
drousso@apple.com [Sat, 26 Jan 2019 01:06:51 +0000 (01:06 +0000)]
Web Inspector: Uncaught Exception: No node with given id found
https://bugs.webkit.org/show_bug.cgi?id=193833

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView):
(WI.CanvasContentView.prototype.initialLayout):
(WI.CanvasContentView.prototype.layout):
(WI.CanvasContentView.prototype._refreshPixelSize):
Drive-by: show the refresh button when viewing a specific canvas.
* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.prototype._removeCanvas):
Reset to the overview if the canvas is removed.

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

6 months agoREGRESSION: Some USDz from 3rd party websites don't go directly to AR QL
dino@apple.com [Sat, 26 Jan 2019 01:00:54 +0000 (01:00 +0000)]
REGRESSION: Some USDz from 3rd party websites don't go directly to AR QL
https://bugs.webkit.org/show_bug.cgi?id=193831
<rdar://problem/47399263>

Reviewed by Chris Dumez.

Source/WebKit:

A System Preview (<a rel="ar">) displays in a modal and doesn't trigger
a navigation. If the link was cross origin, it was causing a process swap,
which meant that the response defaulted back to a navigation.

The fix is to not cause a PSON when the navigation is a system preview.

* UIProcess/API/APINavigation.h:
(API::Navigation::shouldForceDownload const): This is now just tracking
the "download" attribute, and not including System Preview.
(API::Navigation::isSystemPreview const): New method to check for a
navigation triggered as a System Preview.
* UIProcess/WebPageProxy.cpp: Move the code from receivedPolicyDecision to
receivedNavigationPolicyDecision, so that downloads and System Previews are
detected before we decide to change process.
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::receivedPolicyDecision):

Tools:

Two new tests that exercise cross-origin and same-origin System
Previews.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months agoRemove expectation for inspector/css/createStyleSheet.html as test appears to be...
tsavell@apple.com [Sat, 26 Jan 2019 00:54:08 +0000 (00:54 +0000)]
Remove expectation for inspector/css/createStyleSheet.html as test appears to be passing.
https://bugs.webkit.org/show_bug.cgi?id=148636

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

6 months agoFind-in-page on nyt.com scrolls around without touching the screen when find holes...
timothy_horton@apple.com [Sat, 26 Jan 2019 00:44:42 +0000 (00:44 +0000)]
Find-in-page on nyt.com scrolls around without touching the screen when find holes are visible
https://bugs.webkit.org/show_bug.cgi?id=193853

Reviewed by Simon Fraser.

* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::updateFindIndicator):
There is no reason to scroll/zoom to the find indicator just because the
holes are up, we should only do it on initial indicator presentation.
This was a mistake in r178755 that was previously never exercised because
isShowingOverlay was always false.

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

6 months ago[iOS] Add support for the download attribute
cdumez@apple.com [Sat, 26 Jan 2019 00:44:15 +0000 (00:44 +0000)]
[iOS] Add support for the download attribute
https://bugs.webkit.org/show_bug.cgi?id=167341
<rdar://problem/30296281>

Reviewed by Geoffrey Garen.

Source/WTF:

Turn on HTML download attribute support on iOS.

* wtf/FeatureDefines.h:

LayoutTests:

Make download attribute layout tests iOS-friendly and unskip them now that they pass.

* fast/dom/HTMLAnchorElement/anchor-download-unset.html:
* fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-base-target-popup-not-allowed.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target-popup-not-allowed.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download.html:
* fast/dom/HTMLAnchorElement/anchor-nodownload-set.html:
* fast/dom/HTMLAnchorElement/anchor-nodownload.html:
* http/tests/download/anchor-download-attribute-content-disposition.html:
* http/tests/download/anchor-download-no-extension.html:
* http/tests/download/anchor-download-no-value.html:
* http/tests/download/anchor-download-redirect.html:
* http/tests/download/area-download.html:
* http/tests/download/convert-cached-load-to-download.html:
* http/tests/security/anchor-download-allow-blob.html:
* http/tests/security/anchor-download-allow-data.html:
* http/tests/security/anchor-download-allow-sameorigin.html:
* http/tests/security/anchor-download-block-crossorigin-expected.txt:
* http/tests/security/anchor-download-block-crossorigin.html:
* platform/ios-wk2/TestExpectations:
* platform/ios-wk2/http/tests/security/anchor-download-block-crossorigin-expected.txt: Copied from LayoutTests/http/tests/security/anchor-download-block-crossorigin-expected.txt.

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

6 months agoUpdate Xcode projects with "Check .xcfilelists" build phase
krollin@apple.com [Fri, 25 Jan 2019 23:52:51 +0000 (23:52 +0000)]
Update Xcode projects with "Check .xcfilelists" build phase
https://bugs.webkit.org/show_bug.cgi?id=193790
<rdar://problem/47201374>

Reviewed by Alex Christensen.

Support for XCBuild includes specifying inputs and outputs to various
Run Script build phases. These inputs and outputs are specified as
.xcfilelist files. Once created, these .xcfilelist files need to be
kept up-to-date. In order to check that they are up-to-date or not,
add an Xcode build step that invokes an external script that performs
the checking. If the .xcfilelists are found to be out-of-date, update
them, halt the build, and instruct the developer to restart the build
with up-to-date files.

At this time, the checking and regenerating is performed only if the
WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
who want to use this facility can set this variable and test out the
checking/regenerating. Once it seems like there are no egregious
issues that upset a developer's workflow, we'll unconditionally enable
this facility.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
* Scripts/check-xcfilelists.sh: Added.

Source/WebCore:

No new tests since there should be no observable behavior difference.

* Scripts/check-xcfilelists.sh: Added.
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

* Scripts/check-xcfilelists.sh: Added.
* WebKit.xcodeproj/project.pbxproj:

Tools:

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/Scripts/check-xcfilelists.sh: Added.
* WebKitTestRunner/Scripts/check-xcfilelists.sh: Added.
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:

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

6 months agoWeb Inspector: Exclude Debugger Threads from CPU Usage values in Web Inspector
commit-queue@webkit.org [Fri, 25 Jan 2019 23:45:04 +0000 (23:45 +0000)]
Web Inspector: Exclude Debugger Threads from CPU Usage values in Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=193796
<rdar://problem/47532910>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-25
Reviewed by Devin Rousso.

Source/JavaScriptCore:

* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::machThread):
* runtime/SamplingProfiler.h:
Expose the mach_port_t of the SamplingProfiler thread
so it can be tested against later.

Source/WebCore:

* page/ResourceUsageData.h:
* inspector/agents/InspectorCPUProfilerAgent.cpp:
(WebCore::InspectorCPUProfilerAgent::collectSample):
Show the CPU usage without debugger threads in the Web Inspector's timeline.

* page/ResourceUsageThread.h:
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
For OS(DARWIN) ports, when starting to observe resource usage,
we grab the mach_port_t of SamplingProfiler on the main thread
in a thread safe way. For our purposes (Web Inspector timelines),
this will be good enough to identify the SamplingProfiler thread
during timeline recording. The SamplingProfiler thread won't change
during a timeline recording and recording start/stops will never
miss the SamplingProfiler changing.

(WebCore::filterThreads):
(WebCore::threadSendRights):
(WebCore::threadSendRightsExcludingDebuggerThreads):
(WebCore::cpuUsage):
(WebCore::ResourceUsageThread::platformCollectCPUData):
Calculate CPU usage twice, the second time excluding some threads.

* page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
(WebCore::ResourceUsageThread::platformCollectCPUData):
Stubs for linux ports.

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

6 months agoFix Windows build after r240511
achristensen@apple.com [Fri, 25 Jan 2019 23:44:27 +0000 (23:44 +0000)]
Fix Windows build after r240511

* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):

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

6 months agoMove logic from ChildProcess::setApplicationIsDaemon to NetworkProcess::initializeProcess
achristensen@apple.com [Fri, 25 Jan 2019 23:41:30 +0000 (23:41 +0000)]
Move logic from ChildProcess::setApplicationIsDaemon to NetworkProcess::initializeProcess
https://bugs.webkit.org/show_bug.cgi?id=193844

Reviewed by Andy Estes.

Source/WebCore/PAL:

* pal/spi/mac/HIServicesSPI.h:

Source/WebKit:

This simplifies ChildProcess and removes NetworkProcess-specific code from this generic abstraction.

* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::initializeProcess):
* Shared/ios/ChildProcessIOS.mm:
(WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::setApplicationIsDaemon): Deleted.

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

6 months agoRemove FrameView::m_significantRenderedTextMilestonePending
zalan@apple.com [Fri, 25 Jan 2019 23:40:23 +0000 (23:40 +0000)]
Remove FrameView::m_significantRenderedTextMilestonePending
https://bugs.webkit.org/show_bug.cgi?id=193842

Reviewed by Wenson Hsieh.

Currently we keep processing the incoming text content until after the "SignificantRenderedTextMilestone" has been reached.
We can actually stop doing it right when the text content is above the threshold (regardless of whether all the conditions are met for the milestone).
This patch also ensures that we don't update Document::m_mainArticleElement once the threshold is reached.

* page/FrameView.cpp:
(WebCore::FrameView::resetLayoutMilestones):
(WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
(WebCore::FrameView::hasReachedSignificantRenderedTextThreashold):
(WebCore::FrameView::qualifiesAsSignificantRenderedText const):
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
(WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded): Deleted.
* page/FrameView.h:

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

6 months agoWeb Inspector: Improve Dark Mode appearance within Memory timeline
commit-queue@webkit.org [Fri, 25 Jan 2019 23:31:17 +0000 (23:31 +0000)]
Web Inspector: Improve Dark Mode appearance within Memory timeline
https://bugs.webkit.org/show_bug.cgi?id=193804

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-25
Reviewed by Matt Baker.

* UserInterface/Views/TimelineOverview.css:
(.timeline-overview.edit-instruments > .tree-outline.timelines .item.selected):
(.timeline-overview > .tree-outline.timelines .item.selected + .item,):
(@media (prefers-color-scheme: dark)):
(.timeline-overview > .tree-outline.timelines .item.selected + .item): Deleted.
(body.window-inactive .timeline-overview > .tree-outline.timelines .item.selected + .item): Deleted.
Fix some colors for Timelines edit mode.

* UserInterface/Views/CPUTimelineOverviewGraph.css:
(.timeline-overview-graph.cpu:nth-child(even) > .legend):
(@media (prefers-color-scheme: dark)):
(.timeline-overview-graph.cpu > .legend):
(.timeline-overview-graph:nth-child(even) > .legend): Deleted.
* UserInterface/Views/MemoryTimelineOverviewGraph.css:
(.timeline-overview-graph.memory:nth-child(even) > .legend):
(@media (prefers-color-scheme: dark)):
(.timeline-overview-graph.memory > .legend):
(.timeline-overview-graph:nth-child(even) > .legend): Deleted.
Improved colors in CPU / Memory overview graph legends.

* UserInterface/Views/CPUUsageView.css:
(.cpu-usage-view > .details):
* UserInterface/Views/CircleChart.css:
(.circle-chart > svg > path.background):
* UserInterface/Views/MemoryCategoryView.css:
(.memory-category-view > .details):
(.memory-category-view > .details > .name):
* UserInterface/Views/MemoryTimelineView.css:
(.timeline-view.memory > .content > .overview .total-usage,):
(.timeline-view.memory .legend > .row > .size):
Improved colors in CPU / Memory detail views.

* UserInterface/Views/Variables.css:
(:root):
Add a default --text-secondary-color which will end up slightly
lighter in dark mode where it was already implemented.

(@media (prefers-color-scheme: dark)):
Improved max-comparison colors.

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

6 months agoUpdate Xcode projects with "Apply Configuration to XCFileLists" build target
krollin@apple.com [Fri, 25 Jan 2019 23:19:25 +0000 (23:19 +0000)]
Update Xcode projects with "Apply Configuration to XCFileLists" build target
https://bugs.webkit.org/show_bug.cgi?id=193781
<rdar://problem/47201153>

Reviewed by Alex Christensen.

Part of generating the .xcfilelists used as part of adopting XCBuild
includes running `make DerivedSources.make` from a standalone script.
It’s important for this invocation to have the same environment as
when the actual build invokes `make DerivedSources.make`. If the
environments are different, then the two invocations will provide
different results. In order to get the same environment in the
standalone script, have the script launch xcodebuild targeting the
"Apply Configuration to XCFileLists" build target, which will then
re-invoke our standalone script. The script is now running again, this
time in an environment with all workspace, project, target, xcconfig
and other environment variables established.

The "Apply Configuration to XCFileLists" build target accomplishes
this task via a small embedded shell script that consists only of:

    eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"

The process that invokes "Apply Configuration to XCFileLists" first
sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
evaluated and exports it into the shell environment. When xcodebuild
is invoked, it inherits the value of this variable and can `eval` the
contents of that variable. Our external standalone script can then set
WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
of command-line parameters needed to restart itself in the appropriate
state.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WebCore:

No new tests since there should be no observable behavior difference.

* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:

Tools:

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:

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

6 months agoAdd SPI to inform an application that "Go Back" has been clicked from a safe browsing...
achristensen@apple.com [Fri, 25 Jan 2019 23:16:46 +0000 (23:16 +0000)]
Add SPI to inform an application that "Go Back" has been clicked from a safe browsing warning
https://bugs.webkit.org/show_bug.cgi?id=193802
<rdar://problem/46010580>

Reviewed by Andy Estes.

Source/WebKit:

* UIProcess/API/APIUIClient.h:
(API::UIClient::didClickGoBackFromSafeBrowsingWarning):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(-[SafeBrowsingNavigationDelegate _webViewDidClickGoBackFromSafeBrowsingWarning:]):
(TEST):

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

6 months ago[ iOS Simulator Release ] Layout Test fast/animation/request-animation-frame.html...
commit-queue@webkit.org [Fri, 25 Jan 2019 23:16:27 +0000 (23:16 +0000)]
[ iOS Simulator Release ] Layout Test fast/animation/request-animation-frame.html is a flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=190888

Unreviewed test gardening.

Patch by Shawn Roberts <sroberts@apple.com> on 2019-01-25

* platform/ios-wk2/TestExpectations:

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

6 months ago[iOS] Pressing Tab key doesn't move to next cell with Google Sheets
dbates@webkit.org [Fri, 25 Jan 2019 23:12:43 +0000 (23:12 +0000)]
[iOS] Pressing Tab key doesn't move to next cell with Google Sheets
https://bugs.webkit.org/show_bug.cgi?id=193048
<rdar://problem/46433836>

Reviewed by Brent Fulgham.

WebCore knows how interpret the Tab and Shift + Tab keys. When building with UIKit keyboard additions
we do not need to register key commands for handling them from the UIProcess code. Instead UIKit will
sends key events for these commands to us. This will make the behavior of these key commands when executed
in an editable field match the behavior of these command when executed in a non-editable field since
both code paths will now go through WebCore.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView keyCommands]): Only compile when building with !USE(UIKIT_KEYBOARD_ADDITIONS).

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

6 months agoFix Linux build.
achristensen@apple.com [Fri, 25 Jan 2019 22:57:42 +0000 (22:57 +0000)]
Fix Linux build.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):

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

6 months ago[iOS] uiController.keyDown() does not translate Control modified key
dbates@webkit.org [Fri, 25 Jan 2019 22:35:10 +0000 (22:35 +0000)]
[iOS] uiController.keyDown() does not translate Control modified key
https://bugs.webkit.org/show_bug.cgi?id=192898

Reviewed by Wenson Hsieh.

Tools:

Implement uiController.keyDown() in terms of HIDEventGenerator so that UIKit performs
key translation, as applicable. Among other cases, key translation occurs when performing
a Control key modified key sequence. Writing uiController.keyDown() in terms of HIDEventGenerator
also makes the behavior of uiController.keyDown() more closely match the behavior of a
human pressing down and releasing key(s) using a hardware keyboard.

* WebKitTestRunner/ios/HIDEventGenerator.h:
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(-[HIDEventGenerator sendMarkerHIDEventWithCompletionBlock:]): Renamed; formerly named _sendMarkerHIDEventWithCompletionBlock.

(-[HIDEventGenerator touchDown:touchCount:completionBlock:]):
(-[HIDEventGenerator liftUp:touchCount:completionBlock:]):
(-[HIDEventGenerator stylusDownAtPoint:azimuthAngle:altitudeAngle:pressure:completionBlock:]):
(-[HIDEventGenerator stylusMoveToPoint:azimuthAngle:altitudeAngle:pressure:completionBlock:]):
(-[HIDEventGenerator stylusUpAtPoint:completionBlock:]):
(-[HIDEventGenerator stylusTapAtPoint:azimuthAngle:altitudeAngle:pressure:completionBlock:]):
(-[HIDEventGenerator sendTaps:location:withNumberOfTouches:completionBlock:]):
(-[HIDEventGenerator longPress:completionBlock:]):
(-[HIDEventGenerator dragWithStartPoint:endPoint:duration:completionBlock:]):
Update code for above renaming.

(hidUsageCodeForCharacter): Translate \b to a backspace and teach this function to recognize the
DumpRenderTree EventSender-compatible modifier key names (e.g. "metaKey").

(-[HIDEventGenerator keyDown:]): Added.
(-[HIDEventGenerator keyUp:]): Added.
(-[HIDEventGenerator keyPress:completionBlock:]):
(-[HIDEventGenerator eventDispatchThreadEntry:]):
(-[HIDEventGenerator _sendMarkerHIDEventWithCompletionBlock:]): Deleted; renamed to sendMarkerHIDEventWithCompletionBlock.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::parseModifierArray): Modified to return a vector of strings that represent the modifier keys to press.
(WTR::UIScriptController::keyDown): Write in terms of HIDEventGenerator.
(WTR::parseModifier): Deleted.

LayoutTests:

Make tests more robusts.

* fast/events/ios/key-command-italic-dispatches-keydown.html: Remove the need to special-case the test runner and
expect a single key event that represents Command + I. Now that uiController.keyDown() makes use of HIDEventGenerator
we emit separate key events for each key pressed in the sequence: keydown Command, keydown i, keyup i, keyup Command.
This matches how a human being would execute such a key sequence.
* fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible-expected.html:
Make the test less flaky by hiding the tap highlight. Depending on timing, the tap highlight may be snapshotted and thus
cause the reference test to mismatch the test. Mitigate this by hiding the tap highlight.
* fast/text/scroll-text-overflow-ellipsis.html: Wait for a keyup event for the down arrow before declaring the
test complete.

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

6 months agoAdd API to generate and consume cached bytecode
tzagallo@apple.com [Fri, 25 Jan 2019 22:31:12 +0000 (22:31 +0000)]
Add API to generate and consume cached bytecode
https://bugs.webkit.org/show_bug.cgi?id=193401
<rdar://problem/47514099>

Reviewed by Keith Miller.

Add the `generateBytecode` and `generateModuleBytecode` functions to
generate serialized bytecode for a given `SourceCode`. These functions
will eagerly generate code for all the nested functions.

Additionally, update the API methods in JSScript to generate and use the
bytecode when the bytecodeCache path is provided.

* API/JSAPIGlobalObject.mm:
(JSC::JSAPIGlobalObject::moduleLoaderFetch):
* API/JSContext.mm:
(-[JSContext wrapperMap]):
* API/JSContextInternal.h:
* API/JSScript.mm:
(+[JSScript scriptWithSource:inVirtualMachine:]):
(+[JSScript scriptFromASCIIFile:inVirtualMachine:withCodeSigning:andBytecodeCache:]):
(-[JSScript dealloc]):
(-[JSScript readCache]):
(-[JSScript writeCache]):
(-[JSScript hash]):
(-[JSScript source]):
(-[JSScript cachedBytecode]):
(-[JSScript jsSourceCode:]):
* API/JSScriptInternal.h:
* API/JSScriptSourceProvider.h: Copied from Source/JavaScriptCore/API/JSScriptInternal.h.
(JSScriptSourceProvider::create):
(JSScriptSourceProvider::JSScriptSourceProvider):
* API/JSScriptSourceProvider.mm: Copied from Source/JavaScriptCore/API/JSScriptInternal.h.
(JSScriptSourceProvider::hash const):
(JSScriptSourceProvider::source const):
(JSScriptSourceProvider::cachedBytecode const):
* API/JSVirtualMachine.mm:
(-[JSVirtualMachine vm]):
* API/JSVirtualMachineInternal.h:
* API/tests/testapi.mm:
(testBytecodeCache):
(-[JSContextFileLoaderDelegate context:fetchModuleForIdentifier:withResolveHandler:andRejectHandler:]):
(testObjectiveCAPI):
* JavaScriptCore.xcodeproj/project.pbxproj:
* SourcesCocoa.txt:
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
* bytecode/UnlinkedFunctionExecutable.h:
* parser/SourceCodeKey.h:
(JSC::SourceCodeKey::source const):
* parser/SourceProvider.h:
(JSC::CachedBytecode::CachedBytecode):
(JSC::CachedBytecode::operator=):
(JSC::CachedBytecode::data const):
(JSC::CachedBytecode::size const):
(JSC::CachedBytecode::owned const):
(JSC::CachedBytecode::~CachedBytecode):
(JSC::CachedBytecode::freeDataIfOwned):
(JSC::SourceProvider::cachedBytecode const):
* parser/UnlinkedSourceCode.h:
(JSC::UnlinkedSourceCode::provider const):
* runtime/CodeCache.cpp:
(JSC::generateUnlinkedCodeBlockForFunctions):
(JSC::writeCodeBlock):
(JSC::serializeBytecode):
* runtime/CodeCache.h:
(JSC::CodeCacheMap::fetchFromDiskImpl):
(JSC::CodeCacheMap::findCacheAndUpdateAge):
(JSC::generateUnlinkedCodeBlockImpl):
(JSC::generateUnlinkedCodeBlock):
* runtime/Completion.cpp:
(JSC::generateBytecode):
(JSC::generateModuleBytecode):
* runtime/Completion.h:
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

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

6 months agoComplete the implementation of generate-xcfilelists
krollin@apple.com [Fri, 25 Jan 2019 22:23:54 +0000 (22:23 +0000)]
Complete the implementation of generate-xcfilelists
https://bugs.webkit.org/show_bug.cgi?id=193782

Reviewed by Alex Christensen.

A preliminary version of generate-xcfilelists was added in r238008.
This patch updates that script in order to:

- Support checking of .xcfilelists
- Perform better execution of `make DerivedSources.make` by
  relaunching generate-xcfilelists under xcodebuild
- Support incremental generation and checking of .xcfilelists
- Support supplementary .xcfilelists files from WebKitAdditions
- Support being wrapped by parallel version of generate-xcfilelists in
  Internal that adds support for (re)generating WebKit projects in
  that repo.
- Support builds that have been performed in WebKitBuild as well as
  ~/Library/Developer/code/DerivedData
- Increase robustness and debugging facilities.

* Scripts/generate-xcfilelists:

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

6 months agoActivate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate...
bfulgham@apple.com [Fri, 25 Jan 2019 22:21:38 +0000 (22:21 +0000)]
Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
https://bugs.webkit.org/show_bug.cgi?id=193297
<rdar://problem/47158841>

Unreviewed test case fix.

These test cases require ResourceLoadStatistics to be active, so the feature must be turned on.
Previously, the default data store turned the feature on automatically, allowing these tests to pass.

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

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

6 months agoUpdate WebKitAdditions.xcconfig with correct order of variable definitions
krollin@apple.com [Fri, 25 Jan 2019 22:19:25 +0000 (22:19 +0000)]
Update WebKitAdditions.xcconfig with correct order of variable definitions
https://bugs.webkit.org/show_bug.cgi?id=193793
<rdar://problem/47532439>

Reviewed by Alex Christensen.

XCBuild changes the way xcconfig variables are evaluated. In short,
all config file assignments are now considered in part of the
evaluation. When using the new build system and an .xcconfig file
contains multiple assignments of the same build setting:

- Later assignments using $(inherited) will inherit from earlier
  assignments in the xcconfig file.
- Later assignments not using $(inherited) will take precedence over
  earlier assignments. An assignment to a more general setting will
  mask an earlier assignment to a less general setting. For example,
  an assignment without a condition ('FOO = bar') will completely mask
  an earlier assignment with a condition ('FOO[sdk=macos*] = quux').

This affects some of our .xcconfig files, in that sometimes platform-
or sdk-specific definitions appear before the general definitions.
Under the new evaluations rules, the general definitions alway take
effect because they always overwrite the more-specific definitions. The
solution is to swap the order, so that the general definitions are
established first, and then conditionally overwritten by the
more-specific definitions.

Source/JavaScriptCore:

* Configurations/Version.xcconfig:

Source/ThirdParty/libwebrtc:

* Configurations/Version.xcconfig:

Source/WebCore:

No new tests since there should be no observable behavior difference.

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

Source/WebKit:

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

Source/WebKitLegacy/mac:

* Configurations/Version.xcconfig:
* Configurations/WebKitLegacy.xcconfig:

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