WebKit-https.git
22 months agoPACCage should first cage leaving PAC bits intact then authenticate
keith_miller@apple.com [Tue, 2 Jul 2019 07:00:14 +0000 (07:00 +0000)]
PACCage should first cage leaving PAC bits intact then authenticate
https://bugs.webkit.org/show_bug.cgi?id=199372

Reviewed by Saam Barati.

Source/bmalloc:

* bmalloc/ProcessCheck.mm:
(bmalloc::shouldProcessUnconditionallyUseBmalloc):

Source/JavaScriptCore:

This ordering prevents someone from taking a signed pointer from
outside the gigacage and using it in a struct that expects a caged
pointer. Previously, the PACCaging just double checked that the PAC
bits were valid for the original pointer.

       +---------------------------+
       |       |        |          |
       | "PAC" | "base" | "offset" +----+
       |       |        |          |    |
       +---------------------------+    | Caging
        |                               |
        |                               |
        |                               v
        |                +---------------------------+
        |                |       |        |          |
        | Bit Merge      | 00000 |  base  | "offset" |
        |                |       |        |          |
        |                +---------------------------+
        |                               |
        |                               |
        v                               |  Bit Merge
  +---------------------------+         |
  |       |        |          |         |
  | "PAC" |  base  | "offset" +<--------+
  |       |        |          |
  +---------------------------+
              |
              |
              | Authenticate
              |
              v
  +---------------------------+
  |       |        |          |
  | Auth  |  base  | "offset" |
  |       |        |          |
  +---------------------------+

The above ascii art graph shows how the PACCage system works. The
key take away is that even if someone passes in a valid, signed
pointer outside the cage it will still fail to authenticate as the
"base" bits will change before authentication.

* assembler/MacroAssemblerARM64E.h:
* assembler/testmasm.cpp:
(JSC::testCagePreservesPACFailureBit):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::caged):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::cageConditionally):
* llint/LowLevelInterpreter64.asm:

Source/WTF:

* wtf/CagedPtr.h:
(WTF::CagedPtr::get const):
(WTF::CagedPtr::getMayBeNull const):
(WTF::CagedPtr::mergePointers):

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

22 months ago[Wasm-References] Disable references by default
justin_michaud@apple.com [Tue, 2 Jul 2019 05:14:17 +0000 (05:14 +0000)]
[Wasm-References] Disable references by default
https://bugs.webkit.org/show_bug.cgi?id=199390

Reviewed by Saam Barati.

JSTests:

* wasm/references-spec-tests/ref_is_null.js:
* wasm/references-spec-tests/ref_null.js:
* wasm/references/anyref_globals.js:
* wasm/references/anyref_modules.js:
* wasm/references/anyref_table.js:
* wasm/references/anyref_table_import.js:
* wasm/references/element_parsing.js:
* wasm/references/func_ref.js:
* wasm/references/is_null.js:
* wasm/references/multitable.js:
* wasm/references/table_misc.js:
* wasm/references/validation.js:

Source/JavaScriptCore:

* runtime/Options.h:

Tools:

* Scripts/run-jsc-stress-tests:

LayoutTests:

* workers/wasm-references.html:

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

22 months ago[Text autosizing] [iPadOS] AutosizeStatus::idempotentTextSize returns the computed...
zalan@apple.com [Tue, 2 Jul 2019 05:10:54 +0000 (05:10 +0000)]
[Text autosizing] [iPadOS] AutosizeStatus::idempotentTextSize returns the computed font size in certain cases.
https://bugs.webkit.org/show_bug.cgi?id=199382
<rdar://problem/52483097>

Reviewed by Wenson Hsieh.

Adjust the font size on the style only when the autosized value is different from the computed value.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):

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

22 months agoUnreviewed. Revert r246965 to fix build break
jh718.park@samsung.com [Tue, 2 Jul 2019 04:34:59 +0000 (04:34 +0000)]
Unreviewed. Revert r246965 to fix build break
since r247019 reverted its related changes.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::popupValue const): Deleted.

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

22 months agoWeb Inspector: REGRESSION(r245498): Timelines: CPU: discontinuities are filled in...
drousso@apple.com [Tue, 2 Jul 2019 01:17:50 +0000 (01:17 +0000)]
Web Inspector: REGRESSION(r245498): Timelines: CPU: discontinuities are filled in by the next record
https://bugs.webkit.org/show_bug.cgi?id=198927

Reviewed by Matt Baker.

Source/WebInspectorUI:

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.capturingStarted):
(WI.TimelineManager.prototype.capturingStopped):
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording):
(WI.TimelineRecording.prototype.start):
(WI.TimelineRecording.prototype.capturingStarted): Added.
(WI.TimelineRecording.prototype.capturingStopped): Added.
(WI.TimelineRecording.prototype.reset):
(WI.TimelineRecording.prototype.addRecord):
(WI.TimelineRecording.prototype.discontinuitiesInTimeRange):
(WI.TimelineRecording.prototype.addDiscontinuity): Deleted.
Notify the `TimelineRecording` when capturing has started/stopped.
Adjust the first record after a discontinuity to have it's `startTime` match the `endTime`
of the most recent discontinuity.

* UserInterface/Models/Timeline.js:
(WI.Timeline.prototype.addRecord):
* UserInterface/Models/CPUTimeline.js:
(WI.CPUTimeline.prototype.addRecord):
* UserInterface/Models/CPUTimelineRecord.js:
(WI.CPUTimelineRecord.prototype.adjustStartTime): Added.
(WI.CPUTimelineRecord.prototype.adjustStartTimeToLastRecord): Deleted.
* UserInterface/Models/MemoryTimeline.js:
(WI.MemoryTimeline.prototype.addRecord):
* UserInterface/Models/MemoryTimelineRecord.js:
(WI.MemoryTimelineRecord.prototype.adjustStartTime): Added.
(WI.MemoryTimelineRecord.prototype.adjustStartTimeToLastRecord): Deleted.
* UserInterface/Models/NetworkTimeline.js:
(WI.NetworkTimeline.prototype.addRecord):

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.layout):
* UserInterface/Views/MemoryTimelineOverviewGraph.js:
(WI.MemoryTimelineOverviewGraph.prototype.layout):
* UserInterface/Views/MemoryTimelineView.js:
(WI.MemoryTimelineView.prototype.layout):
Include discontinuities that exactly match the start/end time of the record immediately
before/after the discontinuity.

* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._handleTimelineCapturingStateChanged):
(WI.TimelineRecordingContentView.prototype._recordingReset):
Move the logic for handling discontinuity start/end times to the `TimelineRecording`.

* UserInterface/Base/Utilities.js:

LayoutTests:

* inspector/unit-tests/set-utilities.html:
* inspector/unit-tests/set-utilities-expected.txt:

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

22 months agoLayout Test imported/blink/fast/multicol/span/overflow-on-viewport.html is flaky.
tsavell@apple.com [Mon, 1 Jul 2019 23:45:01 +0000 (23:45 +0000)]
Layout Test imported/blink/fast/multicol/span/overflow-on-viewport.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=199387

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-07-01

* platform/ios-wk2/TestExpectations:

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

22 months ago[iOS 13] editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk...
wenson_hsieh@apple.com [Mon, 1 Jul 2019 22:32:15 +0000 (22:32 +0000)]
[iOS 13] editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk.html fails on trunk
https://bugs.webkit.org/show_bug.cgi?id=199384

Reviewed by Tim Horton.

Adjust this test to show the callout menu by tapping on the caret rect, rather than the center of the editable
area. Currently, tapping the center of the editable area twice results in a double tap, which fails to trigger
the callout bar.

* editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk.html:

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

22 months agoRemove virtual functions on WebProcessLifetimeObserver that are unused after r245540
cdumez@apple.com [Mon, 1 Jul 2019 22:27:07 +0000 (22:27 +0000)]
Remove virtual functions on WebProcessLifetimeObserver that are unused after r245540
https://bugs.webkit.org/show_bug.cgi?id=199383

Reviewed by Alex Christensen.

* UIProcess/WebProcessLifetimeObserver.h:
(WebKit::WebProcessLifetimeObserver::webProcessDidCloseConnection):
* UIProcess/WebProcessLifetimeTracker.cpp:
(WebKit::WebProcessLifetimeTracker::addObserver):
(WebKit::WebProcessLifetimeTracker::pageWasInvalidated):

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

22 months agoStorageManager::SessionStorageNamespace::allowedConnections() should not copy the...
cdumez@apple.com [Mon, 1 Jul 2019 22:16:11 +0000 (22:16 +0000)]
StorageManager::SessionStorageNamespace::allowedConnections() should not copy the HashSet
https://bugs.webkit.org/show_bug.cgi?id=199379

Reviewed by Alex Christensen.

This was pretty inefficient.

* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):

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

22 months ago[iOS] REGRESSION (r246757): Unable to select non-editable text in subframes
wenson_hsieh@apple.com [Mon, 1 Jul 2019 22:10:44 +0000 (22:10 +0000)]
[iOS] REGRESSION (r246757): Unable to select non-editable text in subframes
https://bugs.webkit.org/show_bug.cgi?id=199366
<rdar://problem/52460509>

Reviewed by Tim Horton.

r246757 removed logic in selectionPositionInformation responsible for setting the focused frame when handling a
position information request. As the FIXME formerly in InteractionInformationRequest.h alluded to, text
selection gestures on iOS were dependent on this behavior when selecting text in subframes, since text selection
helpers in WebPageIOS.mm assume that the focused frame already contains the selection being set.

Rather than calling setFocusedFrame when requesting position information, we can fix this by making
WebPage::selectWithGesture and WebPage::selectTextWithGranularityAtPoint both set the focused frame if needed
before extending or moving text selections.

Covered by layout tests that began to fail after r246757:
- editing/selection/ios/selection-handles-in-iframe.html
- editing/selection/ios/selection-handle-clamping-in-iframe.html

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

Only call the new helper method, setFocusedFrameBeforeSelectingTextAtLocation, at the start of the gesture.

(WebKit::WebPage::setFocusedFrameBeforeSelectingTextAtLocation):
(WebKit::WebPage::selectTextWithGranularityAtPoint):

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

22 months agoAdd new decidePolicyForNavigationAction SPI with preferences and userInfo
commit-queue@webkit.org [Mon, 1 Jul 2019 22:07:09 +0000 (22:07 +0000)]
Add new decidePolicyForNavigationAction SPI with preferences and userInfo
https://bugs.webkit.org/show_bug.cgi?id=199371
<rdar://problem/52352905>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-01
Reviewed by Tim Horton.

Source/WebKit:

Also deprecate some older SPI so we may someday clean up this mess.

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::NavigationClient::shouldBypassContentModeSafeguards const):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm:
(-[NavigationActionSPIDelegate webView:didFinishNavigation:]):
(-[NavigationActionSPIDelegate _webView:decidePolicyForNavigationAction:preferences:userInfo:decisionHandler:]):
(-[NavigationActionSPIDelegate spiCalled]):
(TEST):

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

22 months agoIt should not be possible to trigger a load while in the middle of restoring a page...
cdumez@apple.com [Mon, 1 Jul 2019 21:55:03 +0000 (21:55 +0000)]
It should not be possible to trigger a load while in the middle of restoring a page in PageCache
https://bugs.webkit.org/show_bug.cgi?id=199190
<rdar://problem/52114552>

Reviewed by Brady Eidson.

Source/WebCore:

Test: http/tests/security/navigate-when-restoring-cached-page.html

* history/CachedFrame.cpp:
(WebCore::CachedFrame::open):
Stop attaching the cached document before calling FrameLoader::open() given that the previous document
is still attached to the frame at this point. This avoids having 2 documents attached to the same frame
during a short period of time.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::open):
We now attach the cached document to the frame *after* calling FrameLoader::clear(), which means that
the previous document now has been detached from this frame.

