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