WebKit-https.git
4 months agoWeb Inspector: Timelines: can't reliably stop/start a recording
drousso@apple.com [Thu, 11 Apr 2019 21:06:47 +0000 (21:06 +0000)]
Web Inspector: Timelines: can't reliably stop/start a recording
https://bugs.webkit.org/show_bug.cgi?id=196778
<rdar://problem/47606798>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/ScriptProfiler.json:
* inspector/protocol/Timeline.json:
It is possible to determine when programmatic capturing starts/stops in the frontend based
on the state when the backend causes the state to change, such as if the state is "inactive"
when the frontend is told that the backend has started capturing.

* inspector/protocol/CPUProfiler.json:
* inspector/protocol/Memory.json:
Send an end timestamp to match other instruments.

* inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::startConsoleProfile):
(Inspector::JSGlobalObjectConsoleClient::stopConsoleProfile):

* inspector/agents/InspectorScriptProfilerAgent.h:
* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
(Inspector::InspectorScriptProfilerAgent::programmaticCaptureStarted): Deleted.
(Inspector::InspectorScriptProfilerAgent::programmaticCaptureStopped): Deleted.

Source/WebCore:

* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::startProgrammaticCapture):
(WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
It is possible to determine when programmatic capturing starts/stops in the frontend based
on the state when the backend causes the state to change, such as if the state is "inactive"
when the frontend is told that the backend has started capturing.

* inspector/agents/InspectorCPUProfilerAgent.cpp:
(WebCore::InspectorCPUProfilerAgent::stopTracking):
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::stopTracking):
Send an end timestamp to match other instruments.

Source/WebInspectorUI:

Rather than have a binary state of capturing/not-capturing, we should use a four state:
 1. inactive (when the backend has stopped capturing)
 2. starting (when the frontend requests capturing to start)
 3. active (when the backend has started capturing)
 4. stopping (when the frontend requests capturing to stop)

Capturing is considered "on" when not in an "inactive" state. Prevent the frontend from
starting/stopping capturing unless we're in a "stable" ("inactive" or "active") state, not a
"transition" ("starting" or "stopping") state.

One "side effect" of this change is that since the capturing is considered active until the
backend has stopped capturing, we will continue to process records in the frontend even if
the frontend has requested to stop capturing. <https://webkit.org/b/152904>

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager):
(WI.TimelineManager.prototype.get capturingState): Added.
(WI.TimelineManager.prototype.reset):
(WI.TimelineManager.prototype.get activeRecording):
(WI.TimelineManager.prototype.set autoCaptureOnPageLoad):
(WI.TimelineManager.prototype.isCapturing):
(WI.TimelineManager.prototype.startCapturing):
(WI.TimelineManager.prototype.stopCapturing):
(WI.TimelineManager.prototype.processJSON):
(WI.TimelineManager.prototype.capturingStarted):
(WI.TimelineManager.prototype.capturingStopped):
(WI.TimelineManager.prototype.autoCaptureStarted):
(WI.TimelineManager.prototype.eventRecorded):
(WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
(WI.TimelineManager.prototype.pageLoadEventFired):
(WI.TimelineManager.prototype.cpuProfilerTrackingUpdated):
(WI.TimelineManager.prototype.cpuProfilerTrackingCompleted):
(WI.TimelineManager.prototype.memoryTrackingUpdated):
(WI.TimelineManager.prototype.memoryTrackingCompleted):
(WI.TimelineManager.prototype.heapTrackingStarted):
(WI.TimelineManager.prototype.heapTrackingCompleted):
(WI.TimelineManager.prototype.heapSnapshotAdded):
(WI.TimelineManager.prototype._updateCapturingState): Added.
(WI.TimelineManager.prototype._processRecord):
(WI.TimelineManager.prototype._processEvent):
(WI.TimelineManager.prototype._loadNewRecording):
(WI.TimelineManager.prototype._addRecord):
(WI.TimelineManager.prototype._attemptAutoCapturingForFrame):
(WI.TimelineManager.prototype._legacyAttemptStartAutoCapturingForFrame):
(WI.TimelineManager.prototype._stopAutoRecordingSoon):
(WI.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
(WI.TimelineManager.prototype._resourceWasAdded):
(WI.TimelineManager.prototype._garbageCollected):
(WI.TimelineManager.prototype._memoryPressure):
(WI.TimelineManager.prototype._handleTimelinesAutoStopSettingChanged):
(WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
(WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
(WI.TimelineManager.prototype._handleDOMNodeLowPowerChanged):
(WI.TimelineManager.prototype.unloadRecording): Deleted.
(WI.TimelineManager.prototype.programmaticCaptureStarted): Deleted.
(WI.TimelineManager.prototype.programmaticCaptureStopped): Deleted.
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStarted): Deleted.
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStopped): Deleted.

* UserInterface/Protocol/ScriptProfilerObserver.js:
(WI.ScriptProfilerObserver.prototype.trackingComplete):
(WI.ScriptProfilerObserver.prototype.programmaticCaptureStarted):
(WI.ScriptProfilerObserver.prototype.programmaticCaptureStopped):
* UserInterface/Protocol/TimelineObserver.js:
(WI.TimelineObserver.prototype.programmaticCaptureStarted):
(WI.TimelineObserver.prototype.programmaticCaptureStopped):
It is possible to determine when programmatic capturing starts/stops in the frontend based
on the state when the backend causes the state to change, such as if the state is "inactive"
when the frontend is told that the backend has started capturing.

* UserInterface/Protocol/CPUProfilerObserver.js:
(WI.CPUProfilerObserver.prototype.trackingComplete):
* UserInterface/Protocol/MemoryObserver.js:
(WI.MemoryObserver.prototype.trackingComplete):
Send an end timestamp to match other instruments.

* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype._handleTimelineCapturingStateChanged): Added.
(WI.DebuggerManager.prototype._timelineCapturingWillStart): Deleted.
(WI.DebuggerManager.prototype._timelineCapturingStopped): Deleted.
* UserInterface/Models/DefaultDashboard.js:
(WI.DefaultDashboard):
(WI.DefaultDashboard.prototype._handleTimelineCapturingStateChanged): Added.
(WI.DefaultDashboard.prototype._capturingStopped): Deleted.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel):
(WI.DebuggerSidebarPanel.prototype._handleTimelineCapturingStateChanged): Added.
(WI.DebuggerSidebarPanel.prototype._timelineCapturingWillStart): Deleted.
(WI.DebuggerSidebarPanel.prototype._timelineCapturingStopped): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStateChanged): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingWillStart): Deleted.
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStopped): Deleted.
* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview):
(WI.TimelineOverview.prototype._handleTimelineCapturingStateChanged): Added.
(WI.TimelineOverview.prototype._capturingStarted): Deleted.
(WI.TimelineOverview.prototype._capturingStopped): Deleted.
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._handleTimelineCapturingStateChanged): Added.
(WI.TimelineRecordingContentView.prototype._recordingUnloaded):
(WI.TimelineRecordingContentView.prototype._capturingStarted): Deleted.
(WI.TimelineRecordingContentView.prototype._capturingStopped): Deleted.
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView):
(WI.TimelineTabContentView.prototype._handleTimelineCapturingStateChanged): Added.
(WI.TimelineTabContentView.prototype._capturingStartedOrStopped): Deleted.
Use the new single event for all Timelines capture state changes.
Prevent the record button from being clicked when capturing is in a transition state.

LayoutTests:

* inspector/timeline/debugger-paused-while-recording.html:
* inspector/timeline/exception-in-injected-script-while-recording.html:
* inspector/timeline/line-column.html:
* inspector/timeline/recording-start-stop-timestamps.html:
* inspector/timeline/resources/timeline-event-utilities.js:
* inspector/timeline/setInstruments-programmatic-capture.html:
* inspector/timeline/setInstruments-programmatic-capture-expected.txt:
* inspector/timeline/timeline-recording.html:

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

4 months agoRename SetArgument to SetArgumentDefinitely
sbarati@apple.com [Thu, 11 Apr 2019 20:47:16 +0000 (20:47 +0000)]
Rename SetArgument to SetArgumentDefinitely
https://bugs.webkit.org/show_bug.cgi?id=196828

Reviewed by Yusuke Suzuki.

This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=196712
where we will introduce a node named SetArgumentMaybe. Doing this refactoring
first will make reviewing that other patch easier.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleVarargsInlining):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCPSRethreadingPhase.cpp:
(JSC::DFG::CPSRethreadingPhase::freeUnnecessaryNodes):
(JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlock):
(JSC::DFG::CPSRethreadingPhase::specialCaseArguments):
(JSC::DFG::CPSRethreadingPhase::propagatePhis):
(JSC::DFG::CPSRethreadingPhase::computeIsFlushed):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGCommon.h:
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::methodOfGettingAValueProfileFor):
* dfg/DFGGraph.h:
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::initialize):
(JSC::DFG::InPlaceAbstractState::endBasicBlock):
* dfg/DFGLiveCatchVariablePreservationPhase.cpp:
(JSC::DFG::LiveCatchVariablePreservationPhase::handleBlockForTryCatch):
* dfg/DFGMaximalFlushInsertionPhase.cpp:
(JSC::DFG::MaximalFlushInsertionPhase::treatRegularBlock):
(JSC::DFG::MaximalFlushInsertionPhase::treatRootBlock):
* dfg/DFGMayExit.cpp:
* dfg/DFGNode.cpp:
(JSC::DFG::Node::hasVariableAccessData):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertPhantomToPhantomLocal):
* dfg/DFGNodeType.h:
* dfg/DFGOSREntrypointCreationPhase.cpp:
(JSC::DFG::OSREntrypointCreationPhase::run):
* dfg/DFGPhantomInsertionPhase.cpp:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSSAConversionPhase.cpp:
(JSC::DFG::SSAConversionPhase::run):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::checkArgumentTypes):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGTypeCheckHoistingPhase.cpp:
(JSC::DFG::TypeCheckHoistingPhase::run):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):

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

4 months agoREGRESSION: changing iPad orientation on blogger.com crashes under RemoteScrollingCoo...
antti@apple.com [Thu, 11 Apr 2019 18:09:56 +0000 (18:09 +0000)]
REGRESSION: changing iPad orientation on blogger.com crashes under RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations()
https://bugs.webkit.org/show_bug.cgi?id=196813
<rdar://problem/49393264>

Reviewed by Simon Fraser.

No test, can't repro.

* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):

Null check the nodes.

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

4 months agoUnreviewed, rolling out r244158.
tsavell@apple.com [Thu, 11 Apr 2019 17:45:05 +0000 (17:45 +0000)]
Unreviewed, rolling out r244158.

Casued 8 inspector/timeline/ test failures.

Reverted changeset:

"Web Inspector: Timelines: can't reliably stop/start a
recording"
https://bugs.webkit.org/show_bug.cgi?id=196778
https://trac.webkit.org/changeset/244158

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

4 months agoUpdated Spanish translation
mcatanzaro@igalia.com [Thu, 11 Apr 2019 15:49:26 +0000 (15:49 +0000)]
Updated Spanish translation
https://bugs.webkit.org/show_bug.cgi?id=196810

Patch by Álvaro Torralba <donfrutosgomez@gmail.com> on 2019-04-11
Rubber-stamped by Michael Catanzaro.

* es.po:

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

4 months ago[WPE] Build error with ENABLE_VIDEO=OFF after r244078
commit-queue@webkit.org [Thu, 11 Apr 2019 13:30:01 +0000 (13:30 +0000)]
[WPE] Build error with ENABLE_VIDEO=OFF after r244078
https://bugs.webkit.org/show_bug.cgi?id=196811

createGenericCue() is only defined when VIDEO_TRACK is enabled.

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2019-04-11
Reviewed by Eric Carlson.

* testing/Internals.cpp:
(WebCore::Internals::createGenericCue):
* testing/Internals.h:

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

4 months ago[GTK] Layout test accessibility/aria-hidden-false-works-in-subtrees.html fails after...
carlosgc@webkit.org [Thu, 11 Apr 2019 08:25:36 +0000 (08:25 +0000)]
[GTK] Layout test accessibility/aria-hidden-false-works-in-subtrees.html fails after r184890
https://bugs.webkit.org/show_bug.cgi?id=146718
<rdar://problem/21722487>

Reviewed by Joanmarie Diggs.

Source/WebCore:

Allow to get the text under element for nodes hidden in DOM but explicitly exposed to accessibility with
aria-hidden="false".

Fixes: accessibility/aria-hidden-false-works-in-subtrees.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement const):
* accessibility/atk/WebKitAccessible.cpp:
(roleIsTextType): Also consider ApplicationGroup role as text elements, so that <div>text</div> is equivalent to
<div role="roup">test</div>.

LayoutTests:

Update test to ATK behavior, rebaseline it and remove the expectations.

* accessibility/aria-hidden-false-works-in-subtrees.html:
* platform/gtk/TestExpectations:
* platform/gtk/accessibility/aria-hidden-false-works-in-subtrees-expected.txt:

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

4 months agoRegression(r244144) ProcessSwap.ReuseSuspendedProcessLoadHTMLString API test is flaky
cdumez@apple.com [Thu, 11 Apr 2019 06:48:20 +0000 (06:48 +0000)]
Regression(r244144) ProcessSwap.ReuseSuspendedProcessLoadHTMLString API test is flaky
https://bugs.webkit.org/show_bug.cgi?id=196784

Reviewed by Antti Koivisto.

When we enter accelerated compositing mode in the new process, we supposed to *close* the last
SuspendedPageProxy, not destroy it. This was causing flakiness in the test because it was testing
that we were using the SuspendedPageProxy's process for a cross-site link navigation, which is
an optimization. This optimization was partly broken by r244144 as the SuspendedPageProxy would
not sometimes be gone by the time we need it.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):

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

4 months agoAbstractValue::validateOSREntryValue is wrong for Int52 constants
sbarati@apple.com [Thu, 11 Apr 2019 06:26:37 +0000 (06:26 +0000)]
AbstractValue::validateOSREntryValue is wrong for Int52 constants
https://bugs.webkit.org/show_bug.cgi?id=196801
<rdar://problem/49771122>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/abstract-value-int52-constant-validation-should-not-care-about-representation.js: Added.

Source/JavaScriptCore:

validateOSREntryValue should not care about the format of the incoming
value for Int52s. This patch normalizes the format of m_value and
the incoming value when comparing them.

* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::validateOSREntryValue const):

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

4 months agoWKNavigationResponse._downloadAttribute should be nil when no download attribute...
commit-queue@webkit.org [Thu, 11 Apr 2019 06:16:01 +0000 (06:16 +0000)]
WKNavigationResponse._downloadAttribute should be nil when no download attribute is present
https://bugs.webkit.org/show_bug.cgi?id=196809
<rdar://49800762>

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

Source/WebKit:

* UIProcess/API/Cocoa/WKNavigationResponse.mm:
(-[WKNavigationResponse _downloadAttribute]):

Tools:

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

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

4 months agoREGRESSION (r241734): ⌥⌘↑ and ⌥⌘↓ no longer navigate to previous/next Reading List...
timothy_horton@apple.com [Thu, 11 Apr 2019 06:08:40 +0000 (06:08 +0000)]
REGRESSION (r241734): ⌥⌘↑ and ⌥⌘↓ no longer navigate to previous/next Reading List article
https://bugs.webkit.org/show_bug.cgi?id=196797
<rdar://problem/48484715>

Reviewed by Simon Fraser.

* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
Validate the set of modifier keys pressed when handling a key event for scrolling:
Ignore key events with multiple modifier keys pressed.
Ignore key events with an invalid modifier key pressed for a given primary key.

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

4 months agorequestAnimationFrame should execute before the next frame
commit-queue@webkit.org [Thu, 11 Apr 2019 05:44:13 +0000 (05:44 +0000)]
requestAnimationFrame should execute before the next frame
https://bugs.webkit.org/show_bug.cgi?id=177484

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-04-10
Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Add trace points for the page RenderingUpdate.

* web-platform-tests/resize-observer/resources/resizeTestHelper.js:
Change ResizeTestHelper.TIMEOUT to be 1 second instead of 100 ms which
is too short for layout tests.

Source/WebCore:

This change fixes these issues with animation timing:

1. Calling the requestAnimationFrame callbacks would have happened when
   the DisplayLink fires. This may have happened even if the frame is
   missed and no display is committed.

2. Style changes and layout triggered by script could trigger painting
   at more than 60fps. CoreAnimation commits could happen at more than
   60fps, although WindowServer will throttle those, and only some will
   be shown on the screen.

