ffa9595d41535e2e4f9b8113626bb4b7120f7761
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-10-04  Sihui Liu  <sihui_liu@apple.com>
2
3         Layout Test imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html is a Flaky Failure
4         https://bugs.webkit.org/show_bug.cgi?id=201481
5         <rdar://problem/55046055>
6
7         Reviewed by Alex Christensen.
8
9         We should not schedule timer if we know the timer function will be no-op.
10
11         * Modules/indexeddb/IDBTransaction.cpp:
12         (WebCore::IDBTransaction::removeRequest):
13         (WebCore::IDBTransaction::scheduleOperation):
14         (WebCore::IDBTransaction::trySchedulePendingOperationTimer):
15         (WebCore::IDBTransaction::pendingOperationTimerFired):
16         (WebCore::IDBTransaction::didStart):
17         (WebCore::IDBTransaction::operationCompletedOnClient):
18         (WebCore::IDBTransaction::deactivate):
19         (WebCore::IDBTransaction::schedulePendingOperationTimer): Deleted.
20         * Modules/indexeddb/IDBTransaction.h:
21
22 2019-10-04  Chris Dumez  <cdumez@apple.com>
23
24         Unreviewed follow-up fix for r250693 to address assertion hits in debug.
25
26         * css/FontFaceSet.cpp:
27         (WebCore::FontFaceSet::didFirstLayout):
28         (WebCore::FontFaceSet::completedLoading):
29         Make sure the ready promise is not already resolved before resolving it.
30
31         * platform/SuspendableTaskQueue.cpp:
32         (WebCore::SuspendableTaskQueue::SuspendableTaskQueue):
33         * platform/SuspendableTaskQueue.h:
34         (WebCore::SuspendableTaskQueue::create):
35         Add a new constructor that takes in a Document since the ActiveDOMObject's
36         constructor taking a Document has some useful logic.
37
38 2019-10-04  Joonghun Park  <jh718.park@samsung.com>
39
40         Negative radii in radial gradients should be rejected.
41         https://bugs.webkit.org/show_bug.cgi?id=202412
42
43         Per the spec, https://drafts.csswg.org/css-images-3/#radial-gradients
44         "Negative values are invalid.",
45         we reject negative radii values in radial-gradient.
46
47         This patch rejects negative radii during radial-gradient parsing
48         for both webkit prefixed and non-prefixed ones.
49
50         Reviewed by Antti Koivisto.
51
52         Tests: imported/blink/css-parser/webkit-gradient.html
53                imported/w3c/web-platform-tests/compat/webkit-radial-gradient-radii.html
54                imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-invalid.html
55
56         * css/parser/CSSPropertyParserHelpers.cpp:
57         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
58         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
59         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
60
61 2019-10-04  Alex Christensen  <achristensen@webkit.org>
62
63         Move WKProcessPool._registerURLSchemeServiceWorkersCanHandle to _WKWebsiteDataStoreConfiguration
64         https://bugs.webkit.org/show_bug.cgi?id=202553
65
66         Reviewed by Youenn Fablet.
67
68         * workers/service/server/SWServer.cpp:
69         (WebCore::SWServer::SWServer):
70         * workers/service/server/SWServer.h:
71         (WebCore::SWServer::registeredSchemes const):
72         * workers/service/server/SWServerJobQueue.cpp:
73         (WebCore::SWServerJobQueue::runRegisterJob):
74
75 2019-10-04  youenn fablet  <youenn@apple.com>
76
77         AbortSignal does not always emit the abort signal
78         https://bugs.webkit.org/show_bug.cgi?id=201871
79         <rdar://problem/55451712>
80
81         Reviewed by Chris Dumez.
82
83         Make sure a JSAbortSignal is not GCed until objects that can abort it are gone.
84         This includes a followed signal and an AbortController.
85         Current WebKit implementation only uses following of one signal at a time.
86
87         Test: http/tests/fetch/abort-signal-gc.html
88
89         * Sources.txt:
90         * WebCore.xcodeproj/project.pbxproj:
91         * bindings/js/JSAbortControllerCustom.cpp: Added.
92         (WebCore::JSAbortController::visitAdditionalChildren):
93         * bindings/js/JSAbortSignalCustom.cpp: Added.
94         (WebCore::JSAbortSignalOwner::isReachableFromOpaqueRoots):
95         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
96         * dom/AbortController.idl:
97         * dom/AbortSignal.cpp:
98         (WebCore::AbortSignal::follow):
99         * dom/AbortSignal.h:
100         * dom/AbortSignal.idl:
101
102 2019-10-04  youenn fablet  <youenn@apple.com>
103
104         Allow to suspend RTCPeerConnection when not connected
105         https://bugs.webkit.org/show_bug.cgi?id=202403
106
107         Reviewed by Chris Dumez.
108
109         Implement suspend/resume in RTCPeerConnection by sending suspend/resume to the libwebrtc media endpoint,
110         which suspends/resumes its socket factory.
111
112         We allow suspension when the connection is not connected.
113         Pages with connected connections will not go in page cache yet.
114
115         Tests: webrtc/datachannel/datachannel-page-cache-send.html
116                webrtc/datachannel/datachannel-page-cache.html
117
118         * Modules/mediastream/PeerConnectionBackend.h:
119         (WebCore::PeerConnectionBackend::suspend):
120         (WebCore::PeerConnectionBackend::resume):
121         * Modules/mediastream/RTCPeerConnection.cpp:
122         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const):
123         (WebCore::RTCPeerConnection::suspend):
124         (WebCore::RTCPeerConnection::resume):
125         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
126         (WebCore::LibWebRTCMediaEndpoint::suspend):
127         (WebCore::LibWebRTCMediaEndpoint::resume):
128         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
129         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
130         (WebCore::LibWebRTCPeerConnectionBackend::suspend):
131         (WebCore::LibWebRTCPeerConnectionBackend::resume):
132         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
133         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
134
135 2019-10-04  Truitt Savell  <tsavell@apple.com>
136
137         Unreviewed, rolling out r250583.
138
139         Broke multiple internal API tests
140
141         Reverted changeset:
142
143         "[JSC] Place VM* in TLS"
144         https://bugs.webkit.org/show_bug.cgi?id=202391
145         https://trac.webkit.org/changeset/250583
146
147 2019-10-04  Alex Christensen  <achristensen@webkit.org>
148
149         Simplify sandbox enabling macros
150         https://bugs.webkit.org/show_bug.cgi?id=202536
151
152         Reviewed by Brent Fulgham.
153
154         * Configurations/FeatureDefines.xcconfig:
155
156 2019-10-04  Chris Lord  <clord@igalia.com>
157
158         ImageBitmap should be serializable
159         https://bugs.webkit.org/show_bug.cgi?id=202394
160
161         Reviewed by Žan Doberšek.
162
163         Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable.html
164
165         * bindings/js/SerializedScriptValue.cpp:
166         (WebCore::CloneSerializer::dumpImageBitmap):
167         (WebCore::CloneDeserializer::readTransferredImageBitmap):
168         (WebCore::CloneDeserializer::readImageBitmap):
169         (WebCore::CloneDeserializer::readTerminal):
170
171 2019-10-03  Antoine Quint  <graouts@apple.com>
172
173         AppleTV named as XSS-payloads trigger when AirPlay is used
174         https://bugs.webkit.org/show_bug.cgi?id=202534
175         <rdar://55931262>
176
177         Reviewed by Eric Carlson.
178
179         Ensure we escape an AirPlay's device name before inserting its name into the DOM.
180
181         * Modules/modern-media-controls/media/placard-support.js:
182         (PlacardSupport.prototype._updateAirPlayPlacard):
183         (PlacardSupport):
184         (escapeHTML):
185
186 2019-10-04  Oriol Brufau  <obrufau@igalia.com>
187
188         [css-grid] Preserve auto repeat() in getComputedStyle() for non-grids
189         https://bugs.webkit.org/show_bug.cgi?id=202258
190
191         Reviewed by Javier Fernandez.
192
193         Tests: imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html
194                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html
195                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html
196                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html
197
198         Usually, the resolved value of grid-template-rows/columns is the used
199         value, expanding the repeat() notation. But for elements with a non-grid
200         display, the resolved value is just the computed value, with repeat(),
201         since the used value doesn't exist.
202         Before this patch, the repeat() was dropped, and line names after it
203         appeared at the wrong position or were also dropped. There was also an
204         assert failure in debug. This patch fixes the serialization for auto
205         repeat(). Integer repeat() is still expanded at computed-value time, so
206         it's not preserved in getComputedStyle().
207
208         * css/CSSComputedStyleDeclaration.cpp:
209         (WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector):
210         (WebCore::OrderedNamedLinesCollectorInsideRepeat::OrderedNamedLinesCollectorInsideRepeat):
211         (WebCore::OrderedNamedLinesCollectorInGridLayout::OrderedNamedLinesCollectorInGridLayout):
212         (WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex const):
213         (WebCore::OrderedNamedLinesCollectorInsideRepeat::collectLineNamesForIndex const):
214         (WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const):
215         (WebCore::populateGridTrackList):
216         (WebCore::valueForGridTrackList):
217
218 2019-10-04  Antti Koivisto  <antti@apple.com>
219
220         [CSS Shadow Parts] Support 'exportparts' attribute
221         https://bugs.webkit.org/show_bug.cgi?id=202520
222
223         Reviewed by Ryosuke Niwa.
224
225         Support 'exportparts' attribute for exporting part mappings from subcomponents.
226
227         * css/ElementRuleCollector.cpp:
228         (WebCore::ElementRuleCollector::matchAuthorRules):
229         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
230
231         Recurse to containing scopes to collect part rules if there are exported mappings.
232
233         (WebCore::ElementRuleCollector::ruleMatches):
234         * css/ElementRuleCollector.h:
235         * css/SelectorChecker.cpp:
236         (WebCore::SelectorChecker::matchRecursively const):
237
238         Make ShadowDescendant fake combinator skip directly to the scope where the part rules are coming from.
239
240         (WebCore::SelectorChecker::checkOne const):
241
242         Resolve names via mappings if needed.
243
244         * css/SelectorChecker.h:
245         * dom/Element.cpp:
246         (WebCore::Element::attributeChanged):
247
248         Invalidate mappings as needed.
249
250         * dom/ShadowRoot.cpp:
251         (WebCore::parsePartMappings):
252
253         Parse the mappings microsyntax.
254
255         (WebCore::ShadowRoot::partMappings const):
256         (WebCore::ShadowRoot::invalidatePartMappings):
257         * dom/ShadowRoot.h:
258         * html/HTMLAttributeNames.in:
259
260 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
261
262         A newly inserted element doesn't get assigned to a named slot if slot assignments had already happened
263         https://bugs.webkit.org/show_bug.cgi?id=199733
264
265         Reviewed by Antti Koivisto.
266
267         The bug was caused by addSlotElementByName not invalidating slot assignments when a new slot element
268         is inserted after corresponding elements with the slot content attribute had already been inserted.
269
270         Fixed the bug by always invalidating the slot assignment when a new slot element is inserted.
271
272         Tests: fast/shadow-dom/add-slotted-element-after-assignment-1.html
273                fast/shadow-dom/add-slotted-element-after-assignment-2.html
274                fast/shadow-dom/add-slotted-element-after-assignment-3.html
275
276         * dom/SlotAssignment.cpp:
277         (WebCore::SlotAssignment::addSlotElementByName):
278
279 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
280
281         Radio button groups are not scoped by shadow boundaries
282         https://bugs.webkit.org/show_bug.cgi?id=199568
283
284         Reviewed by Antti Koivisto.
285
286         Fixed the bug that radio button groups are not scoped to each shadow tree by moving
287         RadioButtonGroups from FormController, which is a per-document object, to TreeScope.
288
289         Test: imported/w3c/web-platform-tests/shadow-dom/input-type-radio.html
290
291         * dom/RadioButtonGroups.h:
292         (WebCore::RadioButtonGroups): Made this bmalloc'ed now that it's allocated standalone.
293         * dom/TreeScope.cpp:
294         (WebCore::TreeScope::radioButtonGroups): Added.
295         * dom/TreeScope.h:
296         * html/FormController.h:
297         (WebCore::FormController::radioButtonGroups): Deleted.
298         * html/HTMLInputElement.cpp:
299         (WebCore::HTMLInputElement::~HTMLInputElement):
300         (WebCore::HTMLInputElement::removedFromAncestor): Update the radio button group here.
301         (WebCore::HTMLInputElement::didMoveToNewDocument): Removed the code to update radio
302         button group here since it's done in removedFromAncestor now. Note that insertion case
303         is alrady taken care of by HTMLInputElement::didFinishInsertingNode.
304         (WebCore::HTMLInputElement::radioButtonGroups const): Ditto.
305
306 2019-10-03  Antti Koivisto  <antti@apple.com>
307
308         [CSS Shadow Parts] Correct interaction with other pseudo elements
309         https://bugs.webkit.org/show_bug.cgi?id=202526
310
311         Reviewed by Ryosuke Niwa.
312
313         Cases like foo::part(bar)::before should work.
314
315         This patch doesn't cover ::placeholder which is implemented as PseudoElementWebKitCustom (like internal -webkit-* properties).
316
317         * css/CSSSelector.h:
318         (WebCore::isTreeStructuralPseudoClass):
319
320         Add a helper.
321
322         * css/parser/CSSSelectorParser.cpp:
323
324         Allow non-structural pseudo classes after ::part().
325         Allow other pseudo elements after ::part().
326
327         (WebCore::CSSSelectorParser::consumePseudo):
328
329         No need for DisallowPseudoElementsScope, we are just parsing identifiers.
330
331 2019-10-03  James Darpinian  <jdarpinian@chromium.org>
332
333         Fix WebGL 1 conformance regressions when USE_ANGLE=1
334         https://bugs.webkit.org/show_bug.cgi?id=202545
335
336         Prevent ANGLE from automatically using ES3 when ES2 is requested.
337
338         WEBGL_debug_shaders extension should not accept or return null.
339
340         Enable ANGLE's new support for emulating RGB on RGBA IOSurfaces.
341
342         Reviewed by Alex Christensen.
343
344         * html/canvas/WebGLDebugShaders.cpp:
345         (WebCore::WebGLDebugShaders::getTranslatedShaderSource):
346         * html/canvas/WebGLDebugShaders.h:
347         * html/canvas/WebGLDebugShaders.idl:
348         * html/canvas/WebGLRenderingContextBase.cpp:
349         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
350         * platform/graphics/angle/Extensions3DANGLE.cpp:
351         (WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
352         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
353         (WebCore::GraphicsContext3D::GraphicsContext3D):
354         * platform/graphics/cocoa/WebGLLayer.mm:
355         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
356
357 2019-10-03  Jer Noble  <jer.noble@apple.com>
358
359     [iOS] WebContent process can be interrupted during suspension; loses "Now Playing" status
360     https://bugs.webkit.org/show_bug.cgi?id=202537
361     <rdar://problem/55952707>
362
363     Reviewed by Eric Carlson.
364
365     Always deactivate the AVAudioSession when the last playing PlatformAudioSession ends playback and the application is in the background.
366
367     * platform/audio/PlatformMediaSessionManager.cpp:
368     (WebCore::PlatformMediaSessionManager::removeSession):
369     (WebCore::PlatformMediaSessionManager::processWillSuspend):
370     (WebCore::PlatformMediaSessionManager::maybeDeactivateAudioSession):
371     * platform/audio/PlatformMediaSessionManager.h:
372     (WebCore::PlatformMediaSessionManager::isApplicationInBackground const):
373     * platform/audio/ios/MediaSessionManagerIOS.h:
374     * platform/audio/ios/MediaSessionManagerIOS.mm:
375     (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
376
377 2019-10-03  Chris Dumez  <cdumez@apple.com>
378
379         Allow pages using FontFaceSet to enter the back/forward cache
380         https://bugs.webkit.org/show_bug.cgi?id=202476
381
382         Reviewed by Myles C. Maxfield.
383
384         Allow pages using FontFaceSet to enter the back/forward cache by updating its
385         implementation to queue all its tasks that run script to a SuspendableTaskQueue.
386         The SuspendableTaskQueue makes sure to properly suspend while in PageCache and
387         run the tasks when resuming from PageCache.
388
389         Test: http/tests/navigation/page-cache-fontfaceset.html
390
391         * PlatformWin.cmake:
392         * Sources.txt:
393         * WebCore.xcodeproj/project.pbxproj:
394         * css/CSSFontFace.cpp:
395         (WebCore::CSSFontFace::fontLoadEventOccurred):
396         * css/FontFaceSet.cpp:
397         (WebCore::FontFaceSet::FontFaceSet):
398         (WebCore::FontFaceSet::canSuspendForDocumentSuspension const):
399         (WebCore::FontFaceSet::didFirstLayout):
400         (WebCore::FontFaceSet::completedLoading):
401         (WebCore::FontFaceSet::faceFinished):
402         * css/FontFaceSet.h:
403
404         * platform/SuspendableTaskQueue.cpp: Added.
405         (WebCore::SuspendableTaskQueue::SuspendableTaskQueue):
406         (WebCore::SuspendableTaskQueue::close):
407         (WebCore::SuspendableTaskQueue::cancelAllTasks):
408         (WebCore::SuspendableTaskQueue::enqueueTask):
409         (WebCore::SuspendableTaskQueue::runOneTask):
410         (WebCore::SuspendableTaskQueue::activeDOMObjectName const):
411         (WebCore::SuspendableTaskQueue::canSuspendForDocumentSuspension const):
412         (WebCore::SuspendableTaskQueue::stop):
413         (WebCore::SuspendableTaskQueue::suspend):
414         (WebCore::SuspendableTaskQueue::resume):
415         * platform/SuspendableTaskQueue.h: Added.
416         (WebCore::SuspendableTaskQueue::create):
417         (WebCore::SuspendableTaskQueue::isClosed const):
418         (WebCore::SuspendableTaskQueue::hasPendingTasks const):
419         Add a SuspendableTaskQueue class which is Page-Cache aware and can be used to queue
420         generic tasks as WTF::Function<void<>> lambdas.
421
422 2019-10-03  Chris Dumez  <cdumez@apple.com>
423
424         Provisional / scheduled loads in subframes should not prevent a page from entering the back/forward cache
425         https://bugs.webkit.org/show_bug.cgi?id=202474
426
427         Reviewed by Alex Christensen.
428
429         Provisional / scheduled loads in subframes should not prevent a page from entering the back/forward cache.
430         To address the issue, we now make sure to stop all loads before checking for PageCache eligibility.
431
432         Test: fast/history/page-cache-quick-redirect-iframe.html
433
434         * history/PageCache.cpp:
435         (WebCore::PageCache::addIfCacheable):
436         * loader/FrameLoader.cpp:
437         (WebCore::FrameLoader::stopForPageCache):
438         * loader/FrameLoader.h:
439
440 2019-10-03  Chris Dumez  <cdumez@apple.com>
441
442         XMLHttpRequest sometimes prevents pages from entering the back/forward cache
443         https://bugs.webkit.org/show_bug.cgi?id=202434
444         <rdar://problem/55890340>
445
446         Reviewed by Geoffrey Garen.
447
448         XMLHttpRequest::canSuspendForDocumentSuspension() was returning false if the document has not fired
449         the window's load event, with a comment explaining that cancelling the XHR in the upon suspension
450         may cause the load event to get fired and thus run script when forbidden. However, we should only
451         return false if the XMLHttpRequest is actually loading (m_loader is not null). XHRs that are not
452         loading should never prevent page caching.
453
454         I saw failures to enter the back/forward cache on yandex.ru and taobao.com because of this.
455
456         Test: http/tests/navigation/page-cache-failed-xhr.html
457
458         * xml/XMLHttpRequest.cpp:
459         (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension const):
460
461 2019-10-03  John Wilander  <wilander@apple.com>
462
463         Resource Load Statistics: Downgrade document.referrer for all third-party iframes
464         https://bugs.webkit.org/show_bug.cgi?id=202506
465         <rdar://problem/55786397>
466
467         Reviewed by Brent Fulgham.
468
469         This change downgrades document.referrer for all third-party iframes if ITP/Resource Load Statistics
470         is enabled. The behavior matches the downgrade of all HTTP referrers for third-party resources
471         which landed in https://trac.webkit.org/changeset/250413/webkit.
472
473         Tests: http/tests/resourceLoadStatistics/downgrade-document-referrer-nested-third-party-iframe.html
474                http/tests/resourceLoadStatistics/downgrade-document-referrer-third-party-iframe.html
475                http/tests/resourceLoadStatistics/leave-empty-document-referrer-alone-third-party-iframe.html
476
477         * dom/Document.cpp:
478         (WebCore::Document::referrer):
479         (WebCore::Document::referrer const): Deleted.
480             Can no longer be const since it lazily downgrades and saves the referrer on read.
481         * dom/Document.h:
482
483 2019-10-03  Devin Rousso  <drousso@apple.com>
484
485         Web Inspector: remove `InspectorInstrumentationCookie`
486         https://bugs.webkit.org/show_bug.cgi?id=202487
487
488         Reviewed by Matt Baker.
489
490         All it does is create a shallow-copy of the `InstrumentingAgents` (it copies a pointer to
491         the `InstrumentingAgents` object, so any of the pointers to the `InspectorAgent` that are
492         contained therein are shared between each instance) and save the tracking
493         `InspectorTimelineAgent`'s id (monotonically increasing integer).
494
495         All uses of `InspectorInstrumentationCookie` are local values, so there's no way that the
496         `InspectorTimelineAgent` (or the id) could change in between an
497         `InspectorInstrumentation::will*` and an `InspectorInstrumentation::did*`, as both the
498         tracking state and id are controlled by the frontend and cannot "interrupt".
499
500         Removing `InspectorInstrumentationCookie` _can_ cause issues is in situations where the
501         `ScriptExecutionContext` (or `Page`) changes between the `InspectorInstrumentation::will*`
502         and the `InspectorInstrumentation::did*`, but this can be avoided so long as a pointer to
503         the "context" used for `InspectorInstrumentation::will*` is saved.
504
505         Covered by existing tests: inspector/timeline/*
506
507         * inspector/InspectorInstrumentationCookie.h: Removed.
508         * inspector/InspectorInstrumentationCookie.cpp: Removed.
509
510         * inspector/agents/InspectorTimelineAgent.h:
511         * inspector/agents/InspectorTimelineAgent.cpp:
512         (WebCore::InspectorTimelineAgent::internalStop):
513         (WebCore::InspectorTimelineAgent::didDispatchEvent):
514         (WebCore::InspectorTimelineAgent::didPaint):
515         (WebCore::InspectorTimelineAgent::clearRecordStack): Deleted.
516
517         * bindings/js/JSCallbackData.cpp:
518         (WebCore::JSCallbackData::invokeCallback):
519         * bindings/js/JSCustomElementInterface.cpp:
520         (WebCore::constructCustomElementSynchronously):
521         (WebCore::JSCustomElementInterface::upgradeElement):
522         (WebCore::JSCustomElementInterface::invokeCallback):
523         * bindings/js/JSErrorHandler.cpp:
524         (WebCore::JSErrorHandler::handleEvent):
525         * bindings/js/JSEventListener.cpp:
526         (WebCore::JSEventListener::handleEvent):
527         * bindings/js/JSExecState.h:
528         * bindings/js/JSExecStateInstrumentation.h:
529         (WebCore::JSExecState::instrumentFunctionInternal):
530         (WebCore::JSExecState::instrumentFunctionCall):
531         (WebCore::JSExecState::instrumentFunctionConstruct):
532         * bindings/js/ScheduledAction.cpp:
533         (WebCore::ScheduledAction::executeFunctionInContext):
534         * bindings/js/ScriptController.cpp:
535         (WebCore::ScriptController::evaluateInWorld):
536         (WebCore::ScriptController::evaluateModule):
537         * dom/Document.cpp:
538         (WebCore::Document::resolveStyle):
539         * dom/EventTarget.cpp:
540         (WebCore::EventTarget::innerInvokeEventListeners):
541         * dom/MutationObserver.cpp:
542         (WebCore::MutationObserver::deliver):
543         * dom/ScriptedAnimationController.cpp:
544         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
545         * page/DOMTimer.cpp:
546         (WebCore::DOMTimer::fired):
547         * page/DOMWindow.cpp:
548         (WebCore::DOMWindow::dispatchEvent):
549         * page/FrameViewLayoutContext.cpp:
550         (WebCore::FrameViewLayoutContext::layout):
551         * page/IntersectionObserver.cpp:
552         (WebCore::IntersectionObserver::notify):
553         * page/PerformanceObserver.cpp:
554         (WebCore::PerformanceObserver::deliver):
555
556         * inspector/InspectorInstrumentation.h:
557         (WebCore::InspectorInstrumentation::willCallFunction):
558         (WebCore::InspectorInstrumentation::didCallFunction):
559         (WebCore::InspectorInstrumentation::willDispatchEvent):
560         (WebCore::InspectorInstrumentation::didDispatchEvent):
561         (WebCore::InspectorInstrumentation::willDispatchEventOnWindow):
562         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
563         (WebCore::InspectorInstrumentation::willEvaluateScript):
564         (WebCore::InspectorInstrumentation::didEvaluateScript):
565         (WebCore::InspectorInstrumentation::willFireTimer):
566         (WebCore::InspectorInstrumentation::didFireTimer):
567         (WebCore::InspectorInstrumentation::willLayout):
568         (WebCore::InspectorInstrumentation::didLayout):
569         (WebCore::InspectorInstrumentation::willRecalculateStyle):
570         (WebCore::InspectorInstrumentation::didRecalculateStyle):
571         (WebCore::InspectorInstrumentation::willFireAnimationFrame):
572         (WebCore::InspectorInstrumentation::didFireAnimationFrame):
573         (WebCore::InspectorInstrumentation::willFireObserverCallback):
574         (WebCore::InspectorInstrumentation::didFireObserverCallback):
575         * inspector/InspectorInstrumentation.cpp:
576         (WebCore::InspectorInstrumentation::willCallFunctionImpl):
577         (WebCore::InspectorInstrumentation::didCallFunctionImpl):
578         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
579         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
580         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
581         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
582         (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
583         (WebCore::InspectorInstrumentation::didEvaluateScriptImpl):
584         (WebCore::InspectorInstrumentation::willFireTimerImpl):
585         (WebCore::InspectorInstrumentation::didFireTimerImpl):
586         (WebCore::InspectorInstrumentation::willLayoutImpl):
587         (WebCore::InspectorInstrumentation::didLayoutImpl):
588         (WebCore::InspectorInstrumentation::willRecalculateStyleImpl):
589         (WebCore::InspectorInstrumentation::didRecalculateStyleImpl):
590         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
591         (WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
592         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
593         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
594         (WebCore::InspectorInstrumentation::retrieveTimelineAgent): Deleted.
595
596         * Sources.txt:
597         * WebCore.xcodeproj/project.pbxproj:
598
599 2019-10-03  Sihui Liu  <sihui_liu@apple.com>
600
601         IndexedDB: add size estimate for key path when estimate task size
602         https://bugs.webkit.org/show_bug.cgi?id=202480
603
604         Reviewed by Geoffrey Garen.
605
606         No observable behavior change.
607
608         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
609         (WebCore::IDBServer::estimateSize):
610
611 2019-10-03  youenn fablet  <youenn@apple.com>
612
613         Regression: iOS 13.1 MediaStreamTrack.enabled = false kills audio track
614         https://bugs.webkit.org/show_bug.cgi?id=202405
615         <rdar://problem/55922616>
616
617         Reviewed by Eric Carlson.
618
619         When the web page is setting enabled to false, media session might change from PlayRecord to None.
620         This might trigger CoreAudio to no longer output audio samples, thus triggering our audio capture failure timer.
621         This would end the track after 2 seconds.
622         Given audio tracks can be reenabled by a web page, we should not change the Media Session setup based on that.
623         This patch updates MediaStream::mediaType to return independently of the enabled state.
624
625         Add internals API to write a cross platform test.
626
627         Test: fast/mediastream/audio-track-enabled.html
628         Manually tested as well.
629
630         * Modules/mediastream/MediaStream.cpp:
631         (WebCore::MediaStream::mediaType const):
632         * platform/mediastream/MediaStreamPrivate.cpp:
633         (WebCore::MediaStreamPrivate::hasCaptureAudioSource const):
634         * testing/Internals.cpp:
635         (WebCore::Internals::supportsAudioSession const):
636         (WebCore::Internals::audioSessionCategory const):
637         * testing/Internals.h:
638         * testing/Internals.idl:
639
640 2019-10-03  youenn fablet  <youenn@apple.com>
641
642         http/tests/security/navigate-when-restoring-cached-page.html should not use RTCPeerConnection to not enter in page cache
643         https://bugs.webkit.org/show_bug.cgi?id=202521
644
645         Reviewed by Chris Dumez.
646
647         Introduce a dummy ActiveDOMObject which can never be suspended for document suspension.
648         Allow a page to create this dummy ActiveDOMObject through internals.
649         Covered by updated test.
650
651         * dom/ActiveDOMObject.h:
652         * testing/Internals.cpp:
653         (WebCore::Internals::preventDocumentForEnteringPageCache):
654         * testing/Internals.h:
655         * testing/Internals.idl:
656
657 2019-10-03  Tim Horton  <timothy_horton@apple.com>
658
659         WebKit doesn't build with trunk clang
660         https://bugs.webkit.org/show_bug.cgi?id=202511
661
662         Reviewed by Anders Carlsson.
663
664         * Modules/fetch/FetchLoader.h:
665         * Modules/geolocation/Geolocation.h:
666         * Modules/indexeddb/IDBTransaction.h:
667         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
668         * Modules/indexeddb/shared/InProcessIDBServer.h:
669         * Modules/notifications/Notification.cpp:
670         * Modules/notifications/Notification.h:
671         * platform/graphics/ca/TileController.h:
672         * workers/service/context/ServiceWorkerThreadProxy.h:
673         Fix the build by exporting destructors and custom delete operators.
674         I don't know why this changed, but trunk clang insists.
675         There are also some new warnings; this only fixes the hard errors.
676
677 2019-10-03  Tim Horton  <timothy_horton@apple.com>
678
679         Yet another build fix
680
681         * css/typedom/TypedOMCSSImageValue.h:
682         Forward declare Document.
683
684 2019-10-03  Jiewen Tan  <jiewen_tan@apple.com>
685
686         Support googleLegacyAppidSupport extension
687         https://bugs.webkit.org/show_bug.cgi?id=202427
688         <rdar://problem/55887473>
689
690         Reviewed by Brent Fulgham.
691
692         This patch adds support for googleLegacyAppidSupport extension, when set:
693         1) user agent should only use the U2F transport protocol,
694         2) should only communicate with roaming authenticators, and
695         3) should use a hard-coded appID of https://www.gstatic.com/securitykey/origins.json.
696         To be noticed as the name implies, this extension is exclusively for RP ID = google.com.
697
698         Implementation wise, all operations are captured in methods with name processGoogleLegacyAppIdSupportExtension.
699         1) AuthenticatorCoordinator takes care of setting the value.
700         2) U2fCommandConstructor takes care of hard coding the AppID.
701         3) AuthenticatorManager takes care of removing AuthenticatorTransport::Internal from TransportSet, so startDiscovery
702         will not poke platform authenticators.
703         4) CtapAuthenticator takes care of downgrading to U2fAuthenticator.
704         5) U2fAuthenticator takes care of setting the AppID in the response.
705
706         Partially covered by new test cases in existing tests, and remaining will be covered by manual tests.
707
708         * Modules/webauthn/AuthenticationExtensionsClientInputs.h:
709         (WebCore::AuthenticationExtensionsClientInputs::encode const):
710         (WebCore::AuthenticationExtensionsClientInputs::decode):
711         * Modules/webauthn/AuthenticationExtensionsClientInputs.idl:
712         * Modules/webauthn/AuthenticatorCoordinator.cpp:
713         (WebCore::AuthenticatorCoordinatorInternal::processGoogleLegacyAppIdSupportExtension):
714         (WebCore::AuthenticatorCoordinator::create const):
715         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
716         (WebCore::PublicKeyCredentialCreationOptions::encode const):
717         (WebCore::PublicKeyCredentialCreationOptions::decode):
718         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
719         (fido::convertToU2fRegisterCommand):
720         (fido::processGoogleLegacyAppIdSupportExtension):
721         * Modules/webauthn/fido/U2fCommandConstructor.h:
722
723 2019-10-03  Yury Semikhatsky  <yurys@chromium.org>
724
725         Web Inspector: tests under LayoutTests/inspector/debugger are flaky
726         https://bugs.webkit.org/show_bug.cgi?id=137131
727         <rdar://problem/18461335>
728
729         Reviewed by Devin Rousso.
730
731         Fix debugger tests on GTK. All tests that pause on breakpoint didn't work because
732         in layout tests InspectorFrontendClientLocal was using Timer to dispatch commands
733         sent from the local front-end page to the inspected one. When paused inside a script
734         triggered by the front-end nested timer event would be scheduled but never fired
735         because in glib implementation of RunLoop::TimerBase uses event source which doesn't
736         allow recursion (g_source_set_can_recurse is not called on the source), so dispatching
737         Debugger.resume command didn't work when paused inside another inspector command (e.g.
738         eval). RunLoop itself uses event source which does allow recursion. So instead of using
739         a timer for asynchronous command dispatching with delay=0 we now schedule a task in
740         RunLoop's queue.
741
742         * inspector/InspectorFrontendClientLocal.cpp:
743         (WebCore::InspectorBackendDispatchTask::dispatch):
744         (WebCore::InspectorBackendDispatchTask::reset):
745         (WebCore::InspectorBackendDispatchTask::InspectorBackendDispatchTask):
746         (WebCore::InspectorBackendDispatchTask::scheduleOneShot): ensures that there is one inspector
747         dispatch task in the queue.
748         (WebCore::InspectorBackendDispatchTask::dispatchOneMessage): this is mostly the same behavior
749         as was with timerFired, we should be able to dispatch all accumulated messages from the queue
750         in one batch but for now I'd like to keep it one per iteration.
751
752 2019-10-03  Joonghun Park  <pjh0718@gmail.com>
753
754         CSS ellipse() doesn't accept single <shape-radius>
755         https://bugs.webkit.org/show_bug.cgi?id=181745
756
757         CSS ellipse() should only accept 0 or 2 radii.
758         The corresponding csswg discussion is
759         https://github.com/w3c/csswg-drafts/issues/2175.
760
761         Reviewed by Antti Koivisto.
762
763         Tests: imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-computed.html
764                imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-invalid.html
765                imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-valid.html
766                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-computed.html
767                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-invalid.html
768                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-valid.html
769
770         * css/CSSBasicShapes.cpp:
771         (WebCore::CSSBasicShapeEllipse::cssText const):
772         * css/parser/CSSPropertyParser.cpp:
773         (WebCore::consumeBasicShapeEllipse):
774
775 2019-10-03  Zan Dobersek  <zdobersek@igalia.com>
776
777         [Nicosia] Enable runtime checks and triggers for async non-main-frame scrolling
778         https://bugs.webkit.org/show_bug.cgi?id=202509
779
780         Reviewed by Carlos Garcia Campos.
781
782         Add build guards that would enable runtime checks of the asynchronous
783         frame scrolling setting in the ScrollingCoordinator and
784         RenderLayerCompositor classes for the Nicosia-using ports.
785
786         The check in ScrollingCoordinator avoids bailing on coordinating
787         scrolling for non-main frames when the setting is enabled. The check in
788         RenderLayerCompositor avoids imposing a requirement for a composition
789         layer for any non-main frame when the setting is disabled.
790
791         * page/scrolling/ScrollingCoordinator.cpp:
792         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView const):
793         * rendering/RenderLayerCompositor.cpp:
794         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
795
796 2019-10-02  Antti Koivisto  <antti@apple.com>
797
798         [CSS Shadow Parts] Support multiple arguments for ::part()
799         https://bugs.webkit.org/show_bug.cgi?id=202482
800
801         Reviewed by Ryosuke Niwa.
802
803         Support ::part(foo bar).
804
805         * css/CSSSelector.cpp:
806         (WebCore::CSSSelector::selectorText const):
807         (WebCore::CSSSelector::setArgumentList):
808         (WebCore::CSSSelector::setLangArgumentList): Deleted.
809
810         Give this a more generic name and use it for ::part() too.
811
812         * css/CSSSelector.h:
813         (WebCore::CSSSelector::argumentList const):
814         (WebCore::CSSSelector::langArgumentList const): Deleted.
815         * css/SelectorChecker.cpp:
816         (WebCore::SelectorChecker::checkOne const):
817
818         Match only if all parts are found from the element 'part' attribute.
819
820         * css/parser/CSSParserSelector.cpp:
821         (WebCore::CSSParserSelector::setArgumentList):
822         (WebCore::CSSParserSelector::setLangArgumentList): Deleted.
823         * css/parser/CSSParserSelector.h:
824         * css/parser/CSSSelectorParser.cpp:
825         (WebCore::CSSSelectorParser::consumePseudo):
826
827         Parse the list.
828
829         * cssjit/SelectorCompiler.cpp:
830         (WebCore::SelectorCompiler::addPseudoClassType):
831
832 2019-10-02  Andy Estes  <aestes@apple.com>
833
834         [iOS] When hit testing for a context menu interaction, do not consider whether the element is contenteditable
835         https://bugs.webkit.org/show_bug.cgi?id=202498
836         <rdar://problem/54723131>
837
838         Reviewed by Tim Horton.
839
840         When the user selects a context menu action, WebKit performs a hit test in order to find the
841         acted-on element on the page. This is separate from the hit test performed to generate the
842         context menu's targeted preview. Since an arbitrary amount of time can elapse between
843         preview generation and action selection, this second hit-tests might return a different
844         element.
845
846         One case where we know a different element can be returned is in apps that dynamically
847         enable and disable editing. If editing is disabled when the first hit test occurs but is
848         enabled when the second one occurs, different elements will be returned due to
849         Frame::qualifyingNodeAtViewportLocation preferring to return the root editable element when
850         the approximate node is contenteditable.
851
852         While the appropriate long-term fix is to only hit-test once and use that element for both
853         preview generation and action selection, this patch implements a short-term fix to address
854         the specific problem in rdar://problem/54723131 by disabling the contenteditable behavior
855         described above for context menu interaction hit testing.
856
857         The long-term fix is tracked by <https://webkit.org/b/202499>.
858
859         * page/Frame.h:
860         * page/ios/FrameIOS.mm:
861         (WebCore::Frame::qualifyingNodeAtViewportLocation):
862         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
863         (WebCore::ancestorRespondingToClickEventsNodeQualifier):
864         (WebCore::Frame::nodeRespondingToClickEvents):
865         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
866         (WebCore::Frame::nodeRespondingToInteraction):
867         (WebCore::Frame::nodeRespondingToScrollWheelEvents):
868
869 2019-10-02  Antti Koivisto  <antti@apple.com>
870
871         [CSS Shadow Parts] Basic ::part() pseudo element support
872         https://bugs.webkit.org/show_bug.cgi?id=202456
873
874         Reviewed by Ryosuke Niwa.
875
876         Implement basic parsing and selector matching for ::part() pseudo element.
877
878         * css/CSSSelector.cpp:
879         (WebCore::CSSSelector::pseudoId):
880         (WebCore::CSSSelector::parsePseudoElementType):
881         (WebCore::CSSSelector::selectorText const):
882         * css/CSSSelector.h:
883         * css/ElementRuleCollector.cpp:
884         (WebCore::ElementRuleCollector::matchAuthorRules):
885         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
886         * css/ElementRuleCollector.h:
887         * css/RuleSet.cpp:
888         (WebCore::RuleSet::addRule):
889         * css/RuleSet.h:
890         (WebCore::RuleSet::partPseudoElementRules const):
891         * css/SelectorChecker.cpp:
892         (WebCore::SelectorChecker::checkOne const):
893         * css/SelectorPseudoElementTypeMap.in:
894         * css/parser/CSSParserSelector.cpp:
895         (WebCore::CSSParserSelector::parsePseudoElementSelector):
896
897         Also added ::slotted to SelectorPseudoElementTypeMap.in to resolve a FIXME here.
898
899         * css/parser/CSSParserSelector.h:
900         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching const):
901         * css/parser/CSSSelectorParser.cpp:
902         (WebCore::isOnlyPseudoElementFunction):
903         (WebCore::CSSSelectorParser::consumePseudo):
904
905         Parse single values only, multipart ::part(foo bar) case is not yet handled.
906
907         * dom/Element.cpp:
908         (WebCore::Element::partNames const):
909
910 2019-10-02  Antoine Quint  <graouts@apple.com>
911
912         Adopt copyToVector() in AnimationTimeline::animationsForElement()
913         https://bugs.webkit.org/show_bug.cgi?id=202488
914
915         Reviewed by Wenson Hsieh.
916
917         * animation/AnimationTimeline.cpp:
918         (WebCore::AnimationTimeline::animationsForElement const):
919
920 2019-10-02  Thibault Saunier  <tsaunier@igalia.com>
921
922         [GStreamer] Let playbin handle redirects for us when appropriate
923         https://bugs.webkit.org/show_bug.cgi?id=195326
924
925         A simplified mechanism has been added in GStreamer to handle corner cases.
926
927         Reviewed by Xabier Rodriguez-Calvar.
928
929         Not easily testable at our level
930
931         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
932         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
933
934 2019-10-02  Tim Horton  <timothy_horton@apple.com>
935
936         Another build fix
937
938         * css/typedom/TypedOMCSSImageValue.cpp:
939         (WebCore::TypedOMCSSImageValue::TypedOMCSSImageValue):
940         * css/typedom/TypedOMCSSImageValue.h:
941         I feel like I am actively being thwarted.
942
943 2019-10-02  Tim Horton  <timothy_horton@apple.com>
944
945         Another build fix
946
947         * css/typedom/TypedOMCSSImageValue.h:
948
949 2019-10-02  Tim Horton  <timothy_horton@apple.com>
950
951         Try to fix the Windows build
952
953         * css/typedom/TypedOMCSSImageValue.cpp:
954         (WebCore::TypedOMCSSImageValue::document const):
955         * css/typedom/TypedOMCSSImageValue.h:
956         Out-of-line this instead of including Document.h in TypedOMCSSImageValue,
957         which was an earlier build fix from r250610.
958
959         * platform/graphics/cg/GradientCG.cpp:
960         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
961         * platform/graphics/win/GraphicsContextCGWin.cpp:
962         Try to fix the build.
963
964 2019-10-02  Keith Rollin  <krollin@apple.com>
965
966         Unreviewed build fix after r250595.
967
968         macCatalyst appears to have triggered the the problem where the build
969         can sometimes fail if the unified sources mechanism doesn't group
970         together the right set of files.
971
972         * css/typedom/TypedOMCSSImageValue.h:
973
974 2019-10-02  Antoine Quint  <graouts@apple.com>
975
976         [Web Animations] Implement replaced animations
977         https://bugs.webkit.org/show_bug.cgi?id=202190
978         <rdar://55697719>
979
980         Reviewed by Dean Jackson.
981
982         Implementing section "5.5 Replacing Animations" (https://drafts.csswg.org/web-animations/#replacing-animations) of the Web Animations
983         specification which allows for Web Animations to be destroyed when they are superseded by another animation and the developer doesn't
984         explicitly opt into persisting them using the persist() method.
985
986         An animation is marked as replaceable (to sum up) when it's finished and another animation for the same property takes precedence.
987         As part of DocumentTimeline::internalUpdateAnimationsAndSendEvents(), we'll go through all replaceable animations, dispatch a "remove"
988         DOM event, and remove them from our list of animations.
989
990         We also make a couple of fixes in this patch that were uncovered while working on the WPT tests for replaced animations:
991         
992         - we would incorrectly parse single values for a property that allows lists (change in KeyframeEffect's processKeyframeLikeObject())
993         - we didn't account for the position in the global animation list when sorted animations by composite order (AnimationTimeline::animationsForElement())
994
995         Finally, to get more readable results, we implement a stub of commitStyles(). Its full implementation is tracked by http://wkb.ug/202193.
996
997         * animation/AnimationTimeline.cpp:
998         (WebCore::AnimationTimeline::animationTimingDidChange): Mark the position of the animation in the global animation list, to which it may only be added once.
999         (WebCore::AnimationTimeline::animationsForElement const): Account for the animation's position in the global animation when sorting.
1000         * animation/DeclarativeAnimation.cpp:
1001         (WebCore::DeclarativeAnimation::bindingsReplaceState const): Flush pending styles when querying the ready state for a declarative animation.
1002         * animation/DeclarativeAnimation.h:
1003         * animation/DocumentTimeline.cpp:
1004         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Run the "remove replaced animations" procedure as the second step in the "update animations
1005         and send events" procedure.
1006         (WebCore::DocumentTimeline::animationCanBeRemoved): Determine whether a given animation may be removed based on its finished state, replace state and whether
1007         it is fully superseded by another animation targeting the same property on the same target element.
1008         (WebCore::DocumentTimeline::removeReplacedAnimations): Remove any removable animation and dispatch a "remove" DOM event for each removed animation. 
1009         * animation/DocumentTimeline.h:
1010         * animation/KeyframeEffect.cpp:
1011         (WebCore::processKeyframeLikeObject): Fix an issue found in a replaced animations WPT test that showed that we didn't record the value of an animation that allows lists.
1012         * animation/WebAnimation.cpp:
1013         (WebCore::WebAnimation::isReplaceable const):
1014         (WebCore::WebAnimation::persist): Mark the replace state as "persisted" and ensure the animation is set on the animation list for its target element in case it had already
1015         been removed based on its persisted state.
1016         (WebCore::WebAnimation::commitStyles): Stub for a new function.
1017         * animation/WebAnimation.h:
1018         (WebCore::WebAnimation::replaceState const):
1019         (WebCore::WebAnimation::setReplaceState):
1020         (WebCore::WebAnimation::bindingsReplaceState const):
1021         (WebCore::WebAnimation::globalPosition const):
1022         (WebCore::WebAnimation::setGlobalPosition):
1023         * animation/WebAnimation.idl:
1024         * dom/EventNames.h: Add the new "remove" event so that the "onremove" DOM property is available on Animation objects. 
1025
1026 2019-10-02  Zan Dobersek  <zdobersek@igalia.com>
1027
1028         Unreviewed build fix in Nicosia's ScrollingTreePositionedNode class.
1029
1030         * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp:
1031         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
1032         Fix the name of the variable included in the log call.
1033
1034 2019-10-02  youenn fablet  <youenn@apple.com>
1035
1036         Use strongly typed identifiers for webrtc sockets
1037         https://bugs.webkit.org/show_bug.cgi?id=202400
1038
1039         Reviewed by Chris Dumez.
1040
1041         No observable change of behavior.
1042
1043         * Headers.cmake:
1044         * WebCore.xcodeproj/project.pbxproj:
1045         * platform/mediastream/libwebrtc/LibWebRTCSocketIdentifier.h: Copied from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocket.h.
1046
1047 2019-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1048
1049         [GTK][WPE] Stop using legacy custom protocol implementation
1050         https://bugs.webkit.org/show_bug.cgi?id=202407
1051
1052         Reviewed by Žan Doberšek.
1053
1054         Remove the code to setup custom protocols in soup session.
1055
1056         * platform/network/soup/SoupNetworkSession.cpp:
1057         (WebCore::SoupNetworkSession::SoupNetworkSession):
1058         * platform/network/soup/SoupNetworkSession.h:
1059
1060 2019-10-02  Zan Dobersek  <zdobersek@igalia.com>
1061
1062         [Nicosia] Enable async scrolling at build-time for Nicosia-using ports
1063         https://bugs.webkit.org/show_bug.cgi?id=202397
1064
1065         Reviewed by Carlos Garcia Campos.
1066
1067         * PlatformPlayStation.cmake: Add missing build targets.
1068         * SourcesGTK.txt: Ditto.
1069
1070 2019-10-01  Tim Horton  <timothy_horton@apple.com>
1071
1072         Clean up some includes to make the build a bit faster
1073         https://bugs.webkit.org/show_bug.cgi?id=202444
1074
1075         Reviewed by Geoff Garen.
1076
1077         No new tests, just reorganizing.
1078
1079         Apply some profile-guided optimizations to our headers.
1080
1081         * bindings/js/CallTracerTypes.h:
1082         * css/typedom/TypedOMCSSImageValue.h:
1083         * html/canvas/WebGLObject.h:
1084         * html/canvas/WebGLVertexArrayObjectBase.h:
1085         * inspector/InspectorInstrumentation.cpp:
1086         (WebCore::InspectorInstrumentation::instrumentingAgentsForWebGPUDevice):
1087         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
1088         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
1089         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
1090         * inspector/InspectorInstrumentation.h:
1091         (WebCore::InspectorInstrumentation::didCreateWebGPUDevice):
1092         (WebCore::InspectorInstrumentation::willDestroyWebGPUDevice):
1093         (WebCore::InspectorInstrumentation::didCreateWebGPUPipeline):
1094         * platform/graphics/BitmapImage.cpp:
1095         * platform/graphics/Font.h:
1096         * platform/graphics/cg/GraphicsContextCG.cpp:
1097         (WebCore::getUserToBaseCTM):
1098         * platform/graphics/cg/GraphicsContextCG.h:
1099         (WebCore::getUserToBaseCTM): Deleted.
1100         * platform/graphics/cg/ImageBufferCG.cpp:
1101         * platform/graphics/cocoa/IOSurface.h:
1102         * platform/graphics/mac/PDFDocumentImageMac.mm:
1103         InspectorInstrumentation.h is one of the most expensive headers in the entire project.
1104         While not included in many places (70), it is fairly straightforward to reduce
1105         its per-inclusion cost by rougly 80%.
1106
1107 2019-10-01  Alex Christensen  <achristensen@webkit.org>
1108
1109         Progress towards a functioning CMake build on Mac
1110         https://bugs.webkit.org/show_bug.cgi?id=202443
1111
1112         Rubber-stamped by Tim Horton.
1113
1114         * testing/Internals.mm:
1115
1116 2019-10-01  John Wilander  <wilander@apple.com>
1117
1118         Storage Access API: document.hasStorageAccess() should return true when the cookie policy allows access
1119         https://bugs.webkit.org/show_bug.cgi?id=202435
1120         <rdar://problem/55718526>
1121
1122         Reviewed by Brent Fulgham.
1123
1124         WebKit's Storage Access API implementation has so far only looked at whether ITP is
1125         blocking cookie access or not. However, the default cookie policy is still in
1126         effect underneath ITP. document.hasStorageAccess() should return true if the
1127         third-party:
1128         a) is not classified by ITP, and
1129         b) has cookies which implies it can use cookies as third-party according to the
1130         default cookie policy.
1131
1132         Tests: http/tests/storageAccess/has-storage-access-false-by-default-ephemeral.html
1133                http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral.html
1134                http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies.html
1135
1136         * platform/network/NetworkStorageSession.h:
1137         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1138         (WebCore::NetworkStorageSession::hasCookies const):
1139         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1140         (WebCore::NetworkStorageSession::hasCookies const):
1141             Not yet implemented. Always says false.
1142         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1143         (WebCore::NetworkStorageSession::hasCookies const):
1144             Not yet implemented. Always says false.
1145
1146 2019-10-01  Tim Horton  <timothy_horton@apple.com>
1147
1148         Clean up some includes to make the build a bit faster
1149         https://bugs.webkit.org/show_bug.cgi?id=202437
1150
1151         Reviewed by Jer Noble.
1152
1153         * Modules/webaudio/PannerNode.h:
1154         * Modules/webaudio/RealtimeAnalyser.h:
1155         * platform/audio/HRTFPanner.h:
1156         FFTFrame includes Accelerate.h, which is quite expensive.
1157
1158 2019-10-01  Antti Koivisto  <antti@apple.com>
1159
1160         [CSS Shadow Parts] Parse 'part' attribute
1161         https://bugs.webkit.org/show_bug.cgi?id=202409
1162
1163         Reviewed by Ryosuke Niwa.
1164
1165         Add parsing for Element 'part' attribute and the IDL interface.
1166         Also add a feature flag for CSS Shadow Parts.
1167
1168         * dom/Element.cpp:
1169         (WebCore::Element::attributeChanged):
1170         (WebCore::isNonEmptyTokenList):
1171         (WebCore::Element::classAttributeChanged):
1172         (WebCore::Element::partAttributeChanged):
1173         (WebCore::Element::partNames const):
1174         (WebCore::Element::part):
1175         (WebCore::classStringHasClassName): Deleted.
1176         * dom/Element.h:
1177         * dom/Element.idl:
1178         * dom/ElementRareData.cpp:
1179         * dom/ElementRareData.h:
1180         (WebCore::ElementRareData::partList const):
1181         (WebCore::ElementRareData::setPartList):
1182         (WebCore::ElementRareData::partNames const):
1183         (WebCore::ElementRareData::setPartNames):
1184         * html/HTMLAttributeNames.in:
1185         * page/RuntimeEnabledFeatures.h:
1186         (WebCore::RuntimeEnabledFeatures::setCSSShadowPartsEnabled):
1187         (WebCore::RuntimeEnabledFeatures::cssShadowPartsEnabled const):
1188
1189 2019-10-01  Yusuke Suzuki  <ysuzuki@apple.com>
1190
1191         [JSC] Place VM* in TLS
1192         https://bugs.webkit.org/show_bug.cgi?id=202391
1193
1194         Reviewed by Mark Lam.
1195
1196         Use JSLockHolder instead. It automatically puts VM* in TLS.
1197
1198         * bindings/js/IDBBindingUtilities.cpp:
1199         (WebCore::toJS):
1200         (WebCore::deserializeIDBValueToJSValue):
1201
1202 2019-10-01  youenn fablet  <youenn@apple.com>
1203
1204         Queue events and promise resolution in RTCPeerConnection when suspended for page cache
1205         https://bugs.webkit.org/show_bug.cgi?id=202396
1206
1207         Reviewed by Chris Dumez.
1208
1209         This patch prepares RTCPeerConnection to be suspendable to enter page cache.
1210         For that purpose, we queue events and promise resolution/rejection tasks if the RTCPeerConnection m_shouldDelayTasks is set to true.
1211         This queueing is enabled when RTCPeerConnection is asked to suspend itself.
1212         The queued tasks are then executed at resume time.
1213         Renamed fireEvent to dispatchEventWhenFeasible.
1214         No change of behavior for now.
1215
1216         * Modules/mediastream/PeerConnectionBackend.cpp:
1217         (WebCore::PeerConnectionBackend::createOfferSucceeded):
1218         (WebCore::PeerConnectionBackend::createOfferFailed):
1219         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
1220         (WebCore::PeerConnectionBackend::createAnswerFailed):
1221         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
1222         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
1223         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
1224         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
1225         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
1226         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
1227         * Modules/mediastream/RTCPeerConnection.cpp:
1228         (WebCore::RTCPeerConnection::doClose):
1229         (WebCore::RTCPeerConnection::suspend):
1230         (WebCore::RTCPeerConnection::resume):
1231         (WebCore::RTCPeerConnection::updateIceGatheringState):
1232         (WebCore::RTCPeerConnection::updateIceConnectionState):
1233         (WebCore::RTCPeerConnection::updateConnectionState):
1234         (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
1235         (WebCore::RTCPeerConnection::doTask):
1236         (WebCore::RTCPeerConnection::fireEvent):
1237         * Modules/mediastream/RTCPeerConnection.h:
1238
1239 2019-10-01  Brent Fulgham  <bfulgham@apple.com>
1240
1241         [FTW] Correct additional canvas test failures
1242         https://bugs.webkit.org/show_bug.cgi?id=202388
1243
1244         Reviewed by Fujii Hironori.
1245
1246         This patch corrects a handful of errors in Direct2D's drawing code.
1247
1248         * platform/graphics/win/Direct2DOperations.cpp:
1249         (WebCore::Direct2D::clearRect): Use the transformed dimensions of
1250         rects to determine whether they intersect with the render target.
1251         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1252         (WebCore::ImageBufferData::copyRectFromData const):
1253         (WebCore::ImageBufferData::loadDataToBitmapIfNeeded): It is not
1254         necessary (or correct) to 'endDraw' when loading image data to the
1255         Bitmap target.
1256         * platform/graphics/win/PathDirect2D.cpp:
1257         (WebCore::Path::strokeBoundingRect const): Provide an implementation.
1258
1259 2019-10-01  Alex Christensen  <achristensen@webkit.org>
1260
1261         Progress towards successful CMake build on Mac
1262         https://bugs.webkit.org/show_bug.cgi?id=202426
1263
1264         Rubber-stamped by Tim Horton.
1265
1266         * PlatformMac.cmake:
1267
1268 2019-10-01  Tim Horton  <timothy_horton@apple.com>
1269
1270         Clean up some includes to make the build a bit faster
1271         https://bugs.webkit.org/show_bug.cgi?id=202417
1272
1273         Reviewed by Jer Noble.
1274
1275         No new tests, just reorganizing.
1276
1277         Apply some profile-guided optimizations to our headers.
1278
1279         * Modules/mediasource/SourceBuffer.cpp:
1280         * WebCorePrefix.h:
1281         Add HashMap, which ends up included in all source files.
1282
1283         * html/HTMLImageElement.cpp:
1284         (WebCore::HTMLImageElement::HTMLImageElement):
1285         (WebCore::HTMLImageElement::selectImageSource):
1286         (WebCore::HTMLImageElement::didAttachRenderers):
1287         (WebCore::HTMLImageElement::insertedIntoAncestor):
1288         (WebCore::HTMLImageElement::width):
1289         (WebCore::HTMLImageElement::height):
1290         (WebCore::HTMLImageElement::naturalWidth const):
1291         (WebCore::HTMLImageElement::naturalHeight const):
1292         (WebCore::HTMLImageElement::complete const):
1293         (WebCore::HTMLImageElement::decode):
1294         (WebCore::HTMLImageElement::didMoveToNewDocument):
1295         (WebCore::HTMLImageElement::cachedImage const):
1296         (WebCore::HTMLImageElement::setLoadManually):
1297         (WebCore::HTMLImageElement::hasPendingActivity const):
1298         (WebCore::HTMLImageElement::pendingDecodePromisesCountForTesting const):
1299         * html/HTMLImageElement.h:
1300         (WebCore::HTMLImageElement::cachedImage const): Deleted.
1301         (WebCore::HTMLImageElement::setLoadManually): Deleted.
1302         (WebCore::HTMLImageElement::hasPendingActivity const): Deleted.
1303         (WebCore::HTMLImageElement::pendingDecodePromisesCountForTesting const): Deleted.
1304         HTMLImageLoader brings in JSDOMPromiseDeferred, which is known to be horribly expensive.
1305         Out-of-line m_imageLoader.
1306
1307         * platform/graphics/GraphicsLayer.h:
1308         Swap Animation for TimingFunction, which is much smaller.
1309
1310         * platform/graphics/MediaPlayer.h:
1311         InbandTextTrackPrivate brings in SerializedPlatformRepresentation.h,
1312         which is very expensive. MediaPlayer.h is included in many places.
1313         Break the link.
1314
1315         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1316
1317 2019-10-01  youenn fablet  <youenn@apple.com>
1318
1319         RTCDataChannel should not prevent entering page cache except if in open state
1320         https://bugs.webkit.org/show_bug.cgi?id=202395
1321
1322         Reviewed by Chris Dumez.
1323
1324         Only prevent entering page cache in open state.
1325         Enqueue message through the document event queue to handle suspension properly.
1326
1327         We cannot yet write page cache tests as a data channel requires a peer connection which
1328         currently forbids entering page cache.
1329
1330         * Modules/mediastream/RTCDataChannel.cpp:
1331         (WebCore::RTCDataChannel::RTCDataChannel):
1332         (WebCore::RTCDataChannel::didReceiveStringData):
1333         (WebCore::RTCDataChannel::didReceiveRawData):
1334         (WebCore::RTCDataChannel::didDetectError):
1335         (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
1336         (WebCore::RTCDataChannel::scheduleDispatchEvent):
1337         (WebCore::RTCDataChannel::scheduledEventTimerFired): Deleted.
1338         * Modules/mediastream/RTCDataChannel.h:
1339
1340 2019-10-01  Rob Buis  <rbuis@igalia.com>
1341
1342         [Mac] Layout Test imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.any.html fails
1343         https://bugs.webkit.org/show_bug.cgi?id=202350
1344
1345         Reviewed by Alex Christensen.
1346
1347         In some cases didReceiveResponse will deliver redirects (normally willSendRequestInternal will be used for redirects).
1348         When this is done in manual redirect mode make sure the response type is opaque redirect.
1349
1350         Test: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.any.html
1351
1352         * loader/SubresourceLoader.cpp:
1353         (WebCore::SubresourceLoader::didReceiveResponse):
1354
1355 2019-10-01  Keith Rollin  <krollin@apple.com>
1356
1357         Remove some support for < iOS 13
1358         https://bugs.webkit.org/show_bug.cgi?id=202386
1359         <rdar://problem/55863017>
1360
1361         Reviewed by Eric Carlson.
1362
1363         Remove some support for iOS versions less than 13.0.
1364
1365         Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
1366         and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
1367         values >= 130000. This means that expressions like
1368         "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
1369         "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
1370
1371         This removal is part of a series of patches effecting the removal of
1372         dead code for old versions of iOS. This particular pass involves
1373         changes in which Jer Noble was involved. These changes are isolated
1374         from other similar changes in order to facilitate the reviewing
1375         process.
1376
1377         No new tests -- no new or changed functionality.
1378
1379         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1380         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime const):
1381         (WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval const):
1382
1383 2019-10-01  Chris Dumez  <cdumez@apple.com>
1384
1385         Unreviewed attempt to fix Windows build after r250527.
1386
1387         * dom/GenericEventQueue.cpp:
1388         (WebCore::TaskQueueConstructor::construct):
1389         (WebCore::TaskQueueConstructor<Timer>::construct):
1390         (WebCore::GenericEventQueueBase<T>::enqueueEvent):
1391         (WebCore::GenericEventQueueBase<T>::close):
1392         (WebCore::GenericEventQueueBase<T>::cancelAllEvents):
1393         (WebCore::GenericEventQueueBase<T>::setPaused):
1394         (WebCore::GenericEventQueueBase<T>::suspend):
1395         (WebCore::GenericEventQueueBase<T>::rescheduleAllEventsIfNeeded):
1396         * dom/GenericEventQueue.h:
1397         * platform/GenericTaskQueue.h:
1398
1399 2019-10-01  Alex Christensen  <achristensen@webkit.org>
1400
1401         Fix internal build after r250549
1402         https://bugs.webkit.org/show_bug.cgi?id=202390
1403
1404         There is an internal #define confirm on some systems, so rename DOMWindow::confirm to DOMWindow::confirmForBindings.
1405
1406         * page/DOMWindow.cpp:
1407         (WebCore::DOMWindow::confirmForBindings):
1408         (WebCore::DOMWindow::confirm): Deleted.
1409         * page/DOMWindow.h:
1410         * page/DOMWindow.idl:
1411
1412 2019-10-01  Chris Dumez  <cdumez@apple.com>
1413
1414         Unreviewed attempt to fix Windows build after r250527.
1415
1416         * platform/GenericTaskQueue.h:
1417
1418 2019-10-01  Zan Dobersek  <zdobersek@igalia.com>
1419
1420         [CoordGraphics] Implement sync methods for position, bounds origin
1421         https://bugs.webkit.org/show_bug.cgi?id=202398
1422
1423         Reviewed by Carlos Garcia Campos.
1424
1425         Add the CoordinatedGraphicsLayer::syncPosition() and
1426         CoordinatedGraphicsLayer::syncBoundsOrigin() method overrides, both
1427         performing a synchronization of the given GraphicsLayer attribute.
1428
1429         These methods are used by the scrolling code to reflect changes in these
1430         attributes without causing a layer flush (which is not necessary since
1431         the changes have already been applied in an equivalent way).
1432
1433         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1434         (WebCore::CoordinatedGraphicsLayer::didChangeGeometry):
1435         (WebCore::CoordinatedGraphicsLayer::syncPosition):
1436         (WebCore::CoordinatedGraphicsLayer::syncBoundsOrigin):
1437         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1438
1439 2019-10-01  Joonghun Park  <jh718.park@samsung.com>
1440
1441         Make table's clientWidth/Height include its border sizes.
1442         https://bugs.webkit.org/show_bug.cgi?id=200974
1443
1444         WebKit doesn't have table wrapper box currently
1445         while Gecko has it,
1446         so this CL tries to mimic the behavior that
1447         clientWidth/Height refers to table wrapper box
1448         which doesn't have borders applied to itself
1449         and table grid box has the borders.
1450
1451         This CL adds table's border sizes
1452         to clientWidth/Height
1453         at |LayoutBox::PixelSnappedClientWidth/Height|.
1454
1455         As a result of this CL, table's clientWidth/Height
1456         and offsetWidth/Height are equal now, respectively.
1457
1458         The corresponding csswg discussion is
1459         https://github.com/w3c/csswg-drafts/issues/4245.
1460
1461         Reviewed by Antti Koivisto.
1462
1463         Tests: fast/table/border-collapsing/bug236727.html
1464                imported/w3c/web-platform-tests/css/cssom-view/table-border-collapse-client-width-height.html
1465                imported/w3c/web-platform-tests/css/cssom-view/table-border-separate-client-width-height.html
1466                imported/w3c/web-platform-tests/css/cssom-view/table-with-border-client-width-height.html
1467
1468         * dom/Element.cpp:
1469         (WebCore::Element::clientWidth):
1470         (WebCore::Element::clientHeight):
1471
1472 2019-10-01  youenn fablet  <youenn@apple.com>
1473
1474         Remove races condition when validating capture sandbox extension revocation
1475         https://bugs.webkit.org/show_bug.cgi?id=202133
1476         <rdar://problem/55660905>
1477
1478         Reviewed by Eric Carlson.
1479
1480         Covered by existing tests.
1481
1482         * Modules/mediastream/MediaStreamTrack.cpp:
1483         (WebCore::MediaStreamTrack::endCapture):
1484         Synchronously update document media state when capture is ended.
1485         This allows to validate the fact that no document is capturing while we revoke sandbox extensions.
1486
1487 2019-10-01  youenn fablet  <youenn@apple.com>
1488
1489         MediaDevices should be SecureContext
1490         https://bugs.webkit.org/show_bug.cgi?id=202267
1491
1492         Reviewed by Eric Carlson.
1493
1494         Manually tested since 127.0.0.1/localhost are secure contexts.
1495
1496         * Modules/mediastream/MediaDevices.idl:
1497         * bindings/js/WebCoreBuiltinNames.h:
1498
1499 2019-09-30  Alex Christensen  <achristensen@webkit.org>
1500
1501         Resurrect Mac CMake build
1502         https://bugs.webkit.org/show_bug.cgi?id=202384
1503
1504         Rubber-stamped by Tim Horton.
1505
1506         * PlatformMac.cmake:
1507
1508 2019-09-30  Chris Dumez  <cdumez@apple.com>
1509
1510         Make GenericEventQueue an ActiveDOMObject
1511         https://bugs.webkit.org/show_bug.cgi?id=202373
1512
1513         Reviewed by Eric Carlson.
1514
1515         Make GenericEventQueue an ActiveDOMObject so that it is guaranteed to never fire any events while
1516         suspended without requiring the client to explicitly suspend/resume the event queue.
1517
1518         * Modules/encryptedmedia/MediaKeySession.cpp:
1519         (WebCore::MediaKeySession::MediaKeySession):
1520         (WebCore::MediaKeySession::enqueueMessage):
1521         (WebCore::MediaKeySession::updateKeyStatuses):
1522         * Modules/encryptedmedia/MediaKeySession.h:
1523         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1524         (WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
1525         (WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
1526         (WebCore::WebKitMediaKeySession::addKeyTimerFired):
1527         (WebCore::WebKitMediaKeySession::sendMessage):
1528         (WebCore::WebKitMediaKeySession::sendError):
1529         (WebCore::WebKitMediaKeySession::hasPendingActivity const):
1530         (WebCore::WebKitMediaKeySession::stop):
1531         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1532         * Modules/mediasource/MediaSource.cpp:
1533         (WebCore::MediaSource::MediaSource):
1534         (WebCore::MediaSource::hasPendingActivity const):
1535         (WebCore::MediaSource::stop):
1536         (WebCore::MediaSource::canSuspendForDocumentSuspension const):
1537         (WebCore::MediaSource::scheduleEvent):
1538         * Modules/mediasource/MediaSource.h:
1539         * Modules/mediasource/SourceBuffer.cpp:
1540         (WebCore::SourceBuffer::SourceBuffer):
1541         (WebCore::SourceBuffer::hasPendingActivity const):
1542         (WebCore::SourceBuffer::stop):
1543         (WebCore::SourceBuffer::scheduleEvent):
1544         * Modules/mediasource/SourceBuffer.h:
1545         * Modules/mediasource/SourceBufferList.cpp:
1546         (WebCore::SourceBufferList::SourceBufferList):
1547         (WebCore::SourceBufferList::scheduleEvent):
1548         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
1549         * Modules/mediasource/SourceBufferList.h:
1550         * Modules/webaudio/AudioContext.cpp:
1551         (WebCore::AudioContext::AudioContext):
1552         (WebCore::AudioContext::stop):
1553         * Modules/webaudio/AudioContext.h:
1554         * animation/DeclarativeAnimation.cpp:
1555         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
1556         (WebCore::DeclarativeAnimation::tick):
1557         (WebCore::DeclarativeAnimation::needsTick const):
1558         (WebCore::DeclarativeAnimation::remove):
1559         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
1560         (WebCore::DeclarativeAnimation::stop):
1561         (WebCore::DeclarativeAnimation::suspend):
1562         (WebCore::DeclarativeAnimation::resume):
1563         * animation/DeclarativeAnimation.h:
1564         * dom/GenericEventQueue.cpp:
1565         (WebCore::GenericEventQueueBase<T>::GenericEventQueueBase):
1566         (WebCore::GenericEventQueueBase<T>::setPaused):
1567         (WebCore::GenericEventQueueBase<T>::canSuspendForDocumentSuspension const):
1568         (WebCore::GenericEventQueueBase<T>::suspend):
1569         (WebCore::GenericEventQueueBase<T>::resume):
1570         (WebCore::GenericEventQueueBase<T>::rescheduleAllEventsIfNeeded):
1571         (WebCore::GenericEventQueueBase<T>::stop):
1572         (WebCore::GenericEventQueueBase<T>::activeDOMObjectName const):
1573         (WebCore::GenericEventQueue::create):
1574         (WebCore::MainThreadGenericEventQueue::create):
1575         * dom/GenericEventQueue.h:
1576         * dom/MessagePort.cpp:
1577         (WebCore::MessagePort::MessagePort):
1578         (WebCore::MessagePort::close):
1579         (WebCore::MessagePort::dispatchMessages):
1580         * dom/MessagePort.h:
1581         * html/HTMLMediaElement.cpp:
1582         (WebCore::HTMLMediaElement::HTMLMediaElement):
1583         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1584         (WebCore::HTMLMediaElement::scheduleEvent):
1585         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1586         (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
1587         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
1588         (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
1589         (WebCore::HTMLMediaElement::closeTaskQueues):
1590         (WebCore::HTMLMediaElement::suspend):
1591         (WebCore::HTMLMediaElement::resume):
1592         (WebCore::HTMLMediaElement::hasPendingActivity const):
1593         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
1594         * html/HTMLMediaElement.h:
1595         * html/track/TrackListBase.cpp:
1596         (WebCore::TrackListBase::TrackListBase):
1597         (WebCore::TrackListBase::scheduleTrackEvent):
1598         (WebCore::TrackListBase::scheduleChangeEvent):
1599         (WebCore::TrackListBase::isChangeEventScheduled const):
1600         (WebCore::TrackListBase::canSuspendForDocumentSuspension const):
1601         * html/track/TrackListBase.h:
1602         * workers/Worker.cpp:
1603         (WebCore::Worker::Worker):
1604         (WebCore::Worker::terminate):
1605         (WebCore::Worker::stop):
1606         (WebCore::Worker::hasPendingActivity const):
1607         (WebCore::Worker::enqueueEvent):
1608         (WebCore::Worker::dispatchEvent):
1609         * workers/Worker.h:
1610         * workers/service/ServiceWorkerContainer.cpp:
1611         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
1612         (WebCore::ServiceWorkerContainer::startMessages):
1613         (WebCore::ServiceWorkerContainer::postMessage):
1614         (WebCore::ServiceWorkerContainer::stop):
1615         * workers/service/ServiceWorkerContainer.h:
1616
1617 2019-09-30  Chris Dumez  <cdumez@apple.com>
1618
1619         IDBTransaction / IDBObjectStore should not prevent a page from entering the back / forward cache
1620         https://bugs.webkit.org/show_bug.cgi?id=202291
1621         <rdar://problem/55760106>
1622
1623         Reviewed by Geoffrey Garen.
1624
1625         IDBObjectStore does not fire any events and should therefore not cause any problem while in PageCache.
1626         IDBTransaction can only fire abort/complete/error events, all of which are being enqueued to the
1627         DocumentEventQueue. The DocumentEventQueue subclasses SuspendableTimer which will correctly suspend
1628         while the document is in page cache. IDBTransaction will therefore not cause events to fire (and JS
1629         to run) while in page cache.
1630
1631         Test: storage/indexeddb/IDBTransaction-page-cache.html
1632
1633         * Modules/indexeddb/IDBObjectStore.cpp:
1634         (WebCore::IDBObjectStore::canSuspendForDocumentSuspension const):
1635         * Modules/indexeddb/IDBTransaction.cpp:
1636         (WebCore::IDBTransaction::canSuspendForDocumentSuspension const):
1637
1638 2019-09-30  Chris Dumez  <cdumez@apple.com>
1639
1640         Refine restrictions for X-Temp-Tablet HTTP header experiment
1641         https://bugs.webkit.org/show_bug.cgi?id=202367
1642         <rdar://problem/55849139>
1643
1644         Reviewed by Geoffrey Garen.
1645
1646         Refine restrictions for X-Temp-Tablet HTTP header experiment:
1647         1. Only send the header if the embedding application is MobileSafari.
1648         2. Only send the header if the first party is google.com
1649         3. Only send the header if the current date is before 2/1/2020
1650         4. Send the header even if using an ephemeral session
1651
1652         * loader/cache/CachedResourceLoader.cpp:
1653         (WebCore::isXTempTabletHeaderExperimentOver):
1654         (WebCore::CachedResourceLoader::CachedResourceLoader):
1655         (WebCore::isGoogleSearch):
1656         (WebCore::CachedResourceLoader::shouldSendXTempTabletHeader const):
1657         (WebCore::CachedResourceLoader::requestResource):
1658         * loader/cache/CachedResourceLoader.h:
1659
1660 2019-09-30  Chris Dumez  <cdumez@apple.com>
1661
1662         Pages with Web Workers cannot enter the back / forward cache
1663         https://bugs.webkit.org/show_bug.cgi?id=202296
1664         <rdar://problem/55764073>
1665
1666         Reviewed by Jer Noble.
1667
1668         Allow pages that use Web Workers to enter the back / forward cache.
1669         This involves adding an EventQueue for all event firing on Woker
1670         objects and suspending this EventQueue while in the page cache.
1671
1672         This was preventing some of the pages on weather.com to enter the
1673         back / forward cache.
1674
1675         Test: fast/workers/worker-page-cache.html
1676
1677         * Modules/encryptedmedia/MediaKeySession.h:
1678         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1679         * Modules/mediasource/MediaSource.h:
1680         * Modules/mediasource/SourceBuffer.h:
1681         * Modules/mediasource/SourceBufferList.h:
1682         * Modules/webaudio/AudioContext.cpp:
1683         (WebCore::AudioContext::AudioContext):
1684         * Modules/webaudio/AudioContext.h:
1685         * animation/DeclarativeAnimation.h:
1686
1687         * dom/GenericEventQueue.cpp:
1688         (WebCore::TaskQueueConstructor::construct):
1689         (WebCore::TaskQueueConstructor<Timer>::construct):
1690         (WebCore::GenericEventQueueBase<T>::GenericEventQueueBase):
1691         (WebCore::GenericEventQueueBase<T>::enqueueEvent):
1692         (WebCore::GenericEventQueueBase<T>::dispatchOneEvent):
1693         (WebCore::GenericEventQueueBase<T>::close):
1694         (WebCore::GenericEventQueueBase<T>::cancelAllEvents):
1695         (WebCore::GenericEventQueueBase<T>::hasPendingEvents const):
1696         (WebCore::GenericEventQueueBase<T>::hasPendingEventsOfType const):
1697         (WebCore::GenericEventQueueBase<T>::suspend):
1698         (WebCore::GenericEventQueueBase<T>::resume):
1699         * dom/GenericEventQueue.h:
1700         (WebCore::GenericEventQueueBase::isSuspended const):
1701         (WebCore::MainThreadGenericEventQueue::MainThreadGenericEventQueue):
1702         (WebCore::GenericEventQueue::GenericEventQueue):
1703         Rename GenericEventQueue to MainThreadGenericEventQueue since its implementation relies
1704         on a global shared Timer to fire events. Introduce a new GenericEventQueue which can
1705         actually be used from any thread. This is useful for MessagePort, which is used both
1706         on the main thread and on worker threads.
1707
1708         * dom/MessagePort.cpp:
1709         (WebCore::MessagePort::MessagePort):
1710         (WebCore::MessagePort::close):
1711         (WebCore::MessagePort::suspend):
1712         (WebCore::MessagePort::resume):
1713         (WebCore::MessagePort::dispatchMessages):
1714         * dom/MessagePort.h:
1715         Use an GenericEventQueue in MessagePort for consistency with Worker.
1716         MessagePort is an ActiveDOMobject which returns true in canSuspend(),
1717         we therefore need to make sure it suspends event firing while
1718         suspended.
1719
1720         * html/HTMLMediaElement.h:
1721         * html/track/TrackListBase.h:
1722         * workers/Worker.cpp:
1723         (WebCore::Worker::Worker):
1724         (WebCore::Worker::terminate):
1725         (WebCore::Worker::canSuspendForDocumentSuspension const):
1726         (WebCore::Worker::suspend):
1727         (WebCore::Worker::resume):
1728         (WebCore::Worker::stop):
1729         (WebCore::Worker::hasPendingActivity const):
1730         (WebCore::Worker::notifyFinished):
1731         (WebCore::Worker::enqueueEvent):
1732         (WebCore::Worker::dispatchEvent):
1733         * workers/Worker.h:
1734         * workers/WorkerMessagingProxy.cpp:
1735         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
1736         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
1737
1738 2019-09-27  Keith Rollin  <krollin@apple.com>
1739
1740         Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
1741         https://bugs.webkit.org/show_bug.cgi?id=202119
1742         <rdar://problem/55638792>
1743
1744         Unreviewed, address post landing review comments for r248533 from
1745         Darin Adler.
1746
1747         No new tests -- no new or changed functionality.
1748
1749         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1750         (WebCore::convert):
1751         (WebCore::subLocality): Deleted.
1752         (WebCore::setSubLocality): Deleted.
1753         (WebCore::subAdministrativeArea): Deleted.
1754         (WebCore::setSubAdministrativeArea): Deleted.
1755
1756 2019-09-30  Antti Koivisto  <antti@apple.com>
1757
1758         RenderLineBreak should use LineLayoutTraversal
1759         https://bugs.webkit.org/show_bug.cgi?id=202316
1760
1761         Reviewed by Zalan Bujtas.
1762
1763         Replace more path specific code with LineLayoutTraversal.
1764
1765         * Headers.cmake:
1766         * rendering/RenderLineBreak.cpp:
1767         (WebCore::RenderLineBreak::linesBoundingBox const):
1768         (WebCore::RenderLineBreak::absoluteRects const):
1769         (WebCore::RenderLineBreak::absoluteQuads const):
1770         (WebCore::simpleLineLayout): Deleted.
1771         * rendering/RenderTreeAsText.cpp:
1772         (WebCore::RenderTreeAsText::writeRenderObject):
1773         (WebCore::writeTextBox):
1774         * rendering/SimpleLineLayoutFunctions.cpp:
1775         (WebCore::SimpleLineLayout::computeBoundingBox): Deleted.
1776         (WebCore::SimpleLineLayout::collectAbsoluteRects): Deleted.
1777         (WebCore::SimpleLineLayout::rendererForPosition): Deleted.
1778         * rendering/SimpleLineLayoutFunctions.h:
1779         * rendering/line/LineLayoutTraversal.cpp:
1780         (WebCore::LineLayoutTraversal::ElementBoxIterator::ElementBoxIterator):
1781         (WebCore::LineLayoutTraversal::ElementBoxIterator::atEnd const):
1782         (WebCore::LineLayoutTraversal::elementBoxFor):
1783         (WebCore::LineLayoutTraversal::TextBox::rect const): Deleted.
1784         (WebCore::LineLayoutTraversal::TextBox::logicalRect const): Deleted.
1785         (WebCore::LineLayoutTraversal::TextBox::hasHyphen const): Deleted.
1786         (WebCore::LineLayoutTraversal::TextBox::isLeftToRightDirection const): Deleted.
1787         (WebCore::LineLayoutTraversal::TextBox::dirOverride const): Deleted.
1788         (WebCore::LineLayoutTraversal::TextBox::text const): Deleted.
1789         (WebCore::LineLayoutTraversal::TextBox::isLineBreak const): Deleted.
1790         (WebCore::LineLayoutTraversal::TextBox::localStartOffset const): Deleted.
1791         (WebCore::LineLayoutTraversal::TextBox::localEndOffset const): Deleted.
1792         (WebCore::LineLayoutTraversal::TextBox::length const): Deleted.
1793         (WebCore::LineLayoutTraversal::TextBox::isLastOnLine const): Deleted.
1794         (WebCore::LineLayoutTraversal::TextBox::isLast const): Deleted.
1795         (WebCore::LineLayoutTraversal::TextBox::iterator const): Deleted.
1796
1797         Move to header as templates.
1798
1799         * rendering/line/LineLayoutTraversal.h:
1800         (WebCore::LineLayoutTraversal::ElementBoxIterator::ElementBoxIterator):
1801         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator bool const):
1802         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator* const):
1803         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator-> const):
1804
1805         Add a new iterator type for element boxes.
1806         It doesn't currently really iterate, is just allows testing for end.
1807
1808         (WebCore::LineLayoutTraversal::Box<Iterator>::rect const):
1809         (WebCore::LineLayoutTraversal::Box<Iterator>::logicalRect const):
1810         (WebCore::LineLayoutTraversal::Box<Iterator>::isLeftToRightDirection const):
1811         (WebCore::LineLayoutTraversal::Box<Iterator>::dirOverride const):
1812         (WebCore::LineLayoutTraversal::Box<Iterator>::isLineBreak const):
1813         (WebCore::LineLayoutTraversal::Box<Iterator>::iterator const):
1814
1815         Split properties that all inline boxes have out from TextBox.
1816         Make it a template class.
1817
1818         (WebCore::LineLayoutTraversal::TextBox<Iterator>::hasHyphen const):
1819         (WebCore::LineLayoutTraversal::TextBox<Iterator>::text const):
1820         (WebCore::LineLayoutTraversal::TextBox<Iterator>::localStartOffset const):
1821         (WebCore::LineLayoutTraversal::TextBox<Iterator>::localEndOffset const):
1822         (WebCore::LineLayoutTraversal::TextBox<Iterator>::length const):
1823         (WebCore::LineLayoutTraversal::TextBox<Iterator>::isLastOnLine const):
1824         (WebCore::LineLayoutTraversal::TextBox<Iterator>::isLast const):
1825
1826         Make a template class.
1827
1828         (WebCore::LineLayoutTraversal::hasTextBoxes): Deleted.
1829
1830 2019-09-30  Rob Buis  <rbuis@igalia.com>
1831
1832         No-Cors check should take into account same-origin
1833         https://bugs.webkit.org/show_bug.cgi?id=202353
1834
1835         Reviewed by Youenn Fablet.
1836
1837         No-Cors check should take into account same-origin, in that case the
1838         check should bail out, since same-origin is already handled in
1839         the first step of [1].
1840
1841         Test: imported/web-platform-tests/fetch/api/redirect/redirect-mode.any.html
1842
1843         [1] https://fetch.spec.whatwg.org/#main-fetch Step 5
1844
1845         * loader/cache/CachedResourceLoader.cpp:
1846         (WebCore::CachedResourceLoader::canRequest):
1847
1848 2019-09-30  Zan Dobersek  <zdobersek@igalia.com>
1849
1850         [Nicosia] Complete ScrollingTreeNicosia::createScrollingTreeNode()
1851         https://bugs.webkit.org/show_bug.cgi?id=202358
1852
1853         Reviewed by Carlos Garcia Campos.
1854
1855         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp:
1856         (WebCore::ScrollingTreeNicosia::createScrollingTreeNode):
1857         Return appropriate objects for the remaining node types.
1858
1859 2019-09-30  Zan Dobersek  <zdobersek@igalia.com>
1860
1861         [Nicosia] Add missing conversion casts for LayerRepresentation objects
1862         https://bugs.webkit.org/show_bug.cgi?id=202357
1863
1864         Reviewed by Carlos Garcia Campos.
1865
1866         After r250491, we have to request explicit conversion of
1867         LayerRepresentation objects to Nicosia::PlatformLayer pointers.
1868
1869         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp:
1870         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
1871         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
1872         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren):
1873         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):
1874         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers):
1875         * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.cpp:
1876         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
1877         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp:
1878         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers):
1879         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent):
1880         * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp:
1881         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
1882         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp:
1883         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
1884
1885 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
1886
1887         ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
1888         https://bugs.webkit.org/show_bug.cgi?id=202256
1889         <rdar://problem/55772092>
1890
1891         Reviewed by Simon Fraser.
1892
1893         Make the scroll container and scrolled contents layer holders
1894         platform-independent by using the LayerRepresentation as the underlying
1895         type for the two member variables in ScrollingTreeScrollingNode.
1896
1897         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1898         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
1899         * page/scrolling/ScrollingTreeScrollingNode.h:
1900         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1901         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
1902         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1903         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
1904
1905 2019-09-28  Brent Fulgham  <bfulgham@apple.com>
1906
1907         [FTW] Correct compositing, shadow, and radial gradient implementations
1908         https://bugs.webkit.org/show_bug.cgi?id=202177
1909
1910         Reviewed by Fujii Hironori.
1911
1912         This patch corrects a number of implementation errors in basic Canvas
1913         drawing operations.
1914
1915         Tested by canvas/philip/tests 
1916
1917         * platform/graphics/win/Direct2DOperations.cpp:
1918         (WebCore::Direct2D::State::setCompositeOperation): Initialize blend and
1919         composite modes to correct defaults.
1920         (WebCore::Direct2D::drawWithShadowHelper): Correct value used for blur
1921         standard deviation to more closely match other browser output.
1922         * platform/graphics/win/Direct2DUtilities.cpp:
1923         (WebCore::Direct2D::createBitmapCopyFromContext): Added helper function.
1924         * platform/graphics/win/Direct2DUtilities.h:
1925         * platform/graphics/win/GradientDirect2D.cpp:
1926         (WebCore::Gradient::generateGradient): Properly handle the case of a non-zero
1927         initial gradient radius. Properly compute the final radius.
1928         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1929         (WebCore::ImageBufferData::readDataFromBitmapIfNeeded const): Update to use ID2D1DeviceContext
1930         from platformContext, rather than searching for it each time.
1931         (WebCore::ImageBufferData::compatibleBitmap): Ditto.
1932         * platform/graphics/win/PlatformContextDirect2D.cpp:
1933         (WebCore::PlatformContextDirect2D::PlatformContextDirect2D): Grab the ID2D1DeviceContext for
1934         the RenderTarget at construction time.
1935         (WebCore::PlatformContextDirect2D::setRenderTarget): Ditto.
1936         (WebCore::PlatformContextDirect2D::endDraw): Perform compositing operations when needed.
1937         (WebCore::PlatformContextDirect2D::compositeIfNeeded): Added.
1938         (WebCore::PlatformContextDirect2D::setBlendAndCompositeMode): Update to properly set the
1939         blend and compositing mode (depending on global value set for the canvas.)
1940         * platform/graphics/win/PlatformContextDirect2D.h:
1941         (WebCore::PlatformContextDirect2D::deviceContext):
1942         (WebCore::PlatformContextDirect2D::setRenderTarget): Deleted.
1943         (WebCore::PlatformContextDirect2D::setBlendMode): Deleted.
1944         (WebCore::PlatformContextDirect2D::setCompositeMode): Deleted.
1945
1946 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
1947
1948         Tighten up LayerRepresentation operators
1949         https://bugs.webkit.org/show_bug.cgi?id=202344
1950
1951         Reviewed by Simon Fraser.
1952
1953         Make the operators on the LayerRepresentation class explicit.
1954         Additionally, the bool operator is added to the class, allowing objects
1955         of this class to be safely used in boolean contexts like null checks.
1956         Before, use in such contexts fell back to using the
1957         GraphicsLayer::PlatformLayerID operator which caused asserts when the
1958         internal representation was of different type.
1959
1960         While the explicit operators prevent misuse, they do require additional
1961         conversion casts to retrieve the internal LayerRepresentation value.
1962
1963         * page/scrolling/ScrollingStateNode.h:
1964         (WebCore::LayerRepresentation::operator GraphicsLayer* const):
1965         (WebCore::LayerRepresentation::operator PlatformLayer* const):
1966         (WebCore::LayerRepresentation::operator GraphicsLayer::PlatformLayerID const):
1967         (WebCore::LayerRepresentation::operator bool const):
1968         (WebCore::LayerRepresentation::toRepresentation const):
1969         Add a missing ASSERT_NOT_REACHED() invocation.
1970         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1971         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
1972         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1973         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
1974         * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
1975         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
1976         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
1977         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
1978         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1979         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
1980         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1981         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1982
1983 2019-09-29  Zalan Bujtas  <zalan@apple.com>
1984
1985         [LFC][IFC] Remove InlineLayout abstraction layer
1986         https://bugs.webkit.org/show_bug.cgi?id=202352
1987         <rdar://problem/55811532>
1988
1989         Reviewed by Antti Koivisto.
1990
1991         Move InlineLayout functions to InlineFormattingContext. Now inline layout has
1992         1. InlineFormattingContext -high level layout and preferred width computation, collecting inline content, constructing display boxes
1993         2. LineLayout -responsible for placing inline content on the current line (partial inline content handling, line breaking etc)
1994         3. Line -represents an actual line, turns inline content into runs.
1995
1996         * Sources.txt:
1997         * WebCore.xcodeproj/project.pbxproj:
1998         * layout/inlineformatting/InlineFormattingContext.cpp:
1999         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
2000         (WebCore::Layout::InlineFormattingContext::lineLayout):
2001         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
2002         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
2003         (WebCore::Layout::InlineFormattingContext::initialConstraintsForLine):
2004         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
2005         * layout/inlineformatting/InlineFormattingContext.h:
2006         (WebCore::Layout::InlineFormattingContext::InlineLayout::layoutState const): Deleted.
2007         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingContext const): Deleted.
2008         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingRoot const): Deleted.
2009         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingState): Deleted.
2010         (WebCore::Layout::InlineFormattingContext::InlineLayout::widthConstraint const): Deleted.
2011         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: Removed.
2012         * layout/inlineformatting/InlineFormattingState.h:
2013         (WebCore::Layout::InlineFormattingState::inlineItems const):
2014         * layout/inlineformatting/InlineLineLayout.cpp: Added.
2015         (WebCore::Layout::inlineItemWidth):
2016         (WebCore::Layout::LineLayout::LineInput::LineInput):
2017         (WebCore::Layout::LineLayout::UncommittedContent::add):
2018         (WebCore::Layout::LineLayout::UncommittedContent::reset):
2019         (WebCore::Layout::LineLayout::LineLayout):
2020         (WebCore::Layout::LineLayout::commitPendingContent):
2021         (WebCore::Layout::LineLayout::close):
2022         (WebCore::Layout::LineLayout::placeInlineItem):
2023         (WebCore::Layout::LineLayout::layout):
2024         * layout/inlineformatting/InlineLineLayout.h: Added.
2025         (WebCore::Layout::LineLayout::formattingContext const):
2026         (WebCore::Layout::LineLayout::UncommittedContent::runs):
2027         (WebCore::Layout::LineLayout::UncommittedContent::isEmpty const):
2028         (WebCore::Layout::LineLayout::UncommittedContent::size const):
2029         (WebCore::Layout::LineLayout::UncommittedContent::width const):
2030
2031 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
2032
2033         [Nicosia] Add overflow, overflow proxy node implementations
2034         https://bugs.webkit.org/show_bug.cgi?id=202306
2035
2036         Reviewed by Carlos Garcia Campos.
2037
2038         Add the ScrollingTreeOverflowScrollProxyNode and
2039         ScrollingTreeOverflowScrollingNodeNicosia classes, implementing the
2040         missing overlfow node types. Both implementations are based on the
2041         corresponsing classes for Cocoa/Mac platforms and should ideally
2042         share most of the platform-agnostic logic.
2043
2044         * SourcesWPE.txt:
2045         * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.cpp: Added.
2046         (WebCore::ScrollingTreeOverflowScrollProxyNode::create):
2047         (WebCore::ScrollingTreeOverflowScrollProxyNode::ScrollingTreeOverflowScrollProxyNode):
2048         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
2049         (WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
2050         (WebCore::ScrollingTreeOverflowScrollProxyNode::dumpProperties const):
2051         * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.h: Added.
2052         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: Added.
2053         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::create):
2054         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ScrollingTreeOverflowScrollingNodeNicosia):
2055         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateAfterChildren):
2056         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::adjustedScrollPosition const):
2057         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers):
2058         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent):
2059         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: Added.
2060
2061 2019-09-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2062
2063         Crash when removing the target element while animating its attributes
2064         https://bugs.webkit.org/show_bug.cgi?id=202247
2065
2066         Reviewed by Darin Adler.
2067
2068         If SMIL is animating a CSS attribute, there is a chance the animation is
2069         ended while it is being started or progressed. For that reason, the member
2070         SVGAnimateElementBase::m_animator has to be made RefPtr and it has to be
2071         be protected in resetAnimatedType() and calculateAnimatedValue().
2072
2073         While SMILTimeContainer::updateAnimations() is calling progress() for the
2074         scheduled animation elements, SMILTimeContainer::unschedule() might get
2075         called if processing an animation causes events to be dispatched. For that
2076         reason we need to copy the scheduled animations Vector before processing
2077         them so we avoid changing the Vector while looping through its items.
2078
2079         Remove the guard SMILTimeContainer::m_preventScheduledAnimationsChanges
2080         which was added in r129670 for debugging purposes. In some situations, 
2081         the scheduled animations map could be modified out from under some of the
2082         functions of SMILTimeContainer.
2083
2084         Test: svg/animations/animate-and-remove-target-element.html
2085
2086         * svg/SVGAnimateElementBase.cpp:
2087         (WebCore::SVGAnimateElementBase::resetAnimatedType):
2088         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2089         * svg/SVGAnimateElementBase.h:
2090         * svg/SVGElement.cpp:
2091         (WebCore::SVGElement::createAnimator):
2092         * svg/SVGElement.h:
2093         * svg/animation/SMILTimeContainer.cpp:
2094         (WebCore::SMILTimeContainer::schedule):
2095         (WebCore::SMILTimeContainer::unschedule):
2096         (WebCore::SMILTimeContainer::setElapsed):
2097         (WebCore::SMILTimeContainer::sortByPriority):
2098         (WebCore::SMILTimeContainer::processAnimations):
2099         (WebCore::SMILTimeContainer::processScheduledAnimations):
2100         (WebCore::SMILTimeContainer::updateAnimations):
2101         (WebCore::SMILTimeContainer::~SMILTimeContainer): Deleted.
2102         * svg/animation/SMILTimeContainer.h:
2103         * svg/animation/SVGSMILElement.cpp:
2104         (WebCore::SVGSMILElement::calculateNextProgressTime const):
2105         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2106         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2107         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
2108         * svg/properties/SVGAnimatedPropertyPairAnimator.h:
2109         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
2110         * svg/properties/SVGAttributeAnimator.h:
2111         * svg/properties/SVGMemberAccessor.h:
2112         (WebCore::SVGMemberAccessor::createAnimator const):
2113         * svg/properties/SVGPrimitivePropertyAnimator.h:
2114         (WebCore::SVGPrimitivePropertyAnimator::create):
2115         * svg/properties/SVGPropertyAnimatorFactory.h:
2116         (WebCore::SVGPropertyAnimatorFactory::createAnimator):
2117         * svg/properties/SVGPropertyOwnerRegistry.h:
2118         * svg/properties/SVGPropertyRegistry.h:
2119         * svg/properties/SVGValuePropertyAnimatorImpl.h:
2120         * svg/properties/SVGValuePropertyListAnimatorImpl.h:
2121
2122 2019-09-28  Zalan Bujtas  <zalan@apple.com>
2123
2124         [LFC][IFC] Move horizontal alignment to Line
2125         https://bugs.webkit.org/show_bug.cgi?id=202351
2126         <rdar://problem/55810139>
2127
2128         Reviewed by Antti Koivisto.
2129
2130         Line should be able to finalize the run placement including horizontal alignment.
2131
2132         * layout/Verification.cpp:
2133         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2134         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2135         (WebCore::Layout::LineInput::LineInput):
2136         (WebCore::Layout::LineLayout::LineLayout):
2137         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
2138         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
2139         * layout/inlineformatting/InlineLine.cpp:
2140         (WebCore::Layout::Line::Line):
2141         (WebCore::Layout::Line::isVisuallyEmpty const):
2142         (WebCore::Layout::Line::close):
2143         (WebCore::Layout::Line::verticalAlignContent):
2144         (WebCore::Layout::Line::horizontalAlignContent):
2145         (WebCore::Layout::Line::appendInlineContainerStart):
2146         (WebCore::Layout::Line::appendTextContent):
2147         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2148         (WebCore::Layout::Line::appendHardLineBreak):
2149         (WebCore::Layout::Line::inlineItemContentHeight const):
2150         * layout/inlineformatting/InlineLine.h:
2151
2152 2019-09-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2153
2154         [IDL] Support record<DOMString, *Callback> in bindings
2155         https://bugs.webkit.org/show_bug.cgi?id=202326
2156
2157         Reviewed by Sam Weinig.
2158
2159         Currently, IDLRecord's converter assumes that the value type (template argument V) can be converted by passing
2160         in only an ExecState and the JSValue, since it calls `auto typedValue = Converter<V>::convert(state, subValue)`.
2161         However, IDLCallbackFunctions additionally require the JSDOMGlobalObject (see JSDOMConverterCallbacks.h). This
2162         results in a compilation error in generated code, when attempting to convert the record.
2163
2164         To fix this, teach Converter<IDLRecord<K, V>> to accept three arguments (the ExecState, value, and global
2165         object) in the case where V requires the global object. Additionally, let the bindings generator know that
2166         JSValue to native object conversion requires the global object, by returning whether or not the value type of
2167         the IDL record requires the global object, in the case where the given type is a record.
2168
2169         * bindings/js/JSDOMConvertRecord.h:
2170         * bindings/scripts/CodeGeneratorJS.pm:
2171         (JSValueToNativeDOMConvertNeedsGlobalObject):
2172         * bindings/scripts/test/JS/JSTestObj.cpp:
2173
2174         Test this scenario by augmenting TestObj.idl with record<DOMString, VoidCallback>.
2175
2176         (WebCore::jsTestObjStringVoidCallbackRecordAttrGetter):
2177         (WebCore::jsTestObjStringVoidCallbackRecordAttr):
2178         (WebCore::setJSTestObjStringVoidCallbackRecordAttrSetter):
2179         (WebCore::setJSTestObjStringVoidCallbackRecordAttr):
2180         * bindings/scripts/test/TestObj.idl:
2181
2182 2019-09-28  Zalan Bujtas  <zalan@apple.com>
2183
2184         [LFC][IFC] Line::InitialConstraints's heightAndBaseline should be optional
2185         https://bugs.webkit.org/show_bug.cgi?id=202348
2186
2187         Reviewed by Antti Koivisto.
2188
2189         Vertical properties are undefined while computing the preferred width.
2190
2191         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2192         (WebCore::Layout::LineInput::LineInput):
2193         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
2194         * layout/inlineformatting/InlineLine.cpp:
2195         (WebCore::Layout::Line::Line):
2196         * layout/inlineformatting/InlineLine.h:
2197
2198 2019-09-28  Chris Dumez  <cdumez@apple.com>
2199
2200         [Experiment][iOS] Add temporary HTTP header to distinguish iPads for requests to Google
2201         https://bugs.webkit.org/show_bug.cgi?id=202335
2202         <rdar://problem/55790994>
2203
2204         Reviewed by Maciej Stachowiak.
2205
2206         * loader/cache/CachedResourceLoader.cpp:
2207         (WebCore::CachedResourceLoader::requestResource):
2208         * platform/network/HTTPHeaderNames.in:
2209
2210 2019-09-28  Zalan Bujtas  <zalan@apple.com>
2211
2212         [LFC][IFC] Line::Box should have a const public interface
2213         https://bugs.webkit.org/show_bug.cgi?id=202336
2214         <rdar://problem/55798628>
2215
2216         Reviewed by Antti Koivisto.
2217
2218         Clean up Line::Box interface.
2219
2220         * layout/inlineformatting/InlineLine.cpp:
2221         (WebCore::Layout::Line::close):
2222         * layout/inlineformatting/InlineLine.h:
2223         (WebCore::Layout::Line::Run::displayRun const):
2224         (WebCore::Layout::Line::Run::isVisuallyEmpty const):
2225         (WebCore::Layout::Line::Run::expand):
2226         (WebCore::Layout::Line::Run::displayRun): Deleted.
2227
2228 2019-09-27  Chris Dumez  <cdumez@apple.com>
2229
2230         Pages using WebGLRenderingContext fail to enter the back/forward cache
2231         https://bugs.webkit.org/show_bug.cgi?id=202318
2232         <rdar://problem/55783612>
2233
2234         Reviewed by Tim Horton.
2235
2236         Allow pages with a WebGLRenderingContext to enter the back/forward cache by updating the
2237         implementation to use SuspendableTimers to fire JS events. This guarantees that no events
2238         will be fired (and thus no JS will run) while in the page cache.
2239
2240         This was preventing some of the pages on weather.com and facebook.com from entering the
2241         back/forward cache.
2242
2243         Test: fast/canvas/webgl/canvas-webgl-page-cache.html
2244
2245         * dom/DocumentEventQueue.cpp:
2246         * html/canvas/WebGLRenderingContextBase.cpp:
2247         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
2248         (WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension const):
2249         (WebCore::WebGLRenderingContextBase::suspend):
2250         (WebCore::WebGLRenderingContextBase::resume):
2251         (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
2252         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
2253         (WebCore::WebGLRenderingContextBase::dispatchContextChangedNotification):
2254         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
2255         * html/canvas/WebGLRenderingContextBase.h:
2256         * page/DOMTimer.cpp:
2257         (WebCore::DOMTimer::DOMTimer):
2258         * page/DOMTimer.h:
2259         * page/SuspendableTimer.cpp:
2260         (WebCore::SuspendableTimerBase::SuspendableTimerBase):
2261         (WebCore::SuspendableTimerBase::hasPendingActivity const):
2262         (WebCore::SuspendableTimerBase::stop):
2263         (WebCore::SuspendableTimerBase::suspend):
2264         (WebCore::SuspendableTimerBase::resume):
2265         (WebCore::SuspendableTimerBase::canSuspendForDocumentSuspension const):
2266         (WebCore::SuspendableTimerBase::didStop):
2267         (WebCore::SuspendableTimerBase::cancel):
2268         (WebCore::SuspendableTimerBase::startRepeating):
2269         (WebCore::SuspendableTimerBase::startOneShot):
2270         (WebCore::SuspendableTimerBase::repeatInterval const):
2271         (WebCore::SuspendableTimerBase::augmentFireInterval):
2272         (WebCore::SuspendableTimerBase::augmentRepeatInterval):
2273         (WebCore::SuspendableTimer::activeDOMObjectName const):
2274         * page/SuspendableTimer.h:
2275
2276 2019-09-27  Adrian Perez de Castro  <aperez@igalia.com>
2277
2278         [GTK][WPE] Fixes for non-unified builds after r249714
2279         https://bugs.webkit.org/show_bug.cgi?id=202304
2280
2281         Reviewed by Youenn Fablet.
2282
2283         No new tests needed.
2284
2285         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: Add missing inclusion of Frame.h
2286         to make the compiler stop complaining about Frame being used without being defined.
2287         * inspector/InspectorShaderProgram.h: Add missing inclusion of wtf/Variant.h, where
2288         WTF::Monostate is defined; and prefixed the usage with its namespace.
2289
2290 2019-09-27  Andres Gonzalez  <andresg_22@apple.com>
2291
2292         Support accessibility for <figure> element on iOS.
2293         https://bugs.webkit.org/show_bug.cgi?id=202272
2294         <rdar://problem/54789907>
2295
2296         Reviewed by Chris Fleizach.
2297
2298         Test: accessibility/ios-simulator/figure-element.html
2299
2300         Added a role description for the <figure> element.
2301         * accessibility/AccessibilityObject.cpp:
2302         (WebCore::AccessibilityObject::roleDescription const):
2303
2304 2019-09-27  Zalan Bujtas  <zalan@apple.com>
2305
2306         [iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
2307         https://bugs.webkit.org/show_bug.cgi?id=202331
2308         <rdar://problem/55629493>
2309
2310         Reviewed by Tim Horton.
2311
2312         Unfortunately the top level menu items now are ARIA labelled as 'buttons' and that triggers the fast path on content observation.
2313         This patch introduces a quirk on ralphLauren.com to ignore the ARIA labels when checking whether the target node should always click through.
2314
2315         * page/Quirks.cpp:
2316         (WebCore::Quirks::shouldIgnoreAriaForFastPathContentObservationCheck const):
2317         * page/Quirks.h:
2318
2319 2019-09-27  Per Arne Vollan  <pvollan@apple.com>
2320
2321         [Win] Crash under FontCache::lastResortFallbackFont
2322         https://bugs.webkit.org/show_bug.cgi?id=202325
2323         <rdar://problem/47856730>
2324
2325         Reviewed by Brent Fulgham.
2326
2327         As demonstrated by crash reports, there seems to be cases where we are not able to create a last resort fallback font  
2328         on Windows. If all attempts to create a fallback font fail, create a font from the default UI font.
2329  
2330         No new tests. I have not been able to reproduce this issue. 
2331
2332         * platform/graphics/win/FontCacheWin.cpp:
2333         (WebCore::FontCache::lastResortFallbackFont):
2334
2335 2019-09-27  Jiewen Tan  <jiewen_tan@apple.com>
2336
2337         Unreviewed, rolling out r250397.
2338
2339         caused failure on iOS 13
2340
2341         Reverted changeset:
2342
2343         "REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-
2344         credential-create-success-u2f.https.html is failing"
2345         https://bugs.webkit.org/show_bug.cgi?id=201620
2346         https://trac.webkit.org/changeset/250397
2347
2348 2019-09-27  Jer Noble  <jer.noble@apple.com>
2349
2350         [iOS] Vimeo fails to AirPlay in desktop mode
2351         https://bugs.webkit.org/show_bug.cgi?id=202322
2352
2353         Reviewed by Eric Carlson.
2354
2355         Add a Quirk which opts Vimeo out of the preload=auto restriction, and allows their
2356         second video element containing a HLS stream to correctly start AirPlaying when the
2357         system route changes.
2358
2359         * html/HTMLMediaElement.cpp:
2360         (WebCore::HTMLMediaElement::finishInitialization):
2361         * page/Quirks.cpp:
2362         (WebCore::Quirks::needsPreloadAutoQuirk const):
2363         * page/Quirks.h:
2364
2365 2019-09-27  Zalan Bujtas  <zalan@apple.com>
2366
2367         [LFC][IFC] Line::close should merge the text runs.
2368         https://bugs.webkit.org/show_bug.cgi?id=202319
2369         <rdar://problem/55785949>
2370
2371         Reviewed by Antti Koivisto.
2372
2373         Now Line::close returns the final Display::Run list.
2374
2375         * layout/displaytree/DisplayRect.h:
2376         (WebCore::Display::Rect::expandHorizontally):
2377         (WebCore::Display::Rect::expandVertically):
2378         (WebCore::Display::Rect::expand):
2379         * layout/displaytree/DisplayRun.h:
2380         (WebCore::Display::Run::expandVertically):
2381         (WebCore::Display::Run::expandHorizontally):
2382         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2383         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
2384         * layout/inlineformatting/InlineLine.cpp:
2385         (WebCore::Layout::Line::close):
2386         * layout/inlineformatting/InlineLine.h:
2387         (WebCore::Layout::Line::Run::displayRun):
2388
2389 2019-09-27  Chris Dumez  <cdumez@apple.com>
2390
2391         Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache
2392         https://bugs.webkit.org/show_bug.cgi?id=202314
2393         <rdar://problem/55783482>
2394
2395         Reviewed by Alex Christensen.
2396
2397         Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache.
2398         This was preventing all pages on Facebook.com to enter the back/forward cache.
2399
2400         No new tests, updated existing test.
2401
2402         * history/PageCache.cpp:
2403         (WebCore::canCacheFrame):
2404
2405 2019-09-27  Devin Rousso  <drousso@apple.com>
2406
2407         Flaky Test: inspector/canvas/updateShader.html
2408         https://bugs.webkit.org/show_bug.cgi?id=202186
2409         <rdar://problem/55716053>
2410
2411         Reviewed by Joseph Pecoraro.
2412
2413         If the `WebGLProgram` outlives it's `WebGLRenderingContext`, the `ScriptExecutionContext*`
2414         that was provided in the constructor won't be invalidated leading to the bad access crash.
2415
2416         Rather than pass the `ScriptExecutionContext*` directly, have `WebGLProgram` inherit from
2417         `ContextDestructionObserver` so that it can propertly invalidate (and notify Web Inspector)
2418         when the related context is about to be destroyed.
2419
2420         Test: inspector/canvas/updateShader.html
2421
2422         * html/canvas/WebGLProgram.h:
2423         (WebCore::WebGLProgram::scriptExecutionContext const): Deleted.
2424         * html/canvas/WebGLProgram.cpp:
2425         (WebCore::WebGLProgram::WebGLProgram):
2426         (WebCore::WebGLProgram::contextDestroyed): Added.
2427
2428 2019-09-27  Zalan Bujtas  <zalan@apple.com>
2429
2430         [LFC][IFC] Replace Line::Run's logicalRect/textContext with Display::Run
2431         https://bugs.webkit.org/show_bug.cgi?id=202313
2432         <rdar://problem/55782430>
2433
2434         Reviewed by Antti Koivisto.
2435
2436         Display::Run is a container for logical rect and text context. Let's replace Line::Run's logical rect/text context with Display::Run.
2437
2438         * layout/Verification.cpp:
2439         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2440         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2441         * layout/displaytree/DisplayRun.h:
2442         (WebCore::Display::Run::logicalRect const):
2443         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2444         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
2445         (WebCore::Layout::InlineFormattingContext::InlineLayout::alignRuns const):
2446         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2447         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
2448         * layout/inlineformatting/InlineFormattingState.h:
2449         (WebCore::Layout::InlineFormattingState::addInlineRun):
2450         * layout/inlineformatting/InlineLine.cpp:
2451         (WebCore::Layout::Line::Run::Run):
2452         (WebCore::Layout::Line::isVisuallyEmpty const):
2453         (WebCore::Layout::Line::appendNonBreakableSpace):
2454         (WebCore::Layout::Line::appendTextContent):
2455         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2456         (WebCore::Layout::Line::appendHardLineBreak):
2457         * layout/inlineformatting/InlineLine.h:
2458         (WebCore::Layout::Line::Run::displayRun const):
2459         (WebCore::Layout::Line::Run::logicalRect const):
2460         (WebCore::Layout::Line::Run::adjustLogicalTop):
2461         (WebCore::Layout::Line::Run::moveVertically):
2462         (WebCore::Layout::Line::Run::moveHorizontally):
2463         (WebCore::Layout::Line::Run::textContext const): Deleted.
2464         * layout/layouttree/LayoutTreeBuilder.cpp:
2465         (WebCore::Layout::outputInlineRuns):
2466
2467 2019-09-27  Truitt Savell  <tsavell@apple.com>
2468
2469         Unreviewed, rolling out r250415.
2470
2471         Broke iOS debug testing with 50 crashes and 850 API failure
2472
2473         Reverted changeset:
2474
2475         "ScrollingTreeScrollingNode: use LayerRepresentation for
2476         scroll container, scrolled contents layers"
2477         https://bugs.webkit.org/show_bug.cgi?id=202256
2478         https://trac.webkit.org/changeset/250415
2479
2480 2019-09-27  Alex Christensen  <achristensen@webkit.org>
2481
2482         Move service worker process termination delay disabling from process pool to website data store
2483         https://bugs.webkit.org/show_bug.cgi?id=202308
2484
2485         Reviewed by Chris Dumez.
2486
2487         * workers/service/server/SWServer.cpp:
2488         (WebCore::SWServer::SWServer):
2489         (WebCore::SWServer::unregisterServiceWorkerClient):
2490         * workers/service/server/SWServer.h:
2491         (WebCore::SWServer::disableServiceWorkerProcessTerminationDelay): Deleted.
2492
2493 2019-09-27  Chris Dumez  <cdumez@apple.com>
2494
2495         IDBRequest should not prevent a page from entering the back/forward cache
2496         https://bugs.webkit.org/show_bug.cgi?id=202270
2497         <rdar://problem/55744717>
2498
2499         Reviewed by Youenn Fablet.
2500
2501         Update IDBRequest::canSuspendForDocumentSuspension() to return true instead of
2502         false. IDBRequest can only fire 2 events (error / success) and for both its
2503         merely enqueues the Event to the DocumentEventQueue. The DocumentEventQueue
2504         uses a SuspendableTimer (which will be suspended while the document is in the
2505         page cache) so there is no risk of firing the events (and thus running script)
2506         while in the page cache.
2507
2508         Test: storage/indexeddb/IDBRequest-page-cache.html
2509
2510         * Modules/indexeddb/IDBRequest.cpp:
2511         (WebCore::IDBRequest::canSuspendForDocumentSuspension const):
2512
2513 2019-09-27  Zalan Bujtas  <zalan@apple.com>
2514
2515         [LFC][IFC] Remove redundant Line::TextContext member variables
2516         https://bugs.webkit.org/show_bug.cgi?id=202300
2517         <rdar://problem/55769916>
2518
2519         Reviewed by Antti Koivisto.
2520
2521         This is in preparation for using Display::Run in Line::Run instead of Display::Rect + TextContext.
2522
2523         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2524         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
2525         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2526         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
2527         * layout/inlineformatting/InlineLine.cpp:
2528         (WebCore::Layout::Line::Run::isWhitespace const):
2529         (WebCore::Layout::Line::Run::canBeExtended const):
2530         (WebCore::Layout::Line::isVisuallyEmpty const):
2531         (WebCore::Layout::Line::removeTrailingTrimmableContent):
2532         (WebCore::Layout::Line::trailingTrimmableWidth const):
2533         (WebCore::Layout::Line::appendTextContent):
2534         * layout/inlineformatting/InlineLine.h:
2535         (WebCore::Layout::Line::Run::isVisuallyEmpty const):
2536         (WebCore::Layout::Line::Run::setVisuallyIsEmpty):
2537         (WebCore::Layout::Line::Run::setTextIsCollapsed): Deleted.
2538
2539 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
2540
2541         [Nicosia] Implement frame scrolling functionality
2542         https://bugs.webkit.org/show_bug.cgi?id=202201
2543
2544         Reviewed by Carlos Garcia Campos.
2545
2546         Implement logic in the ScrollingTreeFrameScrollingNodeNicosia class,
2547         largely following the Mac port's implementation but skipping areas we
2548         don't support or can keep simple, like CSS scroll snap, frame pinning
2549         and more complex wheel event handling through the platform-specific
2550         delegate behavior.
2551
2552         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
2553         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren):
2554         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren):
2555         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):
2556         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::adjustedScrollPosition const):
2557         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::currentScrollPositionChanged):
2558         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers):
2559         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionRelatedLayers):
2560         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:
2561
2562 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
2563
2564         [Nicosia] ScrollingCoordinatorNicosia should handle wheel events coming from the main thread
2565         https://bugs.webkit.org/show_bug.cgi?id=202275
2566
2567         Reviewed by Carlos Garcia Campos.
2568
2569         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
2570         (WebCore::ScrollingCoordinatorNicosia::handleWheelEvent):
2571         Handle wheel events that get rerouted through the main thread,
2572         dispatching them back to the scrolling thread so that they end up
2573         performing the desired scroll if possible.
2574
2575 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
2576
2577         [CoordinatedGraphics] support bounds origin
2578         https://bugs.webkit.org/show_bug.cgi?id=198998
2579
2580         Reviewed by Carlos Garcia Campos.
2581
2582         Add bounds-origin support to the CoordinatedGraphics stack. Currently we
2583         take the short-cut implementation of just combining the bounds origin
2584         and the position value and incorporating them into the layer transform
2585         we calculate in TextureMapperLayer.
2586
2587         Additional boilerplate code is added, as required, to relay the
2588         WebCore::GraphicsLayer change of bounds origin to the rendering system.
2589
2590         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
2591         (Nicosia::CompositionLayer::flushState):
2592         * platform/graphics/texmap/TextureMapperLayer.cpp:
2593         (WebCore::TextureMapperLayer::computeTransformsRecursive):
2594         (WebCore::TextureMapperLayer::setBoundsOrigin):
2595         * platform/graphics/texmap/TextureMapperLayer.h:
2596         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2597         (WebCore::CoordinatedGraphicsLayer::setBoundsOrigin):
2598         (WebCore::CoordinatedGraphicsLayer::computePositionRelativeToBase):
2599         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2600
2601 2019-09-26  Zan Dobersek  <zdobersek@igalia.com>
2602
2603         ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
2604         https://bugs.webkit.org/show_bug.cgi?id=202256
2605
2606         Reviewed by Simon Fraser.
2607
2608         Make the scroll container and scrolled contents layer holders
2609         platform-independent by using the LayerRepresentation as the underlying
2610         type for the two member variables in ScrollingTreeScrollingNode.
2611
2612         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2613         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2614         * page/scrolling/ScrollingTreeScrollingNode.h:
2615         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2616         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
2617         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2618         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
2619
2620 2019-09-26  Chris Dumez  <cdumez@apple.com>
2621
2622         Pages frequently fails to enter the back/forward cache due to pending loads
2623         https://bugs.webkit.org/show_bug.cgi?id=202289
2624         <rdar://problem/55758506>
2625
2626         Reviewed by Geoffrey Garen.
2627
2628         Allow pages to enter the back / forward cache, even if they have pending loads.
2629         Note that these pending loads get cancelled. Also note that we won't enter page
2630         cache unless the 'load' event has been fired in the main frame, since a
2631         HistoryItem would not get created otherwise. This was causing frequent transient
2632         failures to enter the back / forward cache while browsing (e.g. on weather.com).
2633
2634         Test: http/tests/navigation/page-cache-pending-load.html
2635
2636         * history/PageCache.cpp:
2637         (WebCore::canCacheFrame):
2638         * loader/CrossOriginPreflightChecker.cpp:
2639         * loader/CrossOriginPreflightChecker.h:
2640         * loader/DocumentLoader.cpp:
2641         (WebCore::DocumentLoader::setMainDocumentError):
2642         (WebCore::DocumentLoader::stopLoading):
2643         * loader/DocumentLoader.h:
2644         * loader/DocumentThreadableLoader.cpp:
2645         * loader/DocumentThreadableLoader.h:
2646         * loader/cache/CachedResource.cpp:
2647         * loader/cache/CachedResource.h:
2648         * loader/cache/CachedResourceClient.h:
2649         (WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
2650         * page/DiagnosticLoggingKeys.cpp:
2651         (WebCore::DiagnosticLoggingKeys::mainFrameHasNotFinishedLoadingKey):
2652         * page/DiagnosticLoggingKeys.h:
2653
2654 2019-09-26  Zalan Bujtas  <zalan@apple.com>
2655
2656         [LFC][IFC] Line::Run should have a reference to the associated InlineItem
2657         https://bugs.webkit.org/show_bug.cgi?id=202288
2658         <rdar://problem/55758112>
2659
2660         Reviewed by Antti Koivisto.
2661
2662         It makes it clearer where the type and the layout box come from.
2663
2664         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2665         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
2666         * layout/inlineformatting/InlineLine.cpp:
2667         (WebCore::Layout::Line::Run::Run):
2668         * layout/inlineformatting/InlineLine.h:
2669         (WebCore::Layout::Line::Run::layoutBox const):
2670         (WebCore::Layout::Line::Run::textContext const):
2671         (WebCore::Layout::Line::Run::isText const):
2672         (WebCore::Layout::Line::Run::isBox const):
2673         (WebCore::Layout::Line::Run::isLineBreak const):
2674         (WebCore::Layout::Line::Run::isContainerStart const):
2675         (WebCore::Layout::Line::Run::isContainerEnd const):
2676         (WebCore::Layout::Line::Run::type const): Deleted.
2677
2678 2019-09-26  Zalan Bujtas  <zalan@apple.com>
2679
2680         [LFC][IFC] Remove redundant Line::Content
2681         https://bugs.webkit.org/show_bug.cgi?id=202284
2682         <rdar://problem/55757187>
2683
2684         Reviewed by Antti Koivisto.
2685
2686         Line::Content is really just a list or runs at this point.
2687
2688         * layout/inlineformatting/InlineFormattingContext.h:
2689         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2690         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
2691         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2692         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
2693         * layout/inlineformatting/InlineLine.cpp:
2694         (WebCore::Layout::Line::Run::Run):
2695         (WebCore::Layout::Line::Line):
2696         (WebCore::Layout::Line::isVisuallyEmpty const):
2697         (WebCore::Layout::Line::close):
2698         (WebCore::Layout::Line::appendNonBreakableSpace):
2699         (WebCore::Layout::Line::appendTextContent):
2700         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2701         (WebCore::Layout::Line::appendHardLineBreak):
2702         (WebCore::Layout::Line::Content::Run::Run): Deleted.
2703         * layout/inlineformatting/InlineLine.h:
2704         (WebCore::Layout::Line::Run::layoutBox const):
2705         (WebCore::Layout::Line::Run::logicalRect const):
2706         (WebCore::Layout::Line::Run::textContext const):
2707         (WebCore::Layout::Line::Run::type const):
2708         (WebCore::Layout::Line::Run::isText const):
2709         (WebCore::Layout::Line::Run::isBox const):
2710         (WebCore::Layout::Line::Run::isLineBreak const):
2711         (WebCore::Layout::Line::Run::isContainerStart const):
2712         (WebCore::Layout::Line::Run::isContainerEnd const):
2713         (WebCore::Layout::Line::Run::adjustLogicalTop):
2714         (WebCore::Layout::Line::Run::moveVertically):
2715         (WebCore::Layout::Line::Run::moveHorizontally):
2716         (WebCore::Layout::Line::Run::setTextIsCollapsed):
2717         (WebCore::Layout::Line::Content::Run::layoutBox const): Deleted.
2718         (WebCore::Layout::Line::Content::Run::logicalRect const): Deleted.
2719         (WebCore::Layout::Line::Content::Run::textContext const): Deleted.
2720         (WebCore::Layout::Line::Content::Run::type const): Deleted.
2721         (WebCore::Layout::Line::Content::Run::isText const): Deleted.
2722         (WebCore::Layout::Line::Content::Run::isBox const): Deleted.
2723         (WebCore::Layout::Line::Content::Run::isLineBreak const): Deleted.
2724         (WebCore::Layout::Line::Content::Run::isContainerStart const): Deleted.
2725         (WebCore::Layout::Line::Content::Run::isContainerEnd const): Deleted.
2726         (WebCore::Layout::Line::Content::Run::adjustLogicalTop): Deleted.
2727         (WebCore::Layout::Line::Content::Run::moveVertically): Deleted.
2728         (WebCore::Layout::Line::Content::Run::moveHorizontally): Deleted.
2729         (WebCore::Layout::Line::Content::Run::setTextIsCollapsed): Deleted.
2730         (WebCore::Layout::Line::Content::runs const): Deleted.
2731         (WebCore::Layout::Line::Content::runs): Deleted.
2732
2733 2019-09-26  Zalan Bujtas  <zalan@apple.com>
2734
2735         [LFC][IFC] Move Line::Content::m_lineBox to Line.
2736         https://bugs.webkit.org/show_bug.cgi?id=202280
2737         <rdar://problem/55755798>
2738
2739         Reviewed by Antti Koivisto.
2740
2741         This is in preparation for Line producing Display::Runs instead of Line::Runs.
2742
2743         * layout/inlineformatting/InlineFormattingContext.h:
2744         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2745         (WebCore::Layout::LineLayout::close):
2746         (WebCore::Layout::LineLayout::placeInlineItem):
2747         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
2748         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
2749         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
2750         * layout/inlineformatting/InlineLine.cpp:
2751         (WebCore::Layout::Line::Line):
2752         (WebCore::Layout::Line::close):
2753         (WebCore::Layout::Line::removeTrailingTrimmableContent):
2754         (WebCore::Layout::Line::moveLogicalLeft):
2755         (WebCore::Layout::Line::appendNonBreakableSpace):
2756         (WebCore::Layout::Line::appendTextContent):
2757         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2758         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2759         * layout/inlineformatting/InlineLine.h:
2760         (WebCore::Layout::Line::Content::runs const):
2761         (WebCore::Layout::Line::availableWidth const):
2762         (WebCore::Layout::Line::lineBox const):
2763         (WebCore::Layout::Line::logicalTop const):
2764         (WebCore::Layout::Line::logicalBottom const):
2765         (WebCore::Layout::Line::logicalLeft const):
2766         (WebCore::Layout::Line::logicalHeight const):
2767         (WebCore::Layout::Line::contentLogicalWidth const):
2768         (WebCore::Layout::Line::contentLogicalRight const):
2769         (WebCore::Layout::Line::baselineOffset const):
2770         (WebCore::Layout::Line::Content::lineBox const): Deleted.
2771         (WebCore::Layout::Line::Content::lineBox): Deleted.
2772         (WebCore::Layout::Line::Content::setLineBox): Deleted.
2773
2774 2019-09-26  Jiewen Tan  <jiewen_tan@apple.com>
2775
2776         REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-credential-create-success-u2f.https.html is failing
2777         https://bugs.webkit.org/show_bug.cgi?id=201620
2778
2779         Unreviewed, roll back part of r249737 to confirm the cause.
2780
2781         * Modules/webauthn/fido/U2fResponseConverter.cpp:
2782         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
2783
2784 2019-09-26  Truitt Savell  <tsavell@apple.com>
2785
2786         Unreviewed, rolling out r250385.
2787
2788         Broke imported/w3c/web-platform-tests/svg/animations/syncbase-
2789         remove-add-while-running.html on all platforms. Which was
2790         caught by EWS
2791
2792         Reverted changeset:
2793
2794         "Non-callable "handleEvent" property is silently ignored"
2795         https://bugs.webkit.org/show_bug.cgi?id=200066
2796         https://trac.webkit.org/changeset/250385
2797
2798 2019-09-26  Kate Cheney  <katherine_cheney@apple.com>
2799
2800         Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
2801         https://bugs.webkit.org/show_bug.cgi?id=195420
2802         <rdar://problem/54213551> 
2803
2804         Reviewed by Brent Fulgham.
2805
2806         Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect-database.html
2807                http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database.html
2808                http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database.html
2809                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database.html
2810                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database.html
2811                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database.html
2812                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database.html
2813                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database.html
2814                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database.html
2815                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html
2816                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
2817                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html
2818                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html
2819                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html
2820                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
2821                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database.html
2822                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html
2823                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html
2824                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html
2825                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database.html
2826                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html
2827                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html
2828                http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html
2829                http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html
2830                http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html
2831                http/tests/resourceLoadStatistics/cookie-deletion-database.html
2832                http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html
2833                http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database.html
2834                http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database.html
2835                http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database.html
2836                http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database.html
2837                http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html
2838                http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database.html
2839                http/tests/resourceLoadStatistics/enable-debug-mode-database.html
2840                http/tests/resourceLoadStatistics/grandfathering-database.html
2841                http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html
2842                http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html
2843                http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database.html
2844                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
2845                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
2846                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
2847                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
2848                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
2849                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
2850                http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database.html
2851                http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html
2852                http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html
2853                http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html
2854                http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html
2855                http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html
2856                http/tests/resourceLoadStatistics/prune-statistics-database.html
2857                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
2858                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
2859                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
2860                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
2861                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
2862                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
2863                http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database.html
2864                http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html
2865                http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database.html
2866                http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html
2867                http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html
2868                http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database.html
2869                http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database.html
2870
2871         * platform/sql/SQLiteDatabase.h:
2872         Added WEBCORE_EXPORT prefix to 2 functions needed in the ITP Database 
2873         to clear out the database.
2874
2875 2019-09-26  Antti Koivisto  <antti@apple.com>
2876
2877         Use LineLayoutTraversal for RenderText functions
2878         https://bugs.webkit.org/show_bug.cgi?id=202266
2879
2880         Reviewed by Zalan Bujtas.
2881
2882         Replace a bunch of functions that have separate simple and complex line layout versions with
2883         shared functions that use LineLayoutTraversal.
2884
2885         * rendering/RenderText.cpp:
2886         (WebCore::RenderText::absoluteRects const):
2887         (WebCore::RenderText::firstRunLocation const):
2888         (WebCore::RenderText::linesBoundingBox const):
2889
2890         This is substantially simpler than RenderTextLineBoxes::boundingBox because it uses physical rects for all computations
2891         instead of using logical rects and flipping to physical at the end.
2892
2893         (WebCore::RenderText::caretMinOffset const):
2894         (WebCore::RenderText::caretMaxOffset const):
2895         (WebCore::RenderText::countRenderedCharacterOffsetsUntil const):
2896         (WebCore::containsOffset):
2897         (WebCore::RenderText::containsRenderedCharacterOffset const):
2898         (WebCore::RenderText::containsCaretOffset const):
2899         (WebCore::RenderText::hasRenderedText const):
2900         * rendering/RenderTextLineBoxes.cpp:
2901         (WebCore::RenderTextLineBoxes::boundingBox const): Deleted.
2902         (WebCore::RenderTextLineBoxes::firstRunLocation const): Deleted.
2903         (WebCore::RenderTextLineBoxes::hasRenderedText const): Deleted.
2904         (WebCore::RenderTextLineBoxes::caretMinOffset const): Deleted.
2905         (WebCore::RenderTextLineBoxes::caretMaxOffset const): Deleted.
2906         (WebCore::RenderTextLineBoxes::containsOffset const): Deleted.
2907         (WebCore::RenderTextLineBoxes::countCharacterOffsetsUntil const): Deleted.
2908         (WebCore::RenderTextLineBoxes::absoluteRects const): Deleted.
2909         * rendering/RenderTreeAsText.cpp:
2910         (WebCore::write):
2911         * rendering/SimpleLineLayout.cpp:
2912         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded):
2913         * rendering/SimpleLineLayout.h:
2914         (WebCore::SimpleLineLayout::Run::Run):
2915         * rendering/SimpleLineLayoutFunctions.cpp:
2916         (WebCore::SimpleLineLayout::computeFirstRunLocation): Deleted.
2917         * rendering/SimpleLineLayoutFunctions.h:
2918         (WebCore::SimpleLineLayout::findCaretMinimumOffset): Deleted.
2919         (WebCore::SimpleLineLayout::findCaretMaximumOffset): Deleted.
2920         (WebCore::SimpleLineLayout::containsOffset): Deleted.
2921         (WebCore::SimpleLineLayout::isTextRendered): Deleted.
2922         * rendering/SimpleLineLayoutResolver.h:
2923         (WebCore::SimpleLineLayout::RunResolver::Run::isLineBreak const):
2924         * rendering/line/LineLayoutTraversal.cpp:
2925         (WebCore::LineLayoutTraversal::TextBox::isLineBreak const):
2926         (WebCore::LineLayoutTraversal::firstTextBoxFor):
2927         (WebCore::LineLayoutTraversal::firstTextBoxInTextOrderFor):
2928         (WebCore::LineLayoutTraversal::textBoxesFor):
2929         (WebCore::LineLayoutTraversal::firstTextBoxInVisualOrderFor): Deleted.
2930         (WebCore::LineLayoutTraversal::textBoxRangeFor): Deleted.
2931         * rendering/line/LineLayoutTraversal.h:
2932         (WebCore::LineLayoutTraversal::hasTextBoxes):
2933
2934 2019-09-26  Truitt Savell  <tsavell@apple.com>
2935
2936         Unreviewed, rolling out r250381.
2937
2938         broke multiple webgpu/ tests on Mojave WK2
2939
2940         Reverted changeset:
2941
2942         "Flaky Test: inspector/canvas/updateShader.html"
2943         https://bugs.webkit.org/show_bug.cgi?id=202186
2944         https://trac.webkit.org/changeset/250381
2945
2946 2019-09-26  Alexey Shvayka  <shvaikalesh@gmail.com>
2947
2948         Non-callable "handleEvent" property is silently ignored
2949         https://bugs.webkit.org/show_bug.cgi?id=200066
2950
2951         Reviewed by Darin Adler.
2952
2953         Tests: imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html
2954                imported/w3c/web-platform-tests/IndexedDB/fire-success-event-exception.html
2955                imported/w3c/web-platform-tests/IndexedDB/fire-upgradeneeded-event-exception.html
2956                imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent.html
2957
2958         * bindings/js/JSEventListener.cpp:
2959         (WebCore::JSEventListener::handleEvent): Report TypeError if "handleEvent" is not callable.
2960
2961 2019-09-26  Zalan Bujtas  <zalan@apple.com>
2962
2963         [LFC][IFC] Decouple Display::Run and Display::Box initializations.
2964         https://bugs.webkit.org/show_bug.cgi?id=202255
2965         <rdar://problem/55731445>
2966
2967         Reviewed by Antti Koivisto.
2968
2969         This is in preparation for moving Display::Run initialization to Line class.
2970
2971         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2972         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
2973
2974 2019-09-26  Devin Rousso  <drousso@apple.com>
2975
2976         Flaky Test: inspector/canvas/updateShader.html
2977         https://bugs.webkit.org/show_bug.cgi?id=202186
2978         <rdar://problem/55716053>
2979
2980         Reviewed by Joseph Pecoraro.
2981
2982         If the `WebGPUPipeline`/`WebGLProgram` outlives it's `WebGPUDevice`/`WebGLRenderingContext`,
2983         the `ScriptExecutionContext*` that was provided in the constructor won't be invalidated
2984         leading to the bad access crash.
2985
2986         Rather than pass the `ScriptExecutionContext*` directly, have `WebGPUPipeline`/`WebGLProgram`
2987         extend from `ContextDestructionObserver` so that it can propertly invalidate (and notify Web
2988         Inspector) when the related context is about to be destroyed.
2989
2990         Test: inspector/canvas/updateShader.html
2991
2992         * Modules/webgpu/WebGPUPipeline.h:
2993         (WebCore::WebGPUPipeline::scriptExecutionContext const): Deleted.
2994         * Modules/webgpu/WebGPUPipeline.cpp:
2995         (WebCore::WebGPUPipeline::WebGPUPipeline):
2996         (WebCore::WebGPUPipeline::contextDestroyed): Added.
2997
2998         * html/canvas/WebGLProgram.h:
2999         (WebCore::WebGLProgram::scriptExecutionContext const): Deleted.
3000         * html/canvas/WebGLProgram.cpp:
3001         (WebCore::WebGLProgram::WebGLProgram):
3002         (WebCore::WebGLProgram::contextDestroyed): Added.
3003
3004 2019-09-25  Chris Dumez  <cdumez@apple.com>
3005
3006         Add very basic PageCache support for RTCPeerConnection
3007         https://bugs.webkit.org/show_bug.cgi?id=202244
3008
3009         Reviewed by Geoffrey Garen.
3010
3011         RTCPeerConnection::canSuspendForDocumentSuspension() returns true if
3012         RTCPeerConnection::hasPendingActivity() return false. Previously, hasPendingActivity()
3013         would return true unless the JS has called close() on the RTCPeerConnection
3014         object.
3015
3016         On weather.com, an ad would construct an RTCPeerConnection just to do some feature
3017         checking and then let the variable go out of scope (without calling close()). Because
3018         of the previous implementation of RTCPeerConnection::hasPendingActivity(), this wrapper
3019         and its implementation object would stay alive forever AND prevent the page from
3020         entering PageCache on navigation.
3021
3022         To improve this, the implementation of hadPendingActivity() has been updated so that
3023         it keeps returning false if close() has been called, but will also return false if
3024         there are no pending Promises to be resolved and no event listeners.
3025
3026         Test: fast/mediastream/RTCPeerConnection-page-cache.html
3027
3028         * Modules/mediastream/RTCPeerConnection.cpp:
3029         WebCore::RTCPeerConnection::RTCPeerConnection:
3030         Stop taking a pending activity in the constructor, this would be NOT keep the wrapper
3031         alive since RTCPeerConnection::hasPendingActivity() was not checking
3032         ActiveDOMObject::hasPendingActivity().
3033
3034         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const):
3035         (WebCore::RTCPeerConnection::hasPendingActivity const):
3036         
3037         * Modules/mediastream/RTCPeerConnection.h:
3038
3039         * bindings/js/JSDOMPromiseDeferred.h:
3040         (WebCore::DOMPromiseDeferredBase::whenSettled):
3041
3042 2019-09-25  Chris Dumez  <cdumez@apple.com>
3043
3044         Improve Service worker support for Page Caching
3045         https://bugs.webkit.org/show_bug.cgi?id=202221
3046
3047         Reviewed by Geoffrey Garen.
3048
3049         Allow pages using service workers to enter the back / forward cache.
3050         Update ServiceWorkerRegistration / ServiceWorker ActiveDOMObjects
3051         to properly suspend while in PageCache. Also, let documents controlled
3052         by a service worker to enter PageCache (we already unregistered it as
3053         a client of the service worker while suspended).
3054
3055         Test: http/tests/workers/service/page-caching.html
3056
3057         * dom/Document.cpp:
3058         (WebCore::Document::suspend):
3059         (WebCore::Document::resume):
3060         * history/PageCache.cpp:
3061         (WebCore::canCacheFrame):
3062         * workers/service/ServiceWorker.cpp:
3063         (WebCore::ServiceWorker::updateState):
3064         (WebCore::ServiceWorker::canSuspendForDocumentSuspension const):
3065         (WebCore::ServiceWorker::suspend):
3066         (WebCore::ServiceWorker::resume):
3067         * workers/service/ServiceWorker.h:
3068         * workers/service/ServiceWorkerRegistration.cpp:
3069         (WebCore::ServiceWorkerRegistration::fireUpdateFoundEvent):
3070         (WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const):
3071         (WebCore::ServiceWorkerRegistration::suspend):
3072         (WebCore::ServiceWorkerRegistration::resume):
3073         * workers/service/ServiceWorkerRegistration.h:
3074
3075 2019-09-25  Chris Dumez  <cdumez@apple.com>
3076
3077         [Cocoa] Regression(r212041) Safari adds a .dms extension automatically when downloading binaries with no extension
3078         https://bugs.webkit.org/show_bug.cgi?id=202147
3079         <rdar://problem/54886021>
3080
3081         Reviewed by Alexey Proskuryakov.
3082
3083         When getting a suggested filename without extension (either from Content-Disposition header or from the download
3084         attribute), we determine a suitable file extension based on the Content-Type header and append it. This is useful
3085         since a lot of operating systems (such as macOS) rely on the file extension to determine file type.
3086
3087         The issue is that if the Content-Type is not provided or when it is provided but is "application/octet-stream",
3088         we would append a .dms extension, which was unexpected. This patch makes it so that we no longer try to append
3089         an extension when the resolved content type is "application/octet-stream".
3090
3091         Tests: http/tests/download/anchor-download-attribute-content-disposition-no-extension-octet-stream.html
3092                http/tests/download/anchor-download-attribute-content-disposition-no-extension-text-plain.html
3093                http/tests/security/anchor-download-octet-stream-no-extension.html
3094
3095         * platform/MIMETypeRegistry.cpp:
3096         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
3097
3098 2019-09-25  Megan Gardner  <megan_gardner@apple.com>
3099
3100         Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
3101         https://bugs.webkit.org/show_bug.cgi?id=202125
3102
3103         Reviewed by Tim Horton.
3104
3105         Test: editing/selection/ios/update-selection-after-iframe-scroll.html
3106
3107         When we end scrolling, make sure that iframes get a final update to ensure that the 
3108         selection is in the correct position. Pipe that to WebKit/UIProcess via
3109         frame specific plath.
3110
3111         * loader/EmptyClients.cpp:
3112         * page/EditorClient.h:
3113         * page/scrolling/AsyncScrollingCoordinator.cpp:
3114         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
3115
3116 2019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3117
3118         Page temporarily jumps to an excessively small viewport scale while loading usatoday.com
3119         https://bugs.webkit.org/show_bug.cgi?id=202224
3120         <rdar://problem/52906640>
3121
3122         Reviewed by Tim Horton.
3123
3124         On some pages (e.g. usatoday.com), the content width of the page temporarily becomes very large during page
3125         load. This causes a couple of viewport scaling behaviors (notably, the existing shrink-to-fit heuristic in
3126         ViewportConfiguration::initialScaleFromSize, as well as the new iPad-specific content-aware shrink-to-fit
3127         heuristic in WebPage::immediatelyShrinkToFitContent) to cause the page to shrink down excessively in an attempt
3128         to fit all the content to the viewport. This causes a very ugly flash as the page appears zoomed out initially
3129         during page load, before zooming back in.
3130
3131         To fix this, we add some sanity checks to these viewport scaling heuristics. In ViewportConfiguration's
3132         initialScaleFromSize method, in the codepath where an initial scale is not specified, we always scale to fit the
3133         contents of the page; instead, detect the case where the content width is enormous (with a threshold arbitrarily
3134         chosen to be 1920) and fall back to the scaling to fit the viewport's width, if such a width has been explicitly
3135         set. This ensures that we avoid excessive shrinking in the case where content is extremely wide, but also that
3136         we do scale the viewport down to fit all the content in the case where the content isn't extremely wide (e.g. on
3137         daringfireball.com).
3138
3139         See WebKit ChangeLog for more detail.
3140
3141         Test: fast/viewport/ios/shrink-to-fit-large-content-width.html
3142
3143         * page/ViewportConfiguration.cpp:
3144         (WebCore::ViewportConfiguration::initialScaleFromSize const):
3145
3146 2019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3147
3148         [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com
3149         https://bugs.webkit.org/show_bug.cgi?id=202167
3150         <rdar://problem/55185021>
3151
3152         Reviewed by Tim Horton.
3153
3154         Adds a new site-specific quirk. See WebKit ChangeLog for more details.
3155
3156         * page/Quirks.cpp:
3157         (WebCore::Quirks::shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation const):
3158         * page/Quirks.h:
3159         * platform/RuntimeApplicationChecks.h:
3160         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3161         (WebCore::IOSApplication::isDataActivation):
3162
3163 2019-09-25  Jonathan Bedard  <jbedard@apple.com>
3164
3165         Unreviewed, rolling out r250324.
3166
3167         Broke many mac wk2 layout tests
3168
3169         Reverted changeset:
3170
3171         "Enable LayoutTests using ResourceLoadStatistics SQLite
3172         backend (195420)"
3173         https://bugs.webkit.org/show_bug.cgi?id=195420
3174         https://trac.webkit.org/changeset/250324
3175
3176 2019-09-25  Antti Koivisto  <antti@apple.com>
3177
3178         Rename LineLayoutInterface to LineLayoutTraversal
3179         https://bugs.webkit.org/show_bug.cgi?id=202202
3180
3181         Reviewed by Zalan Bujtas.
3182
3183         Use a bit more informative namespace name.
3184
3185         * Headers.cmake:
3186         * Sources.txt:
3187         * WebCore.xcodeproj/project.pbxproj:
3188         * dom/Position.cpp:
3189         (WebCore::Position::upstream const):
3190         (WebCore::Position::downstream const):
3191         * editing/TextIterator.cpp:
3192         (WebCore::TextIterator::handleTextNode):
3193         (WebCore::TextIterator::handleTextBox):
3194         (WebCore::TextIterator::handleTextNodeFirstLetter):
3195         * editing/TextIterator.h:
3196         * rendering/RenderTreeAsText.cpp:
3197         (WebCore::RenderTreeAsText::writeRenderObject):
3198         (WebCore::writeTextBox):
3199         (WebCore::write):
3200         * rendering/line/LineLayoutTraversal.cpp: Renamed from Source/WebCore/rendering/line/LineLayoutInterfaceTextBoxes.cpp.
3201         (WebCore::LineLayoutTraversal::TextBox::rect const):
3202         (WebCore::LineLayoutTraversal::TextBox::logicalRect const):
3203         (WebCore::LineLayoutTraversal::TextBox::hasHyphen const):
3204         (WebCore::LineLayoutTraversal::TextBox::isLeftToRightDirection const):
3205         (WebCore::LineLayoutTraversal::TextBox::dirOverride const):
3206         (WebCore::LineLayoutTraversal::TextBox::text const):
3207         (WebCore::LineLayoutTraversal::TextBox::localStartOffset const):
3208         (WebCore::LineLayoutTraversal::TextBox::localEndOffset const):
3209         (WebCore::LineLayoutTraversal::TextBox::length const):
3210         (WebCore::LineLayoutTraversal::TextBox::isLastOnLine const):
3211         (WebCore::LineLayoutTraversal::TextBox::isLast const):
3212         (WebCore::LineLayoutTraversal::TextBox::iterator const):
3213         (WebCore::LineLayoutTraversal::TextBoxIterator::TextBoxIterator):
3214         (WebCore::LineLayoutTraversal::TextBoxIterator::traverseNextInVisualOrder):
3215         (WebCore::LineLayoutTraversal::TextBoxIterator::ComplexPath::nextInlineTextBoxInTextOrder const):
3216         (WebCore::LineLayoutTraversal::TextBoxIterator::traverseNextInTextOrder):
3217         (WebCore::LineLayoutTraversal::TextBoxIterator::operator== const):
3218         (WebCore::LineLayoutTraversal::TextBoxIterator::atEnd const):
3219         (WebCore::LineLayoutTraversal::firstTextBoxInVisualOrderFor):
3220         (WebCore::LineLayoutTraversal::firstTextBoxInTextOrderFor):
3221         (WebCore::LineLayoutTraversal::textBoxRangeFor):
3222         * rendering/line/LineLayoutTraversal.h: Renamed from Source/WebCore/rendering/line/LineLayoutInterfaceTextBoxes.h.
3223         (WebCore::LineLayoutTraversal::TextBoxIterator::TextBoxIterator):
3224         (WebCore::LineLayoutTraversal::TextBoxIterator::operator++):
3225         (WebCore::LineLayoutTraversal::TextBoxIterator::operator bool const):
3226         (WebCore::LineLayoutTraversal::TextBoxIterator::operator!= const):
3227         (WebCore::LineLayoutTraversal::TextBoxIterator::operator== const):
3228         (WebCore::LineLayoutTraversal::TextBoxIterator::operator* const):
3229         (WebCore::LineLayoutTraversal::TextBoxIterator::operator-> const):
3230         (WebCore::LineLayoutTraversal::TextBoxRange::TextBoxRange):
3231         (WebCore::LineLayoutTraversal::TextBoxRange::begin const):
3232         (WebCore::LineLayoutTraversal::TextBoxRange::end const):
3233         (WebCore::LineLayoutTraversal::hasTextBoxes):
3234
3235 2019-09-25  Zalan Bujtas  <zalan@apple.com>
3236
3237         [LFC][IFC] Use existing Line::Content::LineBox to track the current line geometry
3238         https://bugs.webkit.org/show_bug.cgi?id=202182
3239
3240         Reviewed by Antti Koivisto.
3241
3242         This patch removes the redundant Line::m_logicalTopLeft, m_contentLogicalWidth, m_lineLogicalHeight, m_baseline, m_baselineTop members
3243         and switches over to Line::m_content's LineBox. 
3244
3245         * layout/displaytree/DisplayRect.h:
3246         (WebCore::Display::Rect::Rect):
3247         * layout/inlineformatting/InlineLine.cpp:
3248         (WebCore::Layout::Line::Line):
3249         (WebCore::Layout::Line::close):
3250         (WebCore::Layout::Line::removeTrailingTrimmableContent):
3251         (WebCore::Layout::Line::moveLogicalLeft):
3252         (WebCore::Layout::Line::appendNonBreakableSpace):
3253         (WebCore::Layout::Line::appendTextContent):
3254         (WebCore::Layout::Line::appendNonReplacedInlineBox):
3255         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
3256         (WebCore::Layout::m_skipVerticalAligment): Deleted.
3257         * layout/inlineformatting/InlineLine.h:
3258         (WebCore::Layout::Line::Content::lineBox):
3259         (WebCore::Layout::Line::contentLogicalRight const):
3260         (WebCore::Layout::Line::logicalTop const):
3261         (WebCore::Layout::Line::logicalBottom const):
3262         (WebCore::Layout::Line::logicalLeft const):
3263         (WebCore::Layout::Line::logicalHeight const):
3264         (WebCore::Layout::Line::contentLogicalWidth const):
3265         (WebCore::Layout::Line::baselineOffset const):
3266         * layout/inlineformatting/InlineLineBox.h:
3267         (WebCore::Layout::LineBox::setLogicalTopLeft):
3268         (WebCore::Layout::LineBox::setLogicalHeight):
3269         (WebCore::Layout::LineBox::setLogicalWidth):
3270         (WebCore::Layout::LineBox::moveHorizontally):
3271         (WebCore::Layout::LineBox::expandHorizontally):
3272         (WebCore::Layout::LineBox::shrinkHorizontally):
3273         (WebCore::Layout::LineBox::expandVertically):
3274         (WebCore::Layout::LineBox::shrinkVertically):
3275         (WebCore::Layout::LineBox::LineBox):
3276         (WebCore::Layout::LineBox::setLogicalHeightIfGreater):
3277         (WebCore::Layout::LineBox::setBaseline):
3278         (WebCore::Layout::LineBox::baseline const):
3279         (WebCore::Layout::LineBox::baseline):
3280         (WebCore::Layout::LineBox::setBaselineOffset):
3281         (WebCore::Layout::LineBox::Baseline::setAscentIfGreater):
3282         (WebCore::Layout::LineBox::Baseline::setDescentIfGreater):
3283
3284 2019-09-25  Antti Koivisto  <antti@apple.com>
3285
3286         Rename InlineBox::nextLeafChild to nextLeafOnLine
3287         https://bugs.webkit.org/show_bug.cgi?id=202197
3288
3289         Reviewed by Zalan Bujtas.
3290
3291         The name is confusing as it never returns a child of the inline box it is called on.
3292         Rename it and other similar functions that traverse within a line.
3293
3294         * dom/Position.cpp:
3295         (WebCore::Position::getInlineBoxAndOffset const):
3296         * editing/RenderedPosition.cpp:
3297         (WebCore::RenderedPosition::RenderedPosition):
3298         (WebCore::RenderedPosition::previousLeafOnLine const):
3299         (WebCore::RenderedPosition::nextLeafOnLine const):
3300         (WebCore::RenderedPosition::isEquivalent const):
3301         (WebCore::RenderedPosition::bidiLevelOnLeft const):
3302         (WebCore::RenderedPosition::bidiLevelOnRight const):
3303         (WebCore::RenderedPosition::leftBoundaryOfBidiRun):
3304         (WebCore::RenderedPosition::rightBoundaryOfBidiRun):
3305         (WebCore::RenderedPosition::atLeftBoundaryOfBidiRun const):
3306         (WebCore::RenderedPosition::atRightBoundaryOfBidiRun const):
3307         (WebCore::RenderedPosition::positionAtLeftBoundaryOfBiDiRun const):
3308         (WebCore::RenderedPosition::positionAtRightBoundaryOfBiDiRun const):
3309         (WebCore::RenderedPosition::prevLeafChild const): Deleted.
3310         (WebCore::RenderedPosition::nextLeafChild const): Deleted.
3311         * editing/RenderedPosition.h:
3312         (WebCore::RenderedPosition::RenderedPosition):
3313         * editing/VisiblePosition.cpp:
3314         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
3315         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
3316         * editing/VisibleUnits.cpp:
3317         (WebCore::startPositionForLine):
3318         (WebCore::endPositionForLine):
3319         (WebCore::previousLinePosition):
3320         (WebCore::nextLinePosition):
3321         * layout/Verification.cpp:
3322         (WebCore::Layout::collectFlowBoxSubtree):
3323         * rendering/ComplexLineLayout.cpp:
3324         (WebCore::ComplexLineLayout::updateRubyForJustifiedText):
3325         (WebCore::expansionBehaviorForInlineTextBox):
3326         (WebCore::ComplexLineLayout::computeInlineDirectionPositionsForSegment):
3327         (WebCore::ComplexLineLayout::layoutRunsAndFloats):
3328         * rendering/InlineBox.cpp:
3329         (WebCore::InlineBox::previousOnLineExists const):
3330         (WebCore::InlineBox::nextLeafOnLine const):
3331         (WebCore::InlineBox::previousLeafOnLine const):
3332         (WebCore::InlineBox::nextLeafOnLineIgnoringLineBreak const):
3333         (WebCore::InlineBox::previousLeafOnLineIgnoringLineBreak const):
3334         (WebCore::InlineBox::nextLeafChild const): Deleted.
3335         (WebCore::InlineBox::prevLeafChild const): Deleted.
3336         (WebCore::InlineBox::nextLeafChildIgnoringLineBreak const): Deleted.
3337         (WebCore::InlineBox::prevLeafChildIgnoringLineBreak const): Deleted.
3338         * rendering/InlineBox.h:
3339         (WebCore::InlineBox::nextOnLine const):
3340         (WebCore::InlineBox::previousOnLine const):
3341         (WebCore::InlineBox::setNextOnLine):
3342         (WebCore::InlineBox::setPreviousOnLine):
3343         (WebCore::InlineBox::InlineBox):
3344         (WebCore::InlineBox::prevOnLine const): Deleted.
3345         (WebCore::InlineBox::setPrevOnLine): Deleted.
3346         * rendering/InlineFlowBox.cpp:
3347         (WebCore::InlineFlowBox::addToLine):
3348         (WebCore::InlineFlowBox::removeChild):
3349         (WebCore::InlineFlowBox::nodeAtPoint):
3350         (WebCore::InlineFlowBox::firstLeafDescendant const):
3351         (WebCore::InlineFlowBox::lastLeafDescendant const):
3352         (WebCore::InlineFlowBox::placeEllipsisBox):
3353         (WebCore::InlineFlowBox::collectLeafBoxesInLogicalOrder const):
3354         (WebCore::InlineFlowBox::checkConsistency const):
3355         (WebCore::InlineFlowBox::firstLeafChild const): Deleted.
3356         (WebCore::InlineFlowBox::lastLeafChild const): Deleted.
3357         * rendering/InlineFlowBox.h:
3358         * rendering/InlineTextBox.cpp:
3359         (WebCore::InlineTextBox::expansionBehavior const):
3360         * rendering/RenderBlockFlow.cpp:
3361         (WebCore::RenderBlockFlow::containsNonZeroBidiLevel const):
3362         (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
3363         * rendering/RenderCounter.cpp:
3364         (WebCore::RenderCounter::rendererRemovedFromTree):
3365         * rendering/RenderTextLineBoxes.cpp:
3366         (WebCore::lineDirectionPointFitsInBox):
3367         (WebCore::createVisiblePositionAfterAdjustingOffsetForBiDi):
3368         (WebCore::RenderTextLineBoxes::positionForPoint const):
3369         * rendering/RootInlineBox.cpp:
3370         (WebCore::RootInlineBox::isHyphenated const):
3371         (WebCore::RootInlineBox::lineSelectionGap):
3372         (WebCore::RootInlineBox::selectionState):
3373         (WebCore::RootInlineBox::firstSelectedBox):
3374         (WebCore::RootInlineBox::lastSelectedBox):
3375         (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):
3376         * rendering/svg/SVGRootInlineBox.cpp:
3377         (WebCore::SVGRootInlineBox::closestLeafChildForPosition):
3378         (WebCore::SVGRootInlineBox::nodeAtPoint):
3379
3380 2019-09-25  Zan Dobersek  <zdobersek@igalia.com>
3381
3382         [Nicosia] Add implementations for fixed, positioned, sticky ScrollingTreeNodes
3383         https://bugs.webkit.org/show_bug.cgi?id=202100
3384
3385         Reviewed by Carlos Garcia Campos.
3386
3387         Fill in the Nicosia implementations for the ScrollingTreeFixedNode,
3388         ScrollingTreePositionedNode and ScrollingTreeStickyNode classes.
3389
3390         The implementations in majority repeat what the Cocoa implementations
3391         do, with the main difference being the Nicosia-specific layer state
3392         application. Sharing more of this logic should be investigated in the
3393         future.
3394
3395         * PlatformPlayStation.cmake: Add ScrollingTreePositionedNode to build.
3396         * SourcesGTK.txt: Ditto.
3397         * SourcesWPE.txt: Ditto.
3398         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp:
3399         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
3400         (WebCore::ScrollingTreeFixedNode::applyLayerPositions):
3401         (WebCore::ScrollingTreeFixedNode::dumpProperties const):
3402         * page/scrolling/nicosia/ScrollingTreeFixedNode.h:
3403         * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp: Added.
3404         (WebCore::ScrollingTreePositionedNode::create):
3405         (WebCore::ScrollingTreePositionedNode::ScrollingTreePositionedNode):
3406         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
3407         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
3408         (WebCore::ScrollingTreePositionedNode::dumpProperties const):
3409         * page/scrolling/nicosia/ScrollingTreePositionedNode.h: Added.
3410         (WebCore::ScrollingTreePositionedNode::relatedOverflowScrollingNodes const):
3411         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp:
3412         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
3413         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
3414         (WebCore::ScrollingTreeStickyNode::dumpProperties const):
3415         (WebCore::ScrollingTreeStickyNode::computeLayerPosition const):
3416         * page/scrolling/nicosia/ScrollingTreeStickyNode.h:
3417
3418 2019-09-24  Antoine Quint  <graouts@apple.com>
3419
3420         [Web Animations] Removing an element should only cancel its declarative animations
3421         https://bugs.webkit.org/show_bug.cgi?id=202165
3422
3423         Reviewed by Dean Jackson.
3424
3425         When an element is removed, an Animation created using the JS API should not be canceled.
3426         Only declarative animations should be.
3427
3428         * animation/AnimationTimeline.cpp:
3429         (WebCore::AnimationTimeline::elementWasRemoved):
3430
3431 2019-09-24  Alex Christensen  <achristensen@webkit.org>
3432
3433         Remove SchemeRegistry's list of URL schemes allowing local storage in private browsing, which is unused
3434         https://bugs.webkit.org/show_bug.cgi?id=202181
3435
3436         Reviewed by Geoffrey Garen.
3437
3438         The last use of the WebView SPI to set it is being removed in rdar://problem/55685383
3439         but it already does not do anything.  Let's remove it.
3440
3441         * platform/SchemeRegistry.cpp:
3442         (WebCore::schemesAllowingLocalStorageAccessInPrivateBrowsing): Deleted.
3443         (WebCore::SchemeRegistry::registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsing): Deleted.
3444         (WebCore::SchemeRegistry::allowsLocalStorageAccessInPrivateBrowsing): Deleted.
3445         * platform/SchemeRegistry.h:
3446
3447 2019-09-24  Wenson Hsieh  <wenson_hsieh@apple.com>
3448
3449         Remove a content change observation quirk on united.com
3450         https://bugs.webkit.org/show_bug.cgi?id=202175
3451
3452         Reviewed by Tim Horton.
3453
3454         Remove a site-specific quirk that is no longer necessary.
3455
3456         * page/Quirks.cpp:
3457         (WebCore::Quirks::shouldIgnoreContentChange const): Deleted.
3458         * page/Quirks.h:
3459         * page/ios/ContentChangeObserver.cpp:
3460         (WebCore::ContentChangeObserver::shouldObserveVisibilityChangeForElement):
3461
3462 2019-09-24  Kate Cheney  <katherine_cheney@apple.com>
3463
3464         Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
3465         https://bugs.webkit.org/show_bug.cgi?id=195420
3466         <rdar://problem/54213551> 
3467
3468         Reviewed by Brent Fulgham.
3469
3470         Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect-database.html
3471                http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database.html
3472                http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database.html
3473                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database.html
3474                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database.html
3475                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database.html
3476                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database.html
3477                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database.html
3478                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database.html
3479                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html
3480                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
3481                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html
3482                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html
3483                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html
3484                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
3485                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database.html
3486                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html
3487                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html
3488                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html
3489                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database.html
3490                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html
3491                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html
3492                http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html
3493                http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html
3494                http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html
3495                http/tests/resourceLoadStatistics/cookie-deletion-database.html
3496                http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html
3497                http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database.html
3498                http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database.html
3499                http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database.html
3500                http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database.html
3501                http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html
3502                http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database.html
3503                http/tests/resourceLoadStatistics/enable-debug-mode-database.html
3504                http/tests/resourceLoadStatistics/grandfathering-database.html
3505                http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html
3506                http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html
3507                http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database.html
3508                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3509                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3510                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3511                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3512                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3513                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3514                http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database.html
3515                http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html
3516                http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html
3517                http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html
3518                http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html
3519                http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html
3520                http/tests/resourceLoadStatistics/prune-statistics-database.html
3521                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3522                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3523                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3524                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3525                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3526                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3527                http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database.html
3528                http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html
3529                http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database.html
3530                http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html
3531                http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html
3532                http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database.html
3533                http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database.html
3534
3535         * platform/sql/SQLiteDatabase.h:
3536         Added WEBCORE_EXPORT prefix to 2 functions needed in the ITP Database 
3537         to clear out the database.
3538
3539 2019-09-24  Chris Dumez  <cdumez@apple.com>
3540
3541         Stop sampling PageCache-related AggD data
3542         https://bugs.webkit.org/show_bug.cgi?id=202161
3543
3544         Reviewed by Geoffrey Garen.
3545
3546         Stop sampling PageCache-related AggD data to make it more actionable.
3547
3548         * history/PageCache.cpp:
3549         (WebCore::logPageCacheFailureDiagnosticMessage):
3550         (WebCore::canCacheFrame):
3551         (WebCore::canCachePage):
3552
3553 2019-09-24  Sihui Liu  <sihui_liu@apple.com>
3554
3555         Stop refing UniqueIDBDatabaseTransaction in callbacks
3556         https://bugs.webkit.org/show_bug.cgi?id=202074
3557
3558         Reviewed by Youenn Fablet.
3559
3560         After quota check is introduced to IDB, callbacks that take the ref of UniqueIDBDatabaseTransaction will be 
3561         passed to StorageQuotaManager. This can make UniqueIDBDatabaseTransaction live longer than UniqueIDBDatabase.
3562
3563         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3564         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
3565         (WebCore::IDBServer::UniqueIDBDatabase::waitForRequestSpaceCompletion):
3566         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
3567         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
3568         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
3569         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
3570         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
3571         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
3572         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
3573         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
3574         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
3575         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
3576         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
3577         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
3578         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
3579         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
3580         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
3581         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
3582         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3583         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3584         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
3585         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
3586         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
3587         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
3588         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
3589         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
3590         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
3591         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
3592         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
3593         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
3594         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
3595         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
3596         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
3597         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
3598         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
3599         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
3600
3601 2019-09-24  Keith Rollin  <krollin@apple.com>
3602
3603         Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
3604         https://bugs.webkit.org/show_bug.cgi?id=202119
3605         <rdar://problem/55638792>
3606
3607         Reviewed by Alex Christensen.
3608
3609         After refactoring and other code evolution, some platform checks have
3610         ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
3611         vice-versa). These can be converted into the equivalent
3612         PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
3613         check can be removed altogether (along with any "#else" branches).
3614
3615         No new tests -- no new or changed functionality.
3616
3617         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
3618         (WebCore::subLocality):
3619         (WebCore::setSubLocality):
3620         (WebCore::subAdministrativeArea):
3621         (WebCore::setSubAdministrativeArea):
3622         * css/parser/CSSPropertyParser.cpp:
3623         (WebCore::isAppleLegacyCssValueKeyword):
3624         * html/HTMLMediaElement.cpp:
3625         (WebCore::HTMLMediaElement::mediaSessionTitle const):
3626         * inspector/InspectorFrontendHost.cpp:
3627         (WebCore::InspectorFrontendHost::platform):
3628         * page/FrameView.cpp:
3629         (WebCore::FrameView::updateBackgroundRecursively):
3630         * platform/Timer.cpp:
3631         * platform/cocoa/NetworkExtensionContentFilter.mm:
3632         (WebCore::NetworkExtensionContentFilter::initialize):
3633         * platform/graphics/cg/GraphicsContextCG.cpp:
3634         (WebCore::displayP3ColorSpaceRef):
3635         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3636         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3637         * rendering/RenderLayerCompositor.cpp:
3638         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
3639
3640 2019-09-24  Antoine Quint  <graouts@apple.com>
3641
3642         [Web Animations] Unflake web-animations/timing-model/animations/updating-the-finished-state.html WPT test
3643         https://bugs.webkit.org/show_bug.cgi?id=181121
3644
3645         Reviewed by Dean Jackson.
3646
3647         When running the "update animations and send events" steps (https://drafts.csswg.org/web-animations/#update-animations-and-send-events)
3648         we assemble a list of animations to remove after updating their relevance based on the new timeline current time. However, we wouldn't
3649         account for the fact that we would *then* dispatch events which could update the timing properties of animations that had been marked
3650         for removal at this point.
3651
3652         In this specific WPT test, there were two individual tests that would rewind animations within a "finish" event handler and we would
3653         not consider the fact that they had been rewound. We now check a second time before removing an animation that it should indeed be
3654         removed.
3655
3656         * animation/DocumentTimeline.cpp:
3657         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
3658
3659 2019-09-24  Kate Cheney  <katherine_cheney@apple.com>
3660
3661         Mixed content blocking is bypassed for WebSockets in Workers (159726)
3662         https://bugs.webkit.org/show_bug.cgi?id=159726
3663         <rdar://problem/27326438>
3664
3665         Reviewed by Brady Eidson.
3666
3667         Tests: http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-with-embedded-http.html
3668                http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https.html
3669                http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https.html
3670                http/tests/websocket/tests/hybi/non-document-mixed-content-blocked.https.html
3671         
3672         * Modules/websockets/WebSocket.cpp:
3673         (WebCore::WebSocket::connect):
3674         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3675         (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
3676         * loader/MixedContentChecker.cpp:
3677         (WebCore::MixedContentChecker::checkForMixedContentInFrameTree):
3678         * loader/MixedContentChecker.h:
3679         Patch to block insecure WebSocket URL connection attempts by Workers
3680         on secure pages. If the URL is ws, and any embedding iframe has protocol
3681         https, and the context is a Worker, the connection should be blocked.
3682
3683         I was unable to write a test case to hit the case where a document
3684         does not have a frame and tries to communicate via a worker to
3685         connect to a WebSocket because after removing the subframe from its
3686         parent, the subframe is unable to perform a postMessage to a worker
3687         even in the same script execution to tell the worker to connect
3688         to a WebSocket.
3689
3690 2019-09-24  Zalan Bujtas  <zalan@apple.com>
3691
3692         [LFC][IFC] Line::Content should use LineBox
3693         https://bugs.webkit.org/show_bug.cgi?id=202128
3694         <rdar://problem/55649079>
3695
3696         Reviewed by Antti Koivisto.
3697
3698         Replace Line::Content's m_logicalRect, m_baseline and m_baselineOffset with LineBox.
3699
3700         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3701         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
3702         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
3703         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
3704         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3705         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
3706         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
3707         * layout/inlineformatting/InlineLine.cpp:
3708         (WebCore::Layout::Line::close):
3709         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
3710         * layout/inlineformatting/InlineLine.h:
3711         (WebCore::Layout::Line::Content::lineBox const):
3712         (WebCore::Layout::Line::Content::setLineBox):
3713         (WebCore::Layout::Line::baselineOffset const):
3714         (WebCore::Layout::Line::Content::isEmpty const): Deleted.
3715         (WebCore::Layout::Line::Content::logicalTop const): Deleted.
3716         (WebCore::Layout::Line::Content::logicalLeft const): Deleted.
3717         (WebCore::Layout::Line::Content::logicalRight const): Deleted.
3718         (WebCore::Layout::Line::Content::logicalBottom const): Deleted.
3719         (WebCore::Layout::Line::Content::logicalWidth const): Deleted.
3720         (WebCore::Layout::Line::Content::logicalHeight const): Deleted.
3721         (WebCore::Layout::Line::Content::baseline const): Deleted.
3722         (WebCore::Layout::Line::Content::baselineOffset const): Deleted.
3723         (WebCore::Layout::Line::Content::setLogicalRect): Deleted.
3724         (WebCore::Layout::Line::Content::setBaseline): Deleted.
3725         (WebCore::Layout::Line::Content::setBaselineOffset): Deleted.
3726         * layout/inlineformatting/InlineLineBox.h:
3727         (WebCore::Layout::LineBox::Baseline::height const):
3728         (WebCore::Layout::LineBox::LineBox):
3729         (WebCore::Layout::LineBox::baselineOffset const):
3730         (WebCore::Layout::LineBox::Baseline::Baseline):
3731         (WebCore::Layout::LineBox::Baseline::setAscent):
3732         (WebCore::Layout::LineBox::Baseline::setDescent):
3733         (WebCore::Layout::LineBox::Baseline::reset):
3734         (WebCore::Layout::LineBox::Baseline::ascent const):
3735         (WebCore::Layout::LineBox::Baseline::descent const):
3736
3737 2019-09-24  Zalan Bujtas  <zalan@apple.com>
3738
3739         [LFC][IFC] Move line constraints computation to a dedicated function
3740         https://bugs.webkit.org/show_bug.cgi?id=202121
3741         <rdar://problem/55640742>
3742
3743         Reviewed by Antti Koivisto.
3744
3745         * layout/inlineformatting/InlineFormattingContext.h:
3746         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3747         (WebCore::Layout::LineLayout::LineLayout):
3748         (WebCore::Layout::LineLayout::close):
3749         (WebCore::Layout::LineLayout::placeInlineItem):
3750         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
3751         (WebCore::Layout::InlineFormattingContext::InlineLayout::initialConstraintsForLine):
3752         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
3753         * layout/inlineformatting/InlineLine.h:
3754
3755 2019-09-24  Youenn Fablet  <youenn@apple.com>
3756
3757         AudioTrackPrivateMediaStreamCocoa does not need to manipulate the audio unit in play/pause methods
3758         https://bugs.webkit.org/show_bug.cgi?id=202097
3759         <rdar://problem/51548144>
3760
3761         Reviewed by Eric Carlson.
3762
3763         Instead of manipulating the audio unit in play/pause methods, it is more convenient to do so in audioSamplesAvailable.
3764         play/pause methods only update boolean values that audioSamplesAvailable will read.
3765         In particular, m_autoPlay and m_isPlaying are no longer modified in the audio thread.
3766
3767         Behavior was racy so difficult to reproduce.
3768
3769         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3770         (WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
3771         (WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
3772         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3773         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
3774
3775 2019-09-23  Youenn Fablet  <youenn@apple.com>
3776
3777         Support sync-xhr feature policy
3778         https://bugs.webkit.org/show_bug.cgi?id=202098
3779
3780         Reviewed by Alex Christensen.
3781
3782         Add support for sync-xhr feature policy parsing.
3783         Use this feature policy to control use of sync XHR in documents
3784         as per https://xhr.spec.whatwg.org/#the-send()-method step 12.
3785
3786         Covered by updated test.
3787
3788         * html/FeaturePolicy.cpp:
3789         (WebCore::FeaturePolicy::parse):
3790         (WebCore::FeaturePolicy::allows const):
3791         * html/FeaturePolicy.h:
3792         * xml/XMLHttpRequest.cpp:
3793         (WebCore::isSyncXHRAllowedByFeaturePolicy):
3794         (WebCore::XMLHttpRequest::createRequest):
3795
3796 2019-09-23  Chris Dumez  <cdumez@apple.com>
3797
3798         Drop unnecessary SessionID.h header includes
3799         https://bugs.webkit.org/show_bug.cgi?id=202129
3800
3801         Reviewed by Alex Christensen.
3802
3803         * Modules/fetch/FetchBodyConsumer.h:
3804         * Modules/indexeddb/IDBDatabaseIdentifier.h:
3805         * bindings/js/SerializedScriptValue.h:
3806         * dom/DataTransfer.h:
3807         * editing/WebCorePasteboardFileReader.h:
3808         * fileapi/FileReaderLoader.h:
3809         * fileapi/ThreadableBlobRegistry.h:
3810         * html/FileListCreator.h:
3811         * loader/CookieJar.h:
3812         * loader/EmptyFrameLoaderClient.h:
3813         * loader/FrameLoaderClient.h:
3814         * loader/LoaderStrategy.h:
3815         * page/CacheStorageProvider.h:
3816         * page/Frame.h:
3817         * page/PageGroup.h:
3818         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3819         * platform/network/CacheValidation.h:
3820         * platform/network/FormData.h:
3821         * platform/network/NetworkStorageSession.cpp:
3822         * platform/network/StorageSessionProvider.h:
3823         * workers/WorkerGlobalScopeProxy.h:
3824         * workers/service/ServiceWorkerContainer.h:
3825         * workers/service/ServiceWorkerProvider.h:
3826         * workers/service/server/RegistrationDatabase.h:
3827         * workers/service/server/SWServer.h:
3828         * workers/service/server/SWServerToContextConnection.h:
3829         * worklets/WorkletGlobalScope.h:
3830
3831 2019-09-23  Alex Christensen  <achristensen@webkit.org>
3832
3833         Fix WPT test html/browsers/offline/application-cache-api/api_swapcache_error.https.html
3834         https://bugs.webkit.org/show_bug.cgi?id=202056
3835         <rdar://problem/55523986>
3836
3837         Reviewed by Youenn Fablet.
3838
3839         The test makes sure we throw an exception when we are in an invalid state, which we should definitely do.
3840
3841         * loader/appcache/ApplicationCache.cpp:
3842         (WebCore::ApplicationCache::setGroup):
3843         (WebCore::ApplicationCache::setManifestResource):
3844         * loader/appcache/ApplicationCache.h:
3845         (WebCore::ApplicationCache::manifestResource const):
3846         (WebCore::ApplicationCache::group const):
3847         * loader/appcache/ApplicationCacheGroup.h:
3848         * loader/appcache/ApplicationCacheHost.cpp:
3849         (WebCore::ApplicationCacheHost::candidateApplicationCacheGroup const):
3850         (WebCore::ApplicationCacheHost::failedLoadingMainResource):
3851         (WebCore::ApplicationCacheHost::setCandidateApplicationCacheGroup):
3852         (WebCore::ApplicationCacheHost::swapCache):
3853         * loader/appcache/ApplicationCacheHost.h:
3854         (WebCore::ApplicationCacheHost::candidateApplicationCacheGroup const): Deleted.
3855         * loader/appcache/ApplicationCacheResource.h:
3856
3857 2019-09-23  Chris Dumez  <cdumez@apple.com>
3858
3859         PlugInClient::didStartFromOrigin() does not need a sessionID
3860         https://bugs.webkit.org/show_bug.cgi?id=202127
3861
3862         Reviewed by Geoffrey Garen.
3863
3864         * html/HTMLPlugInImageElement.cpp:
3865         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
3866         * page/PlugInClient.h:
3867
3868 2019-09-23  Devin Rousso  <drousso@apple.com>
3869
3870         Web Inspector: Canvas: show WebGPU shader pipelines
3871         https://bugs.webkit.org/show_bug.cgi?id=201675
3872         <rdar://problem/55543450>
3873
3874         Reviewed by Joseph Pecoraro.
3875
3876         Tests: inspector/canvas/requestShaderSource-webgpu.html
3877                inspector/canvas/shaderProgram-add-remove-webgpu.html
3878                inspector/canvas/updateShader-webgpu.html
3879
3880         Create common base classes for `WebGPUPipeline` and `GPUPipeline` so that Web Inspector can
3881         instrument both render and compute shader pipelines.
3882
3883         Refactor `InspectorShaderProgram` to support both `WebGLProgram` and `WebGPUPipeline` so
3884         that the same object can be used for all types of shader "program"s.
3885
3886         Keep a copy of each shader module's source, and allow the shader module to be updated.
3887
3888         * Modules/webgpu/WebGPUDevice.h:
3889         * Modules/webgpu/WebGPUDevice.cpp:
3890         (WebCore::WebGPUDevice::WebGPUDevice):
3891         (WebCore::WebGPUDevice::~WebGPUDevice):
3892         (WebCore::WebGPUDevice::createShaderModule const):
3893         (WebCore::WebGPUDevice::createRenderPipeline): Added.
3894         (WebCore::WebGPUDevice::createComputePipeline): Added.
3895         (WebCore::WebGPUDevice::createRenderPipeline const): Deleted.
3896         (WebCore::WebGPUDevice::createComputePipeline const): Deleted.
3897
3898         * Modules/webgpu/WebGPUPipeline.h: Added.
3899         (WebCore::WebGPUPipeline::isRenderPipeline const):
3900         (WebCore::WebGPUPipeline::isComputePipeline const):
3901         (WebCore::WebGPUPipeline::scriptExecutionContext const):
3902         * Modules/webgpu/WebGPUPipeline.cpp: Added.
3903         (WebCore::WebGPUPipeline::instancesMutex):
3904         (WebCore::WebGPUPipeline::WebGPUPipeline):
3905         (WebCore::WebGPUPipeline::~WebGPUPipeline):
3906         * platform/graphics/gpu/GPUPipeline.cpp: Added.
3907         * platform/graphics/gpu/GPUPipeline.h: Added.
3908         (WebCore::GPUPipeline::isRenderPipeline const):
3909         (WebCore::GPUPipeline::isComputePipeline const):
3910
3911         * Modules/webgpu/WebGPUComputePipeline.idl:
3912         * Modules/webgpu/WebGPUComputePipeline.h:
3913         (WebCore::WebGPUComputePipeline::computePipeline const): Deleted.
3914         * Modules/webgpu/WebGPUComputePipeline.cpp:
3915         (WebCore::WebGPUComputePipeline::create):
3916         (WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
3917         (WebCore::WebGPUComputePipeline::recompile): Added.
3918         * platform/graphics/gpu/GPUComputePipeline.h:
3919         (WebCore::GPUComputePipeline::isComputePipeline): Added.
3920         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
3921         (WebCore::GPUComputePipeline::tryCreate):
3922         (WebCore::GPUComputePipeline::GPUComputePipeline):
3923         (WebCore::GPUComputePipeline::recompile): Added.
3924
3925         * Modules/webgpu/WebGPURenderPipeline.idl:
3926         * Modules/webgpu/WebGPURenderPipeline.h:
3927         (WebCore::WebGPURenderPipeline::renderPipeline const): Deleted.
3928         * Modules/webgpu/WebGPURenderPipeline.cpp:
3929         (WebCore::WebGPURenderPipeline::create):
3930         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
3931         (WebCore::WebGPURenderPipeline::recompile): Added.
3932         * platform/graphics/gpu/GPURenderPipeline.h:
3933         (WebCore::GPURenderPipeline::isRenderPipeline): Added.
3934         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3935         (WebCore::tryCreateMtlRenderPipelineState):
3936         (WebCore::GPURenderPipeline::tryCreate):
3937         (WebCore::GPURenderPipeline::GPURenderPipeline):
3938         (WebCore::GPURenderPipeline::recompile): Added.
3939
3940         * Modules/webgpu/WebGPUShaderModule.h:
3941         (WebCore::WebGPUShaderModule::source const): Added.
3942         * Modules/webgpu/WebGPUShaderModule.cpp:
3943         (WebCore::WebGPUShaderModule::update): Added.
3944         * Modules/webgpu/WebGPUProgrammableStageDescriptor.h:
3945         * platform/graphics/gpu/GPUProgrammableStageDescriptor.h:
3946         (WebCore::GPUProgrammableStageDescriptor::GPUProgrammableStageDescriptor):
3947
3948         * inspector/InspectorShaderProgram.h:
3949         * inspector/InspectorShaderProgram.cpp:
3950         (WebCore::InspectorShaderProgram::create):
3951         (WebCore::InspectorShaderProgram::InspectorShaderProgram):
3952         (WebCore::InspectorShaderProgram::program const): Added.
3953         (WebCore::InspectorShaderProgram::pipeline const): Added.
3954         (WebCore::shaderForType): Added.
3955         (WebCore::InspectorShaderProgram::requestShaderSource): Added.
3956         (WebCore::InspectorShaderProgram::updateShader): Added.
3957         (WebCore::InspectorShaderProgram::context const): Deleted.
3958         (WebCore::InspectorShaderProgram::shaderForType): Deleted.
3959
3960         * inspector/agents/InspectorCanvasAgent.h:
3961         * inspector/agents/InspectorCanvasAgent.cpp:
3962         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
3963         (WebCore::InspectorCanvasAgent::discardAgent):
3964         (WebCore::InspectorCanvasAgent::enable):
3965         (WebCore::InspectorCanvasAgent::disable):