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