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