fe639d9f7b659e36bcbebdbcdb365b7809e7a197
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
2
3         [iOS] Web process gets suspended while holding locked database files
4         https://bugs.webkit.org/show_bug.cgi?id=196519
5         <rdar://problem/49531797>
6
7         Reviewed by Chris Dumez.
8
9         Don't use DatabaseTracker singleton before it is initialized.
10
11         * Modules/webdatabase/DatabaseTracker.cpp:
12         (WebCore::DatabaseTracker::isInitialized):
13         * Modules/webdatabase/DatabaseTracker.h:
14
15 2019-04-05  Ryosuke Niwa  <rniwa@webkit.org>
16
17         Make WeakPtr<Element> possible and deploy it in form associated elements code
18         https://bugs.webkit.org/show_bug.cgi?id=196626
19
20         Reviewed by Antti Koivisto.
21
22         Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
23
24         No new tests sine there should be no behavioral change.
25
26         * dom/Element.h:
27         * html/FormAssociatedElement.cpp:
28         (WebCore::FormAssociatedElement::FormAssociatedElement):
29         (WebCore::FormAssociatedElement::insertedIntoAncestor):
30         (WebCore::FormAssociatedElement::setForm):
31         (WebCore::FormAssociatedElement::resetFormOwner):
32         (WebCore::FormAssociatedElement::formAttributeChanged):
33         * html/FormAssociatedElement.h:
34         (WebCore::FormAssociatedElement::form const):
35         * html/HTMLElement.cpp:
36         (WebCore::HTMLElement::asFormNamedItem):
37         (WebCore::HTMLElement::asFormAssociatedElement):
38         * html/HTMLElement.h:
39         (WebCore::HTMLElement::asFormNamedItem): Deleted.
40         * html/HTMLFormControlElement.h:
41         * html/HTMLFormControlsCollection.cpp:
42         (WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
43         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
44         * html/HTMLFormControlsCollection.h:
45         * html/HTMLFormElement.cpp:
46         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
47         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
48         (WebCore::HTMLFormElement::registerImgElement):
49         (WebCore::HTMLFormElement::defaultButton const):
50         (WebCore::HTMLFormElement::resetDefaultButton):
51         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
52         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
53         * html/HTMLFormElement.h:
54         * html/HTMLImageElement.cpp:
55         (WebCore::HTMLImageElement::HTMLImageElement):
56         (WebCore::HTMLImageElement::insertedIntoAncestor):
57         * html/HTMLImageElement.h:
58         * html/HTMLInputElement.h:
59         * html/HTMLMediaElement.h:
60         * html/HTMLObjectElement.h:
61         * html/HTMLPictureElement.h:
62         * html/HTMLSlotElement.h:
63         * svg/SVGElement.h:
64
65 2019-04-05  Caitlin Potter  <caitp@igalia.com>
66
67         [JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
68         https://bugs.webkit.org/show_bug.cgi?id=176810
69
70         Reviewed by Saam Barati.
71
72         Previously, there was a comment here indicating uncertainty of whether it
73         was necessary to filter DontEnum properties explicitly or not. It turns
74         out that it was necessary in the case of JSC ProxyObjects.
75
76         This patch adds DontEnum filtering for ProxyObjects, however we continue
77         to explicitly filter them in JSDOMConvertRecord, which needs to use the
78         property descriptor after filtering. This change prevents observably
79         fetching the property descriptor twice per property.
80
81         * bindings/js/JSDOMConvertRecord.h:
82
83 2019-04-05  Michael Catanzaro  <mcatanzaro@igalia.com>
84
85         Unreviewed manual rollout of r243929
86         https://bugs.webkit.org/show_bug.cgi?id=196626
87
88         * dom/Element.h:
89         * html/FormAssociatedElement.cpp:
90         (WebCore::FormAssociatedElement::FormAssociatedElement):
91         (WebCore::FormAssociatedElement::insertedIntoAncestor):
92         (WebCore::FormAssociatedElement::setForm):
93         (WebCore::FormAssociatedElement::resetFormOwner):
94         (WebCore::FormAssociatedElement::formAttributeChanged):
95         * html/FormAssociatedElement.h:
96         (WebCore::FormAssociatedElement::form const):
97         * html/HTMLElement.cpp:
98         (WebCore::HTMLElement::asFormNamedItem): Deleted.
99         (WebCore::HTMLElement::asFormAssociatedElement): Deleted.
100         * html/HTMLElement.h:
101         (WebCore::HTMLElement::asFormNamedItem):
102         * html/HTMLFormControlElement.h:
103         * html/HTMLFormControlsCollection.cpp:
104         (WebCore:: const):
105         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
106         * html/HTMLFormControlsCollection.h:
107         * html/HTMLFormElement.cpp:
108         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
109         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
110         (WebCore::HTMLFormElement::registerImgElement):
111         (WebCore::HTMLFormElement::defaultButton const):
112         (WebCore::HTMLFormElement::resetDefaultButton):
113         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
114         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
115         * html/HTMLFormElement.h:
116         * html/HTMLImageElement.cpp:
117         (WebCore::HTMLImageElement::HTMLImageElement):
118         (WebCore::HTMLImageElement::insertedIntoAncestor):
119         * html/HTMLImageElement.h:
120         * html/HTMLInputElement.h:
121         * html/HTMLMediaElement.h:
122         * html/HTMLObjectElement.h:
123         * html/HTMLPictureElement.h:
124         * html/HTMLSlotElement.h:
125         * svg/SVGElement.h:
126
127 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
128
129         [iOS] Web process gets suspended while holding locked database files
130         https://bugs.webkit.org/show_bug.cgi?id=196519
131         <rdar://problem/49531797>
132
133         Reviewed by Chris Dumez.
134
135         We should close all databases and make sure not open new databases when web process is ready to suspend.
136
137         * platform/sql/SQLiteDatabase.cpp:
138         (WebCore::SQLiteDatabase::setIsDatabaseOpeningForbidden):
139         (WebCore::SQLiteDatabase::open):
140         * platform/sql/SQLiteDatabase.h:
141         * platform/sql/SQLiteDatabaseTracker.cpp:
142         (WebCore::SQLiteDatabaseTracker::setClient):
143         (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
144         (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
145         (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
146
147 2019-04-05  Commit Queue  <commit-queue@webkit.org>
148
149         Unreviewed, rolling out r243833.
150         https://bugs.webkit.org/show_bug.cgi?id=196645
151
152         This change breaks build of WPE and GTK ports (Requested by
153         annulen on #webkit).
154
155         Reverted changeset:
156
157         "[CMake][WTF] Mirror XCode header directories"
158         https://bugs.webkit.org/show_bug.cgi?id=191662
159         https://trac.webkit.org/changeset/243833
160
161 2019-04-05  David Kilzer  <ddkilzer@apple.com>
162
163         REGRESSION(r243887): Try to fix Windows builds by including <wtf/IsoMalloc.h>
164
165         Caused by:
166             [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
167             https://bugs.webkit.org/show_bug.cgi?id=196475
168
169         * css/CSSComputedStyleDeclaration.h:
170         * dom/DOMRectReadOnly.h:
171         * dom/LiveNodeList.h:
172         * dom/NodeIterator.h:
173         * dom/TreeWalker.h:
174         * fileapi/Blob.h:
175         * fileapi/File.h:
176         * fileapi/FileList.h:
177         * html/CachedHTMLCollection.h:
178         * html/HTMLFormElement.h:
179         * html/HTMLNameCollection.h:
180         * html/canvas/GPUBasedCanvasRenderingContext.h:
181         * page/RemoteDOMWindow.h:
182
183 2019-04-05  Ryosuke Niwa  <rniwa@webkit.org>
184
185         Make WeakPtr<Element> possible and deploy it in form associated elements code
186         https://bugs.webkit.org/show_bug.cgi?id=196626
187
188         Reviewed by Antti Koivisto.
189
190         Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
191
192         No new tests sine there should be no behavioral change.
193
194         * dom/Element.h:
195         * html/FormAssociatedElement.cpp:
196         (WebCore::FormAssociatedElement::FormAssociatedElement):
197         (WebCore::FormAssociatedElement::insertedIntoAncestor):
198         (WebCore::FormAssociatedElement::setForm):
199         (WebCore::FormAssociatedElement::resetFormOwner):
200         (WebCore::FormAssociatedElement::formAttributeChanged):
201         * html/FormAssociatedElement.h:
202         (WebCore::FormAssociatedElement::form const):
203         * html/HTMLElement.cpp:
204         (WebCore::HTMLElement::asFormNamedItem):
205         (WebCore::HTMLElement::asFormAssociatedElement):
206         * html/HTMLElement.h:
207         (WebCore::HTMLElement::asFormNamedItem): Deleted.
208         * html/HTMLFormControlElement.h:
209         * html/HTMLFormControlsCollection.cpp:
210         (WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
211         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
212         * html/HTMLFormControlsCollection.h:
213         * html/HTMLFormElement.cpp:
214         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
215         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
216         (WebCore::HTMLFormElement::registerImgElement):
217         (WebCore::HTMLFormElement::defaultButton const):
218         (WebCore::HTMLFormElement::resetDefaultButton):
219         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
220         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
221         * html/HTMLFormElement.h:
222         * html/HTMLImageElement.cpp:
223         (WebCore::HTMLImageElement::HTMLImageElement):
224         (WebCore::HTMLImageElement::insertedIntoAncestor):
225         * html/HTMLImageElement.h:
226         * html/HTMLInputElement.h:
227         * html/HTMLMediaElement.h:
228         * html/HTMLObjectElement.h:
229         * html/HTMLPictureElement.h:
230         * html/HTMLSlotElement.h:
231         * svg/SVGElement.h:
232
233 2019-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
234
235         [ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code
236         https://bugs.webkit.org/show_bug.cgi?id=196593
237         <rdar://problem/49599153>
238
239         Reviewed by Michael Catanzaro.
240
241         We have specific code for GTK to get/set the wrapper only because we don't use smart pointers. Also use
242         WebKitAccessible as AccessibilityObjectWrapper instead of generic AtkObject, to enforce wrappers to be
243         WebKitAccessible instances. This requires a few casts to AtkObject.
244
245         * accessibility/AccessibilityObject.h:
246         (WebCore::AccessibilityObject::setWrapper):
247         * accessibility/AccessibilityObjectInterface.h:
248         * accessibility/atk/AXObjectCacheAtk.cpp:
249         (WebCore::AXObjectCache::detachWrapper):
250         (WebCore::AXObjectCache::attachWrapper):
251         (WebCore::notifyChildrenSelectionChange):
252         (WebCore::AXObjectCache::postPlatformNotification):
253         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
254         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
255         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
256         * accessibility/atk/AccessibilityObjectAtk.cpp:
257         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
258         (webkitAccessibleComponentRefAccessibleAtPoint):
259         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
260         (webkitAccessibleHypertextGetLink):
261         (webkitAccessibleHypertextGetNLinks):
262         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
263         (webkitAccessibleSelectionRefSelection):
264         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
265         (webkitAccessibleTableRefAt):
266         (webkitAccessibleTableGetColumnHeader):
267         (webkitAccessibleTableGetRowHeader):
268         (webkitAccessibleTableGetCaption):
269         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
270         (convertToGPtrArray):
271         (webkitAccessibleTableCellGetTable):
272         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
273         (accessibilityObjectLength):
274         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
275         (setAtkRelationSetFromCoreObject):
276         (atkParentOfRootObject):
277         (webkitAccessibleGetParent):
278         (webkitAccessibleRefChild):
279         (isTextWithCaret):
280         * editing/atk/FrameSelectionAtk.cpp:
281         (WebCore::emitTextSelectionChange):
282         (WebCore::maybeEmitTextFocusChange):
283
284 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
285
286         [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
287         https://bugs.webkit.org/show_bug.cgi?id=195584
288
289         Reviewed by Zalan Bujtas.
290
291         Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
292         RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
293         just as we do for frames.
294
295         AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
296
297         Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
298         ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
299         callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
300         ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
301
302         Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
303         the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
304         already been put in the right locations, but the UI process needs to know that a scroll happened).
305         However, we need to prevent notifications from programmatic scrolls getting back to the
306         web process, because this causes jumpiness. This is done via an early return in
307         RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
308
309         Tests: scrollingcoordinator/ios/programmatic-overflow-scroll.html
310                scrollingcoordinator/ios/programmatic-page-scroll.html
311
312         * page/scrolling/AsyncScrollingCoordinator.cpp:
313         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
314         * page/scrolling/AsyncScrollingCoordinator.h:
315         * page/scrolling/ScrollingCoordinator.h:
316         (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
317         * page/scrolling/ScrollingTree.cpp:
318         (WebCore::ScrollingTree::commitTreeState):
319         (WebCore::ScrollingTree::isHandlingProgrammaticScroll): Deleted.
320         * page/scrolling/ScrollingTree.h:
321         (WebCore::ScrollingTree::isHandlingProgrammaticScroll const):
322         (WebCore::ScrollingTree::setIsHandlingProgrammaticScroll):
323         * page/scrolling/ScrollingTreeScrollingNode.cpp:
324         (WebCore::ScrollingTreeScrollingNode::scrollBy):
325         (WebCore::ScrollingTreeScrollingNode::scrollTo):
326         * page/scrolling/ScrollingTreeScrollingNode.h:
327         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
328         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
329         * rendering/RenderLayer.cpp:
330         (WebCore::RenderLayer::scrollToOffset):
331         (WebCore::RenderLayer::scrollingNodeID const):
332         * rendering/RenderLayer.h:
333         * rendering/RenderMarquee.cpp:
334         (WebCore::RenderMarquee::timerFired):
335
336 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
337
338         Unreviewed, speculative fix for build failure
339         https://bugs.webkit.org/show_bug.cgi?id=196475
340
341         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
342
343 2019-04-04  Ryosuke Niwa  <rniwa@webkit.org>
344
345         Element::isFocusable() debug asserts too frequently
346         https://bugs.webkit.org/show_bug.cgi?id=196634
347
348         Reviewed by Geoffrey Garen.
349
350         Remove the debug assertion for now.
351
352         * dom/Element.cpp:
353         (WebCore::Element::isFocusable const):
354
355 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
356
357         Have ScrollableArea store a ScrollType for the current scroll
358         https://bugs.webkit.org/show_bug.cgi?id=196627
359
360         Reviewed by Zalan Bujtas.
361
362         RenderLayer had isInUserScroll() which is the opposite of ScrollableArea::inProgrammaticScroll(),
363         so just have ScrollableArea store a ScrollType.
364
365         RenderLayer's scrolling bottleneck, scrollToOffset(), now takes a ScrollType, and pushes
366         it onto the base class.
367
368         AsyncScrollingCoordinator::requestScrollPositionUpdate() can use the incoming scrollType (currently
369         incorrect for iOS WK2 overflow) rather than deducing a user scroll from ScrollingLayerPositionAction.
370
371         No behavior change.
372
373         * page/FrameView.cpp:
374         (WebCore::FrameView::setFrameRect):
375         (WebCore::FrameView::topContentInsetDidChange):
376         (WebCore::FrameView::updateLayoutViewport):
377         (WebCore::FrameView::setScrollPosition):
378         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling const):
379         (WebCore::FrameView::setWasScrolledByUser):
380         * page/FrameViewLayoutContext.cpp:
381         (WebCore::LayoutScope::LayoutScope):
382         (WebCore::LayoutScope::~LayoutScope):
383         * page/ios/FrameIOS.mm:
384         (WebCore::Frame::overflowScrollPositionChangedForNode):
385         * page/scrolling/AsyncScrollingCoordinator.cpp:
386         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
387         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
388         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
389         * platform/ScrollView.cpp:
390         (WebCore::ScrollView::setScrollPosition):
391         * platform/ScrollableArea.cpp:
392         (WebCore::ScrollableArea::ScrollableArea):
393         * platform/ScrollableArea.h:
394         (WebCore::ScrollableArea::currentScrollType const):
395         (WebCore::ScrollableArea::setCurrentScrollType):
396         (WebCore::ScrollableArea::setIsUserScroll): Deleted.
397         (WebCore::ScrollableArea::inProgrammaticScroll const): Deleted.
398         (WebCore::ScrollableArea::setInProgrammaticScroll): Deleted.
399         * rendering/RenderLayer.cpp:
400         (WebCore::RenderLayer::RenderLayer):
401         (WebCore::RenderLayer::scrollToXPosition):
402         (WebCore::RenderLayer::scrollToYPosition):
403         (WebCore::RenderLayer::scrollToOffset):
404         (WebCore::RenderLayer::scrollTo):
405         * rendering/RenderLayer.h:
406         * rendering/RenderLayerBacking.cpp:
407         (WebCore::RenderLayerBacking::updateScrollOffset):
408         * rendering/RenderMarquee.cpp:
409         (WebCore::RenderMarquee::start):
410
411 2019-04-04  Shawn Roberts  <sroberts@apple.com>
412
413         Unreviewed, rolling out r243868.
414
415         Causing timeouts failures on several queues
416
417         Reverted changeset:
418
419         "[Web Animations] JS wrapper may be deleted while animation is
420         yet to dispatch its finish event"
421         https://bugs.webkit.org/show_bug.cgi?id=196118
422         https://trac.webkit.org/changeset/243868
423
424 2019-04-04  Youenn Fablet  <youenn@apple.com>
425
426         Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
427         https://bugs.webkit.org/show_bug.cgi?id=196543
428
429         Reviewed by Alex Christensen.
430
431         Add a default routine to compute a third party quota from a per origin quota.
432         No change of behavior.
433
434         * storage/StorageQuotaManager.h:
435         (WebCore::StorageQuotaManager::defaultThirdPartyQuotaFromPerOriginQuota):
436         (WebCore::StorageQuotaManager::defaultThirdPartyQuota):
437
438 2019-04-04  Commit Queue  <commit-queue@webkit.org>
439
440         Unreviewed, rolling out r243807 and r243824.
441         https://bugs.webkit.org/show_bug.cgi?id=196611
442
443         Test added is a flaky timeout on iOS Simulator, 3 tests
444         unskipped are flaky failures (Requested by ShawnRoberts on
445         #webkit).
446
447         Reverted changesets:
448
449         "Blob type cannot be stored correctly in IDB when
450         IDBObjectStore has autoIncrement and keyPath options"
451         https://bugs.webkit.org/show_bug.cgi?id=196128
452         https://trac.webkit.org/changeset/243807
453
454         "Follow up fix for r243807: Use MarkedArgumentBuffer instead
455         of Vector for JSValue"
456         https://bugs.webkit.org/show_bug.cgi?id=196547
457         https://trac.webkit.org/changeset/243824
458
459 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
460
461         Fix rare crash under collectRelatedCoordinatedScrollingNodes()
462         https://bugs.webkit.org/show_bug.cgi?id=196610
463         rdar://problem/49595426
464
465         Reviewed by Zalan Bujtas.
466
467         hasCompositedScrollableOverflow() doesn't check whether a layer is composited (it has
468         to report the right status before layers have been created), so collectRelatedCoordinatedScrollingNodes()
469         needs to check whether there's backing.
470
471         * rendering/RenderLayerCompositor.cpp:
472         (WebCore::collectRelatedCoordinatedScrollingNodes):
473
474 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
475
476         Move "inProgrammaticScroll" down to ScrollableArea
477         https://bugs.webkit.org/show_bug.cgi?id=196614
478
479         Reviewed by Zalan Bujtas.
480
481         A future patch will need to update "inProgrammaticScroll" on RenderLayers, so push
482         inProgrammaticScroll() down to ScrollableArea.
483
484         ScrollableArea already has "isScrolledProgrammatically", which I rename to "scrollShouldClearLatchedState"
485         to reduce confusion. It might be possible to remove this in future with some refactoring.
486
487         Sadly we can no longer use SetForScope<> in FrameView after this change so add some manual save/restore code.
488
489         * dom/Element.cpp:
490         (WebCore::Element::setScrollLeft):
491         (WebCore::Element::setScrollTop):
492         * page/EventHandler.cpp:
493         (WebCore::EventHandler::completeWidgetWheelEvent):
494         (WebCore::EventHandler::handleWheelEvent):
495         * page/FrameView.cpp:
496         (WebCore::FrameView::setFrameRect):
497         (WebCore::FrameView::topContentInsetDidChange):
498         (WebCore::FrameView::updateLayoutViewport):
499         (WebCore::FrameView::setScrollPosition):
500         (WebCore::FrameView::setWasScrolledByUser):
501         * page/FrameView.h:
502         * platform/ScrollView.h:
503         (WebCore::ScrollView::inProgrammaticScroll const): Deleted.
504         * platform/ScrollableArea.cpp:
505         (WebCore::ScrollableArea::ScrollableArea):
506         * platform/ScrollableArea.h:
507         (WebCore::ScrollableArea::inProgrammaticScroll const):
508         (WebCore::ScrollableArea::setInProgrammaticScroll):
509         (WebCore::ScrollableArea::scrollShouldClearLatchedState const):
510         (WebCore::ScrollableArea::setScrollShouldClearLatchedState):
511         (WebCore::ScrollableArea::isScrolledProgrammatically const): Deleted.
512         (WebCore::ScrollableArea::setScrolledProgrammatically): Deleted.
513
514 2019-04-04  Sihui Liu  <sihui_liu@apple.com>
515
516         Leak of UniqueIDBDatabase in network process running layout tests
517         https://bugs.webkit.org/show_bug.cgi?id=196565
518         <rdar://problem/49346139>
519
520         Reviewed by Geoffrey Garen.
521
522         UniqueIDBDatabase will null itself after it receives confirmation about connecton close from its clients, but it
523         is possible that the web process to network process connection closes before servers gets the 
524         confirmDidCloseFromServer. Therefore, we should let UniqueIDBDatabase forget connection when it receives a 
525         conenctionClosedFromClient.
526
527         No new test because this bug is caused by race between network receiving conenctionClosedFromClient and 
528         receiving confirmDidCloseFromServer. This is testable by running some existing layout tests in a row with leak 
529         option.
530
531         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
532         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
533         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
534
535 2019-04-04  Chris Dumez  <cdumez@apple.com>
536
537         Unreviewed, fix iOS build with recent SDKs.
538
539         * platform/gamepad/cocoa/GameControllerGamepad.mm:
540         (WebCore::GameControllerGamepad::GameControllerGamepad):
541
542 2019-04-04  Eric Carlson  <eric.carlson@apple.com>
543
544         [MediaStream] Host should be able to mute screen capture and camera/microphone independently
545         https://bugs.webkit.org/show_bug.cgi?id=196555
546         <rdar://problem/47303865>
547
548         Reviewed by Youenn Fablet.
549
550         Test: fast/mediastream/media-stream-page-muted.html
551
552         * Modules/mediastream/MediaStream.cpp:
553         (WebCore::MediaStream::MediaStream): Call setCaptureTracksMuted to pass page muted 
554         state to tracks.
555         (WebCore::MediaStream::startProducingData): Ditto.
556         (WebCore::MediaStream::setCaptureTracksMuted): New.
557         * Modules/mediastream/MediaStream.h:
558
559         * Modules/mediastream/MediaStreamTrack.cpp:
560         (WebCore::MediaStreamTrack::MediaStreamTrack): Call setMuted with page muted state.
561         (WebCore::MediaStreamTrack::setMuted): Set muted according to page state and source type.
562         (WebCore::MediaStreamTrack::pageMutedStateDidChange): Call setMuted.
563         (WebCore::MediaStreamTrack::mediaState const): Update for new page state.
564         * Modules/mediastream/MediaStreamTrack.h:
565
566         * page/MediaProducer.h: Split capture muted state into two: camera/microphone and screen.
567
568         * page/Page.h:
569         (WebCore::Page::isMediaCaptureMuted const): Update for state changes.
570
571         * platform/mediastream/MediaStreamPrivate.cpp:
572         (WebCore::MediaStreamPrivate::setCaptureTracksMuted): Deleted.
573         (WebCore::MediaStreamPrivate::hasCaptureVideoSource const): Deleted.
574         * platform/mediastream/MediaStreamPrivate.h:
575
576         * platform/mediastream/RealtimeMediaSource.cpp:
577         (WebCore::RealtimeMediaSource::setMuted): Log state.
578         (WebCore::RealtimeMediaSource::notifyMutedChange): Call notifyMutedObservers on the
579         next runloop so events aren't dispatched synchronously.
580
581         * testing/Internals.cpp:
582         (WebCore::Internals::setPageMuted): Add new state.
583
584 2019-04-04  Chris Dumez  <cdumez@apple.com>
585
586         Unreviewed, update r243884 to use macros in Compiler.h instead.
587
588         * platform/ios/LegacyTileGrid.mm:
589         (WebCore::LegacyTileGrid::dropDistantTiles):
590
591 2019-04-04  Chris Fleizach  <cfleizach@apple.com>
592
593         AX: Crash under WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored()
594         https://bugs.webkit.org/show_bug.cgi?id=196600
595         <rdar://problem/49572996>
596
597         Reviewed by Joanmarie Diggs.
598
599         Audit AX code to not dereference renderer before checking if it's null.
600         Not clear how to reproduce at this time.
601
602         * accessibility/AccessibilityRenderObject.cpp:
603         (WebCore::webAreaIsPresentational):
604         (WebCore::AccessibilityRenderObject::layoutCount const):
605         (WebCore::AccessibilityRenderObject::widget const):
606
607 2019-04-04  Antti Koivisto  <antti@apple.com>
608
609         Compute accurate regions for touch-action
610         https://bugs.webkit.org/show_bug.cgi?id=196536
611         <rdar://problem/49516022>
612
613         Reviewed by Simon Fraser.
614
615         Tests: pointerevents/ios/touch-action-region-basic.html
616                pointerevents/ios/touch-action-region-layers.html
617                pointerevents/ios/touch-action-region-pan-x-y.html
618
619         - Use style system to compute effective touch-action without additional tree walks.
620         - Compute touch-action region in a fake paint, at the same time with the event region.
621
622         This patch doesn't yet use the computed region for anything except test output.
623
624         * Sources.txt:
625         * WebCore.xcodeproj/project.pbxproj:
626         * css/StyleResolver.cpp:
627         (WebCore::computeEffectiveTouchActions):
628         (WebCore::StyleResolver::adjustRenderStyle):
629
630         Update RenderStyle::effectiveTouchAction.
631
632         * dom/Element.cpp:
633         (WebCore::Element::computedTouchActions const):
634
635         Just get it from the style.
636
637         * platform/graphics/GraphicsLayer.cpp:
638         (WebCore::GraphicsLayer::setEventRegion):
639         (WebCore::GraphicsLayer::setTouchActionRegion):
640         (WebCore::GraphicsLayer::dumpProperties const):
641         * platform/graphics/GraphicsLayer.h:
642         (WebCore::GraphicsLayer::touchActionRegion const):
643         * platform/graphics/ca/GraphicsLayerCA.cpp:
644         (WebCore::GraphicsLayerCA::setTouchActionRegion):
645         * platform/graphics/ca/GraphicsLayerCA.h:
646         * rendering/PaintInfo.h:
647         * rendering/RenderBlock.cpp:
648         (WebCore::RenderBlock::paintObject):
649         * rendering/RenderLayer.cpp:
650         (WebCore::RenderLayer::collectEventRegionForFragments):
651         * rendering/RenderLayer.h:
652         * rendering/RenderLayerBacking.cpp:
653         (WebCore::RenderLayerBacking::updateConfiguration):
654
655         Need to do this for the top compositing layer too.
656
657         (WebCore::RenderLayerBacking::updateEventRegion):
658
659         Compute touch-action region too.
660         As a basic optimization avoid doing any extra work if there are no elements with non-default touch-action property.
661
662         * rendering/TouchActionRegion.cpp: Added.
663         (WebCore::toIndex):
664         (WebCore::toTouchAction):
665         (WebCore::toString):
666         (WebCore::TouchActionRegion::unite):
667         (WebCore::TouchActionRegion::actionsForPoint const):
668         (WebCore::TouchActionRegion::translate):
669         (WebCore::operator<<):
670         * rendering/TouchActionRegion.h: Added.
671
672         Class for collecting and maintaining touch-action region.
673
674         (WebCore::TouchActionRegion::isEmpty const):
675         (WebCore::TouchActionRegion::operator== const):
676         * rendering/style/RenderStyle.h:
677         (WebCore::RenderStyle::effectiveTouchActions const):
678         (WebCore::RenderStyle::setEffectiveTouchActions):
679
680         Implement as inherited property for efficiency (touch-action itself is non-inherited).
681
682         * rendering/style/StyleRareInheritedData.cpp:
683         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
684         (WebCore::StyleRareInheritedData::operator== const):
685         * rendering/style/StyleRareInheritedData.h:
686
687 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
688
689         Unreviewed, fix linking error because the build of RTCIceTransport.cpp is handled in Xcode project side accidentally
690         https://bugs.webkit.org/show_bug.cgi?id=196475
691
692         We did not have RTCIceTransport.cpp in Sources.txt.
693
694         * WebCore.xcodeproj/project.pbxproj:
695
696 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
697
698         [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
699         https://bugs.webkit.org/show_bug.cgi?id=196475
700
701         Reviewed by Saam Barati.
702
703         This patch puts most of derived classes of ScriptWrappable into IsoHeap. We do not include derived classes of Event simply
704         because Internal repository code also inherits it. After watching the result of this patch, we will try Event and its derived
705         classes into IsoHeap too.
706
707         This patch makes the following things IsoHeap-allocated. These classes are listed by using lldb python script.
708
709             1. DOM collections (HTMLCollection etc.)
710             2. WebAudio nodes
711             3. IDB classes
712             4. FileSystem API classes
713             5. Canvas contexts
714             6. WebRTC classses
715             7. XMLHttpRequest related classes
716             8. WebSocket related classes
717             9. Worker and Worklet related classes
718             10. Other misc classes
719
720         * Modules/applepay/ApplePaySession.cpp:
721         * Modules/applepay/ApplePaySession.h:
722         * Modules/encryptedmedia/MediaKeySession.cpp:
723         * Modules/encryptedmedia/MediaKeySession.h:
724         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
725         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
726         * Modules/entriesapi/DOMFileSystem.cpp:
727         * Modules/entriesapi/DOMFileSystem.h:
728         (WebCore::DOMFileSystem::createEntryForFile): Deleted.
729         (WebCore::DOMFileSystem::name const): Deleted.
730         * Modules/entriesapi/FileSystemDirectoryEntry.h:
731         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
732         * Modules/entriesapi/FileSystemDirectoryReader.h:
733         * Modules/entriesapi/FileSystemEntry.cpp:
734         * Modules/entriesapi/FileSystemEntry.h:
735         * Modules/entriesapi/FileSystemFileEntry.h:
736         * Modules/geolocation/Geolocation.cpp:
737         * Modules/geolocation/Geolocation.h:
738         (WebCore::Geolocation::document const): Deleted.
739         (WebCore::Geolocation::frame const): Deleted.
740         (WebCore::Geolocation::resetIsAllowed): Deleted.
741         (WebCore::Geolocation::isAllowed const): Deleted.
742         (WebCore::Geolocation::isDenied const): Deleted.
743         (WebCore::Geolocation::hasListeners const): Deleted.
744         * Modules/indexeddb/IDBCursor.cpp:
745         * Modules/indexeddb/IDBCursor.h:
746         * Modules/indexeddb/IDBCursorWithValue.cpp:
747         * Modules/indexeddb/IDBCursorWithValue.h:
748         * Modules/indexeddb/IDBDatabase.cpp:
749         * Modules/indexeddb/IDBDatabase.h:
750         (WebCore::IDBDatabase::info const): Deleted.
751         (WebCore::IDBDatabase::databaseConnectionIdentifier const): Deleted.
752         (WebCore::IDBDatabase::connectionProxy): Deleted.
753         (WebCore::IDBDatabase::isClosingOrClosed const): Deleted.
754         * Modules/indexeddb/IDBKeyRange.cpp:
755         * Modules/indexeddb/IDBKeyRange.h:
756         (WebCore::IDBKeyRange::lower const): Deleted.
757         (WebCore::IDBKeyRange::upper const): Deleted.
758         (WebCore::IDBKeyRange::lowerOpen const): Deleted.
759         (WebCore::IDBKeyRange::upperOpen const): Deleted.
760         * Modules/indexeddb/IDBOpenDBRequest.cpp:
761         * Modules/indexeddb/IDBOpenDBRequest.h:
762         * Modules/indexeddb/IDBRequest.cpp:
763         * Modules/indexeddb/IDBRequest.h:
764         * Modules/indexeddb/IDBTransaction.cpp:
765         * Modules/indexeddb/IDBTransaction.h:
766         (WebCore::IDBTransaction::mode const): Deleted.
767         (WebCore::IDBTransaction::info const): Deleted.
768         (WebCore::IDBTransaction::database): Deleted.
769         (WebCore::IDBTransaction::database const): Deleted.
770         (WebCore::IDBTransaction::originalDatabaseInfo const): Deleted.
771         (WebCore::IDBTransaction::isVersionChange const): Deleted.
772         (WebCore::IDBTransaction::isReadOnly const): Deleted.
773         (WebCore::IDBTransaction::isFinished const): Deleted.
774         * Modules/mediarecorder/MediaRecorder.cpp:
775         * Modules/mediarecorder/MediaRecorder.h:
776         * Modules/mediasession/MediaRemoteControls.cpp:
777         * Modules/mediasession/MediaRemoteControls.h:
778         (WebCore::MediaRemoteControls::create): Deleted.
779         (WebCore::MediaRemoteControls::previousTrackEnabled const): Deleted.
780         (WebCore::MediaRemoteControls::nextTrackEnabled const): Deleted.
781         * Modules/mediasource/MediaSource.cpp:
782         * Modules/mediasource/MediaSource.h:
783         * Modules/mediasource/SourceBuffer.cpp:
784         * Modules/mediasource/SourceBuffer.h:
785         * Modules/mediasource/SourceBufferList.cpp:
786         * Modules/mediasource/SourceBufferList.h:
787         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
788         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
789         * Modules/mediastream/MediaDeviceInfo.cpp:
790         * Modules/mediastream/MediaDeviceInfo.h:
791         (WebCore::MediaDeviceInfo::label const): Deleted.
792         (WebCore::MediaDeviceInfo::deviceId const): Deleted.
793         (WebCore::MediaDeviceInfo::groupId const): Deleted.
794         (WebCore::MediaDeviceInfo::kind const): Deleted.
795         * Modules/mediastream/MediaDevices.cpp:
796         * Modules/mediastream/MediaDevices.h:
797         * Modules/mediastream/MediaStream.cpp:
798         * Modules/mediastream/MediaStream.h:
799         * Modules/mediastream/MediaStreamTrack.cpp:
800         * Modules/mediastream/MediaStreamTrack.h:
801         * Modules/mediastream/RTCDTMFSender.cpp:
802         * Modules/mediastream/RTCDTMFSender.h:
803         * Modules/mediastream/RTCDataChannel.cpp:
804         * Modules/mediastream/RTCDataChannel.h:
805         * Modules/mediastream/RTCIceCandidate.cpp:
806         * Modules/mediastream/RTCIceCandidate.h:
807         (WebCore::RTCIceCandidate::candidate const): Deleted.
808         (WebCore::RTCIceCandidate::sdpMid const): Deleted.
809         (WebCore::RTCIceCandidate::sdpMLineIndex const): Deleted.
810         (WebCore::RTCIceCandidate::setCandidate): Deleted.
811         * Modules/mediastream/RTCIceTransport.cpp:
812         * Modules/mediastream/RTCIceTransport.h:
813         (WebCore::RTCIceTransport::create): Deleted.
814         (WebCore::RTCIceTransport::state const): Deleted.
815         (WebCore::RTCIceTransport::setState): Deleted.
816         (WebCore::RTCIceTransport::gatheringState const): Deleted.
817         (WebCore::RTCIceTransport::setGatheringState): Deleted.
818         (WebCore::RTCIceTransport::RTCIceTransport): Deleted.
819         * Modules/mediastream/RTCPeerConnection.cpp:
820         * Modules/mediastream/RTCPeerConnection.h:
821         * Modules/mediastream/RTCRtpReceiver.cpp:
822         * Modules/mediastream/RTCRtpReceiver.h:
823         (WebCore::RTCRtpReceiver::create): Deleted.
824         (WebCore::RTCRtpReceiver::setBackend): Deleted.
825         (WebCore::RTCRtpReceiver::getParameters): Deleted.
826         (WebCore::RTCRtpReceiver::getContributingSources const): Deleted.
827         (WebCore::RTCRtpReceiver::getSynchronizationSources const): Deleted.
828         (WebCore::RTCRtpReceiver::track): Deleted.
829         (WebCore::RTCRtpReceiver::backend): Deleted.
830         * Modules/mediastream/RTCRtpSender.cpp:
831         * Modules/mediastream/RTCRtpSender.h:
832         (WebCore::RTCRtpSender::track): Deleted.
833         (WebCore::RTCRtpSender::trackId const): Deleted.
834         (WebCore::RTCRtpSender::trackKind const): Deleted.
835         (WebCore::RTCRtpSender::mediaStreamIds const): Deleted.
836         (WebCore::RTCRtpSender::setMediaStreamIds): Deleted.
837         (WebCore::RTCRtpSender::isStopped const): Deleted.
838         (WebCore::RTCRtpSender::backend): Deleted.
839         * Modules/mediastream/RTCRtpTransceiver.cpp:
840         * Modules/mediastream/RTCRtpTransceiver.h:
841         (WebCore::RTCRtpTransceiver::create): Deleted.
842         (WebCore::RTCRtpTransceiver::sender): Deleted.
843         (WebCore::RTCRtpTransceiver::receiver): Deleted.
844         (WebCore::RTCRtpTransceiver::iceTransport): Deleted.
845         (WebCore::RTCRtpTransceiver::backend): Deleted.
846         * Modules/mediastream/RTCSessionDescription.cpp:
847         * Modules/mediastream/RTCSessionDescription.h:
848         (WebCore::RTCSessionDescription::type const): Deleted.
849         (WebCore::RTCSessionDescription::sdp const): Deleted.
850         (WebCore::RTCSessionDescription::setSdp): Deleted.
851         * Modules/notifications/Notification.cpp:
852         * Modules/notifications/Notification.h:
853         * Modules/paymentrequest/PaymentRequest.cpp:
854         * Modules/paymentrequest/PaymentRequest.h:
855         * Modules/paymentrequest/PaymentResponse.cpp:
856         * Modules/paymentrequest/PaymentResponse.h:
857         * Modules/speech/SpeechSynthesisUtterance.cpp:
858         * Modules/speech/SpeechSynthesisUtterance.h:
859         * Modules/webaudio/AnalyserNode.cpp:
860         * Modules/webaudio/AnalyserNode.h:
861         * Modules/webaudio/AudioBasicInspectorNode.cpp:
862         * Modules/webaudio/AudioBasicInspectorNode.h:
863         * Modules/webaudio/AudioBasicProcessorNode.cpp:
864         * Modules/webaudio/AudioBasicProcessorNode.h:
865         * Modules/webaudio/AudioBufferSourceNode.cpp:
866         * Modules/webaudio/AudioBufferSourceNode.h:
867         * Modules/webaudio/AudioContext.cpp:
868         * Modules/webaudio/AudioContext.h:
869         * Modules/webaudio/AudioDestinationNode.cpp:
870         * Modules/webaudio/AudioDestinationNode.h:
871         * Modules/webaudio/AudioNode.cpp:
872         * Modules/webaudio/AudioNode.h:
873         * Modules/webaudio/AudioScheduledSourceNode.cpp:
874         * Modules/webaudio/AudioScheduledSourceNode.h:
875         * Modules/webaudio/BiquadFilterNode.cpp:
876         * Modules/webaudio/BiquadFilterNode.h:
877         * Modules/webaudio/ChannelMergerNode.cpp:
878         * Modules/webaudio/ChannelMergerNode.h:
879         * Modules/webaudio/ChannelSplitterNode.cpp:
880         * Modules/webaudio/ChannelSplitterNode.h:
881         * Modules/webaudio/ConvolverNode.cpp:
882         * Modules/webaudio/ConvolverNode.h:
883         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
884         * Modules/webaudio/DefaultAudioDestinationNode.h:
885         * Modules/webaudio/DelayNode.cpp:
886         * Modules/webaudio/DelayNode.h:
887         * Modules/webaudio/DynamicsCompressorNode.cpp:
888         * Modules/webaudio/DynamicsCompressorNode.h:
889         * Modules/webaudio/GainNode.cpp:
890         * Modules/webaudio/GainNode.h:
891         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
892         * Modules/webaudio/MediaElementAudioSourceNode.h:
893         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
894         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
895         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
896         * Modules/webaudio/MediaStreamAudioSourceNode.h:
897         * Modules/webaudio/OfflineAudioContext.cpp:
898         * Modules/webaudio/OfflineAudioContext.h:
899         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
900         * Modules/webaudio/OfflineAudioDestinationNode.h:
901         * Modules/webaudio/OscillatorNode.cpp:
902         * Modules/webaudio/OscillatorNode.h:
903         * Modules/webaudio/PannerNode.cpp:
904         * Modules/webaudio/PannerNode.h:
905         * Modules/webaudio/ScriptProcessorNode.cpp:
906         * Modules/webaudio/ScriptProcessorNode.h:
907         * Modules/webaudio/WaveShaperNode.cpp:
908         * Modules/webaudio/WaveShaperNode.h:
909         * Modules/webgpu/GPUCanvasContext.cpp:
910         * Modules/webgpu/GPUCanvasContext.h:
911         * Modules/websockets/WebSocket.cpp:
912         * Modules/websockets/WebSocket.h:
913         * Modules/webvr/VRDisplay.cpp:
914         * Modules/webvr/VRDisplay.h:
915         (WebCore::VRDisplay::isPresenting const): Deleted.
916         (WebCore::VRDisplay::displayName const): Deleted.
917         (WebCore::VRDisplay::displayId const): Deleted.
918         (WebCore::VRDisplay::depthNear const): Deleted.
919         (WebCore::VRDisplay::setDepthNear): Deleted.
920         (WebCore::VRDisplay::depthFar const): Deleted.
921         (WebCore::VRDisplay::setDepthFar): Deleted.
922         (WebCore::VRDisplay::document): Deleted.
923         * Sources.txt:
924         * WebCore.xcodeproj/project.pbxproj:
925         * animation/CSSAnimation.cpp:
926         * animation/CSSAnimation.h:
927         * animation/CSSTransition.cpp:
928         * animation/CSSTransition.h:
929         * animation/DeclarativeAnimation.cpp:
930         * animation/DeclarativeAnimation.h:
931         * animation/WebAnimation.cpp:
932         * animation/WebAnimation.h:
933         * bindings/js/ScriptWrappable.h:
934         * css/CSSComputedStyleDeclaration.cpp:
935         * css/CSSComputedStyleDeclaration.h:
936         * css/CSSStyleDeclaration.cpp:
937         (): Deleted.
938         * css/CSSStyleDeclaration.h:
939         * css/DOMMatrix.h:
940         * css/DOMMatrixReadOnly.cpp:
941         * css/DOMMatrixReadOnly.h:
942         * css/FontFaceSet.cpp:
943         * css/FontFaceSet.h:
944         * css/PropertySetCSSStyleDeclaration.cpp:
945         * css/PropertySetCSSStyleDeclaration.h:
946         * css/WebKitCSSMatrix.cpp:
947         * css/WebKitCSSMatrix.h:
948         * css/typedom/TypedOMCSSImageValue.cpp: Added.
949         * css/typedom/TypedOMCSSImageValue.h:
950         * css/typedom/TypedOMCSSNumericValue.cpp: Added.
951         * css/typedom/TypedOMCSSNumericValue.h:
952         * css/typedom/TypedOMCSSStyleValue.cpp: Added.
953         * css/typedom/TypedOMCSSStyleValue.h:
954         * css/typedom/TypedOMCSSUnitValue.cpp: Added.
955         * css/typedom/TypedOMCSSUnitValue.h:
956         * css/typedom/TypedOMCSSUnparsedValue.cpp: Added.
957         * css/typedom/TypedOMCSSUnparsedValue.h:
958         * dom/AbortController.cpp:
959         * dom/AbortController.h:
960         * dom/AbortSignal.cpp:
961         * dom/AbortSignal.h:
962         * dom/AllDescendantsCollection.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
963         * dom/AllDescendantsCollection.h:
964         * dom/ChildNodeList.cpp:
965         * dom/ChildNodeList.h:
966         * dom/ClassCollection.cpp:
967         * dom/ClassCollection.h:
968         * dom/DOMImplementation.cpp:
969         * dom/DOMImplementation.h:
970         (WebCore::DOMImplementation::ref): Deleted.
971         (WebCore::DOMImplementation::deref): Deleted.
972         (WebCore::DOMImplementation::document): Deleted.
973         (WebCore::DOMImplementation::hasFeature): Deleted.
974         * dom/DOMPoint.h:
975         * dom/DOMPointReadOnly.cpp:
976         * dom/DOMPointReadOnly.h:
977         * dom/DOMQuad.cpp:
978         * dom/DOMQuad.h:
979         * dom/DOMRect.h:
980         * dom/DOMRectReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.cpp.
981         * dom/DOMRectReadOnly.h:
982         * dom/DataTransferItemList.cpp:
983         * dom/DataTransferItemList.h:
984         (WebCore::DataTransferItemList::ref): Deleted.
985         (WebCore::DataTransferItemList::deref): Deleted.
986         (WebCore::DataTransferItemList::dataTransfer): Deleted.
987         (WebCore::DataTransferItemList::hasItems const): Deleted.
988         (WebCore::DataTransferItemList::items const): Deleted.
989         * dom/DatasetDOMStringMap.cpp:
990         * dom/DatasetDOMStringMap.h:
991         * dom/DocumentParser.h:
992         * dom/EventTarget.cpp:
993         * dom/EventTarget.h:
994         * dom/LiveNodeList.cpp:
995         * dom/LiveNodeList.h:
996         * dom/MessageChannel.cpp:
997         * dom/MessagePort.cpp:
998         * dom/MessagePort.h:
999         * dom/NameNodeList.cpp:
1000         * dom/NameNodeList.h:
1001         * dom/NamedNodeMap.cpp:
1002         * dom/NamedNodeMap.h:
1003         (WebCore::NamedNodeMap::NamedNodeMap): Deleted.
1004         (WebCore::NamedNodeMap::element): Deleted.
1005         * dom/NodeIterator.cpp:
1006         * dom/NodeIterator.h:
1007         (WebCore::NodeIterator::detach): Deleted.
1008         (WebCore::NodeIterator::referenceNode const): Deleted.
1009         (WebCore::NodeIterator::pointerBeforeReferenceNode const): Deleted.
1010         * dom/NodeList.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
1011         * dom/NodeList.h:
1012         * dom/NodeRareData.cpp:
1013         * dom/ScriptExecutionContext.cpp:
1014         * dom/SimulatedClick.cpp:
1015         * dom/StaticNodeList.cpp:
1016         * dom/StaticNodeList.h:
1017         * dom/TagCollection.cpp:
1018         * dom/TagCollection.h:
1019         * dom/TreeWalker.cpp:
1020         * dom/TreeWalker.h:
1021         (WebCore::TreeWalker::create): Deleted.
1022         (WebCore::TreeWalker::currentNode): Deleted.
1023         (WebCore::TreeWalker::currentNode const): Deleted.
1024         * fileapi/Blob.cpp:
1025         * fileapi/Blob.h:
1026         * fileapi/File.cpp:
1027         * fileapi/File.h:
1028         * fileapi/FileList.cpp:
1029         * fileapi/FileList.h:
1030         (WebCore::FileList::create): Deleted.
1031         (WebCore::FileList::length const): Deleted.
1032         (WebCore::FileList::isEmpty const): Deleted.
1033         (WebCore::FileList::files const): Deleted.
1034         (WebCore::FileList::file const): Deleted.
1035         (WebCore::FileList::FileList): Deleted.
1036         (WebCore::FileList::append): Deleted.
1037         (WebCore::FileList::clear): Deleted.
1038         * fileapi/FileReader.cpp:
1039         * fileapi/FileReader.h:
1040         * html/CachedHTMLCollection.h:
1041         * html/GenericCachedHTMLCollection.cpp:
1042         * html/GenericCachedHTMLCollection.h:
1043         * html/HTMLAllCollection.cpp:
1044         * html/HTMLAllCollection.h:
1045         * html/HTMLCollection.cpp:
1046         * html/HTMLCollection.h:
1047         * html/HTMLFormControlsCollection.cpp:
1048         * html/HTMLFormControlsCollection.h:
1049         * html/HTMLNameCollection.cpp:
1050         * html/HTMLNameCollection.h:
1051         * html/HTMLOptionsCollection.cpp:
1052         * html/HTMLOptionsCollection.h:
1053         * html/HTMLTableRowsCollection.cpp:
1054         * html/HTMLTableRowsCollection.h:
1055         * html/ImageBitmap.cpp:
1056         * html/ImageBitmap.h:
1057         (WebCore::ImageBitmap::isDetached const): Deleted.
1058         (WebCore::ImageBitmap::buffer): Deleted.
1059         (WebCore::ImageBitmap::originClean const): Deleted.
1060         * html/LabelsNodeList.cpp:
1061         * html/LabelsNodeList.h:
1062         * html/MediaController.cpp:
1063         * html/MediaController.h:
1064         * html/OffscreenCanvas.cpp:
1065         * html/OffscreenCanvas.h:
1066         * html/RadioNodeList.cpp:
1067         * html/RadioNodeList.h:
1068         * html/canvas/CanvasRenderingContext.cpp:
1069         * html/canvas/CanvasRenderingContext.h:
1070         * html/canvas/CanvasRenderingContext2D.cpp:
1071         * html/canvas/CanvasRenderingContext2D.h:
1072         * html/canvas/CanvasRenderingContext2DBase.cpp:
1073         * html/canvas/CanvasRenderingContext2DBase.h:
1074         * html/canvas/GPUBasedCanvasRenderingContext.h:
1075         * html/canvas/ImageBitmapRenderingContext.cpp:
1076         * html/canvas/ImageBitmapRenderingContext.h:
1077         * html/canvas/OffscreenCanvasRenderingContext2D.cpp:
1078         * html/canvas/OffscreenCanvasRenderingContext2D.h:
1079         * html/canvas/PaintRenderingContext2D.cpp:
1080         * html/canvas/PaintRenderingContext2D.h:
1081         * html/canvas/PlaceholderRenderingContext.cpp:
1082         * html/canvas/PlaceholderRenderingContext.h:
1083         * html/canvas/WebGL2RenderingContext.cpp:
1084         * html/canvas/WebGL2RenderingContext.h:
1085         * html/canvas/WebGLRenderingContext.cpp:
1086         * html/canvas/WebGLRenderingContext.h:
1087         * html/canvas/WebGLRenderingContextBase.cpp:
1088         * html/canvas/WebGLRenderingContextBase.h:
1089         * html/track/AudioTrackList.h:
1090         * html/track/DataCue.cpp:
1091         * html/track/DataCue.h:
1092         * html/track/InbandDataTextTrack.cpp:
1093         * html/track/InbandDataTextTrack.h:
1094         * html/track/InbandGenericTextTrack.cpp:
1095         * html/track/InbandGenericTextTrack.h:
1096         * html/track/InbandTextTrack.cpp:
1097         * html/track/InbandTextTrack.h:
1098         * html/track/InbandWebVTTTextTrack.cpp:
1099         * html/track/InbandWebVTTTextTrack.h:
1100         * html/track/LoadableTextTrack.cpp:
1101         * html/track/LoadableTextTrack.h:
1102         * html/track/TextTrack.cpp:
1103         * html/track/TextTrack.h:
1104         * html/track/TextTrackCue.cpp:
1105         * html/track/TextTrackCue.h:
1106         * html/track/TextTrackCueGeneric.cpp:
1107         * html/track/TextTrackCueGeneric.h:
1108         * html/track/TextTrackList.cpp:
1109         * html/track/TextTrackList.h:
1110         * html/track/TrackListBase.cpp:
1111         * html/track/TrackListBase.h:
1112         * html/track/VTTCue.cpp:
1113         * html/track/VTTCue.h:
1114         * html/track/VideoTrackList.h:
1115         * loader/appcache/DOMApplicationCache.cpp:
1116         * loader/appcache/DOMApplicationCache.h:
1117         * page/AbstractDOMWindow.cpp:
1118         * page/AbstractDOMWindow.h:
1119         * page/BarProp.cpp:
1120         * page/BarProp.h:
1121         (WebCore::BarProp::create): Deleted.
1122         * page/DOMWindow.cpp:
1123         * page/DOMWindow.h:
1124         * page/EventSource.cpp:
1125         * page/EventSource.h:
1126         * page/History.cpp:
1127         * page/History.h:
1128         * page/Location.cpp:
1129         * page/Location.h:
1130         (WebCore::Location::create): Deleted.
1131         (WebCore::Location::toString const): Deleted.
1132         * page/Navigator.cpp:
1133         * page/Navigator.h:
1134         * page/Performance.cpp:
1135         * page/Performance.h:
1136         * page/RemoteDOMWindow.cpp:
1137         * page/RemoteDOMWindow.h:
1138         * page/Screen.cpp:
1139         * page/Screen.h:
1140         * page/VisualViewport.cpp:
1141         * page/VisualViewport.h:
1142         * plugins/DOMMimeTypeArray.cpp:
1143         * plugins/DOMMimeTypeArray.h:
1144         (WebCore::DOMMimeTypeArray::create): Deleted.
1145         * plugins/DOMPlugin.cpp:
1146         * plugins/DOMPlugin.h:
1147         (WebCore::DOMPlugin::create): Deleted.
1148         * plugins/DOMPluginArray.cpp:
1149         * plugins/DOMPluginArray.h:
1150         (WebCore::DOMPluginArray::create): Deleted.
1151         * storage/Storage.cpp:
1152         * storage/Storage.h:
1153         (WebCore::Storage::area const): Deleted.
1154         * workers/AbstractWorker.cpp:
1155         * workers/AbstractWorker.h:
1156         * workers/DedicatedWorkerGlobalScope.cpp:
1157         * workers/DedicatedWorkerGlobalScope.h:
1158         * workers/Worker.cpp:
1159         * workers/Worker.h:
1160         * workers/WorkerGlobalScope.cpp:
1161         * workers/WorkerGlobalScope.h:
1162         * workers/service/ServiceWorker.cpp:
1163         * workers/service/ServiceWorker.h:
1164         * workers/service/ServiceWorkerContainer.cpp:
1165         * workers/service/ServiceWorkerContainer.h:
1166         * workers/service/ServiceWorkerGlobalScope.cpp:
1167         * workers/service/ServiceWorkerGlobalScope.h:
1168         * workers/service/ServiceWorkerRegistration.cpp:
1169         * workers/service/ServiceWorkerRegistration.h:
1170         * worklets/PaintWorkletGlobalScope.cpp:
1171         * worklets/PaintWorkletGlobalScope.h:
1172         * worklets/Worklet.cpp:
1173         * worklets/Worklet.h:
1174         * worklets/WorkletGlobalScope.cpp:
1175         * worklets/WorkletGlobalScope.h:
1176         * xml/XMLHttpRequest.cpp:
1177         * xml/XMLHttpRequest.h:
1178         * xml/XMLHttpRequestEventTarget.h:
1179         * xml/XMLHttpRequestUpload.cpp:
1180         * xml/XMLHttpRequestUpload.h:
1181         * xml/XPathParser.cpp:
1182
1183 2019-04-04  Chris Dumez  <cdumez@apple.com>
1184
1185         Unreviewed, fix iOS build with recent SDKs.
1186
1187         std::ptr_fun() is deprecated.
1188
1189         * platform/ios/LegacyTileGrid.mm:
1190         (WebCore::LegacyTileGrid::dropDistantTiles):
1191
1192 2019-04-04  Antoine Quint  <graouts@apple.com>
1193
1194         [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
1195         https://bugs.webkit.org/show_bug.cgi?id=196118
1196         <rdar://problem/46614137>
1197
1198         Reviewed by Ryosuke Niwa.
1199
1200         Test: webanimations/js-wrapper-kept-alive.html
1201
1202         We need to teach WebAnimation to keep its JS wrapper alive if it's relevant or could become relevant again by virtue of having a timeline.
1203
1204         * animation/WebAnimation.cpp:
1205         (WebCore::WebAnimation::stop): Drive-by fix for the missing superclass method call.
1206         (WebCore::WebAnimation::hasPendingActivity const):
1207         * animation/WebAnimation.h:
1208
1209 2019-04-04  Miguel Gomez  <magomez@igalia.com>
1210
1211         [GTK][WPE] Use a timer to request the creation of pending tiles
1212         https://bugs.webkit.org/show_bug.cgi?id=196594
1213
1214         Reviewed by Žan Doberšek.
1215
1216         Use a timer to request pending tile creation, as calls to notifyFlushRequired() are discarded
1217         while inside a layer flush.
1218
1219         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1220         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
1221         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
1222         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
1223         (WebCore::CoordinatedGraphicsLayer::requestPendingTileCreationTimerFired):
1224         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1225
1226 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1227
1228         [ATK] Wrong index passed to AtkObject::children-changed::add signal in AXObjectCache::attachWrapper()
1229         https://bugs.webkit.org/show_bug.cgi?id=196538
1230
1231         Reviewed by Michael Catanzaro.
1232
1233         In most of the cases the parent is not found, probably because the child is not a direct descendant of the
1234         parent returned by parentObjectUnignored(). We need to handle the case of find() returning notFound.
1235
1236         * accessibility/atk/AXObjectCacheAtk.cpp:
1237         (WebCore::AXObjectCache::attachWrapper): Use -1 as the index when find() returns notFound.
1238
1239 2019-04-03  Timothy Hatcher  <timothy@apple.com>
1240
1241         Update AutoFill field icons to be SVG instead of PNG images.
1242         https://bugs.webkit.org/show_bug.cgi?id=196557
1243         rdar://problem/48292514
1244
1245         Reviewed by Tim Horton.
1246
1247         * css/html.css:
1248         (input::-webkit-credentials-auto-fill-button):
1249         (input::-webkit-contacts-auto-fill-button):
1250         (input::-webkit-credit-card-auto-fill-button):
1251
1252 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
1253
1254         Simplify some "programmaticScroll" code paths
1255         https://bugs.webkit.org/show_bug.cgi?id=196589
1256
1257         Reviewed by Zalan Bujtas.
1258
1259         AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll() just returned early if programmaticScroll
1260         was true, so instead, just never call it. This means we can remove the "programmaticScroll" argument from 
1261         scheduleUpdateScrollPositionAfterAsyncScroll(). Also change some callers to use the ScrollType enum
1262         instead of a bool.
1263
1264         Now, ThreadedScrollingTree::scrollingTreeNodeDidScroll() just returns early. Programmatic scrolls
1265         update state on the main thread before updating the scrolling tree, so this makes sense.
1266
1267         * page/scrolling/AsyncScrollingCoordinator.cpp:
1268         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
1269         (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
1270         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired):
1271         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
1272         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1273         * page/scrolling/AsyncScrollingCoordinator.h:
1274         (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
1275         (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::matchesUpdateType const):
1276         * page/scrolling/ScrollingCoordinator.cpp:
1277         (WebCore::operator<<):
1278         * page/scrolling/ScrollingCoordinator.h:
1279         (WebCore::ScrollingCoordinator::reconcileScrollingState):
1280         * page/scrolling/ThreadedScrollingTree.cpp:
1281         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
1282
1283 2019-04-03  Youenn Fablet  <youenn@apple.com>
1284
1285         Add logging and ASSERTs to investigate issue with VPModuleInitialize
1286         https://bugs.webkit.org/show_bug.cgi?id=196573
1287
1288         Reviewed by Eric Carlson.
1289
1290         Add some ASSERTs.
1291         No change of behavior.
1292
1293         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
1294         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
1295         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
1296
1297 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
1298
1299         Remove some redundant memebers from ScrollingStateFrameScrollingNode
1300         https://bugs.webkit.org/show_bug.cgi?id=196571
1301
1302         Reviewed by Zalan Bujtas.
1303
1304         m_requestedScrollPosition and m_requestedScrollPositionRepresentsProgrammaticScroll were
1305         duplicated on ScrollingStateFrameScrollingNode and ScrollingStateScrollingNode, so
1306         remove them from the derived class.
1307
1308         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1309         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1310         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
1311         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1312
1313 2019-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
1314
1315         REGRESSION (r220717): Assertion fires when animating an SVG rounded corner rect till it collapses
1316         https://bugs.webkit.org/show_bug.cgi?id=196518
1317
1318         Reviewed by Simon Fraser.
1319
1320         r220717 made RenderSVGRect clear its m_path in updateShapeFromElement().
1321
1322         RenderSVGRect tries to optimize its layout and drawing if the rectangle
1323         is not rounded. So it uses the flag m_usePathFallback to know whether to
1324         use m_path or m_innerStrokeRect and m_outerStrokeRect. If the rectangle
1325         is rounded but its boundingSize is empty, m_path will be cleared,
1326         m_innerStrokeRect and m_outerStrokeRect will be recalculated but
1327         m_usePathFallback will not be reset to false. Therefore when calling 
1328         RenderSVGRect::isEmpty(), it will call RenderSVGShape::isEmpty() which
1329         will assert since m_path is null.
1330
1331         Test: svg/animations/animate-rounded-corner-rect-zero-height.svg
1332
1333         * rendering/svg/RenderSVGRect.cpp:
1334         (WebCore::RenderSVGRect::updateShapeFromElement):
1335         Reset m_usePathFallback to false once clearPath() is called.
1336
1337 2019-04-03  Ryosuke Niwa  <rniwa@webkit.org>
1338
1339         Nullptr crash in InlineTextBox::selectionState via TextIndicator::createWithRange
1340         https://bugs.webkit.org/show_bug.cgi?id=196579
1341
1342         Reviewed by Simon Fraser.
1343
1344         Avoid crashing accessing the unengated optional's value in relese builds for now.
1345
1346         Unfortunately, fixing the underlying cause of the selection states of RenderView & RenderObject
1347         getting out out of sync would require a significant re-architecturing of the whole selection
1348         repainting / state managing mechanism.
1349
1350         * rendering/SelectionRangeData.h:
1351         (WebCore::SelectionRangeData::startPosition const):
1352         (WebCore::SelectionRangeData::endPosition const):
1353
1354 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
1355
1356         -apple-trailing-word is needed for browser detection
1357         https://bugs.webkit.org/show_bug.cgi?id=196575
1358
1359         Unreviewed.
1360
1361         This is an unreviewed partial revert of r243819. Turns out there are some websites
1362         which use this property to do browser detection. So, we need to continue to parse
1363         the property, but we don't need the property to do anything.
1364
1365         Test: fast/text/trailing-word-detection.html
1366
1367         * Configurations/FeatureDefines.xcconfig:
1368         * css/CSSComputedStyleDeclaration.cpp:
1369         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1370         * css/CSSPrimitiveValueMappings.h:
1371         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1372         (WebCore::CSSPrimitiveValue::operator TrailingWord const):
1373         * css/CSSProperties.json:
1374         * css/CSSValueKeywords.in:
1375         * css/parser/CSSParserFastPaths.cpp:
1376         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1377         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1378         * rendering/style/RenderStyle.h:
1379         (WebCore::RenderStyle::trailingWord const):
1380         (WebCore::RenderStyle::setTrailingWord):
1381         (WebCore::RenderStyle::initialTrailingWord):
1382         * rendering/style/RenderStyleConstants.h:
1383
1384 2019-04-03  Don Olmstead  <don.olmstead@sony.com>
1385
1386         [CMake][WTF] Mirror XCode header directories
1387         https://bugs.webkit.org/show_bug.cgi?id=191662
1388
1389         Reviewed by Konstantin Tokarev.
1390
1391         Use WTFFramework as a dependency and include frameworks/WTF.cmake for AppleWin internal
1392         builds.
1393
1394         * CMakeLists.txt:
1395         * PlatformWin.cmake:
1396
1397 2019-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
1398
1399         Remove SVG properties tear-off objects
1400         https://bugs.webkit.org/show_bug.cgi?id=191237
1401
1402         Reviewed by Simon Fraser.
1403
1404         This patch cleans the code from unused SVG sources and get rid off the
1405         remaining SVG properties tear-off objects. Here are more details:
1406
1407         -- Remove the SVGAttributeAnimationController and move its code to the
1408            SVGAnimateElementBase. SVGAttributeAnimationController was introduced
1409            to allow animating the SVG properties whether they are backed by tear
1410            off objects or not. Since there will be no tear off objects anymore,
1411            one animation controller will be needed. But in this case, it will be
1412            better if we make SVGAnimateElementBase is the animation controller
1413            and make it manage the animator directly.
1414
1415         -- Remove SVGAttributeRegistry, SVGAttributeOwnerProxy and the virtual
1416            function SVGElement::attributeOwnerProxy(). Remove also all the
1417            overriding functions attributeOwnerProxy() from all the SVGElements.
1418
1419         -- Remove isKnownAttribute() from all the SVG header files except from 
1420            four classes: SVGURIReference, SVGFitToViewBox, SVGLangSpace
1421            and SVGExternalResourcesRequired.
1422
1423         -- Remove all the SVG animated properties classifying functions from
1424            SVGElement. This is now handled by SVGPropertyRegistry.
1425
1426         -- There is no need for the enum AnimatedPropertyType anymore. The SVG
1427            property accessor knows its type, knows how to access it and know what
1428            animator it should be created for it.
1429
1430         * Sources.txt:
1431         * WebCore.xcodeproj/project.pbxproj:
1432         * dom/Element.cpp:
1433         (WebCore::Element::synchronizeAllAttributes const):
1434         (WebCore::Element::synchronizeAttribute const):
1435         (WebCore::Element::fastAttributeLookupAllowed const):
1436         These functions are surprisingly marked 'const'. They were calling 'const'
1437         functions in SVGElement and SVGElement was casting 'this' as non 'const'
1438         before calling the non 'const' functions through the non 'const' 'this'
1439         pointer. Change this by moving the casting to the Element functions.
1440
1441         * rendering/svg/RenderSVGResourceGradient.cpp:
1442         (WebCore::RenderSVGResourceGradient::applyResource):
1443         * rendering/svg/RenderSVGResourcePattern.cpp:
1444         (WebCore::RenderSVGResourcePattern::applyResource):
1445         * svg/SVGAElement.h:
1446         * svg/SVGAltGlyphElement.h:
1447         * svg/SVGAnimateElementBase.cpp:
1448         (WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
1449         (WebCore::SVGAnimateElementBase::animator const):
1450         (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const):
1451         (WebCore::SVGAnimateElementBase::isDiscreteAnimator const):
1452         (WebCore::SVGAnimateElementBase::setTargetElement):
1453         (WebCore::SVGAnimateElementBase::setAttributeName):
1454         (WebCore::SVGAnimateElementBase::resetAnimation):
1455         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
1456         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
1457         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
1458         (WebCore::SVGAnimateElementBase::resetAnimatedType):
1459         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
1460         (WebCore::SVGAnimateElementBase::applyResultsToTarget):
1461         (WebCore::SVGAnimateElementBase::clearAnimatedType):
1462         (WebCore::SVGAnimateElementBase::calculateDistance):
1463         (WebCore::SVGAnimateElementBase::attributeAnimationController): Deleted.
1464         (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): Deleted.
1465         (WebCore::SVGAnimateElementBase::isAdditive const): Deleted.
1466         * svg/SVGAnimateElementBase.h:
1467         (WebCore::SVGAnimateElementBase::animatorIfExists const):
1468         (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists const): Deleted.
1469         The order of the functions was changed to resemble the order of running
1470         the animation:
1471           -- Setting the animation range
1472           -- Starting the animation
1473           -- Progressing the animation
1474           -- Applying the the progressed animaVal() to the target element
1475           -- Stopping the animation
1476
1477         * svg/SVGAnimateMotionElement.cpp:
1478         (WebCore::SVGAnimateMotionElement::calculateDistance):
1479         * svg/SVGAnimateMotionElement.h:
1480         * svg/SVGAnimationElement.cpp:
1481         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
1482         (WebCore::SVGAnimationElement::shouldApplyAnimation): Deleted.
1483         * svg/SVGAnimationElement.h:
1484         (WebCore::SVGAnimationElement::attributeRegistry): Deleted.
1485         (WebCore::SVGAnimationElement::calculateDistance): Deleted.
1486         * svg/SVGAttributeAnimationController.cpp: Removed.
1487         * svg/SVGAttributeAnimationController.h: Removed.
1488         * svg/SVGAttributeAnimationControllerBase.cpp: Removed.
1489         * svg/SVGAttributeAnimationControllerBase.h: Removed.
1490         * svg/SVGCircleElement.h:
1491         * svg/SVGClipPathElement.h:
1492         * svg/SVGComponentTransferFunctionElement.h:
1493         * svg/SVGCursorElement.h:
1494         * svg/SVGDefsElement.h:
1495         * svg/SVGElement.cpp:
1496         (WebCore::SVGElement::synchronizeAttribute):
1497         (WebCore::SVGElement::synchronizeAllAttributes):
1498         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
1499         (WebCore::createAttributeNameToAnimatedPropertyTypeMap): Deleted.
1500         (WebCore::attributeNameToAnimatedPropertyTypeMap): Deleted.
1501         (WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted.
1502         (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted.
1503         (WebCore::SVGElement::animatedPropertyTypesForAttribute): Deleted.
1504         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): Deleted.
1505         (WebCore::SVGElement::isAnimatableCSSProperty): Deleted.
1506         (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Deleted.
1507         * svg/SVGElement.h:
1508         (WebCore::SVGElement::attributeOwnerProxy const): Deleted.
1509         (WebCore::SVGElement::attributeRegistry): Deleted.
1510         (WebCore::SVGElement::synchronizeAttribute): Deleted.
1511         (WebCore::SVGElement::synchronizeAttributes): Deleted.
1512         (WebCore::SVGElement::animatedTypes const): Deleted.
1513         (WebCore::SVGElement::lookupAnimatedProperty const): Deleted.
1514         (WebCore::SVGElement::lookupOrCreateAnimatedProperty): Deleted.
1515         (WebCore::SVGElement::lookupOrCreateAnimatedProperties): Deleted.
1516         (WebCore::SVGElement::isKnownAttribute): Deleted.
1517         * svg/SVGEllipseElement.h:
1518         * svg/SVGExternalResourcesRequired.h:
1519         (WebCore::SVGExternalResourcesRequired::attributeRegistry): Deleted.
1520         (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): Deleted.
1521         * svg/SVGFEBlendElement.h:
1522         * svg/SVGFEColorMatrixElement.h:
1523         * svg/SVGFEComponentTransferElement.h:
1524         * svg/SVGFECompositeElement.h:
1525         * svg/SVGFEConvolveMatrixElement.h:
1526         * svg/SVGFEDiffuseLightingElement.h:
1527         * svg/SVGFEDisplacementMapElement.h:
1528         * svg/SVGFEDropShadowElement.h:
1529         * svg/SVGFEGaussianBlurElement.h:
1530         * svg/SVGFEImageElement.h:
1531         * svg/SVGFELightElement.h:
1532         * svg/SVGFEMergeNodeElement.h:
1533         * svg/SVGFEMorphologyElement.h:
1534         * svg/SVGFEOffsetElement.h:
1535         * svg/SVGFESpecularLightingElement.h:
1536         * svg/SVGFETileElement.h:
1537         * svg/SVGFETurbulenceElement.h:
1538         * svg/SVGFilterElement.h:
1539         * svg/SVGFilterPrimitiveStandardAttributes.h:
1540         (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted.
1541         * svg/SVGFitToViewBox.h:
1542         (WebCore::SVGFitToViewBox::attributeRegistry): Deleted.
1543         * svg/SVGFontElement.h:
1544         * svg/SVGForeignObjectElement.h:
1545         * svg/SVGGElement.h:
1546         * svg/SVGGeometryElement.h:
1547         * svg/SVGGlyphRefElement.h:
1548         * svg/SVGGradientElement.cpp:
1549         (WebCore::SVGGradientElement::svgAttributeChanged):
1550         * svg/SVGGradientElement.h:
1551         (WebCore::SVGGradientElement::attributeRegistry): Deleted.
1552         (WebCore::SVGGradientElement::isKnownAttribute): Deleted.
1553         * svg/SVGGraphicsElement.h:
1554         (WebCore::SVGGraphicsElement::attributeRegistry): Deleted.
1555         * svg/SVGImageElement.h:
1556         * svg/SVGLineElement.h:
1557         * svg/SVGLinearGradientElement.h:
1558         * svg/SVGMPathElement.h:
1559         * svg/SVGMarkerElement.cpp:
1560         * svg/SVGMarkerElement.h:
1561         * svg/SVGMaskElement.h:
1562         * svg/SVGPathElement.h:
1563         * svg/SVGPatternElement.h:
1564         * svg/SVGPolyElement.h:
1565         * svg/SVGRadialGradientElement.h:
1566         * svg/SVGRectElement.h:
1567         * svg/SVGSVGElement.h:
1568         * svg/SVGScriptElement.h:
1569         * svg/SVGStopElement.h:
1570         * svg/SVGSwitchElement.h:
1571         * svg/SVGSymbolElement.h:
1572         * svg/SVGTRefElement.h:
1573         * svg/SVGTests.cpp:
1574         (WebCore::SVGTests::svgAttributeChanged):
1575         (WebCore::SVGTests::attributeRegistry): Deleted.
1576         (WebCore::SVGTests::isKnownAttribute): Deleted.
1577         * svg/SVGTests.h:
1578         * svg/SVGTextContentElement.cpp:
1579         * svg/SVGTextContentElement.h:
1580         (WebCore::SVGTextContentElement::attributeRegistry): Deleted.
1581         * svg/SVGTextPathElement.h:
1582         * svg/SVGTextPositioningElement.h:
1583         (WebCore::SVGTextPositioningElement::attributeRegistry): Deleted.
1584         * svg/SVGURIReference.cpp:
1585         (WebCore::SVGURIReference::SVGURIReference):
1586         (WebCore::SVGURIReference::attributeRegistry): Deleted.
1587         * svg/SVGURIReference.h:
1588         * svg/SVGUseElement.h:
1589         * svg/SVGViewElement.h:
1590         * svg/SVGViewSpec.cpp:
1591         (WebCore::SVGViewSpec::SVGViewSpec):
1592         * svg/SVGViewSpec.h:
1593         * svg/SVGZoomAndPanType.h:
1594         * svg/properties/SVGAnimatedListPropertyTearOff.h: Removed.
1595         * svg/properties/SVGAnimatedPropertyAnimator.h:
1596         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
1597         * svg/properties/SVGAnimatedPropertyPairAnimator.h:
1598         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
1599         * svg/properties/SVGAnimatedPropertyTearOff.h: Removed.
1600         * svg/properties/SVGAnimatedPropertyType.h: Removed.
1601
1602         * svg/properties/SVGAnimationAdditiveFunction.h:
1603         (WebCore::SVGAnimationAdditiveFunction::animate):
1604         (WebCore::SVGAnimationAdditiveFunction::progress): Deleted.
1605         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
1606         (WebCore::SVGAnimationLengthListFunction::animate):
1607         (WebCore::SVGAnimationNumberListFunction::animate):
1608         (WebCore::SVGAnimationPointListFunction::animate):
1609         (WebCore::SVGAnimationTransformListFunction::animate):
1610         (WebCore::SVGAnimationLengthListFunction::progress): Deleted.
1611         (WebCore::SVGAnimationNumberListFunction::progress): Deleted.
1612         (WebCore::SVGAnimationPointListFunction::progress): Deleted.
1613         (WebCore::SVGAnimationTransformListFunction::progress): Deleted.
1614         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
1615         (WebCore::SVGAnimationAngleFunction::animate):
1616         (WebCore::SVGAnimationColorFunction::animate):
1617         (WebCore::SVGAnimationIntegerFunction::animate):
1618         (WebCore::SVGAnimationLengthFunction::animate):
1619         (WebCore::SVGAnimationNumberFunction::animate):
1620         (WebCore::SVGAnimationPathSegListFunction::animate):
1621         (WebCore::SVGAnimationRectFunction::animate):
1622         (WebCore::SVGAnimationAngleFunction::progress): Deleted.
1623         (WebCore::SVGAnimationColorFunction::progress): Deleted.
1624         (WebCore::SVGAnimationIntegerFunction::progress): Deleted.
1625         (WebCore::SVGAnimationLengthFunction::progress): Deleted.
1626         (WebCore::SVGAnimationNumberFunction::progress): Deleted.
1627         (WebCore::SVGAnimationPathSegListFunction::progress): Deleted.
1628         (WebCore::SVGAnimationRectFunction::progress): Deleted.
1629         * svg/properties/SVGAnimationDiscreteFunction.h:
1630         (WebCore::SVGAnimationDiscreteFunction::animate):
1631         (WebCore::SVGAnimationDiscreteFunction::progress): Deleted.
1632         * svg/properties/SVGAnimationFunction.h:
1633         (WebCore::SVGAnimationFunction::calculateDistance const):
1634         -- Rename the 'progress()' functions of SVGAttributeAnimator and SVGAnimationFunction
1635            to 'animate()'.
1636         -- Rename the argument 'percentage' of these function to 'progress'
1637         -- Make calculateDistance return Optional<float> so it does not have to
1638            return -1 in case of error.
1639
1640         * svg/properties/SVGAttribute.h: Removed.
1641         * svg/properties/SVGAttributeAccessor.h: Removed.
1642         * svg/properties/SVGAttributeAnimator.h:
1643         (WebCore::SVGAttributeAnimator::calculateDistance const):
1644         * svg/properties/SVGAttributeOwnerProxy.cpp: Removed.
1645         * svg/properties/SVGAttributeOwnerProxy.h: Removed.
1646         * svg/properties/SVGAttributeOwnerProxyImpl.h: Removed.
1647         * svg/properties/SVGAttributeRegistry.h: Removed.
1648         * svg/properties/SVGLegacyAnimatedProperty.cpp: Removed.
1649         * svg/properties/SVGLegacyAnimatedProperty.h: Removed.
1650         * svg/properties/SVGLegacyProperty.h: Removed.
1651         * svg/properties/SVGListProperty.h: Removed.
1652         * svg/properties/SVGListPropertyTearOff.h: Removed.
1653         * svg/properties/SVGPrimitivePropertyAnimator.h:
1654         * svg/properties/SVGProperty.h:
1655         * svg/properties/SVGPropertyAnimator.h:
1656         * svg/properties/SVGPropertyTearOff.h: Removed.
1657         * svg/properties/SVGValuePropertyAnimator.h:
1658         * svg/properties/SVGValuePropertyListAnimator.h:
1659
1660 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
1661
1662         Documents can be destroyed before their CSSFontFaceSet is destroyed
1663         https://bugs.webkit.org/show_bug.cgi?id=195830
1664
1665         Reviewed by Darin Adler.
1666
1667         CSSFontFaceSet has a raw pointer to its owning document. JS can keep the CSSFontFaceSet alive (by using FontFaceSet)
1668         and can destroy the document at any time. When the document is destroyed, the link between the two objects needs to
1669         be severed.
1670
1671         Test: fast/text/font-face-set-destroy-document.html
1672
1673         * css/CSSFontFace.cpp:
1674         (WebCore::CSSFontFace::CSSFontFace):
1675         * css/CSSFontFace.h:
1676         * css/CSSFontFaceSet.cpp:
1677         (WebCore::CSSFontFaceSet::CSSFontFaceSet):
1678         (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
1679         * css/CSSFontFaceSet.h:
1680         * css/CSSFontSelector.cpp:
1681         (WebCore::CSSFontSelector::CSSFontSelector):
1682         (WebCore::CSSFontSelector::addFontFaceRule):
1683         * css/CSSFontSelector.h:
1684         * css/FontFace.cpp:
1685         (WebCore::FontFace::FontFace):
1686
1687 2019-04-03  Sihui Liu  <sihui_liu@apple.com>
1688
1689         Follow up fix for r243807: Use MarkedArgumentBuffer instead of Vector for JSValue
1690         https://bugs.webkit.org/show_bug.cgi?id=196547
1691
1692         Reviewed by Geoffrey Garen.
1693
1694         JSValue in Vector could be garbage collected because GC doesn't know Vector memory on C++ heap.
1695
1696         * bindings/js/JSIDBRequestCustom.cpp:
1697         (WebCore::JSIDBRequest::result const):
1698
1699 2019-04-03  Chris Dumez  <cdumez@apple.com>
1700
1701         HTML fragment serialization should not strip whitespace from URL attribute values
1702         https://bugs.webkit.org/show_bug.cgi?id=196551
1703
1704         Reviewed by Ryosuke Niwa.
1705
1706         HTML fragment serialization should not strip whitespace from URL attribute values as per:
1707         - https://html.spec.whatwg.org/multipage/parsing.html#html-fragment-serialisation-algorithm
1708
1709         WebKit was stripping such whitespace, Gecko and Blink are not. Align WebKit with other
1710         browser engines and the specification.
1711
1712         No new tests, rebaselined existing test.
1713
1714         * editing/MarkupAccumulator.cpp:
1715         (WebCore::MarkupAccumulator::appendQuotedURLAttributeValue):
1716
1717 2019-04-02  Ryosuke Niwa  <rniwa@webkit.org>
1718
1719         Crash in HTMLCanvasElement::createContext2d after the element got adopted to a new document
1720         https://bugs.webkit.org/show_bug.cgi?id=196527
1721
1722         Reviewed by Antti Koivisto.
1723
1724         We need to update CanvasBase::m_scriptExecutionContext when HTMLCanvasElement moves from
1725         one document to another. Fixed the bug by making CanvasBase::scriptExecutionContext make
1726         a virtual function call instead of directly storing a raw pointer. In HTMLCanvasElement,
1727         we use Node::scriptExecutionContext(). Use ContextDestructionObserver in CustomPaintCanvas
1728         and OffscreenCanvas instead of a raw pointer.
1729
1730         Unfortunately, no new tests since there is no reproducible test case.
1731
1732         * html/CanvasBase.cpp:
1733         (WebCore::CanvasBase::CanvasBase):
1734         * html/CanvasBase.h:
1735         (WebCore::CanvasBase::scriptExecutionContext const):
1736         * html/CustomPaintCanvas.cpp:
1737         (WebCore::CustomPaintCanvas::CustomPaintCanvas):
1738         * html/CustomPaintCanvas.h:
1739         * html/HTMLCanvasElement.cpp:
1740         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
1741         * html/HTMLCanvasElement.h:
1742         * html/OffscreenCanvas.cpp:
1743         (WebCore::OffscreenCanvas::OffscreenCanvas):
1744         * html/OffscreenCanvas.h:
1745
1746 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
1747
1748         Remove support for -apple-trailing-word
1749         https://bugs.webkit.org/show_bug.cgi?id=196525
1750
1751         Reviewed by Zalan Bujtas.
1752
1753         This CSS property is nonstandard and not used.
1754
1755         * Configurations/FeatureDefines.xcconfig:
1756         * css/CSSComputedStyleDeclaration.cpp:
1757         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1758         * css/CSSPrimitiveValueMappings.h:
1759         (WebCore::CSSPrimitiveValue::operator TrailingWord const): Deleted.
1760         * css/CSSProperties.json:
1761         * css/CSSValueKeywords.in:
1762         * css/parser/CSSParserFastPaths.cpp:
1763         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1764         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1765         * rendering/SimpleLineLayout.cpp:
1766         (WebCore::SimpleLineLayout::canUseForStyle):
1767         * rendering/SimpleLineLayoutCoverage.cpp:
1768         (WebCore::SimpleLineLayout::printReason):
1769         * rendering/SimpleLineLayoutCoverage.h:
1770         * rendering/line/BreakingContext.h:
1771         (WebCore::BreakingContext::BreakingContext):
1772         (WebCore::BreakingContext::lineBreak):
1773         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
1774         (WebCore::BreakingContext::commitLineBreakClear):
1775         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
1776         (WebCore::BreakingContext::handleBR):
1777         (WebCore::BreakingContext::handleFloat):
1778         (WebCore::BreakingContext::handleText):
1779         (WebCore::BreakingContext::handleEndOfLine):
1780         (WebCore::BreakingContext::InlineIteratorHistory::InlineIteratorHistory): Deleted.
1781         (WebCore::BreakingContext::InlineIteratorHistory::push): Deleted.
1782         (WebCore::BreakingContext::InlineIteratorHistory::update): Deleted.
1783         (WebCore::BreakingContext::InlineIteratorHistory::renderer const): Deleted.
1784         (WebCore::BreakingContext::InlineIteratorHistory::offset const): Deleted.
1785         (WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition const): Deleted.
1786         (WebCore::BreakingContext::InlineIteratorHistory::atTextParagraphSeparator const): Deleted.
1787         (WebCore::BreakingContext::InlineIteratorHistory::previousInSameNode const): Deleted.
1788         (WebCore::BreakingContext::InlineIteratorHistory::get const): Deleted.
1789         (WebCore::BreakingContext::InlineIteratorHistory::current const): Deleted.
1790         (WebCore::BreakingContext::InlineIteratorHistory::historyLength const): Deleted.
1791         (WebCore::BreakingContext::InlineIteratorHistory::moveTo): Deleted.
1792         (WebCore::BreakingContext::InlineIteratorHistory::increment): Deleted.
1793         (WebCore::BreakingContext::InlineIteratorHistory::clear): Deleted.
1794         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Deleted.
1795         * rendering/style/RenderStyle.h:
1796         (WebCore::RenderStyle::trailingWord const): Deleted.
1797         (WebCore::RenderStyle::setTrailingWord): Deleted.
1798         (WebCore::RenderStyle::initialTrailingWord): Deleted.
1799         * rendering/style/RenderStyleConstants.h:
1800         * rendering/style/StyleRareInheritedData.cpp:
1801         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1802         (WebCore::StyleRareInheritedData::operator== const):
1803         * rendering/style/StyleRareInheritedData.h:
1804
1805 2019-04-03  Youenn Fablet  <youenn@apple.com>
1806
1807         Use makePendingActivity in DOMCache
1808         https://bugs.webkit.org/show_bug.cgi?id=196515
1809
1810         Reviewed by Geoffrey Garen.
1811
1812         No change of behavior, just modernizing the code.
1813
1814         * Modules/cache/DOMCache.cpp:
1815         (WebCore::DOMCache::retrieveRecords):
1816         (WebCore::DOMCache::batchDeleteOperation):
1817         (WebCore::DOMCache::batchPutOperation):
1818         * Modules/cache/DOMCacheStorage.cpp:
1819         (WebCore::DOMCacheStorage::match):
1820
1821 2019-04-03  Chris Dumez  <cdumez@apple.com>
1822
1823         [XML Parser] Insert the error message block when stopping parsing and an error occurred
1824         https://bugs.webkit.org/show_bug.cgi?id=196546
1825
1826         Reviewed by Alexey Proskuryakov.
1827
1828         Insert the error message block when stopping parsing and an error occurred. This is based
1829         on the following Blink commit:
1830         - https://chromium.googlesource.com/chromium/src.git/+/565958bc22e2d49fed7af144482c2bf4d416fec5
1831
1832         No new tests, rebaselined existing test.
1833
1834         * xml/parser/XMLDocumentParser.cpp:
1835         (WebCore::XMLDocumentParser::end):
1836         Avoid showing the error message block twice in some cases. No need to ever call
1837         insertErrorMessageBlock() if we're already stopped since stopParsing() already
1838         takes care of doing this.
1839
1840         * xml/parser/XMLDocumentParserLibxml2.cpp:
1841         (WebCore::XMLDocumentParser::stopParsing):
1842         When XMLDocumentParser::stopParsing() is called to stop parsing, call
1843         insertErrorMessageBlock() to insert the <parsererror> element if an error
1844         occurred.
1845
1846 2019-04-03  Youenn Fablet  <youenn@apple.com>
1847
1848         Clear WorkerCacheStorageConnection callbacks on WorkerGlobalScope termination
1849         https://bugs.webkit.org/show_bug.cgi?id=196521
1850
1851         Reviewed by Alex Christensen.
1852
1853         When the worker global scope is preparing for termination,
1854         all ActiveDOMObjects are stopped.
1855         At that time, the completion handlers related to
1856         WorkerCacheStorageConnection should be cleared to be able to free
1857         memory, and as they are now no-op anyway.
1858
1859         We clear the completion handlers once the active DOM objects are stopped
1860         to limit the processing triggered by clearing them.
1861
1862         Introducing a new Stopped error code to handle this case.
1863         Add an assertion so that this error does not surface to JS.
1864
1865         Covered by existing tests.
1866
1867         * Modules/cache/CacheStorageConnection.cpp:
1868         (WebCore::CacheStorageConnection::clearPendingRequests):
1869         * Modules/cache/CacheStorageConnection.h:
1870         * Modules/cache/DOMCacheEngine.cpp:
1871         (WebCore::DOMCacheEngine::errorToException):
1872         * Modules/cache/DOMCacheEngine.h:
1873         * workers/WorkerGlobalScope.cpp:
1874         (WebCore::WorkerGlobalScope::prepareForTermination):
1875         (WebCore::WorkerGlobalScope::stopIndexedDatabase):
1876
1877 2019-04-03  Youenn Fablet  <youenn@apple.com>
1878
1879         Adopt new VCP SPI
1880         https://bugs.webkit.org/show_bug.cgi?id=193357
1881         <rdar://problem/43656651>
1882
1883         Reviewed by Eric Carlson.
1884
1885         Covered by existing tests.
1886
1887         * testing/Internals.cpp:
1888         (WebCore::Internals::supportsVCPEncoder):
1889
1890 2019-04-03  Chris Dumez  <cdumez@apple.com>
1891
1892         Remove legacy webkitRequestAnimationFrame time quirk
1893         https://bugs.webkit.org/show_bug.cgi?id=196458
1894         <rdar://problem/49490207>
1895
1896         Reviewed by Simon Fraser.
1897
1898         Remove legacy webkitRequestAnimationFrame time quirk and log a deprecation
1899         warning whenever webkitRequestAnimationFrame is called.
1900
1901         * dom/ScriptedAnimationController.cpp:
1902         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
1903         * page/DOMWindow.cpp:
1904         (WebCore::DOMWindow::requestAnimationFrame):
1905         (WebCore::DOMWindow::webkitRequestAnimationFrame):
1906
1907 2019-04-03  Sihui Liu  <sihui_liu@apple.com>
1908
1909         Blob type cannot be stored correctly in IDB when IDBObjectStore has autoIncrement and keyPath options
1910         https://bugs.webkit.org/show_bug.cgi?id=196128
1911
1912         Reviewed by Geoffrey Garen.
1913
1914         If a key is auto-generated, it should become a property of the value object. Network process would perform the 
1915         key injection by deserializing IDBValue into script value, setting the property, serializing the result and 
1916         storing it in a database record. But network process does not have a JSDOMGlobalObject, so it would fail to 
1917         deserialize types including Blob and File.
1918
1919         To solve this issue, we move the key injection to web process and let network process store the original value 
1920         it gets. In this case, when web process asks for some value, network process should return key, value and key 
1921         path so that web process can decide whether it should perform a key injection before returning the result. Note
1922         that the auto-generated key would always be stored as the key in a ObjectStore record.
1923
1924         Test: storage/indexeddb/modern/objectstore-autoincrement-types.html
1925
1926         * Modules/indexeddb/IDBCursor.cpp:
1927         (WebCore::IDBCursor::setGetResult):
1928         * Modules/indexeddb/IDBCursor.h:
1929         (WebCore::IDBCursor::primaryKeyPath):
1930         * Modules/indexeddb/IDBGetAllResult.cpp:
1931         (WebCore::IDBGetAllResult::isolatedCopy):
1932         (WebCore::IDBGetAllResult::addKey):
1933         (WebCore::IDBGetAllResult::addValue):
1934         (WebCore::IDBGetAllResult::keys const):
1935         (WebCore::IDBGetAllResult::values const):
1936         (WebCore::IDBGetAllResult::allBlobFilePaths const):
1937         (WebCore::isolatedCopyOfVariant): Deleted.
1938
1939         * Modules/indexeddb/IDBGetAllResult.h: Introduce an IDBKeyPath parameter. Also replace Variant with two Vectors,
1940         because we only needed to store either key or value before, and now the stored value could be incomplete.
1941         (WebCore::IDBGetAllResult::IDBGetAllResult):
1942         (WebCore::IDBGetAllResult::keyPath const):
1943         (WebCore::IDBGetAllResult::encode const):
1944         (WebCore::IDBGetAllResult::decode):
1945
1946         * Modules/indexeddb/IDBGetResult.cpp:
1947         (WebCore::IDBGetResult::setValue):
1948         * Modules/indexeddb/IDBGetResult.h:
1949         (WebCore::IDBGetResult::IDBGetResult):
1950         (WebCore::IDBGetResult::keyPath const):
1951         * Modules/indexeddb/IDBObjectStore.cpp:
1952         * Modules/indexeddb/IDBRequest.cpp:
1953         (WebCore::IDBRequest::setResult):
1954         (WebCore::IDBRequest::setResultToStructuredClone):
1955         * Modules/indexeddb/IDBRequest.h:
1956         * Modules/indexeddb/IDBTransaction.cpp:
1957         (WebCore::IDBTransaction::didGetAllRecordsOnServer):
1958         (WebCore::IDBTransaction::didGetRecordOnServer):
1959         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1960         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
1961         * Modules/indexeddb/server/MemoryIndex.cpp:
1962         (WebCore::IDBServer::MemoryIndex::getResultForKeyRange const):
1963         (WebCore::IDBServer::MemoryIndex::getAllRecords const):
1964         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
1965         (WebCore::IDBServer::MemoryIndexCursor::currentData):
1966         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1967         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
1968         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
1969         (WebCore::IDBServer::MemoryObjectStore::getAllRecords const):
1970         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1971         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
1972         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1973         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
1974         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
1975         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
1976         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
1977         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
1978         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
1979         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
1980         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
1981         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
1982         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
1983         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1984         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
1985         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1986
1987         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1988         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Remove the key injection from network process. 
1989         UniqueIDBDatabase stores any value it gets from IDBClient.
1990
1991         * Modules/indexeddb/shared/IDBResultData.cpp:
1992         (WebCore::IDBResultData::getResultRef):
1993         * Modules/indexeddb/shared/IDBResultData.h:
1994
1995         * bindings/js/IDBBindingUtilities.cpp:
1996         (WebCore::injectIDBKeyIntoScriptValue): If property is read-only, set would fail and injectKeyIntoResult would
1997         return null, but we expect it to return result as long as the property value is the same as target. Therefore, 
1998         we can add an early return here.
1999         (WebCore::createKeyPathArray):
2000
2001         (WebCore::generateIndexKeyForValue): We used to generate IndexKey from value stored in database but now the
2002         value gets stored does not include auto-generated key, as we remove the key injection from network process. In 
2003         this case if the IDBIndex has the same key path as the auto-generated key, IndexKey would be failed to create
2004         for it cannot extract auto-generated key from value. Since the auto-generated key would always be the key in 
2005         database record, we could use value of that key when we find a match in key path.
2006
2007         (WebCore::deserializeIDBValueWithKeyInjection): If the key path in the result is single entry, the key is 
2008         probably auto-generated, so we could inject the result key into the result value unconditionally.
2009
2010         * bindings/js/IDBBindingUtilities.h:
2011         * bindings/js/JSIDBCursorWithValueCustom.cpp:
2012         (WebCore::JSIDBCursorWithValue::value const):
2013         * bindings/js/JSIDBRequestCustom.cpp:
2014         (WebCore::JSIDBRequest::result const):
2015
2016 2019-04-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2017
2018         Get rid of HTMLInputElement::setEditingValue
2019         https://bugs.webkit.org/show_bug.cgi?id=196402
2020
2021         Reviewed by Darin Adler.
2022
2023         HTMLInputElement::setEditingValue is only used for Epiphany password autofill. We did it
2024         this way because that's what Chrome uses for autofill, but Apple uses
2025         HTMLInputElement::setValueForUser. Let's switch to that instead, then we can get rid of
2026         setEditingValue.
2027
2028         This fixes logging into ting.com after username and password are autofilled by Epiphany.
2029         Before this change, the login would fail unless you first manually edit either the username
2030         or the password field.
2031
2032         * html/HTMLInputElement.cpp:
2033         (WebCore::HTMLInputElement::setEditingValue): Deleted.
2034         * html/HTMLInputElement.h:
2035         * testing/Internals.cpp:
2036         (WebCore::Internals::setEditingValue): Deleted.
2037         * testing/Internals.h:
2038         * testing/Internals.idl:
2039
2040 2019-04-03  Pablo Saavedra  <psaavedra@igalia.com>
2041
2042         Missing includes that were previously provided via UnifiedSources
2043         https://bugs.webkit.org/show_bug.cgi?id=196434
2044
2045         Unreviewed build fix.
2046
2047         * html/InputType.h:
2048
2049 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2050
2051         Introduce and add plumbing for a website policy for meta viewport tag handling
2052         https://bugs.webkit.org/show_bug.cgi?id=196285
2053
2054         Reviewed by Tim Horton.
2055
2056         Add MetaViewportPolicy to DocumentLoader. See WebKit ChangeLog for more detail.
2057
2058         * loader/DocumentLoader.h:
2059         (WebCore::DocumentLoader::metaViewportPolicy const):
2060         (WebCore::DocumentLoader::setMetaViewportPolicy):
2061
2062 2019-04-03  Joseph Pecoraro  <pecoraro@apple.com>
2063
2064         Web Inspector: Remote Inspector indicate callback should always happen on the main thread
2065         https://bugs.webkit.org/show_bug.cgi?id=196513
2066         <rdar://problem/49498284>
2067
2068         Reviewed by Devin Rousso.
2069
2070         * platform/ios/wak/WebCoreThreadSystemInterface.cpp:
2071         (InitWebCoreThreadSystemInterface):
2072
2073 2019-04-02  Simon Fraser  <simon.fraser@apple.com>
2074
2075         REGRESSION (r238266): Exchange 2013 Outlook Web Access displays partially blank page when creating new e-mail
2076         https://bugs.webkit.org/show_bug.cgi?id=196522
2077         rdar://problem/49472941
2078
2079         Reviewed by Zalan Bujtas.
2080
2081         In this content a layer is composited to clip descendants, and has negative z-order children,
2082         so we compute that it "paints into ancestor", and has a foreground layer. This combination doesn't
2083         make sense, and when the layer becomes scrollable, we end up with bad paint phases on layers, and
2084         fail to paint the contents.
2085
2086         Fix by ensuring that a layer has its own backing store if it requires a foreground layer
2087         by virtue of having negative z-order children.
2088
2089         Test: compositing/backing/foreground-layer-no-paints-into-ancestor.html
2090
2091         * rendering/RenderLayerCompositor.cpp:
2092         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2093
2094 2019-04-02  Timothy Hatcher  <timothy@apple.com>
2095
2096         Cursor count badge reverts to Zero during Drag & Drop of multiple items.
2097         https://bugs.webkit.org/show_bug.cgi?id=196511
2098
2099         Reviewed by Daniel Bates.
2100
2101         * page/DragController.cpp:
2102         (WebCore::DragController::tryDocumentDrag): Don't set m_numberOfItemsToBeAccepted to
2103         zero when dragging to a non-file input element.
2104
2105 2019-04-02  Chris Dumez  <cdumez@apple.com>
2106
2107         HTML Parser: Remove conditional parsing of <noembed> content
2108         https://bugs.webkit.org/show_bug.cgi?id=196514
2109
2110         Reviewed by Geoffrey Garen.
2111
2112         Our HTML Parser has raw text handling for <noembed> content only if plugins are runnable.
2113         However, the HTML specification doesn't ask such behavior [1], and it doesn't match to
2114         our HTML serializer. We should always handle it as raw text.
2115
2116         Blink already made this change in https://chromium-review.googlesource.com/c/1477556.
2117
2118         [1] https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments:noembed
2119
2120         No new tests, updated existing test.
2121
2122         * html/parser/HTMLParserOptions.cpp:
2123         (WebCore::HTMLParserOptions::HTMLParserOptions):
2124         * html/parser/HTMLParserOptions.h:
2125         * html/parser/HTMLTokenizer.cpp:
2126         (WebCore::HTMLTokenizer::updateStateFor):
2127         * html/parser/HTMLTreeBuilder.cpp:
2128         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
2129
2130 2019-04-02  Chris Dumez  <cdumez@apple.com>
2131
2132         XMLHttpRequestUpload's loadstart event not correct initialized
2133         https://bugs.webkit.org/show_bug.cgi?id=196174
2134         <rdar://problem/49191412>
2135
2136         Reviewed by Alex Christensen.
2137
2138         Align progress event firing with the XHR specification.
2139
2140         No new tests, rebaselined existing tests.
2141
2142         * xml/XMLHttpRequest.cpp:
2143         (WebCore::XMLHttpRequest::createRequest):
2144         As per [1], the loadstart event fired on the XMLHttpRequestUpload object should use
2145         loaded=0 and total=`req’s body’s total bytes`.
2146         [1] https://xhr.spec.whatwg.org/#the-send()-method (step 11.2.)
2147
2148         (WebCore::XMLHttpRequest::didSendData):
2149         As per [2], the progress / load / loadend should use loaded=transmitted and total=length.
2150         [2] https://xhr.spec.whatwg.org/#ref-for-process-request-end-of-body (steps 5, 6 and 7)
2151
2152         (WebCore::XMLHttpRequest::didReceiveData):
2153         As per [3], we should fire the readystatechange event *before* the progress event.
2154         This is covered by web-platform-tests/xhr/send-response-event-order.htm which was failing
2155         differently after the other changes in this patch.
2156         [3] https://xhr.spec.whatwg.org/#ref-for-process-response (steps 9.4 and 9.5)
2157
2158         (WebCore::XMLHttpRequest::dispatchErrorEvents):
2159         As per [4], in case of an error, we should fire the provided 'event' and 'loadend' with
2160         loaded=0 and total=0.
2161         [4] https://xhr.spec.whatwg.org/#request-error-steps (steps 7 and 8)
2162
2163         * xml/XMLHttpRequestUpload.cpp:
2164         (WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
2165         * xml/XMLHttpRequestUpload.h:
2166         Simplify XMLHttpRequestUpload. It no longer needs to store loaded / total as data
2167         members now that they are always passed by the call site. lengthComputable is set
2168         to !!total as [5] says to set it to true if length/total is not 0. 
2169         [5] https://xhr.spec.whatwg.org/#concept-event-fire-progress
2170
2171 2019-04-02  Devin Rousso  <drousso@apple.com>
2172
2173         Web Inspector: Canvas: add support for showing WebGPU contexts
2174         https://bugs.webkit.org/show_bug.cgi?id=196413
2175         <rdar://problem/49438898>
2176
2177         Reviewed by Timothy Hatcher.
2178
2179         Tests: inspector/canvas/create-context-webgpu.html
2180                inspector/canvas/resolveCanvasContext-webgpu.html
2181
2182         * Modules/webgpu/GPUCanvasContext.idl:
2183         * Modules/webgpu/GPUCanvasContext.h:
2184         (WebCore::GPUCanvasContext::canvas const): Added.
2185         * Modules/webgpu/GPUCanvasContext.cpp:
2186         (WebCore::GPUCanvasContext::create):
2187
2188         * testing/InternalSettings.idl:
2189         * testing/InternalSettings.h:
2190         * testing/InternalSettings.cpp:
2191         (WebCore::InternalSettings::setWebGPUEnabled): Added.
2192
2193 2019-04-02  Chris Dumez  <cdumez@apple.com>
2194
2195         [WK2] Add support for Window's beforeprint / afterprint events
2196         https://bugs.webkit.org/show_bug.cgi?id=196478
2197
2198         Reviewed by Alex Christensen.
2199
2200         Add support for Window's beforeprint / afterprint events as per:
2201         - https://html.spec.whatwg.org/#dom-print
2202
2203         Blink and Gecko already support this.
2204
2205         Test: printing/printing-events.html
2206
2207         * dom/EventNames.h:
2208         * html/HTMLAttributeNames.in:
2209         * html/HTMLBodyElement.cpp:
2210         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
2211         * page/Page.cpp:
2212         (WebCore::dispatchPrintEvent):
2213         (WebCore::Page::dispatchBeforePrintEvent):
2214         (WebCore::Page::dispatchAfterPrintEvent):
2215         * page/Page.h:
2216         * page/WindowEventHandlers.idl:
2217
2218 2019-04-02  Zalan Bujtas  <zalan@apple.com>
2219
2220         [ContentChangeObserver] Hover menus do not function on fidelity.com
2221         https://bugs.webkit.org/show_bug.cgi?id=196507
2222         <rdar://problem/49496520>
2223
2224         Reviewed by Simon Fraser.
2225
2226         fidelity.com has 400ms hover intent timer to bring up the main menus.
2227
2228         Test: fast/events/touch/ios/content-observation/400ms-hover-intent.html
2229
2230         * page/ios/ContentChangeObserver.cpp:
2231
2232 2019-04-02  Timothy Hatcher  <timothy@apple.com>
2233
2234         NSAttributedString crashes when encoding text attachment cell for missing image.
2235         https://bugs.webkit.org/show_bug.cgi?id=196504
2236         rdar://problem/49161281
2237
2238         Reviewed by Tim Horton.
2239
2240         Clean up and fix a couple of errors and crashes in the missing image path of our
2241         attributed string converter.
2242
2243         Fixes include:
2244         * Removed manual call to release on a RetainPtr, leading to autorelease pool crash.
2245         * No longer try to load an image that is missing on disk and has long been renamed.
2246         * No longer use a NSTextAttachmentCell in the Mac code path which can't be encoded
2247           for sending to the UIProcess, so it was pretty useless in the web content process.
2248         * Stopped using NSFileWrapper for the missing image so the attachment can contain the
2249           retina versions of the missing image.
2250         * Simplified bundle finding code, since WebCore is assumed to be loaded.
2251         * Fix leak of attachment by adding missing adoptNS().
2252
2253         * editing/cocoa/HTMLConverter.mm:
2254         (HTMLConverter::_addAttachmentForElement): Unify and simplify missing image path.
2255         (_NSFirstPathForDirectoriesInDomains): Deleted.
2256         (_NSSystemLibraryPath): Deleted.
2257         (_webKitBundle): Deleted.
2258
2259 2019-04-02  Chris Dumez  <cdumez@apple.com>
2260
2261         [Fetch API] Allow used body replacement in Request constructor
2262         https://bugs.webkit.org/show_bug.cgi?id=183703
2263         <rdar://problem/49425609>
2264
2265         Reviewed by Youenn Fablet.
2266
2267         Allow used body replacement in Request constructor as per:
2268         - https://github.com/whatwg/fetch/pull/675
2269
2270         No new tests, rebaseline existing test.
2271
2272         * Modules/fetch/FetchRequest.cpp:
2273         (WebCore::FetchRequest::initializeWith):
2274
2275 2019-04-02  Chris Dumez  <cdumez@apple.com>
2276
2277         Unreviewed, rolling out r243551.
2278
2279         Seems to have broken file uploads to SoundCloud
2280
2281         Reverted changeset:
2282
2283         "XMLHttpRequestUpload's loadstart event not correct
2284         initialized"
2285         https://bugs.webkit.org/show_bug.cgi?id=196174
2286         https://trac.webkit.org/changeset/243551
2287
2288 2019-04-02  Justin Fan  <justin_fan@apple.com>
2289
2290         [Web GPU] Implement blend states and color write mask for GPUColorStateDescriptor
2291         https://bugs.webkit.org/show_bug.cgi?id=196474
2292
2293         Reviewed by Myles C. Maxfield.
2294
2295         Blend states and color write masks must now be specified on GPUColorStateDescriptor instead of 
2296         relying on underlying MTLRenderPipelineColorAttachmentDescriptor defaults.
2297
2298         Test: webgpu/blend-triangle-strip.html, webgpu/color-write-mask-triangle-strip.html
2299
2300         * CMakeLists.txt:
2301         * DerivedSources-input.xcfilelist:
2302         * DerivedSources-output.xcfilelist:
2303         * DerivedSources.make:
2304         * Modules/webgpu/GPUBlendDescriptor.idl: 
2305         * Modules/webgpu/GPUColorStateDescriptor.idl:
2306         * Modules/webgpu/GPUColorWriteBits.idl: 
2307         * Sources.txt:
2308         * WebCore.xcodeproj/project.pbxproj:
2309         * bindings/js/WebCoreBuiltinNames.h:
2310         * platform/graphics/gpu/GPUBlendDescriptor.h:
2311         * platform/graphics/gpu/GPUColorStateDescriptor.h:
2312         * platform/graphics/gpu/GPUColorWriteBits.h:
2313         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2314         (WebCore::mtlColorWriteMaskForGPUColorWriteFlags):
2315         (WebCore::mtlBlendOperationForGPUBlendOperation):
2316         (WebCore::mtlBlendFactorForGPUBlendFactor):
2317         (WebCore::setColorStatesForColorAttachmentArray):
2318         (WebCore::tryCreateMtlRenderPipelineState):
2319         (WebCore::trySetColorStatesForColorAttachmentArray): Deleted.
2320
2321 2019-04-02  Zalan Bujtas  <zalan@apple.com>
2322
2323         [ContentChangeObserver] Ignore reconstructed renderers when checking for visibility change
2324         https://bugs.webkit.org/show_bug.cgi?id=196483
2325         <rdar://problem/49288174>
2326
2327         Reviewed by Simon Fraser.
2328
2329         This patch fixes the cases when the content gets reconstructed in a way that existing and visible elements gain
2330         new renderers within one style recalc. We failed to recognize such cases and ended up detecting the newly constructed renderers
2331         as "visible change" thereby triggering hover.
2332
2333         Test: fast/events/touch/ios/content-observation/visible-content-gains-new-renderer.html
2334
2335         * page/ios/ContentChangeObserver.cpp:
2336         (WebCore::ContentChangeObserver::renderTreeUpdateDidStart):
2337         (WebCore::ContentChangeObserver::renderTreeUpdateDidFinish):
2338         (WebCore::ContentChangeObserver::reset):
2339         (WebCore::ContentChangeObserver::willDestroyRenderer):
2340         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
2341         (WebCore::ContentChangeObserver::RenderTreeUpdateScope::RenderTreeUpdateScope):
2342         (WebCore::ContentChangeObserver::RenderTreeUpdateScope::~RenderTreeUpdateScope):
2343         * page/ios/ContentChangeObserver.h:
2344         (WebCore::ContentChangeObserver::visibleRendererWasDestroyed const):
2345         * rendering/updating/RenderTreeUpdater.cpp:
2346         (WebCore::RenderTreeUpdater::updateRenderTree):
2347         (WebCore::RenderTreeUpdater::tearDownRenderers):
2348
2349 2019-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
2350
2351         [CMake] WEBKIT_MAKE_FORWARDING_HEADERS shouldn't use POST_BUILD to copy generated headers
2352         https://bugs.webkit.org/show_bug.cgi?id=182757
2353
2354         Reviewed by Don Olmstead.
2355
2356         No new tests because no behavior changes.
2357
2358         * PlatformWin.cmake: Do not use DERIVED_SOURCE_DIRECTORIES of
2359         WEBKIT_MAKE_FORWARDING_HEADERS. Added
2360         WebCore_PRIVATE_FRAMEWORK_HEADERS.
2361         * WebCoreMacros.cmake (GENERATE_DOM_NAMES): Added
2362         ${_namespace}ElementTypeHelpers.h to _outputfiles.
2363
2364 2019-04-02  Cathie Chen  <cathiechen@igalia.com>
2365
2366         Update the status of ResizeObserver in features.json.
2367         https://bugs.webkit.org/show_bug.cgi?id=196443
2368
2369         Reviewed by Rob Buis.
2370
2371         * features.json:
2372
2373 2019-04-01  Ryosuke Niwa  <rniwa@webkit.org>
2374
2375         Nullptr crash in Document::open after calling policyChecker().stopCheck()
2376         https://bugs.webkit.org/show_bug.cgi?id=196479
2377
2378         Reviewed by Antti Koivisto.
2379
2380         Added a missing nullptr check in Document::open after calling m_frame->loader().policyChecker().stopCheck()
2381         since it invokes m_willSubmitFormCompletionHandlers in WebKit2, and that could clear m_frame.
2382
2383         Unfortunately, we don't have any reproducible test case.
2384
2385         * dom/Document.cpp:
2386         (WebCore::Document::open):
2387
2388 2019-04-01  Timothy Hatcher  <timothy@apple.com>
2389
2390         Unreviewed build fix.
2391
2392         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
2393         (WebCore::createAndStoreMasterKey): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END
2394         around SecTrustedApplicationCreateFromPath call.
2395
2396 2019-04-01  Simon Fraser  <simon.fraser@apple.com>
2397
2398         Remove some unused iOS scrolling-related code in Frame
2399         https://bugs.webkit.org/show_bug.cgi?id=196473
2400
2401         Reviewed by Zalan Bujtas.
2402
2403         This code has no callers.
2404
2405         * page/Frame.cpp:
2406         (WebCore::Frame::Frame):
2407         (WebCore::Frame::scrollOverflowLayer): Deleted.
2408         (WebCore::Frame::overflowAutoScrollTimerFired): Deleted.
2409         (WebCore::Frame::startOverflowAutoScroll): Deleted.
2410         (WebCore::Frame::checkOverflowScroll): Deleted.
2411         * page/Frame.h:
2412
2413 2019-04-01  Chris Dumez  <cdumez@apple.com>
2414
2415         Attr nodes are not cloned properly
2416         https://bugs.webkit.org/show_bug.cgi?id=196466
2417
2418         Reviewed by Ryosuke Niwa.
2419
2420         Attr nodes are not cloned properly according to:
2421         - https://dom.spec.whatwg.org/#concept-node-clone
2422
2423         A cloned Attr node should retain its prefix and namespace.
2424
2425         Both Gecko and Blink agree with the DOM specification here.
2426
2427         No new tests, rebaselined existing test.
2428
2429         * dom/Document.cpp:
2430         (WebCore::Document::importNode):
2431
2432 2019-04-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
2433
2434         Remove the SVG tear off objects for SVGMatrix, SVGTransfrom, SVGTransformList and SVGAnimatedTransformList
2435         https://bugs.webkit.org/show_bug.cgi?id=196086
2436
2437         Reviewed by Simon Fraser.
2438
2439         The IDL changes:
2440
2441         SVGTransform.idl:
2442             Remove the NewObject qualifier from matrix attribute. This matches 
2443             the specs: https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGTransform.
2444             SVGTransform will internally hold an SVGMatrix. A change in this
2445             SVGMatrix will affect the container SVGTransform.
2446
2447         SVGTransformList.idl:
2448             Remove the NewObject qualifier from consolidate() method. This matches
2449             the specs:
2450             https://www.w3.org/TR/SVG11/coords.html#__svg__SVGTransformList__consolidate
2451             The method consolidate() should return a reference to the first item
2452             in the list after consolidating it.
2453
2454         Code changes:
2455
2456         -- SVGMatrix is now a superclass of SVGValueProperty<AffineTransform>.
2457            No need for SVGMatrixValue since it was wrapper of AffineTransform.
2458
2459         -- SVGTransformValue now holds a Ref<SVGMatrix> member in addition to the
2460            angle and the rotationCenter. Ref<SVGMatrix> is what SVGTransform.matrix
2461            will return. So a change in this matrix will change the owner SVGTransform.
2462
2463         -- SVGTransform is now the owner of SVGMatrix via its SVGTransformValue.
2464
2465         -- SVGTransformList is now a superclass of SVGValuePropertyList<SVGTransform>.
2466            It is responsible for parsing a String to items of SVGTransform.
2467
2468         -- SVGAnimatedTransformList is now defined as SVGAnimatedPropertyList<
2469            SVGTransformList>.
2470
2471         Note the ownership chain of these objects is the following:
2472
2473         -- SVGAnimatedTransformList owns the SVGTransformList via its baseVal 
2474            and animVal members.
2475
2476         -- SVGTransformList owns SVGTransform via its list of items
2477
2478         -- SVGTransform owns SVGMatrix via its SVGTransformValue.
2479
2480            So a change in SVGMatrix will propagate to the owner SVGElement through
2481            the following ownership chain:
2482
2483            SVGMatrix
2484              |_ SVGTransfrom
2485                   |_ SVGTransformList
2486                        |_ SVGAmimatedTransformList
2487                             |_ SVGElement
2488
2489         To get the mechanics of this change right, a new accessor, a new animator
2490         and animation functions are added for the SVGAnimatedTransformList.
2491
2492         -- SVGViewSpec used to hold an SVGAnimatedTransformListAttribute for the
2493         member m_transform although this member should not be animated. See the
2494         comment in the old SVGViewSpec::transform(). This has been changed in this
2495         patch. SVGViewSpec now holds Ref<SVGTransformList> which matches the specs:
2496         https://www.w3.org/TR/SVG11/types.html#InterfaceSVGViewSpec.
2497
2498         * Sources.txt:
2499         * WebCore.xcodeproj/project.pbxproj:
2500         * svg/SVGAnimateElementBase.cpp:
2501         (WebCore::SVGAnimateElementBase::attributeAnimationController):
2502         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
2503         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
2504         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
2505         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
2506         * svg/SVGAnimateElementBase.h:
2507         (WebCore::SVGAnimateElementBase::animateRangeString const):
2508         * svg/SVGAnimateTransformElement.cpp:
2509         (WebCore::SVGAnimateTransformElement::animateRangeString const):
2510         * svg/SVGAnimateTransformElement.h:
2511                 This change is needed because animating the transform attribute can be
2512         written as
2513             <animate ... from="translate(100)" to="translate(200)"/>
2514         or
2515             <animateTransform type="translate" from="100" to="200"/>"
2516         So we need to surround the animation range string with the type qualifier
2517         for animateTransform.
2518
2519         * svg/SVGAnimatedTransformList.cpp: Removed.
2520         * svg/SVGAnimatedTransformList.h: Removed.
2521         * svg/SVGAnimatedType.h: Removed.
2522         * svg/SVGAnimatedTypeAnimator.cpp: Removed.
2523         * svg/SVGAnimatedTypeAnimator.h: Removed.
2524         * svg/SVGAnimationElement.cpp:
2525         (WebCore::SVGAnimationElement::adjustForInheritance): Deleted.
2526         * svg/SVGAnimationElement.h:
2527         (WebCore::SVGAnimationElement::adjustForInheritance): Deleted.
2528         (WebCore::SVGAnimationElement::adjustFromToListValues): Deleted.
2529         (WebCore::SVGAnimationElement::animateDiscreteType): Deleted.
2530         These functions were used by SVGLegacyAttributeAnimationController.
2531
2532         * svg/SVGAnimatorFactory.h: Removed.
2533         * svg/SVGExternalResourcesRequired.h:
2534         (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
2535         * svg/SVGFEImageElement.h:
2536         * svg/SVGFEMorphologyElement.h:
2537         * svg/SVGFETileElement.h:
2538         * svg/SVGFitToViewBox.h:
2539         (WebCore::SVGFitToViewBox::isKnownAttribute):
2540         * svg/SVGGradientElement.cpp:
2541         (WebCore::SVGGradientElement::SVGGradientElement):
2542         (WebCore::SVGGradientElement::parseAttribute):
2543         (WebCore::SVGGradientElement::registerAttributes): Deleted.
2544         * svg/SVGGradientElement.h:
2545         (WebCore::SVGGradientElement::gradientTransform const):
2546         (WebCore::SVGGradientElement::gradientTransformAnimated):
2547         (WebCore::SVGGradientElement::isKnownAttribute):
2548         * svg/SVGGraphicsElement.cpp:
2549         (WebCore::SVGGraphicsElement::SVGGraphicsElement):
2550         (WebCore::SVGGraphicsElement::animatedLocalTransform const):
2551         (WebCore::SVGGraphicsElement::parseAttribute):
2552         (WebCore::SVGGraphicsElement::svgAttributeChanged):
2553         There is one attribute for this element which is "SVGNames::transformAttr"
2554         So there is no need to check for it twice.
2555
2556         (WebCore::SVGGraphicsElement::registerAttributes): Deleted.
2557         * svg/SVGGraphicsElement.h:
2558         (WebCore::SVGGraphicsElement::transform const):
2559         (WebCore::SVGGraphicsElement::transformAnimated):
2560         (WebCore::SVGGraphicsElement::isKnownAttribute): Deleted.
2561         * svg/SVGLangSpace.cpp:
2562         (WebCore::SVGLangSpace::SVGLangSpace):
2563         (WebCore::SVGLangSpace::xmlspace const):
2564         (WebCore::SVGLangSpace::isKnownAttribute):
2565         (WebCore::SVGLangSpace::svgAttributeChanged):
2566         (WebCore::SVGLangSpace::registerAttributes): Deleted.
2567         * svg/SVGLangSpace.h:
2568         (WebCore::SVGLangSpace::xmllang const):
2569         (WebCore::SVGLangSpace::setXmllang):
2570         (WebCore::SVGLangSpace::setXmlspace):
2571         (WebCore::SVGLangSpace::attributeRegistry): Deleted.
2572         (WebCore::SVGLangSpace::isKnownAttribute): Deleted.
2573         * svg/SVGLegacyAttributeAnimationController.cpp: Removed.
2574         * svg/SVGLegacyAttributeAnimationController.h: Removed.
2575         * svg/SVGLinearGradientElement.cpp:
2576         (WebCore::setGradientAttributes):
2577         * svg/SVGMaskElement.h:
2578         * svg/SVGMatrix.h:
2579         (WebCore::SVGMatrix::create):
2580         (WebCore::SVGMatrix::a const):
2581         (WebCore::SVGMatrix::setA):
2582         (WebCore::SVGMatrix::b const):
2583         (WebCore::SVGMatrix::setB):
2584         (WebCore::SVGMatrix::c const):
2585         (WebCore::SVGMatrix::setC):
2586         (WebCore::SVGMatrix::d const):
2587         (WebCore::SVGMatrix::setD):
2588         (WebCore::SVGMatrix::e const):
2589         (WebCore::SVGMatrix::setE):
2590         (WebCore::SVGMatrix::f const):
2591         (WebCore::SVGMatrix::setF):
2592         (WebCore::SVGMatrix::multiply const):
2593         (WebCore::SVGMatrix::inverse const):
2594         (WebCore::SVGMatrix::translate const):
2595         (WebCore::SVGMatrix::scale const):
2596         (WebCore::SVGMatrix::scaleNonUniform const):
2597         (WebCore::SVGMatrix::rotate const):
2598         (WebCore::SVGMatrix::rotateFromVector const):
2599         (WebCore::SVGMatrix::flipX const):
2600         (WebCore::SVGMatrix::flipY const):
2601         (WebCore::SVGMatrix::skewX const):
2602         (WebCore::SVGMatrix::skewY const):
2603         * svg/SVGPatternElement.cpp:
2604         (WebCore::SVGPatternElement::SVGPatternElement):
2605         (WebCore::SVGPatternElement::parseAttribute):
2606         (WebCore::SVGPatternElement::svgAttributeChanged):
2607         (WebCore::SVGPatternElement::collectPatternAttributes const):
2608         (WebCore::SVGPatternElement::localCoordinateSpaceTransform const):
2609         (WebCore::SVGPatternElement::registerAttributes): Deleted.
2610         * svg/SVGPatternElement.h:
2611         * svg/SVGPoint.h:
2612         (WebCore::SVGPoint::matrixTransform const):
2613         * svg/SVGPolyElement.h:
2614         (WebCore::SVGPolyElement::isKnownAttribute): Deleted.
2615         * svg/SVGRadialGradientElement.cpp:
2616         (WebCore::setGradientAttributes):
2617         * svg/SVGSVGElement.cpp:
2618         (WebCore::SVGSVGElement::createSVGTransform):
2619         (WebCore::SVGSVGElement::createSVGTransformFromMatrix):
2620         (WebCore::SVGSVGElement::viewBoxToViewTransform const):
2621         * svg/SVGTextElement.cpp:
2622         (WebCore::SVGTextElement::animatedLocalTransform const):
2623         * svg/SVGTransform.cpp: Removed.
2624         * svg/SVGTransform.h:
2625         (WebCore::SVGTransform::create):
2626         (WebCore::SVGTransform::~SVGTransform):
2627         (WebCore::SVGTransform::clone const):
2628         (WebCore::SVGTransform::type):
2629         (WebCore::SVGTransform::angle):
2630         (WebCore::SVGTransform::matrix):
2631         (WebCore::SVGTransform::setMatrix):
2632         (WebCore::SVGTransform::setTranslate):
2633         (WebCore::SVGTransform::setScale):
2634         (WebCore::SVGTransform::setRotate):
2635         (WebCore::SVGTransform::setSkewX):
2636         (WebCore::SVGTransform::setSkewY):
2637         (WebCore::SVGTransform::SVGTransform):
2638         * svg/SVGTransform.idl:
2639         * svg/SVGTransformList.h:
2640         * svg/SVGTransformList.idl:
2641         * svg/SVGTransformListValues.cpp: Removed.
2642         * svg/SVGTransformListValues.h: Removed.
2643         * svg/SVGTransformValue.cpp: Removed.
2644         * svg/SVGTransformValue.h:
2645         (WebCore::SVGTransformValue::SVGTransformValue):
2646         (WebCore::SVGTransformValue::operator=):
2647         (WebCore::SVGTransformValue::matrix const):
2648         (WebCore::SVGTransformValue::rotationCenter const):
2649         (WebCore::SVGTransformValue::isValid const):
2650         (WebCore::SVGTransformValue::setMatrix):
2651         (WebCore::SVGTransformValue::matrixDidChange):
2652         (WebCore::SVGTransformValue::translate const):
2653         (WebCore::SVGTransformValue::setTranslate):
2654         (WebCore::SVGTransformValue::scale const):
2655         (WebCore::SVGTransformValue::setScale):
2656         (WebCore::SVGTransformValue::setRotate):
2657         (WebCore::SVGTransformValue::setSkewX):
2658         (WebCore::SVGTransformValue::setSkewY):
2659         (WebCore::SVGTransformValue::valueAsString const):
2660         (WebCore::SVGTransformValue::prefixForTransfromType):
2661         (WebCore::SVGTransformValue::appendNumbers const):
2662         (WebCore::SVGTransformValue::appendMatrix const):
2663         (WebCore::SVGTransformValue::appendTranslate const):
2664         (WebCore::SVGTransformValue::appendScale const):
2665         (WebCore::SVGTransformValue::appendRotate const):
2666         (WebCore::SVGTransformValue::appendSkewX const):
2667         (WebCore::SVGTransformValue::appendSkewY const):
2668         (WebCore::SVGTransformValue::matrix): Deleted.
2669         * svg/SVGTransformable.cpp:
2670         (WebCore::SVGTransformable::parseAndSkipType):
2671         (WebCore::parseAndSkipType): Deleted.
2672         (WebCore::SVGTransformable::parseTransformAttribute): Deleted.
2673         The code of this function was moved to SVGTransformList::parse().
2674
2675         * svg/SVGTransformable.h:
2676         There is no need for enum TransformParsingMode. It was used by 
2677         SVGViewSpec::parseViewSpec() to tell SVGTransformable::parseTransformAttribute()
2678         not to clear the list. SVGTransfromList now has two parse() functions:
2679         one public and the second is private. The public one clear the list
2680         before parsing the input String. The private one just does the parsing.
2681         SVGViewSpec::parseViewSpec() calls the private once since it is a friend
2682         of SVGTransfromList.
2683
2684         * svg/SVGValue.h: Removed.
2685         * svg/SVGViewSpec.cpp:
2686         (WebCore::SVGViewSpec::SVGViewSpec):
2687         (WebCore::SVGViewSpec::reset):
2688         (WebCore::SVGViewSpec::parseViewSpec):
2689         (WebCore::SVGViewSpec::registerAttributes): Deleted.
2690         (WebCore::SVGViewSpec::transform): Deleted.
2691         * svg/SVGViewSpec.h:
2692         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2693         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2694         * svg/properties/SVGAnimatedPropertyImpl.h:
2695         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: Removed.
2696         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
2697         (WebCore::SVGAnimationTransformListFunction::progress):
2698         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
2699         * svg/properties/SVGAttributeRegistry.h:
2700         * svg/properties/SVGMatrixTearOff.h: Removed.
2701         * svg/properties/SVGPropertyAccessorImpl.h:
2702         * svg/properties/SVGPropertyOwnerRegistry.h:
2703         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
2704
2705 2019-04-01  Devin Rousso  <drousso@apple.com>
2706
2707         Web Inspector: DOMDebugger: breakpoints for attribute modifications still fire when breakpoints are disabled
2708         https://bugs.webkit.org/show_bug.cgi?id=196456
2709         <rdar://problem/49489747>
2710
2711         Reviewed by Joseph Pecoraro.
2712
2713         Test: inspector/dom-debugger/dom-breakpoints.html
2714
2715         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2716         (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
2717         (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
2718
2719 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2720
2721         Unable to copy and paste a PDF from Notes into Mail compose body
2722         https://bugs.webkit.org/show_bug.cgi?id=196442
2723         <rdar://problem/48573098>
2724
2725         Reviewed by Tim Horton.
2726
2727         Refactor some logic for inserting attachment elements upon paste or drop. Currently, we only prefer inserting
2728         content as attachment elements if the items are annotated with UIPreferredPresentationStyleAttachment. However,
2729         many data sources around the system (both first and third party) have not adopted this API, which makes it
2730         difficult to determine whether a given item provider should be treated as a file or not. In this bug in
2731         particular, no preferred presentation style is set, so we fail to handle the paste command by inserting an
2732         attachment element.
2733
2734         However, most apps around the system that write file or attachment-like data to the pasteboard will at least
2735         offer a suggested name for the file, in the form of -[NSItemProvider suggestedName]. To address this, instead of
2736         relying solely on the preferredPresentationStyle, additionally take a suggested name as an indicator that the
2737         item is probably a file.
2738
2739         In fact, Pasteboard::fileContentState already has similar logic to check for either a suggested file name or
2740         explicitly specified presentation style. We pull this out into a separate helper method on PasteboardItemInfo,
2741         and use it for both Pasteboard::fileContentState and prefersAttachmentRepresentation.
2742
2743         Tests:  WKAttachmentTestsIOS.InsertPastedContactAsAttachment
2744                 WKAttachmentTestsIOS.InsertPastedMapItemAsAttachment
2745
2746         * editing/cocoa/WebContentReaderCocoa.mm:
2747         (WebCore::mimeTypeFromContentType):
2748
2749         Work around <rdar://problem/49478229> by using the "text/vcard" MIME type to handle "public.vcard". CoreServices
2750         currently maps "public.vcard" to "text/directory" when using UTTypeCopyPreferredTagWithClass, despite the SPI
2751         -[NSURLFileTypeMappings MIMETypeForExtension:] returning "text/vcard" for a ".vcf" file.
2752
2753         * platform/PasteboardItemInfo.h:
2754         (WebCore::PasteboardItemInfo::canBeTreatedAsAttachmentOrFile const):
2755
2756         Add a helper method to determine whether the PasteboardItemInfo prefers to be represented as inline data, or an
2757         attachment, or neither. This differs slightly from the existing value of preferredPresentationStyle in that we
2758         consider having a suggested file name as a strong indicator that the item should be treated as an attachment,
2759         even if the presentation style is unspecified.
2760
2761         * platform/cocoa/PasteboardCocoa.mm:
2762         (WebCore::Pasteboard::fileContentState):
2763
2764         Use PasteboardItemInfo::canBeTreatedAsAttachmentOrFile().
2765
2766         * platform/ios/PasteboardIOS.mm:
2767         (WebCore::prefersAttachmentRepresentation):
2768
2769         Use PasteboardItemInfo::canBeTreatedAsAttachmentOrFile().
2770
2771 2019-04-01  Tim Horton  <timothy_horton@apple.com>
2772
2773         Make UIWKDocumentContext rects per-character instead of per-word
2774         https://bugs.webkit.org/show_bug.cgi?id=196459
2775
2776         Reviewed by Wenson Hsieh.
2777
2778         No new tests; adjusted expected results of WebKit.DocumentEditingContext.
2779
2780         * editing/TextIterator.cpp:
2781         (WebCore::CharacterIterator::CharacterIterator):
2782         * editing/TextIterator.h:
2783         (WebCore::CharacterIterator::atEnd const):
2784         (WebCore::CharacterIterator::text const):
2785         Add WEBCORE_EXPORT to some things.
2786         Introduce a CharacterIterator constructor that takes Positions, like one that TextIterator has.
2787         Move initializers to the header.
2788
2789 2019-04-01  Antti Koivisto  <antti@apple.com>
2790
2791         Update event region when toggling pointer-events:none
2792         https://bugs.webkit.org/show_bug.cgi?id=195902
2793         <rdar://problem/48988384>
2794
2795         Reviewed by Simon Fraser.
2796
2797         Test: fast/scrolling/ios/event-region-pointer-events.html
2798
2799         Normally paint invalidation requests compositing configuration update whenever anything that would
2800         affect event region changes. However mutating 'pointer-events' property does not cause paint invalidation.
2801
2802         * rendering/RenderElement.cpp:
2803         (WebCore::RenderElement::styleWillChange):
2804
2805         Request compositing update explicitly from the containing layer.
2806
2807         * rendering/RenderLayer.cpp:
2808         (WebCore::RenderLayer::invalidateEventRegion):
2809         * rendering/RenderLayer.h:
2810
2811 2019-04-01  Chris Dumez  <cdumez@apple.com>
2812
2813         Support "noreferrer" for window.open()
2814         https://bugs.webkit.org/show_bug.cgi?id=194533
2815
2816         Reviewed by Geoffrey Garen.
2817
2818         Support "noreferrer" for window.open() as per:
2819         - https://github.com/whatwg/html/pull/4331
2820
2821         Tests: imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noreferrer.html
2822                http/wpt/html/browsers/the-window-object/window-open-noopener-webkit.html
2823
2824         * page/DOMWindow.cpp:
2825         (WebCore::DOMWindow::createWindow):
2826         * page/WindowFeatures.cpp:
2827         (WebCore::setWindowFeature):
2828         * page/WindowFeatures.h:
2829
2830 2019-04-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
2831
2832         SVGMatrix.IDL methods do not conform to the specs
2833         https://bugs.webkit.org/show_bug.cgi?id=196263
2834
2835         Reviewed by Simon Fraser.
2836
2837         I think there was a misconception about these functions. The specs link
2838         is: https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGMatrix.
2839
2840         Notice that the specs does not state that the SVGMethod methods should
2841         raise the exception NO_MODIFICATION_ALLOWED_ERR if the object is read
2842         only. Notice setting the attribute 'a' for example may raise this
2843         exception. Therefore, I think the specs wanted to make these operations
2844         read-only. None of the methods should raise the exception
2845         NO_MODIFICATION_ALLOWED_ERR.
2846
2847         In fact the SVG code was doing the right thing. For example SVGMatrix::scale()
2848         was calling SVGMatrixValue::scale() which was making a copy of itself,
2849         applying the scale on the copy and then returning the copy. When 
2850         SVGMatrix::scale() receives the copy of the SVGMatrixValue it creates and
2851         returns a new SVGMatrix object.
2852
2853         * WebCore.xcodeproj/project.pbxproj:
2854         * svg/SVGMatrix.h:
2855         (WebCore::SVGMatrix::create):
2856         (WebCore::SVGMatrix::a const):
2857         (WebCore::SVGMatrix::b const):
2858         (WebCore::SVGMatrix::c const):
2859         (WebCore::SVGMatrix::d const):
2860         (WebCore::SVGMatrix::e const):
2861         (WebCore::SVGMatrix::f const):
2862         (WebCore::SVGMatrix::multiply const):
2863         (WebCore::SVGMatrix::inverse const):
2864         (WebCore::SVGMatrix::translate const):
2865         (WebCore::SVGMatrix::scale const):
2866         (WebCore::SVGMatrix::scaleNonUniform const):
2867         (WebCore::SVGMatrix::rotate const):
2868         (WebCore::SVGMatrix::rotateFromVector const):
2869         (WebCore::SVGMatrix::flipX const):
2870         (WebCore::SVGMatrix::flipY const):
2871         (WebCore::SVGMatrix::skewX const):
2872         (WebCore::SVGMatrix::skewY const):
2873         (WebCore::SVGMatrix::a): Deleted.
2874         (WebCore::SVGMatrix::b): Deleted.
2875         (WebCore::SVGMatrix::c): Deleted.
2876         (WebCore::SVGMatrix::d): Deleted.
2877         (WebCore::SVGMatrix::e): Deleted.
2878         (WebCore::SVGMatrix::f): Deleted.
2879         (WebCore::SVGMatrix::multiply): Deleted.
2880         (WebCore::SVGMatrix::inverse): Deleted.
2881         (WebCore::SVGMatrix::translate): Deleted.
2882         (WebCore::SVGMatrix::scale): Deleted.
2883         (WebCore::SVGMatrix::scaleNonUniform): Deleted.
2884         (WebCore::SVGMatrix::rotate): Deleted.
2885         (WebCore::SVGMatrix::rotateFromVector): Deleted.
2886         (WebCore::SVGMatrix::flipX): Deleted.
2887         (WebCore::SVGMatrix::flipY): Deleted.
2888         (WebCore::SVGMatrix::skewX): Deleted.
2889         (WebCore::SVGMatrix::skewY): Deleted.
2890         (WebCore::SVGMatrix::SVGMatrix): Deleted.
2891         * svg/SVGMatrix.idl:
2892         * svg/SVGMatrixValue.h: Removed.
2893         * svg/SVGTransform.cpp:
2894         (WebCore::SVGTransform::matrix):
2895         * svg/SVGTransformDistance.cpp:
2896         (WebCore::SVGTransformDistance::addToSVGTransform const):
2897         * svg/SVGTransformValue.h:
2898         (WebCore::SVGTransformValue::matrix const):
2899         (WebCore::SVGTransformValue::matrix):
2900         (WebCore::SVGTransformValue::svgMatrix): Deleted.
2901         (WebCore::operator==): Deleted.
2902         (WebCore::operator!=): Deleted.
2903         * svg/properties/SVGMatrixTearOff.h:
2904         * svg/properties/SVGPropertyTearOff.h:
2905         (WebCore::SVGPropertyTearOff::propertyReference const):
2906
2907 2019-04-01  Simon Fraser  <simon.fraser@apple.com>
2908
2909         Plumb through a ScrollType value that indicates whether a scroll was a user or programmatic scroll
2910         https://bugs.webkit.org/show_bug.cgi?id=196424
2911
2912         Reviewed by Zalan Bujtas.
2913
2914         In preparation for fixing webkit.org/b/195584, we need to know if an overflow scroll
2915         is programmatic, so plumb through an enum value. The functions touched by this patch are
2916         only ever called for programmatic scrolls.
2917
2918         * dom/Element.cpp:
2919         (WebCore::Element::scrollTo):
2920         (WebCore::Element::setScrollLeft):
2921         (WebCore::Element::setScrollTop):
2922         * platform/ScrollTypes.h:
2923         * rendering/RenderBox.cpp:
2924         (WebCore::RenderBox::setScrollLeft):
2925         (WebCore::RenderBox::setScrollTop):
2926         * rendering/RenderBox.h:
2927         * rendering/RenderLayer.cpp:
2928         (WebCore::RenderLayer::scrollToXPosition):
2929         (WebCore::RenderLayer::scrollToYPosition):
2930         * rendering/RenderLayer.h:
2931         * rendering/RenderListBox.cpp:
2932         (WebCore::RenderListBox::setScrollLeft):
2933         (WebCore::RenderListBox::setScrollTop):
2934         * rendering/RenderListBox.h:
2935         * rendering/RenderTextControlSingleLine.cpp:
2936         (WebCore::RenderTextControlSingleLine::setScrollLeft):
2937         (WebCore::RenderTextControlSingleLine::setScrollTop):
2938         * rendering/RenderTextControlSingleLine.h:
2939
2940 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2941
2942         [iOS] Refactor some logic for inserting pasted or dropped virtual card files as attachment elements
2943         https://bugs.webkit.org/show_bug.cgi?id=196435
2944         Work towards <rdar://problem/48573098>
2945
2946         Reviewed by Darin Adler.
2947
2948         Refactor some existing codepaths on iOS for inserting VCard files as attachment elements. Instead of using a
2949         separate readVirtualContactFile method for converting a vcard file or data into an attachment element (possibly
2950         accompanied by a link), use the existing readFilePaths WebContentReader method.
2951
2952         To handle links which may accompany the attachment element, add a helper method in PasteboardIOS that reads a
2953         titled URL prior to inserting an attachment element, in the case of pasting or dropping a VCF.
2954
2955         This means we no longer need to handle attachment reading in readPasteboardWebContentDataForType, so we can
2956         simply bail before reading "public.vcard" here and defer to reading other data types.
2957
2958         Covered by existing API tests in WKAttachmentTests and DragAndDropTestsIOS.
2959
2960         * editing/WebContentReader.h:
2961         * editing/cocoa/WebContentReaderCocoa.mm:
2962         (WebCore::WebContentReader::readVirtualContactFile): Deleted.
2963         * platform/Pasteboard.h:
2964         * platform/ios/PasteboardIOS.mm:
2965         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
2966         (WebCore::readURLAlongsideAttachmentIfNecessary):
2967         (WebCore::prefersAttachmentRepresentation):
2968         (WebCore::Pasteboard::read):
2969         (WebCore::Pasteboard::readRespectingUTIFidelities):
2970
2971 2019-04-01  Antti Koivisto  <antti@apple.com>
2972
2973         Trying to scroll the compose pane on gmail.com scrolls the message list behind
2974         https://bugs.webkit.org/show_bug.cgi?id=196426
2975         <rdar://problem/49402667>
2976
2977         Reviewed by Darin Adler.
2978
2979         Test: fast/scrolling/ios/event-region-visibility-hidden.html
2980
2981         We fail to gather event region from desdendants of non-overflowing elements with 'visibility:hidden'.
2982
2983         * rendering/RenderBlock.cpp:
2984         (WebCore::RenderBlock::paintObject):
2985
2986         Skip the subtree walk only if the current region covers the box already.
2987
2988         * rendering/RenderLayer.cpp:
2989         (WebCore::RenderLayer::paintList):
2990
2991         Remove the (wrong) optimization, we bail out quickly on first renderer if possible so this is not high value.
2992
2993 2019-04-01  Emilio Cobos Álvarez  <emilio@crisal.io>
2994
2995         Be less strict about closing blocks in attribute and functional pseudo-element selectors.
2996         https://bugs.webkit.org/show_bug.cgi?id=142167
2997
2998         Reviewed by Antti Koivisto.
2999
3000         This was also an issue for, e.g., "::slotted(foo", turns out.
3001
3002         This matches Chromium, Firefox, and the spec:
3003
3004         https://drafts.csswg.org/css-syntax/#parse-error:
3005
3006         > Certain points in the parsing algorithm are said to be parse errors. The error
3007         > handling for parse errors is well-defined: user agents must either act as
3008         > described below when encountering such problems, or must abort processing at
3009         > the first error that they encounter for which they do not wish to apply the
3010         > rules described below.
3011
3012         https://drafts.csswg.org/css-syntax/#consume-simple-block:
3013
3014         > <EOF-token>
3015         >   This is a parse error. Return the block.
3016
3017         Tests: web-platform-tests/dom/nodes/selectors.js (and probably others)
3018
3019         * css/parser/CSSSelectorParser.cpp:
3020         (WebCore::CSSSelectorParser::consumeAttribute):
3021         (WebCore::CSSSelectorParser::consumePseudo):
3022
3023 2019-04-01  Pablo Saavedra  <psaavedra@igalia.com>
3024
3025         Build failure after r243644 in GTK Linux 64-bit stable builds
3026         https://bugs.webkit.org/show_bug.cgi?id=196440
3027
3028         Reviewed by Philippe Normand.
3029
3030         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3031         (WebCore::MediaPlayerPrivateGStreamerBase::updateTextureMapperFlags):
3032
3033 2019-03-31  Manuel Rego Casasnovas  <rego@igalia.com>
3034
3035         Scroll position gets reset when overflow:scroll is inside grid
3036         https://bugs.webkit.org/show_bug.cgi?id=196337
3037         <rdar://problem/49385784>
3038
3039         Reviewed by Simon Fraser.
3040
3041         Fix scroll position when there are changes inside a grid item with "overflow: scroll".
3042
3043         Test: fast/css-grid-layout/grid-item-content-scroll-position.html
3044
3045         * rendering/RenderGrid.cpp:
3046         (WebCore::RenderGrid::layoutBlock): Use beginUpdateScrollInfoAfterLayoutTransaction()
3047         and endAndCommitUpdateScrollInfoAfterLayoutTransaction().
3048
3049 2019-03-31  Ryosuke Niwa  <rniwa@webkit.org>
3050
3051         Reduce the size of Node::deref by eliminating an explicit parentNode check
3052         https://bugs.webkit.org/show_bug.cgi?id=195776
3053
3054         Reviewed by Darin Adler.
3055
3056         Address post-commit review comments.
3057
3058         * dom/Document.cpp:
3059         (WebCore::Document::removedLastRef):
3060         * dom/Node.cpp:
3061         (WebCore::Node::~Node):
3062         (WebCore::Node::removedLastRef):
3063         * dom/Node.h:
3064         (WebCore::Node::deref):
3065         (WebCore::Node::setParentNode):
3066
3067 2019-03-31  Sam Weinig  <weinig@apple.com>
3068
3069         Remove more i386 specific configurations
3070         https://bugs.webkit.org/show_bug.cgi?id=196430
3071
3072         Reviewed by Alexey Proskuryakov.
3073
3074         * Configurations/FeatureDefines.xcconfig:
3075         ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
3076
3077 2019-03-31  Andy Estes  <aestes@apple.com>
3078
3079         [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
3080         https://bugs.webkit.org/show_bug.cgi?id=196433
3081         <rdar://problem/49293305>
3082
3083         Reviewed by Tim Horton.
3084
3085         When ResourceLoader would encounter a response with a MIME type that QuickLook supports, the
3086         response would be implicitly allowed and a QuickLook preview would be generated. After
3087         generating, the client's navigation response policy delegate would be notified of the
3088         preview response, but not the underlying response. Notably, the preview response has a URL
3089         scheme of "x-apple-ql-id", does not include any underlying HTTP headers, and usually has a
3090         MIME type of "text/html" or "application/pdf" rather than the underlying response MIME type.
3091
3092         To allow clients to make better navigation response policy decisions, this patch changes the
3093         above behavior for WKWebView clients that have linked against a version of WebKit that
3094         includes this change. Rather than notifying the client's navigation response policy delegate
3095         of the preview response, we notify the client of the underlying response. Only if the client
3096         responds with a policy of "allow" will the QuickLook preview response be loaded (without
3097         another call to the navigation response policy delegate).
3098
3099         Non-WKWebView clients and clients that have linked against a version of WebKit that does not
3100         include this change will retain the original behavior.
3101
3102         Covered by existing layout tests and new and existing API tests.
3103
3104         * WebCore.xcodeproj/project.pbxproj:
3105         * loader/SubresourceLoader.cpp:
3106         (WebCore::SubresourceLoader::shouldCreatePreviewLoaderForResponse const):
3107         (WebCore::SubresourceLoader::didReceiveResponse):
3108         * loader/ios/PreviewLoader.h:
3109         * loader/ios/PreviewLoader.mm:
3110         (-[WebPreviewLoader initWithResourceLoader:resourceResponse:]):
3111         (-[WebPreviewLoader _loadPreviewIfNeeded]):
3112         (-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
3113         (-[WebPreviewLoader connectionDidFinishLoading:]):
3114         (-[WebPreviewLoader connection:didFailWithError:]):
3115         (WebCore::PreviewLoader::create):
3116         (WebCore::PreviewLoader::didReceiveResponse):
3117         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]): Deleted.
3118         (WebCore::PreviewLoader::shouldCreateForMIMEType): Deleted.
3119         * page/Settings.yaml:
3120         * platform/MIMETypeRegistry.cpp:
3121         (WebCore::MIMETypeRegistry::canShowMIMEType):
3122         * platform/network/ios/PreviewConverter.h:
3123         * platform/network/ios/PreviewConverter.mm:
3124         (WebCore::PreviewConverter::supportsMIMEType):
3125
3126 2019-03-29  Dean Jackson  <dino@apple.com>
3127
3128         gl.readPixels with type gl.FLOAT does not work
3129         https://bugs.webkit.org/show_bug.cgi?id=171432
3130         <rdar://problem/31905150>
3131
3132         Reviewed by Antoine Quint.
3133
3134         Our validation code was identifying readPixels of
3135         type FLOAT as invalid, for three reasons:
3136         - we didn't support the FLOAT type at all.
3137         - we only allowed the combination of RGBA and
3138         UNSIGNED_BYTE in WebGL 1 [*].
3139         - if we had a framebuffer of format RGBA, we assumed
3140         we could only read into a Uint8 ArrayBuffer.
3141
3142         [*] This bug isn't completely fixed, so I opened
3143         https://bugs.webkit.org/show_bug.cgi?id=196418
3144
3145         Test: fast/canvas/webgl/readPixels-float.html
3146
3147         * html/canvas/WebGLRenderingContextBase.cpp:
3148         (WebCore::WebGLRenderingContextBase::readPixels):
3149         - flip the logic in a conditional that was clearly wrong yet
3150           thankfully had no impact.
3151         - support type FLOAT when the relevant extension is enabled.
3152         - allow FLOAT as a valid type (see new bug above)
3153         - create a new macro for CHECK_COMPONENT_COUNT
3154         - update the existing macros to not be case statements,
3155           so that we can put logic in the switch.
3156
3157 2019-03-30  Antti Koivisto  <antti@apple.com>
3158
3159         Try to fix Windows build.
3160
3161         * platform/graphics/RoundedRect.cpp:
3162         (WebCore::approximateAsRegion):
3163
3164 2019-03-30  Joseph Pecoraro  <pecoraro@apple.com>
3165
3166         Web Inspector: JSC Sampling Profiler thread not getting subtracted in CPU Usage Timeline
3167         https://bugs.webkit.org/show_bug.cgi?id=196419
3168         <rdar://problem/49444023>
3169
3170         Reviewed by Devin Rousso.
3171
3172         * page/ResourceUsageThread.cpp:
3173         (WebCore::ResourceUsageThread::addObserver):
3174         We forgot to call the function that would setup platform state
3175         allowing us to subtract out the sampling profiler thread.
3176
3177 2019-03-30  Zalan Bujtas  <zalan@apple.com>
3178
3179         [ContentChangeObserver] Add iFrame elements to the list of "considered clickable" elements.
3180         https://bugs.webkit.org/show_bug.cgi?id=196410
3181         <rdar://problem/49436828>
3182
3183         Reviewed by Simon Fraser.
3184
3185         163.com constructs an iFrame to display the login pane on hover. This patch ensures that we take iFrames into account while observing for visible content change by considering iFrame elements "clickable".
3186         (While iFrames don't necessarily have clickable content, we can't just sit and wait until they are fully loaded.)
3187
3188         Test: fast/events/touch/ios/content-observation/iframe-is-shown-on-hover.html
3189
3190         * page/ios/ContentChangeObserver.cpp:
3191         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
3192
3193 2019-03-30  Antti Koivisto  <antti@apple.com>
3194
3195         Try to fix Windows build.
3196
3197         * platform/graphics/Region.cpp:
3198         * platform/graphics/RoundedRect.cpp:
3199
3200 2019-03-30  Antti Koivisto  <antti@apple.com>
3201
3202         Hit-testing of boxes over scrollers should account for border-radius
3203         https://bugs.webkit.org/show_bug.cgi?id=195374
3204         <rdar://problem/48649993>
3205
3206         Reviewed by Simon Fraser.
3207
3208         Test: fast/scrolling/ios/border-radious-event-region.html
3209
3210         * page/Frame.h:
3211         * platform/graphics/GraphicsLayer.cpp:
3212         (WebCore::GraphicsLayer::dumpProperties const):
3213
3214         Testing support.
3215
3216         * platform/graphics/GraphicsLayerClient.h:
3217         * platform/graphics/RoundedRect.cpp:
3218         (WebCore::approximateAsRegion):
3219
3220         Add a function to approximate RoundedRects as Regions.
3221         It cuts away rectangles from the corners following the corner shapes.
3222         More rectangles are cut for larger radii.
3223
3224         * platform/graphics/RoundedRect.h:
3225         * rendering/RenderBlock.cpp:
3226         (WebCore::RenderBlock::paintObject):
3227
3228         Use the new interface to get rounded corners right.
3229         In rectangle case this takes optimized paths.
3230
3231         * rendering/RenderLayerCompositor.cpp:
3232         (WebCore::RenderLayerCompositor::layerTreeAsText):
3233         * testing/Internals.cpp:
3234         (WebCore::toLayerTreeFlags):
3235         * testing/Internals.h:
3236         * testing/Internals.idl:
3237
3238 2019-03-29  Zalan Bujtas  <zalan@apple.com>
3239
3240         [ContentChangeObserver] Expand DOM timer observation to 350ms
3241         https://bugs.webkit.org/show_bug.cgi?id=196411
3242         <rdar://problem/49391144>
3243
3244         Reviewed by Simon Fraser.
3245
3246         imdb.com main page has 350ms hover intent timer to bring up the hover menus around the search bar.
3247
3248         Test: fast/events/touch/ios/content-observation/350ms-hover-intent.html
3249
3250         * page/ios/ContentChangeObserver.cpp:
3251
3252 2019-03-29  John Wilander  <wilander@apple.com>
3253
3254         Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
3255         https://bugs.webkit.org/show_bug.cgi?id=196407
3256         <rdar://problem/47859936>
3257
3258         Reviewed by Brent Fulgham.
3259
3260         Test: http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture.html
3261
3262         This patch removes old code for the batching into "statistics updated" calls.
3263         Since the move of Resource Load Statistics to the network process, all such
3264         collection is done directly through dedicated calls to the network process.
3265
3266         The remaining functionality was renamed to make it more clear, i.e.
3267         ResourceLoadObserver::notifyObserver() renamed to
3268         ResourceLoadObserver::updateCentralStatisticsStore().
3269
3270         * loader/ResourceLoadObserver.cpp:
3271         (WebCore::ResourceLoadObserver::setStatisticsUpdatedCallback):
3272         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
3273         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3274         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3275         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3276         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
3277         (WebCore::ResourceLoadObserver::updateCentralStatisticsStore):
3278         (WebCore::ResourceLoadObserver::clearState):
3279         (WebCore::ResourceLoadObserver::setNotificationCallback): Deleted.
3280         (WebCore::ResourceLoadObserver::ResourceLoadObserver): Deleted.
3281         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded): Deleted.
3282         (WebCore::ResourceLoadObserver::notifyObserver): Deleted.
3283         * loader/ResourceLoadObserver.h:
3284         * testing/Internals.cpp:
3285         (WebCore::Internals::notifyResourceLoadObserver):
3286
3287 2019-03-29  Chris Dumez  <cdumez@apple.com>
3288
3289         Make someWindow.frames, .self, .window always return someWindow
3290         https://bugs.webkit.org/show_bug.cgi?id=195406
3291
3292         Reviewed by Alex Christensen.
3293
3294         Make someWindow.frames, .self, .window always return someWindow. Previously, they
3295         would return null when the window would lose its browsing context.
3296
3297         This aligns our behavior with Firefox and the HTML specification:
3298         - https://github.com/whatwg/html/pull/4410
3299
3300         Chrome has also recently aligned with Firefox and the HTML specification here so
3301         it makes sense for WebKit to follow.
3302
3303         No new tests, rebaselined existing tests.
3304
3305         * bindings/js/JSDOMWindowCustom.cpp:
3306         (WebCore::JSDOMWindow::self const):
3307         (WebCore::JSDOMWindow::window const):
3308         (WebCore::JSDOMWindow::frames const):
3309         * page/DOMWindow.cpp:
3310         (WebCore::DOMWindow::focus):
3311         * page/DOMWindow.h:
3312         * page/DOMWindow.idl:
3313
3314 2019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
3315
3316         Delete WebMetal implementation in favor of WebGPU
3317         https://bugs.webkit.org/show_bug.cgi?id=195418
3318
3319         Reviewed by Dean Jackson.
3320
3321         WebMetal was only ever intended to be a proof-of-concept, and was never intended to be shipped.
3322         Now that our WebGPU implementation is achieving good functionality, we're hitting conflicts
3323         because we have both implementations. We should delete the non-standard implementation in favor
3324         of the standards-based implementation.
3325
3326         Deletes relevant tests.
3327
3328         * CMakeLists.txt:
3329         * Configurations/FeatureDefines.xcconfig:
3330         * DerivedSources-input.xcfilelist:
3331         * DerivedSources-output.xcfilelist:
3332         * DerivedSources.make:
3333         * Sources.txt:
3334         * SourcesCocoa.txt:
3335         * WebCore.xcodeproj/project.pbxproj:
3336         * bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp: Removed.
3337         * bindings/js/JSWebMetalRenderingContextCustom.cpp: Removed.
3338         * bindings/js/WebCoreBuiltinNames.h:
3339         * dom/Document.cpp:
3340         (WebCore::Document::getCSSCanvasContext):
3341         * dom/Document.h:
3342         * dom/Document.idl:
3343         * html/HTMLCanvasElement.cpp:
3344         (WebCore::HTMLCanvasElement::getContext):
3345         (WebCore::HTMLCanvasElement::isWebMetalType): Deleted.
3346         (WebCore::HTMLCanvasElement::createContextWebMetal): Deleted.
3347         (WebCore::HTMLCanvasElement::getContextWebMetal): Deleted.
3348         * html/HTMLCanvasElement.h:
3349         * html/HTMLCanvasElement.idl:
3350         * html/canvas/CanvasRenderingContext.h:
3351         (WebCore::CanvasRenderingContext::isWebGPU const):
3352         (WebCore::CanvasRenderingContext::isWebMetal const): Deleted.
3353         * html/canvas/WebMetalBuffer.cpp: Removed.
3354         * html/canvas/WebMetalBuffer.h: Removed.
3355         * html/canvas/WebMetalBuffer.idl: Removed.
3356         * html/canvas/WebMetalCommandBuffer.cpp: Removed.
3357         * html/canvas/WebMetalCommandBuffer.h: Removed.
3358         * html/canvas/WebMetalCommandBuffer.idl: Removed.
3359         * html/canvas/WebMetalCommandQueue.cpp: Removed.
3360         * html/canvas/WebMetalCommandQueue.h: Removed.
3361         * html/canvas/WebMetalCommandQueue.idl: Removed.
3362         * html/canvas/WebMetalComputeCommandEncoder.cpp: Removed.
3363         * html/canvas/WebMetalComputeCommandEncoder.h: Removed.
3364         * html/canvas/WebMetalComputeCommandEncoder.idl: Removed.
3365         * html/canvas/WebMetalComputePipelineState.cpp: Removed.
3366         * html/canvas/WebMetalComputePipelineState.h: Removed.
3367         * html/canvas/WebMetalComputePipelineState.idl: Removed.
3368         * html/canvas/WebMetalDepthStencilDescriptor.cpp: Removed.
3369         * html/canvas/WebMetalDepthStencilDescriptor.h: Removed.
3370         * html/canvas/WebMetalDepthStencilDescriptor.idl: Removed.
3371         * html/canvas/WebMetalDepthStencilState.cpp: Removed.
3372         * html/canvas/WebMetalDepthStencilState.h: Removed.
3373         * html/canvas/WebMetalDepthStencilState.idl: Removed.
3374         * html/canvas/WebMetalDrawable.cpp: Removed.
3375         * html/canvas/WebMetalDrawable.h: Removed.
3376         * html/canvas/WebMetalDrawable.idl: Removed.
3377         * html/canvas/WebMetalEnums.cpp: Removed.
3378         * html/canvas/WebMetalEnums.h: Removed.
3379         * html/canvas/WebMetalEnums.idl: Removed.
3380         * html/canvas/WebMetalFunction.cpp: Removed.
3381         * html/canvas/WebMetalFunction.h: Removed.
3382         * html/canvas/WebMetalFunction.idl: Removed.
3383         * html/canvas/WebMetalLibrary.cpp: Removed.
3384         * html/canvas/WebMetalLibrary.h: Removed.
3385         * html/canvas/WebMetalLibrary.idl: Removed.
3386         * html/canvas/WebMetalRenderCommandEncoder.cpp: Removed.
3387         * html/canvas/WebMetalRenderCommandEncoder.h: Removed.
3388         * html/canvas/WebMetalRenderCommandEncoder.idl: Removed.
3389         * html/canvas/WebMetalRenderPassAttachmentDescriptor.cpp: Removed.
3390         * html/canvas/WebMetalRenderPassAttachmentDescriptor.h: Removed.
3391         * html/canvas/WebMetalRenderPassAttachmentDescriptor.idl: Removed.
3392         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.cpp: Removed.
3393         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.h: Removed.
3394         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.idl: Removed.
3395         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.cpp: Removed.
3396         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.h: Removed.
3397         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.idl: Removed.
3398         * html/canvas/WebMetalRenderPassDescriptor.cpp: Removed.
3399         * html/canvas/WebMetalRenderPassDescriptor.h: Removed.
3400         * html/canvas/WebMetalRenderPassDescriptor.idl: Removed.
3401         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.cpp: Removed.
3402         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.h: Removed.
3403         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.idl: Removed.
3404         * html/canvas/WebMetalRenderPipelineDescriptor.cpp: Removed.
3405         * html/canvas/WebMetalRenderPipelineDescriptor.h: Removed.
3406         * html/canvas/WebMetalRenderPipelineDescriptor.idl: Removed.
3407         * html/canvas/WebMetalRenderPipelineState.cpp: Removed.
3408         * html/canvas/WebMetalRenderPipelineState.h: Removed.
3409         * html/canvas/WebMetalRenderPipelineState.idl: Removed.
3410         * html/canvas/WebMetalRenderingContext.cpp: Removed.
3411         * html/canvas/WebMetalRenderingContext.h: Removed.
3412         * html/canvas/WebMetalRenderingContext.idl: Removed.
3413         * html/canvas/WebMetalSize.h: Removed.
3414         * html/canvas/WebMetalSize.idl: Removed.
3415         * html/canvas/WebMetalTexture.cpp: Removed.
3416         * html/canvas/WebMetalTexture.h: Removed.
3417         * html/canvas/WebMetalTexture.idl: Removed.
3418         * html/canvas/WebMetalTextureDescriptor.cpp: Removed.
3419         * html/canvas/WebMetalTextureDescriptor.h: Removed.
3420         * html/canvas/WebMetalTextureDescriptor.idl: Removed.
3421         * inspector/InspectorCanvas.cpp:
3422         (WebCore::InspectorCanvas::buildObjectForCanvas):
3423         * inspector/agents/InspectorCanvasAgent.cpp:
3424         (WebCore::InspectorCanvasAgent::requestContent):
3425         (WebCore::contextAsScriptValue):
3426         * page/RuntimeEnabledFeatures.h:
3427         (WebCore::RuntimeEnabledFeatures::setWebMetalEnabled): Deleted.
3428         (WebCore::RuntimeEnabledFeatures::webMetalEnabled const): Deleted.
3429         * platform/Logging.h:
3430         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3431         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
3432         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
3433         * platform/graphics/cocoa/WebMetalLayer.h: Removed.
3434         * platform/graphics/cocoa/WebMetalLayer.mm: Removed.
3435         * platform/graphics/gpu/legacy/GPULegacyBuffer.cpp: Removed.
3436         * platform/graphics/gpu/legacy/GPULegacyBuffer.h: Removed.
3437         * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp: Removed.
3438         * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.h: Removed.
3439         * platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp: Removed.
3440         * platform/graphics/gpu/legacy/GPULegacyCommandQueue.h: Removed.
3441         * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.cpp: Removed.
3442         * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.h: Removed.
3443         * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.cpp: Removed.
3444         * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.h: Removed.
3445         * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.cpp: Removed.
3446         * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.h: Removed.
3447         * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.cpp: Removed.
3448         * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.h: Removed.
3449         * platform/graphics/gpu/legacy/GPULegacyDevice.cpp: Removed.
3450         * platform/graphics/gpu/legacy/GPULegacyDevice.h: Removed.
3451         * platform/graphics/gpu/legacy/GPULegacyDrawable.cpp: Removed.
3452         * platform/graphics/gpu/legacy/GPULegacyDrawable.h: Removed.
3453         * platform/graphics/gpu/legacy/GPULegacyEnums.h: Removed.
3454         * platform/graphics/gpu/legacy/GPULegacyFunction.cpp: Removed.
3455         * platform/graphics/gpu/legacy/GPULegacyFunction.h: Removed.
3456         * platform/graphics/gpu/legacy/GPULegacyLibrary.cpp: Removed.
3457         * platform/graphics/gpu/legacy/GPULegacyLibrary.h: Removed.
3458         * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.cpp: Removed.
3459         * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.h: Removed.
3460         * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.cpp: Removed.
3461         * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.h: Removed.
3462         * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.cpp: Removed.
3463         * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.h: Removed.
3464         * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.cpp: Removed.
3465         * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.h: Removed.
3466         * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.cpp: Removed.
3467         * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.h: Removed.
3468         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp: Removed.
3469         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.h: Removed.
3470         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.cpp: Removed.
3471         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.h: Removed.
3472         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.cpp: Removed.
3473         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.h: Removed.
3474         * platform/graphics/gpu/legacy/GPULegacySize.h: Removed.
3475         * platform/graphics/gpu/legacy/GPULegacyTexture.cpp: Removed.
3476         * platform/graphics/gpu/legacy/GPULegacyTexture.h: Removed.
3477         * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.cpp: Removed.
3478         * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.h: Removed.
3479         * platform/graphics/gpu/legacy/cocoa/GPULegacyBufferMetal.mm: Removed.
3480         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: Removed.
3481         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandQueueMetal.mm: Removed.
3482         * platform/graphics/gpu/legacy/cocoa/GPULegacyComputeCommandEncoderMetal.mm: Removed.
3483         * platform/graphics/gpu/legacy/cocoa/GPULegacyComputePipelineStateMetal.mm: Removed.
3484         * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilDescriptorMetal.mm: Removed.
3485         * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilStateMetal.mm: Removed.
3486         * platform/graphics/gpu/legacy/cocoa/GPULegacyDeviceMetal.mm: Removed.
3487         * platform/graphics/gpu/legacy/cocoa/GPULegacyDrawableMetal.mm: Removed.
3488         * platform/graphics/gpu/legacy/cocoa/GPULegacyFunctionMetal.mm: Removed.
3489         * platform/graphics/gpu/legacy/cocoa/GPULegacyLibraryMetal.mm: Removed.
3490         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderCommandEncoderMetal.mm: Removed.
3491         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassAttachmentDescriptorMetal.mm: Removed.
3492         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm: Removed.
3493         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm: Removed.
3494         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDescriptorMetal.mm: Removed.
3495         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm: Removed.
3496         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineDescriptorMetal.mm: Removed.
3497         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineStateMetal.mm: Removed.
3498         * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureDescriptorMetal.mm: Removed.
3499         * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureMetal.mm: Removed.
3500         * testing/InternalSettings.cpp:
3501         (WebCore::InternalSettings::Backup::Backup):
3502         (WebCore::InternalSettings::Backup::restoreTo):
3503         (WebCore::InternalSettings::setWebMetalEnabled): Deleted.
3504         * testing/InternalSettings.h:
3505         * testing/InternalSettings.idl:
3506
3507 2019-03-29  Devin Rousso  <drousso@apple.com>
3508
3509         Web Inspector: add fast returns for instrumentation hooks that have no affect before a frontend is connected
3510         https://bugs.webkit.org/show_bug.cgi?id=196382
3511         <rdar://problem/49403417>
3512
3513         Reviewed by Joseph Pecoraro.
3514
3515         Ensure that all instrumentation hooks use `FAST_RETURN_IF_NO_FRONTENDS` or check that
3516         `developerExtrasEnabled`. There should be no activity to/from any inspector objects until
3517         developer extras are enabled.
3518
3519         * inspector/InspectorInstrumentation.h:
3520         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorld):
3521         (WebCore::InspectorInstrumentation::scriptExecutionBlockedByCSP):
3522         (WebCore::InspectorInstrumentation::domContentLoadedEventFired):
3523         (WebCore::InspectorInstrumentation::loadEventFired):
3524         (WebCore::InspectorInstrumentation::frameDetachedFromParent):
3525         (WebCore::InspectorInstrumentation::loaderDetachedFromFrame):
3526         (WebCore::InspectorInstrumentation::frameStartedLoading):
3527         (WebCore::InspectorInstrumentation::frameStoppedLoading):
3528         (WebCore::InspectorInstrumentation::frameScheduledNavigation):
3529         (WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
3530         * inspector/InspectorInstrumentation.cpp:
3531         (WebCore::InspectorInstrumentation::frameWindowDiscardedImpl):
3532         (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
3533         (WebCore::InspectorInstrumentation::didFailLoadingImpl):
3534         (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
3535         (WebCore::InspectorInstrumentation::consoleCountImpl):
3536         (WebCore::InspectorInstrumentation::startConsoleTimingImpl):
3537         (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
3538
3539         * inspector/agents/WebConsoleAgent.cpp:
3540         (WebCore::WebConsoleAgent::frameWindowDiscarded):
3541
3542 2019-03-29  Chris Dumez  <cdumez@apple.com>
3543
3544         Set window.closed immediately when close() is invoked
3545         https://bugs.webkit.org/show_bug.cgi?id=195409
3546
3547         Reviewed by Alex Christensen.
3548
3549         Window.closed should return true if it is closing:
3550         - https://html.spec.whatwg.org/#dom-window-closed
3551
3552         Window.close() sets the 'is closing' flag to true synchronously, as per:
3553         - https://html.spec.whatwg.org/#dom-window-close (step 3.1)
3554
3555         No new tests, rebaselined existing tests.
3556
3557         * page/DOMWindow.cpp:
3558         (WebCore::DOMWindow::closed const):
3559
3560 2019-03-29  Zalan Bujtas  <zalan@apple.com>
3561
3562         [Simple line layout] Turn off inline boxtree generation for multiline content
3563         https://bugs.webkit.org/show_bug.cgi?id=196404
3564         <rdar://problem/49234033>
3565
3566         Reviewed by Simon Fraser.
3567
3568         Currently simple line layout can't provide the correct line breaking context to the inline tree when the boxtree is
3569         generated using the simple line runs. This patch limits the generation of such trees to single lines. Multiline content will
3570         go through the "let's layout this content again" codepath.
3571         This patch fixes disappearing content on Questar.
3572
3573         Test: fast/text/simple-line-layout-and-multiline-inlineboxtree.html
3574
3575         * rendering/SimpleLineLayoutFunctions.cpp:
3576         (WebCore::SimpleLineLayout::canUseForLineBoxTree):
3577
3578 2019-03-29  Justin Fan  <justin_fan@apple.com>
3579
3580         [Web GPU] Replace unsigned longs in WebGPU with uint64_t
3581         https://bugs.webkit.org/show_bug.cgi?id=196401
3582
3583         Reviewed by Myles C. Maxfield.
3584
3585         Unsigned long is not guaranteed to be 64 bits on all platforms. In addition, rowPitch is updated
3586         to u32 in the API and the implementation to match.
3587
3588         No new tests. No new behavior.
3589
3590         * Modules/webgpu/WebGPUBuffer.cpp:
3591         (WebCore::WebGPUBuffer::setSubData):
3592         * Modules/webgpu/WebGPUBuffer.h:
3593         * Modules/webgpu/WebGPUBufferBinding.h:
3594         * Modules/webgpu/WebGPUCommandEncoder.cpp:
3595         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
3596         * Modules/webgpu/WebGPUCommandEncoder.h:
3597         * Modules/webgpu/WebGPUCommandEncoder.idl:
3598         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
3599         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
3600         * Modules/webgpu/WebGPURenderPassEncoder.h:
3601         * platform/graphics/gpu/GPUBindGroupLayout.h:
3602         * platform/graphics/gpu/GPUBuffer.h:
3603         (WebCore::GPUBuffer::byteLength const):
3604         * platform/graphics/gpu/GPUBufferBinding.h:
3605         * platform/graphics/gpu/GPUBufferDescriptor.h:
3606         * platform/graphics/gpu/GPUCommandBuffer.h:
3607         * platform/graphics/gpu/GPURenderPassEncoder.h:
3608         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
3609         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
3610         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3611         (WebCore::GPUBuffer::GPUBuffer):
3612         (WebCore::GPUBuffer::setSubData):
3613         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
3614         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
3615         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3616         (WebCore::GPURenderPassEncoder::setVertexBuffers):
3617
3618 2019-03-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3619
3620         REGRESSION (r243250): Text interactions are no longer suppressed when editing in some websites
3621         https://bugs.webkit.org/show_bug.cgi?id=196378
3622         <rdar://problem/49231299>
3623
3624         Reviewed by Simon Fraser.
3625
3626         Enabling async overflow scrolling by default in r243250 exposed an issue with hidden editable area detection
3627         heuristics. Currently, an empty value for RenderLayer::selfClipRect is used to determine whether the layer
3628         enclosing the editable element or form control is completely clipped by a parent (in other words, the clip rect
3629         is empty). With async overflow scrolling, the enclosing layer of the editable element (as seen in the websites
3630         affected by this bug) will now be a clipping root for painting, since it is composited. This means selfClipRect
3631         returns a non-empty rect despite the layer being entirely clipped, which negates the heuristic.
3632
3633         To address this, we adjust the clipping heuristic to instead walk up the layer tree (crossing frame boundaries)
3634         and look for enclosing ancestors with overflow clip. For each layer we find with an overflow clip, compute the
3635         clip rect of the previous layer relative to the ancestor with overflow clip. If the clipping rect is empty, we
3636         know that the layer is hidden.
3637
3638         This isn't a perfect strategy, since it may still report false negatives (reporting a layer as visible when it
3639         is not) in some cases. One such edge case is a series of overflow hidden containers, nested in such a way that
3640         each container is only partially clipped relative to its ancestor, but the deepest layer is completely clipped
3641         relative to the topmost layer. However, this heuristic is relatively cheap (entailing a layer tree walk at
3642         worst) and works for common use cases on the web without risking scenarios in which text selection that
3643         shouldn't be suppressed ends up becoming suppressed.
3644
3645         Test: editing/selection/ios/hide-selection-in-textarea-with-transform.html
3646
3647         * rendering/RenderLayer.cpp:
3648         (WebCore::RenderLayer::isTransparentOrFullyClippedRespectingParentFrames const):
3649
3650 2019-03-29  Takashi Komori  <Takashi.Komori@sony.com>
3651
3652         [Curl] Add Server Trust Evaluation Support.
3653         https://bugs.webkit.org/show_bug.cgi?id=191646
3654
3655         Reviewed by Fujii Hironori.
3656
3657         Tests: http/tests/ssl/iframe-upgrade.https.html
3658                http/tests/ssl/mixedContent/insecure-websocket.html
3659                http/tests/ssl/upgrade-origin-usage.html
3660
3661         * platform/network/curl/AuthenticationChallenge.h:
3662         * platform/network/curl/AuthenticationChallengeCurl.cpp:
3663         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
3664         (WebCore::AuthenticationChallenge::protectionSpaceForPasswordBased):
3665         (WebCore::AuthenticationChallenge::protectionSpaceForServerTrust):
3666         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle): Deleted.
3667         * platform/network/curl/CurlContext.cpp:
3668         (WebCore::CurlHandle::disableServerTrustEvaluation):
3669         * platform/network/curl/CurlContext.h:
3670         * platform/network/curl/CurlRequest.cpp:
3671         (WebCore::CurlRequest::setupTransfer):
3672         * platform/network/curl/CurlRequest.h:
3673         (WebCore::CurlRequest::disableServerTrustEvaluation):
3674
3675 2019-03-29  Ryosuke Niwa  <rniwa@webkit.org>
3676
3677         Pasting a table from Confluence strip of table cell content
3678         https://bugs.webkit.org/show_bug.cgi?id=196390
3679
3680         Reviewed by Antti Koivisto.
3681
3682         The bug was ultimately caused by FrameView of the document we use to sanitize the pasteboard content
3683         having 0px by 0px dimension. This caused div with `overflow-x: auto` surrounding a table to have
3684         the height of 0px. Because StyledMarkupAccumulator::renderedTextRespectingRange uses TextIterator
3685         to serialize a text node and this div was an ancestor of the text node, TextIterator::handleTextNode
3686         ended up exiting early.
3687
3688         Fixed the bug by giving FrameView, which is used to sanitize the content, a dimension of 800px by 600px.
3689
3690         Using TextIteratorIgnoresStyleVisibility is not a great alternative since removing invisible content
3691         during paste is an important privacy feature.
3692
3693         Test: editing/pasteboard/paste-content-with-overflow-auto-parent-across-origin.html
3694
3695         * editing/markup.cpp:
3696         (WebCore::createPageForSanitizingWebContent):
3697
3698 2019-03-29  Antoine Quint  <graouts@apple.com>
3699
3700         WebKitTestRunner crashes when running pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html
3701         https://bugs.webkit.org/show_bug.cgi?id=196345
3702
3703         Reviewed by Dean Jackson.
3704
3705         An enum used within a WTF::OptionSet needs to have only power-of-two values that are larger than 0.
3706
3707         * platform/TouchAction.h:
3708         * rendering/style/StyleRareNonInheritedData.h:
3709
3710 2019-03-29  Michael Catanzaro  <mcatanzaro@igalia.com>
3711
3712         HTMLInputElement::setEditingValue should not fail if renderer doesn't exist
3713         https://bugs.webkit.org/show_bug.cgi?id=195708
3714
3715         Reviewed by Wenson Hsieh.
3716
3717         HTMLInputElement::setEditingValue currently returns early if the element's renderer() is
3718         null. This is causing the Epiphany password manager to fail to remember passwords on
3719         https://www.geico.com/ except for navigations through page cache.
3720
3721         This check was originally added to avoid some assertion, but I don't know which one, and
3722         there's definitely not any assertion hit nowadays in this case. Probably there are more
3723         guards checking if renderer() is null elsewhere in the code nowadays, closer to where it's
3724         really needed.
3725
3726         Test: fast/forms/editing-value-null-renderer.html
3727
3728         * html/HTMLInputElement.cpp:
3729         (WebCore::HTMLInputElement::setEditingValue):
3730
3731 2019-03-29  Chris Dumez  <cdumez@apple.com>
3732
3733         Unreviewed, rebaseline WPT test after r243638.
3734
3735         * DerivedSources-input.xcfilelist:
3736         * DerivedSources-output.xcfilelist:
3737
3738 2019-03-28  Antoine Quint  <graouts@apple.com>
3739
3740         All PointerEvent.isTrusted is always false.
3741         https://bugs.webkit.org/show_bug.cgi?id=196075
3742         <rdar://problem/49158778>
3743
3744         Reviewed by Chris Dumez.
3745
3746         Test: pointerevents/ios/pointer-events-is-trusted.html
3747
3748         The constructors we were using for some PointerEvent::create() methods were using initializers which are expected to be used with JS APIs
3749         and thus generate untrusted events. We switch to using constructors using dedicated parameters which will set isTrusted to true.
3750
3751         * dom/PointerEvent.cpp:
3752         (WebCore::PointerEvent::create):
3753         (WebCore::PointerEvent::createPointerCancelEvent):
3754         (WebCore::PointerEvent::PointerEvent):
3755         (WebCore::m_isPrimary):
3756         (WebCore::m_pointerType):
3757         * dom/PointerEvent.h:
3758         * page/PointerCaptureController.cpp:
3759         (WebCore::PointerCaptureController::cancelPointer):
3760
3761 2019-03-29  Philippe Normand  <pnormand@igalia.com>
3762
3763         [GStreamer] imxvpudecoder detection and handling
3764         https://bugs.webkit.org/show_bug.cgi?id=196346
3765
3766         Reviewed by Xabier Rodriguez-Calvar.
3767
3768         When the imxvpudecoder is used, the texture sampling of the
3769         directviv-uploaded texture returns an RGB value, so there's no need
3770         to convert it. This patch also includes a refactoring of the
3771         ImageRotation flag handling. The flag is now computed once only
3772         and stored in an instance variable.
3773
3774         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3775         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3776         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3777         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
3778         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3779         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
3780         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
3781         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
3782         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
3783         (WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
3784         (WebCore::MediaPlayerPrivateGStreamerBase::updateTextureMapperFlags):
3785         (WebCore::texMapFlagFromOrientation): Deleted.
3786         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3787
3788 2019-03-29  Cathie Chen  <cathiechen@igalia.com>
3789
3790         Implement ResizeObserver.
3791         https://bugs.webkit.org/show_bug.cgi?id=157743
3792
3793         Reviewed by Simon Fraser.
3794
3795         Tests: resize-observer/modify-frametree-in-callback.html
3796                resize-observer/multi-frames.html
3797                resize-observer/observe-element-from-other-frame.html
3798                Imported from WPT by https://bugs.webkit.org/show_bug.cgi?id=193821
3799
3800         The data structure: Document has a ResizeObserver slot. ResizeObserver has a ResizeObservation slot.
3801         ResizeObservation is related to one Element and the last reported size.
3802         On the other hand, Element has a ResizeObservation slot.
3803
3804         At the beginning of willDisplayPage, it will check resize observations for current page if:
3805         1. There is FrameView be layout and there are ResizeObservers in this page.
3806         2. m_resizeObserverTimer has been started by observe() or hasSkippedResizeObservers().
3807         During checkResizeObservations(), we'll gatherDocumentsNeedingResizeObservationCheck() first,
3808         then notifyResizeObservers() for each document. During notifyResizeObservers(), it will gather
3809         the m_activeObservations whose size changed and target element deeper than require depth.
3810         The size changed shallower observations are skipped observations which will be delivered
3811         in the next time. And an ErrorEvent will be reported.
3812         After gathering, deliverResizeObservations create entries and invoke the callbacks with them.
3813
3814         The Element from other document could be observed.
3815
3816         * CMakeLists.txt:
3817         * Configurations/FeatureDefines.xcconfig:
3818         * DerivedSources.make:
3819         * Sources.txt:
3820         * WebCore.xcodeproj/project.pbxproj:
3821         * bindings/js/WebCoreBuiltinNames.h:
3822         * dom/Document.cpp:
3823         (WebCore::Document::getParserLocation const):
3824         (WebCore::Document::addResizeObserver):
3825         (WebCore::Document::removeResizeObserver):
3826         (WebCore::Document::hasResizeObservers):
3827         (WebCore::Document::gatherResizeObservations): Gather m_activeObservations at depth and return the shallowest depth.
3828         (WebCore::Document::deliverResizeObservations): Deliver m_activeObservations, generate ResizeObserverEntries, and invoke the m_callbacks.
3829         (WebCore::Document::hasSkippedResizeObservations const): To determine if Document has the size changed but not delivered observations.
3830         (WebCore::Document::setHasSkippedResizeObservations):
3831         (WebCore::Document::scheduleResizeObservations):
3832         * dom/Document.h:
3833         * dom/Element.cpp:
3834         (WebCore::Element::~Element):
3835         (WebCore::Element::disconnectFromResizeObservers):
3836         (WebCore::Element::ensureResizeObserverData):
3837         (WebCore::Element::resizeObserverData):
3838         * dom/Element.h:
3839         * dom/ElementRareData.cpp:
3840         * dom/ElementRareData.h:
3841         (WebCore::ElementRareData::resizeObserverData):
3842         (WebCore::ElementRareData::setResizeObserverData):
3843         (WebCore::ElementRareData::useTypes const):
3844         * page/FrameView.cpp:
3845         (WebCore::FrameView::didLayout):
3846         * page/FrameViewLayoutContext.cpp:
3847         (WebCore::FrameViewLayoutContext::layoutTimerFired): We need to start a ResizeObserver timer here, because for WK1 this might not trigger flushCompositingChanges.
3848         * page/Page.cpp:
3849         (WebCore::Page::Page):
3850         (WebCore::Page::willDisplayPage):
3851         (WebCore::Page::hasResizeObservers const):
3852         (WebCore::Page::gatherDocumentsNeedingResizeObservationCheck): Gather the documents with resize observers.
3853         (WebCore::Page::checkResizeObservations): Gather documents then notifyResizeObservers for each document.
3854         (WebCore::Page::scheduleResizeObservations):
3855         (WebCore::Page::notifyResizeObservers): Gather m_activeObservations and deliver them. Report ErrorEvent if it has skipped observations.
3856         * page/Page.h:
3857         (WebCore::Page::setNeedsCheckResizeObservations): Page needs to check ResizeObservations if FrameView layout or m_resizeObserverTimer has been started.
3858         (WebCore::Page::needsCheckResizeObservations const):
3859         * page/PageConsoleClient.cpp:
3860         (WebCore::PageConsoleClient::addMessage):
3861         (WebCore::getParserLocationForConsoleMessage): Deleted.
3862         * page/ResizeObservation.cpp: Added.
3863         (WebCore::ResizeObservation::create):
3864         (WebCore::ResizeObservation::ResizeObservation):
3865         (WebCore::ResizeObservation::~ResizeObservation):
3866         (WebCore::ResizeObservation::updateObservationSize):
3867         (WebCore::ResizeObservation::computeObservedSize const):
3868         (WebCore::ResizeObservation::computeTargetLocation const):
3869         (WebCore::ResizeObservation::computeContentRect const):
3870         (WebCore::ResizeObservation::elementSizeChanged const):
3871         (WebCore::ResizeObservation::targetElementDepth const):
3872         * page/ResizeObservation.h: Copied from Tools/DumpRenderTree/TestOptions.h.
3873         (WebCore::ResizeObservation::target const):
3874         * page/ResizeObserver.cpp: Added.
3875         (WebCore::ResizeObserver::create):
3876         (WebCore::ResizeObserver::ResizeObserver):
3877         (WebCore::ResizeObserver::~ResizeObserver):
3878         (WebCore::ResizeObserver::scheduleObservations):
3879         (WebCore::ResizeObserver::observe):
3880         (WebCore::ResizeObserver::unobserve):
3881         (WebCore::ResizeObserver::disconnect):
3882         (WebCore::ResizeObserver::targetDestroyed):
3883         (WebCore::ResizeObserver::gatherObservations):
3884         (WebCore::ResizeObserver::deliverObservations):
3885         (WebCore::ResizeObserver::removeTarget):
3886         (WebCore::ResizeObserver::removeAllTargets):
3887         (WebCore::ResizeObserver::removeObservation):
3888         (WebCore::ResizeObserver::hasPendingActivity const):
3889         (WebCore::ResizeObserver::activeDOMObjectName const):
3890         (WebCore::ResizeObserver::canSuspendForDocumentSuspension const):
3891         (WebCore::ResizeObserver::stop):
3892         * page/ResizeObserver.h: Added.
3893         (WebCore::ResizeObserver::hasObservations const):
3894         (WebCore::ResizeObserver::hasActiveObservations const):
3895         (WebCore::ResizeObserver::maxElementDepth):
3896         (WebCore::ResizeObserver::hasSkippedObservations const):
3897         (WebCore::ResizeObserver::setHasSkippedObservations):
3898         * page/ResizeObserver.idl: Copied from Tools/DumpRenderTree/TestOptions.h.
3899         * page/ResizeObserverCallback.h: Copied from Tools/DumpRenderTree/TestOptions.h.
3900         * page/ResizeObserverCallback.idl: Copied from Tools/DumpRenderTree/TestOptions.h.
3901         * page/ResizeObserverEntry.h: Copied from Tools/DumpRenderTree/TestOptions.h.
3902         (WebCore::ResizeObserverEntry::create):
3903         (WebCore::ResizeObserverEntry::target const):
3904         (WebCore::ResizeObserverEntry::contentRect const):
3905         (WebCore::ResizeObserverEntry::ResizeObserverEntry):
3906         * page/ResizeObserverEntry.idl: Copied from Tools/DumpRenderTree/TestOptions.h.
3907         * page/Settings.yaml:
3908
3909 2019-03-28  Chris Dumez  <cdumez@apple.com>
3910
3911         Support <object>.contentWindow
3912         https://bugs.webkit.org/show_bug.cgi?id=195562
3913
3914         Reviewed by Sam Weinig.
3915
3916         Support <object>.contentWindow as per:
3917         - https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-object-contentwindow
3918
3919         No new tests, updated / rebaselined existing tests.
3920
3921         * html/HTMLObjectElement.idl:
3922
3923 2019-03-28  Myles C. Maxfield  <mmaxfield@apple.com>
3924
3925         FontFace constructor throws an exception when there is a name which starts with a number
3926         https://bugs.webkit.org/show_bug.cgi?id=196232
3927         <rdar://problem/49293978>
3928
3929         Reviewed by Ryosuke Niwa.
3930
3931         We were technically following the spec, but Chrome and Firefox are both consistent and it was making a website break.
3932         This is just a short-term fix until the underlying https://bugs.webkit.org/show_bug.cgi?id=196381 is fixed.
3933
3934         Test: fast/text/font-face-family.html
3935
3936         * css/FontFace.cpp:
3937         (WebCore::FontFace::setFamily):
3938
3939 2019-03-28  Justin Fan  <justin_fan@apple.com>
3940
3941         [Web GPU] Replace 'unsigned long' with 'unsigned' when implementing u32 variables
3942         https://bugs.webkit.org/show_bug.cgi?id=194618
3943         <rdar://problem/48055796>
3944
3945         Reviewed by Myles C. Maxfield.
3946
3947         WebIDL for "unsigned" on 64-bit is "unsigned long". Update Web GPU to match.
3948
3949         No new tests; no change in behavior.
3950
3951         * Modules/webgpu/GPUBindGroupLayoutBinding.h:
3952         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp:
3953         (WebCore::WHLSL::Metal::calculateVertexBufferIndex):
3954         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h:
3955         * Modules/webgpu/WebGPUBindGroupBinding.h:
3956         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
3957         (WebCore::validateBufferBindingType):
3958         (WebCore::WebGPUBindGroupDescriptor::tryCreateGPUBindGroupDescriptor const):
3959         * Modules/webgpu/WebGPUBuffer.cpp:
3960         (WebCore::WebGPUBuffer::setSubData):
3961         * Modules/webgpu/WebGPUBuffer.h:
3962         * Modules/webgpu/WebGPUBufferBinding.h:
3963         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
3964         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
3965         (WebCore::WebGPURenderPassEncoder::draw):
3966         * Modules/webgpu/WebGPURenderPassEncoder.h:
3967         * platform/graphics/gpu/GPUBindGroupBinding.h:
3968         * platform/graphics/gpu/GPUBindGroupLayout.h:
3969         * platform/graphics/gpu/GPUBufferBinding.h:
3970         * platform/graphics/gpu/GPUExtent3D.h:
3971         * platform/graphics/gpu/GPULimits.h:
3972         * platform/graphics/gpu/GPURenderPassEncoder.h:
3973         * platform/graphics/gpu/GPUTextureDescriptor.h:
3974         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
3975         (WebCore::GPUBindGroupLayout::tryCreate):
3976         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
3977         (WebCore::GPUBindGroup::tryCreate):
3978         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3979         (WebCore::GPURenderPassEncoder::setVertexBuffers):
3980         (WebCore::GPURenderPassEncoder::draw):
3981         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3982         (WebCore::trySetInputStateForPipelineDescriptor):
3983         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
3984         (WebCore::storageModeForPixelFormatAndSampleCount):
3985
3986 2019-03-28  Ryosuke Niwa  <rniwa@webkit.org>
3987
3988         getBoundingClientRect always returns empty rect on a collapsed range
3989         https://bugs.webkit.org/show_bug.cgi?id=196380
3990
3991         Reviewed by Wenson Hsieh.
3992
3993         The bug was caused&