This change introduces a new paint scheduling model where painting is
driven by a "RenderingUpdateScheduler", which only triggers paints once
per 16.7ms frame.

Code that previously scheduled a compositing layer flush now schedules a
"RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
callback. When the render happens, we service requestAnimationFrame callbacks,
Web Animations, intersection observations and resize observations per the
"Update the rendering" step of the HTML Event Loop specification:
<https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.

In the future, more rendering steps will be added to this code.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
Fix layout tests by adding null check.

* animation/DocumentAnimationScheduler.cpp: Removed.
* animation/DocumentAnimationScheduler.h: Removed.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::updateThrottlingState):
(WebCore::DocumentTimeline::suspendAnimations):
(WebCore::DocumentTimeline::resumeAnimations):
(WebCore::DocumentTimeline::liveCurrentTime const):
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::cacheCurrentTime):
(WebCore::DocumentTimeline::animationTimingDidChange):
(WebCore::DocumentTimeline::scheduleAnimationResolution):
(WebCore::DocumentTimeline::unscheduleAnimationResolution):
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::scheduleNextTick):
(WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
Simplify this function by handling the case of no-animations separately.

(WebCore::DocumentTimeline::resolveAnimationsForElement):
Simplify the loop and delete hasPendingAcceleratedAnimations because it
is initialized to true and is not changed inside the loop.

(WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
(WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
* animation/DocumentTimeline.h:
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
There is no need to force update in resolveStyle(). notifyFlushRequired()
will be called eventually which will scheduleRenderingUpdate().

(WebCore::Document::prepareForDestruction):
(WebCore::Document::updateAnimationsAndSendEvents):
(WebCore::Document::serviceRequestAnimationFrameCallbacks):
(WebCore::Document::windowScreenDidChange):
(WebCore::Document::scheduleRenderingUpdate):
(WebCore::Document::updateIntersectionObservations):
(WebCore::Document::addResizeObserver):
(WebCore::Document::updateResizeObservations):
(WebCore::Document::scheduleForcedIntersectionObservationUpdate): Deleted.
(WebCore::Document::scheduleResizeObservations): Deleted.
(WebCore::Document::animationScheduler): Deleted.
No need to schedule web-animations, intersection observations and resize
observations updates separately. All of them will be updated through the
"Update the rendering" step, i.e. Page::updateRendering().

* dom/Document.h:
(WebCore::Document::numberOfIntersectionObservers const):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::animationTimerFired):
(WebCore::ScriptedAnimationController::serviceScriptedAnimations): Deleted.
(WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire): Deleted.
* dom/ScriptedAnimationController.h:
* page/FrameView.cpp:
(WebCore::FrameView::didLayout):
(WebCore::FrameView::viewportContentsChanged):
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layoutTimerFired):
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::observe):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::layoutIfNeeded):
(WebCore::Page::updateRendering):
(WebCore::Page::renderingUpdateScheduler):
(WebCore::Page::willDisplayPage): Deleted.
(WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): Deleted.
(WebCore::Page::updateIntersectionObservations): Deleted.
(WebCore::Page::scheduleForcedIntersectionObservationUpdate): Deleted.
(WebCore::Page::hasResizeObservers const): Deleted.
(WebCore::Page::gatherDocumentsNeedingResizeObservationCheck): Deleted.
(WebCore::Page::checkResizeObservations): Deleted.
(WebCore::Page::scheduleResizeObservations): Deleted.
(WebCore::Page::notifyResizeObservers): Deleted.
* page/Page.h:
(WebCore::Page::setNeedsCheckResizeObservations): Deleted.
(WebCore::Page::needsCheckResizeObservations const): Deleted.
The IntersectionObserver and the ResizeObserver do not need to schedule
their own timers. The RenderingUpdateScheduler will schedule the "Update
the rendering" step in which these obverses will be served.

* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::didChangeViewExposedRect):
(WebCore::PageOverlayController::notifyFlushRequired):
Force committing the layers to be 60 fps at maximum.

* page/RenderingUpdateScheduler.cpp: Added.
(WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
(WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
(WebCore::RenderingUpdateScheduler::isScheduled const):
(WebCore::RenderingUpdateScheduler::startTimer):
(WebCore::RenderingUpdateScheduler::clearScheduled):
(WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const):
(WebCore::RenderingUpdateScheduler::windowScreenDidChange):
(WebCore::RenderingUpdateScheduler::displayRefreshFired):
(WebCore::RenderingUpdateScheduler::scheduleCompositingLayerFlush):
* page/RenderingUpdateScheduler.h: Added.
(WebCore::RenderingUpdateScheduler::create):
* page/ResizeObserver.cpp:
(WebCore::ResizeObserver::observe):
(WebCore::ResizeObserver::scheduleObservations): Deleted.
* page/ResizeObserver.h:
(WebCore::ResizeObserver::hasActiveObservations const):
* page/ios/ContentChangeObserver.h:
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
* page/scrolling/ScrollingStateTree.cpp:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
(WebCore::RenderLayerCompositor::layerTreeAsText):

Source/WebKit:

Replace the calls to Page::layoutIfNeeded() and willDisplayPage() by
a single call to Page::updateRendering(). This new function implements
"Update the rendering" step of the HTML Event Loop specification
<https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.

* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
(WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::display):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::layerFlushTimerFired):

* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
-- Call Page::updateRendering() to make sure that "Update the rendering"
   happens immediately before updating the page.

-- Move the call to RemoteLayerBackingStoreCollection::willFlushLayers()
   to be exactly before flushing the layers. This fixes the assertion
   ASSERT(m_inLayerFlush) which was firing when running a layout test.
   RemoteLayerTreeDrawingArea::flushLayers() now can call itself through
   TestRunner::notifyDone(). flushLayers() was calling willFlushLayers()
   twice before calling didFlushLayers().

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::layoutIfNeeded):
(WebKit::WebPage::updateRendering):
(WebKit::WebPage::willDisplayPage): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _viewWillDrawInternal]):
(-[WebView _flushCompositingChanges]):
Call Page::updateRendering() which implements "Update the rendering"
step of the HTML Event Loop specification.

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::updateBackingStore):
(WebView::flushPendingGraphicsLayerChangesSoon):
(WebView::flushPendingGraphicsLayerChanges):
Call Page::updateRendering() which implements "Update the rendering"
step of the HTML Event Loop specification.

Source/WTF:

Add trace points for the page RenderingUpdate.

* wtf/SystemTracing.h:

Tools:

Add trace points for the page RenderingUpdate.

* Tracing/SystemTracePoints.plist:

LayoutTests:

* TestExpectations:
There is a slight difference between the actual DRT and the expected DRT
due to animation timing change. But these two tests are not animating
correctly if they are opened in Safari with web animation turned on.

* accessibility/mac/selection-notification-focus-change-expected.txt:
* accessibility/mac/selection-notification-focus-change.html:
Remove the debug statements form notificationCallback() since the number
of times this function is called back and the order of notifications are
not defined. This test has been flaky and some trials were made to make
it more reliable. With this change it became flaky again.

* animations/animation-multiple-callbacks-timestamp.html:
Fix variable names used by an error message.

* animations/no-style-recalc-during-accelerated-animation-expected.txt:
* animations/no-style-recalc-during-accelerated-animation.html:
One extra styleReclc was incurred due to the document styleRecalcTimer.
I think this timer is not needed anymore. I will look at removing it in
a separate patch.

* animations/resources/animation-test-helpers.js:
(waitForAnimationToStart):
The expectation that animation will start at the beginning of the next
event loop is not true anymore. The animation will start at the time the
requestAnimationFrame fires.

* compositing/video/video-clip-change-src.html:
This test loads a video data and pushes it to the encoder. Originally it
used to wait 150 ms after receiving the second canplaythrough. I had to
change this timing to 250 ms.

* css3/filters/composited-during-animation.html:
Ditto. setTimeout({...}, 0) versus requestAnimationFrame.

* media/media-controls-accessibility.html:
Updating the accessibility button happens asynchronously, see
[WebAccessibilityObjectWrapper accessibilityPerformPressAction]. Due to
changing the page update timing, this test became flaky. Originally it used
to setTimeout({...}, 10) to ensure the stringValue of the mutate button
was changed after it was pressed. The fix is to loop using rAF till the
stringValue changes.

* platform/mac-wk2/accessibility/mac/selection-notification-focus-change-expected.txt: Removed.
The number of time notificationCallback() is called and the order of
notifications are not defined. And this is why we have two expected files:
one for WK1 and the other for WK2. Since the test is now simplified, we
can get rid of this duplication. We will test the minimum reliable thing
we can test.

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

4 months agoNullptr crash in CompositeEditCommand::moveParagraphs when root editable element...
rniwa@webkit.org [Thu, 11 Apr 2019 02:12:56 +0000 (02:12 +0000)]
Nullptr crash in CompositeEditCommand::moveParagraphs when root editable element goes away
https://bugs.webkit.org/show_bug.cgi?id=193027

Reviewed by Wenson Hsieh.

Source/WebCore:

Added an early exit when the root editable element (editing host in HTML5 spec terminology) is null
during CompositeEditCommand::moveParagraphs. This could happen when the website does something crazy
like removing contenteditable content attribute during DOM mutations or when the destination becomes
disconnected (orphaned) from the document due to bugs elsewhere in the codebase.

Test: editing/deleting/merge-paragraphs-null-root-editable-element-crash.html

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs): Added an early exit.

LayoutTests:

Added a regression test. Note that the test works around debug assertions in moveParagraphs.
These assertions are generally correct & useful unless the website does something crazy like
removing the contenteditable content attribute during editing operations.

* editing/deleting/merge-paragraphs-null-root-editable-element-crash-expected.txt: Added.
* editing/deleting/merge-paragraphs-null-root-editable-element-crash.html: Added.

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

4 months agoWeb Inspector: save sheet should be anchored underneath the tab bar when detached
drousso@apple.com [Thu, 11 Apr 2019 02:04:57 +0000 (02:04 +0000)]
Web Inspector: save sheet should be anchored underneath the tab bar when detached
https://bugs.webkit.org/show_bug.cgi?id=196722
<rdar://problem/49613280>

Reviewed by Timothy Hatcher.

Source/WebCore:

No web observable change.

* inspector/InspectorFrontendClient.h:
(WebCore::InspectorFrontendClient::changeSheetRect): Added.

* inspector/InspectorFrontendClientLocal.h:
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::changeSheetRect): Added.

* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::setSheetRect): Added.

* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::setSheetRect): Added.

Source/WebInspectorUI:

* UserInterface/Base/Main.js:
(WI.contentLoaded):

Source/WebKit:

* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::changeSheetRect): Added.
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/WebInspectorProxy.h:
(WebKit::WebInspectorProxy::sheetRect const): Added.
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::setSheetRect): Added.
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorProxyObjCAdapter window:willPositionSheet:usingRect:]): Added.
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/wpe/WebInspectorProxyWPE.cpp:
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.

* WebProcess/WebPage/RemoteWebInspectorUI.h:
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::changeSheetRect): Added.
* UIProcess/RemoteWebInspectorProxy.messages.in:
* UIProcess/RemoteWebInspectorProxy.h:
(WebKit::RemoteWebInspectorProxy::sheetRect const): Added.
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::setSheetRect): Added.
(WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
(WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(-[WKRemoteWebInspectorProxyObjCAdapter window:willPositionSheet:usingRect:]): Added.
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
(WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.

Source/WebKitLegacy/ios:

* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorFrontendClient::setSheetRect): Added.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient::sheetRect const): Added.
* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController window:willPositionSheet:usingRect:]):
(WebInspectorFrontendClient::setSheetRect): Added.

Source/WebKitLegacy/win:

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::setSheetRect): Added.

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

4 months ago[GTK] Unreviewed test gardening
aboya@igalia.com [Thu, 11 Apr 2019 01:43:24 +0000 (01:43 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=196800

* platform/gtk/TestExpectations:
* platform/gtk/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt:

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

4 months agoArithSub over Int52 has shouldCheckOverflow as always true
sbarati@apple.com [Thu, 11 Apr 2019 01:31:51 +0000 (01:31 +0000)]
ArithSub over Int52 has shouldCheckOverflow as always true
https://bugs.webkit.org/show_bug.cgi?id=196796

Reviewed by Yusuke Suzuki.

AI was checking for ArithSub over Int52 if !shouldCheckOverflow. However,
shouldCheckOverflow is always true, so !shouldCheckOverflow is always
false. We shouldn't check something we assert against.

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

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

4 months ago[iOS] Let PDFHostViewController specify the background color to use for WKPDFView
aestes@apple.com [Thu, 11 Apr 2019 01:22:19 +0000 (01:22 +0000)]
[iOS] Let PDFHostViewController specify the background color to use for WKPDFView
https://bugs.webkit.org/show_bug.cgi?id=196785
<rdar://problem/48240051>

Reviewed by Tim Horton.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_initWithFrame:webView:mimeType:]):

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

4 months ago[PlayStation] Specify byte order clearly on Remote Inspector Protocol
basuke.suzuki@sony.com [Thu, 11 Apr 2019 01:19:28 +0000 (01:19 +0000)]
[PlayStation] Specify byte order clearly on Remote Inspector Protocol
https://bugs.webkit.org/show_bug.cgi?id=196790

Reviewed by Ross Kirsling.

Original implementation lacks byte order specification. Network byte order is the
good candidate if there's no strong reason to choose other.
Currently no client exists for PlayStation remote inspector protocol, so we can
change the byte order without care.

* inspector/remote/playstation/RemoteInspectorMessageParserPlayStation.cpp:
(Inspector::MessageParser::createMessage):
(Inspector::MessageParser::parse):

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

4 months agoSource/JavaScriptCore:
drousso@apple.com [Thu, 11 Apr 2019 00:33:29 +0000 (00:33 +0000)]
Source/JavaScriptCore:
       Web Inspector: Inspector: lazily create the agent
       https://bugs.webkit.org/show_bug.cgi?id=195971
       <rdar://problem/49039645>

       Reviewed by Joseph Pecoraro.

       * inspector/JSGlobalObjectInspectorController.cpp:
       (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
       (Inspector::JSGlobalObjectInspectorController::connectFrontend):
       (Inspector::JSGlobalObjectInspectorController::appendExtraAgent):
       (Inspector::JSGlobalObjectInspectorController::createLazyAgents):

       * inspector/agents/InspectorAgent.h:
       * inspector/agents/InspectorAgent.cpp:

Source/WebCore:
Web Inspector: Inspector: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195971
<rdar://problem/49039645>

Reviewed by Joseph Pecoraro.

No change in functionality.

* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
(WebCore::InspectorController::evaluateForTestInFrontend):
(WebCore::InspectorController::ensureInspectorAgent):

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

4 months ago[Win] Use a bundled vswhere.exe instead of downloading by update-vswhere.py
Hironori.Fujii@sony.com [Thu, 11 Apr 2019 00:08:34 +0000 (00:08 +0000)]
[Win] Use a bundled vswhere.exe instead of downloading by update-vswhere.py
https://bugs.webkit.org/show_bug.cgi?id=196760

Reviewed by Don Olmstead.

vswhere.exe has been bundled since Visual Studio 2017 version
15.2. We shouldn't download vswhere.exe.

* Scripts/build-jsc: Do not call update-vswhere.py.
* Scripts/build-webkit: Ditto.
* Scripts/update-vswhere.py: Removed.
* Scripts/webkitdirs.pm:
(requireModulesForVSWhere): Deleted.
(pickCurrentVisualStudioInstallation): Deleted.
(visualStudioInstallDirVSWhere): Return the latest installed VS
installation path by using the bundled vswhere.exe.
(setupCygwinEnv): Removed a unused variable $visualStudioPath.
(visualStudioInstallDirFallback): Removed.

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

4 months agoUnreviewed, rolling out r244146.
cdumez@apple.com [Wed, 10 Apr 2019 23:57:30 +0000 (23:57 +0000)]
Unreviewed, rolling out r244146.

Caused a few DeviceOrientation API test failures on iOS

Reverted changeset:

"Unable to run system Safari with trunk WebKit"
https://bugs.webkit.org/show_bug.cgi?id=196777
https://trac.webkit.org/changeset/244146

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

4 months agoRemove unneeded extern C
megan_gardner@apple.com [Wed, 10 Apr 2019 23:35:52 +0000 (23:35 +0000)]
Remove unneeded extern C
https://bugs.webkit.org/show_bug.cgi?id=196786

Reviewed by Tim Horton.

No tests needed, just needs to compile.

Removing staging hack for Reveal framework.

* editing/cocoa/DictionaryLookup.mm:

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

4 months ago[ Mojave WK2 iOS Sim ] Layout Test http/wpt/cache-storage/quota-third-party.https...
youenn@apple.com [Wed, 10 Apr 2019 23:18:29 +0000 (23:18 +0000)]
[ Mojave WK2 iOS Sim ] Layout Test http/wpt/cache-storage/quota-third-party.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196358
<rdar://problem/49388128>

Unreviewed.

* platform/ios-simulator-wk2/TestExpectations:
Mark test as slow.

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

4 months agoWeb Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can...
drousso@apple.com [Wed, 10 Apr 2019 23:15:08 +0000 (23:15 +0000)]
Web Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can be accessed before being created
https://bugs.webkit.org/show_bug.cgi?id=196725
<rdar://problem/49669810>

Reviewed by Timothy Hatcher.

Source/WebCore:

Move the logic for creating the `InspectorPageAgent` and `InspectorDOMAgent` into separate
functions so that callers into `InspectorController` can be guaranteed to have a valid
instance of the agent.

This doesn't interfere with the `Page.enable` command, as it doesn't clear any saved state.
There is no `DOM.enable` command, so there's no issue there either.

* inspector/InspectorController.h:
(WebCore::InspectorController::pageAgent): Deleted.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::createLazyAgents):
(WebCore::InspectorController::inspect):
(WebCore::InspectorController::hideHighlight):
(WebCore::InspectorController::ensureDOMAgent): Added.
(WebCore::InspectorController::ensurePageAgent): Added.

* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):

Source/WebKit:

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::showMainResourceForFrame):

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

4 months ago[ews-build] PrintConfiguration should display Xcode version instead of SDKVersion
aakash_jain@apple.com [Wed, 10 Apr 2019 23:04:14 +0000 (23:04 +0000)]
[ews-build] PrintConfiguration should display Xcode version instead of SDKVersion
https://bugs.webkit.org/show_bug.cgi?id=196780

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/ews-build/steps.py:
* BuildSlaveSupport/ews-build/steps_unittest.py:

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

4 months agoWork around an arm64_32 LLVM miscompile bug
sbarati@apple.com [Wed, 10 Apr 2019 23:02:11 +0000 (23:02 +0000)]
Work around an arm64_32 LLVM miscompile bug
https://bugs.webkit.org/show_bug.cgi?id=196788

Reviewed by Yusuke Suzuki.

* runtime/CachedTypes.cpp:

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

4 months agoClear Cache Storage structures before removing all related files
youenn@apple.com [Wed, 10 Apr 2019 22:59:14 +0000 (22:59 +0000)]
Clear Cache Storage structures before removing all related files
https://bugs.webkit.org/show_bug.cgi?id=196650

Reviewed by Alex Christensen.

Previously, we were clearing files in parallel to clearing the internal CacheStorage structures.
To make things more deterministic, clear files/folders directly
after CachesStorage structures have finished being cleared.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::clearAllCaches):
(WebKit::CacheStorage::Engine::clearCachesForOrigin):

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

4 months agoAdd SPI WKNavigationResponse._downloadAttribute
commit-queue@webkit.org [Wed, 10 Apr 2019 22:56:35 +0000 (22:56 +0000)]
Add SPI WKNavigationResponse._downloadAttribute
https://bugs.webkit.org/show_bug.cgi?id=196755
<rdar://49587365>

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

Source/WebCore:

Covered by an API test that validates the attribute is correctly sent through the FrameLoader to the API.
When a user clicks on a link with a download attribute, the download attribute should be used as the suggested filename sometimes.
The application needs this information after it has received the response in order to make fully informed decisions about downloads.
In order to get this attribute to the decidePolicyForNavigationResponse, we need to store the attribute on the DocumentLoader
from the FrameLoadRequest then send it from the DocumentLoader when the response is received.

* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setDownloadAttribute):
(WebCore::DocumentLoader::downloadAttribute const):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkContentPolicy):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadPostRequest):
* loader/FrameLoader.h:
(WebCore::FrameLoader::loadWithNavigationAction):
* loader/FrameLoaderClient.h:

Source/WebKit:

* UIProcess/API/APINavigationResponse.h:
* UIProcess/API/Cocoa/WKNavigationResponse.mm:
(-[WKNavigationResponse _downloadAttribute]):
* UIProcess/API/Cocoa/WKNavigationResponsePrivate.h:
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::decidePolicyForResponse):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDecidePolicyForResponse):

Source/WebKitLegacy/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDecidePolicyForResponse):
* WebCoreSupport/WebFrameLoaderClient.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm:
(-[NavigationResponseTestDelegate navigationResponse]):
(-[NavigationResponseTestDelegate waitForNavigationResponseCallback]):
(-[NavigationResponseTestDelegate waitForNavigationFinishedCallback]):
(-[NavigationResponseTestDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[NavigationResponseTestDelegate webView:didFinishNavigation:]):
(-[NavigationResponseTestDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(readRequest):
(writeResponse):
(TEST):

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

4 months agoSWClientConnection should not double hop to fire some events
youenn@apple.com [Wed, 10 Apr 2019 22:55:01 +0000 (22:55 +0000)]
SWClientConnection should not double hop to fire some events
https://bugs.webkit.org/show_bug.cgi?id=196735

Reviewed by Alex Christensen.

Source/WebCore:

Some events, like postMessage in service workers is hopping from main thread to service worker thread to dispatch events.
Some other events, like service worker state update, are hopping from main thread to service worker thread, then posting a task to dispatch events.
This may create ordering problems.

To fix the issue, we now hop to the service worker thread and dispatch the events.
In addition, for documents, we post a task and do the whole service worker processing in it.
This ensures that some tests, like whether there is a service worker container,
or creation of a service worker are done consistently.

Covered by unflaked test.

* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::updateRegistrationState):
(WebCore::SWClientConnection::updateWorkerState):
(WebCore::SWClientConnection::fireUpdateFoundEvent):
(WebCore::SWClientConnection::notifyClientsOfControllerChange):
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::updateState):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::updateRegistrationState):
(WebCore::ServiceWorkerContainer::fireUpdateFoundEvent):
(WebCore::ServiceWorkerContainer::fireControllerChangeEvent):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::notifyFinished):
Notify of the script URL in the error message.
This will help diagnose flakiness issues.
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::fireUpdateFoundEvent):
* workers/service/ServiceWorkerRegistration.h:

Source/WebKit:

Removed unnecessary method.

* WebProcess/Storage/WebSWClientConnection.cpp:
* WebProcess/Storage/WebSWClientConnection.h:

LayoutTests:

* platform/mac-wk2/TestExpectations:

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

4 months ago[iOS] Fix iokit-get-properties sandbox violations
pvollan@apple.com [Wed, 10 Apr 2019 22:50:04 +0000 (22:50 +0000)]
[iOS] Fix iokit-get-properties sandbox violations
https://bugs.webkit.org/show_bug.cgi?id=196782
<rdar://problem/49497720>

Reviewed by Brent Fulgham.

Add iokit properties to the WebContent sandbox on iOS.

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

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

4 months agoWeb Inspector: Timelines: can't reliably stop/start a recording
drousso@apple.com [Wed, 10 Apr 2019 22:48:54 +0000 (22:48 +0000)]
Web Inspector: Timelines: can't reliably stop/start a recording
https://bugs.webkit.org/show_bug.cgi?id=196778
<rdar://problem/47606798>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/ScriptProfiler.json:
* inspector/protocol/Timeline.json:
It is possible to determine when programmatic capturing starts/stops in the frontend based
on the state when the backend causes the state to change, such as if the state is "inactive"
when the frontend is told that the backend has started capturing.

* inspector/protocol/CPUProfiler.json:
* inspector/protocol/Memory.json:
Send an end timestamp to match other instruments.

* inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::startConsoleProfile):
(Inspector::JSGlobalObjectConsoleClient::stopConsoleProfile):

* inspector/agents/InspectorScriptProfilerAgent.h:
* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
(Inspector::InspectorScriptProfilerAgent::programmaticCaptureStarted): Deleted.
(Inspector::InspectorScriptProfilerAgent::programmaticCaptureStopped): Deleted.

Source/WebCore:

* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::startProgrammaticCapture):
(WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
It is possible to determine when programmatic capturing starts/stops in the frontend based
on the state when the backend causes the state to change, such as if the state is "inactive"
when the frontend is told that the backend has started capturing.

* inspector/agents/InspectorCPUProfilerAgent.cpp:
(WebCore::InspectorCPUProfilerAgent::stopTracking):
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::stopTracking):
Send an end timestamp to match other instruments.

Source/WebInspectorUI:

Rather than have a binary state of capturing/not-capturing, we should use a four state:
 1. inactive (when the backend has stopped capturing)
 2. starting (when the frontend requests capturing to start)
 3. active (when the backend has started capturing)
 4. stopping (when the frontend requests capturing to stop)

Capturing is considered "on" when not in an "inactive" state. Prevent the frontend from
starting/stopping capturing unless we're in a "stable" ("inactive" or "active") state, not a
"transition" ("starting" or "stopping") state.

One "side effect" of this change is that since the capturing is considered active until the
backend has stopped capturing, we will continue to process records in the frontend even if
the frontend has requested to stop capturing. <https://webkit.org/b/152904>

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager):
(WI.TimelineManager.prototype.get capturingState): Added.
(WI.TimelineManager.prototype.reset):
(WI.TimelineManager.prototype.get activeRecording):
(WI.TimelineManager.prototype.set autoCaptureOnPageLoad):
(WI.TimelineManager.prototype.isCapturing):
(WI.TimelineManager.prototype.startCapturing):
(WI.TimelineManager.prototype.stopCapturing):
(WI.TimelineManager.prototype.processJSON):
(WI.TimelineManager.prototype.capturingStarted):
(WI.TimelineManager.prototype.capturingStopped):
(WI.TimelineManager.prototype.autoCaptureStarted):
(WI.TimelineManager.prototype.eventRecorded):
(WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
(WI.TimelineManager.prototype.pageLoadEventFired):
(WI.TimelineManager.prototype.cpuProfilerTrackingUpdated):
(WI.TimelineManager.prototype.cpuProfilerTrackingCompleted):
(WI.TimelineManager.prototype.memoryTrackingUpdated):
(WI.TimelineManager.prototype.memoryTrackingCompleted):
(WI.TimelineManager.prototype.heapTrackingStarted):
(WI.TimelineManager.prototype.heapTrackingCompleted):
(WI.TimelineManager.prototype.heapSnapshotAdded):
(WI.TimelineManager.prototype._updateCapturingState): Added.
(WI.TimelineManager.prototype._processRecord):
(WI.TimelineManager.prototype._processEvent):
(WI.TimelineManager.prototype._loadNewRecording):
(WI.TimelineManager.prototype._addRecord):
(WI.TimelineManager.prototype._attemptAutoCapturingForFrame):
(WI.TimelineManager.prototype._legacyAttemptStartAutoCapturingForFrame):
(WI.TimelineManager.prototype._stopAutoRecordingSoon):
(WI.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
(WI.TimelineManager.prototype._mainResourceDidChange):
(WI.TimelineManager.prototype._resourceWasAdded):
(WI.TimelineManager.prototype._garbageCollected):
(WI.TimelineManager.prototype._memoryPressure):
(WI.TimelineManager.prototype._handleTimelinesAutoStopSettingChanged):
(WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
(WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
(WI.TimelineManager.prototype._handleDOMNodeLowPowerChanged):
(WI.TimelineManager.prototype.unloadRecording): Deleted.
(WI.TimelineManager.prototype.programmaticCaptureStarted): Deleted.
(WI.TimelineManager.prototype.programmaticCaptureStopped): Deleted.
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStarted): Deleted.
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStopped): Deleted.

* UserInterface/Protocol/ScriptProfilerObserver.js:
(WI.ScriptProfilerObserver.prototype.trackingComplete):
(WI.ScriptProfilerObserver.prototype.programmaticCaptureStarted):
(WI.ScriptProfilerObserver.prototype.programmaticCaptureStopped):
* UserInterface/Protocol/TimelineObserver.js:
(WI.TimelineObserver.prototype.programmaticCaptureStarted):
(WI.TimelineObserver.prototype.programmaticCaptureStopped):
It is possible to determine when programmatic capturing starts/stops in the frontend based
on the state when the backend causes the state to change, such as if the state is "inactive"
when the frontend is told that the backend has started capturing.

* UserInterface/Protocol/CPUProfilerObserver.js:
(WI.CPUProfilerObserver.prototype.trackingComplete):
* UserInterface/Protocol/MemoryObserver.js:
(WI.MemoryObserver.prototype.trackingComplete):
Send an end timestamp to match other instruments.

* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype._handleTimelineCapturingStateChanged): Added.
(WI.DebuggerManager.prototype._timelineCapturingWillStart): Deleted.
(WI.DebuggerManager.prototype._timelineCapturingStopped): Deleted.
* UserInterface/Models/DefaultDashboard.js:
(WI.DefaultDashboard):
(WI.DefaultDashboard.prototype._handleTimelineCapturingStateChanged): Added.
(WI.DefaultDashboard.prototype._capturingStopped): Deleted.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel):
(WI.DebuggerSidebarPanel.prototype._handleTimelineCapturingStateChanged): Added.
(WI.DebuggerSidebarPanel.prototype._timelineCapturingWillStart): Deleted.
(WI.DebuggerSidebarPanel.prototype._timelineCapturingStopped): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStateChanged): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingWillStart): Deleted.
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStopped): Deleted.
* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview):
(WI.TimelineOverview.prototype._handleTimelineCapturingStateChanged): Added.
(WI.TimelineOverview.prototype._capturingStarted): Deleted.
(WI.TimelineOverview.prototype._capturingStopped): Deleted.
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._handleTimelineCapturingStateChanged): Added.
(WI.TimelineRecordingContentView.prototype._recordingUnloaded):
(WI.TimelineRecordingContentView.prototype._capturingStarted): Deleted.
(WI.TimelineRecordingContentView.prototype._capturingStopped): Deleted.
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView):
(WI.TimelineTabContentView.prototype._handleTimelineCapturingStateChanged): Added.
(WI.TimelineTabContentView.prototype._capturingStartedOrStopped): Deleted.
Use the new single event for all Timelines capture state changes.
Prevent the record button from being clicked when capturing is in a transition state.

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

4 months agoWeb Inspector: REGRESSION: Audit: result UI shown on first open if an audit was previ...
drousso@apple.com [Wed, 10 Apr 2019 22:47:26 +0000 (22:47 +0000)]
Web Inspector: REGRESSION: Audit: result UI shown on first open if an audit was previously selected
https://bugs.webkit.org/show_bug.cgi?id=196723
<rdar://problem/49722252>

Reviewed by Timothy Hatcher.

When opening Web Inspector for the first time, we will trigger resize `layout`s on the main
content area as Web Inspector is resized to it's old window size.

Rather than treating this layout as a `View.LayoutReason.Resize`, we should treat the
first `layout` (e.g. `initialLayout`) as a `View.LayoutReason.Dirty` instead, as there was
previously no content.

* UserInterface/Views/View.js:
(WI.View.prototype._layoutSubtree):
(WI.View.prototype._setLayoutReason):

* UserInterface/Views/AuditTestContentView.js:
(WI.AuditTestContentView):
Drive-by: ensure that this class is not instantiated directly.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244157 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: Debugger: current call frame indicator is indented when there is more...
drousso@apple.com [Wed, 10 Apr 2019 22:47:02 +0000 (22:47 +0000)]
Web Inspector: Debugger: current call frame indicator is indented when there is more than one thread
https://bugs.webkit.org/show_bug.cgi?id=196580
<rdar://problem/49582138>

Reviewed by Timothy Hatcher.

* UserInterface/Views/CallFrameTreeElement.css:
(.tree-outline .item.call-frame .status):
(.tree-outline.single-thread .item.call-frame .status): Added.

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

4 months agoWeb Inspector: REGRESSION (r238602): Elements: deleting the last child of a collapsed...
drousso@apple.com [Wed, 10 Apr 2019 22:44:50 +0000 (22:44 +0000)]
Web Inspector: REGRESSION (r238602): Elements: deleting the last child of a collapsed parent selects the parent's next sibling
https://bugs.webkit.org/show_bug.cgi?id=192711
<rdar://problem/46738990>

Reviewed by Timothy Hatcher.

Original patch by Matt Baker <mattbaker@apple.com>.

Source/WebInspectorUI:

* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController.prototype.removeSelectedItems):
When looking for a new item to select, start with the item preceding the
selection, instead of the item following the selection. This matches
pre-multiple selection behavior, as well as Mail and Xcode.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.onexpand):
Drive-by fix: when a hidden node is selected, its selection area is drawn
with a height of 0px. Update the selection area once the hidden node's
parent is expanded. AFAIK, this has always been broken.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.ondelete):
After a delete the `SelectionController` may have chosen a child of a
collapsed parent as the new selected item. If the item isn't the closing tag (e.g. after
deleting the last child), reveal it.

(WI.DOMTreeOutline.prototype.selectionControllerPreviousSelectableItem):

* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.get previousSelectableSibling): Added.
(WI.TreeElement.prototype.get nextSelectableSibling): Added.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selectionControllerPreviousSelectableItem):
(WI.TreeOutline.prototype.selectionControllerNextSelectableItem):
Set `skipUnrevealed` to false, so that children of collapsed parent nodes
are considered when looking for an item to selected after a delete. Hidden `TreeElement`s
are still ignored as they aren't `selectable`.

LayoutTests:

* inspector/table/table-remove-rows.html:
* inspector/table/table-remove-rows-expected.txt:

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

4 months agoWeb Inspector: Elements tab: multiple selection lost after navigating to another tab
drousso@apple.com [Wed, 10 Apr 2019 22:44:11 +0000 (22:44 +0000)]
Web Inspector: Elements tab: multiple selection lost after navigating to another tab
https://bugs.webkit.org/show_bug.cgi?id=192681
<rdar://problem/46709392>

Reviewed by Timothy Hatcher.

Orginal patch by Matt Baker <mattbaker@apple.com>.

Source/WebInspectorUI:

* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController.prototype.selectItem):
Simplify internal logic by removing an early return.

(WI.SelectionController.prototype.selectItems): Added.
(WI.SelectionController.prototype.selectAll):
Provide a means to select multiple items in a single operation.
If `_lastSelectedItem` is not in the items to select, the last
item being selected will become the last selected item.

(WI.SelectionController.prototype._deselectAllAndSelect):
Drive-by fix: correct a logic error. If no items are selected, the item
passed as an argument should still become selected.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selectTreeElements): Added.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement):
(WI.DOMTreeElement.prototype.get closeTagTreeElement): Added.
(WI.DOMTreeElement.prototype._updateChildren):
Make the close tag `TreeElement` available from the open tag `TreeElement`.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.update):
Restore selected `TreeElement`s after updating.

* UserInterface/Base/Utilities.js:
* UserInterface/Test.html:

LayoutTests:

* inspector/tree-outline/tree-outline-selection.html: Added.
* inspector/tree-outline/tree-outline-selection-expected.txt: Added.
Add `TreeOutline` tests for single and multiple selection.

* inspector/unit-tests/set-utilities.html:
* inspector/unit-tests/set-utilities-expected.txt:
Add tests for `Set.prototype.lastValue`.

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

4 months agoAdd modern API for overriding the page's specified viewport configuration
timothy_horton@apple.com [Wed, 10 Apr 2019 21:32:58 +0000 (21:32 +0000)]
Add modern API for overriding the page's specified viewport configuration
https://bugs.webkit.org/show_bug.cgi?id=167734
<rdar://problem/30331795>

Reviewed by Simon Fraser.

Source/WebCore:

New API test: WebKit.OverrideViewportArguments

* dom/Document.cpp:
(WebCore::Document::updateViewportArguments):
* dom/Document.h:
(WebCore::Document::viewportArguments const):
Make the viewportArguments() getter respect the overridden arguments.

* dom/ViewportArguments.cpp:
(WebCore::numericPrefix):
(WebCore::findSizeValue):
(WebCore::findScaleValue):
(WebCore::findBooleanValue):
(WebCore::parseViewportFitValue):
(WebCore::viewportErrorMessage):
(WebCore::reportViewportWarning):
(WebCore::setViewportFeature):
* dom/ViewportArguments.h:
Make it possible to parse ViewportArguments without a Document, so
that it can be used in the UI process. We only used the Document for
two things: error reporting, and getting the state of one setting.
Refactor error handling to use a passed-arund function, and add a
variant of setViewportFeature() that doesn't take a Document.

Source/WebKit:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Plumb overrideViewportArguments in WebPageCreationParameters, so that
if the process crashes (or swaps) they are maintained.

* UIProcess/API/Cocoa/WKWebView.mm:
(viewportArgumentsFromDictionary):
(-[WKWebView _overrideViewportWithArguments:]):
Add SPI to set override viewport arguments. Parse them into a ViewportArguments
object and use the existing (now improved) overrideViewportArguments mechanism
to take over the page's viewport arguments.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setOverrideViewportArguments):
* WebProcess/WebPage/WebPage.cpp:
Plumb overrideViewportArguments around more.

Tools:

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

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

4 months agoLayout Test http/wpt/fetch/response-opaque-clone.html is sometimes timing out on...
youenn@apple.com [Wed, 10 Apr 2019 21:16:42 +0000 (21:16 +0000)]
Layout Test http/wpt/fetch/response-opaque-clone.html is sometimes timing out on iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=194525
<rdar://problem/48012229>

Reviewed by Alex Christensen.

Test is no longer flaky on MacOS.
As per flakiness dashboard, it sometimes times out on iOS simulator.
It sometimes passes after running for 20 seconds.
Mark it as Slow and improve the test to output more sub-tests.
Removed unnecessary removal of cache since test runner will clear them at the end of the test.

* http/wpt/fetch/response-opaque-clone-expected.txt:
* http/wpt/fetch/response-opaque-clone.html:
* platform/ios-simulator-wk2/TestExpectations:

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

4 months agoUnreviewed, fix watch build after r244143
tzagallo@apple.com [Wed, 10 Apr 2019 21:15:18 +0000 (21:15 +0000)]
Unreviewed, fix watch build after r244143
https://bugs.webkit.org/show_bug.cgi?id=195000

The result of `lseek` should be `off_t` rather than `int`.

* jsc.cpp:

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

4 months agoAdd runJavaScriptInFrame for WebPageProxy/WebPage
jiewen_tan@apple.com [Wed, 10 Apr 2019 20:49:23 +0000 (20:49 +0000)]
Add runJavaScriptInFrame for WebPageProxy/WebPage
https://bugs.webkit.org/show_bug.cgi?id=196750
<rdar://problem/49755738>

Reviewed by Youenn Fablet.

Tests of the new method will be covered by the internal counterpart.

* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::loadData):
* UIProcess/WebFrameProxy.h:
Add a comment.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runJavaScriptInMainFrame):
(WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
Merge the above two runJavaScriptInMainFrame*.
(WebKit::WebPageProxy::runJavaScriptInFrame):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadDataInFrame):
Add an assertion.
(WebKit::WebPage::runJavaScript):
(WebKit::WebPage::runJavaScriptInMainFrameScriptWorld):
(WebKit::WebPage::runJavaScriptInFrame):
(WebKit::WebPage::runJavaScriptInMainFrame): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

4 months ago[Web GPU] Indexed drawing and GPUCommandEncoder crash prevention
justin_fan@apple.com [Wed, 10 Apr 2019 20:48:38 +0000 (20:48 +0000)]
[Web GPU] Indexed drawing and GPUCommandEncoder crash prevention
https://bugs.webkit.org/show_bug.cgi?id=196758

Reviewed by Dean Jackson.

Source/WebCore:

Test: webgpu/draw-indexed-triangles.html

Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed to enable indexed drawing.
Disable GPUCommandEncoders with active pass encoders from being submitted or encoding blits.

Prevent active GPUCommandEncoders from being submitted or encoding blit commands:
* Modules/webgpu/WebGPUCommandEncoder.cpp:
(WebCore::WebGPUCommandEncoder::finish):
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::copyBufferToBuffer):
(WebCore::GPUCommandBuffer::copyBufferToTexture):
(WebCore::GPUCommandBuffer::copyTextureToBuffer):
(WebCore::GPUCommandBuffer::copyTextureToTexture):

Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setIndexBuffer):
(WebCore::WebGPURenderPassEncoder::setVertexBuffers): Remove unnecessary move operations.
(WebCore::WebGPURenderPassEncoder::drawIndexed): Added.
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::isIndex const):
* platform/graphics/gpu/GPUInputStateDescriptor.h:
* platform/graphics/gpu/GPURenderPassEncoder.h: Cache the index buffer, as Metal does not set the index buffer separate from the draw call.
* platform/graphics/gpu/GPURenderPipeline.h:
(WebCore::GPURenderPipeline::indexFormat const):
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setIndexBuffer):
(WebCore::GPURenderPassEncoder::setVertexBuffers):
(WebCore::mtlPrimitiveTypeForGPUPrimitiveTopology):
(WebCore::GPURenderPassEncoder::draw):
(WebCore::mtlIndexTypeForGPUIndexFormat): Added.
(WebCore::GPURenderPassEncoder::drawIndexed): Added.
(WebCore::primitiveTypeForGPUPrimitiveTopology): Deleted.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::GPURenderPipeline):

LayoutTests:

Add draw-indexed-triangles to test drawing a green square using GPURenderPassEncoder::setIndexBuffer and drawIndexed.

* webgpu/draw-indexed-triangles-expected.html: Added.
* webgpu/draw-indexed-triangles.html: Added.

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

4 months agoUnable to run system Safari with trunk WebKit
cdumez@apple.com [Wed, 10 Apr 2019 20:44:34 +0000 (20:44 +0000)]
Unable to run system Safari with trunk WebKit
https://bugs.webkit.org/show_bug.cgi?id=196777
<rdar://problem/49784574>

Reviewed by Alex Christensen.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
Add a linkedOnAfter check so that throwing exceptions when related web views use a different
data store only happens for apps rebuilt using recent SDK.

* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/Cocoa/VersionChecks.mm:
(WebKit::linkedOnOrAfter):
- By default, linkedOnOrAfter assumed Safari / MobileSafari is always linked-on-after. To satisfy my
  use cases, I introduced a new AssumeSafariIsAlwaysLinkedOnAfter parameter so that this behavior can
  be controlled by the caller.
- In the header, DYLD_IOS_VERSION_* / DYLD_MACOS_VERSION_* constants are 0 when building with the
  non-internal SDK. As a result, the check instead linkedOnOrAfter() would cause us to always return
  true, which was wrong. I therefore updated the check inside linkedOnOrAfter() to special-case the
  0 value for sdkVersion.

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

4 months agoOfflineAudioDestinationNode::startRendering leaks OfflineAudioDestinationNode if...
rniwa@webkit.org [Wed, 10 Apr 2019 20:31:04 +0000 (20:31 +0000)]
OfflineAudioDestinationNode::startRendering leaks OfflineAudioDestinationNode if offlineRender exists early
https://bugs.webkit.org/show_bug.cgi?id=196759

Reviewed by Eric Carlson.

OfflineAudioDestinationNode::startRendering unconditionally ref's itself before invoking offlineRender() in a new thread.
But offlineRender can early exit without ever calling deref() in the main thread, leading to the leak of
OfflineAudioDestinationNode. Fixed the leak by always calling deref in the main thread after calling offlineRender().

Also removed the debug assertion in offlineRender which always hits when we run the relevant test.

Test: imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html

* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::startRendering):
(WebCore::OfflineAudioDestinationNode::offlineRender):
(WebCore::OfflineAudioDestinationNode::notifyComplete): Merged into startRendering.
* Modules/webaudio/OfflineAudioDestinationNode.h:

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

4 months agoRegression(r240562) Audio sometimes keeps playing in previous process after a process...
cdumez@apple.com [Wed, 10 Apr 2019 19:56:44 +0000 (19:56 +0000)]
Regression(r240562) Audio sometimes keeps playing in previous process after a process-swap
https://bugs.webkit.org/show_bug.cgi?id=196774
<rdar://problem/49460572>

Reviewed by Alex Christensen.

r240562 added logic to prevent flashing on navigation. When we receive the DidFailToSuspendAfterProcessSwap
IPC from the previous process, we would delay closing the WebPage in that process until EnterAcceleratedCompositingMode
IPC is received from the new process. The issue is that this was racy as we would receive the EnterAcceleratedCompositingMode
IPC from the new process *before* receiving the DidFailToSuspendAfterProcessSwap IPC from the previous process, which which
case we would fail to close the WebPage and audio could keep playing.

To address the issue, the WebPageProxy keeps track of its last suspended page and notifies it whenever it receives the
EnterAcceleratedCompositingMode IPC. If the suspended page already received the DidFailToSuspendAfterProcessSwap IPC, it
will close the page. Otherwise, it will set a boolean data member indicating that we should not delay page closing when
the DidFailToSuspendAfterProcessSwap is eventually received.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
* UIProcess/WebProcessPool.h:

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

4 months agoAdd support for incremental bytecode cache updates
tzagallo@apple.com [Wed, 10 Apr 2019 19:18:20 +0000 (19:18 +0000)]
Add support for incremental bytecode cache updates
https://bugs.webkit.org/show_bug.cgi?id=195000

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Add support for incremental updates to the bytecode cache. The cache
is constructed as follows:
- When the cache is empty, the initial payload can be added to the BytecodeCache
by calling BytecodeCache::addGlobalUpdate. This represents the encoded
top-level UnlinkedCodeBlock.
- Afterwards, updates can be added by calling BytecodeCache::addFunctionUpdate.
The update is applied by appending the encoded UnlinkedFunctionCodeBlock
to the existing cache and updating the CachedFunctionExecutableMetadata
and the offset of the new CachedFunctionCodeBlock in the owner CachedFunctionExecutable.

* API/JSScript.mm:
(-[JSScript readCache]):
(-[JSScript isUsingBytecodeCache]):
(-[JSScript init]):
(-[JSScript cachedBytecode]):
(-[JSScript writeCache:]):
* API/JSScriptInternal.h:
* API/JSScriptSourceProvider.h:
* API/JSScriptSourceProvider.mm:
(JSScriptSourceProvider::cachedBytecode const):
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
* jsc.cpp:
(ShellSourceProvider::~ShellSourceProvider):
(ShellSourceProvider::cachePath const):
(ShellSourceProvider::loadBytecode const):
(ShellSourceProvider::ShellSourceProvider):
(ShellSourceProvider::cacheEnabled):
* parser/SourceProvider.h:
(JSC::SourceProvider::cachedBytecode const):
(JSC::SourceProvider::updateCache const):
(JSC::SourceProvider::commitCachedBytecode const):
* runtime/CachePayload.cpp: Copied from Source/JavaScriptCore/API/JSScriptInternal.h.
(JSC::CachePayload::makeMappedPayload):
(JSC::CachePayload::makeMallocPayload):
(JSC::CachePayload::makeEmptyPayload):
(JSC::CachePayload::CachePayload):
(JSC::CachePayload::~CachePayload):
(JSC::CachePayload::operator=):
(JSC::CachePayload::freeData):
* runtime/CachePayload.h: Copied from Source/JavaScriptCore/API/JSScriptInternal.h.
(JSC::CachePayload::data const):
(JSC::CachePayload::size const):
(JSC::CachePayload::CachePayload):
* runtime/CacheUpdate.cpp: Copied from Source/JavaScriptCore/API/JSScriptInternal.h.
(JSC::CacheUpdate::CacheUpdate):
(JSC::CacheUpdate::operator=):
(JSC::CacheUpdate::isGlobal const):
(JSC::CacheUpdate::asGlobal const):
(JSC::CacheUpdate::asFunction const):
* runtime/CacheUpdate.h: Copied from Source/JavaScriptCore/API/JSScriptInternal.h.
* runtime/CachedBytecode.cpp: Added.
(JSC::CachedBytecode::addGlobalUpdate):
(JSC::CachedBytecode::addFunctionUpdate):
(JSC::CachedBytecode::copyLeafExecutables):
(JSC::CachedBytecode::commitUpdates const):
* runtime/CachedBytecode.h: Added.
(JSC::CachedBytecode::create):
(JSC::CachedBytecode::leafExecutables):
(JSC::CachedBytecode::data const):
(JSC::CachedBytecode::size const):
(JSC::CachedBytecode::hasUpdates const):
(JSC::CachedBytecode::sizeForUpdate const):
(JSC::CachedBytecode::CachedBytecode):
* runtime/CachedTypes.cpp:
(JSC::Encoder::addLeafExecutable):
(JSC::Encoder::release):
(JSC::Decoder::Decoder):
(JSC::Decoder::create):
(JSC::Decoder::size const):
(JSC::Decoder::offsetOf):
(JSC::Decoder::ptrForOffsetFromBase):
(JSC::Decoder::addLeafExecutable):
(JSC::VariableLengthObject::VariableLengthObject):
(JSC::VariableLengthObject::buffer const):
(JSC::CachedPtrOffsets::offsetOffset):
(JSC::CachedWriteBarrierOffsets::ptrOffset):
(JSC::CachedFunctionExecutable::features const):
(JSC::CachedFunctionExecutable::hasCapturedVariables const):
(JSC::CachedFunctionExecutableOffsets::codeBlockForCallOffset):
(JSC::CachedFunctionExecutableOffsets::codeBlockForConstructOffset):
(JSC::CachedFunctionExecutableOffsets::metadataOffset):
(JSC::CachedFunctionExecutable::encode):
(JSC::CachedFunctionExecutable::decode const):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::encodeCodeBlock):
(JSC::encodeFunctionCodeBlock):
(JSC::decodeCodeBlockImpl):
(JSC::isCachedBytecodeStillValid):
* runtime/CachedTypes.h:
(JSC::VariableLengthObjectBase::VariableLengthObjectBase):
(JSC::decodeCodeBlock):
* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedGlobalCodeBlock):
(JSC::CodeCache::updateCache):
(JSC::CodeCache::write):
(JSC::writeCodeBlock):
(JSC::serializeBytecode):
* runtime/CodeCache.h:
(JSC::SourceCodeValue::SourceCodeValue):
(JSC::CodeCacheMap::findCacheAndUpdateAge):
(JSC::CodeCacheMap::fetchFromDiskImpl):
* runtime/Completion.cpp:
(JSC::generateProgramBytecode):
(JSC::generateModuleBytecode):
* runtime/Completion.h:
* runtime/LeafExecutable.cpp: Copied from Source/JavaScriptCore/API/JSScriptSourceProvider.mm.
(JSC::LeafExecutable::operator+ const):
* runtime/LeafExecutable.h: Copied from Source/JavaScriptCore/API/JSScriptSourceProvider.mm.
(JSC::LeafExecutable::LeafExecutable):
(JSC::LeafExecutable::base const):