(WebCore::FrameLoader::detachChildren):
As per the HTML specification [1], an attempt to navigate should fail if the prompt to unload algorithm
is being run for the active document of browsingContext. Note that the "prompt to unload" algorithm [2]
includes firing the 'unload' event in the current document and in all the documents in the subframes.
As a result, FrameLoader::detachChildren() is the right prevent such navigations. We were actually trying
to do this via the SubframeLoadingDisabler stack variable inside detachChildren(). The issue is that this
only prevents navigation in the subframes (i.e. <iframe> elements), not the main frame. As a result,
script would be able to navigate the top-frame even though detachChildren() is being called on the top
frame. To address the issue, I now create a NavigationDisabler variable in the scope of detachChildren()
when detachChildren() is called on the top frame. NavigationDisabler prevents all navigations within the
page, including navigations on the main/top frame.

[1] https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate
[2] https://html.spec.whatwg.org/multipage/browsing-the-web.html#prompt-to-unload-a-document

LayoutTests:

Add layout test coverage.

* http/tests/security/navigate-when-restoring-cached-page-expected.txt: Added.
* http/tests/security/navigate-when-restoring-cached-page.html: Added.
* http/tests/security/resources/navigate-when-restoring-cached-page-frame.html: Added.
* http/tests/security/resources/navigate-when-restoring-cached-page-victim.html: Added.

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

22 months agoUnreviewed, rolling out r246844.
tsavell@apple.com [Mon, 1 Jul 2019 21:25:57 +0000 (21:25 +0000)]
Unreviewed, rolling out r246844.

Broke 12 tests in imported/w3c/web-platform-
tests/pointerevents/

Reverted changeset:

"[Pointer Events] Respect pointer capture when dispatching
mouse boundary events and updating :hover"
https://bugs.webkit.org/show_bug.cgi?id=198999
https://trac.webkit.org/changeset/246844

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

22 months agoUnreviewed, rolling out r246849.
tsavell@apple.com [Mon, 1 Jul 2019 21:23:44 +0000 (21:23 +0000)]
Unreviewed, rolling out r246849.

12 tests broken in r246844 require this to be rolled out.

Reverted changeset:

"[Pointer Events] Respect pointer capture when dispatching
mouse boundary events and updating :hover"
https://bugs.webkit.org/show_bug.cgi?id=198999
https://trac.webkit.org/changeset/246849

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

22 months agoSource/WebKit:
commit-queue@webkit.org [Mon, 1 Jul 2019 21:17:00 +0000 (21:17 +0000)]
Source/WebKit:
Deprecate but still call _webView:showCustomSheetForElement: after transition to UIContextMenuInteraction
https://bugs.webkit.org/show_bug.cgi?id=199296
<rdar://problem/51041960>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-01
Reviewed by Darin Adler.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showAttachmentSheet]):
(-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
(-[WKContentView continueContextMenuInteraction:]):

Tools:
Deprecate _webView:showCustomSheetForElement: after transition to UIContextMenuInteraction
https://bugs.webkit.org/show_bug.cgi?id=199296
<rdar://problem/51041960>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-01
Reviewed by Darin Adler.

* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator _webView:showCustomSheetForElement:]):

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

22 months agoNull check provisionalItem in FrameLoader::continueLoadAfterNavigationPolicy
commit-queue@webkit.org [Mon, 1 Jul 2019 21:11:36 +0000 (21:11 +0000)]
Null check provisionalItem in FrameLoader::continueLoadAfterNavigationPolicy
https://bugs.webkit.org/show_bug.cgi?id=199327
<rdar://problem/48262384>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-01
Reviewed by Darin Adler.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
Sometimes provisionalItem is null.  Let's not crash.

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

22 months agoAdd main thread assertions in sendWithAsyncReply code
commit-queue@webkit.org [Mon, 1 Jul 2019 21:11:29 +0000 (21:11 +0000)]
Add main thread assertions in sendWithAsyncReply code
https://bugs.webkit.org/show_bug.cgi?id=199324

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-01
Reviewed by Sam Weinig.

sendWithAsyncReply can only be used on the main thread because
the CompletionHandler will be called on the main thread, and if it's
called from a background thread, then HashMap corruption will likely happen.
Add assertions to alert developers that they should only call sendWithAsyncReply
from the main thread.

This is responding to good feedback from r237294

* Platform/IPC/Connection.cpp:
(IPC::asyncReplyHandlerMap):
(IPC::nextAsyncReplyHandlerID):
(IPC::addAsyncReplyHandler):
(IPC::clearAsyncReplyHandlers):
(IPC::CompletionHandler<void):

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

22 months agoUnreviewed, rolling out r246958.
tsavell@apple.com [Mon, 1 Jul 2019 21:07:31 +0000 (21:07 +0000)]
Unreviewed, rolling out r246958.

Broke inspector/dom/getAccessibilityPropertiesForNode.html

Reverted changeset:

"Enhance support of aria-haspopup per ARIA 1.1 specification."
https://bugs.webkit.org/show_bug.cgi?id=199216
https://trac.webkit.org/changeset/246958

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

22 months ago[iOS] Exiting from fullscreen scrolls to top of page
eric.carlson@apple.com [Mon, 1 Jul 2019 20:52:58 +0000 (20:52 +0000)]
[iOS] Exiting from fullscreen scrolls to top of page
https://bugs.webkit.org/show_bug.cgi?id=199338
<rdar://problem/51273017>

Reviewed by Jer Noble.

Source/WebKit:

* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _completedExitFullScreen]): Restore scroll position.
Hide window after restoring scroll position.
(-[WKFullScreenWindowController _exitFullscreenImmediately]): Drive-by fix: remove code
already also done in _completedExitFullScreen.

LayoutTests:

* fullscreen/fullscreen-restore-scroll-position-expected.txt: Added.
* fullscreen/fullscreen-restore-scroll-position.html: Added.

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

22 months agoMore judiciously handle clearing/creation of DOMWindows for new Documents.
beidson@apple.com [Mon, 1 Jul 2019 20:29:20 +0000 (20:29 +0000)]
More judiciously handle clearing/creation of DOMWindows for new Documents.
<rdar://problem/51665406> and https://bugs.webkit.org/show_bug.cgi?id=198786

Reviewed by Chris Dumez.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeIfJavaScriptURL):

* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::replaceDocumentWithResultOfExecutingJavascriptURL): Rename for clarity.
(WebCore::DocumentWriter::begin): Handle DOMWindow taking/creation inside FrameLoader::clear via a lambda.
(WebCore::DocumentWriter::replaceDocument): Deleted.
* loader/DocumentWriter.h:

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear): Take a "handleDOMWindowCreation" lambda to run after clearing the previous document.
* loader/FrameLoader.h:

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

22 months agoLayout Test imported/mozilla/svg/text/selectSubString.svg is flaky.
tsavell@apple.com [Mon, 1 Jul 2019 20:14:19 +0000 (20:14 +0000)]
Layout Test imported/mozilla/svg/text/selectSubString.svg is flaky.
https://bugs.webkit.org/show_bug.cgi?id=199370

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-07-01

* platform/ios-wk2/TestExpectations:

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

22 months agoSource/WebCore:
zalan@apple.com [Mon, 1 Jul 2019 19:57:39 +0000 (19:57 +0000)]
Source/WebCore:
[iPadOS] Tapping on the bottom part of youtube video behaves as if controls were visible
https://bugs.webkit.org/show_bug.cgi?id=199349
<rdar://problem/51955744>

Reviewed by Simon Fraser.

Synthetic click event should not be dispatched to a node that is initially hidden (by opacity: 0) and becomes visible by the touchStart event.
While this behaves different from macOS where opacity: 0; content is "clickable", it impoves usability on certain sites like YouTube.com.

Test: fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition2.html

* dom/Node.cpp:
(WebCore::Node::defaultEventHandler):
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::isConsideredHidden):
(WebCore::ContentChangeObserver::reset):
(WebCore::isConsideredHidden): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::setHiddenTouchTarget):
(WebCore::ContentChangeObserver::resetHiddenTouchTarget):
(WebCore::ContentChangeObserver::hiddenTouchTarget const):

Source/WebKit:
Tapping on the bottom part of youtube video behaves as if controls were visible
https://bugs.webkit.org/show_bug.cgi?id=199349
<rdar://problem/51955744>

Reviewed by Simon Fraser.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::handleTouchEvent):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::potentialTapAtPosition):

LayoutTests:
Tapping on the bottom part of youtube video behaves as if controls were visible
https://bugs.webkit.org/show_bug.cgi?id=199349
<rdar://problem/51955744>

Reviewed by Simon Fraser.

* fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition2-expected.txt: Added.
* fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition2.html: Added.

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

22 months ago[FTW] Build WebCore
bfulgham@apple.com [Mon, 1 Jul 2019 19:32:31 +0000 (19:32 +0000)]
[FTW] Build WebCore
https://bugs.webkit.org/show_bug.cgi?id=199199

Reviewed by Don Olmstead.

.:

Establish a set of build options for the FTW port, based on the current WinCairo
feature set. I also note which features should be turned on, but aren't yet, as
well as which features are disabled due to lack of WebGL and Media support in
the current build.

* Source/cmake/OptionsFTW.cmake:

Source/WebCore:

Make some minor corrections needed to get FTW WebCore to build and link.

* PlatformFTW.cmake: Added.
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::setURLForRect):
* platform/graphics/win/PatternDirect2D.cpp:
* platform/graphics/win/SimpleFontDataDirect2D.cpp:
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::setTargetContext): Added stub.
* platform/image-decoders/ScalableImageDecoder.h:
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::hasCookies):
(WebCore::CookieJarDB::canAcceptCookie):

Source/WebCore/PAL:

* pal/PlatformFTW.cmake: Added.

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

22 months agoiOS: REGRESSION(async scroll): Caret doesn't scroll when scrolling textarea
wenson_hsieh@apple.com [Mon, 1 Jul 2019 18:14:10 +0000 (18:14 +0000)]
iOS: REGRESSION(async scroll): Caret doesn't scroll when scrolling textarea
https://bugs.webkit.org/show_bug.cgi?id=198217
<rdar://problem/51097296>

Reviewed by Simon Fraser.

Source/WebCore:

Add a ScrollingLayerPositionAction argument to ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling, and
avoid bailing early in the case where ScrollingLayerPositionAction::Set is used. See the WebKit ChangeLog for
more detail.

Test: editing/selection/ios/update-selection-after-overflow-scroll.html

* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
* page/scrolling/ScrollingTreeScrollingNode.h:

Source/WebKit:

In iOS 12, when scrolling a text selection in an fast-scrolling container, editor state updates are scheduled
under AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll after the end of the scrolling gesture,
when the scrolling layer action is ScrollingLayerPositionAction::Set. This is no longer the case in iOS 13,
because we now bail in ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling after scroll deceleration
finishes since the scroll position didn't end up changing. Additionally, we no longer use
ScrollingLayerPositionAction::Set in the case where scrolling finished decelerating, since
ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll no longer uses to value of inUserInteraction to
determine whether to Set or Sync scrolling layer positions.

To restore iOS 12 behavior, ensure that we send a scrolling tree update using ScrollingLayerPositionAction::Set
after scrolling ends.

* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):

LayoutTests:

Add a new layout test to check that the text selection views are updated after scrolling in a fast overflow
scrolling container.

* editing/selection/ios/update-selection-after-overflow-scroll-expected.txt: Added.
* editing/selection/ios/update-selection-after-overflow-scroll.html: Added.

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

22 months agoREGRESSION(r240047): Overflow scrollers on WK1 fail to update their content size...
antti@apple.com [Mon, 1 Jul 2019 18:09:27 +0000 (18:09 +0000)]
REGRESSION(r240047): Overflow scrollers on WK1 fail to update their content size when it changes
https://bugs.webkit.org/show_bug.cgi?id=199360
<rdar://problem/51643386>

