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