Tools:

Exit when the initial run to generate bytecode fails.

* Scripts/jsc-stress-test-helpers/bytecode-cache-test-helper.sh:

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

4 months agoWKScrollView background color does not match WKWebView before content is loaded.
timothy@apple.com [Wed, 10 Apr 2019 18:51:28 +0000 (18:51 +0000)]
WKScrollView background color does not match WKWebView before content is loaded.
https://bugs.webkit.org/show_bug.cgi?id=196745
rdar://problem/49750810

Reviewed by Megan Gardner.

* UIProcess/API/Cocoa/WKWebView.mm:
(scrollViewBackgroundColor): Default to _contentView.backgroundColor on invalid base color.
(-[WKWebView _processDidExit]): Reset to _contentView.backgroundColor.
(-[WKWebView setBackgroundColor:]): Call _updateScrollViewBackground since it can use
_contentView.backgroundColor and it has changed.

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

4 months agoFix text autoscrolling when typing in modern webkit
megan_gardner@apple.com [Wed, 10 Apr 2019 18:47:25 +0000 (18:47 +0000)]
Fix text autoscrolling when typing in modern webkit
https://bugs.webkit.org/show_bug.cgi?id=196718
Source/WebCore:

<rdar://problem/49225507>

Reviewed by Tim Horton.

Tests: fast/events/autoscroll-when-input-is-offscreen.html
       fast/events/autoscroll-with-software-keyboard.html

We have been relying on UIKit to scroll editable text, but
since we cannot give them enough information for them to always
do the right thing, we should just do all the work in WebKit.
This has the added benifit of fixing some tricky autoscrolling
bugs that have cropped up recently.

* editing/Editor.cpp:
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::revealSelectionAfterEditingOperation):
We should be scrolling the main frame in WebKit. We have been relying on UIKit,
but we cannot give them enough information to guarantee a correct scroll, so just
do all the work in WebKit.
* page/FrameView.cpp:
(WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
Update to use the rect that is actually visible, accounting for the software keyboard.

Source/WebKit:

<rdar://problem/49225507>

Reviewed by Tim Horton.

For staging only. We need to turn off UIKit's scrolling behavior to land
the changes we are making. To keep from the build ever breaking,
I am temporarily circumventing the changes in UIKit. This will be removed
once the next UIKit submission happens.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKUIWKTextInteractionAssistant scrollSelectionToVisible]):
(-[WKContentView setUpTextSelectionAssistant]):

LayoutTests:

Reviewed by Tim Horton.

* fast/events/autoscroll-when-input-is-offscreen-expected.txt: Added.
* fast/events/autoscroll-when-input-is-offscreen.html: Added.
* fast/events/autoscroll-with-software-keyboard-expected.txt: Added.
* fast/events/autoscroll-with-software-keyboard.html: Added.

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

4 months ago[iOSMac] Opt into modern compatibility mode by default
wenson_hsieh@apple.com [Wed, 10 Apr 2019 18:45:04 +0000 (18:45 +0000)]
[iOSMac] Opt into modern compatibility mode by default
https://bugs.webkit.org/show_bug.cgi?id=196763
<rdar://problem/49038732>

Reviewed by Tim Horton.

Achieve this by limiting legacy compatibility mode by default to non-iOSMac iOS only.

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

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

4 months agoRemoteObjectRegistry message receiver should be removed when WebPage::close is called...
commit-queue@webkit.org [Wed, 10 Apr 2019 18:35:32 +0000 (18:35 +0000)]
RemoteObjectRegistry message receiver should be removed when WebPage::close is called instead of waiting until dealloc
https://bugs.webkit.org/show_bug.cgi?id=196744
<rdar://49415309>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-04-10
Reviewed by Chris Dumez.

Source/WebKit:

This is a similar problem to the one I fixed in r241306 so I piggy-backed on the same test.
When you do a cross site navigation but the previous page is in a suspended process then you navigate back,
you can get two WebPage objects in the same process with the same IDs.  WebPage::close has been called
on the old one which is supposed to make it so all the message receivers associated with it have been removed
so we don't have any loss of communication, but we missed the RemoteObjectRegistry messages, which are owned
by the ObjC bundle object wrapping the WebPage (which can keep it alive if a strong reference to it is held).
To fix the assertion that happens in this case and the resulting communication breakage, teach the WebPage about
these messages so it can tear down the message receiver with the others it removes at close time.

* Shared/API/Cocoa/RemoteObjectRegistry.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController dealloc]):
(-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]):
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::addRemoteObjectRegistry):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
* WebProcess/WebPage/WebPage.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/BundleRetainPagePlugIn.mm:
(-[BundleRetainPagePlugIn webProcessPlugIn:didCreateBrowserContextController:]):

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

4 months agoUnreviewed, rolling out r243989.
mcatanzaro@igalia.com [Wed, 10 Apr 2019 18:27:25 +0000 (18:27 +0000)]
Unreviewed, rolling out r243989.

Broke i686 builds

Reverted changeset:

"[CMake] Detect SSE2 at compile time"
https://bugs.webkit.org/show_bug.cgi?id=196488
https://trac.webkit.org/changeset/243989

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

4 months agoWe should clear m_needsOverflowCheck when hitting an exception in defineProperties...
rmorisset@apple.com [Wed, 10 Apr 2019 18:05:00 +0000 (18:05 +0000)]
We should clear m_needsOverflowCheck when hitting an exception in defineProperties in ObjectConstructor.cpp
https://bugs.webkit.org/show_bug.cgi?id=196746

JSTests:

Reviewed by Yusuke Suzuki.

* stress/cyclic-define-properties.js: Added.
(foo):

Source/JavaScriptCore:

Reviewed by Yusuke Suzuki..

It should be safe as in that case we are not completing the operation, and so not going to have any buffer overflow.

* runtime/ObjectConstructor.cpp:
(JSC::defineProperties):

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

4 months agoDo not generate empty unified sources when unified builds are disabled
csaavedra@igalia.com [Wed, 10 Apr 2019 17:53:21 +0000 (17:53 +0000)]
Do not generate empty unified sources when unified builds are disabled
https://bugs.webkit.org/show_bug.cgi?id=196767

Reviewed by Konstantin Tokarev.

If unified builds are disabled, the ruby script to generate them
is still used to list the sources that need to be
compiled. Currently, the script always generates bundled unified
sources, even if it's being used just to list all the sources. So
when the unified builds are disabled and no files are going to be
bundled, the script generates one empty file per bundle manager
(that is, one C++ and one ObjectiveC), that gets added to the
sources to be compiled.

* Scripts/generate-unified-source-bundles.rb: Only go through the
bundle managers file generation when not running in
PrintAllSources mode, to avoid generating empty bundle files.

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

4 months agoAdd a way to opt into modern compatibility mode in layout tests
wenson_hsieh@apple.com [Wed, 10 Apr 2019 17:46:44 +0000 (17:46 +0000)]
Add a way to opt into modern compatibility mode in layout tests
https://bugs.webkit.org/show_bug.cgi?id=196770
<rdar://problem/49777550>

Reviewed by Antoine Quint.

Add a new test option to enable modern compatibility mode in layout tests.

* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView):
(WTR::TestController::enableModernCompatibilityMode):

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

4 months agoTry to fix the 32-bit watchOS build.
aestes@apple.com [Wed, 10 Apr 2019 17:40:21 +0000 (17:40 +0000)]
Try to fix the 32-bit watchOS build.

* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView evaluateJavaScriptAndWaitForInputSessionToChange:]):

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

4 months agoUnreviewed, drop SuspendedPageProxy data member that is unused after r244075.
cdumez@apple.com [Wed, 10 Apr 2019 17:12:50 +0000 (17:12 +0000)]
Unreviewed, drop SuspendedPageProxy data member that is unused after r244075.

* UIProcess/SuspendedPageProxy.h:

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

4 months agoVersioning.
kocsen_chung@apple.com [Wed, 10 Apr 2019 17:05:18 +0000 (17:05 +0000)]
Versioning.

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

4 months agoWebCore should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
ross.kirsling@sony.com [Wed, 10 Apr 2019 16:53:41 +0000 (16:53 +0000)]
WebCore should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
https://bugs.webkit.org/show_bug.cgi?id=196762

Reviewed by Ryosuke Niwa.

* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/websockets/WebSocketFrame.cpp:
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::parentTable const):
* accessibility/AccessibilityObject.cpp:
* accessibility/AccessibilityRenderObject.cpp:
* animation/CSSAnimation.cpp:
* animation/DeclarativeAnimation.cpp:
* bindings/js/DOMGCOutputConstraint.h:
* bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::root):
(WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
(WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
* bindings/js/JSDOMConvertNumbers.cpp:
* bindings/js/JSDOMWindowCustom.cpp:
* bindings/js/JSExtendableMessageEventCustom.cpp:
* bindings/js/SerializedScriptValue.cpp:
* css/CSSFontFaceSource.cpp:
* css/CSSFontFaceSource.h:
* css/MediaQueryMatcher.h:
* css/parser/CSSPropertyParserHelpers.cpp:
* dom/DocumentParser.cpp:
* dom/EventPath.cpp:
* dom/MouseEvent.h:
* dom/SpectreGadget.cpp:
* dom/SpectreGadget.h:
* editing/ChangeListTypeCommand.cpp:
* editing/EditAction.cpp:
* editing/ReplaceSelectionCommand.cpp:
* editing/TextGranularity.h:
* html/HTMLFormControlsCollection.cpp:
* html/HTMLImageElement.cpp:
* html/canvas/CanvasRenderingContext2DBase.cpp:
* inspector/InspectorController.cpp:
* inspector/agents/InspectorApplicationCacheAgent.cpp:
* inspector/agents/InspectorCanvasAgent.cpp:
* inspector/agents/WebHeapAgent.cpp:
* inspector/agents/page/PageAuditAgent.cpp:
* inspector/agents/page/PageConsoleAgent.cpp:
* inspector/agents/page/PageNetworkAgent.cpp:
* inspector/agents/worker/WorkerAuditAgent.cpp:
* loader/CrossOriginAccessControl.h:
* loader/CrossOriginPreflightResultCache.h:
* loader/NavigationAction.cpp:
* loader/ResourceLoadObserver.cpp:
* page/FrameTree.cpp:
* page/IntersectionObserver.cpp:
* page/PageConfiguration.cpp:
* page/PerformanceResourceTiming.cpp:
* page/ResizeObservation.cpp:
* page/UndoManager.cpp:
* plugins/PluginData.cpp:
* rendering/Grid.h:
* rendering/GridBaselineAlignment.cpp:
* rendering/GridBaselineAlignment.h:
* rendering/GridLayoutFunctions.cpp:
* rendering/GridLayoutFunctions.h:
* rendering/GridTrackSizingAlgorithm.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
* rendering/RenderFlexibleBox.cpp:
* rendering/RenderIFrame.cpp:
* rendering/RenderLayerFilters.cpp:
* rendering/TextDecorationPainter.cpp:
* rendering/TextDecorationPainter.h:
* rendering/TextPainter.cpp:
* rendering/TextPainter.h:
* rendering/style/StyleRareNonInheritedData.cpp:
* rendering/style/StyleRareNonInheritedData.h:
* rendering/svg/SVGRenderSupport.h:
* rendering/updating/RenderTreeBuilder.cpp:
* rendering/updating/RenderTreeBuilderSVG.cpp:
* style/InlineTextBoxStyle.cpp:
* style/InlineTextBoxStyle.h:
* style/StylePendingResources.cpp:
* svg/SVGMatrix.h:
* svg/SVGViewSpec.h:
* svg/SVGZoomAndPan.h:
* workers/WorkerScriptLoader.cpp:
* workers/WorkerScriptLoader.h:
* workers/service/ServiceWorker.cpp:
* workers/service/ServiceWorkerClientData.cpp:
* workers/service/ServiceWorkerClients.cpp:
* workers/service/ServiceWorkerClients.h:
* workers/service/ServiceWorkerGlobalScope.cpp:
* workers/service/ServiceWorkerJob.cpp:
* workers/service/ServiceWorkerProvider.cpp:
* workers/service/context/ServiceWorkerFetch.cpp:
* workers/service/context/ServiceWorkerInspectorProxy.h:
* workers/service/context/ServiceWorkerThread.cpp:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
* workers/service/server/SWServerJobQueue.cpp:
* workers/service/server/SWServerToContextConnection.cpp:
* workers/service/server/SWServerWorker.cpp:
* workers/service/server/SWServerWorker.h:
* worklets/Worklet.h:

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

4 months agoEnable Pointer Events on watchOS
graouts@webkit.org [Wed, 10 Apr 2019 16:44:56 +0000 (16:44 +0000)]
Enable Pointer Events on watchOS
https://bugs.webkit.org/show_bug.cgi?id=196771
<rdar://problem/49040909>

Reviewed by Dean Jackson.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

4 months agoBackground tabs are not fully reactivated after a link is opened from an external...
beidson@apple.com [Wed, 10 Apr 2019 16:32:30 +0000 (16:32 +0000)]
Background tabs are not fully reactivated after a link is opened from an external application.
<rdar://problem/49533278> and https://bugs.webkit.org/show_bug.cgi?id=196705

Reviewed by Chris Dumez.

If an app unparents a WKWebView right after activation but before the "applicationWillEnterForeground" notification
is dispatched, then that WKWebView is in a broken state with a frozen layer tree.

The WKApplicationStateTrackingView logic needs to be a little more resilient.

* UIProcess/ios/WKApplicationStateTrackingView.mm:
(-[WKApplicationStateTrackingView willMoveToWindow:]): When clearing the window, remember the current background state.
(-[WKApplicationStateTrackingView didMoveToWindow]): If our last observed background state doesn't match the current
  background state then fake the relevant notification.
(-[WKApplicationStateTrackingView _applicationDidEnterBackground]): Remember that we've observed a backgrounding.
(-[WKApplicationStateTrackingView _applicationWillEnterForeground]): Remember that we've observed a foregrounding.

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

4 months agoDelay initialization of quota users until the first quota request
youenn@apple.com [Wed, 10 Apr 2019 16:30:58 +0000 (16:30 +0000)]
Delay initialization of quota users until the first quota request
https://bugs.webkit.org/show_bug.cgi?id=196467

Reviewed by Chris Dumez.

Source/WebCore:

Instead of triggering initialization of each user when being added,
delay initialization until the first call to requestSpace with a non zero task size.
This will make sure we do not load Cache API information in memory or check for
IDB space until actually necessary.

To implement that, move from a HashSet of being initialized users to a HashMap where the key is user and
the value is the user initialization state.

When removing a user, delay the call to processPendingRequest so that a synchronous call to addUser
can be taken into consideration.

This unflakes some Cache API tests as these tests do clear the Cache API and check for the clearing result.
Clearing the caches triggers a removeUser/addUser dance which then triggers initialization of the Caches structure.

Covered by existing tests.

* storage/StorageQuotaManager.cpp:
(WebCore::StorageQuotaManager::initializeUsersIfNeeded):
(WebCore::StorageQuotaManager::askUserToInitialize):
(WebCore::StorageQuotaManager::addUser):
(WebCore::StorageQuotaManager::requestSpace):
* storage/StorageQuotaManager.h:

LayoutTests:

Unflake cache storage tests.

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

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

4 months agothere is no vp8 support in youtube.com/html5 page with libwebkit2gtk 2.24 (MSE enabled)
philn@webkit.org [Wed, 10 Apr 2019 13:46:01 +0000 (13:46 +0000)]
there is no vp8 support in youtube.com/html5 page with libwebkit2gtk 2.24 (MSE enabled)
https://bugs.webkit.org/show_bug.cgi?id=196615

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Add vp8.0 and vp9.0 in supported mime-types if the corresponding video decoders are found.

No new tests, existing web-platform-tests cover this change.

* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::initialize):

LayoutTests:

Update WPE baselines and add/unskip the
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType.html test in GTK.

* platform/gtk/TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt: Copied from LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt.
* platform/wpe/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt:

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

4 months agoUnreviewed. Fix WPE accessibility tests after r244059.
philn@webkit.org [Wed, 10 Apr 2019 11:08:40 +0000 (11:08 +0000)]
Unreviewed. Fix WPE accessibility tests after r244059.

We are failing to load the injected bundle due to undefined symbol
AccessibilityUIElement::replaceTextInRange().

* WebKitTestRunner/InjectedBundle/wpe/AccessibilityUIElementWPE.cpp:
(WTR::AccessibilityUIElement::replaceTextInRange):

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

4 months ago[GStreamer] Adaptive streaming playback broken with GStreamer < 1.12
philn@webkit.org [Wed, 10 Apr 2019 09:14:18 +0000 (09:14 +0000)]
[GStreamer] Adaptive streaming playback broken with GStreamer < 1.12
https://bugs.webkit.org/show_bug.cgi?id=196765

Reviewed by Xabier Rodriguez-Calvar.

Without the following patch in gst-plugins-bad, the uridownloader
doesn't relay need-context messages to its parent, so in our case
the player can't share its context with secondary webkitwebsrc
elements and a RELEASE_ASSERT is hit in the WebProcess.

So the workaround is to use again webkit+ protocol prefixes for
GStreamer versions older than 1.12.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/8cf858fb27919e1d631223375f81b98055623733

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::convertToInternalProtocol):
(WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStart):
(webKitWebSrcGetProtocols):
(convertPlaybinURI):
(webKitWebSrcSetUri):
(CachedResourceStreamingClient::responseReceived):
(webKitSrcWouldTaintOrigin):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:

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