Reviewed by Simon Fraser.

r240047 replaced didCommitChangesForLayer() mechanism by a more narrow didChangePlatformLayerForLayer.
Unfortunately on WK1 we relied on scroll layers being invalidated after every size (and scrollbar) change.
Without this invalidation we don't call WebChromeClientIOS::addOrUpdateScrollingLayer and the UIKit delegate
that resizes the UIScrollView content.

Fix by removing the scroll layer invalidation mechanism from LegacyWebKitScrollingLayerCoordinator completely and instead
simply update all scroll layers after commit. The UIKit delegate doesn't do any significant work if nothing changes,
this was not a very meaninful optimization.

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

Update all scroll layers after flush (similar to viewport constrained layers).

(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate): Deleted.
(WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer): Deleted.
* rendering/RenderLayerCompositor.h:

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

22 months agoUnreviewed, rolling out r246946.
ryanhaddad@apple.com [Mon, 1 Jul 2019 16:59:33 +0000 (16:59 +0000)]
Unreviewed, rolling out r246946.

Caused JSC test crashes on arm64

Reverted changeset:

"Add b3 macro lowering for CheckMul on arm64"
https://bugs.webkit.org/show_bug.cgi?id=199251
https://trac.webkit.org/changeset/246946

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

22 months ago[GStreamer] Cannot play Bert's Bytes radio stream from http://radio.dos.nl/
philn@webkit.org [Mon, 1 Jul 2019 16:57:03 +0000 (16:57 +0000)]
[GStreamer] Cannot play Bert's Bytes radio stream from radio.dos.nl/
https://bugs.webkit.org/show_bug.cgi?id=198376

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

The delayed startup was due to a mix of buffering feedback
messages not handled correctly by the player. We were handling
download and streaming buffering metrics without distinction.
Range requests (used for seeking) were also triggering on-disk
buffering in some cases. The buffering percentage estimation based
on network read position was not working either because uint64_t
division doesn't return a floating point value.

No new tests, existing media tests cover this patch.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::commitLoad):
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
(WebCore::MediaPlayerPrivateGStreamer::updateBufferingStatus):
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded const):
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
(WebCore::MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag):
(WebCore::MediaPlayerPrivateGStreamer::setPreload):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkitWebSrcReset):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:

Source/WTF:

* wtf/glib/GLibUtilities.h:
(enumToString): Utility function to get a string representation of of a GLib enum.

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

22 months agoPerform less work when a pre-warmed WebProcess is suspended or resumed.
pvollan@apple.com [Mon, 1 Jul 2019 15:34:16 +0000 (15:34 +0000)]
Perform less work when a pre-warmed WebProcess is suspended or resumed.
https://bugs.webkit.org/show_bug.cgi?id=199195

Reviewed by Darin Adler.

Return early from WebProcess::actualPrepareToSuspend and WebProcess::processDidResume
if this is a pre-warmed process. This is a confirmed improvement in page load time.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):

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

22 months agoREGRESSION(r246963) GTK's debug build is broken
magomez@igalia.com [Mon, 1 Jul 2019 13:42:25 +0000 (13:42 +0000)]
REGRESSION(r246963) GTK's debug build is broken
https://bugs.webkit.org/show_bug.cgi?id=199358

Reviewed by Michael Catanzaro.

Add traits to be able to downcast AnimatedBackingStoreClient.

* platform/graphics/nicosia/NicosiaAnimatedBackingStoreClient.h:
(Nicosia::AnimatedBackingStoreClient::AnimatedBackingStoreClient):
(Nicosia::AnimatedBackingStoreClient::type const):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):

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

22 months agoUnreviewed. Fix GTK build with GSTREAMER_GL disabled after r246710
carlosgc@webkit.org [Mon, 1 Jul 2019 12:10:54 +0000 (12:10 +0000)]
Unreviewed. Fix GTK build with GSTREAMER_GL disabled after r246710

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

22 months agoUnreviewed, GTK a11y tests fix after r246958
philn@webkit.org [Mon, 1 Jul 2019 08:27:07 +0000 (08:27 +0000)]
Unreviewed, GTK a11y tests fix after r246958

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::popupValue const):

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

22 months agoWebSockets: add support for sending blob messages when using web sockets platform...
carlosgc@webkit.org [Mon, 1 Jul 2019 08:09:46 +0000 (08:09 +0000)]
WebSockets: add support for sending blob messages when using web sockets platform APIs
https://bugs.webkit.org/show_bug.cgi?id=199189

Reviewed by Youenn Fablet.

Source/WebCore:

* Headers.cmake: Add missing headers.

Source/WebKit:

Add helper private class BlobLoader that uses FileReaderLoader to load the blobs. Since blob loads are
asynchronous, the messages are queued using another helper internal class PendingMessage.

* WebProcess/Network/WebSocketChannel.cpp:
(WebKit::WebSocketChannel::increaseBufferedAmount): Increase the buffered amount checking we don't overlofw.
(WebKit::WebSocketChannel::decreaseBufferedAmount): Decrease the buffered amount.
(WebKit::WebSocketChannel::sendMessage): Helper class to send message to the network process and decrease the
buffered amount when done.
(WebKit::WebSocketChannel::send): Queue the message in pending queue if there are pending messages in the queue
for text and binary messages. For blobs, always queue the message unless it's an empty blob that we can handle
as empty binary data directly.
(WebKit::PendingMessage::PendingMessage): Helper class to queue message requests.
(WebKit::PendingMessage::type const): Type of message: Text, Binary, Blob.
(WebKit::PendingMessage::textMessage const): The text message.
(WebKit::PendingMessage::binaryData const): The binary data.
(WebKit::PendingMessage::blobLoader const): The blob loader.
(WebKit::WebSocketChannel::fail): Notify the client about the error to ensure onclose is emitted.
(WebKit::WebSocketChannel::disconnect): Clear the pending messages queue.
* WebProcess/Network/WebSocketChannel.h:

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

22 months ago[WPE][GTK] Content disappearing when using CSS transforms
magomez@igalia.com [Mon, 1 Jul 2019 08:01:19 +0000 (08:01 +0000)]
[WPE][GTK] Content disappearing when using CSS transforms
https://bugs.webkit.org/show_bug.cgi?id=181757

Reviewed by Žan Doberšek.

Source/WebCore:

During each layer flush, create an AnimatedBackingStoreClient instance for each layer that
has a backingStore and is to be animated, and send that client to the appropriate
TextureMapperLayer on the compositor thread. During each frame rendering, the client will
use the future layer position (currently 50ms in the future) to check whether new tiles are
required to keep the animation ongoing, and notify the appropriate CoordinatedGraphicsLayer so
it can perform a layer flush and provide new tiles.

* platform/TextureMapper.cmake:
* platform/graphics/nicosia/NicosiaAnimatedBackingStoreClient.h: Added.
* platform/graphics/nicosia/NicosiaPlatformLayer.h:
(Nicosia::CompositionLayer::flushState):
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::applyKeepingInternalState):
(WebCore::TextureMapperAnimations::applyKeepingInternalState):
* platform/graphics/texmap/TextureMapperAnimation.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::computeTransformsRecursive):
(WebCore::TextureMapperLayer::setAnimatedBackingStoreClient):
(WebCore::TextureMapperLayer::syncAnimations):
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
(WebCore::clampToContentsRectIfRectIsInfinite):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::requestBackingStoreUpdate):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

Source/WebKit:

Set the appropriate AnimatedBackingStoreClient to the TextureMapperLayers when required.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::updateSceneState):

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

22 months agoUse separate variables for moving and stationary scrolling relationships in RemoteLay...
antti@apple.com [Mon, 1 Jul 2019 05:52:30 +0000 (05:52 +0000)]
Use separate variables for moving and stationary scrolling relationships in RemoteLayerTreeNode
https://bugs.webkit.org/show_bug.cgi?id=199348

Reviewed by Darin Adler.

Source/WebCore:

* page/scrolling/ScrollingStateStickyNode.cpp:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::activeOverflowScrollProxyNodes):
(WebCore::ScrollingTree::activePositionedNodes):
(WebCore::ScrollingTree::nodesWithRelatedOverflow): Deleted.

Use separate sets for overflow proxies and positioned nodes.
Use Refs to nodes instead of ids to simplify client code. This doesn't affect lifetimes, these sets are cleared
at the beginning of each commit.

* page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
(WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
* page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
(WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):

Source/WebKit:

A layer can have only one acting scroll parent. Not using a vector for that case makes the code clearer.

* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
(WebKit::RemoteLayerTreeNode::actingScrollContainerID const):
(WebKit::RemoteLayerTreeNode::stationaryScrollContainerIDs const):

Separate fields for the acting container and stationary containers.

(WebKit::RemoteLayerTreeNode::setActingScrollContainerID):
(WebKit::RemoteLayerTreeNode::setStationaryScrollContainerIDs):
(WebKit::RemoteLayerTreeNode::relatedScrollContainerIDs const): Deleted.
(WebKit::RemoteLayerTreeNode::relatedScrollContainerPositioningBehavior const): Deleted.
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::setRelatedScrollContainerBehaviorAndIDs): Deleted.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::isScrolledBy):
(WebKit::findActingScrollParent):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):

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

22 months agoUnreviewed, rolling out r246959.
Hironori.Fujii@sony.com [Mon, 1 Jul 2019 04:03:42 +0000 (04:03 +0000)]
Unreviewed, rolling out r246959.

svg/clip-path/clip-hidpi.svg is flaky on mac-wk2-ews

Reverted changeset:

"LayoutTests svg/clip-path/clip-hidpi.svg isn't working as
expected due to a syntax error"
https://bugs.webkit.org/show_bug.cgi?id=199313
https://trac.webkit.org/changeset/246959

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

22 months ago[Win] Multiline mode of tooltip control does word-wrapping very slowly
Hironori.Fujii@sony.com [Mon, 1 Jul 2019 02:32:19 +0000 (02:32 +0000)]
[Win] Multiline mode of tooltip control does word-wrapping very slowly
https://bugs.webkit.org/show_bug.cgi?id=198989

Reviewed by Ross Kirsling.

Source/WebKit:

* UIProcess/win/WebView.cpp:
(WebKit::truncatedString): Added.
(WebKit::WebView::setToolTip): Use truncatedString.

Source/WebKitLegacy/win:

* WebView.cpp:
(truncatedString): Added.
(WebView::setToolTip): Use truncatedString.

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

22 months agoLayoutTests svg/clip-path/clip-hidpi.svg isn't working as expected due to a syntax...
Hironori.Fujii@sony.com [Mon, 1 Jul 2019 02:30:40 +0000 (02:30 +0000)]
LayoutTests svg/clip-path/clip-hidpi.svg isn't working as expected due to a syntax error
https://bugs.webkit.org/show_bug.cgi?id=199313

Reviewed by Carlos Garcia Campos.

* svg/clip-path/clip-hidpi.svg: Fix the syntax error by replacing '->' with '=>'.
Call testRunner.waitUntilDone() before testRunner.notifyDone().
* svg/clip-path/clip-hidpi-expected.svg: Call testRunner.setBackingScaleFactor().

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

22 months agoEnhance support of aria-haspopup per ARIA 1.1 specification.
commit-queue@webkit.org [Mon, 1 Jul 2019 01:21:17 +0000 (01:21 +0000)]
Enhance support of aria-haspopup per ARIA 1.1 specification.
https://bugs.webkit.org/show_bug.cgi?id=199216
<rdar://problem/46221342>

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-06-30
Reviewed by Chris Fleizach.

Source/WebCore:

Test button-with-aria-haspopup-role.html was expanded to cover testing
of new functionality.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::popupValue const): replaces hasPopupValue.
(WebCore::AccessibilityObject::hasPopupValue const): Deleted.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::hasPopup const): method rename.
* accessibility/atk/WebKitAccessible.cpp:
(webkitAccessibleGetAttributes): method rename.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityPopupValue]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

