WebKit-https.git
7 months agoStop using setDefersLoading from WebCore
achristensen@apple.com [Wed, 13 Feb 2019 19:00:30 +0000 (19:00 +0000)]
Stop using setDefersLoading from WebCore
https://bugs.webkit.org/show_bug.cgi?id=194315

Reviewed by Jer Noble.

That is what CompletionHandlers are for.

* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
(WebCore::MediaResource::setDefersLoading): Deleted.
* loader/MediaResourceLoader.h:
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::responseReceived):
(WebCore::PlatformMediaResource::stop):
(WebCore::PlatformMediaResource::setDefersLoading): Deleted.
* platform/network/cocoa/WebCoreNSURLSession.mm:
(WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
(-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.

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

7 months ago[ews-app] Generate status-bubble
aakash_jain@apple.com [Wed, 13 Feb 2019 18:54:32 +0000 (18:54 +0000)]
[ews-app] Generate status-bubble
https://bugs.webkit.org/show_bug.cgi?id=194572

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._build_bubble):
(StatusBubble._should_show_bubble_for):
(StatusBubble._build_bubbles_for_patch):

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

7 months agoCodeBlocks read from disk should not be re-written
tzagallo@apple.com [Wed, 13 Feb 2019 18:50:20 +0000 (18:50 +0000)]
CodeBlocks read from disk should not be re-written
https://bugs.webkit.org/show_bug.cgi?id=194535

Reviewed by Michael Saboff.

Keep track of which CodeBlocks have been read from disk or have already
been serialized in CodeCache.

* runtime/CodeCache.cpp:
(JSC::CodeCache::write):
* runtime/CodeCache.h:
(JSC::SourceCodeValue::SourceCodeValue):
(JSC::CodeCacheMap::fetchFromDiskImpl):

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

7 months agoRemove legacy sync messaging in some IPC code
achristensen@apple.com [Wed, 13 Feb 2019 18:35:20 +0000 (18:35 +0000)]
Remove legacy sync messaging in some IPC code
https://bugs.webkit.org/show_bug.cgi?id=194561

Reviewed by Geoffrey Garen.

Changing some LegacySync messages to Delayed messages.  We should probably rename Delayed to Sync.
There are too many ways to send messages.  Let's work to get rid of the old one.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
(WebKit::NetworkProcess::processWillSuspendImminently):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::handleWheelEvent):
(WebKit::PluginControllerProxy::handleMouseEnterEvent):
(WebKit::PluginControllerProxy::handleMouseLeaveEvent):
(WebKit::PluginControllerProxy::handleKeyboardEvent):
(WebKit::PluginControllerProxy::handleEditingCommand):
(WebKit::PluginControllerProxy::isEditingCommandEnabled):
(WebKit::PluginControllerProxy::handlesPageScaleFactor):
(WebKit::PluginControllerProxy::requiresUnifiedScaleFactor):
(WebKit::PluginControllerProxy::paintEntirePlugin):
(WebKit::PluginControllerProxy::supportsSnapshotting):
(WebKit::PluginControllerProxy::snapshot):
(WebKit::PluginControllerProxy::getPluginScriptableNPObject):
(WebKit::PluginControllerProxy::getFormValue):
* PluginProcess/PluginControllerProxy.h:
* PluginProcess/PluginControllerProxy.messages.in:
* Shared/Plugins/NPObjectMessageReceiver.cpp:
(WebKit::NPObjectMessageReceiver::deallocate):
(WebKit::NPObjectMessageReceiver::hasMethod):
(WebKit::NPObjectMessageReceiver::invoke):
(WebKit::NPObjectMessageReceiver::invokeDefault):
(WebKit::NPObjectMessageReceiver::hasProperty):
(WebKit::NPObjectMessageReceiver::getProperty):
(WebKit::NPObjectMessageReceiver::setProperty):
(WebKit::NPObjectMessageReceiver::removeProperty):
(WebKit::NPObjectMessageReceiver::enumerate):
(WebKit::NPObjectMessageReceiver::construct):
* Shared/Plugins/NPObjectMessageReceiver.h:
* Shared/Plugins/NPObjectMessageReceiver.messages.in:
* UIProcess/mac/SecItemShimProxy.cpp:
(WebKit::SecItemShimProxy::secItemRequest):
* UIProcess/mac/SecItemShimProxy.h:
* UIProcess/mac/SecItemShimProxy.messages.in:

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

7 months ago[ews-app] Add status bubble html template
aakash_jain@apple.com [Wed, 13 Feb 2019 18:30:13 +0000 (18:30 +0000)]
[ews-app] Add status bubble html template
https://bugs.webkit.org/show_bug.cgi?id=194571

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/templates: Added.
* BuildSlaveSupport/ews-app/ews/templates/statusbubble.html: Copied from QueueStatusServer/templates/statusbubble.html.

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

7 months ago[Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base...
jer.noble@apple.com [Wed, 13 Feb 2019 17:45:23 +0000 (17:45 +0000)]
[Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base address size.
https://bugs.webkit.org/show_bug.cgi?id=194580
<rdar://problem/42727739>

Reviewed by Eric Carlson.

* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:
* platform/graphics/cv/PixelBufferConformerCV.cpp:
(WebCore::CVPixelBufferGetBytePointerCallback):
(WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):

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

7 months agoAdd two regression tests for reference cycle in IndexedDB
sihui_liu@apple.com [Wed, 13 Feb 2019 17:12:57 +0000 (17:12 +0000)]
Add two regression tests for reference cycle in IndexedDB
https://bugs.webkit.org/show_bug.cgi?id=194527

Reviewed by Geoffrey Garen.

* fast/dom/reference-cycle-leaks.html:
* platform/win/TestExpectations:
The added tests are failing on win bots for unknown reasons, propably related to webkit.org/b/193540. Skip them
on win.

* storage/indexeddb/resources/result-request-cycle.js: Added.
(prepareDatabase):
* storage/indexeddb/resources/value-cursor-cycle.js: Added.
(prepareDatabase):
(onOpen.cursorRequest.onsuccess):
* storage/indexeddb/result-request-cycle-expected.txt: Added.
* storage/indexeddb/result-request-cycle.html: Added.
* storage/indexeddb/value-cursor-cycle-expected.txt: Added.
* storage/indexeddb/value-cursor-cycle.html: Added.

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

7 months agoUnreviewed, rolling out r241433.
tsavell@apple.com [Wed, 13 Feb 2019 16:55:05 +0000 (16:55 +0000)]
Unreviewed, rolling out r241433.

Broke internal builds.

Reverted changeset:

"Move
UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to
SPI"
https://bugs.webkit.org/show_bug.cgi?id=194531
https://trac.webkit.org/changeset/241433

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

7 months agoMove UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
graouts@webkit.org [Wed, 13 Feb 2019 13:46:58 +0000 (13:46 +0000)]
Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
https://bugs.webkit.org/show_bug.cgi?id=194531
<rdar://problem/47714562>

Reviewed by Dean Jackson.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cancelPointersForGestureRecognizer:]): We update the referenced Radar since we need to keep the call
to respondsToSelector until the SPI has shipped for OpenSource builds to work.

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

7 months agoSupport simulated mouse events on iOS based on a PlatformTouchEvent
graouts@webkit.org [Wed, 13 Feb 2019 13:34:43 +0000 (13:34 +0000)]
Support simulated mouse events on iOS based on a PlatformTouchEvent
https://bugs.webkit.org/show_bug.cgi?id=194501
<rdar://problem/46910790>

Reviewed by Dean Jackson.

Source/WebCore:

Add support for two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and
whether simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. To facilitate
that, we allow for a MouseEvent to be created, much like a PointerEvent, based on a PlatformTouchEvent. Then, we set a flag on Event within
EventTarget::innerInvokeEventListeners() to see whether any page code has been evaluated as a result of a mousemove event being dispatched.
Finally, we also track mouse events when invalidating touch regions provided the required internal runtime flag is on.

Test: fast/events/touch/ios/mouse-events-dispatch-with-touch.html

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Event.cpp:
* dom/Event.h:
(WebCore::Event::hasEncounteredListener const):
(WebCore::Event::setHasEncounteredListener):
* dom/EventNames.h:
(WebCore::EventNames::isTouchRelatedEventType const):
(WebCore::EventNames::touchRelatedEventNames const):
(WebCore::EventNames::extendedTouchRelatedEventNames const):
(WebCore::EventNames::isTouchEventType const): Deleted.
(WebCore::EventNames::touchAndPointerEventNames const): Deleted.
* dom/EventTarget.cpp:
(WebCore::EventTarget::innerInvokeEventListeners):
* dom/MouseEvent.h:
* dom/Node.cpp:
(WebCore::Node::moveNodeToNewDocument):
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
(WebCore::Node::defaultEventHandler):
* dom/ios/MouseEventIOS.cpp: Added.
(WebCore::mouseEventType):
(WebCore::MouseEvent::create):
* dom/ios/PointerEventIOS.cpp:
(WebCore::pointerEventType):
(WebCore::PointerEvent::create):
(WebCore::eventType): Deleted.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
* page/EventHandler.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::mouseEventsSimulationEnabled const):
(WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled):
(WebCore::RuntimeEnabledFeatures::mousemoveEventHandlingPreventsDefaultEnabled const):
(WebCore::RuntimeEnabledFeatures::setMousemoveEventHandlingPreventsDefaultEnabled):

Source/WebKit:

Add two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and whether
simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. We also ensure
that we correctly create touch tracking regions for mouse events.

* Shared/WebPreferences.yaml:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateTouchEventTracking):

LayoutTests:

Add a new test to check that we correctly dispatch mouse events as touches occur.

* fast/events/touch/ios/mouse-events-dispatch-with-touch-expected.txt: Added.
* fast/events/touch/ios/mouse-events-dispatch-with-touch.html: Added.
* pointerevents/utils.js:
(prototype.handleEvent):
(prototype._handlePointerEvent):
(prototype._handleMouseEvent):

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

7 months agoSourceCode should be copied when generating bytecode for functions
tzagallo@apple.com [Wed, 13 Feb 2019 12:21:00 +0000 (12:21 +0000)]
SourceCode should be copied when generating bytecode for functions
https://bugs.webkit.org/show_bug.cgi?id=194536

Reviewed by Saam Barati.

The FunctionExecutable might be collected while generating the bytecode
for nested functions, in which case the SourceCode reference would no
longer be valid.

* runtime/CodeCache.cpp:
(JSC::generateUnlinkedCodeBlockForFunctions):

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

7 months ago[GTK][WPE] Don't use DumpJSConsoleLogInStdErr expectation in platform TestExpectations
Hironori.Fujii@sony.com [Wed, 13 Feb 2019 10:12:27 +0000 (10:12 +0000)]
[GTK][WPE] Don't use DumpJSConsoleLogInStdErr expectation in platform TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=194587

Unreviewed gardening.

* platform/gtk/TestExpectations: Removed DumpJSConsoleLogInStdErr markers which are marked in top TestExpectations.
* platform/wpe/TestExpectations: Ditto.

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

7 months ago[FreeType] Unable to render some Hebrew characters
carlosgc@webkit.org [Wed, 13 Feb 2019 09:10:13 +0000 (09:10 +0000)]
[FreeType] Unable to render some Hebrew characters
https://bugs.webkit.org/show_bug.cgi?id=194498

Reviewed by Michael Catanzaro.

We are failing to find a font for some of the combining character sequences because normalization is failing due
to overflow error. In case of overflow, normalize returns the required length for the normalized characters, so
we should handle that case to resize the output buffer and try again.

* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const):

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

7 months agoCrash in Page::setActivityState because m_page is null
rniwa@webkit.org [Wed, 13 Feb 2019 09:07:23 +0000 (09:07 +0000)]
Crash in Page::setActivityState because m_page is null
https://bugs.webkit.org/show_bug.cgi?id=194584

Reviewed by Antti Koivisto.

Add a null check to avoid the crash. Also add a debug assertion to help diagnose this in the future.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setActivityState):

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

7 months agoRelease assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatc...
rniwa@webkit.org [Wed, 13 Feb 2019 09:01:49 +0000 (09:01 +0000)]
Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
https://bugs.webkit.org/show_bug.cgi?id=194582

Reviewed by Antti Koivisto.

Source/WebCore:

Check the zero-ness of m_policyCheck first so that we can differentiate process ID being wrong
from the non-generated identifier being sent to us as it was the case in this failure.

* loader/PolicyChecker.cpp:
(WebCore::PolicyCheckIdentifier::isValidFor):

Source/WebKit:

The bug was caused by WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction invoking the callback
with responseIdentifier even when we had failed to send the policy check IPC. Clearly, responseIdentifier
is invalid in that case, and we should be using requestIdentifier instead.

Unfortunately no new tests since I'm not aware of a way to make sendSync fail in this case.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

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

7 months agoResponsiveness timers are too expensive for frequent events
benjamin@webkit.org [Wed, 13 Feb 2019 08:41:22 +0000 (08:41 +0000)]
Responsiveness timers are too expensive for frequent events
https://bugs.webkit.org/show_bug.cgi?id=194003

Reviewed by Geoffrey Garen.

With each event, we set a responsivness timer to check if the WebProcess
is responsive, and reset the timer when the WebProcess sends an answer.

For frequent events (e.g. wheel events, mouse force events, etc),
we are spamming the kernel with hundreds of timers per second.
That is a bit inefficient.

Another source of inefficiency comes from the timer implementation
itself. Stopping a RunLoop::Timer removes the timer from every mode
and invalidate the timer. It becomes costly since we do it a lot.

With this patch, I tweak ResponsivenessTimer and its use to minimize
how often we schedule system timers.

