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