gPictureOwnerMap is unnecessary
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-01  Ryosuke Niwa  <rniwa@webkit.org>
2
3         gPictureOwnerMap is unnecessary
4         https://bugs.webkit.org/show_bug.cgi?id=195228
5
6         Reviewed by Zalan Bujtas.
7
8         Just store in HTMLImageElement. An extra pointer isn't going to affect the memory use here.
9         If anything, we should worry about m_editableImage and m_pendingClonedAttachmentID instead.
10
11         * html/HTMLImageElement.cpp:
12         (WebCore::HTMLImageElement::pictureElement const):
13         (WebCore::HTMLImageElement::setPictureElement):
14         * html/HTMLImageElement.h:
15
16 2019-03-04  Daniel Bates  <dabates@apple.com>
17
18         [iOS] Caret x-position in empty text area does not match text field
19         https://bugs.webkit.org/show_bug.cgi?id=195125
20         <rdar://problem/47161070>
21
22         Remove the word "use" in the added comment to make it read well.
23
24         * css/html.css:
25         (textarea):
26
27 2019-03-04  Joseph Pecoraro  <pecoraro@apple.com>
28
29         ITMLKit Inspector: Data Bindings / Associated Data for nodes
30         https://bugs.webkit.org/show_bug.cgi?id=195290
31         <rdar://problem/48304019>
32
33         Reviewed by Devin Rousso.
34
35         * inspector/agents/InspectorDOMAgent.h:
36         * inspector/agents/InspectorDOMAgent.cpp:
37         (WebCore::InspectorDOMAgent::getDataBindingsForNode):
38         (WebCore::InspectorDOMAgent::getAssociatedDataForNode):
39         Stub these for web pages, they will only be used for ITMLKit right now.
40
41 2019-03-04  Daniel Bates  <dabates@apple.com>
42
43         [iOS] Caret x-position in empty text area does not match text field
44         https://bugs.webkit.org/show_bug.cgi?id=195125
45         <rdar://problem/47161070>
46
47         Reviewed by Darin Adler.
48
49         Fix up User Agent styles for <textarea> on iOS such that they have the same left padding
50         width and same text-indent as <input type="text">. This makes the x-position of the caret
51         in an empty textarea match the position of the caret in an empty text field.
52
53         Test: fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield.html
54
55         * css/html.css:
56         (textarea): For iOS Family, do not use the padding shorthand property. Instead explicitly specify
57         padding-top and padding-bottom to be 2px to keep our current behavior (because it looks reasonable)
58         and do not specify left and right padding so that we inherit the padding set earlier in this file.
59         (textarea::placeholder): Deleted. This was added to "try" to make fix up the position of the placeholder
60         text so as to match the position of the textarea's inner text and the position of a text field's inner
61         text. This fix up may have worked out visually when it was added, but based on the discovery of the
62         hardcoded 3px left and right padding (see below remark) it looks like it was always one pixel too short.
63         * html/HTMLTextAreaElement.cpp:
64         (WebCore::HTMLTextAreaElement::createInnerTextStyle): Remove hardcoded 3px left and right padding.
65
66 2019-03-04  Youenn Fablet  <youenn@apple.com>
67
68         Make sure to correctly notify of end of a ServiceWorkerJob when the context is stopped
69         https://bugs.webkit.org/show_bug.cgi?id=195195
70
71         Reviewed by Chris Dumez.
72
73         Before the patch, we were notifying that some jobs were finished too aggressively at context stop time.
74         This was confusing the Network Process.
75         Only notify such jobs that have pending loads.
76         Improve the tracking of jobs doing registration resolution to ensure the Network Process gets notified
77         in case of a registration promise being resolved but the settling callback being not yet called while the context is stopped.
78
79         Covered by existing tests not crashing anymore, in particular imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting.https.html.
80
81         * workers/service/ServiceWorkerContainer.cpp:
82         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
83         (WebCore::ServiceWorkerContainer::notifyRegistrationIsSettled):
84         (WebCore::ServiceWorkerContainer::stop):
85         * workers/service/ServiceWorkerContainer.h:
86         * workers/service/ServiceWorkerJob.cpp:
87         (WebCore::ServiceWorkerJob::cancelPendingLoad):
88         * workers/service/ServiceWorkerJob.h:
89         (WebCore::ServiceWorkerJob::isLoading const):
90
91 2019-03-04  Chris Dumez  <cdumez@apple.com>
92
93         [iOS] Improve our file picker
94         https://bugs.webkit.org/show_bug.cgi?id=195284
95         <rdar://problem/45655856>
96
97         Reviewed by Tim Horton and Wenson Hsieh.
98
99         Export UTIUtilities.h so that it can be used from WebKit2.
100
101         * WebCore.xcodeproj/project.pbxproj:
102
103 2019-03-04  Zalan Bujtas  <zalan@apple.com>
104
105         [ContentChangeObserver] Decouple mouseMoved event and the "is observing content change" status.
106         https://bugs.webkit.org/show_bug.cgi?id=195286
107
108         Reviewed by Simon Fraser.
109
110         Now isObservingContentChanges returns true only when we are actively observing content change during timer firing and/or style recalculating.
111         This patch also renames a couple of functions to follow the didStart/didFinish pattern.
112
113         * page/ios/ContentChangeObserver.cpp:
114         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
115         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
116         (WebCore::ContentChangeObserver::styleRecalcDidStart):
117         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
118         (WebCore::ContentChangeObserver::mouseMovedDidStart):
119         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
120         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
121         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
122         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
123         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
124         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
125         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
126         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
127         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
128         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute): Deleted.
129         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute): Deleted.
130         (WebCore::ContentChangeObserver::startObservingStyleRecalc): Deleted.
131         (WebCore::ContentChangeObserver::stopObservingStyleRecalc): Deleted.
132         (WebCore::ContentChangeObserver::startObservingMouseMoved): Deleted.
133         (WebCore::ContentChangeObserver::stopObservingMouseMoved): Deleted.
134         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
135         * page/ios/ContentChangeObserver.h:
136         (WebCore::ContentChangeObserver::setShouldObserveDOMTimerScheduling):
137         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
138         (WebCore::ContentChangeObserver::isObservingStyleRecalc const):
139         (WebCore::ContentChangeObserver::isObservingContentChanges const):
140         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
141         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
142         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const): Deleted.
143
144 2019-03-04  Yusuke Suzuki  <ysuzuki@apple.com>
145
146         [JSC] Offer @makeTypeError instead of exposing @TypeError
147         https://bugs.webkit.org/show_bug.cgi?id=193858
148
149         Reviewed by Mark Lam.
150
151         Use @makeTypeError instead.
152
153         * Modules/mediastream/RTCPeerConnection.js:
154         * Modules/mediastream/RTCPeerConnectionInternals.js:
155         * Modules/streams/ReadableByteStreamInternals.js:
156         (readableByteStreamControllerClose):
157         (readableByteStreamControllerPullInto):
158         * Modules/streams/ReadableStream.js:
159         (cancel):
160         (pipeTo):
161         * Modules/streams/ReadableStreamBYOBReader.js:
162         (cancel):
163         (read):
164         * Modules/streams/ReadableStreamDefaultReader.js:
165         (cancel):
166         (read):
167         * Modules/streams/ReadableStreamInternals.js:
168         (readableStreamReaderGenericRelease):
169         * Modules/streams/WritableStream.js:
170         (abort):
171         (close):
172         (write):
173         (getter.closed):
174         (getter.ready):
175
176 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
177
178         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
179         https://bugs.webkit.org/show_bug.cgi?id=195258
180
181         Reviewed by Antti Koivisto.
182
183         This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
184         ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
185         scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
186         to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
187
188         Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
189         RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
190         At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
191         of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
192         references to GraphicsLayers before that becomes safe).
193         
194         The actual fix that allows overflow scrollbars to show is the change in
195         AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
196         for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
197
198         * SourcesCocoa.txt:
199         * WebCore.xcodeproj/project.pbxproj:
200         * page/scrolling/AsyncScrollingCoordinator.cpp:
201         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
202         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
203         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
204         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
205         * page/scrolling/ScrollingCoordinator.h:
206         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
207         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
208         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
209         (WebCore::ScrollingStateFrameScrollingNode::setVerticalScrollbarLayer): Deleted.
210         (WebCore::ScrollingStateFrameScrollingNode::setHorizontalScrollbarLayer): Deleted.
211         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars): Deleted.
212         * page/scrolling/ScrollingStateFrameScrollingNode.h:
213         * page/scrolling/ScrollingStateScrollingNode.cpp:
214         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
215         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
216         (WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarLayer):
217         (WebCore::ScrollingStateScrollingNode::setVerticalScrollbarLayer):
218         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
219         * page/scrolling/ScrollingStateScrollingNode.h:
220         (WebCore::ScrollingStateScrollingNode::horizontalScrollbarLayer const):
221         (WebCore::ScrollingStateScrollingNode::verticalScrollbarLayer const):
222         (WebCore::ScrollingStateScrollingNode::verticalScrollerImp const):
223         (WebCore::ScrollingStateScrollingNode::horizontalScrollerImp const):
224         * page/scrolling/ScrollingTree.cpp:
225         (WebCore::ScrollingTree::setOrClearLatchedNode):
226         (WebCore::ScrollingTree::handleWheelEvent):
227         * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
228         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
229         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
230         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
231         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
232         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
233         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
234         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): Deleted.
235         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread): Deleted.
236         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
237         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
238         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
239         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
240         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionRelatedLayers):
241         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
242         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
243         (WebCore::ScrollingTreeScrollingNodeDelegateMac::~ScrollingTreeScrollingNodeDelegateMac):
244         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
245         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
246         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters):
247         (WebCore::ScrollingTreeScrollingNodeDelegateMac::releaseReferencesToScrollerImpsOnTheMainThread):
248         * platform/ScrollbarThemeComposite.h:
249         * rendering/RenderLayerCompositor.cpp:
250         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
251         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
252         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
253         * rendering/RenderLayerCompositor.h:
254
255 2019-03-04  Jer Noble  <jer.noble@apple.com>
256
257         Remove HEVC as a codec requiring hardware support.
258         https://bugs.webkit.org/show_bug.cgi?id=194960
259         <rdar://problem/47741432>
260
261         Reviewed by Eric Carlson.
262
263         * page/cocoa/SettingsBaseCocoa.mm:
264         (WebCore::SettingsBase::defaultMediaContentTypesRequiringHardwareSupport):
265
266 2019-03-04  Jer Noble  <jer.noble@apple.com>
267
268         [iOS] Fullscreen "stay in page" option breaks video playback
269         https://bugs.webkit.org/show_bug.cgi?id=195277
270         <rdar://problem/48537317>
271
272         Reviewed by Eric Carlson.
273
274         Add a LOG entry when playback is rejected due to media playback suspension.
275
276         * html/MediaElementSession.cpp:
277         (WebCore::MediaElementSession::playbackPermitted const):
278
279 2019-03-04  Tim Horton  <timothy_horton@apple.com>
280
281         Fix the build.
282
283         * dom/Document.h:
284
285 2019-03-03  Zalan Bujtas  <zalan@apple.com>
286
287         [ContentChangeObserver] Content observation should be limited to the current document.
288         https://bugs.webkit.org/show_bug.cgi?id=195256
289         <rdar://problem/48544402>
290
291         Move ContentChangeObserver from Page to Document.
292         It limits content observation to the target node's owner document.
293
294         Reviewed by Simon Fraser.
295
296         * dom/Document.cpp:
297         (WebCore::m_contentChangeObserver):
298         (WebCore::Document::updateStyleIfNeeded):
299         (WebCore::Document::willDetachPage):
300         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
301         (WebCore::m_undoManager): Deleted.
302         * dom/Document.h:
303         (WebCore::Document::contentChangeObserver):
304         * page/DOMTimer.cpp:
305         (WebCore::DOMTimer::install):
306         (WebCore::DOMTimer::removeById):
307         (WebCore::DOMTimer::fired):
308         * page/Frame.cpp:
309         (WebCore::Frame::willDetachPage):
310         * page/Page.cpp:
311         (WebCore::Page::Page):
312         * page/Page.h:
313         (WebCore::Page::pointerLockController const):
314         (WebCore::Page::contentChangeObserver): Deleted.
315         * page/ios/ContentChangeObserver.cpp:
316         (WebCore::ContentChangeObserver::ContentChangeObserver):
317         (WebCore::ContentChangeObserver::didInstallDOMTimer):
318         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
319         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
320         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
321         (WebCore::ContentChangeObserver::startObservingMouseMoved):
322         (WebCore::ContentChangeObserver::hasDeterminateState const):
323         (WebCore::ContentChangeObserver::adjustObservedState):
324         (WebCore::ContentChangeObserver::notifyContentChangeIfNeeded):
325         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
326         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
327         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
328         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
329         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
330         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
331         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
332         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
333         (WebCore::hasPendingStyleRecalc): Deleted.
334         * page/ios/ContentChangeObserver.h:
335         * page/ios/EventHandlerIOS.mm:
336         (WebCore::EventHandler::mouseMoved):
337         * rendering/updating/RenderTreeUpdater.cpp:
338         (WebCore::RenderTreeUpdater::updateElementRenderer):
339
340 2019-03-02  Simon Fraser  <simon.fraser@apple.com>
341
342         Share more code for updating the state of frame scrolling nodes
343         https://bugs.webkit.org/show_bug.cgi?id=195254
344
345         Reviewed by Antti Koivisto.
346
347         Responsibility for updating state on ScrollingStateFrameScrolling nodes was split between
348         AsyncScrollingCoordinator::frameViewLayoutUpdated(), which is called post-layout, and
349         RenderLayerCompositor. This patch gives that responsibility entirely to RenderLayerCompositor,
350         ensuring that we update frame scrolling nodes at the same time as the rest of the scrolling
351         state tree.
352         
353         We also share code between updating ScrollingStateFrameScrollingNodes and
354         ScrollingStateOverflowScrollingNodews, since both can be updated from a ScrollableArea.
355         Some minor cleanup of ScrollableArea is doing to help. For the first time, we're pushing
356         ScrollableAreaParameters for overflow scrolling nodes, allowing rubber-banding to work
357         on macOS.
358
359         * page/scrolling/AsyncScrollingCoordinator.cpp:
360         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
361         (WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode):
362         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
363         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
364         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeConstraints):
365         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry): Deleted.
366         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
367         * page/scrolling/AsyncScrollingCoordinator.h:
368         * page/scrolling/ScrollingCoordinator.h:
369         (WebCore::ScrollingCoordinator::setRectRelativeToParentNode):
370         (WebCore::ScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
371         (WebCore::ScrollingCoordinator::setFrameScrollingNodeState):
372         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeConstraints):
373         (WebCore::ScrollingCoordinator::setScrollingNodeGeometry): Deleted.
374         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
375         * platform/ScrollView.h:
376         (WebCore::ScrollView::horizontalScrollbarMode const): Deleted.
377         (WebCore::ScrollView::verticalScrollbarMode const): Deleted.
378         * platform/ScrollableArea.cpp:
379         (WebCore::ScrollableArea::reachableTotalContentsSize const):
380         * platform/ScrollableArea.h:
381         (WebCore::ScrollableArea::horizontalScrollbarMode const):
382         (WebCore::ScrollableArea::verticalScrollbarMode const):
383         * rendering/RenderLayer.cpp:
384         (WebCore::RenderLayer::overhangAmount const):
385         (WebCore::RenderLayer::reachableTotalContentsSize const):
386         (WebCore::RenderLayer::scrollableContentsSize const): Deleted.
387         * rendering/RenderLayer.h:
388         * rendering/RenderLayerCompositor.cpp:
389         (WebCore::RenderLayerCompositor::updateCompositingLayers):
390         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
391         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
392         (WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const):
393         (WebCore::RenderLayerCompositor::parentRelativeScrollableRect const):
394         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
395         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
396         (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const): Deleted.
397         (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const): Deleted.
398         (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const): Deleted.
399         * rendering/RenderLayerCompositor.h:
400
401 2019-03-02  Darin Adler  <darin@apple.com>
402
403         Retire legacy dtoa function and DecimalNumber class
404         https://bugs.webkit.org/show_bug.cgi?id=195253
405
406         Reviewed by Daniel Bates.
407
408         * css/CSSPrimitiveValue.cpp:
409         (WebCore::CSSPrimitiveValue::formatNumberValue const): Use makeString instead
410         of DecimalNumber. Also changed return type to String and use StringView and
411         removed special handling of literals.
412         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Removed an
413         unnecessary use of StringBuilder.
414
415         * css/CSSPrimitiveValue.h: Updated for changes to formatNumberValue.
416
417 2019-03-03  Michael Catanzaro  <mcatanzaro@igalia.com>
418
419         [SOUP] Cleanups in SoupNetworkSession
420         https://bugs.webkit.org/show_bug.cgi?id=195247
421
422         Reviewed by Daniel Bates.
423
424         This renames clientCertificates to allowedCertificates, since they are not client
425         certificates at all, but server certificates. It also adds a using statement to avoid
426         repeating the long type of the map, and avoids an unnecessary copy.
427
428         * platform/network/soup/SoupNetworkSession.cpp:
429         (WebCore::allowedCertificates):
430         (WebCore::SoupNetworkSession::checkTLSErrors):
431         (WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
432         (WebCore::clientCertificates): Deleted.
433
434 2019-03-03  Michael Catanzaro  <mcatanzaro@igalia.com>
435
436         -Wformat error in SharedBuffer::tryCreateArrayBuffer
437         https://bugs.webkit.org/show_bug.cgi?id=195004
438
439         Reviewed by Darin Adler.
440
441         Seems C++ has no format specifier appropriate for printing the result of sizeof. We should
442         just not try to print it. Anyway, that's easy in this case, because sizeof(char) is
443         guaranteed to be 1. This code was an attempt to be pedantic to account for mythical systems
444         with char larger than one byte, but perhaps it didn't realize sizeof always returns
445         multiples of char and so sizeof(char) is always one even on such mythical systems.
446
447         Note the sizeof(char) use two lines up is left since it's not clear that switching it to 1
448         would actually be more readable.
449
450         * platform/SharedBuffer.cpp:
451         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
452
453 2019-03-03  Tim Horton  <timothy_horton@apple.com>
454
455         Remove some more unused 32-bit code
456         https://bugs.webkit.org/show_bug.cgi?id=195255
457
458         Reviewed by Darin Adler.
459
460         * platform/gamepad/cocoa/GameControllerGamepad.h:
461         * platform/gamepad/cocoa/GameControllerGamepad.mm:
462         * platform/gamepad/cocoa/GameControllerGamepadProvider.h:
463         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
464         * platform/graphics/cocoa/FontCascadeCocoa.mm:
465         * platform/mac/PlatformEventFactoryMac.mm:
466         (WebCore::globalPointForEvent):
467         (WebCore::pointForEvent):
468         (WebCore::mouseButtonForEvent):
469         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
470         * rendering/RenderThemeMac.mm:
471         (WebCore::RenderThemeMac::servicesRolloverButtonCell const):
472         (WebCore::RenderThemeMac::paintImageControlsButton):
473         (WebCore::RenderThemeMac::imageControlsButtonSize const):
474         (WebCore::RenderThemeMac::imageControlsButtonPositionOffset const):
475
476 2019-03-02  Zalan Bujtas  <zalan@apple.com>
477
478         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
479         https://bugs.webkit.org/show_bug.cgi?id=195252
480         <rdar://problem/48539446>
481
482         Reviewed by Simon Fraser.
483
484         Scope the mouse-moved event to make the callsites less error-prone. 
485
486         * page/ios/ContentChangeObserver.cpp:
487         (WebCore::ContentChangeObserver::startObservingMouseMoved):
488         (WebCore::ContentChangeObserver::stopObservingMouseMoved):
489         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
490         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
491         (WebCore::ContentChangeObserver::startObservingContentChanges): Deleted.
492         (WebCore::ContentChangeObserver::stopObservingContentChanges): Deleted.
493         * page/ios/ContentChangeObserver.h:
494         * page/ios/EventHandlerIOS.mm:
495         (WebCore::EventHandler::mouseMoved):
496
497 2019-03-02  Zalan Bujtas  <zalan@apple.com>
498
499         [ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
500         https://bugs.webkit.org/show_bug.cgi?id=195244
501         <rdar://problem/48536737>
502
503         Reviewed by Simon Fraser.
504
505         Move state change handling code to adjustObservedState() and introduce signalContentChangeIfNeeded() to
506         let the client know about the state change (or lack of state change).
507
508         Test: fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html
509
510         * page/ios/ContentChangeObserver.cpp:
511         (WebCore::ContentChangeObserver::didInstallDOMTimer):
512         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
513         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
514         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
515         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
516         (WebCore::ContentChangeObserver::didContentVisibilityChange):
517         (WebCore::ContentChangeObserver::addObservedDOMTimer):
518         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
519         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
520         (WebCore::ContentChangeObserver::adjustObservedState):
521         (WebCore::ContentChangeObserver::signalContentChangeIfNeeded):
522         * page/ios/ContentChangeObserver.h:
523         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
524         (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
525         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
526
527 2019-03-02  Zalan Bujtas  <zalan@apple.com>
528
529         [ContentChangeObserver] Move away from WKContentChange values
530         https://bugs.webkit.org/show_bug.cgi?id=195240
531         <rdar://problem/48532358>
532
533         Reviewed by Simon Fraser.
534
535         This is in preparation for moving towards a state machine-like implementation.
536
537         * page/ios/ContentChangeObserver.cpp:
538         (WebCore::ContentChangeObserver::didInstallDOMTimer): Do not install the timer if we are already in "hover" state.
539         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
540         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
541         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
542         (WebCore::ContentChangeObserver::startObservingStyleRecalc): No need to start observing the style recalc if we are already in "hover" state.
543         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
544         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
545         (WebCore::ContentChangeObserver::didContentVisibilityChange):
546         (WebCore::ContentChangeObserver::startObservingContentChanges):
547         (WebCore::ContentChangeObserver::observedContentChange const):
548         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
549         (WebCore::ContentChangeObserver::hasDeterminedState const):
550         (WebCore::ContentChangeObserver::observedContentChange): Deleted.
551         (WebCore::ContentChangeObserver::resetObservedContentChange): Deleted.
552         (WebCore::ContentChangeObserver::setObservedContentChange): Deleted.
553         (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
554         * page/ios/ContentChangeObserver.h:
555         (WebCore::ContentChangeObserver::addObservedDOMTimer):
556         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
557         (WebCore::ContentChangeObserver::hasVisibleChangeState const):
558         (WebCore::ContentChangeObserver::hasObservedDOMTimer const):
559         (WebCore::ContentChangeObserver::setHasNoChangeState):
560         (WebCore::ContentChangeObserver::setHasIndeterminateState):
561         (WebCore::ContentChangeObserver::setHasVisibleChangeState):
562         (WebCore::ContentChangeObserver::countOfObservedDOMTimers const): Deleted.
563
564 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
565
566         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
567         https://bugs.webkit.org/show_bug.cgi?id=195053
568         <rdar://problem/48134710>
569
570         Reviewed by Ryosuke Niwa.
571
572         Plumb the document pasteboard identifier through the client when making a DOM paste access request. See WebKit
573         ChangeLog for more details.
574
575         Test: editing/pasteboard/ios/dom-paste-same-origin.html
576
577         * WebCore.xcodeproj/project.pbxproj:
578         * dom/DOMPasteAccess.h: Renamed from Source/WebCore/dom/DOMPasteAccessPolicy.h.
579
580         Introduce DOMPasteAccessResponse, which is either DeniedForGesture, GrantedForCommand, or GrantedForGesture. In
581         particular, when pasteboard identifiers match, we only grant access for the current paste command, rather than
582         throughout the user gesture.
583
584         * dom/UserGestureIndicator.h:
585         (WebCore::UserGestureToken::didRequestDOMPasteAccess):
586         * loader/EmptyClients.cpp:
587         * page/EditorClient.h:
588         * page/Frame.cpp:
589         (WebCore::Frame::requestDOMPasteAccess):
590
591 2019-02-27  Darin Adler  <darin@apple.com>
592
593         Fixed makeString(float) to do shortest-form serialization without first converting to double
594         https://bugs.webkit.org/show_bug.cgi?id=195142
595
596         Reviewed by Daniel Bates.
597
598         * platform/graphics/Color.cpp: Removed unneeded include of DecimalNumber.h.
599
600 2019-03-02  Simon Fraser  <simon.fraser@apple.com>
601
602         REGRESSION (r242132): Incorrect positioning with multiple position:fixed elements
603         https://bugs.webkit.org/show_bug.cgi?id=195246
604
605         Reviewed by Frederic Wang.
606
607         r242132 introduced a bug where the management of 'cumulativeDelta' in ScrollingTree::notifyRelatedNodesRecursive
608         was incorrect. This value should propagate from ancestors to descendants, but not between siblings in the scrolling
609         tree, which it did, causing sibling position:fixed to behave incorrectly.
610
611         Test: scrollingcoordinator/mac/multiple-fixed.html
612
613         * page/scrolling/ScrollingTree.cpp:
614         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
615         * page/scrolling/ScrollingTree.h:
616
617 2019-03-02  Darin Adler  <darin@apple.com>
618
619         Improve some comments
620         https://bugs.webkit.org/show_bug.cgi?id=195243
621
622         Reviewed by Daniel Bates.
623
624         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
625         (-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
626         Fix a typo in a comment.
627
628         * dom/RadioButtonGroups.cpp: Fix a typo in a comment.
629         (WebCore::RadioButtonGroups::checkedButtonForGroup const): Use nullptr instead of 0.
630
631         * html/HTMLInputElement.cpp:
632         (WebCore::HTMLInputElement::~HTMLInputElement): Improved a comment, but sadly made
633         it a bit longer. Use nullptr instead of 0.
634         (WebCore::HTMLInputElement::didMoveToNewDocument): Added a comment.
635
636 2019-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
637
638         [Datalist] fast/forms/datalist/datalist-child-validation.html crashes with a debug assertion in isValidFormControlElement()
639         https://bugs.webkit.org/show_bug.cgi?id=190620
640         <rdar://problem/19226679>
641
642         Reviewed by Ryosuke Niwa.
643
644         Fixes and re-enables an existing layout test that is asserting on debug builds (and failing on release builds).
645         To understand why we hit this assertion, we first note several observations:
646
647             -   The validity of a form control (`isValid()`) depends on the value of `willValidate()`.
648             -   Both of these results are cached in member variables: `m_isValid` and `m_willValidate`, respectively.
649             -   `willValidate()` changes the cached value of `m_willValidate` if necessary, but `isValid()` uses the
650                 cached value without update.
651
652         Now, consider the following scenario:
653
654             1.  Something changes in the DOM that changes the result of `willValidate()`. This can happen as a result of
655                 several things:
656                 a.  The form control changes readonly state
657                 b.  The form control changes disabled state
658                 c.  The form control is added to a datalist element
659                 d.  The form control is removed from a datalist element
660             2.  Call `willValidate()`.
661             3.  Call `isValid()`.
662
663         In scenarios (a) - (c), we ensure that cached form control validity (`m_isValid`) is updated alongside
664         `m_willValidate` by invoking `setNeedsWillValidateCheck()`, such that the result of `isValid()` matches the
665         result of `m_isValid` in step (3). However, in the last scenario (d), we don't do this, which causes form
666         control validity to fall out of sync with the result of `isValid()`. To fix the bug, we update willValidate and
667         isValid when a form control is removed from an ancestor, only if one of its ancestors is a datalist element.
668
669         * html/HTMLFormControlElement.cpp:
670         (WebCore::HTMLFormControlElement::insertedIntoAncestor):
671         (WebCore::HTMLFormControlElement::removedFromAncestor):
672
673         Make a couple of minor tweaks:
674           - Currently, we always invalidate `m_dataListAncestorState` by resetting the state to `Unknown` when the form
675             control is removed from an ancestor or inserted. Instead, we only need to reset it when the form control
676             already has an ancestor that is a datalist (in the case where it's being removed) or when the form control
677             does not yet have an ancestor (in the case where it is being added).
678           - If the form control was inside a datalist prior to removal, recompute its cached value of `m_willValidate`,
679             as well as its cached validity (`m_isValid`).
680
681 2019-03-01  Darin Adler  <darin@apple.com>
682
683         Finish removing String::format
684         https://bugs.webkit.org/show_bug.cgi?id=194893
685
686         Reviewed by Daniel Bates.
687
688         * dom/Document.cpp:
689         (WebCore::Document::lastModified const): Use makeString and pad.
690         * html/FTPDirectoryDocument.cpp:
691         (WebCore::processFileDateString): Ditto.
692
693         * mathml/MathMLElement.cpp:
694         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
695
696         * page/cocoa/ResourceUsageOverlayCocoa.mm:
697         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
698
699         * page/linux/ResourceUsageOverlayLinux.cpp:
700         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
701         (WebCore::gcTimerString): Use String::number.
702
703         * platform/DateComponents.cpp:
704         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
705         (WebCore::DateComponents::toString const): Ditto.
706
707         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
708         and that was also inaccurate.
709
710         * platform/audio/HRTFElevation.cpp:
711         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
712         Use makeString and pad.
713         * platform/mock/MockRealtimeVideoSource.cpp:
714         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
715         * rendering/RenderLayerCompositor.cpp:
716         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
717         * rendering/RenderTheme.cpp:
718         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
719
720 2019-03-01  Chris Dumez  <cdumez@apple.com>
721
722         Do not attempt to set WAL Journal mode on a readonly SQLite database
723         https://bugs.webkit.org/show_bug.cgi?id=195237
724
725         Reviewed by Simon Fraser.
726
727         This avoids logging errors when opening the database.
728
729         * platform/sql/SQLiteDatabase.cpp:
730         (WebCore::SQLiteDatabase::open):
731         (WebCore::SQLiteDatabase::useWALJournalMode):
732         * platform/sql/SQLiteDatabase.h:
733
734 2019-03-01  Antoine Quint  <graouts@apple.com>
735
736         [iOS] Turn mouse event simulation on by default
737         https://bugs.webkit.org/show_bug.cgi?id=195218
738         <rdar://problem/48516794>
739
740         Reviewed by Dean Jackson.
741
742         * page/RuntimeEnabledFeatures.h:
743
744 2019-03-01  Chris Dumez  <cdumez@apple.com>
745
746         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
747         https://bugs.webkit.org/show_bug.cgi?id=195230
748         <rdar://problem/47925359>
749
750         Reviewed by Ryosuke Niwa.
751
752         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
753         to address crashes on iOS WK1.
754
755         * platform/network/NetworkStateNotifier.cpp:
756         (WebCore::shouldSuppressThreadSafetyCheck):
757         (WebCore::NetworkStateNotifier::singleton):
758
759 2019-03-01  Simon Fraser  <simon.fraser@apple.com>
760
761         Show mouse event regions in the overlay
762         https://bugs.webkit.org/show_bug.cgi?id=195227
763
764         Reviewed by Tim Horton.
765
766         Enhance event region overlays to show more kinds of events.
767
768         * page/DebugPageOverlays.cpp:
769         (WebCore::touchEventRegionColors):
770         (WebCore::NonFastScrollableRegionOverlay::drawRect):
771
772 2019-03-01  Zalan Bujtas  <zalan@apple.com>
773
774         [ContentChangeObserver] Check for pending style recalcs at the end of each timer run.
775         https://bugs.webkit.org/show_bug.cgi?id=195220
776         <rdar://problem/48518979>
777
778         Reviewed by Simon Fraser.
779
780         didScheduleStyleRecalc callback was introduced to see if a style recalc is scheduled while firing the DOM timer. However it does not handle the case
781         when in addition to this style recalc scheduling, something later (though during the same timer firing) triggers a sync style recalc.
782         Let's just check if we've got a pending style recalc when the DOM timer comes back.
783
784         Test: fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html
785
786         * dom/Document.cpp:
787         (WebCore::Document::scheduleStyleRecalc):
788         * page/ios/ContentChangeObserver.cpp:
789         (WebCore::hasPendingStyleRecalc):
790         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
791         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
792         (WebCore::ContentChangeObserver::startObservingContentChanges):
793         (WebCore::ContentChangeObserver::didScheduleStyleRecalc): Deleted.
794         * page/ios/ContentChangeObserver.h:
795         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
796         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
797         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const): Deleted.
798
799 2019-03-01  John Wilander  <wilander@apple.com>
800
801         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
802         https://bugs.webkit.org/show_bug.cgi?id=195196
803         <rdar://problem/48006419>
804
805         Reviewed by Brent Fulgham.
806
807         Tests: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html
808                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html
809                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html
810                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html
811                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html
812
813         Trackers abuse link query parameters to transport user identifiers cross-site.
814         This patch detects such navigations and applies further restrictions to
815         client-site cookies on the destination page.
816
817         * platform/network/NetworkStorageSession.cpp:
818         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
819             Now sets the regular 7-day cap and a reduced 1-day cap.
820         (WebCore::NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics):
821             Renamed NetworkStorageSession::removeStorageAccessForAllFramesOnPage() to
822             NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics since
823             it now clears out two types of page-specific data.
824         (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration):
825             This function receives a cross-site navigation and checks if the originating
826             site is a prevalent resource. If so, it marks the page or stricter cookie
827             rules.
828         (WebCore::NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting):
829             Test infrastructure. This sets a state that overrides the regular per-page
830             clear of data. The reason is that the double clear was racy and caused test
831             failures.
832         (WebCore::NetworkStorageSession::clientSideCookieCap const):
833             New function that returns the current cookie lifetime cap.
834         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
835             Renamed to NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics().
836         * platform/network/NetworkStorageSession.h:
837         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
838         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
839             Now calls NetworkStorageSession::clientSideCookieCap() to set the cap.
840
841 2019-03-01  Rob Buis  <rbuis@igalia.com>
842
843         Adjust XMLHttpRequest Content-Type handling
844         https://bugs.webkit.org/show_bug.cgi?id=184645
845
846         Reviewed by Youenn Fablet.
847
848         Implement steps 4.4.1.2 and 4.4.1.3 of send() [1].
849
850         Test: web-platform-tests/xhr/send-content-type-charset.htm
851
852         [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send
853
854         * platform/network/ParsedContentType.cpp:
855         (WebCore::ParsedContentType::setCharset):
856         * platform/network/ParsedContentType.h:
857         * xml/XMLHttpRequest.cpp:
858         (WebCore::replaceCharsetInMediaTypeIfNeeded):
859         (WebCore::XMLHttpRequest::send):
860         (WebCore::replaceCharsetInMediaType): Deleted.
861
862 2019-03-01  Youenn Fablet  <youenn@apple.com>
863
864         Update originsMatch to handle the case of file origins which enforce file path separation
865         https://bugs.webkit.org/show_bug.cgi?id=195216
866
867         Reviewed by Brady Eidson.
868
869         Covered by the assertion and existing tests like fast/xmlhttprequest/xmlhttprequest-no-file-access.html.
870         Make sure originsMatch returns true if either compared origins are the same object
871         or they have the same file path separation behavior.
872
873         * page/SecurityOrigin.cpp:
874         (WebCore::areOriginsMatching):
875         (WebCore::originsMatch):
876
877 2019-03-01  Youenn Fablet  <youenn@apple.com>
878
879         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
880         https://bugs.webkit.org/show_bug.cgi?id=195213
881
882         Reviewed by Alex Christensen.
883
884         Add traits to enable enum IPC encoding.
885         No change of behavior.
886
887         * Modules/indexeddb/IndexedDB.h:
888
889 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
890
891         [WinCairo] Enable service worker
892         https://bugs.webkit.org/show_bug.cgi?id=188318
893
894         Reviewed by Youenn Fablet.
895
896         * WebCorePrefix.h:
897         * testing/ServiceWorkerInternals.h:
898         * workers/service/context/SWContextManager.cpp:
899         (WebCore::SWContextManager::serviceWorkerFailedToTerminate):
900         * workers/service/context/SWContextManager.h:
901
902 2019-03-01  Sihui Liu  <sihui_liu@apple.com>
903
904         Add a quirk for bostongloble.com and latimes.com
905         https://bugs.webkit.org/show_bug.cgi?id=195155
906
907         Reviewed by Geoffrey Garen.
908
909         Covered by manual testing.
910
911         * Modules/webdatabase/DOMWindowWebDatabase.idl:
912         * bindings/scripts/CodeGeneratorJS.pm:
913         (GenerateRuntimeEnableConditionalString):
914         * bindings/scripts/IDLAttributes.json:
915         * bindings/scripts/preprocess-idls.pl:
916         (GenerateConstructorAttributes):
917         * page/Quirks.cpp:
918         (WebCore::Quirks::hasWebSQLSupportQuirk const):
919         * page/Quirks.h:
920
921 2019-03-01  Zalan Bujtas  <zalan@apple.com>
922
923         [ContentChangeObserver] Rename members and move implementation to header.
924         https://bugs.webkit.org/show_bug.cgi?id=195198
925         <rdar://problem/48499967>
926
927         Reviewed by Simon Fraser.
928
929         * page/ios/ContentChangeObserver.cpp:
930         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
931         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
932         (WebCore::ContentChangeObserver::startObservingStyleRecalc):
933         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
934         (WebCore::ContentChangeObserver::startObservingContentChanges):
935         (WebCore::ContentChangeObserver::stopObservingContentChanges):
936         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
937         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
938         (WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
939         (WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
940         (WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
941         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
942         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
943         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
944         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
945         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
946         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
947         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
948         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
949         (WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
950         (WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
951         (WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
952         * page/ios/ContentChangeObserver.h:
953         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
954         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
955         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
956         (WebCore::ContentChangeObserver::containsObservedDOMTimer const):
957         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
958         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
959         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
960         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
961         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
962         (WebCore::ContentChangeObserver::isObservingContentChanges const):
963         (WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
964         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
965
966 2019-03-01  Zalan Bujtas  <zalan@apple.com>
967
968         [ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
969         https://bugs.webkit.org/show_bug.cgi?id=195197
970         <rdar://problem/48498332>
971
972         Reviewed by Simon Fraser.
973
974         Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.
975
976         * page/ios/ContentChangeObserver.cpp:
977         (WebCore::ContentChangeObserver::didContentVisibilityChange):
978         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
979         * page/ios/ContentChangeObserver.h:
980
981 2019-03-01  Jer Noble  <jer.noble@apple.com>
982
983         [EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
984         https://bugs.webkit.org/show_bug.cgi?id=195217
985
986         Reviewed by Eric Carlson.
987
988         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
989         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
990
991 2019-03-01  Justin Fan  <justin_fan@apple.com>
992
993         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
994         https://bugs.webkit.org/show_bug.cgi?id=195191
995
996         Rubber-stamped by Dean Jackson.
997
998         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
999
1000         * Configurations/FeatureDefines.xcconfig:
1001
1002 2019-02-28  Fujii Hironori  <Hironori.Fujii@sony.com>
1003
1004         HTTPSUpgradeList.db database should be opened in readonly mode
1005         https://bugs.webkit.org/show_bug.cgi?id=195194
1006         <rdar://problem/47103889>
1007
1008         Unreviewed build fix for curl.
1009
1010         * platform/network/curl/CookieJarDB.cpp:
1011         (WebCore::CookieJarDB::openDatabase): Removed the second arguemnt of SQLiteDatabase::open.
1012
1013 2019-02-28  Chris Dumez  <cdumez@apple.com>
1014
1015         Unreviewed Windows build fix after r242251.
1016
1017         * platform/win/SearchPopupMenuDB.cpp:
1018         (WebCore::SearchPopupMenuDB::openDatabase):
1019
1020 2019-02-28  Zalan Bujtas  <zalan@apple.com>
1021
1022         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
1023         https://bugs.webkit.org/show_bug.cgi?id=195143
1024         <rdar://problem/48462351>
1025
1026         Reviewed by Simon Fraser.
1027
1028         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
1029
1030         * page/DOMTimer.cpp:
1031         (WebCore::DOMTimer::removeById):
1032         * page/DOMWindow.cpp:
1033         (WebCore::DOMWindow::clearTimeout):
1034         * page/ios/ContentChangeObserver.cpp:
1035         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
1036         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1037         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
1038         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
1039         * page/ios/ContentChangeObserver.h:
1040
1041 2019-02-28  Chris Dumez  <cdumez@apple.com>
1042
1043         HTTPSUpgradeList.db database should be opened in readonly mode
1044         https://bugs.webkit.org/show_bug.cgi?id=195194
1045         <rdar://problem/47103889>
1046
1047         Reviewed by Youenn Fablet.
1048
1049         Add parameter to SQLiteDatabase::open() to specific the open flags.
1050
1051         * Modules/webdatabase/Database.cpp:
1052         (WebCore::Database::performOpenAndVerify):
1053         * platform/sql/SQLiteDatabase.cpp:
1054         (WebCore::SQLiteDatabase::open):
1055         * platform/sql/SQLiteDatabase.h:
1056         * platform/sql/SQLiteFileSystem.cpp:
1057         * platform/sql/SQLiteFileSystem.h:
1058
1059 2019-02-28  Brady Eidson  <beidson@apple.com>
1060
1061         Followup to:
1062         Universal links from Google search results pages don't open the app
1063         https://bugs.webkit.org/show_bug.cgi?id=195126
1064
1065         Unreviewed.
1066
1067         * page/SecurityOrigin.cpp:
1068         (WebCore::originsMatch): Remove a bogus assertion (reasoning in bugzilla)
1069
1070 2019-02-28  Simon Fraser  <simon.fraser@apple.com>
1071
1072         [iOS] Dark flash when opening Google AMP pages
1073         https://bugs.webkit.org/show_bug.cgi?id=195193
1074         rdar://problem/48326442
1075
1076         Reviewed by Zalan Bujtas.
1077
1078         After the incremental compositing updates changes, it was possible for a change in the size
1079         of an overflow:hidden element to fail to update the "ancestor clipping layer" geometry on
1080         a composited descendant that is not a descendant in z-order. When Google search results
1081         create the <iframe> that contain AMP contents, we'd fail to update a zero-sized clipping layer,
1082         leaving the #222 background of an intermediate element visible.
1083
1084         Fix by setting a flag in RenderLayer::updateLayerPosition() (which is called in containing block order)
1085         that sets the "needs geometry update" dirty bit on containing-block-descendant layers. Currently
1086         this flag affects all descendants; in future, we might be able to clear it for grand-children.
1087
1088         Tests: compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html
1089                compositing/geometry/ancestor-clip-change.html
1090
1091         * rendering/RenderLayer.cpp:
1092         (WebCore::RenderLayer::updateLayerPositions):
1093         (WebCore::RenderLayer::updateLayerPosition):
1094         * rendering/RenderLayer.h:
1095         * rendering/RenderLayerBacking.cpp:
1096         (WebCore::RenderLayerBacking::updateAfterLayout):
1097         * rendering/RenderLayerBacking.h:
1098
1099 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
1100
1101         Use-after-move in RenderCombineText::combineTextIfNeeded()
1102         https://bugs.webkit.org/show_bug.cgi?id=195188
1103
1104         Reviewed by Zalan Bujtas.
1105
1106         r241288 uncovered an existing problem with our text-combine code. r242204 alleviated the
1107         symptom, but this patch fixes the source of the problem (and reverts r242204).
1108
1109         The code in RenderCombineText::combineTextIfNeeded() has a bit that’s like:
1110
1111         FontDescription bestFitDescription;
1112         while (...) {
1113             FontCascade compressedFont(WTFMove(bestFitDescription), ...);
1114             ...
1115         }
1116
1117         Clearly this is wrong.
1118
1119         Test: fast/text/text-combine-crash-2.html
1120
1121         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1122         (WebCore::FontDescription::platformResolveGenericFamily):
1123         * rendering/RenderCombineText.cpp:
1124         (WebCore::RenderCombineText::combineTextIfNeeded):
1125
1126 2019-02-28  Zalan Bujtas  <zalan@apple.com>
1127
1128         [ContentChangeObserver] Introduce observer subclasses to scope content change observing.
1129         https://bugs.webkit.org/show_bug.cgi?id=195172
1130         <rdar://problem/48479259>
1131
1132         Reviewed by Simon Fraser.
1133
1134         Let's scope start/stopObserving call pairs.
1135
1136         * dom/Document.cpp:
1137         (WebCore::Document::updateStyleIfNeeded):
1138         * page/DOMTimer.cpp:
1139         (WebCore::DOMTimer::fired):
1140         * page/ios/ContentChangeObserver.cpp:
1141         (WebCore::ContentChangeObserver::StyleChangeObserver::StyleChangeObserver):
1142         (WebCore::ContentChangeObserver::StyleChangeObserver::~StyleChangeObserver):
1143         (WebCore::ContentChangeObserver::StyleRecalcObserver::StyleRecalcObserver):
1144         (WebCore::ContentChangeObserver::StyleRecalcObserver::~StyleRecalcObserver):
1145         (WebCore::ContentChangeObserver::DOMTimerObserver::DOMTimerObserver):
1146         (WebCore::ContentChangeObserver::DOMTimerObserver::~DOMTimerObserver):
1147         (WebCore::ContentChangeObserver::StyleChange::StyleChange): Deleted.
1148         (WebCore::ContentChangeObserver::StyleChange::~StyleChange): Deleted.
1149         * page/ios/ContentChangeObserver.h:
1150         * rendering/updating/RenderTreeUpdater.cpp:
1151         (WebCore::RenderTreeUpdater::updateElementRenderer):
1152
1153 2019-02-28  Antoine Quint  <graouts@apple.com>
1154
1155         Enable the Pointer Events runtime flag by default
1156         https://bugs.webkit.org/show_bug.cgi?id=195156
1157
1158         Reviewed by Dean Jackson.
1159
1160         * page/RuntimeEnabledFeatures.h:
1161
1162 2019-02-28  Zalan Bujtas  <zalan@apple.com>
1163
1164         [ContentChangeObserver] Make observed state reset explicit.
1165         https://bugs.webkit.org/show_bug.cgi?id=195185
1166         <rdar://problem/48488342>
1167
1168         Reviewed by Simon Fraser.
1169
1170         Use setObservedContentChange only for setting the observed change while observing.
1171
1172         * page/ios/ContentChangeObserver.cpp:
1173         (WebCore::ContentChangeObserver::startObservingContentChanges):
1174         (WebCore::ContentChangeObserver::resetObservedContentChange):
1175         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
1176         * page/ios/ContentChangeObserver.h:
1177
1178 2019-02-28  Commit Queue  <commit-queue@webkit.org>
1179
1180         Unreviewed, rolling out r242210.
1181         https://bugs.webkit.org/show_bug.cgi?id=195179
1182
1183         it broke hover menus on losaltosonline.com (Requested by zalan
1184         on #webkit).
1185
1186         Reverted changeset:
1187
1188         "[ContentChangeObserver] Move timer removal code from
1189         DOMWindow::clearTimeout to DOMTimer::removeById"
1190         https://bugs.webkit.org/show_bug.cgi?id=195143
1191         https://trac.webkit.org/changeset/242210
1192
1193 2019-02-28  Zalan Bujtas  <zalan@apple.com>
1194
1195         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
1196         https://bugs.webkit.org/show_bug.cgi?id=195143
1197         <rdar://problem/48462351>
1198
1199         Reviewed by Simon Fraser.
1200
1201         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
1202
1203         * page/DOMTimer.cpp:
1204         (WebCore::DOMTimer::removeById):
1205         * page/DOMWindow.cpp:
1206         (WebCore::DOMWindow::clearTimeout):
1207         * page/ios/ContentChangeObserver.cpp:
1208         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
1209         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1210         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
1211         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
1212         * page/ios/ContentChangeObserver.h:
1213
1214 2019-02-28  Charles Vazac  <cvazac@akamai.com>
1215
1216         Fix Resource Timing buffer edge cases for WPT
1217         https://bugs.webkit.org/show_bug.cgi?id=193213
1218
1219         Reviewed by Youenn Fablet.
1220
1221         Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html
1222
1223         * page/Performance.cpp:
1224         (WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
1225         resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
1226         expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
1227         the secondary buffer.
1228
1229 2019-02-28  Takashi Komori  <Takashi.Komori@sony.com>
1230
1231         [Curl] HTTP Body is missing with redirection.
1232         https://bugs.webkit.org/show_bug.cgi?id=191651
1233
1234         Reviewed by Don Olmstead.
1235
1236         Implement updateFromDelegatePreservingOldProperties for curl port.
1237
1238         Tests: http/tests/navigation/post-301-response.html
1239                http/tests/navigation/post-302-response.html
1240                http/tests/navigation/post-303-response.html
1241                http/tests/navigation/post-307-response.html
1242                http/tests/navigation/post-308-response.html
1243
1244         * platform/Curl.cmake:
1245         * platform/network/curl/ResourceRequest.h:
1246         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
1247         * platform/network/curl/ResourceRequestCurl.cpp: Added.
1248         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
1249
1250 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1251
1252         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
1253         https://bugs.webkit.org/show_bug.cgi?id=195159
1254
1255         Reviewed by Don Olmstead.
1256
1257         Use COORDINATED_GRAPHICS instead.
1258
1259         * platform/graphics/GraphicsContext3D.h:
1260         * platform/graphics/PlatformLayer.h:
1261         * platform/graphics/cairo/ImageBufferCairo.cpp:
1262         (WebCore::ImageBufferData::ImageBufferData):
1263         (WebCore::ImageBufferData::~ImageBufferData):
1264         * platform/graphics/cairo/ImageBufferDataCairo.h:
1265         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
1266         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
1267         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
1268         (Nicosia::GC3DLayer::swapBuffersIfNeeded):
1269         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1270         (WebCore::GraphicsContext3D::reshapeFBOs):
1271         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1272         (WebCore::GraphicsContext3D::prepareTexture):
1273         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
1274         (WebCore::GraphicsContext3D::reshapeFBOs):
1275         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
1276         (WebCore::GraphicsContext3D::GraphicsContext3D):
1277         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1278         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
1279         (WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
1280         (WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
1281         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
1282         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1283         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
1284         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
1285         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
1286         * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h:
1287         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1288         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
1289         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
1290         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
1291         * rendering/RenderLayerBacking.cpp:
1292         (WebCore::RenderLayerBacking::paintsIntoWindow const):
1293         * rendering/RenderLayerCompositor.cpp:
1294         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
1295
1296 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
1297
1298         Locale names can be nullptr
1299         https://bugs.webkit.org/show_bug.cgi?id=195171
1300         <rdar://problem/48262376>
1301
1302         Reviewed by Dean Jackson.
1303
1304         Nullptr can't be used in keys to HashMaps, so take an early out in this case.
1305
1306         This is a partial revert of r241288.
1307
1308         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1309         (WebCore::FontDescription::platformResolveGenericFamily):
1310
1311 2019-02-28  Justin Fan  <justin_fan@apple.com>
1312
1313         [Web GPU] Enable Web GPU only on 64-bit
1314         https://bugs.webkit.org/show_bug.cgi?id=195139
1315
1316         Because Metal is only supported on 64 bit apps.
1317
1318         Unreviewed build fix.
1319
1320         * Configurations/FeatureDefines.xcconfig:
1321
1322 2019-02-27  Zalan Bujtas  <zalan@apple.com>
1323
1324         [ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
1325         https://bugs.webkit.org/show_bug.cgi?id=195128
1326         <rdar://problem/48456752>
1327
1328         Reviewed by Simon Fraser.
1329
1330         Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.
1331
1332         * WebCore.xcodeproj/project.pbxproj:
1333         * page/ios/ContentChangeObserver.mm:
1334         (WebCore::ContentChangeObserver::setObservedContentChange):
1335         * platform/ios/wak/WKContentObservation.cpp:
1336         (WKSetObservedContentChange):
1337         * platform/ios/wak/WKContentObservation.h:
1338         * platform/ios/wak/WKContentObservationInternal.h: Removed.
1339
1340 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
1341
1342         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
1343
1344         * dom/Document.cpp:
1345         (WebCore::Document::lastModified const):
1346         * html/FTPDirectoryDocument.cpp:
1347         (WebCore::processFileDateString):
1348         * mathml/MathMLElement.cpp:
1349         (WebCore::convertToPercentageIfNeeded):
1350         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
1351         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1352         (WebCore::ResourceUsageOverlay::platformDraw):
1353         * page/linux/ResourceUsageOverlayLinux.cpp:
1354         (WebCore::cpuUsageString):
1355         (WebCore::gcTimerString):
1356         * platform/DateComponents.cpp:
1357         (WebCore::DateComponents::toStringForTime const):
1358         (WebCore::DateComponents::toString const):
1359         * platform/LocalizedStrings.cpp:
1360         (WebCore::localizedString):
1361         * platform/audio/HRTFElevation.cpp:
1362         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
1363         * platform/mock/MockRealtimeVideoSource.cpp:
1364         (WebCore::MockRealtimeVideoSource::drawText):
1365         * rendering/RenderLayerCompositor.cpp:
1366         (WebCore::RenderLayerCompositor::logLayerInfo):
1367         * rendering/RenderTheme.cpp:
1368         (WebCore::RenderTheme::formatMediaControlsTime const):
1369
1370 2019-02-27  Zalan Bujtas  <zalan@apple.com>
1371
1372         [ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
1373         https://bugs.webkit.org/show_bug.cgi?id=195091
1374         <rdar://problem/48427271>
1375
1376         Reviewed by Tim Horton.
1377
1378         * page/ios/ContentChangeObserver.h:
1379         * page/ios/ContentChangeObserver.mm:
1380         (WebCore::ContentChangeObserver::startObservingContentChanges):
1381         (WebCore::ContentChangeObserver::stopObservingContentChanges):
1382         (WebCore::ContentChangeObserver::isObservingContentChanges):
1383         * platform/ios/wak/WKContentObservation.cpp:
1384         (WKObservingContentChanges): Deleted.
1385         (WKStartObservingContentChanges): Deleted.
1386         (WKStopObservingContentChanges): Deleted.
1387         * platform/ios/wak/WKContentObservation.h:
1388         * platform/ios/wak/WKContentObservationInternal.h:
1389
1390 2019-02-27  Brady Eidson  <beidson@apple.com>
1391
1392         Universal links from Google search results pages don't open the app.
1393         <rdar://problem/46887179> and https://bugs.webkit.org/show_bug.cgi?id=195126
1394
1395         Reviewed by Geoffrey Garen.
1396
1397         Covered by new API tests.
1398
1399         * loader/DocumentLoader.cpp:
1400         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const): Propagate the external URL policy from
1401           an iframe if it is from the same security origin as the main frame.
1402
1403 2019-02-27  Zalan Bujtas  <zalan@apple.com>
1404
1405         [ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeObserver class
1406         https://bugs.webkit.org/show_bug.cgi?id=195090
1407         <rdar://problem/48426771>
1408
1409         Reviewed by Tim Horton.
1410
1411         Also remove some unused functions from WKContentObservationInternal.
1412
1413         * page/ios/ContentChangeObserver.h:
1414         * page/ios/ContentChangeObserver.mm:
1415         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
1416         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
1417         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling):
1418         * platform/ios/wak/WKContentObservation.cpp:
1419         (WKStartObservingDOMTimerScheduling): Deleted.
1420         (WKStopObservingDOMTimerScheduling): Deleted.
1421         (WKIsObservingDOMTimerScheduling): Deleted.
1422         * platform/ios/wak/WKContentObservation.h:
1423         * platform/ios/wak/WKContentObservationInternal.h:
1424
1425 2019-02-27  Zalan Bujtas  <zalan@apple.com>
1426
1427         [ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
1428         https://bugs.webkit.org/show_bug.cgi?id=195087
1429
1430         Reviewed by Simon Fraser.
1431
1432         Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.
1433
1434         * page/ios/ContentChangeObserver.h:
1435         * page/ios/ContentChangeObserver.mm:
1436         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
1437         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
1438         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
1439         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
1440         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
1441         (WebCore::ContentChangeObserver::setObservedContentChange):
1442         * platform/ios/wak/WKContentObservation.cpp:
1443         (WKSetObservedContentChange):
1444         (WKStartObservingStyleRecalcScheduling): Deleted.
1445         (WKStopObservingStyleRecalcScheduling): Deleted.
1446         (WKIsObservingStyleRecalcScheduling): Deleted.
1447         (WKSetShouldObserveNextStyleRecalc): Deleted.
1448         (WKShouldObserveNextStyleRecalc): Deleted.
1449         * platform/ios/wak/WKContentObservation.h:
1450
1451 2019-02-27  Zalan Bujtas  <zalan@apple.com>
1452
1453         [ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
1454         https://bugs.webkit.org/show_bug.cgi?id=195070
1455         <rdar://problem/48417650>
1456
1457         Reviewed by Tim Horton.
1458
1459         Add DOM timer list to ContentChangeObserver and move the related code over from WK functions.
1460
1461         * page/ios/ContentChangeObserver.h:
1462         * page/ios/ContentChangeObserver.mm:
1463         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
1464         (WebCore::ContentChangeObserver::countOfObservedDOMTimers):
1465         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
1466         (WebCore::ContentChangeObserver::setObservedContentChange):
1467         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
1468         (WebCore::ContentChangeObserver::addObservedDOMTimer):
1469         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
1470         * platform/ios/wak/WKContentObservation.cpp:
1471         (WKStartObservingDOMTimerScheduling):
1472         (WKSetObservedContentChange):
1473         (WebThreadGetObservedDOMTimers): Deleted.
1474         (WebThreadCountOfObservedDOMTimers): Deleted.
1475         (WebThreadClearObservedDOMTimers): Deleted.
1476         (WebThreadContainsObservedDOMTimer): Deleted.
1477         (WebThreadAddObservedDOMTimer): Deleted.
1478         (WebThreadRemoveObservedDOMTimer): Deleted.
1479         * platform/ios/wak/WKContentObservation.h:
1480
1481 2019-02-27  Justin Fan  <justin_fan@apple.com>
1482         Fix build errors after Web GPU buffer updates changed some IDL fields from unsigned long to unsigned long long.
1483
1484         Unreviewed build fix.
1485
1486         * Modules/webgpu/WebGPUBuffer.cpp:
1487         (WebCore::WebGPUBuffer::setSubData):
1488         * Modules/webgpu/WebGPUBuffer.h:
1489         * Modules/webgpu/WebGPUBufferBinding.h:
1490         * Modules/webgpu/WebGPURenderPassEncoder.idl:
1491         * platform/graphics/gpu/GPUBufferBinding.h:
1492         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
1493         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
1494
1495 2019-02-27  John Wilander  <wilander@apple.com>
1496
1497         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
1498         https://bugs.webkit.org/show_bug.cgi?id=195071
1499         <rdar://problem/48417690>
1500
1501         Reviewed by Alex Christensen and Brent Fulgham.
1502
1503         No new tests. This patch maintains functionality covered by plenty of layout
1504         tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.
1505
1506         This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
1507         and makes the necessary infrastructure changes to support that.
1508
1509         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
1510         HashSets since we never used the counts for anything. This change simplified
1511         encoding and decoding for IPC and will eventually simplify encoding and
1512         decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
1513         model version 14 and below.
1514
1515         The patch also makes WebCore::RegistrableDomain's String constructor private.
1516         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
1517         is introduced to better signal to users that creating a registrable domain
1518         object with a string may create an object that doesn't match a registrable
1519         domain in a valid HTTP-family URL. This change (private String constructor)
1520         motivated a change in WebCore::AdClickAttribution where the Source and
1521         Destination structs now take a URL as parameter instead of a String.
1522
1523         Finally, this patch harmonizes parameter and variable naming, going from
1524         "origin" to "domain" and "mainFrame" to "topFrame."
1525
1526         * html/HTMLAnchorElement.cpp:
1527         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
1528         * html/HTMLMediaElement.cpp:
1529         (WebCore::HTMLMediaElement::mediaSessionTitle const):
1530         * loader/AdClickAttribution.h:
1531         (WebCore::AdClickAttribution::Source::Source):
1532         (WebCore::AdClickAttribution::Source::deletedValue):
1533         (WebCore::AdClickAttribution::Destination::Destination):
1534         (WebCore::AdClickAttribution::Destination::deletedValue):
1535         (WebCore::AdClickAttribution::decode):
1536         * loader/ResourceLoadObserver.cpp:
1537         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1538         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1539         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1540         (WebCore::ResourceLoadObserver::statisticsForURL):
1541         (WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
1542         * loader/ResourceLoadObserver.h:
1543         * loader/ResourceLoadStatistics.cpp:
1544         (WebCore::encodeHashSet):
1545         (WebCore::ResourceLoadStatistics::encode const):
1546         (WebCore::decodeHashCountedSet):
1547         (WebCore::decodeHashSet):
1548         (WebCore::ResourceLoadStatistics::decode):
1549         (WebCore::appendHashSet):
1550         (WebCore::ResourceLoadStatistics::toString const):
1551         (WebCore::ResourceLoadStatistics::merge):
1552         (WebCore::encodeHashCountedSet): Deleted.
1553         (WebCore::encodeOriginHashSet): Deleted.
1554         (WebCore::decodeOriginHashSet): Deleted.
1555         (WebCore::appendHashCountedSet): Deleted.
1556         * loader/ResourceLoadStatistics.h:
1557         * platform/RegistrableDomain.h:
1558         (WebCore::RegistrableDomain::uncheckedCreateFromString):
1559         (WebCore::RegistrableDomain::RegistrableDomain):
1560         * testing/Internals.cpp:
1561         (WebCore::Internals::resourceLoadStatisticsForURL):
1562         (WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
1563         * testing/Internals.h:
1564         * testing/Internals.idl:
1565
1566 2019-02-27  Justin Fan  <justin_fan@apple.com>
1567
1568         [Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
1569         https://bugs.webkit.org/show_bug.cgi?id=195077
1570         <rdar://problem/47805229>
1571
1572         Reviewed by Dean Jackson.
1573
1574         Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be 
1575         used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
1576         update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.
1577
1578         Tests: webgpu/buffer-command-buffer-races.html
1579                webgpu/map-read-buffers.html
1580
1581         * Modules/webgpu/WebGPUBindGroup.h:
1582         (WebCore::WebGPUBindGroup::bindGroup const):
1583         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
1584         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
1585         * Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
1586         (WebCore::WebGPUBuffer::setSubData):
1587         (WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
1588         (WebCore::WebGPUBuffer::destroy):
1589         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
1590         * Modules/webgpu/WebGPUBuffer.h:
1591         (WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
1592         * Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
1593         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1594         (WebCore::WebGPUCommandBuffer::beginRenderPass):
1595         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1596         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
1597         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1598         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1599         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
1600         * Sources.txt:
1601         * WebCore.xcodeproj/project.pbxproj:
1602         * platform/graphics/gpu/GPUBuffer.h:
1603         (WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
1604         (WebCore::GPUBuffer::isVertex const):
1605         (WebCore::GPUBuffer::isUniform const):
1606         (WebCore::GPUBuffer::isStorage const):
1607         (WebCore::GPUBuffer::isReadOnly const):
1608         (WebCore::GPUBuffer::isMappable const):
1609         (WebCore::GPUBuffer::isMapWrite const):
1610         (WebCore::GPUBuffer::isMapRead const):
1611         (WebCore::GPUBuffer::isMapWriteable const):
1612         (WebCore::GPUBuffer::isMapReadable const):
1613         * platform/graphics/gpu/GPUBufferBinding.h:
1614         * platform/graphics/gpu/GPUCommandBuffer.h:
1615         (WebCore::GPUCommandBuffer::usedBuffers const):
1616         (WebCore::GPUCommandBuffer::useBuffer):
1617         * platform/graphics/gpu/GPUDevice.cpp:
1618         (WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
1619         (WebCore::GPUDevice::tryCreateBuffer const): Deleted.
1620         * platform/graphics/gpu/GPUDevice.h:
1621         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
1622         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
1623         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
1624         (WebCore::GPUProgrammablePassEncoder::commandBuffer const):
1625         * platform/graphics/gpu/GPURenderPassEncoder.h:
1626         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1627         (WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
1628         (WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
1629         (WebCore::GPUBuffer::GPUBuffer):
1630         (WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
1631         (WebCore::GPUBuffer::state const):
1632         (WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
1633         (WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
1634         (WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
1635         (WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
1636         (WebCore::GPUBuffer::registerMappingCallback):
1637         (WebCore::GPUBuffer::runMappingCallback):
1638         (WebCore::GPUBuffer::unmap):
1639         (WebCore::GPUBuffer::destroy):
1640         (WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
1641         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
1642         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
1643         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
1644         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
1645         (WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
1646         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1647         (WebCore::GPURenderPassEncoder::tryCreate):
1648         (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
1649         (WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
1650         (WebCore::GPURenderPassEncoder::create): Deleted.
1651
1652         Buffer size updates in the IDL:
1653         * Modules/webgpu/GPUBufferDescriptor.idl:
1654         * Modules/webgpu/WebGPUBuffer.idl:
1655         * Modules/webgpu/WebGPUBufferBinding.idl:
1656         * Modules/webgpu/WebGPUCommandBuffer.idl:
1657         * Modules/webgpu/WebGPURenderPassEncoder.idl:
1658         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
1659         * Modules/webgpu/WebGPUVertexInputDescriptor.idl:
1660
1661 2019-02-27  Youenn Fablet  <youenn@apple.com>
1662
1663         Remove LeetCode FetchRequest quirk
1664         https://bugs.webkit.org/show_bug.cgi?id=195100
1665
1666         Reviewed by Alex Christensen.
1667
1668         Covered by manual testing.
1669
1670         * Modules/fetch/FetchRequest.cpp:
1671         (WebCore::needsSignalQuirk):
1672
1673 2019-02-27  Chris Dumez  <cdumez@apple.com>
1674
1675         Unable to log into chase.com on iPad when DeviceMotionEvent API is disabled
1676         https://bugs.webkit.org/show_bug.cgi?id=195101
1677         <rdar://problem/48423023>
1678
1679         Reviewed by Geoffrey Garen.
1680
1681         Add site-specific quirk for chase.com on iOS where we fire a dummy DeviceMotionEvent if the page
1682         tries to register a "devicemotion" event listener and fails because the API is disabled. This is
1683         needed to unblock the site and proceed with the login flow.
1684
1685         Unfortunately, document()->settings().needsSiteSpecificQuirks() is false on iOS so I could not
1686         guard the quirk behind this flag.
1687
1688         * page/DOMWindow.cpp:
1689         (WebCore::DOMWindow::addEventListener):
1690         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
1691         * page/DOMWindow.h:
1692
1693 2019-02-27  Antoine Quint  <graouts@apple.com>
1694
1695         Support Pointer Events on macOS
1696         https://bugs.webkit.org/show_bug.cgi?id=195008
1697         <rdar://problem/47454419>
1698
1699         Reviewed by Dean Jackson.
1700
1701         We now dispatch relevant pointer events as we prepare to dispatch mouse events. In most cases, this means we dispatch
1702         a pointer event of the same type, with "mouse" being substituted by "pointer", and with the same properties with the
1703         exception that if preventDefault() is called for a "pointerdown" event, the matching "mousedown" will not be dispatched,
1704         and the same behavior also extends to "pointerup".
1705
1706         Tests: pointerevents/mouse/over-enter-out-leave.html
1707                pointerevents/mouse/pointer-capture.html
1708                pointerevents/mouse/pointer-event-basic-properties.html
1709                pointerevents/mouse/pointer-events-before-mouse-events.html
1710                pointerevents/mouse/pointerdown-prevent-default.html
1711
1712         * Configurations/FeatureDefines.xcconfig:
1713         * dom/Document.cpp: All of the touch-action related members and functions should be iOS-specific since the touch-action
1714         property does not have any effect on macOS.
1715         (WebCore::Document::invalidateRenderingDependentRegions):
1716         (WebCore::Document::nodeWillBeRemoved):
1717         (WebCore::Document::updateTouchActionElements):
1718         * dom/Document.h:
1719         * dom/Element.cpp:
1720         (WebCore::Element::dispatchMouseEvent): Dispatch a pointer event matching the mouse event that is about to be dispatched.
1721         If preventDefault() is called in the event handler for either "pointerdown" or "pointerup", do not proceed with dispatching
1722         the mouse event.
1723         * dom/PointerEvent.cpp:
1724         (WebCore::pointerEventType):
1725         (WebCore::PointerEvent::create):
1726         * dom/PointerEvent.h:
1727         * page/EventHandler.cpp: Check both the pointer and mouse events to see if we need to dispatch "enter" and "leave" events.
1728         (WebCore::hierarchyHasCapturingEventListeners):
1729         (WebCore::EventHandler::updateMouseEventTargetNode):
1730         * page/PointerCaptureController.cpp: Fix a build error which only happened on macOS.
1731         (WebCore::PointerCaptureController::PointerCaptureController): Create the CapturingData for the unique mouse pointer.
1732         (WebCore::PointerCaptureController::hasPointerCapture): The code did not match the spec cited in the comment, only the
1733         pending target override needs to be considered to determine whether a given element has pointer capture enabled.
1734         (WebCore::PointerCaptureController::dispatchEvent): Dispatch the provided pointer event, accounting for pointer capture if
1735         it is set.
1736         * page/PointerLockController.cpp: Fix a build error which only happened on macOS.
1737         * style/StyleTreeResolver.cpp:
1738         (WebCore::Style::TreeResolver::resolveElement): Code related to touch-action is only relevant to iOS.
1739
1740 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
1741
1742         Network Process is put to suspended when holding locked IndexedDB files
1743         https://bugs.webkit.org/show_bug.cgi?id=195024
1744         <rdar://problem/45194169>
1745
1746         Reviewed by Geoffrey Garen.
1747
1748         We found network process was suspended when IDBDatabase was being closed in the background database thread, 
1749         holding locks to its database file. To avoid starvation or deadlock, we need to keep network process alive by 
1750         taking background assertion in UI process until the closes are done and locks are released.
1751
1752         * Modules/indexeddb/server/IDBServer.cpp:
1753         (WebCore::IDBServer::IDBServer::create):
1754         (WebCore::IDBServer::IDBServer::IDBServer):
1755         (WebCore::IDBServer::IDBServer::createBackingStore):
1756         (WebCore::IDBServer::IDBServer::closeDatabase):
1757         (WebCore::IDBServer::IDBServer::didCloseDatabase):
1758         * Modules/indexeddb/server/IDBServer.h:
1759         (WebCore::IDBServer::IDBServer::create):
1760         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1761         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
1762         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
1763         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
1764         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1765         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1766         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
1767         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1768
1769 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
1770
1771         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
1772         https://bugs.webkit.org/show_bug.cgi?id=194973
1773
1774         Reviewed by Antti Koivisto.
1775
1776         This patch cleans up how the scrolling tree responds to scrolls.
1777
1778         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
1779         UI process scroll position.
1780
1781         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
1782         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
1783         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
1784         updates related layers on this node (counter-scrolling layers etc), and then tells the
1785         scrolling tree, which recurses through descendant nodes so they can adjust their layer
1786         positions.
1787
1788         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
1789         which does the above other than setting scrolledContentsLayer (since we're reacting to
1790         layer state changes, not producing them).
1791
1792         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
1793         ScrollingTree does the tree walk so classes don't have to implement
1794         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
1795         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
1796         need to cross frame boundaries).
1797
1798         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
1799         since the fixed state was computed with the "layout" scroll position, so we have to account
1800         for the scroll delta since the last committed position. It's possible we could improve this
1801         in future.
1802
1803         * page/scrolling/ScrollingTree.cpp:
1804         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
1805         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
1806         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
1807         (WebCore::ScrollingTree::mainFrameLayoutViewport):
1808         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
1809         * page/scrolling/ScrollingTree.h:
1810         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1811         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
1812         * page/scrolling/ScrollingTreeFrameHostingNode.h:
1813         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1814         (WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
1815         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
1816         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1817         * page/scrolling/ScrollingTreeNode.cpp:
1818         (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
1819         (WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
1820         * page/scrolling/ScrollingTreeNode.h:
1821         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1822         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
1823         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
1824         (WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
1825         (WebCore::ScrollingTreeScrollingNode::scrollBy):
1826         (WebCore::ScrollingTreeScrollingNode::scrollTo):
1827         (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
1828         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
1829         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
1830         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
1831         (WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
1832         * page/scrolling/ScrollingTreeScrollingNode.h:
1833         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
1834         (WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
1835         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
1836         * page/scrolling/ThreadedScrollingTree.cpp:
1837         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
1838         * page/scrolling/ThreadedScrollingTree.h:
1839         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
1840         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1841         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
1842         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
1843         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1844         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1845         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
1846         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
1847         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1848         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1849         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1850         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
1851         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1852         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
1853         (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
1854         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
1855         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
1856         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
1857         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
1858         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
1859         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
1860         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
1861         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
1862         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1863         (): Deleted.
1864         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1865         (WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
1866         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
1867         (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
1868         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
1869         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
1870         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
1871         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
1872         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
1873         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1874         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
1875         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
1876         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
1877         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
1878         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
1879         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
1880
1881 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
1882
1883         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
1884         https://bugs.webkit.org/show_bug.cgi?id=194973
1885
1886         Reviewed by Antti Koivisto.
1887
1888         The "master" value for the scroll position of a ScrollingTreeScrollingNode is now its m_scrollPosition member;
1889         layout viewports and layer positions will be set from this. This allows scrollPosition() to no longer be virtual
1890         and require different code for each scrolling node subclass, and adds a choke point that we can use to update
1891         the layout viewport.
1892         
1893         We can remove m_probableMainThreadScrollPosition on ScrollingTreeFrameScrollingNodeMac because this was really just
1894         an alias for the scroll position.
1895
1896         Add some isRootNode() checks for things that should only affect the main frame.
1897
1898         * page/scrolling/ScrollingTree.h: Remove fixedPositionRect() which was unused, and is a per-frame thing so makes
1899         no sense here.
1900         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1901         (WebCore::ScrollingTreeFrameScrollingNode::didChangeScrollPosition):
1902         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1903         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewport const):
1904         (WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
1905         (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Deleted.
1906         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1907         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
1908         (WebCore::ScrollingTreeScrollingNode::setScrollPositionInternal):
1909         (WebCore::ScrollingTreeScrollingNode::didChangeScrollPosition):
1910         * page/scrolling/ScrollingTreeScrollingNode.h:
1911         (WebCore::ScrollingTreeScrollingNode::scrollPosition const):
1912         * page/scrolling/ios/ScrollingTreeIOS.cpp:
1913         (WebCore::ScrollingTreeIOS::fixedPositionRect): Deleted.
1914         * page/scrolling/ios/ScrollingTreeIOS.h:
1915         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1916         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1917         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1918         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
1919         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1920         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
1921         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
1922         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
1923         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1924         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1925         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
1926
1927 2019-02-27  Ulrich Pflueger  <up@nanocosmos.de>
1928
1929         [MSE] SourceBuffer sample time increment vs. last frame duration check is broken
1930         https://bugs.webkit.org/show_bug.cgi?id=194747
1931         <rdar://problem/48148469>
1932
1933         Reviewed by Jer Noble.
1934
1935         Prevent unintended frame drops by including last frame duration in discontinuity check. 
1936
1937         Test: media/media-source/media-source-append-variable-frame-lengths-with-matching-durations.html
1938
1939         * Modules/mediasource/SourceBuffer.cpp:
1940         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1941
1942 2019-02-27  Timothy Hatcher  <timothy@apple.com>
1943
1944         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
1945         https://bugs.webkit.org/show_bug.cgi?id=195086
1946         rdar://problem/48419124
1947
1948         Reviewed by Tim Horton.
1949
1950         * platform/mac/ScrollAnimatorMac.mm:
1951         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
1952
1953 2019-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1954
1955         Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
1956         https://bugs.webkit.org/show_bug.cgi?id=195067
1957         <rdar://problem/44812080>
1958
1959         Reviewed by Tim Horton.
1960
1961         This iOS-specific override was introduced to fix <rdar://problem/7114425>, in which the last typed character
1962         would be revealed when redoing text input on iOS inside a password field. The associated change fixed this bug
1963         by overriding doReapply on iOS to only insert text (instead of additionally handling password echo); however, it
1964         really makes sense to skip password echo when redoing on all platforms, so we can just remove the platform-
1965         specific guards around this logic.
1966
1967         Doing this allows us to add the `hasEditableStyle()` check on iOS when redoing text insertion, which results in
1968         a very subtle behavior change covered by the new layout test below.
1969
1970         Test: editing/undo/redo-text-insertion-in-non-editable-node.html
1971
1972         * editing/InsertIntoTextNodeCommand.cpp:
1973         (WebCore::InsertIntoTextNodeCommand::doReapply):
1974         * editing/InsertIntoTextNodeCommand.h:
1975
1976 2019-02-26  Keith Miller  <keith_miller@apple.com>
1977
1978         Code quality cleanup in NeverDestroyed
1979         https://bugs.webkit.org/show_bug.cgi?id=194824
1980
1981         Reviewed by Mark Lam.
1982
1983         name_names.pl should not just assume the layout of LazyNeverDestroyed.
1984
1985         * dom/make_names.pl:
1986         (printNamesCppFile):
1987
1988 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1989
1990         Do not try to observe the timer when Page is nullptr
1991         https://bugs.webkit.org/show_bug.cgi?id=195076
1992
1993         Reviewed by Tim Horton.
1994
1995         Covered by fast/dom/Window/timer-null-script-execution-context.html.
1996
1997         * page/DOMTimer.cpp:
1998         (WebCore::DOMTimer::install):
1999
2000 2019-02-20  Jer Noble  <jer.noble@apple.com>
2001
2002         [Cocoa] Media elements will restart network buffering just before suspending
2003         https://bugs.webkit.org/show_bug.cgi?id=193691
2004
2005         Reviewed by Eric Carlson.
2006
2007         API Test: WebKit.ProcessSuspendMediaBuffering
2008
2009         Allow the Page to suspend all media buffering in its child Documents.
2010
2011         * dom/Document.cpp:
2012         (WebCore::Document::suspendAllMediaBuffering):
2013         (WebCore::Document::resumeAllMediaBuffering):
2014         * dom/Document.h:
2015         * html/MediaElementSession.cpp:
2016         (WebCore::MediaElementSession::dataBufferingPermitted const):
2017         (WebCore::MediaElementSession::suspendBuffering):
2018         (WebCore::MediaElementSession::resumeBuffering):
2019         (WebCore::MediaElementSession::bufferingSuspended const):
2020         * html/MediaElementSession.h:
2021         * page/Page.cpp:
2022         (WebCore::Page::suspendAllMediaBuffering):
2023         (WebCore::Page::resumeAllMediaBuffering):
2024         * page/Page.h:
2025         (WebCore::Page::mediaPlaybackIsSuspended const):
2026         (WebCore::Page::mediaBufferingIsSuspended const):
2027         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
2028         * platform/audio/PlatformMediaSession.h:
2029         (WebCore::PlatformMediaSession::suspendBuffering):
2030         (WebCore::PlatformMediaSession::resumeBuffering):
2031         * platform/audio/PlatformMediaSessionManager.cpp:
2032         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
2033         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
2034         * platform/audio/PlatformMediaSessionManager.h:
2035
2036 2019-02-26  Youenn Fablet  <youenn@apple.com>
2037
2038         Move service worker response validation from the service worker client to the service worker itself
2039         https://bugs.webkit.org/show_bug.cgi?id=194716
2040
2041         Reviewed by Geoffrey Garen.
2042
2043         Added response validation at service worker side.
2044
2045         No change of behavior except for now logging validation error messages in the console.
2046         Covered by rebased tests.
2047
2048         * workers/service/context/ServiceWorkerFetch.cpp:
2049         (WebCore::ServiceWorkerFetch::validateResponse):
2050         (WebCore::ServiceWorkerFetch::processResponse):
2051         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
2052
2053 2019-02-26  Sihui Liu  <sihui_liu@apple.com>
2054
2055         [Mac WK2] storage/indexeddb/IDBObject-leak.html is flaky
2056         https://bugs.webkit.org/show_bug.cgi?id=195036
2057
2058         Reviewed by Geoffrey Garen.
2059
2060         When connection to IDBServer is lost, IDBDatabase in web process should not only stop active transactions, but 
2061         also transactions in committing process.
2062
2063         Also, TransactionOpration should clear its perform function when the operation is being completed, otherwise 
2064         there is a reference cycle of TransactionOpration.
2065
2066         Covered by existing tests storage/indexeddb/IDBObject-leak.html.
2067
2068         * Modules/indexeddb/IDBDatabase.cpp:
2069         (WebCore::IDBDatabase::connectionToServerLost): notify committing transasctions that connection is lost.
2070         * Modules/indexeddb/IDBTransaction.cpp:
2071         (WebCore::IDBTransaction::connectionClosedFromServer): notify IDBConnectionProxy that transaction ends.
2072         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2073         (WebCore::IDBClient::IDBConnectionProxy::forgetTransaction): clear finished transactions.
2074         * Modules/indexeddb/client/IDBConnectionProxy.h:
2075         * Modules/indexeddb/client/TransactionOperation.h:
2076         (WebCore::IDBClient::TransactionOperation::doComplete): clear perform function unconditionally when the 
2077         operation is in completion process. 
2078
2079 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2080
2081         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
2082         https://bugs.webkit.org/show_bug.cgi?id=195066
2083         <rdar://problem/48411682>
2084
2085         Reviewed by Tim Horton.
2086
2087         Now all the empty clearContentChangeObservers() implementations can be removed.
2088
2089         * dom/Document.cpp:
2090         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
2091         * loader/EmptyClients.h:
2092         * page/ChromeClient.h:
2093         * page/Frame.cpp:
2094         (WebCore::Frame::willDetachPage):
2095         * page/ios/ContentChangeObserver.h:
2096         * page/ios/ContentChangeObserver.mm:
2097         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
2098         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects): Might need to merge them.
2099         (WebCore::ContentChangeObserver::willDetachPage):
2100
2101 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2102
2103         [ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
2104         https://bugs.webkit.org/show_bug.cgi?id=195062
2105         <rdar://problem/48409258>
2106
2107         Reviewed by Tim Horton.
2108
2109         Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.
2110
2111         * dom/Document.cpp:
2112         (WebCore::Document::scheduleStyleRecalc):
2113         * page/DOMTimer.cpp:
2114         (WebCore::DOMTimer::install):
2115         * page/ios/ContentChangeObserver.h:
2116         * page/ios/ContentChangeObserver.mm:
2117         (WebCore::ContentChangeObserver::didInstallDOMTimer):
2118         (WebCore::ContentChangeObserver::didScheduleStyleRecalc):
2119         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.
2120
2121 2019-02-26  Chris Dumez  <cdumez@apple.com>
2122
2123         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
2124         https://bugs.webkit.org/show_bug.cgi?id=195054
2125         <rdar://problem/48330549>
2126
2127         Reviewed by Geoff Garen.
2128
2129         Add MaintainMemoryCache flag to indicate that the memory cache should not get purged.
2130
2131         * page/MemoryRelease.cpp:
2132         (WebCore::releaseNoncriticalMemory):
2133         (WebCore::releaseCriticalMemory):
2134         (WebCore::releaseMemory):
2135         * page/MemoryRelease.h:
2136
2137 2019-02-26  Commit Queue  <commit-queue@webkit.org>
2138
2139         Unreviewed, rolling out r241970.
2140         https://bugs.webkit.org/show_bug.cgi?id=195057
2141
2142         made the QuickLook.LegacyQuickLookContent API test flakey
2143         (Requested by estes on #webkit).
2144
2145         Reverted changeset:
2146
2147         "[iOS] Break a reference cycle between PreviewLoader and
2148         ResourceLoader"
2149         https://bugs.webkit.org/show_bug.cgi?id=194964
2150         https://trac.webkit.org/changeset/241970
2151
2152 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2153
2154         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
2155         https://bugs.webkit.org/show_bug.cgi?id=195023
2156         <rdar://problem/48381885>
2157
2158         Reviewed by Tim Horton.
2159
2160         In the future we might decide that certain activities don't require DOMTimer observation, but that should
2161         be internal to ContentChangeObserver.
2162
2163         * page/ios/ContentChangeObserver.h:
2164         * page/ios/ContentChangeObserver.mm:
2165         (WebCore::ContentChangeObserver::startObservingContentChanges):
2166         (WebCore::ContentChangeObserver::stopObservingContentChanges):
2167         * page/ios/EventHandlerIOS.mm:
2168         (WebCore::EventHandler::mouseMoved):
2169
2170 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2171
2172         [ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
2173         https://bugs.webkit.org/show_bug.cgi?id=195032
2174         <rdar://problem/48388063>
2175
2176         Reviewed by Tim Horton.
2177
2178         This might eventually turn into a regular start/stop content observing call.
2179
2180         * dom/Document.cpp:
2181         (WebCore::Document::updateStyleIfNeeded):
2182         * page/ios/ContentChangeObserver.h:
2183         * page/ios/ContentChangeObserver.mm:
2184         (WebCore::ContentChangeObserver::startObservingStyleResolve):
2185         (WebCore::ContentChangeObserver::stopObservingStyleResolve):
2186
2187 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2188
2189         [ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
2190         https://bugs.webkit.org/show_bug.cgi?id=195035
2191         <rdar://problem/48389123>
2192
2193         Reviewed by Tim Horton.
2194
2195         Visibility checking logic belongs to ContentChangeObserver.
2196
2197         * page/ios/ContentChangeObserver.h:
2198         * page/ios/ContentChangeObserver.mm:
2199         (WebCore::elementImplicitVisibility):
2200         (WebCore::ContentChangeObserver::StyleChange::StyleChange):
2201         (WebCore::ContentChangeObserver::StyleChange::~StyleChange):
2202         * rendering/updating/RenderTreeUpdater.cpp:
2203         (WebCore::RenderTreeUpdater::updateElementRenderer):
2204         (WebCore::elementImplicitVisibility): Deleted.
2205         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange): Deleted.
2206         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): Deleted.
2207
2208 2019-02-26  Philippe Normand  <pnormand@igalia.com>
2209
2210         [EGL] Runtime support for RGB565 pixel layout
2211         https://bugs.webkit.org/show_bug.cgi?id=194817
2212
2213         Reviewed by Carlos Garcia Campos.
2214
2215         Currently our graphics pipeline always relies on a ARGB8888 (32
2216         bpp) pixel configuration. On some low-end (old) embedded platforms
2217         the graphics driver is sometimes optimized for 16 bpp
2218         configurations, such as RGB565. On those platforms the application
2219         can now set the WEBKIT_EGL_PIXEL_LAYOUT environment variable to
2220         "RGB565" to adjust to the best pixel configuration supported by
2221         the screen and graphics driver.
2222
2223         * platform/graphics/egl/GLContextEGL.cpp:
2224         (WebCore::GLContextEGL::getEGLConfig):
2225
2226 2019-02-26  Philippe Normand  <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
2227
2228         [WPE] Add API for webview background color configuration
2229         https://bugs.webkit.org/show_bug.cgi?id=192305
2230
2231         Reviewed by Michael Catanzaro.
2232
2233         Adapt the FrameView API to allow a default non-white background color.
2234
2235         * page/Frame.cpp:
2236         (WebCore::Frame::createView): Replace isTransparent argument with a background color one.
2237         * page/Frame.h:
2238         * page/FrameView.cpp:
2239         (WebCore::FrameView::recalculateBaseBackgroundColor): Use Color::transparent if m_isTransparent is true.
2240         (WebCore::FrameView::updateBackgroundRecursively): Allow the fallback background color to be non-white, this is
2241         used only in non-dark-mode-css build configurations.
2242         * page/FrameView.h:
2243         * testing/Internals.cpp:
2244         (WebCore::Internals::setViewIsTransparent): Use Color::transparent if transparent is true.
2245
2246 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
2247
2248         scalableNativeWebpageParameters() is not preserved on new page navigation.
2249         https://bugs.webkit.org/show_bug.cgi?id=194892
2250         <rdar://problem/47538280>
2251
2252         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
2253         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
2254         configuration until we derive the right values from viewport meta-tag.
2255
2256         Reviewed by Wenson Hsieh.
2257
2258         Test: fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html
2259
2260         * page/ViewportConfiguration.cpp:
2261         (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): Use fixedNativeWebpageParameters().
2262         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Use nativeWebpageParameters.
2263         (WebCore::ViewportConfiguration::nativeWebpageParameters): Return the appropriate default configuration
2264             based on m_canIgnoreScalingConstraints and shouldIgnoreMinimumEffectiveDeviceWidth().
2265         (WebCore::ViewportConfiguration::fixedNativeWebpageParameters): Renamed from nativeWebpageParameters()
2266         (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Use fixedNativeWebpageParameters.
2267         * page/ViewportConfiguration.h: Make nativeWebpageParameters() an instance method and change the old
2268             static method to fixedNativeWebpageParameters which better reflects the actual behavior.
2269
2270 2019-02-25  Zalan Bujtas  <zalan@apple.com>
2271
2272         [ContentChangeObserver] Move observing logic from DOMWindow::clearTimeout to ContentChangeObserver
2273         https://bugs.webkit.org/show_bug.cgi?id=194988
2274         <rdar://problem/48343040>
2275
2276         Reviewed by Tim Horton.
2277
2278         ContentChangeObserver::removeDOMTimer takes care of the canceled timer removal.
2279
2280         * page/DOMWindow.cpp:
2281         (WebCore::DOMWindow::clearTimeout):
2282         * page/ios/ContentChangeObserver.h:
2283         * page/ios/ContentChangeObserver.mm:
2284         (WebCore::ContentChangeObserver::startObservingDOMTimer):
2285         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
2286         (WebCore::ContentChangeObserver::removeDOMTimer):
2287
2288 2019-02-25  Zalan Bujtas  <zalan@apple.com>
2289
2290         [ContentChangeObserver] Move observing logic from DOMTimer to ContentChangeObserver
2291         https://bugs.webkit.org/show_bug.cgi?id=194987
2292         <rdar://problem/48342910>
2293
2294         Reviewed by Tim Horton.
2295
2296         Content obvservation logic should all move to the ContentChangeObserver class.
2297
2298         * page/DOMTimer.cpp:
2299         (WebCore::DOMTimer::install):
2300         (WebCore::DOMTimer::fired):
2301         * page/Page.cpp:
2302         (WebCore::Page::Page):
2303         * page/Page.h:
2304         (WebCore::Page::contentChangeObserver):
2305         * page/ios/ContentChangeObserver.h:
2306         * page/ios/ContentChangeObserver.mm:
2307         (WebCore::ContentChangeObserver::ContentChangeObserver):
2308         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded):
2309         (WebCore::ContentChangeObserver::startObservingDOMTimer):
2310         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
2311         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
2312         (WebCore::ContentChangeObserver::addObservedDOMTimer):
2313         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
2314
2315 2019-02-25  John Wilander  <wilander@apple.com>
2316
2317         Introduce and adopt new class RegistrableDomain for eTLD+1
2318         https://bugs.webkit.org/show_bug.cgi?id=194791
2319         <rdar://problem/48179240>
2320
2321         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
2322
2323         A new API test was added. Plenty of existing layout tests under
2324         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
2325
2326         This patch introduces and adopts a new class called WebCore::RegistrableDomain
2327         which represents a domain's eTLD+1 (effective top level domain plus one) and is
2328         the basis for the term "site," as in same-site. Other popular names include
2329         high-level domain, primary domain, and top privately controlled/owned domain.
2330         Effective top level domains are enumerated on the Public Suffix List
2331         (https://publicsuffix.org).
2332
2333         This class just uses the full domain for when the Public Suffix List cannot help
2334         finding the registrable domain and for WebKit ports that haven't enabled
2335         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
2336         for the null or unique origin (this matches how these origins were handled
2337         before).
2338
2339         The implementation is a wrapper around a String and the functions and class
2340         members that now make use of this new class used to handle regular String
2341         objects which didn't help much in terms of type safety or guarantees that the
2342         string had already been converted to an eTLD+1.
2343
2344         We've at least two bad bugs in the Storage Access API because of confusion
2345         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
2346         will prohibit such bugs in the future.
2347
2348         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
2349         WebCore::RegistrableDomain for partitioning in a later patch.
2350
2351         This patch also enhances parameter naming by:
2352         - Removing parts that refer to "primary" as in primaryDomain.
2353         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
2354         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
2355         - Using the term "domain" consistently instead of e.g. "host."
2356
2357         * WebCore.xcodeproj/project.pbxproj:
2358         * dom/Document.cpp:
2359         (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
2360         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
2361         * dom/Document.h:
2362         * html/HTMLAnchorElement.cpp:
2363         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
2364         * html/HTMLMediaElement.cpp:
2365         (WebCore::HTMLMediaElement::mediaSessionTitle const):
2366         * loader/AdClickAttribution.cpp:
2367         (WebCore::AdClickAttribution::url const):
2368         (WebCore::AdClickAttribution::referrer const):
2369         (WebCore::AdClickAttribution::toString const):
2370         * loader/AdClickAttribution.h:
2371         (WebCore::AdClickAttribution::Source::Source):
2372         (WebCore::AdClickAttribution::Source::matches const):
2373         (WebCore::AdClickAttribution::Source::deleteValue):
2374         (WebCore::AdClickAttribution::Destination::Destination):
2375         (WebCore::AdClickAttribution::Destination::matches const):
2376         (WebCore::AdClickAttribution::Destination::deleteValue):
2377         * loader/ResourceLoadObserver.cpp:
2378         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
2379         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
2380         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback):
2381         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback):
2382         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback):
2383         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2384         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2385         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2386         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
2387         (WebCore::ResourceLoadObserver::logFontLoad):
2388         (WebCore::ResourceLoadObserver::logCanvasRead):
2389         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
2390         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
2391         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
2392         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
2393         (WebCore::ResourceLoadObserver::statisticsForOrigin):
2394         (WebCore::primaryDomain): Deleted.
2395         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain): Deleted.
2396         * loader/ResourceLoadObserver.h:
2397         * loader/ResourceLoadStatistics.cpp:
2398         (WebCore::ResourceLoadStatistics::encode const):
2399         (WebCore::ResourceLoadStatistics::decode):
2400         (WebCore::ResourceLoadStatistics::toString const):
2401         (WebCore::ResourceLoadStatistics::merge):
2402         (WebCore::ResourceLoadStatistics::primaryDomain): Deleted.
2403         * loader/ResourceLoadStatistics.h:
2404         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
2405         * page/Page.cpp:
2406         (WebCore::Page::logNavigation):
2407         (WebCore::Page::mainFrameLoadStarted):
2408         * page/Page.h:
2409         * page/PerformanceMonitor.cpp:
2410         (WebCore::reportPageOverPostLoadResourceThreshold):
2411         * platform/RegistrableDomain.h: Added.
2412         (WebCore::RegistrableDomain::RegistrableDomain):
2413         (WebCore::RegistrableDomain::isEmpty const):
2414         (WebCore::RegistrableDomain::string const):
2415         (WebCore::RegistrableDomain::operator!= const):
2416         (WebCore::RegistrableDomain::operator== const):
2417         (WebCore::RegistrableDomain::matches const):
2418         (WebCore::RegistrableDomain::isolatedCopy const):
2419         (WebCore::RegistrableDomain::isHashTableDeletedValue const):
2420         (WebCore::RegistrableDomain::hash const):
2421         (WebCore::RegistrableDomain::RegistrableDomainHash::hash):
2422         (WebCore::RegistrableDomain::RegistrableDomainHash::equal):
2423         (WebCore::RegistrableDomain::encode const):
2424         (WebCore::RegistrableDomain::decode):
2425         * platform/network/NetworkStorageSession.cpp:
2426         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
2427         (WebCore::NetworkStorageSession::shouldBlockCookies const):
2428         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
2429         (WebCore::NetworkStorageSession::removePrevalentDomains):
2430         (WebCore::NetworkStorageSession::hasStorageAccess const):
2431         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
2432         (WebCore::NetworkStorageSession::grantStorageAccess):
2433         (WebCore::getPartitioningDomain): Deleted.
2434         * platform/network/NetworkStorageSession.h:
2435
2436 2019-02-25  Chris Fleizach  <cfleizach@apple.com>
2437
2438         AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
2439         https://bugs.webkit.org/show_bug.cgi?id=190138
2440         <rdar://problem/44907695>
2441
2442         Reviewed by Joanmarie Diggs.
2443
2444         Make sure that footer elements use the right role depending on their context.
2445         If scoped to body, they become contentinfo. Otherwise they are just delineated by
2446         a footer subrole.
2447
2448         * accessibility/AccessibilityObject.cpp:
2449         (WebCore::AccessibilityObject::isLandmark const):
2450         * accessibility/AccessibilityRenderObject.cpp:
2451         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
2452         (WebCore::AccessibilityRenderObject::isDescendantOfElementType const):
2453         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2454         * accessibility/AccessibilityRenderObject.h:
2455         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2456         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
2457         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2458         (-[WebAccessibilityObjectWrapper subrole]):
2459
2460 2019-02-25  Sihui Liu  <sihui_liu@apple.com>
2461
2462         IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
2463         https://bugs.webkit.org/show_bug.cgi?id=194709
2464
2465         Reviewed by Geoffrey Garen.
2466
2467         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
2468         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
2469  
2470         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
2471         between IDBOpenDBRequest and IDBTransaction.
2472
2473         Test: storage/indexeddb/IDBObject-leak.html
2474
2475         * Modules/indexeddb/IDBDatabase.cpp:
2476         (WebCore::IDBDatabase::connectionToServerLost):
2477         * Modules/indexeddb/IDBTransaction.cpp:
2478         (WebCore::IDBTransaction::IDBTransaction):
2479         (WebCore::IDBTransaction::~IDBTransaction):
2480         (WebCore::IDBTransaction::connectionClosedFromServer):
2481         * Modules/indexeddb/IDBTransaction.h:
2482         * testing/Internals.cpp:
2483         (WebCore::Internals::numberOfIDBTransactions const):
2484         * testing/Internals.h:
2485         * testing/Internals.idl:
2486
2487 2019-02-25  Zalan Bujtas  <zalan@apple.com>
2488
2489         Add missing stream parameter. Unreviewed.
2490
2491         * page/DOMTimer.cpp:
2492         (WebCore::DOMTimer::fired):
2493
2494 2019-02-25  Zalan Bujtas  <zalan@apple.com>
2495
2496         Unreviewed build fix after r242032.
2497
2498         * page/DOMTimer.cpp:
2499         (WebCore::DOMTimer::install):
2500
2501 2019-02-20  Darin Adler  <darin@apple.com>
2502
2503         Incorrect use of String::foldCase for font family names
2504         https://bugs.webkit.org/show_bug.cgi?id=194895
2505
2506         Reviewed by Myles C. Maxfield.
2507
2508         * platform/graphics/FontCascadeDescription.cpp:
2509         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
2510         familyNamesAreEqual instead of calling convertToASCIILowercase directly.
2511         (WebCore::FontCascadeDescription::familyNamesAreEqual): Use AtomicString's
2512         operator== when we want case sensitive family name comparisons. This is a special
2513         case to accomodate CoreText, which uses "."-prefix names for internal fonts that
2514         are treated case sensitively. (Ideally webpages would not use these fonts at all.)
2515         (WebCore::FontCascadeDescription::familyNameHash): Use AtomicString's existingHash
2516         when we want case sensitive family name hashing.
2517         (WebCore::FontCascadeDescription::foldedFamilyName): Take a String instead of an
2518         AtomicString so we can use this at an additional call site. Converting from an
2519         AtomicString to a String if free and automatic at the existing call sites. Use
2520         convertToASCIILowercase instead of foldCase for three reasons: 1) Other functions
2521         here are folding only ASCII case by using ASCIICaseInsensitiveHash, and this one
2522         must be consistent. 2) this is considerably faster, and 3) font family names don't
2523         need arbitrary Unicode case folding, it's only A-Z that should be folded.
2524         * platform/graphics/FontCascadeDescription.h: Take a String instead of AtomicString
2525         in the foldedFamilyName function.
2526
2527         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2528         (WebCore::FontDatabase::collectionForFamily): Instead of calling foldCase, use
2529         FontCascadeDescription::foldedFamilyName to correctly fold font family names.
2530
2531 2019-02-25  Charlie Turner  <cturner@igalia.com>
2532
2533         [EME][GStreamer] Replace caps field loop with gst_structure_remove_fields
2534         https://bugs.webkit.org/show_bug.cgi?id=194992
2535
2536         Reviewed by Xabier Rodriguez-Calvar.
2537
2538         Refactoring, no new tests.
2539
2540         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2541         (transformCaps): Simplify the code a little. The idea to use this
2542         utility function came from a review upstream here:
2543         https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/67
2544
2545 2019-02-25  Alicia Boya García  <aboya@igalia.com>
2546
2547         [MSE][GStreamer] Batch player duration updates
2548         https://bugs.webkit.org/show_bug.cgi?id=194220
2549
2550         Reviewed by Xabier Rodriguez-Calvar.
2551
2552         This saves up a ton of CPU cycles doing layout unnecessarily when all
2553         the appended frames extend the duration of the movie, like in
2554         YTTV 2018 59.DASHLatencyVP9.
2555
2556         This patch is an optimization that introduces no new behavior.
2557
2558         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2559         (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
2560         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2561         (WebCore::MediaPlayerPrivateGStreamerMSE::blockDurationChanges):
2562         (WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
2563         (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
2564         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2565
2566 2019-02-25  Miguel Gomez  <magomez@igalia.com>
2567
2568         [WPE] Add support for holepunch using an external video player
2569         https://bugs.webkit.org/show_bug.cgi?id=194899
2570
2571         Reviewed by Xabier Rodriguez-Calvar.
2572
2573         Implement the holepunch feature to allow playback using an external player. This creates
2574         a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and
2575         whose goal is to just draw a transparent rectangle in the position where the video should be.
2576         This can be used to allow a player placed on a lower plane than the browser to become visible.
2577
2578         Added ManualTest wpe/video-player-holepunch-external.html to test the feature.
2579
2580         * PlatformWPE.cmake:
2581         * platform/HolePunch.cmake: Added.
2582         * platform/graphics/MediaPlayer.cpp:
2583         (WebCore::buildMediaEnginesVector):
2584         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added.
2585         (WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch):
2586         (WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch):
2587         (WebCore::MediaPlayerPrivateHolePunch::platformLayer const):
2588         (WebCore::MediaPlayerPrivateHolePunch::naturalSize const):
2589         (WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
2590         (WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded):
2591         (WebCore::MediaPlayerPrivateHolePunch::proxy const):
2592         (WebCore::mimeTypeCache):
2593         (WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes):
2594         (WebCore::MediaPlayerPrivateHolePunch::supportsType):
2595         (WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine):
2596         (WebCore::MediaPlayerPrivateHolePunch::notifyReadyState):
2597         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added.
2598         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2599         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
2600
2601 2019-02-24  Zalan Bujtas  <zalan@apple.com>
2602
2603         Introduce ContentChangeObserver class
2604         https://bugs.webkit.org/show_bug.cgi?id=194977
2605         <rdar://problem/48338115>
2606
2607         Reviewed by Simon Fraser.
2608
2609         This patch is about piping through all the related WK* calls. 
2610
2611         * SourcesCocoa.txt:
2612         * WebCore.xcodeproj/project.pbxproj:
2613         * dom/Document.cpp:
2614         (WebCore::Document::scheduleStyleRecalc):
2615         (WebCore::Document::updateStyleIfNeeded):
2616         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
2617         * loader/FrameLoader.cpp:
2618         * page/DOMTimer.cpp:
2619         (WebCore::DOMTimer::install):
2620         (WebCore::DOMTimer::fired):
2621         * page/DOMWindow.cpp:
2622         (WebCore::DOMWindow::clearTimeout):
2623         * page/Frame.cpp:
2624         (WebCore::Frame::willDetachPage):
2625         * page/Page.h:
2626         (WebCore::Page::contentChangeObserver):
2627         * page/ios/EventHandlerIOS.mm:
2628         (WebCore::EventHandler::mouseMoved):
2629         * rendering/updating/RenderTreeUpdater.cpp:
2630         (WebCore::RenderTreeUpdater::updateElementRenderer):
2631         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
2632         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
2633
2634 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
2635
2636         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
2637         https://bugs.webkit.org/show_bug.cgi?id=194984
2638
2639         Reviewed by Sam Weinig.
2640
2641         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
2642
2643         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
2644         current layout viewport rect. Instead, set the layout viewport on the root
2645         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
2646
2647         * page/scrolling/ScrollingTree.cpp:
2648         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
2649         (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Deleted.
2650         * page/scrolling/ScrollingTree.h:
2651         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
2652         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
2653         * page/scrolling/ScrollingTreeFrameHostingNode.h:
2654         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2655         * page/scrolling/ScrollingTreeNode.h:
2656         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2657         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange):
2658         * page/scrolling/ScrollingTreeScrollingNode.h:
2659         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
2660         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
2661         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
2662         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
2663         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
2664         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
2665         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2666         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2667         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2668         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
2669         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
2670
2671 2019-02-24  Devin Rousso  <drousso@apple.com>
2672
2673         Web Inspector: Change the InspectorOverlay to use native rather than canvas
2674         https://bugs.webkit.org/show_bug.cgi?id=105023
2675         <rdar://problem/13443692>
2676
2677         Reviewed by Brian Burg.
2678
2679         Should be no change in observed functionality.
2680
2681         * inspector/InspectorOverlay.h:
2682         * inspector/InspectorOverlay.cpp:
2683         (WebCore::truncateWithEllipsis): Added.
2684         (WebCore::localPointToRootPoint): Added.
2685         (WebCore::contentsQuadToCoordinateSystem):
2686         (WebCore::effectiveElementForNode): Added.
2687         (WebCore::quadToPath): Added.
2688         (WebCore::drawOutlinedQuadWithClip): Added.
2689         (WebCore::drawOutlinedQuad): Added.
2690         (WebCore::drawFragmentHighlight): Added.
2691         (WebCore::drawShapeHighlight): Added.
2692         (WebCore::InspectorOverlay::paint):
2693         (WebCore::InspectorOverlay::setIndicating):
2694         (WebCore::InspectorOverlay::shouldShowOverlay const):
2695         (WebCore::InspectorOverlay::update):
2696         (WebCore::InspectorOverlay::setShowPaintRects): Added.
2697         (WebCore::InspectorOverlay::showPaintRect):
2698         (WebCore::InspectorOverlay::updatePaintRectsTimerFired):
2699         (WebCore::InspectorOverlay::drawNodeHighlight):
2700         (WebCore::InspectorOverlay::drawQuadHighlight):
2701         (WebCore::InspectorOverlay::drawPaintRects):
2702         (WebCore::InspectorOverlay::drawBounds): Added.
2703         (WebCore::InspectorOverlay::drawRulers):
2704         (WebCore::InspectorOverlay::drawElementTitle): Added.
2705         (WebCore::contentsQuadToPage): Deleted.
2706         (WebCore::InspectorOverlay::setPausedInDebuggerMessage): Deleted.
2707         (WebCore::buildObjectForPoint): Deleted.
2708         (WebCore::buildObjectForRect): Deleted.
2709         (WebCore::buildArrayForQuad): Deleted.
2710         (WebCore::buildObjectForHighlight): Deleted.
2711         (WebCore::buildObjectForSize): Deleted.
2712         (WebCore::InspectorOverlay::setShowingPaintRects): Deleted.
2713         (WebCore::buildArrayForRendererFragments): Deleted.
2714         (WebCore::localPointToRoot): Deleted.
2715         (WebCore::appendPathCommandAndPoints): Deleted.
2716         (WebCore::appendPathSegment): Deleted.
2717         (WebCore::buildObjectForShapeOutside): Deleted.
2718         (WebCore::buildObjectForElementData): Deleted.
2719         (WebCore::InspectorOverlay::buildHighlightObjectForNode const): Deleted.
2720         (WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): Deleted.
2721         (WebCore::InspectorOverlay::drawPausedInDebuggerMessage): Deleted.
2722         (WebCore::InspectorOverlay::overlayPage): Deleted.
2723         (WebCore::InspectorOverlay::forcePaint): Deleted.
2724         (WebCore::InspectorOverlay::reset): Deleted.
2725         (WebCore::evaluateCommandInOverlay): Deleted.
2726         (WebCore::InspectorOverlay::evaluateInOverlay): Deleted.
2727         (WebCore::InspectorOverlay::freePage): Deleted.
2728
2729         * inspector/agents/InspectorPageAgent.cpp:
2730         (WebCore::InspectorPageAgent::disable):
2731         (WebCore::InspectorPageAgent::setShowPaintRects):
2732         Drive-by: rename `setShowingPaintRects` to better match the protocol.
2733
2734         * inspector/agents/page/PageDebuggerAgent.h:
2735         * inspector/agents/page/PageDebuggerAgent.cpp:
2736         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
2737         (WebCore::PageDebuggerAgent::setOverlayMessage): Deleted.
2738         Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.
2739
2740         * inspector/InspectorController.h:
2741         * inspector/InspectorController.cpp:
2742         (WebCore::InspectorController::createLazyAgents):
2743         (WebCore::InspectorController::disconnectFrontend):
2744         (WebCore::InspectorController::disconnectAllFrontends):
2745         (WebCore::InspectorController::buildObjectForHighlightedNodes const): Deleted.
2746
2747         * testing/Internals.h:
2748         * testing/Internals.idl:
2749         * testing/Internals.cpp:
2750         (WebCore::Internals::inspectorHighlightObject): Deleted.
2751
2752         * inspector/InspectorOverlayPage.css: Removed.
2753         * inspector/InspectorOverlayPage.html: Removed.
2754         * inspector/InspectorOverlayPage.js: Removed.
2755
2756         * CMakeLists.txt:
2757         * DerivedSources-input.xcfilelist:
2758         * DerivedSources-output.xcfilelist:
2759         * DerivedSources.make:
2760         * WebCore.xcodeproj/project.pbxproj:
2761
2762 2019-02-20  Darin Adler  <darin@apple.com>
2763
2764         Finish removing String::format
2765         https://bugs.webkit.org/show_bug.cgi?id=194893
2766
2767         Reviewed by Daniel Bates.
2768
2769         * dom/Document.cpp:
2770         (WebCore::Document::lastModified const): Use makeString and pad.
2771         * html/FTPDirectoryDocument.cpp:
2772         (WebCore::processFileDateString): Ditto.
2773
2774         * mathml/MathMLElement.cpp:
2775         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
2776
2777         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2778         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
2779
2780         * page/linux/ResourceUsageOverlayLinux.cpp:
2781         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
2782         (WebCore::gcTimerString): Use String::number.
2783
2784         * platform/DateComponents.cpp:
2785         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
2786         (WebCore::DateComponents::toString const): Ditto.
2787
2788         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
2789         and that was also inaccurate.
2790
2791         * platform/audio/HRTFElevation.cpp:
2792         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2793         Use makeString and pad.
2794         * platform/mock/MockRealtimeVideoSource.cpp:
2795         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
2796         * rendering/RenderLayerCompositor.cpp:
2797         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
2798         * rendering/RenderTheme.cpp:
2799         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
2800
2801 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2802
2803         [WPE][GTK] Remove user agent quirk for washingtonpost.com
2804         https://bugs.webkit.org/show_bug.cgi?id=194981
2805
2806         Reviewed by Žan Doberšek.
2807
2808         Remove user agent quirk for washingtonpost.com because we support JPEG 2000 now.
2809
2810         * platform/UserAgentQuirks.cpp:
2811         (WebCore::urlRequiresChromeBrowser):
2812
2813 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
2814
2815         Remove remnants of iOS WK1 scrolling tree code
2816         https://bugs.webkit.org/show_bug.cgi?id=194980
2817
2818         Reviewed by Sam Weinig.
2819
2820         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated,
2821         to reduce maintenance costs and simplify.
2822
2823         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS
2824         since that was the only concrete subclass, removing code which never applies to iOS WK2
2825         (e.g. the synchronous scrolling code path).
2826
2827         * SourcesCocoa.txt:
2828         * WebCore.xcodeproj/project.pbxproj:
2829         * page/FrameView.h:
2830         * page/scrolling/ScrollingCoordinator.cpp:
2831         * page/scrolling/ScrollingTree.h:
2832         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2833         * page/scrolling/ScrollingTreeNode.h:
2834         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2835         (WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
2836         * page/scrolling/ScrollingTreeScrollingNode.h:
2837         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterDelegatedScroll): Deleted.
2838         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const): Deleted.
2839         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const): Deleted.
2840         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets const): Deleted.
2841         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets const): Deleted.
2842         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges const): Deleted.
2843         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges const): Deleted.
2844         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex const): Deleted.
2845         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex const): Deleted.
2846         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Deleted.
2847         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Deleted.
2848         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const): Deleted.
2849         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const): Deleted.
2850         (WebCore::ScrollingTreeScrollingNode::reachableContentsSize const): Deleted.
2851         (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): Deleted.
2852         (WebCore::ScrollingTreeScrollingNode::scrollOrigin const): Deleted.
2853         (WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand const): Deleted.
2854         (WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand): Deleted.
2855         (WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity const): Deleted.
2856         (WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity const): Deleted.
2857         (WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar const): Deleted.
2858         (WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar const): Deleted.
2859         (WebCore::ScrollingTreeScrollingNode::canHaveScrollbars const): Deleted.
2860         (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): Deleted.
2861         (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const): Deleted.
2862         (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const): Deleted.
2863         * page/scrolling/ios/ScrollingCoordinatorIOS.h: Removed.
2864         * page/scrolling/ios/ScrollingCoordinatorIOS.mm: Removed.
2865         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Removed.
2866         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Removed.
2867         * page/scrolling/ios/ScrollingTreeIOS.cpp: Removed.
2868         * page/scrolling/ios/ScrollingTreeIOS.h: Removed.
2869         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2870         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
2871
2872 2019-02-23  Justin Fan  <justin_fan@apple.com>
2873
2874         [WebGPU] Buffer updates part 1: async mapping functions, unmap, and destroy
2875         https://bugs.webkit.org/show_bug.cgi?id=194665
2876
2877         Reviewed by Dean Jackson.
2878
2879         Test: map-write-buffers.html. Other tests updated to match new API.
2880
2881         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Added.
2882         (WebCore::validateBufferBindingType): Ensure buffer binding usages match the binding type.
2883         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Logic moved out from WebGPUDevice.cpp.
2884         * Modules/webgpu/WebGPUBindGroupDescriptor.h:
2885         * Modules/webgpu/WebGPUBuffer.cpp: Added GPUBuffer functionality.
2886         (WebCore::WebGPUBuffer::create):
2887         (WebCore::WebGPUBuffer::WebGPUBuffer):
2888         (WebCore::WebGPUBuffer::mapReadAsync):
2889         (WebCore::WebGPUBuffer::mapWriteAsync):
2890         (WebCore::WebGPUBuffer::unmap):
2891         (WebCore::WebGPUBuffer::destroy):
2892         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback): Register a mapping request on the GPUBuffer, if valid.
2893         * Modules/webgpu/WebGPUBuffer.h:
2894         (WebCore::WebGPUBuffer::buffer const):
2895         (WebCore::WebGPUBuffer::mapping const): Deleted.
2896         * Modules/webgpu/WebGPUBuffer.idl: Update to latest API and enable every function except setSubData.
2897         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2898         (WebCore::WebGPUCommandBuffer::beginRenderPass): Renamed descriptor conversion method.
2899         * Modules/webgpu/WebGPUDevice.cpp:
2900         (WebCore::WebGPUDevice::createBuffer const): Update to non-nullable return type.
2901         (WebCore::WebGPUDevice::createBindGroup const): Move descriptor validation logic to descriptor implementation.
2902         * Modules/webgpu/WebGPUDevice.h:
2903         * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
2904         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const): Renamed from validateAndConvertToGPUVersion.
2905         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2906         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Add validation for submitted buffers.
2907         * platform/graphics/gpu/GPUBuffer.cpp: Added.
2908         (WebCore::GPUBuffer::PendingMappingCallback::PendingMappingCallback): New struct for retaining a reference to mapping callbacks.
2909         * platform/graphics/gpu/GPUBuffer.h: Add functionality to retain callbacks and usage bits.
2910         (WebCore::GPUBuffer::isVertex const):
2911         (WebCore::GPUBuffer::isUniform const):
2912         (WebCore::GPUBuffer::isStorage const):
2913         (WebCore::GPUBuffer::isReadOnly const):
2914         (WebCore::GPUBuffer::PendingMapPromise::create):
2915         (WebCore::GPUBuffer::isMappable const):
2916         (WebCore::GPUBuffer::isMapWriteable const):
2917         (WebCore::GPUBuffer::isMapReadable const):
2918         (WebCore::GPUBuffer::mapping const): Deleted.
2919         * platform/graphics/gpu/GPUBufferUsage.h: enum class cannot be logical ORed together.
2920         * platform/graphics/gpu/GPUDevice.cpp:
2921         (WebCore::GPUDevice::tryCreateBuffer const): Renamed from createBuffer. 
2922         (WebCore::GPUDevice::createBuffer const): Deleted.
2923         * platform/graphics/gpu/GPUDevice.h:
2924         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2925         (WebCore::GPUBuffer::tryCreateSharedBuffer): Attempt to create a MTLBuffer with shared memory.
2926         (WebCore::GPUBuffer::tryCreate): No longer use Gigacage-allocated memory for MTLBuffer.
2927         (WebCore::GPUBuffer::GPUBuffer):
2928         (WebCore::GPUBuffer::~GPUBuffer):
2929         (WebCore::GPUBuffer::registerMappingCallback): Register the provided callback to be executed when the staging buffer can be safely exposed.
2930         (WebCore::GPUBuffer::stagingBufferForRead): Prepare the arrayBuffer for reading and run the mapping callback.
2931         (WebCore::GPUBuffer::stagingBufferForWrite): Ditto, but for writing.
2932         (WebCore::GPUBuffer::unmap): If needed, copy the staging ArrayBuffer to the MTLBuffer. Unregister any mapping callback.
2933         (WebCore::GPUBuffer::destroy): Stub implementation for now. Frees the MTLBuffer as soon as possible.
2934         (WebCore::GPUBuffer::create): Deleted.
2935         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
2936         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Ensure only read-only GPUBuffers are used as read-only on the GPU.
2937
2938         Add symbols for new files:
2939         * Sources.txt:
2940         * WebCore.xcodeproj/project.pbxproj:
2941
2942 2019-02-23  Keith Miller  <keith_miller@apple.com>
2943
2944         Add new mac target numbers
2945         https://bugs.webkit.org/show_bug.cgi?id=194955
2946
2947         Reviewed by Tim Horton.
2948
2949         * Configurations/Base.xcconfig:
2950         * Configurations/DebugRelease.xcconfig:
2951
2952 2019-02-23  chris fleizach  <cfleizach@apple.com>
2953
2954         AX: WebKit is incorrectly mapping the <meter> element to progressbar
2955         https://bugs.webkit.org/show_bug.cgi?id=164051
2956         <rdar://problem/29055615>
2957
2958         Reviewed by Joanmarie Diggs.
2959
2960         Add a specific role for meter and map that to the appropriate mac role. 
2961
2962         * accessibility/AccessibilityNodeObject.cpp:
2963         (WebCore::AccessibilityNodeObject::canHaveChildren const):
2964         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
2965         * accessibility/AccessibilityObject.cpp:
2966         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
2967         (WebCore::AccessibilityObject::isRangeControl const):
2968         (WebCore::AccessibilityObject::computedRoleString const):
2969         * accessibility/AccessibilityObjectInterface.h:
2970         * accessibility/AccessibilityProgressIndicator.cpp:
2971         (WebCore::AccessibilityProgressIndicator::roleValue const):
2972         * accessibility/AccessibilityProgressIndicator.h:
2973         * accessibility/AccessibilityRenderObject.cpp:
2974         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
2975         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2976         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2977         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2978         (createAccessibilityRoleMap):
2979
2980 2019-02-22  Ryosuke Niwa  <rniwa@webkit.org>
2981
2982         Crash in SWServerJobQueue::runNextJobSynchronously
2983         https://bugs.webkit.org/show_bug.cgi?id=194974
2984
2985         Reviewed by Geoffrey Garen.
2986
2987         We suspect the crash is happening due to m_jobQueue being empty in runNextJobSynchronously
2988         or there is a timer heap corruption again :(
2989
2990         Exit early when m_jobQueue is empty. Also add a debug assert that this should never happen
2991         but convert an existing release assert to a debug assert since this appears to be hitting
2992         too frequently in wild.
2993
2994         * workers/service/server/SWServerJobQueue.cpp:
2995         (WebCore::SWServerJobQueue::runNextJobSynchronously):
2996
2997 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
2998
2999         Clean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusion in the scrolling tree nodes
3000         https://bugs.webkit.org/show_bug.cgi?id=194968
3001
3002         Reviewed by Antti Koivisto.
3003
3004         Having both setScrollPosition() and setScrollPositionWithoutContentEdgeConstraints() is confusing because
3005         you can't tell which is the bottleneck. So add a 'clamp' parameter to setScrollPosition() and merge them.
3006
3007         ScrollingTreeFrameScrollingNodeMac::setScrollPosition() replicates a bit of code but future cleanups will
3008         reduce that.
3009
3010         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3011         (WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition): Deleted. This was the same as the base class method.
3012         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3013         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3014         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
3015         (WebCore::ScrollingTreeScrollingNode::clampScrollPosition const):
3016         (WebCore::ScrollingTreeScrollingNode::scrollBy):
3017         (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints): Deleted.
3018         (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
3019         * page/scrolling/ScrollingTreeScrollingNode.h:
3020         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
3021         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
3022         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
3023         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): Deleted. Did nothing.
3024         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3025         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3026         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
3027         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
3028         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
3029         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
3030         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
3031         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
3032         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
3033         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
3034         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
3035         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
3036         * platform/PlatformWheelEvent.h:
3037         (WebCore::PlatformWheelEvent::delta const):
3038         * platform/ScrollTypes.h:
3039
3040 2019-02-22  Eric Liang  <ericliang@apple.com>
3041
3042         AX: Treat AXChildrenInNavigationOrder as AXChildren before adding support for aria-flowto
3043         https://bugs.webkit.org/show_bug.cgi?id=194923
3044
3045         Reviewed by Chris Fleizach.
3046
3047         Added AXChildrenInNavigationOrder attribute that returns the same array as from AXChildren. It prevents AppKit from reordering elements from the fallback AXChildren attribute.
3048
3049         Test: accessibility/mac/children-in-navigation-order-returns-children.html
3050
3051         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3052         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3053
3054 2019-02-22  Tim Horton  <timothy_horton@apple.com>
3055
3056         ProcessSwap.PageOverlayLayerPersistence fails on iOS and in debug builds
3057         https://bugs.webkit.org/show_bug.cgi?id=194963
3058
3059         Reviewed by Dean Jackson.
3060
3061         Tested by existing failing API test.
3062
3063         * page/Page.cpp:
3064         (WebCore::Page::installedPageOverlaysChanged): Deleted.
3065         * page/Page.h:
3066         (WebCore::Page::pageOverlayController):
3067         * page/PageOverlayController.cpp:
3068         (WebCore::PageOverlayController::installedPageOverlaysChanged):
3069         (WebCore::PageOverlayController::detachViewOverlayLayers):
3070         (WebCore::PageOverlayController::installPageOverlay):
3071         (WebCore::PageOverlayController::uninstallPageOverlay):
3072         (WebCore::PageOverlayController::willDetachRootLayer): Deleted.
3073         * page/PageOverlayController.h:
3074         As intended by r240940, move installedPageOverlaysChanged to PageOverlayController.
3075         Also, make it ignore isInWindow state; otherwise, if you install a overlay
3076         and then come into window, nothing installs the root layer. There is no
3077         need for this code to follow in-window state manually anymore since
3078         the DrawingArea and RenderLayerCompositor just hook the layers up when needed.
3079
3080         Make some methods private, and make detachViewOverlayLayers only touch
3081         *view* overlays, so that we don't detach the document-relative root
3082         layer when you drop to having no view overlays. This maintains
3083         existing behavior because nothing was calling PageOverlayController::detachViewOverlayLayers.
3084
3085         Now there are no callers of willDetachRootLayer, so remove it.
3086
3087 2019-02-22  Andy Estes  <aestes@apple.com>
3088
3089         [iOS] Break a reference cycle between PreviewLoader and ResourceLoader
3090         https://bugs.webkit.org/show_bug.cgi?id=194964
3091         <rdar://problem/48279441>
3092
3093         Reviewed by Alex Christensen.
3094
3095         When a document's QuickLook preview is loaded, a reference cycle is created between
3096         PreviewLoader and ResourceLoader. Break the cycle by clearing m_previewLoader in
3097         ResourceLoader::releaseResources().
3098
3099         Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`.
3100
3101         * loader/ResourceLoader.cpp:
3102         (WebCore::ResourceLoader::releaseResources):
3103
3104 2019-02-22  Sihui Liu  <sihui_liu@apple.com>
3105
3106         Crash under IDBServer::IDBConnectionToClient::identifier() const
3107         https://bugs.webkit.org/show_bug.cgi?id=194843
3108         <rdar://problem/48203102>
3109
3110         Reviewed by Geoffrey Garen.
3111
3112         UniqueIDBDatabase should ignore requests from connections that are already closed.
3113
3114         Tests are hard to create without some tricks on UniqueIDBDatabase so this fix is verified manually. 
3115         One test is created by adding delay to UniqueIDBDatabase::openBackingStore on the background thread to make sure
3116         disconnection of web process happens before UniqueIDBDatabase::didOpenBackingStore, because didOpenBackingStore
3117         may start a version change transaction and ask for identifier from the connection that is already gone.
3118
3119         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
3120         (WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
3121         * Modules/indexeddb/server/IDBConnectionToClient.h:
3122         (WebCore::IDBServer::IDBConnectionToClient::isClosed):
3123         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3124         (WebCore::IDBServer::UniqueIDBDatabase::clearStalePendingOpenDBRequests):
3125         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
3126         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
3127         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3128
3129 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3130
3131         Input type "formatSetInlineTextDirection" is dispatched when changing paragraph-level text direction
3132         https://bugs.webkit.org/show_bug.cgi?id=194703
3133         <rdar://problem/48111775>
3134
3135         Reviewed by Ryosuke Niwa.
3136
3137         Currently, when changing text direction, WebKit always sends input events of type formatSetInlineTextDirection,
3138         even when changing paragraph text direction. Instead, we should be emitting formatSetBlockTextDirection in this
3139         scenario. This is problematic when using the context menus on macOS to change writing direction, since changing
3140         "Selection Direction" is currently indistinguishable from changing "Paragraph Direction".
3141
3142         To fix this, we split EditAction::SetWritingDirection into EditAction::SetInlineWritingDirection and
3143         EditAction::SetBlockWritingDirection, which emit inline and block text direction input events, respectively.
3144
3145         Tests: fast/events/before-input-events-prevent-block-text-direction.html
3146                fast/events/before-input-events-prevent-inline-text-direction.html
3147
3148         * editing/CompositeEditCommand.cpp:
3149         (WebCore::CompositeEditCommand::apply):
3150         * editing/EditAction.cpp:
3151         (WebCore::undoRedoLabel):
3152         * editing/EditAction.h:
3153         * editing/EditCommand.cpp:
3154         (WebCore::inputTypeNameForEditingAction):
3155         * editing/Editor.cpp:
3156         (WebCore::inputEventDataForEditingStyleAndAction):
3157         (WebCore::Editor::setBaseWritingDirection):
3158         * editing/EditorCommand.cpp:
3159         (WebCore::executeMakeTextWritingDirectionLeftToRight):
3160         (WebCore::executeMakeTextWritingDirectionNatural):
3161         (WebCore::executeMakeTextWritingDirectionRightToLeft):
3162
3163 2019-02-22  Rob Buis  <rbuis@igalia.com>
3164
3165         Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp
3166         https://bugs.webkit.org/show_bug.cgi?id=160172
3167
3168         Reviewed by Frédéric Wang.
3169
3170         Remove stripLeadingAndTrailingWhitespace and use stripLeadingAndTrailingHTTPSpaces
3171         from HTTPParsers instead.
3172
3173         No new tests, already covered by MathML tests.
3174
3175         * mathml/MathMLElement.cpp:
3176         (WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Deleted.
3177         * mathml/MathMLElement.h:
3178         * mathml/MathMLPresentationElement.cpp:
3179         (WebCore::MathMLPresentationElement::parseMathMLLength):
3180         * mathml/MathMLTokenElement.cpp:
3181         (WebCore::MathMLTokenElement::convertToSingleCodePoint):
3182
3183 2019-02-22  Eric Carlson  <eric.carlson@apple.com>
3184
3185         Update some media logging
3186         https://bugs.webkit.org/show_bug.cgi?id=194915
3187
3188         Reviewed by Jer Noble.
3189
3190         No new tests, no functional change.
3191
3192         * Modules/mediasource/SourceBuffer.cpp:
3193         (WebCore::SourceBuffer::evictCodedFrames):
3194         (WebCore::SourceBuffer::provideMediaData):
3195         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
3196
3197         * html/HTMLMediaElement.cpp:
3198         (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
3199         (WebCore::HTMLMediaElement::loadResource):
3200         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
3201         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
3202         (WebCore::HTMLMediaElement::seekTask):
3203         (WebCore::HTMLMediaElement::playInternal):
3204         (WebCore::HTMLMediaElement::pauseInternal):
3205         (WebCore::HTMLMediaElement::setLoop):
3206         (WebCore::HTMLMediaElement::setControls):
3207         (WebCore::HTMLMediaElement::sourceWasRemoved):
3208
3209         * html/MediaElementSession.cpp:
3210         (WebCore::convertEnumerationToString):
3211
3212         * html/MediaElementSession.h:
3213         (WTF::LogArgument<WebCore::MediaPlaybackDenialReason>::toString):
3214
3215         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3216         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
3217
3218 2019-02-22  Rob Buis  <rbuis@igalia.com>
3219
3220         Fix unitless usage of mathsize
3221         https://bugs.webkit.org/show_bug.cgi?id=194940
3222
3223         Reviewed by Frédéric Wang.
3224
3225         Convert unitless lengths to percentage values to correct the computed
3226         font size.
3227
3228         * mathml/MathMLElement.cpp:
3229         (WebCore::convertToPercentageIfNeeded):
3230         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
3231
3232 2019-02-21  Simon Fraser  <simon.fraser@apple.com>
3233
3234         Hardcode Visual Viewports on everywhere except iOS WK1
3235         https://bugs.webkit.org/show_bug.cgi?id=194928
3236
3237         Reviewed by Zalan Bujtas.
3238
3239         Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
3240         change the default value of the Setting to 'true', and hardcode WebView on iOS to
3241         set it to false. The setting has shipped for several years and there's no need to turn
3242         it off now.
3243
3244         Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
3245         Visual Viewports are not enabled.
3246         
3247         Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
3248         that only runs in WK2
3249
3250         * page/Settings.yaml:
3251         * page/scrolling/AsyncScrollingCoordinator.cpp:
3252         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3253         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
3254         (WebCore::AsyncScrollingCoordinator::visualViewportEnabled const): Deleted.
3255         * page/scrolling/AsyncScrollingCoordinator.h:
3256         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3257         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3258         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
3259         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
3260         (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled): Deleted.
3261         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3262         * page/scrolling/ScrollingTree.cpp:
3263         (WebCore::ScrollingTree::commitTreeState):
3264         * page/scrolling/ScrollingTree.h:
3265         (WebCore::ScrollingTree::visualViewportEnabled const): Deleted.
3266         (WebCore::ScrollingTree::setVisualViewportEnabled): Deleted.
3267         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3268         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
3269         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3270         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
3271         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
3272
3273 2019-02-21  Darin Adler  <darin@apple.com>
3274
3275         Some refinements for Node and Document
3276         https://bugs.webkit.org/show_bug.cgi?id=194764
3277
3278         Reviewed by Ryosuke Niwa.
3279
3280         * accessibility/AccessibilityObject.cpp:
3281         (WebCore::AccessibilityObject::press): Use shadowHost instead of
3282         deprecatedShadowAncestorNode.
3283         (WebCore::AccessibilityObject::axObjectCache const): Tweak coding style.
3284         (WebCore::AccessibilityObject::focusedUIElement const): Use existing page
3285         function to streamline.
3286
3287         * accessibility/AccessibilityRenderObject.cpp:
3288         (WebCore::AccessibilityRenderObject::accessKey const): Use
3289         attributeWithoutSynchronization for efficiency and consistency with other
3290         code working with the accesskey attribute.
3291
3292         * dom/ContainerNode.cpp:
3293         (WebCore::ContainerNode::childrenChanged): Added call to
3294         invalidateAccessKeyCache, replacing old scheme tied to style recalculation.
3295
3296         * dom/DecodedDataDocumentParser.cpp:
3297         (WebCore::DecodedDataDocumentParser::appendBytes): Update for name and return
3298         type change of createDecoderIfNeeded to decoder.
3299         (WebCore::DecodedDataDocumentParser::flush): Ditto.
3300
3301         * dom/Document.cpp:
3302         (WebCore::Document::elementForAccessKey): Renamed from getElementForAccessKey
3303         to match WebKit coding style. Changed to use unique_ptr instead of separate
3304         boolean to keep track of map validity status.
3305         (WebCore::Document::buildAccessKeyCache): Renamed from buildAccessKeyMap to
3306         clarify that this is a cache. Changed to use composedTreeDescendants rather
3307         than explicit calls to shadowRoot. Use add instead of set so that first element
3308         in document order wins, instead of last element in document order. Updated
3309         to make a new map in a new unique_ptr instead of populating a map.
3310         (WebCore::Document::invalidateAccessKeyCacheSlowCase): Renamed from
3311         invalidateAccessKeyMap, and left an inline part in the header so the fast case
3312         of quickly checking for a null pointer can be inlined.
3313         (WebCore::Document::doctype const): Use downcast instead of static_cast.
3314         (WebCore::Document::scheduleStyleRecalc): Moved call to invalidateAccessKeyMap
3315         from here to childrenChanged and accesskey attribute change handling.
3316         (WebCore::Document::processFormatDetection): Set m_isTelephoneNumberParsingAllowed
3317         directly since this is the only place that does it and we don't need to factor
3318         that one line of code into a function.
3319         (WebCore::Document::getOverrideStyle): Moved to header since it's just a stub
3320         that always returns nullptr and can be inlined.
3321         (WebCore::Document::setIsTelephoneNumberParsingAllowed): Deleted.
3322         (WebCore::Document::ensureTemplateDocument): Removed nullptr frame argument to
3323         the create function, since Document::create now always involves no frame.
3324         (WebCore::Document::didAssociateFormControl): Changed argument type to a reference
3325         and simplified the logic with a local variable.
3326         (WebCore::Document::didAssociateFormControlsTimerFired): Simplified the null
3327         checks and rearranged things so that m_associatedFormControls will always
3328         get cleared even if the document is no longer associated with a page.
3329
3330         * dom/Document.h: Removed unnnecessary explicit values for enumerations (first
3331         value is always zero, etc.) and formatted simple enumerations in a single line
3332         for easier reading. Moved Document::create fucntion bodies out of line, removed
3333         the frame argument from the simple "create with URL" overload and made the frame
3334         argument for createNonRenderedPlaceholder be a reference rather than a pointer.
3335         Renamed getElementByAccessKey to elementForAccessKey, invalidateAccessKeyMap to
3336         invalidateAccessKeyCache, buildAccessKeyMap to buildAccessKeCache,
3337         m_elementsByAccessKey to m_accessKeyCache and changed its type.
3338         Removed bogus "DOM methods" comment, unused setParserFeature friend declaration,
3339         setIsTelephoneNumberParsingAllowed function, and m_accessKeyMapValid flag.
3340
3341         * dom/Document.idl: Added comment highlighting that getOverrideStyle is just a
3342         placeholder returning null.
3343
3344         * dom/Element.cpp:
3345         (WebCore::Element::attributeChanged): Call invalidateAccessKeyCache when the
3346         value of the accesskey attribute is changed. Also moved the class attribute code
3347         so the attributes here are in alphabetical order (only class and id were out of
3348         alphabetical order).
3349
3350         * dom/Node.cpp:
3351         (WebCore::Node::isDescendantOrShadowDescendantOf const): Rewrote to no longer
3352         use deprecatedShadowAncestorNode and used boolean operators to make it a
3353         single line and easier to understand. Also added a FIXME since the
3354         containsIncludingShadowDOM function is so similar, yet differently written.
3355         (WebCore::Node::contains const): Rewrote as a single line to make this easier
3356         to read and to *slightly* improve the speed in the "this == node" case.
3357         (WebCore::Node::containsIncludingHostElements const): Use downcast.
3358         (WebCore::Node::deprecatedShadowAncestorNode const): Deleted.
3359
3360         * dom/Node.h: Deleted now-unused deprecatedShadowAncestorNode.
3361
3362         * editing/ReplaceSelectionCommand.cpp:
3363         (WebCore::ReplacementFragment::ReplacementFragment): Rewrote to use shadowHost
3364         instead of deprecatedShadowAncestorNode.
3365
3366         * html/FormAssociatedElement.cpp:
3367         (WebCore::FormAssociatedElement::resetFormOwner): Pass reference to
3368         didAssociateFormControl.
3369         (WebCore::FormAssociatedElement::formAttributeChanged): Ditto.
3370
3371         * html/HTMLAreaElement.cpp:
3372         (WebCore::HTMLAreaElement::parseAttribute): Removed special case for accesskey
3373         attribute, because we want to call the base class parseAttribute in that case.
3374
3375         * html/HTMLFormElement.cpp:
3376         (WebCore::HTMLFormElement::insertedIntoAncestor): Pass reference to
3377         didAssociateFormControl.
3378
3379         * html/HTMLSelectElement.cpp:
3380         (WebCore::HTMLSelectElement::parseAttribute): Removed special case for accesskey
3381         attribute with mysterious FIXME, because we want to call the base class
3382         parseAttribute in that case. The old code had no effect before; the access key
3383         logic would still find the attribute; if the goal is to&