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