Add support for reporting "display composited video frames" through the VideoPlayback...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-10-03  Jer Noble  <jer.noble@apple.com>
2
3         Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
4         https://bugs.webkit.org/show_bug.cgi?id=190266
5
6         Reviewed by Eric Carlson.
7
8         Test: TestWebKitAPI.VideoQualityDisplayCompositing
9
10         Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
11         constructor (rather than individual fields). Add a new setting to control visibility
12         of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
13         for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
14
15         * Modules/mediasource/VideoPlaybackQuality.cpp:
16         (WebCore::VideoPlaybackQuality::create):
17         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
18         * Modules/mediasource/VideoPlaybackQuality.h:
19         (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
20         * Modules/mediasource/VideoPlaybackQuality.idl:
21         * html/HTMLMediaElement.cpp:
22         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
23         * html/HTMLMediaElement.h:
24         * html/HTMLMediaElement.idl:
25         * page/Settings.yaml:
26         * platform/graphics/MediaPlayer.h:
27         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
28         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
29         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
30         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
31         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
32         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
33         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
34
35 2018-10-05  Ryan Haddad  <ryanhaddad@apple.com>
36
37         Unreviewed, rolling out r236866.
38
39         Breaks internal builds.
40
41         Reverted changeset:
42
43         "Add support for reporting "display composited video frames"
44         through the VideoPlaybackQuality object."
45         https://bugs.webkit.org/show_bug.cgi?id=190266
46         https://trac.webkit.org/changeset/236866
47
48 2018-10-05  Antoine Quint  <graouts@apple.com>
49
50         [Web Animations] REGRESSION (r236809): crash under AnimationTimeline::updateCSSAnimationsForElement()
51         https://bugs.webkit.org/show_bug.cgi?id=190307
52         <rdar://problem/45009901>
53
54         Reviewed by Dean Jackson.
55
56         We could crash with an invalid access to cssAnimationsByName since cancelOrRemoveDeclarativeAnimation() already
57         does the job of clearing the m_elementToCSSAnimationByName entry for this particular element if there are no
58         animations targeting it anymore. This started happening in r236809 when we switched from a simple call to to cancel()
59         to a call to cancelOrRemoveDeclarativeAnimation(). We can safely remove the removal here since cancelOrRemoveDeclarativeAnimation()
60         will already have performed this task safely if needed.
61
62         * animation/AnimationTimeline.cpp:
63         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
64
65 2018-10-04  Jer Noble  <jer.noble@apple.com>
66
67         Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
68         https://bugs.webkit.org/show_bug.cgi?id=190266
69
70         Reviewed by Eric Carlson.
71
72         Test: TestWebKitAPI.VideoQualityDisplayCompositing
73
74         Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
75         constructor (rather than individual fields). Add a new setting to control visibility
76         of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
77         for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
78
79         * Modules/mediasource/VideoPlaybackQuality.cpp:
80         (WebCore::VideoPlaybackQuality::create):
81         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
82         * Modules/mediasource/VideoPlaybackQuality.h:
83         (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
84         * Modules/mediasource/VideoPlaybackQuality.idl:
85         * html/HTMLMediaElement.cpp:
86         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
87         * html/HTMLMediaElement.h:
88         * html/HTMLMediaElement.idl:
89         * page/Settings.yaml:
90         * platform/graphics/MediaPlayer.h:
91         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
92         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
93         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
94         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
95         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
96         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
97         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
98
99 2018-10-04  Chris Dumez  <cdumez@apple.com>
100
101         A Document / Window should lose its browsing context as soon as its iframe is removed from the document
102         https://bugs.webkit.org/show_bug.cgi?id=190282
103
104         Reviewed by Ryosuke Niwa.
105
106         A Document / Window should lose its browsing context (aka Frame) as soon as its iframe is removed from
107         the document. In WebKit, a Document / Window's Frame was only getting nulled out when the frame gets
108         destroyed, which happens later usually after a GC happens.
109
110         Specification:
111         - https://html.spec.whatwg.org/#the-iframe-element
112         """
113         When an iframe element is removed from a document, the user agent must discard the element's nested browsing
114         context, if it is not null, and then set the element's nested browsing context to null.
115         """
116
117         This was not consistent with the specification or other browsers (tested Chrome and Firefox) so this
118         patch is aligning our behavior.
119
120         In a follow-up, I am planning to look into making the Window not be a FrameDestructionObserver, and instead
121         get its frame from the Document. This should make the code simpler.
122
123         No new tests, rebaselined existing tests.
124
125         * Modules/mediastream/MediaDevices.cpp:
126         (WebCore::MediaDevices::getUserMedia const):
127         * Modules/mediastream/MediaDevices.h:
128         Update getUserMedia() to reject a the Promise with an InvalidStateError when calling after the
129         document has been detached, instead of throwing an InvalidStateError. This behavior is as per
130         specification:
131         - https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia (Step 4)
132         I needed to make this change to keep one of our layout tests passing.
133
134         * dom/Document.cpp:
135         (WebCore::Document::attachToCachedFrame):
136         (WebCore::Document::detachFromFrame):
137         * dom/Document.h:
138         * page/DOMWindow.cpp:
139         (WebCore::DOMWindow::didSecureTransitionTo):
140         (WebCore::DOMWindow::willDetachDocumentFromFrame):
141         (WebCore::DOMWindow::setStatus):
142         (WebCore::DOMWindow::detachFromFrame):
143         (WebCore::DOMWindow::attachToFrame):
144         * page/DOMWindow.h:
145         * page/DOMWindowProperty.cpp:
146         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
147         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
148         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
149         * page/Frame.cpp:
150         (WebCore::Frame::disconnectOwnerElement):
151
152         * platform/mock/MockRealtimeVideoSource.cpp:
153         (WebCore::MockRealtimeVideoSource::drawText):
154         Calling drawText() with a null String hits an assertion in debug. This was triggered by one of
155         our layout tests so I made sure we only call drawText when the String is not null.
156
157 2018-10-04  Jeremy Jones  <jeremyj@apple.com>
158
159         Unify implementation in VideoFullscreenInterfaceAVKit
160         https://bugs.webkit.org/show_bug.cgi?id=190091
161         rdar://problem/44734523
162
163         Reviewed by Jer Noble.
164
165         No new tests because no behavior change.
166
167         Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
168         any changes that had been made in the old path.
169
170         * platform/ios/VideoFullscreenInterfaceAVKit.h:
171         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
172         (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
173         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
174         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
175         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
176         (VideoFullscreenControllerContext::requestUpdateInlineRect):
177         (VideoFullscreenControllerContext::requestVideoContentLayer):
178         (VideoFullscreenControllerContext::returnVideoContentLayer):
179         (VideoFullscreenControllerContext::didSetupFullscreen):
180         (VideoFullscreenControllerContext::didExitFullscreen):
181
182 2018-10-04  Justin Michaud  <justin_michaud@apple.com>
183
184         Bindings generator should support static attributes that are interfaces with CallWith
185         https://bugs.webkit.org/show_bug.cgi?id=190292
186
187         Reviewed by Chris Dumez.
188
189         Add support for static attributes that support callWith to the bindings generator. This
190         is needed for CSS.paintWorklet.
191
192         * bindings/scripts/CodeGeneratorJS.pm:
193         (GenerateAttributeGetterBodyDefinition):
194         * bindings/scripts/test/JS/JSTestObj.cpp:
195         (WebCore::jsTestObjConstructorTestStaticReadonlyObjGetter):
196         (WebCore::jsTestObjConstructorTestStaticReadonlyObj):
197         * bindings/scripts/test/TestObj.idl:
198
199 2018-10-04  Matt Lewis  <jlewis3@apple.com>
200
201         Unreviewed, rolling out r236730.
202
203         This caused a consistent crash in test http/tests/media/media-stream/get-display-media-prompt.html.
204
205         Reverted changeset:
206
207         "[MediaStream] RealtimeMediaSource should be able to vend
208         hashed IDs"
209         https://bugs.webkit.org/show_bug.cgi?id=190142
210         https://trac.webkit.org/changeset/236730
211
212 2018-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
213
214         [macOS] Fix some font attribute conversion bugs in preparation for "Font > Styles…" support in WebKit2
215         https://bugs.webkit.org/show_bug.cgi?id=190289
216         <rdar://problem/45020806>
217
218         Reviewed by Ryosuke Niwa.
219
220         Makes some small adjustments to fix two bugs in font attribute conversion logic. See below for more detail.
221
222         Tests:  FontManagerTests.AddFontShadowUsingFontOptions
223                 FontManagerTests.AddAndRemoveColorsUsingFontOptions
224
225         * editing/FontAttributeChanges.cpp:
226         (WebCore::cssValueListForShadow):
227         * editing/cocoa/FontAttributesCocoa.mm:
228
229         Currently, we bail from adding a font shadow if the shadow's offset is empty. However, valid shadow offsets may
230         have negative dimensions, so a check for `isZero()` should be used instead.
231
232         (WebCore::FontAttributes::createDictionary const):
233         * platform/mac/WebCoreNSFontManagerExtras.mm:
234
235         Fall back to a transparent background color; this allows senders to remove the current background color by just
236         removing NSBackgroundColorAttributeName from the attribute dictionary, rather than explicitly setting it to the
237         transparent color (this scenario is exercised when using "Font > Styles…" to specify a font style without a
238         background color).
239
240         (WebCore::computedFontAttributeChanges):
241
242 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
243
244         MutationRecord doesn't keep JS wrappers of target, addedNodes, and removedNodes alive
245         https://bugs.webkit.org/show_bug.cgi?id=190277
246
247         Reviewed by Antti Koivisto.
248
249         The bug was caused by JSMutationRecord not visiting any of the nodes referenced by mutation records.
250
251         Fixed the bug by adding JSMutationRecord::visitAdditionalChildren, which adds the root nodes of
252         the root nodes of the target, addedNodes, and removedNodes in each mutation record.
253
254         Test: fast/dom/MutationObserver/mutation-record-keeps-js-wrappers-of-nodes-alive.html
255
256         * Sources.txt:
257         * WebCore.xcodeproj/project.pbxproj:
258         * bindings/js/JSMutationRecordCustom.cpp: Added.
259         (WebCore::JSMutationRecord::visitAdditionalChildren): Added.
260         * bindings/js/JSPerformanceObserverCustom.cpp: This file got dumped out of a unified build file
261         where using namespace JSC was defined. Use the fully qualified names to refer to JSC types.
262         (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
263         * dom/MutationRecord.cpp:
264         (WebCore::ChildListRecord::visitNodesConcurrently): Added.
265         (WebCore::RecordWithEmptyNodeLists::visitNodesConcurrently): Added.
266         (WebCore::MutationRecordWithNullOldValue::visitNodesConcurrently): Added.
267         * dom/MutationRecord.h:
268         * dom/MutationRecord.idl:
269
270 2018-10-04  Jiewen Tan  <jiewen_tan@apple.com>
271
272         [WebAuthN] Move time out control from WebProcess to UIProcess
273         https://bugs.webkit.org/show_bug.cgi?id=189642
274         <rdar://problem/44476765>
275
276         Reviewed by Chris Dumez.
277
278         Since now the control unit of WebAuthN has been moved to UI Process, i.e. AuthenticatorManager,
279         the time out timer should move to UI Process as well.
280
281         Tests: http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html
282                http/wpt/webauthn/public-key-credential-get-failure-local-silent.https.html
283
284         * Modules/webauthn/AuthenticatorCoordinator.cpp:
285         (WebCore::AuthenticatorCoordinator::create const):
286         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
287         (WebCore::AuthenticatorCoordinatorInternal::initTimeoutTimer): Deleted.
288         (WebCore::AuthenticatorCoordinatorInternal::didTimeoutTimerFire): Deleted.
289         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
290         (WebCore::PublicKeyCredentialCreationOptions::encode const):
291         (WebCore::PublicKeyCredentialCreationOptions::decode):
292         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
293         (WebCore::PublicKeyCredentialRequestOptions::encode const):
294         (WebCore::PublicKeyCredentialRequestOptions::decode):
295
296 2018-10-04  Chris Dumez  <cdumez@apple.com>
297
298         Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
299         https://bugs.webkit.org/show_bug.cgi?id=190252
300
301         Reviewed by Alex Christensen.
302
303         Add a null check for element() after firing the 'input' event and before firing the 'change' event
304         in case the input event listener changes the input type.
305
306         Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
307                fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
308
309         * html/BaseCheckableInputType.cpp:
310         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
311
312 2018-10-04  Yuhan Wu  <yuhan_wu@apple.com>
313
314         runtime flag and IDL for MediaRecorder
315         https://bugs.webkit.org/show_bug.cgi?id=190018
316
317         Reviewed by Youenn Fablet and Chris Dumez.
318
319         Covered by tests:
320         imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
321         imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html
322
323         Add an architecture of the IDL and the class for MediaRecorder and BlobEvent.
324
325         * CMakeLists.txt:
326         * DerivedSources.make:
327         * Modules/mediarecorder/BlobEvent.h:
328         (WebCore::BlobEvent::create):
329         (WebCore::BlobEvent:::Event):
330         * Modules/mediarecorder/BlobEvent.idl:
331         * Modules/mediarecorder/MediaRecorder.cpp:
332         (WebCore::MediaRecorder::create):
333         (WebCore::MediaRecorder::MediaRecorder):
334         (WebCore::MediaRecorder::activeDOMObjectName const):
335         (WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
336         * Modules/mediarecorder/MediaRecorder.h: Added.
337         (WebCore::MediaRecorder::state const):
338         (WebCore::MediaRecorder::~MediaRecorder):
339         * Modules/mediarecorder/MediaRecorder.idl:
340         * Modules/mediastream/RTCRtpReceiver.cpp:
341         * Sources.txt:
342         * WebCore.xcodeproj/project.pbxproj:
343         * bindings/js/WebCoreBuiltinNames.h:
344         * page/RuntimeEnabledFeatures.h:
345         (WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const):
346         (WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled):
347
348 2018-10-04  Chris Dumez  <cdumez@apple.com>
349
350         Unreviewed, rolling out r236803.
351
352         Caused crashes on some bots
353
354         Reverted changeset:
355
356         "Regression(r236779): Crash when changing the input element
357         type from inside an 'input' event listener"
358         https://bugs.webkit.org/show_bug.cgi?id=190252
359         https://trac.webkit.org/changeset/236803
360
361 2018-10-04  Dan Bernstein  <mitz@apple.com>
362
363         Tried to fix the Mojave build after r236832.
364
365         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
366         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
367         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
368
369 2018-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
370
371         ENABLE(ASSERT) used in grid code when !ASSERT_DISABLED is desired
372         https://bugs.webkit.org/show_bug.cgi?id=190145
373
374         Reviewed by Javier Fernandez.
375
376         Replace ENABLE(ASSERT), which doesn't exist, with !ASSERT_DISABLED.
377
378         * rendering/RenderGrid.cpp:
379         (WebCore::RenderGrid::placeItemsOnGrid const):
380         (WebCore::RenderGrid::baselinePosition const):
381         * rendering/style/GridArea.h:
382         (WebCore::GridSpan::GridSpan):
383
384 2018-10-04  Dan Bernstein  <mitz@apple.com>
385
386         WebCore part of [Xcode] Update some build settings as recommended by Xcode 10
387         https://bugs.webkit.org/show_bug.cgi?id=190250
388
389         Reviewed by Andy Estes.
390
391         * Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF,
392           CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED, and CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS.
393
394         * WebCore.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck and remove a
395           duplicate reference in a Compile Sources build phase.
396
397         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Suppress -Wdeprecated-implementations
398           around implementations of deprecated accessibility methods.
399
400         * loader/TextResourceDecoder.cpp:
401         (WebCore::TextResourceDecoder::checkForBOM): Addressed CLANG_WARN_COMMA.
402
403         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
404         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
405           Suppress -Wdeprecated-implementations around implementations of this deprecated delegate method.
406         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): Ditto.
407
408 2018-10-02  Darin Adler  <darin@apple.com>
409
410         AudioNode.connect should use [ReturnValue]
411         https://bugs.webkit.org/show_bug.cgi?id=190231
412
413         Reviewed by Eric Carlson.
414
415         This is a slightly more efficient way to return a value that is always
416         identical to one of the arguments, so use it here.
417
418         * Modules/webaudio/AudioBasicInspectorNode.cpp:
419         (WebCore::AudioBasicInspectorNode::connect): Return ExceptionOr<void>.
420         * Modules/webaudio/AudioBasicInspectorNode.h: Ditto.
421         * Modules/webaudio/AudioNode.cpp:
422         (WebCore::AudioNode::connect): Ditto.
423         * Modules/webaudio/AudioNode.h: Ditto.
424
425         * Modules/webaudio/AudioNode.idl: Use [ReturnValue].
426
427 2018-10-03  Justin Michaud  <justin_michaud@apple.com>
428
429         Registered custom properties should allow inheritance to be controlled
430         https://bugs.webkit.org/show_bug.cgi?id=190038
431
432         Reviewed by Antti Koivisto.
433
434         Tests: css-custom-properties-api/inherits.html
435                css-custom-properties-api/length.html
436                css-custom-properties-api/length2.html
437
438         Add support for inherits property on registered css custom properties, as well
439         as a starting point for evaluating registered custom properties with types. Registered
440         custom properties are evaluated as length values before being substituted. Currently,
441         relative unit cycles are not detected.
442
443         A proper solution is still needed to resolve relative unit cycles, and to apply properties like font
444         and line-height before they are needed by custom properties. In this patch, the font-size property is
445         applied twice, once before and once after resolving custom property values.
446
447         * Sources.txt:
448         * WebCore.xcodeproj/project.pbxproj:
449         * css/CSSComputedStyleDeclaration.cpp:
450         (WebCore::ComputedStyleExtractor::customPropertyValue):
451         (WebCore::CSSComputedStyleDeclaration::length const):
452         (WebCore::CSSComputedStyleDeclaration::item const):
453
454         Allow JS to get custom properties that have been resolved to a length. Also add properties from
455         m_rareNonInheritedData.
456
457         * css/CSSCustomPropertyValue.cpp:
458         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
459         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
460         * css/CSSCustomPropertyValue.h:
461         * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h.
462         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
463         (WebCore::CSSRegisteredCustomProperty::initialValueCopy const):
464         * css/CSSRegisteredCustomProperty.h:
465         (WebCore::CSSRegisteredCustomProperty::initialValue const):
466         * css/CSSVariableData.cpp:
467         (WebCore::CSSVariableData::checkVariablesForCycles const):
468         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
469         (WebCore::CSSVariableData::resolveVariableFallback const):
470         (WebCore::CSSVariableData::resolveVariableReference const):
471         (WebCore::CSSVariableData::resolveVariableReferences const):
472         (WebCore::CSSVariableData::resolveTokenRange const):
473         * css/CSSVariableData.h:
474         * css/CSSVariableReferenceValue.cpp:
475         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
476         * css/CSSVariableReferenceValue.h:
477         * css/DOMCSSRegisterCustomProperty.cpp:
478         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
479
480         Use RenderStyle over passing in a customProperties map.
481
482         * css/StyleBuilder.h:
483         * css/StyleBuilderConverter.h:
484         (WebCore::StyleBuilderConverter::convertLength):
485         (WebCore::StyleBuilderConverter::convertLengthOrAuto):
486         (WebCore::StyleBuilderConverter::convertLengthSizing):
487         (WebCore::StyleBuilderConverter::convertLengthMaxSizing):
488         * css/StyleBuilderCustom.h:
489         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
490         (WebCore::StyleBuilderCustom::applyInheritCustomProperty):
491         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
492         * css/StyleResolver.cpp:
493         (WebCore::StyleResolver::useSVGZoomRules const):
494         (WebCore::StyleResolver::useSVGZoomRulesForLength const):
495         (WebCore::StyleResolver::applyProperty):
496         (WebCore::StyleResolver::resolvedVariableValue const):
497         (WebCore::StyleResolver::applyCascadedProperties):
498         (WebCore::StyleResolver::useSVGZoomRules): Deleted.
499         (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted.
500         (WebCore::StyleResolver::resolvedVariableValue): Deleted.
501         * css/StyleResolver.h:
502         * css/makeprop.pl:
503
504         Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with
505         inheritance, unset and revert values.
506
507         * css/parser/CSSParser.cpp:
508         (WebCore::CSSParser::parseValueWithVariableReferences):
509         * css/parser/CSSParser.h:
510         * css/parser/CSSParserContext.cpp:
511         (WebCore::CSSParserContext::CSSParserContext):
512         * css/parser/CSSParserContext.h:
513         * css/parser/CSSPropertyParser.cpp:
514         (WebCore::CSSPropertyParser::parseSingleValue):
515
516         Allow parsing custom property values as lengths.
517
518         * rendering/style/RenderStyle.cpp:
519         (WebCore::RenderStyle::checkVariablesInCustomProperties):
520         * rendering/style/RenderStyle.h:
521         (WebCore::RenderStyle::inheritedCustomProperties const):
522         (WebCore::RenderStyle::nonInheritedCustomProperties const):
523         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
524         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
525         (WebCore::RenderStyle::getCustomProperty const):
526         (WebCore::RenderStyle::customProperties const): Deleted.
527         (WebCore::RenderStyle::setCustomPropertyValue): Deleted.
528         * rendering/style/StyleRareNonInheritedData.cpp:
529         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
530         (WebCore::StyleRareNonInheritedData::operator== const):
531         * rendering/style/StyleRareNonInheritedData.h:
532         * style/StyleResolveForDocument.cpp:
533         (WebCore::Style::resolveForDocument):
534
535         Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find
536         cycles between them.
537
538 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
539
540         Clear m_pendingTargets in MutationObserver::takeRecords
541         https://bugs.webkit.org/show_bug.cgi?id=190240
542
543         Reviewed by Geoffrey Garen.
544
545         In r236781, we delayed the clearing of m_pendingTargets until the end of microtask to avoid a race between
546         mutation record's JS wrappers getting created and GC marking JS wrappers of elements in mutation records.
547
548         This patch shortens this delay to until mutation record's JS wrappers are created. Specifically, we make
549         MutationObserver::takeRecords() return a struct which has both pending targets hash set and the vector of
550         mutation records so that the hash set survives through the creation of JS wrappers for mutation records.
551
552         To do this, a new IDL extended attribute "ResultField" is introduced to specify the member variable in
553         which the result is stored.
554
555         No new tests. Unfortunately, this race condition appears to be impossible to capture in a regression test.
556
557         * bindings/scripts/CodeGeneratorJS.pm:
558         (GenerateOperationBodyDefinition):
559         * bindings/scripts/IDLAttributes.json:
560         * bindings/scripts/test/JS/JSTestInterface.cpp:
561         (WebCore::jsTestInterfacePrototypeFunctionTakeNodesBody):
562         (WebCore::jsTestInterfacePrototypeFunctionTakeNodes):
563         * bindings/scripts/test/TestImplements.idl: Added a test case.
564         * dom/MutationObserver.cpp:
565         (WebCore::MutationObserver::takeRecords):
566         (WebCore::MutationObserver::deliver):
567         * dom/MutationObserver.h:
568         * dom/MutationObserver.idl:
569
570 2018-10-03  Youenn Fablet  <youenn@apple.com>
571
572         Add VP8 support to WebRTC
573         https://bugs.webkit.org/show_bug.cgi?id=189976
574
575         Reviewed by Eric Carlson.
576
577         Add a runtime flag to control activation of VP8 codec.
578         Bind this runtime flag to the video codec factories.
579         Test: webrtc/video-mute-vp8.html
580
581         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
582         (WebCore::createLibWebRTCPeerConnectionBackend):
583         * page/RuntimeEnabledFeatures.h:
584         (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const):
585         (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled):
586         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
587         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
588         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
589         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
590         * testing/Internals.cpp:
591         (WebCore::Internals::resetToConsistentState):
592         Enable VP8 codec for tests.
593
594 2018-09-28  Jiewen Tan  <jiewen_tan@apple.com>
595
596         [WebCrypto] ECDSA could not deal with invalid signature inputs
597         https://bugs.webkit.org/show_bug.cgi?id=189879
598         <rdar://problem/44701276>
599
600         Reviewed by Brent Fulgham.
601
602         Add some guards over detections of the start positions of r/s.
603
604         Covered by improved existing tests.
605
606         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
607         (WebCore::verifyECDSA):
608
609 2018-10-03  Jer Noble  <jer.noble@apple.com>
610
611         Add a quirk to disable Modern EME for sites which are broken with it enabled
612         https://bugs.webkit.org/show_bug.cgi?id=190051
613
614         Reviewed by Daniel Bates.
615
616         Add a new class, parallel to Settings, to track quirk behavior. Extend the bindings
617         generator to support a DisabledByQuirk attribute, and set this attribute for all
618         the Modern EME types. Check whether the quirk is set inside HTMLMediaElement in
619         addition to the existing Setting.
620
621         * Modules/encryptedmedia/MediaKeyMessageEvent.idl:
622         * Modules/encryptedmedia/MediaKeySession.idl:
623         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
624         * Modules/encryptedmedia/MediaKeySystemAccess.idl:
625         * Modules/encryptedmedia/MediaKeys.idl:
626         * Modules/encryptedmedia/NavigatorEME.idl:
627         * Sources.txt:
628         * WebCore.xcodeproj/project.pbxproj:
629         * bindings/scripts/CodeGenerator.pm:
630         (WK_ucfirst):
631         * bindings/scripts/CodeGeneratorJS.pm:
632         (NeedsRuntimeCheck):
633         (GenerateRuntimeEnableConditionalString):
634         * bindings/scripts/IDLAttributes.json:
635         * bindings/scripts/preprocess-idls.pl:
636         (GenerateConstructorAttributes):
637         * dom/Document.cpp:
638         (WebCore::Document::Document):
639         * dom/Document.h:
640         (WebCore::Document::quirks const):
641         * html/HTMLMediaElement.cpp:
642         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
643         (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
644         * html/HTMLMediaElement.idl:
645         * page/Quirks.cpp: Added.
646         (Quirks::Quirks):
647         (Quirks::disableEncryptedMediaAPIQuirk const):
648         * page/Quirks.h: Added.
649
650 2018-10-03  Antoine Quint  <graouts@apple.com>
651
652         [Web Animations] REGRESSION: setting 'animation-name: none' after a 'fill: forwards' animation has completed does not revert to the unanimated style
653         https://bugs.webkit.org/show_bug.cgi?id=190257
654         <rdar://problem/41341473>
655
656         Reviewed by Dean Jackson.
657
658         Test: animations/animation-fill-forwards-removal.html
659
660         While we removed a declarative animation that was no longer targetting its element, we were not removing it from the declarative animation maps
661         on the timeline, which means that the animation would still be picked up when resolving styles. We now notify the timeline that the animation
662         was detached from the element. This preserves the DeclarativeAnimation relationship returning the element as its effect's target and the document
663         timeline as its timeline, but the document timeline will no longer see this animation as targeting this element.
664
665         * animation/AnimationTimeline.cpp:
666         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
667         * animation/DeclarativeAnimation.h:
668         (WebCore::DeclarativeAnimation::target const):
669
670 2018-10-03  Jer Noble  <jer.noble@apple.com>
671
672         CRASH in CVPixelBufferGetBytePointerCallback()
673         https://bugs.webkit.org/show_bug.cgi?id=190092
674
675         Reviewed by Eric Carlson.
676
677         Speculative fix for crash that occurs when callers of CVPixelBufferGetBytePointerCallback() attempt
678         to read the last byte of a CVPixelBuffer (as a pre-flight check) and crash due to a memory access
679         error. It's speculated that mismatching CVPixelBufferLockBytePointer / CVPixelBufferUnlockBytePointer
680         calls could result in an incorrect state inside the CVPixelBuffer. Add log count checks, locking, and
681         release logging to try to pinpoint if mismatch lock counts are occurring in this code path.
682
683         * platform/graphics/cv/PixelBufferConformerCV.cpp:
684         (WebCore::CVPixelBufferGetBytePointerCallback):
685         (WebCore::CVPixelBufferReleaseBytePointerCallback):
686         (WebCore::CVPixelBufferReleaseInfoCallback):
687         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
688
689 2018-10-03  Chris Dumez  <cdumez@apple.com>
690
691         Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
692         https://bugs.webkit.org/show_bug.cgi?id=190252
693
694         Reviewed by Alex Christensen.
695
696         Add a null check for element() after firing the 'input' event and before firing the 'change' event
697         in case the input event listener changes the input type.
698
699         Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
700                fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
701
702         * html/BaseCheckableInputType.cpp:
703         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
704
705 2018-10-03  Chris Dumez  <cdumez@apple.com>
706
707         Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener
708         https://bugs.webkit.org/show_bug.cgi?id=190251
709
710         Reviewed by Alex Christensen.
711
712         Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener,
713         similarly to noopener=1:
714         - https://html.spec.whatwg.org/#window-open-steps (step 5)
715
716         It does not matter what the value is, if there is a key named "noopener", then the new window
717         should not have an opener.
718
719         No new tests, rebaselined existing test.
720
721         * page/WindowFeatures.cpp:
722         (WebCore::setWindowFeature):
723
724 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
725
726         GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
727         https://bugs.webkit.org/show_bug.cgi?id=190115
728
729         Reviewed by Geoffrey Garen.
730
731         Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
732
733         This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
734         target is kept alive and MutationObserverRegistration where each node which had been removed
735         from an observed tree is kept alive for a subtree observation.
736
737         No new test since the test which can reproduce this problem is too slow.
738
739         * dom/GCReachableRef.h:
740         (WebCore::GCReachableRef): Made it work with hash table.
741         (WebCore::GCReachableRef::operator T& const):
742         (WebCore::GCReachableRef::GCReachableRef):
743         (WebCore::GCReachableRef::isHashTableDeletedValue const):
744         (WebCore::GCReachableRef::isHashTableEmptyValue const):
745         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
746         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
747         (WebCore::GCReachableRef::assignToHashTableEmptyValue):
748         (WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
749         (WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
750         (WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
751         (WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
752         (WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
753         (WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
754         * dom/MutationObserver.cpp:
755         (WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
756         to be collected before elements in mutation records are accessed. We delay until the end of the current
757         microtask at which point deliver() function is called.
758         (WebCore::MutationObserver::disconnect):
759         (WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
760         This is needed for a newly inserted node, a node with attribute change, etc...
761         (WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
762         records are delivered to each observer. These are nodes which had been removed from a tree and whose
763         subtree had still been obsreved up until this point.
764         * dom/MutationObserver.h:
765         * dom/MutationObserverRegistration.cpp:
766         (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
767         (WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
768         that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
769         function had been called.
770         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
771         * dom/MutationObserverRegistration.h:
772
773 2018-10-03  Dean Jackson  <dino@apple.com>
774
775         Make the Pointer Events feature description valid
776         https://bugs.webkit.org/show_bug.cgi?id=190254
777
778         Reviewed by Simon Fraser.
779
780         * features.json:
781
782 2018-10-03  Matt Lewis  <jlewis3@apple.com>
783
784         Unreviewed, rolling out r236781.
785
786         The test added with this commit is timing out consistently.
787
788         Reverted changeset:
789
790         "GC can collect JS wrappers of nodes in the mutation records
791         waiting to be delivered"
792         https://bugs.webkit.org/show_bug.cgi?id=190115
793         https://trac.webkit.org/changeset/236781
794
795 2018-10-03  Dean Jackson  <dino@apple.com>
796
797         [macOS] Switching to discrete GPU should be done in the UI process
798         https://bugs.webkit.org/show_bug.cgi?id=189361
799         <rdar://problem/43949622>
800
801         Try to fix the IOSMAC build.
802
803         * platform/graphics/GraphicsContext3D.h:
804
805 2018-10-03  Chris Dumez  <cdumez@apple.com>
806
807         input.checked is incorrect while we're parsing its children
808         https://bugs.webkit.org/show_bug.cgi?id=190227
809
810         Reviewed by Ryosuke Niwa.
811
812         input.checked was incorrect while we're parsing its children because we were delaying updating the
813         checked state until HTMLInputElement::finishParsingChildren() is called, to avoid a bad interaction
814         with form state restoration.
815
816         In this patch, we update the checked state as soon as the 'checked' attribute is set, when we know
817         that no form state to restore.
818
819         fast/forms/radio/state-restore-radio-group.html covers the form restoration case and is still
820         passing.
821
822         No new tests, rebaselined existing test.
823
824         * html/FormController.cpp:
825         (WebCore::FormController::hasFormStateToRestore const):
826         * html/FormController.h:
827         * html/HTMLInputElement.cpp:
828         (WebCore::HTMLInputElement::parseAttribute):
829
830 2018-10-03  Miguel Gomez  <magomez@igalia.com>
831
832         [GTK][WPE] Incorrect rendering of layers whose backingStore hasn't changed
833         https://bugs.webkit.org/show_bug.cgi?id=190249
834
835         Reviewed by Žan Doberšek.
836
837         Do not overwrite m_nicosia.performLayerSync when updating the content buffers or we lose
838         the value calculated during the layer flush. Use an OR instead to keep the old value.
839
840         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
841         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
842
843 2018-10-03  Youenn Fablet  <youenn@apple.com>
844
845         Enable H264 simulcast
846         https://bugs.webkit.org/show_bug.cgi?id=190167
847
848         Reviewed by Eric Carlson.
849
850         Activate H264 simulcast trial field.
851         Make track.getSettings() expose width and height for incoming tracks.
852
853         Test: webrtc/simulcast-h264.html
854
855         * Configurations/WebCore.xcconfig:
856         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
857         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
858         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
859         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
860
861 2018-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
862
863         -Wunused-variable in RenderLayer::updateScrollableAreaSet
864         https://bugs.webkit.org/show_bug.cgi?id=190200
865
866         Reviewed by Yusuke Suzuki.
867
868         Pass it through UNUSED_VARIABLE().
869
870         * rendering/RenderLayer.cpp:
871         (WebCore::RenderLayer::calculateClipRects const):
872
873 2018-10-03  Zan Dobersek  <zdobersek@igalia.com>
874
875         Ref<FetchResponse> use-after-move in DOMCache::put()
876         https://bugs.webkit.org/show_bug.cgi?id=190239
877
878         Reviewed by Youenn Fablet.
879
880         Retrieve reference from the Ref<FetchResponse> object before it's
881         move-captured in the lambda that's passed to the
882         FetchResponse::consumeBodyReceivedByChunk() method that is invoked on
883         that very same object. This is a classic use-after-move bug that pops
884         up on compilers with different C++ calling convention.
885
886         * Modules/cache/DOMCache.cpp:
887         (WebCore::DOMCache::put):
888
889 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
890
891         Enable selectionAcrossShadowBoundariesEnabled by default in WebKitLegacy
892         https://bugs.webkit.org/show_bug.cgi?id=190238
893
894         Reviewed by Antti Koivisto.
895
896         Enable the feature by default.
897
898         * page/Settings.yaml:
899
900 2018-10-02  Ryosuke Niwa  <rniwa@webkit.org>
901
902         Copying content with shadow DOM doesn't copy any contents
903         https://bugs.webkit.org/show_bug.cgi?id=157443
904
905         Reviewed by Wenson Hsieh.
906
907         This patch adds the support for copying and pasting content across shadow boundaries in HTML and plain text,
908         which is enabled whenever selection across shadow boundaries is enabled.
909
910         To do this, TextIterator now has a constructor which takes two Positions, and the node traversal code in
911         StyledMarkupAccumulator has been abstracted via helper functions as done for TextIterator.
912
913         When serializing a HTMl slot element, serialize it as a span with "display: contents" to make sure when
914         the content is pasted into a shadow tree, it wouldn't affect the slot assignment of the shadow tree.
915
916         Tests: editing/pasteboard/copy-paste-across-shadow-boundaries-1.html
917                editing/pasteboard/copy-paste-across-shadow-boundaries-2.html
918                editing/pasteboard/copy-paste-across-shadow-boundaries-3.html
919                editing/pasteboard/copy-paste-across-shadow-boundaries-4.html
920                editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-1.html
921                editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-2.html
922                editing/pasteboard/copy-paste-with-shadow-content.html
923
924         * dom/ComposedTreeIterator.h:
925         (WebCore::assignedSlotIgnoringUserAgentShadow): Moved from TextIterator.cpp.
926         (WebCore::shadowRootIgnoringUserAgentShadow): Ditto.
927         (WebCore::firstChildInComposedTreeIgnoringUserAgentShadow): Ditto.
928         (WebCore::nextSiblingInComposedTreeIgnoringUserAgentShadow): Ditto.
929         * dom/Position.h:
930         (WebCore::Position::treeScope const): Added.
931         * editing/EditingStyle.cpp:
932         (WebCore::EditingStyle::addDisplayContents): Added.
933         * editing/EditingStyle.h:
934         * editing/Editor.cpp:
935         (WebCore::Editor::selectedText const): Use the new behavior when selectionAcrossShadowBoundariesEnabled is set.
936         (WebCore::Editor::selectedTextForDataTransfer const): Ditto.
937         * editing/MarkupAccumulator.cpp:
938         (WebCore::MarkupAccumulator::appendEndElement): Renamed from appendEndTag. Now takes StringBuilder.
939         * editing/MarkupAccumulator.h:
940         (WebCore::MarkupAccumulator::appendEndTag):
941         * editing/TextIterator.cpp:
942         (WebCore::TextIterator::TextIterator): Added a new variant which takes two positions.
943         (WebCore::TextIterator::init):
944         (WebCore::firstChild):
945         (WebCore::nextSibling):
946         (WebCore::plainText): Ditto.
947         * editing/TextIterator.h:
948         * editing/cocoa/EditorCocoa.mm:
949         (WebCore::Editor::selectionInHTMLFormat): Use the new behavior if selectionAcrossShadowBoundariesEnabled is set.
950         * editing/gtk/EditorGtk.cpp:
951         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
952         * editing/markup.cpp:
953         (WebCore::StyledMarkupAccumulator::parentNode): Added.
954         (WebCore::StyledMarkupAccumulator::firstChild): Added.
955         (WebCore::StyledMarkupAccumulator::nextSibling): Added.
956         (WebCore::StyledMarkupAccumulator::nextSkippingChildren): Added.
957         (WebCore::StyledMarkupAccumulator::hasChildNodes): Added.
958         (WebCore::StyledMarkupAccumulator::isDescendantOf): Added.
959         (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
960         (WebCore::StyledMarkupAccumulator::appendElement): Serialize a slot element as a span with display: contents.
961         (WebCore::StyledMarkupAccumulator::appendEndElement): Added. Ditto.
962         (WebCore::StyledMarkupAccumulator::serializeNodes):
963         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): Use the newly added helper functions to
964         traverse the composed tree when m_useComposedTree is set.
965         (WebCore::commonShadowIncludingAncestor): Added.
966         (WebCore::serializePreservingVisualAppearanceInternal): Added SerializeComposedTree as an argument. Also use
967         StyledMarkupAccumulator::parentNode to serialize special common ancestors; e.g. to preserve b, i, etc...
968         (WebCore::serializePreservingVisualAppearance): Ditto to the variant which takes VisibleSelection.
969         (WebCore::sanitizedMarkupForFragmentInDocument):
970         * editing/markup.h:
971         * editing/wpe/EditorWPE.cpp:
972         (WebCore::Editor::writeSelectionToPasteboard):
973         * loader/archive/cf/LegacyWebArchive.cpp:
974         (WebCore::LegacyWebArchive::createFromSelection):
975         * page/PageSerializer.cpp:
976         (WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndElement):
977         * testing/Internals.cpp:
978         (WebCore::Internals::setSelectionWithoutValidation): Added. A helper function to create a selection across
979         shadow boundaries for testing purposes.
980         * testing/Internals.h:
981         * testing/Internals.idl:
982
983 2018-10-02  Chris Dumez  <cdumez@apple.com>
984
985         MessageEvent.ports should return the same object
986         https://bugs.webkit.org/show_bug.cgi?id=190151
987
988         Reviewed by Darin Adler.
989
990         MessageEvent.ports should return the same object it was initialized to instead of
991         constructing a new JSValue every time.
992
993         No new tests, rebaselined existing test.
994
995         * bindings/js/JSMessageEventCustom.cpp:
996         (WebCore::JSMessageEvent::ports const):
997         (WebCore::JSMessageEvent::visitAdditionalChildren):
998         * dom/MessageEvent.cpp:
999         (WebCore::MessageEvent::initMessageEvent):
1000         * dom/MessageEvent.h:
1001         * dom/MessageEvent.idl:
1002
1003 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
1004
1005         GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
1006         https://bugs.webkit.org/show_bug.cgi?id=190115
1007
1008         Reviewed by Geoffrey Garen.
1009
1010         Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
1011
1012         This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
1013         target is kept alive and MutationObserverRegistration where each node which had been removed
1014         from an observed tree is kept alive for a subtree observation.
1015
1016         Test: fast/dom/MutationObserver/mutation-observer-retains-js-wrappers-of-targets-alive.html
1017
1018         * dom/GCReachableRef.h:
1019         (WebCore::GCReachableRef): Made it work with hash table.
1020         (WebCore::GCReachableRef::operator T& const):
1021         (WebCore::GCReachableRef::GCReachableRef):
1022         (WebCore::GCReachableRef::isHashTableDeletedValue const):
1023         (WebCore::GCReachableRef::isHashTableEmptyValue const):
1024         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
1025         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
1026         (WebCore::GCReachableRef::assignToHashTableEmptyValue):
1027         (WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
1028         (WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
1029         (WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
1030         (WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
1031         (WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
1032         (WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
1033         * dom/MutationObserver.cpp:
1034         (WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
1035         to be collected before elements in mutation records are accessed. We delay until the end of the current
1036         microtask at which point deliver() function is called.
1037         (WebCore::MutationObserver::disconnect):
1038         (WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
1039         This is needed for a newly inserted node, a node with attribute change, etc...
1040         (WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
1041         records are delivered to each observer. These are nodes which had been removed from a tree and whose
1042         subtree had still been obsreved up until this point.
1043         * dom/MutationObserver.h:
1044         * dom/MutationObserverRegistration.cpp:
1045         (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
1046         (WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
1047         that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
1048         function had been called.
1049         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
1050         * dom/MutationObserverRegistration.h:
1051
1052 2018-10-02  Chris Dumez  <cdumez@apple.com>
1053
1054         radio / checkbox inputs should fire "click, input, change" events in order when clicked
1055         https://bugs.webkit.org/show_bug.cgi?id=190223
1056
1057         Reviewed by Ryosuke Niwa.
1058
1059         radio / checkbox inputs should fire "click, input, change" events in order when clicked:
1060         - https://html.spec.whatwg.org/#radio-button-state-(type=radio)
1061         - https://html.spec.whatwg.org/#checkbox-state-(type=checkbox)
1062         - https://dom.spec.whatwg.org/#ref-for-eventtarget-activation-behavior③ (step 11)
1063
1064         Gecko and Blink already behave this way. However, WebKit has the following issues:
1065         - the input event is not fired
1066         - the click event is fired after the change event
1067
1068         No new tests, updated / rebaselined existing tests.
1069
1070         * html/BaseCheckableInputType.cpp:
1071         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
1072         * html/BaseCheckableInputType.h:
1073         * html/CheckboxInputType.cpp:
1074         (WebCore::CheckboxInputType::willDispatchClick):
1075         (WebCore::CheckboxInputType::didDispatchClick):
1076         * html/HTMLInputElement.cpp:
1077         (WebCore::HTMLInputElement::setChecked):
1078         * html/HTMLInputElement.h:
1079         * html/RadioInputType.cpp:
1080         (WebCore::RadioInputType::willDispatchClick):
1081         (WebCore::RadioInputType::didDispatchClick):
1082
1083 2018-10-02  Chris Dumez  <cdumez@apple.com>
1084
1085         fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection
1086         https://bugs.webkit.org/show_bug.cgi?id=190218
1087
1088         Reviewed by Alex Christensen.
1089
1090         fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection:
1091         - https://github.com/whatwg/html/commit/8beedf0c2ffd38853caddec67490288f47afc8eb
1092
1093         Gecko has always behaved this way. Blink aligned with Gecko and the HTML specification in December 2016:
1094         - https://bugs.chromium.org/p/chromium/issues/detail?id=665291
1095
1096         This simplifies our HTMLFieldSetElement code a lot.
1097
1098         Test: fast/forms/fieldset/fieldset-elements-htmlcollection.html
1099
1100         * html/CollectionType.h:
1101         * html/GenericCachedHTMLCollection.cpp:
1102         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const):
1103         * html/HTMLCollection.cpp:
1104         (WebCore::HTMLCollection::rootTypeFromCollectionType):
1105         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
1106         * html/HTMLFieldSetElement.cpp:
1107         (WebCore::HTMLFieldSetElement::elements):
1108         * html/HTMLFieldSetElement.h:
1109         * html/HTMLFieldSetElement.idl:
1110         * html/HTMLFormControlsCollection.cpp:
1111         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
1112         (WebCore:: const):
1113         (WebCore::HTMLFormControlsCollection::copyFormControlElementsVector const):
1114         (WebCore::HTMLFormControlsCollection::ownerNode const):
1115         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
1116         * html/HTMLFormControlsCollection.h:
1117
1118 2018-10-02  Devin Rousso  <drousso@apple.com>
1119
1120         Web Inspector: prevent layer events from firing until the layer information is re-requested
1121         https://bugs.webkit.org/show_bug.cgi?id=190159
1122
1123         Reviewed by Joseph Pecoraro.
1124
1125         Test: inspector/layers/layerTreeDidChange.html
1126
1127         * inspector/agents/InspectorLayerTreeAgent.h:
1128         * inspector/agents/InspectorLayerTreeAgent.cpp:
1129         (WebCore::InspectorLayerTreeAgent::reset):
1130         (WebCore::InspectorLayerTreeAgent::layerTreeDidChange):
1131         (WebCore::InspectorLayerTreeAgent::layersForNode):
1132
1133 2018-10-02  Brian Burg  <bburg@apple.com>
1134
1135         Web Automation: tab default key handler should always cycle focus when page is controlled by automation
1136         https://bugs.webkit.org/show_bug.cgi?id=190221
1137         <rdar://problem/44914534>
1138
1139         Reviewed by Joseph Pecoraro.
1140
1141         This change progresses WPT WebDriver test special_keys.py::test_webdriver_special_key_sends_keydown[TAB-expected24].
1142
1143         * page/FocusController.cpp:
1144         (WebCore::FocusController::advanceFocusInDocumentOrder):
1145         Always cycle focus if the page is controlled by automation. If the chrome takes
1146         focus, then the first responder will be something other than the WebView, which
1147         causes subsequent WebDriver commands to hang.
1148
1149 2018-10-01  Dean Jackson  <dino@apple.com>
1150
1151         [macOS] Switching to discrete GPU should be done in the UI process
1152         https://bugs.webkit.org/show_bug.cgi?id=189361
1153         <rdar://problem/43949622>
1154
1155         Reviewed by Simon Fraser.
1156
1157         Based on an earlier patch by Per Arne Vollan.
1158
1159         Due to the fact we can't talk to the Window Server, the Web Process can
1160         no longer muxing to the discrete GPU directly. Instead we have to get the
1161         UI Process to process the change. Do this by adding a new Chrome client
1162         called GPUClient, that will have implementations provided by both WebKit
1163         and legacy WebKit.
1164
1165         Unfortunately this can't be tested by a regular WKTR since:
1166         - it requires specific hardware
1167         - swapping to/from the discrete GPU takes about 20 seconds
1168         - running concurrent tests could confuse the tests into thinking
1169           the wrong GPU is active
1170
1171         Instead we'll write a specific test for this functionality and
1172         run it on a separate bot.
1173
1174         * WebCore.xcodeproj/project.pbxproj: Add GPUClient files.
1175
1176         * page/Chrome.cpp: Drive by clean-up.
1177         (WebCore::Chrome::windowScreenDidChange):
1178
1179         * platform/graphics/GraphicsContext3D.h: We need to keep track of
1180         whether we've muxed for this context, in order to not respond to
1181         the screen change notifications (they are misleading in the case
1182         of muxing).
1183
1184         * platform/graphics/GraphicsContext3DManager.cpp: Rather than try
1185         to mux directly, call into GPUClient.
1186         (WebCore::GraphicsContext3DManager::displayWasReconfigured):
1187         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
1188         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
1189         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
1190         * platform/graphics/GraphicsContext3DManager.h:
1191
1192         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Only reconfigure
1193         the virtual display if it didn't happen from muxing.
1194         (WebCore::GraphicsContext3D::GraphicsContext3D):
1195         (WebCore::GraphicsContext3D::updateCGLContext):
1196         (WebCore::GraphicsContext3D::screenDidChange):
1197
1198         * platform/graphics/mac/SwitchingGPUClient.cpp: Added.
1199         (WebCore::SwitchingGPUClient::singleton):
1200         (WebCore::SwitchingGPUClient::setSingleton):
1201         * platform/graphics/mac/SwitchingGPUClient.h: Added.
1202
1203         * testing/Internals.cpp: Testing helper.
1204         (WebCore::Internals::hasMuxableGPU):
1205         * testing/Internals.h:
1206         * testing/Internals.idl:
1207
1208 2018-10-02  Chris Dumez  <cdumez@apple.com>
1209
1210         Image.__proto__ should be Function.prototype, not HTMLElement.prototype
1211         https://bugs.webkit.org/show_bug.cgi?id=190216
1212
1213         Reviewed by Alex Christensen.
1214
1215         Properties created for named constructors should always use Function.prototype as prototype, as per:
1216         - https://heycam.github.io/webidl/#named-constructors
1217
1218         Gecko and Blink agree with the Web IDL specification. However, WebKit was using the parent interface's
1219         prototype if such a parent existing. So Image.__proto__ would end up being HTMLElement.prototype
1220         instead of Function.prototype.
1221
1222         No new tests, rebaselined existing test.
1223
1224         * bindings/scripts/CodeGeneratorJS.pm:
1225         (GenerateConstructorHelperMethods):
1226
1227 2018-10-02  Alex Christensen  <achristensen@webkit.org>
1228
1229         Prepare WebCoreNSURLExtras for ARC
1230         https://bugs.webkit.org/show_bug.cgi?id=190219
1231
1232         Reviewed by Tim Horton.
1233
1234         ARC doesn't like the explicit sending of -release.
1235         Use RetainPtr instead.
1236
1237         * platform/mac/WebCoreNSURLExtras.mm:
1238         (WebCore::collectRangesThatNeedMapping):
1239         (WebCore::collectRangesThatNeedEncoding):
1240         (WebCore::collectRangesThatNeedDecoding):
1241         (WebCore::applyHostNameFunctionToMailToURLString):
1242         (WebCore::applyHostNameFunctionToURLString):
1243         (WebCore::mapHostNames):
1244         (WebCore::stringByTrimmingWhitespace):
1245         (WebCore::URLWithUserTypedString):
1246         (WebCore::userVisibleString):
1247         (WebCore::rangeOfURLScheme):
1248         (WebCore::looksLikeAbsoluteURL):
1249         (WebCore::retain): Deleted.
1250
1251 2018-10-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1252
1253         [Curl] Fix missing values of  resource timing API.
1254         https://bugs.webkit.org/show_bug.cgi?id=190193
1255
1256         Reviewed by Alex Christensen.
1257
1258         The property nextHopProtocol was not returned correctly. It was
1259         returned only when remote inspector is opened.
1260
1261         Tests: http/wpt/resource-timing/rt-nextHopProtocol.html
1262                http/wpt/resource-timing/rt-nextHopProtocol.worker.html
1263
1264         * platform/network/curl/CurlContext.cpp:
1265         (WebCore::CurlHandle::getNetworkLoadMetrics):
1266         (WebCore::CurlHandle::addExtraNetworkLoadMetrics):
1267
1268 2018-10-02  Alex Christensen  <achristensen@webkit.org>
1269
1270         Remove unused linked-on-or-before-iOS5 check
1271         https://bugs.webkit.org/show_bug.cgi?id=190164
1272
1273         Reviewed by Michael Saboff.
1274
1275         If an app hasn't been updated since iOS5, it can't run supported iOS.
1276         This value is also only checked in an uninstantiated template function.
1277
1278         * platform/URL.cpp:
1279         (WebCore::enableURLSchemeCanonicalization): Deleted.
1280         (WebCore::equal): Deleted.
1281         * platform/URL.h:
1282
1283 2018-10-02  Alex Christensen  <achristensen@webkit.org>
1284
1285         Remove ParsedURLString
1286         https://bugs.webkit.org/show_bug.cgi?id=190154
1287
1288         Reviewed by Chris Dumez.
1289
1290         Before the introduction of URLParser, it would indicate that we should assume the String
1291         is from a valid URL so we can skip canonicalization and just find the offsets inside the String
1292         to quickly create a URL.  It was a performance optimization that caused security issues when
1293         misused.  Since the introduction of URLParser, we have a fast path for all URL parsing, so
1294         right now it actually doesn't change any behavior.  It's just a relic of the past that complicates
1295         the URL class, making it harder to express which constructor to use and making it harder to move
1296         the class.
1297
1298         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
1299         (WebCore::NavigatorContentUtils::registerProtocolHandler):
1300         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
1301         (WebCore::NavigatorContentUtils::unregisterProtocolHandler):
1302         * dom/Document.cpp:
1303         (WebCore::Document::updateBaseURL):
1304         (WebCore::Document::initSecurityContext):
1305         * dom/ExtensionStyleSheets.cpp:
1306         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
1307         * dom/ProcessingInstruction.cpp:
1308         (WebCore::ProcessingInstruction::checkStyleSheet):
1309         * editing/markup.cpp:
1310         (WebCore::completeURLs):
1311         * fileapi/BlobURL.cpp:
1312         (WebCore::BlobURL::createBlobURL):
1313         * history/HistoryItem.cpp:
1314         (WebCore::HistoryItem::url const):
1315         (WebCore::HistoryItem::originalURL const):
1316         * html/HTMLFrameElementBase.cpp:
1317         (WebCore::HTMLFrameElementBase::location const):
1318         * html/HTMLMediaElement.cpp:
1319         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
1320         * html/PublicURLManager.cpp:
1321         (WebCore::PublicURLManager::stop):
1322         * inspector/InspectorStyleSheet.cpp:
1323         (WebCore::InspectorStyleSheet::resourceStyleSheetText const):
1324         * inspector/agents/InspectorPageAgent.cpp:
1325         (WebCore::InspectorPageAgent::getCookies):
1326         (WebCore::InspectorPageAgent::deleteCookie):
1327         (WebCore::InspectorPageAgent::getResourceContent):
1328         (WebCore::InspectorPageAgent::searchInResource):
1329         * inspector/agents/page/PageDebuggerAgent.cpp:
1330         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
1331         * loader/DocumentLoader.cpp:
1332         (WebCore::DocumentLoader::subresources const):
1333         * loader/FrameLoader.cpp:
1334         (WebCore::FrameLoader::init):
1335         (WebCore::FrameLoader::initForSynthesizedDocument):
1336         * loader/HistoryController.cpp:
1337         (WebCore::HistoryController::pushState):
1338         (WebCore::HistoryController::replaceState):
1339         * loader/appcache/ApplicationCache.cpp:
1340         (WebCore::ApplicationCache::addResource):
1341         (WebCore::ApplicationCache::resourceForURL):
1342         * loader/appcache/ApplicationCacheGroup.cpp:
1343         (WebCore::ApplicationCacheGroup::startLoadingEntry):
1344         (WebCore::ApplicationCacheGroup::addEntry):
1345         * loader/appcache/ApplicationCacheStorage.cpp:
1346         (WebCore::ApplicationCacheStorage::cacheGroupForURL):
1347         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
1348         (WebCore::ApplicationCacheStorage::loadCache):
1349         (WebCore::ApplicationCacheStorage::manifestURLs):
1350         * loader/archive/cf/LegacyWebArchive.cpp:
1351         (WebCore::LegacyWebArchive::create):
1352         * page/DOMWindow.cpp:
1353         (WebCore::DOMWindow::createWindow):
1354         * page/PageSerializer.cpp:
1355         (WebCore::PageSerializer::urlForBlankFrame):
1356         * platform/URL.cpp:
1357         (WebCore::blankURL):
1358         * platform/URL.h:
1359         (): Deleted.
1360         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1361         (WebCore::MediaPlayerPrivateAVFoundation::load):
1362         * platform/network/BlobRegistryImpl.cpp:
1363         (WebCore::BlobRegistryImpl::populateBlobsForFileWriting):
1364         * platform/network/ResourceRequestBase.h:
1365         (WebCore::ResourceRequestBase::decodeBase):
1366         * platform/network/ResourceResponseBase.cpp:
1367         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
1368         * platform/network/cf/DNSResolveQueueCFNet.cpp:
1369         (WebCore::DNSResolveQueueCFNet::updateIsUsingProxy):
1370         * platform/network/cf/ResourceRequest.h:
1371         (WebCore::ResourceRequest::ResourceRequest):
1372         * platform/network/curl/CookieJarDB.cpp:
1373         (WebCore::CookieJarDB::searchCookies):
1374         (WebCore::CookieJarDB::setCookie):
1375         (WebCore::CookieJarDB::deleteCookie):
1376         * platform/network/curl/ResourceRequest.h:
1377         (WebCore::ResourceRequest::ResourceRequest):
1378         * platform/network/soup/ResourceRequest.h:
1379         (WebCore::ResourceRequest::ResourceRequest):
1380         * xml/XSLTProcessorLibxslt.cpp:
1381         (WebCore::docLoaderFunc):
1382
1383 2018-10-02  Per Arne Vollan  <pvollan@apple.com>
1384
1385         [WebVTT] Cue with line setting is not rendered correctly
1386         https://bugs.webkit.org/show_bug.cgi?id=190168
1387
1388         Reviewed by Eric Carlson.
1389
1390         When the line setting contains an optional alignment value, the cue is not rendered at the correct position,
1391         see https://w3c.github.io/webvtt/#webvtt-line-cue-setting. This patch does not implement correct handling of
1392         the line setting alignment values, it only makes sure parsing does not fail when the cue has line alignment
1393         settings.
1394
1395         Test: media/track/track-cue-line-position.html
1396
1397         * html/track/VTTCue.cpp:
1398         (WebCore::VTTCueBox::applyCSSProperties):
1399         (WebCore::VTTCue::getPositionCoordinates const):
1400         (WebCore::VTTCue::setCueSettings):
1401
1402 2018-10-02  Antti Koivisto  <antti@apple.com>
1403
1404         User installed fonts are not always disabled when they should be
1405         https://bugs.webkit.org/show_bug.cgi?id=190195
1406
1407         Reviewed by Geoffrey Garen.
1408
1409         SVG images and some theme cases fail to respect the setting. Besides the obvious problem this
1410         is also a performance issue as various font caches include this setting in the key.
1411
1412         * platform/graphics/FontDescription.cpp:
1413         (WebCore::m_shouldAllowUserInstalledFonts):
1414
1415         Initialize to 'No' by default. All paths where user fonts make sense already set the bit from
1416         settings. This fixes some cases in system themes that construct FontDescriptions from scratch.
1417
1418         * rendering/RenderElement.cpp:
1419         (WebCore::RenderElement::styleWillChange):
1420
1421         Add assertion. This verified the change with the existing tests.
1422
1423         * svg/graphics/SVGImage.cpp:
1424         (WebCore::SVGImage::dataChanged):
1425
1426         Always disallow user fonts in SVG used as images.
1427
1428 2018-10-01  Dean Jackson  <dino@apple.com>
1429
1430         Remove CSS Animation Triggers
1431         https://bugs.webkit.org/show_bug.cgi?id=190175
1432         <rdar://problem/44925626>
1433
1434         Reviewed by Simon Fraser.
1435
1436         Remove the never-properly specified CSS Animation Triggers.
1437
1438         * Configurations/FeatureDefines.xcconfig:
1439         * Sources.txt:
1440         * WebCore.xcodeproj/project.pbxproj:
1441         * css/CSSAnimationTriggerScrollValue.cpp: Removed.
1442         * css/CSSAnimationTriggerScrollValue.h: Removed.
1443         * css/CSSComputedStyleDeclaration.cpp:
1444         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1445         (WebCore::createAnimationTriggerValue): Deleted.
1446         (WebCore::animationTriggerValue): Deleted.
1447         * css/CSSProperties.json:
1448         * css/CSSToStyleMap.cpp:
1449         (WebCore::CSSToStyleMap::mapAnimationTrigger): Deleted.
1450         * css/CSSToStyleMap.h:
1451         * css/CSSValue.cpp:
1452         (WebCore::CSSValue::equals const):
1453         (WebCore::CSSValue::cssText const):
1454         (WebCore::CSSValue::destroy):
1455         * css/CSSValue.h:
1456         (WebCore::CSSValue::isAnimationTriggerScrollValue const): Deleted.
1457         * css/parser/CSSPropertyParser.cpp:
1458         (WebCore::consumeAnimationValue):
1459         (WebCore::CSSPropertyParser::parseSingleValue):
1460         (WebCore::consumeWebkitAnimationTrigger): Deleted.
1461         * page/FrameView.cpp:
1462         (WebCore::FrameView::sendScrollEvent):
1463         * page/RuntimeEnabledFeatures.h:
1464         (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled): Deleted.
1465         (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled const): Deleted.
1466         * page/animation/AnimationBase.cpp:
1467         (WebCore::AnimationBase::updateStateMachine):
1468         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
1469         (WebCore::AnimationBase::timeToNextService):
1470         (WebCore::AnimationBase::getElapsedTime const):
1471         * page/animation/CSSAnimationController.cpp:
1472         (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved):
1473         (WebCore::CSSAnimationControllerPrivate::addToAnimationsDependentOnScroll): Deleted.
1474         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsDependentOnScroll): Deleted.
1475         (WebCore::CSSAnimationControllerPrivate::scrollWasUpdated): Deleted.
1476         (WebCore::CSSAnimationController::wantsScrollUpdates const): Deleted.
1477         (WebCore::CSSAnimationController::scrollWasUpdated): Deleted.
1478         * page/animation/CSSAnimationController.h:
1479         * page/animation/CSSAnimationControllerPrivate.h:
1480         (WebCore::CSSAnimationControllerPrivate::wantsScrollUpdates const): Deleted.
1481         (WebCore::CSSAnimationControllerPrivate::scrollPosition const): Deleted.
1482         * page/animation/CompositeAnimation.cpp:
1483         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1484         * page/animation/CompositeAnimation.h:
1485         (WebCore::CompositeAnimation::hasScrollTriggeredAnimation const): Deleted.
1486         * platform/animation/Animation.cpp:
1487         (WebCore::Animation::Animation):
1488         (WebCore::Animation::operator=):
1489         (WebCore::Animation::animationsMatch const):
1490         * platform/animation/Animation.h:
1491         (WebCore::Animation::isTimingFunctionSet const):
1492         (WebCore::Animation::isEmpty const):
1493         (WebCore::Animation::clearTimingFunction):
1494         (WebCore::Animation::clearAll):
1495         (WebCore::Animation::animationMode const):
1496         (WebCore::Animation::setAnimationMode):
1497         (WebCore::Animation::initialTimingFunction):
1498         (WebCore::Animation::isTriggerSet const): Deleted.
1499         (WebCore::Animation::clearTrigger): Deleted.
1500         (WebCore::Animation::trigger const): Deleted.
1501         (WebCore::Animation::setTrigger): Deleted.
1502         (WebCore::Animation::initialTrigger): Deleted.
1503         * platform/animation/AnimationTrigger.h: Removed.
1504         * platform/graphics/ca/GraphicsLayerCA.cpp:
1505         (WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
1506 2018-10-02  Commit Queue  <commit-queue@webkit.org>
1507
1508         Unreviewed, rolling out r236624 and r236671.
1509         https://bugs.webkit.org/show_bug.cgi?id=190207
1510
1511         The change in r236624 introduced crashes on the bots
1512         (Requested by ryanhaddad on #webkit).
1513
1514         Reverted changesets:
1515
1516         "Refactoring: eliminate raw pointer usage in Fullscreen code"
1517         https://bugs.webkit.org/show_bug.cgi?id=188747
1518         https://trac.webkit.org/changeset/236624
1519
1520         "Unify implementation in VideoFullscreenInterfaceAVKit"
1521         https://bugs.webkit.org/show_bug.cgi?id=190091
1522         https://trac.webkit.org/changeset/236671
1523
1524 2018-10-02  Sihui Liu  <sihui_liu@apple.com>
1525
1526         Add release assertion to ensure m_owningPointerForClose is null in UniqueIDBDatabase::invokeOperationAndTransactionTimer()
1527         https://bugs.webkit.org/show_bug.cgi?id=190178
1528
1529         Reviewed by Chris Dumez.
1530
1531         This would help debug rdar://problem/44902833.
1532
1533         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1534         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
1535
1536 2018-10-02  Commit Queue  <commit-queue@webkit.org>
1537
1538         Unreviewed, rolling out r236719.
1539         https://bugs.webkit.org/show_bug.cgi?id=190197
1540
1541         this revision caused 39 layout test failures that tested for
1542         scrolling, a bug was also not present in the commit or change
1543         log. (Requested by Truitt on #webkit).
1544
1545         Reverted changeset:
1546
1547         "Unreviewed, fix unused variable in
1548         RenderLayer::updateScrollableAreaSet"
1549         https://trac.webkit.org/changeset/236719
1550
1551 2018-10-02  Alicia Boya García  <aboya@igalia.com>
1552
1553         [MSE][GStreamer] Add h264parse to accept MP4 without stss
1554         https://bugs.webkit.org/show_bug.cgi?id=190143
1555
1556         Reviewed by Xabier Rodriguez-Calvar.
1557
1558         The MP4 file used in this URL does not contain a stss (Sync Sample
1559         Box). In consequence, in acordance with the ISO BMFF spec, all samples
1560         are assumed to be sync frames... But in this case that is not true,
1561         it's just that the file is wrong (e.g. created with a buggy muxer).
1562
1563         http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
1564
1565         The way it works in other browsers is because instead of trusting the
1566         MP4 stss table, they rely on parsing the h264 frames. We can do that
1567         too.
1568
1569         This patch also changes RELEASE_ASSERT() when creating the parsers
1570         to GLib criticals.
1571
1572         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1573         (WebCore::createOptionalParserForFormat):
1574
1575 2018-10-02  Eric Carlson  <eric.carlson@apple.com>
1576
1577         [MediaStream] RealtimeMediaSource should be able to vend hashed IDs
1578         https://bugs.webkit.org/show_bug.cgi?id=190142
1579         <rdar://problem/44911109>
1580
1581         Reviewed by Youenn Fablet.
1582
1583         No new tests, covered by existing tests.
1584
1585         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
1586         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
1587         to base class.
1588
1589         * Modules/mediastream/MediaDevicesRequest.cpp:
1590         (WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
1591         as passed salt.
1592
1593         * Modules/mediastream/MediaStreamTrack.cpp:
1594         (WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
1595         (WebCore::MediaStreamTrack::getCapabilities const): Ditto.
1596         * Modules/mediastream/MediaStreamTrack.h:
1597         * Modules/mediastream/MediaStreamTrack.idl:
1598
1599         * Modules/mediastream/UserMediaRequest.cpp:
1600         (WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
1601
1602         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1603         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
1604         to base class.
1605
1606         * Modules/webaudio/MediaStreamAudioSource.cpp:
1607         (WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
1608         * platform/mediastream/MediaConstraints.h:
1609
1610         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
1611         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
1612
1613         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
1614         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
1615
1616         * platform/mediastream/RealtimeMediaSource.cpp:
1617         (WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
1618         (WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
1619         (WebCore::RealtimeMediaSource::hashedId const): New.
1620         (WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
1621         * platform/mediastream/RealtimeMediaSource.h:
1622
1623         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1624         (WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
1625         a source.
1626         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
1627         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
1628         * platform/mediastream/RealtimeMediaSourceCenter.h:
1629
1630         * platform/mediastream/RealtimeMediaSourceFactory.h:
1631         * platform/mediastream/RealtimeVideoSource.cpp:
1632         (WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
1633         * platform/mediastream/RealtimeVideoSource.h:
1634
1635         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
1636         (WebCore::GStreamerAudioCaptureSource::create): Ditto.
1637         (WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
1638         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
1639
1640         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
1641         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
1642         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
1643         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
1644
1645         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
1646         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
1647         (WebCore::MockRealtimeAudioSource::create): Ditto.
1648         (WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
1649         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
1650
1651         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
1652         (WebCore::MockRealtimeVideoSource::create): Ditto.
1653         (WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
1654         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
1655
1656         * platform/mediastream/mac/AVVideoCaptureSource.h:
1657         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1658         (WebCore::AVVideoCaptureSource::create): Ditto.
1659         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
1660         (WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
1661         (WebCore::AVVideoCaptureSource::capabilities): Ditto.
1662
1663         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1664         (WebCore::CoreAudioCaptureSource::create): Update parameters.
1665         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
1666         (WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
1667         (WebCore::CoreAudioCaptureSource::settings): Ditto.
1668         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1669
1670         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
1671         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
1672         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
1673
1674         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
1675         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1676         (WebCore::MockRealtimeAudioSource::create): Ditto.
1677         (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
1678
1679         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
1680         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1681         (WebCore::MockRealtimeVideoSource::create): Ditto.
1682         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
1683
1684         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1685
1686         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
1687         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1688         (WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
1689         (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
1690         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
1691         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
1692         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
1693
1694         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
1695         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
1696         (WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
1697
1698         * platform/mock/MockRealtimeAudioSource.cpp:
1699         (WebCore::MockRealtimeAudioSource::create): Ditto.
1700         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
1701         (WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
1702         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
1703         * platform/mock/MockRealtimeAudioSource.h:
1704
1705         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1706
1707         * platform/mock/MockRealtimeVideoSource.cpp:
1708         (WebCore::MockRealtimeVideoSource::create): Update parameters.
1709         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
1710         (WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
1711         (WebCore::MockRealtimeVideoSource::settings): Ditto.
1712         * platform/mock/MockRealtimeVideoSource.h:
1713
1714 2018-10-02  Philippe Normand  <pnormand@igalia.com>
1715
1716         [GStreamer][playbin3] Stream tag lists leaks
1717         https://bugs.webkit.org/show_bug.cgi?id=190192
1718
1719         Reviewed by Xabier Rodriguez-Calvar.
1720
1721         The gst_stream_get_tags() result is transfer-full, so needs to be adopted to prevent a leak.
1722         Also check the tags list pointer which might be NULL in some cases.
1723
1724         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
1725         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
1726         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1727         (WebCore::MediaPlayerPrivateGStreamer::naturalSize const):
1728         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
1729         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
1730
1731 2018-10-01  Michael Catanzaro  <mcatanzaro@igalia.com>
1732
1733         Unreviewed, fix unused variable in RenderLayer::updateScrollableAreaSet
1734
1735         * rendering/RenderLayer.cpp:
1736         (WebCore::RenderLayer::calculateClipRects const): This is a prepare-ChangeLog bug. I don't
1737         have any changes in this function....
1738
1739 2018-10-02  Alicia Boya García  <aboya@igalia.com>
1740
1741         [MSE][GStreamer] Make same thread assert non-release
1742         https://bugs.webkit.org/show_bug.cgi?id=189924
1743
1744         Reviewed by Xabier Rodriguez-Calvar.
1745
1746         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1747         (WebCore::AppendPipeline::handleNewAppsinkSample):
1748
1749 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
1750
1751         Add a new variant of serializePreservingVisualAppearance which takes VisibleSelection
1752         https://bugs.webkit.org/show_bug.cgi?id=190108
1753
1754         Reviewed by Wenson Hsieh.
1755
1756         Added a version of serializePreservingVisualAppearance which takes VisibleSelection so that we can avoid creating
1757         a range simply to get the first node and the end node of the selection later. This simple change also fixes a bug
1758         demonstrated in editing/pasteboard/paste-table-003.html.
1759
1760         Test: editing/pasteboard/paste-table-003.html
1761
1762         * editing/cocoa/EditorCocoa.mm:
1763         (WebCore::Editor::selectionInHTMLFormat): Adopt the new variant.
1764         * editing/gtk/EditorGtk.cpp:
1765         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
1766         * editing/markup.cpp:
1767         (WebCore::serializePreservingVisualAppearance): Added.
1768         * editing/markup.h:
1769         * editing/wpe/EditorWPE.cpp:
1770         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
1771         * loader/archive/cf/LegacyWebArchive.cpp:
1772         (WebCore::LegacyWebArchive::createFromSelection): Ditto.
1773         * platform/win/PasteboardWin.cpp:
1774         (WebCore::Pasteboard::writeSelection): Ditto.
1775
1776 2018-10-01  Alex Christensen  <achristensen@webkit.org>
1777
1778         Don't read from WebCore's bundle for IDNScriptWhiteList
1779         https://bugs.webkit.org/show_bug.cgi?id=190157
1780
1781         Reviewed by Dan Bernstein.
1782
1783         No change in behavior.  This increases performance by not reading from the WebCore bundle,
1784         and it makes it so that URL-related functionality can be moved to a place without
1785         a bundle for resources.
1786
1787         * Resources/IDNScriptWhiteList.txt: Removed.
1788         * WebCore.xcodeproj/project.pbxproj:
1789         * platform/mac/WebCoreNSURLExtras.mm:
1790         (WebCore::whiteListIDNScripts):
1791         (WebCore::allCharactersInIDNScriptWhiteList):
1792         (WebCore::readIDNScriptWhiteListFile): Deleted.
1793
1794 2018-10-01  Alex Christensen  <achristensen@webkit.org>
1795
1796         Unreviewed, rolling out r236551.
1797
1798         Fails URL validating too aggressively
1799
1800         Reverted changeset:
1801
1802         "URLWithUserTypedString should return nil for URLs deemed to
1803         be invalid by WebCore::URL"
1804         https://bugs.webkit.org/show_bug.cgi?id=189979
1805         https://trac.webkit.org/changeset/236551
1806
1807 2018-10-01  Keith Miller  <keith_miller@apple.com>
1808
1809         Create a RELEASE_AND_RETURN macro for ExceptionScopes
1810         https://bugs.webkit.org/show_bug.cgi?id=190163
1811
1812         Reviewed by Mark Lam.
1813
1814         The new RELEASE_AND_RETURN does all the work for cases
1815         where you want to return the result of some expression
1816         without explicitly checking for an exception. This is
1817         much like the existing RETURN_IF_EXCEPTION macro.
1818
1819         No new tests since this is a refactor.
1820
1821         * bridge/runtime_array.cpp:
1822         (JSC::RuntimeArray::put):
1823
1824 2018-10-01  Daniel Bates  <dabates@apple.com>
1825
1826         Attempt to fix the watchOS build after <https://trac.webkit.org/changeset/236678>
1827         (https://bugs.webkit.org/show_bug.cgi?id=189974)
1828
1829         Explicitly cast index to unsigned to make the operator[] call unambiguous.
1830
1831         * platform/ios/KeyEventIOS.mm:
1832         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
1833
1834 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
1835
1836         ASAN failure in ~GCReachableRef()
1837         https://bugs.webkit.org/show_bug.cgi?id=190113
1838
1839         Reviewed by Darin Adler.
1840
1841         The bug was caused by ~GCReachableRef accessing Ref after it had been poisoned for ASAN
1842         in Ref::leakRef via Ref(Ref&& other). Fixed the bug by using RefPtr instead since that's
1843         the simplest solution here although we could unpoison Ref temporarily as done in ~Ref.
1844
1845         * dom/GCReachableRef.h:
1846         (WebCore::GCReachableRef::GCReachableRef):
1847         (WebCore::GCReachableRef::~GCReachableRef):
1848         (WebCore::GCReachableRef::operator-> const):
1849         (WebCore::GCReachableRef::get const):
1850         (WebCore::GCReachableRef::operator T& const):
1851         (WebCore::GCReachableRef::operator! const):
1852         (WebCore::GCReachableRef::isNull const): Deleted.
1853
1854 2018-10-01  Sihui Liu  <sihui_liu@apple.com>
1855
1856         Remove StorageProcess
1857         https://bugs.webkit.org/show_bug.cgi?id=189975
1858
1859         Reviewed by Geoffrey Garen.
1860
1861         Clean up code. No behavior change.
1862
1863         * English.lproj/Localizable.strings:
1864
1865 2018-10-01  Alicia Boya García  <aboya@igalia.com>
1866
1867         [MSE][GStreamer] Set a minimum sample duration
1868         https://bugs.webkit.org/show_bug.cgi?id=190125
1869
1870         Reviewed by Xabier Rodriguez-Calvar.
1871
1872         The last sample of the audio track in the asset used in this test
1873         player has a tiny duration (100 ns):
1874
1875         http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
1876
1877         So small, we were truncating it to zero. We're not supposed to have
1878         frames with zero duration. Instead, lets set a minimum frame duration
1879         for those fringe cases.
1880
1881         * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
1882         (WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
1883
1884 2018-10-01  Daniel Bates  <dabates@apple.com>
1885
1886         [iOS] Special keys are misidentified in DOM keyboard events
1887         https://bugs.webkit.org/show_bug.cgi?id=189974
1888
1889         Reviewed by Wenson Hsieh.
1890
1891         This patch fixes two issues:
1892             1. Special keyboard keys would be misidentified in dispatched DOM keyboard events.
1893             2. DOM keypress events may not be dispatched for some special keys.
1894
1895         UIKit uses special input strings to identify the Page Up, Page Down, Escape, Up Arrow, Down Arrow,
1896         Left Arrow, and Right Arrow keys. It also uses ASCII control characters to represent some other
1897         special keys, including Num Lock / Clear, Home, End, Forward Delete, and F1, ..., F24. We need
1898         to explicitly handle these special keyboard keys in order to be able to identify the key that
1899         was pressed as well as to correctly disambiguate a key down to know whether to dispatch a DOM
1900         keypress event for the key.
1901
1902         Unlike UIKit, AppKit reserves Unicode Private Use Area (PUA) code points in 0xF700–0xF8FF to
1903         represent special keyboard keys. This makes it straightforward to disambiguate such keys using
1904         the input string of the keyboard event alone. To simplify the implementation for iOS
1905         we normalize the input string be AppKit compatible. See the explaination for WebCore::windowsKeyCodeForCharCode()
1906         below for more details on why this is done.
1907
1908         Tests: fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element.html
1909                fast/events/ios/keypress-keys-in-non-editable-element.html
1910
1911         * SourcesCocoa.txt:
1912         * WebCore.xcodeproj/project.pbxproj:
1913         Do not use unified source build strategy when building WebEvent.mm as it makes
1914         use of SoftLinking macros that are incompatible with this strategy.
1915
1916         * platform/ios/KeyEventIOS.mm:
1917         (WebCore::windowsKeyCodeForCharCode): Recognize some special AppKit special char codes.
1918         These special char codes are generated by WebKit. WebKit uses the same special char codes
1919         as AppKit as a convenience instead of defining our own constants for the same purpose.
1920         Encoding the special UIKit input strings (e.g. up arrow) as distinct char codes allows us
1921         to use integer arithmetic and switch blocks to map characters to Windows virtual key
1922         codes as opposed to special cased branches to perform pointer or string comparisions.
1923         The latter would be necessary in Modern WebKit in order for key down events to be properly
1924         disambiguated to dispatch a DOM keypress event because pointers are not perserved, though
1925         what they point to is, when sending the WebEvent from UIProcess to the WebProcess and
1926         vice versa.
1927         (WebCore::isFunctionKey): Convenience function that determines whether the specified char
1928         code corresponds to a function key on the keyboard. The term "function key" is taken from
1929         AppKit parlance to describe a special keyboard key. These keys include F1, F2, ..., F24,
1930         and cursor keys among other special keyboard keys.
1931         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Write in terms of isFunctionKey().
1932         * platform/ios/PlatformEventFactoryIOS.h:
1933         * platform/ios/PlatformEventFactoryIOS.mm:
1934         (WebCore::keyIdentifierForKeyEvent): Remove code to handle UIKit special input strings as
1935         we now map such special input strings to char codes and hence can use the default code path.
1936         (WebCore::keyForKeyEvent): Ditto.
1937         (WebCore::codeForKeyEvent): Remove code to compute the Window virtual key code corresponding
1938         to a UIKit special key command now that we map such special input strings to char codes and
1939         subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
1940         constructors). So, we can now use WebEvent.keyCode directly to compute the DOM UIEvents code
1941         for the event.
1942         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Remove code to fix up
1943         WebEvent.keyCode to account for UIKit special input strings now that we map such special key
1944         commands to char codes and subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
1945         constructors). So, we can now take WebEvent.keyCode verbatim to be the Window virtual key code.
1946         (WebCore::convertSpecialKeyToCharCode): Deleted.
1947         (WebCore::keyCodeForEvent): Deleted.
1948         * platform/ios/WebEvent.mm:
1949         (normalizedStringWithAppKitCompatibilityMapping): Added; converts a UIKit character string
1950         to the corresponding AppKit-compatible one (if not already compatible). See the explaination
1951         for WebCore::windowsKeyCodeForCharCode() above for more details on why this is done.
1952
1953         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
1954         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
1955         Normalize the character strings to be AppKit compatible.
1956
1957 2018-10-01  Simon Fraser  <simon.fraser@apple.com>
1958
1959         Optimize RenderStyle::diff() and clean up the code
1960         https://bugs.webkit.org/show_bug.cgi?id=190104
1961
1962         Reviewed by Dan Bernstein.
1963
1964         RenderStyle::changeRequiresLayout() and related should only check values on 
1965         m_rareNonInheritedData and m_rareInheritedData after checking for pointer equality.
1966         To reduce the chances of future changes regressing this, move code comparing values
1967         on StyleRare[Non]InheritedData into dedication functions.
1968         
1969         In addition, the transform comparison double-compared the transformOperations,
1970         because m_rareNonInheritedData->transform != other.m_rareNonInheritedData->transform
1971         is a deep comparison, and it was followed by *m_rareNonInheritedData->transform != *other.m_rareNonInheritedData->transform.
1972         Change the first to be a pointer comparison.
1973
1974         * rendering/style/RenderStyle.cpp:
1975         (WebCore::rareNonInheritedDataChangeRequiresLayout):
1976         (WebCore::rareInheritedDataChangeRequiresLayout):
1977         (WebCore::RenderStyle::changeRequiresLayout const):
1978         (WebCore::rareNonInheritedDataChangeRequiresLayerRepaint):
1979         (WebCore::RenderStyle::changeRequiresLayerRepaint const):
1980         (WebCore::rareNonInheritedDataChangeRequiresRepaint):
1981         (WebCore::rareInheritedDataChangeRequiresRepaint):
1982         (WebCore::RenderStyle::changeRequiresRepaint const):
1983
1984 2018-10-01  Alex Christensen  <achristensen@webkit.org>
1985
1986         URL should not use TextEncoding internally
1987         https://bugs.webkit.org/show_bug.cgi?id=190111
1988
1989         Reviewed by Andy Estes.
1990
1991         That dependency makes it impossible to move or use elsewhere.
1992         Using TextEncoding was overkill because we know the credentials are UTF-8 percent-encoded in a parsed URL.
1993         No change in behavior as verified by new API tests.
1994
1995         * page/SecurityOrigin.cpp:
1996         * page/csp/ContentSecurityPolicySourceList.cpp:
1997         * platform/URL.cpp:
1998         (WebCore::decodeEscapeSequencesFromParsedURL):
1999         (WebCore::URL::user const):
2000         (WebCore::URL::pass const):
2001         (WebCore::URL::fileSystemPath const):
2002         (WebCore::decodeURLEscapeSequences): Deleted.
2003         * platform/URL.h:
2004         * platform/network/DataURLDecoder.cpp:
2005         * platform/text/TextEncoding.cpp:
2006         (WebCore::decodeURLEscapeSequences):
2007         * platform/text/TextEncoding.h:
2008
2009 2018-10-01  Simon Pieters  <zcorpan@gmail.com>
2010
2011         <form> in quirks mode should have margin-block-end: 1em
2012         https://bugs.webkit.org/show_bug.cgi?id=157788
2013
2014         Reviewed by Simon Fraser.
2015
2016         Change the default style for forms to take writing-mode into account
2017         in quirks mode. Matches the behavior of Gecko and Edge and the HTML
2018         standard.
2019
2020         Spec: https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3
2021
2022         Test: imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/form-margin-quirk.html
2023
2024         * css/quirks.css:
2025         (form):
2026
2027 2018-10-01  Jeremy Jones  <jeremyj@apple.com>
2028
2029         Unify implementation in VideoFullscreenInterfaceAVKit
2030         https://bugs.webkit.org/show_bug.cgi?id=190091
2031         rdar://problem/44734523
2032
2033         Reviewed by Jer Noble.
2034
2035         No new tests because no behavior change.
2036
2037         Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
2038         any changes that had been made in the old path.
2039
2040         * platform/ios/VideoFullscreenInterfaceAVKit.h:
2041         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2042         (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
2043         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
2044         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2045         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2046         (VideoFullscreenControllerContext::requestUpdateInlineRect):
2047         (VideoFullscreenControllerContext::requestVideoContentLayer):
2048         (VideoFullscreenControllerContext::returnVideoContentLayer):
2049         (VideoFullscreenControllerContext::didSetupFullscreen):
2050         (VideoFullscreenControllerContext::didExitFullscreen):
2051
2052 2018-10-01  Antoine Quint  <graouts@apple.com>
2053
2054         [Web Animations] Ensure renderers with accelerated animations have layers
2055         https://bugs.webkit.org/show_bug.cgi?id=189990
2056
2057         Reviewed by Simon Fraser.
2058
2059         In r236501 we added code that would make a RenderBox and a RenderInline query the document timeline for whether a given element has
2060         accelerated animations running on it. Since the calls to requiresLayer() are in a hot path, we instead keep a list of elements with
2061         exclusively accelerated animations running.
2062
2063         No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html
2064         which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element.
2065
2066         * animation/AnimationTimeline.h:
2067         * animation/DocumentTimeline.cpp:
2068         (WebCore::DocumentTimeline::detachFromDocument):
2069         (WebCore::DocumentTimeline::animationWasAddedToElement):
2070         (WebCore::DocumentTimeline::animationWasRemovedFromElement):
2071         (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
2072         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Iterate over an element's animations to determine
2073         whether all of its animations are running accelerated, then update the HashSet containing elements running accelerated animations to remove or
2074         add this element.
2075         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): Make a simple contains() call on the HashSet containing elements
2076         running accelerated animations.
2077         * animation/DocumentTimeline.h:
2078         * animation/KeyframeEffectReadOnly.cpp:
2079         (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState):
2080         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
2081         * rendering/RenderBoxModelObject.h:
2082
2083 2018-10-01  Alicia Boya García  <aboya@igalia.com>
2084
2085         [GStreamer] Fix abort in gst_sample_get_info()
2086         https://bugs.webkit.org/show_bug.cgi?id=190135
2087
2088         Reviewed by Philippe Normand.
2089
2090         A flush can occur before any frame has finished decoding -- especially
2091         in tests, where actions on the player often occur in quick succession.
2092
2093         Therefore, the code must not assume by the time a flush occurs any
2094         frame has reached the sink. This patch fixes a case when such wrong
2095         assumption was causing gst_sample_get_info() to abort (crashing
2096         WebKit).
2097
2098         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2099         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
2100         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
2101
2102 2018-10-01  Olivier Blin  <olivier.blin@softathome.com>
2103
2104         [WPE] fix buffer over-read in RenderThemeWPE::mediaControlsStyleSheet()
2105         https://bugs.webkit.org/show_bug.cgi?id=190139
2106
2107         Reviewed by Michael Catanzaro.
2108
2109         Like done upstream for EFL in r210213
2110         https://bugs.webkit.org/show_bug.cgi?id=166622
2111
2112         This has been detected by a charactersAreAllASCII() assert failure.
2113
2114         This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet().
2115         mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string.
2116         It is thus incorrect to use StringImpl::createFromLiteral() that calls
2117         strlen() to get the string length.
2118
2119         The String::ConstructFromLiteral constructor can not be used, since it
2120         skips the last character.
2121
2122         * platform/wpe/RenderThemeWPE.cpp:
2123         (WebCore::RenderThemeWPE::mediaControlsStyleSheet):
2124         Explicitely pass the size to the String constructor.
2125
2126 2018-10-01  Rob Buis  <rbuis@igalia.com>
2127
2128         Align XMLHttpRequest's overrideMimeType() with the standard
2129         https://bugs.webkit.org/show_bug.cgi?id=169276
2130
2131         Reviewed by Chris Dumez.
2132
2133         Implement the overrideMimeType() as specified in that standard, i.e.
2134         add a check that the passed mime type is valid and if not fallback
2135         to application/octet-stream.
2136
2137         In order for this patch to have any effect, I went ahead and
2138         made an improvement to the ContentType parsing, parseContentType now
2139         will reject mime types that do not match the type / subtype format, I
2140         believe this is required by both RFC2045 and mimesniff specs.
2141
2142         This behavior matches Chrome and Firefox.
2143
2144         Test: web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm
2145
2146         * platform/network/ParsedContentType.cpp:
2147         (WebCore::parseContentType):
2148         * xml/XMLHttpRequest.cpp:
2149         (WebCore::XMLHttpRequest::overrideMimeType):
2150
2151
2152 2018-10-01  Chris Dumez  <cdumez@apple.com>
2153
2154         Make crossOriginObject.then undefined for promises
2155         https://bugs.webkit.org/show_bug.cgi?id=190094
2156
2157         Reviewed by Darin Adler.
2158
2159         Make crossOriginObject.then undefined for promises. This allows promises to work better with cross-origin WindowProxy
2160         and Location objects.
2161
2162         Specification:
2163         - https://github.com/whatwg/html/pull/3242
2164         - https://github.com/whatwg/dom/issues/536
2165
2166         This aligns our behavior with Blink and Gecko.
2167
2168         No new tests, rebaselined existing test.
2169
2170         * bindings/js/JSDOMWindowCustom.cpp:
2171         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2172         (WebCore::addCrossOriginWindowOwnPropertyNames):
2173         * bindings/js/JSLocationCustom.cpp:
2174         (WebCore::getOwnPropertySlotCommon):
2175         (WebCore::addCrossOriginLocationOwnPropertyNames):
2176
2177 2018-10-01  Xan Lopez  <xan@igalia.com>
2178
2179         [SOUP] Fix the build for libsoup > 2.61.90
2180         https://bugs.webkit.org/show_bug.cgi?id=190126
2181
2182         Reviewed by Michael Catanzaro.
2183
2184         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2185
2186 2018-10-01  Alicia Boya García  <aboya@igalia.com>
2187
2188         [MSE][GStreamer] Reset running time in PlaybackPipeline::flush()
2189         https://bugs.webkit.org/show_bug.cgi?id=190076
2190
2191         Reviewed by Philippe Normand.
2192
2193         Test: media/media-source/media-source-seek-redundant-append.html
2194
2195         PlaybackPipeline::flush() is called when already enqueued frames are
2196         appended again. This may be caused by a quality change or just a
2197         redundant append. Either way, the pipeline has to be flushed and
2198         playback begin again, but without changing the player position by
2199         much.
2200
2201         There are two kinds of time to consider here: stream time (i.e. the
2202         time of a frame as written in the file, e.g. a frame may have stream
2203         time 0:01:00), and running time (i.e. how much time since playback
2204         started should pass before the frame should be played, e.g. if we
2205         started playing at 0:00:59 that same frame would have a running time
2206         of just 1 second).
2207
2208         Notice how running time depends on where and when playback starts.
2209         Running time can also be optionally resetted after a flush. (This is
2210         indeed done currently by most demuxers after a seek.)
2211
2212         Instead of resetting running time, PlaybackPipeline used to modify the
2213         first GstSegment emitted after the flush. A GstSegment declares the
2214         mapping between stream time and running time for the following frames.
2215         There, PlaybackPipeline used to set `base` (the running time at which
2216         the segment starts) to the position reported by a position query
2217         (which is stream time).
2218
2219         This, of course, only worked when playback (or the last seek) started
2220         at stream time 0:00:00, since that's the only case where running time
2221         equals stream time. In other cases delays as long as the difference
2222         between these timelines would appear. This is demonstrated in the
2223         attached test, where seeks and appends are made in such an order that
2224         the difference is more than 5 minutes, making the playback stall for
2225         >5 minutes before playing 1 second of audio.
2226
2227         This patch fixes the problem by resetting running time with the flush
2228         and not modifying GstSegment.base anymore (it will be left as zero,
2229         which is now correct since the running time has been reset).
2230
2231         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2232         (WebCore::PlaybackPipeline::flush):
2233         (WebCore::segmentFixerProbe): Deleted.
2234
2235 2018-09-30  Ryosuke Niwa  <rniwa@webkit.org>
2236
2237         Use Position instead of Range in createMarkupInternal
2238         https://bugs.webkit.org/show_bug.cgi?id=190107
2239
2240         Reviewed by Darin Adler.
2241
2242         Use two Position's indicating start and end instead of Range in createMarkupInternal and StylizedMarkupAccumulator
2243         in order to support copy & paste across shadow boundaries in the bug 157443. This patch also removes the use of
2244         Range in MarkupAccumulator since all uses of range is via StylizedMarkupAccumulator.
2245
2246         Also renamed createMarkupInternal to serializePreservingVisualAppearanceInternal to match the rename in r236612.
2247
2248         * dom/Position.cpp:
2249         (WebCore::Position::firstNode const):  Added.
2250         * dom/Position.h:
2251         * editing/MarkupAccumulator.cpp:
2252         (WebCore::MarkupAccumulator::MarkupAccumulator): No longer takes Range.
2253         (WebCore::MarkupAccumulator::appendText): Removed the code to truncate string at the boundary points of the range.
2254         * editing/MarkupAccumulator.h:
2255         (WebCore::MarkupAccumulator): Made this class non-copyable.
2256         * editing/markup.cpp:
2257         (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator): Now takes and stores two positions.
2258
2259         (WebCore::StyledMarkupAccumulator::appendText): Use textContentRespectingRange in the case annotation is disabled
2260         instead of calling to MarkupAccumulator::appendText, which no longer respects boundary offsets.
2261
2262         (WebCore::StyledMarkupAccumulator::renderedTextRespectingRange): Renamed from renderedText. Updated to respect
2263         boundary offsets defined by m_start and m_end Positions instead of m_range Range.
2264
2265         (WebCore::StyledMarkupAccumulator::textContentRespectingRange): Renamed from stringValueForRange. Ditto.
2266
2267         (WebCore::StyledMarkupAccumulator::serializeNodes): Now computes startNode and pastEnd nodes from start and end
2268         Positions. Note that the end position is always the next node in the tree order  for a character node
2269         and computeNodeAfterPosition returns nullptr for a character data.
2270
2271         (WebCore::highestAncestorToWrapMarkup): Now takes two positions instead of a range.
2272
2273         (WebCore::serializePreservingVisualAppearanceInternal): Renamed from createMarkupInternal. Removed the obsolete
2274         comments which were added for DOMRange in WebKitLegacy.
2275
2276         (WebCore::serializePreservingVisualAppearance):
2277
2278         (WebCore::sanitizedMarkupForFragmentInDocument): Create positions instead of a range to pass to
2279         serializePreservingVisualAppearanceInternal.
2280
2281         (WebCore::serializeFragment):
2282
2283         * editing/markup.h:
2284         * page/PageSerializer.cpp:
2285         (WebCore::PageSerializer::SerializerMarkupAccumulator): Removed the unnecessary WebCore namespace qualifier.
2286
2287 2018-09-30  Walker Henderson  <wjahenderson@gmail.com>
2288
2289         AudioNode.connect should return passed destination node
2290         https://bugs.webkit.org/show_bug.cgi?id=188834
2291
2292         Reviewed by Eric Carlson.
2293
2294         No new tests, rebaselined existing test.
2295
2296         * Modules/webaudio/AudioBasicInspectorNode.cpp:
2297         (WebCore::AudioBasicInspectorNode::connect): Deleted.
2298         * Modules/webaudio/AudioBasicInspectorNode.h:
2299         * Modules/webaudio/AudioNode.cpp:
2300         * Modules/webaudio/AudioNode.h:
2301         * Modules/webaudio/AudioNode.idl:
2302
2303 2018-09-30  Eric Carlson  <eric.carlson@apple.com>
2304
2305         [MediaStream] Clean up RealtimeMediaSource settings change handling
2306         https://bugs.webkit.org/show_bug.cgi?id=189998
2307         <rdar://problem/44797884>
2308
2309         Reviewed by Youenn Fablet.
2310
2311         No new tests, updated webrtc/video-disabled-black.html.
2312
2313         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2314         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
2315         (WebCore::CanvasCaptureMediaStreamTrack::Source::settings):
2316         (WebCore::CanvasCaptureMediaStreamTrack::Source::settingsDidChange):
2317         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
2318         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
2319         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2320         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2321         (WebCore::RealtimeIncomingVideoSource::settings):
2322         (WebCore::RealtimeIncomingVideoSource::settingsDidChange):
2323         * platform/mediastream/RealtimeIncomingVideoSource.h:
2324         * platform/mediastream/RealtimeMediaSource.cpp:
2325         (WebCore::RealtimeMediaSource::settingsDidChange):
2326         (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
2327         (WebCore::RealtimeMediaSource::setSize):
2328         (WebCore::RealtimeMediaSource::setFrameRate):
2329         (WebCore::RealtimeMediaSource::setAspectRatio):
2330         (WebCore::RealtimeMediaSource::setFacingMode):
2331         (WebCore::RealtimeMediaSource::setVolume):
2332         (WebCore::RealtimeMediaSource::setSampleRate):
2333         (WebCore::RealtimeMediaSource::setSampleSize):
2334         (WebCore::RealtimeMediaSource::setEchoCancellation):
2335         * platform/mediastream/RealtimeMediaSource.h:
2336         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
2337         (WebCore::GStreamerAudioCaptureSource::settingsDidChange):
2338         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
2339         (WebCore::GStreamerVideoCaptureSource::settingsDidChange):
2340         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2341         (WebCore::AVVideoCaptureSource::settingsDidChange):
2342         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2343         (WebCore::CoreAudioCaptureSource::settingsDidChange):
2344         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2345         (WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
2346         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2347         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
2348         * platform/mock/MockRealtimeAudioSource.cpp:
2349         (WebCore::MockRealtimeAudioSource::settingsDidChange):
2350         * platform/mock/MockRealtimeVideoSource.cpp:
2351         (WebCore::MockRealtimeVideoSource::settingsDidChange):
2352
2353 2018-09-30  Eric Carlson  <eric.carlson@apple.com>
2354
2355         [MediaStream] Use display-specific capture factories
2356         https://bugs.webkit.org/show_bug.cgi?id=190043
2357         <rdar://problem/44834412>
2358
2359         Reviewed by Youenn Fablet.
2360
2361         No new tests, no change in functionality.
2362
2363         * Sources.txt:
2364         * WebCore.xcodeproj/project.pbxproj:
2365         * platform/mediastream/RealtimeMediaSource.cpp:
2366         (WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory): Deleted.
2367         (WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory): Deleted.
2368         * platform/mediastream/RealtimeMediaSource.h:
2369         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2370         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
2371         (WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
2372         * platform/mediastream/RealtimeMediaSourceCenter.h:
2373         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
2374         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
2375         * platform/mediastream/RealtimeMediaSourceFactory.cpp: Added.
2376         (WebCore::SingleSourceFactory::setActiveSource):
2377         (WebCore::SingleSourceFactory::unsetActiveSource):
2378         * platform/mediastream/RealtimeMediaSourceFactory.h: Added.
2379         (WebCore::SingleSourceFactory::activeSource):
2380         (WebCore::VideoCaptureFactory::setVideoCapturePageState):
2381         (WebCore::DisplayCaptureFactory::setDisplayCapturePageState):
2382         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
2383         (WebCore::libWebRTCVideoCaptureSourceFactory):
2384         (WebCore::libWebRTCDisplayCaptureSourceFactory):
2385         (WebCore::GStreamerVideoCaptureSource::factory):
2386         (WebCore::GStreamerVideoCaptureSource::displayFactory):
2387         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
2388         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
2389         (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory):
2390         (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory):
2391         (WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory):
2392         (WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory):
2393         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
2394         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2395         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
2396         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2397         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2398         (WebCore::CoreAudioCaptureSource::factory):
2399         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2400         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2401         (WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory):
2402         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory):
2403         (WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory):
2404         (WebCore::RealtimeMediaSourceCenterMac::audioFactory):
2405         (WebCore::RealtimeMediaSourceCenterMac::videoFactory):
2406         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory):
2407         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
2408         * platform/mock/MockRealtimeAudioSource.cpp:
2409         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
2410         (WebCore::MockRealtimeAudioSource::startProducingData):
2411         (): Deleted.
2412         (WebCore::mockAudioCaptureSourceFactory): Deleted.
2413         (WebCore::MockRealtimeAudioSource::factory): Deleted.
2414         * platform/mock/MockRealtimeAudioSource.h:
2415         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2416         (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState):
2417         (WebCore::MockRealtimeMediaSourceCenter::audioFactory):
2418         (WebCore::MockRealtimeMediaSourceCenter::videoFactory):
2419         (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
2420         * platform/mock/MockRealtimeMediaSourceCenter.h:
2421         * platform/mock/MockRealtimeVideoSource.cpp:
2422         (): Deleted.
2423         (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): Deleted.
2424         (WebCore::mockVideoCaptureSourceFactory): Deleted.
2425         (WebCore::MockRealtimeVideoSource::factory): Deleted.
2426         * platform/mock/MockRealtimeVideoSource.h:
2427
2428 2018-09-29  Oriol Brufau  <obrufau@igalia.com>
2429
2430         [css-grid] Properly align items next to collapsed tracks with gutters
2431         https://bugs.webkit.org/show_bug.cgi?id=190089
2432
2433         Reviewed by Manuel Rego Casasnovas.
2434
2435         gridAreaPositionForInFlowChild could return a wrong end position for
2436         grid items adjacent to a collapsed track, because it didn't take into
2437         account that gutters collapse in that case. Therefore, "center" or
2438         "end" alignments displayed the item at the wrong position.
2439
2440         Test: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-013.html
2441
2442         * rendering/RenderGrid.cpp:
2443         (WebCore::RenderGrid::gridAreaPositionForInFlowChild const):
2444
2445 2018-09-29  Alicia Boya García  <aboya@igalia.com>
2446
2447         [GStreamer][MSE] Use GObject for GST_TRACE_OBJECT
2448         https://bugs.webkit.org/show_bug.cgi?id=190045
2449
2450         Reviewed by Philippe Normand.
2451
2452         Passing a non-GObject object to GST_TRACE_OBJECT() can be
2453         theoretically misunderstood by the GStreamer logging function, so this
2454         patch avoids that.
2455
2456         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2457         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
2458         (WebCore::AppendPipeline::handleEndOfAppend):
2459         (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
2460         (WebCore::AppendPipeline::pushNewBuffer):
2461
2462 2018-09-28  Zamiul Haque  <zhaque@apple.com>
2463
2464         Angled gradient backgrounds in body render vertically when body height is 0
2465         https://bugs.webkit.org/show_bug.cgi?id=177232
2466         <rdar://problem/34548230>.
2467
2468         Reviewed by Tim Horton.
2469
2470         Specifically, gradients displayed at an angle (ie. 45 degrees) are rendered
2471         as if they are vertical when the body tag containing the gradient
2472         has a height of 0. Other browsers do not render under these circumstances,
2473         so WebKit was modified to follow in suit. The problem was due to layout sizes for
2474         fill tiles being calculated with a minimum height of 1px. A simple change of the
2475         minimum height and width to 0px was enough to bring about the desired behavior.
2476
2477         Tests: angled-background-repeating-gradient-rendering-vertical.html
2478
2479         * rendering/RenderBoxModelObject.cpp:
2480         (WebCore::RenderBoxModelObject::calculateFillTileSize const):
2481
2482 2018-09-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2483
2484         No DOM API to instantiate an attachment for an img element
2485         https://bugs.webkit.org/show_bug.cgi?id=189934
2486         <rdar://problem/44743222>
2487
2488         Reviewed by Ryosuke Niwa.
2489
2490         Adds support for HTMLAttachmentElement.getAttachmentIdentifier, a function that internal WebKit clients can use
2491         to ensure that an image element is backed by a unique _WKAttachment. See below for more details.
2492
2493         Tests:  WKAttachmentTests.AddAttachmentToConnectedImageElement
2494                 WKAttachmentTests.ChangeFileWrapperForPastedImage
2495                 WKAttachmentTests.ConnectImageWithAttachmentToDocument
2496
2497         * dom/Document.cpp:
2498         (WebCore::Document::registerAttachmentIdentifier):
2499
2500         Add a new hook to register an empty _WKAttachment in the UI process with a given identifier. Used when creating
2501         a new empty attachment to back an image element.
2502
2503         * dom/Document.h:
2504         * editing/Editor.cpp:
2505         (WebCore::Editor::registerAttachmentIdentifier):
2506         (WebCore::Editor::notifyClientOfAttachmentUpdates):
2507         * editing/Editor.h:
2508         * html/HTMLAttachmentElement.cpp:
2509         (WebCore::HTMLAttachmentElement::getAttachmentIdentifier):
2510
2511         Creates an attachment element to back the image element, if an attachment does not already exist, and returns
2512         the unique identifier. This also causes an empty corresponding _WKAttachment to be created in the client, whose
2513         file wrapper determines the contents of the image.
2514
2515         (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):
2516         (WebCore::HTMLAttachmentElement::hasEnclosingImage const):
2517         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
2518
2519         Add a helper that updates the source of the enclosing image element given a content type and image data, by
2520         creating a new blob and blob URL.
2521
2522         * html/HTMLAttachmentElement.h:
2523         * html/HTMLAttachmentElement.idl:
2524         * html/HTMLImageElement.idl:
2525
2526         Rename webkitAttachmentIdentifier to just attachmentIdentifier.
2527
2528         * page/EditorClient.h:
2529         (WebCore::EditorClient::registerAttachmentIdentifier):
2530         (WebCore::EditorClient::didInsertAttachmentWithIdentifier):
2531
2532 2018-09-28  Chris Dumez  <cdumez@apple.com>
2533
2534         The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString
2535         https://bugs.webkit.org/show_bug.cgi?id=190090
2536
2537         Reviewed by Ryosuke Niwa.
2538
2539         The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString:
2540         - https://html.spec.whatwg.org/#onbeforeunloadeventhandler
2541         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5)
2542
2543         In particular, this means that returning false in an OnBeforeUnloadEventHandler should NOT
2544         cancel the event when the event is a CustomEvent (and not a BeforeUnloadEvent). This is
2545         because the return value cannot be false at:
2546         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5. Otherwise case).
2547
2548         No new tests, rebaselined existing test.
2549
2550         * bindings/js/JSEventListener.cpp:
2551         (WebCore::JSEventListener::handleEvent):
2552
2553 2018-09-28  Simon Fraser  <simon.fraser@apple.com>
2554
2555         RenderLayer::removeOnlyThisLayer() should not call updateLayerPositions()
2556         https://bugs.webkit.org/show_bug.cgi?id=190093
2557
2558         Reviewed by Dean Jackson and Zalan Bujtas.
2559         
2560         It's wrong for RenderLayer::removeOnlyThisLayer() to call updateLayerPositions(),
2561         because this is called at style update time, and layout will be stale.
2562         
2563         It was added (see webkit.org/b/25252) so that opacity changes, which can destroy layers, correctly update
2564         descendants. However, RenderStyle::changeRequiresLayout() checks for opacity <=> no opacity
2565         changes and triggers layout accordingly, which will result in a full post-layout
2566         updateLayerPositions().
2567         
2568         This also revealed that changes to the "isolate" property fail to trigger any kind of style recalc or layout;
2569         we need it to trigger layout (for now) because it affects z-order.
2570
2571         Covered by existing tests.
2572
2573         * rendering/RenderLayer.cpp:
2574         (WebCore::RenderLayer::removeOnlyThisLayer):
2575         * rendering/style/RenderStyle.cpp:
2576         (WebCore::RenderStyle::changeRequiresLayout const):
2577
2578 2018-09-28  Jiewen Tan  <jiewen_tan@apple.com>
2579
2580         [WebAuthN] Polish WebAuthN auto-test environment
2581         https://bugs.webkit.org/show_bug.cgi?id=189283
2582         <rdar://problem/44117828>
2583
2584         Reviewed by Chris Dumez.
2585
2586         This patch removes the old mocking mechanism.
2587
2588         Tests: http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html
2589                http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html
2590                http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html
2591
2592         * DerivedSources.make:
2593         * WebCore.xcodeproj/project.pbxproj:
2594         * testing/Internals.cpp:
2595         (WebCore::Internals::Internals):
2596         (WebCore::Internals::mockAuthenticatorCoordinator const): Deleted.
2597         * testing/Internals.h:
2598         * testing/Internals.idl:
2599         * testing/MockAuthenticatorCoordinator.cpp: Removed.
2600         * testing/MockAuthenticatorCoordinator.h: Removed.
2601         * testing/MockAuthenticatorCoordinator.idl: Removed.
2602
2603 2018-09-28  Jer Noble  <jer.noble@apple.com>
2604
2605         Refactoring: eliminate raw pointer usage in Fullscreen code
2606         https://bugs.webkit.org/show_bug.cgi?id=188747
2607         <rdar://problem/43541164>
2608
2609         Reviewed by Alex Christensen.
2610
2611         Two sources of raw pointers in the Fullscreen code:
2612         - Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so
2613           they are passed around as raw references.
2614         - Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and
2615           VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't
2616           be ref-able.
2617
2618         Make Model classes ref-able by adding ref() and deref() which call virtual refModel and
2619         derefModel methods, overridden by implementing subclasses. Make every concrete observer
2620         inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around
2621         the client interface.
2622
2623         Since every Interface class now holds a strong reference to its Model classes, and each
2624         Model class holds a weak reference to all its clients, no explicit invalidate() method
2625         is necessary.
2626
2627         Notes:
2628
2629         - Since the weak pointer methods need to be able to downcast to the abstract base class,
2630           observers need to inherit publically (rather than privately) from those base classes.
2631         - Media element Models should compose EventListener rather than inheriting from it, since
2632           EventListener has its own RefCount.
2633         - WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when
2634           their underlying object is destroyed), so clients should be stored in a Vector instead.
2635         - Interfaces should be given all required Refs at creation time, so that they can store
2636           those parameters as Refs instead of RefPtrs.
2637
2638         * platform/cocoa/PlaybackSessionInterface.h:
2639         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted.
2640         * platform/cocoa/PlaybackSessionModel.h:
2641         (WebCore::PlaybackSessionModel::ref):
2642         (WebCore::PlaybackSessionModel::deref):
2643         (WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted.
2644         * platform/cocoa/PlaybackSessionModelMediaElement.h:
2645         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
2646         (WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement):
2647         (WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement):
2648         (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
2649         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
2650         (WebCore::PlaybackSessionModelMediaElement::addClient):
2651         (WebCore::PlaybackSessionModelMediaElement::removeClient):
2652         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
2653         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices):
2654         (WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted.
2655         * platform/cocoa/VideoFullscreenChangeObserver.h:
2656         (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted.
2657         * platform/cocoa/VideoFullscreenModel.h:
2658         (WebCore::VideoFullscreenModel::ref):
2659         (WebCore::VideoFullscreenModel::deref):
2660         (WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted.
2661         * platform/cocoa/VideoFullscreenModelVideoElement.h:
2662         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
2663         (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
2664         (VideoFullscreenModelVideoElement::setVideoElement):
2665         (VideoFullscreenModelVideoElement::addClient):
2666         (VideoFullscreenModelVideoElement::removeClient):
2667         (VideoFullscreenModelVideoElement::setHasVideo):
2668         (VideoFullscreenModelVideoElement::setVideoDimensions):
2669         (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
2670         (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
2671         (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
2672         (VideoFullscreenModelVideoElement::willExitPictureInPicture):
2673         (VideoFullscreenModelVideoElement::didExitPictureInPicture):
2674         (VideoFullscreenModelVideoElement::handleEvent): Deleted.
2675         * platform/ios/PlaybackSessionInterfaceAVKit.h:
2676         (WebCore::PlaybackSessionInterfaceAVKit::create):
2677         (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
2678         (): Deleted.
2679         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
2680         (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
2681         (WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
2682         (WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted.
2683         * platform/ios/VideoFullscreenInterfaceAVKit.h:
2684         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2685         (-[WebAVPlayerLayer layoutSublayers]):
2686         (-[WebAVPlayerLayer resolveBounds]):
2687         (-[WebAVPlayerLayer setVideoGravity:]):
2688         (VideoFullscreenInterfaceAVKit::create):
2689         (VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit):
2690         (VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit):
2691         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
2692         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
2693         (VideoFullscreenInterfaceAVKit::setupFullscreen):
2694         (VideoFullscreenInterfaceAVKit::presentingViewController):
2695         (VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
2696         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
2697         (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
2698         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
2699         (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
2700         (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
2701         (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
2702         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2703         (VideoFullscreenInterfaceAVKit::doSetup):
2704         (VideoFullscreenInterfaceAVKit::setMode):
2705         (VideoFullscreenInterfaceAVKit::clearMode):
2706         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted.
2707         (VideoFullscreenInterfaceAVKit::invalidate): Deleted.
2708         * platform/ios/WebAVPlayerController.h:
2709         * platform/ios/WebAVPlayerController.mm:
2710         (-[WebAVPlayerController delegate]):
2711         (-[WebAVPlayerController playbackSessionInterface]):
2712         (-[WebAVPlayerController setPlaybackSessionInterface:]):
2713         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2714         (VideoFullscreenControllerContext::didCleanupFullscreen):
2715         (VideoFullscreenControllerContext::addClient):
2716         (VideoFullscreenControllerContext::removeClient):
2717         (VideoFullscreenControllerContext::willEnterPictureInPicture):
2718         (VideoFullscreenControllerContext::didEnterPictureInPicture):
2719         (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
2720         (VideoFullscreenControllerContext::willExitPictureInPicture):
2721         (VideoFullscreenControllerContext::didExitPictureInPicture):
2722         (VideoFullscreenControllerContext::setUpFullscreen):
2723         * platform/mac/PlaybackSessionInterfaceMac.h:
2724         * platform/mac/PlaybackSessionInterfaceMac.mm:
2725         (WebCore::PlaybackSessionInterfaceMac::create):
2726         (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
2727         (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
2728         (WebCore::PlaybackSessionInterfaceMac::rateChanged):
2729         (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
2730         (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
2731         (WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager):
2732         (WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
2733         (WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted.
2734         (WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted.
2735         * platform/mac/VideoFullscreenInterfaceMac.h:
2736         (WebCore::VideoFullscreenInterfaceMac::create):
2737         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
2738         (WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const):
2739         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
2740         * platform/mac/VideoFullscreenInterfaceMac.mm:
2741         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
2742         (-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]):
2743         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
2744         (-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]):
2745         (-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]):
2746         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
2747         (WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac):
2748         (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
2749         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
2750         (WebCore::VideoFullscreenInterfaceMac::setMode):
2751         (WebCore::VideoFullscreenInterfaceMac::clearMode):
2752         (WebCore::VideoFullscreenInterfaceMac::invalidate):
2753         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP):
2754         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted.
2755         * platform/mac/WebPlaybackControlsManager.mm:
2756         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
2757         (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
2758         (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
2759         (-[WebPlaybackControlsManager togglePlayback]):
2760         (-[WebPlaybackControlsManager setPlaying:]):
2761         (-[WebPlaybackControlsManager isPlaying]):
2762         (-[WebPlaybackControlsManager togglePictureInPicture]):
2763
2764 2018-09-28  Chris Dumez  <cdumez@apple.com>
2765
2766         Drop support for cross-origin-window-policy header
2767         https://bugs.webkit.org/show_bug.cgi?id=190081
2768
2769         Reviewed by Ryosuke Niwa.
2770
2771         Drop support for cross-origin-window-policy header as this was never enabled and its design has
2772         some issues we have not resolved. An alternative is being worked on but will be substantially
2773         different so there is not much value in keeping this code around.
2774
2775         * bindings/js/JSDOMBindingSecurity.cpp:
2776         * bindings/js/JSDOMBindingSecurity.h:
2777         * bindings/js/JSDOMWindowCustom.cpp:
2778         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2779         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2780         (WebCore::addCrossOriginWindowPropertyNames):
2781         (WebCore::addScopedChildrenIndexes):
2782         (WebCore::addCrossOriginWindowOwnPropertyNames):
2783         (WebCore::JSDOMWindow::getOwnPropertyNames):
2784         * bindings/js/JSDOMWindowCustom.h:
2785         * bindings/js/JSRemoteDOMWindowCustom.cpp:
2786         * bindings/scripts/CodeGeneratorJS.pm:
2787         (GenerateAttributeGetterBodyDefinition):
2788         (GenerateAttributeSetterBodyDefinition):
2789         (GenerateOperationBodyDefinition):
2790         * bindings/scripts/IDLAttributes.json:
2791         * dom/Document.cpp:
2792         (WebCore::Document::canNavigate):
2793         * loader/FrameLoader.cpp:
2794         (WebCore::FrameLoader::didBeginDocument):
2795         * page/AbstractDOMWindow.cpp:
2796         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
2797         * page/AbstractDOMWindow.h:
2798         * page/DOMWindow.idl:
2799         * page/Settings.yaml:
2800         * platform/network/HTTPParsers.cpp:
2801         * platform/network/HTTPParsers.h:
2802
2803 2018-09-28  Daniel Bates  <dabates@apple.com>
2804
2805         [iOS] Allow programmatic focus when hardware keyboard is attached
2806         https://bugs.webkit.org/show_bug.cgi?id=190017
2807         <rdar://problem/42270463>
2808
2809         Reviewed by Wenson Hsieh.
2810
2811         Add support for checking if the embedding client is WebKitTestRunner and export isDumpRenderTree()
2812         so that we can make use of it from WebKit. We will make use of these functions to keep the current
2813         behavior of disallowing programmatic focus when running tests in these apps. This is needed to
2814         keep testing deterministic. Otherwise, test results would be dependent on whether a hardware
2815         keyboard is attached. When running tests in Simulator.app the hardware keyboard may also not be
2816         connected (i.e. Hardware > Keyboard > Connect Hardware Keyboard is disabled).
2817
2818         * platform/RuntimeApplicationChecks.h:
2819         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2820         (WebCore::IOSApplication::isWebKitTestRunner): Added.
2821
2822 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2823
2824         REGRESSION(r236609): API tests for mso list preservation are failing
2825         https://bugs.webkit.org/show_bug.cgi?id=190095
2826
2827         Reviewed by Wenson Hsieh.
2828
2829         The regression was caused by appendNodeToPreserveMSOList called after an early return for not having renderer.
2830         Clearly, comment & style elements coming from a MS word document wouldn't have a renderer.
2831
2832         Fixed the bug by changing the order.
2833
2834         * editing/markup.cpp:
2835         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
2836
2837 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2838
2839         Build fix after r236612.
2840
2841         * platform/win/PasteboardWin.cpp:
2842         (WebCore::Pasteboard::writeSelection):
2843
2844 2018-09-28  Andy Estes  <aestes@apple.com>
2845
2846         [Apple Pay] Remove the "in-store" button type
2847         https://bugs.webkit.org/show_bug.cgi?id=190079
2848
2849         Reviewed by Tim Horton.
2850
2851         According to <https://developer.apple.com/design/human-interface-guidelines/apple-pay/buttons-and-marks/buttons/>,
2852         this button is meant only for certain kinds of native apps. It shouldn't be available on the web.
2853
2854         Updated http/tests/ssl/applepay/ApplePayButton.html.
2855
2856         * css/CSSPrimitiveValueMappings.h:
2857         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2858         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
2859         * css/CSSValueKeywords.in:
2860         * css/parser/CSSParserFastPaths.cpp:
2861         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2862         * rendering/RenderThemeCocoa.mm:
2863         (WebCore::toPKPaymentButtonType):
2864         * rendering/style/RenderStyleConstants.h:
2865
2866 2018-09-28  Chris Dumez  <cdumez@apple.com>
2867
2868         document.open() should throw errors for cross-origin calls
2869         https://bugs.webkit.org/show_bug.cgi?id=189371
2870         <rdar://problem/44282700>
2871
2872         Reviewed by Youenn Fablet.
2873
2874         document.open() / document.write() should throw errors for cross-origin calls as per:
2875         - https://html.spec.whatwg.org/#document-open-steps (Step 4)
2876
2877         No new tests, rebaselined existing tests.
2878
2879         * dom/Document.cpp:
2880         (WebCore::Document::open):
2881         (WebCore::Document::write):
2882         (WebCore::Document::writeln):
2883         * dom/Document.h:
2884
2885 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2886
2887         Rename createMarkup to serializePreservingVisualAppearance
2888         https://bugs.webkit.org/show_bug.cgi?id=190086
2889
2890         Reviewed by Wenson Hsieh.
2891
2892         Renamed the function to clarify what it does. Also removed the unused Range::toHTML.
2893
2894         * dom/Range.cpp:
2895         (WebCore::Range::toHTML const): Deleted.
2896         * dom/Range.h:
2897         * editing/CompositeEditCommand.cpp:
2898         (WebCore::CompositeEditCommand::moveParagraphs):
2899         * editing/cocoa/EditorCocoa.mm:
2900         (WebCore::Editor::selectionInHTMLFormat):
2901         * editing/gtk/EditorGtk.cpp:
2902         (WebCore::Editor::writeSelectionToPasteboard):
2903         * editing/markup.cpp:
2904         (WebCore::serializePreservingVisualAppearance):
2905         (WebCore::createMarkup): Deleted.
2906         * editing/markup.h:
2907         * editing/wpe/EditorWPE.cpp:
2908         (WebCore::Editor::writeSelectionToPasteboard):
2909         * loader/archive/cf/LegacyWebArchive.cpp:
2910         (WebCore::LegacyWebArchive::create):
2911         (WebCore::LegacyWebArchive::createFromSelection):
2912         * platform/win/PasteboardWin.cpp:
2913         (WebCore::Pasteboard::writeRangeToDataObject):
2914
2915 2018-09-28  Simon Fraser  <simon.fraser@apple.com>
2916
2917         Remove some unused RenderLayer code
2918         https://bugs.webkit.org/show_bug.cgi?id=190078
2919
2920         Reviewed by Zalan Bujtas.
2921
2922         The 'outOfFlowDescendantContainingBlocks' code was related to the accelerated overflow scrolling code that
2923         I removed recently.
2924         
2925         updateDescendantsLayerListsIfNeeded() is never called.
2926
2927         * rendering/RenderLayer.cpp:
2928         (WebCore::RenderLayer::updateDescendantDependentFlags):
2929         (WebCore::RenderLayer::calculateClipRects const):
2930         * rendering/RenderLayer.h:
2931
2932 2018-09-28  Commit Queue  <commit-queue@webkit.org>
2933
2934         Unreviewed, rolling out r236605.
2935         https://bugs.webkit.org/show_bug.cgi?id=190087
2936
2937         caused three API test timeouts (Requested by jernoble on
2938         #webkit).
2939
2940         Reverted changeset:
2941
2942         "Refactoring: eliminate raw pointer usage in Fullscreen code"
2943         https://bugs.webkit.org/show_bug.cgi?id=188747
2944         https://trac.webkit.org/changeset/236605
2945
2946 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2947
2948         Simplify StyledMarkupAccumulator::traverseNodesForSerialization
2949         https://bugs.webkit.org/show_bug.cgi?id=190073
2950
2951         Reviewed by Antti Koivisto.
2952
2953         Simplified the range traversal algorithm in traverseNodesForSerialization as it was too complicated
2954         to support shadow DOM for copy and paste.
2955
2956         Instead of using NodeTraversal::next to traverse past ancestors and then figuring out which ancestor
2957         must be closed or to wrap the existing markup with, new code collects the list of ancestors as we
2958         traverse out of them.
2959
2960         Also extracted lambdas for generating markup and deciding whether to skip a node as well as keeping
2961         track of the depth of the current markup. This further reduces the code complexity of the actual
2962         node traversal algorithm. Keeping track of the depth allows us to now generate ancestor elements'
2963         closing tags without keeping a stack of ancestor nodes we opened at all times.
2964
2965         * editing/markup.cpp:
2966         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
2967
2968 2018-09-27  Ryosuke Niwa  <rniwa@webkit.org>
2969
2970         Replace every use of Node::offsetInCharacters() by Node::isCharacterDataNode()
2971         https://bugs.webkit.org/show_bug.cgi?id=190069
2972
2973         Reviewed by Zalan Bujtas.
2974
2975         Removed Node::offsetInCharacters() and replaced every use of it by isCharacterDataNode()
2976         because their implementations are identical.
2977
2978         Note that offsetInCharacters() sounds like a function which returns some kind of an offset
2979         but it doesn't. It returns true when called on a CharacterData and false elsewhere.
2980
2981         * accessibility/AXObjectCache.cpp:
2982         (WebCore::characterOffsetsInOrder):
2983         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
2984         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
2985         * dom/CharacterData.cpp:
2986         (WebCore::CharacterData::offsetInCharacters const): Deleted.
2987         * dom/CharacterData.h:
2988         * dom/Node.cpp:
2989         (WebCore::Node::offsetInCharacters const): Deleted.
2990         * dom/Node.h:
2991         * dom/Position.cpp:
2992         (WebCore::Position::parentAnchoredEquivalent const):
2993         * dom/Position.h:
2994         (WebCore::lastOffsetInNode):
2995         (WebCore::minOffsetForNode):
2996         (WebCore::offsetIsBeforeLastNodeOffset):
2997         * dom/Range.cpp:
2998         (WebCore::Range::firstNode const):
2999         (WebCore::Range::pastLastNode const):
3000         * dom/RangeBoundaryPoint.h:
3001         (WebCore::RangeBoundaryPoint::setOffset):
3002         (WebCore::RangeBoundaryPoint::setToEndOfNode):
3003         * editing/Editing.cpp:
3004         (WebCore::lastOffsetForEditing):
3005         * editing/TextIterator.cpp:
3006         (WebCore::nextInPreOrderCrossingShadowBoundaries):
3007         (WebCore::TextIterator::node const):
3008         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
3009         * page/DOMSelection.cpp:
3010         (WebCore::DOMSelection::extend):
3011
3012 2018-09-28  Jer Noble  <jer.noble@apple.com>
3013
3014         Refactoring: eliminate raw pointer usage in Fullscreen code
3015         https://bugs.webkit.org/show_bug.cgi?id=188747
3016         <rdar://problem/43541164>
3017
3018         Reviewed by Alex Christensen.
3019
3020         Two sources of raw pointers in the Fullscreen code:
3021         - Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so
3022           they are passed around as raw references.
3023         - Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and
3024           VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't
3025           be ref-able.
3026
3027         Make Model classes ref-able by adding ref() and deref() which call virtual refModel and
3028         derefModel methods, overridden by implementing subclasses. Make every concrete observer
3029         inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around
3030         the client interface.
3031
3032         Since every Interface class now holds a strong reference to its Model classes, and each
3033         Model class holds a weak reference to all its clients, no explicit invalidate() method
3034         is necessary.
3035
3036         Notes:
3037
3038         - Since the weak pointer methods need to be able to downcast to the abstract base class,
3039           observers need to inherit publically (rather than privately) from those base classes.
3040         - Media element Models should compose EventListener rather than inheriting from it, since
3041           EventListener has its own RefCount.
3042         - WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when
3043           their underlying object is destroyed), so clients should be stored in a Vector instead.
3044         - Interfaces should be given all required Refs at creation time, so that they can store
3045           those parameters as Refs instead of RefPtrs.
3046
3047         * platform/cocoa/PlaybackSessionInterface.h:
3048         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted.
3049         * platform/cocoa/PlaybackSessionModel.h:
3050         (WebCore::PlaybackSessionModel::ref):
3051         (WebCore::PlaybackSessionModel::deref):
3052         (WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted.
3053         * platform/cocoa/PlaybackSessionModelMediaElement.h:
3054         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
3055         (WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement):
3056         (WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement):
3057         (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
3058         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
3059         (WebCore::PlaybackSessionModelMediaElement::addClient):
3060         (WebCore::PlaybackSessionModelMediaElement::removeClient):
3061         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
3062         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices):
3063         (WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted.
3064         * platform/cocoa/VideoFullscreenChangeObserver.h:
3065         (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted.
3066         * platform/cocoa/VideoFullscreenModel.h:
3067         (WebCore::VideoFullscreenModel::ref):
3068         (WebCore::VideoFullscreenModel::deref):
3069         (WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted.
3070         * platform/cocoa/VideoFullscreenModelVideoElement.h:
3071         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
3072         (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
3073         (VideoFullscreenModelVideoElement::setVideoElement):
3074         (VideoFullscreenModelVideoElement::addClient):
3075         (VideoFullscreenModelVideoElement::removeClient):
3076         (VideoFullscreenModelVideoElement::setHasVideo):
3077         (VideoFullscreenModelVideoElement::setVideoDimensions):
3078         (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
3079         (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
3080         (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
3081         (VideoFullscreenModelVideoElement::willExitPictureInPicture):
3082         (VideoFullscreenModelVideoElement::didExitPictureInPicture):
3083         (VideoFullscreenModelVideoElement::handleEvent): Deleted.
3084         * platform/ios/PlaybackSessionInterfaceAVKit.h:
3085         (WebCore::PlaybackSessionInterfaceAVKit::create):
3086         (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
3087         (): Deleted.
3088         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
3089         (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
3090         (WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
3091         (WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted.
3092         * platform/ios/VideoFullscreenInterfaceAVKit.h:
3093         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3094         (-[WebAVPlayerLayer layoutSublayers]):
3095         (-[WebAVPlayerLayer resolveBounds]):
3096         (-[WebAVPlayerLayer setVideoGravity:]):
3097         (VideoFullscreenInterfaceAVKit::create):
3098         (VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit):
3099         (VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit):
3100         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
3101         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
3102         (VideoFullscreenInterfaceAVKit::setupFullscreen):
3103         (VideoFullscreenInterfaceAVKit::presentingViewController):
3104         (VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
3105         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
3106         (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
3107         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
3108         (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
3109         (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
3110         (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
3111         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
3112         (VideoFullscreenInterfaceAVKit::doSetup):
3113         (VideoFullscreenInterfaceAVKit::setMode):
3114         (VideoFullscreenInterfaceAVKit::clearMode):
3115         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted.
3116         (VideoFullscreenInterfaceAVKit::invalidate): Deleted.
3117         * platform/ios/WebAVPlayerController.h:
3118         * platform/ios/WebAVPlayerController.mm:
3119         (-[WebAVPlayerController delegate]):
3120         (-[WebAVPlayerController playbackSessionInterface]):
3121         (-[WebAVPlayerController setPlaybackSessionInterface:]):
3122         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3123         (VideoFullscreenControllerContext::didCleanupFullscreen):
3124         (VideoFullscreenControllerContext::addClient):
3125         (VideoFullscreenControllerContext::removeClient):
3126         (VideoFullscreenControllerContext::willEnterPictureInPicture):
3127         (VideoFullscreenControllerContext::didEnterPictureInPicture):
3128         (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
3129         (VideoFullscreenControllerContext::willExitPictureInPicture):
3130         (VideoFullscreenControllerContext::didExitPictureInPicture):
3131         (VideoFullscreenControllerContext::setUpFullscreen):
3132         * platform/mac/PlaybackSessionInterfaceMac.h:
3133         * platform/mac/PlaybackSessionInterfaceMac.mm:
3134         (WebCore::PlaybackSessionInterfaceMac::create):
3135         (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
3136         (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
3137         (WebCore::PlaybackSessionInterfaceMac::rateChanged):
3138         (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
3139         (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
3140         (WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager):
3141         (WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
3142         (WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted.
3143         (WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted.
3144         * platform/mac/VideoFullscreenInterfaceMac.h:
3145         (WebCore::VideoFullscreenInterfaceMac::create):
3146         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
3147         (WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const):
3148         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
3149         * platform/mac/VideoFullscreenInterfaceMac.mm:
3150         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
3151         (-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]):
3152         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
3153         (-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]):
3154         (-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]):
3155         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
3156         (WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac):
3157         (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
3158         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
3159         (WebCore::VideoFullscreenInterfaceMac::setMode):
3160         (WebCore::VideoFullscreenInterfaceMac::clearMode):
3161         (WebCore::VideoFullscreenInterfaceMac::invalidate):
3162         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP):
3163         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted.
3164         * platform/mac/WebPlaybackControlsManager.mm:
3165         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
3166         (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
3167         (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
3168         (-[WebPlaybackControlsManager togglePlayback]):
3169         (-[WebPlaybackControlsManager setPlaying:]):
3170         (-[WebPlaybackControlsManager isPlaying]):
3171         (-[WebPlaybackControlsManager togglePictureInPicture]):
3172
3173 2018-09-28  Chris Dumez  <cdumez@apple.com>
3174
3175         Drop iOS specific quirk in SettingsBase::scriptEnabledChanged()
3176         https://bugs.webkit.org/show_bug.cgi?id=190077
3177         <rdar://problem/44812613>
3178
3179         Reviewed by Zalan Bujtas.
3180
3181         Drop iOS specific quirk in SettingsBase::scriptEnabledChanged() that would dirty style after the
3182         "JavaScriptEnabled" setting's state is toggled. I do not see a good reason to do this given that
3183         scripts would not get executed until a reload.
3184
3185         If we find out after dropping this that this is actually useful for some reason, then we can
3186         always bring it back and consider making this non-iOS specific, as well as documenting why this
3187         it is needed.
3188
3189         * page/Settings.yaml:
3190         * page/SettingsBase.cpp:
3191         (WebCore::SettingsBase::scriptEnabledChanged): Deleted.
3192         * page/SettingsBase.h:
3193
3194 2018-09-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3195
3196         [Curl] Fix priority issue with multiple cookies with different level of path.
3197         https://bugs.webkit.org/show_bug.cgi?id=189920
3198
3199         Reviewed by Fujii Hironori.
3200
3201         When multiple cookies are stored in the database for same site, the priority of
3202         multiple cookies which matches path criteria was not defined. The backend
3203         implementation `sqlite` then returns the first matching result, which is the one
3204         stored earlier.
3205
3206         Test: http/tests/cookies/cookie-with-multiple-level-path.html
3207
3208         * platform/network/curl/CookieJarDB.cpp:
3209         (WebCore::CookieJarDB::searchCookies):
3210
3211 2018-09-26  Ryosuke Niwa  <rniwa@webkit.org>
3212
3213         Use enum class in createMarkup arguments
3214         https://bugs.webkit.org/show_bug.cgi?id=190028
3215
3216         Reviewed by Wenson Hsieh.
3217
3218         Replaced enums used by createMarkup with equivalent enum classes: EChildrenOnly with SerializedNodes,
3219         EAbsoluteURLs with ResolveURLs, and EFragmentSerialization with SerializationSyntax.
3220
3221         Also replaced the boolean convertBlocksToInlines with an enum class of the same name.
3222
3223         Finally, renamed the createMarkup variant which doesn't serialize style and used for innerHTML and XMLSerializer
3224         to serializeFragment.
3225
3226         * dom/Element.cpp:
3227         (WebCore::Element::innerHTML const):
3228         (WebCore::Element::outerHTML const):
3229         * dom/ShadowRoot.cpp:
3230         (WebCore::ShadowRoot::innerHTML const):
3231         * editing/CompositeEditCommand.cpp:
3232         (WebCore::CompositeEditCommand::moveParagraphs):
3233         * editing/HTMLInterchange.h:
3234         (WebCore::AnnotateForInterchange): Renamed from EAnnotateForInterchange.
3235         * editing/MarkupAccumulator.cpp:
3236         (WebCore::MarkupAccumulator::MarkupAccumulator):
3237         (WebCore::MarkupAccumulator::serializeNodes):
3238         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
3239         (WebCore::MarkupAccumulator::resolveURLIfNeeded const):
3240         * editing/MarkupAccumulator.h:
3241         (WebCore::MarkupAccumulator::inXMLFragmentSerialization const):
3242         * editing/ReplaceRangeWithTextCommand.cpp:
3243         (WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer const):
3244         * editing/ReplaceSelectionCommand.cpp:
3245         (WebCore::ReplaceSelectionCommand::willApplyCommand):
3246         * editing/SpellingCorrectionCommand.cpp:
3247         (WebCore::SpellingCorrectionCommand::inputEventDataTransfer const):
3248         * editing/cocoa/EditorCocoa.mm:
3249         (WebCore::Editor::selectionInHTMLFormat):
3250         * editing/cocoa/WebContentReaderCocoa.mm:
3251         (WebCore::WebContentMarkupReader::readRTFD):
3252         (WebCore::WebContentMarkupReader::readRTF):
3253         * editing/gtk/EditorGtk.cpp:
3254         (WebCore::Editor::writeImageToPasteboard):
3255         (WebCore::Editor::writeSelectionToPasteboard):
3256         * editing/markup.cpp:
3257         (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
3258         (WebCore::StyledMarkupAccumulator::serializeNodes):
3259         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
3260         (WebCore::highestAncestorToWrapMarkup):
3261         (WebCore::createMarkupInternal):
3262         (WebCore::createMarkup):
3263         (WebCore::sanitizedMarkupForFragmentInDocument):
3264         (WebCore::serializeFragment): Renamed from createMarkup. This is used for innerHTML and XMLSerializer,
3265         which faithfully serializes the fragment without any computed style as inline styles.
3266         (WebCore::documentTypeString):
3267         (WebCore::createFullMarkup): Deleted two varinats used in WebKitLegacy.
3268         * editing/markup.h:
3269         (WebCore::ResolveURLs): Renamed from EAbsoluteURLs.
3270         (WebCore::ConvertBlocksToInlines): Added.
3271         (WebCore::SerializedNodes): Renamed from EChildrenOnly.
3272         (WebCore::SerializationSyntax): Renamed from EFragmentSerialization.
3273         * editing/wpe/EditorWPE.cpp:
3274         (WebCore::Editor::writeSelectionToPasteboard):
3275         * inspector/DOMEditor.cpp:
3276         * inspector/agents/InspectorDOMAgent.cpp:
3277         (WebCore::InspectorDOMAgent::getOuterHTML):
3278         * loader/archive/cf/LegacyWebArchive.cpp:
3279         (WebCore::LegacyWebArchive::create):
3280         (WebCore::LegacyWebArchive::createFromSelection):
3281         * page/PageSerializer.cpp:
3282         (WebCore::PageSerializer::SerializerMarkupAccumulator::SerializerMarkupAccumulator):
3283         (WebCore::PageSerializer::serializeFrame):
3284         * page/win/DragControllerWin.cpp:
3285         (WebCore::DragController::declareAndWriteDragImage):
3286         * Source/WebCore/platform/win/PasteboardWin.cpp:
3287         (WebCore::Pasteboard::writeRangeToDataObject):
3288         (WebCore::Pasteboard::writeSelection):
3289         * xml/XMLHttpRequest.cpp:
3290         (WebCore::XMLHttpRequest::send):
3291         * xml/XMLSerializer.cpp:
3292         (WebCore::XMLSerializer::serializeToString):
3293         * xml/XSLTProcessorLibxslt.cpp:
3294         (WebCore::xsltStylesheetPointer):
3295         (WebCore::xmlDocPtrFromNode):
3296
3297 2018-09-27  John Wilander  <wilander@apple.com>
3298
3299         Resource Load Statistics: Non-redirected top frame navigation should not get captured in statistics
3300         https://bugs.webkit.org/show_bug.cgi?id=190055
3301         <rdar://problem/44843460>
3302
3303         Reviewed by Chris Dumez.
3304
3305         Test: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html
3306
3307         * loader/ResourceLoadStatistics.cpp:
3308         (WebCore::ResourceLoadStatistics::decode):
3309             Corrects legacy statistics for frames and triggers a re-classification.
3310
3311 2018-09-27  Jer Noble  <jer.noble@apple.com>
3312
3313         Unreviewed watchOS build fix; Fix declaration for ports which USE(ENCRYPTED_MEDIA) but don't
3314         HAVE(AVCONTENTKEYSESSION).
3315
3316         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3317
3318 2018-09-27  Justin Michaud  <justin_michaud@apple.com>
3319
3320         Remove duplicate CSS Properties and Values feature on status page
3321         https://bugs.webkit.org/show_bug.cgi?id=189909
3322
3323         Reviewed by Simon Fraser.
3324
3325         Update CSS properties and values api feature in features.json
3326
3327         * features.json:
3328
3329 2018-09-27  Jer Noble  <jer.noble@apple.com>
3330
3331         MediaPlayer should have mediaPlayerWaitingForKeyChanged() / bool waitingForKey() accessor
3332         https://bugs.webkit.org/show_bug.cgi?id=189951
3333
3334         Reviewed by Eric Carlson.
3335
3336         In order to implement the "Resume Playback" section of EME, part 4, we need to be able
3337         to query whether the MediaPlayer is still waiting for a key after attemptToDecrypt()
3338         has been called. Currently this involves no behavioral changes, as all modern EME ports
3339         will still just notify the media element that they no longer need keys after one has
3340         been added, but future ports may be able to wait for multiple keys before reporting
3341         that it is no longer waiting for keys.
3342
3343         * html/HTMLMediaElement.cpp:
3344         (WebCore::HTMLMediaElement::mediaPlayerWaitingForKeyChanged):
3345         (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
3346         (WebCore::HTMLMediaElement::mediaPlayerWaitingForKey): Deleted.
3347         * html/HTMLMediaElement.h:
3348         * platform/graphics/MediaPlayer.cpp:
3349         (WebCore::MediaPlayer::waitingForKeyChanged):
3350         (WebCore::MediaPlayer::waitingForKey const):
3351         (WebCore::MediaPlayer::waitingForKey): Deleted.
3352         * platform/graphics/MediaPlayer.h:
3353         (WebCore::MediaPlayerClient::mediaPlayerWaitingForKeyChanged):
3354         (WebCore::MediaPlayerClient::mediaPlayerWaitingForKey): Deleted.
3355         * platform/graphics/MediaPlayerPrivate.h:
3356         (WebCore::MediaPlayerPrivateInterface::waitingForKey const):
3357         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3358         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3359         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
3360         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
3361         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3362         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3363         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
3364         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
3365         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged):
3366         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
3367         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3368         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3369         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
3370         (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
3371         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3372         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3373         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3374         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
3375         (WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey):
3376         (WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
3377         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3378         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
3379         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
3380
3381 2018-09-27  Alicia Boya García  <aboya@igalia.com>
3382
3383         [MSE] Fix unwanted sample erase from the decode queue
3384         https://bugs.webkit.org/show_bug.cgi?id=180643
3385
3386         Reviewed by Jer Noble.
3387
3388         Test: media/media-source/media-source-append-acb-no-frame-lost.html
3389
3390         This bug reproduced when unordered appends were made. For instance, if
3391         the application appended [0, 10) and then [20, 30), the frame at 20
3392         would be wrongly discarded from the decode queue.
3393
3394         Later the application could append [10, 20) and the gap at [20, 21)
3395       &n