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