The first change is to not stop the timer when we get the stop()
calls if we expect more events to come in. Instead, we keep track
if we care about the timeout or not in the attribute "m_waitingForTimer".
When the next event starts, we can reschedule the timer without ever
having told the kernel about the stop.
If there are no next events, the timeout fires but m_waitingForTimer
is false. To avoid idle wake up, the lazy stop is only used when having
following events is common.

The second improvements comes from not even rescheduling the timer
when restarted. Instead of changing the timer, we let the original timer
fire and re-shedule a new one with the missing time.

For more context, also see patches r240759 and r240944.

* UIProcess/ResponsivenessTimer.cpp:
(WebKit::ResponsivenessTimer::ResponsivenessTimer):
(WebKit::ResponsivenessTimer::invalidate):
(WebKit::ResponsivenessTimer::timerFired):
(WebKit::ResponsivenessTimer::start):
(WebKit::ResponsivenessTimer::startWithLazyStop):
(WebKit::ResponsivenessTimer::stop):
(WebKit::ResponsivenessTimer::processTerminated):
(WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted.
* UIProcess/ResponsivenessTimer.h:
(WebKit::ResponsivenessTimer::hasActiveTimer const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processNextQueuedMouseEvent):
(WebKit::WebPageProxy::sendWheelEvent):
(WebKit::WebPageProxy::handleKeyboardEvent):
(WebKit::WebPageProxy::handleGestureEvent):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::isResponsiveWithLazyStop):
* UIProcess/WebProcessProxy.h:

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

7 months agoUnreviewed, rolling out r241273.
commit-queue@webkit.org [Wed, 13 Feb 2019 08:26:23 +0000 (08:26 +0000)]
Unreviewed, rolling out r241273.
https://bugs.webkit.org/show_bug.cgi?id=194579

This change is causing a flaky assertion failure crash in High
Sierra Debug (Requested by ShawnRoberts on #webkit).

Reverted changeset:

"Stop using setDefersLoading from WebCore"
https://bugs.webkit.org/show_bug.cgi?id=194315
https://trac.webkit.org/changeset/241273

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

7 months agoNull deref in userInterfaceLayoutDirection under ViewGestureController::handleSwipeGe...
timothy_horton@apple.com [Wed, 13 Feb 2019 07:36:30 +0000 (07:36 +0000)]
Null deref in userInterfaceLayoutDirection under ViewGestureController::handleSwipeGesture
https://bugs.webkit.org/show_bug.cgi?id=194569
<rdar://problem/46711049>

Reviewed by Wenson Hsieh.

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::handleSwipeGesture):
It is conceivable that we could get here if the client closes the page
e.g. in the callback from willEndSwipeGesture. We already guarded against
this ... one line too late! Rearrange the lines so we don't call into
WebPageProxy at all if we don't have a drawing area (which is a strict subset
of the time that isValid would return true). This is a speculative fix,
since I can no longer reproduce the crash on demand.

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

7 months agoRemove unnecessary null check in bindings.
mark.lam@apple.com [Wed, 13 Feb 2019 07:13:07 +0000 (07:13 +0000)]
Remove unnecessary null check in bindings.
https://bugs.webkit.org/show_bug.cgi?id=194581

Reviewed by Yusuke Suzuki.

It is always safe to call visitor.containsOpaqueRoot(root) with a null root pointer.
It will just return false.  Since we don't expect the root pointer to be null in
the common case, having a null check here is also not optimal.  We'll remove this
unneeded null check.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):

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

7 months agoJSScript needs to retain its cache path NSURL*
sbarati@apple.com [Wed, 13 Feb 2019 06:34:44 +0000 (06:34 +0000)]
JSScript needs to retain its cache path NSURL*
https://bugs.webkit.org/show_bug.cgi?id=194577

Reviewed by Tim Horton.

* API/JSScript.mm:
(+[JSScript scriptFromASCIIFile:inVirtualMachine:withCodeSigning:andBytecodeCache:]):
(-[JSScript dealloc]):

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

7 months agoWebServiceWorkerProvider::handleFetch no longer needs a CachedResource parameter
youenn@apple.com [Wed, 13 Feb 2019 05:24:52 +0000 (05:24 +0000)]
WebServiceWorkerProvider::handleFetch no longer needs a CachedResource parameter
https://bugs.webkit.org/show_bug.cgi?id=194548

Reviewed by Alex Christensen.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::handleFetch):
* WebProcess/Storage/WebServiceWorkerProvider.h:

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

7 months agoRemove WKLegacyPDFView
timothy_horton@apple.com [Wed, 13 Feb 2019 05:04:36 +0000 (05:04 +0000)]
Remove WKLegacyPDFView
https://bugs.webkit.org/show_bug.cgi?id=194559

Reviewed by Andy Estes.

Source/WebKit:

* Platform/spi/ios/CorePDFSPI.h: Removed.
* SourcesCocoa.txt:
* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
(-[WKWebViewContentProviderRegistry initWithConfiguration:]):
* UIProcess/ios/WKLegacyPDFView.h: Removed.
* UIProcess/ios/WKLegacyPDFView.mm: Removed.
* WebKit.xcodeproj/project.pbxproj:

Source/WTF:

* wtf/FeatureDefines.h:

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

7 months agoRegression(PSON) MESSAGE_CHECK() hit under WebPageProxy::didFailProvisionalLoadForFra...
cdumez@apple.com [Wed, 13 Feb 2019 02:32:24 +0000 (02:32 +0000)]
Regression(PSON) MESSAGE_CHECK() hit under WebPageProxy::didFailProvisionalLoadForFrameShared()
https://bugs.webkit.org/show_bug.cgi?id=194568
<rdar://problem/47944490>

Reviewed by Ryosuke Niwa.

Source/WebKit:

When the provisional process crashes, it is unsafe to call ProvisionalPageProxy::cancel() because
the WebProcessProxy clears its frame map as soon as the process crashes. Calling cancel() after
that would call WebPageProxy::didFailProvisionalLoadForFrameShared(), which would try to look up
the frame by ID and MESSAGE_CHECK() that the frame is not null. We would fail this check since
the frame has been removed from the WebProcessProxy at this point.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _provisionalWebProcessIdentifier]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::provisionalProcessDidTerminate):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONNavigationDelegate webView:didStartProvisionalNavigation:]):

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

7 months agoMake B3Value::returnsBool() more precise
rmorisset@apple.com [Wed, 13 Feb 2019 02:30:13 +0000 (02:30 +0000)]
Make B3Value::returnsBool() more precise
https://bugs.webkit.org/show_bug.cgi?id=194457

Reviewed by Saam Barati.

It is currently used repeatedly in B3ReduceStrength, as well as once in B3LowerToAir.
It has a needlessly complex rule for BitAnd, and has no rule for other easy cases such as BitOr or Select.
No new tests added as this should be indirectly tested by the already existing tests.

* b3/B3Value.cpp:
(JSC::B3::Value::returnsBool const):

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

7 months agoAlign with Fetch on data: URLs
commit-queue@webkit.org [Wed, 13 Feb 2019 01:33:55 +0000 (01:33 +0000)]
Align with Fetch on data: URLs
https://bugs.webkit.org/show_bug.cgi?id=182325

Patch by Rob Buis <rbuis@igalia.com> on 2019-02-12
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Update improved test expectations.

* web-platform-tests/fetch/data-urls/processing.any-expected.txt:
* web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt:

Source/WebCore:

The MIME type part of the data url should be serialized as
specified in step 3 under "data" [1].

Test: web-platform-tests/fetch/data-urls/processing.any.js

[1] https://fetch.spec.whatwg.org/#concept-scheme-fetch

* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::parseMediaType):

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

7 months ago[iOS] Youtube fails to play.
pvollan@apple.com [Wed, 13 Feb 2019 01:32:56 +0000 (01:32 +0000)]
[iOS] Youtube fails to play.
https://bugs.webkit.org/show_bug.cgi?id=194565
<rdar://problem/47974770>

Reviewed by Geoffrey Garen.

This is caused by sandbox violations and was introduced in r240500.

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

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

7 months agoBuild fix after r241320
achristensen@apple.com [Wed, 13 Feb 2019 01:05:43 +0000 (01:05 +0000)]
Build fix after r241320
https://bugs.webkit.org/show_bug.cgi?id=194271

* page/Frame.cpp:
(WebCore::Frame::requestDOMPasteAccess):

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

7 months agoRemove firing assertion after r241317
achristensen@apple.com [Wed, 13 Feb 2019 01:01:59 +0000 (01:01 +0000)]
Remove firing assertion after r241317
https://bugs.webkit.org/show_bug.cgi?id=194506

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::setDefersLoading):
The creation of a PageGroupLoadDeferrer in Chrome.cpp tries to defer loading.
See comments in Chrome::runJavaScriptAlert et al.
This was necessary with WebKitLegacy, so keep it, but it doesn't need to do anything in modern WebKit.

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

7 months agowebkitpy: Remove bug_dummy from parsed test expectations
jbedard@apple.com [Wed, 13 Feb 2019 00:45:39 +0000 (00:45 +0000)]
webkitpy: Remove bug_dummy from parsed test expectations
https://bugs.webkit.org/show_bug.cgi?id=194562
<rdar://problem/47853999>

Reviewed by Lucas Forschler.

* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectationParser):
(TestExpectationParser.expectation_for_skipped_test): Remove DUMMY_BUG_MODIFIER from
skipped tests.
* Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:

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

7 months ago[WebGPU] Remove WebGPUBufferDescriptor/Usage and use GPU versions
justin_fan@apple.com [Wed, 13 Feb 2019 00:23:10 +0000 (00:23 +0000)]
[WebGPU] Remove WebGPUBufferDescriptor/Usage and use GPU versions
https://bugs.webkit.org/show_bug.cgi?id=194552

Reviewed by Dean Jackson.

WebGPUBufferDescriptor/Usage have been renamed to GPUBufferDescriptor/Usage in the Web GPU API.
Source/WebCore:

Consolidate the two versions of these classes in our implementation.

Affected layout tests updated with new names. No change in behavior.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/webgpu/GPUBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl.
* Modules/webgpu/GPUBufferUsage.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl.
* Modules/webgpu/WebGPUBufferUsage.h: Removed.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBuffer const):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/graphics/gpu/GPUBufferDescriptor.h: Moved out GPUBufferUsage.
* platform/graphics/gpu/GPUBufferUsage.h: Moved from GPUBufferDescriptor.h.

LayoutTests:

Update affected tests to match.

* webgpu/bind-groups.html:
* webgpu/buffer-resource-triangles.html:
* webgpu/buffers.html:
* webgpu/depth-enabled-triangle-strip.html:
* webgpu/vertex-buffer-triangle-strip.html:

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

7 months agoUnreviewed, try to fix the internal iOS build after r241321
wenson_hsieh@apple.com [Wed, 13 Feb 2019 00:19:04 +0000 (00:19 +0000)]
Unreviewed, try to fix the internal iOS build after r241321

* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:

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

7 months ago[ews-app] Add method to fetch patch
aakash_jain@apple.com [Wed, 13 Feb 2019 00:02:23 +0000 (00:02 +0000)]
[ews-app] Add method to fetch patch
https://bugs.webkit.org/show_bug.cgi?id=194518

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/patch.py:
(Patch.get_patch):

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

7 months agoWeb Inspector: Experimental setting for CPU Usage Timeline improvements
commit-queue@webkit.org [Wed, 13 Feb 2019 00:00:25 +0000 (00:00 +0000)]
Web Inspector: Experimental setting for CPU Usage Timeline improvements
https://bugs.webkit.org/show_bug.cgi?id=194556

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

* UserInterface/Main.html:
* UserInterface/Views/LegacyCPUTimelineView.css: Added.
* UserInterface/Views/LegacyCPUTimelineView.js: Added.
Copy of CPUTimelineView.js/css to be used when the setting is not set.

* UserInterface/Views/ContentView.js:
(WI.ContentView.createFromRepresentedObject):
ContentView to create based on the setting.

* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
Experimental switch.

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

7 months ago[LFC] Expand tests coverage (60 new tests -> 860)
zalan@apple.com [Tue, 12 Feb 2019 23:59:51 +0000 (23:59 +0000)]
[LFC] Expand tests coverage (60 new tests -> 860)

Unreviewed test gardening (run-singly, --child-processes=1).

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

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

7 months agoFind on Page shouldn't zoom in on matches
timothy_horton@apple.com [Tue, 12 Feb 2019 23:33:23 +0000 (23:33 +0000)]
Find on Page shouldn't zoom in on matches
https://bugs.webkit.org/show_bug.cgi?id=194557
<rdar://problem/42087017>

Reviewed by Wenson Hsieh.

* UIProcess/ios/SmartMagnificationController.h:
* UIProcess/ios/SmartMagnificationController.messages.in:
* UIProcess/ios/SmartMagnificationController.mm:
(WebKit::SmartMagnificationController::scrollToRect):
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::updateFindIndicator):
Only scroll to reveal the find result, do not zoom in.

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

7 months agoAllow pages to trigger programmatic paste from script on iOS
wenson_hsieh@apple.com [Tue, 12 Feb 2019 23:18:30 +0000 (23:18 +0000)]
Allow pages to trigger programmatic paste from script on iOS
https://bugs.webkit.org/show_bug.cgi?id=194271
<rdar://problem/47808810>

Reviewed by Tim Horton.

Source/WebCore:

Tests: editing/pasteboard/ios/dom-paste-confirmation.html
       editing/pasteboard/ios/dom-paste-consecutive-confirmations.html
       editing/pasteboard/ios/dom-paste-rejection.html
       editing/pasteboard/ios/dom-paste-requires-user-gesture.html

* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::~UserGestureIndicator):

Reset a gesture token's DOM paste access when exiting the scope of a user gesture. This prevents DOM paste
access permissions from leaking into `setTimeout()` callbacks when we forward user gesture tokens.

