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