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