* dom/UserGestureIndicator.h:
(WebCore::UserGestureToken::resetDOMPasteAccess):

Source/WebKit:

Cancel the pending DOM paste access handler when the menu is about to hide, rather than when the hiding
animation has completed. This ensures that if the page (on behalf of the user) requests DOM paste again during
user interaction before the callout bar has finished fading after the previous DOM paste, we won't automatically
cancel the incoming DOM paste access request because the callout bar animation finished.

This scenario is exercised in the layout test editing/pasteboard/ios/dom-paste-consecutive-confirmations.html.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _willHideMenu:]):
(-[WKContentView _didHideMenu:]):

Tools:

Add support for interacting with the callout bar on iOS during layout tests. See below for more detail.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::platformSetDidShowMenuCallback):
(WTR::UIScriptController::platformSetDidHideMenuCallback):
(WTR::UIScriptController::rectForMenuAction const):

Add new mechanisms to make it possible to interact with and query the state of the callout menu on iOS. This
includes determining the rect (in content view coordinates) of the menu's controls, and callbacks to register
for when the menu is shown or hidden.

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptContext.h:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::setDidShowMenuCallback):
(WTR::UIScriptController::didShowMenuCallback const):
(WTR::UIScriptController::setDidHideMenuCallback):
(WTR::UIScriptController::didHideMenuCallback const):
(WTR::UIScriptController::platformSetDidShowMenuCallback):
(WTR::UIScriptController::platformSetDidHideMenuCallback):
(WTR::UIScriptController::rectForMenuAction const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:

Add a new test option to determine whether DOM paste is enabled. DOM paste is currently enabled everywhere by
default, but these new programmatic paste tests require it to be disabled in order for confirmation UI to show.

(WTR::TestOptions::hasSameInitializationOptions const):
* WebKitTestRunner/UIScriptControllerCocoa.mm:
(WTR::UIScriptController::calendarType const):
(WTR::UIScriptController::platformUndoManager const):
* WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView initWithFrame:configuration:]):
(-[TestRunnerWKWebView dealloc]):
(-[TestRunnerWKWebView _didShowMenu]):
(-[TestRunnerWKWebView _didHideMenu]):

Listen to when the callout bar is presented and dismissed, and invoke testing callbacks as needed.

* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::handleMenuWillHideNotification):
(WTR::handleMenuDidHideNotification):
(WTR::TestController::platformInitialize):
(WTR::TestController::platformDestroy):
(WTR::TestController::platformResetStateToConsistentValues):

Additionally ensure that any callout menu presented by a previous layout test is dismissed before running the
next test by hiding the callout bar if necessary, and then waiting for the "DidHide" notification.

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::forEachViewInHierarchy):
(WTR::findViewInHierarchyOfType):

Move `forEachViewInHierarchy` so that we can use it throughout the file, and then add some additional helper
functions that dig through a given view's hierarchy in search of a view of a given class.

(WTR::UIScriptController::selectionStartGrabberViewRect const):
(WTR::UIScriptController::selectionEndGrabberViewRect const):
(WTR::UIScriptController::selectionCaretViewRect const):
(WTR::UIScriptController::selectionRangeViewRects const):
(WTR::UIScriptController::platformSetDidShowMenuCallback):
(WTR::UIScriptController::platformSetDidHideMenuCallback):

Tweak these to use `platformContentView` instead of grabbing the content view from WKWebView directly.

(WTR::UIScriptController::rectForMenuAction const):

Add a new UIScriptController method to get the rect of the action in the contextual menu (on iOS, this is the
callout bar) whose label matches the given string.

(WTR::UIScriptController::platformContentView const):

Add a `platformContentView()` helper on UIScriptController so that we can stop grabbing the value for key
"_currentContentView" from various places in this file. Additionally, rewrite `platformUndoManager()` in terms
of this new helper, and move the code out from iOS/macOS-specific files into UIScriptControllerCocoa.

(WTR::UIScriptController::platformUndoManager const): Deleted.
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::platformContentView const):
(WTR::UIScriptController::platformUndoManager const): Deleted.

LayoutTests:

Add new tests to exercise programmatic pasting.

* TestExpectations:
* editing/pasteboard/ios/dom-paste-confirmation-expected.txt: Added.
* editing/pasteboard/ios/dom-paste-confirmation.html: Added.

Verify that the user can tap "Paste" to allow programmatic pasting.

* editing/pasteboard/ios/dom-paste-consecutive-confirmations-expected.txt: Added.
* editing/pasteboard/ios/dom-paste-consecutive-confirmations.html: Added.

Verify that DOM paste access isn't carried over when using `setTimeout` in a user gesture event handler.

* editing/pasteboard/ios/dom-paste-rejection-expected.txt: Added.
* editing/pasteboard/ios/dom-paste-rejection.html: Added.

Verify that resigning first responder dismisses the callout bar and does not allow programmatic pasting.

* editing/pasteboard/ios/dom-paste-requires-user-gesture-expected.txt: Added.
* editing/pasteboard/ios/dom-paste-requires-user-gesture.html: Added.

Verify that user gesture is required to present the callout menu for a programmatic paste request.

* editing/pasteboard/ios/resources/dom-paste-helper.js: Added.
(return.new.Promise.):
(async._waitForOrTriggerPasteMenu):
(async.triggerPasteMenuAfterTapAt):
(async.waitForPasteMenu):

Add helpers to summon, wait for, and interact with the callout bar when the page attempts to trigger a paste.

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

Skip editing/pasteboard/ios by default, and enable it only in the modern WebKit port of iOS.

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

7 months agoAX: IsolatedTree: Implement more attributes
cfleizach@apple.com [Tue, 12 Feb 2019 22:55:33 +0000 (22:55 +0000)]
AX: IsolatedTree: Implement more attributes
https://bugs.webkit.org/show_bug.cgi?id=193911
<rdar://problem/47599217>

Reviewed by Daniel Bates.

Source/WebCore:

Make use of new HIServices SPI to use a secondary AX thread.
Store root node/focused node status in IsolatedTree rather than on the element.
Implement the following attributes: children, parent, isIgnored, isTree, isTreeItem, relativeFrame, speechHint, title, description.
Implement hit-testing using relative-frames.
Ensure that WKAccessibilityWebPageObject queries happen on main thread when they need to.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::generateIsolatedAccessibilityTree):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::focusedUIElementForPage):
* accessibility/AccessibilityAttachment.cpp:
(WebCore::AccessibilityAttachment::accessibilityText const):
(WebCore::AccessibilityAttachment::accessibilityText): Deleted.
* accessibility/AccessibilityAttachment.h:
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::accessibilityText const):
(WebCore::AccessibilityImageMapLink::accessibilityText): Deleted.
* accessibility/AccessibilityImageMapLink.h:
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::accessibilityText const):
(WebCore::AccessibilityMediaControl::accessibilityText): Deleted.
* accessibility/AccessibilityMediaControls.h:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::accessibilityText const):
(WebCore::AccessibilityNodeObject::accessibilityText): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::convertFrameToSpace const):
(WebCore::AccessibilityObject::relativeFrame const):
(WebCore::AccessibilityObject::elementAccessibilityHitTest const):
(WebCore::AccessibilityObject::focusedUIElement const):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::accessibilityText const):
(WebCore::AccessibilityObject::isLink const): Deleted.
(WebCore::AccessibilityObject::isImage const): Deleted.
(WebCore::AccessibilityObject::isAttachment const): Deleted.
(WebCore::AccessibilityObject::isFileUploadButton const): Deleted.
(WebCore::AccessibilityObject::isImageMapLink const): Deleted.
(WebCore::AccessibilityObject::isMediaControlLabel const): Deleted.
(WebCore::AccessibilityObject::isTree const): Deleted.
(WebCore::AccessibilityObject::isTreeItem const): Deleted.
(WebCore::AccessibilityObject::isScrollbar const): Deleted.
(WebCore::AccessibilityObject::accessibilityHitTest const): Deleted.
(WebCore::AccessibilityObject::accessibilityText): Deleted.
(WebCore::AccessibilityObject::roleValue const): Deleted.
(WebCore::AccessibilityObject::wrapper const): Deleted.
* accessibility/AccessibilityObjectInterface.h: Replaced.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isTabItemSelected const):
(WebCore::AccessibilityRenderObject::remoteSVGElementHitTest const):
(WebCore::AccessibilityRenderObject::elementAccessibilityHitTest const):
(WebCore::AccessibilityRenderObject::accessibilityHitTest const):
(WebCore::AccessibilityRenderObject::selectedChildren):
* accessibility/AccessibilityRenderObject.h:
* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::accessibilityText const):
(WebCore::AccessibilitySVGElement::accessibilityText): Deleted.
* accessibility/AccessibilitySVGElement.h:
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::accessibilityHitTest const):
* accessibility/AccessibilityScrollView.h:
* accessibility/ios/AccessibilityObjectIOS.mm:
(WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper fileUploadButtonReturnsValueInTitle]): Deleted.
* accessibility/isolatedtree: Replaced.
* accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
(WebCore::AXIsolatedTree::treePageCache):
(WebCore::AXIsolatedTree::AXIsolatedTree):
(WebCore::AXIsolatedTree::nodeInTreeForID):
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::focusedUIElement):
(WebCore::AXIsolatedTree::setRootNodeID):
(WebCore::AXIsolatedTree::setFocusedNodeID):
(WebCore::AXIsolatedTree::setInitialRequestInProgress):
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/isolatedtree/AXIsolatedTree.h: Added.
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
(WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
(WebCore::AXIsolatedTreeNode::~AXIsolatedTreeNode):
(WebCore::AXIsolatedTreeNode::initializeAttributeData):
(WebCore::AXIsolatedTreeNode::setProperty):
(WebCore::AXIsolatedTreeNode::setParent):
(WebCore::AXIsolatedTreeNode::setTreeIdentifier):
(WebCore::AXIsolatedTreeNode::focusedUIElement const):
(WebCore::AXIsolatedTreeNode::parentObjectInterfaceUnignored const):
(WebCore::AXIsolatedTreeNode::accessibilityHitTest const):
(WebCore::AXIsolatedTreeNode::tree const):
(WebCore::AXIsolatedTreeNode::rectAttributeValue const):
(WebCore::AXIsolatedTreeNode::stringAttributeValue const):
* accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::associateIsolatedTreeNode):
* accessibility/mac/AccessibilityObjectBase.mm: Added.
(WebCore::AccessibilityObject::speechHintAttributeValue const):
(WebCore::AccessibilityObject::descriptionAttributeValue const):
(WebCore::AccessibilityObject::titleAttributeValue const):
(WebCore::AccessibilityObject::helpTextAttributeValue const):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(addChildToArray):
(convertToNSArray):
(-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
(-[WebAccessibilityObjectWrapperBase detach]):
(-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
(-[WebAccessibilityObjectWrapperBase accessibilityObject]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
(-[WebAccessibilityObjectWrapperBase axBackingObject]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
(convertPathToScreenSpaceFunction):
(-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
(-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
(-[WebAccessibilityObjectWrapperBase titleTagShouldBeUsedInDescriptionField]): Deleted.
(-[WebAccessibilityObjectWrapperBase fileUploadButtonReturnsValueInTitle]): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
(-[WebAccessibilityObjectWrapper childrenVectorSize]):
(-[WebAccessibilityObjectWrapper childrenVectorArray]):
(-[WebAccessibilityObjectWrapper position]):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper roleDescription]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
(-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
(-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
(-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
(-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):

Source/WebCore/PAL:

* pal/spi/mac/HIServicesSPI.h:

Source/WebKit:

* Platform/spi/mac/AccessibilityPrivSPI.h: Added.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase clientSupportsIsolatedTree]):
(-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]):
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject IGNORE_WARNINGS_END]):
(-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]):
(-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]):
(-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):

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

7 months agoAllow pages to trigger programmatic paste from script on iOS
wenson_hsieh@apple.com [Tue, 12 Feb 2019 22:37:48 +0000 (22:37 +0000)]
Allow pages to trigger programmatic paste from script on iOS
https://bugs.webkit.org/show_bug.cgi?id=194271
<rdar://problem/47808810>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Add support for allowing script to trigger programmatic paste commands. Currently on macOS and iOS, the ability
to trigger programmatic paste (i.e. `document.execCommand('Paste');`) is disabled by default, such that
execCommand is simply a no-op that returns false. This policy is a privacy measure (common among other major
browsers) that prevents untrusted web content from sniffing content from the system pasteboard (even on user
interaction, since unintended user interaction occasionally happens as well!).

In order to make it possible for web pages to programmatically paste without opening the door to privacy and
security issues, we make paste commands triggered from bindings present platform UI on iOS, in the form of a
callout bar with the single option to paste. This UI is dismissed upon any user interaction; furthermore, any
user interaction short of explicitly triggering the "Paste" action subsequently prevents the page from executing
the paste (and causes execCommand to return false). However, if the paste action is chosen by the user, we
instead follow through with the programmatic paste command.

New tests to come in a followup patch.

* WebCore.xcodeproj/project.pbxproj:
* dom/DOMPasteAccessPolicy.h: Added.
* dom/UserGestureIndicator.h:
(WebCore::UserGestureToken::domPasteAccessPolicy const):
(WebCore::UserGestureToken::didRequestDOMPasteAccess):

Add helpers on UserGestureToken to update and query the current DOM paste access policy. The access policies are
"NotRequestedYet" (i.e. pending a response from the user), "Granted" (the user has granted DOM paste access to
the page), or "Denied" (the user has prevented the page from reading the contents of the clipboard). When DOM
paste access is granted or rejected, make this decision sticky until the end of the current user gesture.

* editing/EditorCommand.cpp:
(WebCore::executePaste):
(WebCore::executePasteAndMatchStyle):
(WebCore::executePasteAsPlainText):
(WebCore::executePasteAsQuotation):

When executing a paste command where the source is DOM bindings, request DOM paste if needed before proceeding
with the paste.

(WebCore::supportedPaste):
* loader/EmptyClients.cpp:
* page/EditorClient.h:
* page/Frame.cpp:
(WebCore::Frame::requestDOMPasteAccess):

Add a helper method that requests access to the clipboard on behalf of script when pasting.

* page/Frame.h:
* page/Settings.yaml:

Introduce a new WebCore setting, used to gate DOM paste access requests.

Source/WebKit:

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:

Add an internal setting to enable or disable DOM paste access requests. This is on by default in iOS only
(excluding watchOS and Apple TV), and is additionally disabled on macOS.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):

