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