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