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