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