4 months ago[WPE] Avoid async IO starving timers
eocanha@igalia.com [Wed, 10 Apr 2019 08:55:55 +0000 (08:55 +0000)]
[WPE] Avoid async IO starving timers
https://bugs.webkit.org/show_bug.cgi?id=196733

Reviewed by Carlos Garcia Campos.

If AsyncIONetwork and DiskCacheRead priorities are higher than
MainThreadSharedTimer the timers get starved. This causes the NetworkProcess
to accumulate MB of data instead of handing it down to the WebProcess (done
using a Timer). This eventually causes an Out Of Memory kill on the
NetworkProcess on some embedded platforms with low memory limits.

This patch levels the three priorities to the same value, while still leaving
DiskCacheWrite with less priority than DiskCacheRead.

* wtf/glib/RunLoopSourcePriority.h: Changed RunLoopSourcePriority values for WPE.

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

4 months ago[ATK] Defer the emision of AtkObject::children-changed signal after layout is done
carlosgc@webkit.org [Wed, 10 Apr 2019 08:01:01 +0000 (08:01 +0000)]
[ATK] Defer the emision of AtkObject::children-changed signal after layout is done
https://bugs.webkit.org/show_bug.cgi?id=187948

Reviewed by Michael Catanzaro.

Source/WebCore:

The signal AtkObject::children-changed is emitted from AXObjectCache::attachWrapper() and
AXObjectCache::detachWrapper(). Both can be called in the middle of a layout, so we need to defer the emission
of the signal after the layout is done, to avoid other atk entry points from being called at that point, since
most of them update the backing store at the beginning.

Fixes: accessibility/children-changed-sends-notification.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::performDeferredCacheUpdate): Call platformPerformDeferredCacheUpdate().
* accessibility/AXObjectCache.h:
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::wrapperParent): Helper to get the AtkObject parent of a given WebKitAccessible.
(WebCore::AXObjectCache::detachWrapper): Add wrapper to m_deferredDetachedWrapperList.
(WebCore::AXObjectCache::attachWrapper): Add object to m_deferredAttachedWrapperObjectList.
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): Emit AtkObject::children-changed::add for objects
in m_deferredAttachedWrapperObjectList and AtkObject::children-changed::remove for wrappers in m_deferredDetachedWrapperList.
* accessibility/ios/AXObjectCacheIOS.mm:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
* accessibility/wpe/AXObjectCacheWPE.cpp:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):

LayoutTests:

Remove expectations of accessibility/children-changed-sends-notification.html that passes now.

* platform/gtk/TestExpectations:

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

4 months ago[WinCairo][MiniBrowser] Pull down menu "Disable JavaScript" doesn't work.
commit-queue@webkit.org [Wed, 10 Apr 2019 08:00:41 +0000 (08:00 +0000)]
[WinCairo][MiniBrowser] Pull down menu "Disable JavaScript" doesn't work.
https://bugs.webkit.org/show_bug.cgi?id=196727

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-04-10
Reviewed by Fujii Hironori.

* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::create):

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

4 months ago[ATK] Test accessibility/insert-children-assert.html is crashing since added in r216980
carlosgc@webkit.org [Wed, 10 Apr 2019 07:59:14 +0000 (07:59 +0000)]
[ATK] Test accessibility/insert-children-assert.html is crashing since added in r216980
https://bugs.webkit.org/show_bug.cgi?id=172281
<rdar://problem/37030990>

Reviewed by Joanmarie Diggs.

Source/WebCore:

The crash happens because at some point the test tries to get the anonymous block text, getting the RenderText as
first child and RenderFullScreen as last child and the latter doesn't have a node. This is because in atk we do
things differently, we don't include the static text elements individually, but parent element uses
textUnderElement() to get all the pieces together. We can just turn the asserts into actual nullptr checks.

Fixes: accessibility/insert-children-assert.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement const):

LayoutTests:

Update the test to expect the whole content text on atk and remove the test expectations.

* accessibility/insert-children-assert.html:
* platform/gtk/TestExpectations:

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

4 months agoUnreviewed, build fix for r244097
dpino@igalia.com [Wed, 10 Apr 2019 07:22:52 +0000 (07:22 +0000)]
Unreviewed, build fix for r244097

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::actualPrepareToSuspend):
(WebKit::NetworkProcess::resume):
Added guards for ENABLE(SERVICE_WORKER)

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

4 months ago[CMake] WEBKIT_COMPUTE_SOURCES should use the target's derived sources directory
don.olmstead@sony.com [Wed, 10 Apr 2019 01:28:33 +0000 (01:28 +0000)]
[CMake] WEBKIT_COMPUTE_SOURCES should use the target's derived sources directory
https://bugs.webkit.org/show_bug.cgi?id=196741

Reviewed by Michael Catanzaro.

WEBKIT_COMPUTE_SOURCES is using ${DERIVED_SOURCES_DIR} directly. Instead it should
rely on the directory specified by the target.

* Source/cmake/WebKitFS.cmake:
Add variables that can be expanded within CMake to the derived sources directory for
a target.

* Source/cmake/WebKitMacros.cmake:
Use variable expansion rather than ${DERIVED_SOURCES_DIR} to determine the target's
derived sources directory.

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

4 months ago[ews-build] Add unit tests for PrintConfiguration
aakash_jain@apple.com [Wed, 10 Apr 2019 01:06:42 +0000 (01:06 +0000)]
[ews-build] Add unit tests for PrintConfiguration
https://bugs.webkit.org/show_bug.cgi?id=196752

Reviewed by Dewei Zhu.

* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

4 months agoAdd Resource Load Statistics test case for Ping
wilander@apple.com [Wed, 10 Apr 2019 01:03:28 +0000 (01:03 +0000)]
Add Resource Load Statistics test case for Ping
https://bugs.webkit.org/show_bug.cgi?id=196748

Reviewed by Alex Christensen.

* http/tests/resourceLoadStatistics/ping-to-prevalent-resource-expected.txt: Added.
* http/tests/resourceLoadStatistics/ping-to-prevalent-resource.html: Added.

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

4 months agoUnreviewed build maintenance -- update .xcfilelists.
krollin@apple.com [Wed, 10 Apr 2019 00:35:18 +0000 (00:35 +0000)]
Unreviewed build maintenance -- update .xcfilelists.

Source/JavaScriptCore:

* DerivedSources-input.xcfilelist:

Source/WebCore:

* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:

Source/WebKit:

* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:

Tools:

* DumpRenderTree/DerivedSources-input.xcfilelist:
* DumpRenderTree/DerivedSources-output.xcfilelist:

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

4 months agoTurn on editing test that should pass now
megan_gardner@apple.com [Tue, 9 Apr 2019 23:56:37 +0000 (23:56 +0000)]
Turn on editing test that should pass now
https://bugs.webkit.org/show_bug.cgi?id=196747
<rdar://problem/38779179>

Reviewed by Tim Horton.

Just turning on a test that needed to be turns off for a while due to compatibility changes
with the system.

* platform/ios-wk2/TestExpectations:

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

4 months ago[AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide...
zalan@apple.com [Tue, 9 Apr 2019 23:42:18 +0000 (23:42 +0000)]
[AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide table
https://bugs.webkit.org/show_bug.cgi?id=196743
<rdar://problem/43897551>

Reviewed by Tim Horton.

Source/WebCore:

This patch changes the auto size behavior by using fixed constraint (instead of a min/max pair) to compute the content height.
Now with the initial containing block width is firmly set to auto-sizing width, the overflow content will not stretch the ICB. Instead it overflows the ICB
and triggers scrolling the same way the non-auto-sizing mode does.

* page/FrameView.cpp:
(WebCore::FrameView::autoSizeIfEnabled):
(WebCore::FrameView::enableAutoSizeMode):
* page/FrameView.h:
* testing/Internals.cpp:
(WebCore::Internals::enableAutoSizeMode):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setViewLayoutSize):

Tools:

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

LayoutTests:

* css3/viewport-percentage-lengths/vh-auto-size-expected.html:
* css3/viewport-percentage-lengths/vh-auto-size.html:
* fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html:
* fast/dynamic/mail-autosize-viewport-unit.html:

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

4 months agoClose service worker database on network process suspension
youenn@apple.com [Tue, 9 Apr 2019 23:37:17 +0000 (23:37 +0000)]
Close service worker database on network process suspension
https://bugs.webkit.org/show_bug.cgi?id=196623
<rdar://problem/48930869>

Reviewed by Alex Christensen.

Source/WebCore:

Add suspend/resume support to SWServer.
On suspend, close the service worker database and stop pushing for changes.
On resume, push changes if needed.

* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::close):
* workers/service/server/RegistrationDatabase.h:
(WebCore::RegistrationDatabase::isClosed const): Deleted.
* workers/service/server/RegistrationStore.cpp:
(WebCore::RegistrationStore::closeDatabase):
* workers/service/server/RegistrationStore.cpp:
(WebCore::RegistrationStore::pushChangesToDatabase):
(WebCore::RegistrationStore::clearAll):
(WebCore::RegistrationStore::startSuspension):
(WebCore::RegistrationStore::endSuspension):
* workers/service/server/RegistrationStore.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::startSuspension):
(WebCore::SWServer::endSuspension):
* workers/service/server/SWServer.h:

Source/WebKit:

Close service worker database when preparing to suspend.
On resume, push changes if any is needed.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::actualPrepareToSuspend):
(WebKit::NetworkProcess::cancelPrepareToSuspend):
(WebKit::NetworkProcess::processDidResume):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _sendNetworkProcessWillSuspendImminently]):
(-[WKProcessPool _sendNetworkProcessDidResume]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::sendNetworkProcessWillSuspendImminently):
(WebKit::WebProcessPool::sendNetworkProcessDidResume):
* UIProcess/WebProcessPool.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

4 months ago[iPad] Should open popover when the spacebar is pressed
commit-queue@webkit.org [Tue, 9 Apr 2019 21:45:03 +0000 (21:45 +0000)]
[iPad] Should open popover when the spacebar is pressed
https://bugs.webkit.org/show_bug.cgi?id=196360
<rdar://problem/49389129>

Patch by Daniel Bates <dabates@apple.com> on 2019-04-09
Reviewed by Brent Fulgham.

Source/WebKit:

Pressing the spacebar should open the popover for a focused popup button (e.g. <select>) on iOS
just like it does on the Mac.

For now, we keep the iPhone behavior of blurring the element when the Done button is pressed and
hence pressing spacebar does nothing (because there is no focused element).

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView accessoryOpen]): Added. Extracted the logic from -_elementDidFocus to scroll to
the focused element, update the accessory and then tell the accessory to begin editing.
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
Write in terms of -accessoryOpen.
* UIProcess/ios/forms/WKFormPeripheralBase.mm:
(-[WKFormPeripheralBase handleKeyEvent:]): Interpret the spacebar when the peripheral is closed (!_editing)
and call -accessoryOpen to ultimately call back to this peripheral to tell it to begin editing,
which will cause the popover to appear again.

Tools:

Add testing infrastructure to support waiting for a popover to be presented or dismissed.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::isShowingPopover const): Added.
(WTR::UIScriptController::platformSetWillPresentPopoverCallback): Added.
(WTR::UIScriptController::platformSetDidDismissPopoverCallback): Added.
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptContext.h:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::setWillPresentPopoverCallback): Added.
(WTR::UIScriptController::willPresentPopoverCallback const): Added.
(WTR::UIScriptController::setDidDismissPopoverCallback): Added.
(WTR::UIScriptController::didDismissPopoverCallback const): Added.
(WTR::UIScriptController::isShowingPopover const): Added.
(WTR::UIScriptController::platformSetWillPresentPopoverCallback): Added.
(WTR::UIScriptController::platformSetDidDismissPopoverCallback): Added.
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView initWithFrame:configuration:]): Update some state.
(-[TestRunnerWKWebView resetInteractionCallbacks]): Ditto.
(-[TestRunnerWKWebView _willPresentPopover]): Added.
(-[TestRunnerWKWebView _didDismissPopover]): Added.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::isShowingPopover const): Added.
(WTR::UIScriptController::platformSetWillPresentPopoverCallback): Added.
(WTR::UIScriptController::platformSetDidDismissPopoverCallback): Added.

LayoutTests:

Add an iPad-specific test to ensure that pressing the spacebar opens the popover and scrolls
the form control into view.

* fast/forms/ios/ipad/open-picker-using-keyboard-expected.txt: Added.
* fast/forms/ios/ipad/open-picker-using-keyboard.html: Added.
* platform/ios/TestExpectations: Skip tests in fast/forms/ios/ipad. We will unskip for iPad below.
* platform/ipad/TestExpectations: Mark tests in fast/forms/ios/ipad as PASS so we run them.
* resources/ui-helper.js:
(window.UIHelper.waitForPopoverToPresent):
(window.UIHelper.waitForPopoverToDismiss):

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

4 months agoUnreviewed, fix webkitpy failure after r244085.
cdumez@apple.com [Tue, 9 Apr 2019 21:42:32 +0000 (21:42 +0000)]
Unreviewed, fix webkitpy failure after r244085.

Use a list instead of a set for header includes so that the order is
maintained.

* Scripts/webkit/messages.py:

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