Plumb DOM paste access requests from the web process (WebEditorClient) to the view (WKContentView). As per the
usual, this involves WebEditorClient, WebPage, WebPageProxy, PageClient and finally WKContentView.

* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestDOMPasteAccess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _webTouchEventsRecognized:]):

Bail from any pending DOM paste access handler the moment we start handling touches on the web view, or if the
web view resigns first responder, or if the web process crashes.

(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):

Reject text selection gestures while waiting for DOM paste access.

(-[WKContentView canPerformAction:withSender:]):
(-[WKContentView canPerformActionForWebView:withSender:]):

If we're handling a DOM paste, always return YES to allow the callout bar to show the "Paste" option.

(-[WKContentView _didHideMenu:]):

If the menu is programmatically hidden by the app while handling a DOM paste request, immediately reject the DOM
paste request.

(-[WKContentView pasteForWebView:]):

Adjust -pasteForWebView: on WKContentView to first check whether there's an outstanding DOM paste completion
handler to invoke, instead of telling the page to execute a paste command.

(-[WKContentView _handleDOMPasteRequestWithResult:]):

Add a helper to take and invoke the current DOM paste completion handler (if it exists) with the given result,
and then dismiss the shared callout bar. Returns whether or not the paste completion handler exists. Invoked
from various sources of user interaction or significant state changes (e.g. following a web process crash in
-cleanupInteraction).

(-[WKContentView _willPerformAction:sender:]):
(-[WKContentView _didPerformAction:sender:]):

Add hooks to detect when WKContentView is executing an editing action. This is to ensure that the page doesn't
get stuck in a bad state in the case where WKWebView has been subclassed, overrides `-paste:`, and does not
invoke the superclass method (which calls back into `-[WKContentView pasteForWebView:]`). There are a few
possibilities here:
1. WKWebView's `-paste:` action is not overridden. In this case, we will call back into `-pasteForWebView:`,
   which will notice that we have a pending paste completion handler and invoke it.
2. WKWebView's `-paste:` action is overridden and does not call back into the content view. In this case, we
   will invoke the paste completion handler in `-_didPerformAction:sender:`.
3. WKWebView's `-canPerformAction:withSender:` is overridden to include additional actions. In this case, we may
   get a call to invoke a different action selector while waiting for a potential paste action. If this happens,
   prevent the DOM paste in `-_willPerformAction:sender:` prior to handling the other action.

(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):

Dismiss DOM paste UI upon handling any key event.

(-[WKContentView showGlobalMenuControllerInRect:]):
(-[WKContentView hideGlobalMenuController]):

Helper methods to present and dismiss the global UIMenuController, that accounts for available platform APIs for
presenting or dismissing the menu controller on iOS.

(-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]):

Attempt to find a good target presentation rect when showing the callout menu. First, we will try to use the
rect of the element the user has interacted with when triggering the paste. If such an element is too large or
does not exist, we fall back to presenting the callout menu near the user's last touch location (with a small
amount of margin, such that the action doesn't overlap with the user's finger, stylus, etc.).

(-[WKContentView _resetShowingTextStyle:]): Deleted.

Rename this to `-_didHideMenu:`.

* UIProcess/mac/PageClientImplMac.h:
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/win/PageClientImpl.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::requestDOMPasteAccess):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestDOMPasteAccess):

Add more plumbing and method stubs.

(WebKit::WebPage::updateCurrentModifierState):
(WebKit::WebPage::rectForElementAtInteractionLocation const):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::rectForElementAtInteractionLocation const):
(WebKit::WebPage::rectForElementAtInteractionLocation): Deleted.

Mark this method as const, add a platform-agnostic stub, and adopt it for the purposes of determining where to
position the callout bar when pasting.

Source/WebKitLegacy/mac:

See WebCore and WebKit ChangeLogs for more details.

* WebCoreSupport/WebEditorClient.h:

Source/WebKitLegacy/win:

* WebCoreSupport/WebEditorClient.h:

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

7 months agoSource/WebCore:
dino@apple.com [Tue, 12 Feb 2019 21:57:48 +0000 (21:57 +0000)]
Source/WebCore:
Remove setDefersLoading infrastructure from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=194506

Patch by Alex Christensen <achristensen@webkit.org> on 2019-02-12
Reviewed by Brady Eidson.

setDefersLoading is inherently racy from WebCore to the NetworkProcess,
it adds unwanted complexity to the initialization and use of network objects,
and it has led to many unrecoverable hang bugs over the years.
We needed to force it into WebKit2 to transition some existing clients who relied on it,
but we have recently finished transitioning those clients to other solutions, mostly
completion handlers.

* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused):

LayoutTests:
BitmapRenderer should handle existing ImageBuffers
https://bugs.webkit.org/show_bug.cgi?id=194555
<rdar://problem/47857150>

Reviewed by Tim Horton.

Test that creates a canvas, triggers an ImageBuffer to be created, then
creates the bitmaprenderer context.

* fast/canvas/bitmaprenderer-created-after-toBlob-expected.txt: Added.
* fast/canvas/bitmaprenderer-created-after-toBlob.html: Added.

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

7 months agowebkitpy: No option to only show unexpected failures in results.html for iPad
jbedard@apple.com [Tue, 12 Feb 2019 21:53:00 +0000 (21:53 +0000)]
webkitpy: No option to only show unexpected failures in results.html for iPad
https://bugs.webkit.org/show_bug.cgi?id=194554
<rdar://problem/47922442>

Rubber-stamped by Aakash Jain.

Just because a TestExpecations file does not exist for a specific platform does not mean that
TestExpecations are not being used, given that platforms inherit test expectations.

* Scripts/webkitpy/port/base.py:
(Port.uses_test_expectations_file): Check all possible locations of a TestExpectations file.
* Scripts/webkitpy/port/base_unittest.py:
(PortTest.test_uses_test_expectations_file):

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

7 months agoRemove setDefersLoading infrastructure from WebKit2
achristensen@apple.com [Tue, 12 Feb 2019 21:49:39 +0000 (21:49 +0000)]
Remove setDefersLoading infrastructure from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=194506

Reviewed by Brady Eidson.

Source/WebCore:

setDefersLoading is inherently racy from WebCore to the NetworkProcess,
it adds unwanted complexity to the initialization and use of network objects,
and it has led to many unrecoverable hang bugs over the years.
We needed to force it into WebKit2 to transition some existing clients who relied on it,
but we have recently finished transitioning those clients to other solutions, mostly
completion handlers.

* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused):

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setDefersLoading): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::suspend): Deleted.
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::initialize):
(WebKit::NetworkLoad::setDefersLoading): Deleted.
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::setDefersLoading): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::suspend): Deleted.
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::suspend): Deleted.
* NetworkProcess/curl/NetworkDataTaskCurl.h:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::suspend): Deleted.
* NetworkProcess/soup/NetworkDataTaskSoup.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::setDefersLoading):

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setDefersLoading): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:

LayoutTests:

* platform/wk2/TestExpectations:

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

7 months agoUnreviewed, fix build warnings after content extensions enablement
mcatanzaro@igalia.com [Tue, 12 Feb 2019 21:35:59 +0000 (21:35 +0000)]
Unreviewed, fix build warnings after content extensions enablement
https://bugs.webkit.org/show_bug.cgi?id=193622
<rdar://problem/47982850>

Source/WebCore:

* contentextensions/DFABytecode.h:
(WebCore::ContentExtensions::instructionSizeWithArguments):
* contentextensions/DFABytecodeCompiler.h:
* contentextensions/URLFilterParser.cpp:
(WebCore::ContentExtensions::URLFilterParser::statusString):

Source/WebKit:

* UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
(toResult):

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

7 months agoWeb Inspector: Timeline.prototype.recordsInTimeRange uses a property most records...
commit-queue@webkit.org [Tue, 12 Feb 2019 21:21:56 +0000 (21:21 +0000)]
Web Inspector: Timeline.prototype.recordsInTimeRange uses a property most records do not have
https://bugs.webkit.org/show_bug.cgi?id=194549

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

* UserInterface/Models/Timeline.js:
(WI.Timeline.prototype.recordsInTimeRange):

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

7 months agoUnreviewed, fix -Wimplicit-fallthrough warning after r241140
mcatanzaro@igalia.com [Tue, 12 Feb 2019 21:17:47 +0000 (21:17 +0000)]
Unreviewed, fix -Wimplicit-fallthrough warning after r241140
https://bugs.webkit.org/show_bug.cgi?id=194399
<rdar://problem/47889777>

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

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

7 months agoSwitching focus from a UITextField to an editable WKWebView causes the keyboard to...
timothy_horton@apple.com [Tue, 12 Feb 2019 20:30:20 +0000 (20:30 +0000)]
Switching focus from a UITextField to an editable WKWebView causes the keyboard to dance
https://bugs.webkit.org/show_bug.cgi?id=194524
<rdar://problem/35481797>

Reviewed by Wenson Hsieh.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/InputViewUpdateDeferrer.h:
* UIProcess/ios/InputViewUpdateDeferrer.mm:
(WebKit::InputViewUpdateDeferrer::InputViewUpdateDeferrer):
(WebKit::InputViewUpdateDeferrer::~InputViewUpdateDeferrer):
Make use of the per-responder and much safer input view pinning mechanism.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView becomeFirstResponderForWebView]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:modifierFlags:]):
Always temporarily pin input views when becoming first responder; there are
many paths (such as through the text interaction assistant) that can
focus us on tap, trying to cover them all is a fool's errand. We'll
just get out the big hammer and call it in becomeFirstResponder.
This also means we can remove it from _singleTapCommitted and _attemptClick...

(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
Don't release the input view pinning until we return from _elementDidFocus;
it does the rebuilding synchronously, so we need to have actually updated
all of the prerequisites of -inputView before depinning.

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

7 months ago[Web GPU] DepthStencilAttachment implementation
justin_fan@apple.com [Tue, 12 Feb 2019 20:11:49 +0000 (20:11 +0000)]
[Web GPU] DepthStencilAttachment implementation
https://bugs.webkit.org/show_bug.cgi?id=194458
<rdar://problem/47932446>

Reviewed by Dean Jackson.

Source/WebCore:

Implement ability to provide a depth attachment to the render pass encoder. Also implement
GPULoad/StoreOp and update color attachments' implementation for full functionality.

Test: webgpu/depth-enabled-triangle-strip.html

Update project files for new symbols:
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

* Modules/webgpu/GPUColor.idl: Renamed from WebGPUColor.idl
* Modules/webgpu/GPULoadOp.idl: Added. Interface for attachment operation enum.
* Modules/webgpu/GPUStoreOp.idl: Ditto.
* Modules/webpug/WebGPUColor.h: Removed.
* Modules/webgpu/WebGPUCommandBuffer.cpp: Refactored descriptor validation logic out of this file.
(WebCore::WebGPUCommandBuffer::beginRenderPass):
* Modules/webgpu/WebGPURenderPassDescriptor.cpp: Added. Now owns code for validating descriptors.
(WebCore::WebGPURenderPassDescriptor::validateAndConvertToGPUVersion const):
* Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.h/idl: Removed. Code moved into WebGPURenderPassDescriptor.
* Modules/webgpu/WebGPURenderPassDescriptor.h: Move sub-descriptor definitions into this file.
* Modules/webgpu/WebGPURenderPassDescriptor.idl: Ditto.
* Modules/webgpu/WebGPURenderPipelineDescriptor.h: Make depthStencilState optional to match API update.
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
* Modules/webgpu/WebGPUTextureView.h:
* platform/graphics/gpu/GPULoadOp.h: Added.
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Removed (moved into GPURenderPassDescriptor).
* platform/graphics/gpu/GPURenderPassDescriptor.h: Mirror WebGPU* changes.
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Make depthStencilState optional.
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
* platform/graphics/gpu/GPUStoreOp.h: Added.
* platform/graphics/gpu/GPUTexture.h:
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::loadActionForGPULoadOp): Added.
(WebCore::storeActionForGPUStoreOp): Added.
(WebCore::populateMtlColorAttachmentsArray): Added. Create all expected color attachments, rather than just the first.
(WebCore::populateMtlDepthStencilAttachment): Added.
(WebCore::GPURenderPassEncoder::create):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Make depthStencilState optional.
(WebCore::GPURenderPipeline::create):

LayoutTests:

Add test and update utility functions for depth texture attachments. Update others to specify their
loadOp and storeOp for all render pass attachments, as these are no longer provided by default by the implementation.

* webgpu/buffer-resource-triangles.html:
* webgpu/depth-enabled-triangle-strip-expected.html: Added.
* webgpu/depth-enabled-triangle-strip.html: Added.
* webgpu/js/basic-webgpu-functions.js:
(render):
* webgpu/js/webgpu-functions.js:
(createBasicDepthStateDescriptor):
(createBasicDepthTexture):
(beginBasicRenderPass):
(createBasicPipeline): Deleted.
* webgpu/render-command-encoding.html:
* webgpu/render-passes.html:

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

7 months agoREGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers releas...
ddkilzer@apple.com [Tue, 12 Feb 2019 19:58:19 +0000 (19:58 +0000)]
REGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers release assertion when missing
<https://webkit.org/b/194529>
<rdar://problem/47924449>