Tools:

* DumpRenderTree/AccessibilityUIElement.cpp:
(getPopupValueCallback):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::popupValue const):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::popupValue const):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::popupValue const):

LayoutTests:

* accessibility/button-with-aria-haspopup-role-expected.txt:
* accessibility/button-with-aria-haspopup-role.html:
* accessibility/ios-simulator/button-with-aria-haspopup-role-expected.txt:
* accessibility/ios-simulator/button-with-aria-haspopup-role.html:

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

22 months agoPass WebProcess information to platformInitializeWebProcess().
Basuke.Suzuki@sony.com [Sun, 30 Jun 2019 21:59:19 +0000 (21:59 +0000)]
Pass WebProcess information to platformInitializeWebProcess().
https://bugs.webkit.org/show_bug.cgi?id=199345

Reviewed by Darin Adler.

Add const reference to WebProcessProxy for first argument of
WebProcessPool::platformInitializeWebProcess().

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
* UIProcess/WebProcessPool.h:
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/win/WebProcessPoolWin.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess):

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

22 months ago[LFC] Implement Layout::printLayoutTreeForLiveDocuments
zalan@apple.com [Sun, 30 Jun 2019 14:02:40 +0000 (14:02 +0000)]
[LFC] Implement Layout::printLayoutTreeForLiveDocuments
https://bugs.webkit.org/show_bug.cgi?id=199343
<rdar://problem/52393047>

Reviewed by Antti Koivisto.

* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::printLayoutTreeForLiveDocuments):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

22 months agoWeb Inspector: Remove trailing white-space
nvasilyev@apple.com [Sun, 30 Jun 2019 05:11:26 +0000 (05:11 +0000)]
Web Inspector: Remove trailing white-space
https://bugs.webkit.org/show_bug.cgi?id=199346

Reviewed by Matt Baker.

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype._initiatorCallFramesFromPayload):
* UserInterface/Images/Import.svg:
* UserInterface/Views/CanvasOverviewContentView.css:
(.navigation-bar > .item.canvas-recording-auto-capture > label > input):
* UserInterface/Views/DataGrid.css:
(.data-grid .resizer):
* UserInterface/Views/DatabaseContentView.css:
(.storage-view):
* UserInterface/Views/GoToLineDialog.css:
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/GradientSlider.css:
(.gradient-slider > .add-area):
(.gradient-slider-knob > :matches(img, div)):
* UserInterface/Views/ResourceDetailsSection.css:
* UserInterface/Views/ScrubberNavigationItem.css:
(.navigation-bar .item.scrubber > input[disabled]):
* UserInterface/Views/SourceCodeTextEditor.css:
(.popover .expandable):
* UserInterface/Views/TimelineRecordBar.css:
(.timeline-record-bar.timeline-record-type-script.garbage-collected > .segment,):
* UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
(HeapSnapshotWorker.prototype.createSnapshot):

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

22 months agoRemove duplicate "Private" section and fix white space
nvasilyev@apple.com [Sun, 30 Jun 2019 03:20:51 +0000 (03:20 +0000)]
Remove duplicate "Private" section and fix white space

Unreviewed code style fix.

* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):

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

22 months agoStreamline some string code, focusing on functions that were using substringSharingImpl
darin@apple.com [Sat, 29 Jun 2019 21:50:00 +0000 (21:50 +0000)]
Streamline some string code, focusing on functions that were using substringSharingImpl
https://bugs.webkit.org/show_bug.cgi?id=198898

Reviewed by Daniel Bates.

Source/WebCore:

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::CSSComputedStyleDeclaration): Take a StringView
instead of a String argument for the pseudo-element name. This prevents us from having
to use substringSharingImpl to strip off leading colons.
(WebCore::CSSComputedStyleDeclaration::create): Moved this function in here since it's
no longer being inlined.

* css/CSSComputedStyleDeclaration.h: Moved the create function to no longer be inlined,
since it's better to have the constructor be inlined in the create function instead.
Changed the pseudo-element name argument to be a StringView rather than a String.
Also initialize m_refCount in the class definition.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::parsePseudoElementType): Take a StringView instead of a String.
* css/CSSSelector.h: Updated for the above change.

* css/SelectorPseudoTypeMap.h: Change both parse functions to take StringView. Before
one took a StringImpl and the other used const StringView&, which is not as good as
StringView.

* css/makeSelectorPseudoClassAndCompatibilityElementMap.py: Use StringView, not
const StringView&.

* css/makeSelectorPseudoElementsMap.py: Use StringView rather than StringImpl.

* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parsePageSelector): Use a StringView for the pseudo-element
name. It was already computed as a StringView, but the old code converted it to
an AtomicString.

* css/parser/CSSParserSelector.cpp:
(WebCore::CSSParserSelector::parsePagePseudoSelector): Take a StringView, and
return a std::unique_ptr.
(WebCore::CSSParserSelector::parsePseudoElementSelector): Renamed to not mention
StringView in function name. Take a StringView, not a StringView&. Do the lowercasing
inside this function rather than having it be a caller responsibility. Don't convert
from a StringView to an AtomicString before starting to parse; only do it in the
"unknown/custom" case. Return a std::unique_ptr.
(WebCore::CSSParserSelector::parsePseudoClassSelector): Ditto.
* css/parser/CSSParserSelector.h: Make the three parse functions all take a StringView
and all return a std::unique_ptr. They were already creating objects, but before
callers just had to know to adopt.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo): Updated to use improved parse
functions above.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules const): Updated to use the new
parsePseudoElementType above and use StringView::substring instead of
String::substringSharingImpl.

* platform/Length.cpp:
(WebCore::newCoordsArray): Local string that is "spacified" can't have any non-Latin-1
characters, so use LChar instead of UChar.

* rendering/RenderText.cpp:
(WebCore::convertNoBreakSpaceToSpace): Renamed for clarity. Also use constexpr
instead of inline since this is a pure function.
(WebCore::capitalize): Tighten up logic a bit.

Source/WTF:

* wtf/URLHelpers.cpp:
(WTF::URLHelpers::applyHostNameFunctionToURLString): Change code using
substringSharingImpl so it could call String::find to call StringView::contains
instead. Also rewrote lambdas to be simpler and likely more efficient.
Rewrote another case using substringSharingImpl so it could call String::find
to call StringView::find instead.

* wtf/text/StringView.cpp:
(WTF::StringView::startsWith const): Added.

* wtf/text/StringView.h: Tweaked style a bit, and added an overload of
StringView::contains that takes a CodeUnitMatchFunction and an overload
of startsWith that cakes a UChar.

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

22 months agoRemove a PLATFORM(IOS_FAMILY) related to repaint offsets in composited scrolling...
simon.fraser@apple.com [Sat, 29 Jun 2019 21:01:40 +0000 (21:01 +0000)]
Remove a PLATFORM(IOS_FAMILY) related to repaint offsets in composited scrolling layers
https://bugs.webkit.org/show_bug.cgi?id=199342

Reviewed by Zalan Bujtas.

Source/WebCore:

Code in RenderObject::shouldApplyCompositedContainerScrollsForRepaint() adds VisibleRectContextOption::ApplyCompositedContainerScrolls
only for iOS, and RenderLayerBacking::setContentsNeedDisplayInRect() subtracts out scroll position for only iOS,
so remove this iOS-specific code.

Blame for this code mentions touch event regions, so I tested these but they use absoluteBoundingBoxRect()
which doesn't hit this code. Still, I added a layout test for touch regions inside scrolled overflow.

Existing tests exist for repaint inside scrolled overflow.

Test: fast/events/touch/ios/touch-event-regions/scrolled-overflow.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint): Deleted.
(WebCore::RenderObject::visibleRectContextForRepaint): Deleted.
* rendering/RenderObject.h:
(WebCore::RenderObject::visibleRectContextForRepaint):

LayoutTests:

* fast/events/touch/ios/touch-event-regions/scrolled-overflow-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/scrolled-overflow.html: Added.

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

22 months agoRevise WebContent sandbox based on seed feedback
bfulgham@apple.com [Sat, 29 Jun 2019 05:09:49 +0000 (05:09 +0000)]
Revise WebContent sandbox based on seed feedback
https://bugs.webkit.org/show_bug.cgi?id=199339
<rdar://problem/49609201>

Reviewed by Alexey Proskuryakov.

Unblock syscall needed by CoreText.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

22 months agoiOS WebKit2 find-in-page indicator doesn't move with 'overflow: scroll'
timothy_horton@apple.com [Sat, 29 Jun 2019 03:48:18 +0000 (03:48 +0000)]
iOS WebKit2 find-in-page indicator doesn't move with 'overflow: scroll'
https://bugs.webkit.org/show_bug.cgi?id=175032
<rdar://problem/29346482>

Reviewed by Wenson Hsieh.

Source/WebCore:

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::selectionBounds const):
(WebCore::FrameSelection::revealSelection):
* editing/FrameSelection.h:
Make selectionBounds' clipToVisibleContent param an enum class.

* page/TextIndicator.cpp:
(WebCore::initializeIndicator):
Save the un-clipped selection rect; otherwise we'll frequently save 0, 0
here when finding a match that is off-screen.

Source/WebKit:

* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::drawRect):
(WebKit::FindController::didScrollAffectingFindIndicatorPosition):
Adopt the macOS code that notices that the find highlight doesn't match
its original position, but instead of hiding the highlight like we do on macOS,
update it. We do this asynchronously to avoid mutating the layer tree
in the middle of painting, which is not /truly/ unsafe, but definitely
non-ideal and causes fun flashes.

* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::updateFindIndicator):
Store m_findIndicatorRect when updating the indicator, just like we do on macOS.

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

22 months agoUnreviewed build fix attempt after r246928.
ryanhaddad@apple.com [Fri, 28 Jun 2019 23:35:44 +0000 (23:35 +0000)]
Unreviewed build fix attempt after r246928.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _closeAllMediaPresentations]):

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

22 months agoAdd b3 macro lowering for CheckMul on arm64
justin_michaud@apple.com [Fri, 28 Jun 2019 23:19:11 +0000 (23:19 +0000)]
Add b3 macro lowering for CheckMul on arm64
https://bugs.webkit.org/show_bug.cgi?id=199251

Reviewed by Robin Morisset.

JSTests:

* microbenchmarks/check-mul-constant.js: Added.
(doTest):
* microbenchmarks/check-mul-no-constant.js: Added.
(doTest):
* microbenchmarks/check-mul-power-of-two.js: Added.
(doTest):

Source/JavaScriptCore:

- Lower CheckMul for 32-bit arguments on arm64 into a mul and then an overflow check.
- Add a new opcode to air on arm64 for smull (multiplySignExtend32).
- Fuse sign extend 32 + mul into smull (taking two 32-bit arguments and producing 64 bits).
- 1.25x speedup on power of two microbenchmark, 1.15x speedup on normal constant microbenchmark,
  and no change on the no-constant benchmark.
Also, skip some of the b3 tests that were failing before this patch so that the new tests can run
to completion.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::multiplySignExtend32):
* assembler/testmasm.cpp:
(JSC::testMul32SignExtend):
(JSC::run):
* b3/B3LowerMacros.cpp:
* b3/B3LowerToAir.cpp:
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::testMulArgs32SignExtend):
(JSC::B3::testMulImm32SignExtend):
(JSC::B3::testMemoryFence):
(JSC::B3::testStoreFence):
(JSC::B3::testLoadFence):
(JSC::B3::testPinRegisters):
(JSC::B3::run):

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

22 months agounable to build WebRTC for iOS Simulator
dino@apple.com [Fri, 28 Jun 2019 22:50:41 +0000 (22:50 +0000)]
unable to build WebRTC for iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=199337
<rdar://problem/52020841>

Reviewed by Tim Horton.

