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