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