Run the compiled yasm with DYLD_ROOT_PATH=/
in order to convince dyld that it can load
the simulator binary on macOS.

* libwebrtc.xcodeproj/project.pbxproj:

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

22 months agoAdding myself as a reviewer in contributors.json.
rmorisset@apple.com [Fri, 28 Jun 2019 22:48:13 +0000 (22:48 +0000)]
Adding myself as a reviewer in contributors.json.

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

22 months ago[Text autosizing][iPadOS] bing.com is hard to read even with boosted text because...
zalan@apple.com [Fri, 28 Jun 2019 22:27:58 +0000 (22:27 +0000)]
[Text autosizing][iPadOS] bing.com is hard to read even with boosted text because of the line height
https://bugs.webkit.org/show_bug.cgi?id=199318
<rdar://problem/51826096>

Reviewed by Wenson Hsieh.

Source/WebCore:

Initial implementation of line height boosting on iPadOs. It enlarges line height in certain cases to improve readability when the text content feels too dense.
It kicks in only for relatively small text (12px) where it slightly (1.25x) changes the line height to widen the gap between lines.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):

LayoutTests:

* fast/text-autosizing/ios/idempotentmode/line-height-boosting-expected.txt: Added.
* fast/text-autosizing/ios/idempotentmode/line-height-boosting.html: Added.

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

22 months agoMake getHostnamesWithCookies more robust
commit-queue@webkit.org [Fri, 28 Jun 2019 22:24:23 +0000 (22:24 +0000)]
Make getHostnamesWithCookies more robust
https://bugs.webkit.org/show_bug.cgi?id=199334
<rdar://problem/51860593>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-06-28
Reviewed by Brent Fulgham.

Crash logs suggest either httpCookies is returning a nil cookie or a cookie without a domain.
This should not happen, but if it does we shouldn't crash.

* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::getHostnamesWithCookies):

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

22 months agoAX: Both convertToNSArray() functions in WebAccessibilityObjectWrapperBase.mm leak...
cfleizach@apple.com [Fri, 28 Jun 2019 22:21:35 +0000 (22:21 +0000)]
AX: Both convertToNSArray() functions in WebAccessibilityObjectWrapperBase.mm leak every NSMutableArray returned
https://bugs.webkit.org/show_bug.cgi?id=199306

Reviewed by David Kilzer.

Stop leaking every instance of convertToNSArray and return an autoreleased version.
Remove unneeded casts.

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityFindMatchingObjects:]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertToNSArray):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper childrenVectorArray]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

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

22 months agoFollowup to r246931
wenson_hsieh@apple.com [Fri, 28 Jun 2019 22:18:33 +0000 (22:18 +0000)]
Followup to r246931
https://bugs.webkit.org/show_bug.cgi?id=199331

Reviewed by Tim Horton.

Extend the site-specific quirk added in r246931 to *.sharepoint.com, so that it fixes Word for enterprise
customers as well.

* page/Quirks.cpp:
(WebCore::Quirks::shouldAvoidResizingWhenInputViewBoundsChange const):

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

22 months agoProtect NetworkProcess::m_swServers from bad session IDs
youenn@apple.com [Fri, 28 Jun 2019 21:53:42 +0000 (21:53 +0000)]
Protect NetworkProcess::m_swServers from bad session IDs
https://bugs.webkit.org/show_bug.cgi?id=199298
<rdar://problem/51859081>

Reviewed by Chris Dumez.

Protect NetworkProcess from receiving bad session IDs in service worker code path by checking for session ID validity whenever interacting with the map.
One of the check is done in WebProcess in which case, if the session ID is bad, the SW connection to NetworkProcess will not be made.
For bad session IDs, this will in that case trigger timing out of service worker operations.

For get/clear data, exit early in case of bad session ID.

Made some refactoring to remove swOriginStoreForSession method.
In the one call site where it is used, the store should already be created so we reuse existingSWOriginStoreForSession.

Added a bunch of additional ASSERTs.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
(WebKit::NetworkProcess::actualPrepareToSuspend):
(WebKit::NetworkProcess::swServerForSession):
(WebKit::NetworkProcess::existingSWOriginStoreForSession const):
(WebKit::NetworkProcess::registerSWServerConnection):
* NetworkProcess/NetworkProcess.h:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::initializeSWClientConnection):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
(WebKit::WebSWClientConnection::initializeConnectionIfNeeded):
(WebKit::WebSWClientConnection::ensureConnectionAndSend):

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

22 months agoRename effectiveAppearanceIsInactive and useInactiveAppearance to better match UIUser...
timothy@apple.com [Fri, 28 Jun 2019 21:39:36 +0000 (21:39 +0000)]
Rename effectiveAppearanceIsInactive and useInactiveAppearance to better match UIUserInterfaceLevel.
https://bugs.webkit.org/show_bug.cgi?id=199336
rdar://problem/52348938

Reviewed by Tim Horton.

Source/WebCore:

* css/StyleColor.h:
* dom/Document.cpp:
(WebCore::Document::useElevatedUserInterfaceLevel const):
(WebCore::Document::styleColorOptions const):
(WebCore::Document::useInactiveAppearance const): Deleted.
* dom/Document.h:
* page/Page.cpp:
(WebCore::Page::effectiveAppearanceDidChange):
* page/Page.h:
(WebCore::Page::useElevatedUserInterfaceLevel const):
(WebCore::Page::useInactiveAppearance const): Deleted.
* platform/ios/LocalCurrentTraitCollection.h:
(WebCore::LocalCurrentTraitCollection::usingElevatedUserInterfaceLevel const):
(WebCore::LocalCurrentTraitCollection::usingBaseLevelAppearance const): Deleted.
* platform/ios/LocalCurrentTraitCollection.mm:
(WebCore::LocalCurrentTraitCollection::LocalCurrentTraitCollection):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::systemColor const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setUseDarkAppearanceInternal):

Source/WebKit:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _effectiveUserInterfaceLevelIsElevated]):
(-[WKWebView _effectiveAppearanceIsInactive]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::effectiveUserInterfaceLevelIsElevated):
(WebKit::WebViewImpl::effectiveAppearanceIsInactive): Deleted.
* UIProcess/PageClient.h:
(WebKit::PageClient::effectiveUserInterfaceLevelIsElevated const):
(WebKit::PageClient::effectiveAppearanceIsInactive const): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::useElevatedUserInterfaceLevel const):
(WebKit::WebPageProxy::effectiveAppearanceDidChange):
(WebKit::WebPageProxy::useInactiveAppearance const): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::effectiveUserInterfaceLevelIsElevated const):
(WebKit::PageClientImpl::effectiveAppearanceIsInactive const): Deleted.
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::effectiveUserInterfaceLevelIsElevated const):
(WebKit::PageClientImpl::effectiveAppearanceIsInactive const): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetUseDarkAppearance):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shrinkToFitContentTimer):
(WebKit::WebPage::effectiveAppearanceDidChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _setUseDarkAppearance:]):
(-[WebView _useElevatedUserInterfaceLevel]):
(-[WebView _setUseElevatedUserInterfaceLevel:]):
(-[WebView _setUseDarkAppearance:useInactiveAppearance:]):
(-[WebView _setUseDarkAppearance:useElevatedUserInterfaceLevel:]):
(-[WebView _effectiveUserInterfaceLevelIsElevated]):
(-[WebView viewDidChangeEffectiveAppearance]):
(-[WebView _useInactiveAppearance]): Deleted.
(-[WebView _setUseInactiveAppearance:]): Deleted.
(-[WebView _effectiveAppearanceIsInactive]): Deleted.
* WebView/WebViewPrivate.h:

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

22 months agoREGRESSION (r239984): pages with custom scrollbars also show normal scrollbars
simon.fraser@apple.com [Fri, 28 Jun 2019 20:23:12 +0000 (20:23 +0000)]
REGRESSION (r239984): pages with custom scrollbars also show normal scrollbars
https://bugs.webkit.org/show_bug.cgi?id=199321
<rdar://problem/52308095>

Reviewed by Timothy Hatcher.

Revert the part of r239984 that made isCustomScrollbar() virtual, since theme().registerScrollbar()
calls it from the base class constructor.

I wasn't able to make a test that tests rendering of overlay scrollbars (webkit.org/b/199323).

* platform/Scrollbar.cpp:
(WebCore::Scrollbar::Scrollbar):
* platform/Scrollbar.h:
(WebCore::Scrollbar::isCustomScrollbar const):
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::RenderScrollbar):
* rendering/RenderScrollbar.h:

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

22 months agoUnreviewed maccatalyst build fix; add ENABLE(FULLSCREEN) checks around calls to fullS...
jer.noble@apple.com [Fri, 28 Jun 2019 20:15:33 +0000 (20:15 +0000)]
Unreviewed maccatalyst build fix; add ENABLE(FULLSCREEN) checks around calls to fullScreenManager().

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _closeAllMediaPresentations]):

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

22 months agomacCatalyst: Selected range sometimes wrong after autocorrection
timothy_horton@apple.com [Fri, 28 Jun 2019 20:14:49 +0000 (20:14 +0000)]
macCatalyst: Selected range sometimes wrong after autocorrection
https://bugs.webkit.org/show_bug.cgi?id=199299
<rdar://problem/49717224>

Reviewed by Wenson Hsieh.

* UIProcess/Cocoa/TextCheckingController.h:
* UIProcess/Cocoa/TextCheckingController.mm:
(WebKit::TextCheckingController::replaceRelativeToSelection):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView replaceSelectionOffset:length:withAnnotatedString:relativeReplacementRange:]):
Plumb the whole relative replacement range through to the Web Content process.

* WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h:
* WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.messages.in:
* WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
(WebKit::TextCheckingControllerProxy::replaceRelativeToSelection):
Only replace the text of the substring that changed (the replacement range),
and fix up the selection offset math (it was really just wrong before).

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

22 months agoNeed a way for SPI clients to know when to avoid resizing to accommodate for the...
wenson_hsieh@apple.com [Fri, 28 Jun 2019 20:12:45 +0000 (20:12 +0000)]
Need a way for SPI clients to know when to avoid resizing to accommodate for the input view bounds
https://bugs.webkit.org/show_bug.cgi?id=199331
<rdar://problem/52116170>

Reviewed by Tim Horton.

Source/WebCore:

Add a new quirk to avoid resizing the web view when input view bounds change.

* page/Quirks.cpp:
(WebCore::Quirks::shouldAvoidResizingWhenInputViewBoundsChange const):
* page/Quirks.h:

Source/WebKit:

Expose new SPI, such that clients may check whether to avoid resizing the web view when changing input view
bounds. In particular, resizing the web view in this case causes toolbar menus in Microsoft Word online to
dismiss immediately after opening them, due to resize events fired as a result of the input view dismissing.

* Shared/FocusedElementInformation.cpp:
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/FocusedElementInformation.h:

Add a new flag to FocusedElementInformation to indicate whether we should avoid resizing the web view when an
input view is presented.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidBlur]):

Reset the value of the flag.

(-[WKContentView _shouldAvoidResizingWhenInputViewBoundsChange]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):

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

22 months agoAdd new -[WKWebView _closeAllMediaPresentations] SPI
jer.noble@apple.com [Fri, 28 Jun 2019 17:39:53 +0000 (17:39 +0000)]
Add new -[WKWebView _closeAllMediaPresentations] SPI
https://bugs.webkit.org/show_bug.cgi?id=199294
<rdar://problem/51965958>

Reviewed by Alex Christensen.

Source/WebKit:

Add a new SPI that will close all out-of-window media presentations, including
picture-in-picture, video fullscreen, and element fullscreen.

Drive-by fixes:

+ -[WKApplicationStateTrackingView didMoveToWindow] incorrectly assumes that a WKWebView will
  never be moved frome one window to another, and asserts.

+ -[WKFullScreenWindowController close] doesn't fire the correct 'webkitfullscreenchange' event
  when called in the middle of animating into fullscreen.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _closeAllMediaPresentations]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::forEachSession):