Reviewed by Eric Carlson.

Source/WebCore:

* SourcesCocoa.txt:
- Do not include DataDetectorsCoreSoftLink.mm in unified
  sources.
* WebCore.xcodeproj/project.pbxproj:
- Add DataDetectorsCoreSoftLink.mm to the WebCore target now
  that it isn't part of the unifed sources.
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
- Switch from using SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL() to
  SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE() when linking
  DataDetectorsCore.framework. None of the other macros assume
  this framework is optional, and it was likely made optional
  originally because the framework was new to iOS and thus
  didn't exist on older versions.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
- Change use of SOFT_LINK_CLASS_FOR_SOURCE() macros to
  SOFT_LINK_CLASS() since the latter can only be used with
  SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation).  This broke after
  the fix for <wtf/SoftLinking.h> was applied.

Source/WTF:

* wtf/cocoa/SoftLinking.h:
(SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_IS_OPTIONAL): Rename
SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_ASSERTION() to this
and change `assertion` argument to `isOptional`.  Pass
`isOptional` to framework##Library() method to control assertion
behavior.  Only check RELEASE_ASSERT() if `!isOptional`, else
that code should be optimized out by the compiler.  This fixes
the crash.
(NO_ASSERT): Remove macro since it's no longer used.
(SOFT_LINK_IS_OPTIONAL): Add macro to use for soft-linking
optional classes.
(SOFT_LINK_IS_NOT_OPTIONAL): Add macro to use for soft-linking
non-optional classes.
(SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT): Update to use new
SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_IS_OPTIONAL() macro.
(SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT): Ditto.
(SOFT_LINK_CLASS_FOR_SOURCE): Ditto.
(SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL): Ditto.

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

7 months agoMake use of is<SubresourceLoader>
youenn@apple.com [Tue, 12 Feb 2019 19:53:24 +0000 (19:53 +0000)]
Make use of is<SubresourceLoader>
https://bugs.webkit.org/show_bug.cgi?id=194541

Reviewed by Alex Christensen.

Source/WebCore:

No change of behavior.

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didReceiveResponse):
* loader/SubresourceLoader.h:
(isType):

Source/WebKit:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

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

7 months agoAX: Fix flaky accessibility/loading-iframe-sends-notification.html
cfleizach@apple.com [Tue, 12 Feb 2019 19:51:02 +0000 (19:51 +0000)]
AX: Fix flaky accessibility/loading-iframe-sends-notification.html
https://bugs.webkit.org/show_bug.cgi?id=194546

Reviewed by Zalan Bujtas.

This test was relying on timing between load events being sent and accessibility events being sent.
We don't need to do that, we can more directly test this interplay.

* accessibility/loading-iframe-sends-notification-expected.txt:
* accessibility/loading-iframe-sends-notification.html:

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

7 months agoWebPage::close needs to remove all message receivers associated with that WebPage...
achristensen@apple.com [Tue, 12 Feb 2019 19:29:21 +0000 (19:29 +0000)]
WebPage::close needs to remove all message receivers associated with that WebPage, not WebPage::~WebPage
https://bugs.webkit.org/show_bug.cgi?id=194522
<rdar://problem/47789393>

Reviewed by Chris Dumez.

Source/WebKit:

The InjectedBundle SPI can retain the WebPage or wrapping objects (WKWebProcessPlugInBrowserContextController/WKBundlePageRef).
This can make it so WebPage::close is called before WebPage::~WebPage, and if the SuspendedPageProxy is reused for a subsequent
navigation to the same domain, the WebProcess is reused with a different WebPage instance with the same PageID, which causes problems
when another WebPage registers message handlers and then the previous WebPage is destroyed, which removes both message handlers.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::~WebPage):
(WebKit::WebPage::close):
(WebKit::WebPage::mainFrameDidLayout):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebProcess.h:
(WebKit::WebProcess::eventDispatcher):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/BundleRetainPagePlugIn.mm: Added.
(-[BundleRetainPagePlugIn webProcessPlugIn:didCreateBrowserContextController:]):
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

7 months agoUnreviewed, rolling out r241182.
commit-queue@webkit.org [Tue, 12 Feb 2019 19:20:51 +0000 (19:20 +0000)]
Unreviewed, rolling out r241182.
https://bugs.webkit.org/show_bug.cgi?id=194547

causes a 2-3% Speedometer2 regression. (Requested by
keith_miller on #webkit).

Reverted changeset:

"bmalloc uses more memory on iOS compared to macOS due to
physical page size differences"
https://bugs.webkit.org/show_bug.cgi?id=192389
https://trac.webkit.org/changeset/241182

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

7 months ago[WPE][GTK] Unsafe g_unsetenv() use in WebProcessPool::platformInitialize
mcatanzaro@igalia.com [Tue, 12 Feb 2019 18:45:31 +0000 (18:45 +0000)]
[WPE][GTK] Unsafe g_unsetenv() use in WebProcessPool::platformInitialize
https://bugs.webkit.org/show_bug.cgi?id=194370

Reviewed by Darin Adler.

Source/JavaScriptCore:

Change a couple WTFLogAlways to use g_warning, for good measure. Of course this isn't
necessary, but it will make errors more visible.

* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::start):
(Inspector::dbusConnectionCallAsyncReadyCallback):
* inspector/remote/glib/RemoteInspectorServer.cpp:
(Inspector::RemoteInspectorServer::start):

Source/WebKit:

It is incorrect to use g_unsetenv() here because it is MT-Unsafe. We know that it is
impossible and unreasonable to expect the application has not started other threads at this
point, and threads will be calling getenv(). WebKit itself has probably already started
threads of its own.

Fortunately, the remote inspector in the web process is already prepared to deal with
failure to connect to the inspector server, so we don't need to do anything except stop
messing with the environment.

Note these files are copies of each other. I'll merge them together in a follow-up patch.

* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::initializeRemoteInspectorServer):
(WebKit::WebProcessPool::platformInitialize):
* UIProcess/wpe/WebProcessPoolWPE.cpp:
(WebKit::initializeRemoteInspectorServer):
(WebKit::WebProcessPool::platformInitialize):

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

7 months agoEnsure old binaries have old snapshotting behaviors
bdakin@apple.com [Tue, 12 Feb 2019 18:23:43 +0000 (18:23 +0000)]
Ensure old binaries have old snapshotting behaviors
https://bugs.webkit.org/show_bug.cgi?id=194449
-and corresponding-
rdar://problem/47931954

Reviewed by Darin Adler.

Make sure that a nil configuration behaves the same way that it used to on apps
that were linked before FirstWithSnapshotAfterScreenUpdates

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
* UIProcess/Cocoa/VersionChecks.h:

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

7 months agoWeb Inspector: Timelines: clicking on an empty space in the overview should deselect...
drousso@apple.com [Tue, 12 Feb 2019 18:22:40 +0000 (18:22 +0000)]
Web Inspector: Timelines: clicking on an empty space in the overview should deselect any selected record bar
https://bugs.webkit.org/show_bug.cgi?id=194365
<rdar://problem/47868426>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineRecordBar.js:
(WI.TimelineRecordBar.prototype._handleClick):
Mark the "click" event so that later listeners know it was handled by `WI.TimelineRecordBar`.

* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview):
(WI.TimelineOverview.prototype._instrumentAdded):
(WI.TimelineOverview.prototype._instrumentRemoved):
(WI.TimelineOverview.prototype._handleGraphsContainerClick): Added.
(WI.TimelineOverview.prototype._handleOverviewGraphRecordSelected): Added.
(WI.TimelineOverview.prototype._recordSelected):
Listen for "click" on the graph container and deselect all records when fired, unless the
click was marked by a `WI.TimelineRecordBar`.

* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView.prototype._recordSelected):
Ensure that all `WI.TimelineView` update their selected record whenever it changes for any
other `WI.TimelineView` (or if there is no selected record).

* UserInterface/Views/TimelineOverviewGraph.js:
(WI.TimelineOverviewGraph.prototype.didLayoutSubtree): Added.
Drive-by: since `WI.TimelineRecordBar` are reused when combining, we need to re-determine
which one holds the currently selected record.

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

7 months agoWeb Inspector: Remove unused maxUsage in CPUTimelineView
commit-queue@webkit.org [Tue, 12 Feb 2019 18:21:58 +0000 (18:21 +0000)]
Web Inspector: Remove unused maxUsage in CPUTimelineView
https://bugs.webkit.org/show_bug.cgi?id=194526

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

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView):
(WI.CPUTimelineView.prototype.shown):

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

7 months agoAdd some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRo...
mark.lam@apple.com [Tue, 12 Feb 2019 18:21:45 +0000 (18:21 +0000)]
Add some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRoots() functions.
https://bugs.webkit.org/show_bug.cgi?id=194530
<rdar://problem/47973274>

Reviewed by Chris Dumez.

This is needed to fix a null pointer dereference that arises from the following scenario:
1. a Document detaches from its StyleSheetList.
2. the JSStyleSheetList that is associated with the detached StyleSheetList has yet
   to be scanned and collected by the GC.
3. the GC eventually looks for the opaque root of the StyleSheetList's owner, and
   discovers a null owner pointer.

This patch fixes this issue by applying the following null checks:

1. Add a null check in JSNodeCustom.h's root().

   root() is called from a isReachableFromOpaqueRoots() generated by CodeGeneratorJS.pm.
   isReachableFromOpaqueRoots() calls a ownerNode() method and passes its result
   to root().  However, depending on which class the ownerNode() method belongs to,
   it can either return a pointer or a reference.  The null check only makes sense
   in the pointer case.

   To accommodate the 2 forms, root() itself is has an overload that takes a
   reference instead of a pointer.

   Since CodeGeneratorJS.pm can't tell what the generated class' ownerNode()
   returns, it can't discern when the result is a pointer and apply the null check.
   Instead, we just add the null check to the version of root() that takes a
   pointer.  If the node pointer is null, we'll return a null opaque root.

2. Fix CodeGeneratorJS.pm to null check the opaque root before using it.

* bindings/js/JSNodeCustom.h:
(WebCore::root):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):

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

7 months ago[iOSMac] Enable Parental Controls Content Filtering
aestes@apple.com [Tue, 12 Feb 2019 17:43:37 +0000 (17:43 +0000)]
[iOSMac] Enable Parental Controls Content Filtering
https://bugs.webkit.org/show_bug.cgi?id=194521
<rdar://39732376>

Reviewed by Tim Horton.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* platform/ContentFilterUnblockHandler.h:
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
* platform/cocoa/ParentalControlsContentFilter.mm:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/Platform.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

7 months agoUnreviewed WPE gardening. Unskip content extensions tests after r241283
aperez@igalia.com [Tue, 12 Feb 2019 17:38:42 +0000 (17:38 +0000)]
Unreviewed WPE gardening. Unskip content extensions tests after r241283

* platform/wpe/TestExpectations: Unskip content extensions tests, and list
as failing those known to not pass due to missing expectaions or timeouts.

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

7 months agoSource/WebCore:
jer.noble@apple.com [Tue, 12 Feb 2019 16:53:12 +0000 (16:53 +0000)]
Source/WebCore:
Unreviewed build fix; add a HAVE_CELESTIAL guard around Celestial framework usage.

* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):

Source/WebCore/PAL:
Unreviewed build fix; add a HAVE_CELESTIAL guard around the CelestialSPI.h contents.

* pal/spi/ios/CelestialSPI.h:

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

7 months agoCrash in WebCore::ScrollingTree::updateTreeFromStateNode
antti@apple.com [Tue, 12 Feb 2019 16:22:18 +0000 (16:22 +0000)]
Crash in WebCore::ScrollingTree::updateTreeFromStateNode
https://bugs.webkit.org/show_bug.cgi?id=194538
<rdar://problem/47841926>

Reviewed by Zalan Bujtas.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::updateTreeFromStateNode):

Make sure we don't leave node entry behind in m_nodeMap in case we failed to add it to the parent.

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

