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