initKeyboardEvent doesn't clear CapsLock state
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-08-23  Ryosuke Niwa  <rniwa@webkit.org>
2
3         initKeyboardEvent doesn't clear CapsLock state
4         https://bugs.webkit.org/show_bug.cgi?id=188909
5
6         Reviewed by Wenson Hsieh.
7
8         Fixed the bug by not preserving CapsLock state in setModifierKeys variant which takes boolean
9         for altGraphKey, which is only called by KeyboardEvent::initKeyboardEvent.
10
11         Test: fast/events/init-event-clears-capslock.html
12
13         * dom/UIEventWithKeyState.h:
14         (WebCore::UIEventWithKeyState::setModifierKeys):
15
16 2018-08-23  Aditya Keerthi  <akeerthi@apple.com>
17
18         Unreviewed, fix the Windows build after r235245.
19
20         * html/InputMode.cpp:
21         (WebCore::stringForInputMode):
22
23 2018-08-23  Saam barati  <sbarati@apple.com>
24
25         JSRunLoopTimer may run part of a member function after it's destroyed
26         https://bugs.webkit.org/show_bug.cgi?id=188426
27
28         Reviewed by Mark Lam.
29
30         * page/cocoa/ResourceUsageThreadCocoa.mm:
31         (WebCore::ResourceUsageThread::platformThreadBody):
32         * page/linux/ResourceUsageThreadLinux.cpp:
33         (WebCore::ResourceUsageThread::platformThreadBody):
34
35 2018-08-23  David Fenton  <david_fenton@apple.com>
36
37         Unreviewed, rolling out r235129.
38
39         broke internal builds
40
41         Reverted changeset:
42
43         "Allow creating WeakPtrs to const objects"
44         https://bugs.webkit.org/show_bug.cgi?id=188785
45         https://trac.webkit.org/changeset/235129
46
47 2018-08-23  Daniel Bates  <dabates@apple.com>
48
49         [iOS] Test editing/undo/replace-text-in-node-preserving-markers-crash.html crashes
50         https://bugs.webkit.org/show_bug.cgi?id=188898
51
52         Reviewed by Simon Fraser.
53
54         Not all document markers may have a dictation metadata on iOS.
55
56         Currently we assume that every marker has dictation alternatives (i.e. DocumentMarker::alternatives()
57         can be called) when deleting a selection preserving document markers on iOS. However, only markers
58         for dictation may have dictation alternatives. For example, document markers for misspelled words do
59         not have dictation metadata by definition. Instead of assuming every marker has dictation alternatives
60         on iOS we need to check the marker type to determine whether it has associated dictation metadata and
61         invoke the appropriate DocumentMarkerController::addMarker() overload.
62
63         * dom/DocumentMarker.h:
64         (WebCore::DocumentMarker::isDictation const): Added.
65         * editing/CompositeEditCommand.cpp:
66         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Only access DocumentMarker::alternatives()
67         and add a dictation marker on iOS if the marker is a dictation marker.
68
69 2018-08-23  Mark Lam  <mark.lam@apple.com>
70
71         Move vmEntryGlobalObject() to VM from CallFrame.
72         https://bugs.webkit.org/show_bug.cgi?id=188900
73         <rdar://problem/43655753>
74
75         Reviewed by Michael Saboff.
76
77         No new tests needed because this patch does not introduce new functionality.
78
79         * bindings/js/JSCustomXPathNSResolver.cpp:
80         (WebCore::JSCustomXPathNSResolver::create):
81         * bindings/js/JSDOMGlobalObject.cpp:
82         (WebCore::callerGlobalObject):
83         (WebCore::toJSDOMGlobalObject): Deleted.
84         * bindings/js/JSDOMWindowBase.cpp:
85         (WebCore::firstDOMWindow):
86         * bridge/c/c_utility.cpp:
87         (JSC::Bindings::convertValueToNPVariant):
88         * bridge/objc/WebScriptObject.mm:
89         (WebCore::addExceptionToConsole):
90         * bridge/objc/objc_instance.mm:
91         (ObjcInstance::moveGlobalExceptionToExecState):
92         * bridge/objc/objc_runtime.mm:
93         (JSC::Bindings::convertValueToObjcObject):
94         * bridge/objc/objc_utility.mm:
95         (JSC::Bindings::convertValueToObjcValue):
96         * testing/Internals.cpp:
97         (WebCore::Internals::cloneArrayBuffer):
98
99 2018-08-23  Andy Estes  <aestes@apple.com>
100
101         [Apple Pay] Introduce Apple Pay JS v4 on iOS 12 and macOS Mojave
102         https://bugs.webkit.org/show_bug.cgi?id=188829
103
104         Reviewed by Tim Horton.
105
106         Test: http/tests/ssl/applepay/ApplePaySessionV4.html
107
108         * Configurations/FeatureDefines.xcconfig:
109         * testing/MockPaymentCoordinator.cpp:
110         (WebCore::MockPaymentCoordinator::supportsVersion):
111
112 2018-08-23  Devin Rousso  <drousso@apple.com>
113
114         Web Inspector: support breakpoints for timers and animation-frame events
115         https://bugs.webkit.org/show_bug.cgi?id=188778
116
117         Reviewed by Brian Burg.
118
119         The original implementation of "instrumentation" breakpoints relied upon the frontend
120         sending somewhat arbitrary strings when enabling breakpoints for specific events. As an
121         example, setting a breakpoint for `requestAnimationFrame` expects `"animationFrameFired"`
122         as the string, which doesn't make much sense. This patch removes the usage of these strings
123         and instead expects the agent to implement a method that matches what is happening.
124
125         Tests: inspector/dom-debugger/event-animation-frame-breakpoints.html
126                inspector/dom-debugger/event-listener-breakpoints.html
127                inspector/dom-debugger/event-timer-breakpoints.html
128
129         * inspector/InspectorInstrumentation.h:
130         (WebCore::InspectorInstrumentation::willFireTimer):
131         * inspector/InspectorInstrumentation.cpp:
132         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
133         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
134         (WebCore::InspectorInstrumentation::willFireTimerImpl):
135         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
136         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
137         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
138         (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded): Deleted.
139
140         * inspector/agents/InspectorDOMDebuggerAgent.h:
141         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
142         (WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint): Added.
143         (WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint): Added.
144         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
145         (WebCore::InspectorDOMDebuggerAgent::willFireTimer): Added.
146         (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame): Added.
147         (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Deleted.
148         (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Deleted.
149         (WebCore::InspectorDOMDebuggerAgent::setBreakpoint): Deleted.
150         (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Deleted.
151         (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Deleted.
152         (WebCore::InspectorDOMDebuggerAgent::removeBreakpoint): Deleted.
153         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): Deleted.
154         Unify the event listener and instrumentation breakpoint commands into a single method,
155         `setEventBreakpoint`, that takes in both an `EventBreakpointType` and `eventName`.
156
157         * page/DOMTimer.cpp:
158         (WebCore::DOMTimer::fired):
159
160 2018-08-23  Aditya Keerthi  <akeerthi@apple.com>
161
162         [iOS] Support the inputmode attribute on contenteditable elements
163         https://bugs.webkit.org/show_bug.cgi?id=188878
164
165         Reviewed by Ryosuke Niwa.
166
167         The inputmode attribute should apply to contenteditable elements, in addition to
168         textfield inputs and textareas.
169
170         Moved the inputmode attribute from HTMLInputElement.idl and
171         HTMLTextAreaElement.idl to HTMLElement.idl to reflect the specification.
172
173         Also moved all logic to convert between the InputMode enum and string values
174         into InputMode.cpp to avoid exposing unnecessary details to WebKit. Furthermore,
175         InputMode::Auto was renamed to InputMode::Unspecified to avoid confusion with the
176         specification.
177
178         Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
179
180         Tests: fast/forms/inputmode-attribute-contenteditable.html
181                fast/forms/inputmode-attribute-input.html
182                fast/forms/inputmode-attribute-textarea.html
183
184         * Sources.txt:
185         * WebCore.xcodeproj/project.pbxproj:
186         * html/HTMLElement.cpp:
187         (WebCore::HTMLElement::canonicalInputMode const):
188         (WebCore::HTMLElement::inputMode const):
189         (WebCore::HTMLElement::setInputMode):
190         * html/HTMLElement.h:
191         * html/HTMLElement.idl:
192         * html/HTMLInputElement.idl:
193         * html/HTMLTextAreaElement.idl:
194         * html/HTMLTextFormControlElement.cpp:
195         * html/HTMLTextFormControlElement.h:
196         * html/InputMode.cpp: Renamed from Source/WebCore/html/InputModeNames.cpp.
197         (WebCore::inputModeForAttributeValue):
198         (WebCore::stringForInputMode):
199         * html/InputMode.h: Renamed from Source/WebCore/html/InputModeNames.h.
200
201 2018-08-23  Eric Carlson  <eric.carlson@apple.com>
202
203         [MediaStream] Store video preset sizes in a map
204         https://bugs.webkit.org/show_bug.cgi?id=188866
205         <rdar://problem/43622643>
206
207         Reviewed by Youenn Fablet.
208
209         No new tests, tested manually.
210
211         * platform/mediastream/mac/AVVideoCaptureSource.h:
212         * platform/mediastream/mac/AVVideoCaptureSource.mm:
213         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
214         (WebCore::AVVideoCaptureSource::initializeCapabilities):
215         (WebCore::AVVideoCaptureSource::sizeForPreset):
216         (WebCore::AVVideoCaptureSource::setPreset):
217         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
218         (WebCore::sizeForPreset): Deleted.
219         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions const): Deleted.
220
221 2018-08-23  Ryan Haddad  <ryanhaddad@apple.com>
222
223         Unreviewed, attempt to fix the build after r235230.
224
225         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
226
227 2018-08-23  Youenn Fablet  <youenn@apple.com>
228
229         Update libwebrtc up to 984f1a80c0
230         https://bugs.webkit.org/show_bug.cgi?id=188745
231         <rdar://problem/43539177>
232
233         Reviewed by Eric Carlson.
234
235         Updated implementation according new webrtc backend.
236         Instead of modifying libwebrtc header files, we disable unused parameter warning for such headers included in WebCore.
237         WebCore implementation is updated according new webrtc API, mostly AddRef/Release.
238         RealtimeOutgoingVideoSource now uses a pixel convolver to convert RGB pixel buffers as I420.
239
240         Covered by existing tests.
241
242         * CMakeLists.txt:
243         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
244         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
245         (WebCore::LibWebRTCMediaEndpoint::addTrack):
246         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
247         (WebCore::fillEncodingParameters):
248         (WebCore::fillRtpParameters):
249         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
250         (WebCore::LibWebRTCMediaEndpoint::Release const):
251         * WebCore.xcodeproj/project.pbxproj:
252         * platform/mediastream/RealtimeIncomingAudioSource.h:
253         * platform/mediastream/RealtimeIncomingVideoSource.h:
254         * platform/mediastream/RealtimeMediaSource.cpp:
255         (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
256         (WebCore::RealtimeMediaSource::supportsConstraint const):
257         (WebCore::RealtimeMediaSource::supportsConstraints):
258         * platform/mediastream/RealtimeOutgoingAudioSource.h:
259         * platform/mediastream/RealtimeOutgoingVideoSource.h:
260         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
261         (WebCore::GStreamerVideoDecoder::newSampleCallback):
262         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
263         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
264         (WebCore::GStreamerVideoEncoder::newSampleCallback):
265         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
266         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
267         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
268         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
269         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
270         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
271         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
272         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
273         (WebCore::ConvertToI420):
274         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
275         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
276         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm: Added.
277         (WebCore::RealtimeOutgoingVideoSourceCocoa::convertToYUV):
278         * testing/MockLibWebRTCPeerConnection.cpp:
279         (WebCore::MockLibWebRTCPeerConnection::AddTrack):
280         * testing/MockLibWebRTCPeerConnection.h:
281         (WebCore::MockRtpSender::GetParameters):
282         (WebCore::MockRtpSender::SetParameters):
283
284 2018-08-23  Wenson Hsieh  <wenson_hsieh@apple.com>
285
286         [Attachment Support] Attachment elements don't appear in drag images on macOS
287         https://bugs.webkit.org/show_bug.cgi?id=188823
288         <rdar://problem/43616378>
289
290         Reviewed by Tim Horton.
291
292         Currently, attachment elements don't show up in the drag image snapshot on macOS. This is because only the
293         "Selection" phase is painted when generating a drag image on macOS, and many replaced renderers (with some
294         exceptions, such as RenderImage) only paint visible content during the "Foreground" phase. To fix this, we
295         override RenderAttachment::paintReplaced to paint the attachment in the case where the Selection phase is being
296         painted.
297
298         Tests:  WKAttachmentTestsMac.DragAttachmentAsFilePromise
299                 WKAttachmentTests.MoveAttachmentElementAsIconByDragging
300
301         * rendering/RenderAttachment.cpp:
302         (WebCore::RenderAttachment::paintReplaced):
303         * rendering/RenderAttachment.h:
304         * rendering/RenderThemeMac.mm:
305         (WebCore::titleTextColorForAttachment):
306         (WebCore::AttachmentLayout::layOutTitle):
307
308         Plumb an AttachmentLayoutStyle (i.e. NonSelected or Selected) to AttachmentLayout, and use this bit when
309         determining the title text color, as well whether to paint backgrounds for the icon and title.
310
311         (WebCore::AttachmentLayout::AttachmentLayout):
312         (WebCore::RenderThemeMac::attachmentIntrinsicSize const):
313         (WebCore::RenderThemeMac::attachmentBaseline const):
314         (WebCore::paintAttachmentIconBackground):
315         (WebCore::paintAttachmentTitleBackground):
316
317         Bail from painting backgrounds if a selected style is used for the attachment.
318
319         (WebCore::RenderThemeMac::paintAttachment):
320
321         Rather than check the RenderAttachment's selection state when determining whether to paint with a non-selected
322         or selected style, only use selected style if the RenderAttachment has a selection _and_ the painting phase is
323         not "Selection". While this sounds extremely counter-intuitive, the "Selection" painting phase refers to
324         painting the selected foreground content _without_ including any part of the selection highlight.
325
326 2018-08-23  Zalan Bujtas  <zalan@apple.com>
327
328         [LFC][Floating] Decouple the incoming floats and floats already placed in the list
329         https://bugs.webkit.org/show_bug.cgi?id=188886
330
331         Reviewed by Antti Koivisto.
332
333         This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.
334
335         1. Introduce FloatBox class for the incoming floats (This will need to be renamed when adding support for avoidance -incoming box is actually not a float).
336         2. Use the existing FloatState::FloatItem class for placed floats.
337
338         * Sources.txt:
339         * WebCore.xcodeproj/project.pbxproj:
340         * layout/LayoutUnits.h:
341         * layout/Verification.cpp:
342         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
343         * layout/displaytree/DisplayBox.h:
344         * layout/floats/FloatBox.cpp: Added.
345         (WebCore::Layout::FloatBox::FloatBox):
346         (WebCore::Layout::FloatBox::initializePosition):
347         (WebCore::Layout::FloatBox::isLeftAligned const):
348         (WebCore::Layout::FloatBox::setLeft):
349         (WebCore::Layout::FloatBox::setTopLeft):
350         (WebCore::Layout::FloatBox::resetVertically):
351         (WebCore::Layout::FloatBox::resetHorizontally):
352         (WebCore::Layout::FloatBox::topLeftInContainingBlock const):
353         * layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatingContext.h.
354         (WebCore::Layout::FloatBox::top const):
355         (WebCore::Layout::FloatBox::left const):
356         (WebCore::Layout::FloatBox::marginTop const):
357         (WebCore::Layout::FloatBox::marginLeft const):
358         (WebCore::Layout::FloatBox::marginBottom const):
359         (WebCore::Layout::FloatBox::marginRight const):
360         (WebCore::Layout::FloatBox::rectWithMargin const):
361         (WebCore::Layout::FloatBox::setTop):
362         * layout/floats/FloatingContext.cpp:
363         (WebCore::Layout::FloatingPair::verticalPosition const):
364         (WebCore::Layout::begin):
365         (WebCore::Layout::FloatingContext::positionForFloat const):
366         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
367         (WebCore::Layout::FloatingContext::floatingPosition const):
368         (WebCore::Layout::FloatingPair::horiztonalPosition const):
369         (WebCore::Layout::FloatingPair::bottom const):
370         (WebCore::Layout::Iterator::Iterator):
371         (WebCore::Layout::Iterator::operator++):
372         (WebCore::Layout::Iterator::set):
373         (WebCore::Layout::FloatingContext::initialVerticalPosition const): Deleted.
374         (WebCore::Layout::FloatingContext::alignWithContainingBlock const): Deleted.
375         (WebCore::Layout::FloatingContext::alignWithFloatings const): Deleted.
376         (WebCore::Layout::FloatingContext::toContainingBlock const): Deleted.
377         * layout/floats/FloatingContext.h:
378         * layout/floats/FloatingState.h:
379         (WebCore::Layout::FloatingState::root const):
380         (WebCore::Layout::FloatingState::layoutContext const):
381
382 2018-08-23  Zan Dobersek  <zdobersek@igalia.com>
383
384         [CoordGraphics] Remove the remaining CoordinatedGraphicsLayerState cruft
385         https://bugs.webkit.org/show_bug.cgi?id=188881
386
387         Reviewed by Carlos Garcia Campos.
388
389         Remove what's left of CoordinatedGraphicsLayerState usage in the
390         CoordinatedGraphics subsystem. In CoordinatedGraphicsLayer, this means
391         dropping the m_layerState member variable since at this point it is not
392         used anymore in any capacity. Affected helper methods and member
393         variables are also removed where possible.
394
395         The syncLayerState() method on the CoordinatedGraphicsLayerClient
396         interface is adjusted to not accept any parameters. Client should just
397         mark frame synchronization as required while the layer state is now
398         managed differently.
399
400         Instead of the CoordinatedLayerID (which is removed) the
401         Nicosia::PlatformLayer::LayerID alias is introduced as a layer ID type,
402         aliased to the uint64_t type.
403
404         CoordinatedGraphicsState.h file is rid of all structs except the
405         basic CoordinatedGraphicsState struct that at this point contains only
406         a reference to the Nicosia::Scene object. This will be further
407         simplified in the patches that follow.
408
409         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
410         (Nicosia::PlatformLayer::id const):
411         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
412         (WebCore::CoordinatedGraphicsLayer::didChangeAnimations):
413         (WebCore::CoordinatedGraphicsLayer::didChangeChildren):
414         (WebCore::CoordinatedGraphicsLayer::didChangeFilters):
415         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
416         (WebCore::CoordinatedGraphicsLayer::didChangeGeometry):
417         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
418         (WebCore::CoordinatedGraphicsLayer::setPosition):
419         (WebCore::CoordinatedGraphicsLayer::setAnchorPoint):
420         (WebCore::CoordinatedGraphicsLayer::setSize):
421         (WebCore::CoordinatedGraphicsLayer::setTransform):
422         (WebCore::CoordinatedGraphicsLayer::setChildrenTransform):
423         (WebCore::CoordinatedGraphicsLayer::setPreserves3D):
424         (WebCore::CoordinatedGraphicsLayer::setMasksToBounds):
425         (WebCore::CoordinatedGraphicsLayer::setDrawsContent):
426         (WebCore::CoordinatedGraphicsLayer::setContentsVisible):
427         (WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
428         (WebCore::CoordinatedGraphicsLayer::setBackfaceVisibility):
429         (WebCore::CoordinatedGraphicsLayer::setOpacity):
430         (WebCore::CoordinatedGraphicsLayer::setContentsRect):
431         (WebCore::CoordinatedGraphicsLayer::setContentsTileSize):
432         (WebCore::CoordinatedGraphicsLayer::setContentsTilePhase):
433         (WebCore::CoordinatedGraphicsLayer::setContentsToSolidColor):
434         (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
435         (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
436         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
437         (WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
438         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplay):
439         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):
440         (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
441         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
442         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
443         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
444         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
445         (WebCore::toCoordinatedLayerID): Deleted.
446         (WebCore::CoordinatedGraphicsLayer::didChangeLayerState): Deleted.
447         (WebCore::CoordinatedGraphicsLayer::syncChildren): Deleted.
448         (WebCore::CoordinatedGraphicsLayer::syncFilters): Deleted.
449         (WebCore::CoordinatedGraphicsLayer::syncLayerState): Deleted.
450         (WebCore::CoordinatedGraphicsLayer::syncAnimations): Deleted.
451         (WebCore::CoordinatedGraphicsLayer::resetLayerState): Deleted.
452         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
453         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
454         (): Deleted.
455         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState): Deleted.
456         (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const): Deleted.
457
458 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
459
460         [CoordGraphics] Drop old-school PlatformLayer management in CoordinatedGraphicsLayer
461         https://bugs.webkit.org/show_bug.cgi?id=188850
462
463         Reviewed by Michael Catanzaro.
464
465         Remove the m_platformLayer member from the CoordinatedGraphicsLayer
466         class as it's been unused since the rework in r235165.
467
468         The CoordinatedGraphicsLayer::syncPlatformLayer() helper method and the
469         related member variable can both be removed as well. On the
470         CoordinatedGraphicsLayerState class, we can remove the obsolete
471         flags and the TextureMapperPlatformLayerProxy member variable that's
472         unused now that such objects are handled through the Nicosia impl class.
473
474         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
475         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
476         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
477         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
478         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
479         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
480         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer): Deleted.
481         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
482         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
483         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
484
485 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
486
487         [CoordGraphics] Remove TiledBackingStoreClient inheritance from CoordinatedGraphicsLayer
488         https://bugs.webkit.org/show_bug.cgi?id=188849
489
490         Reviewed by Michael Catanzaro.
491
492         Remove the TiledBackingStoreClient inheritance from the
493         CoordinatedGraphicsLayer class since it's not used anymore after changes
494         made in r235165.
495
496         Related TiledBackingStore objects on this class, along with tile state
497         tracking member variables on the CoordinatedGraphicsLayerState class,
498         are also removed.
499
500         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
501         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
502         (WebCore::CoordinatedGraphicsLayer::resetLayerState):
503         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
504         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreHasPendingTileCreation): Deleted.
505         (WebCore::CoordinatedGraphicsLayer::createTile): Deleted.
506         (WebCore::CoordinatedGraphicsLayer::updateTile): Deleted.
507         (WebCore::CoordinatedGraphicsLayer::removeTile): Deleted.
508         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
509         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
510         (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const):
511
512 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
513
514         [CoordGraphics] Remove CoordinatedImageBacking and related functionality
515         https://bugs.webkit.org/show_bug.cgi?id=188847
516
517         Reviewed by Michael Catanzaro.
518
519         Remove the CoordinatedImageBacking class and its intertwining use in the
520         CoordinatedGraphics system.
521
522         Remove the now-unused m_coordinatedImageBacking member variable from the
523         CoordinatedGraphicsLayer class, along with CoordinatedImageBacking::Host
524         inheritance. Various related helper methods are also removed.
525
526         In CoordinatedGraphicsState and CoordinatedGraphicsLayerState classes,
527         we are able to drop different CoordinatedImageBacking-related state
528         values that are not used anymore.
529
530         * platform/TextureMapper.cmake:
531         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
532         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
533         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
534         (WebCore::CoordinatedGraphicsLayer::setContentsToImage):
535         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
536         (WebCore::CoordinatedGraphicsLayer::didChangeImageBacking): Deleted.
537         (WebCore::CoordinatedGraphicsLayer::syncImageBacking): Deleted.
538         (WebCore::CoordinatedGraphicsLayer::imageBackingVisible): Deleted.
539         (WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded): Deleted.
540         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
541         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
542         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
543         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: Removed.
544         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h: Removed.
545
546 2018-08-22  Ryosuke Niwa  <rniwa@webkit.org>
547
548         Store RefPtr in FocusNavigationScope
549         https://bugs.webkit.org/show_bug.cgi?id=188864
550
551         Reviewed by Simon Fraser.
552
553         Use RefPtr to store the root node of a tree scope and a slot element instead of a reference and a raw pointer.
554
555         * page/FocusController.cpp:
556         (WebCore::FocusNavigationScope::parentInScope const):
557         (WebCore::FocusNavigationScope::firstNodeInScope const):
558         (WebCore::FocusNavigationScope::lastNodeInScope const):
559         (WebCore::FocusNavigationScope::FocusNavigationScope):
560         (WebCore::FocusNavigationScope::owner const):
561
562 2018-08-22  Jiewen Tan  <jiewen_tan@apple.com>
563
564         Unreviewed, update "Web Authentication" from "Under Consideration" to "In Development"
565         in features.json.
566
567         * features.json:
568
569 2018-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>
570
571         [Attachment Support] Support dragging attachment elements out as files on macOS
572         https://bugs.webkit.org/show_bug.cgi?id=181294
573         <rdar://problem/36298801>
574
575         Reviewed by Tim Horton.
576
577         Serialize a dragged attachment element as a web archive on macOS. This allows us to move attachment elements
578         around a document by dragging, without performing a file upload upon every drop. Ideally, we should do this on
579         iOS as well, but this currently causes attachment data to go missing; further investigation to fix this for iOS
580         is tracked in <https://bugs.webkit.org/show_bug.cgi?id=181514>.
581
582         Tests:  WKAttachmentTestsMac.DragAttachmentAsFilePromise
583                 WKAttachmentTests.MoveAttachmentElementAsIconByDragging
584
585         * editing/cocoa/EditorCocoa.mm:
586         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
587
588 2018-08-22  Aditya Keerthi  <akeerthi@apple.com>
589
590         [iOS] Add support for the inputmode attribute
591         https://bugs.webkit.org/show_bug.cgi?id=183621
592
593         Reviewed by Tim Horton.
594
595         Added the inputmode attribute to the HTMLInputElement and HTMLTextAreaElement IDL
596         files. The possible values for the attribute are specified in InputModeNames.
597
598         Test: fast/forms/inputmode-attribute.html
599
600         * Sources.txt:
601         * WebCore.xcodeproj/project.pbxproj:
602         * html/HTMLAttributeNames.in:
603         * html/HTMLInputElement.idl:
604         * html/HTMLTextAreaElement.idl:
605         * html/HTMLTextFormControlElement.cpp:
606         (WebCore::HTMLTextFormControlElement::inputMode const):
607         (WebCore::HTMLTextFormControlElement::setInputMode):
608         * html/HTMLTextFormControlElement.h:
609         * html/InputModeNames.cpp: Added.
610         (WebCore::InputModeNames::text):
611         (WebCore::InputModeNames::tel):
612         (WebCore::InputModeNames::url):
613         (WebCore::InputModeNames::email):
614         (WebCore::InputModeNames::numeric):
615         (WebCore::InputModeNames::decimal):
616         (WebCore::InputModeNames::search):
617         * html/InputModeNames.h: Added.
618
619 2018-08-22  Eric Carlson  <eric.carlson@apple.com>
620
621         Log more often during AirPlay state changes
622         https://bugs.webkit.org/show_bug.cgi?id=188854
623
624         Always log some infrequent but important AirPlay state changes to make debugging easier.
625
626         Reviewed by Jer Noble.
627
628         * html/HTMLMediaElement.cpp:
629         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Low always.
630         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
631         (WebCore::HTMLMediaElement::setWirelessPlaybackTarget): Ditto.
632         (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget): Ditto.
633
634 2018-08-21  Ryosuke Niwa  <rniwa@webkit.org>
635
636         Focus navigation order in slot fallback contents is wrong
637         https://bugs.webkit.org/show_bug.cgi?id=178001
638         <rdar://problem/42842997>
639
640         Reviewed by Antti Koivisto.
641
642         The bug here is that when a slot uses its fallback content, the fallback content's focus order doesn't get
643         grouped by that of the slot. Consider the following DOM tree:
644
645         - ShadowRoot
646             - div tabindex = 2
647             - slot tabindex = 1
648                 - span tabindex = 3
649
650         In this example, the sequential focus navigation should be slot, span, then div. Even though span has tabindex
651         order of 3, which is lower than that of div, the fallback content of the slot should be grouped together
652         before the focus moves out of the slot content.
653
654         In WebKit, this concept of grouping elements for the sequential focus navigation ordering is implemeneted
655         as FocusNavigationScope. Both ShadowRoot and HTMLSlotElement are treated as a focus scope owner but we had
656         a bug that a slot element which uses its fallback content was not treated as a focus scope owner.
657
658         This patch addresses the bug by treating a slot wich uses its fallback content as a focus scope owner.
659
660         Test: fast/shadow-dom/focus-navigation-across-slots.html
661
662         * page/FocusController.cpp:
663         (WebCore::isFocusScopeOwner): Treat a slot elment hs a focus scope owner regardless of whether it has assigned
664         nodes or not.
665         (WebCore::FocusNavigationScope::SlotKind): Added.
666         (WebCore::FocusNavigationScope::m_slotKind): Added.
667         (WebCore::FocusNavigationScope::parentInScope const): Return null if `node` is a child of the slot element for
668         which this FocusNavigationScope is created (i.e. `node` is slot's fallback content).
669         (WebCore::FocusNavigationScope::firstNodeInScope const): Return the first child node when this
670         FocusNavigationScope is for a slot element using its fallback content.
671         (WebCore::FocusNavigationScope::lastNodeInScope const): Ditto for the last child.
672         (WebCore::FocusNavigationScope::FocusNavigationScope):
673         (WebCore::FocusNavigationScope::scopeOf): The scope of a child of a slot element which uses its fallback content
674         is its slot element (i.e. the current node is a fallback content). We can't simply check the current node is
675         a slot element which uses a fallback content since the scope of a slot element is the parent scope. e.g. its
676         tree scope like ShadowRoot or Document inside which this slot element appears.
677         (WebCore::FocusNavigationScope::scopeOwnedByScopeOwner): Create the appropriate FocusNavigationScope based on
678         whether the slot element has assigned or it uses its fallback content.
679
680 2018-08-22  David Kilzer  <ddkilzer@apple.com>
681
682         Move files in WebCore project to match Xcode folder structure
683         <https://webkit.org/b/188851>
684
685         Reviewed by Tim Horton.
686
687         * Scripts/LocalizableStrings.pm: Renamed from Source/WebCore/LocalizableStrings.pm.
688         * Scripts/extract-localizable-strings.pl: Renamed from Source/WebCore/extract-localizable-strings.pl.
689         * WebCore.xcodeproj/project.pbxproj: Update to match new location of files.
690         * platform/audio/cocoa/WebAudioBufferList.cpp: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.cpp.
691         * platform/audio/cocoa/WebAudioBufferList.h: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.h.
692         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h.
693         * platform/ios/wak/WAKViewInternal.h: Renamed from Source/WebCore/platform/WAKViewInternal.h.
694           Also fix 3 webkit-style warnings.
695
696 2018-08-22  Zalan Bujtas  <zalan@apple.com>
697
698         [LFC][Floating] Move files to a dedicated directory.
699         https://bugs.webkit.org/show_bug.cgi?id=188846
700
701         Reviewed by Simon Fraser.
702
703         layout/Float* -> layout/floats
704
705         * WebCore.xcodeproj/project.pbxproj:
706         * layout/floatformatting/FloatingContext.cpp: Renamed from Source/WebCore/layout/FloatingContext.cpp.
707         (WebCore::Layout::FloatingPair::isEmpty const):
708         (WebCore::Layout::FloatingPair::verticalPosition const):
709         (WebCore::Layout::Iterator::operator* const):
710         (WebCore::Layout::begin):
711         (WebCore::Layout::end):
712         (WebCore::Layout::FloatingContext::FloatingContext):
713         (WebCore::Layout::FloatingContext::positionForFloat const):
714         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
715         (WebCore::Layout::FloatingContext::floatingPosition const):
716         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
717         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
718         (WebCore::Layout::FloatingContext::alignWithFloatings const):
719         (WebCore::Layout::FloatingContext::toContainingBlock const):
720         (WebCore::Layout::FloatingPair::FloatingPair):
721         (WebCore::Layout::FloatingPair::left const):
722         (WebCore::Layout::FloatingPair::right const):
723         (WebCore::Layout::FloatingPair::intersects const):
724         (WebCore::Layout::FloatingPair::operator == const):
725         (WebCore::Layout::FloatingPair::bottom const):
726         (WebCore::Layout::Iterator::Iterator):
727         (WebCore::Layout::previousFloatingIndex):
728         (WebCore::Layout::Iterator::operator++):
729         (WebCore::Layout::Iterator::set):
730         (WebCore::Layout::Iterator::operator== const):
731         (WebCore::Layout::Iterator::operator!= const):
732         * layout/floatformatting/FloatingContext.h: Renamed from Source/WebCore/layout/FloatingContext.h.
733         (WebCore::Layout::FloatingContext::floatingState const):
734         (WebCore::Layout::FloatingContext::layoutContext const):
735         * layout/floatformatting/FloatingState.cpp: Renamed from Source/WebCore/layout/FloatingState.cpp.
736         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
737         (WebCore::Layout::FloatingState::FloatingState):
738         (WebCore::Layout::belongsToThisFloatingContext):
739         (WebCore::Layout::FloatingState::remove):
740         (WebCore::Layout::FloatingState::append):
741         (WebCore::Layout::FloatingState::bottom const):
742         * layout/floatformatting/FloatingState.h: Renamed from Source/WebCore/layout/FloatingState.h.
743         (WebCore::Layout::FloatingState::create):
744         (WebCore::Layout::FloatingState::isEmpty const):
745         (WebCore::Layout::FloatingState::FloatItem::layoutBox const):
746         (WebCore::Layout::FloatingState::FloatItem::containingBlock const):
747         (WebCore::Layout::FloatingState::FloatItem::displayBox const):
748         (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const):
749         (WebCore::Layout::FloatingState::floats const):
750         (WebCore::Layout::FloatingState::last const):
751         (WebCore::Layout::FloatingState::layoutContext const):
752         (WebCore::Layout::FloatingState::root const):
753         (WebCore::Layout::FloatingState::leftBottom const):
754         (WebCore::Layout::FloatingState::rightBottom const):
755         (WebCore::Layout::FloatingState::bottom const):
756
757 2018-08-22  Rob Buis  <rbuis@igalia.com>
758
759         Fetch: Stop checking Request.integrity's value in no-cors mode
760         https://bugs.webkit.org/show_bug.cgi?id=188802
761
762         Reviewed by Frédéric Wang.
763
764         Remove this check since it was removed from the spec.
765
766         Behavior matches Chrome and Firefox.
767
768         Test: http/tests/subresource-integrity/sri-fetch.js:
769
770         * Modules/fetch/FetchRequest.cpp:
771         (WebCore::FetchRequest::initializeOptions):
772
773 2018-08-22  Youenn Fablet  <youenn@apple.com>
774
775         Mark MediaStream Recording API as under consideration
776         https://bugs.webkit.org/show_bug.cgi?id=188822
777
778         Reviewed by Jon Lee.
779
780         * features.json:
781
782 2018-08-22  Ms2ger  <Ms2ger@igalia.com>
783
784         [GTK] Never return an uninitialized ImageGStreamer object.
785         https://bugs.webkit.org/show_bug.cgi?id=188305
786
787         Reviewed by Philippe Normand.
788
789         The single caller was already checking for a null return value, so
790         make that check actually do something. Also remove the null-check on
791         the return value of image(), which asserted that it would never return
792         null.
793
794         Test: fast/canvas/canvas-createPattern-video-loading.html
795
796         * platform/graphics/gstreamer/ImageGStreamer.h:
797         (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created.
798         (WebCore::ImageGStreamer::image): Return a reference.
799         (WebCore::ImageGStreamer::rect): Always assert that m_image is present.
800         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
801         (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature.
802
803 2018-08-22  Zalan Bujtas  <zalan@apple.com>
804
805         Add changes missing from r234925.
806
807         * layout/blockformatting/BlockMarginCollapse.cpp:
808         (WebCore::Layout::isMarginTopCollapsedWithParent):
809         (WebCore::Layout::isMarginBottomCollapsedThrough):
810         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
811
812 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
813
814         [CoordGraphics] Switch to Nicosia::CompositionLayer state tracking
815         https://bugs.webkit.org/show_bug.cgi?id=188693
816
817         Reviewed by Carlos Garcia Campos.
818
819         Populate Nicosia::CompositionLayer with additional LayerState member
820         objects. For now we're using pending, staging and committed states,
821         though it might be possible to narrow down these to just two.
822
823         Pending state contains state that will be moved to staging during the
824         final steps of the next layer flush. flushState() method accumulates all
825         state changes in the staging state, and also allows the caller to
826         additionally perform flushing operations that are specific to backing
827         store, image backing or content layer containers.
828
829         commitState() method moves staging state over into the committed state,
830         again allowing user to pass a functor that receives the just-committed
831         state and apply it to their composition engine.
832
833         Changes in state objects are done under a thread-safe lock. This might
834         not be completely necessary at this point, but will be useful when
835         additonal layer state updates will be coming from e.g. the scrolling
836         thread. It might also make sense to tie in this lock use with the
837         Nicosia::Scene lock in the future.
838
839         Nicosia::ContentLayerTextureMapperImpl is modified slightly to allow
840         determining during flushes whether an update is pending. This is
841         necessary for a special case in ThreadedCompositor where content (i.e.
842         platform) layers like WebGL or video require an additional level of
843         scene update coordination. This complete special case has to go through
844         another review to see whether it's still necessary. Ideally we would be
845         able to remove it.
846
847         CoordinatedGraphicsLayer is finally switched over to using
848         Nicosia layer objects for state updates of any kind. This patch only
849         adds all the necessary bits, but doesn't yet remove any of the existing
850         code (but rather disables it temporarily, before it's removed).
851
852         Updating of simple state values is already in place. For backing stores,
853         the flushCompositingStateForThisLayerOnly() method now takes care of
854         preparing the backing store object if necessary as per layer state,
855         while the updateContentBuffers() method is switched to operate with
856         TiledBackingStore objects now kept on the BackingStoreTextureMapperImpl
857         instance associated with that backing store. Helper methods like
858         adjustContentsScale() and createBackingStore(), only called from the
859         updateContentBuffers() method, are removed and the code there inlined.
860
861         For image-backed layers, the update is now done directly in
862         the flushCompositingStateForThisLayerOnly() method, if necessary. The
863         helper syncImageBacking() method is commented out in order to prevent
864         double-painting of image buffers for now, but all this (along with the
865         CoordinatedImageBacking logic in CompositingCoordinator) will be removed
866         later.
867
868         For layers backed by platform layer objects, integration is relatively
869         simple. setContentsToPlatformLayer() is changed to properly handle any
870         passed-in platform layer object, and updatePlatformLayer() invokes the
871         swapBuffersIfNeeded() method on the ContentLayerTextureMapperImpl object
872         during each flush, if necessary.
873
874         In order to ensure any Nicosia-specific state update properly triggers
875         a composition update, m_nicosia.performLayerUpdate is added and flipped
876         to true during the flush in case of any state change. This then triggers
877         a layer sync in the CompositingCoordinator object when the
878         syncPendingStateChangesIncludingSubLayers() method is called. While no
879         old-style layer state update is provided, it causes the necessary
880         synchronization step that properly picks up the Nicosia-provided state
881         changes. Once the old-style layer state tracking is removed, this method
882         of update triggering will have to be updated as well.
883
884         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
885         (Nicosia::CompositionLayer::flushState):
886         (Nicosia::CompositionLayer::commitState):
887         (Nicosia::CompositionLayer::accessCommitted):
888         * platform/graphics/nicosia/NicosiaScene.h:
889         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp:
890         (Nicosia::ContentLayerTextureMapperImpl::flushUpdate):
891         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h:
892         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
893         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
894         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
895         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
896         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
897         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
898         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
899         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
900         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
901         (WebCore::CoordinatedGraphicsLayer::adjustContentsScale): Deleted.
902         (WebCore::CoordinatedGraphicsLayer::createBackingStore): Deleted.
903         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
904
905 2018-08-22  David Kilzer  <ddkilzer@apple.com>
906
907         Remove stale file references in WebCore Xcode project
908
909         I manually removed these using Xcode and verified that there was
910         a commit that removed the original files.
911
912         Found by tool created for Bug 188754: Tool to fix folders that
913         should map to directories in Xcode project files.
914
915         * WebCore.xcodeproj/project.pbxproj:
916         (dom/DOMExceptions.in): Removed in r219741.
917         (Modules/modern-media-controls/start-button.js):
918         (Modules/modern-media-controls/volume-slider.css):
919         (Modules/modern-media-controls/icon-button.css):
920         (Modules/modern-media-controls/volume-slider.js):
921         (Modules/modern-media-controls/macos-media-controls.js):
922         (Modules/modern-media-controls/ios-inline-media-controls.css):
923         (Modules/modern-media-controls/scrubber.css):
924         (Modules/modern-media-controls/start-button.css):
925         (Modules/modern-media-controls/scrubber.js):
926         (Modules/modern-media-controls/icon-button.js):
927         (Modules/modern-media-controls/macos-compact-inline-media-controls.css):
928         (Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png):
929         (Modules/modern-media-controls/images/iOS/start@1x.png):
930         (Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png):
931         (Modules/modern-media-controls/images/iOS/pause@2x.png):
932         (Modules/modern-media-controls/images/iOS/play@3x.png):
933         (Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png):
934         (Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png):
935         (Modules/modern-media-controls/images/iOS/pip-in@2x.png):
936         (Modules/modern-media-controls/images/iOS/start@3x.png):
937         (Modules/modern-media-controls/images/iOS/airplay@1x.png):
938         (Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png):
939         (Modules/modern-media-controls/images/iOS/slider-thumb@2x.png):
940         (Modules/modern-media-controls/images/iOS/airplay@2x.png):
941         (Modules/modern-media-controls/images/iOS/pause@3x.png):
942         (Modules/modern-media-controls/images/iOS/pip-in@3x.png):
943         (Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png):
944         (Modules/modern-media-controls/images/iOS/pause@1x.png):
945         (Modules/modern-media-controls/images/iOS/start@2x.png):
946         (Modules/modern-media-controls/images/iOS/play@2x.png):
947         (Modules/modern-media-controls/images/iOS/pip-in@1x.png):
948         (Modules/modern-media-controls/images/iOS/play@1x.png):
949         (Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@1x.png):
950         (Modules/modern-media-controls/images/macOS/rewind@1x.png):
951         (Modules/modern-media-controls/images/macOS/play@2x.png):
952         (Modules/modern-media-controls/images/macOS/volume-mute@2x.png):
953         (Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png):
954         (Modules/modern-media-controls/images/macOS/volume@2x.png):
955         (Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png):
956         (Modules/modern-media-controls/images/macOS/volume-compact@2x.png):
957         (Modules/modern-media-controls/images/macOS/start@2x.png):
958         (Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png):
959         (Modules/modern-media-controls/images/macOS/airplay@2x.png):
960         (Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png):
961         (Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png):
962         (Modules/modern-media-controls/images/macOS/airplay@1x.png):
963         (Modules/modern-media-controls/images/macOS/pip-in@1x.png):
964         (Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png):
965         (Modules/modern-media-controls/images/macOS/rewind@2x.png):
966         (Modules/modern-media-controls/images/macOS/play-compact@1x.png):
967         (Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png):
968         (Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png):
969         (Modules/modern-media-controls/images/macOS/volume@1x.png):
970         (Modules/modern-media-controls/images/macOS/pip-in@2x.png):
971         (Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png):
972         (Modules/modern-media-controls/images/macOS/volume-down-fullscreen@1x.png):
973         (Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png):
974         (Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@2x.png):
975         (Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png):
976         (Modules/modern-media-controls/images/macOS/pause-compact@1x.png):
977         (Modules/modern-media-controls/images/macOS/start@1x.png):
978         (Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png):
979         (Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png):
980         (Modules/modern-media-controls/images/macOS/play@1x.png):
981         (Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png):
982         (Modules/modern-media-controls/images/macOS/forward@1x.png):
983         (Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png):
984         (Modules/modern-media-controls/images/macOS/pause@1x.png):
985         (Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png):
986         (Modules/modern-media-controls/images/macOS/interval-skip-back-compact@2x.png):
987         (Modules/modern-media-controls/images/macOS/pause@2x.png):
988         (Modules/modern-media-controls/images/macOS/volume-up-fullscreen@1x.png):
989         (Modules/modern-media-controls/images/macOS/volume-compact@1x.png):
990         (Modules/modern-media-controls/images/macOS/play-compact@2x.png):
991         (Modules/modern-media-controls/images/macOS/media-selection@2x.png):
992         (Modules/modern-media-controls/images/macOS/forward@2x.png):
993         (Modules/modern-media-controls/images/macOS/interval-skip-back-compact@1x.png):
994         (Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png):
995         (Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png):
996         (Modules/modern-media-controls/images/macOS/media-selection@1x.png):
997         (Modules/modern-media-controls/images/macOS/volume-mute@1x.png):
998         (Modules/modern-media-controls/images/macOS/pause-compact@2x.png):
999         (Modules/modern-media-controls/images/macOS/volume-up-fullscreen@2x.png):
1000         (Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png):
1001         (Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png):
1002         (Modules/modern-media-controls/images/macOS/volume-down-fullscreen@2x.png):
1003         (Modules/modern-media-controls/media/time-labels-support.js):
1004         - Removed in r217823.
1005         (Modules/webvr/VRDisplayCapabilities.cpp): Removed in r229089.
1006         (Modules/webvr/VRFieldOfView.cpp): Removed in r228819.
1007         (rendering/svg/RenderSVGAllInOne.cpp): Removed in r234655.
1008
1009 2018-08-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1010
1011         Do not try to update the compositing policy when not in accelerated compositing mode
1012         https://bugs.webkit.org/show_bug.cgi?id=188787
1013
1014         Reviewed by Simon Fraser.
1015
1016         RenderLayerCompositor::updateCompositingPolicy() is called very often (called from
1017         RenderLayerCompositor::cacheAcceleratedCompositingFlags()) and it uses WTF::memoryFootprint() to decide the
1018         current compositing policy. Getting the memory footprint is an expensive operation in Linux (and I suspect other
1019         non-cocoa ports too), causing an excessive CPU usage. This caused the WPE and GTK+ unit test
1020         /webkit/WebKitWebContext/uri-scheme to start timing out in the bots, because the test expects things to happen
1021         fast and that's no longer the case. We could reduce the CPU usage a lot by not trying to update the policy when
1022         not in accelerated compositing mode. We will need a solution for the accelerated compositing mode, though.
1023
1024         Fixes WPE/GTK+ unit test /webkit/WebKitWebContext/uri-scheme.
1025
1026         * rendering/RenderLayerCompositor.cpp:
1027         (WebCore::RenderLayerCompositor::updateCompositingPolicy): Return early when not in accelerated compositing mode.
1028
1029 2018-08-21  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1030
1031         Support "name" option for dedicated workers
1032         https://bugs.webkit.org/show_bug.cgi?id=188779
1033
1034         Reviewed by Joseph Pecoraro.
1035
1036         This patch adds `new Worker(url, { name: "Worker Name" })` option support[1].
1037         This name can be accessible from `self.name` of DedicatedWorkerGlobalScope.
1038         It is useful for debugging dedicated workers if the inspector can show the
1039         names of the workers. This enhancement is tracked by [2].
1040
1041         [1]: https://github.com/whatwg/html/issues/2477
1042         [2]: https://bugs.webkit.org/show_bug.cgi?id=164678
1043
1044         Tests: http/wpt/workers/name-property-enhanced.html
1045                http/wpt/workers/name-property-no-name.html
1046
1047         * workers/DedicatedWorkerGlobalScope.cpp:
1048         (WebCore::DedicatedWorkerGlobalScope::create):
1049         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1050         Hold `name` member.
1051
1052         * workers/DedicatedWorkerGlobalScope.h:
1053         * workers/DedicatedWorkerGlobalScope.idl:
1054         Add `name` attribute.
1055
1056         * workers/DedicatedWorkerThread.cpp:
1057         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1058         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
1059         * workers/DedicatedWorkerThread.h:
1060         * workers/Worker.cpp:
1061         (WebCore::Worker::Worker):
1062         (WebCore::Worker::create):
1063         (WebCore::Worker::notifyFinished):
1064         * workers/Worker.h:
1065         * workers/Worker.idl:
1066         Add WorkerOptions for dedicated worker creation.
1067
1068         * workers/WorkerGlobalScopeProxy.h:
1069         * workers/WorkerMessagingProxy.cpp:
1070         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1071         * workers/WorkerMessagingProxy.h:
1072         * workers/WorkerThread.cpp:
1073         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
1074         Isolate copy the given `name` to pass the worker thread.
1075
1076         (WebCore::WorkerThread::WorkerThread):
1077         (WebCore::WorkerThread::workerThread):
1078         * workers/WorkerThread.h:
1079         * workers/service/context/ServiceWorkerThread.cpp:
1080         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1081         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
1082         * workers/service/context/ServiceWorkerThread.h:
1083
1084 2018-08-21  Ryosuke Niwa  <rniwa@webkit.org>
1085
1086         Replace booleans for modifier keys in UIEventWithKeyState with OptionSet<Modifier>
1087         https://bugs.webkit.org/show_bug.cgi?id=188777
1088
1089         Reviewed by Simon Fraser.
1090
1091         Replaced boolean arguments and instance variables for modifier keys (ctrl, alt, shift, and meta keys) in
1092         UIEventWithKeyState with OptionSet<Modifier> and isSimulated boolean in MouseRelatedEvent with IsSimulated
1093         enum class.
1094
1095         Also made movementDelta always compiled instead of only when ENABLE(POINTER_LOCK) to simplify the code.
1096
1097         No new tests since there should be no observable behavioral change.
1098
1099         * dom/Element.cpp:
1100         (WebCore::Element::dispatchMouseEvent):
1101         * dom/KeyboardEvent.cpp:
1102         (WebCore::KeyboardEvent::KeyboardEvent):
1103         (WebCore::KeyboardEvent::initKeyboardEvent): Call setModifierKeys.
1104         * dom/MouseEvent.cpp:
1105         (WebCore::MouseEvent::create):
1106         (WebCore::MouseEvent::MouseEvent):
1107         (WebCore::MouseEvent::initMouseEvent): Ditto.
1108         * dom/MouseEvent.h:
1109         * dom/MouseRelatedEvent.cpp:
1110         (WebCore::MouseRelatedEvent::MouseRelatedEvent): Added a new variant which takes the minimum arguments
1111         for gesture & touch events. In those events, detail is always set to 0, movementDelta is always set to 0,0,
1112         and they are never simulated.
1113         * dom/MouseRelatedEvent.h:
1114         (WebCore::MouseRelatedEvent::IsSimulated): Added.
1115         * dom/SimulatedClick.cpp:
1116         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent): Get OptionSet<Modifier> out of the underlying event
1117         instead of manually setting each key state. This code now preserves the state of caps lock and alt-graph
1118         keys but this is not observable because we have yet to implement getModifierState on MouseEvent.
1119         (WebCore::SimulatedMouseEvent::modifiersFromUnderlyingEvent): Added.
1120         * dom/TouchEvent.cpp:
1121         (WebCore::TouchEvent::TouchEvent):
1122         * dom/TouchEvent.h:
1123         * dom/UIEventWithKeyState.h:
1124         (WebCore::UIEventWithKeyState::Modifier): Alias to PlatformEvent::Modifier.
1125         (WebCore::UIEventWithKeyState::ctrlKey const): Updated to use m_modifiers.
1126         (WebCore::UIEventWithKeyState::shiftKey const): Ditto.
1127         (WebCore::UIEventWithKeyState::altKey const): Ditto.
1128         (WebCore::UIEventWithKeyState::metaKey const): Ditto.
1129         (WebCore::UIEventWithKeyState::altGraphKey const): Ditto.
1130         (WebCore::UIEventWithKeyState::capsLockKey const): Ditto.
1131         (WebCore::UIEventWithKeyState::modifierKeys): Added.
1132         (WebCore::UIEventWithKeyState::UIEventWithKeyState): Now takes OptionSet<Modifier>.
1133         (WebCore::UIEventWithKeyState::setModifierKeys): Added. Used by init*Event functions in subclasses. Note that
1134         these functions preseve the states of alt-graph and caps lock keys to match the existing behaviors in this
1135         cleanup patch but they don't match behaviors of Chrome or Firefox.
1136         (WebCore::UIEventWithKeyState::modifiersFromInitializer): Added.
1137         * dom/WheelEvent.cpp:
1138         (WebCore::WheelEvent::WheelEvent): Simulated::No corresponds to the last boolean being false.
1139         * page/EventHandler.cpp:
1140         (WebCore::EventHandler::dispatchDragEvent):
1141         (WebCore::EventHandler::handleTouchEvent):
1142         * platform/PlatformEvent.h:
1143         (WebCore::PlatformEvent::Modifier): Added AltGraphKey.
1144         * platform/mac/PlatformEventFactoryMac.h:
1145         (WebCore::modifiersForEvent): Exported to be used in [WebPDFView PDFViewWillClickOnLink:withURL:].
1146         * platform/mac/PlatformEventFactoryMac.mm:
1147         (WebCore::modifiersForEvent):
1148         * testing/Internals.cpp:
1149         (WebCore::Internals::accessKeyModifiers const):
1150
1151 2018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1152
1153         [Attachment Support] Remove _WKAttachments and notify the UI client upon mainframe navigation
1154         https://bugs.webkit.org/show_bug.cgi?id=188715
1155         <rdar://problem/43541790>
1156
1157         Reviewed by Tim Horton.
1158
1159         Rename didInsertAttachment to didInsertAttachmentWithIdentifier. See WebKit ChangeLog for more detail.
1160
1161         Tests:  WKAttachmentTests.InvalidateAttachmentsAfterMainFrameNavigation
1162                 WKAttachmentTests.InvalidateAttachmentsAfterWebProcessTermination
1163
1164         * editing/Editor.cpp:
1165         (WebCore::Editor::notifyClientOfAttachmentUpdates):
1166         * page/EditorClient.h:
1167         (WebCore::EditorClient::didInsertAttachmentWithIdentifier):
1168         (WebCore::EditorClient::didRemoveAttachmentWithIdentifier):
1169         (WebCore::EditorClient::didInsertAttachment): Deleted.
1170         (WebCore::EditorClient::didRemoveAttachment): Deleted.
1171
1172 2018-08-21  Ryan Haddad  <ryanhaddad@apple.com>
1173
1174         Unreviewed, rolling out r235128.
1175
1176         The test added with this change is frequently failing.
1177
1178         Reverted changeset:
1179
1180         "Support "name" option for dedicated workers"
1181         https://bugs.webkit.org/show_bug.cgi?id=188779
1182         https://trac.webkit.org/changeset/235128
1183
1184 2018-08-21  Commit Queue  <commit-queue@webkit.org>
1185
1186         Unreviewed, rolling out r235107.
1187         https://bugs.webkit.org/show_bug.cgi?id=188832
1188
1189         "It revealed bugs in Blob code as well as regressed JS
1190         performance tests" (Requested by saamyjoon on #webkit).
1191
1192         Reverted changeset:
1193
1194         "JSRunLoopTimer may run part of a member function after it's
1195         destroyed"
1196         https://bugs.webkit.org/show_bug.cgi?id=188426
1197         https://trac.webkit.org/changeset/235107
1198
1199 2018-08-21  Megan Gardner  <megan_gardner@apple.com>
1200
1201         Use VisiblePosition to calculate selection ranges
1202         https://bugs.webkit.org/show_bug.cgi?id=188767
1203         <rdar://problem/43577166>
1204
1205         Reviewed by Ryosuke Niwa.
1206
1207         Exposing comparePositions.
1208
1209         * editing/Editing.h:
1210
1211 2018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1212
1213         [Attachment Support] Augment _WKAttachment SPI to handle NSFileWrappers in addition to NSData
1214         https://bugs.webkit.org/show_bug.cgi?id=188496
1215         <rdar://problem/43216836>
1216
1217         Reviewed by Tim Horton.
1218
1219         Refactors logic around HTMLAttachmentElement and pasteboard reading helpers, in support of moving the data
1220         backing for attachment elements to the client layer, instead of keeping it in the attachment element's File.
1221         Augmented existing API tests in WKAttachmentTests, and also added a new API test (see Tools for more detail).
1222
1223         * WebCore.xcodeproj/project.pbxproj:
1224         * dom/Document.cpp:
1225         (WebCore::Document::didInsertAttachmentElement):
1226
1227         Notify the client layer when a newly inserted attachment element's identifier has been updated to avoid
1228         colliding with the identifier of an existing attachment element. This can happen if, for instance, one or more
1229         attachments are copied and pasted within the same document.
1230
1231         * editing/Editor.cpp:
1232         (WebCore::Editor::registerAttachmentIdentifier):
1233         (WebCore::Editor::cloneAttachmentData):
1234
1235         Add new helper functions to notify the client when the attachment identifier to data mapping needs to be
1236         updated. This can happen in three ways: (1) an attachment is created with raw data, or (2) an attachment is
1237         created with a file path, or (3) the unique identifier for an attachment element has been reassigned. These
1238         correspond to the two versions of `registerAttachmentIdentifier`, and `cloneAttachmentData`, respectively.
1239
1240         (WebCore::EditorClient::supportsClientSideAttachmentData const):
1241
1242         Add a new EditorClient hook to determine whether client-side attachment data management is supported. Currently,
1243         this only returns true for WebKit2. If this flag is set to true, we register attachment identifiers and don't
1244         create a new File object for the attachment element; otherwise, fall back to creating and setting a File for the
1245         new attachment element.
1246
1247         (WebCore::Editor::insertAttachment):
1248         (WebCore::Editor::insertAttachmentFromFile): Deleted.
1249
1250         Adjust logic when inserting an attachment; we now only need to update the attributes of the attachment element
1251         with metadata from the client layer.
1252
1253         * editing/Editor.h:
1254         * editing/cocoa/WebContentReaderCocoa.mm:
1255         (WebCore::supportsClientSideAttachmentData):
1256         (WebCore::createFragmentForImageAttachment):
1257
1258         Notify the client when creating an attachment element from image data on the pasteboard.
1259
1260         (WebCore::replaceRichContentWithAttachments):
1261
1262         Refactor this helper function to no longer connect attachment elements to File objects created from
1263         subresources. Instead, just update each attachment element's attributes using information about the subresource,
1264         and then notify the client about the new attachment data and attachment identifier.
1265
1266         (WebCore::createFragmentAndAddResources):
1267         (WebCore::sanitizeMarkupWithArchive):
1268
1269         Plumb the current WebContentReader's Frame& to each of these helpers, so that it can call out to the client.
1270
1271         (WebCore::WebContentReader::readWebArchive):
1272         (WebCore::WebContentMarkupReader::readWebArchive):
1273         (WebCore::WebContentReader::readImage):
1274         (WebCore::WebContentReader::readFilePaths):
1275
1276         Notify the client when creating an attachment from the path of a dropped file.
1277
1278         * html/AttachmentTypes.h:
1279
1280         Remove AttachmentInfo. This is no longer necessary because we don't need to request attachment data from the web
1281         process anymore.
1282
1283         * html/HTMLAttachmentElement.cpp:
1284         (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):
1285
1286         Add a helper function on the attachment element to create and return a unique identifier if needed.
1287
1288         (WebCore::HTMLAttachmentElement::updateAttributes):
1289
1290         Add a helper method to update the displayed element attributes (type, title and subtitle) or an attachment.
1291
1292         (WebCore::AttachmentDataReader::create): Deleted.
1293         (WebCore::AttachmentDataReader::AttachmentDataReader): Deleted.
1294
1295         Remove AttachmentDataReader. This helper class was only used to load attachment data when requesting attachment
1296         information in the client, but this is now obviated by moving attachment data to the client layer.
1297
1298         (WebCore::HTMLAttachmentElement::updateFileWithData): Deleted.
1299         (WebCore::HTMLAttachmentElement::requestInfo): Deleted.
1300         (WebCore::HTMLAttachmentElement::destroyReader): Deleted.
1301         (WebCore::AttachmentDataReader::~AttachmentDataReader): Deleted.
1302         (WebCore::AttachmentDataReader::didFinishLoading): Deleted.
1303         (WebCore::AttachmentDataReader::didFail): Deleted.
1304         (WebCore::AttachmentDataReader::invokeCallbackAndFinishReading): Deleted.
1305         * html/HTMLAttachmentElement.h:
1306         * page/DragClient.h:
1307         * page/DragController.cpp:
1308         (WebCore::DragController::startDrag):
1309         (WebCore::DragController::doSystemDrag):
1310         (WebCore::DragController::promisedAttachmentInfo):
1311
1312         Allow dragging an attachment (even if it does not have a file) as long as it has a unique identifier and a
1313         content type.
1314
1315         (WebCore::DragController::promisedBlobInfo): Deleted.
1316         * page/DragController.h:
1317         * page/EditorClient.h:
1318         (WebCore::EditorClient::registerAttachmentIdentifier):
1319         (WebCore::EditorClient::cloneAttachmentData):
1320         * platform/DragItem.h:
1321         (WebCore::DragItem::encode const):
1322         (WebCore::DragItem::decode):
1323         * platform/PromisedAttachmentInfo.h: Renamed from Source/WebCore/platform/PromisedBlobInfo.h.
1324
1325         Add an attachment identifier to PromisedBlobInfo. Additionally, rename PromisedBlobInfo to
1326         PromisedAttachmentInfo, since it is currently exclusively used to attachment element data to the pasteboard.
1327         In the future, this could be renamed to something more general (e.g. PromisedPasteboardData), should we use this
1328         mechanism to write data from other sources to the pasteboard.
1329
1330         (WebCore::PromisedAttachmentInfo::operator bool const):
1331
1332 2018-08-21  Brent Fulgham  <bfulgham@apple.com>
1333
1334         Remove experimental affiliated domain code now that StorageAccess API is available
1335         https://bugs.webkit.org/show_bug.cgi?id=188756
1336         <rdar://problem/43527848>
1337
1338         Reviewed by Alex Christensen.
1339
1340         In Bug 174661 we added a compatibility quirk to support wsj.com authentication. This quirk is no longer needed,
1341         since the StorageAccess API provides the necessary tools to do this type of interaction without needing global
1342         cross-site access.
1343
1344         * loader/ResourceLoadObserver.cpp:
1345         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1346         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1347         (WebCore::areDomainsAssociated): Deleted.
1348         (WebCore::shouldEnableSiteSpecificQuirks): Deleted.
1349         * loader/ResourceLoadStatistics.cpp:
1350         (WebCore::ResourceLoadStatistics::areDomainsAssociated): Deleted.
1351         * loader/ResourceLoadStatistics.h:
1352
1353 2018-08-21  Antti Koivisto  <antti@apple.com>
1354
1355         Allow creating WeakPtrs to const objects
1356         https://bugs.webkit.org/show_bug.cgi?id=188785
1357
1358         Reviewed by Geoffrey Garen.
1359
1360         Remove some unneeded const_casts.
1361
1362         * css/MediaQueryEvaluator.cpp:
1363         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
1364         (WebCore::MediaQueryEvaluator::evaluate const):
1365         * css/MediaQueryEvaluator.h:
1366         * rendering/FloatingObjects.cpp:
1367         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
1368         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
1369         (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
1370         (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
1371         (WebCore::FloatingObjects::FloatingObjects):
1372         * rendering/FloatingObjects.h:
1373         (WebCore::FloatingObjects::renderer const):
1374
1375 2018-08-21  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1376
1377         Support "name" option for dedicated workers
1378         https://bugs.webkit.org/show_bug.cgi?id=188779
1379
1380         Reviewed by Joseph Pecoraro.
1381
1382         This patch adds `new Worker(url, { name: "Worker Name" })` option support[1].
1383         This name can be accessible from `self.name` of DedicatedWorkerGlobalScope.
1384         It is useful for debugging dedicated workers if the inspector can show the
1385         names of the workers. This enhancement is tracked by [2].
1386
1387         [1]: https://github.com/whatwg/html/issues/2477
1388         [2]: https://bugs.webkit.org/show_bug.cgi?id=164678
1389
1390         * workers/DedicatedWorkerGlobalScope.cpp:
1391         (WebCore::DedicatedWorkerGlobalScope::create):
1392         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1393         Hold `name` member.
1394
1395         * workers/DedicatedWorkerGlobalScope.h:
1396         * workers/DedicatedWorkerGlobalScope.idl:
1397         Add `name` attribute.
1398
1399         * workers/DedicatedWorkerThread.cpp:
1400         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1401         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
1402         * workers/DedicatedWorkerThread.h:
1403         * workers/Worker.cpp:
1404         (WebCore::Worker::Worker):
1405         (WebCore::Worker::create):
1406         (WebCore::Worker::notifyFinished):
1407         * workers/Worker.h:
1408         * workers/Worker.idl:
1409         Add WorkerOptions for dedicated worker creation.
1410
1411         * workers/WorkerGlobalScopeProxy.h:
1412         * workers/WorkerMessagingProxy.cpp:
1413         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1414         * workers/WorkerMessagingProxy.h:
1415         * workers/WorkerThread.cpp:
1416         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
1417         Isolate copy the given `name` to pass the worker thread.
1418
1419         (WebCore::WorkerThread::WorkerThread):
1420         (WebCore::WorkerThread::workerThread):
1421         * workers/WorkerThread.h:
1422         * workers/service/context/ServiceWorkerThread.cpp:
1423         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1424         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
1425         * workers/service/context/ServiceWorkerThread.h:
1426
1427 2018-08-21  Per Arne Vollan  <pvollan@apple.com>
1428
1429         [WebGL] Contexts are not updated when display configuration changed.
1430         https://bugs.webkit.org/show_bug.cgi?id=188750
1431
1432         Reviewed by Brent Fulgham.
1433
1434         Calling CGDisplayRegisterReconfigurationCallback in GraphicsContext3DManager::addContext
1435         returns kCGErrorSuccess when WindowServer access is blocked in the WebContent process,
1436         but the callback function is never called. We should register the callback function in
1437         the UI process, and send a message to the WebContent process when the display
1438         configuration changed.
1439
1440         Test: fast/canvas/webgl/context-update-on-display-configuration.html
1441
1442         * WebCore.xcodeproj/project.pbxproj:
1443         * platform/graphics/GraphicsContext3DManager.cpp:
1444         (WebCore::GraphicsContext3DManager::displayWasReconfigured):
1445         (WebCore::GraphicsContext3DManager::addContext):
1446         (WebCore::GraphicsContext3DManager::removeContext):
1447         (WebCore::displayWasReconfigured): Deleted.
1448         * platform/graphics/GraphicsContext3DManager.h:
1449
1450 2018-08-21  John Wilander  <wilander@apple.com>
1451
1452         Make ResourceLoadObserver::logWebSocketLoading() handle websockets in detached frames
1453         https://bugs.webkit.org/show_bug.cgi?id=188757
1454         <rdar://problem/38713390>
1455
1456         Reviewed by Alex Christensen.
1457
1458         Test: http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html
1459
1460         * Modules/websockets/WebSocket.cpp:
1461         (WebCore::WebSocket::connect):
1462             Now logs even when a frame doesn't exist.
1463         * loader/ResourceLoadObserver.cpp:
1464         (WebCore::ResourceLoadObserver::shouldLog const):
1465             Now takes boolean 'usesEphemeralSession' instead of a page to support logging when there is no page.
1466         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1467             Changed to send a boolean to ResourceLoadObserver::shouldLog().
1468         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1469             Changed to:
1470             - receive the main frame's URL and a boolean for ephemeral sessions instead of the Frame.
1471             - send a boolean to ResourceLoadObserver::shouldLog().
1472             - No longer call areDomainsAssociated(). It is being removed in https://bugs.webkit.org/show_bug.cgi?id=188756.
1473         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1474             Changed to send a boolean to ResourceLoadObserver::shouldLog().
1475         * loader/ResourceLoadObserver.h:
1476
1477 2018-08-21  Daniel Bates  <dabates@apple.com>
1478
1479         Disallow navigations when page cache updates the current document of the frame
1480         https://bugs.webkit.org/show_bug.cgi?id=188422
1481
1482         Reviewed by Ryosuke Niwa.
1483
1484         Make use of NavigationDisabler to disallow navigations when associating the cached
1485         document back with its frame (i.e. calling Frame::setDocument()).
1486
1487         When we associate a cached document with its frame we will construct its render tree
1488         and run post style resolution callbacks that can do anything, including performing
1489         a frame load. Until page restoration is comnplete the frame tree is in a transient
1490         state that makes reasoning about it difficult and error prone. We should not allow
1491         navigations in this state.
1492
1493         Test: fast/history/go-back-to-object-subframe.html
1494
1495         * loader/FrameLoader.cpp:
1496         (WebCore::FrameLoader::open):
1497
1498 2018-08-21  Daniel Bates  <dabates@apple.com>
1499
1500         Replace TextCheckingTypeMask with OptionSet
1501         https://bugs.webkit.org/show_bug.cgi?id=188678
1502
1503         Reviewed by Antti Koivisto.
1504
1505         Replaces TextCheckingTypeMask with an OptionSet to improve type safety and code clarity. Additionally
1506         change the values of TextCheckingType such that all the enumerators fit within an uint8_t.
1507
1508         * PlatformMac.cmake:
1509         * SourcesCocoa.txt:
1510         * WebCore.xcodeproj/project.pbxproj:
1511         * accessibility/AccessibilityObject.cpp:
1512         (WebCore::AccessibilityObject::hasMisspelling const):
1513         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1514         (AXAttributeStringSetSpelling):
1515         * editing/AlternativeTextController.cpp:
1516         (WebCore::AlternativeTextController::timerFired):
1517         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
1518         * editing/Editor.cpp:
1519         (WebCore::Editor::replaceSelectionWithFragment):
1520         (WebCore::Editor::markMisspellingsAfterTypingToWord):
1521         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
1522         (WebCore::isAutomaticTextReplacementType):
1523         (WebCore::Editor::markAndReplaceFor): For now, change a local variable from const to non-const to work
1524         around the following MSVC compiler bug: <https://developercommunity.visualstudio.com/content/problem/316713/msvc-cant-compile-webkits-optionsetcontainsany.html>.
1525         (WebCore::Editor::markMisspellingsAndBadGrammar):
1526         (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
1527         (WebCore::Editor::editorUIUpdateTimerFired):
1528         (WebCore::Editor::resolveTextCheckingTypeMask):
1529         * editing/Editor.h:
1530         * editing/SpellChecker.cpp:
1531         (WebCore::SpellCheckRequest::SpellCheckRequest):
1532         (WebCore::SpellCheckRequest::create):
1533         (WebCore::SpellChecker::didCheckSucceed):
1534         * editing/SpellChecker.h:
1535         * editing/TextCheckingHelper.cpp:
1536         (WebCore::findGrammaticalErrors):
1537         (WebCore::findMisspellings):
1538         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
1539         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
1540         (WebCore::checkTextOfParagraph):
1541         * editing/TextCheckingHelper.h:
1542         * loader/EmptyClients.cpp:
1543         * platform/text/TextCheckerClient.h:
1544         * platform/text/TextChecking.h: Remove TextCheckingTypeMask. Reorganized the fields of TextCheckingRequestData
1545         to coallesce padding and move it to the end of class. Also used default initializer syntax and defaulted (= default)
1546         the default constructor of TextCheckingRequestData, removing the need for a user-defined default constructor.
1547         (WebCore::TextCheckingRequestData::TextCheckingRequestData):
1548         (WebCore::TextCheckingRequestData::text const): Changed return type from String to const String&
1549         to avoid unnecessary ref-count churn for callers that do not need to take a shared ownership in
1550         this string.
1551         (WebCore::TextCheckingRequestData::checkingTypes const): Renamed; formerly named mask.
1552         (WebCore::TextCheckingRequestData::mask const): Deleted.
1553         * platform/text/mac/TextCheckingMac.mm: Added.
1554         (WebCore::nsTextCheckingTypes):
1555         * testing/Internals.cpp:
1556         (WebCore::Internals::handleAcceptedCandidate):
1557
1558 2018-08-21  Fujii Hironori  <Hironori.Fujii@sony.com>
1559
1560         Don't place "using namespace XXX;" in global space for unified source builds
1561         https://bugs.webkit.org/show_bug.cgi?id=188739
1562
1563         Reviewed by Yusuke Suzuki.
1564
1565         No new tests (No behavior change).
1566
1567         * html/track/AudioTrackList.cpp:
1568         * html/track/TextTrackList.cpp:
1569         * html/track/VideoTrackList.cpp:
1570         * page/SecurityOriginData.cpp:
1571         * page/TextIndicator.cpp:
1572         * platform/geoclue/GeolocationProviderGeoclue.cpp:
1573         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
1574         * platform/graphics/win/FullScreenController.cpp:
1575         * platform/mediastream/CaptureDeviceManager.cpp:
1576         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
1577         * svg/animation/SMILTime.cpp:
1578         * testing/js/WebCoreTestSupport.cpp:
1579         * xml/XPathParser.cpp:
1580
1581 2018-08-21  Philippe Normand  <philn@igalia.com>
1582
1583         [GStreamer] Warn early about incomplete MSE track switching support
1584         https://bugs.webkit.org/show_bug.cgi?id=188653
1585
1586         Reviewed by Xabier Rodriguez-Calvar.
1587
1588         The proper track switching support shall be fixed at some point by:
1589         https://bugs.webkit.org/show_bug.cgi?id=182531.
1590
1591         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1592         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Remove redundant test.
1593         (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Exit early if
1594         this method is called by the MSE player.
1595
1596 2018-08-21  Philippe Normand  <philn@igalia.com>
1597
1598         [GStreamer][MSE] Generic main thread notification support
1599         https://bugs.webkit.org/show_bug.cgi?id=188647
1600
1601         Reviewed by Xabier Rodriguez-Calvar.
1602
1603         Using GstBus for main thread notifications has the side effect of "leaking" the
1604         application messages to the media player, leading to CPU cycles wasting.
1605
1606         No new tests, existing MSE tests cover this change.
1607
1608         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1609         (webkit_media_src_init):
1610         (webKitMediaSrcFinalize):
1611         (webKitMediaSrcSetMediaPlayerPrivate):
1612         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
1613
1614 2018-08-21  Philippe Normand  <philn@igalia.com>
1615
1616         [GStreamer][MSE] Remove parsers from playback pipeline
1617         https://bugs.webkit.org/show_bug.cgi?id=188646
1618
1619         Reviewed by Xabier Rodriguez-Calvar.
1620
1621         Decodebin already includes parsers in front of the decoders.
1622
1623         No new tests, existing MSE tests cover this change.
1624
1625         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1626         (WebCore::PlaybackPipeline::addSourceBuffer):
1627         (WebCore::PlaybackPipeline::attachTrack):
1628         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1629         (webKitMediaSrcLinkSourcePad):
1630         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
1631
1632 2018-08-21  Commit Queue  <commit-queue@webkit.org>
1633
1634         Unreviewed, rolling out r234979.
1635         https://bugs.webkit.org/show_bug.cgi?id=188780
1636
1637         broke ubuntu LTS build (Requested by philn on #webkit).
1638
1639         Reverted changeset:
1640
1641         "[GTK] Never return an uninitialized ImageGStreamer object."
1642         https://bugs.webkit.org/show_bug.cgi?id=188305
1643         https://trac.webkit.org/changeset/234979
1644
1645 2018-08-21  Saam barati  <sbarati@apple.com>
1646
1647         JSRunLoopTimer may run part of a member function after it's destroyed
1648         https://bugs.webkit.org/show_bug.cgi?id=188426
1649
1650         Reviewed by Mark Lam.
1651
1652         * page/cocoa/ResourceUsageThreadCocoa.mm:
1653         (WebCore::ResourceUsageThread::platformThreadBody):
1654         * page/linux/ResourceUsageThreadLinux.cpp:
1655         (WebCore::ResourceUsageThread::platformThreadBody):
1656
1657 2018-08-20  Devin Rousso  <drousso@apple.com>
1658
1659         Web Inspector: allow breakpoints to be set for specific event listeners
1660         https://bugs.webkit.org/show_bug.cgi?id=183138
1661
1662         Reviewed by Joseph Pecoraro.
1663
1664         Test: inspector/dom/breakpoint-for-event-listener.html
1665
1666         * inspector/agents/InspectorDOMAgent.h:
1667         * inspector/agents/InspectorDOMAgent.cpp:
1668         (WebCore::InspectorDOMAgent::getEventListenersForNode):
1669         (WebCore::InspectorDOMAgent::setEventListenerDisabled):
1670         (WebCore::InspectorDOMAgent::setBreakpointForEventListener): Added.
1671         (WebCore::InspectorDOMAgent::removeBreakpointForEventListener): Added.
1672         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1673         (WebCore::InspectorDOMAgent::willRemoveEventListener):
1674         (WebCore::InspectorDOMAgent::isEventListenerDisabled):
1675         (WebCore::InspectorDOMAgent::hasBreakpointForEventListener): Added.
1676         (WebCore::InspectorDOMAgent::idForEventListener): Added.
1677         Rework the event listener data structure to be based on ID instead of `EventListener`, since
1678         it is possible to have the same `EventListener` be used for multiple events.
1679
1680         * inspector/agents/InspectorDOMDebuggerAgent.h:
1681         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
1682         (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint):
1683         (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint):
1684         (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint):
1685         (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint):
1686         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent): Added.
1687         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
1688         For DOM events, also check to see if there is a matching event listener specific breakpoint
1689         set via the DOMAgent, and break on it if one is found.
1690
1691         * inspector/InspectorInstrumentation.h:
1692         * inspector/InspectorInstrumentation.cpp:
1693         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
1694         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
1695         (WebCore::InspectorInstrumentation::willHandleEventImpl):
1696         (WebCore::InspectorInstrumentation::willFireTimerImpl):
1697         (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded):
1698         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
1699         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
1700         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
1701         Split off `pauseOnNativeEventIfNeeded` to only handle non-DOM events, since all DOM events
1702         would already only go through `willHandleEvent`.
1703
1704 2018-08-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1705
1706         [CMake] Sync unified build with Cocoa ports
1707         https://bugs.webkit.org/show_bug.cgi?id=188732
1708
1709         Reviewed by Tim Horton.
1710
1711         For iOS, disambiguate between ::WebEvent declared in PlatformKeyboardEvent.h and
1712         WebCore::WebEvent declared in WebEvent.h. It's expected that we'll have to deal with random
1713         issues like this when modifying unrelated source files in higher-level projects, since any
1714         change to the sources list changes which files get bundled together, and headers from
1715         lower-level projects that were not included before may now be included together.
1716
1717         * platform/PlatformKeyboardEvent.h:
1718         (WebCore::PlatformKeyboardEvent::event const):
1719
1720 2018-08-20  David Kilzer  <ddkilzer@apple.com>
1721
1722         REGRESSION (r223192): Remove invalid `path` for Modules/geolocation/ios folder
1723
1724         * WebCore.xcodeproj/project.pbxproj: Remove invalid `path`
1725         setting for WebCore/Modules/geolocation/ios folder. This was
1726         found while working on a script for Bug 188754: Tool to fix
1727         folders that should map to directories in Xcode project files.
1728
1729 2018-08-20  David Kilzer  <ddkilzer@apple.com>
1730
1731         REGRESSION (r235015): Xcode changes `mainGroup` name when updating WebCore project file
1732
1733         * WebCore.xcodeproj/project.pbxproj:
1734         - Change `name` to "WebCore" within the group used by
1735           `mainGroup` so Xcode won't keep changing its value back to
1736           "WebKit".
1737
1738 2018-08-20  Jeremy Jones  <jeremyj@apple.com>
1739
1740         UIWebView crashes while attempting to play youtube video on phone
1741         https://bugs.webkit.org/show_bug.cgi?id=188351
1742         rdar://problem/42489664
1743
1744         Reviewed by David Kilzer.
1745
1746         Test will be incorporated with fix for 188749, which will test both fixes.
1747
1748         VideoFullscreenControllerContext must remove unretained reference to it from m_playbackModel during cleanup.
1749
1750         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1751         (VideoFullscreenControllerContext::didCleanupFullscreen):
1752
1753 2018-08-20  Eric Carlson  <eric.carlson@apple.com>
1754
1755         [MediaStream] Move capture device monitoring to WebKit
1756         https://bugs.webkit.org/show_bug.cgi?id=188521
1757         <rdar://problem/43251787>
1758
1759         Reviewed by Youenn Fablet.
1760
1761         No new tests, updated fast/mediastream/device-change-event-2.html for the changes.
1762
1763         * Modules/mediastream/MediaDevices.cpp:
1764         (WebCore::MediaDevices::MediaDevices): Device change listener is added in addEventListener.
1765         (WebCore::MediaDevices::stop): Device change listener is on the user media controller.
1766         (WebCore::MediaDevices::addEventListener): Add the device change listener only once the first
1767         event handler is added.
1768         * Modules/mediastream/MediaDevices.h:
1769
1770         * Modules/mediastream/UserMediaClient.h:
1771         * Modules/mediastream/UserMediaController.h:
1772         (WebCore::UserMediaController::addDeviceChangeObserver): Pass through to the client.
1773         (WebCore::UserMediaController::removeDeviceChangeObserver): Ditto.
1774
1775         * platform/mediastream/CaptureDeviceManager.cpp:
1776         (CaptureDeviceManager::deviceChanged): Notify RealtimeMediaSourceCenter.
1777         (nextObserverToken): Deleted.
1778         (CaptureDeviceManager::addCaptureDeviceChangedObserver): Deleted.
1779         (CaptureDeviceManager::removeCaptureDeviceChangedObserver): Deleted.
1780         * platform/mediastream/CaptureDeviceManager.h:
1781
1782         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1783         (WebCore::RealtimeMediaSourceCenter::setDevicesChangedObserver):
1784         (WebCore::RealtimeMediaSourceCenter::captureDevicesChanged):
1785         (WebCore::observerMap): Deleted.
1786         (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver): Deleted.
1787         (WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver): Deleted.
1788         * platform/mediastream/RealtimeMediaSourceCenter.h:
1789
1790         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
1791         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): Call base class.
1792
1793         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1794         (WebCore::AVCaptureDeviceManager::deviceConnected): Ditto.
1795         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Ditto.
1796
1797         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
1798         (WebCore::deviceHasInputStreams): Drive-by fix, check the number of buffers to see if the
1799         device has input streams.
1800         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): Use new bool parameter
1801         added to refreshAudioCaptureDevices so we won't trigger a device change event on the first scan.
1802         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): Add param.
1803         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Use new param.
1804         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
1805
1806         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1807         (WebCore::MockRealtimeMediaSourceCenter::setDevices): Don't need to call captureDevicesChanged,
1808         it is done in the UI process.
1809         (WebCore::MockRealtimeMediaSourceCenter::addDevice): Ditto.
1810         (WebCore::MockRealtimeMediaSourceCenter::removeDevice): Ditto.
1811
1812         * testing/InternalSettings.cpp:
1813         (WebCore::InternalSettings::setPageIsFocusedAndActive): New, used by updated test.
1814         * testing/Internals.h:
1815         * testing/Internals.idl:
1816
1817 2018-08-20  Rob Buis  <rbuis@igalia.com>
1818
1819         Throw an exception if window.open() gets passed a URL that cannot be parsed
1820         https://bugs.webkit.org/show_bug.cgi?id=171656
1821
1822         Reviewed by Darin Adler.
1823
1824         Throw a SyntaxError exception when an invalid url gets passed into window.open().
1825
1826         Tests: imported/w3c/web-platform-tests/url/failure.html
1827                fast/dom/Window/open-invalid-url.html
1828
1829         * page/DOMWindow.cpp:
1830         (WebCore::DOMWindow::createWindow):
1831         (WebCore::DOMWindow::open):
1832         (WebCore::DOMWindow::showModalDialog):
1833         * page/DOMWindow.h:
1834         * page/DOMWindow.idl:
1835         * testing/Internals.cpp:
1836         (WebCore::Internals::openDummyInspectorFrontend):
1837
1838 2018-08-20  Ms2ger  <Ms2ger@igalia.com>
1839
1840         [SOUP] Check length before calling soup_message_body_append_buffer.
1841         https://bugs.webkit.org/show_bug.cgi?id=176803
1842
1843         Reviewed by Carlos Garcia Campos.
1844
1845         The function has a precondition that the buffer is non-empty.
1846
1847         Test: http/tests/local/blob/send-hybrid-blob-using-open-panel.html
1848
1849         * platform/network/soup/ResourceRequestSoup.cpp:
1850         (WebCore::appendEncodedBlobItemToSoupMessageBody):
1851         (WebCore::ResourceRequest::updateSoupMessageBody const):
1852
1853 2018-08-20  Rob Buis  <rbuis@igalia.com>
1854
1855         Relax Request constructor around referrers
1856         https://bugs.webkit.org/show_bug.cgi?id=168649
1857
1858         Reviewed by Darin Adler.
1859
1860         Implement remaining part of fetch change
1861         https://github.com/whatwg/fetch/pull/377, i.e.
1862         if "parsedReferrer’s origin is not same origin with origin",
1863         then set request’s referrer to "client", instead of
1864         throwing an exception [1].
1865
1866         WebKit's new behavior matches that of Chrome and Firefox.
1867
1868         Testing is covered by existing wpt tests.
1869
1870         [1] Step 15.3.3 of https://fetch.spec.whatwg.org/#main-fetch
1871
1872         * Modules/fetch/FetchRequest.cpp:
1873         (WebCore::computeReferrer):
1874
1875 2018-08-19  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1876
1877         Shrink size of WebCore::Event further by reordering members
1878         https://bugs.webkit.org/show_bug.cgi?id=188734
1879
1880         Reviewed by Daniel Bates.
1881
1882         Since WebCore::Event is ref-counted class, it has 4bytes m_refCount at the head of the class.
1883         So placing 4bytes just after that before placing 8bytes aligned member (like pointers in 64bit
1884         platforms) can save the size of WebCore::Event further.
1885         This patch reorders members of WebCore::Event to shrink the size from 80bytes to 72bytes.
1886
1887         No behavior change.
1888
1889         * dom/Event.cpp:
1890         (WebCore::Event::Event):
1891         * dom/Event.h:
1892
1893 2018-08-18  David Kilzer  <ddkilzer@apple.com>
1894
1895         Let Xcode have its way with the WebCore project
1896
1897         * WebCore.xcodeproj/project.pbxproj:
1898         - Let Xcode sort recently added resources by unique ID.
1899         - Manually change the `mainGroup` name from "WebKit" to
1900           "WebCore".  There's no need to do this other than to make the
1901           inside of the proverbial cabinet match the outside.  It's been
1902           this way since the project file was committed in r9857.
1903
1904 2018-08-18  Ali Juma  <ajuma@chromium.org>
1905
1906         [IntersectionObserver] Fire an initial dummy notification
1907         https://bugs.webkit.org/show_bug.cgi?id=188670
1908
1909         Reviewed by Simon Fraser.
1910
1911         Add logic to track ongoing intersection observations. Create an IntersectionObserverRegistration
1912         and fire a single dummy notification for each one.
1913
1914         Test: intersection-observer/root-element-moved.html
1915         Also tested by existing tests in imported/w3c/web-platform-tests/intersection-observer.
1916
1917         * dom/Document.cpp:
1918         (WebCore::Document::~Document):
1919         (WebCore::Document::addIntersectionObserver):
1920         (WebCore::Document::removeIntersectionObserver):
1921         (WebCore::Document::updateIntersectionObservations):
1922         (WebCore::Document::notifyIntersectionObserversTimerFired):
1923         * dom/Document.h:
1924         (WebCore::Document::numberOfIntersectionObservers const):
1925         * dom/Element.cpp:
1926         (WebCore::Element::didMoveToNewDocument):
1927         (WebCore::Element::disconnectFromIntersectionObservers):
1928         * page/IntersectionObserver.cpp:
1929         (WebCore::IntersectionObserver::create):
1930         (WebCore::IntersectionObserver::IntersectionObserver):
1931         (WebCore::IntersectionObserver::~IntersectionObserver):
1932         (WebCore::IntersectionObserver::observe):
1933         (WebCore::IntersectionObserver::unobserve):
1934         (WebCore::IntersectionObserver::disconnect):
1935         (WebCore::IntersectionObserver::takeRecords):
1936         (WebCore::IntersectionObserver::targetDestroyed):
1937         (WebCore::IntersectionObserver::removeTargetRegistration):
1938         (WebCore::IntersectionObserver::removeAllTargets):
1939         (WebCore::IntersectionObserver::rootDestroyed):
1940         (WebCore::IntersectionObserver::appendQueuedEntry):
1941         (WebCore::IntersectionObserver::notify):
1942         * page/IntersectionObserver.h:
1943         (WebCore::IntersectionObserver::trackingDocument):
1944         (WebCore::IntersectionObserver:: const):
1945         (WebCore::IntersectionObserver::hasObservationTargets const):
1946         * page/IntersectionObserver.idl:
1947         * testing/Internals.cpp:
1948         (WebCore::Internals::numberOfIntersectionObservers const):
1949         * testing/Internals.h:
1950         * testing/Internals.idl:
1951
1952 2018-08-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1953
1954         [iOS] Paste is missing from callout bar when pasteboard only contains custom data
1955         https://bugs.webkit.org/show_bug.cgi?id=184271
1956         <rdar://problem/39256708>
1957
1958         Reviewed by Ryosuke Niwa.
1959
1960         Export a couple of WebCore functions for use in WebKit.
1961
1962         * dom/Document.h:
1963         * platform/Pasteboard.h:
1964
1965 2018-08-17  Ryosuke Niwa  <rniwa@webkit.org>
1966
1967         Pack booleans in Event into a bitfield
1968         https://bugs.webkit.org/show_bug.cgi?id=188713
1969
1970         Reviewed by Daniel Bates.
1971
1972         Use bitfields for booleans in Event class.
1973
1974         * dom/Event.cpp:
1975         (WebCore::Event::Event):
1976         * dom/Event.h:
1977         (WebCore::Event::IsComposed): Added.
1978         (WebCore::Event): Packed booleans into a bitfield.
1979
1980 2018-08-17  Aditya Keerthi  <akeerthi@apple.com>
1981
1982         [Datalist][iOS] Display suggestions for input[type=color]
1983         https://bugs.webkit.org/show_bug.cgi?id=188669
1984
1985         Reviewed by Tim Horton.
1986
1987         Expose suggestedColors() in HTMLInputElement in order to allow the UIProcess to
1988         access the list of suggested colors from a <datalist> element.
1989
1990         * html/ColorInputType.cpp:
1991         (WebCore::ColorInputType::suggestedColors const):
1992         * html/ColorInputType.h:
1993         * html/HTMLInputElement.cpp:
1994         (WebCore::HTMLInputElement::suggestedColors const):
1995         * html/HTMLInputElement.h:
1996         * html/InputType.cpp:
1997         (WebCore::InputType::suggestedColors const):
1998         * html/InputType.h:
1999         * platform/ColorChooserClient.h:
2000
2001 2018-08-17  Alex Christensen  <achristensen@webkit.org>
2002
2003         Clean up CSSSelectorList after r234825
2004         https://bugs.webkit.org/show_bug.cgi?id=188566
2005
2006         Reviewed by Megan Gardner.
2007
2008         This is responding to Darin's feedback in https://bugs.webkit.org/show_bug.cgi?id=188539
2009
2010         * css/CSSSelectorList.cpp:
2011         (WebCore::CSSSelectorList::operator=): Deleted.
2012         * css/CSSSelectorList.h:
2013         (WebCore::CSSSelectorList::CSSSelectorList):
2014         * css/parser/CSSParserImpl.cpp:
2015         (WebCore::CSSParserImpl::parsePageSelector):
2016         * css/parser/CSSSelectorParser.cpp:
2017         (WebCore::CSSSelectorParser::consumeComplexSelectorList):
2018         (WebCore::CSSSelectorParser::consumeCompoundSelectorList):
2019
2020 2018-08-17  Brent Fulgham  <bfulgham@apple.com>
2021
2022         Remove Adobe SSO exception now that StorageAccess API is available
2023         https://bugs.webkit.org/show_bug.cgi?id=188710
2024         <rdar://problem/35056707>
2025
2026         Reviewed by Alex Christensen.
2027
2028         Remove custom quirk now that proper API exists to allow the same functions.
2029
2030         * loader/ResourceLoadObserver.cpp:
2031         (WebCore::ResourceLoadObserver::logSubresourceLoading): Remove unneeded quirk.
2032         (WebCore::resourceNeedsSSOQuirk): Deleted.
2033
2034 2018-08-17  Ryosuke Niwa  <rniwa@webkit.org>
2035
2036         Replace canBubble and cancelable booleans in Event by enum classes
2037         https://bugs.webkit.org/show_bug.cgi?id=188692
2038         <rdar://problem/43411944>
2039
2040         Rubber-stamped by Alex Christensen.
2041
2042         Make these enum classes uint8_t.
2043
2044         * dom/Event.h:
2045
2046 2018-08-17  Alex Christensen  <achristensen@webkit.org>
2047
2048         Add some plumbing for safe browsing
2049         https://bugs.webkit.org/show_bug.cgi?id=188709
2050
2051         Reviewed by Tim Horton.
2052
2053         No change in behavior.  Just passing around unused booleans.
2054         We will need this for a way to load a page even though safe browsing says it's unsafe.
2055
2056         * WebCore.xcodeproj/project.pbxproj:
2057         * loader/EmptyClients.cpp:
2058         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2059         * loader/EmptyFrameLoaderClient.h:
2060         * loader/FrameLoadRequest.h:
2061         (WebCore::FrameLoadRequest::setShouldSkipSafeBrowsingCheck):
2062         (WebCore::FrameLoadRequest::shouldSkipSafeBrowsingCheck):
2063         * loader/FrameLoader.cpp:
2064         (WebCore::FrameLoader::loadArchive):
2065         (WebCore::FrameLoader::loadURL):
2066         (WebCore::FrameLoader::load):
2067         (WebCore::FrameLoader::loadWithNavigationAction):
2068         (WebCore::FrameLoader::loadWithDocumentLoader):
2069         (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL):
2070         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2071         (WebCore::FrameLoader::reload):
2072         (WebCore::FrameLoader::loadPostRequest):
2073         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2074         (WebCore::FrameLoader::loadDifferentDocumentItem):
2075         * loader/FrameLoader.h:
2076         (WebCore::FrameLoader::loadWithDocumentLoader):
2077         (WebCore::FrameLoader::loadWithNavigationAction):
2078         * loader/FrameLoaderClient.h:
2079         * loader/PolicyChecker.cpp:
2080         (WebCore::PolicyChecker::checkNavigationPolicy):
2081         * loader/PolicyChecker.h:
2082         * loader/ShouldSkipSafeBrowsingCheck.h: Added.
2083
2084 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
2085
2086         Replace canBubble and cancelable booleans in Event by enum classes
2087         https://bugs.webkit.org/show_bug.cgi?id=188692
2088
2089         Reviewed by Alex Christensen.
2090
2091         Replaced booleans indicating whether an event can bubble and an event is cancelable
2092         by two enum classes: CanBubble and IsCancelable.
2093
2094         No new tests since there should be no behavioral changes.
2095
2096         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
2097         (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
2098         * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
2099         (WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent):
2100         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
2101         (WebCore::ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent):
2102         * Modules/applepay/ApplePaySession.cpp:
2103         (WebCore::ApplePaySession::didCancelPaymentSession):
2104         * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
2105         (WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent):
2106         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
2107         (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent):
2108         * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
2109         (WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent):
2110         * Modules/encryptedmedia/MediaKeySession.cpp:
2111         (WebCore::MediaKeySession::updateKeyStatuses):
2112         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
2113         (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
2114         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
2115         (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
2116         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2117         (WebCore::WebKitMediaKeySession::addKeyTimerFired):
2118         (WebCore::WebKitMediaKeySession::sendError):
2119         * Modules/gamepad/GamepadEvent.cpp:
2120         (WebCore::GamepadEvent::GamepadEvent):
2121         * Modules/indexeddb/IDBDatabase.cpp:
2122         (WebCore::IDBDatabase::connectionToServerLost):
2123         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2124         (WebCore::IDBOpenDBRequest::onError):
2125         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
2126         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
2127         (WebCore::IDBOpenDBRequest::onSuccess):
2128         * Modules/indexeddb/IDBRequest.cpp:
2129         (WebCore::IDBRequest::onError):
2130         (WebCore::IDBRequest::onSuccess):
2131         * Modules/indexeddb/IDBRequestCompletionEvent.cpp:
2132         (WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent):
2133         * Modules/indexeddb/IDBRequestCompletionEvent.h:
2134         (WebCore::IDBRequestCompletionEvent::create):
2135         * Modules/indexeddb/IDBTransaction.cpp:
2136         (WebCore::IDBTransaction::fireOnComplete):
2137         (WebCore::IDBTransaction::fireOnAbort):
2138         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
2139         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
2140         * Modules/mediasession/MediaSession.cpp:
2141         (WebCore::MediaSession::skipToNextTrack):
2142         (WebCore::MediaSession::skipToPreviousTrack):
2143         * Modules/mediasource/MediaSource.cpp:
2144         (WebCore::MediaSource::scheduleEvent):
2145         * Modules/mediasource/SourceBuffer.cpp:
2146         (WebCore::SourceBuffer::scheduleEvent):
2147         * Modules/mediasource/SourceBufferList.cpp:
2148         (WebCore::SourceBufferList::scheduleEvent):
2149         * Modules/mediastream/MediaDevices.cpp:
2150         (WebCore::MediaDevices::scheduledEventTimerFired):
2151         * Modules/mediastream/MediaStream.cpp:
2152         (WebCore::MediaStream::internalAddTrack):
2153         (WebCore::MediaStream::internalRemoveTrack):
2154         * Modules/mediastream/MediaStreamEvent.cpp:
2155         (WebCore::MediaStreamEvent::create):
2156         (WebCore::MediaStreamEvent::MediaStreamEvent):
2157         * Modules/mediastream/MediaStreamEvent.h:
2158         * Modules/mediastream/MediaStreamTrack.cpp:
2159         (WebCore::MediaStreamTrack::trackEnded):
2160         (WebCore::MediaStreamTrack::trackMutedChanged):
2161         * Modules/mediastream/MediaStreamTrackEvent.cpp:
2162         (WebCore::MediaStreamTrackEvent::create):
2163         (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
2164         * Modules/mediastream/MediaStreamTrackEvent.h:
2165         * Modules/mediastream/OverconstrainedErrorEvent.h:
2166         (WebCore::OverconstrainedErrorEvent::create):
2167         (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
2168         * Modules/mediastream/PeerConnectionBackend.cpp:
2169         (WebCore::PeerConnectionBackend::fireICECandidateEvent):
2170         (WebCore::PeerConnectionBackend::doneGatheringCandidates):
2171         (WebCore::PeerConnectionBackend::updateSignalingState):
2172         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
2173         (WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent):
2174         * Modules/mediastream/RTCDataChannel.cpp:
2175         (WebCore::RTCDataChannel::didChangeReadyState):
2176         (WebCore::RTCDataChannel::didDetectError):
2177         (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
2178         * Modules/mediastream/RTCDataChannelEvent.cpp:
2179         (WebCore::RTCDataChannelEvent::create):
2180         (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
2181         * Modules/mediastream/RTCDataChannelEvent.h:
2182         * Modules/mediastream/RTCPeerConnection.cpp:
2183         (WebCore::RTCPeerConnection::updateIceGatheringState):
2184         (WebCore::RTCPeerConnection::updateIceConnectionState):
2185         (WebCore::RTCPeerConnection::updateConnectionState):
2186         (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
2187         * Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
2188         (WebCore::RTCPeerConnectionIceEvent::create):
2189         (WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):
2190         * Modules/mediastream/RTCPeerConnectionIceEvent.h:
2191         * Modules/mediastream/RTCTrackEvent.cpp:
2192         (WebCore::RTCTrackEvent::create):
2193         (WebCore::RTCTrackEvent::RTCTrackEvent):
2194         * Modules/mediastream/RTCTrackEvent.h:
2195         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2196         (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
2197         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
2198         (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
2199         * Modules/notifications/Notification.cpp:
2200         (WebCore::Notification::dispatchShowEvent):
2201         (WebCore::Notification::dispatchClickEvent):
2202         (WebCore::Notification::dispatchCloseEvent):
2203         (WebCore::Notification::dispatchErrorEvent):
2204         * Modules/paymentrequest/MerchantValidationEvent.cpp:
2205         (WebCore::MerchantValidationEvent::MerchantValidationEvent):
2206         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
2207         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
2208         * Modules/plugins/QuickTimePluginReplacement.mm:
2209         (WebCore::QuickTimePluginReplacement::postEvent):
2210         * Modules/speech/SpeechSynthesisEvent.cpp:
2211         (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
2212         * Modules/webaudio/AudioContext.cpp:
2213         (WebCore::AudioContext::setState):
2214         * Modules/webaudio/AudioProcessingEvent.cpp:
2215         (WebCore::AudioProcessingEvent::AudioProcessingEvent):
2216         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2217         (WebCore::AudioScheduledSourceNode::finish):
2218         * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
2219         (WebCore::OfflineAudioCompletionEvent::OfflineAudioCompletionEvent):
2220         * Modules/websockets/CloseEvent.h:
2221         (WebCore::CloseEvent::CloseEvent):
2222         * Modules/websockets/WebSocket.cpp:
2223         (WebCore::WebSocket::didConnect):
2224         (WebCore::WebSocket::dispatchOrQueueErrorEvent):
2225         * Modules/webvr/VRDisplayEvent.cpp:
2226         (WebCore::VRDisplayEvent::VRDisplayEvent):
2227         * accessibility/AccessibilityObject.cpp:
2228         (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const):
2229         * accessibility/AccessibleSetValueEvent.cpp:
2230         (WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
2231         * animation/AnimationPlaybackEvent.cpp:
2232         (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
2233         * dom/AbortSignal.cpp:
2234         (WebCore::AbortSignal::abort):
2235         * dom/AnimationEvent.cpp:
2236         (WebCore::AnimationEvent::AnimationEvent):
2237         * dom/BeforeLoadEvent.h:
2238         * dom/BeforeTextInsertedEvent.cpp:
2239         (WebCore::BeforeTextInsertedEvent::BeforeTextInsertedEvent):
2240         * dom/BeforeUnloadEvent.cpp:
2241         (WebCore::BeforeUnloadEvent::BeforeUnloadEvent):
2242         * dom/CharacterData.cpp:
2243         (WebCore::CharacterData::dispatchModifiedEvent):
2244         * dom/CompositionEvent.cpp:
2245         (WebCore::CompositionEvent::CompositionEvent):
2246         * dom/ContainerNode.cpp:
2247         (WebCore::dispatchChildInsertionEvents):
2248         (WebCore::dispatchChildRemovalEvents):
2249         * dom/DeviceMotionEvent.cpp:
2250         (WebCore::DeviceMotionEvent::DeviceMotionEvent):
2251         * dom/DeviceOrientationEvent.cpp:
2252         (WebCore::DeviceOrientationEvent::DeviceOrientationEvent):
2253         * dom/Document.cpp:
2254         (WebCore::Document::setReadyState):
2255         (WebCore::Document::visibilityStateChanged):
2256         (WebCore::Document::finishedParsing):
2257         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
2258         (WebCore::Document::orientationChanged):
2259         * dom/DocumentEventQueue.cpp:
2260         (WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
2261         (WebCore::DocumentEventQueue::enqueueScrollEvent):
2262         (WebCore::DocumentEventQueue::enqueueResizeEvent):
2263         * dom/DocumentEventQueue.h:
2264         * dom/Element.cpp:
2265         (WebCore::Element::dispatchMouseEvent):
2266         (WebCore::Element::dispatchFocusInEvent):
2267         (WebCore::Element::dispatchFocusOutEvent):
2268         (WebCore::Element::dispatchFocusEvent):
2269         (WebCore::Element::dispatchBlurEvent):
2270         (WebCore::Element::dispatchWebKitImageReadyEventForTesting):
2271         * dom/ErrorEvent.cpp:
2272         (WebCore::ErrorEvent::ErrorEvent):
2273         * dom/Event.cpp:
2274         (WebCore::Event::Event):
2275         (WebCore::Event::create):
2276         * dom/Event.h:
2277         * dom/FocusEvent.cpp:
2278         (WebCore::FocusEvent::FocusEvent):
2279         * dom/FocusEvent.h:
2280         * dom/HashChangeEvent.h:
2281         * dom/InputEvent.cpp:
2282         (WebCore::InputEvent::create):
2283         (WebCore::InputEvent::InputEvent):
2284         * dom/InputEvent.h:
2285         * dom/KeyboardEvent.cpp:
2286         (WebCore::KeyboardEvent::KeyboardEvent):
2287         * dom/MessageEvent.cpp:
2288         (WebCore::MessageEvent::MessageEvent):
2289         * dom/MouseEvent.cpp:
2290         (WebCore::MouseEvent::create):
2291         (WebCore::MouseEvent::MouseEvent):
2292         * dom/MouseEvent.h:
2293         * dom/MouseRelatedEvent.cpp:
2294         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
2295         * dom/MouseRelatedEvent.h:
2296         * dom/MutationEvent.cpp:
2297         (WebCore::MutationEvent::MutationEvent):
2298         * dom/MutationEvent.h:
2299         * dom/Node.cpp:
2300         (WebCore::Node::dispatchSubtreeModifiedEvent):
2301         (WebCore::Node::dispatchDOMActivateEvent):
2302         (WebCore::Node::dispatchInputEvent):
2303         * dom/OverflowEvent.cpp:
2304         (WebCore::OverflowEvent::OverflowEvent):
2305         * dom/PageTransitionEvent.cpp:
2306         (WebCore::PageTransitionEvent::PageTransitionEvent):
2307         * dom/PopStateEvent.cpp:
2308         (WebCore::PopStateEvent::PopStateEvent):
2309         * dom/ProgressEvent.cpp:
2310         (WebCore::ProgressEvent::ProgressEvent):
2311         * dom/ScriptElement.cpp:
2312         (WebCore::ScriptElement::dispatchErrorEvent):
2313         * dom/SecurityPolicyViolationEvent.h:
2314         * dom/SimulatedClick.cpp:
2315         * dom/TextEvent.cpp:
2316         (WebCore::TextEvent::TextEvent):
2317         * dom/TransitionEvent.cpp:
2318         (WebCore::TransitionEvent::TransitionEvent):
2319         * dom/UIEvent.cpp:
2320         (WebCore::UIEvent::UIEvent):
2321         * dom/UIEvent.h:
2322         (WebCore::UIEvent::create):
2323         * dom/UIEventWithKeyState.h:
2324         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
2325         * dom/WebKitAnimationEvent.cpp:
2326         (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
2327         * dom/WebKitTransitionEvent.cpp:
2328         (WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
2329         * dom/WheelEvent.cpp:
2330         (WebCore::WheelEvent::WheelEvent):
2331         * editing/Editor.cpp:
2332         (WebCore::dispatchBeforeInputEvent):
2333         (WebCore::dispatchBeforeInputEvents):
2334         (WebCore::Editor::willApplyEditing const):
2335         * editing/FrameSelection.cpp:
2336         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
2337         (WebCore::FrameSelection::selectAll):
2338         (WebCore::FrameSelection::dispatchSelectStart):
2339         * html/HTMLDetailsElement.cpp:
2340         (WebCore::HTMLDetailsElement::dispatchPendingEvent):
2341         * html/HTMLFormControlElement.cpp:
2342         (WebCore::HTMLFormControlElement::dispatchChangeEvent):
2343         (WebCore::HTMLFormControlElement::checkValidity):
2344         * html/HTMLFormElement.cpp:
2345         (WebCore::HTMLFormElement::prepareForSubmission):
2346         (WebCore::HTMLFormElement::reset):
2347         * html/HTMLImageLoader.cpp:
2348         (WebCore::HTMLImageLoader::dispatchLoadEvent):
2349         * html/HTMLInputElement.cpp:
2350         (WebCore::HTMLInputElement::onSearch):
2351         * html/HTMLLinkElement.cpp:
2352         (WebCore::HTMLLinkElement::dispatchPendingEvent):
2353         * html/HTMLMediaElement.cpp:
2354         (WebCore::HTMLMediaElement::scheduleEvent):
2355         (WebCore::HTMLMediaElement::notifyAboutPlaying):
2356         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2357         (WebCore::HTMLMediaElement::layoutSizeChanged):
2358         * html/HTMLPlugInImageElement.cpp:
2359         (WebCore::HTMLPlugInImageElement::checkSnapshotStatus):
2360         * html/HTMLScriptElement.cpp:
2361         (WebCore::HTMLScriptElement::dispatchLoadEvent):
2362         * html/HTMLSlotElement.cpp:
2363         (WebCore::HTMLSlotElement::dispatchSlotChangeEvent):
2364         * html/HTMLSourceElement.cpp:
2365         (WebCore::HTMLSourceElement::errorEventTimerFired):
2366         * html/HTMLStyleElement.cpp:
2367         (WebCore::HTMLStyleElement::dispatchPendingEvent):
2368         * html/HTMLTextFormControlElement.cpp:
2369         (WebCore::HTMLTextFormControlElement::selectionChanged):
2370         * html/HTMLTrackElement.cpp:
2371         (WebCore::HTMLTrackElement::didCompleteLoad):
2372         * html/MediaController.cpp:
2373         (WebCore::MediaController::scheduleEvent):
2374         * html/canvas/WebGLContextEvent.cpp:
2375         (WebCore::WebGLContextEvent::WebGLContextEvent):
2376         * html/canvas/WebGLContextEvent.h:
2377         * html/canvas/WebGLRenderingContextBase.cpp:
2378         (WebCore::WebGLRenderingContextBase::create):
2379         (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
2380         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
2381         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
2382         * html/parser/HTMLScriptRunner.cpp:
2383         (WebCore::createScriptLoadEvent):
2384         * html/track/TrackEvent.cpp:
2385         (WebCore::TrackEvent::TrackEvent):
2386         * html/track/TrackEvent.h:
2387         * html/track/TrackListBase.cpp:
2388         (WebCore::TrackListBase::scheduleTrackEvent):
2389         (WebCore::TrackListBase::scheduleChangeEvent):
2390         * loader/DocumentLoader.cpp:
2391         (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
2392         * loader/FrameLoader.cpp:
2393         (WebCore::FrameLoader::dispatchUnloadEvents):
2394         * loader/ImageLoader.cpp:
2395         (WebCore::ImageLoader::dispatchPendingErrorEvent):
2396         * loader/PolicyChecker.cpp:
2397         (WebCore::PolicyChecker::checkNavigationPolicy):
2398         * loader/appcache/ApplicationCacheHost.cpp:
2399         (WebCore::createApplicationCacheEvent):
2400         * page/DOMWindow.cpp:
2401         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
2402         (WebCore::DOMWindow::languagesChanged):
2403         (WebCore::DOMWindow::dispatchLoadEvent):
2404         * page/EventHandler.cpp:
2405         (WebCore::dispatchSelectStart):
2406         (WebCore::EventHandler::dispatchDragEvent):
2407         * page/EventSource.cpp:
2408         (WebCore::EventSource::scheduleReconnect):
2409         (WebCore::EventSource::didReceiveResponse):
2410         (WebCore::EventSource::abortConnectionAttempt):
2411         * page/FocusController.cpp:
2412         (WebCore::dispatchEventsOnWindowAndFocusedElement):
2413         (WebCore::FocusController::setFocusedFrame):
2414         * page/FrameView.cpp:
2415         (WebCore::FrameView::sendResizeEventIfNeeded):
2416         * page/Page.cpp:
2417         (WebCore::networkStateChanged):
2418         * page/Performance.cpp:
2419         (WebCore::Performance::resourceTimingBufferFullTimerFired):
2420         * page/PointerLockController.cpp:
2421         (WebCore::PointerLockController::enqueueEvent):
2422         * page/VisualViewport.cpp:
2423         (WebCore::VisualViewport::enqueueResizeEvent):
2424         (WebCore::VisualViewport::enqueueScrollEvent):
2425         * storage/StorageEvent.cpp:
2426         (WebCore::StorageEvent::StorageEvent):
2427         * svg/SVGElement.cpp:
2428         (WebCore::SVGElement::sendSVGLoadEventIfPossible):
2429         * svg/SVGImageLoader.cpp:
2430         (WebCore::SVGImageLoader::dispatchLoadEvent):
2431         * svg/SVGUseElement.cpp:
2432         (WebCore::SVGUseElement::notifyFinished):
2433         * svg/animation/SVGSMILElement.cpp:
2434         (WebCore::SVGSMILElement::dispatchPendingEvent):
2435         * workers/Worker.cpp:
2436         (WebCore::Worker::notifyFinished):
2437         * workers/WorkerMessagingProxy.cpp:
2438         (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
2439         * workers/service/ExtendableEvent.cpp:
2440         (WebCore::ExtendableEvent::ExtendableEvent):
2441         * workers/service/ExtendableEvent.h:
2442         * workers/service/ExtendableMessageEvent.cpp:
2443         (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
2444         * workers/service/ServiceWorker.cpp:
2445         (WebCore::ServiceWorker::scheduleTaskToUpdateState):
2446         * workers/service/ServiceWorkerContainer.cpp:
2447         (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
2448         * workers/service/ServiceWorkerRegistration.cpp:
2449         (WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
2450         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2451         (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange):
2452         * xml/XMLHttpRequest.cpp:
2453         (WebCore::XMLHttpRequest::callReadyStateChangeListener):
2454
2455 2018-08-17  Yusuke Suzuki  <yusukesuzuki@slowstart.org> and Fujii Hironori  <Hironori.Fujii@sony.com>
2456
2457         [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg
2458         https://bugs.webkit.org/show_bug.cgi?id=188589
2459
2460         Reviewed by Mark Lam.
2461         And reviewed by Yusuke Suzuki for Hironori's change.
2462
2463         * cssjit/FunctionCall.h:
2464         (WebCore::FunctionCall::FunctionCall):
2465         * cssjit/SelectorCompiler.cpp:
2466         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
2467         * html/HTMLKeygenElement.cpp:
2468         Remove `using namespace WebCore` not to introduce `operator+/-` which makes the resolution of `operator+/-` for RegisterID ambiguous.
2469
2470 2018-08-17  Philippe Normand  <philn@igalia.com>
2471
2472         [GStreamer] reduce position queries frequency
2473         https://bugs.webkit.org/show_bug.cgi?id=188645
2474
2475         Reviewed by Xabier Rodriguez-Calvar.
2476
2477         There is no need to perform dozens of position queries per second.
2478         One every 300ms is enough.
2479
2480         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2481         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
2482         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
2483         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
2484         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
2485         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2486
2487 2018-08-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2488
2489         [SOUP] Handle OAuth authentication after r234912
2490         https://bugs.webkit.org/show_bug.cgi?id=188651
2491
2492         Reviewed by Carlos Garcia Campos.
2493
2494         Update this switch to consider the new OAuth enum value added in r234912. I suppose OAuth is
2495         used for HTTP Auth now. It will be a one-time compatibility break as passwords previously
2496         stored with type "Unknown" will no longer be accessible.
2497
2498         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2499         (WebCore::authTypeFromProtectionSpaceAuthenticationScheme):
2500
2501 2018-08-17  Ms2ger  <Ms2ger@igalia.com>
2502
2503         [GTK] Never return an uninitialized ImageGStreamer object.
2504         https://bugs.webkit.org/show_bug.cgi?id=188305
2505
2506         Reviewed by Philippe Normand.
2507
2508         The single caller was already checking for a null return value, so
2509         make that check actually do something. Also remove the null-check on
2510         the return value of image(), which asserted that it would never return
2511         null.
2512
2513         Test: fast/canvas/canvas-createPattern-video-loading.html
2514
2515         * platform/graphics/gstreamer/ImageGStreamer.h:
2516         (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created.
2517         (WebCore::ImageGStreamer::image): Return a reference.
2518         (WebCore::ImageGStreamer::rect): Always assert that m_image is present.
2519         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2520         (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature.
2521
2522 2018-08-17  Philippe Normand  <philn@igalia.com>
2523
2524         [GStreamer] Enable fpsdisplaysink only when MEDIA_STATISTICS is enabled
2525         https://bugs.webkit.org/show_bug.cgi?id=188648
2526
2527         Reviewed by Xabier Rodriguez-Calvar.
2528
2529         The fpsdisplaysink is useful only when MEDIA_STATISTICS is turned on.
2530         The text overlay is now enabled when GST_DEBUG tracing is enabled for the player.
2531
2532         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2533         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
2534
2535 2018-08-17  Philippe Normand  <philn@igalia.com>
2536
2537         [GStreamer][MSE] Disable last-sample support in AppendPipeline
2538         https://bugs.webkit.org/show_bug.cgi?id=188649
2539
2540         Reviewed by Xabier Rodriguez-Calvar.
2541
2542         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2543         (WebCore::AppendPipeline::AppendPipeline): This property isn't
2544         used by the append pipeline. So as a micro-optimization, it is now
2545         disabled.
2546
2547 2018-08-16  Devin Rousso  <drousso@apple.com>
2548
2549         Web Inspector: support breakpoints for arbitrary event names
2550         https://bugs.webkit.org/show_bug.cgi?id=183118
2551
2552         Reviewed by Joseph Pecoraro.
2553
2554         Tests: inspector/dom-debugger/event-breakpoints.html
2555                inspector/dom-debugger/event-breakpoints-with-navigation.html
2556
2557         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2558         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
2559
2560 2018-08-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2561
2562         [Curl] Bug fix on deleting cookies when Max-Age is set to zero.
2563         https://bugs.webkit.org/show_bug.cgi?id=188617
2564
2565         Reviewed by Alex Christensen.
2566
2567         Delete cookie if Max-Age is set to zero in Set-Cookie. Original implementation was
2568         compared using "less than", but it must be "less than or equal" to zero.
2569
2570         Tests: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html
2571
2572         * platform/network/curl/CookieJarDB.cpp:
2573         (WebCore::CookieJarDB::setCookie):
2574
2575 2018-08-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2576
2577         [Curl] Implement deleteAllCookies()
2578         https://bugs.webkit.org/show_bug.cgi?id=188612
2579
2580         Reviewed by Alex Christensen.
2581
2582         deleteAllCookies() was not implemented. Connect the interface to the implementation.
2583
2584         Tests: http/tests/cookies/simple-cookies-expired.html
2585                http/tests/cookies/simple-cookies-max-age.html
2586
2587         * platform/network/curl/CookieJarCurlDatabase.cpp:
2588         (WebCore::CookieJarCurlDatabase::deleteAllCookies const):
2589
2590 2018-08-16  Ross Kirsling  <ross.kirsling@sony.com>
2591
2592         REGRESSION(r234930): Don't embed a #if in an ASSERT
2593         https://bugs.webkit.org/show_bug.cgi?id=188680
2594
2595         Reviewed by Tim Horton.
2596
2597         * page/EventHandler.cpp:
2598         (WebCore::EventHandler::handleDrag):
2599         Simplify the ASSERT -- it seems we just want to know that DragSourceActionSelection and exactly one other DragSourceAction is set. 
2600
2601 2018-08-16  Alex Christensen  <achristensen@webkit.org>
2602
2603         Remove unused allowScriptsToCloseWindows setting
2604         https://bugs.webkit.org/show_bug.cgi?id=188602
2605
2606         Reviewed by Simon Fraser.
2607
2608         No change in behaviour. It was always false.
2609
2610         * page/DOMWindow.cpp:
2611         (WebCore::DOMWindow::close):
2612         * page/Settings.yaml:
2613
2614 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
2615
2616         Custom element constructor doesn't use HTMLElement in new.target's realm
2617         https://bugs.webkit.org/show_bug.cgi?id=188634
2618
2619         Reviewed by Keith Miller.
2620
2621         Fixed the bug that HTMLElement's constructor was constructing an element of its own realm
2622         instead of the realm of new.target. This results in the JS wrapper created for the element
2623         belonging to the global object of the HTMLElement constructor which was invoked instead of
2624         the global object of new.target as specified in:
2625         https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors
2626
2627         In particular, step 9.2. specifies that we "perform element.[[SetPrototypeOf]](prototype)."
2628         where prototype is the result of Get(NewTarget, "prototype") in step 7.
2629
2630         WebKit's new behavior matches that of Chrome and Firefox.
2631
2632         Test: imported/w3c/web-platform-tests/custom-elements/htmlconstructor/newtarget.html
2633
2634         * bindings/js/JSHTMLElementCustom.cpp:
2635         (WebCore::constructJSHTMLElement): 
2636
2637 2018-08-16  Aditya Keerthi  <akeerthi@apple.com>
2638
2639         Unreviewed, fix the watchOS build after r188464.
2640
2641         * platform/ios/PlatformPasteboardIOS.mm:
2642         (WebCore::PlatformPasteboard::setColor):
2643
2644 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
2645
2646         Custom element doesn't invalidate its style when :defined rule starts to apply
2647         https://bugs.webkit.org/show_bug.cgi?id=188637
2648
2649         Reviewed by Antti Koivisto.
2650
2651         Fixed the bug by invalidating the subtree when a custom element gets defined.
2652
2653         Test: fast/custom-elements/defined-update-style.html
2654
2655         * dom/Element.cpp:
2656         (WebCore::Element::setIsDefinedCustomElement):
2657
2658 2018-08-16  Youenn Fablet  <youenn@apple.com>
2659
2660         Change the input camera in the sources & outputs example on Safari (11) with M.Way camera
2661         https://bugs.webkit.org/show_bug.cgi?id=187756
2662         <rdar://problem/42332178>
2663
2664         Reviewed by Eric Carlson.
2665
2666         Covered by manual testing.
2667
2668         640x480x30fps is added as ideal constraints to getUserMedia if none other is added to provide consistent behavior.
2669         Some cameras do not support 30fps as they have discrete frame rate ranges.
2670         Before the patch, we were rejecting getUserMedia promise if the 'ideal' frameRate was not supported.
2671         After the patch, we do not check whether frame rate is supported if it is not mandatory.
2672         At capture time, we will still try to apply frame rate change and if not supported, the frame rate will not be set to 30 fps.
2673
2674         While we could surface discrete width/height/frame rate ranges, it seems best to fix the issue this way.
2675         In the future, we might implement video interpolation for width/height/framerate at WebCore level.
2676
2677         * platform/mediastream/RealtimeMediaSource.cpp:
2678         (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
2679         (WebCore::RealtimeMediaSource::supportsConstraint const):
2680         (WebCore::RealtimeMediaSource::supportsConstraints):
2681
2682 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
2683
2684         Perform a microtask checkpoint before creating a custom element
2685         https://bugs.webkit.org/show_bug.cgi?id=188189
2686         <rdar://problem/42843022>
2687
2688         Reviewed by Geoffrey Garen.
2689
2690         Fixed the bug that the HTML parser was not performing a microtask checkpoint prior to synchronously constructing
2691         a custom element in the concept to create an element for a token:
2692         https://html.spec.whatwg.org/multipage/parsing.html#creating-and-inserting-nodes:perform-a-microtask-checkpoint
2693
2694         Also added a microtask checkpoint before dispatching DOMContentLoaded to work around webkit.org/b/82931 since
2695         scheduling a task to fire a DOMContentLoaded event in Document::finishedParsing as the HTML5 spec mandates
2696         is a long standing bug with a lot of implications, which is completely outside the scope of this bug fix:
2697         https://html.spec.whatwg.org/multipage/parsing.html#stop-parsing
2698
2699         Test: fast/custom-elements/perform-microtask-checkpoint-before-construction.html
2700
2701         * dom/Document.cpp:
2702         (WebCore::Document::finishedParsing): Perform a microtask checkpoint before dispatching DOMContentLoaded here as
2703         a workaround for webkit.org/b/82931.
2704         * html/parser/HTMLDocumentParser.cpp:
2705         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Perform a microtask checkpoint here to fix the bug.
2706
2707 2018-08-16  Alex Christensen  <achristensen@webkit.org>
2708
2709         Re-introduce assertion removed in r234890
2710         https://bugs.webkit.org/show_bug.cgi?id=188611
2711
2712         Reviewed by Geoffrey Garen.
2713
2714         The assertion was failing because Vector<String>::operator== was using memcmp,
2715         which failed to consider different instances of equal Strings equal.  Added an
2716         API test and this assertion, which now succeeds.
2717
2718         * contentextensions/ContentExtensionCompiler.cpp:
2719         (WebCore::ContentExtensions::compileRuleList):
2720
2721 2018-08-15  Jer Noble  <jer.noble@apple.com>
2722
2723         Add Experimental Feature support for SourceBuffer.changeType()
2724         https://bugs.webkit.org/show_bug.cgi?id=188626
2725
2726         Reviewed by Eric Carlson.
2727
2728         Tests: imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html
2729                imported/w3c/web-platform-tests/media-source/mediasource-changetype.html
2730
2731         The WICG is incubating a new proposal to allow clients to switch between streams
2732         with different codecs within the same SourceBuffer. The proposal is being tracked
2733         by <https://github.com/w3c/media-source/issues/155> and the proposed spec change
2734         is available at <https://rawgit.com/wicg/media-source/codec-switching/index.html>.
2735
2736         Drive-by fix: One of the wpt tests uses a .mp3 file to test SourceBuffer switching.
2737         The AVStreamDataParser does not necessarily emit every frame appended, and after a
2738         new init segment is appended, it's possible that frames from the previous media
2739         segment will be emitted. This causes an error condition to occur, due to an added
2740         check in the spec for a new flag. When the SourceBuffer asks its private implementation
2741         to reset the parser state, since there's no API on AVStreamDataParser to actually
2742         reset the parser state, just set a flag to drop all emitted buffers until the next
2743         initialization segment is parsed.
2744
2745         * Modules/mediasource/MediaSource.cpp:
2746         (WebCore::MediaSource::contentTypeShouldGenerateTimestamps):
2747         (WebCore::MediaSource::setDurationInternal):
2748         (WebCore::MediaSource::addSourceBuffer):
2749         * Modules/mediasource/MediaSource.h:
2750         * Modules/mediasource/SourceBuffer.cpp:
2751         (WebCore::SourceBuffer::changeType):
2752         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
2753         (WebCore::SourceBuffer::validateInitializationSegment):
2754         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2755         * Modules/mediasource/SourceBuffer.h:
2756         * Modules/mediasource/SourceBuffer.idl:
2757         * page/Settings.yaml:
2758         * platform/graphics/SourceBufferPrivate.h:
2759         (WebCore::SourceBufferPrivate::canSwitchToType):
2760         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2761         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2762         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
2763         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
2764         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
2765         (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
2766
2767 2018-08-16  Christopher Reid  <chris.reid@sony.com>
2768
2769         [Curl] Not all Cookie database files are deleted on corruption
2770         https://bugs.webkit.org/show_bug.cgi?id=185873
2771
2772         Reviewed by Fujii Hironori.
2773
2774         No new tests.
2775
2776         Delete the cookie database file and the corruption flag file when corruption is detected.
2777         Adding a quick integrity check in case it can catch anything when opening the database.
2778         Removing PRAGMA temp_store = MEMORY and PRAGMA journal_mode = WAL as they are set in SQLiteDatabase::open.
2779
2780         * platform/network/curl/CookieJarDB.cpp:
2781
2782 2018-08-16  Zan Dobersek  <zdobersek@igalia.com>
2783
2784         [Nicosia] Add Nicosia::ImageBackingTextureMapperImpl
2785         https://bugs.webkit.org/show_bug.cgi?id=188550
2786
2787         Reviewed by Carlos Garcia Campos.
2788
2789         Add the Nicosia::ImageBackingTextureMapperImpl class, the
2790         TextureMapper-specific implementation that will extend the ImageBacking
2791         class.
2792
2793         This class will be used to contain and manage updates for layers that
2794         are backed by image objects. The CoordinatedGraphicsLayer instance will
2795         use the LayerState object to track the currently-presented image objects
2796         and to store the latest update of these objects. The Update struct
2797         contains information about the current visibility of the image in the
2798         layer tree as well as the Nicosia::Buffer object containing the painted
2799         image data that's to be presented on the screen.
2800
2801         During the layer flush the flushUpdate() method will move the current
2802         update data into the pending position, from which this data will be
2803         gathered by the composition component through the takeUpdate() method
2804         and used to update the CoordinatedBackingStore object that's kept in
2805         the CompositionState object on this impl class.
2806
2807         This will be deployed for use in the CoordinatedGraphicsLayer at a later
2808         stage as it requires a larger rework in both CoordinatedGraphicsLayer as
2809         well as the CoordinatedGraphicsScene classes.
2810
2811         The implementation itself differs from the current image backing support
2812         in CoordinatedGraphicsLayer and CompositingCoordinator by abandoning the
2813         idea of sharing single image backings between layers that might be
2814         backed by identical Image objects. We thus end up trading any memory
2815         consumption benefit in these scenarios for a much simplified
2816         implementation. Overall this area needs more research both in figuring
2817         out whether there's worthy improvements in grouping image backings, as
2818         well as investigating whether it's possible to avoid additional image
2819         rasterization by just leveraging direct pixel data via the
2820         NativeImagePtr object.
2821
2822         * platform/TextureMapper.cmake:
2823         * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: Added.
2824         (Nicosia::ImageBackingTextureMapperImpl::createFactory):
2825         (Nicosia::ImageBackingTextureMapperImpl::flushUpdate):
2826         (Nicosia::ImageBackingTextureMapperImpl::takeUpdate):
2827         * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h: Added.
2828
2829 2018-08-16  Aditya Keerthi  <akeerthi@apple.com>
2830
2831         Support drag-and-drop for input[type=color]
2832         https://bugs.webkit.org/show_bug.cgi?id=188464
2833
2834         Reviewed by Wenson Hsieh.
2835
2836         input[type=color] should support native drag and drop on both macOS and iOS.
2837
2838         Added methods to Pasteboard and PlatformPasteboard to enable colors to be read
2839         from and written to the pasteboard. On macOS, colors are managed through the
2840         NSColorPboardType, whereas on iOS, colors are managed through the
2841         'com.apple.uikit.color' identifier.
2842
2843         DragSourceActionColor was added to the list of DragSourceActions to identify
2844         when a color input is being dragged.
2845
2846         Tests: editing/pasteboard/drag-and-drop-color-input-events.html
2847                editing/pasteboard/drag-and-drop-color-input.html
2848
2849         * page/DragActions.h:
2850         * page/DragController.cpp:
2851         (WebCore::DragController::dragEnteredOrUpdated):
2852         (WebCore::isEnabledColorInput):
2853         (WebCore::DragController::concludeEditDrag):
2854         (WebCore::DragController::canProcessDrag):
2855         (WebCore::DragController::draggableElement const):
2856         (WebCore::DragController::startDrag):
2857         * page/EventHandler.cpp:
2858         (WebCore::EventHandler::dragHysteresisExceeded const):
2859         (WebCore::EventHandler::handleDrag):
2860         * page/EventHandler.h:
2861         * page/mac/DragControllerMac.mm:
2862         (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const):
2863         * platform/DragData.h:
2864         * platform/DragImage.cpp:
2865         (WebCore::DragImage::operator=):
2866         * platform/DragImage.h: Added the visiblePath property to DragImage, in order for
2867         us to be able to clip images in the UITargetedDragPreview on iOS.
2868         * platform/DragItem.h:
2869         (WebCore::DragItem::encode const):
2870         (WebCore::DragItem::decode):
2871         * platform/Pasteboard.h:
2872         * platform/PasteboardStrategy.h:
2873         * platform/PlatformPasteboard.h:
2874         * platform/gtk/DragImageGtk.cpp:
2875         (WebCore::createDragImageForColor):
2876         * platform/gtk/PasteboardGtk.cpp:
2877         (WebCore::Pasteboard::write):
2878         * platform/ios/DragImageIOS.mm:
2879         (WebCore::createDragImageForColor):
2880         * platform/ios/PasteboardIOS.mm:
2881         (WebCore::Pasteboard::write):
2882         * platform/ios/PlatformPasteboardIOS.mm:
2883         (WebCore::PlatformPasteboard::color):
2884         (WebCore::PlatformPasteboard::setColor):
2885         * platform/mac/DragDataMac.mm:
2886         (WebCore::colorPasteboardType):
2887         (WebCore::DragData::containsCompatibleContent const):
2888         * platform/mac/DragImageMac.mm:
2889         (WebCore::createDragImageForColor): Draw a rounded rectangle with a fill color
2890         matching the value of the dragged color input. The rendered image is designed to
2891         mimic the preview shown when dragging an NSColorWell.
2892         * platform/mac/PasteboardMac.mm:
2893         (WebCore::Pasteboard::write):
2894         * platform/mac/PlatformPasteboardMac.mm:
2895         (WebCore::PlatformPasteboard::setColor):
2896         * platform/win/PasteboardWin.cpp:
2897         (WebCore::Pasteboard::write):
2898         * platform/wpe/PasteboardWPE.cpp:
2899         (WebCore::Pasteboard::write):
2900
2901 2018-08-16  Zalan Bujtas  <zalan@apple.com>
2902
2903         [lFC][Floating] Add estimated margin top computation.
2904         https://bugs.webkit.org/show_bug.cgi?id=188619
2905
2906         Reviewed by Antti Koivisto.
2907
2908         In order to figure out whether a box should avoid a float, we need to know the final positions of both (ignore relative positioning for now).
2909         In block formatting context the final position for a normal flow box includes
2910         1. the static position and
2911         2. the corresponding (non)collapsed margins.
2912         Now the vertical margins are computed when all the descendants are finalized, because the margin values might be depending on the height of the box
2913         (and the height might be based on the content).
2914         So when we get to the point where we intersect the box with the float to decide if the box needs to move, we don't yet have the final vertical position.
2915
2916         The idea here is that as long as we don't cross the block formatting context boundary, we should be able to pre-compute the final top margin.
2917         (if this holds true for all the cases, the estimated prefix could be removed and just use marginTop() instead.)
2918
2919         Covered by existing block-only tests.
2920
2921         * layout/blockformatting/BlockFormattingContext.cpp:
2922         (WebCore::Layout::BlockFormattingContext::layout const):
2923         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
2924         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
2925         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2926         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2927         (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
2928         * layout/blockformatting/BlockFormattingContext.h:
2929         * layout/blockformatting/BlockMarginCollapse.cpp:
2930         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginTop):
2931         * layout/displaytree/DisplayBox.cpp:
2932         (WebCore::Display::Box::Box):
2933         * layout/displaytree/DisplayBox.h:
2934         (WebCore::Display::Box::setHasValidTop):
2935         (WebCore::Display::Box::setHasValidLeft):
2936         (WebCore::Display::Box::top const):
2937         (WebCore::Display::Box::left const):
2938         (WebCore::Display::Box::topLeft const):
2939         (WebCore::Display::Box::setTopLeft):
2940         (WebCore::Display::Box::setTop):
2941         (WebCore::Display::Box::setLeft):
2942         (WebCore::Display::Box::setVerticalMargin):
2943         (WebCore::Display::Box::setEstimatedMarginTop):
2944         (WebCore::Display::Box::estimatedMarginTop const):
2945
2946 2018-08-16  Zalan Bujtas  <zalan@apple.com>
2947
2948         [LFC][BFC] Display::Box interface should reflect that padding is optional.
2949         https://bugs.webkit.org/show_bug.cgi?id=188630
2950
2951         Reviewed by Antti Koivisto.
2952
2953         Certain type of boxes can't have paddings (see Layout::Box::isPaddingApplicable).
2954
2955         * layout/FormattingContext.cpp:
2956         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
2957         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
2958         * layout/FormattingContextGeometry.cpp:
2959         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2960         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2961         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2962         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2963         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2964         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2965         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2966         * layout/displaytree/DisplayBox.h:
2967         (WebCore::Display::Box::width const):
2968         (WebCore::Display::Box::height const):
2969         (WebCore::Display::Box::contentBoxTop const):
2970         (WebCore::Display::Box::contentBoxLeft const):
2971         (WebCore::Display::Box::setPadding):
2972         (WebCore::Display::Box::paddingTop const):
2973         (WebCore::Display::Box::paddingLeft const):
2974         (WebCore::Display::Box::paddingBottom const):
2975         (WebCore::Display::Box::paddingRight const):
2976
2977 2018-08-16  Zalan Bujtas  <zalan@apple.com>
2978
2979         [LFC] Add showLayoutTree() that does not require LayoutContext.
2980         https://bugs.webkit.org/show_bug.cgi?id=188631
2981
2982         Reviewed by Antti Koivisto.
2983
2984         * layout/layouttree/LayoutBox.cpp:
2985         (WebCore::Layout::Box::formattingContextRoot const):
2986         (WebCore::Layout::Box::initialContainingBlock const):
2987         * layout/layouttree/LayoutBox.h:
2988         * layout/layouttree/LayoutTreeBuilder.cpp:
2989         (WebCore::Layout::outputLayoutTree):
2990         (WebCore::Layout::showLayoutTree):
2991         (WebCore::Layout::TreeBuilder::showLayoutTree): Deleted.
2992         * layout/layouttree/LayoutTreeBuilder.h:
2993
2994 2018-08-16  Zalan Bujtas  <zalan@apple.com>
2995
2996         [LFC] Tree builder should construct block and inline containers based on the display type.
2997         https://bugs.webkit.org/show_bug.cgi?id=188632
2998
2999         Reviewed by Antti Koivisto.
3000
3001         Inline elements can also construct RenderBlock renderers (inline-bloc etc), so use the display type instead when deciding what type of container to construct.   
3002
3003         * layout/layouttree/LayoutTreeBuilder.cpp:
3004         (WebCore::Layout::TreeBuilder::createSubTree):
3005
3006 2018-08-16  Zalan Bujtas  <zalan@apple.com>
3007
3008         [LFC] Bail out of subtree verification when trees are out of sync.
3009         https://bugs.webkit.org/show_bug.cgi?id=188633
3010
3011         Reviewed by Antti Koivisto.
3012
3013         There's no point of trying to match geometry when subtrees are out of sync.
3014         They get out of sync when the render tree has unsupported boxes (see LayoutTreeBuilder).
3015
3016         * layout/Verification.cpp:
3017         (WebCore::Layout::verifyAndOutputSubtree):
3018
3019 2018-08-16  Antti Koivisto  <antti@apple.com>
3020
3021         Use OptionSet for ActivityState::Flags
3022         https://bugs.webkit.org/show_bug.cgi?id=188554
3023
3024         Reviewed by Brent Fulgham.
3025
3026         More typesafe flags.
3027
3028         * Modules/geolocation/GeolocationController.cpp:
3029         (WebCore::GeolocationController::activityStateDidChange):
3030         * Modules/geolocation/GeolocationController.h:
3031         * html/canvas/WebGLRenderingContextBase.cpp:
3032         (WebCore::WebGLRenderingContextBase::activityStateDidChange):
3033         * html/canvas/WebGLRenderingContextBase.h:
3034         * page/ActivityState.cpp:
3035         (WebCore::operator<<):
3036         (WebCore::activityStateFlagsToString): Deleted.
3037         * page/ActivityState.h:
3038         (WebCore::ActivityState::allFlags):
3039         * page/ActivityStateChangeObserver.h:
3040         * page/FocusController.cpp:
3041         (WebCore::FocusController::FocusController):
3042         (WebCore::FocusController::setFocused):
3043         (WebCore::FocusController::setActivityState):
3044         (WebCore::FocusController::setActive):
3045         * page/FocusController.h:
3046         (WebCore::FocusController::isActive const):
3047         (WebCore::FocusController::isFocused const):
3048         (WebCore::FocusController::contentIsVisible const):
3049         * page/Page.cpp:
3050         (WebCore::pageInitialActivityState):
3051         (WebCore::Page::Page):
3052         (WebCore::Page::setIsInWindow):
3053         (WebCore::Page::updateTimerThrottlingState):
3054         (WebCore::Page::setActivityState):
3055         (WebCore::Page::isVisibleAndActive const):
3056         (WebCore::Page::isWindowActive const):
3057         (WebCore::Page::setIsVisible):
3058         * page/Page.h:
3059         (WebCore::Page::activityState const):
3060         (WebCore::Page::isVisible const):
3061         (WebCore::Page::isInWindow const):
3062         * page/PerformanceMonitor.cpp:
3063         (WebCore::activityStateForCPUSampling):
3064         (WebCore::PerformanceMonitor::activityStateChanged):
3065         * page/PerformanceMonitor.h:
3066         * platform/text/cocoa: Added.
3067
3068 2018-08-15  Ansh Shukla  <ansh_shukla@apple.com>
3069
3070         NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
3071         https://bugs.webkit.org/show_bug.cgi?id=186870
3072         <rdar://problem/41314410>
3073
3074         Reviewed by Alex Christensen.
3075
3076         Add the ProtectionSpaceAuthenticationSchemeOAuth type.
3077
3078         * platform/network/ProtectionSpaceBase.cpp:
3079         (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge
3080         expects a token in return.
3081         * platform/network/ProtectionSpaceBase.h:
3082         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
3083         (WebCore::scheme):
3084         (WebCore::ProtectionSpace::nsSpace const):
3085
3086 2018-08-15  Ben Richards  <benton_richards@apple.com>
3087
3088         We should cache the compiled sandbox profile in a data vault
3089         https://bugs.webkit.org/show_bug.cgi?id=184991
3090
3091         Reviewed by Ryosuke Niwa.
3092
3093         Added functionality to FileHandle so that it can lock a file while open.
3094         Added a function to FileSystem to delete non empty directories.
3095
3096         * platform/FileHandle.cpp:
3097         (WebCore::FileHandle::FileHandle):
3098         (WebCore::FileHandle::open):
3099         (WebCore::FileHandle::close):
3100         * platform/FileHandle.h:
3101         * platform/FileSystem.h:
3102         * platform/cocoa/FileSystemCocoa.mm:
3103         (WebCore::FileSystem::deleteNonEmptyDirectory):
3104
3105 2018-08-15  Ryosuke Niwa  <rniwa@webkit.org>
3106
3107         Can't share an app on AppStore to WeChat due to a release assert
3108         https://bugs.webkit.org/show_bug.cgi?id=188621
3109         <rdar://problem/43343976>
3110
3111         Reviewed by Geoffrey Garen.
3112
3113         Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert
3114         is getting hit by third party applications on iOS in UI process.
3115
3116         * platform/Timer.cpp:
3117         (WebCore::shouldSuppressThreadSafetyCheck): Added a SDK check.
3118
3119 2018-08-15  Christopher Reid  <chris.reid@sony.com>
3120
3121         [Curl] Implement default cookie path handling correctly as outlined in RFC6265.
3122         https://bugs.webkit.org/show_bug.cgi?id=188609
3123
3124         Reviewed by Alex Christensen.
3125
3126         Curl implementation of default cookie path was wrong so that some cookies cannot be accessible.
3127         It should be generated as outlined in: https://tools.ietf.org/html/rfc6265#section-5.1.4
3128
3129         Tests: http/tests/cookies/http-get-cookie-set-in-js.html
3130
3131         * platform/network/curl/CookieJarDB.cpp:
3132         (WebCore::CookieJarDB::setCookie):
3133         * platform/network/curl/CookieUtil.cpp:
3134         (WebCore::CookieUtil::defaultPathForURL):
3135         * platform/network/curl/CookieUtil.h:
3136
3137 2018-08-15  Aditya Keerthi  <akeerthi@apple.com>
3138
3139         [Datalist] Add button to TextFieldInputs with a datalist
3140         https://bugs.webkit.org/show_bug.cgi?id=187741
3141
3142         Reviewed by Tim Horton.
3143
3144         TextFieldInputs that have an associated datalist element should be drawn as
3145         combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox
3146         is not height-resizable. Furthermore, the input should also be able to contain
3147         additional elements, such as the stepper for type=number and the cancel button
3148         for type=search. For these reasons, we draw a button at the end of the input,
3149         mimicking appearance of a combo box.
3150
3151         The list-button -webkit-appearance value was added to display the new button.
3152
3153         Tests: fast/forms/datalist/datalist-searchinput-appearance.html
3154                fast/forms/datalist/datalist-textinput-appearance.html
3155
3156         * Resources/ListButtonArrow.png: Added.
3157         * Resources/ListButtonArrow@2x.png: Added.
3158         * WebCore.xcodeproj/project.pbxproj:
3159         * css/CSSPrimitiveValueMappings.h:
3160         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3161         * css/CSSProperties.json:
3162         * css/CSSValueKeywords.in:
3163         * css/html.css:
3164         (input::-webkit-list-button):
3165         * html/HTMLInputElement.cpp:
3166         (WebCore::HTMLInputElement::dataListButtonElement const):
3167         * html/HTMLInputElement.h:
3168         * html/InputType.h:
3169         (WebCore::InputType::dataListButtonElement const):
3170         * html/TextFieldInputType.cpp:
3171         (WebCore::TextFieldInputType::needsContainer const):
3172         (WebCore::TextFieldInputType::createShadowSubtree):
3173         (WebCore::TextFieldInputType::destroyShadowSubtree):
3174         (WebCore::TextFieldInputType::listAttributeTargetChanged):
3175         (WebCore::TextFieldInputType::dataListButtonElement const):
3176         (WebCore::TextFieldInputType::dataListButtonElementWasClicked):
3177         (WebCore::TextFieldInputType::didCloseSuggestions):
3178         * html/TextFieldInputType.h:
3179         * html/shadow/DataListButtonElement.cpp: Added.
3180         (WebCore::DataListButtonElement::create):
3181         (WebCore::DataListButtonElement::DataListButtonElement):
3182         (WebCore::DataListButtonElement::~DataListButtonElement):
3183         (WebCore::DataListButtonElement::defaultEventHandler):
3184         * html/shadow/DataListButtonElement.h: Added.
3185         * platform/ThemeTypes.h:
3186         * rendering/RenderTheme.cpp:
3187         (WebCore::RenderTheme::adjustStyle):
3188         (WebCore::RenderTheme::adjustListButtonStyle const):
3189         * rendering/RenderTheme.h:
3190         * rendering/RenderThemeMac.h:
3191         * rendering/RenderThemeMac.mm:
3192         (-[WebListButtonCell drawWithFrame:inView:]):
3193         (WebCore::RenderThemeMac::paintListButtonForInput):
3194         (WebCore::RenderThemeMac::adjustListButtonStyle const):
3195         (WebCore::RenderThemeMac::paintTextField):
3196         (WebCore::RenderThemeMac::paintSearchField):
3197         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
3198         (WebCore::RenderThemeMac::listButton const):
3199
3200 2018-08-15  Ryan Haddad  <ryanhaddad@apple.com>
3201
3202         Unreviewed, rolling out r234870.
3203
3204         The test introduced with this change is a flaky failure.
3205
3206         Reverted changeset:
3207
3208         "NSURLAuthenticationMethodOAuth challenges are surfaced to
3209         clients in -didReceiveAuthenticationChallenge as
3210         NSURLAuthenticationMethodDefault"
3211         https://bugs.webkit.org/show_bug.cgi?id=186870
3212         https://trac.webkit.org/changeset/234870
3213
3214 2018-08-14  Ryosuke Niwa  <rniwa@webkit.org>
3215
3216         connectedCallback is invoked by the HTML parser after child nodes had been inserted
3217         https://bugs.webkit.org/show_bug.cgi?id=183931
3218         <rdar://problem/38843548>
3219
3220         Reviewed by Alex Christensen.
3221
3222         Invoke the custom element reactions after constructing and inserting a custom element as specifed in step 3.3 of:
3223         https://html.spec.whatwg.org/multipage/parsing.html#insert-a-foreign-element
3224
3225         The bug here was that HTMLConstructionSite::insertCustomElement uses attachLater so that even though the task
3226         to insert the custom element was created, it didn't get executed until after CustomElementReactionStack in
3227         HTMLDocumentParser::runScriptsForPausedTreeBuilder had been popped off of the stack.
3228
3229         Test: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html
3230
3231         * html/parser/HTMLConstructionSite.cpp:
3232         (WebCore::HTMLConstructionSite::insertCustomElement): Fixed the bug by manually executing the scheduled tasks.
3233         This will enqueue any custom element reactions while CustomElementReactionStack in runScriptsForPausedTreeBuilder
3234         is still in the stack.
3235
3236 2018-08-15  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3237
3238         [Curl] Don't send Content-Type header for POST request when body is null.
3239         https://bugs.webkit.org/show_bug.cgi?id=188588
3240
3241         Reviewed by Youenn Fablet.
3242
3243         The Content-Type header was sent by libcurl automatically. Suppress that behavior
3244         when body is null.
3245
3246         Tests: http/tests/xmlhttprequest/methods.html
3247
3248         * platform/network/curl/CurlRequest.cpp:
3249         (WebCore::CurlRequest::setupPOST):
3250
3251 2018-08-15  Alex Christensen  <achristensen@webkit.org>
3252
3253         Remove failing assertion introduced in r234873
3254         https://bugs.webkit.org/show_bug.cgi?id=188581
3255
3256         * contentextensions/ContentExtensionCompiler.cpp:
3257         (WebCore::ContentExtensions::compileRuleList):
3258         The assertion is correct but failing because VectorTraits<String> is incorrect.
3259         I'll re-add it and fix VectorTraits<String> in a separate patch.
3260
3261 2018-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3262
3263         [Attachment SPI] Remove attachment display mode options
3264         https://bugs.webkit.org/show_bug.cgi?id=188596
3265
3266         Reviewed by Dan Bernstein.
3267
3268         Remove the ability to specify an "in-place" or "icon" representation for attachment elements, as well as logic
3269         needed to allow an attachment element to render image or video elements in a shadow root. The requirements that
3270         initially drove this effort are obviated by r227068, which allows Mail to intercept and provide a custom scheme
3271         for images inserted into the document via rich editing operations.
3272
3273         Removed some existing API tests in _WKAttachmentTests that exercised this functionality.
3274
3275         * editing/Editor.cpp:
3276         (WebCore::Editor::insertAttachmentFromFile):
3277         * editing/cocoa/WebContentReaderCocoa.mm:
3278         (WebCore::createFragmentForImageAttachment):
3279         (WebCore::replaceRichContentWithAttachments):
3280         * html/AttachmentTypes.h:
3281         (WebCore::AttachmentDisplayOptions::encode const):
3282         (WebCore::AttachmentDisplayOptions::decode):
3283
3284         Remove logic for encoding the attachment display mode. While this leaves AttachmentDisplayOptions completely
3285         empty, I haven't removed AttachmentDisplayOptions as well in this patch, since it's not clear that we won't be
3286         needing any mechanism for influencing the display of attachment elements inserted via native SPI.
3287
3288         (): Deleted.
3289         * html/HTMLAttachmentElement.cpp:
3290         (WebCore::HTMLAttachmentElement::createElementRenderer):
3291         (WebCore::HTMLAttachmentElement::setFile):
3292         (WebCore::HTMLAttachmentElement::parseAttribute):
3293         (WebCore::HTMLAttachmentElement::invalidateShadowRootChildrenIfNecessary): Deleted.
3294         (WebCore::HTMLAttachmentElement::attachmentRenderer const): Deleted.
3295         (WebCore::HTMLAttachmentElement::updateDisplayMode): Deleted.
3296         (WebCore::HTMLAttachmentElement::ensureInnerImage): Deleted.
3297         (WebCore::HTMLAttachmentElement::ensureInnerVideo): Deleted.
3298         (WebCore::HTMLAttachmentElement::innerImage const): Deleted.
3299         (WebCore::HTMLAttachmentElement::innerVideo const): Deleted.
3300         (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary): Deleted.
3301
3302         Remove logic for building the shadow root to house inline media elements.
3303
3304         * html/HTMLAttachmentElement.h:
3305
3306         The renderer of the attachment element is once again always a `RenderAttachment`, so we can remove
3307         `attachmentRenderer()` altogether and revert to overriding `renderer()` to return a `RenderAttachment*`.
3308
3309         * page/DragController.cpp:
3310         (WebCore::DragController::startDrag):
3311         * rendering/RenderAttachment.h:
3312         (WebCore::HTMLAttachmentElement::renderer const):
3313
3314 2018-08-15  Ali Juma  <ajuma@chromium.org>
3315
3316         [IntersectionObserver] Do not hold a strong reference to the root element
3317         https://bugs.webkit.org/show_bug.cgi?id=188575
3318
3319         Reviewed by Simon Fraser.
3320
3321         Make IntersectionObserver have only a raw pointer to its root element rather than
3322         a reference, so that an otherwise-unreachable root isn't kept alive. Add logic to
3323         to clear this pointer when the root element gets deleted.
3324
3325         Test: intersection-observer/root-element-deleted.html
3326
3327         * dom/Element.cpp:
3328         (WebCore::Element::~Element):
3329         (WebCore::Element::disconnectFromIntersectionObservers):
3330         (WebCore::Element::ensureIntersectionObserverData):
3331         (WebCore::Element::intersectionObserverData):
3332         * dom/Element.h:
3333         * dom/ElementRareData.cpp:
3334         * dom/ElementRareData.h:
3335         (WebCore::ElementRareData::intersectionObserverData):
3336         (WebCore::ElementRareData::setIntersectionObserverData):
3337         * page/IntersectionObserver.cpp:
3338         (WebCore::IntersectionObserver::create):
3339         (WebCore::IntersectionObserver::IntersectionObserver):
3340         (WebCore::IntersectionObserver::~IntersectionObserver):
3341         (WebCore::IntersectionObserver::rootDestroyed):
3342         * page/IntersectionObserver.h:
3343         (WebCore::IntersectionObserver::root const):
3344
3345 2018-08-14  Zan Dobersek  <zdobersek@igalia.com>
3346
3347         [Nicosia] Add Nicosia::BackingStoreTextureMapperImpl
3348         https://bugs.webkit.org/show_bug.cgi?id=188548
3349
3350         Reviewed by Carlos Garcia Campos.
3351
3352         Add the Nicosia::BackingStoreTextureMapperImpl class, the
3353         TextureMapper-specific implementation that will extend the BackingStore
3354         class.
3355
3356         Purpose of this class is to manage content of painted layers. In the
3357         LayerState object that will be exposed to the CoordinatedGraphicsLayer
3358         owner we keep the current and previous TiledBackingStore objects that
3359         will be used for painting. A TileUpdate object is used to store all tile
3360         creation, removal and update changes that happen during the painting
3361         that's performed during the CoordinatedGraphicsLayer flush.
3362
3363         At the point of synchronization under the Nicosia::Scene object, these
3364         updates will be moved over to the pending TileUpdate object that will
3365         then be accessed during the composition step. For that purpose we keep
3366         in the CompositionState member object a reference to the
3367         CoordinatedBackingStore object that will get updated with the tile
3368         creation, removal and update changes (if there are any). The composition
3369         step will use the takeUpdate() method to retrieve all these changes and
3370         apply them outside of the point of synchronization (avoiding this sync
3371         step to take too long).
3372
3373         This will be integrated into the CoordinatedGraphicsLayer class at a
3374         later point, when the switch to the new infrastructure can be made in
3375         one go.
3376
3377         * platform/TextureMapper.cmake:
3378         * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: Added.
3379         (Nicosia::BackingStoreTextureMapperImpl::createFactory):
3380         (Nicosia::BackingStoreTextureMapperImpl::tiledBackingStoreHasPendingTileCreation):
3381         (Nicosia::BackingStoreTextureMapperImpl::createTile):
3382         (Nicosia::BackingStoreTextureMapperImpl::updateTile):
3383         (Nicosia::BackingStoreTextureMapperImpl::removeTile):
3384         (Nicosia::BackingStoreTextureMapperImpl::flushUpdate):
3385         (Nicosia::BackingStoreTextureMapperImpl::takeUpdate):
3386         * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h: Added.
3387
3388 2018-08-14  Fujii Hironori  <Hironori.Fujii@sony.com>
3389
3390         Unreviewed, rolling out r234874 and r234876.
3391
3392         WinCairo port can't compile
3393
3394         Reverted changesets:
3395
3396         "[JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg"
3397         https://bugs.webkit.org/show_bug.cgi?id=188589
3398         https://trac.webkit.org/changeset/234874
3399
3400         "Unreviewed, attempt to fix CLoop build"