7 months ago[LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
zalan@apple.com [Tue, 12 Feb 2019 15:59:16 +0000 (15:59 +0000)]
[LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
https://bugs.webkit.org/show_bug.cgi?id=194540

Reviewed by Antti Koivisto.

Use FormattingContext::computeBorderAndPadding instead.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
* layout/FormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

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

7 months ago[LFC][IFC] Add intrinsic width support for float boxes.
zalan@apple.com [Tue, 12 Feb 2019 15:34:36 +0000 (15:34 +0000)]
[LFC][IFC] Add intrinsic width support for float boxes.
https://bugs.webkit.org/show_bug.cgi?id=194528

Reviewed by Antti Koivisto.

Source/WebCore:

This patch implements a very simple float box support for intrinsic width.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const):
(WebCore::Layout::InlineFormattingContext::computeMargin const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

Tools:

Expand tests coverage (2 new tests -> 800).
(This is the correct test ordering --runs-singly --child-processes=1)

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

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

7 months agoImplement serializing in MIME type parser
commit-queue@webkit.org [Tue, 12 Feb 2019 10:04:38 +0000 (10:04 +0000)]
Implement serializing in MIME type parser
https://bugs.webkit.org/show_bug.cgi?id=193909

Patch by Rob Buis <rbuis@igalia.com> on 2019-02-12
Reviewed by Darin Adler.

Source/WebCore:

Implement serializing in MIME type parser [1], to preserve the parameter
order the Vector m_parameterNames is introduced, since HashMaps do not
guarantee any order.

Test: ParsedContentType.Serialize

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

* platform/network/ParsedContentType.cpp:
(WebCore::skipSpaces):
(WebCore::parseQuotedString):
(WebCore::ParsedContentType::parseContentType):
(WebCore::ParsedContentType::parameterValueForName const):
(WebCore::ParsedContentType::parameterCount const):
(WebCore::ParsedContentType::setContentType):
(WebCore::ParsedContentType::setContentTypeParameter):
(WebCore::ParsedContentType::serialize const):
* platform/network/ParsedContentType.h:

Tools:

Add various tests involving upper case, non-ASCII, control/null characters,
various HTTP whitespace, single quotes and an unpaired surrogate.

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

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

7 months ago[WPE][GTK] Sleep disabler code should inhibit idle when a "System" sleep disabler...
mcatanzaro@igalia.com [Tue, 12 Feb 2019 09:29:46 +0000 (09:29 +0000)]
[WPE][GTK] Sleep disabler code should inhibit idle when a "System" sleep disabler is requested
https://bugs.webkit.org/show_bug.cgi?id=194500

Reviewed by Carlos Garcia Campos.

There are three things wrong with the comment at the top of SleepDisablerGLib's constructor:

(1) Nowadays, GNOME suspends the computer automatically on inactivity, and we actually do
    want to prevent that.

(2) Inhibiting idle does affect the autosuspend countdown. So the current code should
    prevent automatic suspend, just not manual suspend. (I think I stand by my comment that
    we do not want to inhibit normal suspend, since that would just be annoying.)

(3) I don't know why I thought HTMLMediaElement::shouldDisableSleep was suspicious.

Anyway, the behavior we want is to ignore the Type argument and just always inhibit idle.
That is, treat type=System the same way we current treat type=Display.

* pal/system/glib/SleepDisablerGLib.cpp:
(PAL::SleepDisablerGLib::SleepDisablerGLib):

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

7 months agoAXObjectCache::childrenChanged shouldn't update layout or style during another style...
cfleizach@apple.com [Tue, 12 Feb 2019 09:28:44 +0000 (09:28 +0000)]
AXObjectCache::childrenChanged shouldn't update layout or style during another style recalc
https://bugs.webkit.org/show_bug.cgi?id=182280
<rdar://problem/37018386>

Reviewed by Alan Bujtas.

Source/WebCore:

Remove the possibility that changing children calls back into updating layout by
handling children changes in a deferred manner.

This follows the same architecture as many other deferred changes, but also requires us to check deferred changes
in updateBackingStore, because things like aria-hidden changes won't trigger a layout, but will require us to update children.

A few tests had to be modified to no longer change the tree and then check the children immediately.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::childrenChanged):
(WebCore::AXObjectCache::prepareForDocumentDestruction):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertToNSArray):
(-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):

LayoutTests:

* accessibility/aria-hidden-update.html:
* accessibility/aria-hidden-updates-alldescendants.html:
* accessibility/image-load-on-delay.html:
* accessibility/mac/aria-hidden-changes-for-non-ignored-elements.html:
* accessibility/removed-anonymous-block-child-causes-crash.html:

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

7 months ago[Cocoa] Ask platform for generic font family mappings
mmaxfield@apple.com [Tue, 12 Feb 2019 02:19:19 +0000 (02:19 +0000)]
[Cocoa] Ask platform for generic font family mappings
https://bugs.webkit.org/show_bug.cgi?id=187723
<rdar://problem/41892438>

Reviewed by Brent Fulgham.

Source/WebCore:

WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
When trying to style a character with a generic font family, we first look to see if
we have a mapping for the particular script the character is rendered with, and if we
don't find a match, we then check USCRIPT_COMMON.

In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
the only scripts which won't use the API families) is in
SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
for the CJK scripts.

The mappings inside SettingsBase are incorrect and conflict with our policy regarding
user-installed fonts. Instead, we should be consulting with the platform for some of
these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
API still has to work to set the mappings for untagged content. Therefore, we use the
system mappings for language-tagged content, and the API mappings for non-language-tagged
content. This is a good balance that makes sure we always have a good mapping for every
language, but API clients can still set the mappings, too.

Test: fast/text/ja-sans-serif.html

* css/CSSComputedStyleDeclaration.cpp:
* css/CSSFontSelector.cpp:
(WebCore::resolveGenericFamily):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFamily):
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::initializeDefaultFontFamilies):
(WebCore::osakaMonoIsInstalled): Deleted.
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/FontDescription.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::computeSpecializedChineseLocale):
(WebCore::cachedSpecializedChineseLocale):
(WebCore::languageChanged):
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::clear):
(WebCore::genericFamily):
(WebCore::SystemFontDatabaseCoreText::serifFamily):
(WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
(WebCore::SystemFontDatabaseCoreText::cursiveFamily):
(WebCore::SystemFontDatabaseCoreText::fantasyFamily):
(WebCore::SystemFontDatabaseCoreText::monospaceFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:

Source/WebCore/PAL:

* pal/spi/cocoa/CoreTextSPI.h:

Source/WTF:

Add an ENABLE in Platform.

* wtf/Platform.h:

Tools:

Allow testing infrastructure to use fonts that are returned from CTFontDescriptorCreateForCSSFamily().

* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::allowedFontFamilySet):

LayoutTests:

Update the tests to work with this new model.

* fast/text/international/font-fallback-to-common-script-expected.html: Removed.
* fast/text/international/font-fallback-to-common-script.html: Removed.
* fast/text/international/lang-sensitive-fonts-expected.html:
* fast/text/international/lang-sensitive-fonts-xml-expected.html:
* fast/text/international/lang-sensitive-fonts-xml.xhtml:
* fast/text/international/lang-sensitive-fonts.html:
* fast/text/international/locale-sensitive-fonts-expected.html:
* fast/text/international/locale-sensitive-fonts.html:
* fast/text/ja-sans-serif-expected-mismatch.html: Added.
* fast/text/ja-sans-serif.html: Added.
* platform/ios/fast/block/float/016-expected.txt:

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

7 months agoRemove noisy and unnecessary logs added in r241223
achristensen@apple.com [Tue, 12 Feb 2019 01:50:34 +0000 (01:50 +0000)]
Remove noisy and unnecessary logs added in r241223
https://bugs.webkit.org/show_bug.cgi?id=194427

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
Errors occur all the time in the XPC connection's event handler, like when a process terminates.
We don't need to print an "error" every time any process terminates.

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

7 months agoUpdating for all of Mac WK2 for flaky test
commit-queue@webkit.org [Tue, 12 Feb 2019 01:16:19 +0000 (01:16 +0000)]
Updating for all of Mac WK2 for flaky test
https://bugs.webkit.org/show_bug.cgi?id=185994

Unreviewed test gardening.

Patch by Shawn Roberts <sroberts@apple.com> on 2019-02-11

* platform/mac-wk2/TestExpectations:

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

7 months ago[Cocoa] Web Automation: client callbacks are not called if delegate does not override
bburg@apple.com [Tue, 12 Feb 2019 01:15:49 +0000 (01:15 +0000)]
[Cocoa] Web Automation: client callbacks are not called if delegate does not override
https://bugs.webkit.org/show_bug.cgi?id=194519
<rdar://problem/47981961>

Reviewed by Joseph Pecoraro.

Call the completion handler directly if the delegate does not implement the relevant method.

* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::requestNewPageWithOptions):
(WebKit::AutomationSessionClient::requestSwitchToPage):
(WebKit::AutomationSessionClient::requestHideWindowOfPage):
(WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
(WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):

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

7 months ago[iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph
dbates@webkit.org [Tue, 12 Feb 2019 01:04:16 +0000 (01:04 +0000)]
[iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph
https://bugs.webkit.org/show_bug.cgi?id=194505
<rdar://problem/47743533>

Reviewed by Tim Horton.

Source/WebKit:

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _deleteToEndOfParagraph]): Added.
(-[WKContentView _transpose]): Added.

LayoutTests:

Add tests to ensure that Control + t and Control + k perform a transpose and delete to the
end of the line/paragraph. Skip the tests for now until we have the UIKit fix <rdar://problem/44928156>.

* fast/events/ios/key-command-delete-to-end-of-paragraph-expected.txt: Added.
* fast/events/ios/key-command-delete-to-end-of-paragraph.html: Added.
* fast/events/ios/key-command-transpose-expected.txt: Added.
* fast/events/ios/key-command-transpose.html: Added.
* platform/ios/TestExpectations: Skip tests for now.

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

7 months ago[GTK][WPE] Add content extensions support in WKTR and unskip layout tests
aperez@igalia.com [Tue, 12 Feb 2019 00:07:21 +0000 (00:07 +0000)]
[GTK][WPE] Add content extensions support in WKTR and unskip layout tests
https://bugs.webkit.org/show_bug.cgi?id=193622

Reviewed by Michael Catanzaro.

.:

* Source/cmake/OptionsGTK.cmake: Enable CONTENT_EXTENSIONS by default.
* Source/cmake/OptionsWPE.cmake: Ditto.
* Source/cmake/WebKitFeatures.cmake: Add a private CONTENT_EXTENSIONS option.

Source/WebCore:

No new tests needed.

* SourcesCocoa.txt: Remove loader/ResourceLoadInfo.cpp, it's not Cocoa-specific anymore.
* Sources.txt: Add loader/ResourceLoadInfo.cpp, all ports use it now.

Source/WebKit:

* NetworkProcess/cache/NetworkCacheData.h: Define an adoptAndMapFile() implementation
for GFileIOStream objects.
* NetworkProcess/cache/NetworkCacheDataSoup.cpp:
(WebKit::NetworkCache::adoptAndMapFile): Added implementation, which extracts the file
descriptor from a GFileIOStream, as it inherits from GFileDescriptorBased, and then
reuses the version of adoptAndMapFile() which takes a file descritor for the actual work.
* NetworkProcess/NetworkLoadChecker.cpp:
(Webkit::NetworkLoadChecker::checkRequest): Use "this" when referring to
processContentExtensionRulesForLoad() in order to avoid ambiguity.
* Sources.txt: Add WKUserContentExtensionStoreRef.cpp, all ports use it now.
* SourcesCocoa.txt: Remove WKUserContentExtensionStoreRef.cpp, because it is not
Cocoa-specific anymore.
* SourcesGTK.txt: Add APIContentRuleListStoreGLib.cpp.
* SourcesWPE.txt: Ditto.
* UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
(WKUserContentExtensionStoreCreate): Added.
(toResult): Added.
(WKUserContentExtensionStoreCompile): Added.
(WKUserContentExtensionStoreLookup): Added.
(WKUserContentExtensionStoreRemove): Added.
* UIProcess/API/C/WKUserContentExtensionStoreRef.h: Add declarations for the new C API
functions and for the WKUserContentExtensionStoreResult status enum.
* UIProcess/API/glib/APIContentRuleListStoreGLib.cpp: Added.
(API::ContentRuleListStore::defaultStorePath): Add a dummy implementation. The public API
for the GLib based ports (GTK+ and WPE) will not allow using the default store and will
always indicating a path.

Tools:

This adds support for loading content extension rule sets from the JSON files which
accompany the corresponding layout test, using the C API. The Cocoa specific parts
of WKTR for this could be removed, but that is left for a follow-up patch with
cleanups.

* Scripts/webkitperl/FeatureList.pm: Add an option to toggle CONTENT_EXTENSIONS.
* WebKitTestRunner/TestController.cpp:
(WTR::testPath): Subtract one from the length when constructing the result std::string to
avoid having the null-terminator copied into the result.
(WTR::TestController::configureViewForTest): Call configureContentExtensionForTest() as
part of the preparations to run a test.
(WTR::ContentExtensionStoreCallbackContext::ContentExtensionStoreCallbackContext): Added.
(WTR::contentExtensionStoreCallback): Added.
(WTR::contentExtensionJSONPath): Used to calculate the path to the JSON rule set to be
used for content extensions test.
(WTR::TestController::configureContentExtensionForTest): Added, handles enabling content
extensions and compiling the JSON rule set for tests involving content extensions.
(WTR::TestController::resetContentExtensions): Removes the content extension built for
testing and disables content extensions.
(WTR::TestController::resetPreferencesToConsistentValues): Add a call to
resetContentExtensions().
(WTR::TestController::userContentController): Added implementation for ports other than Cocoa.
* WebKitTestRunner/TestController.h: Add declarations for resetContentExtensions(),
configureContentExtensionForTest(), and userContentController().

LayoutTests:

* platform/gtk/TestExpectations: Un-skip tests for content extensions and add expectations.

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

7 months ago[iOS] Mouse/Touch/Pointer events are missing modifier keys
dbates@webkit.org [Mon, 11 Feb 2019 23:24:23 +0000 (23:24 +0000)]
[iOS] Mouse/Touch/Pointer events are missing modifier keys
https://bugs.webkit.org/show_bug.cgi?id=191446
<rdar://problem/45929460>

Reviewed by Tim Horton.

Source/WebCore:

Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
to be passed to WebKit.

Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
       fast/events/touch/ios/pointer-events-with-modifiers.html
       fast/events/touch/ios/touch-events-with-modifiers.html

* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithMouseEventType:timeStamp:location:]):
(-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):

Source/WebKit:

Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
flags held when a navigation action was initiated.

* Platform/spi/ios/UIKitSPI.h: Expose SPI.
* Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
from both C++ and Objective-C source files. It only makes sense to expose this function when
compiling as part of an Objective-C source file.
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
when the platform touch event was received and pass them through to the base constructor.
(WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
OptionSet<WebKit::WebEvent::Modifier>.
* Shared/ios/WebIOSEventFactory.h:
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
to the platform-specific UIKeyModifierFlags.
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction modifierFlags]): Added.
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(gestureRecognizerModifierFlags): Added.

(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _highlightLongPressRecognized:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _singleTapCommited:]):
Pass modifier flags through.

