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