* UIProcess/ios/WKApplicationStateTrackingView.mm:
(-[WKApplicationStateTrackingView didMoveToWindow]):
* UIProcess/mac/WKFullScreenWindowController.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController exitFullScreenImmediately]):
(-[WKFullScreenWindowController close]):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm: Added.
(TEST):

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

22 months agoAdd a regression test for change r246901
sihui_liu@apple.com [Fri, 28 Jun 2019 17:35:29 +0000 (17:35 +0000)]
Add a regression test for change r246901
https://bugs.webkit.org/show_bug.cgi?id=199290

Reviewed by Geoffrey Garen.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm:
(-[LocalStorageNavigationDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]):
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/localstorage-open-window-private.html: Added.

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

22 months ago[iOS Scrolling] Propagate scrolls to non-nested UIScrollViews
antti@apple.com [Fri, 28 Jun 2019 17:12:27 +0000 (17:12 +0000)]
[iOS Scrolling] Propagate scrolls to non-nested UIScrollViews
https://bugs.webkit.org/show_bug.cgi?id=199222

Reviewed by Simon Fraser.

We may generate scrolling hierarchies where the scrolling ancestor of a layer is not
an ancestor in the layer tree. We  handle this in most situations but there is still
a problem where a scroller fails to propage scroll to the ancestor when it reaches
the edge.

This patch hooks up a new SPI that allows us to tell UIKit about non-ancestor scrolling
relations and solve this problem.

* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::findActingScrollParent):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(-[WKScrollingNodeScrollViewDelegate _actingParentScrollViewForScrollView:]):

Hook into UIKit SPI.

(WebKit::ScrollingTreeScrollingNodeDelegateIOS::findActingScrollParent):

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

22 months agoRemove traces of ENABLE_ICONDATABASE remaining after its removal in 219733
annulen@yandex.ru [Fri, 28 Jun 2019 16:00:17 +0000 (16:00 +0000)]
Remove traces of ENABLE_ICONDATABASE remaining after its removal in 219733
https://bugs.webkit.org/show_bug.cgi?id=199317

Reviewed by Michael Catanzaro.

While IconDatabase and all code using it was removed,
ENABLE_ICONDATABASE still exists as build option and C++ macro.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

PerformanceTests:

* StitchMarker/wtf/FeatureDefines.h:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* Resources/urlIcon.png: Removed file which was only used in
IconDatabase.cpp.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* PlatformGTK.cmake: Remove reference to unused urlIcon.png file.

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:
* WebView/WebView.mm:
(-[WebView _cacheFrameLoadDelegateImplementations]): Use PLATFORM(MAC)
guard instead of ENABLE_ICONDATABASE, because ENABLE_ICONDATABASE was
enabled for macOS only.

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* gtk/manifest.txt.in: Remove reference to unused urlIcon.png file.
* wpe/manifest.txt.in: Remove reference to unused urlIcon.png file.

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

22 months ago-[WKContentView _selectionClipRects] returns a bogus value in -reloadInputViews when...
wenson_hsieh@apple.com [Fri, 28 Jun 2019 14:48:52 +0000 (14:48 +0000)]
-[WKContentView _selectionClipRects] returns a bogus value in -reloadInputViews when focusing an element
https://bugs.webkit.org/show_bug.cgi?id=199310
<rdar://problem/52292137>

Reviewed by Megan Gardner.

Source/WebKit:

When reloading input views under -_elementDidFocus:, -_selectionClipRect returns the value of the previously
focused element; this is because _selectionClipRect depends on EditorState's post layout data, which is only
guaranteed to arrive during the next remote layer tree commit after the element is focused.

However, some clients need to inspect this value under the call to -reloadInputViews when an element is focused;
to make this work, simply check whether we are currently waiting for post-layout EditorState data to arrive
following element focus; if so, return the FocusedElementInformation's elementRect, which represents the initial
state of the focused element. Otherwise, use the EditorState's post layout data, which is guaranteed to be more
up-to-date than the FocusedElementInformation's element rect.

Test: KeyboardInputTests.SelectionClipRectsWhenPresentingInputView

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::waitingForPostLayoutEditorStateUpdateAfterFocusingElement const):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _selectionClipRect]):

Tools:

Add a new API test to verify that _selectionClipRects returns the correct value when invoked under the scope of
_elementDidFocus.

* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/ios/TestInputDelegate.h:
* TestWebKitAPI/Tests/ios/TestInputDelegate.mm:
(-[TestInputDelegate setDidStartInputSessionHandler:]):
(-[TestInputDelegate didStartInputSessionHandler]):

Add plumbing for a handler block in TestInputDelegate.

(-[TestInputDelegate setWillStartInputSessionHandler:]):

Drive-by style fixes to add a space between id and < for Objective-C protocols.

(-[TestInputDelegate willStartInputSessionHandler]):
(-[TestInputDelegate _webView:willStartInputSession:]):
(-[TestInputDelegate _webView:didStartInputSession:]):
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/ios/UIKitSPI.h:

Add a declaration for _selectionClipRects.

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

22 months ago[SOUP] WebSockets: runtime critical warning when closing the connection in some cases
carlosgc@webkit.org [Fri, 28 Jun 2019 07:46:56 +0000 (07:46 +0000)]
[SOUP] WebSockets: runtime critical warning when closing the connection in some cases
https://bugs.webkit.org/show_bug.cgi?id=199265

Reviewed by Michael Catanzaro.

Ensure the connection is still open before calling soup_websocket_connection_close().

* NetworkProcess/soup/WebSocketTaskSoup.cpp:
(WebKit::WebSocketTask::close):

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

22 months ago[Win] unresolved external symbol "JSC::JSObject::didBecomePrototype(void)" referenced...
Hironori.Fujii@sony.com [Fri, 28 Jun 2019 07:38:09 +0000 (07:38 +0000)]
[Win] unresolved external symbol "JSC::JSObject::didBecomePrototype(void)" referenced in function "JSC::Structure::create(...)"
https://bugs.webkit.org/show_bug.cgi?id=199312

Reviewed by Keith Miller.

WinCairo port, clang-cl Release builds reported a following linkage error:

> WebCore.lib(UnifiedSource-4babe430-10.cpp.obj) : error LNK2019: unresolved external symbol "public: void __cdecl JSC::JSObject::didBecomePrototype(void)" (?didBecomePrototype@JSObject@JSC@@QEAAXXZ) referenced in function "public: static class JSC::Structure * __cdecl JSC::Structure::create(class JSC::VM &,class JSC::JSGlobalObject *,class JSC::JSValue,class JSC::TypeInfo const &,struct JSC::ClassInfo const *,unsigned char,unsigned int)" (?create@Structure@JSC@@SAPEAV12@AEAVVM@2@PEAVJSGlobalObject@2@VJSValue@2@AEBVTypeInfo@2@PEBUClassInfo@2@EI@Z)

No new tests because there is no behavior change.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Include <JavaScriptCore/JSCInlines.h>,
and do not include headers which is included by it.

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

22 months agoUnreviewed WPE build fix.
zandobersek@gmail.com [Fri, 28 Jun 2019 05:57:35 +0000 (05:57 +0000)]
Unreviewed WPE build fix.

* SourcesWPE.txt: Add WebSocketTaskSoup.cpp to the build.

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

22 months agoREGRESSION(r244633): e-mail with "height: 100%" causes unstable layout.
zalan@apple.com [Fri, 28 Jun 2019 03:22:29 +0000 (03:22 +0000)]
REGRESSION(r244633): e-mail with "height: 100%" causes unstable layout.
https://bugs.webkit.org/show_bug.cgi?id=199303
<rdar://problem/51340927>

Reviewed by Tim Horton.

Source/WebCore:

This patch restores the previous behavior (pre r244633) where we intentionally reported stale content size value to
avoid unstable layout for content like height: 100px.

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

Tools:

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

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

22 months ago[WinCairo][MediaFoundation] Stop using soft linking for Media Foundation
Hironori.Fujii@sony.com [Fri, 28 Jun 2019 03:08:22 +0000 (03:08 +0000)]
[WinCairo][MediaFoundation] Stop using soft linking for Media Foundation
https://bugs.webkit.org/show_bug.cgi?id=198783
<rdar://problem/52301843>

Unreviewed compilation warning fix. clang-cl reports:

..\..\Source\WebCore\platform\graphics\win\MediaPlayerPrivateMediaFoundation.cpp(526,10): warning: address of function 'MFCreateTopology' will always evaluate to 'true' [-Wpointer-bool-conversion]
    if (!MFCreateTopology)
        ~^~~~~~~~~~~~~~~~
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::createTopologyFromSource): Removed the pointer check of MFCreateTopology.

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

22 months ago[WinCairo][MediaFoundation] Stop using soft linking for Media Foundation
Hironori.Fujii@sony.com [Fri, 28 Jun 2019 02:10:09 +0000 (02:10 +0000)]
[WinCairo][MediaFoundation] Stop using soft linking for Media Foundation
https://bugs.webkit.org/show_bug.cgi?id=198783

Reviewed by Alex Christensen.

WinCairo is supporting Windows 7 or newer. It doesn't need soft
linking anymore.

No new tests because there is no behavior change.

* PlatformWinCairo.cmake: Added libraries to WebCore_LIBRARIES.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::mimeTypeCache):
(WebCore::MediaPlayerPrivateMediaFoundation::setRate):
(WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes):
(WebCore::MediaPlayerPrivateMediaFoundation::createSession):
(WebCore::MediaPlayerPrivateMediaFoundation::endSession):
(WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
(WebCore::MediaPlayerPrivateMediaFoundation::createTopologyFromSource):
(WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
(WebCore::MediaPlayerPrivateMediaFoundation::createSourceStreamNode):
(WebCore::MediaPlayerPrivateMediaFoundation::updateReadyState):
(WebCore::MediaPlayerPrivateMediaFoundation::videoDisplay):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::createOptimalVideoType):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::setFrameRate):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::initializeD3D):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DSample):

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

22 months ago Fix build error on WebCore when disabling ENABLE_INDEXED_DATABASE.
Basuke.Suzuki@sony.com [Fri, 28 Jun 2019 01:49:29 +0000 (01:49 +0000)]
 Fix build error on WebCore when disabling ENABLE_INDEXED_DATABASE.
https://bugs.webkit.org/show_bug.cgi?id=199286

 Unreviewed build fix.

 * testing/Internals.cpp: Make method conditional.
 * testing/Internals.h: Ditto.
 * testing/Internals.idl: Ditto.

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

22 months agoFix crash in ScrollingStateNode::insertChild()
simon.fraser@apple.com [Fri, 28 Jun 2019 01:09:45 +0000 (01:09 +0000)]
Fix crash in ScrollingStateNode::insertChild()
https://bugs.webkit.org/show_bug.cgi?id=199297
rdar://problem/49415136

Reviewed by Tim Horton.

Crash data suggest that 'parent' can be deleted in ScrollingStateTree::insertNode(). To avoid this,
have ScrollingStateTree::m_stateNodeMap store RefPts, and do the same for ScrollingTree::m_nodeMap.

* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::ScrollingStateNode): The relaxAdoptionRequirement() is required
to avoid ASSERT(!m_adoptionIsRequired) when the node is added to the tree in its constructor.
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::unparentNode):
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
(WebCore::ScrollingStateTree::detachAndDestroySubtree):
(WebCore::ScrollingStateTree::stateNodeForID const):
* page/scrolling/ScrollingStateTree.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::updateTreeFromStateNode):
* page/scrolling/ScrollingTree.h:

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

22 months agoProvide overrides for UIKit's suggested actions in UIContextMenuInteraction
dino@apple.com [Fri, 28 Jun 2019 01:06:38 +0000 (01:06 +0000)]
Provide overrides for UIKit's suggested actions in UIContextMenuInteraction
https://bugs.webkit.org/show_bug.cgi?id=199301
<rdar://problem/52297380>