4 months agoRefresh WPT service worker expectations
youenn@apple.com [Tue, 9 Apr 2019 20:17:50 +0000 (20:17 +0000)]
Refresh WPT service worker expectations
https://bugs.webkit.org/show_bug.cgi?id=196732

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/window/cache-abort.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/worker/cache-abort.https-expected.txt:
* web-platform-tests/service-workers/service-worker/client-navigate.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-matchall-include-uncontrolled.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image-cache.https-expected.txt:
* web-platform-tests/service-workers/service-worker/multipart-image.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/performance-timeline.https-expected.txt:
* web-platform-tests/service-workers/service-worker/resource-timing.https-expected.txt:
* web-platform-tests/service-workers/service-worker/respond-with-body-accessed-response.https-expected.txt:
* web-platform-tests/service-workers/service-worker/sandboxed-iframe-fetch-event.https-expected.txt:
* web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https-expected.txt:

LayoutTests:

* TestExpectations:

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

4 months ago[Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
justin_fan@apple.com [Tue, 9 Apr 2019 20:03:18 +0000 (20:03 +0000)]
[Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
https://bugs.webkit.org/show_bug.cgi?id=196719

Reviewed by Myles C. Maxfield.

Source/WebCore:

Implement setBlendColor, setViewport, and setScissorRect for GPURenderPassEncoder.

Tests: webgpu/viewport-scissor-rect-triangle-strip.html, webgpu/blend-color-triangle-strip.html

* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setBlendColor):
(WebCore::WebGPURenderPassEncoder::setViewport):
(WebCore::WebGPURenderPassEncoder::setScissorRect):
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* platform/graphics/gpu/GPURenderPassEncoder.h:
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setBlendColor):
(WebCore::GPURenderPassEncoder::setViewport):
(WebCore::GPURenderPassEncoder::setScissorRect):

LayoutTests:

Add blend-color-triangle-strip to set and blend with a custom blend color on the renderpass encoder.
Add viewport-scissor-rect-triangle-strip to draw a checkerboard by restricting the drawing viewport or scissor rectangle.

* webgpu/blend-color-triangle-strip.html: Added.
* webgpu/js/webgpu-functions.js:
(beginBasicRenderPass):
* webgpu/viewport-scissor-rect-triangle-strip-expected.html: Added.
* webgpu/viewport-scissor-rect-triangle-strip.html: Added.

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

4 months ago[Apple Pay] Add release logging to PaymentCoordinator
aestes@apple.com [Tue, 9 Apr 2019 19:53:35 +0000 (19:53 +0000)]
[Apple Pay] Add release logging to PaymentCoordinator
https://bugs.webkit.org/show_bug.cgi?id=196738

Reviewed by Alex Christensen.

Source/WebCore:

When allowed, log interactions with PaymentCoordinator to os_log to help diagnose Apple Pay bugs.

The following information might be logged: names of functions called, merchant API versions,
boolean results of canMakePayments(), boolean results of beginPaymentSession(), whether
completePaymentSession() was called with a final state result, boolean results of
shouldAllowApplePay(), whether a document has evaluated user agent scripts or is running
user scripts, and whether a client supports unrestricted Apple Pay.

* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::supportsVersion const):
(WebCore::PaymentCoordinator::canMakePayments):
(WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
(WebCore::PaymentCoordinator::openPaymentSetup):
(WebCore::PaymentCoordinator::beginPaymentSession):
(WebCore::PaymentCoordinator::completeMerchantValidation):
(WebCore::PaymentCoordinator::completeShippingMethodSelection):
(WebCore::PaymentCoordinator::completeShippingContactSelection):
(WebCore::PaymentCoordinator::completePaymentMethodSelection):
(WebCore::PaymentCoordinator::completePaymentSession):
(WebCore::PaymentCoordinator::abortPaymentSession):
(WebCore::PaymentCoordinator::cancelPaymentSession):
(WebCore::PaymentCoordinator::validateMerchant):
(WebCore::PaymentCoordinator::didAuthorizePayment):
(WebCore::PaymentCoordinator::didSelectPaymentMethod):
(WebCore::PaymentCoordinator::didSelectShippingMethod):
(WebCore::PaymentCoordinator::didSelectShippingContact):
(WebCore::PaymentCoordinator::didCancelPaymentSession):
(WebCore::PaymentCoordinator::shouldAllowApplePay const):
(WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
* Modules/applepay/PaymentCoordinatorClient.h:
(WebCore::PaymentCoordinatorClient::isAlwaysOnLoggingAllowed const):
* platform/Logging.h:
* testing/MockPaymentCoordinator.h:

Source/WebKit:

* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::isAlwaysOnLoggingAllowed const):
* WebProcess/ApplePay/WebPaymentCoordinator.h:

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

4 months ago[Cocoa] Awaken UIProcess if WebContent process is awakened from suspensions unexpectedly.
jer.noble@apple.com [Tue, 9 Apr 2019 19:37:28 +0000 (19:37 +0000)]
[Cocoa] Awaken UIProcess if WebContent process is awakened from suspensions unexpectedly.
https://bugs.webkit.org/show_bug.cgi?id=196659

Reviewed by Chris Dumez.

* Platform/IPC/Connection.h:
(IPC::Connection::sendWithAsyncReply):
* Platform/spi/ios/AssertionServicesSPI.h:
* Shared/Cocoa/ProcessTaskStateObserver.h: Added.
(WebKit::ProcessTaskStateObserver::setClient):
(WebKit::ProcessTaskStateObserver::client):
(WebKit::ProcessTaskStateObserver::taskState const):
* Shared/Cocoa/ProcessTaskStateObserver.mm: Added.
(-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):
(WebKit::toProcessTaskStateObserverTaskState):
(WebKit::ProcessTaskStateObserver::ProcessTaskStateObserver):
(WebKit::ProcessTaskStateObserver::~ProcessTaskStateObserver):
(WebKit::ProcessTaskStateObserver::setTaskState):
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
* UIProcess/ProcessAssertion.h:
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertion):
* UIProcess/ProcessThrottler.h:
(WebKit::ProcessThrottler::shouldBeRunnable const):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::reasonForState):
(WebKit::toBKSProcessAssertionReason):
(WebKit::ProcessAssertion::ProcessAssertion):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::processTaskStateDidChange):

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

4 months ago[CMake] WTF derived sources should only be referenced inside WTF
don.olmstead@sony.com [Tue, 9 Apr 2019 19:32:08 +0000 (19:32 +0000)]
[CMake] WTF derived sources should only be referenced inside WTF
https://bugs.webkit.org/show_bug.cgi?id=196706

Reviewed by Konstantin Tokarev.

.:

* Source/cmake/OptionsWinCairo.cmake:
* Source/cmake/WebKitFS.cmake:

Source/WTF:

Use ${WTF_DERIVED_SOURCES_DIR} instead of ${DERIVED_SOURCES_DIR} within WTF.

* wtf/CMakeLists.txt:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:

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

4 months agoClicking "Go Back" from a safe browsing warning from an iframe should navigate the...
commit-queue@webkit.org [Tue, 9 Apr 2019 19:07:55 +0000 (19:07 +0000)]
Clicking "Go Back" from a safe browsing warning from an iframe should navigate the WKWebView back to the previous page
https://bugs.webkit.org/show_bug.cgi?id=196665
<rdar://45115669>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-04-09
Reviewed by Geoff Garen.

Source/WebKit:

It is insufficient to just not navigate the subframe.  We must leave the page that contained it.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showSafeBrowsingWarning):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(goBack):
(+[SimpleLookupContext sharedLookupContext]):
(-[SimpleLookupContext lookUpURL:completionHandler:]):
(TEST):
(+[Simple3LookupContext sharedLookupContext]): Deleted.
(-[Simple3LookupContext lookUpURL:completionHandler:]): Deleted.

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

4 months agoJSC should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
ross.kirsling@sony.com [Tue, 9 Apr 2019 18:50:00 +0000 (18:50 +0000)]
JSC should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
https://bugs.webkit.org/show_bug.cgi?id=193073

Reviewed by Keith Miller.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitEqualityOpImpl):
(JSC::BytecodeGenerator::emitEqualityOp): Deleted.
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitEqualityOp):
Factor out the logic that uses the template parameter and keep it in the header.

* jit/JITPropertyAccess.cpp:
List off the template specializations needed by JITOperations.cpp.
This is unfortunate but at least there are only two (x2) by definition?
Trying to do away with this incurs a severe domino effect...

* API/JSValueRef.cpp:
* b3/B3OptimizeAssociativeExpressionTrees.cpp:
* b3/air/AirHandleCalleeSaves.cpp:
* builtins/BuiltinNames.cpp:
* bytecode/AccessCase.cpp:
* bytecode/BytecodeIntrinsicRegistry.cpp:
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecode/BytecodeRewriter.cpp:
* bytecode/BytecodeUseDef.h:
* bytecode/CodeBlock.cpp:
* bytecode/InstanceOfAccessCase.cpp:
* bytecode/MetadataTable.cpp:
* bytecode/PolyProtoAccessChain.cpp:
* bytecode/StructureSet.cpp:
* bytecompiler/NodesCodegen.cpp:
* dfg/DFGCFAPhase.cpp:
* dfg/DFGPureValue.cpp:
* heap/GCSegmentedArray.h:
* heap/HeapInlines.h:
* heap/IsoSubspace.cpp:
* heap/LocalAllocator.cpp:
* heap/LocalAllocator.h:
* heap/LocalAllocatorInlines.h:
* heap/MarkingConstraintSolver.cpp:
* inspector/ScriptArguments.cpp:
(Inspector::ScriptArguments::isEqual const):
* inspector/ScriptCallStackFactory.cpp:
* interpreter/CallFrame.h:
* interpreter/Interpreter.cpp:
* interpreter/StackVisitor.cpp:
* llint/LLIntEntrypoint.cpp:
* runtime/ArrayIteratorPrototype.cpp:
* runtime/BigIntPrototype.cpp:
* runtime/CachedTypes.cpp:
* runtime/ErrorType.cpp:
* runtime/IndexingType.cpp:
* runtime/JSCellInlines.h:
* runtime/JSImmutableButterfly.h:
* runtime/Operations.h:
* runtime/RegExpCachedResult.cpp:
* runtime/RegExpConstructor.cpp:
* runtime/RegExpGlobalData.cpp:
* runtime/StackFrame.h:
* wasm/WasmSignature.cpp:
* wasm/js/JSToWasm.cpp:
* wasm/js/JSToWasmICCallee.cpp:
* wasm/js/WebAssemblyFunction.h:
Fix includes / forward declarations (and a couple of nearby clang warnings).

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

4 months agoUnreviewed, fix test failures after r239698.
drousso@apple.com [Tue, 9 Apr 2019 18:45:33 +0000 (18:45 +0000)]
Unreviewed, fix test failures after r239698.
<rdar://problem/47223615>

* http/tests/inspector/network/resource-security-connection.html:
Security connection information is sent as part of the metrics, not the response.

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

4 months agoPick up Ad Click Attribution conversions in NetworkResourceLoader::willSendRedirected...
wilander@apple.com [Tue, 9 Apr 2019 18:19:59 +0000 (18:19 +0000)]
Pick up Ad Click Attribution conversions in NetworkResourceLoader::willSendRedirectedRequest()
https://bugs.webkit.org/show_bug.cgi?id=196558
<rdar://problem/47650245>

Reviewed by Youenn Fablet.

Source/WebCore:

Tests: http/tests/adClickAttribution/attribution-conversion-through-cross-site-image-redirect.html
       http/tests/adClickAttribution/attribution-conversion-through-image-redirect-with-priority.html
       http/tests/adClickAttribution/attribution-conversion-through-image-redirect-without-priority.html

The existing API tests were expanded too.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
   Enhanced the use of AdClickAttribution::MaxEntropy.
* loader/AdClickAttribution.cpp:
(WebCore::AdClickAttribution::parseConversionRequest):
    New function to parse and validate URLs with a path starting with
    /.well-known/ad-click-attribution/.
(WebCore::AdClickAttribution::toString const):
    Added output for the conversion priority for testing purposes.
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::Campaign::isValid const):
(WebCore::AdClickAttribution::Conversion::isValid const):
   Enhanced the use of AdClickAttribution::MaxEntropy.

Source/WebKit:

So called pixel requests have traditionally been used to send ad click
attribution data to click sources. The privacy implications of such
pixel requests are severe which is in part why browsers have started to
block cookies from being sent in such third-party requests.

To allow for a smooth transition to more privacy-friendly ad click
attribution, we should allow servers to make a redirect to
https://click-source.example/.well-known/ad-click-attribution/ to
trigger a so called conversion.

This patch checks for the well-known location in the path component of
the redirect URL. If the request indeed goes to the well-known location,
we parse the conversion data and send it to the storage in the network
session.

* NetworkProcess/NetworkAdClickAttribution.cpp:
(WebKit::NetworkAdClickAttribution::convert):
    Reporting function.
* NetworkProcess/NetworkAdClickAttribution.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
    Now checks for the well-known location through a call to
    WebCore::AdClickAttribution::parseConversionRequest().
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::convertAdClickAttribution):
    Piping to WebKit::NetworkAdClickAttribution::convert().
* NetworkProcess/NetworkSession.h:

Tools:

* TestWebKitAPI/Tests/WebCore/AdClickAttribution.cpp:
(TestWebKitAPI::TEST):
    Added tests of WebCore::AdClickAttribution::parseConversionRequest().

LayoutTests:

* http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt:
   Enhanced the use of AdClickAttribution::MaxEntropy.
* http/tests/adClickAttribution/attribution-conversion-through-cross-site-image-redirect-expected.txt: Added.
* http/tests/adClickAttribution/attribution-conversion-through-cross-site-image-redirect.html: Added.
* http/tests/adClickAttribution/attribution-conversion-through-image-redirect-with-priority-expected.txt: Added.
* http/tests/adClickAttribution/attribution-conversion-through-image-redirect-with-priority.html: Added.
* http/tests/adClickAttribution/attribution-conversion-through-image-redirect-without-priority-expected.txt: Added.
* http/tests/adClickAttribution/attribution-conversion-through-image-redirect-without-priority.html: Added.
* http/tests/adClickAttribution/resources/redirectToConversion.php: Added.
* http/tests/adClickAttribution/resources/redirectToConversionOnIPAddress.php: Added.
* platform/ios-wk2/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt:
   Enhanced the use of AdClickAttribution::MaxEntropy.

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

4 months ago[iOS] WebContent processes should be marked as "Foreground Running" when their view...
cdumez@apple.com [Tue, 9 Apr 2019 18:08:27 +0000 (18:08 +0000)]
[iOS] WebContent processes should be marked as "Foreground Running" when their view is visible
https://bugs.webkit.org/show_bug.cgi?id=196695
<rdar://problem/48073787>

Reviewed by Tim Horton.

In order for WebContent processes to get marked as "Foreground Running" when their view
is visible on iOS, we now construct a _UILayerHostView in the UIProcess and add it as
a subview of the WKContentView. The _UILayerHostView's visibility target is the
WebContent process currently associated with the view.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/PageClient.h:
(WebKit::PageClient::didCreateContextForVisibilityPropagation):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::contextIDForVisibilityPropagation):
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didCreateContextForVisibilityPropagation):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView _setupVisibilityPropagationView]):
(-[WKContentView _processDidExit]):
(-[WKContentView _didRelaunchProcess]):
(-[WKContentView _processDidCreateContextForVisibilityPropagation]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCreateContextForVisibilityPropagation):
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::didCreateContextForVisibilityPropagation):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

4 months agoinspector/canvas/css-canvas-clients.html is a flaky failure
sroberts@apple.com [Tue, 9 Apr 2019 18:07:25 +0000 (18:07 +0000)]
inspector/canvas/css-canvas-clients.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=174272

Unreviewed test gardening

* platform/mac/TestExpectations: Updating expectations to unskip test and just mark as a flaky failure

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

4 months agoinspector/console/console-time.html is a flaky failure
sroberts@apple.com [Tue, 9 Apr 2019 18:04:02 +0000 (18:04 +0000)]
inspector/console/console-time.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=158006

Unreviewed test gardening.

* platform/mac/TestExpectations: Updating expecations for flaky failure

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

4 months ago[ Mac ] REGRESSION (r237587) Layout Test compositing/visible-rect/animated-from-none...
graouts@webkit.org [Tue, 9 Apr 2019 17:50:11 +0000 (17:50 +0000)]
[ Mac ] REGRESSION (r237587) Layout Test compositing/visible-rect/animated-from-none.html is flaky text diff failure
https://bugs.webkit.org/show_bug.cgi?id=194798
<rdar://problem/48181898>

Reviewed by Dean Jackson.

When using the Web Animations engine, the best way to run code as an animation start is to use the "ready" promise, whereas
DOM events are dispatched asynchronously and, in the case of this test, might have an animation progress that is greater
than 0 and yield an animated transform that isn't quite the identity matrix.

