Unreviewed, rolling out r235107.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-08-21  Commit Queue  <commit-queue@webkit.org>
2
3         Unreviewed, rolling out r235107.
4         https://bugs.webkit.org/show_bug.cgi?id=188832
5
6         "It revealed bugs in Blob code as well as regressed JS
7         performance tests" (Requested by saamyjoon on #webkit).
8
9         Reverted changeset:
10
11         "JSRunLoopTimer may run part of a member function after it's
12         destroyed"
13         https://bugs.webkit.org/show_bug.cgi?id=188426
14         https://trac.webkit.org/changeset/235107
15
16 2018-08-21  Megan Gardner  <megan_gardner@apple.com>
17
18         Use VisiblePosition to calculate selection ranges
19         https://bugs.webkit.org/show_bug.cgi?id=188767
20         <rdar://problem/43577166>
21
22         Reviewed by Ryosuke Niwa.
23
24         Exposing comparePositions.
25
26         * editing/Editing.h:
27
28 2018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>
29
30         [Attachment Support] Augment _WKAttachment SPI to handle NSFileWrappers in addition to NSData
31         https://bugs.webkit.org/show_bug.cgi?id=188496
32         <rdar://problem/43216836>
33
34         Reviewed by Tim Horton.
35
36         Refactors logic around HTMLAttachmentElement and pasteboard reading helpers, in support of moving the data
37         backing for attachment elements to the client layer, instead of keeping it in the attachment element's File.
38         Augmented existing API tests in WKAttachmentTests, and also added a new API test (see Tools for more detail).
39
40         * WebCore.xcodeproj/project.pbxproj:
41         * dom/Document.cpp:
42         (WebCore::Document::didInsertAttachmentElement):
43
44         Notify the client layer when a newly inserted attachment element's identifier has been updated to avoid
45         colliding with the identifier of an existing attachment element. This can happen if, for instance, one or more
46         attachments are copied and pasted within the same document.
47
48         * editing/Editor.cpp:
49         (WebCore::Editor::registerAttachmentIdentifier):
50         (WebCore::Editor::cloneAttachmentData):
51
52         Add new helper functions to notify the client when the attachment identifier to data mapping needs to be
53         updated. This can happen in three ways: (1) an attachment is created with raw data, or (2) an attachment is
54         created with a file path, or (3) the unique identifier for an attachment element has been reassigned. These
55         correspond to the two versions of `registerAttachmentIdentifier`, and `cloneAttachmentData`, respectively.
56
57         (WebCore::EditorClient::supportsClientSideAttachmentData const):
58
59         Add a new EditorClient hook to determine whether client-side attachment data management is supported. Currently,
60         this only returns true for WebKit2. If this flag is set to true, we register attachment identifiers and don't
61         create a new File object for the attachment element; otherwise, fall back to creating and setting a File for the
62         new attachment element.
63
64         (WebCore::Editor::insertAttachment):
65         (WebCore::Editor::insertAttachmentFromFile): Deleted.
66
67         Adjust logic when inserting an attachment; we now only need to update the attributes of the attachment element
68         with metadata from the client layer.
69
70         * editing/Editor.h:
71         * editing/cocoa/WebContentReaderCocoa.mm:
72         (WebCore::supportsClientSideAttachmentData):
73         (WebCore::createFragmentForImageAttachment):
74
75         Notify the client when creating an attachment element from image data on the pasteboard.
76
77         (WebCore::replaceRichContentWithAttachments):
78
79         Refactor this helper function to no longer connect attachment elements to File objects created from
80         subresources. Instead, just update each attachment element's attributes using information about the subresource,
81         and then notify the client about the new attachment data and attachment identifier.
82
83         (WebCore::createFragmentAndAddResources):
84         (WebCore::sanitizeMarkupWithArchive):
85
86         Plumb the current WebContentReader's Frame& to each of these helpers, so that it can call out to the client.
87
88         (WebCore::WebContentReader::readWebArchive):
89         (WebCore::WebContentMarkupReader::readWebArchive):
90         (WebCore::WebContentReader::readImage):
91         (WebCore::WebContentReader::readFilePaths):
92
93         Notify the client when creating an attachment from the path of a dropped file.
94
95         * html/AttachmentTypes.h:
96
97         Remove AttachmentInfo. This is no longer necessary because we don't need to request attachment data from the web
98         process anymore.
99
100         * html/HTMLAttachmentElement.cpp:
101         (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):
102
103         Add a helper function on the attachment element to create and return a unique identifier if needed.
104
105         (WebCore::HTMLAttachmentElement::updateAttributes):
106
107         Add a helper method to update the displayed element attributes (type, title and subtitle) or an attachment.
108
109         (WebCore::AttachmentDataReader::create): Deleted.
110         (WebCore::AttachmentDataReader::AttachmentDataReader): Deleted.
111
112         Remove AttachmentDataReader. This helper class was only used to load attachment data when requesting attachment
113         information in the client, but this is now obviated by moving attachment data to the client layer.
114
115         (WebCore::HTMLAttachmentElement::updateFileWithData): Deleted.
116         (WebCore::HTMLAttachmentElement::requestInfo): Deleted.
117         (WebCore::HTMLAttachmentElement::destroyReader): Deleted.
118         (WebCore::AttachmentDataReader::~AttachmentDataReader): Deleted.
119         (WebCore::AttachmentDataReader::didFinishLoading): Deleted.
120         (WebCore::AttachmentDataReader::didFail): Deleted.
121         (WebCore::AttachmentDataReader::invokeCallbackAndFinishReading): Deleted.
122         * html/HTMLAttachmentElement.h:
123         * page/DragClient.h:
124         * page/DragController.cpp:
125         (WebCore::DragController::startDrag):
126         (WebCore::DragController::doSystemDrag):
127         (WebCore::DragController::promisedAttachmentInfo):
128
129         Allow dragging an attachment (even if it does not have a file) as long as it has a unique identifier and a
130         content type.
131
132         (WebCore::DragController::promisedBlobInfo): Deleted.
133         * page/DragController.h:
134         * page/EditorClient.h:
135         (WebCore::EditorClient::registerAttachmentIdentifier):
136         (WebCore::EditorClient::cloneAttachmentData):
137         * platform/DragItem.h:
138         (WebCore::DragItem::encode const):
139         (WebCore::DragItem::decode):
140         * platform/PromisedAttachmentInfo.h: Renamed from Source/WebCore/platform/PromisedBlobInfo.h.
141
142         Add an attachment identifier to PromisedBlobInfo. Additionally, rename PromisedBlobInfo to
143         PromisedAttachmentInfo, since it is currently exclusively used to attachment element data to the pasteboard.
144         In the future, this could be renamed to something more general (e.g. PromisedPasteboardData), should we use this
145         mechanism to write data from other sources to the pasteboard.
146
147         (WebCore::PromisedAttachmentInfo::operator bool const):
148
149 2018-08-21  Brent Fulgham  <bfulgham@apple.com>
150
151         Remove experimental affiliated domain code now that StorageAccess API is available
152         https://bugs.webkit.org/show_bug.cgi?id=188756
153         <rdar://problem/43527848>
154
155         Reviewed by Alex Christensen.
156
157         In Bug 174661 we added a compatibility quirk to support wsj.com authentication. This quirk is no longer needed,
158         since the StorageAccess API provides the necessary tools to do this type of interaction without needing global
159         cross-site access.
160
161         * loader/ResourceLoadObserver.cpp:
162         (WebCore::ResourceLoadObserver::logSubresourceLoading):
163         (WebCore::ResourceLoadObserver::logWebSocketLoading):
164         (WebCore::areDomainsAssociated): Deleted.
165         (WebCore::shouldEnableSiteSpecificQuirks): Deleted.
166         * loader/ResourceLoadStatistics.cpp:
167         (WebCore::ResourceLoadStatistics::areDomainsAssociated): Deleted.
168         * loader/ResourceLoadStatistics.h:
169
170 2018-08-21  Antti Koivisto  <antti@apple.com>
171
172         Allow creating WeakPtrs to const objects
173         https://bugs.webkit.org/show_bug.cgi?id=188785
174
175         Reviewed by Geoffrey Garen.
176
177         Remove some unneeded const_casts.
178
179         * css/MediaQueryEvaluator.cpp:
180         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
181         (WebCore::MediaQueryEvaluator::evaluate const):
182         * css/MediaQueryEvaluator.h:
183         * rendering/FloatingObjects.cpp:
184         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
185         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
186         (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
187         (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
188         (WebCore::FloatingObjects::FloatingObjects):
189         * rendering/FloatingObjects.h:
190         (WebCore::FloatingObjects::renderer const):
191
192 2018-08-21  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
193
194         Support "name" option for dedicated workers
195         https://bugs.webkit.org/show_bug.cgi?id=188779
196
197         Reviewed by Joseph Pecoraro.
198
199         This patch adds `new Worker(url, { name: "Worker Name" })` option support[1].
200         This name can be accessible from `self.name` of DedicatedWorkerGlobalScope.
201         It is useful for debugging dedicated workers if the inspector can show the
202         names of the workers. This enhancement is tracked by [2].
203
204         [1]: https://github.com/whatwg/html/issues/2477
205         [2]: https://bugs.webkit.org/show_bug.cgi?id=164678
206
207         * workers/DedicatedWorkerGlobalScope.cpp:
208         (WebCore::DedicatedWorkerGlobalScope::create):
209         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
210         Hold `name` member.
211
212         * workers/DedicatedWorkerGlobalScope.h:
213         * workers/DedicatedWorkerGlobalScope.idl:
214         Add `name` attribute.
215
216         * workers/DedicatedWorkerThread.cpp:
217         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
218         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
219         * workers/DedicatedWorkerThread.h:
220         * workers/Worker.cpp:
221         (WebCore::Worker::Worker):
222         (WebCore::Worker::create):
223         (WebCore::Worker::notifyFinished):
224         * workers/Worker.h:
225         * workers/Worker.idl:
226         Add WorkerOptions for dedicated worker creation.
227
228         * workers/WorkerGlobalScopeProxy.h:
229         * workers/WorkerMessagingProxy.cpp:
230         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
231         * workers/WorkerMessagingProxy.h:
232         * workers/WorkerThread.cpp:
233         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
234         Isolate copy the given `name` to pass the worker thread.
235
236         (WebCore::WorkerThread::WorkerThread):
237         (WebCore::WorkerThread::workerThread):
238         * workers/WorkerThread.h:
239         * workers/service/context/ServiceWorkerThread.cpp:
240         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
241         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
242         * workers/service/context/ServiceWorkerThread.h:
243
244 2018-08-21  Per Arne Vollan  <pvollan@apple.com>
245
246         [WebGL] Contexts are not updated when display configuration changed.
247         https://bugs.webkit.org/show_bug.cgi?id=188750
248
249         Reviewed by Brent Fulgham.
250
251         Calling CGDisplayRegisterReconfigurationCallback in GraphicsContext3DManager::addContext
252         returns kCGErrorSuccess when WindowServer access is blocked in the WebContent process,
253         but the callback function is never called. We should register the callback function in
254         the UI process, and send a message to the WebContent process when the display
255         configuration changed.
256
257         Test: fast/canvas/webgl/context-update-on-display-configuration.html
258
259         * WebCore.xcodeproj/project.pbxproj:
260         * platform/graphics/GraphicsContext3DManager.cpp:
261         (WebCore::GraphicsContext3DManager::displayWasReconfigured):
262         (WebCore::GraphicsContext3DManager::addContext):
263         (WebCore::GraphicsContext3DManager::removeContext):
264         (WebCore::displayWasReconfigured): Deleted.
265         * platform/graphics/GraphicsContext3DManager.h:
266
267 2018-08-21  John Wilander  <wilander@apple.com>
268
269         Make ResourceLoadObserver::logWebSocketLoading() handle websockets in detached frames
270         https://bugs.webkit.org/show_bug.cgi?id=188757
271         <rdar://problem/38713390>
272
273         Reviewed by Alex Christensen.
274
275         Test: http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html
276
277         * Modules/websockets/WebSocket.cpp:
278         (WebCore::WebSocket::connect):
279             Now logs even when a frame doesn't exist.
280         * loader/ResourceLoadObserver.cpp:
281         (WebCore::ResourceLoadObserver::shouldLog const):
282             Now takes boolean 'usesEphemeralSession' instead of a page to support logging when there is no page.
283         (WebCore::ResourceLoadObserver::logSubresourceLoading):
284             Changed to send a boolean to ResourceLoadObserver::shouldLog().
285         (WebCore::ResourceLoadObserver::logWebSocketLoading):
286             Changed to:
287             - receive the main frame's URL and a boolean for ephemeral sessions instead of the Frame.
288             - send a boolean to ResourceLoadObserver::shouldLog().
289             - No longer call areDomainsAssociated(). It is being removed in https://bugs.webkit.org/show_bug.cgi?id=188756.
290         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
291             Changed to send a boolean to ResourceLoadObserver::shouldLog().
292         * loader/ResourceLoadObserver.h:
293
294 2018-08-21  Daniel Bates  <dabates@apple.com>
295
296         Disallow navigations when page cache updates the current document of the frame
297         https://bugs.webkit.org/show_bug.cgi?id=188422
298
299         Reviewed by Ryosuke Niwa.
300
301         Make use of NavigationDisabler to disallow navigations when associating the cached
302         document back with its frame (i.e. calling Frame::setDocument()).
303
304         When we associate a cached document with its frame we will construct its render tree
305         and run post style resolution callbacks that can do anything, including performing
306         a frame load. Until page restoration is comnplete the frame tree is in a transient
307         state that makes reasoning about it difficult and error prone. We should not allow
308         navigations in this state.
309
310         Test: fast/history/go-back-to-object-subframe.html
311
312         * loader/FrameLoader.cpp:
313         (WebCore::FrameLoader::open):
314
315 2018-08-21  Daniel Bates  <dabates@apple.com>
316
317         Replace TextCheckingTypeMask with OptionSet
318         https://bugs.webkit.org/show_bug.cgi?id=188678
319
320         Reviewed by Antti Koivisto.
321
322         Replaces TextCheckingTypeMask with an OptionSet to improve type safety and code clarity. Additionally
323         change the values of TextCheckingType such that all the enumerators fit within an uint8_t.
324
325         * PlatformMac.cmake:
326         * SourcesCocoa.txt:
327         * WebCore.xcodeproj/project.pbxproj:
328         * accessibility/AccessibilityObject.cpp:
329         (WebCore::AccessibilityObject::hasMisspelling const):
330         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
331         (AXAttributeStringSetSpelling):
332         * editing/AlternativeTextController.cpp:
333         (WebCore::AlternativeTextController::timerFired):
334         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
335         * editing/Editor.cpp:
336         (WebCore::Editor::replaceSelectionWithFragment):
337         (WebCore::Editor::markMisspellingsAfterTypingToWord):
338         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
339         (WebCore::isAutomaticTextReplacementType):
340         (WebCore::Editor::markAndReplaceFor): For now, change a local variable from const to non-const to work
341         around the following MSVC compiler bug: <https://developercommunity.visualstudio.com/content/problem/316713/msvc-cant-compile-webkits-optionsetcontainsany.html>.
342         (WebCore::Editor::markMisspellingsAndBadGrammar):
343         (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
344         (WebCore::Editor::editorUIUpdateTimerFired):
345         (WebCore::Editor::resolveTextCheckingTypeMask):
346         * editing/Editor.h:
347         * editing/SpellChecker.cpp:
348         (WebCore::SpellCheckRequest::SpellCheckRequest):
349         (WebCore::SpellCheckRequest::create):
350         (WebCore::SpellChecker::didCheckSucceed):
351         * editing/SpellChecker.h:
352         * editing/TextCheckingHelper.cpp:
353         (WebCore::findGrammaticalErrors):
354         (WebCore::findMisspellings):
355         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
356         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
357         (WebCore::checkTextOfParagraph):
358         * editing/TextCheckingHelper.h:
359         * loader/EmptyClients.cpp:
360         * platform/text/TextCheckerClient.h:
361         * platform/text/TextChecking.h: Remove TextCheckingTypeMask. Reorganized the fields of TextCheckingRequestData
362         to coallesce padding and move it to the end of class. Also used default initializer syntax and defaulted (= default)
363         the default constructor of TextCheckingRequestData, removing the need for a user-defined default constructor.
364         (WebCore::TextCheckingRequestData::TextCheckingRequestData):
365         (WebCore::TextCheckingRequestData::text const): Changed return type from String to const String&
366         to avoid unnecessary ref-count churn for callers that do not need to take a shared ownership in
367         this string.
368         (WebCore::TextCheckingRequestData::checkingTypes const): Renamed; formerly named mask.
369         (WebCore::TextCheckingRequestData::mask const): Deleted.
370         * platform/text/mac/TextCheckingMac.mm: Added.
371         (WebCore::nsTextCheckingTypes):
372         * testing/Internals.cpp:
373         (WebCore::Internals::handleAcceptedCandidate):
374
375 2018-08-21  Fujii Hironori  <Hironori.Fujii@sony.com>
376
377         Don't place "using namespace XXX;" in global space for unified source builds
378         https://bugs.webkit.org/show_bug.cgi?id=188739
379
380         Reviewed by Yusuke Suzuki.
381
382         No new tests (No behavior change).
383
384         * html/track/AudioTrackList.cpp:
385         * html/track/TextTrackList.cpp:
386         * html/track/VideoTrackList.cpp:
387         * page/SecurityOriginData.cpp:
388         * page/TextIndicator.cpp:
389         * platform/geoclue/GeolocationProviderGeoclue.cpp:
390         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
391         * platform/graphics/win/FullScreenController.cpp:
392         * platform/mediastream/CaptureDeviceManager.cpp:
393         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
394         * svg/animation/SMILTime.cpp:
395         * testing/js/WebCoreTestSupport.cpp:
396         * xml/XPathParser.cpp:
397
398 2018-08-21  Philippe Normand  <philn@igalia.com>
399
400         [GStreamer] Warn early about incomplete MSE track switching support
401         https://bugs.webkit.org/show_bug.cgi?id=188653
402
403         Reviewed by Xabier Rodriguez-Calvar.
404
405         The proper track switching support shall be fixed at some point by:
406         https://bugs.webkit.org/show_bug.cgi?id=182531.
407
408         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
409         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Remove redundant test.
410         (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Exit early if
411         this method is called by the MSE player.
412
413 2018-08-21  Philippe Normand  <philn@igalia.com>
414
415         [GStreamer][MSE] Generic main thread notification support
416         https://bugs.webkit.org/show_bug.cgi?id=188647
417
418         Reviewed by Xabier Rodriguez-Calvar.
419
420         Using GstBus for main thread notifications has the side effect of "leaking" the
421         application messages to the media player, leading to CPU cycles wasting.
422
423         No new tests, existing MSE tests cover this change.
424
425         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
426         (webkit_media_src_init):
427         (webKitMediaSrcFinalize):
428         (webKitMediaSrcSetMediaPlayerPrivate):
429         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
430
431 2018-08-21  Philippe Normand  <philn@igalia.com>
432
433         [GStreamer][MSE] Remove parsers from playback pipeline
434         https://bugs.webkit.org/show_bug.cgi?id=188646
435
436         Reviewed by Xabier Rodriguez-Calvar.
437
438         Decodebin already includes parsers in front of the decoders.
439
440         No new tests, existing MSE tests cover this change.
441
442         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
443         (WebCore::PlaybackPipeline::addSourceBuffer):
444         (WebCore::PlaybackPipeline::attachTrack):
445         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
446         (webKitMediaSrcLinkSourcePad):
447         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
448
449 2018-08-21  Commit Queue  <commit-queue@webkit.org>
450
451         Unreviewed, rolling out r234979.
452         https://bugs.webkit.org/show_bug.cgi?id=188780
453
454         broke ubuntu LTS build (Requested by philn on #webkit).
455
456         Reverted changeset:
457
458         "[GTK] Never return an uninitialized ImageGStreamer object."
459         https://bugs.webkit.org/show_bug.cgi?id=188305
460         https://trac.webkit.org/changeset/234979
461
462 2018-08-21  Saam barati  <sbarati@apple.com>
463
464         JSRunLoopTimer may run part of a member function after it's destroyed
465         https://bugs.webkit.org/show_bug.cgi?id=188426
466
467         Reviewed by Mark Lam.
468
469         * page/cocoa/ResourceUsageThreadCocoa.mm:
470         (WebCore::ResourceUsageThread::platformThreadBody):
471         * page/linux/ResourceUsageThreadLinux.cpp:
472         (WebCore::ResourceUsageThread::platformThreadBody):
473
474 2018-08-20  Devin Rousso  <drousso@apple.com>
475
476         Web Inspector: allow breakpoints to be set for specific event listeners
477         https://bugs.webkit.org/show_bug.cgi?id=183138
478
479         Reviewed by Joseph Pecoraro.
480
481         Test: inspector/dom/breakpoint-for-event-listener.html
482
483         * inspector/agents/InspectorDOMAgent.h:
484         * inspector/agents/InspectorDOMAgent.cpp:
485         (WebCore::InspectorDOMAgent::getEventListenersForNode):
486         (WebCore::InspectorDOMAgent::setEventListenerDisabled):
487         (WebCore::InspectorDOMAgent::setBreakpointForEventListener): Added.
488         (WebCore::InspectorDOMAgent::removeBreakpointForEventListener): Added.
489         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
490         (WebCore::InspectorDOMAgent::willRemoveEventListener):
491         (WebCore::InspectorDOMAgent::isEventListenerDisabled):
492         (WebCore::InspectorDOMAgent::hasBreakpointForEventListener): Added.
493         (WebCore::InspectorDOMAgent::idForEventListener): Added.
494         Rework the event listener data structure to be based on ID instead of `EventListener`, since
495         it is possible to have the same `EventListener` be used for multiple events.
496
497         * inspector/agents/InspectorDOMDebuggerAgent.h:
498         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
499         (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint):
500         (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint):
501         (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint):
502         (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint):
503         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent): Added.
504         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
505         For DOM events, also check to see if there is a matching event listener specific breakpoint
506         set via the DOMAgent, and break on it if one is found.
507
508         * inspector/InspectorInstrumentation.h:
509         * inspector/InspectorInstrumentation.cpp:
510         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
511         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
512         (WebCore::InspectorInstrumentation::willHandleEventImpl):
513         (WebCore::InspectorInstrumentation::willFireTimerImpl):
514         (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded):
515         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
516         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
517         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
518         Split off `pauseOnNativeEventIfNeeded` to only handle non-DOM events, since all DOM events
519         would already only go through `willHandleEvent`.
520
521 2018-08-20  Michael Catanzaro  <mcatanzaro@igalia.com>
522
523         [CMake] Sync unified build with Cocoa ports
524         https://bugs.webkit.org/show_bug.cgi?id=188732
525
526         Reviewed by Tim Horton.
527
528         For iOS, disambiguate between ::WebEvent declared in PlatformKeyboardEvent.h and
529         WebCore::WebEvent declared in WebEvent.h. It's expected that we'll have to deal with random
530         issues like this when modifying unrelated source files in higher-level projects, since any
531         change to the sources list changes which files get bundled together, and headers from
532         lower-level projects that were not included before may now be included together.
533
534         * platform/PlatformKeyboardEvent.h:
535         (WebCore::PlatformKeyboardEvent::event const):
536
537 2018-08-20  David Kilzer  <ddkilzer@apple.com>
538
539         REGRESSION (r223192): Remove invalid `path` for Modules/geolocation/ios folder
540
541         * WebCore.xcodeproj/project.pbxproj: Remove invalid `path`
542         setting for WebCore/Modules/geolocation/ios folder. This was
543         found while working on a script for Bug 188754: Tool to fix
544         folders that should map to directories in Xcode project files.
545
546 2018-08-20  David Kilzer  <ddkilzer@apple.com>
547
548         REGRESSION (r235015): Xcode changes `mainGroup` name when updating WebCore project file
549
550         * WebCore.xcodeproj/project.pbxproj:
551         - Change `name` to "WebCore" within the group used by
552           `mainGroup` so Xcode won't keep changing its value back to
553           "WebKit".
554
555 2018-08-20  Jeremy Jones  <jeremyj@apple.com>
556
557         UIWebView crashes while attempting to play youtube video on phone
558         https://bugs.webkit.org/show_bug.cgi?id=188351
559         rdar://problem/42489664
560
561         Reviewed by David Kilzer.
562
563         Test will be incorporated with fix for 188749, which will test both fixes.
564
565         VideoFullscreenControllerContext must remove unretained reference to it from m_playbackModel during cleanup.
566
567         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
568         (VideoFullscreenControllerContext::didCleanupFullscreen):
569
570 2018-08-20  Eric Carlson  <eric.carlson@apple.com>
571
572         [MediaStream] Move capture device monitoring to WebKit
573         https://bugs.webkit.org/show_bug.cgi?id=188521
574         <rdar://problem/43251787>
575
576         Reviewed by Youenn Fablet.
577
578         No new tests, updated fast/mediastream/device-change-event-2.html for the changes.
579
580         * Modules/mediastream/MediaDevices.cpp:
581         (WebCore::MediaDevices::MediaDevices): Device change listener is added in addEventListener.
582         (WebCore::MediaDevices::stop): Device change listener is on the user media controller.
583         (WebCore::MediaDevices::addEventListener): Add the device change listener only once the first
584         event handler is added.
585         * Modules/mediastream/MediaDevices.h:
586
587         * Modules/mediastream/UserMediaClient.h:
588         * Modules/mediastream/UserMediaController.h:
589         (WebCore::UserMediaController::addDeviceChangeObserver): Pass through to the client.
590         (WebCore::UserMediaController::removeDeviceChangeObserver): Ditto.
591
592         * platform/mediastream/CaptureDeviceManager.cpp:
593         (CaptureDeviceManager::deviceChanged): Notify RealtimeMediaSourceCenter.
594         (nextObserverToken): Deleted.
595         (CaptureDeviceManager::addCaptureDeviceChangedObserver): Deleted.
596         (CaptureDeviceManager::removeCaptureDeviceChangedObserver): Deleted.
597         * platform/mediastream/CaptureDeviceManager.h:
598
599         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
600         (WebCore::RealtimeMediaSourceCenter::setDevicesChangedObserver):
601         (WebCore::RealtimeMediaSourceCenter::captureDevicesChanged):
602         (WebCore::observerMap): Deleted.
603         (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver): Deleted.
604         (WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver): Deleted.
605         * platform/mediastream/RealtimeMediaSourceCenter.h:
606
607         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
608         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): Call base class.
609
610         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
611         (WebCore::AVCaptureDeviceManager::deviceConnected): Ditto.
612         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Ditto.
613
614         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
615         (WebCore::deviceHasInputStreams): Drive-by fix, check the number of buffers to see if the
616         device has input streams.
617         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): Use new bool parameter
618         added to refreshAudioCaptureDevices so we won't trigger a device change event on the first scan.
619         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): Add param.
620         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Use new param.
621         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
622
623         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
624         (WebCore::MockRealtimeMediaSourceCenter::setDevices): Don't need to call captureDevicesChanged,
625         it is done in the UI process.
626         (WebCore::MockRealtimeMediaSourceCenter::addDevice): Ditto.
627         (WebCore::MockRealtimeMediaSourceCenter::removeDevice): Ditto.
628
629         * testing/InternalSettings.cpp:
630         (WebCore::InternalSettings::setPageIsFocusedAndActive): New, used by updated test.
631         * testing/Internals.h:
632         * testing/Internals.idl:
633
634 2018-08-20  Rob Buis  <rbuis@igalia.com>
635
636         Throw an exception if window.open() gets passed a URL that cannot be parsed
637         https://bugs.webkit.org/show_bug.cgi?id=171656
638
639         Reviewed by Darin Adler.
640
641         Throw a SyntaxError exception when an invalid url gets passed into window.open().
642
643         Tests: imported/w3c/web-platform-tests/url/failure.html
644                fast/dom/Window/open-invalid-url.html
645
646         * page/DOMWindow.cpp:
647         (WebCore::DOMWindow::createWindow):
648         (WebCore::DOMWindow::open):
649         (WebCore::DOMWindow::showModalDialog):
650         * page/DOMWindow.h:
651         * page/DOMWindow.idl:
652         * testing/Internals.cpp:
653         (WebCore::Internals::openDummyInspectorFrontend):
654
655 2018-08-20  Ms2ger  <Ms2ger@igalia.com>
656
657         [SOUP] Check length before calling soup_message_body_append_buffer.
658         https://bugs.webkit.org/show_bug.cgi?id=176803
659
660         Reviewed by Carlos Garcia Campos.
661
662         The function has a precondition that the buffer is non-empty.
663
664         Test: http/tests/local/blob/send-hybrid-blob-using-open-panel.html
665
666         * platform/network/soup/ResourceRequestSoup.cpp:
667         (WebCore::appendEncodedBlobItemToSoupMessageBody):
668         (WebCore::ResourceRequest::updateSoupMessageBody const):
669
670 2018-08-20  Rob Buis  <rbuis@igalia.com>
671
672         Relax Request constructor around referrers
673         https://bugs.webkit.org/show_bug.cgi?id=168649
674
675         Reviewed by Darin Adler.
676
677         Implement remaining part of fetch change
678         https://github.com/whatwg/fetch/pull/377, i.e.
679         if "parsedReferrer’s origin is not same origin with origin",
680         then set request’s referrer to "client", instead of
681         throwing an exception [1].
682
683         WebKit's new behavior matches that of Chrome and Firefox.
684
685         Testing is covered by existing wpt tests.
686
687         [1] Step 15.3.3 of https://fetch.spec.whatwg.org/#main-fetch
688
689         * Modules/fetch/FetchRequest.cpp:
690         (WebCore::computeReferrer):
691
692 2018-08-19  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
693
694         Shrink size of WebCore::Event further by reordering members
695         https://bugs.webkit.org/show_bug.cgi?id=188734
696
697         Reviewed by Daniel Bates.
698
699         Since WebCore::Event is ref-counted class, it has 4bytes m_refCount at the head of the class.
700         So placing 4bytes just after that before placing 8bytes aligned member (like pointers in 64bit
701         platforms) can save the size of WebCore::Event further.
702         This patch reorders members of WebCore::Event to shrink the size from 80bytes to 72bytes.
703
704         No behavior change.
705
706         * dom/Event.cpp:
707         (WebCore::Event::Event):
708         * dom/Event.h:
709
710 2018-08-18  David Kilzer  <ddkilzer@apple.com>
711
712         Let Xcode have its way with the WebCore project
713
714         * WebCore.xcodeproj/project.pbxproj:
715         - Let Xcode sort recently added resources by unique ID.
716         - Manually change the `mainGroup` name from "WebKit" to
717           "WebCore".  There's no need to do this other than to make the
718           inside of the proverbial cabinet match the outside.  It's been
719           this way since the project file was committed in r9857.
720
721 2018-08-18  Ali Juma  <ajuma@chromium.org>
722
723         [IntersectionObserver] Fire an initial dummy notification
724         https://bugs.webkit.org/show_bug.cgi?id=188670
725
726         Reviewed by Simon Fraser.
727
728         Add logic to track ongoing intersection observations. Create an IntersectionObserverRegistration
729         and fire a single dummy notification for each one.
730
731         Test: intersection-observer/root-element-moved.html
732         Also tested by existing tests in imported/w3c/web-platform-tests/intersection-observer.
733
734         * dom/Document.cpp:
735         (WebCore::Document::~Document):
736         (WebCore::Document::addIntersectionObserver):
737         (WebCore::Document::removeIntersectionObserver):
738         (WebCore::Document::updateIntersectionObservations):
739         (WebCore::Document::notifyIntersectionObserversTimerFired):
740         * dom/Document.h:
741         (WebCore::Document::numberOfIntersectionObservers const):
742         * dom/Element.cpp:
743         (WebCore::Element::didMoveToNewDocument):
744         (WebCore::Element::disconnectFromIntersectionObservers):
745         * page/IntersectionObserver.cpp:
746         (WebCore::IntersectionObserver::create):
747         (WebCore::IntersectionObserver::IntersectionObserver):
748         (WebCore::IntersectionObserver::~IntersectionObserver):
749         (WebCore::IntersectionObserver::observe):
750         (WebCore::IntersectionObserver::unobserve):
751         (WebCore::IntersectionObserver::disconnect):
752         (WebCore::IntersectionObserver::takeRecords):
753         (WebCore::IntersectionObserver::targetDestroyed):
754         (WebCore::IntersectionObserver::removeTargetRegistration):
755         (WebCore::IntersectionObserver::removeAllTargets):
756         (WebCore::IntersectionObserver::rootDestroyed):
757         (WebCore::IntersectionObserver::appendQueuedEntry):
758         (WebCore::IntersectionObserver::notify):
759         * page/IntersectionObserver.h:
760         (WebCore::IntersectionObserver::trackingDocument):
761         (WebCore::IntersectionObserver:: const):
762         (WebCore::IntersectionObserver::hasObservationTargets const):
763         * page/IntersectionObserver.idl:
764         * testing/Internals.cpp:
765         (WebCore::Internals::numberOfIntersectionObservers const):
766         * testing/Internals.h:
767         * testing/Internals.idl:
768
769 2018-08-18  Wenson Hsieh  <wenson_hsieh@apple.com>
770
771         [iOS] Paste is missing from callout bar when pasteboard only contains custom data
772         https://bugs.webkit.org/show_bug.cgi?id=184271
773         <rdar://problem/39256708>
774
775         Reviewed by Ryosuke Niwa.
776
777         Export a couple of WebCore functions for use in WebKit.
778
779         * dom/Document.h:
780         * platform/Pasteboard.h:
781
782 2018-08-17  Ryosuke Niwa  <rniwa@webkit.org>
783
784         Pack booleans in Event into a bitfield
785         https://bugs.webkit.org/show_bug.cgi?id=188713
786
787         Reviewed by Daniel Bates.
788
789         Use bitfields for booleans in Event class.
790
791         * dom/Event.cpp:
792         (WebCore::Event::Event):
793         * dom/Event.h:
794         (WebCore::Event::IsComposed): Added.
795         (WebCore::Event): Packed booleans into a bitfield.
796
797 2018-08-17  Aditya Keerthi  <akeerthi@apple.com>
798
799         [Datalist][iOS] Display suggestions for input[type=color]
800         https://bugs.webkit.org/show_bug.cgi?id=188669
801
802         Reviewed by Tim Horton.
803
804         Expose suggestedColors() in HTMLInputElement in order to allow the UIProcess to
805         access the list of suggested colors from a <datalist> element.
806
807         * html/ColorInputType.cpp:
808         (WebCore::ColorInputType::suggestedColors const):
809         * html/ColorInputType.h:
810         * html/HTMLInputElement.cpp:
811         (WebCore::HTMLInputElement::suggestedColors const):
812         * html/HTMLInputElement.h:
813         * html/InputType.cpp:
814         (WebCore::InputType::suggestedColors const):
815         * html/InputType.h:
816         * platform/ColorChooserClient.h:
817
818 2018-08-17  Alex Christensen  <achristensen@webkit.org>
819
820         Clean up CSSSelectorList after r234825
821         https://bugs.webkit.org/show_bug.cgi?id=188566
822
823         Reviewed by Megan Gardner.
824
825         This is responding to Darin's feedback in https://bugs.webkit.org/show_bug.cgi?id=188539
826
827         * css/CSSSelectorList.cpp:
828         (WebCore::CSSSelectorList::operator=): Deleted.
829         * css/CSSSelectorList.h:
830         (WebCore::CSSSelectorList::CSSSelectorList):
831         * css/parser/CSSParserImpl.cpp:
832         (WebCore::CSSParserImpl::parsePageSelector):
833         * css/parser/CSSSelectorParser.cpp:
834         (WebCore::CSSSelectorParser::consumeComplexSelectorList):
835         (WebCore::CSSSelectorParser::consumeCompoundSelectorList):
836
837 2018-08-17  Brent Fulgham  <bfulgham@apple.com>
838
839         Remove Adobe SSO exception now that StorageAccess API is available
840         https://bugs.webkit.org/show_bug.cgi?id=188710
841         <rdar://problem/35056707>
842
843         Reviewed by Alex Christensen.
844
845         Remove custom quirk now that proper API exists to allow the same functions.
846
847         * loader/ResourceLoadObserver.cpp:
848         (WebCore::ResourceLoadObserver::logSubresourceLoading): Remove unneeded quirk.
849         (WebCore::resourceNeedsSSOQuirk): Deleted.
850
851 2018-08-17  Ryosuke Niwa  <rniwa@webkit.org>
852
853         Replace canBubble and cancelable booleans in Event by enum classes
854         https://bugs.webkit.org/show_bug.cgi?id=188692
855         <rdar://problem/43411944>
856
857         Rubber-stamped by Alex Christensen.
858
859         Make these enum classes uint8_t.
860
861         * dom/Event.h:
862
863 2018-08-17  Alex Christensen  <achristensen@webkit.org>
864
865         Add some plumbing for safe browsing
866         https://bugs.webkit.org/show_bug.cgi?id=188709
867
868         Reviewed by Tim Horton.
869
870         No change in behavior.  Just passing around unused booleans.
871         We will need this for a way to load a page even though safe browsing says it's unsafe.
872
873         * WebCore.xcodeproj/project.pbxproj:
874         * loader/EmptyClients.cpp:
875         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
876         * loader/EmptyFrameLoaderClient.h:
877         * loader/FrameLoadRequest.h:
878         (WebCore::FrameLoadRequest::setShouldSkipSafeBrowsingCheck):
879         (WebCore::FrameLoadRequest::shouldSkipSafeBrowsingCheck):
880         * loader/FrameLoader.cpp:
881         (WebCore::FrameLoader::loadArchive):
882         (WebCore::FrameLoader::loadURL):
883         (WebCore::FrameLoader::load):
884         (WebCore::FrameLoader::loadWithNavigationAction):
885         (WebCore::FrameLoader::loadWithDocumentLoader):
886         (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL):
887         (WebCore::FrameLoader::reloadWithOverrideEncoding):
888         (WebCore::FrameLoader::reload):
889         (WebCore::FrameLoader::loadPostRequest):
890         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
891         (WebCore::FrameLoader::loadDifferentDocumentItem):
892         * loader/FrameLoader.h:
893         (WebCore::FrameLoader::loadWithDocumentLoader):
894         (WebCore::FrameLoader::loadWithNavigationAction):
895         * loader/FrameLoaderClient.h:
896         * loader/PolicyChecker.cpp:
897         (WebCore::PolicyChecker::checkNavigationPolicy):
898         * loader/PolicyChecker.h:
899         * loader/ShouldSkipSafeBrowsingCheck.h: Added.
900
901 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
902
903         Replace canBubble and cancelable booleans in Event by enum classes
904         https://bugs.webkit.org/show_bug.cgi?id=188692
905
906         Reviewed by Alex Christensen.
907
908         Replaced booleans indicating whether an event can bubble and an event is cancelable
909         by two enum classes: CanBubble and IsCancelable.
910
911         No new tests since there should be no behavioral changes.
912
913         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
914         (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
915         * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
916         (WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent):
917         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
918         (WebCore::ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent):
919         * Modules/applepay/ApplePaySession.cpp:
920         (WebCore::ApplePaySession::didCancelPaymentSession):
921         * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
922         (WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent):
923         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
924         (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent):
925         * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
926         (WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent):
927         * Modules/encryptedmedia/MediaKeySession.cpp:
928         (WebCore::MediaKeySession::updateKeyStatuses):
929         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
930         (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
931         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
932         (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
933         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
934         (WebCore::WebKitMediaKeySession::addKeyTimerFired):
935         (WebCore::WebKitMediaKeySession::sendError):
936         * Modules/gamepad/GamepadEvent.cpp:
937         (WebCore::GamepadEvent::GamepadEvent):
938         * Modules/indexeddb/IDBDatabase.cpp:
939         (WebCore::IDBDatabase::connectionToServerLost):
940         * Modules/indexeddb/IDBOpenDBRequest.cpp:
941         (WebCore::IDBOpenDBRequest::onError):
942         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
943         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
944         (WebCore::IDBOpenDBRequest::onSuccess):
945         * Modules/indexeddb/IDBRequest.cpp:
946         (WebCore::IDBRequest::onError):
947         (WebCore::IDBRequest::onSuccess):
948         * Modules/indexeddb/IDBRequestCompletionEvent.cpp:
949         (WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent):
950         * Modules/indexeddb/IDBRequestCompletionEvent.h:
951         (WebCore::IDBRequestCompletionEvent::create):
952         * Modules/indexeddb/IDBTransaction.cpp:
953         (WebCore::IDBTransaction::fireOnComplete):
954         (WebCore::IDBTransaction::fireOnAbort):
955         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
956         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
957         * Modules/mediasession/MediaSession.cpp:
958         (WebCore::MediaSession::skipToNextTrack):
959         (WebCore::MediaSession::skipToPreviousTrack):
960         * Modules/mediasource/MediaSource.cpp:
961         (WebCore::MediaSource::scheduleEvent):
962         * Modules/mediasource/SourceBuffer.cpp:
963         (WebCore::SourceBuffer::scheduleEvent):
964         * Modules/mediasource/SourceBufferList.cpp:
965         (WebCore::SourceBufferList::scheduleEvent):
966         * Modules/mediastream/MediaDevices.cpp:
967         (WebCore::MediaDevices::scheduledEventTimerFired):
968         * Modules/mediastream/MediaStream.cpp:
969         (WebCore::MediaStream::internalAddTrack):
970         (WebCore::MediaStream::internalRemoveTrack):
971         * Modules/mediastream/MediaStreamEvent.cpp:
972         (WebCore::MediaStreamEvent::create):
973         (WebCore::MediaStreamEvent::MediaStreamEvent):
974         * Modules/mediastream/MediaStreamEvent.h:
975         * Modules/mediastream/MediaStreamTrack.cpp:
976         (WebCore::MediaStreamTrack::trackEnded):
977         (WebCore::MediaStreamTrack::trackMutedChanged):
978         * Modules/mediastream/MediaStreamTrackEvent.cpp:
979         (WebCore::MediaStreamTrackEvent::create):
980         (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
981         * Modules/mediastream/MediaStreamTrackEvent.h:
982         * Modules/mediastream/OverconstrainedErrorEvent.h:
983         (WebCore::OverconstrainedErrorEvent::create):
984         (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
985         * Modules/mediastream/PeerConnectionBackend.cpp:
986         (WebCore::PeerConnectionBackend::fireICECandidateEvent):
987         (WebCore::PeerConnectionBackend::doneGatheringCandidates):
988         (WebCore::PeerConnectionBackend::updateSignalingState):
989         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
990         (WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent):
991         * Modules/mediastream/RTCDataChannel.cpp:
992         (WebCore::RTCDataChannel::didChangeReadyState):
993         (WebCore::RTCDataChannel::didDetectError):
994         (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
995         * Modules/mediastream/RTCDataChannelEvent.cpp:
996         (WebCore::RTCDataChannelEvent::create):
997         (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
998         * Modules/mediastream/RTCDataChannelEvent.h:
999         * Modules/mediastream/RTCPeerConnection.cpp:
1000         (WebCore::RTCPeerConnection::updateIceGatheringState):
1001         (WebCore::RTCPeerConnection::updateIceConnectionState):
1002         (WebCore::RTCPeerConnection::updateConnectionState):
1003         (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
1004         * Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
1005         (WebCore::RTCPeerConnectionIceEvent::create):
1006         (WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):
1007         * Modules/mediastream/RTCPeerConnectionIceEvent.h:
1008         * Modules/mediastream/RTCTrackEvent.cpp:
1009         (WebCore::RTCTrackEvent::create):
1010         (WebCore::RTCTrackEvent::RTCTrackEvent):
1011         * Modules/mediastream/RTCTrackEvent.h:
1012         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1013         (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
1014         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
1015         (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
1016         * Modules/notifications/Notification.cpp:
1017         (WebCore::Notification::dispatchShowEvent):
1018         (WebCore::Notification::dispatchClickEvent):
1019         (WebCore::Notification::dispatchCloseEvent):
1020         (WebCore::Notification::dispatchErrorEvent):
1021         * Modules/paymentrequest/MerchantValidationEvent.cpp:
1022         (WebCore::MerchantValidationEvent::MerchantValidationEvent):
1023         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
1024         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
1025         * Modules/plugins/QuickTimePluginReplacement.mm:
1026         (WebCore::QuickTimePluginReplacement::postEvent):
1027         * Modules/speech/SpeechSynthesisEvent.cpp:
1028         (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
1029         * Modules/webaudio/AudioContext.cpp:
1030         (WebCore::AudioContext::setState):
1031         * Modules/webaudio/AudioProcessingEvent.cpp:
1032         (WebCore::AudioProcessingEvent::AudioProcessingEvent):
1033         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1034         (WebCore::AudioScheduledSourceNode::finish):
1035         * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
1036         (WebCore::OfflineAudioCompletionEvent::OfflineAudioCompletionEvent):
1037         * Modules/websockets/CloseEvent.h:
1038         (WebCore::CloseEvent::CloseEvent):
1039         * Modules/websockets/WebSocket.cpp:
1040         (WebCore::WebSocket::didConnect):
1041         (WebCore::WebSocket::dispatchOrQueueErrorEvent):
1042         * Modules/webvr/VRDisplayEvent.cpp:
1043         (WebCore::VRDisplayEvent::VRDisplayEvent):
1044         * accessibility/AccessibilityObject.cpp:
1045         (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const):
1046         * accessibility/AccessibleSetValueEvent.cpp:
1047         (WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
1048         * animation/AnimationPlaybackEvent.cpp:
1049         (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
1050         * dom/AbortSignal.cpp:
1051         (WebCore::AbortSignal::abort):
1052         * dom/AnimationEvent.cpp:
1053         (WebCore::AnimationEvent::AnimationEvent):
1054         * dom/BeforeLoadEvent.h:
1055         * dom/BeforeTextInsertedEvent.cpp:
1056         (WebCore::BeforeTextInsertedEvent::BeforeTextInsertedEvent):
1057         * dom/BeforeUnloadEvent.cpp:
1058         (WebCore::BeforeUnloadEvent::BeforeUnloadEvent):
1059         * dom/CharacterData.cpp:
1060         (WebCore::CharacterData::dispatchModifiedEvent):
1061         * dom/CompositionEvent.cpp:
1062         (WebCore::CompositionEvent::CompositionEvent):
1063         * dom/ContainerNode.cpp:
1064         (WebCore::dispatchChildInsertionEvents):
1065         (WebCore::dispatchChildRemovalEvents):
1066         * dom/DeviceMotionEvent.cpp:
1067         (WebCore::DeviceMotionEvent::DeviceMotionEvent):
1068         * dom/DeviceOrientationEvent.cpp:
1069         (WebCore::DeviceOrientationEvent::DeviceOrientationEvent):
1070         * dom/Document.cpp:
1071         (WebCore::Document::setReadyState):
1072         (WebCore::Document::visibilityStateChanged):
1073         (WebCore::Document::finishedParsing):
1074         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
1075         (WebCore::Document::orientationChanged):
1076         * dom/DocumentEventQueue.cpp:
1077         (WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
1078         (WebCore::DocumentEventQueue::enqueueScrollEvent):
1079         (WebCore::DocumentEventQueue::enqueueResizeEvent):
1080         * dom/DocumentEventQueue.h:
1081         * dom/Element.cpp:
1082         (WebCore::Element::dispatchMouseEvent):
1083         (WebCore::Element::dispatchFocusInEvent):
1084         (WebCore::Element::dispatchFocusOutEvent):
1085         (WebCore::Element::dispatchFocusEvent):
1086         (WebCore::Element::dispatchBlurEvent):
1087         (WebCore::Element::dispatchWebKitImageReadyEventForTesting):
1088         * dom/ErrorEvent.cpp:
1089         (WebCore::ErrorEvent::ErrorEvent):
1090         * dom/Event.cpp:
1091         (WebCore::Event::Event):
1092         (WebCore::Event::create):
1093         * dom/Event.h:
1094         * dom/FocusEvent.cpp:
1095         (WebCore::FocusEvent::FocusEvent):
1096         * dom/FocusEvent.h:
1097         * dom/HashChangeEvent.h:
1098         * dom/InputEvent.cpp:
1099         (WebCore::InputEvent::create):
1100         (WebCore::InputEvent::InputEvent):
1101         * dom/InputEvent.h:
1102         * dom/KeyboardEvent.cpp:
1103         (WebCore::KeyboardEvent::KeyboardEvent):
1104         * dom/MessageEvent.cpp:
1105         (WebCore::MessageEvent::MessageEvent):
1106         * dom/MouseEvent.cpp:
1107         (WebCore::MouseEvent::create):
1108         (WebCore::MouseEvent::MouseEvent):
1109         * dom/MouseEvent.h:
1110         * dom/MouseRelatedEvent.cpp:
1111         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
1112         * dom/MouseRelatedEvent.h:
1113         * dom/MutationEvent.cpp:
1114         (WebCore::MutationEvent::MutationEvent):
1115         * dom/MutationEvent.h:
1116         * dom/Node.cpp:
1117         (WebCore::Node::dispatchSubtreeModifiedEvent):
1118         (WebCore::Node::dispatchDOMActivateEvent):
1119         (WebCore::Node::dispatchInputEvent):
1120         * dom/OverflowEvent.cpp:
1121         (WebCore::OverflowEvent::OverflowEvent):
1122         * dom/PageTransitionEvent.cpp:
1123         (WebCore::PageTransitionEvent::PageTransitionEvent):
1124         * dom/PopStateEvent.cpp:
1125         (WebCore::PopStateEvent::PopStateEvent):
1126         * dom/ProgressEvent.cpp:
1127         (WebCore::ProgressEvent::ProgressEvent):
1128         * dom/ScriptElement.cpp:
1129         (WebCore::ScriptElement::dispatchErrorEvent):
1130         * dom/SecurityPolicyViolationEvent.h:
1131         * dom/SimulatedClick.cpp:
1132         * dom/TextEvent.cpp:
1133         (WebCore::TextEvent::TextEvent):
1134         * dom/TransitionEvent.cpp:
1135         (WebCore::TransitionEvent::TransitionEvent):
1136         * dom/UIEvent.cpp:
1137         (WebCore::UIEvent::UIEvent):
1138         * dom/UIEvent.h:
1139         (WebCore::UIEvent::create):
1140         * dom/UIEventWithKeyState.h:
1141         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
1142         * dom/WebKitAnimationEvent.cpp:
1143         (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
1144         * dom/WebKitTransitionEvent.cpp:
1145         (WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
1146         * dom/WheelEvent.cpp:
1147         (WebCore::WheelEvent::WheelEvent):
1148         * editing/Editor.cpp:
1149         (WebCore::dispatchBeforeInputEvent):
1150         (WebCore::dispatchBeforeInputEvents):
1151         (WebCore::Editor::willApplyEditing const):
1152         * editing/FrameSelection.cpp:
1153         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
1154         (WebCore::FrameSelection::selectAll):
1155         (WebCore::FrameSelection::dispatchSelectStart):
1156         * html/HTMLDetailsElement.cpp:
1157         (WebCore::HTMLDetailsElement::dispatchPendingEvent):
1158         * html/HTMLFormControlElement.cpp:
1159         (WebCore::HTMLFormControlElement::dispatchChangeEvent):
1160         (WebCore::HTMLFormControlElement::checkValidity):
1161         * html/HTMLFormElement.cpp:
1162         (WebCore::HTMLFormElement::prepareForSubmission):
1163         (WebCore::HTMLFormElement::reset):
1164         * html/HTMLImageLoader.cpp:
1165         (WebCore::HTMLImageLoader::dispatchLoadEvent):
1166         * html/HTMLInputElement.cpp:
1167         (WebCore::HTMLInputElement::onSearch):
1168         * html/HTMLLinkElement.cpp:
1169         (WebCore::HTMLLinkElement::dispatchPendingEvent):
1170         * html/HTMLMediaElement.cpp:
1171         (WebCore::HTMLMediaElement::scheduleEvent):
1172         (WebCore::HTMLMediaElement::notifyAboutPlaying):
1173         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1174         (WebCore::HTMLMediaElement::layoutSizeChanged):
1175         * html/HTMLPlugInImageElement.cpp:
1176         (WebCore::HTMLPlugInImageElement::checkSnapshotStatus):
1177         * html/HTMLScriptElement.cpp:
1178         (WebCore::HTMLScriptElement::dispatchLoadEvent):
1179         * html/HTMLSlotElement.cpp:
1180         (WebCore::HTMLSlotElement::dispatchSlotChangeEvent):
1181         * html/HTMLSourceElement.cpp:
1182         (WebCore::HTMLSourceElement::errorEventTimerFired):
1183         * html/HTMLStyleElement.cpp:
1184         (WebCore::HTMLStyleElement::dispatchPendingEvent):
1185         * html/HTMLTextFormControlElement.cpp:
1186         (WebCore::HTMLTextFormControlElement::selectionChanged):
1187         * html/HTMLTrackElement.cpp:
1188         (WebCore::HTMLTrackElement::didCompleteLoad):
1189         * html/MediaController.cpp:
1190         (WebCore::MediaController::scheduleEvent):
1191         * html/canvas/WebGLContextEvent.cpp:
1192         (WebCore::WebGLContextEvent::WebGLContextEvent):
1193         * html/canvas/WebGLContextEvent.h:
1194         * html/canvas/WebGLRenderingContextBase.cpp:
1195         (WebCore::WebGLRenderingContextBase::create):
1196         (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
1197         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
1198         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
1199         * html/parser/HTMLScriptRunner.cpp:
1200         (WebCore::createScriptLoadEvent):
1201         * html/track/TrackEvent.cpp:
1202         (WebCore::TrackEvent::TrackEvent):
1203         * html/track/TrackEvent.h:
1204         * html/track/TrackListBase.cpp:
1205         (WebCore::TrackListBase::scheduleTrackEvent):
1206         (WebCore::TrackListBase::scheduleChangeEvent):
1207         * loader/DocumentLoader.cpp:
1208         (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
1209         * loader/FrameLoader.cpp:
1210         (WebCore::FrameLoader::dispatchUnloadEvents):
1211         * loader/ImageLoader.cpp:
1212         (WebCore::ImageLoader::dispatchPendingErrorEvent):
1213         * loader/PolicyChecker.cpp:
1214         (WebCore::PolicyChecker::checkNavigationPolicy):
1215         * loader/appcache/ApplicationCacheHost.cpp:
1216         (WebCore::createApplicationCacheEvent):
1217         * page/DOMWindow.cpp:
1218         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
1219         (WebCore::DOMWindow::languagesChanged):
1220         (WebCore::DOMWindow::dispatchLoadEvent):
1221         * page/EventHandler.cpp:
1222         (WebCore::dispatchSelectStart):
1223         (WebCore::EventHandler::dispatchDragEvent):
1224         * page/EventSource.cpp:
1225         (WebCore::EventSource::scheduleReconnect):
1226         (WebCore::EventSource::didReceiveResponse):
1227         (WebCore::EventSource::abortConnectionAttempt):
1228         * page/FocusController.cpp:
1229         (WebCore::dispatchEventsOnWindowAndFocusedElement):
1230         (WebCore::FocusController::setFocusedFrame):
1231         * page/FrameView.cpp:
1232         (WebCore::FrameView::sendResizeEventIfNeeded):
1233         * page/Page.cpp:
1234         (WebCore::networkStateChanged):
1235         * page/Performance.cpp:
1236         (WebCore::Performance::resourceTimingBufferFullTimerFired):
1237         * page/PointerLockController.cpp:
1238         (WebCore::PointerLockController::enqueueEvent):
1239         * page/VisualViewport.cpp:
1240         (WebCore::VisualViewport::enqueueResizeEvent):
1241         (WebCore::VisualViewport::enqueueScrollEvent):
1242         * storage/StorageEvent.cpp:
1243         (WebCore::StorageEvent::StorageEvent):
1244         * svg/SVGElement.cpp:
1245         (WebCore::SVGElement::sendSVGLoadEventIfPossible):
1246         * svg/SVGImageLoader.cpp:
1247         (WebCore::SVGImageLoader::dispatchLoadEvent):
1248         * svg/SVGUseElement.cpp:
1249         (WebCore::SVGUseElement::notifyFinished):
1250         * svg/animation/SVGSMILElement.cpp:
1251         (WebCore::SVGSMILElement::dispatchPendingEvent):
1252         * workers/Worker.cpp:
1253         (WebCore::Worker::notifyFinished):
1254         * workers/WorkerMessagingProxy.cpp:
1255         (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
1256         * workers/service/ExtendableEvent.cpp:
1257         (WebCore::ExtendableEvent::ExtendableEvent):
1258         * workers/service/ExtendableEvent.h:
1259         * workers/service/ExtendableMessageEvent.cpp:
1260         (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
1261         * workers/service/ServiceWorker.cpp:
1262         (WebCore::ServiceWorker::scheduleTaskToUpdateState):
1263         * workers/service/ServiceWorkerContainer.cpp:
1264         (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
1265         * workers/service/ServiceWorkerRegistration.cpp:
1266         (WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
1267         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1268         (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange):
1269         * xml/XMLHttpRequest.cpp:
1270         (WebCore::XMLHttpRequest::callReadyStateChangeListener):
1271
1272 2018-08-17  Yusuke Suzuki  <yusukesuzuki@slowstart.org> and Fujii Hironori  <Hironori.Fujii@sony.com>
1273
1274         [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg
1275         https://bugs.webkit.org/show_bug.cgi?id=188589
1276
1277         Reviewed by Mark Lam.
1278         And reviewed by Yusuke Suzuki for Hironori's change.
1279
1280         * cssjit/FunctionCall.h:
1281         (WebCore::FunctionCall::FunctionCall):
1282         * cssjit/SelectorCompiler.cpp:
1283         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
1284         * html/HTMLKeygenElement.cpp:
1285         Remove `using namespace WebCore` not to introduce `operator+/-` which makes the resolution of `operator+/-` for RegisterID ambiguous.
1286
1287 2018-08-17  Philippe Normand  <philn@igalia.com>
1288
1289         [GStreamer] reduce position queries frequency
1290         https://bugs.webkit.org/show_bug.cgi?id=188645
1291
1292         Reviewed by Xabier Rodriguez-Calvar.
1293
1294         There is no need to perform dozens of position queries per second.
1295         One every 300ms is enough.
1296
1297         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1298         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
1299         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
1300         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
1301         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
1302         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1303
1304 2018-08-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1305
1306         [SOUP] Handle OAuth authentication after r234912
1307         https://bugs.webkit.org/show_bug.cgi?id=188651
1308
1309         Reviewed by Carlos Garcia Campos.
1310
1311         Update this switch to consider the new OAuth enum value added in r234912. I suppose OAuth is
1312         used for HTTP Auth now. It will be a one-time compatibility break as passwords previously
1313         stored with type "Unknown" will no longer be accessible.
1314
1315         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1316         (WebCore::authTypeFromProtectionSpaceAuthenticationScheme):
1317
1318 2018-08-17  Ms2ger  <Ms2ger@igalia.com>
1319
1320         [GTK] Never return an uninitialized ImageGStreamer object.
1321         https://bugs.webkit.org/show_bug.cgi?id=188305
1322
1323         Reviewed by Philippe Normand.
1324
1325         The single caller was already checking for a null return value, so
1326         make that check actually do something. Also remove the null-check on
1327         the return value of image(), which asserted that it would never return
1328         null.
1329
1330         Test: fast/canvas/canvas-createPattern-video-loading.html
1331
1332         * platform/graphics/gstreamer/ImageGStreamer.h:
1333         (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created.
1334         (WebCore::ImageGStreamer::image): Return a reference.
1335         (WebCore::ImageGStreamer::rect): Always assert that m_image is present.
1336         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1337         (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature.
1338
1339 2018-08-17  Philippe Normand  <philn@igalia.com>
1340
1341         [GStreamer] Enable fpsdisplaysink only when MEDIA_STATISTICS is enabled
1342         https://bugs.webkit.org/show_bug.cgi?id=188648
1343
1344         Reviewed by Xabier Rodriguez-Calvar.
1345
1346         The fpsdisplaysink is useful only when MEDIA_STATISTICS is turned on.
1347         The text overlay is now enabled when GST_DEBUG tracing is enabled for the player.
1348
1349         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1350         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
1351
1352 2018-08-17  Philippe Normand  <philn@igalia.com>
1353
1354         [GStreamer][MSE] Disable last-sample support in AppendPipeline
1355         https://bugs.webkit.org/show_bug.cgi?id=188649
1356
1357         Reviewed by Xabier Rodriguez-Calvar.
1358
1359         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1360         (WebCore::AppendPipeline::AppendPipeline): This property isn't
1361         used by the append pipeline. So as a micro-optimization, it is now
1362         disabled.
1363
1364 2018-08-16  Devin Rousso  <drousso@apple.com>
1365
1366         Web Inspector: support breakpoints for arbitrary event names
1367         https://bugs.webkit.org/show_bug.cgi?id=183118
1368
1369         Reviewed by Joseph Pecoraro.
1370
1371         Tests: inspector/dom-debugger/event-breakpoints.html
1372                inspector/dom-debugger/event-breakpoints-with-navigation.html
1373
1374         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
1375         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
1376
1377 2018-08-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1378
1379         [Curl] Bug fix on deleting cookies when Max-Age is set to zero.
1380         https://bugs.webkit.org/show_bug.cgi?id=188617
1381
1382         Reviewed by Alex Christensen.
1383
1384         Delete cookie if Max-Age is set to zero in Set-Cookie. Original implementation was
1385         compared using "less than", but it must be "less than or equal" to zero.
1386
1387         Tests: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html
1388
1389         * platform/network/curl/CookieJarDB.cpp:
1390         (WebCore::CookieJarDB::setCookie):
1391
1392 2018-08-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1393
1394         [Curl] Implement deleteAllCookies()
1395         https://bugs.webkit.org/show_bug.cgi?id=188612
1396
1397         Reviewed by Alex Christensen.
1398
1399         deleteAllCookies() was not implemented. Connect the interface to the implementation.
1400
1401         Tests: http/tests/cookies/simple-cookies-expired.html
1402                http/tests/cookies/simple-cookies-max-age.html
1403
1404         * platform/network/curl/CookieJarCurlDatabase.cpp:
1405         (WebCore::CookieJarCurlDatabase::deleteAllCookies const):
1406
1407 2018-08-16  Ross Kirsling  <ross.kirsling@sony.com>
1408
1409         REGRESSION(r234930): Don't embed a #if in an ASSERT
1410         https://bugs.webkit.org/show_bug.cgi?id=188680
1411
1412         Reviewed by Tim Horton.
1413
1414         * page/EventHandler.cpp:
1415         (WebCore::EventHandler::handleDrag):
1416         Simplify the ASSERT -- it seems we just want to know that DragSourceActionSelection and exactly one other DragSourceAction is set. 
1417
1418 2018-08-16  Alex Christensen  <achristensen@webkit.org>
1419
1420         Remove unused allowScriptsToCloseWindows setting
1421         https://bugs.webkit.org/show_bug.cgi?id=188602
1422
1423         Reviewed by Simon Fraser.
1424
1425         No change in behaviour. It was always false.
1426
1427         * page/DOMWindow.cpp:
1428         (WebCore::DOMWindow::close):
1429         * page/Settings.yaml:
1430
1431 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
1432
1433         Custom element constructor doesn't use HTMLElement in new.target's realm
1434         https://bugs.webkit.org/show_bug.cgi?id=188634
1435
1436         Reviewed by Keith Miller.
1437
1438         Fixed the bug that HTMLElement's constructor was constructing an element of its own realm
1439         instead of the realm of new.target. This results in the JS wrapper created for the element
1440         belonging to the global object of the HTMLElement constructor which was invoked instead of
1441         the global object of new.target as specified in:
1442         https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors
1443
1444         In particular, step 9.2. specifies that we "perform element.[[SetPrototypeOf]](prototype)."
1445         where prototype is the result of Get(NewTarget, "prototype") in step 7.
1446
1447         WebKit's new behavior matches that of Chrome and Firefox.
1448
1449         Test: imported/w3c/web-platform-tests/custom-elements/htmlconstructor/newtarget.html
1450
1451         * bindings/js/JSHTMLElementCustom.cpp:
1452         (WebCore::constructJSHTMLElement): 
1453
1454 2018-08-16  Aditya Keerthi  <akeerthi@apple.com>
1455
1456         Unreviewed, fix the watchOS build after r188464.
1457
1458         * platform/ios/PlatformPasteboardIOS.mm:
1459         (WebCore::PlatformPasteboard::setColor):
1460
1461 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
1462
1463         Custom element doesn't invalidate its style when :defined rule starts to apply
1464         https://bugs.webkit.org/show_bug.cgi?id=188637
1465
1466         Reviewed by Antti Koivisto.
1467
1468         Fixed the bug by invalidating the subtree when a custom element gets defined.
1469
1470         Test: fast/custom-elements/defined-update-style.html
1471
1472         * dom/Element.cpp:
1473         (WebCore::Element::setIsDefinedCustomElement):
1474
1475 2018-08-16  Youenn Fablet  <youenn@apple.com>
1476
1477         Change the input camera in the sources & outputs example on Safari (11) with M.Way camera
1478         https://bugs.webkit.org/show_bug.cgi?id=187756
1479         <rdar://problem/42332178>
1480
1481         Reviewed by Eric Carlson.
1482
1483         Covered by manual testing.
1484
1485         640x480x30fps is added as ideal constraints to getUserMedia if none other is added to provide consistent behavior.
1486         Some cameras do not support 30fps as they have discrete frame rate ranges.
1487         Before the patch, we were rejecting getUserMedia promise if the 'ideal' frameRate was not supported.
1488         After the patch, we do not check whether frame rate is supported if it is not mandatory.
1489         At capture time, we will still try to apply frame rate change and if not supported, the frame rate will not be set to 30 fps.
1490
1491         While we could surface discrete width/height/frame rate ranges, it seems best to fix the issue this way.
1492         In the future, we might implement video interpolation for width/height/framerate at WebCore level.
1493
1494         * platform/mediastream/RealtimeMediaSource.cpp:
1495         (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
1496         (WebCore::RealtimeMediaSource::supportsConstraint const):
1497         (WebCore::RealtimeMediaSource::supportsConstraints):
1498
1499 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
1500
1501         Perform a microtask checkpoint before creating a custom element
1502         https://bugs.webkit.org/show_bug.cgi?id=188189
1503         <rdar://problem/42843022>
1504
1505         Reviewed by Geoffrey Garen.
1506
1507         Fixed the bug that the HTML parser was not performing a microtask checkpoint prior to synchronously constructing
1508         a custom element in the concept to create an element for a token:
1509         https://html.spec.whatwg.org/multipage/parsing.html#creating-and-inserting-nodes:perform-a-microtask-checkpoint
1510
1511         Also added a microtask checkpoint before dispatching DOMContentLoaded to work around webkit.org/b/82931 since
1512         scheduling a task to fire a DOMContentLoaded event in Document::finishedParsing as the HTML5 spec mandates
1513         is a long standing bug with a lot of implications, which is completely outside the scope of this bug fix:
1514         https://html.spec.whatwg.org/multipage/parsing.html#stop-parsing
1515
1516         Test: fast/custom-elements/perform-microtask-checkpoint-before-construction.html
1517
1518         * dom/Document.cpp:
1519         (WebCore::Document::finishedParsing): Perform a microtask checkpoint before dispatching DOMContentLoaded here as
1520         a workaround for webkit.org/b/82931.
1521         * html/parser/HTMLDocumentParser.cpp:
1522         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Perform a microtask checkpoint here to fix the bug.
1523
1524 2018-08-16  Alex Christensen  <achristensen@webkit.org>
1525
1526         Re-introduce assertion removed in r234890
1527         https://bugs.webkit.org/show_bug.cgi?id=188611
1528
1529         Reviewed by Geoffrey Garen.
1530
1531         The assertion was failing because Vector<String>::operator== was using memcmp,
1532         which failed to consider different instances of equal Strings equal.  Added an
1533         API test and this assertion, which now succeeds.
1534
1535         * contentextensions/ContentExtensionCompiler.cpp:
1536         (WebCore::ContentExtensions::compileRuleList):
1537
1538 2018-08-15  Jer Noble  <jer.noble@apple.com>
1539
1540         Add Experimental Feature support for SourceBuffer.changeType()
1541         https://bugs.webkit.org/show_bug.cgi?id=188626
1542
1543         Reviewed by Eric Carlson.
1544
1545         Tests: imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html
1546                imported/w3c/web-platform-tests/media-source/mediasource-changetype.html
1547
1548         The WICG is incubating a new proposal to allow clients to switch between streams
1549         with different codecs within the same SourceBuffer. The proposal is being tracked
1550         by <https://github.com/w3c/media-source/issues/155> and the proposed spec change
1551         is available at <https://rawgit.com/wicg/media-source/codec-switching/index.html>.
1552
1553         Drive-by fix: One of the wpt tests uses a .mp3 file to test SourceBuffer switching.
1554         The AVStreamDataParser does not necessarily emit every frame appended, and after a
1555         new init segment is appended, it's possible that frames from the previous media
1556         segment will be emitted. This causes an error condition to occur, due to an added
1557         check in the spec for a new flag. When the SourceBuffer asks its private implementation
1558         to reset the parser state, since there's no API on AVStreamDataParser to actually
1559         reset the parser state, just set a flag to drop all emitted buffers until the next
1560         initialization segment is parsed.
1561
1562         * Modules/mediasource/MediaSource.cpp:
1563         (WebCore::MediaSource::contentTypeShouldGenerateTimestamps):
1564         (WebCore::MediaSource::setDurationInternal):
1565         (WebCore::MediaSource::addSourceBuffer):
1566         * Modules/mediasource/MediaSource.h:
1567         * Modules/mediasource/SourceBuffer.cpp:
1568         (WebCore::SourceBuffer::changeType):
1569         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
1570         (WebCore::SourceBuffer::validateInitializationSegment):
1571         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1572         * Modules/mediasource/SourceBuffer.h:
1573         * Modules/mediasource/SourceBuffer.idl:
1574         * page/Settings.yaml:
1575         * platform/graphics/SourceBufferPrivate.h:
1576         (WebCore::SourceBufferPrivate::canSwitchToType):
1577         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1578         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1579         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
1580         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
1581         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
1582         (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
1583
1584 2018-08-16  Christopher Reid  <chris.reid@sony.com>
1585
1586         [Curl] Not all Cookie database files are deleted on corruption
1587         https://bugs.webkit.org/show_bug.cgi?id=185873
1588
1589         Reviewed by Fujii Hironori.
1590
1591         No new tests.
1592
1593         Delete the cookie database file and the corruption flag file when corruption is detected.
1594         Adding a quick integrity check in case it can catch anything when opening the database.
1595         Removing PRAGMA temp_store = MEMORY and PRAGMA journal_mode = WAL as they are set in SQLiteDatabase::open.
1596
1597         * platform/network/curl/CookieJarDB.cpp:
1598
1599 2018-08-16  Zan Dobersek  <zdobersek@igalia.com>
1600
1601         [Nicosia] Add Nicosia::ImageBackingTextureMapperImpl
1602         https://bugs.webkit.org/show_bug.cgi?id=188550
1603
1604         Reviewed by Carlos Garcia Campos.
1605
1606         Add the Nicosia::ImageBackingTextureMapperImpl class, the
1607         TextureMapper-specific implementation that will extend the ImageBacking
1608         class.
1609
1610         This class will be used to contain and manage updates for layers that
1611         are backed by image objects. The CoordinatedGraphicsLayer instance will
1612         use the LayerState object to track the currently-presented image objects
1613         and to store the latest update of these objects. The Update struct
1614         contains information about the current visibility of the image in the
1615         layer tree as well as the Nicosia::Buffer object containing the painted
1616         image data that's to be presented on the screen.
1617
1618         During the layer flush the flushUpdate() method will move the current
1619         update data into the pending position, from which this data will be
1620         gathered by the composition component through the takeUpdate() method
1621         and used to update the CoordinatedBackingStore object that's kept in
1622         the CompositionState object on this impl class.
1623
1624         This will be deployed for use in the CoordinatedGraphicsLayer at a later
1625         stage as it requires a larger rework in both CoordinatedGraphicsLayer as
1626         well as the CoordinatedGraphicsScene classes.
1627
1628         The implementation itself differs from the current image backing support
1629         in CoordinatedGraphicsLayer and CompositingCoordinator by abandoning the
1630         idea of sharing single image backings between layers that might be
1631         backed by identical Image objects. We thus end up trading any memory
1632         consumption benefit in these scenarios for a much simplified
1633         implementation. Overall this area needs more research both in figuring
1634         out whether there's worthy improvements in grouping image backings, as
1635         well as investigating whether it's possible to avoid additional image
1636         rasterization by just leveraging direct pixel data via the
1637         NativeImagePtr object.
1638
1639         * platform/TextureMapper.cmake:
1640         * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: Added.
1641         (Nicosia::ImageBackingTextureMapperImpl::createFactory):
1642         (Nicosia::ImageBackingTextureMapperImpl::flushUpdate):
1643         (Nicosia::ImageBackingTextureMapperImpl::takeUpdate):
1644         * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h: Added.
1645
1646 2018-08-16  Aditya Keerthi  <akeerthi@apple.com>
1647
1648         Support drag-and-drop for input[type=color]
1649         https://bugs.webkit.org/show_bug.cgi?id=188464
1650
1651         Reviewed by Wenson Hsieh.
1652
1653         input[type=color] should support native drag and drop on both macOS and iOS.
1654
1655         Added methods to Pasteboard and PlatformPasteboard to enable colors to be read
1656         from and written to the pasteboard. On macOS, colors are managed through the
1657         NSColorPboardType, whereas on iOS, colors are managed through the
1658         'com.apple.uikit.color' identifier.
1659
1660         DragSourceActionColor was added to the list of DragSourceActions to identify
1661         when a color input is being dragged.
1662
1663         Tests: editing/pasteboard/drag-and-drop-color-input-events.html
1664                editing/pasteboard/drag-and-drop-color-input.html
1665
1666         * page/DragActions.h:
1667         * page/DragController.cpp:
1668         (WebCore::DragController::dragEnteredOrUpdated):
1669         (WebCore::isEnabledColorInput):
1670         (WebCore::DragController::concludeEditDrag):
1671         (WebCore::DragController::canProcessDrag):
1672         (WebCore::DragController::draggableElement const):
1673         (WebCore::DragController::startDrag):
1674         * page/EventHandler.cpp:
1675         (WebCore::EventHandler::dragHysteresisExceeded const):
1676         (WebCore::EventHandler::handleDrag):
1677         * page/EventHandler.h:
1678         * page/mac/DragControllerMac.mm:
1679         (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const):
1680         * platform/DragData.h:
1681         * platform/DragImage.cpp:
1682         (WebCore::DragImage::operator=):
1683         * platform/DragImage.h: Added the visiblePath property to DragImage, in order for
1684         us to be able to clip images in the UITargetedDragPreview on iOS.
1685         * platform/DragItem.h:
1686         (WebCore::DragItem::encode const):
1687         (WebCore::DragItem::decode):
1688         * platform/Pasteboard.h:
1689         * platform/PasteboardStrategy.h:
1690         * platform/PlatformPasteboard.h:
1691         * platform/gtk/DragImageGtk.cpp:
1692         (WebCore::createDragImageForColor):
1693         * platform/gtk/PasteboardGtk.cpp:
1694         (WebCore::Pasteboard::write):
1695         * platform/ios/DragImageIOS.mm:
1696         (WebCore::createDragImageForColor):
1697         * platform/ios/PasteboardIOS.mm:
1698         (WebCore::Pasteboard::write):
1699         * platform/ios/PlatformPasteboardIOS.mm:
1700         (WebCore::PlatformPasteboard::color):
1701         (WebCore::PlatformPasteboard::setColor):
1702         * platform/mac/DragDataMac.mm:
1703         (WebCore::colorPasteboardType):
1704         (WebCore::DragData::containsCompatibleContent const):
1705         * platform/mac/DragImageMac.mm:
1706         (WebCore::createDragImageForColor): Draw a rounded rectangle with a fill color
1707         matching the value of the dragged color input. The rendered image is designed to
1708         mimic the preview shown when dragging an NSColorWell.
1709         * platform/mac/PasteboardMac.mm:
1710         (WebCore::Pasteboard::write):
1711         * platform/mac/PlatformPasteboardMac.mm:
1712         (WebCore::PlatformPasteboard::setColor):
1713         * platform/win/PasteboardWin.cpp:
1714         (WebCore::Pasteboard::write):
1715         * platform/wpe/PasteboardWPE.cpp:
1716         (WebCore::Pasteboard::write):
1717
1718 2018-08-16  Zalan Bujtas  <zalan@apple.com>
1719
1720         [lFC][Floating] Add estimated margin top computation.
1721         https://bugs.webkit.org/show_bug.cgi?id=188619
1722
1723         Reviewed by Antti Koivisto.
1724
1725         In order to figure out whether a box should avoid a float, we need to know the final positions of both (ignore relative positioning for now).
1726         In block formatting context the final position for a normal flow box includes
1727         1. the static position and
1728         2. the corresponding (non)collapsed margins.
1729         Now the vertical margins are computed when all the descendants are finalized, because the margin values might be depending on the height of the box
1730         (and the height might be based on the content).
1731         So when we get to the point where we intersect the box with the float to decide if the box needs to move, we don't yet have the final vertical position.
1732
1733         The idea here is that as long as we don't cross the block formatting context boundary, we should be able to pre-compute the final top margin.
1734         (if this holds true for all the cases, the estimated prefix could be removed and just use marginTop() instead.)
1735
1736         Covered by existing block-only tests.
1737
1738         * layout/blockformatting/BlockFormattingContext.cpp:
1739         (WebCore::Layout::BlockFormattingContext::layout const):
1740         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
1741         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1742         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1743         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1744         (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
1745         * layout/blockformatting/BlockFormattingContext.h:
1746         * layout/blockformatting/BlockMarginCollapse.cpp:
1747         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginTop):
1748         * layout/displaytree/DisplayBox.cpp:
1749         (WebCore::Display::Box::Box):
1750         * layout/displaytree/DisplayBox.h:
1751         (WebCore::Display::Box::setHasValidTop):
1752         (WebCore::Display::Box::setHasValidLeft):
1753         (WebCore::Display::Box::top const):
1754         (WebCore::Display::Box::left const):
1755         (WebCore::Display::Box::topLeft const):
1756         (WebCore::Display::Box::setTopLeft):
1757         (WebCore::Display::Box::setTop):
1758         (WebCore::Display::Box::setLeft):
1759         (WebCore::Display::Box::setVerticalMargin):
1760         (WebCore::Display::Box::setEstimatedMarginTop):
1761         (WebCore::Display::Box::estimatedMarginTop const):
1762
1763 2018-08-16  Zalan Bujtas  <zalan@apple.com>
1764
1765         [LFC][BFC] Display::Box interface should reflect that padding is optional.
1766         https://bugs.webkit.org/show_bug.cgi?id=188630
1767
1768         Reviewed by Antti Koivisto.
1769
1770         Certain type of boxes can't have paddings (see Layout::Box::isPaddingApplicable).
1771
1772         * layout/FormattingContext.cpp:
1773         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1774         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1775         * layout/FormattingContextGeometry.cpp:
1776         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1777         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1778         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1779         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1780         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1781         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1782         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1783         * layout/displaytree/DisplayBox.h:
1784         (WebCore::Display::Box::width const):
1785         (WebCore::Display::Box::height const):
1786         (WebCore::Display::Box::contentBoxTop const):
1787         (WebCore::Display::Box::contentBoxLeft const):
1788         (WebCore::Display::Box::setPadding):
1789         (WebCore::Display::Box::paddingTop const):
1790         (WebCore::Display::Box::paddingLeft const):
1791         (WebCore::Display::Box::paddingBottom const):
1792         (WebCore::Display::Box::paddingRight const):
1793
1794 2018-08-16  Zalan Bujtas  <zalan@apple.com>
1795
1796         [LFC] Add showLayoutTree() that does not require LayoutContext.
1797         https://bugs.webkit.org/show_bug.cgi?id=188631
1798
1799         Reviewed by Antti Koivisto.
1800
1801         * layout/layouttree/LayoutBox.cpp:
1802         (WebCore::Layout::Box::formattingContextRoot const):
1803         (WebCore::Layout::Box::initialContainingBlock const):
1804         * layout/layouttree/LayoutBox.h:
1805         * layout/layouttree/LayoutTreeBuilder.cpp:
1806         (WebCore::Layout::outputLayoutTree):
1807         (WebCore::Layout::showLayoutTree):
1808         (WebCore::Layout::TreeBuilder::showLayoutTree): Deleted.
1809         * layout/layouttree/LayoutTreeBuilder.h:
1810
1811 2018-08-16  Zalan Bujtas  <zalan@apple.com>
1812
1813         [LFC] Tree builder should construct block and inline containers based on the display type.
1814         https://bugs.webkit.org/show_bug.cgi?id=188632
1815
1816         Reviewed by Antti Koivisto.
1817
1818         Inline elements can also construct RenderBlock renderers (inline-bloc etc), so use the display type instead when deciding what type of container to construct.   
1819
1820         * layout/layouttree/LayoutTreeBuilder.cpp:
1821         (WebCore::Layout::TreeBuilder::createSubTree):
1822
1823 2018-08-16  Zalan Bujtas  <zalan@apple.com>
1824
1825         [LFC] Bail out of subtree verification when trees are out of sync.
1826         https://bugs.webkit.org/show_bug.cgi?id=188633
1827
1828         Reviewed by Antti Koivisto.
1829
1830         There's no point of trying to match geometry when subtrees are out of sync.
1831         They get out of sync when the render tree has unsupported boxes (see LayoutTreeBuilder).
1832
1833         * layout/Verification.cpp:
1834         (WebCore::Layout::verifyAndOutputSubtree):
1835
1836 2018-08-16  Antti Koivisto  <antti@apple.com>
1837
1838         Use OptionSet for ActivityState::Flags
1839         https://bugs.webkit.org/show_bug.cgi?id=188554
1840
1841         Reviewed by Brent Fulgham.
1842
1843         More typesafe flags.
1844
1845         * Modules/geolocation/GeolocationController.cpp:
1846         (WebCore::GeolocationController::activityStateDidChange):
1847         * Modules/geolocation/GeolocationController.h:
1848         * html/canvas/WebGLRenderingContextBase.cpp:
1849         (WebCore::WebGLRenderingContextBase::activityStateDidChange):
1850         * html/canvas/WebGLRenderingContextBase.h:
1851         * page/ActivityState.cpp:
1852         (WebCore::operator<<):
1853         (WebCore::activityStateFlagsToString): Deleted.
1854         * page/ActivityState.h:
1855         (WebCore::ActivityState::allFlags):
1856         * page/ActivityStateChangeObserver.h:
1857         * page/FocusController.cpp:
1858         (WebCore::FocusController::FocusController):
1859         (WebCore::FocusController::setFocused):
1860         (WebCore::FocusController::setActivityState):
1861         (WebCore::FocusController::setActive):
1862         * page/FocusController.h:
1863         (WebCore::FocusController::isActive const):
1864         (WebCore::FocusController::isFocused const):
1865         (WebCore::FocusController::contentIsVisible const):
1866         * page/Page.cpp:
1867         (WebCore::pageInitialActivityState):
1868         (WebCore::Page::Page):
1869         (WebCore::Page::setIsInWindow):
1870         (WebCore::Page::updateTimerThrottlingState):
1871         (WebCore::Page::setActivityState):
1872         (WebCore::Page::isVisibleAndActive const):
1873         (WebCore::Page::isWindowActive const):
1874         (WebCore::Page::setIsVisible):
1875         * page/Page.h:
1876         (WebCore::Page::activityState const):
1877         (WebCore::Page::isVisible const):
1878         (WebCore::Page::isInWindow const):
1879         * page/PerformanceMonitor.cpp:
1880         (WebCore::activityStateForCPUSampling):
1881         (WebCore::PerformanceMonitor::activityStateChanged):
1882         * page/PerformanceMonitor.h:
1883         * platform/text/cocoa: Added.
1884
1885 2018-08-15  Ansh Shukla  <ansh_shukla@apple.com>
1886
1887         NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
1888         https://bugs.webkit.org/show_bug.cgi?id=186870
1889         <rdar://problem/41314410>
1890
1891         Reviewed by Alex Christensen.
1892
1893         Add the ProtectionSpaceAuthenticationSchemeOAuth type.
1894
1895         * platform/network/ProtectionSpaceBase.cpp:
1896         (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge
1897         expects a token in return.
1898         * platform/network/ProtectionSpaceBase.h:
1899         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
1900         (WebCore::scheme):
1901         (WebCore::ProtectionSpace::nsSpace const):
1902
1903 2018-08-15  Ben Richards  <benton_richards@apple.com>
1904
1905         We should cache the compiled sandbox profile in a data vault
1906         https://bugs.webkit.org/show_bug.cgi?id=184991
1907
1908         Reviewed by Ryosuke Niwa.
1909
1910         Added functionality to FileHandle so that it can lock a file while open.
1911         Added a function to FileSystem to delete non empty directories.
1912
1913         * platform/FileHandle.cpp:
1914         (WebCore::FileHandle::FileHandle):
1915         (WebCore::FileHandle::open):
1916         (WebCore::FileHandle::close):
1917         * platform/FileHandle.h:
1918         * platform/FileSystem.h:
1919         * platform/cocoa/FileSystemCocoa.mm:
1920         (WebCore::FileSystem::deleteNonEmptyDirectory):
1921
1922 2018-08-15  Ryosuke Niwa  <rniwa@webkit.org>
1923
1924         Can't share an app on AppStore to WeChat due to a release assert
1925         https://bugs.webkit.org/show_bug.cgi?id=188621
1926         <rdar://problem/43343976>
1927
1928         Reviewed by Geoffrey Garen.
1929
1930         Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert
1931         is getting hit by third party applications on iOS in UI process.
1932
1933         * platform/Timer.cpp:
1934         (WebCore::shouldSuppressThreadSafetyCheck): Added a SDK check.
1935
1936 2018-08-15  Christopher Reid  <chris.reid@sony.com>
1937
1938         [Curl] Implement default cookie path handling correctly as outlined in RFC6265.
1939         https://bugs.webkit.org/show_bug.cgi?id=188609
1940
1941         Reviewed by Alex Christensen.
1942
1943         Curl implementation of default cookie path was wrong so that some cookies cannot be accessible.
1944         It should be generated as outlined in: https://tools.ietf.org/html/rfc6265#section-5.1.4
1945
1946         Tests: http/tests/cookies/http-get-cookie-set-in-js.html
1947
1948         * platform/network/curl/CookieJarDB.cpp:
1949         (WebCore::CookieJarDB::setCookie):
1950         * platform/network/curl/CookieUtil.cpp:
1951         (WebCore::CookieUtil::defaultPathForURL):
1952         * platform/network/curl/CookieUtil.h:
1953
1954 2018-08-15  Aditya Keerthi  <akeerthi@apple.com>
1955
1956         [Datalist] Add button to TextFieldInputs with a datalist
1957         https://bugs.webkit.org/show_bug.cgi?id=187741
1958
1959         Reviewed by Tim Horton.
1960
1961         TextFieldInputs that have an associated datalist element should be drawn as
1962         combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox
1963         is not height-resizable. Furthermore, the input should also be able to contain
1964         additional elements, such as the stepper for type=number and the cancel button
1965         for type=search. For these reasons, we draw a button at the end of the input,
1966         mimicking appearance of a combo box.
1967
1968         The list-button -webkit-appearance value was added to display the new button.
1969
1970         Tests: fast/forms/datalist/datalist-searchinput-appearance.html
1971                fast/forms/datalist/datalist-textinput-appearance.html
1972
1973         * Resources/ListButtonArrow.png: Added.
1974         * Resources/ListButtonArrow@2x.png: Added.
1975         * WebCore.xcodeproj/project.pbxproj:
1976         * css/CSSPrimitiveValueMappings.h:
1977         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1978         * css/CSSProperties.json:
1979         * css/CSSValueKeywords.in:
1980         * css/html.css:
1981         (input::-webkit-list-button):
1982         * html/HTMLInputElement.cpp:
1983         (WebCore::HTMLInputElement::dataListButtonElement const):
1984         * html/HTMLInputElement.h:
1985         * html/InputType.h:
1986         (WebCore::InputType::dataListButtonElement const):
1987         * html/TextFieldInputType.cpp:
1988         (WebCore::TextFieldInputType::needsContainer const):
1989         (WebCore::TextFieldInputType::createShadowSubtree):
1990         (WebCore::TextFieldInputType::destroyShadowSubtree):
1991         (WebCore::TextFieldInputType::listAttributeTargetChanged):
1992         (WebCore::TextFieldInputType::dataListButtonElement const):
1993         (WebCore::TextFieldInputType::dataListButtonElementWasClicked):
1994         (WebCore::TextFieldInputType::didCloseSuggestions):
1995         * html/TextFieldInputType.h:
1996         * html/shadow/DataListButtonElement.cpp: Added.
1997         (WebCore::DataListButtonElement::create):
1998         (WebCore::DataListButtonElement::DataListButtonElement):
1999         (WebCore::DataListButtonElement::~DataListButtonElement):
2000         (WebCore::DataListButtonElement::defaultEventHandler):
2001         * html/shadow/DataListButtonElement.h: Added.
2002         * platform/ThemeTypes.h:
2003         * rendering/RenderTheme.cpp:
2004         (WebCore::RenderTheme::adjustStyle):
2005         (WebCore::RenderTheme::adjustListButtonStyle const):
2006         * rendering/RenderTheme.h:
2007         * rendering/RenderThemeMac.h:
2008         * rendering/RenderThemeMac.mm:
2009         (-[WebListButtonCell drawWithFrame:inView:]):
2010         (WebCore::RenderThemeMac::paintListButtonForInput):
2011         (WebCore::RenderThemeMac::adjustListButtonStyle const):
2012         (WebCore::RenderThemeMac::paintTextField):
2013         (WebCore::RenderThemeMac::paintSearchField):
2014         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2015         (WebCore::RenderThemeMac::listButton const):
2016
2017 2018-08-15  Ryan Haddad  <ryanhaddad@apple.com>
2018
2019         Unreviewed, rolling out r234870.
2020
2021         The test introduced with this change is a flaky failure.
2022
2023         Reverted changeset:
2024
2025         "NSURLAuthenticationMethodOAuth challenges are surfaced to
2026         clients in -didReceiveAuthenticationChallenge as
2027         NSURLAuthenticationMethodDefault"
2028         https://bugs.webkit.org/show_bug.cgi?id=186870
2029         https://trac.webkit.org/changeset/234870
2030
2031 2018-08-14  Ryosuke Niwa  <rniwa@webkit.org>
2032
2033         connectedCallback is invoked by the HTML parser after child nodes had been inserted
2034         https://bugs.webkit.org/show_bug.cgi?id=183931
2035         <rdar://problem/38843548>
2036
2037         Reviewed by Alex Christensen.
2038
2039         Invoke the custom element reactions after constructing and inserting a custom element as specifed in step 3.3 of:
2040         https://html.spec.whatwg.org/multipage/parsing.html#insert-a-foreign-element
2041
2042         The bug here was that HTMLConstructionSite::insertCustomElement uses attachLater so that even though the task
2043         to insert the custom element was created, it didn't get executed until after CustomElementReactionStack in
2044         HTMLDocumentParser::runScriptsForPausedTreeBuilder had been popped off of the stack.
2045
2046         Test: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html
2047
2048         * html/parser/HTMLConstructionSite.cpp:
2049         (WebCore::HTMLConstructionSite::insertCustomElement): Fixed the bug by manually executing the scheduled tasks.
2050         This will enqueue any custom element reactions while CustomElementReactionStack in runScriptsForPausedTreeBuilder
2051         is still in the stack.
2052
2053 2018-08-15  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2054
2055         [Curl] Don't send Content-Type header for POST request when body is null.
2056         https://bugs.webkit.org/show_bug.cgi?id=188588
2057
2058         Reviewed by Youenn Fablet.
2059
2060         The Content-Type header was sent by libcurl automatically. Suppress that behavior
2061         when body is null.
2062
2063         Tests: http/tests/xmlhttprequest/methods.html
2064
2065         * platform/network/curl/CurlRequest.cpp:
2066         (WebCore::CurlRequest::setupPOST):
2067
2068 2018-08-15  Alex Christensen  <achristensen@webkit.org>
2069
2070         Remove failing assertion introduced in r234873
2071         https://bugs.webkit.org/show_bug.cgi?id=188581
2072
2073         * contentextensions/ContentExtensionCompiler.cpp:
2074         (WebCore::ContentExtensions::compileRuleList):
2075         The assertion is correct but failing because VectorTraits<String> is incorrect.
2076         I'll re-add it and fix VectorTraits<String> in a separate patch.
2077
2078 2018-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2079
2080         [Attachment SPI] Remove attachment display mode options
2081         https://bugs.webkit.org/show_bug.cgi?id=188596
2082
2083         Reviewed by Dan Bernstein.
2084
2085         Remove the ability to specify an "in-place" or "icon" representation for attachment elements, as well as logic
2086         needed to allow an attachment element to render image or video elements in a shadow root. The requirements that
2087         initially drove this effort are obviated by r227068, which allows Mail to intercept and provide a custom scheme
2088         for images inserted into the document via rich editing operations.
2089
2090         Removed some existing API tests in _WKAttachmentTests that exercised this functionality.
2091
2092         * editing/Editor.cpp:
2093         (WebCore::Editor::insertAttachmentFromFile):
2094         * editing/cocoa/WebContentReaderCocoa.mm:
2095         (WebCore::createFragmentForImageAttachment):
2096         (WebCore::replaceRichContentWithAttachments):
2097         * html/AttachmentTypes.h:
2098         (WebCore::AttachmentDisplayOptions::encode const):
2099         (WebCore::AttachmentDisplayOptions::decode):
2100
2101         Remove logic for encoding the attachment display mode. While this leaves AttachmentDisplayOptions completely
2102         empty, I haven't removed AttachmentDisplayOptions as well in this patch, since it's not clear that we won't be
2103         needing any mechanism for influencing the display of attachment elements inserted via native SPI.
2104
2105         (): Deleted.
2106         * html/HTMLAttachmentElement.cpp:
2107         (WebCore::HTMLAttachmentElement::createElementRenderer):
2108         (WebCore::HTMLAttachmentElement::setFile):
2109         (WebCore::HTMLAttachmentElement::parseAttribute):
2110         (WebCore::HTMLAttachmentElement::invalidateShadowRootChildrenIfNecessary): Deleted.
2111         (WebCore::HTMLAttachmentElement::attachmentRenderer const): Deleted.
2112         (WebCore::HTMLAttachmentElement::updateDisplayMode): Deleted.
2113         (WebCore::HTMLAttachmentElement::ensureInnerImage): Deleted.
2114         (WebCore::HTMLAttachmentElement::ensureInnerVideo): Deleted.
2115         (WebCore::HTMLAttachmentElement::innerImage const): Deleted.
2116         (WebCore::HTMLAttachmentElement::innerVideo const): Deleted.
2117         (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary): Deleted.
2118
2119         Remove logic for building the shadow root to house inline media elements.
2120
2121         * html/HTMLAttachmentElement.h:
2122
2123         The renderer of the attachment element is once again always a `RenderAttachment`, so we can remove
2124         `attachmentRenderer()` altogether and revert to overriding `renderer()` to return a `RenderAttachment*`.
2125
2126         * page/DragController.cpp:
2127         (WebCore::DragController::startDrag):
2128         * rendering/RenderAttachment.h:
2129         (WebCore::HTMLAttachmentElement::renderer const):
2130
2131 2018-08-15  Ali Juma  <ajuma@chromium.org>
2132
2133         [IntersectionObserver] Do not hold a strong reference to the root element
2134         https://bugs.webkit.org/show_bug.cgi?id=188575
2135
2136         Reviewed by Simon Fraser.
2137
2138         Make IntersectionObserver have only a raw pointer to its root element rather than
2139         a reference, so that an otherwise-unreachable root isn't kept alive. Add logic to
2140         to clear this pointer when the root element gets deleted.
2141
2142         Test: intersection-observer/root-element-deleted.html
2143
2144         * dom/Element.cpp:
2145         (WebCore::Element::~Element):
2146         (WebCore::Element::disconnectFromIntersectionObservers):
2147         (WebCore::Element::ensureIntersectionObserverData):
2148         (WebCore::Element::intersectionObserverData):
2149         * dom/Element.h:
2150         * dom/ElementRareData.cpp:
2151         * dom/ElementRareData.h:
2152         (WebCore::ElementRareData::intersectionObserverData):
2153         (WebCore::ElementRareData::setIntersectionObserverData):
2154         * page/IntersectionObserver.cpp:
2155         (WebCore::IntersectionObserver::create):
2156         (WebCore::IntersectionObserver::IntersectionObserver):
2157         (WebCore::IntersectionObserver::~IntersectionObserver):
2158         (WebCore::IntersectionObserver::rootDestroyed):
2159         * page/IntersectionObserver.h:
2160         (WebCore::IntersectionObserver::root const):
2161
2162 2018-08-14  Zan Dobersek  <zdobersek@igalia.com>
2163
2164         [Nicosia] Add Nicosia::BackingStoreTextureMapperImpl
2165         https://bugs.webkit.org/show_bug.cgi?id=188548
2166
2167         Reviewed by Carlos Garcia Campos.
2168
2169         Add the Nicosia::BackingStoreTextureMapperImpl class, the
2170         TextureMapper-specific implementation that will extend the BackingStore
2171         class.
2172
2173         Purpose of this class is to manage content of painted layers. In the
2174         LayerState object that will be exposed to the CoordinatedGraphicsLayer
2175         owner we keep the current and previous TiledBackingStore objects that
2176         will be used for painting. A TileUpdate object is used to store all tile
2177         creation, removal and update changes that happen during the painting
2178         that's performed during the CoordinatedGraphicsLayer flush.
2179
2180         At the point of synchronization under the Nicosia::Scene object, these
2181         updates will be moved over to the pending TileUpdate object that will
2182         then be accessed during the composition step. For that purpose we keep
2183         in the CompositionState member object a reference to the
2184         CoordinatedBackingStore object that will get updated with the tile
2185         creation, removal and update changes (if there are any). The composition
2186         step will use the takeUpdate() method to retrieve all these changes and
2187         apply them outside of the point of synchronization (avoiding this sync
2188         step to take too long).
2189
2190         This will be integrated into the CoordinatedGraphicsLayer class at a
2191         later point, when the switch to the new infrastructure can be made in
2192         one go.
2193
2194         * platform/TextureMapper.cmake:
2195         * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: Added.
2196         (Nicosia::BackingStoreTextureMapperImpl::createFactory):
2197         (Nicosia::BackingStoreTextureMapperImpl::tiledBackingStoreHasPendingTileCreation):
2198         (Nicosia::BackingStoreTextureMapperImpl::createTile):
2199         (Nicosia::BackingStoreTextureMapperImpl::updateTile):
2200         (Nicosia::BackingStoreTextureMapperImpl::removeTile):
2201         (Nicosia::BackingStoreTextureMapperImpl::flushUpdate):
2202         (Nicosia::BackingStoreTextureMapperImpl::takeUpdate):
2203         * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h: Added.
2204
2205 2018-08-14  Fujii Hironori  <Hironori.Fujii@sony.com>
2206
2207         Unreviewed, rolling out r234874 and r234876.
2208
2209         WinCairo port can't compile
2210
2211         Reverted changesets:
2212
2213         "[JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg"
2214         https://bugs.webkit.org/show_bug.cgi?id=188589
2215         https://trac.webkit.org/changeset/234874
2216
2217         "Unreviewed, attempt to fix CLoop build"
2218         https://bugs.webkit.org/show_bug.cgi?id=188589
2219         https://trac.webkit.org/changeset/234876
2220
2221 2018-08-14  Zalan Bujtas  <zalan@apple.com>
2222
2223         [LFC][Floating] Add support for negative clearance.
2224         https://bugs.webkit.org/show_bug.cgi?id=188555
2225
2226         Reviewed by Simon Fraser.
2227
2228         1. Compute clearance to avoid float(s) (border box needs to avoid floats)
2229         2. Reset vertical margins to non-collapsed values.
2230         4. Adjust clearance with the new margins.
2231         5. Take the adjusted clearance and move the box vertically if needed.
2232
2233         Test: fast/block/block-only/margin-collapse-with-clearance.html
2234
2235         * layout/FloatingContext.cpp:
2236         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2237         * layout/FloatingState.cpp:
2238         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
2239         * layout/FormattingContext.cpp:
2240         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
2241         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
2242         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
2243         (WebCore::Layout::FormattingContext::mapToAncestor): Deleted.
2244         * layout/FormattingContext.h:
2245         * layout/LayoutUnits.h:
2246         (WebCore::Layout::Position::Position):
2247         (WebCore::Layout::Position::moveBy):
2248         * layout/displaytree/DisplayBox.h:
2249
2250 2018-08-14  Fujii Hironori  <Hironori.Fujii@sony.com>
2251
2252         Unreviewed, rolling out r234859.
2253
2254         Windows ports can't compile
2255
2256         Reverted changeset:
2257
2258         "Use a Variant instead of a union in CSSSelector"
2259         https://bugs.webkit.org/show_bug.cgi?id=188559
2260         https://trac.webkit.org/changeset/234859
2261
2262 2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2263
2264         [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg
2265         https://bugs.webkit.org/show_bug.cgi?id=188589
2266
2267         Reviewed by Mark Lam.
2268
2269         No behavior change.
2270
2271         * cssjit/FunctionCall.h:
2272         (WebCore::FunctionCall::FunctionCall):
2273         * cssjit/SelectorCompiler.cpp:
2274         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
2275
2276 2018-08-14  Alex Christensen  <achristensen@webkit.org>
2277
2278         isValidCSSSelector is unsafe to be called from a non-main thread
2279         https://bugs.webkit.org/show_bug.cgi?id=188581
2280         <rdar://problem/40517358>
2281
2282         Reviewed by Sam Weinig.
2283
2284         Parsing and determining whether the css selectors are valid is fast enough to do before
2285         hopping to the background thread for the slow NFA/DFA operations and writing to disk.
2286         Doing it on the main thread avoids the thread safety issues in the CSSParser's use of strings.
2287
2288         * contentextensions/ContentExtensionCompiler.cpp:
2289         (WebCore::ContentExtensions::compileRuleList):
2290         * contentextensions/ContentExtensionCompiler.h:
2291         * contentextensions/ContentExtensionParser.cpp:
2292         (WebCore::ContentExtensions::isValidCSSSelector):
2293         (WebCore::ContentExtensions::loadEncodedRules):
2294         (WebCore::ContentExtensions::parseRuleList):
2295         * contentextensions/ContentExtensionParser.h:
2296         * contentextensions/ContentExtensionRule.cpp:
2297         (WebCore::ContentExtensions::Trigger::isolatedCopy const):
2298         (WebCore::ContentExtensions::Action::isolatedCopy const):
2299         * contentextensions/ContentExtensionRule.h:
2300         (WebCore::ContentExtensions::Trigger::isEmpty const):
2301         (WebCore::ContentExtensions::Trigger::operator== const):
2302         (WebCore::ContentExtensions::Action::Action):
2303         (WebCore::ContentExtensions::ContentExtensionRule::isolatedCopy const):
2304         (WebCore::ContentExtensions::ContentExtensionRule::operator== const):
2305         (WebCore::ContentExtensions::vectorIsolatedCopy):
2306
2307 2018-08-14  Ansh Shukla  <ansh_shukla@apple.com>
2308
2309         NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
2310         https://bugs.webkit.org/show_bug.cgi?id=186870
2311         <rdar://problem/41314410>
2312
2313         Reviewed by Alex Christensen.
2314
2315         Add the ProtectionSpaceAuthenticationSchemeOAuth type.
2316
2317         * platform/network/ProtectionSpaceBase.cpp:
2318         (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge
2319         expects a token in return.
2320         * platform/network/ProtectionSpaceBase.h:
2321         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
2322         (WebCore::scheme):
2323         (WebCore::ProtectionSpace::nsSpace const):
2324
2325 2018-08-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2326
2327         [Curl] Implement platform default timeout interval.
2328         https://bugs.webkit.org/show_bug.cgi?id=188565
2329
2330         Reviewed by Alex Christensen.
2331
2332         Curl port didn't implement platform default timeout interval. It treated
2333         zero value for timeout interval as no timeout.
2334
2335         Add platform dependent timeout interval into CurlContext and use that if
2336         timeout and default timeout aren't supplied.
2337
2338         Tests: http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html
2339
2340         * platform/network/curl/CurlContext.cpp:
2341         (WebCore::CurlHandle::setTimeout):
2342         * platform/network/curl/CurlContext.h:
2343         (WebCore::CurlContext::defaultTimeoutInterval const):
2344         * platform/network/curl/CurlRequest.cpp:
2345         (WebCore::CurlRequest::setupTransfer):
2346         (WebCore::CurlRequest::timeoutInterval const):
2347         (WebCore::CurlRequest::didCompleteTransfer):
2348         * platform/network/curl/CurlRequest.h:
2349
2350 2018-08-14  Alex Christensen  <achristensen@webkit.org>
2351
2352         Use a Variant instead of a union in CSSSelector
2353         https://bugs.webkit.org/show_bug.cgi?id=188559
2354
2355         Reviewed by Antti Koivisto.
2356
2357         No change in behavior. This just makes some of the existing problems more obvious and easy to fix.
2358
2359         I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
2360         I only have m_isForPage when assertions are enabled because it's only used for an assertion.
2361         The rest is pretty straightforward translating union syntax to Variant syntax.
2362         I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.
2363
2364         * css/CSSSelector.cpp:
2365         (WebCore::CSSSelector::CSSSelector):
2366         (WebCore::CSSSelector::createRareData):
2367         (WebCore::CSSSelector::setAttribute):
2368         (WebCore::CSSSelector::setArgument):
2369         (WebCore::CSSSelector::setLangArgumentList):
2370         (WebCore::CSSSelector::setSelectorList):
2371         (WebCore::CSSSelector::setNth):
2372         (WebCore::CSSSelector::matchNth const):
2373         (WebCore::CSSSelector::nthA const):
2374         (WebCore::CSSSelector::nthB const):
2375         (WebCore::CSSSelector::RareData::RareData):
2376         * css/CSSSelector.h:
2377         (WebCore::CSSSelector::argument const):
2378         (WebCore::CSSSelector::langArgumentList const):
2379         (WebCore::CSSSelector::selectorList const):
2380         (WebCore::CSSSelector::attribute const):
2381         (WebCore::CSSSelector::attributeCanonicalLocalName const):
2382         (WebCore::CSSSelector::setValue):
2383         (WebCore::CSSSelector::CSSSelector):
2384         (WebCore::CSSSelector::~CSSSelector):
2385         (WebCore::CSSSelector::tagQName const):
2386         (WebCore::CSSSelector::tagLowercaseLocalName const):
2387         (WebCore::CSSSelector::value const):
2388         (WebCore::CSSSelector::serializingValue const):
2389         (WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
2390         (WebCore::CSSSelector::RareData::create): Deleted.
2391         * css/parser/CSSParserImpl.cpp:
2392         (WebCore::CSSParserImpl::parsePageSelector):
2393         * css/parser/CSSParserSelector.h:
2394
2395 2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2396
2397         Unhandled Promise Rejection logging in workers should not emit ErrorEvent to host Worker object
2398         https://bugs.webkit.org/show_bug.cgi?id=188551
2399
2400         Reviewed by Youenn Fablet.
2401
2402         Previously we dispatched ErrorEvent on the Worker object of the host side when the unhandled promise
2403         rejection happens in the worker. But that was wrong. We should not dispatch such an event and we
2404         should just log the error message.
2405
2406         * dom/ScriptExecutionContext.cpp:
2407         (WebCore::ScriptExecutionContext::reportUnhandledPromiseRejection):
2408
2409 2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2410
2411         Unreviewed, follow-up patch for comments
2412         https://bugs.webkit.org/show_bug.cgi?id=188265
2413
2414         * bindings/js/JSExecState.cpp:
2415         (WebCore::JSExecState::didLeaveScriptContext):
2416         Do nothing if `context` is nullptr. It is OK since we do not need to drain microtasks / rejected
2417         promise events after ScriptExecutionContext is gone.
2418
2419         * dom/Microtasks.cpp:
2420         (WebCore::MicrotaskQueue::contextQueue):
2421         Drop unnecessary assertion since it is subsumed by downcast<>.
2422
2423 2018-08-14  Ali Juma  <ajuma@chromium.org>
2424
2425         Follow-up: [IntersectionObserver] Implement rootMargin parsing
2426         https://bugs.webkit.org/show_bug.cgi?id=188469
2427
2428         Address review feedback from Darin Adler.
2429
2430         * page/IntersectionObserver.cpp:
2431         (WebCore::IntersectionObserver::rootMargin const):
2432         Use StringBuilder::appendLiteral instead of ::append to append a literal.
2433
2434 2018-08-14  Antoine Quint  <graouts@apple.com>
2435
2436         [Web Animations] Crash under AnimationTimeline::cancelOrRemoveDeclarativeAnimation()
2437         https://bugs.webkit.org/show_bug.cgi?id=188519
2438         <rdar://problem/43237889>
2439
2440         Reviewed by Eric Carlson.
2441
2442         Test: webanimations/css-animation-effect-target-change-and-animation-removal-crash.html
2443
2444         We would crash because we blindly assumed an animation that was found in the previous style must be in the list of running animations
2445         but in fact it could have been removed already due to the element being removed from the DOM or its effect target changing, etc. So when
2446         we iterate over names of animations that were found in the previous style but not in the new style, we must make a null check to ensure
2447         that there is an animation to remove. Adding an ASSERT() in AnimationTimeline::cancelOrRemoveDeclarativeAnimation() will also clarify the
2448         expectation here.
2449
2450         * animation/AnimationTimeline.cpp:
2451         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
2452         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
2453
2454 2018-08-14  Zalan Bujtas  <zalan@apple.com>
2455
2456         [LFC][Floating] Adjust vertical position with non-collapsed previous sibling margin.
2457         https://bugs.webkit.org/show_bug.cgi?id=188543
2458
2459         Reviewed by Antti Koivisto.
2460
2461         This patch ensures that the inital vertical position for a float is adjusted with the non-collapsed sibling margin.
2462
2463         <div id=A style="margin-bottom: 20px;"></div>
2464         <div id=B style='float: left'></div>
2465         <div id=C style="margin-top: 10px;"></div>
2466
2467         While computing the static position for element "B", we simply call marginBottom() on A.
2468         In the case above, A's margin bottom is collapsed with C's margin top and the value is 0 (C.marginTop() is 20px).
2469         However CSS spec says that in block formatting context, the non-collapsed margin should be used instead to offset the float box.
2470         (The reason why this should not be part of the BlockMarginCollapse::marginBottom() logic is because it can not differentiate the context of
2471         sibling float/sibling inflow. When we margin collapse, we always do it in the context of inflow boxes.)
2472
2473         Test: fast/block/block-only/float-and-siblings-with-margins.html
2474
2475         * layout/blockformatting/BlockFormattingContext.cpp:
2476         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2477         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2478         * layout/blockformatting/BlockFormattingContext.h:
2479
2480 2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2481
2482         Worker should support unhandled promise rejections
2483         https://bugs.webkit.org/show_bug.cgi?id=188265
2484
2485         Reviewed by Darin Adler.
2486
2487         This patch adds PromiseRejectionEvent support in workers.
2488
2489         * Sources.txt:
2490         * WebCore.xcodeproj/project.pbxproj:
2491         * bindings/js/JSDOMGlobalObject.cpp:
2492         (WebCore::JSDOMGlobalObject::promiseRejectionTracker):
2493         Move promiseRejectionTracker handler from JSDOMWindowBase to JSDOMGlobalObject
2494         to share it with WorkerGlobalScope.
2495
2496         * bindings/js/JSDOMGlobalObject.h:
2497         * bindings/js/JSDOMWindowBase.cpp:
2498         (WebCore::JSDOMWindowBase::promiseRejectionTracker): Deleted.
2499         Moved to JSDOMGlobalObject.
2500
2501         * bindings/js/JSDOMWindowBase.h:
2502         * bindings/js/JSExecState.cpp:
2503         (WebCore::JSExecState::didLeaveScriptContext):
2504         PromiseRejectionTracker is driven in workers too.
2505
2506         * bindings/js/JSPromiseRejectionEventCustom.cpp: Added.
2507         (WebCore::JSPromiseRejectionEvent::visitAdditionalChildren):
2508         Marking PromiseRejectionEvent::m_reason.
2509
2510         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2511         Configure promiseRejectionTracker.
2512
2513         * dom/Microtasks.cpp:
2514         (WebCore::MicrotaskQueue::contextQueue):
2515         * dom/Microtasks.h:
2516         * dom/PromiseRejectionEvent.cpp:
2517         (WebCore::PromiseRejectionEvent::PromiseRejectionEvent):
2518         * dom/PromiseRejectionEvent.h:
2519         * dom/PromiseRejectionEvent.idl:
2520         Expose it to worker scope. The custom mark function is required since we start
2521         using JSValueInWrappedObject. And the constructor no longer requires ExecState.
2522
2523         * dom/RejectedPromiseTracker.cpp:
2524         (WebCore::RejectedPromiseTracker::reportUnhandledRejections):
2525         (WebCore::RejectedPromiseTracker::reportRejectionHandled):
2526         Remove state argument for PromiseRejectionEvent::create.
2527
2528         * dom/ScriptExecutionContext.cpp:
2529         (WebCore::ScriptExecutionContext::removeRejectedPromiseTracker):
2530         * dom/ScriptExecutionContext.h:
2531         In worker thread, we should delete PromiseRejectionTracker before destroying VM
2532         because PromiseRejectionTracker's destruction requires VM. If we destroy VM first,
2533         PromiseRejectionTracker's destruction causes crashing. In main thread, we do not
2534         need to handle this case since we never destroy VM.
2535
2536         * workers/WorkerGlobalScope.cpp:
2537         (WebCore::WorkerGlobalScope::prepareForTermination):
2538         (WebCore::WorkerGlobalScope::removeMicrotaskQueue): Deleted.
2539         * workers/WorkerGlobalScope.h:
2540         * workers/WorkerGlobalScope.idl:
2541         Add onunhandledrejection and onrejectionhandled event handler attributes.
2542
2543         * workers/WorkerThread.cpp:
2544         (WebCore::WorkerThread::stop):
2545         We call WorkerGlobalScope::prepareForTermination, which cleans up Worker's objects touching VM.
2546
2547 2018-08-14  Rob Buis  <rbuis@igalia.com>
2548
2549         Fetch: content-length header is being added to the safe-list
2550         https://bugs.webkit.org/show_bug.cgi?id=185473
2551
2552         Reviewed by Youenn Fablet.
2553
2554         Content-Length is a CORS-safelisted reponse header:
2555         https://fetch.spec.whatwg.org/#cors-safelisted-response-header-name
2556
2557         Tests: web-platform-tests/fetch/api/cors/cors-filtering.html
2558                web-platform-tests/fetch/api/cors/cors-filtering-worker.html
2559
2560         * platform/network/HTTPParsers.cpp:
2561         (WebCore::isCrossOriginSafeHeader):
2562
2563 2018-08-13  Zalan Bujtas  <zalan@apple.com>
2564
2565         [LFC][Floating] Do not confuse clear with clearance.
2566         https://bugs.webkit.org/show_bug.cgi?id=188541
2567
2568         Reviewed by Simon Fraser.
2569
2570         clear -> CSS property.
2571         clearance -> the offset required to avoid floats when clear is present.
2572
2573         * layout/FloatingContext.cpp:
2574         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2575         * layout/blockformatting/BlockFormattingContext.cpp:
2576         (WebCore::Layout::BlockFormattingContext::layout const):
2577         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForClear const):
2578         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const): Deleted.
2579         * layout/blockformatting/BlockFormattingContext.h:
2580         * layout/layouttree/LayoutBox.cpp:
2581         (WebCore::Layout::Box::hasClear const):
2582         (WebCore::Layout::Box::hasClearance const): Deleted.
2583         * layout/layouttree/LayoutBox.h:
2584
2585 2018-08-13  James Savage  <james.savage@apple.com>
2586
2587         [iOS] Crash at -[UIViewController _presentViewController:withAnimationController:completion:]
2588         https://bugs.webkit.org/show_bug.cgi?id=188537
2589         <rdar://problem/41400259>
2590
2591         Reviewed by Tim Horton.
2592
2593         * platform/ios/ValidationBubbleIOS.mm:
2594         (WebCore::ValidationBubble::show): Avoid hitting a UIKit exception for
2595         presenting an already presented view controller by turning the scenario
2596         into an early return.
2597
2598 2018-08-13  Alex Christensen  <achristensen@webkit.org>
2599
2600         Make CSSSelectorList a little more sane
2601         https://bugs.webkit.org/show_bug.cgi?id=188539
2602
2603         Reviewed by Simon Fraser.
2604
2605         This patch does four things:
2606         1. Use a UniqueArray<CSSSelector> instead of a raw pointer and manually calling destructors.
2607         2. Use move semantics a little bit better.
2608         3. Add a CSSSelectorList&& to the StyleRule and StyleRulePage because every time we create either
2609         one of those objects we call a setter to give it a CSSSelectorList.  That's what constructor arguments are for.
2610         4. Don't use CSSSelectorList.componentCount(), which iterates all components, to determine if it's empty.
2611         Use first() instead.
2612
2613         * css/CSSPageRule.cpp:
2614         (WebCore::CSSPageRule::setSelectorText):
2615         * css/CSSSelectorList.cpp:
2616         (WebCore::CSSSelectorList::CSSSelectorList):
2617         (WebCore::CSSSelectorList::componentCount const):
2618         (WebCore::CSSSelectorList::listSize const):
2619         (WebCore::CSSSelectorList::operator=):
2620         (WebCore::CSSSelectorList::deleteSelectors): Deleted.
2621         * css/CSSSelectorList.h:
2622         (WebCore::CSSSelectorList::CSSSelectorList):
2623         (WebCore::CSSSelectorList::first const):
2624         (WebCore::CSSSelectorList::indexOfNextSelectorAfter const):
2625         (WebCore::CSSSelectorList::~CSSSelectorList): Deleted.
2626         (WebCore::CSSSelectorList::adoptSelectorArray): Deleted.
2627         (WebCore::CSSSelectorList::hasOneSelector const): Deleted.
2628         * css/CSSStyleRule.cpp:
2629         (WebCore::CSSStyleRule::setSelectorText):
2630         * css/StyleRule.cpp:
2631         (WebCore::StyleRule::StyleRule):
2632         (WebCore::StyleRule::createForSplitting):
2633         (WebCore::StyleRulePage::StyleRulePage):
2634         * css/StyleRule.h:
2635         * css/parser/CSSParserImpl.cpp:
2636         (WebCore::CSSParserImpl::consumePageRule):
2637         (WebCore::CSSParserImpl::consumeStyleRule):
2638         * css/parser/CSSSelectorParser.cpp:
2639         (WebCore::CSSSelectorParser::consumePseudo):
2640
2641 2018-08-13  Ali Juma  <ajuma@chromium.org>
2642
2643         [IntersectionObserver] Validate threshold values
2644         https://bugs.webkit.org/show_bug.cgi?id=188475
2645
2646         Reviewed by Simon Fraser.
2647
2648         Throw an exception if any of an IntersectionObserver's thresholds are outside
2649         the range [0, 1].
2650
2651         Tested by: imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html
2652                    intersection-observer/intersection-observer-interface.html
2653
2654         * page/IntersectionObserver.cpp:
2655         (WebCore::IntersectionObserver::create):
2656         (WebCore::IntersectionObserver::IntersectionObserver):
2657         * page/IntersectionObserver.h:
2658
2659 2018-08-13  Alex Christensen  <achristensen@webkit.org>
2660
2661         Remove unused CSSSelector::parseNth
2662         https://bugs.webkit.org/show_bug.cgi?id=188529
2663
2664         Reviewed by Simon Fraser.
2665
2666         This was conceptually replaced by the call to setNth in CSSSelectorParser::consumePseudo.
2667
2668         * css/CSSSelector.cpp:
2669         (WebCore::CSSSelector::CSSSelector):
2670         (WebCore::CSSSelector::setNth):
2671         (WebCore::CSSSelector::nthA const):
2672         (WebCore::CSSSelector::nthB const):
2673         (WebCore::CSSSelector::parseNth const): Deleted.
2674         (WebCore::CSSSelector::RareData::parseNth): Deleted.
2675         * css/CSSSelector.h:
2676         (WebCore::CSSSelector::CSSSelector):
2677         * css/SelectorChecker.cpp:
2678         (WebCore::SelectorChecker::checkOne const):
2679         * cssjit/SelectorCompiler.cpp:
2680         (WebCore::SelectorCompiler::addNthChildType):
2681
2682 2018-08-13  Alex Christensen  <achristensen@webkit.org>
2683
2684         Remove unused code in CSSParserSelector/CSSSelector
2685         https://bugs.webkit.org/show_bug.cgi?id=188528
2686
2687         Reviewed by Simon Fraser.
2688
2689         * css/CSSSelector.cpp:
2690         * css/CSSSelector.h:
2691         (WebCore::CSSSelector::serializingValue const):
2692         (WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive): Deleted.
2693         * css/parser/CSSParserSelector.h:
2694         (WebCore::CSSParserSelector::setAttributeValueMatchingIsCaseInsensitive): Deleted.
2695
2696 2018-08-13  Alex Christensen  <achristensen@webkit.org>
2697
2698         Modernize CSSSelectorList a little
2699         https://bugs.webkit.org/show_bug.cgi?id=188527
2700
2701         Reviewed by Simon Fraser.
2702
2703         No change in behavior.  Just use make_unique and move semantics a little more.
2704
2705         * css/CSSSelectorList.cpp:
2706         (WebCore::CSSSelectorList::CSSSelectorList):
2707         (WebCore::CSSSelectorList::adoptSelectorVector): Deleted.
2708         * css/CSSSelectorList.h:
2709         * css/StyleRule.h:
2710         * css/parser/CSSParserImpl.cpp:
2711         (WebCore::CSSParserImpl::parsePageSelector):
2712         * css/parser/CSSParserSelector.cpp:
2713         (WebCore::CSSParserSelector::adoptSelectorVector):
2714         * css/parser/CSSParserSelector.h:
2715         * css/parser/CSSSelectorParser.cpp:
2716         (WebCore::CSSSelectorParser::consumeComplexSelectorList):
2717         (WebCore::CSSSelectorParser::consumeCompoundSelectorList):
2718         (WebCore::CSSSelectorParser::consumePseudo):
2719
2720 2018-08-13  Antti Koivisto  <antti@apple.com>
2721
2722         Meaning of OptionSet::contains is unclear when used with OptionSet argument
2723         https://bugs.webkit.org/show_bug.cgi?id=188501
2724
2725         Reviewed by Anders Carlsson.
2726
2727         * dom/DocumentMarkerController.cpp:
2728         (WebCore::DocumentMarkerController::possiblyHasMarkers):
2729         * dom/DocumentMarkerController.h:
2730         (WebCore::DocumentMarkerController::hasMarkers const):
2731         * platform/FileSystem.h:
2732         (WebCore::FileSystem::openAndLockFile):
2733         * rendering/RenderElement.cpp:
2734         (WebCore::RenderElement::selectionColor const):
2735         * rendering/RenderLayer.cpp:
2736         (WebCore::RenderLayer::paintForegroundForFragments):
2737
2738 2018-08-13  Commit Queue  <commit-queue@webkit.org>
2739
2740         Unreviewed, rolling out r234747.
2741         https://bugs.webkit.org/show_bug.cgi?id=188524
2742
2743         plugin processes crash on launch (Requested by smfr on
2744         #webkit).
2745
2746         Reverted changeset:
2747
2748         "We should cache the compiled sandbox profile in a data vault"
2749         https://bugs.webkit.org/show_bug.cgi?id=184991
2750         https://trac.webkit.org/changeset/234747
2751
2752 2018-08-13  Wenson Hsieh  <wenson_hsieh@apple.com>
2753
2754         [iOS] Dragging a non-editable text selection into a plain text input inserts HTML markup
2755         https://bugs.webkit.org/show_bug.cgi?id=188485
2756         <rdar://problem/43168784>
2757
2758         Reviewed by Tim Horton.
2759
2760         Before r223678, -typeIdentifiersToLoadForRegisteredTypeIdentifiers:, which is responsible for determining which
2761         type identifiers to load upon performing a drop, returned the following when dropping a rich text selection onto
2762         a textarea:
2763
2764             "public.plain-text",
2765             "public.html"
2766
2767         After r223678, we now propagate a custom pasteboard data type when dragging, and the same list now looks like:
2768
2769             "com.apple.WebKit.custom-pasteboard-data",
2770             "public.html",
2771             "public.plain-text"
2772
2773         Subsequently, logic in `-_preLoadedDataConformingToType:…` (responsible for mapping a requested type identifier
2774         to data that has been loaded from an item provider) iterates through the aforementioned list of type identifiers
2775         and selects the data of the first type identifier in the list that conforms to the requested type identifier.
2776         However, this list of type identifiers is currently the result of `-[NSSet allObjects]`, which means that the
2777         type identifiers in the list are in no particular order!
2778
2779         As such, this particular use case only worked by accident prior to r223678, and after that change, this latent
2780         bug was surfaced. The patch here makes two adjustments to pasteboard handling on iOS to fix the bug.
2781
2782         Test: DragAndDropTests.NonEditableTextSelectionToTextarea
2783
2784         * platform/ios/PasteboardIOS.mm:
2785         (WebCore::Pasteboard::read):
2786
2787         When reading plain text from the pasteboard, give "public.plain-text" priority over "public.text". This ensures
2788         that we don't end up reading markup as "plain text" when there's already more relevant plain text data present
2789         in the pasteboard.
2790
2791         * platform/ios/WebItemProviderPasteboard.mm:
2792         (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentifiers:]):
2793
2794         Refactor existing logic to enforce a consistent ordering of type identifiers to load. First, we use
2795         NSMutableOrderedSet instead of just an NSMutableSet to store type identifiers we've added. Secondly, move all
2796         logic to insert type identifiers into this set to the end of the method, where we iterate over all of the type
2797         identifiers in order and add each type identifier to the set if needed. This ensures that the order of resulting
2798         types is from highest to lowest fidelity.
2799
2800         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
2801         (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]): Deleted.
2802
2803         Fix a typo in the method name.
2804
2805 2018-08-13  Alex Christensen  <achristensen@webkit.org>
2806
2807         Use a 1-byte enum class for TextDirection
2808         https://bugs.webkit.org/show_bug.cgi?id=188350
2809
2810         Reviewed by Simon Fraser.
2811
2812         * Modules/notifications/Notification.h:
2813         * css/CSSPrimitiveValueMappings.h:
2814         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2815         (WebCore::CSSPrimitiveValue::operator TextDirection const):
2816         * css/ElementRuleCollector.cpp:
2817         (WebCore::ElementRuleCollector::matchAllRules):
2818         * dom/Document.cpp:
2819         (WebCore::Document::updateTitleFromTitleElement):
2820         (WebCore::Document::setTitle):
2821         * dom/Position.cpp:
2822         (WebCore::Position::primaryDirection const):
2823         * dom/Range.cpp:
2824         (WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const):
2825         * editing/Editing.cpp:
2826         (WebCore::directionOfEnclosingBlock):
2827         * editing/Editor.cpp:
2828         (WebCore::Editor::baseWritingDirectionForSelectionStart const):
2829         * editing/FrameSelection.cpp:
2830         (WebCore::FrameSelection::willBeModified):
2831         (WebCore::FrameSelection::modifyExtendingRight):
2832         (WebCore::FrameSelection::modifyExtendingForward):
2833         (WebCore::FrameSelection::modifyMovingRight):
2834         (WebCore::FrameSelection::modifyExtendingLeft):
2835         (WebCore::FrameSelection::modifyExtendingBackward):
2836         (WebCore::FrameSelection::modifyMovingLeft):
2837         (WebCore::FrameSelection::textSelectionIntent):
2838         (WebCore::FrameSelection::modify):
2839         * editing/VisiblePosition.cpp:
2840         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
2841         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
2842         * editing/VisibleUnits.cpp:
2843         (WebCore::visualWordPosition):
2844         (WebCore::leftWordPosition):
2845         (WebCore::rightWordPosition):
2846         (WebCore::leftBoundaryOfLine):
2847         (WebCore::rightBoundaryOfLine):
2848         * html/HTMLElement.cpp:
2849         (WebCore::HTMLElement::directionalityIfhasDirAutoAttribute const):
2850         (WebCore::HTMLElement::directionality const):
2851         * html/HTMLInputElement.cpp:
2852         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
2853         * html/HTMLTextFormControlElement.cpp:
2854         (WebCore::HTMLTextFormControlElement::directionForFormData const):
2855         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
2856         * html/HTMLTitleElement.cpp:
2857         (WebCore::HTMLTitleElement::computedTextWithDirection):
2858         * html/canvas/CanvasRenderingContext2D.cpp:
2859         (WebCore::CanvasRenderingContext2D::toTextDirection const):
2860         (WebCore::CanvasRenderingContext2D::direction const):
2861         (WebCore::CanvasRenderingContext2D::textOffset):
2862         * html/shadow/SliderThumbElement.cpp:
2863         (WebCore::RenderSliderContainer::layout):
2864         * html/shadow/TextControlInnerElements.cpp:
2865         (WebCore::TextControlInnerElement::resolveCustomStyle):
2866         * page/Chrome.cpp:
2867         (WebCore::Chrome::setToolTip):
2868         * page/FrameView.cpp:
2869         (WebCore::paginationModeForRenderStyle):
2870         * page/Settings.yaml:
2871         * platform/RectEdges.h:
2872         (WebCore::RectEdges::start):
2873         (WebCore::RectEdges::end):
2874         (WebCore::RectEdges::start const):
2875         (WebCore::RectEdges::end const):
2876         (WebCore::RectEdges::setStart):
2877         (WebCore::RectEdges::setEnd):
2878         * platform/UserInterfaceLayoutDirection.h:
2879         * platform/graphics/ComplexTextController.cpp:
2880         (WebCore::ComplexTextController::computeExpansionOpportunity):
2881         * platform/graphics/FontCascade.cpp:
2882         (WebCore::FontCascade::expansionOpportunityCountInternal):
2883         (WebCore::FontCascade::leadingExpansionOpportunity):
2884         (WebCore::FontCascade::trailingExpansionOpportunity):
2885         * platform/graphics/GraphicsContext.cpp:
2886         (WebCore::GraphicsContext::drawBidiText):
2887         * platform/graphics/TextRun.h:
2888         (WebCore::TextRun::TextRun):
2889         (WebCore::TextRun::rtl const):
2890         (WebCore::TextRun::ltr const):
2891         (WebCore::TextRun::setDirection):
2892         * platform/graphics/WidthIterator.cpp:
2893         (WebCore::WidthIterator::WidthIterator):
2894         * platform/ios/SelectionRect.cpp:
2895         (WebCore::SelectionRect::SelectionRect):
2896         * platform/text/BidiResolver.h:
2897         (WebCore::BidiStatus::BidiStatus):
2898         * platform/text/StringWithDirection.h:
2899         * platform/text/WritingMode.h:
2900         (WebCore::isLeftToRightDirection):
2901         (WebCore::isVerticalWritingMode):
2902         (WebCore::isFlippedWritingMode):
2903         (WebCore::mapLogicalSideToPhysicalSide):
2904         * rendering/HitTestResult.cpp:
2905         (WebCore::HitTestResult::spellingToolTip const):
2906         (WebCore::HitTestResult::title const):
2907         (WebCore::HitTestResult::innerTextIfTruncated const):
2908         * rendering/InlineBox.h:
2909         (WebCore::InlineBox::direction const):
2910         (WebCore::InlineBox::isLeftToRightDirection const):
2911         * rendering/InlineFlowBox.cpp:
2912         (WebCore::InlineFlowBox::paintFillLayer):
2913         * rendering/InlineIterator.h:
2914         (WebCore::embedCharFromDirection):
2915         * rendering/InlineTextBox.cpp:
2916         (WebCore::InlineTextBox::paint):
2917         (WebCore::mirrorRTLSegment):
2918         * rendering/RenderBlock.cpp:
2919         (WebCore::RenderBlock::constructTextRun):
2920         * rendering/RenderBlockLineLayout.cpp:
2921         (WebCore::determineDirectionality):
2922         (WebCore::RenderBlockFlow::textAlignmentForLine const):
2923         (WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
2924         (WebCore::RenderBlockFlow::handleTrailingSpaces):
2925         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
2926         * rendering/RenderBox.cpp:
2927         (WebCore::computeInlineStaticDistance):
2928         (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
2929         (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
2930         * rendering/RenderDeprecatedFlexibleBox.cpp:
2931         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2932         * rendering/RenderFragmentedFlow.cpp:
2933         (WebCore::RenderFragmentedFlow::updateLogicalWidth):
2934         (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
2935         * rendering/RenderLayerModelObject.cpp:
2936         (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const):
2937         * rendering/RenderMarquee.cpp:
2938         (WebCore::RenderMarquee::direction const):
2939         * rendering/RenderMenuList.cpp:
2940         (WebCore::RenderMenuList::adjustInnerStyle):
2941         (RenderMenuList::clientPaddingLeft const):
2942         (RenderMenuList::clientPaddingRight const):
2943         * rendering/RenderThemeIOS.mm:
2944         (WebCore::RenderThemeIOS::popupInternalPaddingBox const):
2945         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
2946         * rendering/RenderThemeMac.mm:
2947         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
2948         (WebCore::RenderThemeMac::popupInternalPaddingBox const):
2949         (WebCore::RenderThemeMac::setPopupButtonCellState):
2950         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2951         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
2952         * rendering/mathml/RenderMathMLBlock.cpp:
2953         (WebCore::RenderMathMLBlock::mirrorIfNeeded const):
2954         * rendering/mathml/RenderMathMLOperator.cpp:
2955         (WebCore::RenderMathMLOperator::layoutBlock):
2956         * rendering/style/RenderStyle.cpp:
2957         (WebCore::RenderStyle::RenderStyle):
2958         * rendering/style/RenderStyle.h:
2959         (WebCore::RenderStyle::isLeftToRightDirection const):
2960         (WebCore::RenderStyle::initialDirection):
2961         * testing/InternalSettings.cpp:
2962         (WebCore::InternalSettings::systemLayoutDirection):
2963         (WebCore::InternalSettings::setSystemLayoutDirection):
2964         * testing/Internals.h:
2965
2966 2018-08-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2967
2968         Followup (r234683): Element::getAttribute() should return the first non-null attribute value
2969         https://bugs.webkit.org/show_bug.cgi?id=188419
2970
2971         Reviewed by Darin Adler.
2972
2973         Element::getAttribute() should return the first non-null attribute value
2974         since an empty string is a legitimate attribute value.
2975
2976         Test: svg/custom/href-svg-namespace-empty.html
2977
2978         * dom/Element.h:
2979         (WebCore::Element::getAttribute const):
2980
2981 2018-08-13  Michael Catanzaro  <mcatanzaro@igalia.com>
2982
2983         Unreviewed, since -Wsign-compare warnings in URL.cpp
2984
2985         This regressed in r233798 when m_schemeEnd changed to a bitfield. The code looks safe to
2986         me, so just silence the warnings with casts.
2987
2988         * platform/URL.cpp:
2989         (WebCore::URL::setHost):
2990         (WebCore::URL::setHostAndPort):
2991         (WebCore::URL::setUser):
2992         (WebCore::URL::setPass):
2993
2994 2018-08-13  Antti Koivisto  <antti@apple.com>
2995
2996         Use OptionSet more in editing code
2997         https://bugs.webkit.org/show_bug.cgi?id=188500
2998
2999         Reviewed by Wenson Hsieh.
3000
3001         Typesafe flags.
3002
3003         * editing/CompositeEditCommand.cpp:
3004         (WebCore::CompositeEditCommand::moveParagraphs):
3005         * editing/Editor.cpp:
3006         (WebCore::TemporarySelectionChange::TemporarySelectionChange):
3007         (WebCore::Editor::replaceSelectionWithFragment):
3008         (WebCore::Editor::appliedEditing):
3009         (WebCore::Editor::selectComposition):
3010         (WebCore::Editor::changeSelectionAfterCommand):
3011         (WebCore::Editor::respondToChangedSelection):
3012         * editing/Editor.h:
3013         (WebCore::TemporarySelectionChange::TemporarySelectionChange):
3014         * editing/FrameSelection.cpp:
3015         (WebCore::FrameSelection::moveWithoutValidationTo):
3016         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
3017         (WebCore::FrameSelection::setSelection):
3018         (WebCore::FrameSelection::setSelectedRange):
3019         * editing/FrameSelection.h:
3020         (WebCore::FrameSelection::defaultSetSelectionOptions):
3021         * editing/MoveSelectionCommand.cpp:
3022         (WebCore::MoveSelectionCommand::doApply):
3023         * editing/ReplaceSelectionCommand.cpp:
3024         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
3025         * editing/ReplaceSelectionCommand.h:
3026         (WebCore::ReplaceSelectionCommand::create):
3027         * editing/SetSelectionCommand.cpp:
3028         (WebCore::SetSelectionCommand::SetSelectionCommand):
3029         * editing/SetSelectionCommand.h:
3030         (WebCore::SetSelectionCommand::create):
3031         * page/ContextMenuController.cpp:
3032         (WebCore::ContextMenuController::contextMenuItemSelected):
3033         * page/DragController.cpp:
3034         (WebCore::DragController::concludeEditDrag):
3035         * page/TextIndicator.cpp:
3036         (WebCore::TextIndicator::createWithRange):
3037
3038 2018-08-13  Zalan Bujtas  <zalan@apple.com>
3039
3040         [LFC][Floating] Add basic clearance support
3041         https://bugs.webkit.org/show_bug.cgi?id=188492
3042
3043         Reviewed by Antti Koivisto.
3044
3045         Adjust final position of a block level box with clearance when float is present.
3046
3047         Test: fast/block/block-only/floating-left-and-right-with-clearance.html
3048
3049         * layout/FloatingContext.cpp:
3050         (WebCore::Layout::FloatingContext::positionForFloat const):
3051         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3052         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
3053         (WebCore::Layout::FloatingContext::toContainingBlock const):
3054         (WebCore::Layout::FloatingContext::computePosition const): Deleted.
3055         * layout/FloatingContext.h:
3056         * layout/FloatingState.cpp:
3057         (WebCore::Layout::FloatingState::bottom const):
3058         * layout/FloatingState.h:
3059         (WebCore::Layout::FloatingState::leftBottom const):
3060         (WebCore::Layout::FloatingState::rightBottom const):
3061         (WebCore::Layout::FloatingState::bottom const):
3062         * layout/Verification.cpp:
3063         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
3064         * layout/blockformatting/BlockFormattingContext.cpp:
3065         (WebCore::Layout::BlockFormattingContext::layout const):
3066         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
3067         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const):
3068         * layout/blockformatting/BlockFormattingContext.h:
3069         * layout/layouttree/LayoutBox.cpp:
3070         (WebCore::Layout::Box::hasClearance const):
3071         * layout/layouttree/LayoutBox.h:
3072
3073 2018-08-13  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3074
3075         Expose CloseEvent and CustomEvent to workers
3076         https://bugs.webkit.org/show_bug.cgi?id=188493
3077
3078         Reviewed by Sam Weinig.
3079
3080         This patch exposes CloseEvent and CustomEvent to workers.
3081         It is OK since they do not depend on things in the main thread.
3082         For example, we cannot expose FormData right now since it depends
3083         on Page.
3084
3085         We do not expose PromiseRejectionEvent in this patch since it will
3086         be done in [1].
3087
3088         [1]: https://bugs.webkit.org/show_bug.cgi?id=188265
3089
3090         * Modules/websockets/CloseEvent.idl:
3091         * dom/CustomEvent.idl:
3092
3093 2018-08-13  Oriol Brufau  <obrufau@igalia.com>
3094
3095         [css-logical] Implement flow-relative margin, padding, border and sizing properties
3096         https://bugs.webkit.org/show_bug.cgi?id=188386
3097
3098         Reviewed by Manuel Rego Casasnovas.
3099
3100         These properties provide the author with the ability to control margins
3101         through logical, rather than physical, direction and dimension mappings.
3102
3103         Only longhand properties and border shorthands for specific sides are
3104         implemented as part of this patch.
3105
3106         The existing prefixed properties become aliases of the new ones.
3107
3108         The change in WebCore::isLayoutDependent fixes an existing issue that
3109         made getComputedStyle provide an old value for -webkit-logical-height
3110         and -webkit-logical-height (see https://crbug.com/849855).
3111
3112         Tests: imported/w3c/web-platform-tests/css/css-logical/animation-001.html
3113                imported/w3c/web-platform-tests/css/css-logical/animation-002.html
3114                imported/w3c/web-platform-tests/css/css-logical/animation-003.tentative.html
3115                imported/w3c/web-platform-tests/css/css-logical/cascading-001.html
3116                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
3117                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
3118                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
3119                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
3120                imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
3121                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
3122                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
3123                imported/w3c/web-platform-tests/css/css-logical/logical-box-size.html
3124                imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size-vlr.html
3125                imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size.html
3126                imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size-vlr.html
3127                imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size.html
3128                imported/w3c/web-platform-tests/css/css-logical/logicalprops-quirklength.html
3129
3130         * css/CSSComputedStyleDeclaration.cpp:
3131         (WebCore::isLayoutDependent):
3132         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3133         * css/CSSProperties.json:
3134         * css/CSSProperty.cpp:
3135         (WebCore::CSSProperty::resolveDirectionAwareProperty):
3136         (WebCore::CSSProperty::isDirectionAwareProperty):
3137         * css/StyleProperties.cpp:
3138         (WebCore::StyleProperties::getPropertyValue const):
3139         * css/parser/CSSParserFastPaths.cpp:
3140         (WebCore::isSimpleLengthPropertyID):
3141         (WebCore::isColorPropertyID):
3142         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3143         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3144         * css/parser/CSSPropertyParser.cpp:
3145         (WebCore::CSSPropertyParser::parseSingleValue):
3146         (WebCore::CSSPropertyParser::parseShorthand):
3147         * html/HTMLTableElement.cpp:
3148         (WebCore::HTMLTableElement::collectStyleForPresentationAttribute):
3149         * rendering/RenderTableCell.cpp:
3150         (WebCore::RenderTableCell::computeCollapsedStartBorder const):
3151         (WebCore::RenderTableCell::computeCollapsedEndBorder const):
3152         (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
3153         (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
3154
3155 2018-08-12  Sihui Liu  <sihui_liu@apple.com>
3156
3157         CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient(WebCore::IDBServer::UniqueIDBDatabaseConnection&)
3158         https://bugs.webkit.org/show_bug.cgi?id=188474
3159
3160         Reviewed by Chris Dumez.
3161
3162         UniqueIDBDatabaseConnection is refcounted by UniqueIDBDatabaseTransaction and it refcounts
3163         UniqueIDBDatabaseTransaction. This cycle could make UniqueIDBDatabaseConnection outlives
3164         UniqueIDBDatabase, so its reference to UniqueIDBDatabase may be stale. Calling a function
3165         on a stale object is probably the reason of recent various storage process crashes in
3166         indexedDB.
3167
3168         This patch makes m_database a WeakPtr and adds assertions that could help us debug the
3169         crashes.
3170
3171         * Modules/indexeddb/server/IDBServer.cpp:
3172         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
3173         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
3174         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3175         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
3176         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
3177         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3178         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
3179         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
3180         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
3181         (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
3182         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
3183         (WebCore::IDBServer::UniqueIDBDatabaseConnection::confirmDidCloseFromServer):
3184         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
3185         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
3186         (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
3187         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
3188         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
3189         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
3190         (WebCore::IDBServer::UniqueIDBDatabaseConnection::database):
3191         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3192         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
3193         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
3194         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
3195         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
3196         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
3197         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
3198         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
3199         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
3200         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
3201         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
3202         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
3203         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
3204         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
3205         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
3206         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
3207         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
3208         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
3209         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
3210         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
3211         * Modules/indexeddb/shared/IDBResultData.cpp:
3212         (WebCore::IDBResultData::openDatabaseSuccess):
3213         (WebCore::IDBResultData::openDatabaseUpgradeNeeded):
3214
3215 2018-08-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3216
3217         Break reference cycle in ErrorEvent by using JSValueInWrappedObject
3218         https://bugs.webkit.org/show_bug.cgi?id=188491
3219
3220         Reviewed by Darin Adler.
3221
3222         ErrorEvent should not use Strong<Unkonwn> to hold error JSValue. This patch integrates
3223         JSValueInWrappedObject into ErrorEvent.
3224
3225         * Modules/webvr/VRDisplayEvent.h:
3226         Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build.
3227
3228         * Sources.txt:
3229         * WebCore.xcodeproj/project.pbxproj:
3230         * bindings/js/JSErrorEventCustom.cpp: Copied from Source/WebCore/Modules/webvr/VRDisplayEvent.h.
3231         (WebCore::JSErrorEvent::visitAdditionalChildren):
3232         Add custom mark function for JSValueInWrappedObject.
3233
3234         * bindings/js/JSEventListener.h:
3235         * bindings/js/WindowProxy.cpp:
3236         Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build.
3237
3238         * dom/ErrorEvent.cpp:
3239         (WebCore::ErrorEvent::ErrorEvent):
3240         (WebCore::ErrorEvent::error):
3241         (WebCore::ErrorEvent::trySerializeError):
3242         Align the implementation to PushStateEvent::trySerializeState.
3243
3244         * dom/ErrorEvent.h:
3245         * dom/ErrorEvent.idl:
3246
3247 2018-08-12  Aditya Keerthi  <akeerthi@apple.com>
3248
3249         [macOS] Color wells should appear pressed when presenting a color picker
3250         https://bugs.webkit.org/show_bug.cgi?id=188477
3251
3252         Reviewed by Tim Horton.
3253
3254         Currently, when clicking on a color well, the color well loses its pressed
3255         appearance once the mouse is lifted. Because of this behavior, the color well
3256         does not appear to be active when the color picker is displayed.
3257
3258         Added the color-well -webkit-appearance value to control the drawing of the color
3259         well separate from other buttons. Also added a new ControlState, named
3260         PresentingState. A control can be in this state whenever it is presenting some
3261         attached view. In the case of the color well this is the color picker. The
3262         Information as to whether a form control is in the presenting state comes from
3263         isPresentingAttachedView() in HTMLInputElement.
3264
3265         * css/CSSPrimitiveValueMappings.h:
3266         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3267         * css/CSSProperties.json:
3268         * css/CSSValueKeywords.in:
3269         * css/html.css:
3270         (input[type="color"]::-webkit-color-swatch):
3271         * html/ColorInputType.cpp:
3272         (WebCore::ColorInputType::isPresentingAttachedView const):
3273         (WebCore::ColorInputType::elementDidBlur):
3274         (WebCore::ColorInputType::didEndChooser):
3275         * html/ColorInputType.h:
3276         * html/HTMLInputElement.cpp:
3277         (WebCore::HTMLInputElement::isPresentingAttachedView const):
3278         * html/HTMLInputElement.h:
3279         * html/InputType.cpp:
3280         (WebCore::InputType::isPresentingAttachedView const):
3281         * html/InputType.h:
3282         * platform/ControlStates.h:
3283         * platform/ThemeTypes.h:
3284         * platform/mac/ThemeMac.mm:
3285         (WebCore::updateStates):
3286         (WebCore::setUpButtonCell):
3287         (WebCore::paintColorWell):
3288         (WebCore::ThemeMac::minimumControlSize const):
3289         (WebCore::ThemeMac::controlBorder const):
3290         (WebCore::ThemeMac::paint):
3291         * rendering/RenderTheme.cpp:
3292         (WebCore::RenderTheme::adjustStyle):
3293         (WebCore::RenderTheme::paint):
3294         (WebCore::RenderTheme::paintBorderOnly):
3295         (WebCore::RenderTheme::paintDecorations):
3296         (WebCore::RenderTheme::isControlStyled const):
3297         (WebCore::RenderTheme::extractControlStatesForRenderer const):
3298         (WebCore::RenderTheme::isPresenting const):
3299         * rendering/RenderTheme.h:
3300         * rendering/RenderThemeMac.mm:
3301         (WebCore::RenderThemeMac::adjustRepaintRect):
3302
3303 2018-08-12  Zalan Bujtas  <zalan@apple.com>
3304
3305         [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent.
3306         https://bugs.webkit.org/show_bug.cgi?id=188487
3307
3308         Reviewed by Antti Koivisto.
3309
3310         Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin.html
3311
3312         * layout/blockformatting/BlockMarginCollapse.cpp:
3313         (WebCore::Layout::isMarginTopCollapsedWithParent):
3314         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
3315
3316 2018-08-10  Antti Koivisto  <antti@apple.com>
3317
3318         Use OptionSet for various RenderLayer flags
3319         https://bugs.webkit.org/show_bug.cgi?id=188472
3320         <rdar://problem/43153059>
3321
3322         Followup, fix some mistakes.
3323
3324         * rendering/RenderLayer.cpp:
3325         (WebCore::RenderLayer::calculateClipRects const):
3326         * rendering/RenderLayerBacking.cpp:
3327         (WebCore::RenderLayerBacking::~RenderLayerBacking):
3328
3329 2018-08-10  Ryosuke Niwa  <rniwa@webkit.org>
3330
3331         [macOS] Multiple third party apps crash due to the thread safety check in TimerBase::setNextFireTime
3332         https://bugs.webkit.org/show_bug.cgi?id=188480
3333
3334         Reviewed by Simon Fraser.
3335
3336         Suppress the release assert in WebKit1 on macOS (isInWebProcess is always true in non-Cocoa platforms).
3337
3338         In the future, we should consider throwing Objective-C exceptions when third party apps call WebKit1
3339         or WebKit2 APIs in non-main threads.
3340
3341         * platform/Timer.cpp:
3342         (WebCore::shouldSuppressThreadSafetyCheck): Extracted out of ~TimerBase and setNextFireTime.
3343         (WebCore::TimerBase::~TimerBase):
3344         (WebCore::TimerBase::setNextFireTime):
3345
3346 2018-08-10  Daniel Bates  <dabates@apple.com>
3347
3348         Cleanup: Remove unnecessary code to resume animations from CachedFrameBase::restore()
3349         https://bugs.webkit.org/show_bug.cgi?id=188459
3350
3351         Reviewed by Chris Dumez.
3352
3353         It is unnessary for CachedFrameBase::restore() to explicitly resume animations on the
3354         document as it calls Document::resume(), which already does this.
3355
3356         No functionality changed. So, no new tests.
3357
3358         * history/CachedFrame.cpp:
3359         (WebCore::CachedFrameBase::restore):
3360
3361 2018-08-10  Antti Koivisto  <antti@apple.com>
3362
3363         Use OptionSet for various RenderLayer flags
3364         https://bugs.webkit.org/show_bug.cgi?id=188472
3365
3366         Reviewed by Simon Fraser.
3367
3368         Typesafe flags.
3369
3370         * html/shadow/MediaControlElements.cpp:
3371         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
3372         * page/FrameView.cpp:
3373         (WebCore::updateLayerPositionFlags):
3374         (WebCore::FrameView::paintContents):
3375         * rendering/RenderLayer.cpp:
3376         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
3377         (WebCore::RenderLayer::updateLayerPositions):
3378         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
3379         (WebCore::RenderLayer::paint):
3380         (WebCore::paintForFixedRootBackground):
3381         (WebCore::RenderLayer::paintLayer):
3382         (WebCore::RenderLayer::paintLayerContentsAndReflection):
3383         (WebCore::RenderLayer::filterPainter const):
3384         (WebCore::RenderLayer::hasFilterThatIsPainting const):
3385         (WebCore::RenderLayer::setupFilters):
3386         (WebCore::RenderLayer::paintLayerContents):
3387         (RenderLayer::paintLayerByApplyingTransform):
3388         (RenderLayer::paintList):
3389         (RenderLayer::updatePaintingInfoForFragments):
3390         (RenderLayer::paintTransformedLayerIntoFragments):
3391         (RenderLayer::calculateClipRects const):
3392         (WebCore::RenderLayer::paintLayerByApplyingTransform): Deleted.
3393         (WebCore::RenderLayer::paintList): Deleted.
3394         (WebCore::RenderLayer::enclosingPaginationLayerInSubtree const): Deleted.
3395         (WebCore::RenderLayer::collectFragments): Deleted.
3396         (WebCore::RenderLayer::updatePaintingInfoForFragments): Deleted.
3397         (WebCore::RenderLayer::paintTransformedLayerIntoFragments): Deleted.
3398         (WebCore::RenderLayer::paintBackgroundForFragments): Deleted.
3399         (WebCore::RenderLayer::paintForegroundForFragments): Deleted.
3400         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): Deleted.
3401         (WebCore::RenderLayer::paintOutlineForFragments): Deleted.
3402         (WebCore::RenderLayer::paintMaskForFragments): Deleted.
3403         (WebCore::RenderLayer::paintChildClippingMaskForFragments): Deleted.
3404         (WebCore::RenderLayer::paintOverflowControlsForFragments): Deleted.
3405         (WebCore::RenderLayer::hitTest): Deleted.
3406         (WebCore::RenderLayer::enclosingElement const): Deleted.
3407         (WebCore::RenderLayer::enclosingFragmentedFlowAncestor const): Deleted.
3408         (WebCore::computeZOffset): Deleted.
3409         (WebCore::RenderLayer::createLocalTransformState const): Deleted.
3410         (WebCore::isHitCandidate): Deleted.
3411         (WebCore::RenderLayer::hitTestLayer): Deleted.
3412         (WebCore::RenderLayer::hitTestContentsForFragments const): Deleted.
3413         (WebCore::RenderLayer::hitTestResizerInFragments const): Deleted.
3414         (WebCore::RenderLayer::hitTestTransformedLayerInFragments): Deleted.
3415         (WebCore::RenderLayer::hitTestLayerByApplyingTransform): Deleted.
3416         (WebCore::RenderLayer::hitTestContents const): Deleted.
3417         (WebCore::RenderLayer::hitTestList): Deleted.
3418         (WebCore::RenderLayer::updateClipRects): Deleted.
3419         (WebCore::RenderLayer::clipRects const): Deleted.
3420         (WebCore::RenderLayer::calculateClipRects const): Deleted.
3421         (WebCore::showLayerTree): Deleted.
3422         * rendering/RenderLayer.h:
3423         * rendering/RenderLayerBacking.cpp:
3424         (WebCore::RenderLayerBacking::updateCompositedBounds):
3425         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
3426         (WebCore::RenderLayerBacking::paintIntoLayer):
3427         * rendering/RenderLayerBacking.h:
3428         * rendering/RenderLayerCompositor.cpp:
3429         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
3430         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
3431         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):