(-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
(-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
detail that this action is implemented via mouse click and we should re-evaluate this decision in light of
the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible
to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse
event perspective.
(webEventFlagsForUIKeyModifierFlags): Added.
(-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through.
(-[WKContentView _attemptClickAtLocation:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::handleTap):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::commitPotentialTap):
Pass modifier flags through.

Tools:

Add support infrastructure for testing touch and stylus taps when holding modifier keys.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::arrayLength):
(WTR::parseModifierArray):
(WTR::UIScriptController::singleTapAtPoint): Implemented in terms of singleTapAtPointWithModifiers().
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPoint): Implemented in terms of stylusTapAtPointWithModifiers().
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.

LayoutTests:

Refactor existing iOS key events tests to share code. Add new tests to ensure touch and mouse events
have accurate modifier key details.

* fast/events/ios/key-events-meta-alt-combinations.html:
* fast/events/ios/resources/key-tester.js:
(computeSubsets.compareByModifierOrder): Deleted.
* fast/events/resources/compute-subsets.js: Added.
(computeSubsets.compareByOriginalArrayOrder):
(computeSubsets):
* fast/events/touch/ios/mouse-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/mouse-events-with-modifiers.html: Added.
* fast/events/touch/ios/pointer-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/pointer-events-with-modifiers.html: Added.
* fast/events/touch/ios/touch-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/touch-events-with-modifiers.html: Added.
* http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt: Update expected result
due to changes to ui-helper.js.
* http/tests/security/anchor-download-block-crossorigin-expected.txt: Ditto.
* platform/ios/TestExpectations:
* resources/ui-helper.js:
(window.UIHelper.tapAt.return.new.Promise):
(window.UIHelper.tapAt):
(window.UIHelper.stylusTapAt.return.new.Promise):
(window.UIHelper.stylusTapAt):

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

7 months ago[Cocoa] Notify AVSystemController of our presenting PID before registering as a Now...
jer.noble@apple.com [Mon, 11 Feb 2019 22:52:18 +0000 (22:52 +0000)]
[Cocoa] Notify AVSystemController of our presenting PID before registering as a Now Playing app.
https://bugs.webkit.org/show_bug.cgi?id=194504

Reviewed by Eric Carlson.

Source/WebCore:

This allows the MediaRemote framework to associate the WebContent process with its host application.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::prepareToSendUserMediaPermissionRequest):
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(MediaSessionManagerCocoa::prepareToSendUserMediaPermissionRequest):
(MediaSessionManagerCocoa::providePresentingApplicationPIDIfNecessary):
(MediaSessionManagerCocoa::updateNowPlayingInfo):

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/spi/ios/CelestialSPI.h: Renamed from Source/WebKit/Platform/spi/ios/CelestialSPI.h.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
(WebKit::WebUserMediaClient::requestUserMediaAccess):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::userMediaPermissionRequestManager):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted.

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

7 months agoRandomize insertion of deallocated StructureIDs into the StructureIDTable's free...
mark.lam@apple.com [Mon, 11 Feb 2019 22:44:17 +0000 (22:44 +0000)]
Randomize insertion of deallocated StructureIDs into the StructureIDTable's free list.
https://bugs.webkit.org/show_bug.cgi?id=194512
<rdar://problem/47975465>

Reviewed by Yusuke Suzuki.

* runtime/StructureIDTable.cpp:
(JSC::StructureIDTable::StructureIDTable):
(JSC::StructureIDTable::allocateID):
(JSC::StructureIDTable::deallocateID):
* runtime/StructureIDTable.h:

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

7 months agoWeb Inspector: add context menu items to copy a resource's HTTP request/response...
drousso@apple.com [Mon, 11 Feb 2019 22:27:37 +0000 (22:27 +0000)]
Web Inspector: add context menu items to copy a resource's HTTP request/response data
https://bugs.webkit.org/show_bug.cgi?id=194261
<rdar://problem/21693696>

Reviewed by Joseph Pecoraro.

* UserInterface/Models/Resource.js:
(WI.Resource.prototype.stringifyHTTPRequest): Added.
(WI.Resource.prototype.stringifyHTTPResponse): Added.
Don't include the request/response data, as that can be very large, and can easily be
accessed by actually selecting the resource in the Resources/Network tab.

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

* Localizations/en.lproj/localizedStrings.js:

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

7 months agoUnreviewed, rolling out r241272 and r241276.
commit-queue@webkit.org [Mon, 11 Feb 2019 21:55:14 +0000 (21:55 +0000)]
Unreviewed, rolling out r241272 and r241276.
https://bugs.webkit.org/show_bug.cgi?id=194514

Broke the Apple Internal build and the fix requires human
intervention :( (Requested by dydz on #webkit).

Reverted changesets:

"[iOS] Mouse/Touch/Pointer events are missing modifier keys"
https://bugs.webkit.org/show_bug.cgi?id=191446
https://trac.webkit.org/changeset/241272

"Fix internal iOS build after r241272"
https://bugs.webkit.org/show_bug.cgi?id=191446
https://trac.webkit.org/changeset/241276

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

7 months agoUnreviewed, rolling out r241269.
tsavell@apple.com [Mon, 11 Feb 2019 21:47:56 +0000 (21:47 +0000)]
Unreviewed, rolling out r241269.

Caused 5 layout tests crashes on Mac WK1

Reverted changeset:

"DumpRenderTree should report unknown options"
https://bugs.webkit.org/show_bug.cgi?id=191303
https://trac.webkit.org/changeset/241269

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

7 months agoFix internal iOS build after r241272
achristensen@apple.com [Mon, 11 Feb 2019 20:43:03 +0000 (20:43 +0000)]
Fix internal iOS build after r241272
https://bugs.webkit.org/show_bug.cgi?id=191446

* Platform/spi/ios/UIKitSPI.h:
Declare the _modifierFlags when using the internal SDK also.

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

7 months agofast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html does not work...
wenson_hsieh@apple.com [Mon, 11 Feb 2019 19:30:05 +0000 (19:30 +0000)]
fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html does not work on iPad
https://bugs.webkit.org/show_bug.cgi?id=194313

Reviewed by Tim Horton.

Source/WebKit:

Make `-dateTimePickerCalendarType` work on iPad by handling the case where the date picker control is a
WKDateTimePopover. This fixes UIScriptController::calendarType() returning null on iPad.

* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKFormInputControl dateTimePickerCalendarType]):
(-[WKDateTimePopover calendarType]):

Tools:

Add a helper to determine whether the web view is presenting modal UI.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::isPresentingModally const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::isPresentingModally const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/UIScriptControllerCocoa.mm:
(WTR::UIScriptController::calendarType const): Deleted.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::isPresentingModally const):
(WTR::UIScriptController::calendarType const):
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::calendarType const):

LayoutTests:

Adjusts an existing layout test to work on both iPhone and iPad simulators.

* fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry-expected.txt:
* fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html:

Make this test wait after blurring the currently focused element, such that tapping to focus the next form
control doesn't fail. Notably on iPad, not waiting for the popover to dismiss meant that subsequent taps would
be dispatched too soon, and hit-test to the popover view being dismissed rather than WKWebView.

* platform/ipad/TestExpectations:

Unskip the test on iPad.

* resources/ui-helper.js:

Add helpers to query whether or not the keyboard is shown, and whether or not a view controller is being modally
presented over the current root view controller (this is the case when interacting with date pickers on iPad).

(window.UIHelper.isShowingKeyboard):
(window.UIHelper.isPresentingModally):
(window.UIHelper.deactivateFormControl):

Add a new helper method to blur the given form control element and wait for web view chrome to finish dismissing
(on iOS, this is either the date picker input view in the keyboard on iPhone, or the date picker popover view
controller on iPad).

(window.UIHelper.isShowingDataListSuggestions):

Drive-by fix: remove an extraneous ternary conditional statement.

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

7 months agoGCHeapInspector: Show the retained sizes in more places
commit-queue@webkit.org [Mon, 11 Feb 2019 19:25:50 +0000 (19:25 +0000)]
GCHeapInspector: Show the retained sizes in more places
https://bugs.webkit.org/show_bug.cgi?id=194464

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-11
Reviewed by Simon Fraser.

* GCHeapInspector/gc-heap-inspector.html:
* GCHeapInspector/script/interface.js:
(HeapInspectorUtils.humanReadableSize):
(HeapInspectorUtils.spanForNode.let.nodeHTML.node.className.span):
(HeapInspectorUtils.spanForNode.span.span):
(HeapSnapshotInspector.prototype.buildAllObjectsByType):
(HeapSnapshotInspector.prototype.buildRoots):

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

7 months agoStop using setDefersLoading from WebCore
achristensen@apple.com [Mon, 11 Feb 2019 19:02:49 +0000 (19:02 +0000)]
Stop using setDefersLoading from WebCore
https://bugs.webkit.org/show_bug.cgi?id=194315

Reviewed by Jer Noble.

That is what CompletionHandlers are for.

* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
(WebCore::MediaResource::setDefersLoading): Deleted.
* loader/MediaResourceLoader.h:
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::responseReceived):
(WebCore::PlatformMediaResource::stop):
(WebCore::PlatformMediaResource::setDefersLoading): Deleted.
* platform/network/cocoa/WebCoreNSURLSession.mm:
(WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
(-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.

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

7 months ago[iOS] Mouse/Touch/Pointer events are missing modifier keys
dbates@webkit.org [Mon, 11 Feb 2019 19:01:55 +0000 (19:01 +0000)]
[iOS] Mouse/Touch/Pointer events are missing modifier keys
https://bugs.webkit.org/show_bug.cgi?id=191446
<rdar://problem/45929460>

Reviewed by Tim Horton.

Source/WebCore:

Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
to be passed to WebKit.

Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
       fast/events/touch/ios/pointer-events-with-modifiers.html
       fast/events/touch/ios/touch-events-with-modifiers.html

* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithMouseEventType:timeStamp:location:]):
(-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):

Source/WebKit:

Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
flags held when a navigation action was initiated.

* Platform/spi/ios/UIKitSPI.h: Expose SPI.
* Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
from both C++ and Objective-C source files. It only makes sense to expose this function when
compiling as part of an Objective-C source file.
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
when the platform touch event was received and pass them through to the base constructor.
(WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
OptionSet<WebKit::WebEvent::Modifier>.
* Shared/ios/WebIOSEventFactory.h:
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
to the platform-specific UIKeyModifierFlags.
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction modifierFlags]): Added.
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(gestureRecognizerModifierFlags): Added.

(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _highlightLongPressRecognized:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _singleTapCommited:]):
Pass modifier flags through.

(-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
(-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
detail that this action is implemented via mouse click and we should re-evaluate this decision in light of
the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible
to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse
event perspective.
(webEventFlagsForUIKeyModifierFlags): Added.
(-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through.
(-[WKContentView _attemptClickAtLocation:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::handleTap):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::commitPotentialTap):
Pass modifier flags through.

Tools:

Add support infrastructure for testing touch and stylus taps when holding modifier keys.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::arrayLength):
(WTR::parseModifierArray):
(WTR::UIScriptController::singleTapAtPoint): Implemented in terms of singleTapAtPointWithModifiers().
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPoint): Implemented in terms of stylusTapAtPointWithModifiers().
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.

LayoutTests:

Refactor existing iOS key events tests to share code. Add new tests to ensure touch and mouse events
have accurate modifier key details.

* fast/events/ios/key-events-meta-alt-combinations.html:
* fast/events/ios/resources/key-tester.js:
(computeSubsets.compareByModifierOrder): Deleted.
* fast/events/resources/compute-subsets.js: Added.
(computeSubsets.compareByOriginalArrayOrder):
(computeSubsets):
* fast/events/touch/ios/mouse-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/mouse-events-with-modifiers.html: Added.
* fast/events/touch/ios/pointer-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/pointer-events-with-modifiers.html: Added.
* fast/events/touch/ios/touch-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/touch-events-with-modifiers.html: Added.
* http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt: Update expected result
due to changes to ui-helper.js.
* http/tests/security/anchor-download-block-crossorigin-expected.txt: Ditto.
* platform/ios/TestExpectations:
* resources/ui-helper.js:
(window.UIHelper.tapAt.return.new.Promise):
(window.UIHelper.tapAt):
(window.UIHelper.stylusTapAt.return.new.Promise):
(window.UIHelper.stylusTapAt):

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

7 months agoSeparate out outline-style: auto user-agent appearance from Mac animated focus ring...
dbates@webkit.org [Mon, 11 Feb 2019 19:00:08 +0000 (19:00 +0000)]
Separate out outline-style: auto user-agent appearance from Mac animated focus ring drawing
https://bugs.webkit.org/show_bug.cgi?id=193591

Reviewed by Simon Fraser.

Untangle the Mac-specific concept of animated focus ring drawing from the concepts of using
the fancy shrink-wrapped focus ring appearance and using the platform focus ring color when
outline-style: auto.

No functionality changed. So, no new tests.

* platform/graphics/GraphicsContext.h:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRing):
(WebCore::drawFocusRingToContextAtTime):
Change some macro guards.

* rendering/RenderElement.cpp:
(WebCore::usePlatformFocusRingColorForOutlineStyleAuto): Added.
(WebCore::useShrinkWrappedFocusRingForOutlineStyleAuto): Added.
(WebCore::drawFocusRing): Added.
(WebCore::RenderElement::paintFocusRing): Write in terms of drawFocusRing().

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

7 months agoFilter out Overconstrainederror.constraint when getUserMedia is not granted
youenn@apple.com [Mon, 11 Feb 2019 18:49:10 +0000 (18:49 +0000)]
Filter out Overconstrainederror.constraint when getUserMedia is not granted
https://bugs.webkit.org/show_bug.cgi?id=194240

Reviewed by Eric Carlson.

Source/WebKit:

Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.

Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.

Covered by added test.