* compositing/visible-rect/animated-from-none.html:

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

4 months ago[CMake] Apple builds should use ICU_INCLUDE_DIRS
don.olmstead@sony.com [Tue, 9 Apr 2019 16:57:22 +0000 (16:57 +0000)]
[CMake] Apple builds should use ICU_INCLUDE_DIRS
https://bugs.webkit.org/show_bug.cgi?id=196720

Reviewed by Konstantin Tokarev.

.:

The Apple platform is using ${DERIVED_SOURCES_WTF_DIR} for hosting the ICU headers.
Instead it should stage the headers into ${ICU_INCLUDE_DIRS} so no special handling
is needed.

* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsMac.cmake:

Source/JavaScriptCore:

* PlatformMac.cmake:

Source/WebCore:

* PlatformMac.cmake:

Source/WebCore/PAL:

* pal/PlatformMac.cmake:

Source/WTF:

Copy ICU headers for Apple builds into ICU_INCLUDE_DIRS.

* CMakeLists.txt:
* wtf/PlatformMac.cmake:

Tools:

* TestWebKitAPI/PlatformMac.cmake:

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

4 months agoiOS 12 Simulator Release WK2 frequently timing out while running layout tests
jbedard@apple.com [Tue, 9 Apr 2019 16:14:43 +0000 (16:14 +0000)]
iOS 12 Simulator Release WK2 frequently timing out while running layout tests
https://bugs.webkit.org/show_bug.cgi?id=196694
<rdar://problem/48388734>

Rubber-stamped by Aakash Jain.

* Scripts/webkitpy/port/image_diff.py:
(ImageDiffer.diff_image): If the ImageDiff process has data, kill it before running again.
* Scripts/webkitpy/port/server_process.py:
(ServerProcess.has_available_stdout): Check if stdout has data in it.
(ServerProcess._wait_for_data_and_update_buffers_using_select):
(ServerProcess._wait_for_data_and_update_buffers_using_win32_apis):
* Scripts/webkitpy/port/server_process_mock.py:
(MockServerProcess.has_available_stdout):
* Scripts/webkitpy/port/server_process_unittest.py:
(TestServerProcess.serial_test_basic):

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

4 months agoClean up Int52 code and some bugs in it
sbarati@apple.com [Tue, 9 Apr 2019 16:06:48 +0000 (16:06 +0000)]
Clean up Int52 code and some bugs in it
https://bugs.webkit.org/show_bug.cgi?id=196639
<rdar://problem/49515757>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/spec-any-int-as-double-produces-any-int52-from-int52-rep.js: Added.

Source/JavaScriptCore:

This patch fixes bugs in our Int52 code. The primary change in this patch is
adopting a segregated type lattice for Int52. Previously, for Int52 values,
we represented them with SpecInt32Only and SpecInt52Only. For an Int52,
SpecInt32Only meant that the value is in int32 range. And SpecInt52Only meant
that the is outside of the int32 range.

However, this got confusing because we reused SpecInt32Only both for JSValue
representations and Int52 representations. This actually lead to some bugs.

1. It's possible that roundtripping through Int52 representation would say
it produces the wrong type. For example, consider this program and how we
used to annotate types in AI:
a: JSConstant(10.0) => m_type is SpecAnyIntAsDouble
b: Int52Rep(@a) => m_type is SpecInt52Only
c: ValueRep(@b) => m_type is SpecAnyIntAsDouble

In AI, for the above program, we'd say that @c produces SpecAnyIntAsDouble.
However, the execution semantics are such that it'd actually produce a boxed
Int32. This patch fixes the bug where we'd say that Int52Rep over SpecAnyIntAsDouble
would produce SpecInt52Only. This is clearly wrong, as SpecAnyIntAsDouble can
mean an int value in either int32 or int52 range.

2. AsbstractValue::validateTypeAcceptingBoxedInt52 was wrong in how it
accepted Int52 values. It was wrong in two different ways:
a: If the AbstractValue's type was SpecInt52Only, and the incoming value
was a boxed double, but represented a value in int32 range, the incoming
value would incorrectly validate as being acceptable. However, we should
have rejected this value.
b: If the AbstractValue's type was SpecInt32Only, and the incoming value
was an Int32 boxed in a double, this would not validate, even though
it should have validated.

Solving 2 was easiest if we segregated out the Int52 type into its own
lattice. This patch makes a new Int52 lattice, which is composed of
SpecInt32AsInt52 and SpecNonInt32AsInt52.

The conversion rules are now really simple.

Int52 rep => JSValue rep
SpecInt32AsInt52 => SpecInt32Only
SpecNonInt32AsInt52 => SpecAnyIntAsDouble

JSValue rep => Int52 rep
SpecInt32Only => SpecInt32AsInt52
SpecAnyIntAsDouble => SpecInt52Any

With these rules, the program in (1) will now correctly report that @c
returns SpecInt32Only | SpecAnyIntAsDouble.

* bytecode/SpeculatedType.cpp:
(JSC::dumpSpeculation):
(JSC::speculationToAbbreviatedString):
(JSC::int52AwareSpeculationFromValue):
(JSC::leastUpperBoundOfStrictlyEquivalentSpeculations):
(JSC::speculationFromString):
* bytecode/SpeculatedType.h:
(JSC::isInt32SpeculationForArithmetic):
(JSC::isInt32OrBooleanSpeculationForArithmetic):
(JSC::isAnyInt52Speculation):
(JSC::isIntAnyFormat):
(JSC::isInt52Speculation): Deleted.
(JSC::isAnyIntSpeculation): Deleted.
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::fixTypeForRepresentation):
(JSC::DFG::AbstractValue::checkConsistency const):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::isInt52Any const):
(JSC::DFG::AbstractValue::validateTypeAcceptingBoxedInt52 const):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupArithMul):
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupGetPrototypeOf):
(JSC::DFG::FixupPhase::fixupToThis):
(JSC::DFG::FixupPhase::fixupToStringOrCallStringConstructor):
(JSC::DFG::FixupPhase::observeUseKindOnNode):
(JSC::DFG::FixupPhase::fixIntConvertingEdge):
(JSC::DFG::FixupPhase::attemptToMakeIntegerAdd):
(JSC::DFG::FixupPhase::fixupCompareStrictEqAndSameValue):
(JSC::DFG::FixupPhase::fixupChecksInBlock):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::addShouldSpeculateInt52):
(JSC::DFG::Graph::binaryArithShouldSpeculateInt52):
(JSC::DFG::Graph::unaryArithShouldSpeculateInt52):
(JSC::DFG::Graph::addShouldSpeculateAnyInt): Deleted.
(JSC::DFG::Graph::binaryArithShouldSpeculateAnyInt): Deleted.
(JSC::DFG::Graph::unaryArithShouldSpeculateAnyInt): Deleted.
* dfg/DFGNode.h:
(JSC::DFG::Node::shouldSpeculateInt52):
(JSC::DFG::Node::shouldSpeculateAnyInt): Deleted.
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::setIntTypedArrayLoadResult):
(JSC::DFG::SpeculativeJIT::compileArithAdd):
(JSC::DFG::SpeculativeJIT::compileArithSub):
(JSC::DFG::SpeculativeJIT::compileArithNegate):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
(JSC::DFG::SpeculativeJIT::fillSpeculateInt52):
* dfg/DFGUseKind.h:
(JSC::DFG::typeFilterFor):
* dfg/DFGVariableAccessData.cpp:
(JSC::DFG::VariableAccessData::makePredictionForDoubleFormat):
(JSC::DFG::VariableAccessData::couldRepresentInt52Impl):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArithAddOrSub):
(JSC::FTL::DFG::LowerDFGToB3::compileArithNegate):
(JSC::FTL::DFG::LowerDFGToB3::setIntTypedArrayLoadResult):

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

4 months agoSource/WebCore:
jer.noble@apple.com [Tue, 9 Apr 2019 15:57:45 +0000 (15:57 +0000)]
Source/WebCore:
Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
https://bugs.webkit.org/show_bug.cgi?id=196097

Reviewed by Eric Carlson.

Test: media/track/track-in-band-metadata-display-order.html

Add a method in Internals to create a TextTrackCueGeneric (which can normally only be created
by parsing an in-band media track). This requires adding IDL for TextTrackCueGeneric, and exporting
TextTrackCueGeneric for testing.

Drive-by fixes:

Add runtime logging to MediaControlTextTrackContainerElement. This necessitates modifying the
parentMediaElement() method to take a const Node*, and const_cast that constness away in order to return
a HTMLMediaElement*

TextTrackCue, VTTCue, TextTrackCueGeneric, and DataCue should all use the WTF TypeCasts macros to
enable use of is<> and downcast<>.

* Source/WebCore/CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* Sources.txt:
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::parentMediaElement):
* html/shadow/MediaControlElementTypes.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
(WebCore::MediaControlTextTrackContainerElement::logger const):
(WebCore::MediaControlTextTrackContainerElement::logIdentifier const):
(WebCore::MediaControlTextTrackContainerElement::logChannel const):
* html/shadow/MediaControlElements.h:
* html/track/DataCue.h:
(isType):
* html/track/TextTrackCueGeneric.h:
(isType):
* html/track/TextTrackCueGeneric.idl: Added.
* html/track/VTTCue.h:
(isType):
* testing/Internals.cpp:
(WebCore::Internals::createGenericCue):
* testing/Internals.h:
* testing/Internals.idl:

Tools:
Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
https://bugs.webkit.org/show_bug.cgi?id=196097

Reviewed by Eric Carlson.

Drive-by bug fix: allow tests to play audio without a user gesture by default.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:
Add test for fix of #196095
https://bugs.webkit.org/show_bug.cgi?id=196097

Reviewed by Eric Carlson.

* media/track/track-in-band-metadata-display-order-expected.txt: Added.
* media/track/track-in-band-metadata-display-order.html: Added.

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

4 months agoRemove unnecessary network process assertion for IDB close
sihui_liu@apple.com [Tue, 9 Apr 2019 15:56:45 +0000 (15:56 +0000)]
Remove unnecessary network process assertion for IDB close
https://bugs.webkit.org/show_bug.cgi?id=196693

Reviewed by Geoffrey Garen.

Source/WebCore:

We already took assertion at WebCore::SQLiteDatabase::close.

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::create):
(WebCore::IDBServer::IDBServer::IDBServer):
(WebCore::IDBServer::m_quotaManagerGetter): Deleted.
(WebCore::IDBServer::IDBServer::closeDatabase): Deleted.
(WebCore::IDBServer::IDBServer::didCloseDatabase): Deleted.
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::create): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
(WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
(WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.h:

Source/WebKit:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createIDBServer):
(WebKit::NetworkProcess::notifyHoldingLockedFiles): Deleted.
* NetworkProcess/NetworkProcess.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:

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

4 months ago[JSCOnly] Add an i386 JSCOnly EWS that runs tests
commit-queue@webkit.org [Tue, 9 Apr 2019 15:43:00 +0000 (15:43 +0000)]
[JSCOnly] Add an i386 JSCOnly EWS that runs tests
https://bugs.webkit.org/show_bug.cgi?id=196690

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2019-04-09
Reviewed by Michael Catanzaro.

* QueueStatusServer/config/queues.py:
* Scripts/webkitpy/common/config/ews.json:
* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
(test_ews_name):

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

4 months agoLoads using loadHTMLString() cause flashing when process-swapping
cdumez@apple.com [Tue, 9 Apr 2019 14:20:12 +0000 (14:20 +0000)]
Loads using loadHTMLString() cause flashing when process-swapping
https://bugs.webkit.org/show_bug.cgi?id=196714
<rdar://problem/49637354>

Reviewed by Antti Koivisto.

Source/WebKit:

Our logic to decide if we should construct a SuspendedPageProxy on process-swap was assuming
a SuspendedPageProxy is only useful for PageCache and would therefore not create one if PageCache
is disabled or if there is no associated WebBackForwardListItem. However, constructing a
SuspendedPageProxy is also useful to prevent flashing when process-swapping as we need to keep
displaying the layer of the previous process until there is something meaningful to show in the
new process.

This patch makes it so that we now construct a SuspendedPageProxy on process-swap, even if
PageCache is disabled or if there is no associated WebBackForwardListItem. The process in
question will not be useful for PageCache but it will avoid flashing. The SuspendedPageProxy's
process may also get used for future navigations to the same site (as demonstrated by the
API test) which is beneficial for performance.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::findReusableSuspendedPageProcess):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

4 months agoInitialize trackTypeAsString for call to GST_INFO_OBJECT() in TrackType::Text
commit-queue@webkit.org [Tue, 9 Apr 2019 10:21:03 +0000 (10:21 +0000)]
Initialize trackTypeAsString for call to GST_INFO_OBJECT() in TrackType::Text
https://bugs.webkit.org/show_bug.cgi?id=196350

Patch by Eike Rathke <erack@redhat.com> on 2019-04-09
Reviewed by Xabier Rodriguez-Calvar.

trackTypeAsString was uninitialized in the
TrackPrivateBaseGStreamer::TrackType::Text case when calling
GST_INFO_OBJECT().

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):

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

4 months agoUnreviewed. Fix ATK accessibility tests after r244059.
carlosgc@webkit.org [Tue, 9 Apr 2019 09:48:21 +0000 (09:48 +0000)]
Unreviewed. Fix ATK accessibility tests after r244059.

We are failing to load the injected bundle due to undefined symbol
AccessibilityUIElement::replaceTextInRange().

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

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

4 months ago[ATK] Cleanup WebKitAccessibleHyperlink
carlosgc@webkit.org [Tue, 9 Apr 2019 09:01:35 +0000 (09:01 +0000)]
[ATK] Cleanup WebKitAccessibleHyperlink
https://bugs.webkit.org/show_bug.cgi?id=196602

Reviewed by Michael Catanzaro.

Cleanups:

 - Rename webkitAccessibleHyperlinkNew() as webkitAccessibleHyperlinkGetOrCreate() and move the code to get/set
   the object data here.
 - Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
   struct are no longer leaked.
 - Remove all confusing core() functions and simply use webkitAccessibleGetAccessibilityObject().
 - Use nullptr instead of 0 and other coding style issues.

* accessibility/atk/WebKitAccessibleHyperlink.cpp:
(webkitAccessibleHyperlinkActionDoAction):
(webkitAccessibleHyperlinkActionGetNActions):
(webkitAccessibleHyperlinkActionGetDescription):
(webkitAccessibleHyperlinkActionGetKeybinding):
(webkitAccessibleHyperlinkActionGetName):
(atk_action_interface_init):
(webkitAccessibleHyperlinkGetURI):
(webkitAccessibleHyperlinkGetObject):
(rangeLengthForObject):
(webkitAccessibleHyperlinkGetStartIndex):
(webkitAccessibleHyperlinkGetEndIndex):
(webkitAccessibleHyperlinkIsValid):
(webkitAccessibleHyperlinkGetNAnchors):
(webkitAccessibleHyperlinkIsSelectedLink):
(webkitAccessibleHyperlinkGetProperty):
(webkitAccessibleHyperlinkSetProperty):
(webkit_accessible_hyperlink_class_init):
(webkitAccessibleHyperlinkGetOrCreate):
(core): Deleted.
(atkActionInterfaceInit): Deleted.
(getRangeLengthForObject): Deleted.
(webkitAccessibleHyperlinkFinalize): Deleted.
(webkitAccessibleHyperlinkClassInit): Deleted.
(webkitAccessibleHyperlinkInit): Deleted.
(webkitAccessibleHyperlinkGetType): Deleted.
(webkitAccessibleHyperlinkNew): Deleted.
(webkitAccessibleHyperlinkGetAccessibilityObject): Deleted.
* accessibility/atk/WebKitAccessibleHyperlink.h:
* accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
(webkitAccessibleHyperlinkImplGetHyperlink):
(webkitAccessibleHyperlinkImplInterfaceInit):

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

4 months agoASSERTION FAILED: !scope.exception() || !hasProperty in JSObject::get
tzagallo@apple.com [Tue, 9 Apr 2019 07:54:18 +0000 (07:54 +0000)]
ASSERTION FAILED: !scope.exception() || !hasProperty in JSObject::get
https://bugs.webkit.org/show_bug.cgi?id=196708
<rdar://problem/49556803>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/proxy-getter-stack-overflow.js: Added.
(const.handler.get target):
(const.handler.has):
(try.with):
(catch):

Source/JavaScriptCore:

`operationPutToScope` needs to return early if an exception is thrown while
checking if `hasProperty`.

* jit/JITOperations.cpp:

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