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