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