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