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