f01b6f0705c9ecdd1a566b0617cad7eac5a4d875
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-04  Zalan Bujtas  <zalan@apple.com>
2
3         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
4         https://bugs.webkit.org/show_bug.cgi?id=191078
5         <rdar://problem/45736178>
6
7         Reviewed by Antti Koivisto.
8
9         1. Improve visuallyNonEmpty milestone confidence level.
10             Ignore whitespace and non visible text content.
11             Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
12             Check if the html/body is actually visible.
13
14         2. Issue initial paint soon after the milestone fires.
15             Use a 0ms timer to flush the initial paint.
16             Throttle additional flushes for 500ms (remove the non-initial 1.5 throttling)
17
18         3. Suspend optional style recalcs and layouts while painting is being throttled.
19            When parsing yields we initiate a 0ms style recalc/layout timer.
20            These optional layouts produce content that we have no intention to paint. 
21
22         * dom/Document.cpp:
23         (WebCore::Document::scheduleStyleRecalc):
24         (WebCore::Document::shouldScheduleLayout):
25         * page/ChromeClient.h:
26         * page/FrameView.cpp:
27         (WebCore::FrameView::resetLayoutMilestones):
28         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
29         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
30         (WebCore::FrameView::updateIsVisuallyNonEmpty):
31         * page/FrameView.h:
32         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
33         * platform/graphics/FontCascade.h:
34         * rendering/RenderText.cpp: Check whether the text is actually visible at this point.
35         (WebCore::RenderText::RenderText):
36
37 2018-11-04  Zalan Bujtas  <zalan@apple.com>
38
39         [LFC][BFC] Add support for percentage height in quirks mode.
40         https://bugs.webkit.org/show_bug.cgi?id=191232
41
42         Reviewed by Antti Koivisto.
43
44         In quirks mode, we go and travers the containing block chain to find a block level
45         box with fixed height value to resolve the percentage value.
46
47         Test: fast/block/basic/quirk-mode-percent-height.html
48
49         * layout/FormattingContextGeometry.cpp:
50         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
51         * layout/Verification.cpp:
52         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
53
54 2018-11-04  Zalan Bujtas  <zalan@apple.com>
55
56         [LFC][BCF] Add support for block level non-replaced inflow height percentage
57         https://bugs.webkit.org/show_bug.cgi?id=191229
58
59         Reviewed by Antti Koivisto.
60
61         Test: fast/block/basic/child-block-level-box-with-height-percent.html
62
63         * layout/FormattingContext.h:
64         * layout/FormattingContextGeometry.cpp:
65         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
66         (WebCore::Layout::computedHeightValue): Deleted.
67         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
68         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
69
70 2018-11-04  Youenn Fablet  <youenn@apple.com>
71
72         RealtimeOutgoingAudioSource should use DestructionThread::Main
73         https://bugs.webkit.org/show_bug.cgi?id=191230
74
75         Reviewed by Eric Carlson.
76
77         Covered by imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html
78         that should no longer crash in debug.
79
80         * platform/mediastream/RealtimeOutgoingAudioSource.h:
81
82 2018-11-04  Youenn Fablet  <youenn@apple.com>
83
84         IDB should allow storing RTCCertificate
85         https://bugs.webkit.org/show_bug.cgi?id=191077
86
87         Reviewed by Chris Dumez.
88
89         Add support for serialization/deserialization of RTCCertificate.
90         Store the origin in RTCCertificate and make sure that a certificate
91         with a different origin cannot be used to create a RTCPeerConnection.
92
93         Test: imported/w3c/web-platform-tests/webrtc/RTCCertificate-postMessage.html
94
95         * Modules/mediastream/PeerConnectionBackend.cpp:
96         (WebCore::PeerConnectionBackend::generateCertificate):
97         * Modules/mediastream/RTCCertificate.cpp:
98         (WebCore::RTCCertificate::create):
99         (WebCore::RTCCertificate::RTCCertificate):
100         * Modules/mediastream/RTCCertificate.h:
101         (WebCore::RTCCertificate::origin const):
102         * Modules/mediastream/RTCPeerConnection.cpp:
103         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
104         * Modules/mediastream/RTCPeerConnection.h:
105         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
106         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback):
107         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
108         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h:
109         * bindings/js/SerializedScriptValue.cpp:
110         (WebCore::CloneSerializer::dumpIfTerminal):
111         (WebCore::CloneDeserializer::CachedString::takeString):
112         (WebCore::CloneDeserializer::readRTCCertificate):
113         (WebCore::CloneDeserializer::readTerminal):
114
115 2018-11-04  Youenn Fablet  <youenn@apple.com>
116
117         Add support for RTCMuxPolicy
118         https://bugs.webkit.org/show_bug.cgi?id=191188
119
120         Reviewed by Eric Carlson.
121
122         Add support for RTCMuxPolicy dictionary option for both constructor and setConfiguration.
123         Make sure setConfiguration throws if trying to change this policy.
124         Pipe this parameter up to libwebrtc.
125         Covered by rebased test.
126
127         * Modules/mediastream/RTCConfiguration.h:
128         * Modules/mediastream/RTCConfiguration.idl:
129         * Modules/mediastream/RTCPeerConnection.cpp:
130         (WebCore::iceServersFromConfiguration):
131         (WebCore::RTCPeerConnection::initializeConfiguration):
132         (WebCore::RTCPeerConnection::setConfiguration):
133         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
134         (WebCore::rtcpMuxPolicyfromConfiguration):
135         (WebCore::configurationFromMediaEndpointConfiguration):
136         * WebCore.xcodeproj/project.pbxproj:
137         * platform/mediastream/MediaEndpointConfiguration.cpp:
138         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
139         * platform/mediastream/MediaEndpointConfiguration.h:
140         * platform/mediastream/RTCPMuxPolicy.h: Added.
141
142 2018-11-03  Devin Rousso  <drousso@apple.com>
143
144         Web Inspector: Canvas: capture changes to <canvas> that would affect the recorded context
145         https://bugs.webkit.org/show_bug.cgi?id=190854
146
147         Reviewed by Matt Baker.
148
149         Updated existing tests: inspector/canvas/recording-2d.html
150                                 inspector/canvas/recording-bitmaprenderer.html
151                                 inspector/canvas/recording-webgl.html
152
153         * html/HTMLCanvasElement.idl:
154         Apply `CallTracingCallback=recordCanvasAction` to the `width` and `height` attributes so
155         that they are recorded through the same path as `CanvasRenderingContext`.
156
157         * html/CanvasBase.h:
158         * html/CanvasBase.cpp:
159         (WebCore::CanvasBase::callTracingActive const): Added.
160
161         * bindings/js/CallTracer.h:
162         * bindings/js/CallTracer.cpp:
163         (WebCore::CallTracer::recordCanvasAction):
164
165
166 2018-11-03  Andy Estes  <aestes@apple.com>
167
168         [Payment Request] PaymentResponse.retry()'s errorFields should be optional
169         https://bugs.webkit.org/show_bug.cgi?id=191212
170
171         Reviewed by Youenn Fablet.
172
173         Per WebIDL, the errorFields argument to PaymentResponse.retry() should be optional. See
174         <https://github.com/w3c/payment-request/issues/804> for details.
175
176         Added test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
177
178         * Modules/paymentrequest/PaymentResponse.idl:
179
180 2018-11-02  Zalan Bujtas  <zalan@apple.com>
181
182         [LFC][BFC] Resolve percentage height values.
183         https://bugs.webkit.org/show_bug.cgi?id=191224
184
185         Reviewed by Antti Koivisto.
186
187         10.5 Content height: the 'height' property
188         The percentage is calculated with respect to the height of the generated box's containing block.
189         If the height of the containing block is not specified explicitly (i.e., it depends on content height),
190         and this element is not absolutely positioned, the used height is calculated as if 'auto' was specified.
191
192         https://www.w3.org/TR/CSS22/visudet.html#propdef-height
193
194         Test: fast/block/basic/height-percentage-simple.html
195
196         * layout/FormattingContextGeometry.cpp:
197         (WebCore::Layout::isHeightAuto):
198         (WebCore::Layout::computedHeightValue):
199         (WebCore::Layout::contentHeightForFormattingContextRoot):
200         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
201         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
202         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
203         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
204         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
205         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
206
207 2018-11-03  Eric Carlson  <eric.carlson@apple.com>
208
209         [MediaStream] enumerateDevices should not expose devices that are not available to getUserMedia
210         https://bugs.webkit.org/show_bug.cgi?id=191177
211         <rdar://problem/45747873>
212
213         Reviewed by Jer Noble.
214
215         Test: http/tests/media/media-stream/enumerate-devices-iframe-allow-attribute.html
216
217         * Modules/mediastream/MediaDevicesRequest.cpp:
218         (WebCore::MediaDevicesRequest::start): Only expose devices that are available to gUM.
219
220         * Modules/mediastream/UserMediaController.cpp:
221         (WebCore::isSecure): Moved from UserMediaRequest.cpp.
222         (WebCore::isAllowedToUse): Ditto.
223         (WebCore::UserMediaController::canCallGetUserMedia): Modified from UserMediaRequest.cpp.
224         (WebCore::UserMediaController::logGetUserMediaDenial): Log reason for denial.
225         * Modules/mediastream/UserMediaController.h:
226
227         * Modules/mediastream/UserMediaRequest.cpp:
228         (WebCore::UserMediaRequest::start): Use UserMediaController::canCallGetUserMedia.
229         (WebCore::isSecure): Deleted.
230         (WebCore::isAllowedToUse): Deleted.
231         (WebCore::canCallGetUserMedia): Deleted.
232
233 2018-11-02  Justin Michaud  <justin_michaud@apple.com>
234
235         Add new global object and preliminary Worklets support for CSS painting api
236         https://bugs.webkit.org/show_bug.cgi?id=190979
237
238         Reviewed by Chris Dumez.
239
240         Test: fast/css-custom-paint/worklet.html
241
242         Add a new ScriptExecutionContext and global object to run worklets in. This is mostly copy+paste
243         from Workers, but without any of the threading. Worklet.addModule does not yet support loading scripts
244         or doing cross origin checking. There are quite a few parts of the ScriptExecutionContext api that are
245         left as ASSERT_NOT_REACHED().
246
247         * CMakeLists.txt:
248         * DerivedSources.make:
249         * Sources.txt:
250         * WebCore.xcodeproj/project.pbxproj:
251         * bindings/js/JSDOMGlobalObject.cpp:
252         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
253         * bindings/js/JSPaintWorkletGlobalScopeCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp.
254         (WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren):
255         (WebCore::JSPaintWorkletGlobalScope::registerPaint):
256         * bindings/js/JSWorkletGlobalScopeBase.cpp: Added.
257         (WebCore::JSWorkletGlobalScopeBase::JSWorkletGlobalScopeBase):
258         (WebCore::JSWorkletGlobalScopeBase::finishCreation):
259         (WebCore::JSWorkletGlobalScopeBase::clearDOMGuardedObjects):
260         (WebCore::JSWorkletGlobalScopeBase::visitChildren):
261         (WebCore::JSWorkletGlobalScopeBase::destroy):
262         (WebCore::JSWorkletGlobalScopeBase::scriptExecutionContext const):
263         (WebCore::JSWorkletGlobalScopeBase::supportsRichSourceInfo):
264         (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScript):
265         (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScriptBeforeTimeout):
266         (WebCore::JSWorkletGlobalScopeBase::javaScriptRuntimeFlags):
267         (WebCore::toJS):
268         (WebCore::toJSWorkletGlobalScope):
269         * bindings/js/JSWorkletGlobalScopeBase.h: Added.
270         (WebCore::JSWorkletGlobalScopeBase::wrapped const):
271         (WebCore::JSWorkletGlobalScopeBase::proxy const):
272         (WebCore::JSWorkletGlobalScopeBase::createStructure):
273         (WebCore::toJS):
274         * bindings/js/ScriptState.cpp:
275         (WebCore::execStateFromWorkerGlobalScope):
276         (WebCore::execStateFromWorkletGlobalScope):
277         * bindings/js/ScriptState.h:
278         * bindings/js/WebCoreBuiltinNames.h:
279         * bindings/scripts/CodeGeneratorJS.pm:
280         (IsDOMGlobalObject):
281         (ShouldUseGlobalObjectPrototype):
282         (GenerateHeader):
283         (GenerateRuntimeEnableConditionalStringForExposed):
284         (GenerateImplementation):
285         * bindings/scripts/preprocess-idls.pl:
286         * css/CSSPaintImageValue.cpp:
287         (WebCore::CSSPaintImageValue::image):
288         * css/DOMCSSPaintWorklet.cpp:
289         (WebCore::DOMCSSPaintWorklet::ensurePaintWorklet):
290         (WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope): Deleted.
291         * css/DOMCSSPaintWorklet.h:
292         * css/DOMCSSPaintWorklet.idl:
293         * dom/Document.cpp:
294         (WebCore::Document::ensureCSSPaintWorklet):
295         (WebCore::Document::setCSSPaintWorkletGlobalScope):
296         (WebCore::Document::ensureCSSPaintWorkletGlobalScope): Deleted.
297         * dom/Document.h:
298         (WebCore::Document::getCSSPaintWorkletGlobalScope):
299         * dom/EventTargetFactory.in:
300         * dom/ScriptExecutionContext.cpp:
301         (WebCore::ScriptExecutionContext::vm):
302         (WebCore::ScriptExecutionContext::execState):
303         * dom/ScriptExecutionContext.h:
304         (WebCore::ScriptExecutionContext::isWorkletGlobalScope const):
305         * inspector/agents/worker/WorkerDebuggerAgent.cpp:
306         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
307         * inspector/agents/worker/WorkerRuntimeAgent.cpp:
308         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
309         * platform/graphics/CustomPaintImage.cpp:
310         (WebCore::CustomPaintImage::CustomPaintImage):
311         (WebCore::CustomPaintImage::doCustomPaint):
312         * platform/graphics/CustomPaintImage.h:
313         * worklets/PaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
314         (WebCore::PaintWorkletGlobalScope::create):
315         (WebCore::PaintWorkletGlobalScope::PaintWorkletGlobalScope):
316         (WebCore::PaintWorkletGlobalScope::devicePixelRatio):
317         (WebCore::PaintWorkletGlobalScope::addRegisteredPaint):
318         * worklets/PaintWorkletGlobalScope.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.h.
319         * worklets/PaintWorkletGlobalScope.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
320         * worklets/Worklet.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
321         (WebCore::Worklet::create):
322         (WebCore::Worklet::Worklet):
323         (WebCore::Worklet::addModule):
324         * worklets/Worklet.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
325         * worklets/Worklet.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
326         * worklets/WorkletConsoleClient.cpp: Copied from Source/WebCore/inspector/agents/worker/WorkerDebuggerAgent.cpp.
327         (WebCore::WorkletConsoleClient::WorkletConsoleClient):
328         (WebCore::WorkletConsoleClient::messageWithTypeAndLevel):
329         (WebCore::WorkletConsoleClient::count):
330         (WebCore::WorkletConsoleClient::time):
331         (WebCore::WorkletConsoleClient::timeEnd):
332         (WebCore::WorkletConsoleClient::profile):
333         (WebCore::WorkletConsoleClient::profileEnd):
334         (WebCore::WorkletConsoleClient::takeHeapSnapshot):
335         (WebCore::WorkletConsoleClient::timeStamp):
336         (WebCore::WorkletConsoleClient::record):
337         (WebCore::WorkletConsoleClient::recordEnd):
338         * worklets/WorkletConsoleClient.h: Added.
339         * worklets/WorkletGlobalScope.cpp: Added.
340         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
341         (WebCore::WorkletGlobalScope::~WorkletGlobalScope):
342         (WebCore::WorkletGlobalScope::evaluate):
343         (WebCore::WorkletGlobalScope::isJSExecutionForbidden const):
344         (WebCore::WorkletGlobalScope::disableEval):
345         (WebCore::WorkletGlobalScope::disableWebAssembly):
346         (WebCore::WorkletGlobalScope::completeURL const):
347         (WebCore::WorkletGlobalScope::logExceptionToConsole):
348         (WebCore::WorkletGlobalScope::addConsoleMessage):
349         (WebCore::WorkletGlobalScope::addMessage):
350         * worklets/WorkletGlobalScope.h: Added.
351         (WebCore::WorkletGlobalScope::isPaintWorkletGlobalScope const):
352         (WebCore::WorkletGlobalScope::identifier const):
353         (WebCore::WorkletGlobalScope::script):
354         (WebCore::WorkletGlobalScope::jsRuntimeFlags const):
355         (isType):
356         * worklets/WorkletGlobalScope.idl: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
357         * worklets/WorkletScriptController.cpp: Added.
358         (WebCore::WorkletScriptController::WorkletScriptController):
359         (WebCore::WorkletScriptController::~WorkletScriptController):
360         (WebCore::WorkletScriptController::forbidExecution):
361         (WebCore::WorkletScriptController::isExecutionForbidden const):
362         (WebCore::WorkletScriptController::disableEval):
363         (WebCore::WorkletScriptController::disableWebAssembly):
364         (WebCore::WorkletScriptController::initScriptWithSubclass):
365         (WebCore::WorkletScriptController::initScript):
366         (WebCore::WorkletScriptController::evaluate):
367         (WebCore::WorkletScriptController::setException):
368         * worklets/WorkletScriptController.h: Added.
369         (WebCore::WorkletScriptController::workletGlobalScopeWrapper):
370         (WebCore::WorkletScriptController::vm):
371         (WebCore::WorkletScriptController::initScriptIfNeeded):
372
373 2018-11-02  Myles C. Maxfield  <mmaxfield@apple.com>
374
375         Clean up drawLineForDocumentMarker()
376         https://bugs.webkit.org/show_bug.cgi?id=191215
377
378         Reviewed by Zalan Bujtas.
379
380         In preparation for https://bugs.webkit.org/show_bug.cgi?id=190764, I need to do a little bit of refactoring.
381         This patch has no behavior change; it just does the following:
382
383         1. Renames drawLineForDocumentMarker() to drawDotsForDocumentMarker(), because 2 of the 3 implementations draw dots
384         2. Moves our implementation back into GraphicsContext, because it's simpler and  GraphicsContext is already platform-
385                specific.
386         3. The signature used to accept a location and a width, but without a height, it's difficult to know what the bounding
387                box is. In particular, knowing the bounding box must be possible without a GraphicsContext. So, I've modified
388                the signature to accept a rectangle instead. The GraphicsContext draws only within this rectangle.
389
390         No new tests because there is no behavior change.
391
392         * platform/graphics/GraphicsContext.h:
393         * platform/graphics/GraphicsContextImpl.h:
394         * platform/graphics/cairo/CairoOperations.cpp:
395         (WebCore::Cairo::drawDotsForDocumentMarker):
396         (WebCore::Cairo::drawLineForDocumentMarker): Deleted.
397         * platform/graphics/cairo/CairoOperations.h:
398         * platform/graphics/cairo/GraphicsContextCairo.cpp:
399         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
400         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
401         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
402         (WebCore::GraphicsContextImplCairo::drawDotsForDocumentMarker):
403         (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker): Deleted.
404         * platform/graphics/cairo/GraphicsContextImplCairo.h:
405         * platform/graphics/cocoa/FontCascadeCocoa.mm:
406         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
407         (WebCore::colorForMarkerLineStyle):
408         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
409         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
410         * platform/graphics/displaylists/DisplayListItems.cpp:
411         (WebCore::DisplayList::Item::sizeInBytes):
412         (WebCore::DisplayList::DrawDotsForDocumentMarker::apply const):
413         (WebCore::DisplayList::DrawDotsForDocumentMarker::localBounds const):
414         (WebCore::DisplayList::operator<<):
415         (WebCore::DisplayList::DrawLineForDocumentMarker::apply const): Deleted.
416         (WebCore::DisplayList::DrawLineForDocumentMarker::localBounds const): Deleted.
417         * platform/graphics/displaylists/DisplayListItems.h:
418         (WebCore::DisplayList::DrawDotsForDocumentMarker::create):
419         (WebCore::DisplayList::DrawDotsForDocumentMarker::rect const):
420         (WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker):
421         (WebCore::DisplayList::DrawLineForDocumentMarker::create): Deleted.
422         (WebCore::DisplayList::DrawLineForDocumentMarker::point const): Deleted.
423         (WebCore::DisplayList::DrawLineForDocumentMarker::width const): Deleted.
424         (WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker): Deleted.
425         * platform/graphics/displaylists/DisplayListRecorder.cpp:
426         (WebCore::DisplayList::Recorder::drawDotsForDocumentMarker):
427         (WebCore::DisplayList::Recorder::drawLineForDocumentMarker): Deleted.
428         * platform/graphics/displaylists/DisplayListRecorder.h:
429         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
430         (Nicosia::CairoOperationRecorder::drawDotsForDocumentMarker):
431         (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker): Deleted.
432         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
433         * platform/graphics/win/GraphicsContextCGWin.cpp:
434         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
435         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
436         * platform/graphics/win/GraphicsContextDirect2D.cpp:
437         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
438         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
439         * rendering/InlineTextBox.cpp:
440         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
441         * rendering/RenderTheme.cpp:
442         (WebCore::RenderTheme::drawLineForDocumentMarker): Deleted.
443         * rendering/RenderTheme.h:
444         * rendering/RenderThemeCocoa.h:
445         * rendering/RenderThemeCocoa.mm:
446         (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Deleted.
447         * rendering/RenderThemeIOS.h:
448         * rendering/RenderThemeIOS.mm:
449         (WebCore::RenderThemeIOS::colorForMarkerLineStyle): Deleted.
450         * rendering/RenderThemeMac.h:
451         * rendering/RenderThemeMac.mm:
452         (WebCore::RenderThemeMac::colorForMarkerLineStyle): Deleted.
453
454 2018-11-02  Ali Juma  <ajuma@chromium.org>
455
456         requestAnimationFrame causes bad location of position:fixed inside overflow:auto and iframe
457         https://bugs.webkit.org/show_bug.cgi?id=176243
458
459         Reviewed by Simon Fraser.
460
461         When a new layer tree is committed to the UIProcess, the positions of layers for fixed
462         or sticky nodes in the newly-committed tree can be stale, because of scrolling that has
463         happened in the UIProcess since the tree was updated in the WebProcess. To handle this,
464         RemoteLayerTreeDrawingAreaProxy::commitLayerTree updates the positions of these layers
465         by calling RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling, which
466         leads to a recursive traversal of the ScrollingTree to update each such layer. However,
467         since ScrollingTreeFrameScrollingNodeIOS didn't implement updateLayersAfterAncestorChange,
468         this traversal never descended into scrolling nodes within an iframe, so the layers for
469         these nodes were left with stale positions.
470
471         Implement ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange so that
472         fixed and sticky layers within an iframe do get their positions updated when a new layer
473         tree is committed.
474
475         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
476         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
477         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange):
478
479 2018-11-02  Wenson Hsieh  <wenson_hsieh@apple.com>
480
481         [iOS] Changing view scale sometimes does not zoom the page to the new initial scale, when the page is at initial scale
482         https://bugs.webkit.org/show_bug.cgi?id=191180
483         <rdar://problem/45744786>
484
485         Reviewed by Simon Fraser.
486
487         When computing the minimum scale in ViewportConfiguration::minimumScale, if our content width or height is
488         shorter than the view width or height, then we recompute the minimum scale such that the content dimensions will
489         fill the bounds of the view by setting the minimum scale to the view width or height divided by the content
490         width or height.
491
492         Suppose the minimum scale is equal to some value `s`; additionally, let `w_c` denote the content width and `w_v`
493         denote the view width (as integers). If `w_v / s` is not an integral value, the computed content width `w_c` may
494         be rounded, such that `w_v / w_c` is not precisely equal to `s`. In the case that `w_v / w_c` is ever so
495         slightly larger than `s`, we will end up overriding the minimum scale `s` with `w_v / w_c`.
496
497         As a result, specifying a viewport with a decimal `minimum-scale` will sometimes cause the computed minimum
498         scale of the viewport (and platform view) to be very slightly different from the minimum scale. The new layout
499         test below exercises this scenario, specifying a viewport with minimum and initial scales of 0.94 that results
500         in `ViewportConfiguration::minimumScale` returning 0.94158.
501
502         With the `WebPage::setViewportConfigurationViewLayoutSize` check added in r237127, this means setting
503         `_viewScale:` when the page is at initial scale sometimes doesn't zoom the page to the new initial scale when it
504         should, since the page scale factor and the initial scale are different enough such that
505         `areEssentiallyEqualAsFloat` returns false.
506
507         This patch addresses these issues by snapping to the minimum scale if the computed scale that fits content
508         dimensions to view dimensions results in a minimum scale that is close enough to the configuration's minimum
509         scale, such that the difference can be attributed to rounding error when computing content or view dimensions.
510
511         Test: fast/viewport/ios/viewport-minimum-and-initial-scale.html
512
513         * page/ViewportConfiguration.cpp:
514         (WebCore::ViewportConfiguration::minimumScale const):
515
516 2018-11-02  Philippe Normand  <pnormand@igalia.com>
517
518         [GTK][WPE] Unreviewed, another --no-video --no-web-audio build fix following r237677
519
520         * inspector/agents/InspectorDOMAgent.cpp:
521         (WebCore::InspectorDOMAgent::addEventListenersToNode):
522
523 2018-11-02  Daniel Bates  <dabates@apple.com>
524
525         [iOS] Normalize character string based on key code
526         https://bugs.webkit.org/show_bug.cgi?id=191120
527
528         Reviewed by Tim Horton.
529
530         Following r236417 (https://bugs.webkit.org/show_bug.cgi?id=189604) we always have a valid key code
531         for a special key (e.g. page up) and can simplify the character string normalization code.
532
533         No functionality changed. So, no new tests.
534
535         * platform/ios/WebEvent.mm:
536         (normalizedStringWithAppKitCompatibilityMapping): Modified to take a key code and wrote algorithm
537         in terms of it.
538
539         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
540         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
541         Pass the key code for the event to normalizedStringWithAppKitCompatibilityMapping().
542
543 2018-11-02  Daniel Bates  <dabates@apple.com>
544
545         [iOS] WebKit should dispatch DOM events when a modifier key is pressed
546         https://bugs.webkit.org/show_bug.cgi?id=190487
547
548         Reviewed by Tim Horton.
549
550         Add support for modifier flags change events.
551
552         * platform/ios/PlatformEventFactoryIOS.mm:
553         (WebCore::modifiersForEvent): Modifier keys do not have an associated character and do not
554         participate in key repeat.
555         (WebCore::keyIdentifierForKeyEvent): Identify modifier keys, returning "Unidentified" if
556         the modifier key is unidentified. This matches the behavior on Mac.
557         (WebCore::keyForKeyEvent): Identify modifier keys, returning the empty string if the modifier
558         key is unidentified. This matches the behavior on Mac.
559         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
560         * platform/ios/WebEvent.h:
561
562         * platform/ios/WebEvent.mm:
563         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
564         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
565         Modifier keys do not have an associated character and do not participate in key repeat.
566
567         (-[WebEvent _eventDescription]): Modified to print a description for a keydown or keyup event
568         that represents a modifier flags change.
569         (-[WebEvent characters]): Modifier keys do not have an associated character. Assert this
570         invariant as it is a programming error. On Mac, the same operation would result in a
571         NSInternalInconsistencyException exception being raised.
572         (-[WebEvent charactersIgnoringModifiers]): Ditto.
573
574 2018-11-02  Ali Juma  <ajuma@chromium.org>
575
576         Allow cross-document intersection observing
577         https://bugs.webkit.org/show_bug.cgi?id=165746
578
579         Reviewed by Simon Fraser.
580
581         Add logic to compute the intersection between the viewport and an element in a
582         subframe.
583
584         Add a FloatRect version of ScrollView::rootViewToContents, and FloatRect versions
585         of the methods it calls.
586
587         Test: http/tests/intersection-observer/intermediate-frame-changes.html
588         Also covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer.
589
590         * dom/Document.cpp:
591         (WebCore::computeClippedRectInRootContentsSpace):
592         (WebCore::computeIntersectionState):
593         (WebCore::Document::updateIntersectionObservations):
594         * page/FrameView.cpp:
595         (WebCore::FrameView::viewportContentsChanged):
596         (WebCore::FrameView::convertFromContainingViewToRenderer const):
597         (WebCore::FrameView::convertFromContainingView const):
598         * page/FrameView.h:
599         * platform/ScrollView.cpp:
600         (WebCore::ScrollView::viewToContents const):
601         (WebCore::ScrollView::contentsToView const):
602         (WebCore::ScrollView::rootViewToContents const):
603         * platform/ScrollView.h:
604         * platform/Widget.cpp:
605         (WebCore::Widget::convertFromRootView const):
606         (WebCore::Widget::convertFromContainingView const):
607         * platform/Widget.h:
608
609 2018-11-02  Rob Buis  <rbuis@igalia.com>
610
611         Remove ENABLE_OPENCL fully
612         https://bugs.webkit.org/show_bug.cgi?id=191172
613
614         Reviewed by Yusuke Suzuki.
615
616         No new tests since no change in functionality.
617
618         * platform/graphics/filters/FilterEffect.h:
619         (WebCore::FilterEffect::hasResult const):
620         (WebCore::FilterEffect::applyAll):
621         (WebCore::FilterEffect::openCLImage): Deleted.
622         (WebCore::FilterEffect::setOpenCLImage): Deleted.
623
624 2018-11-02  Zalan Bujtas  <zalan@apple.com>
625
626         [LFC][IFC] Add support for intrinsic width calculation
627         https://bugs.webkit.org/show_bug.cgi?id=191144
628
629         Reviewed by Antti Koivisto.
630
631         This is the inline formatting version of the shrink-to-fit computation. It generates inline runs
632         and uses InlineLineBreaker to compute min/max width. This is very similar to ::layout.
633
634         Test: fast/inline/simple-shrink-to-fit-inline-block.html
635
636         * layout/inlineformatting/InlineFormattingContext.cpp:
637         (WebCore::Layout::InlineFormattingContext::layout const):
638         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
639         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
640         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
641         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
642         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
643         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
644         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const): Deleted.
645         * layout/inlineformatting/InlineFormattingContext.h:
646
647 2018-11-02  Zalan Bujtas  <zalan@apple.com>
648
649         [LFC][BFC] BlockFormattingContext::instrinsicWidthConstraints logic should look similar to ::layout
650         https://bugs.webkit.org/show_bug.cgi?id=191181
651
652         Reviewed by Antti Koivisto.
653
654         * layout/blockformatting/BlockFormattingContext.cpp:
655         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
656
657 2018-11-02  Zalan Bujtas  <zalan@apple.com>
658
659         [LFC] Align shrink-to-fit width computation with the layout implementation.
660         https://bugs.webkit.org/show_bug.cgi?id=191179
661
662         Reviewed by Antti Koivisto.
663
664         There are many similarities between layout and shrink-to-fit.
665         They both operate on formatting roots only (shrink-to-fit -> float, out-of-flow, inline-block) and in both cases
666         the algoritm depends on what type of formatting context the element establishes.
667
668         This patch is in preparation for transforming the "shrink-to-fit" width computation to make it behave more like layout.
669         With this change the instrinsicWidthConstraints() computation happens in the formatting context that the element establishes (similar to layout).
670
671         * layout/FormattingContext.cpp:
672         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
673         * layout/FormattingContext.h:
674         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
675         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
676         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
677         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
678         * layout/FormattingContextGeometry.cpp:
679         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
680         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
681         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
682         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
683         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
684         * layout/blockformatting/BlockFormattingContext.cpp:
685         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
686         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
687         * layout/blockformatting/BlockFormattingContext.h:
688         * layout/inlineformatting/InlineFormattingContext.cpp:
689         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
690         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
691         * layout/inlineformatting/InlineFormattingContext.h:
692         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
693         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
694
695 2018-11-01  Antoine Quint  <graouts@apple.com>
696
697         [Web Animations] Make document.getAnimations() return declarative animations in the correct order
698         https://bugs.webkit.org/show_bug.cgi?id=191153
699
700         Reviewed by Dean Jackson.
701
702         The Web Animations spec has the notion of "composite order" which determines the order in which animations should
703         be returned when document.getAnimations() is called. The CSS Transitions and CSS Animations specifications also
704         determine the composite order of their respective animation classes, as well as the notion of "owning element",
705         the element that was the animation target when specified through style, prior to any manipulation via the Web
706         Animations API. We implement these two notions so that we can pass the document.getAnimations() tests for
707         declarative animations.
708
709         It is important that we have the notion of an "owning element" since when a CSS Transition or CSS Animation is
710         modified via the Web Animations API in a way that an animation created through CSS we must consider no longer
711         as a declarative animation but as a regular Web Animation. In this patch, we remove the DeclarativeAnimation's
712         target(), which returned a reference, to owningElement(), which returns a pointer and return nullptr once the
713         declarative animation has been modified.
714
715         In order to also keep a correct count of declarative animations applied to elements, we correctly add transitions
716         that have completed to a list of completed transitions, as specified by the CSS Transitions spec. We have had this
717         list declared in AnimationTimeline.h for a while but never actually did the work to add items to it. Thanks to that,
718         AnimationTimeline::updateCSSTransitionsForElement() now correctly accounts for completed transitions so that they
719         may be canceled if overridden with a new animation, correctly removing their "owning element".
720
721         Finally, now that we have saner lists of animations per classes, we can apply the right sorting routines to match
722         the composite order for CSS Transitions, CSS Animations and Web Animations, keeping a list of all animations created
723         in order as the final criterion for sorting.
724
725         * animation/AnimationTimeline.cpp:
726         (WebCore::AnimationTimeline::animationTimingDidChange): Make sure this animation is tracked on the list of all animations
727         created for this timeline in the order in which they were created, which is needed to sort animations correctly when
728         document.getAnimations() is called.
729         (WebCore::AnimationTimeline::animationWasAddedToElement): We've removed the relevantMapForAnimation() method which we used
730         to determine which map we should add an animation to based on its class and instead have code that accounts for not just
731         the animation's class, but also whether it has an owning element since a valid owning element is required to qualify as
732         a CSS Transition or CSS Animation, regardless of the animation's original class.
733         (WebCore::removeAnimationFromMapForElement): Adding this helper to remove an animation from the provided animation map so
734         that animationWasRemovedFromElement() can call this with all of the various animation maps.
735         (WebCore::AnimationTimeline::animationWasRemovedFromElement): Check all of the various animation maps to see which may
736         contain the animation we're trying to remove as the owning element might have been cleared by the time this function is
737         called and looking at the animation's class would not be sufficient to determine which animation map the animation was in.
738         (WebCore::AnimationTimeline::removeDeclarativeAnimationFromListsForOwningElement): New function in which the logic from
739         animationWasRemovedFromElement() that dealt with removing animations from the list of running CSS Animations/Transitions as
740         well as completed CSS Transitions was factored out. This allowed us to also call this function from
741         DeclarativeAnimation::disassociateFromOwningElement().
742         (WebCore::AnimationTimeline::elementWasRemoved): We no longer need to remove an animation as canceling it will remove it
743         correctly when DocumentTimeline::updateAnimationsAndSendEvents() is called.
744         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Call cancelDeclarativeAnimation() instead of the removed
745         cancelOrRemoveDeclarativeAnimation() when a CSS Animation should be canceled.
746         (WebCore::AnimationTimeline::ensureRunningTransitionsByProperty): Now that we correctly remove transitions from the list
747         of running transitions once they've completed or have been canceled, we need a helper to always get a valid map of running
748         transitions for a given element as that map can be cleared while updateCSSTransitionsForElement() is running. 
749         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Call cancelDeclarativeAnimation() instead of the removed
750         cancelOrRemoveDeclarativeAnimation() when a CSS Transition should be canceled. Additionally we always get the list of running
751         transitions for a given element as it can be cleared by a prior cancelation.
752         (WebCore::AnimationTimeline::cancelDeclarativeAnimation): New function replacing cancelOrRemoveDeclarativeAnimation() in which
753         we call the new DeclarativeAnimation::cancelFromStyle() function on the provided animation and then remove the animation from
754         all known lists, including the new list of all animations. We do this final part so that the animation gets re-added as if it
755         were a new animation since canceling a declarative animation via a style change removes its declarative-ness. This guarantees
756         that a declarative animation that is canceled through style but then resumed through the Web Animations API sorts after any
757         declarative animation with an owning element.
758         (WebCore::AnimationTimeline::relevantMapForAnimation): Deleted.
759         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Deleted.
760         * animation/AnimationTimeline.h:
761         (WebCore::AnimationTimeline::timingModelDidChange): Deleted. This was left over in the patch where we implemented the "update
762         animations and send events" procedure.
763         (WebCore::AnimationTimeline::animations const): Deleted.
764         * animation/CSSAnimation.cpp:
765         (WebCore::CSSAnimation::create): Some refactoring to make the handling of a declarative animation's owning element part of the
766         DeclarativeAnimation constructor.
767         * animation/CSSTransition.cpp:
768         (WebCore::CSSTransition::create): Some refactoring to make the handling of a declarative animation's owning element part of the
769         DeclarativeAnimation constructor.
770         * animation/DeclarativeAnimation.cpp:
771         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
772         (WebCore::DeclarativeAnimation::tick): Make sure we disassociate from the animation's owning element once we transition from a
773         relevant state to an idle state. This will catch any changes made via the Web Animations API to a declarative animation when the
774         "update animations and send events" procedure is run.
775         (WebCore::DeclarativeAnimation::disassociateFromOwningElement): Remove this animation from the list of declarative animations on
776         the associated timeline and make owningElement() nullptr so that document.getAnimations() will know to sort this animation with other
777         Web Animations created via the Web Animations API.
778         (WebCore::DeclarativeAnimation::initialize):
779         (WebCore::DeclarativeAnimation::cancelFromStyle): New method called from AnimationTimeline::cancelDeclarativeAnimation() which
780         cancels the animation but also disassociates it from its owning element.
781         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
782         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
783         * animation/DeclarativeAnimation.h:
784         (WebCore::DeclarativeAnimation::owningElement const):
785         (WebCore::DeclarativeAnimation::target const): Deleted.
786         * animation/DocumentTimeline.cpp:
787         (WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): Adding a new utility used when sorting both
788         CSS Transitions and CSS Animations by tree order when their owning element differ, with special logic for pseudo-elements.
789         (WebCore::DocumentTimeline::getAnimations const): Filter and sort animations according to their composite order.
790         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Compile a list of transitions that move to a finished state to
791         the list of completed transitions so that they may be canceled correctly in AnimationTimeline::updateCSSTransitionsForElement().
792         (WebCore::DocumentTimeline::transitionDidComplete):
793         * animation/DocumentTimeline.h:
794
795 2018-11-02  Zan Dobersek  <zdobersek@igalia.com>
796
797         PNGImageDecoder: report no repetition for non-animated images
798         https://bugs.webkit.org/show_bug.cgi?id=191068
799
800         Reviewed by Michael Catanzaro.
801
802         When building with APNG support enabled, the
803         PNGImageDecoder::repetitionCount() method until now reported  infinite
804         repetition count for all PNG images, even the ones that were not
805         animated. This is now changed so that no repetition is reported for
806         non-animated images.
807
808         * platform/image-decoders/png/PNGImageDecoder.cpp:
809         (WebCore::PNGImageDecoder::repetitionCount const):
810
811 2018-11-02  Justin Fan  <justin_fan@apple.com>
812
813         [WebGPU] Experimental prototype for MSL shaders
814         https://bugs.webkit.org/show_bug.cgi?id=191084
815
816         Reviewed by Dean Jackson.
817
818         Begin implementation for WebGPUDevice and WebGPUShaderModule and associated descriptor objects.
819
820         Test: webgpu/webgpu-basics.html
821         Test: webgpu/shader-modules.html
822
823         * CMakeLists.txt:
824         * DerivedSources.make:
825         * Modules/webgpu/GPUDevice.cpp: 
826         (WebCore::GPUDevice::createShaderModule const):
827         * Modules/webgpu/GPUDevice.h: 
828         (WebCore::GPUDevice::platformDevice const):
829         * Modules/webgpu/GPUShaderModule.h:
830         (WebCore::GPUShaderModule::platformShaderModule const):
831         * Modules/webgpu/GPUShaderModuleDescriptor.h:
832         * Modules/webgpu/WebGPU.cpp:
833         (WebCore::WebGPU::requestAdapter const):
834         * Modules/webgpu/WebGPUAdapter.cpp:
835         (WebCore::WebGPUAdapter::create):
836         (WebCore::WebGPUAdapter::createDevice):
837         * Modules/webgpu/WebGPUAdapter.h:
838         * Modules/webgpu/WebGPUAdapter.idl:
839         * Modules/webgpu/WebGPUDevice.cpp:
840         (WebCore::WebGPUDevice::create):
841         (WebCore::WebGPUDevice::WebGPUDevice):
842         (WebCore::WebGPUDevice::createShaderModule const):
843         * Modules/webgpu/WebGPUDevice.h:
844         * Modules/webgpu/WebGPUDevice.idl:
845         * Modules/webgpu/WebGPUShaderModule.cpp:
846         (WebCore::WebGPUShaderModule::create):
847         (WebCore::WebGPUShaderModule::WebGPUShaderModule):
848         * Modules/webgpu/WebGPUShaderModule.h:
849         * Modules/webgpu/WebGPUShaderModule.idl:
850         * Modules/webgpu/WebGPUShaderModuleDescriptor.h:
851         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
852         * Modules/webgpu/WebGPUSwapChain.cpp:
853         (WebCore::WebGPUSwapChain::configure):
854         * Modules/webgpu/WebGPUSwapChain.h:
855         * Modules/webgpu/WebGPUSwapChain.idl:
856         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
857         (WebCore::GPUDevice::create):
858         (WebCore::GPUDevice::GPUDevice):
859         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
860         (WebCore::GPUShaderModule::create):
861         (WebCore::GPUShaderModule::GPUShaderModule):
862         * Sources.txt:
863         * SourcesCocoa.txt:
864         * WebCore.xcodeproj/project.pbxproj:
865         * bindings/js/WebCoreBuiltinNames.h:
866         * platform/Logging.h:
867
868 2018-11-01  Jiewen Tan  <jiewen_tan@apple.com>
869
870         Replace CommonRandom SPI with API
871         https://bugs.webkit.org/show_bug.cgi?id=191178
872         <rdar://problem/45722391>
873
874         Reviewed by Brent Fulgham.
875
876         The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace
877         all SPI usages with API.
878
879         No change of behaviors.
880
881         * crypto/CommonCryptoUtilities.h:
882         * crypto/mac/CryptoKeyMac.cpp:
883         (WebCore::CryptoKey::randomData):
884         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
885         (WebCore::createAndStoreMasterKey):
886         (WebCore::wrapSerializedCryptoKey):
887         * page/Crypto.cpp:
888         (WebCore::Crypto::getRandomValues):
889
890 2018-11-01  Chris Dumez  <cdumez@apple.com>
891
892         [WebIDL] Rename CallWith=ScriptState to CallWith=ExecState
893         https://bugs.webkit.org/show_bug.cgi?id=191162
894
895         Reviewed by Alex Christensen.
896
897         Rename CallWith=ScriptState to CallWith=ExecState in our Web IDL as ScriptState is no longer a thing
898         in modern WebKit. The implementation is actually passed an ExecState nowadays.
899
900         * Modules/applepay/ApplePaySession.idl:
901         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
902         * Modules/fetch/FetchBody.idl:
903         * Modules/indexeddb/IDBCursor.idl:
904         * Modules/indexeddb/IDBFactory.idl:
905         * Modules/indexeddb/IDBIndex.idl:
906         * Modules/indexeddb/IDBKeyRange.idl:
907         * Modules/indexeddb/IDBObjectStore.idl:
908         * Modules/mediastream/RTCPeerConnection.idl:
909         * animation/Animatable.idl:
910         * animation/KeyframeEffect.idl:
911         * animation/KeyframeEffectReadOnly.idl:
912         * bindings/scripts/CodeGeneratorJS.pm:
913         (GenerateCallWith):
914         (GenerateConstructorDefinition):
915         * bindings/scripts/IDLAttributes.json:
916         * bindings/scripts/test/JS/JSTestObj.cpp:
917         (WebCore::jsTestObjWithExecStateAttributeGetter):
918         (WebCore::jsTestObjWithExecStateAttribute):
919         (WebCore::setJSTestObjWithExecStateAttributeSetter):
920         (WebCore::setJSTestObjWithExecStateAttribute):
921         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttributeGetter):
922         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttribute):
923         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttributeSetter):
924         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttribute):
925         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeGetter):
926         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
927         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeSetter):
928         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
929         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody):
930         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoid):
931         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjBody):
932         (WebCore::jsTestObjPrototypeFunctionWithExecStateObj):
933         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody):
934         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidException):
935         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjExceptionBody):
936         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjException):
937         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody):
938         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecState):
939         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjExceptionBody):
940         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjException):
941         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpacesBody):
942         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpaces):
943         (WebCore::jsTestObjWithScriptStateAttributeGetter): Deleted.
944         (WebCore::jsTestObjWithScriptStateAttribute): Deleted.
945         (WebCore::setJSTestObjWithScriptStateAttributeSetter): Deleted.
946         (WebCore::setJSTestObjWithScriptStateAttribute): Deleted.
947         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter): Deleted.
948         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
949         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeSetter): Deleted.
950         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
951         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter): Deleted.
952         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
953         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeSetter): Deleted.
954         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
955         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidBody): Deleted.
956         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoid): Deleted.
957         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjBody): Deleted.
958         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj): Deleted.
959         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidExceptionBody): Deleted.
960         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException): Deleted.
961         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjExceptionBody): Deleted.
962         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException): Deleted.
963         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateBody): Deleted.
964         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState): Deleted.
965         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjExceptionBody): Deleted.
966         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException): Deleted.
967         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpacesBody): Deleted.
968         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces): Deleted.
969         * bindings/scripts/test/TestObj.idl:
970         * bindings/scripts/test/TestPromiseRejectionEvent.idl:
971         * crypto/SubtleCrypto.idl:
972         * dom/Element.idl:
973         * dom/ErrorEvent.idl:
974         * dom/MessagePort.idl:
975         * dom/MouseEvent.idl:
976         * html/HTMLCanvasElement.idl:
977         * html/HTMLFrameElement.idl:
978         * html/OffscreenCanvas.idl:
979         * html/track/DataCue.idl:
980         * inspector/CommandLineAPIHost.idl:
981         * page/DOMWindow.idl:
982         * page/RemoteDOMWindow.idl:
983         * page/WindowOrWorkerGlobalScope.idl:
984         * testing/Internals.idl:
985         * workers/DedicatedWorkerGlobalScope.idl:
986         * workers/Worker.idl:
987
988 2018-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
989
990         Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
991         https://bugs.webkit.org/show_bug.cgi?id=189693
992
993         Reviewed by Yusuke Suzuki.
994
995         No new tests because there's no behaviro changes.
996
997         * platform/SharedBuffer.cpp: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
998         * xml/XSLTProcessorLibxslt.cpp: Ditto.
999         * xml/parser/XMLDocumentParserLibxml2.cpp: Ditto.
1000
1001 2018-11-01  John Wilander  <wilander@apple.com>
1002
1003         In WebCore::ResourceLoadObserver, use document.sessionID().isEphemeral() when possible and check for page existence when not
1004         https://bugs.webkit.org/show_bug.cgi?id=191119
1005         <rdar://problem/44176965>
1006
1007         Reviewed by Chris Dumez.
1008
1009         New API test added.
1010
1011         * loader/ResourceLoadObserver.cpp:
1012         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1013         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1014
1015 2018-11-01  Devin Rousso  <drousso@apple.com>
1016
1017         Web Inspector: Network: remove unnecessary media event tracking
1018         https://bugs.webkit.org/show_bug.cgi?id=191174
1019
1020         Reviewed by Joseph Pecoraro.
1021
1022         No new tests, as this simply removes some event listeners for the WebInspector frontend.
1023
1024         * inspector/agents/InspectorDOMAgent.cpp:
1025         (WebCore::InspectorDOMAgent::addEventListenersToNode):
1026
1027 2018-11-01  Chris Dumez  <cdumez@apple.com>
1028
1029         Location object sans browsing context
1030         https://bugs.webkit.org/show_bug.cgi?id=191060
1031
1032         Reviewed by Geoffrey Garen.
1033
1034         As per https://github.com/whatwg/html/pull/4076, a Location object's URL should be "about:blank" when
1035         it does not have a browsing context (Frame), not "".
1036
1037         No new tests, rebaselined existing tests.
1038
1039         * page/Location.cpp:
1040         (WebCore::Location::url const):
1041         (WebCore::Location::href const):
1042         (WebCore::Location::protocol const):
1043         (WebCore::Location::host const):
1044         (WebCore::Location::hostname const):
1045         (WebCore::Location::port const):
1046         (WebCore::Location::pathname const):
1047         (WebCore::Location::search const):
1048         (WebCore::Location::origin const):
1049         (WebCore::Location::hash const):
1050
1051 2018-11-01  Sihui Liu  <sihui_liu@apple.com>
1052
1053         Add a storage limit for IndexedDB
1054         https://bugs.webkit.org/show_bug.cgi?id=190598
1055         <rdar://problem/44654715>
1056
1057         Reviewed by Chris Dumez.
1058
1059         Set a storage limit in IndexedDB for each pair of mainFrameOrigin and openingOrigin. 
1060         IndexedDB will return a QuotaExceededError if limit is reached.
1061
1062         If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is 
1063         half the free disk space.
1064
1065         Test: storage/indexeddb/storage-limit.html
1066
1067         * Modules/indexeddb/server/IDBBackingStore.h:
1068         * Modules/indexeddb/server/IDBServer.cpp:
1069         (WebCore::IDBServer::IDBServer::createBackingStore):
1070         (WebCore::IDBServer::IDBServer::setPerOriginQuota):
1071         * Modules/indexeddb/server/IDBServer.h:
1072         (WebCore::IDBServer::IDBServer::perOriginQuota const):
1073         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1074         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1075         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
1076         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
1077         (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
1078         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
1079         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
1080         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
1081         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1082         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
1083         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
1084         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1085         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
1086         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1087         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1088         (WebCore::IDBServer::UniqueIDBDatabase::setQuota):
1089         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1090
1091 2018-11-01  Justin Michaud  <justin_michaud@apple.com>
1092
1093         CSS Custom Properties API Should Support syntax="*" and "<length>", and handle cycles properly
1094         https://bugs.webkit.org/show_bug.cgi?id=191042
1095
1096         Reviewed by Antti Koivisto.
1097
1098         Refactor code so that:
1099         - All properties applied in StyleResolver::applyMatchedProperties are only applied once. 
1100         - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
1101           every time they were referenced, and again in RenderStyle.
1102         - The font-size property is applied after its variable references, but before custom properties that depend on it.
1103         - Cycles are detected at the same time as resolution.
1104         - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
1105           If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
1106           This behaviour matches chrome, but is not documented in the spec. 
1107         - Custom property values have more explicit resolved/unresolved state.
1108         - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
1109
1110         Tests: css-custom-properties-api/crash.html
1111                css-custom-properties-api/cycles.html
1112                css-custom-properties-api/inline.html
1113
1114         * css/CSSComputedStyleDeclaration.cpp:
1115         (WebCore::ComputedStyleExtractor::customPropertyValue):
1116         * css/CSSCustomPropertyValue.cpp:
1117         (WebCore::CSSCustomPropertyValue::equals const):
1118         (WebCore::CSSCustomPropertyValue::customCSSText const):
1119         (WebCore::CSSCustomPropertyValue::tokens const):
1120         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
1121         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
1122         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
1123         * css/CSSCustomPropertyValue.h:
1124         * css/CSSRegisteredCustomProperty.cpp:
1125         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
1126         * css/CSSRegisteredCustomProperty.h:
1127         * css/CSSVariableData.cpp:
1128         (WebCore::CSSVariableData::CSSVariableData):
1129         (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
1130         (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
1131         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
1132         (WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
1133         (WebCore::CSSVariableData::resolveVariableReference const): Deleted.
1134         (WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
1135         (WebCore::CSSVariableData::resolveTokenRange const): Deleted.
1136         * css/CSSVariableData.h:
1137         (WebCore::CSSVariableData::create):
1138         (WebCore::CSSVariableData::createResolved): Deleted.
1139         (WebCore::CSSVariableData::needsVariableResolution const): Deleted.
1140         (WebCore::CSSVariableData::CSSVariableData): Deleted.
1141         * css/CSSVariableReferenceValue.cpp:
1142         (WebCore::resolveVariableFallback):
1143         (WebCore::resolveVariableReference):
1144         (WebCore::resolveTokenRange):
1145         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
1146         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
1147         * css/CSSVariableReferenceValue.h:
1148         (WebCore::CSSVariableReferenceValue::create):
1149         (WebCore::CSSVariableReferenceValue::equals const):
1150         (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
1151         * css/DOMCSSRegisterCustomProperty.cpp:
1152         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
1153         * css/PropertySetCSSStyleDeclaration.cpp:
1154         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
1155         * css/StyleBuilderCustom.h:
1156         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
1157         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
1158         * css/StyleProperties.cpp:
1159         (WebCore::MutableStyleProperties::setCustomProperty):
1160         * css/StyleProperties.h:
1161         * css/StyleResolver.cpp:
1162         (WebCore::StyleResolver::State::setStyle):
1163         (WebCore::StyleResolver::styleForKeyframe):
1164         (WebCore::StyleResolver::styleForPage):
1165         (WebCore::StyleResolver::applyMatchedProperties):
1166         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
1167         (WebCore::StyleResolver::applyProperty):
1168         (WebCore::StyleResolver::resolvedVariableValue const):
1169         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
1170         (WebCore::StyleResolver::CascadedProperties::Property::apply):
1171         (WebCore::StyleResolver::applyCascadedCustomProperty):
1172         (WebCore::StyleResolver::applyCascadedProperties):
1173         * css/StyleResolver.h:
1174         * css/parser/CSSParser.cpp:
1175         (WebCore::CSSParser::parseValueWithVariableReferences):
1176         * css/parser/CSSParser.h:
1177         * css/parser/CSSPropertyParser.cpp:
1178         (WebCore::CSSPropertyParser::CSSPropertyParser):
1179         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
1180         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
1181         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
1182         (WebCore::CSSPropertyParser::parseValueStart):
1183         (WebCore::CSSPropertyParser::parseSingleValue):
1184         * css/parser/CSSPropertyParser.h:
1185         * css/parser/CSSVariableParser.cpp:
1186         (WebCore::CSSVariableParser::parseDeclarationValue):
1187         * dom/ConstantPropertyMap.cpp:
1188         (WebCore::ConstantPropertyMap::setValueForProperty):
1189         (WebCore::variableDataForPositivePixelLength):
1190         (WebCore::variableDataForPositiveDuration):
1191         * rendering/style/RenderStyle.cpp:
1192         (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
1193         * rendering/style/RenderStyle.h:
1194         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
1195         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
1196         * rendering/style/StyleCustomPropertyData.h:
1197         (WebCore::StyleCustomPropertyData::operator== const):
1198         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
1199         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
1200         (): Deleted.
1201
1202 2018-11-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
1203
1204         [CG] Adopt CG SPI for non-even cornered rounded rects
1205         https://bugs.webkit.org/show_bug.cgi?id=190155
1206
1207         Reviewed by Simon Fraser.
1208
1209         Instead of creating bezier curves for the non-even corners of the rounded
1210         rects, we should use the optimized SPI provided by CG.
1211
1212         * platform/graphics/cg/PathCG.cpp:
1213         (WebCore::Path::platformAddPathForRoundedRect):
1214
1215 2018-11-01  Youenn Fablet  <youenn@apple.com>
1216
1217         RTCTrackEvent.streams should be SameObject
1218         https://bugs.webkit.org/show_bug.cgi?id=191130
1219
1220         Reviewed by Eric Carlson.
1221
1222         Mimick SameObject using CachedAttribute.
1223         Covered by rebased test.
1224
1225         * Modules/mediastream/RTCTrackEvent.idl:
1226
1227 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1228
1229         [LFC][IFC] Add support for inline-block elements.
1230         https://bugs.webkit.org/show_bug.cgi?id=191143
1231
1232         Reviewed by Antti Koivisto.
1233
1234         This patch add support for laying out non-shrink-to-width inline-block elements.
1235
1236         Test: fast/inline/simple-inline-block.html
1237
1238         * layout/FormattingContext.h:
1239         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1240         * layout/FormattingContextGeometry.cpp:
1241         (WebCore::Layout::contentHeightForFormattingContextRoot):
1242         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1243         * layout/inlineformatting/InlineFormattingContext.cpp:
1244         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1245         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1246         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1247         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
1248         * layout/layouttree/LayoutInlineContainer.cpp:
1249         (WebCore::Layout::InlineContainer::establishesInlineFormattingContext const):
1250         * layout/layouttree/LayoutInlineContainer.h:
1251         * layout/layouttree/LayoutTreeBuilder.cpp:
1252         (WebCore::Layout::TreeBuilder::createSubTree):
1253
1254 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
1255
1256         Fix build with VIDEO and WEB_AUDIO disabled
1257         https://bugs.webkit.org/show_bug.cgi?id=191147
1258
1259         Reviewed by Philippe Normand.
1260
1261         Supported or not, there were a few build fixes needed
1262         to be able to build WebKit with media disabled. Mostly
1263         low-hanging fruits.
1264
1265         * Modules/mediasource/VideoPlaybackQuality.cpp:
1266         * Modules/mediasource/VideoPlaybackQuality.h:
1267         * Modules/mediasource/VideoPlaybackQuality.idl:
1268         * dom/Document.cpp:
1269         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
1270         * inspector/agents/InspectorDOMAgent.cpp:
1271         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
1272         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
1273         * inspector/agents/InspectorDOMAgent.h:
1274         * rendering/RenderThemeGtk.cpp:
1275
1276 2018-10-31  Devin Rousso  <drousso@apple.com>
1277
1278         Web Inspector: Canvas: create a setting for auto-recording newly created contexts
1279         https://bugs.webkit.org/show_bug.cgi?id=190856
1280
1281         Reviewed by Brian Burg.
1282
1283         Test: inspector/canvas/setRecordingAutoCaptureFrameCount.html
1284
1285         * inspector/agents/InspectorCanvasAgent.h:
1286         (WebCore::InspectorCanvasAgent::RecordingOptions): Added.
1287         * inspector/agents/InspectorCanvasAgent.cpp:
1288         (WebCore::InspectorCanvasAgent::enable):
1289         (WebCore::InspectorCanvasAgent::disable):
1290         (WebCore::InspectorCanvasAgent::setRecordingAutoCaptureFrameCount): Added.
1291         (WebCore::InspectorCanvasAgent::startRecording):
1292         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
1293         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
1294         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
1295         (WebCore::InspectorCanvasAgent::startRecording): Added.
1296         Unify the different functions that are able to start a recording to use a single path.
1297
1298         * inspector/InspectorCanvas.h:
1299         * inspector/InspectorCanvas.cpp:
1300         (WebCore::InspectorCanvas::resetRecordingData):
1301         (WebCore::InspectorCanvas::recordAction):
1302         (WebCore::InspectorCanvas::setFrameCount): Added.
1303         (WebCore::InspectorCanvas::overFrameCount const): Added.
1304
1305 2018-10-31  Devin Rousso  <drousso@apple.com>
1306
1307         Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls
1308         https://bugs.webkit.org/show_bug.cgi?id=190641
1309         <rdar://problem/45319049>
1310
1311         Reviewed by Joseph Pecoraro.
1312
1313         No new tests, as low power mode is indeterminate. Should not affect functionality.
1314
1315         * inspector/agents/InspectorDOMAgent.h:
1316         * inspector/agents/InspectorDOMAgent.cpp:
1317         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
1318         (WebCore::InspectorDOMAgent::addEventListenersToNode):
1319         (WebCore::InspectorDOMAgent::mediaMetricsTimerFired): Added.
1320
1321 2018-10-31  Alicia Boya GarcĂ­a  <aboya@igalia.com>
1322
1323         [MSE] Use tolerance when growing the coded frame group
1324         https://bugs.webkit.org/show_bug.cgi?id=190085
1325
1326         Reviewed by Jer Noble.
1327
1328         Test: media/media-source/media-source-append-acb-tolerance.html
1329
1330         This patch introduces a millisecond tolerance in the range of
1331         potential frames that should be erased frame from the track buffer
1332         when the coded frame group is growing.
1333
1334         This is necessary because some files have imprecise overlapping
1335         timestamps (especially WebM files).
1336
1337         This fixes a stall when seeking back and forth in YouTube with WebM
1338         video.
1339
1340         A test case simulating the problem with video/mock using timestamps
1341         similar to those of a typical 30 fps WebM video is also added.
1342
1343         * Modules/mediasource/SourceBuffer.cpp:
1344         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1345
1346 2018-10-31  Jer Noble  <jer.noble@apple.com>
1347
1348         MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.B0') is inproperly rejected
1349         https://bugs.webkit.org/show_bug.cgi?id=191129
1350
1351         Reviewed by Eric Carlson.
1352
1353         Test: media/media-source/media-source-istypesupported-case-sensitive.html
1354
1355         According to RFC 2045: "All media type values, subtype values, and parameter names as
1356         defined are case-insensitive. However, parameter values are case-sensitive unless otherwise
1357         specified for the specific parameter." So rather than fold the entire ContentType into lower-
1358         case, leave the original string intact and require clients to enforce case-insensitivity.
1359
1360         * Modules/mediasource/MediaSource.cpp:
1361         (WebCore::MediaSource::isTypeSupported):
1362
1363 2018-10-31  Jer Noble  <jer.noble@apple.com>
1364
1365         Unreivewed build fix; fix the non-HAVE_AVCONTENTKEYSESSION builds by adding guards around
1366         access of m_cdmInstance.
1367
1368         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1369         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
1370
1371 2018-10-31  YUHAN WU  <yuhan_wu@apple.com>
1372
1373         MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
1374         https://bugs.webkit.org/show_bug.cgi?id=190778
1375         <rdar://problem/45703574>
1376
1377         Reviewed by Youenn Fablet.
1378
1379         Add a include to fix the unified build error.
1380
1381         No tests since no new functionality.
1382
1383         * Modules/webgpu/WebGPUDevice.cpp:
1384
1385 2018-10-26  Jer Noble  <jer.noble@apple.com>
1386
1387         [EME][Cocoa] Cannot play unmuxed video and audio fMP4 streams encrypted with different keys via MSE
1388         https://bugs.webkit.org/show_bug.cgi?id=190946
1389
1390         Reviewed by Eric Carlson.
1391
1392         Use separate AVContentKeySessions per CDMInstanceSession (rather than one AVContentKeySession per
1393         CDMInstance).
1394
1395         - Add a mechanism for sending a message out from platform/CDMInstance to MediaKeySession without
1396           requiring MediaKeySession to send a callback first.
1397
1398         - Move all the AVContentKeySession delegate methods from CDMInstanceFairPlayStreamingAVFObjC to
1399           CDMInstanceSessionFairPlayStreamingAVFObjC.
1400
1401         - Add a mechanism for requesting the correct CDMInstanceSession for a given KeyID.
1402
1403         - Support key renewal through a "renew" message.
1404
1405         - Remember the keyID in SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID()
1406           and ask for the correct CDMInstanceSession for that keyID in attemptToDecrypt().
1407
1408         - Pass the CDMInstance down from MediaPlayerPrivateMediaSourceAVFObjC -> SourceBufferPrivateAVFObjC.
1409
1410         * Modules/encryptedmedia/MediaKeySession.cpp:
1411         (WebCore::MediaKeySession::sendMessage):
1412         * Modules/encryptedmedia/MediaKeySession.h:
1413         * platform/encryptedmedia/CDMInstanceSession.h:
1414         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
1415         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1416         (-[WebCoreFPSContentKeySessionDelegate initWithParent:]):
1417         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
1418         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession):
1419         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1420         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForKeyIDs const):
1421         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
1422         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::~CDMInstanceSessionFairPlayStreamingAVFObjC):
1423         (WebCore::keyIDsForRequest):
1424         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
1425         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
1426         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
1427         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
1428         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
1429         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
1430         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
1431         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
1432         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
1433         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
1434         (WebCore::requestStatusToCDMStatus):
1435         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
1436         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1437         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
1438         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1439         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1440         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1441         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceAttached):
1442         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceDetached):
1443         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
1444         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1445         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1446         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1447         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
1448         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
1449         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
1450         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
1451         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1452         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1453         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
1454         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceAttached):
1455         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceDetached):
1456         (WebCore::MediaSourcePrivateAVFObjC::attemptToDecryptWithInstance):
1457         (WebCore::MediaSourcePrivateAVFObjC::waitingForKey const):
1458         (WebCore::MediaSourcePrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1459         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1460         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1461         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1462         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
1463         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
1464         (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
1465         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1466
1467 2018-10-31  Zach Li  <zacharyli323@gmail.com>
1468
1469         Add credit card autofill button
1470         https://bugs.webkit.org/show_bug.cgi?id=191051
1471         <rdar://problem/45657011>
1472
1473         Reviewed by Wenson Hsieh.
1474
1475         Test: fast/forms/auto-fill-button/input-credit-card-auto-fill-button.html
1476
1477         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1478         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1479         * css/html.css:
1480         (input::-webkit-credit-card-auto-fill-button):
1481         Add credit card autofill button.
1482         (input::-webkit-credit-card-auto-fill-button:hover):
1483         (input::-webkit-credit-card-auto-fill-button:active):
1484         * html/HTMLTextFormControlElement.h:
1485         * html/TextFieldInputType.cpp:
1486         (WebCore::autoFillButtonTypeToAccessibilityLabel):
1487         (WebCore::autoFillButtonTypeToAutoFillButtonText):
1488         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
1489         (WebCore::isAutoFillButtonTypeChanged):
1490         * platform/LocalizedStrings.cpp:
1491         (WebCore::AXAutoFillCreditCardLabel):
1492         * platform/LocalizedStrings.h:
1493         * testing/Internals.cpp:
1494         (WebCore::toAutoFillButtonType):
1495         (WebCore::toInternalsAutoFillButtonType):
1496         * testing/Internals.h:
1497         * testing/Internals.idl:
1498
1499 2018-10-31  Eric Carlson  <eric.carlson@apple.com>
1500
1501         [MediaStream] Don't reveal device IDs until the user has granted permission to capture
1502         https://bugs.webkit.org/show_bug.cgi?id=191112
1503         <rdar://problem/45699932>
1504
1505         Reviewed by Youenn Fablet.
1506
1507         No new tests, existing tests updated.
1508
1509         * Modules/mediastream/MediaDevicesRequest.cpp:
1510         (WebCore::MediaDevicesRequest::start): Don't reveal device ID or group ID until the user 
1511         has granted permssion to capture.
1512
1513 2018-10-31  YUHAN WU  <yuhan_wu@apple.com>
1514
1515         MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
1516         https://bugs.webkit.org/show_bug.cgi?id=190778
1517
1518         Reviewed by Youenn Fablet.
1519
1520         Implement JavaScript dispatch event dataavailable and JavaScript exposed method stop().
1521         Implement a mock string as the output buffer of MediaRecorder.
1522         Remove the declaration of timecode in BlobEvent since it has not been implemented in MediaRecorder and MediaRecorderPrivate. 
1523
1524         Tests: http/wpt/mediarecorder/MediaRecorder-dataavailable.html
1525                http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html
1526                imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution.html
1527                imported/w3c/web-platform-tests/mediacapture-record/support/MediaRecorder-iframe.html
1528
1529         * CMakeLists.txt:
1530         * Modules/mediarecorder/BlobEvent.cpp: Added.
1531         (WebCore::BlobEvent::create):
1532         (WebCore::BlobEvent::BlobEvent):
1533         (WebCore::BlobEvent::eventInterface const):
1534         * Modules/mediarecorder/BlobEvent.h:
1535         * Modules/mediarecorder/BlobEvent.idl:
1536         * Modules/mediarecorder/MediaRecorder.cpp:
1537         (WebCore::MediaRecorder::MediaRecorder):
1538         (WebCore::MediaRecorder::~MediaRecorder):
1539         (WebCore::MediaRecorder::stop):
1540         (WebCore::MediaRecorder::startRecording):
1541         (WebCore::MediaRecorder::stopRecording):
1542         (WebCore::MediaRecorder::stopRecordingInternal):
1543         (WebCore::MediaRecorder::didAddOrRemoveTrack):
1544         (WebCore::MediaRecorder::trackEnded):
1545         (WebCore::MediaRecorder::sampleBufferUpdated):
1546         (WebCore::MediaRecorder::audioSamplesAvailable):
1547         (WebCore::MediaRecorder::scheduleDeferredTask):
1548         * Modules/mediarecorder/MediaRecorder.h:
1549         * Modules/mediarecorder/MediaRecorder.idl:
1550         * Sources.txt:
1551         * WebCore.xcodeproj/project.pbxproj:
1552         * dom/EventNames.h:
1553         * dom/EventNames.in:
1554         * platform/mediarecorder/MediaRecorderPrivate.h: Added.
1555         * platform/mediarecorder/MediaRecorderPrivateMock.cpp: Added.
1556         (WebCore::MediaRecorderPrivateMock::sampleBufferUpdated):
1557         (WebCore::MediaRecorderPrivateMock::audioSamplesAvailable):
1558         (WebCore::MediaRecorderPrivateMock::generateMockString):
1559         (WebCore::MediaRecorderPrivateMock::fetchData):
1560         * platform/mediarecorder/MediaRecorderPrivateMock.h: Added.
1561
1562 2018-10-31  Claudio Saavedra  <csaavedra@igalia.com>
1563
1564         [GTK][WPE] Remaining topPrivatelyControlledDomain() fixes
1565         https://bugs.webkit.org/show_bug.cgi?id=191110
1566
1567         Reviewed by Michael Catanzaro.
1568
1569         Covered by existing tests.
1570
1571         Turns out that this method is expected to reject domains that
1572         are not registrable. Also sync with the Mac implementation in
1573         that given domains that are not all ASCII should be returned
1574         back as is. This fixes the remaining Public Suffix API tests.
1575
1576         * platform/soup/PublicSuffixSoup.cpp:
1577         (WebCore::topPrivatelyControlledDomain):
1578
1579 2018-10-31  Antti Koivisto  <antti@apple.com>
1580
1581         Remove LayerFlushScheduler
1582         https://bugs.webkit.org/show_bug.cgi?id=191103
1583
1584         Reviewed by Anders Carlsson.
1585
1586         It is only used in WK1.
1587
1588         * SourcesCocoa.txt:
1589         * WebCore.xcodeproj/project.pbxproj:
1590         * platform/graphics/ca/LayerFlushScheduler.cpp: Removed.
1591         * platform/graphics/ca/LayerFlushScheduler.h: Removed.
1592         * platform/graphics/ca/LayerFlushSchedulerClient.h: Removed.
1593         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Removed.
1594
1595 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1596
1597         Missing from r237634
1598
1599         * layout/inlineformatting/InlineFormattingState.cpp:
1600         (WebCore::Layout::InlineFormattingState::formattingContext):
1601
1602 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1603
1604         [LFC] Do not pass LayoutState& to compute* and layout* functions
1605         https://bugs.webkit.org/show_bug.cgi?id=191100
1606
1607         Reviewed by Antti Koivisto.
1608
1609         Reduce noise by removing LayoutState& parameter where possible.
1610
1611         * layout/FormattingContext.cpp:
1612         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1613         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1614         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1615         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
1616         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1617         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1618         * layout/FormattingContext.h:
1619         * layout/FormattingContextGeometry.cpp:
1620         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1621         * layout/LayoutFormattingState.cpp:
1622         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
1623         * layout/blockformatting/BlockFormattingContext.cpp:
1624         (WebCore::Layout::BlockFormattingContext::layout const):
1625         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1626         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1627         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1628         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1629         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
1630         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1631         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1632         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1633         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
1634         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1635         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1636         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
1637         * layout/blockformatting/BlockFormattingContext.h:
1638         * layout/inlineformatting/InlineFormattingContext.cpp:
1639         (WebCore::Layout::InlineFormattingContext::layout const):
1640         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
1641         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
1642         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1643         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
1644         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
1645         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
1646         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
1647         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1648         * layout/inlineformatting/InlineFormattingContext.h:
1649
1650 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1651
1652         [LFC] FormattingContext class should take FormattingState&
1653         https://bugs.webkit.org/show_bug.cgi?id=191099
1654
1655         Reviewed by Antti Koivisto.
1656
1657         This is in preparation for not passing LayoutState& into every layout functions.
1658         FormattingContext has FormattingState now and LayoutState can be acquired through FormattingState.
1659         LayoutState <- FormattingState <- FormattingContext
1660
1661         * layout/FormattingContext.cpp:
1662         (WebCore::Layout::FormattingContext::FormattingContext):
1663         (WebCore::Layout::FormattingContext::formattingState const):
1664         (WebCore::Layout::FormattingContext::layoutState const):
1665         * layout/FormattingContext.h:
1666         * layout/FormattingState.cpp:
1667         (WebCore::Layout::FormattingState::FormattingState):
1668         * layout/FormattingState.h:
1669         (WebCore::Layout::FormattingState::layoutState const):
1670         * layout/LayoutFormattingState.h:
1671         * layout/blockformatting/BlockFormattingContext.cpp:
1672         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
1673         * layout/blockformatting/BlockFormattingContext.h:
1674         * layout/blockformatting/BlockFormattingState.cpp:
1675         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
1676         (WebCore::Layout::BlockFormattingState::formattingContext):
1677         (WebCore::Layout::BlockFormattingState::formattingContext const): Deleted.
1678         * layout/blockformatting/BlockFormattingState.h:
1679         * layout/inlineformatting/InlineFormattingContext.cpp:
1680         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
1681         * layout/inlineformatting/InlineFormattingContext.h:
1682         * layout/inlineformatting/InlineFormattingState.cpp:
1683         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
1684         (WebCore::Layout::InlineFormattingState::formattingContext):
1685         (WebCore::Layout::InlineFormattingState::formattingContext const): Deleted.
1686         * layout/inlineformatting/InlineFormattingState.h:
1687
1688 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1689
1690         [LFC] The *FormattingState class should provide the *FormattingContext.
1691         https://bugs.webkit.org/show_bug.cgi?id=191089
1692
1693         Reviewed by Antti Koivisto.
1694
1695         BlockFormattingState provides the BlockFormattingContext object, while InlineFormattingState provides the InlineFormattingContext.
1696
1697         * layout/FormattingContext.cpp:
1698         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1699         * layout/FormattingState.h:
1700         * layout/LayoutFormattingState.cpp:
1701         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
1702         (WebCore::Layout::LayoutState::formattingContext const): Deleted.
1703         * layout/LayoutFormattingState.h:
1704         * layout/blockformatting/BlockFormattingContext.cpp:
1705         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1706         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
1707         * layout/blockformatting/BlockFormattingState.cpp:
1708         (WebCore::Layout::BlockFormattingState::formattingContext const):
1709         * layout/blockformatting/BlockFormattingState.h:
1710         * layout/inlineformatting/InlineFormattingContext.cpp:
1711         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1712         * layout/inlineformatting/InlineFormattingState.cpp:
1713         (WebCore::Layout::InlineFormattingState::formattingContext const):
1714         * layout/inlineformatting/InlineFormattingState.h:
1715
1716 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1717
1718         [LFC] Rename LayoutContext to LayoutState
1719         https://bugs.webkit.org/show_bug.cgi?id=191080
1720
1721         Reviewed by Antti Koivisto.
1722
1723         LayoutContext naming was a bit misleading since none of the other *FormattingContext classes (BlockFormattingContext etc) hold states.
1724         (LayoutContext.cpp -> LayoutFormattingState.cpp because LayoutState.cpp name is already taken.)
1725
1726         Now the current state is as follows:
1727
1728         LayoutState has
1729         1. Layout tree
1730         2. State content for each formatting subtrees
1731         3. Display tree
1732
1733         * Sources.txt:
1734         * WebCore.xcodeproj/project.pbxproj:
1735         * layout/FormattingContext.cpp:
1736         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1737         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1738         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1739         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
1740         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1741         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
1742         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
1743         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
1744         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1745         * layout/FormattingContext.h:
1746         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
1747         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1748         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
1749         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1750         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1751         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1752         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1753         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1754         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1755         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1756         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1757         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
1758         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1759         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1760         * layout/FormattingContextGeometry.cpp:
1761         (WebCore::Layout::contentHeightForFormattingContextRoot):
1762         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
1763         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
1764         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
1765         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
1766         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1767         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1768         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1769         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1770         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1771         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1772         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1773         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
1774         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1775         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
1776         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1777         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
1778         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1779         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1780         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1781         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
1782         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
1783         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1784         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1785         * layout/FormattingState.cpp:
1786         (WebCore::Layout::FormattingState::FormattingState):
1787         * layout/FormattingState.h:
1788         (WebCore::Layout::FormattingState::setInstrinsicWidthConstraints):
1789         (WebCore::Layout::FormattingState::instrinsicWidthConstraints const):
1790         * layout/LayoutFormattingState.cpp: Renamed from Source/WebCore/layout/LayoutContext.cpp.
1791         (WebCore::Layout::LayoutState::LayoutState):
1792         (WebCore::Layout::LayoutState::initializeRoot):
1793         (WebCore::Layout::LayoutState::updateLayout):
1794         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
1795         (WebCore::Layout::LayoutState::displayBoxForLayoutBox const):
1796         (WebCore::Layout::LayoutState::styleChanged):
1797         (WebCore::Layout::LayoutState::markNeedsUpdate):
1798         (WebCore::Layout::LayoutState::formattingStateForBox const):
1799         (WebCore::Layout::LayoutState::establishedFormattingState const):
1800         (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
1801         (WebCore::Layout::LayoutState::formattingContext const):
1802         * layout/LayoutFormattingState.h: Renamed from Source/WebCore/layout/LayoutContext.h.
1803         (WebCore::Layout::LayoutState::setInQuirksMode):
1804         (WebCore::Layout::LayoutState::hasDisplayBox const):
1805         (WebCore::Layout::LayoutState::inQuirksMode const):
1806         * layout/Verification.cpp:
1807         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
1808         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
1809         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1810         (WebCore::Layout::verifyAndOutputSubtree):
1811         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
1812         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): Deleted.
1813         * layout/blockformatting/BlockFormattingContext.cpp:
1814         (WebCore::Layout::BlockFormattingContext::layout const):
1815         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1816         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1817         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1818         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1819         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
1820         (WebCore::Layout::hasPrecomputedMarginTop):
1821         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1822         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1823         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1824         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
1825         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1826         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1827         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
1828         * layout/blockformatting/BlockFormattingContext.h:
1829         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1830         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1831         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1832         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1833         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1834         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1835         (WebCore::Layout::isStretchedToInitialContainingBlock):
1836         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1837         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1838         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1839         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1840         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
1841         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1842         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1843         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
1844         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop):
1845         * layout/blockformatting/BlockFormattingState.cpp:
1846         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
1847         * layout/blockformatting/BlockFormattingState.h:
1848         * layout/blockformatting/BlockInvalidation.cpp:
1849         (WebCore::Layout::computeUpdateType):
1850         (WebCore::Layout::computeUpdateTypeForAncestor):
1851         (WebCore::Layout::BlockInvalidation::invalidate):
1852         * layout/blockformatting/BlockInvalidation.h:
1853         * layout/blockformatting/BlockMarginCollapse.cpp:
1854         (WebCore::Layout::isMarginTopCollapsedWithParent):
1855         (WebCore::Layout::isMarginBottomCollapsedThrough):
1856         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild):
1857         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop):
1858         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop):
1859         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom):
1860         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
1861         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
1862         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
1863         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
1864         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom):
1865         * layout/displaytree/DisplayBox.h:
1866         * layout/floats/FloatAvoider.cpp:
1867         (WebCore::Layout::FloatAvoider::FloatAvoider):
1868         * layout/floats/FloatAvoider.h:
1869         * layout/floats/FloatBox.cpp:
1870         (WebCore::Layout::FloatBox::FloatBox):
1871         * layout/floats/FloatBox.h:
1872         * layout/floats/FloatingContext.cpp:
1873         (WebCore::Layout::FloatingContext::positionForFloat const):
1874         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
1875         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1876         * layout/floats/FloatingContext.h:
1877         (WebCore::Layout::FloatingContext::layoutState const):
1878         (WebCore::Layout::FloatingContext::layoutContext const): Deleted.
1879         * layout/floats/FloatingState.cpp:
1880         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
1881         (WebCore::Layout::FloatingState::FloatingState):
1882         (WebCore::Layout::FloatingState::constraints const):
1883         * layout/floats/FloatingState.h:
1884         (WebCore::Layout::FloatingState::create):
1885         (WebCore::Layout::FloatingState::layoutState const):
1886         (WebCore::Layout::FloatingState::layoutContext const): Deleted.
1887         * layout/inlineformatting/InlineFormattingContext.cpp:
1888         (WebCore::Layout::InlineFormattingContext::layout const):
1889         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
1890         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
1891         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1892         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
1893         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
1894         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
1895         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
1896         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1897         * layout/inlineformatting/InlineFormattingContext.h:
1898         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1899         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1900         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
1901         * layout/inlineformatting/InlineFormattingState.cpp:
1902         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
1903         * layout/inlineformatting/InlineFormattingState.h:
1904         * layout/inlineformatting/InlineInvalidation.cpp:
1905         (WebCore::Layout::InlineInvalidation::invalidate):
1906         * layout/inlineformatting/InlineInvalidation.h:
1907         * layout/inlineformatting/InlineLineBreaker.cpp:
1908         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
1909         (WebCore::Layout::InlineLineBreaker::runWidth const):
1910         * layout/inlineformatting/InlineLineBreaker.h:
1911         * layout/layouttree/LayoutTreeBuilder.cpp:
1912         (WebCore::Layout::outputInlineRuns):
1913         (WebCore::Layout::outputLayoutTree):
1914         (WebCore::Layout::showLayoutTree):
1915         * layout/layouttree/LayoutTreeBuilder.h:
1916         * page/FrameViewLayoutContext.cpp:
1917         (WebCore::layoutUsingFormattingContext):
1918
1919 2018-10-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1920
1921         [Cocoa] Attachment dropped from one web view to another is missing its file wrapper
1922         https://bugs.webkit.org/show_bug.cgi?id=190530
1923         <rdar://problem/45232149>
1924
1925         Reviewed by Tim Horton.
1926
1927         Add support for copying and pasting attachment elements across web views by encoding and adding file wrapper
1928         data as subresources in the web archive when writing selected web content to the pasteboard, and then decoding
1929         and creating NSFileWrappers upon reading web content.
1930
1931         Test: WKAttachmentTests.CopyAndPasteBetweenWebViews
1932
1933         * WebCore.xcodeproj/project.pbxproj:
1934         * editing/Editor.cpp:
1935         (WebCore::Editor::registerAttachments):
1936         * editing/Editor.h:
1937
1938         Add registerAttachments(), which registers _WKAttachments in the UI process given a list of
1939         SerializedAttachmentData. This behaves similarly to registerAttachmentIdentifiers(), but differs in that (1) it
1940         sends serialized file wrapper data, and (2) it sends a list of serialized attachments, rather than information
1941         about just a single attachment.
1942
1943         * editing/SerializedAttachmentData.h:
1944
1945         Introduce SerializedAttachmentData, a struct containing information needed to serialize and deserialize an
1946         attachment. These are used both when writing attachment data to the pasteboard, and when consuming attachment
1947         data upon paste.
1948
1949         * editing/cocoa/WebContentReaderCocoa.mm:
1950         (WebCore::replaceRichContentWithAttachments):
1951
1952         Add a step when pasting rich content with attachments, to collect and send serialized attachments to the client.
1953         Also, drive-by fix: don't WTFMove() the Ref here if it's still going to be used below.
1954
1955         * html/HTMLAttachmentElement.cpp:
1956         (WebCore::HTMLAttachmentElement::archiveResourceURL):
1957         * html/HTMLAttachmentElement.h:
1958
1959         Add a static helper function to compute a URL that represents the data for the given attachment identifier, for
1960         use in a web archive resource.
1961
1962         * loader/archive/cf/LegacyWebArchive.cpp:
1963         (WebCore::addSubresourcesForAttachmentElementsIfNecessary):
1964
1965         Add a helper function to create and append ArchiveResources representing attachment element data when writing
1966         attachments to the pasteboard via web archive data.
1967
1968         (WebCore::LegacyWebArchive::create):
1969         * page/EditorClient.h:
1970         (WebCore::EditorClient::registerAttachments):
1971         (WebCore::EditorClient::serializedAttachmentDataForIdentifiers):
1972
1973 2018-10-30  David Kilzer  <ddkilzer@apple.com>
1974
1975         XSLTProcessor should limit max transform depth
1976         <https://webkit.org/b/191075>
1977         <rdar://problem/45531453>
1978
1979         Reviewed by Alex Christensen.
1980
1981         Test: fast/xsl/xslt-max-depth.html
1982
1983         * xml/SoftLinkLibxslt.cpp: Add macro for `xsltMaxDepth` global.
1984         * xml/SoftLinkLibxslt.h: Ditto.
1985         * xml/XSLTProcessorLibxslt.cpp:
1986         (WebCore::XSLTProcessor::transformToString): Set `xsltMaxDepth`
1987         to 1000.  Default in libxslt.dylib is 3000.
1988
1989 2018-10-30  Jim Mason  <jmason@ibinx.com>
1990
1991         [GTK] Scrollbars not following gtk-primary-button-warps-slider setting
1992         https://bugs.webkit.org/show_bug.cgi?id=191067
1993
1994         Reviewed by Michael Catanzaro.
1995
1996         * platform/gtk/ScrollbarThemeGtk.cpp:
1997         (WebCore::ScrollbarThemeGtk::handleMousePressEvent):
1998
1999 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
2000
2001         Clean up some obsolete MAX_ALLOWED macros
2002         https://bugs.webkit.org/show_bug.cgi?id=190916
2003
2004         Reviewed by Tim Horton.
2005
2006         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2007         (WebCore::exernalDeviceDisplayNameForPlayer):
2008         * platform/mac/PlatformEventFactoryMac.mm:
2009         (WebCore::globalPointForEvent):
2010         (WebCore::pointForEvent):
2011         (WebCore::mouseButtonForEvent):
2012         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
2013
2014 2018-10-30  Ali Juma  <ajuma@chromium.org>
2015
2016         Calling window.open("", "_self") allows working around restrictions on window.close()
2017         https://bugs.webkit.org/show_bug.cgi?id=191073
2018
2019         Reviewed by Chris Dumez.
2020
2021         Do not treat a re-used frame in DOMWindow::createWindow as having been opened by DOM.
2022
2023         Test: fast/dom/Window/window-open-self-disallow-close.html
2024
2025         * page/DOMWindow.cpp:
2026         (WebCore::DOMWindow::createWindow):
2027
2028 2018-10-30  Andy Estes  <aestes@apple.com>
2029
2030         [Payment Request] Implement PaymentResponse.retry()
2031         https://bugs.webkit.org/show_bug.cgi?id=190985
2032
2033         Reviewed by Daniel Bates.
2034
2035         Implemented the retry() method on PaymentResponse as specified in the Payment Request API
2036         W3C Editor's Draft of 24 October 2018.
2037
2038         See https://w3c.github.io/payment-request/#retry-method for details.
2039
2040         Tests: http/tests/paymentrequest/payment-response-rejects-if-not-active.https.html
2041                http/tests/paymentrequest/payment-response-retry-method.https.html
2042
2043         * Modules/applepay/PaymentCoordinator.h:
2044         (WebCore::PaymentCoordinator::client): Added. Returns m_client.
2045         * Modules/applepay/PaymentCoordinatorClient.h:
2046         (WebCore::PaymentCoordinatorClient::isMockPaymentCoordinator const): Added. Used to downcast
2047         a PaymentCoordinatorClient to a MockPaymentCoordinator.
2048         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2049         (WebCore::ApplePayPaymentHandler::computeTotalAndLineItems const): Made const.
2050         (WebCore::ApplePayPaymentHandler::computeErrors const): Broke this function into
2051         computeAddressErrors, computePayerErrors, and computePaymentMethodErrors, then modified this
2052         function to call those functions. Exceptions thrown by computePaymentMethodErrors are ignored.
2053         (WebCore::ApplePayPaymentHandler::computeAddressErrors const): Added.
2054         (WebCore::ApplePayPaymentHandler::computePayerErrors const): Added.
2055         (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): Added.
2056         (WebCore::ApplePayPaymentHandler::complete): Added ASSERTs to verify whether result is a
2057         final result.
2058         (WebCore::ApplePayPaymentHandler::retry): Computed PaymentErrors from PaymentValidationErrors,
2059         ensured the PaymentAuthorizationResult was non-final by adding an unknown error if necessary,
2060         and called PaymentCoordinator::completePaymentSession.
2061         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
2062         * Modules/paymentrequest/PaymentHandler.h:
2063         * Modules/paymentrequest/PaymentRequest.cpp:
2064         (WebCore::PaymentRequest::show): Changed to call settleShowPromise.
2065         (WebCore::PaymentRequest::abortWithException): Changed to abort PaymentResponse's retry
2066         promise, if present, instead of PaymentResponse's show promise.
2067         (WebCore::PaymentRequest::settleShowPromise): Added. Settles m_showPromise then sets it to
2068         std::nullopt.
2069         (WebCore::PaymentRequest::closeActivePaymentHandler): Added. Hides the active payment
2070         handler then sets it to std::nullopt.
2071         (WebCore::PaymentRequest::stop): Stopped calling abortWithException, since that function
2072         might settle PaymentResponse's retry promise. PaymentResponse is now an ActiveDOMObject and
2073         will settle its own promise in its implementation of stop.
2074         (WebCore::PaymentRequest::abort): Changed to throw an InvalidStateError if there is a
2075         pending retry promise and to call abortWithException instead of stop.
2076         (WebCore::PaymentRequest::completeMerchantValidation): Changed to call abortWithException
2077         instead of stop.
2078         (WebCore::PaymentRequest::settleDetailsPromise): Ditto.
2079         (WebCore::PaymentRequest::accept): Updated the existing PaymentResponse, if present, rather
2080         than creating a new one. Settled the existing PaymentResponse's retry promise, if present,
2081         rather than the show promise.
2082         (WebCore::PaymentRequest::complete): Changed to throw an AbortError if there is no longer an
2083         active payment handler.
2084         (WebCore::PaymentRequest::retry): Changed to throw an AbortError if there is no longer an
2085         active payment handler, and to call PaymentHandler::retry if there is.
2086         (WebCore::PaymentRequest::cancel): Changed to call abortWithException instead of stop.
2087         * Modules/paymentrequest/PaymentRequest.h:
2088         * Modules/paymentrequest/PaymentRequest.idl:
2089         * Modules/paymentrequest/PaymentResponse.cpp:
2090         (WebCore::PaymentResponse::PaymentResponse):
2091         (WebCore::PaymentResponse::finishConstruction): Pending activities create strong references
2092         to |this|, so they cannot be created in constructors without relaxing adoption requirements.
2093         Added this function so that the pending activity can be created after the PaymentResponse is
2094         created and adopted.
2095         (WebCore::PaymentResponse::~PaymentResponse):
2096         (WebCore::PaymentResponse::complete): Updated to throw an AbortError or InvalidStateError
2097         when necessary.
2098         (WebCore::PaymentResponse::retry): Implemented. Throws an AbortError or InvalidStateError
2099         when necessary, otherwise calls PaymentRequest::retry and stores the retry promise in
2100         m_retryPromise.
2101         (WebCore::PaymentResponse::abortWithException): Added. Rejects the retry promise with
2102         |exception|, clears the pending activity, and sets m_state to Completed.
2103         (WebCore::PaymentResponse::settleRetryPromise): Added. Settles the retry promise and sets it
2104         to std::nullopt.
2105         (WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Added. Returns true if
2106         there is no pending activity.
2107         (WebCore::PaymentResponse::stop): Added. Rejects the retry promise with AbortError, clears
2108         the pending activity, and sets m_state to Stopped.
2109         * Modules/paymentrequest/PaymentResponse.h: Changed create to call finishConstruction and
2110         made PaymentResponse an ActiveDOMObject instead of a ContextDestructionObserver.
2111         * testing/Internals.cpp:
2112         (WebCore::Internals::Internals): Changed to only create a MockPaymentCoordinator for main frames.
2113         (WebCore::Internals::mockPaymentCoordinator): Changed to get the MockPaymentCoordinator by
2114         downcasting the page's payment coordinator client.
2115         * testing/Internals.h:
2116         * testing/Internals.idl:
2117         * testing/MockPaymentCoordinator.cpp:
2118         (WebCore::MockPaymentCoordinator::completePaymentSession): Changed to only increment
2119         hideCount for final results.
2120         * testing/MockPaymentCoordinator.h:
2121         (isType): Added so that PaymentCoordinatorClients can be downcasted to MockPaymentCoordinators.
2122
2123 2018-10-30  Zalan Bujtas  <zalan@apple.com>
2124
2125         [iOS] Use the mainframe view size to compute window.outerWidth/height.
2126         https://bugs.webkit.org/show_bug.cgi?id=191070
2127         <rdar://problem/42368377>
2128
2129         Reviewed by Tim Horton.
2130
2131         Use a more reasonable value for window.outerWidth and height.
2132         (WKWebView's frame rect -> drawing area sizing -> WebPage's view size -> FrameView size)
2133
2134         * page/DOMWindow.cpp:
2135         (WebCore::DOMWindow::outerHeight const):
2136         (WebCore::DOMWindow::outerWidth const):
2137
2138 2018-10-30  Andy Estes  <aestes@apple.com>
2139
2140         [Apple Pay] PaymentRequest.canMakePayment() should resolve to true whenever Apple Pay is available
2141         https://bugs.webkit.org/show_bug.cgi?id=191039
2142
2143         Reviewed by Megan Gardner.
2144
2145         During a recent Web Payments WG F2F, we decided that canMakePayment() should return true
2146         whenever the user agent supports one or more of the specified payment methods, even if those
2147         payment methods do not have active instruments.
2148
2149         Change WebKit's implementation of canMakePayment() for Apple Pay to resolve with the value
2150         of ApplePaySession.canMakePayments() rather than ApplePaySession.canMakePaymentsWithActiveCard().
2151
2152         Added a test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
2153
2154         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2155         (WebCore::ApplePayPaymentHandler::canMakePayment):
2156         (WebCore::shouldDiscloseApplePayCapability): Deleted.
2157         * testing/MockPaymentCoordinator.cpp:
2158         (WebCore::MockPaymentCoordinator::canMakePayments):
2159         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
2160         * testing/MockPaymentCoordinator.h:
2161         * testing/MockPaymentCoordinator.idl:
2162
2163 2018-10-30  Sihui Liu  <sihui_liu@apple.com>
2164
2165         Add a deprecation warning to console for Web SQL
2166         https://bugs.webkit.org/show_bug.cgi?id=190936
2167
2168         Reviewed by Ryosuke Niwa.
2169
2170         No new tests. Just adding a console message.
2171
2172         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2173         (WebCore::DOMWindowWebDatabase::openDatabase):
2174
2175 2018-10-30  Sihui Liu  <sihui_liu@apple.com>
2176
2177         IndexedDB: iteration of cursors skip records if updated or deleted
2178         https://bugs.webkit.org/show_bug.cgi?id=190917
2179         <rdar://problem/35250410>
2180
2181         Reviewed by Chris Dumez.
2182
2183         When object store has changes, we cleared cached records and reset the SQLite statement, 
2184         updating the boundary to the next key in cursor's direction. Therefore, the cursor could 
2185         jump to the next key after update or deletion.
2186         We should cache those records before changing the statement.
2187
2188         Test: storage/indexeddb/cursor-update-while-iterating.html
2189
2190         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2191         (WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
2192         (WebCore::IDBServer::SQLiteIDBCursor::fetch):
2193         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2194
2195 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2196
2197         [LFC][IFC] Introduce InlineFormattingContextGeometry class
2198         https://bugs.webkit.org/show_bug.cgi?id=191054
2199
2200         Reviewed by Antti Koivisto.
2201
2202         This is in preparation for inline-block support.
2203
2204         Move float and inline-block elements layout to layoutFormattingContextRoot().
2205         computeWidthAndHeightForInlineBox takes care of replaced elements.
2206
2207         * Sources.txt:
2208         * WebCore.xcodeproj/project.pbxproj:
2209         * layout/inlineformatting/InlineFormattingContext.cpp:
2210         (WebCore::Layout::InlineFormattingContext::layout const):
2211         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2212         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
2213         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const): Deleted.
2214         * layout/inlineformatting/InlineFormattingContext.h:
2215         * layout/inlineformatting/InlineFormattingContextGeometry.cpp: Added.
2216         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2217         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2218
2219 2018-10-28  Antoine Quint  <graouts@apple.com>
2220
2221         [Web Animations] Implement the update animations and send events procedure
2222         https://bugs.webkit.org/show_bug.cgi?id=191013
2223         <rdar://problem/45620495>
2224
2225         Reviewed by Dean Jackson.
2226
2227         While we implemented the various parts of what the Web Animations specification refers to as the "update animations and send events"
2228         procedure, we did not implement it as one function and in the correct order, specifically updating animations and sending events in
2229         two separate tasks. We now have a single method on DocumentTimeline which runs as the DisplayRefreshMonitor fires to update each
2230         "relevant" animation with the current time, perform a microtask checkpoint and dispatch events.
2231
2232         Implementing this procedure allowed us to make several enhancements:
2233
2234         1. We introduce the concept of a "relevant" animation, which is essentially an animation that is either pending or playing. All animations
2235         in a different state are no longer owned by the DocumentTimeline and can thus be destroyed if the developer doesn't hold references in JS.
2236         Maintaining such a list guarantees that we're only updating animations that would have changed state since the last time the "update animations
2237         and send events" procedure was run. Note that DeclarativeAnimation instances are also considered to be relevant if they have queued DOM events
2238         to dispatch as they could otherwise be destroyed before they can fully dispatch them.
2239
2240         2. We no longer conflate the timing model and effects. Until now the way we would update animations was to go through all elements for which
2241         we had a registered animation, invalidate their style and finally forcing a style update on the document. We had a separate data structure where
2242         we help animations without targets so we update these as well in a separate pass, in order to make sure that promises and events would fire for
2243         them as expected. We now let the "update animations and send events" procedure update the timing of all relevant animations and let individual
2244         animation effects invalidate their style as needed, the document style invalidation happening naturally without DocumentTimeline forcing it. 
2245
2246         3. We use a single step to schedule the update of animations, which is to register for a display refresh monitor update provided a "relevant"
2247         animation is known since the previous update. Until now we first had an "timing model invalidation" task scheduled upon any change of an animation's
2248         timing model, which would then create a timer to the earliest moment any listed animation would require an update, finally registering a display
2249         refresh monitor update, which used at least GenericTaskQueue<Timer> and potentially two, whereas we use none right now.
2250
2251         4. We allow for a display refresh monitor update to be canceled should the number of "relevant" animations since the last update goes back to 0.
2252
2253         To facilitate all of this, we have changed the m_animations ListHashSet to contain only the "relevant" animations, and no longer every animation created
2254         that has this DocumentTimeline set as their "timeline" property. To keep this list current, every single change that changes a given animation's timing
2255         ends up calling AnimationTimeline::animationTimingDidChange() passing the animation as the sole parameter and adding this animation to m_animations. We
2256         immediately schedule a display refresh monitor update if one wasn't already scheduled. Then, when running the "update animations and send events"
2257         procedure, we call a new WebAnimation::tick() method on each of those animations, which updates this animation's effect and relevance, using the newly
2258         computed relevance to identify whether this animation should be kept in the m_animations ListHashSet.
2259
2260         This is only the first step towards a more efficient update and ownership model of animations by the document timeline since animations created as CSS
2261         Animations and CSS Transitions are committed through CSS have dedicated data structures that are not updated in this particular patch, but this will be
2262         addressed in a followup to keep this already significant patch smaller. Another issue that will be addressed later is the ability to not schedule display
2263         refresh monitor udpates when only accelerated animations are running.
2264
2265         * animation/AnimationTimeline.cpp:
2266         (WebCore::AnimationTimeline::animationTimingDidChange): Called by animations when any aspect of their timing model changes. The provided animation is then
2267         added to the m_animations list unless its timeline is no longer this timeline.
2268         (WebCore::AnimationTimeline::removeAnimation): Remove the provided animation from m_animations and remove any animation registered on the element-specific
2269         animation lists if this animation has an effect with a target.
2270         (WebCore::AnimationTimeline::animationWasAddedToElement): We no longer need to worry about the m_animationsWithoutTarget data structure since we removed it.
2271         (WebCore::removeCSSTransitionFromMap): Fix a bug where we would remove any CSSTransition in the provided map that had a matching transition-property instead
2272         of checking the CSSTransition registered for this transition-property was indeed the provided CSSTransition. The other code changes in this patch made this
2273         code now cause regressions in the Web Platform Tests.
2274         (WebCore::AnimationTimeline::animationWasRemovedFromElement): Stop updating m_animationsWithoutTarget since it no longer exists.
2275         (WebCore::AnimationTimeline::elementWasRemoved):
2276         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Fix a small error that caused a regression in the Web Platform Tests where we could attempt to
2277         call setBackingAnimation() on a nullptr instead of a valid CSSAnimation.
2278         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
2279         (WebCore::AnimationTimeline::addAnimation): Deleted.
2280         * animation/AnimationTimeline.h:
2281         (WebCore::AnimationTimeline::hasElementAnimations const): Deleted.
2282         (WebCore::AnimationTimeline:: const): Deleted.
2283         (WebCore::AnimationTimeline::elementToAnimationsMap): Deleted.
2284         (WebCore::AnimationTimeline::elementToCSSAnimationsMap): Deleted.
2285         (WebCore::AnimationTimeline::elementToCSSTransitionsMap): Deleted.
2286         * animation/CSSTransition.cpp:
2287         (WebCore::CSSTransition::canBeListed const): Deleted.
2288         * animation/CSSTransition.h:
2289         * animation/DeclarativeAnimation.cpp:
2290         (WebCore::DeclarativeAnimation::tick): Call the superclass's method and queue any necessary DOM events reflecting the timing model changes.
2291         (WebCore::DeclarativeAnimation::needsTick const): Call the superclass's method and return true also if we have pending events since otherwise this animation
2292         could be removed from m_animations on its AnimationTimeline and potentially destroyed before the GenericEventQueue had a chance to dispatch all events.
2293         (WebCore::DeclarativeAnimation::startTime const): We removed the custom binding for this IDL property and renamed the method from bindingsStartTime to startTime.
2294         (WebCore::DeclarativeAnimation::setStartTime): We removed the custom binding for this IDL property and renamed the method from setBindingsStartTime to setStartTime.
2295         (WebCore::DeclarativeAnimation::bindingsStartTime const): Deleted.
2296         (WebCore::DeclarativeAnimation::setBindingsStartTime): Deleted.
2297         * animation/DeclarativeAnimation.h:
2298         * animation/DocumentAnimationScheduler.cpp:
2299         (WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution): Add a method to mark that we no longer need a display refresh monitor update for this
2300         document's animation timeline. This is called when m_animations becomes empty.
2301         * animation/DocumentAnimationScheduler.h:
2302         * animation/DocumentTimeline.cpp:
2303         (WebCore::DocumentTimeline::DocumentTimeline):
2304         (WebCore::DocumentTimeline::detachFromDocument): Stop clearing two task queues and a timer that no longer exist and instead only clear the task queue to clear
2305         the cached current time, which we queue any time we generate a new one (see DocumentTimeline::currentTime).
2306         (WebCore::DocumentTimeline::getAnimations const): Use isRelevant() instead of canBeListed().
2307         (WebCore::DocumentTimeline::updateThrottlingState):
2308         (WebCore::DocumentTimeline::suspendAnimations):
2309         (WebCore::DocumentTimeline::resumeAnimations):
2310         (WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const):
2311         (WebCore::DocumentTimeline::currentTime): Queue a task in the new m_currentTimeClearingTaskQueue task queue to clear the current time that we've generated and cached
2312         in the next run loop (provided all pending JS execution has also completed). 
2313         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime):
2314         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Schedule a display refresh monitor update if we are not suspended and have "relevant" animations.
2315         (WebCore::DocumentTimeline::animationTimingDidChange): Call scheduleAnimationResolutionIfNeeded() after calling the superclass's implementation.
2316         (WebCore::DocumentTimeline::removeAnimation): Call unscheduleAnimationResolution() if the list of "relevant" animations is now empty.
2317         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Unschedule a pending display refresh monitor update.
2318         (WebCore::DocumentTimeline::animationResolutionTimerFired):
2319         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Implement the "update animations and send events" procedure as specified by the Web Animations spec.
2320         During this procedure, we call tick() on all animations listed in m_animations and create a list of animations to remove from that list if this animation is no
2321         longer relevant following the call to tick().
2322         (WebCore::DocumentTimeline::enqueueAnimationPlaybackEvent):
2323         (WebCore::DocumentTimeline::timingModelDidChange): Deleted.
2324         (WebCore::DocumentTimeline::scheduleInvalidationTaskIfNeeded): Deleted.
2325         (WebCore::DocumentTimeline::performInvalidationTask): Deleted.
2326         (WebCore::DocumentTimeline::updateAnimationSchedule): Deleted.
2327         (WebCore::DocumentTimeline::animationScheduleTimerFired): Deleted.
2328         (WebCore::DocumentTimeline::updateAnimations): Deleted.
2329         (WebCore::compareAnimationPlaybackEvents): Deleted.
2330         (WebCore::DocumentTimeline::performEventDispatchTask): Deleted.
2331         * animation/DocumentTimeline.h:
2332         * animation/WebAnimation.cpp: The majority of the changes to this class is that we call the new timingDidChange() method when any code that modifies the timing model
2333         is run. We also remove methods to set the pending play and pause tasks as well as the animation's start time and hold time since any time we're changing these instance
2334         variables, we later already have a call to update the timing model and we were doing more work than needed. As a result we no longer need an internal method to set the
2335         start time and can stop requiring a custom IDL binding for the "startTime" property.
2336         (WebCore::WebAnimation::effectTimingPropertiesDidChange):
2337         (WebCore::WebAnimation::setEffect):
2338         (WebCore::WebAnimation::setEffectInternal):
2339         (WebCore::WebAnimation::setTimeline):
2340         (WebCore::WebAnimation::setTimelineInternal):
2341         (WebCore::WebAnimation::startTime const):
2342         (WebCore::WebAnimation::setStartTime):
2343         (WebCore::WebAnimation::silentlySetCurrentTime):
2344         (WebCore::WebAnimation::setCurrentTime):
2345         (WebCore::WebAnimation::setPlaybackRate):
2346         (WebCore::WebAnimation::cancel):
2347         (WebCore::WebAnimation::resetPendingTasks):
2348         (WebCore::WebAnimation::finish):
2349         (WebCore::WebAnimation::timingDidChange): New method called any time a timing property changed where we run the "update the finished state" procedure and notify the
2350         animation's timeline that its timing changed so that it can be considered the next time the "update animations and send events" procedure runs.
2351         (WebCore::WebAnimation::invalidateEffect):
2352         (WebCore::WebAnimation::updateFinishedState): Update the animation's relevance after running the procedure as specified.
2353         (WebCore::WebAnimation::play):
2354         (WebCore::WebAnimation::runPendingPlayTask):
2355         (WebCore::WebAnimation::pause):
2356         (WebCore::WebAnimation::runPendingPauseTask):
2357         (WebCore::WebAnimation::needsTick const):
2358         (WebCore::WebAnimation::tick): New method called during the "update animations and send events" procedure where we run the "update the finished state" procedure and run
2359         the pending play and pause tasks.
2360         (WebCore::WebAnimation::resolve):
2361         (WebCore::WebAnimation::updateRelevance):
2362         (WebCore::WebAnimation::computeRelevance):
2363         (WebCore::WebAnimation::timingModelDidChange): Deleted.
2364         (WebCore::WebAnimation::setHoldTime): Deleted.
2365         (WebCore::WebAnimation::bindingsStartTime const): Deleted.
2366         (WebCore::WebAnimation::setBindingsStartTime): Deleted.
2367         (WebCore::WebAnimation::setTimeToRunPendingPlayTask): Deleted.
2368         (WebCore::WebAnimation::setTimeToRunPendingPauseTask): Deleted.
2369         (WebCore::WebAnimation::updatePendingTasks): Deleted.
2370         (WebCore::WebAnimation::timeToNextRequiredTick const): Deleted.
2371         (WebCore::WebAnimation::runPendingTasks): Deleted.
2372         (WebCore::WebAnimation::canBeListed const): Deleted.
2373         * animation/WebAnimation.h:
2374         (WebCore::WebAnimation::isRelevant const):
2375         (WebCore::WebAnimation::hasPendingPlayTask const):
2376         (WebCore::WebAnimation::isEffectInvalidationSuspended):
2377         * animation/WebAnimation.idl:
2378         * dom/Element.cpp:
2379         (WebCore::Element::getAnimations): Use isRelevant() instead of canBeListed().
2380
2381 2018-10-30  Youenn Fablet  <youenn@apple.com>
2382
2383         LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
2384         https://bugs.webkit.org/show_bug.cgi?id=191026
2385
2386         Reviewed by Eric Carlson.
2387
2388         Covered by updated test.
2389
2390         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
2391         (WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
2392
2393 2018-10-30  Claudio Saavedra  <csaavedra@igalia.com>
2394
2395         [GTK][WPE] Fixes to the PublicSuffix implementation
2396         https://bugs.webkit.org/show_bug.cgi?id=191031
2397
2398         Reviewed by Michael Catanzaro.
2399
2400         Covered by existing tests.
2401
2402         Downcase hostnames before passing it on to the underlying
2403         libsoup API. Special case localhost and fix a mixed-up
2404         libsoup GError checks. This fixes most of the failures.
2405
2406         * platform/soup/PublicSuffixSoup.cpp:
2407         (WebCore::isPublicSuffix):
2408         (WebCore::topPrivatelyControlledDomain):
2409
2410 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2411
2412         Missing from r237549
2413
2414         * layout/blockformatting/BlockFormattingContext.cpp:
2415         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
2416         (WebCore::Layout::hasPrecomputedMarginTop):
2417
2418 2018-10-29  Ross Kirsling  <ross.kirsling@sony.com>
2419
2420         Unreviewed speculative build fix for AppleWin after r237559.
2421
2422         * PlatformAppleWin.cmake:
2423
2424 2018-10-29  Justin Michaud  <justin_michaud@apple.com>
2425
2426         Revert r237347 registered custom properties... https://bugs.webkit.org/show_bug.cgi?id=190039
2427         https://bugs.webkit.org/show_bug.cgi?id=190919
2428
2429         Reviewed by Michael Saboff.
2430
2431         * css/CSSComputedStyleDeclaration.cpp:
2432         (WebCore::ComputedStyleExtractor::customPropertyValue):
2433         * css/CSSCustomPropertyValue.cpp:
2434         (WebCore::CSSCustomPropertyValue::customCSSText const):
2435         (WebCore::CSSCustomPropertyValue::tokens const):
2436         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
2437         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
2438         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
2439         (WebCore::CSSCustomPropertyValue::equals const): Deleted.
2440         * css/CSSCustomPropertyValue.h:
2441         * css/CSSRegisteredCustomProperty.cpp:
2442         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
2443         * css/CSSRegisteredCustomProperty.h:
2444         * css/CSSVariableData.cpp:
2445         (WebCore::CSSVariableData::consumeAndUpdateTokens):
2446         (WebCore::CSSVariableData::CSSVariableData):
2447         (WebCore::CSSVariableData::checkVariablesForCycles const):
2448         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
2449         (WebCore::CSSVariableData::resolveVariableFallback const):
2450         (WebCore::CSSVariableData::resolveVariableReference const):
2451         (WebCore::CSSVariableData::resolveVariableReferences const):
2452         (WebCore::CSSVariableData::resolveTokenRange const):
2453         * css/CSSVariableData.h:
2454         (WebCore::CSSVariableData::create):
2455         (WebCore::CSSVariableData::createResolved):
2456         (WebCore::CSSVariableData::needsVariableResolution const):
2457         (WebCore::CSSVariableData::CSSVariableData):
2458         * css/CSSVariableReferenceValue.cpp:
2459         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
2460         (WebCore::resolveVariableFallback): Deleted.
2461         (WebCore::resolveVariableReference): Deleted.
2462         (WebCore::resolveTokenRange): Deleted.
2463         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const): Deleted.
2464         * css/CSSVariableReferenceValue.h:
2465         (WebCore::CSSVariableReferenceValue::create):
2466         (WebCore::CSSVariableReferenceValue::variableDataValue const):
2467         (WebCore::CSSVariableReferenceValue::equals const):
2468         * css/DOMCSSRegisterCustomProperty.cpp:
2469         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2470         * css/PropertySetCSSStyleDeclaration.cpp:
2471         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
2472         * css/StyleBuilderCustom.h:
2473         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
2474         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
2475         * css/StyleProperties.cpp:
2476         (WebCore::MutableStyleProperties::setCustomProperty):
2477         * css/StyleProperties.h:
2478         * css/StyleResolver.cpp:
2479         (WebCore::StyleResolver::State::setStyle):
2480         (WebCore::StyleResolver::styleForKeyframe):
2481         (WebCore::StyleResolver::styleForPage):
2482         (WebCore::StyleResolver::applyMatchedProperties):
2483         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
2484         (WebCore::StyleResolver::applyProperty):
2485         (WebCore::StyleResolver::resolvedVariableValue const):
2486         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
2487         (WebCore::StyleResolver::CascadedProperties::Property::apply):
2488         (WebCore::StyleResolver::applyCascadedProperties):
2489         (WebCore::StyleResolver::applyCascadedCustomProperty): Deleted.
2490         * css/StyleResolver.h:
2491         * css/parser/CSSParser.cpp:
2492         (WebCore::CSSParser::parseValueWithVariableReferences):
2493         * css/parser/CSSParser.h:
2494         * css/parser/CSSPropertyParser.cpp:
2495         (WebCore::CSSPropertyParser::CSSPropertyParser):
2496         (WebCore::CSSPropertyParser::parseValueStart):
2497         (WebCore::CSSPropertyParser::parseSingleValue):
2498         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): Deleted.
2499         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): Deleted.
2500         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): Deleted.
2501         * css/parser/CSSPropertyParser.h:
2502         * css/parser/CSSVariableParser.cpp:
2503         (WebCore::CSSVariableParser::parseDeclarationValue):
2504         * dom/ConstantPropertyMap.cpp:
2505         (WebCore::ConstantPropertyMap::setValueForProperty):
2506         (WebCore::variableDataForPositivePixelLength):
2507         (WebCore::variableDataForPositiveDuration):
2508         * rendering/style/RenderStyle.cpp:
2509         (WebCore::RenderStyle::checkVariablesInCustomProperties):
2510         * rendering/style/RenderStyle.h:
2511         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
2512         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
2513         * rendering/style/StyleCustomPropertyData.h:
2514         (WebCore::StyleCustomPropertyData::operator== const):
2515         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
2516         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
2517
2518 2018-10-29  Youenn Fablet  <youenn@apple.com>
2519
2520         Handle MDNS resolution of candidates through libwebrtc directly
2521         https://bugs.webkit.org/show_bug.cgi?id=190681
2522
2523         Reviewed by Eric Carlson.
2524
2525         Remove the previous MDNS resolution mechanism.
2526         Instead, add support for the AsyncResolver mechanism added to libwebrtc.
2527         Covered by current mdns webrtc test that is unflaked.
2528
2529         * Modules/mediastream/PeerConnectionBackend.cpp:
2530         (WebCore::PeerConnectionBackend::addIceCandidate):
2531         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2532         (WebCore::LibWebRTCProvider::createPeerConnection):
2533         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2534         * testing/MockLibWebRTCPeerConnection.cpp:
2535         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
2536         * testing/MockLibWebRTCPeerConnection.h:
2537
2538 2018-10-29  Devin Rousso  <drousso@apple.com>
2539
2540         Web Inspector: increase size limits for NetworkResourceData
2541         https://bugs.webkit.org/show_bug.cgi?id=191034
2542         <rdar://problem/45529852>
2543
2544         Reviewed by Joseph Pecoraro.
2545
2546         No tests since no new functionality.
2547
2548         * inspector/NetworkResourcesData.cpp:
2549         All resources: 100MB => 200MB
2550         Each resource:  10MB =>  50MB
2551
2552 2018-10-29  Tim Horton  <timothy_horton@apple.com>
2553
2554         Modernize WebKit nibs and lprojs for localization's sake
2555         https://bugs.webkit.org/show_bug.cgi?id=190911
2556         <rdar://problem/45349466>
2557
2558         Reviewed by Dan Bernstein.
2559
2560         * PlatformGTK.cmake:
2561         * PlatformWPE.cmake:
2562         * PlatformWin.cmake:
2563         * WebCore.xcodeproj/project.pbxproj:
2564         * en.lproj/Localizable.strings: Renamed from Source/WebCore/English.lproj/Localizable.strings.
2565         * en.lproj/Localizable.stringsdict: Renamed from Source/WebCore/English.lproj/Localizable.stringsdict.
2566         * en.lproj/mediaControlsLocalizedStrings.js: Renamed from Source/WebCore/English.lproj/mediaControlsLocalizedStrings.js.
2567         * en.lproj/modern-media-controls-localized-strings.js: Renamed from Source/WebCore/English.lproj/modern-media-controls-localized-strings.js.
2568         English->en
2569
2570 2018-10-29  Tim Horton  <timothy_horton@apple.com>
2571
2572         Make FindOptionsShowOverlay work on iOS
2573         https://bugs.webkit.org/show_bug.cgi?id=190551
2574
2575         Reviewed by Andy Estes.
2576
2577         * platform/graphics/GraphicsContext.h:
2578         Export some more GraphicsContext methods.
2579
2580 2018-10-29  Youenn Fablet  <youenn@apple.com>
2581
2582         Invalid ssrc value in the stats of type 'inbound-rtp'
2583         https://bugs.webkit.org/show_bug.cgi?id=190826
2584         <rdar://problem/45487435>
2585
2586         Reviewed by Eric Carlson.
2587
2588         Value was not initialized in WebCore if missing from libwebrtc.
2589         Change value to an optional so that it will not appear if libwebrtc does not expose it.
2590         Move integer/boolean values from being initialized to be optional so
2591         that we do not expose them to JS if not exposed by libwebrtc.
2592
2593         Covered by updated tests.
2594
2595         * Modules/mediastream/RTCStatsReport.h:
2596
2597 2018-10-29  Jer Noble  <jer.noble@apple.com>
2598
2599         CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
2600         https://bugs.webkit.org/show_bug.cgi?id=190954
2601
2602         Reviewed by Simon Fraser.
2603
2604         Crash analyitics show that WebProcess will crash in ERROR_CGDataProvider_BufferIsNotBigEnough,
2605         which attempts to fetch the last byte in the image buffer in order to verify that the entire
2606         buffer is readable. Unfortunately, the stack trace generated by this crash does not identify
2607         what CGDataProvider is responsible for the not-big-enough buffer. In order to identify which
2608         CGDataProvider created by WebKit is responsible (if any), we will add our own version of
2609         ERROR_CGDataProvider_BufferIsNotBigEnough, called at CGDataProvider creation time, which should
2610         generate a crash within the responsible stack frame.
2611
2612         (This assumes that the issue is the wrong sized buffer at CGDataProvider creation time, and not
2613         that the buffer itself is reclaimed between creation time and access.)
2614
2615         * WebCore.xcodeproj/project.pbxproj:
2616         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2617         (WebCore::GraphicsContext3D::paintToCanvas):
2618         * platform/graphics/cg/ImageBufferCG.cpp:
2619         (WebCore::ImageBuffer::ImageBuffer):
2620         (WebCore::ImageBuffer::toCFData const):
2621         (WebCore::cfData):
2622         * platform/graphics/cocoa/WebGLLayer.mm:
2623         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
2624         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2625         (WebCore::CVPixelBufferGetBytePointerCallback):
2626         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
2627         * platform/graphics/cg/ImageUtilitiesCG.h: Added.
2628         (WebCore::verifyImageBufferIsBigEnough):
2629
2630 2018-10-29  David Kilzer  <ddkilzer@apple.com>
2631
2632         Fix clang static analyzer warning in StyleBuilderConverter.h
2633         <https://webkit.org/b/190907>
2634
2635         Reviewed by Antti Koivisto.
2636
2637         Fix the following clang static warning in StyleBuilderConverter.h:
2638             Value stored to 'autoFlow' during its initialization is never read
2639
2640         * css/StyleBuilderConverter.h:
2641         (WebCore::StyleBuilderConverter::convertGridAutoFlow): Move
2642         assignment of RenderStyle::initialGridAutoFlow() to `default`
2643         case.  Make `CSSValueDense` consistent with other cases by
2644         assigning value to `autoFlow` instead of returning early.
2645
2646 2018-10-29  Youenn Fablet  <youenn@apple.com>
2647
2648         Guard H264 simulcast with a runtime flag
2649         https://bugs.webkit.org/show_bug.cgi?id=191025
2650
2651         Reviewed by Eric Carlson.
2652
2653         Add a runtime flag for H264 simulcast and enable libwebrtc field trial based on it.
2654         Covered by existing test.
2655
2656         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2657         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
2658         * page/RuntimeEnabledFeatures.h:
2659         (WebCore::RuntimeEnabledFeatures::webRTCH264SimulcastEnabled const):
2660         (WebCore::RuntimeEnabledFeatures::setWebRTCH264SimulcastEnabled):
2661
2662 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2663
2664         [LFC][IFC] Compute estimated margin top for inline formatting root's ancestors
2665         https://bugs.webkit.org/show_bug.cgi?id=191018
2666
2667         Reviewed by Antti Koivisto.
2668
2669         <div><img style="float: left"></div>
2670         This inline formatting context (root -> div) inherits the floating context from the parent block formatting context.
2671         Floats are added to the floating context relative to the floating context's root. In order to position this float properly we
2672         need to precompute the ancestor's margin top (stop at the block formatting root boundary).
2673
2674         Test: fast/inline/simple-intruding-floats3.html
2675
2676         * layout/blockformatting/BlockFormattingContext.cpp:
2677         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
2678
2679 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2680
2681         [LFC] Add support for inflow non replaced content height when the box is an inline formatting root.
2682         https://bugs.webkit.org/show_bug.cgi?id=191011
2683
2684         Reviewed by Antti Koivisto.
2685
2686         // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
2687         // Height is the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
2688
2689         This is temporary until after inline runs transition to the display tree.
2690
2691         Test: fast/inline/simple-intruding-floats2.html
2692
2693         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2694         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2695         * layout/inlineformatting/InlineRun.h:
2696         (WebCore::Layout::InlineRun::logicalLeft const):
2697         (WebCore::Layout::InlineRun::logicalRight const):
2698         (WebCore::Layout::InlineRun::logicalTop const):
2699         (WebCore::Layout::InlineRun::logicalBottom const):
2700         (WebCore::Layout::InlineRun::width const):
2701         (WebCore::Layout::InlineRun::height const):
2702         (WebCore::Layout::InlineRun::setWidth):
2703         (WebCore::Layout::InlineRun::setLogicalLeft):
2704         (WebCore::Layout::InlineRun::setLogicalRight):
2705         (WebCore::Layout::InlineRun::moveHorizontally):
2706         (WebCore::Layout::InlineRun::InlineRun):
2707         * layout/inlineformatting/Line.cpp:
2708         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
2709
2710 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2711
2712         [LFC][IFC] Add support for simple intruding floats.
2713         https://bugs.webkit.org/show_bug.cgi?id=190998
2714
2715         Reviewed by Antti Koivisto.
2716
2717         In order to be able to figure out whether a float is intruding on a line, we need to provide the line's final vertical position.
2718         This vertical position must be in the same coordinate system as the float's position is. In case of intruding float,
2719         it is the parent block formatting root's coordinate system (that's where the float lives.)
2720
2721         Test: fast/inline/simple-intruding-float1.html
2722
2723         * layout/blockformatting/BlockFormattingContext.cpp:
2724         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2725         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
2726         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
2727         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2728         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2729         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2730         * layout/blockformatting/BlockFormattingContext.h:
2731         * layout/floats/FloatingState.cpp:
2732         (WebCore::Layout::FloatingState::constraints const):
2733
2734 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2735
2736         [LFC][IFC] Inline layout produces separate runs when float is present.
2737         https://bugs.webkit.org/show_bug.cgi?id=190980
2738
2739         Reviewed by Antti Koivisto.
2740
2741         <div>foo<img src="foobar.jpg" style="float: left">bar</div> produces 2 inline boxes (foo) and (bar) -> current inline code
2742         while it is really just one continuous run (foobar) -> LFC
2743         Adjust verification code to check for such runs.
2744
2745         * layout/Verification.cpp:
2746         (WebCore::Layout::checkForMatchingNonTextRuns):
2747         (WebCore::Layout::checkForMatchingTextRuns):
2748         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2749         * layout/inlineformatting/InlineRun.h:
2750         (WebCore::Layout::InlineRun::textContext const):
2751
2752 2018-10-29  Youenn Fablet  <youenn@apple.com>
2753
2754         [WebRTC] Enable VP8 by default
2755         https://bugs.webkit.org/show_bug.cgi?id=190672
2756         <rdar://problem/43663785>
2757
2758         Reviewed by Eric Carlson.
2759
2760         No change of behavior.
2761
2762         * page/RuntimeEnabledFeatures.h: Set default value to true.
2763
2764 2018-10-28  Andy Estes  <aestes@apple.com>
2765
2766         [Payment Request] Implement MerchantValidationEvent.methodName
2767         https://bugs.webkit.org/show_bug.cgi?id=190058
2768
2769         Reviewed by Darin Adler.
2770
2771         Implemented MerchantValidationEvent's methodName attribute and MerchantValidationEventInit's
2772         methodName property as specified in the Payment Request API W3C Editor's Draft of
2773         27 September 2018.
2774
2775         Covered by web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html.
2776
2777         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2778         (WebCore::ApplePayPaymentHandler::validateMerchant): Passed the payment method identifier
2779         (as a string) to MerchantValidationEvent::create()
2780         * Modules/paymentrequest/MerchantValidationEvent.cpp:
2781         (WebCore::MerchantValidationEvent::create): Validated the methodName before constructing the
2782         event, throwing a RangeError on failure.
2783         (WebCore::MerchantValidationEvent::MerchantValidationEvent):
2784         * Modules/paymentrequest/MerchantValidationEvent.h:
2785         * Modules/paymentrequest/MerchantValidationEvent.idl:
2786
2787 2018-10-27  Antoine Quint  <graouts@apple.com>
2788
2789         [Web Animations] Remove WebAnimation::description()
2790         https://bugs.webkit.org/show_bug.cgi?id=190995
2791
2792         Reviewed by Dean Jackson.
2793
2794         This method is never used.
2795
2796         * animation/WebAnimation.cpp:
2797         (WebCore::WebAnimation::description): Deleted.
2798         * animation/WebAnimation.h:
2799
2800 2018-10-27  Antoine Quint  <graouts@apple.com>
2801
2802         [Web Animations] Move the logic of Document::getAnimations() to DocumentTimeline
2803         https://bugs.webkit.org/show_bug.cgi?id=190994
2804
2805         Reviewed by Dean Jackson.
2806
2807         It would be cleaner to have the logic of document.getAnimations() on the DocumentTimeline instead of the Document, keep more
2808         animation-related code compartmentalized in the animation directory. No change in behavior, so no test update.
2809
2810         * animation/DocumentTimeline.cpp:
2811         (WebCore::DocumentTimeline::getAnimations const):
2812         * animation/DocumentTimeline.h:
2813         * dom/Document.cpp:
2814         (WebCore::Document::getAnimations):
2815
2816 2018-10-27  Antoine Quint  <graouts@apple.com>
2817
2818         [Web Animations] Move bindings methods requiring style flush from CSSAnimation to DeclarativeAnimation
2819         https://bugs.webkit.org/show_bug.cgi?id=190996
2820
2821         Reviewed by Dean Jackson.
2822
2823         Moving all of the IDL bindings methods that require flushing style from CSSAnimation to its superclass
2824         DeclarativeAnimation so we follow the same route in CSSTransition. Note that there was code in
2825         CSSAnimation::bindingsCurrentTime() that was not moved as it proved to not be necessary.
2826
2827         * animation/CSSAnimation.cpp:
2828         (WebCore::CSSAnimation::bindingsPlay):
2829         (WebCore::CSSAnimation::bindingsPause):
2830         (WebCore::CSSAnimation::bindingsStartTime const): Deleted.
2831         (WebCore::CSSAnimation::setBindingsStartTime): Deleted.
2832         (WebCore::CSSAnimation::bindingsCurrentTime const): Deleted.
2833         (WebCore::CSSAnimation::setBindingsCurrentTime): Deleted.
2834         (WebCore::CSSAnimation::bindingsPlayState const): Deleted.
2835         (WebCore::CSSAnimation::bindingsPending const): Deleted.
2836         (WebCore::CSSAnimation::bindingsReady): Deleted.
2837         (WebCore::CSSAnimation::bindingsFinished): Deleted.
2838         (WebCore::CSSAnimation::flushPendingStyleChanges const): Deleted.
2839         * animation/CSSAnimation.h:
2840         * animation/DeclarativeAnimation.cpp:
2841         (WebCore::DeclarativeAnimation::bindingsStartTime const):
2842         (WebCore::DeclarativeAnimation::setBindingsStartTime):
2843         (WebCore::DeclarativeAnimation::bindingsCurrentTime const):
2844         (WebCore::DeclarativeAnimation::setBindingsCurrentTime):
2845         (WebCore::DeclarativeAnimation::bindingsPlayState const):
2846         (WebCore::DeclarativeAnimation::bindingsPending const):
2847         (WebCore::DeclarativeAnimation::bindingsReady):
2848         (WebCore::DeclarativeAnimation::bindingsFinished):
2849         (WebCore::DeclarativeAnimation::bindingsPlay):
2850         (WebCore::DeclarativeAnimation::bindingsPause):
2851         (WebCore::DeclarativeAnimation::flushPendingStyleChanges const):
2852         * animation/DeclarativeAnimation.h:
2853
2854 2018-10-27  Charlie Turner  <cturner@igalia.com>
2855
2856         [EME] Add a logging macro
2857         https://bugs.webkit.org/show_bug.cgi?id=190984
2858
2859         Reviewed by Xabier Rodriguez-Calvar.
2860
2861         No tests since no new functionality.
2862
2863         * Modules/encryptedmedia/MediaKeySession.cpp:
2864         (WebCore::MediaKeySession::MediaKeySession):
2865         (WebCore::MediaKeySession::generateRequest):
2866         (WebCore::MediaKeySession::update):
2867         (WebCore::MediaKeySession::close):
2868         (WebCore::MediaKeySession::remove):
2869         (WebCore::MediaKeySession::sessionClosed):
2870         * Modules/encryptedmedia/MediaKeys.cpp:
2871         (WebCore::MediaKeys::createSession):
2872         * Modules/encryptedmedia/NavigatorEME.cpp:
2873         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
2874         * platform/Logging.h:
2875
2876 2018-10-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2877
2878         [GStreamer][EME] Post key received to bus should be done before waking up other threads
2879         https://bugs.webkit.org/show_bug.cgi?id=190822
2880
2881         Reviewed by Philippe Normand.
2882
2883         Notify after posting message to bus.
2884
2885         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2886         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
2887
2888 2018-10-27  Charlie Turner  <cturner@igalia.com>
2889
2890         Fix release build with -DLOG_DISABLED=0
2891         https://bugs.webkit.org/show_bug.cgi?id=190866
2892
2893         Reviewed by Xabier Rodriguez-Calvar.
2894
2895         No new tests since no functionality changed.
2896
2897         * platform/graphics/Font.cpp:
2898         * platform/graphics/Font.h:
2899         * platform/graphics/FontPlatformData.h:
2900         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2901         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2902         * platform/graphics/win/FontPlatformDataWin.cpp:
2903
2904 2018-10-26  Commit Queue  <commit-queue@webkit.org>
2905
2906         Unreviewed, rolling out r237458.
2907         https://bugs.webkit.org/show_bug.cgi?id=190973
2908
2909         broke internal iOS builds (Requested by zalan on #webkit).
2910
2911         Reverted changeset:
2912
2913         "Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
2914         https://bugs.webkit.org/show_bug.cgi?id=190951
2915         https://trac.webkit.org/changeset/237458
2916
2917 2018-10-26  Antoine Quint  <graouts@apple.com>
2918
2919         [Web Animations] Remove useless internals methods
2920         https://bugs.webkit.org/show_bug.cgi?id=190968
2921
2922         Reviewed by Dean Jackson.
2923
2924         We had a few internals methods added early on in the Web Animations implementation that are no longer
2925         relevant now that the full API is implemented. We can safely remove them now.
2926
2927         * animation/AnimationTimeline.cpp:
2928         (WebCore::AnimationTimeline::setCurrentTime): Deleted.
2929         (WebCore::AnimationTimeline::description): Deleted.
2930         * animation/AnimationTimeline.h:
2931         (WebCore::AnimationTimeline::currentTime):
2932         (WebCore::AnimationTimeline::pause): Deleted.
2933         * animation/DocumentTimeline.cpp:
2934         (WebCore::DocumentTimeline::currentTime):
2935         (WebCore::DocumentTimeline::pause): Deleted.
2936         * animation/DocumentTimeline.h:
2937         * testing/Internals.cpp:
2938         (WebCore::Internals::timelineDescription): Deleted.
2939         (WebCore::Internals::pauseTimeline): Deleted.
2940         (WebCore::Internals::setTimelineCurrentTime): Deleted.
2941         * testing/Internals.h:
2942         * testing/Internals.idl:
2943
2944 2018-10-26  Antoine Quint  <graouts@apple.com>
2945
2946         Web Inspector: Crash in http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html
2947         https://bugs.webkit.org/show_bug.cgi?id=190955
2948
2949         Reviewed by Dean Jackson.
2950
2951         We can get in situations when running tests where runtime flags are not consistent throughout the time a test is run since
2952         showing the Web Inspector can cause flags to be re-set after the initial test was loaded. As such, to avoid crashes due to
2953         the ASSERT(!frame().animation().hasAnimations()) in FrameView::didDestroyRenderTree(), we now cancel animations upon teardown
2954         no matter what the value of the runtime flag for the Web Animations CSS Integration on both the DocumentTimeline (if it exists)
2955         and the CSSAnimationController.
2956
2957         * dom/Element.cpp:
2958         (WebCore::Element::removedFromAncestor):
2959         * dom/PseudoElement.cpp:
2960         (WebCore::PseudoElement::clearHostElement):
2961         * page/FrameView.cpp:
2962         (WebCore::FrameView::didDestroyRenderTree):
2963         * rendering/updating/RenderTreeUpdater.cpp:
2964         (WebCore::RenderTreeUpdater::tearDownRenderers):
2965
2966 2018-10-26  Timothy Hatcher  <timothy@apple.com>
2967
2968         Use dark appearance scrollbar when page background is dark or document supports dark mode.
2969         https://bugs.webkit.org/show_bug.cgi?id=190937
2970         rdar://problem/41225839
2971
2972         Reviewed by Beth Dakin.
2973
2974         * page/FrameView.cpp:
2975         (WebCore::FrameView::useDarkAppearance const): Added. Ask the document.
2976         (WebCore::FrameView::paintScrollCorner): Set LocalDefaultSystemAppearance based
2977         on the scrollbar overlay style too.
2978         * page/FrameView.h:
2979         * platform/ScrollableArea.h:
2980         (WebCore::ScrollableArea::useDarkAppearance const): Added. Default to false.
2981         * platform/mac/ScrollAnimatorMac.mm:
2982         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Added.
2983         Ask the ScrollableArea if a dark appearance is desired.
2984
2985 2018-10-26  Antti Koivisto  <antti@apple.com>
2986
2987         Use random() instead of begin() to limit cache sizes
2988         https://bugs.webkit.org/show_bug.cgi?id=190957
2989
2990         Reviewed by Chris Dumez.
2991
2992         We currently use cache.remove(cache.begin()) pattern to limit sized of various caches.
2993         This is a bad pattern for tables that never rehash (because they have fixed maximum size) as most of the
2994         keys get permanently stuck in the table.
2995
2996         * css/CSSValuePool.cpp:
2997         (WebCore::CSSValuePool::createColorValue):
2998         (WebCore::CSSValuePool::createFontFamilyValue):
2999         (WebCore::CSSValuePool::createFontFaceValue):
3000         * dom/InlineStyleSheetOwner.cpp:
3001         (WebCore::InlineStyleSheetOwner::createSheet):
3002         * dom/SelectorQuery.cpp:
3003         * platform/graphics/FontCascade.cpp:
3004         (WebCore::retrieveOrAddCachedFonts):
3005         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3006         (WebCore::shouldAutoActivateFontIfNeeded):
3007         * platform/mac/PublicSuffixMac.mm:
3008         (WebCore::topPrivatelyControlledDomain):
3009
3010 2018-10-26  Jer Noble  <jer.noble@apple.com>
3011
3012         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
3013         https://bugs.webkit.org/show_bug.cgi?id=190951
3014         <rdar://problem/45213065>
3015
3016         Reviewed by Alex Christensen.
3017
3018         Request the correct route policy and context from the VideoFullscreenModel.
3019
3020         * platform/cocoa/VideoFullscreenModel.h:
3021         (WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID):
3022         * platform/cocoa/VideoFullscreenModelVideoElement.h:
3023         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
3024         (WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID):
3025         * platform/ios/VideoFullscreenInterfaceAVKit.h:
3026         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3027         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
3028         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
3029         (VideoFullscreenInterfaceAVKit::doSetup):
3030
3031 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3032
3033         [LFC][IFC] Add more inline information to outputLayoutTree
3034         https://bugs.webkit.org/show_bug.cgi?id=190945
3035
3036         Reviewed by Antti Koivisto.
3037
3038         * layout/layouttree/LayoutTreeBuilder.cpp:
3039         (WebCore::Layout::outputInlineRuns):
3040         (WebCore::Layout::outputLayoutBox):
3041
3042 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3043
3044         [LFC][IFC] Layout floats as part of the inline content
3045         https://bugs.webkit.org/show_bug.cgi?id=190942
3046
3047         Reviewed by Antti Koivisto.
3048
3049         Add float handling to InlineFormattingContext::layoutInlineContent.
3050         Note that floats don't actually generate inline runs.
3051
3052         Test: fast/block/basic/inline-content-with-floating-image.html
3053
3054         * layout/blockformatting/BlockFormattingContext.cpp:
3055         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3056         * layout/floats/FloatAvoider.cpp:
3057         (WebCore::Layout::FloatAvoider::FloatAvoider): Check if any mapping is needed.
3058         * layout/inlineformatting/InlineFormattingContext.cpp:
3059         (WebCore::Layout::isTrimmableContent):
3060         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3061         (WebCore::Layout::trimLeadingRun): Deleted.
3062         * layout/inlineformatting/InlineFormattingContext.h:
3063         (WebCore::Layout::InlineFormattingContext::Line::isClosed const):
3064         * layout/inlineformatting/Line.cpp:
3065         (WebCore::Layout::InlineFormattingContext::Line::init):
3066         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
3067         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
3068         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
3069         (WebCore::Layout::InlineFormattingContext::Line::close):
3070
3071 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3072
3073         [LFC][IFC] Adjust current line with float constraints.
3074         https://bugs.webkit.org/show_bug.cgi?id=190940
3075
3076         Reviewed by Antti Koivisto.
3077
3078         * layout/inlineformatting/InlineFormattingContext.cpp:
3079         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
3080         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3081         * layout/inlineformatting/InlineFormattingContext.h:
3082         * layout/inlineformatting/InlineRun.h:
3083         (WebCore::Layout::InlineRun::moveHorizontally):
3084         * layout/inlineformatting/Line.cpp:
3085         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
3086         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
3087
3088 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3089
3090         [LFC][IFC] Compute float box size and position
3091         https://bugs.webkit.org/show_bug.cgi?id=190938
3092
3093         Reviewed by Antti Koivisto.
3094
3095         * layout/inlineformatting/InlineFormattingContext.cpp:
3096         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const):
3097         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
3098         * layout/inlineformatting/InlineFormattingContext.h:
3099
3100 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3101
3102         [LFC][IFC] Add line logical top and bottom
3103         https://bugs.webkit.org/show_bug.cgi?id=190934
3104
3105         Reviewed by Antti Koivisto.
3106
3107         * layout/inlineformatting/InlineFormattingContext.cpp:
3108         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
3109         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3110         * layout/inlineformatting/InlineFormattingContext.h:
3111         (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const):
3112         (WebCore::Layout::InlineFormattingContext::Line::logicalTop const):
3113         (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const):
3114         * layout/inlineformatting/Line.cpp:
3115         (WebCore::Layout::InlineFormattingContext::Line::init):
3116         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight):
3117         (WebCore::Layout::InlineFormattingContext::Line::close):
3118
3119 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3120
3121         [LFC][IFC] Find floating constraints for a given vertical position
3122         https://bugs.webkit.org/show_bug.cgi?id=190928
3123
3124         Reviewed by Antti Koivisto.
3125
3126         https://www.w3.org/TR/CSS22/visuren.html#inline-formatting
3127
3128         "In general, the left edge of a line box touches the left edge of its containing block and the right edge touches the right edge of its containing block.
3129         However, floating boxes may come between the containing block edge and the line box edge.
3130         Thus, although line boxes in the same inline formatting context generally have the same width
3131         (that of the containing block), they may vary in width if available horizontal space is reduced due to floats."
3132
3133         This patch adds support for retrieving left/right constraints for a given line (vertical position).
3134
3135         * layout/floats/FloatingState.cpp:
3136         (WebCore::Layout::FloatingState::constraints const):
3137         * layout/floats/FloatingState.h:
3138
3139 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3140
3141         [LFC] Inline formatting context has higher priority than block
3142         https://bugs.webkit.org/show_bug.cgi?id=190924
3143
3144         Reviewed by Antti Koivisto.
3145
3146         When an element establishes both inline and block formatting contexts, we need to pick one to
3147         create (and we choose the content driven formatting type (inline)). See example below:
3148
3149         <div style="overflow: hidden">This text should be inside an inlines formatting context.</div>
3150
3151         * layout/LayoutContext.cpp:
3152         (WebCore::Layout::LayoutContext::formattingContext const):
3153
3154 2018-10-26  Ali Juma  <ajuma@chromium.org>
3155
3156         REGRESSION (r237255): Text selection is broken in form fields
3157         https://bugs.webkit.org/show_bug.cgi?id=190899
3158
3159         Reviewed by Ryosuke Niwa.
3160
3161         Fix missing negation when checking for a fully-clipped-out rect. This was causing
3162         RenderObject::computeVisibleRectInContainer to incorrectly early-out.
3163
3164         Test: fast/repaint/text-selection-overflow-hidden.html
3165
3166         * rendering/RenderObject.cpp:
3167         (WebCore::RenderObject::computeVisibleRectInContainer const):
3168
3169 2018-10-25  Chris Dumez  <cdumez@apple.com>
3170
3171         [PSON] Navigating cross-site with locked history but unlocked back/forward list fails to create a new BackForwardListItem
3172         https://bugs.webkit.org/show_bug.cgi?id=190915
3173         <rdar://problem/45059069>
3174
3175         Reviewed by Geoffrey Garen.
3176
3177         * history/PageCache.cpp:
3178         (WebCore::canCacheFrame):
3179         Make sure we do not put into PageCache a page whose main frame is showing the initial empty document.
3180         We usually do not try to put those into PageCache because we do not have a HistoryItem to save the
3181         PageCache entry on. However, when we process-swap on a navigation with the history locked, the new
3182         process has a HistoryItem and is initially showing the initial empty document before continuing
3183         the load from the previous process. Note that saving the initial empty document in PageCache would
3184         lead to crashes later on previous the initial empty document's Window is taken and reused for the
3185         next load.
3186
3187         * loader/FrameLoader.cpp:
3188         (WebCore::FrameLoader::load):
3189         Stop assuming that we're continuing a client-side redirect when lockHistory is Yes. It is
3190         lockBackForwardList that is actually Yes when we're doing a client-side redirect.
3191
3192         * loader/PolicyChecker.cpp:
3193         (WebCore::PolicyChecker::checkNavigationPolicy):
3194         Stop using calling the completion handler with an invalid URL when the policy decision is 'Suspend' and
3195         use 'about:blank' instead. Without this change, FrameLoader::continueLoadAfterNavigationPolicy() would
3196         not load 'about:blank' when its AllowNavigationToInvalidURL parameter is No.
3197
3198 2018-10-25  Devin Rousso  <drousso@apple.com>
3199
3200         Fix build after r237431 for platforms that don't support FULLSCREEN_API
3201
3202         Reviewed by Joseph Pecoraro.
3203
3204         No new tests. No change in behavior.
3205
3206         * inspector/agents/InspectorDOMAgent.cpp:
3207         (WebCore::InspectorDOMAgent::addEventListenersToNode):
3208
3209 2018-10-25  Devin Rousso  <drousso@apple.com>
3210
3211         Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls
3212         https://bugs.webkit.org/show_bug.cgi?id=189874
3213         <rdar://problem/44700000>
3214
3215         Reviewed by Joseph Pecoraro.
3216
3217         Updated existing test: http/tests/inspector/dom/didFireEvent.html
3218
3219         * inspector/agents/InspectorDOMAgent.h:
3220         * inspector/agents/InspectorDOMAgent.cpp:
3221         (WebCore::EventFiredCallback::handleEvent):
3222         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
3223         (WebCore::InspectorDOMAgent::addEventListenersToNode):
3224         (WebCore::InspectorDOMAgent::discardBindings):
3225         (WebCore::InspectorDOMAgent::eventDidResetAfterDispatch): Added.
3226         Prevent the same event from being sent to the frontend more than once.
3227
3228         * dom/Event.cpp:
3229         (WebCore::Event::resetAfterDispatch):
3230
3231         * dom/Document.cpp:
3232         (WebCore::Document::Document):
3233
3234         * inspector/InspectorInstrumentation.h:
3235         (WebCore::InspectorInstrumentation::eventDidResetAfterDispatch): Added.
3236         * inspector/InspectorInstrumentation.cpp:
3237         (WebCore::InspectorInstrumentation::eventDidResetAfterDispatchImpl): Added.
3238
3239 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3240
3241         Unreviewed, silence a -Wreturn-type warning
3242
3243         When every return is supposed to be covered by a switch statement, a release assert or CRASH
3244         is required by GCC.
3245
3246         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
3247         (WebCore::LibWebRTCCertificateGenerator::keyParamsFromCertificateType):
3248
3249 2018-10-25  Antoine Quint  <graouts@apple.com>
3250
3251         [Web Animations] Turn Web Animations CSS Integration off by default
3252         https://bugs.webkit.org/show_bug.cgi?id=190901
3253
3254         Reviewed by Dean Jackson.
3255
3256         * page/RuntimeEnabledFeatures.h:
3257
3258 2018-10-25  Jon Davis  <jond@apple.com>
3259
3260         Changed "Under Development" status to use "In Development" instead
3261         https://bugs.webkit.org/show_bug.cgi?id=187615
3262
3263         Reviewed by Joseph Pecoraro.
3264
3265         * features.json: Updated CSS Painting API Level 1 and CSS Properties and Values API Level 1.
3266
3267 2018-10-25  Chris Dumez  <cdumez@apple.com>
3268
3269         REGRESSION (236779) scandinaviandesigns.com product pages auto redirect to product image
3270         https://bugs.webkit.org/show_bug.cgi?id=190891
3271         <rdar://problem/45296796>
3272
3273         Reviewed by Antti Koivisto.
3274
3275         When a radio element gets clicked, we should only fire the 'input' and 'change' if the checked state
3276         of the radio element has changed.
3277
3278         Test: fast/dom/HTMLInputElement/radio-element-fires-change-event-only-when-checked-state-changes.html
3279
3280         * html/RadioInputType.cpp:
3281         (WebCore::RadioInputType::didDispatchClick):
3282
3283 2018-10-25  Joseph Pecoraro  <pecoraro@apple.com>
3284
3285         InspectorCanvas is not getting cleared properly for OffscreenCanvas
3286         https://bugs.webkit.org/show_bug.cgi?id=190894
3287         <rdar://problem/45498435>
3288
3289         Reviewed by Simon Fraser.
3290
3291         Covered by existing tests not crashing with guard malloc.
3292
3293         InspectorCanvasAgents tracks all CanvasRenderingContexts and needs to
3294         remove its reference when the containing CanvasBase goes away. It does
3295         this by registering as a notification observer, but if it can't map
3296         from the CanvasBase back to the rendering context we were failing to
3297         remove our reference. Enforce CanvasBase classes to notify observers
3298         of destruction while they still have their CanvasRenderingContext.
3299
3300         * html/CanvasBase.cpp:
3301         (WebCore::CanvasBase::~CanvasBase):
3302         (WebCore::CanvasBase::notifyObserversCanvasDestroyed):
3303         * html/CanvasBase.h:
3304         Assert that subclasses notify observers of the canvas being destroyed,
3305         since they will need to do this before m_context is cleared.
3306
3307         * html/CustomPaintCanvas.cpp:
3308         (WebCore::CustomPaintCanvas::~CustomPaintCanvas):
3309         * html/OffscreenCanvas.cpp:
3310         (WebCore::OffscreenCanvas::~OffscreenCanvas):
3311         Follow the new expected pattern of notifying observers before clearing
3312         the context. HTMLCanvasElement already followed this pattern.
3313
3314         * inspector/agents/InspectorCanvasAgent.cpp:
3315         (WebCore::InspectorCanvasAgent::canvasDestroyed):
3316         Add an assertion that would catch this earlier.
3317
3318 2018-10-24  Alexey Proskuryakov  <ap@apple.com>
3319
3320         Clean up some obsolete macOS version guards
3321         https://bugs.webkit.org/show_bug.cgi?id=190887
3322
3323         Reviewed by Dan Bernstein.
3324
3325         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3326         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
3327         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime const):
3328         (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const):
3329         (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
3330
3331 2018-10-24  Tim Horton  <timothy_horton@apple.com>
3332
3333         Attachment filenames with RTL characters should format similar to Finder
3334         https://bugs.webkit.org/show_bug.cgi?id=190736
3335         <rdar://problem/44735946>
3336
3337         Reviewed by Dan Bernstein.
3338
3339         Test: fast/attachment/attachment-title-with-rtl.html
3340
3341         * html/HTMLAttachmentElement.cpp:
3342         (WebCore::HTMLAttachmentElement::attachmentTitleForDisplay const):
3343         * html/HTMLAttachmentElement.h:
3344         Add attachmentTitleForDisplay(), which wraps the non-extension part of
3345         attachmentTitle in BiDi isolates, matching Finder's behavior.
3346
3347         * rendering/RenderThemeIOS.mm:
3348         (WebCore::RenderAttachmentInfo::buildWrappedLines):
3349         (WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
3350         * rendering/RenderThemeMac.mm:
3351         (WebCore::AttachmentLayout::layOutTitle):
3352         Adopt attachmentTitleForDisplay, and ask CoreText to use a subrange of
3353         the original string for the last line, instead of splitting the string
3354         ourselves. This ensures that BiDi control characters are respected
3355         even in the last line of the string.
3356
3357 2018-10-24  Megan Gardner  <megan_gardner@apple.com>
3358
3359         Turn on Conic Gradients
3360         https://bugs.webkit.org/show_bug.cgi?id=190810
3361
3362         Reviewed by Tim Horton.
3363
3364         Added tests previously, only switching feature from experimental to always avaiable.
3365
3366         * Configurations/FeatureDefines.xcconfig:
3367         * css/parser/CSSParserContext.cpp:
3368         (WebCore::CSSParserContext::CSSParserContext):
3369         (WebCore::operator==):
3370         * css/parser/CSSParserContext.h:
3371         (WebCore::CSSParserContextHash::hash):
3372         * css/parser/CSSPropertyParserHelpers.cpp:
3373         (WebCore::CSSPropertyParserHelpers::consumeConicGradient):
3374         * page/Settings.yaml:
3375
3376 2018-10-11  Jiewen Tan  <jiewen_tan@apple.com>
3377
3378         Only report resource timing to parent frame for the first iframe load
3379         https://bugs.webkit.org/show_bug.cgi?id=190498
3380         <rdar://problem/44347398>
3381
3382         Reviewed by Youenn Fablet.
3383
3384         Only the first iframe navigation or the first iframe navigation after about:blank should be reported.
3385         https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface
3386
3387         Test: http/tests/misc/resource-timing-navigation-in-restored-iframe.html
3388
3389         * loader/FrameLoader.cpp:
3390         (WebCore::FrameLoader::loadWithDocumentLoader):
3391         * loader/FrameLoader.h:
3392         (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
3393         (WebCore::FrameLoader::setShouldReportResourceTimingToParentFrame): Deleted.
3394         * loader/ResourceTimingInformation.cpp:
3395         (WebCore::ResourceTimingInformation::addResourceTiming):
3396
3397 2018-10-24  Brent Fulgham  <bfulgham@apple.com>
3398
3399         Cure Windows Direct2D Backend of a nasty case of bitrot
3400         https://bugs.webkit.org/show_bug.cgi?id=190875
3401         <rdar://problem/45523268>
3402         
3403         Reviewed by Zalan Bujtas.
3404
3405         The Direct2D backend has drifted out of date with the rest of WebKit.
3406         This patch updates things so we can get a runnable build.
3407         
3408         * platform/graphics/FontPlatformData.h:
3409         * platform/graphics/ImageBuffer.cpp:
3410         (WebCore::ImageBuffer::create):
3411         * platform/graphics/ImageBuffer.h:
3412         * platform/graphics/ImageDecoder.h:
3413         * platform/graphics/ImageSource.cpp:
3414         (WebCore::ImageSource::setTargetContext):
3415         * platform/graphics/opentype/OpenTypeMathData.cpp:
3416         (WebCore::OpenTypeMathData::OpenTypeMathData): Need non-default constructor to make Visual
3417         Studio happy.
3418         * platform/graphics/win/GradientDirect2D.cpp:
3419         (WebCore::Gradient::generateGradient):
3420         * platform/graphics/win/GraphicsContextDirect2D.cpp: Update for new display list implementation.
3421         (WebCore::GraphicsContextPlatformPrivate::setAlpha):
3422         (WebCore::GraphicsContext::savePlatformState):
3423         (WebCore::GraphicsContext::restorePlatformState):
3424         (WebCore::GraphicsContext::drawNativeImage):
3425         (WebCore::GraphicsContext::drawPattern):
3426         (WebCore::GraphicsContext::drawRect):
3427         (WebCore::GraphicsContext::drawLine):
3428         (WebCore::GraphicsContext::drawEllipse):
3429         (WebCore::GraphicsContext::drawPath):
3430         (WebCore::GraphicsContext::fillPath):
3431         (WebCore::GraphicsContext::strokePath):
3432         (WebCore::GraphicsContext::fillRect):
3433         (WebCore::GraphicsContext::platformFillRoundedRect):
3434         (WebCore::GraphicsContext::fillRectWithRoundedHole):
3435         (WebCore::GraphicsContext::clip):
3436         (WebCore::GraphicsContext::clipOut):
3437         (WebCore::GraphicsContext::clipPath):
3438         (WebCore::GraphicsContext::clipBounds const):
3439         (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
3440         (WebCore::GraphicsContext::endPlatformTransparencyLayer):
3441         (WebCore::GraphicsContext::setMiterLimit):
3442         (WebCore::GraphicsContext::clearRect):
3443         (WebCore::GraphicsContext::strokeRect):
3444         (WebCore::GraphicsContext::setLineCap):
3445         (WebCore::GraphicsContext::setLineDash):
3446         (WebCore::GraphicsContext::setLineJoin):
3447         (WebCore::GraphicsContext::scale):
3448         (WebCore::GraphicsContext::rotate):
3449         (WebCore::GraphicsContext::translate):
3450         (WebCore::GraphicsContext::concatCTM):
3451         (WebCore::GraphicsContext::setCTM):
3452         (WebCore::GraphicsContext::getCTM const):
3453         (WebCore::GraphicsContext::roundToDevicePixels):
3454         (WebCore::GraphicsContext::drawLinesForText):
3455         (WebCore::GraphicsContext::setURLForRect):
3456         (WebCore::GraphicsContext::setIsCALayerContext):
3457         (WebCore::GraphicsContext::isCALayerContext const):
3458         (WebCore::GraphicsContext::setIsAcceleratedContext):
3459         (WebCore::GraphicsContext::isAcceleratedContext const):
3460         (WebCore::GraphicsContext::setPlatformShouldAntialias):
3461         (WebCore::GraphicsContext::setPlatformShouldSmoothFonts):
3462         (WebCore::GraphicsContext::setPlatformCompositeOperation):
3463         (WebCore::GraphicsContext::platformFillEllipse):
3464         (WebCore::GraphicsContext::platformStrokeEllipse):
3465         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
3466         (WebCore::GraphicsLayer::create):
3467         (): Deleted.
3468         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
3469         (WebCore::ImageBufferData::putData):
3470         * platform/graphics/win/ImageBufferDataDirect2D.h:
3471         * platform/graphics/win/ImageBufferDirect2D.cpp:
3472         (WebCore::ImageBuffer::createCompatibleBuffer):
3473         (WebCore::ImageBuffer::ImageBuffer):
3474         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3475         (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties const):
3476         (WebCore::ImageDecoderDirect2D::encodedDataStatus const):
3477         (WebCore::ImageDecoderDirect2D::repetitionCount const):
3478         (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
3479         (WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
3480         (WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
3481         (WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
3482         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex):
3483         (WebCore::ImageDecoderDirect2D::setData):
3484         (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties): Deleted.
3485         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const): Deleted.
3486         * platform/graphics/win/ImageDecoderDirect2D.h:
3487         * platform/graphics/win/ImageDirect2D.cpp:
3488         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
3489         * platform/graphics/win/PatternDirect2D.cpp:
3490         (WebCore::Pattern::createPlatformPattern const):
3491
3492 2018-10-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
3493
3494         Cleanup: MIMETypeRegistry functions
3495         https://bugs.webkit.org/show_bug.cgi?id=190838
3496
3497         Reviewed by Simon Fraser.
3498
3499         Modernize the initialization of the lists in MIMETypeRegistry. Make the
3500         functions that return these list be self-contained. Use NeverDestroy<> to
3501         allocate the local static variable. Use std::initializer_list() and
3502         makeNeverDestroyed() to initialize NeverDestroy<> variables only once.
3503
3504         supportedImageResourceMIMETypes will be deleted and all the calls to it 
3505         will be replaced by supportedImageMIMETypes because they are identical.
3506
3507         * loader/archive/ArchiveFactory.cpp:
3508         (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): This function
3509         is called while initializing the supportedNonImageMIMETypes(). So it
3510         should not have a direct call to it. Instead, supportedNonImageMIMETypes
3511         is passed to it.
3512         * loader/archive/ArchiveFactory.h:
3513         * platform/MIMETypeRegistry.cpp:
3514         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
3515         (WebCore::supportedImageMIMETypesForEncoding):
3516         (WebCore::supportedJavaScriptMIMETypes):
3517         (WebCore::MIMETypeRegistry::supportedNonImageMIMETypes):
3518         (WebCore::MIMETypeRegistry::supportedMediaMIMETypes):
3519         (WebCore::pdfMIMETypes):
3520         (WebCore::MIMETypeRegistry::unsupportedTextMIMETypes):
3521         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
3522         (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding):
3523         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
3524         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
3525         (WebCore::MIMETypeRegistry::isSupportedMediaMIMEType):
3526         (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
3527         (WebCore::MIMETypeRegistry::isPDFMIMEType):
3528         (WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
3529         (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType):
3530         (WebCore::initializeSupportedImageMIMETypes): Deleted.
3531         (WebCore::initializeSupportedImageMIMETypesForEncoding): Deleted.
3532         (WebCore::initializeSupportedJavaScriptMIMETypes): Deleted.
3533         (WebCore::initializePDFMIMETypes): Deleted.
3534         (WebCore::initializeSupportedNonImageMimeTypes): Deleted.
3535         (WebCore::initializeSupportedMediaMIMETypes): Deleted.
3536         (WebCore::initializeUnsupportedTextMIMETypes): Deleted.
3537         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Deleted.
3538         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Deleted.
3539         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
3540         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Deleted.
3541         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Deleted.
3542         (WebCore::MIMETypeRegistry::getPDFMIMETypes): Deleted.
3543         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Deleted.
3544         (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes): Deleted.
3545         * platform/MIMETypeRegistry.h:
3546         * platform/graphics/Image.cpp:
3547         (WebCore::Image::supportsType):
3548         * platform/graphics/cg/ImageDecoderCG.cpp:
3549         (WebCore::ImageDecoderCG::encodedDataStatus const):
3550         * platform/graphics/cg/UTIRegistry.cpp:
3551         (WebCore::supportedDefaultImageSourceTypes):
3552         (WebCore::isSupportImageSourceType):
3553         (WebCore::allowedImageUTIs): Deleted.
3554         (WebCore::isAllowedImageUTI): Deleted.
3555         * platform/graphics/cg/UTIRegistry.h:
3556         * platform/mac/PasteboardMac.mm:
3557         (WebCore::Pasteboard::write):
3558
3559 2018-10-24  Chris Dumez  <cdumez@apple.com>
3560
3561         [PSON] When navigating back and forth, 'about:blank' shows up in the back/forward list
3562         https://bugs.webkit.org/show_bug.cgi?id=190846
3563         <rdar://problem/45058938>
3564
3565         Reviewed by Antti Koivisto.
3566
3567         When a page gets suspended after a process-swap, we navigate it to about:blank from inside the navigation
3568         policy handler, by overriding the request URL. This normally works fine because we usually process-swap
3569         on standard navigation. However, when we would process-swap on a back/forward navigation, we would end
3570         up using the back/forward navigation load type to do the about:blank load. This would have repercussions
3571         because history navigations update the current history item with the new URL (in this case 'about:blank').
3572         To avoid the issue, switch to a standard load type whenever the client asks us to suspend and we load
3573         'about:blank' as a result.
3574
3575         * loader/FrameLoader.cpp:
3576         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
3577
3578 2018-10-24  Andy Estes  <aestes@apple.com>
3579
3580         [macOS Debug WK2] Layout Test http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html is a flaky failure
3581         https://bugs.webkit.org/show_bug.cgi?id=190650
3582         <rdar://problem/45341914>
3583
3584         Reviewed by Alex Christensen.
3585
3586         In computeErrors, we intend to ignore errors when computing paymentMethodErrors. But we
3587         weren't clearing exceptions generated from calling convert(), so they would end up being
3588         logged as unhandled promise rejections.
3589
3590         Changed ApplePayPaymentHandler::computeErrors() to use a CatchScope to clear exceptions when
3591         decoding paymentMethodErrors.
3592
3593         Also changed ApplePayShippingAddressChangeEventErrorsV3.https.html to catch promise
3594         rejections from calling PaymentRequest.abort().
3595
3596         Covered by existing test.
3597
3598         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3599         (WebCore::ApplePayPaymentHandler::computeErrors const):
3600
3601 2018-10-22  Antti Koivisto  <antti@apple.com>
3602
3603         topPrivatelyControlledDomain is slow
3604         https://bugs.webkit.org/show_bug.cgi?id=190792
3605
3606         Reviewed by Alex Christensen and Chris Dumez.
3607
3608         It calls into some slowish CFNetwork code and ends up showing up in profiles.
3609
3610         * platform/mac/PublicSuffixMac.mm:
3611         (WebCore::topPrivatelyControlledDomain):
3612
3613         Add a cache that avoids calls into frameworks.
3614
3615 2018-10-22  Jer Noble  <jer.noble@apple.com>
3616
3617         Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC
3618         https://bugs.webkit.org/show_bug.cgi?id=190790
3619
3620         Reviewed by Alex Christensen.
3621
3622         Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by
3623         MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created
3624         the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make 
3625         GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making 
3626         incrementing the pending task count atomic.
3627
3628         * platform/GenericTaskQueue.cpp:
3629         (WebCore::TaskDispatcher<Timer>::postTask):
3630         (WebCore::TaskDispatcher<Timer>::sharedLock):
3631         (WebCore::TaskDispatcher<Timer>::sharedTimerFired):
3632         (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
3633         (WebCore::TaskDispatcher<Timer>::pendingDispatchers):
3634         * platform/GenericTaskQueue.h:
3635         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3636         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3637         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
3638         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
3639         (-[WebCoreAVFMovieObserver initWithPlayer:]):
3640         (-[WebCoreAVFMovieObserver disconnect]):
3641         (-[WebCoreAVFMovieObserver metadataLoaded]):
3642         (-[WebCoreAVFMovieObserver didEnd:]):
3643         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3644         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
3645         (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
3646         (-[WebCoreAVFLoaderDelegate initWithPlayer:]):
3647         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
3648         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
3649         (-[WebCoreAVFPullDelegate initWithPlayer:]):
3650         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
3651         (-[WebCoreAVFMovieObserver initWithCallback:]): Deleted.
3652         (-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted.
3653         (-[WebCoreAVFLoaderDelegate setCallback:]): Deleted.
3654         (-[WebCoreAVFPullDelegate initWithCallback:]): Deleted.
3655         (-[WebCoreAVFPullDelegate setCallback:]): Deleted.
3656
3657 2018-10-23  Jer Noble  <jer.noble@apple.com>
3658
3659         TextTrack cues should be updated more often than every 250ms.
3660         https://bugs.webkit.org/show_bug.cgi?id=190827
3661
3662         Reviewed by Eric Carlson.
3663
3664         Test: media/track/track-cue-timing.html
3665
3666         TextTracks cues are recalculated on the playback timer, which fires at least every 250ms.
3667         In addition to this timer, add a method to MediaPlayer to provide a task which will be
3668         performed at a particular media time, and use this new method to request cues be updated
3669         at the next interesting media time. The next interesting time would be either when the
3670         soonest current cue will end, or when the next non-current cue will start, whichever is
3671         earlier.
3672
3673         (Determining the "next non-current cue" requires new API on PODIntervalTree, as that class
3674         does not have iterators per-se.)
3675
3676         * html/HTMLMediaElement.cpp:
3677         (WebCore::compareCueIntervalEndTime):
3678         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
3679         * platform/PODIntervalTree.h:
3680         * platform/graphics/MediaPlayer.cpp:
3681         (WebCore::MediaPlayer::performTaskAtMediaTime):
3682         * platform/graphics/MediaPlayer.h:
3683         * platform/graphics/MediaPlayerPrivate.h:
3684         (WebCore::MediaPlayerPrivateInterface::performTaskAtMediaTime):
3685         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3686         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3687         (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):
3688         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3689         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3690         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
3691
3692 2018-10-23  Fujii Hironori  <Hironori.Fujii@sony.com>
3693
3694         [Win] Assertion fails while destructing local static AtomicString of FontCache::lastResortFallbackFont
3695         https://bugs.webkit.org/show_bug.cgi?id=190748
3696
3697         Reviewed by Myles C. Maxfield.
3698
3699         FontCache::lastResortFallbackFont had local static AtomicString
3700         variables which are not capsuled by NeverDestroyed. Hence, those
3701         variables are destructed on IPC thread when WebProcess exits.
3702
3703         Changed those AtomicString to NeverDestroyed<AtomicString> not to
3704         be destructed on exit.
3705
3706         This change can't be tested automatically because WebKitTestRunner
3707         doesn't support Windows port yet.
3708
3709         * platform/graphics/win/FontCacheWin.cpp:
3710         (WebCore::FontCache::lastResortFallbackFont): Changed
3711         fallbackFonts's type from AtomicString array to
3712         NeverDestroyed<AtomicString> array.
3713
3714 2018-10-23  Justin Fan  <justin_fan@apple.com>
3715
3716         [WebGPU] Rename old GPU* implementation files to GPULegacy* for WebMetal
3717         https://bugs.webkit.org/show_bug.cgi?id=190817
3718
3719         Reviewed by Dean Jackson.
3720
3721         No new tests. No change in behavior.
3722
3723         * [Large list of refactored classes and renamed files]: GPU* is now GPULegacy*
3724
3725 2018-10-23  Ryan Haddad  <ryanhaddad@apple.com>
3726
3727         Unreviewed, rolling out r237261.
3728
3729         The layout test for this change crashes under GuardMalloc.
3730
3731         Reverted changeset:
3732
3733         "Handle MDNS resolution of candidates through libwebrtc
3734         directly"
3735         https://bugs.webkit.org/show_bug.cgi?id=190681
3736         https://trac.webkit.org/changeset/237261
3737
3738 2018-10-23  Truitt Savell  <tsavell@apple.com>
3739
3740         Unreviewed, rolling out r237357.
3741
3742         API test is now failing on all platforms.
3743
3744         Reverted changeset:
3745
3746         "topPrivatelyControlledDomain is slow"
3747         https://bugs.webkit.org/show_bug.cgi?id=190792
3748         https://trac.webkit.org/changeset/237357
3749
3750 2018-10-23  Truitt Savell  <tsavell@apple.com>
3751
3752         Unreviewed, rolling out r237350.
3753
3754         Caused several Crashes cross multiple tests and platforms.
3755
3756         Reverted changeset:
3757
3758         "Use WeakPtr and GenericTaskQueue within ObjC classes used by
3759         MediaPlayerPrivateAVFoundationObjC"
3760         https://bugs.webkit.org/show_bug.cgi?id=190790
3761         https://trac.webkit.org/changeset/237350
3762
3763 2018-10-23  Ryan Haddad  <ryanhaddad@apple.com>
3764
3765         Unreviewed, rolling out r237280.
3766
3767         Causes fast/box-shadow/box-shadow-with-zero-radius.html to
3768         fail on iOS Simulator.
3769
3770         Reverted changeset:
3771
3772         "[CG] Adopt CG SPI for non-even cornered rounded rects"
3773         https://bugs.webkit.org/show_bug.cgi?id=190155
3774         https://trac.webkit.org/changeset/237280
3775
3776 2018-10-23  Antti Koivisto  <antti@apple.com>
3777
3778         topPrivatelyControlledDomain is slow
3779         https://bugs.webkit.org/show_bug.cgi?id=190792
3780
3781         Reviewed by Alex Christensen.
3782
3783         It calls into some slowish CFNetwork code and ends up showing up in profiles.
3784
3785         * platform/mac/PublicSuffixMac.mm:
3786         (WebCore::topPrivatelyControlledDomain):
3787
3788         Add a cache that avoids calls into frameworks.
3789
3790 2018-10-23  Chris Dumez  <cdumez@apple.com>
3791
3792         [PSON] Add support for cross-site client-side redirects
3793         https://bugs.webkit.org/show_bug.cgi?id=190806
3794         <rdar://problem/45047344>
3795
3796         Reviewed by Geoffrey Garen.
3797
3798         Add support for cross-site client-side redirects so that it swaps process and so that the back
3799         forward list looks as expected. To support this, the following changes had to be done:
3800         - The NavigationAction now provides additional information so that the WebProcess can communicate
3801           things about the client-side redirect to the UIProcess: lockHistory / lockBackForwardList and
3802           clientRedirectSourceForHistory.
3803         - If the UIProcess decides to process-swap on a client-side redirect, we pass the client-side
3804           redirect information to the new WebContent process via LoadRequest struct. WebCore then takes
3805           care of setting things up using this information so that it recognizes that it is continuing
3806           a load that is a client side redirect.
3807         - We also need to pass the current BackForwardListItem / HistoryItem to the new WebContent
3808           process so that the new process can truly lock history and keep updating the *current*
3809           HistoryItem, instead of creating a new HistoryItem.
3810         - After a process swap, when we re-construct the WebFrameProxy for the main frame in the new
3811           process, we now set the frame's URL in the UIProcess to the URL it had before we swapped.
3812           Clients such as Safari, rely on the main frame's URL being the expected value (the last
3813           committed load URL) until the next load is committed when receiving didPerformRedirect
3814           calls. Because we are destroying the main frame on process-swapping, we were losing the
3815           last committed URL and Safari would hit assertions.
3816
3817         With this model, the willPerformClientRedirect IPC is still sent from the previous WebProcess
3818         and the didPerformClientRedirect IPC is now sent by the new WebProcess. No change should be
3819         observable from the client's point of view.
3820
3821         * loader/FrameLoadRequest.h:
3822         (WebCore::FrameLoadRequest::setLockHistory):
3823         (WebCore::FrameLoadRequest::setlockBackForwardList):
3824         (WebCore::FrameLoadRequest::clientRedirectSourceForHistory const):
3825         (WebCore::FrameLoadRequest::setClientRedirectSourceForHistory):
3826         * loader/FrameLoader.cpp:
3827         (WebCore::FrameLoader::loadURL):
3828         (WebCore::FrameLoader::load):
3829         * loader/HistoryController.cpp:
3830         (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
3831         * loader/HistoryController.h:
3832         * loader/NavigationAction.h:
3833         (WebCore::NavigationAction::lockHistory const):
3834         (WebCore::NavigationAction::setLockHistory):
3835         (WebCore::NavigationAction::lockBackForwardList const):
3836         (WebCore::NavigationAction::setLockBackForwardList):
3837
3838 2018-10-23  Jer Noble  <jer.noble@apple.com>
3839
3840         Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC
3841         https://bugs.webkit.org/show_bug.cgi?id=190790
3842
3843         Reviewed by Alex Christensen.
3844
3845         Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by
3846         MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created
3847         the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make 
3848         GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making 
3849         incrementing the pending task count atomic.
3850
3851         * platform/GenericTaskQueue.cpp:
3852         (WebCore::TaskDispatcher<Timer>::postTask):
3853         (WebCore::TaskDispatcher<Timer>::sharedLock):
3854         (WebCore::TaskDispatcher<Timer>::sharedTimerFired):
3855         (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
3856         (WebCore::TaskDispatcher<Timer>::pendingDispatchers):
3857         * platform/GenericTaskQueue.h:
3858         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3859         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3860         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
3861         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
3862         (-[WebCoreAVFMovieObserver initWithPlayer:]):
3863         (-[WebCoreAVFMovieObserver disconnect]):
3864         (-[WebCoreAVFMovieObserver metadataLoaded]):
3865         (-[WebCoreAVFMovieObserver didEnd:]):
3866         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3867         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
3868         (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
3869         (-[WebCoreAVFLoaderDelegate initWithPlayer:]):
3870         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
3871         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
3872         (-[WebCoreAVFPullDelegate initWithPlayer:]):
3873         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
3874         (-[WebCoreAVFMovieObserver initWithCallback:]): Deleted.
3875         (-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted.
3876         (-[WebCoreAVFLoaderDelegate setCallback:]): Deleted.
3877         (-[WebCoreAVFPullDelegate initWithCallback:]): Deleted.
3878         (-[WebCoreAVFPullDelegate setCallback:]): Deleted.
3879
3880 2018-10-22  Justin Michaud  <justin_michaud@apple.com>
3881
3882         Registered custom properties should support syntax parameter for <length> and *
3883         https://bugs.webkit.org/show_bug.cgi?id=190039
3884
3885         Reviewed by Antti Koivisto.
3886