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