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