Reviewed by Tim Horton.

We were previously wrapping the actionMenuProvider with our own block
in order to ensure the correct suggestedActions were passed to the provider.
UIKit added API for us to override the actions separately.

Unfortunately we can't quite yet get rid of our access into the
UIContextMenuConfiguration, because we still need to override the preview
handler in the case where the user does not want link previews.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView continueContextMenuInteraction:]):
(-[WKContentView _contextMenuInteraction:overrideSuggestedActionsForConfiguration:]):
Implement the new delegate SPI to provide our own actions.

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

22 months agoFTL keepAlive()'s patchpoint should also declare that it reads HeapRange::top().
mark.lam@apple.com [Fri, 28 Jun 2019 00:26:35 +0000 (00:26 +0000)]
FTL keepAlive()'s patchpoint should also declare that it reads HeapRange::top().
https://bugs.webkit.org/show_bug.cgi?id=199291

Reviewed by Yusuke Suzuki and Filip Pizlo.

The sole purpose of keepAlive() is to communicate to B3 that an LValue
needs to be kept alive past the last opportunity for a GC.  The only way
we can get a GC is via a function call.  Hence, what keepAlive() really
needs to communicate is that the LValue needs to be kept alive past the
last function call.  Function calls read and write HeapRange::top().
Currently, B3 does not shuffle writes.  Hence, simply inserting the
keepAlive() after the calls that can GC is sufficient.

But to be strictly correct, keepAlive() should also declare that it reads
HeapRange::top().  This will guarantee that the keepAlive patchpoint won't
ever be moved before the function call should B3 gain the ability to shuffle
writes in the future.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::keepAlive):

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

22 months agoFix the test added in r246868 on iOS debug simulator.
rniwa@webkit.org [Thu, 27 Jun 2019 23:49:12 +0000 (23:49 +0000)]
Fix the test added in r246868 on iOS debug simulator.

* editing/pasteboard/paste-contents-with-side-effects.html:

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

22 months ago[iOS] Select all with existing range selection replaces range instead of selecting...
dbates@webkit.org [Thu, 27 Jun 2019 23:06:52 +0000 (23:06 +0000)]
[iOS] Select all with existing range selection replaces range instead of selecting all text
https://bugs.webkit.org/show_bug.cgi?id=197950
<rdar://problem/50245131>

Reviewed by Wenson Hsieh.

Source/WebKit:

Following <rdar://problem/47333786>, UIKit now asks WebKit whether it can handle Command + A as
"select all" instead of just demanding that we handle it. So, WebKit needs to be able to correctly
tell UIKit in advance whether it can handle it. Currenlty WebKit tells UIKit it cannot handle a
"select all" whenever there is an existing range selection. So, UIKit does not tell WebKit to
perform the "select all". Moreover, since UIKit has no other means to handle this key command
itself it tells WebKit the key command was not handled. So, WebKit tells the keyboard to insert
the "a". Instead, WebKit should tell UIKit it can handle a "select all" even when this is an
existing range selection. However we need to keep the current logic just for when UIKit is
asking us with respect to populating the callout menu to not regress platform behavior.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]): Do what we do now if we are called
when populating the callout menu and action is Select All. Otherwise, return YES for the Select All
action if we have a non-empty selection.

LayoutTests:

Add a test to ensure that pressing Command + A performs a "select all" even when there
is an existing range selection.

* fast/events/ios/select-all-with-existing-selection-expected.txt: Added.
* fast/events/ios/select-all-with-existing-selection.html: Added.

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

22 months ago[iOS] Stop using cached UITargetedPreviews from previous interactions when starting...
aestes@apple.com [Thu, 27 Jun 2019 22:03:29 +0000 (22:03 +0000)]
[iOS] Stop using cached UITargetedPreviews from previous interactions when starting a new context menu interaction
https://bugs.webkit.org/show_bug.cgi?id=199285
<rdar://problem/52074916>

Reviewed by Tim Horton.

WKContentView was caching the UITargetedPreview created in
-contextMenuInteraction:previewForHighlightingMenuWithConfiguration: for later reuse by
-contextMenuInteraction:previewForDismissingMenuWithConfiguration:. The cached value was
then cleared in -contextMenuInteractionDidEnd:.

This was wrong, because -contextMenuInteractionDidEnd: can be called before
-contextMenuInteraction:previewForDismissingMenuWithConfiguration:, so we would clear the
cache then create and cache a new UITargetedPreview during dismissal. Then when a new
context menu interaction started, we'd reuse the targeted preview created for the previous
dismissal (which has the wrong geometry).

Stop assuming an ordering between
-contextMenuInteraction:previewForDismissingMenuWithConfiguration: and
-contextMenuInteractionDidEnd:. Instead, always create and cache a new UITargetedPreview in
-contextMenuInteraction:previewForHighlightingMenuWithConfiguration:, then reuse it and
clear the cache in -contextMenuInteraction:previewForDismissingMenuWithConfiguration:.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _createTargetedPreviewIfPossible]):
(-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
(-[WKContentView contextMenuInteractionDidEnd:]):

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

22 months agoAvoid using WTF::Function for passing local function pointers and closures in URLHelp...
annulen@yandex.ru [Thu, 27 Jun 2019 21:36:11 +0000 (21:36 +0000)]
Avoid using WTF::Function for passing local function pointers and closures in URLHelpers.cpp
https://bugs.webkit.org/show_bug.cgi?id=199271

Reviewed by Yusuke Suzuki.

WTF::Function allocates memory on heap, which is totally redundant in this
case.

* wtf/URLHelpers.cpp:
(WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):

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

22 months agoMove WebKitLegacy off of a couple AppKit ivars.
timothy@apple.com [Thu, 27 Jun 2019 21:11:13 +0000 (21:11 +0000)]
Move WebKitLegacy off of a couple AppKit ivars.
https://bugs.webkit.org/show_bug.cgi?id=199279
rdar://problem/34983438

Reviewed by Tim Horton.

Source/WebKitLegacy/mac:

* WebView/WebHTMLView.mm:
(-[NSView _setSubviewsIvar:]): Added. Implement on older systems.
(-[NSView _subviewsIvar]): Added. Ditto.
(needsCursorRectsSupportAtPoint): Use _borderView property.
(-[WebHTMLView _setAsideSubviews]): Use _subviewsIvar property.
(-[NSWindow _web_borderView]): Deleted.

Source/WTF:

* wtf/Platform.h: Added HAVE_SUBVIEWS_IVAR_SPI.

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

22 months agoLayout Test fast/parser/parser-yield-timing.html was flaky due to strict tolerance...
commit-queue@webkit.org [Thu, 27 Jun 2019 20:57:10 +0000 (20:57 +0000)]
Layout Test fast/parser/parser-yield-timing.html was flaky due to strict tolerance, increased tolerance.
https://bugs.webkit.org/show_bug.cgi?id=199280

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-27
Reviewed by Tim Horton.

* fast/parser/parser-yield-timing-expected.txt:
* fast/parser/parser-yield-timing.html:
* platform/mac-wk1/TestExpectations:

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

22 months agoRegression(r246526): StorageManager thread hangs
sihui_liu@apple.com [Thu, 27 Jun 2019 20:46:23 +0000 (20:46 +0000)]
Regression(r246526): StorageManager thread hangs
https://bugs.webkit.org/show_bug.cgi?id=199278
<rdar://problem/52202948>

Reviewed by Geoffrey Garen.

r246526 adds a lock m_localStorageNamespacesMutex to protect m_localStorageNamespaces, because
m_localStorageNamespaces is destroyed at main thread while accesses to m_localStorageNamespaces happen in the
background thread.
After r246526, getOrCreateLocalStorageNamespace acquires lock m_localStorageNamespacesMutex when
m_localStorageNamespacesMutex is already acquired in cloneSessionStorageNamespace, so the StorageManager thread
hangs.
To solve this issue, we can remove the lock in getOrCreateLocalStorageNamespace, or we can remove the
m_localStorageNamespacesMutex. waitUntilWritesFinished() before ~StorageManager() already guarantees nothing
will be running in the background thread, so it is unlikely we the access to m_localStorageNamespaces in the
background thread would collide with the destruction of m_localStorageNamespaces. Also, we don't need
didDestroyStorageArea as LocalStorageNamespace can hold the last reference of StorageArea after r245881.

* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::StorageArea):
(WebKit::StorageManager::StorageArea::~StorageArea):
(WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
(WebKit::StorageManager::cloneSessionStorageNamespace):
(WebKit::StorageManager::getLocalStorageOrigins):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
(WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
(WebKit::StorageManager::getOrCreateLocalStorageNamespace):
(WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea): Deleted.
* NetworkProcess/WebStorage/StorageManager.h:

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

22 months agoREGRESSION (r246888): fast/dom/navigator-detached-no-crash.html failing on Apple...
ryanhaddad@apple.com [Thu, 27 Jun 2019 20:44:16 +0000 (20:44 +0000)]
REGRESSION (r246888): fast/dom/navigator-detached-no-crash.html failing on Apple High Sierra Release WK2 (Tests)
https://bugs.webkit.org/show_bug.cgi?id=199284

Unreviewed test gardening.

* platform/mac-highsierra/fast/dom/navigator-detached-no-crash-expected.txt: Rebaseline test after r246888.

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

22 months agoREGRESSION (r246869): ASSERTION FAILED: !renderer().hasRepaintLayoutRects() || render...
simon.fraser@apple.com [Thu, 27 Jun 2019 20:22:16 +0000 (20:22 +0000)]
REGRESSION (r246869): ASSERTION FAILED: !renderer().hasRepaintLayoutRects() || renderer().repaintLayoutRects().m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint())
https://bugs.webkit.org/show_bug.cgi?id=199274

Reviewed by Zalan Bujtas.

When layer backing sharing changes, we need to clear cached repaint rects, since they
painting root changes.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setBackingProviderLayer):

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

22 months agoLayout Test fast/parser/parser-yield-timing.html is flaky.
tsavell@apple.com [Thu, 27 Jun 2019 20:00:40 +0000 (20:00 +0000)]
Layout Test fast/parser/parser-yield-timing.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=199280

Unreviewed test gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-27

* platform/mac-wk1/TestExpectations:

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

22 months agopointerevents/ios/pointer-events-implicit-capture.html fails on iOS
commit-queue@webkit.org [Thu, 27 Jun 2019 19:43:41 +0000 (19:43 +0000)]
pointerevents/ios/pointer-events-implicit-capture.html fails on iOS
https://bugs.webkit.org/show_bug.cgi?id=199259

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

The assumptions made by this test were incorrect. The "gotpointercapture" event should not be dispatched
until the next pointer event is dispatched after setting pointer capture. Even though pointer capture is
set implicitly on "pointerdown" on non-mouse devices, the event will only be fired once a "pointermove" or
"pointerup" event is dispatched.

* pointerevents/ios/pointer-events-implicit-capture.html:

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

22 months agoWebSockets: avoid data copies when queuing tasks in WebSocketChannel
commit-queue@webkit.org [Thu, 27 Jun 2019 18:43:10 +0000 (18:43 +0000)]
WebSockets: avoid data copies when queuing tasks in WebSocketChannel
https://bugs.webkit.org/show_bug.cgi?id=199262

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-06-27
Reviewed by Alex Christensen.

For IPC message handler arguments we can receive rvalue references instead of const references.

* WebProcess/Network/WebSocketChannel.cpp:
(WebKit::WebSocketChannel::didConnect):
(WebKit::WebSocketChannel::didReceiveText):
(WebKit::WebSocketChannel::didReceiveBinaryData):
(WebKit::WebSocketChannel::didClose):
(WebKit::WebSocketChannel::didReceiveMessageError):
* WebProcess/Network/WebSocketChannel.h:

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

