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