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