22 months agoFix build after revision 246877
youenn@apple.com [Thu, 27 Jun 2019 18:36:13 +0000 (18:36 +0000)]
Fix build after revision 246877
https://bugs.webkit.org/show_bug.cgi?id=199276

Unreviewed.

Pass protocol parameter to NetworkSocketChannel.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:webSocketTask:didOpenWithProtocol:]):
* NetworkProcess/cocoa/WebSocketTaskCocoa.h:
* NetworkProcess/cocoa/WebSocketTaskCocoa.mm:
(WebKit::WebSocketTask::didConnect):

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

22 months agoUnreviewed, fix test failures after r246876.
drousso@apple.com [Thu, 27 Jun 2019 18:27:35 +0000 (18:27 +0000)]
Unreviewed, fix test failures after r246876.

* inspector/worker/console-basic-expected.txt:

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

22 months agoUnreviewed test gardening, rebaseline test after r246876.
ryanhaddad@apple.com [Thu, 27 Jun 2019 18:23:43 +0000 (18:23 +0000)]
Unreviewed test gardening, rebaseline test after r246876.

* inspector/worker/console-basic-expected.txt:

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

22 months agoUpstream use of MACCATALYST
bdakin@apple.com [Thu, 27 Jun 2019 18:17:35 +0000 (18:17 +0000)]
Upstream use of MACCATALYST
https://bugs.webkit.org/show_bug.cgi?id=199245
rdar://problem/51687723

Reviewed by Tim Horton.

PerformanceTests:

* MediaTime/Configurations/SDKVariant.xcconfig:

Source/bmalloc:

* Configurations/SDKVariant.xcconfig:

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/JavaScriptCore.xcconfig:
* Configurations/SDKVariant.xcconfig:

Source/ThirdParty/ANGLE:

* Configurations/SDKVariant.xcconfig:

Source/ThirdParty/libwebrtc:

* Configurations/SDKVariant.xcconfig:

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/SDKVariant.xcconfig:
* Configurations/WebCore.xcconfig:
* Modules/geolocation/ios/GeolocationPositionIOS.mm:
(WebCore::GeolocationPosition::GeolocationPosition):
* editing/cocoa/DictionaryLookup.mm:
(-[WebRevealHighlight drawHighlightContentForItem:context:]):
(WebCore::showPopupOrCreateAnimationController):
* editing/cocoa/WebContentReaderCocoa.mm:
* page/Navigator.h:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::defaultContentChangeObserverEnabled):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::routingContextUID const):
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::canHandleResponse):
* platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
(WebCore::AVAssetMIMETypeCache::isAvailable const):
* platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm:
(WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
* platform/graphics/cv/ImageTransferSessionVT.h:
* platform/graphics/cv/ImageTransferSessionVT.mm:
(WebCore::cvPixelFormatOpenGLKey):
(WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readPasteboardWebContentDataForType):
(WebCore::Pasteboard::supportedWebContentPasteboardTypes):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::registerItemToPasteboard):
(WebCore::PlatformPasteboard::write):
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer setVideoGravity:]):
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderRegistrationInfoList itemProvider]):
(-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
(-[WebItemProviderPasteboard numberOfFiles]):
* platform/network/cf/CertificateInfoCFNet.cpp:
(WebCore::CertificateInfo::summaryInfo const):

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/SDKVariant.xcconfig:
* pal/spi/mac/AVFoundationSPI.h:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig:

Source/WebKit:

* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Network-iOSMac.entitlements: Removed.
* Configurations/Network-macCatalyst.entitlements: Copied from Source/WebKit/Configurations/Network-iOSMac.entitlements.
* Configurations/NetworkService.xcconfig:
* Configurations/SDKVariant.xcconfig:
* Configurations/WebContent-iOSMac.entitlements: Removed.
* Configurations/WebContent-macCatalyst.entitlements: Copied from Source/WebKit/Configurations/WebContent-iOSMac.entitlements.
* Configurations/WebContentService.xcconfig:
* Configurations/WebKit.xcconfig:
* NetworkProcess/ios/NetworkProcessIOS.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::initializeProcess):
(WebKit::NetworkProcess::initializeProcessName):
* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createForExternalHostingProcess):
* Platform/spi/ios/ManagedConfigurationSPI.h:
* Platform/spi/ios/UIKitSPI.h:
* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultCustomPasteboardDataEnabled):
* Shared/ios/AuxiliaryProcessIOS.mm:
(WebKit::AuxiliaryProcess::initializeSandbox):
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const):
(WebKit::InteractionInformationAtPosition::decode):
* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::enableSandboxStyleFileQuarantine):
* Shared/mac/CodeSigning.mm:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _webViewPrintFormatter]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(-[WKRemoteView initWithFrame:contextID:]):
* UIProcess/_WKWebViewPrintFormatter.mm:
* UIProcess/_WKWebViewPrintFormatterInternal.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant _elementActionForDDAction:]):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView _showTapHighlight]):
(-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView _defineForWebView:]):
(-[WKContentView setSelectedTextRange:]):
(-[WKContentView closestPositionToPoint:]):
(-[WKContentView _showShareSheet:inRect:completionHandler:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::desktopClassBrowsingSupported):
(WebKit::desktopClassBrowsingRecommended):
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _showDocumentPickerMenu]):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::dictionaryPopupInfoForRange):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
(WebKit::WebPage::selectWithGesture):
(WebKit::selectionPositionInformation):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeSandbox):
* WebProcess/com.apple.WebProcess.sb.in:

Source/WebKitLegacy/ios:

* Misc/WebGeolocationCoreLocationProvider.mm:
(-[WebGeolocationCoreLocationProvider requestGeolocationAuthorization]):

Source/WebKitLegacy/mac:

* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/SDKVariant.xcconfig:

Source/WTF:

* Configurations/SDKVariant.xcconfig:
* wtf/FeatureDefines.h:
* wtf/Platform.h:

Tools:

* ContentExtensionTester/Configurations/SDKVariant.xcconfig:
* DumpRenderTree/mac/Configurations/SDKVariant.xcconfig:
* ImageDiff/cg/Configurations/SDKVariant.xcconfig:
* MiniBrowser/Configurations/SDKVariant.xcconfig:
* MobileMiniBrowser/Configurations/SDKVariant.xcconfig:
* Scripts/webkitpy/generate_xcfilelists_lib/generators.py:
(JavaScriptCoreGenerator):
(WebCoreGenerator):
(WebKitGenerator):
* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* TestWebKitAPI/Configurations/SDKVariant.xcconfig:
* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
* WebEditingTester/Configurations/SDKVariant.xcconfig:
* WebKitLauncher/Configurations/SDKVariant.xcconfig:
* WebKitTestRunner/Configurations/SDKVariant.xcconfig:
* lldb/lldbWebKitTester/Configurations/SDKVariant.xcconfig:

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

22 months agoUnreviewed. Skip WebGPU tests on High Sierra since WebGPU is disabled.
sbarati@apple.com [Thu, 27 Jun 2019 18:12:30 +0000 (18:12 +0000)]
Unreviewed. Skip WebGPU tests on High Sierra since WebGPU is disabled.

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

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

22 months agoCorrect document lifecycle while processing commands
bfulgham@apple.com [Thu, 27 Jun 2019 18:11:59 +0000 (18:11 +0000)]
Correct document lifecycle while processing commands
https://bugs.webkit.org/show_bug.cgi?id=199146
<rdar://problem/52047462>

Reviewed by Darin Adler.

Protect the document while commands are being processed since script may run
during the style resolution. We should protect against this.

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

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

22 months agoAdd status for Web Bluetooth Scanning standards specification.
jond@apple.com [Thu, 27 Jun 2019 17:59:17 +0000 (17:59 +0000)]
Add status for Web Bluetooth Scanning standards specification.
https://bugs.webkit.org/show_bug.cgi?id=199235

Reviewed by Joseph Pecoraro.

* features.json:

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

22 months agoMake WEBGPU enabled only on Mojave and later.
sbarati@apple.com [Thu, 27 Jun 2019 17:47:17 +0000 (17:47 +0000)]
Make WEBGPU enabled only on Mojave and later.

Rubber-stamped by Myles C. Maxfield.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

We're going to look into re-enabling it on High Sierra in:
https://bugs.webkit.org/show_bug.cgi?id=199275

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

22 months ago[FTW] Build JavaScriptCore
don.olmstead@sony.com [Thu, 27 Jun 2019 16:54:10 +0000 (16:54 +0000)]
[FTW] Build JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=199254

Reviewed by Brent Fulgham.

.:

Add the FTW [For the Win(dows)] port. FTW is OS(WINDOWS) + USE(DIRECT2D) +
USE(CURL). Its eventual goal is to be the one true Windows port but to avoid
breaking AppleWin and WinCairo its being split into its own port for the interim.

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

Source/JavaScriptCore:

* PlatformFTW.cmake: Added.

Source/WTF:

* wtf/PlatformFTW.cmake: Added.

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

22 months ago[ews-build] Do not print worker environment variables in each build step
aakash_jain@apple.com [Thu, 27 Jun 2019 16:10:01 +0000 (16:10 +0000)]
[ews-build] Do not print worker environment variables in each build step
https://bugs.webkit.org/show_bug.cgi?id=197319

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(CheckOutSource.__init__): Disabled logging of environment variables.
(ApplyPatch.__init__): Ditto.
(KillOldProcesses.__init__): Ditto.
(ArchiveBuiltProduct.__init__): Ditto.
(DownloadBuiltProduct.__init__): Ditto.
(ExtractBuiltProduct.__init__): Ditto.
(RunAPITests.__init__): Ditto.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests accordingly.

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

22 months agoUse JSC_GLIB_API_ENABLED instead of USE(GLIB) as a compile-time check for GLib JSC API
annulen@yandex.ru [Thu, 27 Jun 2019 15:38:57 +0000 (15:38 +0000)]
Use JSC_GLIB_API_ENABLED instead of USE(GLIB) as a compile-time check for GLib JSC API
https://bugs.webkit.org/show_bug.cgi?id=199270

Reviewed by Michael Catanzaro.

This change allows building code with enabled USE(GLIB) but without
GLib JSC API.

* heap/Heap.cpp:
(JSC::Heap::releaseDelayedReleasedObjects):
* heap/Heap.h:
* heap/HeapInlines.h:

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

22 months ago[GTK][WPE] Fix build non-unified builds after r246856
aperez@igalia.com [Thu, 27 Jun 2019 13:45:32 +0000 (13:45 +0000)]
[GTK][WPE] Fix build non-unified builds after r246856
https://bugs.webkit.org/show_bug.cgi?id=199263

Reviewed by Michael Catanzaro.

* UIProcess/API/C/WKMessageListener.cpp: Added missing inclusion of WKAPICast.h and usage of WebKit namespace.

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

22 months agoREGRESSION (touch-action): Can't scroll vertically when touching a horizontally-scrol...
antti@apple.com [Thu, 27 Jun 2019 13:32:33 +0000 (13:32 +0000)]
REGRESSION (touch-action): Can't scroll vertically when touching a horizontally-scrollable element on instagram.com
https://bugs.webkit.org/show_bug.cgi?id=199268
<rdar://problem/52246473>

Reviewed by Antoine Quint.

Source/WebCore:

Test: pointerevents/ios/touch-action-region-manipulation.html

Having a restrictive touch-action value like 'pan-y' on on element and then having a descendant with
'touch-action: manipulation' computes to 'none'.

* css/StyleResolver.cpp:
(WebCore::computeEffectiveTouchActions):

For value 'manipulation' return the current effective value, similar to the reverse case above.
Set intersection should only be computed out of restrictive values (pan-x/pan-y/pinch-zoom/none).

LayoutTests:

* pointerevents/ios/touch-action-region-manipulation-expected.txt: Added.
* pointerevents/ios/touch-action-region-manipulation.html: Added.

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