* UIProcess/UserMediaPermissionCheckProxy.cpp:
(WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
(WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::isPending const):
(WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
(WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
(WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
(WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
(WebKit::UserMediaPermissionRequestProxy::userMediaID const):
(WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
(WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
(WebKit::UserMediaPermissionRequestProxy::userRequest const):
(WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
(WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
(WebKit::UserMediaPermissionRequestProxy::audioDevice const):
(WebKit::UserMediaPermissionRequestProxy::videoDevice const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
* UIProcess/WebPageProxy.h:

LayoutTests:

* fast/mediastream/overconstrainederror-constraint-expected.txt: Added.
* fast/mediastream/overconstrainederror-constraint.html: Added.

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

7 months agoDumpRenderTree should report unknown options
commit-queue@webkit.org [Mon, 11 Feb 2019 18:32:42 +0000 (18:32 +0000)]
DumpRenderTree should report unknown options
https://bugs.webkit.org/show_bug.cgi?id=191303

Patch by Darshan Kadu <dkadu@igalia.com> on 2019-02-11
Reviewed by Frédéric Wang.

Added RELEASE_ASSERT_NOT_REACHED for DumpRenderTree/TestOptions.cpp
to report unknown options.
Added and assigned test options which are currently used in tests.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):

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

7 months agoUnreviewed, rolling out r241229.
tsavell@apple.com [Mon, 11 Feb 2019 18:22:18 +0000 (18:22 +0000)]
Unreviewed, rolling out r241229.

Revision broke internal builds for watchOS.

Reverted changeset:

"[Cocoa] Ask platform for generic font family mappings"
https://bugs.webkit.org/show_bug.cgi?id=187723
https://trac.webkit.org/changeset/241229

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

7 months agoRemove the RELEASE_ASSERT check for duplicate cases in the BinarySwitch constructor.
mark.lam@apple.com [Mon, 11 Feb 2019 18:10:25 +0000 (18:10 +0000)]
Remove the RELEASE_ASSERT check for duplicate cases in the BinarySwitch constructor.
https://bugs.webkit.org/show_bug.cgi?id=194493
<rdar://problem/36380852>

Reviewed by Yusuke Suzuki.

Having duplicate cases in the BinarySwitch is not a correctness issue.  It is
however not good for performance and memory usage.  As such, a debug ASSERT will
do.  We'll also do an audit of the clients of BinarySwitch to see if it's
possible to be instantiated with duplicate cases in
https://bugs.webkit.org/show_bug.cgi?id=194492 later.

Also added some value dumps to the RELEASE_ASSERT to help debug the issue when we
see duplicate cases.

* jit/BinarySwitch.cpp:
(JSC::BinarySwitch::BinarySwitch):

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

7 months ago[WinCairo][MiniBrowser] Basic authentication always fails.
commit-queue@webkit.org [Mon, 11 Feb 2019 17:29:39 +0000 (17:29 +0000)]
[WinCairo][MiniBrowser] Basic authentication always fails.
https://bugs.webkit.org/show_bug.cgi?id=194496

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-02-11
Reviewed by Don Olmstead.

* MiniBrowser/win/DialogHelper.h:
(Dialog::getText):

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

7 months agoMake Request constructor throw if FetchRequestInit.signal is not undefined, null...
youenn@apple.com [Mon, 11 Feb 2019 17:20:07 +0000 (17:20 +0000)]
Make Request constructor throw if FetchRequestInit.signal is not undefined, null or an AbortSignal object
https://bugs.webkit.org/show_bug.cgi?id=194404
<rdar://problem/47891915>

Reviewed by Geoffrey Garen.

Source/WebCore:

Align with the spec, except for known problematic web sites.
Covered by updated test.

* Modules/fetch/FetchRequest.cpp:
(WebCore::needsSignalQuirk):
(WebCore::processInvalidSignal):
(WebCore::FetchRequest::initializeWith):

LayoutTests:

* http/wpt/fetch/request-abort-expected.txt:

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

7 months ago[LFC] FormattingContext::Geometry::floatingHeightAndMargin should take UsedHorizontal...
zalan@apple.com [Mon, 11 Feb 2019 16:23:03 +0000 (16:23 +0000)]
[LFC] FormattingContext::Geometry::floatingHeightAndMargin should take UsedHorizontalValues
https://bugs.webkit.org/show_bug.cgi?id=194490

Reviewed by Antti Koivisto.

This is in preparation for adding floating preferred width computation support. It requires height computaiton
which uses containing block width to resolve vertical margins.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/LayoutUnits.h:
(WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):

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

7 months ago[LFC] FormattingContext::intrinsicWidthConstraints should compute and save the intrin...
zalan@apple.com [Mon, 11 Feb 2019 16:19:36 +0000 (16:19 +0000)]
[LFC] FormattingContext::intrinsicWidthConstraints should compute and save the intrinsic widths consistently.
https://bugs.webkit.org/show_bug.cgi?id=194483

Reviewed by Antti Koivisto.

Rename intrinsicWidthConstraints to computeIntrinsicWidthConstraints (it does not return the width values anymore).

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeIntrinsicWidthConstraints const):
(WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

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

7 months ago[WPE] Do not try to create empty egl windows
carlosgc@webkit.org [Mon, 11 Feb 2019 14:08:00 +0000 (14:08 +0000)]
[WPE] Do not try to create empty egl windows
https://bugs.webkit.org/show_bug.cgi?id=194497

Reviewed by Žan Doberšek.

In AcceleratedSurfaceWPE we ensure the size we pass to wpe is at least 0x0, but wl_egl_window_create() returns
nullptr if 0 is passed as width or height. We should use at least 1x1 instead.

* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
(WebKit::AcceleratedSurfaceWPE::initialize):
(WebKit::AcceleratedSurfaceWPE::clientResize):

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

7 months ago[GStreamer] GstMappedBuffer testsuite build fails
commit-queue@webkit.org [Mon, 11 Feb 2019 12:14:50 +0000 (12:14 +0000)]
[GStreamer] GstMappedBuffer testsuite build fails
https://bugs.webkit.org/show_bug.cgi?id=194495

Patch by Philippe Normand <pnormand@igalia.com> on 2019-02-11
Reviewed by Carlos Garcia Campos.

Fix the build by explicitely adding the gstreamer1.0-audio include
directories to the include path.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWPE.cmake:

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

7 months ago[WPE] Do not use a sync IPC message to send the host FD to the web process
carlosgc@webkit.org [Mon, 11 Feb 2019 08:12:04 +0000 (08:12 +0000)]
[WPE] Do not use a sync IPC message to send the host FD to the web process
https://bugs.webkit.org/show_bug.cgi?id=194216

Reviewed by Darin Adler.

It can be sent as a web page creation parameter instead.

* PlatformWPE.cmake:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* SourcesWPE.txt:
* UIProcess/API/wpe/CompositingManagerProxy.cpp: Removed.
* UIProcess/API/wpe/CompositingManagerProxy.h: Removed.
* UIProcess/API/wpe/CompositingManagerProxy.messages.in: Removed.
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::hostFileDescriptor):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
* UIProcess/API/wpe/WPEView.h:
(WKWPE::View::create):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_hostFileDescriptor):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::releaseHostFileDescriptor):
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
(WebKit::AcceleratedSurfaceWPE::AcceleratedSurfaceWPE):
(WebKit::AcceleratedSurfaceWPE::initialize):
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
* WebProcess/WebPage/wpe/CompositingManager.cpp: Removed.
* WebProcess/WebPage/wpe/CompositingManager.h: Removed.

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

7 months agoUnreviewed WPE gardening. Adding additional baselines after font variations
zandobersek@gmail.com [Mon, 11 Feb 2019 08:06:48 +0000 (08:06 +0000)]
Unreviewed WPE gardening. Adding additional baselines after font variations
enablement. Additionally rebaselining a couple other WPT and WebGL tests.

* platform/wpe/TestExpectations:
* platform/wpe/fast/css/getComputedStyle: Added.
* platform/wpe/fast/css/getComputedStyle/computed-style-expected.txt: Added.
* platform/wpe/fast/css/getComputedStyle/computed-style-font-family-expected.txt: Added.
* platform/wpe/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Added.
* platform/wpe/fast/dom/52776-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.worker-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* platform/wpe/svg/css/getComputedStyle-basic-expected.txt: Added.
* platform/wpe/webgl/2.0.0/conformance/canvas/buffer-offscreen-test-expected.txt:
* platform/wpe/webgl/2.0.0/conformance/canvas/buffer-preserve-test-expected.txt:
* platform/wpe/webgl/2.0.0/conformance/context/context-attribute-preserve-drawing-buffer-expected.txt:

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

7 months ago[GTK][WPE] Add enable-javascript-markup setting
carlosgc@webkit.org [Mon, 11 Feb 2019 06:36:04 +0000 (06:36 +0000)]
[GTK][WPE] Add enable-javascript-markup setting
https://bugs.webkit.org/show_bug.cgi?id=193439

Reviewed by Michael Catanzaro.

Source/WebKit:

Expose JavaScriptMarkupEnabled setting in the GLib API.

* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_javascript_markup):
(webkit_settings_set_enable_javascript_markup):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitSettings.h:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:

Tools:

Add test cases to check the new setting.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings):
(testWebKitSettingsJavaScriptMarkup):
(beforeAll):

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

7 months ago[LFC] Fix spelling error.
zalan@apple.com [Mon, 11 Feb 2019 06:17:53 +0000 (06:17 +0000)]
[LFC] Fix spelling error.
https://bugs.webkit.org/show_bug.cgi?id=194489

Reviewed by Simon Fraser.

instrinsic -> intrinsic

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::setIntrinsicWidthConstraints):
(WebCore::Layout::FormattingState::clearIntrinsicWidthConstraints):
(WebCore::Layout::FormattingState::intrinsicWidthConstraints const):
(WebCore::Layout::FormattingState::setInstrinsicWidthConstraints): Deleted.
(WebCore::Layout::FormattingState::clearInstrinsicWidthConstraints): Deleted.
(WebCore::Layout::FormattingState::instrinsicWidthConstraints const): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraintsNeedChildrenWidth):
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraintsNeedChildrenWidth): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

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

7 months agoSwitch uses of StringBuilder with String::format for hex numbers to use HexNumber...
darin@apple.com [Mon, 11 Feb 2019 06:02:05 +0000 (06:02 +0000)]
Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
https://bugs.webkit.org/show_bug.cgi?id=194485

Reviewed by Daniel Bates.

Source/JavaScriptCore:

* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::json): Use appendUnsignedAsHex along with
reinterpret_cast<uintptr_t> to replace uses of String::format with "%p".

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::encode): Removed some unneeded casts in StringBuilder code,
including one in a call to appendByteAsHex.
(JSC::globalFuncEscape): Ditto.

Source/WebCore:

* Modules/websockets/WebSocket.cpp:
(WebCore::encodeProtocolString): Use appendUnsignedAsHexFixedSize instead of String::format.

* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize const): Fixed style of many return statements
that called a function returning void; doesn't match WebKit's prevailing style.
Also use break instead of return. Used appendLiteral instead of append in many
cases, and append character instead of single-character literal in others.
Use appendUnsignedAsHex instead of String::format.

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::generateHashedName): Use appendUnsignedAsHex instad of appendUnsigned64AsHex.
Should come back here and use makeString once we make HexNumber.h work with that.

* platform/mac/WebCoreNSURLExtras.mm: Removed unnecessary include of HexNumber.h.

* rendering/RenderTreeAsText.cpp:
(WebCore::quoteAndEscapeNonPrintables): Use appendLiteral instead of multiple calls
to character append. Touched because it was next to a call to appendUnsignedAsHex.

Source/WebKit:

* UIProcess/DeviceIdHashSaltStorage.cpp:
(WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall): Use
appendUnsignedAsHex instead of appendUnsigned64AsHex.

* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::loggingString): Use appendUnsignedAsHex and
reinterpret_cast<uintptr_t> instead of String::format and "%p".

Source/WTF:

* wtf/HexNumber.h: Removed unused functions placeByteAsHexCompressIfPossible and
placeByteAsHex. Can always bring them back if someone needs them. Updated
appendUnsignedAsHex to be a template so we can use it on any integer type,
got rid of unnecessary use of Vector and unnecessary reversing, and got rid of
appendUnsigned64AsHex since callers can now just use appendUnsignedAsHex.
Rewrote appendUnsignedAsHexFixedSize to share mode code rather than replicating.

* wtf/Logger.h: Use appendUnsignedAsHex instead of appendUnsigned64AsHex.

* wtf/URL.cpp: Removed unnecessary include of HexNumber.h.

* wtf/cocoa/NSURLExtras.h: Added missing include of Foundation.h that was
worked around in NSURLExtras.mm.
* wtf/cocoa/NSURLExtras.mm: Removed unnecessary includes of HexNumber.h
and Foundation.h.

Tools:

* WebKitTestRunner/TestController.cpp: Removed unnecessary include of HexNumber.h.

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

7 months agoUnreviewed, rolling out r241230.
commit-queue@webkit.org [Mon, 11 Feb 2019 04:10:08 +0000 (04:10 +0000)]
Unreviewed, rolling out r241230.
https://bugs.webkit.org/show_bug.cgi?id=194488

"It regressed JetStream2 by ~6%" (Requested by saamyjoon on
#webkit).

Reverted changeset:

"We should only make rope strings when concatenating strings
long enough."
https://bugs.webkit.org/show_bug.cgi?id=194465
https://trac.webkit.org/changeset/241230

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

7 months agoBBQ-Air: Emit better code for switch
sbarati@apple.com [Mon, 11 Feb 2019 03:25:52 +0000 (03:25 +0000)]
BBQ-Air: Emit better code for switch
https://bugs.webkit.org/show_bug.cgi?id=194053

Reviewed by Yusuke Suzuki.

Instead of emitting a linear set of jumps for Switch, this patch
makes the BBQ-Air backend emit a binary switch.

* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::addSwitch):

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