[Mail] Tapping top of message scrolls back to copied text instead of top of the message
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-07-22  Rob Buis  <rbuis@igalia.com>
2
3         Remove some unneeded code in MathOperator
4         https://bugs.webkit.org/show_bug.cgi?id=199935
5
6         Reviewed by Frédéric Wang.
7
8         Remove unused method.
9
10         No new tests, not changing behavior.
11
12         * rendering/mathml/MathOperator.h:
13
14 2019-07-21  Konstantin Tokarev  <annulen@yandex.ru>
15
16         Add DataListButtonElement.cpp to unified sources
17         https://bugs.webkit.org/show_bug.cgi?id=199989
18
19         Reviewed by Michael Catanzaro.
20
21         * Sources.txt:
22         * WebCore.xcodeproj/project.pbxproj:
23
24 2019-07-21  Andres Gonzalez  <andresg_22@apple.com>
25
26         Add accessibilityInsertText for text insertion in edit fields.
27         https://bugs.webkit.org/show_bug.cgi?id=199973
28
29         Reviewed by Chris Fleizach.
30
31         Renamed accessibilityInsertText to _accessibilityInsertText.
32
33         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
34         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
35         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
36         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
37         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
38         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
39
40 2019-07-21  Saam Barati  <sbarati@apple.com>
41
42         [WHLSL] Checker needs to setError() when a property access node can't commit its base type
43         https://bugs.webkit.org/show_bug.cgi?id=199978
44
45         Reviewed by Dean Jackson.
46
47         Test: webgpu/whlsl/null-array-property-access.html
48
49         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
50         (WebCore::WHLSL::Checker::finishVisiting):
51
52 2019-07-21  Saam Barati  <sbarati@apple.com>
53
54         [WHLSL] Return the zero-value enum in the enum-from-integer constructor when the integer is not a valid enum value
55         https://bugs.webkit.org/show_bug.cgi?id=199853
56
57         Reviewed by Dean Jackson.
58
59         Test: webgpu/whlsl/enum-integer-constructor.html
60
61         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
62         (WebCore::WHLSL::Metal::writeNativeFunction):
63
64 2019-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
65
66         [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
67         https://bugs.webkit.org/show_bug.cgi?id=199912
68         <rdar://problem/52182454>
69
70         Reviewed by Simon Fraser.
71
72         This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
73         text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
74         CoreText.
75
76         Test: fast/text/international/system-language/composition.html
77
78         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
79         (WebCore::Font::getCFStringAttributes const):
80
81 2019-07-20  Andres Gonzalez  <andresg_22@apple.com>
82
83         Add accessibilityInsertText for text insertion in edit fields.
84         https://bugs.webkit.org/show_bug.cgi?id=199973
85
86         Reviewed by Chris Fleizach.
87
88         Tests: accessibility/insert-newline.html
89                accessibility/ios-simulator/insert-newline.html
90
91         Accessibility clients like VoiceOver and Voice Control were entering
92         text in text fields by replacing the entire content of the field
93         (SetValue) and then setting the insertion point to the appropriate
94         offset (SetSelectedTextRange). accessibilityInsertText gives a simpler
95         interface to clients to insert text at the insertion point location.
96         In addition, this provides a workaround for the issue encountered with
97         the previous method when inserting a linebreak.
98
99         * accessibility/AccessibilityObject.cpp:
100         (WebCore::AccessibilityObject::insertText):
101         * accessibility/AccessibilityObject.h:
102         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
103         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
104         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
105         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
106
107 2019-07-20  Alexander Mikhaylenko  <exalm7659@gmail.com>
108
109         REGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
110         https://bugs.webkit.org/show_bug.cgi?id=199322
111
112         Reviewed by Michael Catanzaro.
113
114         Check ENABLE(KINETIC_SCROLLING) instead of ENABLE(ASYNC_SCROLLING) for kinetic scrolling.
115
116         * platform/PlatformWheelEvent.h:
117         * platform/generic/ScrollAnimatorGeneric.cpp:
118         (WebCore::ScrollAnimatorGeneric::handleWheelEvent):
119         * platform/gtk/PlatformWheelEventGtk.cpp:
120         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
121
122 2019-07-20  Zalan Bujtas  <zalan@apple.com>
123
124         [LFC][TFC] Introduce table formatting context.
125         https://bugs.webkit.org/show_bug.cgi?id=199979
126         <rdar://problem/53346292>
127
128         Reviewed by Antti Koivisto.
129
130         Add the basic class structure for the table formatting context.
131         https://www.w3.org/TR/CSS22/tables.html
132
133         * Sources.txt:
134         * WebCore.xcodeproj/project.pbxproj:
135         * layout/FormattingState.h:
136         (WebCore::Layout::FormattingState::isTableFormattingState const):
137         * layout/tableformatting/TableFormattingContext.cpp: Added.
138         (WebCore::Layout::TableFormattingContext::TableFormattingContext):
139         (WebCore::Layout::TableFormattingContext::layout const):
140         * layout/tableformatting/TableFormattingContext.h: Added.
141         * layout/tableformatting/TableFormattingState.cpp: Added.
142         (WebCore::Layout::TableFormattingState::TableFormattingState):
143         (WebCore::Layout::TableFormattingState::~TableFormattingState):
144         * layout/tableformatting/TableFormattingState.h: Added.
145         * layout/tableformatting/TableInvalidation.cpp: Added.
146         (WebCore::Layout::TableInvalidation::invalidate):
147         * layout/tableformatting/TableInvalidation.h: Added.
148
149 2019-07-20  Zalan Bujtas  <zalan@apple.com>
150
151         [LFC][IFC] Add support for mid-word break.
152         https://bugs.webkit.org/show_bug.cgi?id=199976
153         <rdar://problem/53337349>
154
155         Reviewed by Antti Koivisto.
156
157         Introduce leading and trailing InlineTextItem to support incoming and outgoing partial content.
158         TextUtil::split is a straight copy of SimpleLineLayout::split.
159
160         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
161         (WebCore::Layout::inlineItemWidth):
162         (WebCore::Layout::LineLayout::close):
163         (WebCore::Layout::LineLayout::placeInlineItem):
164         (WebCore::Layout::LineLayout::layout):
165         * layout/inlineformatting/InlineTextItem.cpp:
166         (WebCore::Layout::InlineTextItem::split const):
167         (WebCore::Layout::InlineTextItem::split): Deleted.
168         * layout/inlineformatting/InlineTextItem.h:
169         (WebCore::Layout::InlineTextItem::inlineBox const):
170         * layout/inlineformatting/text/TextUtil.cpp:
171         (WebCore::Layout::TextUtil::split):
172         * layout/inlineformatting/text/TextUtil.h:
173
174 2019-07-20  Zalan Bujtas  <zalan@apple.com>
175
176         [Text autosizing] Do not nuke the style on dynamicViewportSizeUpdate
177         https://bugs.webkit.org/show_bug.cgi?id=199718
178         <rdar://problem/53344961>
179
180         Reviewed by Simon Fraser.
181
182         When the page scale changes (e.g. as the result of shink to fit mode) we need to visit all the text content on the page and check whether they need to be boosted.
183         Currently we call setNeedsRecalcStyleInAllFrames() to accomplish it. Unfortunatelly setNeedsRecalcStyleInAllFrames destroys all the style information which means that the
184         subsequent styleResolve() needs to start from scratch.
185         This patch addresses this issue by directly adjusting the computed style information when text boosting is required and schedules layout accordingly. We also trigger this style adjusting
186         on a timer so that rapid dynamicViewportSizeUpdate() calls won't trigger redundant layouts.
187
188         * css/StyleResolver.cpp:
189         (WebCore::hasTextChild):
190         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
191         (WebCore::hasTextChildren): Deleted.
192         * css/StyleResolver.h:
193         * page/FrameView.h:
194         * page/Page.cpp:
195         (WebCore::Page::invalidateTextAutoSizeInAllFrames):
196         * page/Page.h:
197
198 2019-07-20  Saam Barati  <sbarati@apple.com>
199
200         [WHLSL] Make enums work
201         https://bugs.webkit.org/show_bug.cgi?id=199634
202
203         Reviewed by Robin Morisset.
204
205         This patch makes enums work. There were a couple changes needed to do this work:
206         1. In the metal codegen, we were emitting code like "EnumType.EnumValue"
207         instead of "EnumType::EnumValue".
208         
209         2. Inside the enumeration declaration AST node, we track enums in a HashMap
210         because we need to look up names of enum values in that map in parts of the
211         compiler. However, HashMap is not ordered but we were relying on the iteration
212         order of it to generate the default values of enums. E.g, in: "enum { Foo = 10, Bar }",
213         Bar should be 11. However, there was no guarantee that we iterated over Bar
214         after Foo. Instead, we just track the default values as we parse an enum
215         inside of the parser. This allows us to continue to keep using HashMap without
216         also adding an auxiliary data structure (or using more memory in some way) to
217         track the order of the enum elements.
218         
219         I've also filed a patch to do follow-up work on implementing the correct
220         operational behavior when constructing an enum from its underlying type when
221         the underlying value does not match any enum value:
222         https://bugs.webkit.org/show_bug.cgi?id=199853
223
224         Tests: webgpu/whlsl/enums-2.html
225                webgpu/whlsl/enums.html
226
227         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
228         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
229         (WebCore::WHLSL::AST::EnumerationMember::value):
230         (WebCore::WHLSL::AST::EnumerationMember::setValue): Deleted.
231         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
232         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
233         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
234         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
235         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
236         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
237         (WebCore::WHLSL::ASTDumper::visit):
238         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
239         (WebCore::WHLSL::Checker::visit):
240         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
241         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
242         (WebCore::WHLSL::Parser::parseEnumerationMember):
243         * Modules/webgpu/WHLSL/WHLSLParser.h:
244         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
245         (WebCore::WHLSL::Visitor::visit):
246
247 2019-07-19  Youenn Fablet  <youenn@apple.com>
248
249         Remote WebInspector should enable mock capture devices in UIProcess if doing it in WebProcess
250         https://bugs.webkit.org/show_bug.cgi?id=199924
251         <rdar://problem/50552067>
252
253         Reviewed by Devin Rousso.
254
255         Add necessary API to set mock capture devices override.
256         In case of desynchronization between webprocess and uiprocess, make sure to return early
257         and fail capture instead of crashing.
258
259         * inspector/InspectorClient.h:
260         (WebCore::InspectorClient::setMockCaptureDevicesEnabled):
261         * inspector/agents/InspectorPageAgent.cpp:
262         (WebCore::InspectorPageAgent::disable):
263         (WebCore::InspectorPageAgent::overrideSetting):
264         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
265
266 2019-07-19  Andy Estes  <aestes@apple.com>
267
268         [Apple Pay] Log less in PaymentCoordinator::shouldEnableApplePayAPIs()
269         https://bugs.webkit.org/show_bug.cgi?id=199958
270
271         Reviewed by Tim Horton.
272
273         Only log when APIs are disabled due to user scripts.
274
275         * Modules/applepay/PaymentCoordinator.cpp:
276         (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
277
278 2019-07-19  Dean Jackson  <dino@apple.com>
279
280         Add a menu item to toggle between showing and hiding link previews
281         https://bugs.webkit.org/show_bug.cgi?id=199940
282         <rdar://problem/53032288>
283
284         Reviewed by Beth Dakin.
285
286         New strings for Show/Hide Link Previews.
287
288         * en.lproj/Localizable.strings:
289
290 2019-07-19  Antoine Quint  <graouts@apple.com>
291
292         Links stop working after long-pressing a link (WK1)
293         https://bugs.webkit.org/show_bug.cgi?id=199952
294         <rdar://problem/52291860>
295
296         Reviewed by Wenson Hsieh.
297
298         Test: fast/events/touch/ios/click-after-long-press.html
299
300         When EventHandler::tryToBeginDragAtPoint() is called, we must reset m_mousePressed to false so that
301         WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed() when we would
302         process the next tap after a drag interaction.
303
304         * page/ios/EventHandlerIOS.mm:
305         (WebCore::EventHandler::tryToBeginDragAtPoint):
306
307 2019-07-19  Sihui Liu  <sihui_liu@apple.com>
308
309         IndexedDB: error in starting version change transaction may be neglected
310         https://bugs.webkit.org/show_bug.cgi?id=199818
311         <rdar://problem/52925738>
312
313         Reviewed by Brady Eidson.
314
315         For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread 
316         before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the 
317         DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
318         marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange, 
319         m_databaseInfo could become nullptr.
320
321         To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the 
322         SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of 
323         ungradeneeded event is dispatched to the IDBRequest.
324
325         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
326         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
327         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
328         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
329         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
330         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
331         * Modules/indexeddb/server/UniqueIDBDatabase.h:
332
333 2019-07-19  Zalan Bujtas  <zalan@apple.com>
334
335         [LFC][IFC] Add partial content handling
336         https://bugs.webkit.org/show_bug.cgi?id=199930
337
338         Reviewed by Antti Koivisto.
339
340         Move the actual inline item placement to a dedicated functions. This enables us to
341         construct a dedicated InlineItem for the partial content and pass it in to this function.
342
343         <span>The quick brown fox jumps over the lazy dog</span> <- inline content
344         [The][ ][quick][ ][brown][ ][fox][ ][jumps][ ][over][ ][the][ ][lazy][ ][dog] <- InlineItems
345
346         Line breaking:
347         [The][ ][qu]
348         [ick] <- Partial InlineItem (position: 6 length: 3) from [quick] (position: 4 length: 5)
349
350         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
351         (WebCore::Layout::LineLayout::close):
352         (WebCore::Layout::LineLayout::placeInlineItem):
353         (WebCore::Layout::LineLayout::layout):
354         (WebCore::Layout::LineInput::LineInput):
355         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
356         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
357         * layout/inlineformatting/InlineTextItem.cpp:
358         (WebCore::Layout::InlineTextItem::split):
359         * layout/inlineformatting/InlineTextItem.h:
360
361 2019-07-19  Charlie Turner  <cturner@igalia.com>
362
363         [GStreamer] Flush get_range calls during PAUSED->READY in WebKitWebSource
364         https://bugs.webkit.org/show_bug.cgi?id=199934
365
366         Reviewed by Xabier Rodriguez-Calvar.
367
368         Unit testing not applicable.
369
370         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
371         (webKitWebSrcChangeState): A well-behaved element should unblock streaming threads
372         during a PAUSED->READY transition, so do that here.
373
374 2019-07-19  Rob Buis  <rbuis@igalia.com>
375
376         Remove some unneeded code in MathOperator
377         https://bugs.webkit.org/show_bug.cgi?id=199935
378
379         Reviewed by Frédéric Wang.
380
381         The initialize method is unneeded since the member
382         variables all use default initialization.
383
384         No new tests, not changing behavior.
385
386         * rendering/mathml/MathOperator.cpp:
387         (WebCore::MathOperator::MathOperator):
388         (WebCore::MathOperator::GlyphAssemblyData::initialize): Deleted.
389
390 2019-07-18  Antoine Quint  <graouts@apple.com>
391
392         Enable simulated mouse events quirk for soundcloud.com
393         https://bugs.webkit.org/show_bug.cgi?id=199908
394         <rdar://problem/52915981>
395
396         Reviewed by Brent Fulgham.
397
398         Scrubbing on soundcloud.com relies on mouse events alone when displaying on iPad with the desktop UA string.
399         Opting into the simulated mouse events quirk makes scrubbing work and we also ensure that page scrolling is
400         disabled as a result of scrubbing by returning true in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented().
401
402         Also making a drive-by fix in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented() to use a reference
403         instead of a pointer when downcasting a null-checked pointer.
404
405         * page/Quirks.cpp:
406         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
407         (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
408
409 2019-07-18  Per Arne Vollan  <pvollan@apple.com>
410
411         Prewarm font cache with more fonts
412         https://bugs.webkit.org/show_bug.cgi?id=199283
413
414         Reviewed by Myles C. Maxfield.
415
416         Initialize the list of families requiring system fallback in the prewarming information struct, since
417         this was part of the original, approved patch, and is needed for the performance improvement.
418
419         No new tests, covered by existing tests.
420
421         * platform/graphics/cocoa/FontCacheCoreText.cpp:
422         (WebCore::fontFamiliesForPrewarming):
423         (WebCore::FontCache::prewarmGlobally):
424
425 2019-07-18  Ryan Haddad  <ryanhaddad@apple.com>
426
427         Unreviewed, rolling out r247531.
428
429         Caused multiple IndexedDB layout test crashes.
430
431         Reverted changeset:
432
433         "IndexedDB: error in starting version change transaction may
434         be neglected"
435         https://bugs.webkit.org/show_bug.cgi?id=199818
436         https://trac.webkit.org/changeset/247531
437
438 2019-07-18  Antoine Quint  <graouts@apple.com>
439
440         Ensure Quirks::shouldDispatchSimulatedMouseEvents() works for all Google Maps and Amazon domains
441         https://bugs.webkit.org/show_bug.cgi?id=199904
442         <rdar://problem/53250104>
443
444         Reviewed by Dean Jackson.
445
446         Use topPrivatelyControlledDomain() to determine whether the URL is a Google or Amazon domain so as to apply
447         Google Maps and Amazon quirks to all the various domain names used.
448
449         * page/Quirks.cpp:
450         (WebCore::Quirks::isAmazon const):
451         (WebCore::Quirks::isGoogleMaps const):
452         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
453         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
454         * page/Quirks.h:
455
456 2019-07-18  Per Arne Vollan  <pvollan@apple.com>
457
458         Crash under WebPage::boundaryEventOccurred
459         https://bugs.webkit.org/show_bug.cgi?id=199907
460
461         Reviewed by Chris Fleizach.
462
463         Add null pointer checks.
464
465         No new tests, since I have not been able to reproduce this in a test.
466
467         * Modules/speech/SpeechSynthesis.cpp:
468         (WebCore::SpeechSynthesis::didStartSpeaking):
469         (WebCore::SpeechSynthesis::didFinishSpeaking):
470         (WebCore::SpeechSynthesis::didPauseSpeaking):
471         (WebCore::SpeechSynthesis::didResumeSpeaking):
472         (WebCore::SpeechSynthesis::speakingErrorOccurred):
473         (WebCore::SpeechSynthesis::boundaryEventOccurred):
474
475 2019-07-18  Antoine Quint  <graouts@apple.com>
476
477         [Pointer Events] The button and buttons properties are incorrect on iOS
478         https://bugs.webkit.org/show_bug.cgi?id=199910
479         <rdar://problem/52778374>
480
481         Reviewed by Dean Jackson.
482
483         The button and buttons properties were always set to 0 on iOS. We now use the correct values such that
484         button is always 0 except for "pointermove" where it's -1, and "buttons" is 1 as long as the pointer is
485         in contact with the touch surface.
486
487         Tests: pointerevents/ios/pointer-event-button-and-buttons-pointer-cancel.html
488                pointerevents/ios/pointer-event-button-and-buttons.html
489
490         * dom/ios/PointerEventIOS.cpp:
491         (WebCore::buttonForType):
492         (WebCore::buttonsForType):
493         (WebCore::PointerEvent::PointerEvent):
494
495 2019-07-18  Antoine Quint  <graouts@apple.com>
496
497         REGRESSION: Unable to enable simulated mouse events using the runtime flag
498         https://bugs.webkit.org/show_bug.cgi?id=199909
499         <rdar://problem/53254895>
500
501         Reviewed by Dean Jackson.
502
503         The fix for wkb.ug/199508 (r247152) broke the ability enable simulated mouse events using the runtime flag.
504         We now add a check for the flag in Quirks::shouldDispatchSimulatedMouseEvents() so that the runtime flag
505         overrides the content of that function. This is more practical and allows for a quick override using the flag.
506
507         Additionally, we need only call shouldDispatchSimulatedMouseEvents() in simulatedMouseEventTypeForTarget() since
508         that function already calls needsQuirks().
509
510         * dom/EventNames.h:
511         (WebCore::EventNames::isTouchRelatedEventType const):
512         * dom/Node.cpp:
513         (WebCore::Node::moveNodeToNewDocument):
514         * page/Quirks.cpp:
515         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
516         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
517
518 2019-07-18  Antoine Quint  <graouts@apple.com>
519
520         REGRESSION: Panning on an Amazon product image scrolls the page on iPadOS
521         https://bugs.webkit.org/show_bug.cgi?id=199905
522         <rdar://problem/49124529>
523
524         Reviewed by Dean Jackson.
525
526         Amazon product pages include images that the user can touch and pan to show zoomed details in a side image. This
527         currently works on iPadOS thanks to the dispatch of simulated "mousemove" events on the product image, but the site
528         doesn't call preventDefault() when handling those events as it wasn't necessary for macOS.
529
530         We add a new quirk that will indicate that a given element is such a product image.
531
532         * page/Quirks.cpp:
533         (WebCore::Quirks::isAmazon const):
534         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
535         (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
536         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
537         * page/Quirks.h:
538
539 2019-07-18  Youenn Fablet  <youenn@apple.com>
540
541         Make sure to set kCTFontFallbackOptionAttribute to kCTFontFallbackOptionSystem for system fonts
542         https://bugs.webkit.org/show_bug.cgi?id=199769
543         <rdar://problem/49390297>
544
545         Reviewed by Myles C. Maxfield.
546
547         When getting a system font, set the appropriate attribute so that it
548         does not fallback to a user initiated font.
549         Add an ASSERT that checks that the font in use is not a user font if
550         policy is to not use user installed fonts.
551
552         Tests: fast/text/user-installed-fonts/extended-character-with-user-font.html
553                fast/text/user-installed-fonts/extended-character.html
554
555         * platform/graphics/Font.h:
556         * platform/graphics/FontCascadeFonts.cpp:
557         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
558         * platform/graphics/cocoa/FontCacheCoreText.cpp:
559         (WebCore::preparePlatformFont):
560         (WebCore::FontDatabase::singletonAllowingUserInstalledFonts):
561         (WebCore::FontDatabase::singletonDisallowingUserInstalledFonts):
562         (WebCore::addAttributesForInstalledFonts):
563         (WebCore::addAttributesForWebFonts):
564         (WebCore::installedFontMandatoryAttributes):
565         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
566         (WebCore::Font::isUserInstalledFont const):
567
568 2019-07-18  Zalan Bujtas  <zalan@apple.com>
569
570         [LFC][IFC] InlineFormattingContext::LineLayout::placeInlineItems is getting too complex.
571         https://bugs.webkit.org/show_bug.cgi?id=199898
572         <rdar://problem/53235958>
573
574         Reviewed by Antti Koivisto.
575
576         It's time to restructure LineLayout::placeInlineItems to be able to expand it further.
577         Introduce the LineLayout class. This class is responsible to place the inline items on the current line.
578         (Rename InlineFormattingContext::lineLayout -> InlineFormattingContext::InlineLayout and
579         use Line::InitialConstraints in LineInput)
580
581         * layout/inlineformatting/InlineFormattingContext.cpp:
582         (WebCore::Layout::InlineFormattingContext::layout const):
583         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
584         * layout/inlineformatting/InlineFormattingContext.h:
585         (WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const): Deleted.
586         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
587         (WebCore::Layout::inlineItemWidth):
588         (WebCore::Layout::LineLayout::layoutState const):
589         (WebCore::Layout::LineLayout::UncommittedContent::runs):
590         (WebCore::Layout::LineLayout::UncommittedContent::isEmpty const):
591         (WebCore::Layout::LineLayout::UncommittedContent::size const):
592         (WebCore::Layout::LineLayout::UncommittedContent::width const):
593         (WebCore::Layout::LineLayout::UncommittedContent::add):
594         (WebCore::Layout::LineLayout::UncommittedContent::reset):
595         (WebCore::Layout::LineLayout::LineLayout):
596         (WebCore::Layout::LineLayout::commitPendingContent):
597         (WebCore::Layout::LineLayout::close):
598         (WebCore::Layout::LineLayout::layout):
599         (WebCore::Layout::LineInput::LineInput):
600         (WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
601         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
602         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
603         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
604         (WebCore::Layout::InlineFormattingContext::InlineLayout::alignRuns const):
605         (WebCore::Layout::UncommittedContent::runs): Deleted.
606         (WebCore::Layout::UncommittedContent::isEmpty const): Deleted.
607         (WebCore::Layout::UncommittedContent::size const): Deleted.
608         (WebCore::Layout::UncommittedContent::width const): Deleted.
609         (WebCore::Layout::UncommittedContent::add): Deleted.
610         (WebCore::Layout::UncommittedContent::reset): Deleted.
611         (WebCore::Layout::LineInput::HorizontalConstraint::HorizontalConstraint): Deleted.
612         (WebCore::Layout::InlineFormattingContext::LineLayout::LineLayout): Deleted.
613         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const): Deleted.
614         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): Deleted.
615         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const): Deleted.
616         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const): Deleted.
617         (WebCore::Layout::InlineFormattingContext::LineLayout::alignRuns const): Deleted.
618         * layout/inlineformatting/InlineLine.cpp:
619         (WebCore::Layout::Line::Line):
620         * layout/inlineformatting/InlineLine.h:
621
622 2019-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
623
624         [GTK] MOUSE_CURSOR_SCALE is not implemented
625         https://bugs.webkit.org/show_bug.cgi?id=109469
626
627         Reviewed by Darin Adler.
628
629         Use gdk_cursor_new_from_surface() instead of gdk_cursor_new_from_pixbuf() to avoid the surface to pixbuf
630         conversion.
631
632         * platform/gtk/CursorGtk.cpp:
633         (WebCore::createCustomCursor):
634
635 2019-07-17  Chris Dumez  <cdumez@apple.com>
636
637         Prewarm local storage in the NetworkProcess to reduce WebContent process hangs
638         https://bugs.webkit.org/show_bug.cgi?id=199879
639         <rdar://problem/53217757>
640
641         Reviewed by Ryosuke Niwa.
642
643         When JS accesses window.localStorage for the first time, we end up doing a
644         synchronous IPC to the network process to pull in all items in the local
645         storage for the origin. If the network process does not have this data in
646         memory, it has to read it from a database on disk, which may take a significant
647         amount of time and hang the WebContent process during this time.
648
649         To alleviate this problem, this patch introduces prewarming on the local storage
650         in the network process when loading a given origin in the WebContent process.
651         This way, in most cases, when the JS accesses window.localStorage for the first
652         time, the synchronous IPC to the network process returns much faster (measured
653         50-100ms for a very large database, down from 250-300ms), as it only needs to
654         IPC the data over, without the need to fetch it from disk.
655
656         As a safety net to avoid excessive prewarming, we currently prewarm at most 5
657         security origins per page load.
658
659         * loader/DocumentLoader.cpp:
660         (WebCore::DocumentLoader::commitData):
661         * page/DOMWindow.cpp:
662         (WebCore::DOMWindow::prewarmLocalStorageIfNecessary):
663         * page/DOMWindow.h:
664         * page/Frame.cpp:
665         (WebCore::Frame::didPrewarmLocalStorage):
666         (WebCore::Frame::mayPrewarmLocalStorage const):
667         * page/Frame.h:
668         * storage/Storage.cpp:
669         (WebCore::Storage::prewarm):
670         * storage/Storage.h:
671         * storage/StorageArea.h:
672         (WebCore::StorageArea::prewarm):
673
674 2019-07-17  Robin Morisset  <rmorisset@apple.com>
675
676         [WHLSL] The lexer should not choke on a single '/'
677         https://bugs.webkit.org/show_bug.cgi?id=199886
678
679         Reviewed by Myles Maxfield.
680
681         The bug is trivial: just recognize that a single '/' without a '*' or '/' afterwards is not the beginning of a comment.
682
683         While investigating this bug, I also found that part of the parser fails to properly propagate errors, so I fixed it.
684
685         New test in LayoutTests/webgpu/whlsl/float-math.html
686         I also added a new flag to WHLSLPrepare.cpp. It can be used to parse the full standard library (this is how I found this bug in the first place).
687
688         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
689         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
690         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
691         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
692         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
693         (WebCore::WHLSL::prepareShared):
694         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
695         (WebCore::WHLSL::includeStandardLibrary):
696         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h:
697
698 2019-07-17  Simon Fraser  <simon.fraser@apple.com>
699
700         Unreviewed build fix after r247549.
701
702         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
703
704 2019-07-17  Robin Morisset  <rmorisset@apple.com>
705
706         [WHLSL] Remove traps from the compiler
707         https://bugs.webkit.org/show_bug.cgi?id=195811
708         <rdar://problem/50746299>
709
710         Reviewed by Myles Maxfield.
711
712         Remove the Trap statement from the language, see https://github.com/gpuweb/WHLSL/issues/301.
713
714         No new tests, as this part of the language was already untested, and we are removing it, not adding anything.
715
716         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
717         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
718         (WebCore::WHLSL::AST::Statement::isSwitchStatement const):
719         * Modules/webgpu/WHLSL/AST/WHLSLTrap.h: Removed.
720         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
721         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
722         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
723         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
724         (WebCore::WHLSL::Token::typeName):
725         (WebCore::WHLSL::Lexer::recognizeKeyword):
726         * Modules/webgpu/WHLSL/WHLSLLexer.h:
727         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
728         (WebCore::WHLSL::Parser::parseStatement):
729         * Modules/webgpu/WHLSL/WHLSLParser.h:
730         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
731         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
732         (WebCore::WHLSL::Visitor::visit):
733         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
734         * WebCore.xcodeproj/project.pbxproj:
735
736 2019-07-17  Robin Morisset  <rmorisset@apple.com>
737
738         [WHLSL] checkRecursiveType should not have exponential complexity.
739         https://bugs.webkit.org/show_bug.cgi?id=199835
740
741         Reviewed by Myles Maxfield.
742
743         The change is very similar to that in https://bugs.webkit.org/show_bug.cgi?id=199688.
744         Just keep track of which types have already been visited, and don't visit them again.
745
746         No new tests as there is no intended functional change.
747
748         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
749         (WebCore::WHLSL::RecursiveTypeChecker::visit):
750         (WebCore::WHLSL::checkRecursiveTypes):
751
752 2019-07-17  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
753
754         Add missing #include's
755         https://bugs.webkit.org/show_bug.cgi?id=199856
756
757         Reviewed by Simon Fraser.
758
759         The missing headers were found during development when unified sources changed.
760
761         No new tests required. Adding #include's only.
762
763         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
764         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
765         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
766         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
767         * Modules/webgpu/WebGPUCommandEncoder.cpp:
768
769 2019-07-17  Ryosuke Niwa  <rniwa@webkit.org>
770
771         Add inputmode to the feature status page
772         https://bugs.webkit.org/show_bug.cgi?id=199884
773
774         Reviewed by Wenson Hsieh.
775
776         Added as supported.
777
778         * features.json:
779
780 2019-07-17  Antoine Quint  <graouts@apple.com>
781
782         Disable Pointer Events prior to watchOS 6
783         https://bugs.webkit.org/show_bug.cgi?id=199890
784         <rdar://problem/53206113>
785
786         Reviewed by Dean Jackson.
787
788         * Configurations/FeatureDefines.xcconfig:
789
790 2019-07-17  Antoine Quint  <graouts@apple.com>
791
792         Unable to bring up custom media controls on iOS for video.sina.cn
793         https://bugs.webkit.org/show_bug.cgi?id=199889
794         <rdar://problem/51883919>
795
796         Reviewed by Dean Jackson.
797
798         Videos on video.sina.cn by default have the "controls" attribute and are set not to autoplay. This means that the original state
799         of the media controls are set to show the built-in media controls and also show the prominent play button to begin playback. The
800         display of the play button also requires a tap gesture recognizer, which calls preventDefault() when the "touchend" is received
801         to prevent double-tap-to-zoom, but also has the side-effect of preventing a "click" event from being dispatched for a tap.
802
803         The video.sina.cn code would eventually remove the "controls" attribute, which would make the built-in media controls not visible,
804         but still participate in hit-testing because we keep the shadow DOM around in order to potentially show the Airplay or picture-in-picture
805         placards. Additionally, we wouldn't disable the tap gesture recognizer when the "controls" attribute was removed.
806
807         We now ensure that both gesture recognizers used by iOS inline media controls are only enabled when media controls are visible.
808
809         Test: media/modern-media-controls/media-controller/ios/media-controller-allows-click-over-video-with-no-controls.html
810
811         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
812         (IOSInlineMediaControls.prototype.set showsStartButton):
813         (IOSInlineMediaControls.prototype.get visible):
814         (IOSInlineMediaControls.prototype.set visible):
815         (IOSInlineMediaControls.prototype._updateGestureRecognizers):
816         (IOSInlineMediaControls.prototype._tapGestureRecognizerStateDidChange):
817         (IOSInlineMediaControls.prototype._pinchGestureRecognizerStateDidChange):
818
819 2019-07-17  Christopher Reid  <chris.reid@sony.com>
820
821         Bytecode cache should use FileSystem
822         https://bugs.webkit.org/show_bug.cgi?id=199759
823
824         Reviewed by Yusuke Suzuki.
825
826         * platform/SharedBuffer.cpp:
827
828 2019-07-17  Zalan Bujtas  <zalan@apple.com>
829
830         Unable to tap buttons at top of Wells Fargo app’s Payees screen
831         https://bugs.webkit.org/show_bug.cgi?id=199846
832         <rdar://problem/48112220>
833
834         Reviewed by Simon Fraser.
835
836         This patch restores the stop-before-reaching-the-body heuristics for the approximate node finding feature only.
837         (WebFrame::approximateNodeAtViewportLocation mistakenly relied on this odd quirk of nodeRespondingToClickEvents.)
838
839         * page/Frame.h:
840         * page/ios/FrameIOS.mm:
841         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
842
843 2019-07-17  Simon Fraser  <simon.fraser@apple.com>
844
845         [iOS WK2] Avoid lots of compositing backing store for offscreen position:fixed descendants
846         https://bugs.webkit.org/show_bug.cgi?id=199819
847         rdar://problem/51977416
848
849         Reviewed by Zalan Bujtas.
850
851         There was code to ensure that position:fixed layers and their descendants don't have their
852         backing store detached (thrown away to save memory when offscreen), since that can trigger
853         flashing when async scrolling moves layers in and out of the visual viewport.
854
855         However, some pages have many descendant layers of positon:fixed which entrain backing
856         store, because, for example, they have a stack of translated-offscreen menu elements inside
857         a fixed header, and those elements may composite because of overflow:scroll.
858
859         To avoid using too much memory on such pages, allow backing store detachment for fixed
860         layers that are outside the layout viewport. Add a flag to RenderLayer that's set for layers
861         which are fixed, or descendants of fixed, and consult that flag in
862         updateAllowsBackingStoreDetaching(). The logic there is similar to
863         RenderLayerCompositor::requiresCompositingForPosition().
864         
865         I considered allowing all position:fixed to composite (since this patch would keep most of
866         the memory saving), but historically we've avoided compositing out-of-viewport
867         position:fixed because it's quite common to have them with negative z-index, and compositing
868         those has significant compositing knock-on effects.
869         
870         GraphicsLayer flushing no longer needs to track the viewport-constrained status of layers,
871         so remove that code.
872         
873         This patch removes backing-store pinning for sticky layers.
874         scrolling/ios/reconcile-layer-position-recursive.html then revealed a bug in
875         ScrollingStateStickyNode::reconcileLayerPositionForViewportRect(), which was assuming that
876         the sticky element was scrolled by the page, causing a bad layer position to get sync'd onto
877         the layer. Fixed by copying code from ScrollingTreeStickyNode that is smarter about
878         computing layer positions.
879         
880         This patch fixes jetsams on kmart.com.au in iOS 13 beta.
881
882         Test: compositing/layer-creation/fixed-position-descendants-out-of-view.html
883
884         * page/scrolling/ScrollingStateStickyNode.cpp:
885         (WebCore::ScrollingStateStickyNode::computeLayerPosition const):
886         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
887         * page/scrolling/ScrollingStateStickyNode.h:
888         * platform/graphics/GraphicsLayer.h:
889         (WebCore::GraphicsLayer::setAllowsBackingStoreDetaching):
890         (WebCore::GraphicsLayer::allowsBackingStoreDetaching const):
891         (WebCore::GraphicsLayer::setIsViewportConstrained): Deleted.
892         (WebCore::GraphicsLayer::isViewportConstrained const): Deleted.
893         (WebCore::GraphicsLayer::setCanDetachBackingStore): Deleted.
894         (WebCore::GraphicsLayer::canDetachBackingStore const): Deleted.
895         * platform/graphics/ca/GraphicsLayerCA.cpp:
896         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
897         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
898         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
899         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
900         (WebCore::GraphicsLayerCA::updateCoverage):
901         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
902         * platform/graphics/ca/GraphicsLayerCA.h:
903         * rendering/RenderLayer.cpp:
904         (WebCore::RenderLayer::RenderLayer):
905         (WebCore::RenderLayer::updateLayerPositions):
906         (WebCore::outputPaintOrderTreeLegend):
907         (WebCore::outputPaintOrderTreeRecursive):
908         * rendering/RenderLayer.h:
909         * rendering/RenderLayerBacking.cpp:
910         (WebCore::RenderLayerBacking::updateAllowsBackingStoreDetaching):
911         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
912         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole): Deleted.
913         * rendering/RenderLayerBacking.h:
914         * rendering/RenderLayerCompositor.cpp:
915         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
916         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
917         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
918         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
919
920 2019-07-17  Chris Dumez  <cdumez@apple.com>
921
922         Avoid unnecessary copy of monitors under DisplayRefreshMonitorManager::displayWasUpdated()
923         https://bugs.webkit.org/show_bug.cgi?id=199847
924
925         Reviewed by Said Abou-Hallawa.
926
927         There is always one one monitor in m_monitors for a given displayID so there is
928         no need to copy the monitors inside DisplayRefreshMonitorManager::displayWasUpdated()
929         and no need to iterate over all of them. This patch also factors a bit differently
930         so that it becomes more obvious.
931
932         * platform/graphics/DisplayRefreshMonitorManager.cpp:
933         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
934         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
935         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
936         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
937         (WebCore::DisplayRefreshMonitorManager::findMonitorForDisplay const):
938         (WebCore::DisplayRefreshMonitorManager::monitorForDisplay const):
939         * platform/graphics/DisplayRefreshMonitorManager.h:
940
941 2019-07-17  Sihui Liu  <sihui_liu@apple.com>
942
943         IndexedDB: error in starting version change transaction may be neglected
944         https://bugs.webkit.org/show_bug.cgi?id=199818
945         <rdar://problem/52925738>
946
947         Reviewed by Brady Eidson.
948
949         For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread 
950         before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the 
951         DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
952         marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange, 
953         m_databaseInfo could become nullptr.
954
955         To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the 
956         SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of 
957         ungradeneeded event is dispatched to the IDBRequest.
958
959         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
960         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
961         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
962         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
963         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
964         * Modules/indexeddb/server/UniqueIDBDatabase.h:
965
966 2019-07-17  Daniel Bates  <dabates@apple.com>
967
968         Typing into a cell in a Google Sheet lags behind by one character
969         https://bugs.webkit.org/show_bug.cgi?id=199587
970         <rdar://problem/51616845>
971
972         Reviewed by Brent Fulgham.
973
974         Add a Google Sheets quirk. Put all DOM timers scheduled from keydown and keypress event listeners
975         into a holding tank. The timers continue to tick, but are barred from executing their action until
976         the next text insertion or deletion or 32 ms (on device) have elapsed, whichever is sooner. We only
977         allocate a holding tank once per document, only if the quirk is active, and this allocation is done
978         when the document schedules a timer on keydown or keypress. The holding tank lives for the lifetime
979         of the document.
980
981         The story behind the quirk:
982
983         On keypress Google Sheets schedules timers and expects that a DOM update will occur (i.e. text
984         will be inserted or deleted) within the same event loop iteration as the dispatched keypress. The
985         UI Events spec. [1] makes no such guarantee of when a DOM update must occur in relation to the keypress
986         event. It could happen in the same event loop iteration as the key press (as Google expects), the
987         next iteration, 500ms later, 2 minutes later, etc. What the spec does guarantee is that by the time
988         a DOM input event is dispatched that the DOM will be updated. And this is the solution to the problem
989         Google Sheets is trying to solve, but is doing so using pre-IE 9 technology (though similar
990         functionality was available via onpropertychange in IE < 9).
991
992         See also <https://github.com/w3c/uievents/issues/238>, which is tracking a spec. text update for
993         this quirk.
994
995         Test: fast/events/ios/dom-update-on-keydown-quirk.html
996
997         [1] <https://w3c.github.io/uievents/> (Editor's Draft, 14 October 2018)
998
999         * SourcesCocoa.txt:
1000         * WebCore.xcodeproj/project.pbxproj:
1001         Add some files to the project.
1002
1003         * dom/Document.cpp:
1004         (WebCore::Document::domTimerHoldingTank): Added.
1005         * dom/Document.h:
1006         (WebCore::Document::domTimerHoldingTankIfExists): Added.
1007
1008         * page/DOMTimer.cpp:
1009         (WebCore::DOMTimer::install): Put the newly instantiated timer into the holding tank.
1010         (WebCore::DOMTimer::removeById): Remove the timer from the holding tank.
1011         (WebCore::DOMTimer::fired): Check if the timer is in the holding tank. If it is and it is a one-
1012         shot timer then schedule it for the next event loop iteration. If it's a repeating timer just
1013         let it continue ticking. Otherwise, do what we no now and execute the timer's action. The reason
1014         we do not suspend timers in the holding tank is because:
1015             1. Far out timers (Google Sheets registers timers as far out as 5 minutes!) are not penalized.
1016             Though smart supension logic could avoid this. See (3).
1017
1018             2. Empirical observations indicate that the keyboard will perform the insertion or deletion
1019             reasonably quickly (not the same event loop iteration as the keydown, but within two iterations out).
1020             So, the timers in the holding tank are short-lived.
1021
1022             3. Simplifies the code. There is no need to keep additional bookkeeping to track multiple timer
1023             suspension reasons (timers currently can only have one suspension reason) or alternatively defer
1024             scheduling a timer until a later time and computing a new "fair" firing time when scheduled.
1025         * page/EventHandler.cpp:
1026         (WebCore::EventHandler::internalKeyEvent): Place a token on the stack to put all DOM timers
1027         scheduled on keydown and keypress into the holding tank if the quirk is enabled.
1028         * page/Quirks.cpp:
1029         (WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const): Added.
1030         * page/Quirks.h:
1031         * page/Settings.yaml: Added setting so that this quirk can be enabled from a layout test. This setting
1032         also lets us enable the quirk for all sites or for certain third-party apps if desired.
1033         * page/ios/DOMTimerHoldingTank.cpp: Added.
1034         (WebCore::DOMTimerHoldingTank::DOMTimerHoldingTank):
1035         (WebCore::DOMTimerHoldingTank::add):
1036         (WebCore::DOMTimerHoldingTank::remove):
1037         (WebCore::DOMTimerHoldingTank::contains):
1038         (WebCore::DOMTimerHoldingTank::removeAll):
1039         (WebCore::DOMTimerHoldingTank::stopExceededMaximumHoldTimer):
1040         * page/ios/DOMTimerHoldingTank.h: Added.
1041         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
1042         (WebCore::DeferDOMTimersForScope::~DeferDOMTimersForScope):
1043         (WebCore::DeferDOMTimersForScope::isDeferring):
1044
1045 2019-07-17  Darin Adler  <darin@apple.com>
1046
1047         No need for isURLAllowed function in Frame
1048         https://bugs.webkit.org/show_bug.cgi?id=120266
1049
1050         Reviewed by Alex Christensen.
1051
1052         * css/SelectorCheckerTestFunctions.h:
1053         (WebCore::matchesFullScreenPseudoClass): Use is<> instead of
1054         the isFrameElementBase function. Also updated includes and spacing.
1055
1056         * dom/Document.cpp:
1057         (WebCore::Document::resolveStyle): Shortened an old, long comment
1058         that happened to mention HTMLFrameElementBase::isURLAllowed by name.
1059
1060         * dom/Element.h: Deleted isFrameElementBase.
1061
1062         * html/HTMLAppletElement.cpp:
1063         (WebCore::HTMLAppletElement::updateWidget): Tweaked comment.
1064
1065         * html/HTMLBodyElement.cpp:
1066         (WebCore::HTMLBodyElement::insertedIntoAncestor): Moved comment from
1067         here to didFinishInsertingNode, since the code it's talking about is there.
1068         Also got rid of unnecessary local variable.
1069         (WebCore::HTMLBodyElement::didFinishInsertingNode): Moved comment here
1070         and elaborated a bit. Also changed the code to copy margin attributes in a
1071         simpler way without requiring special getter functions. There is a slight
1072         behavior change here, but seems unlikely to affect any websites or tests.
1073         Would be good to add better test coverage, which I think should be done
1074         when fixing the problems described in the FIXME.
1075
1076         * html/HTMLEmbedElement.cpp:
1077         (WebCore::HTMLEmbedElement::updateWidget): allowedToLoadFrameURL -> canLoadURL
1078         Also Tweaked comments.
1079
1080         * html/HTMLFrameElement.cpp:
1081         (WebCore::HTMLFrameElement::rendererIsNeeded): isURLAllowed -> canLoad
1082
1083         * html/HTMLFrameElementBase.cpp:
1084         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase): Removed initial
1085         values for no-longer-needed data members.
1086
1087         (WebCore::HTMLFrameElementBase::canLoadScriptURL const): Renamed from
1088         isURLAllowed. Also refactored so it now calls canLoadURL.
1089         (WebCore::HTMLFrameElementBase::canLoad const): Renamed from isURLAllowed.
1090         Also added FIXME comments about multiple ways that this code incorrectly
1091         handles the empty string. Might inspire some tests and future fixes.
1092         (WebCore::HTMLFrameElementBase::canLoadURL const): Renamed from isURLAllowed.
1093         Added an overload that takes a relative URL string largely to make this
1094         more parallel with the similar code in HTMLPlugInImageElement. Refactored
1095         to call canAddSubframe and isProhibitedSelfReference, removing the need
1096         to call Frame::isURLAllowed.
1097         (WebCore::HTMLFrameElementBase::openURL): isURLAllowed -> canLoad
1098         (WebCore::HTMLFrameElementBase::parseAttribute): Removed unneeded code
1099         to parse marginwidth, marginheight, and scrolling, which are now done
1100         as needed instead. Might have to add code back if we ever add code to
1101         make these cause dynamic updates when changed, but that was not the
1102         behavior of the existing code.
1103         (WebCore::HTMLFrameElementBase::scrollingMode const): Changed to call
1104         attributeWithoutSynchronization rather than reading from a data member.
1105
1106         * html/HTMLFrameElementBase.h: Moved scrollingMode into the .cpp file.
1107         Removed marginWidth and marginHeight since they are no longer called.
1108         Made canContainRangeEndPoint override be private. Renamed isURLAllowed
1109         to canLoad/canLoadScriptURL/canLoadURL. Removed unneeded isFrameElementBase
1110         since is<HTMLFrameElementBase> already works without it. Removed unneeded
1111         data members m_scrolling, m_marginWidth, and m_marginHeight.
1112
1113         * html/HTMLFrameOwnerElement.cpp:
1114         (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement): Moved initialization
1115         of m_contentFrame and m_sandboxFlags to the header.
1116         (WebCore::HTMLFrameOwnerElement::clearContentFrame): 0 -> nullptr
1117         (WebCore::HTMLFrameOwnerElement::canAddSubframe const): Added. Code was moved
1118         here from multiple functions that enforced the subframe count limit.
1119         (WebCore::HTMLFrameOwnerElement::isProhibitedSelfReference const): Added.
1120         Moved code here from Frame::isURLAllowed so it's easy to use as needed.
1121
1122         * html/HTMLFrameOwnerElement.h: Renamed isURLAllowed to canLoadScriptURL.
1123         Added protected canAddSubframe and isProhibitedSelfReference functions.
1124         Initialized the data members here.
1125
1126         * html/HTMLIFrameElement.cpp:
1127         (WebCore::HTMLIFrameElement::sandbox): Added braces for multi-line if statement.
1128         (WebCore::HTMLIFrameElement::parseAttribute): Removed unneeded storage of the
1129         allow attribute value. Added missing code to invalidate m_featurePolicy when
1130         the allow attribute changes. This could change behavior, but unlikely to affect
1131         any websites of tests. Would be good to add a test for this.
1132         (WebCore::HTMLIFrameElement::rendererIsNeeded): isURLAllowed -> canLoad. Also
1133         reordered the code to be more efficient for display: none (why not?).
1134         (WebCore::HTMLIFrameElement::featurePolicy const): Use attributeWithoutSynchronization
1135         to read the allow attribute rather than using a data member.
1136
1137         * html/HTMLIFrameElement.h: Removed the unneeded allow function member and
1138         m_allow data member since DOM reflection takes care of the function and the
1139         featurePolicy function can get the attribute without a data member.
1140
1141         * html/HTMLObjectElement.cpp:
1142         (WebCore::HTMLObjectElement::updateWidget): allowedToLoadFrameURL -> canLoadURL
1143         Also tweaked comments.
1144
1145         * html/HTMLPlugInElement.cpp:
1146         (WebCore::HTMLPlugInElement::canLoadScriptURL const): Added. Code moved here
1147         from HTMLFrameOwnerElement::isURLAllowed. Added comment about why this is not
1148         necessarily correct and might need improvement.
1149
1150         * html/HTMLPlugInElement.h: Added private override of canLoadScriptURL.
1151
1152         * html/HTMLPlugInImageElement.cpp:
1153         (WebCore::HTMLPlugInImageElement::canLoadURL const): Renamed from
1154         allowedToLoadFrameURL and refactored into two functions to match the
1155         structure of the similar function in HTMLFrameElementBase. Also refactored
1156         to use canAddSubframe and isProhibitedSelfReference rather than Frame::isURLAllowed.
1157         (WebCore::HTMLPlugInImageElement::canLoadPlugInContent const): Renamed from
1158         allowedToLoadPluginContent.
1159         (WebCore::HTMLPlugInImageElement::requestObject): allowedToLoadPluginContent
1160         -> canLoadPlugInContent
1161
1162         * html/HTMLPlugInImageElement.h: Renamed functions as mentioned above.
1163
1164         * loader/SubframeLoader.cpp:
1165         (WebCore::SubframeLoader::requestFrame): isURLAllowed -> canLoadScriptURL
1166
1167         * page/FocusController.h: Removed unneeded forward declaration of HTMLFrameOwnerElement.
1168
1169         * page/Frame.cpp:
1170         (WebCore::Frame::isURLAllowed const): Deleted.
1171         * page/Frame.h: Ditto.
1172
1173         * page/FrameView.cpp:
1174         (WebCore::FrameView::init): Removed code to initialize m_margins, since nothing
1175         was looking at it after that.
1176         (WebCore::FrameView::setMarginWidth): Deleted.
1177         (WebCore::FrameView::setMarginHeight): Deleted.
1178
1179         * page/FrameView.h: Removed marginWidth, marginHeight, setMarginWidth,
1180         setMarginHeight, and m_margins because there was no code anywhere calling
1181         marginWidth or marginHeight, and no other side effects of these functions.
1182
1183 2019-07-17  Alex Christensen  <achristensen@webkit.org>
1184
1185         Add a runtime-disabled dialog element skeleton
1186         https://bugs.webkit.org/show_bug.cgi?id=199839
1187
1188         Reviewed by Ryosuke Niwa.
1189
1190         Beginning implementation of https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element
1191         Covered by rebaselining WPT tests.
1192
1193         * CMakeLists.txt:
1194         * DerivedSources-input.xcfilelist:
1195         * DerivedSources-output.xcfilelist:
1196         * DerivedSources.make:
1197         * Sources.txt:
1198         * WebCore.xcodeproj/project.pbxproj:
1199         * bindings/js/WebCoreBuiltinNames.h:
1200         * html/HTMLDialogElement.cpp: Added.
1201         (WebCore::HTMLDialogElement::HTMLDialogElement):
1202         (WebCore::HTMLDialogElement::open):
1203         (WebCore::HTMLDialogElement::setOpen):
1204         (WebCore::HTMLDialogElement::returnValue):
1205         (WebCore::HTMLDialogElement::setReturnValue):
1206         (WebCore::HTMLDialogElement::show):
1207         (WebCore::HTMLDialogElement::showModal):
1208         (WebCore::HTMLDialogElement::close):
1209         * html/HTMLDialogElement.h: Added.
1210         * html/HTMLDialogElement.idl: Added.
1211         * html/HTMLTagNames.in:
1212         * page/RuntimeEnabledFeatures.h:
1213         (WebCore::RuntimeEnabledFeatures::setDialogElementEnabled):
1214         (WebCore::RuntimeEnabledFeatures::dialogElementEnabled const):
1215
1216 2019-07-17  Youenn Fablet  <youenn@apple.com>
1217
1218         Hop to the main thread when doing logging in RealtimeIncomingVideoSourceCocoa
1219         https://bugs.webkit.org/show_bug.cgi?id=199865
1220
1221         Reviewed by Darin Adler.
1222
1223         LoggerHelper routines allow logging messages in system console and inspector console.
1224         These routines iterate through a Vector of log observers which is not thread safe.
1225         Document, the main log observer, also expects to be called on the main thread.
1226         Manually tested (writing a layout test for this would require more than 2 seconds).
1227
1228         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
1229         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
1230
1231 2019-07-17  Commit Queue  <commit-queue@webkit.org>
1232
1233         Unreviewed, rolling out r247505.
1234         https://bugs.webkit.org/show_bug.cgi?id=199871
1235
1236         "Caused failed ASSERT in stress test" (Requested by creid on
1237         #webkit).
1238
1239         Reverted changeset:
1240
1241         "Bytecode cache should use FileSystem"
1242         https://bugs.webkit.org/show_bug.cgi?id=199759
1243         https://trac.webkit.org/changeset/247505
1244
1245 2019-07-17  Youenn Fablet  <youenn@apple.com>
1246
1247         Add release logging to AudioSampleDataSource
1248         https://bugs.webkit.org/show_bug.cgi?id=199814
1249         <rdar://problem/53128140>
1250
1251         Reviewed by Eric Carlson.
1252
1253         Use release logging for AudioSampleDataSource in case of errors.
1254         This requires passing a logger and a logger identifier.
1255         For that purpose, pass a MediaStreamTrackPrivate to it constructor
1256         and reuse its logger and log identifier.
1257
1258         For each log, hop to the main thread as release logging requires to be done in the main thread.
1259         Add specific handling for RealtimeOutgoingAudioSource as its MediaStreamTrack can change in case of replaceTrack.
1260         In that case, we change of logger when changing the MediaStreamTrackPrivate.
1261
1262         No observable change of behavior, covered by existing tests.
1263
1264         * platform/audio/mac/AudioSampleDataSource.h:
1265         * platform/audio/mac/AudioSampleDataSource.mm:
1266         (WebCore::AudioSampleDataSource::create):
1267         (WebCore::AudioSampleDataSource::AudioSampleDataSource):
1268         (WebCore::AudioSampleDataSource::setupConverter):
1269         (WebCore::AudioSampleDataSource::pushSamplesInternal):
1270         (WebCore::AudioSampleDataSource::pullSamplesInternal):
1271         (WebCore::AudioSampleDataSource::setLogger):
1272         (WebCore::AudioSampleDataSource::logChannel const):
1273         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
1274         (WebCore::RealtimeOutgoingAudioSource::setSource):
1275         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1276         (WebCore::RealtimeOutgoingAudioSource::sourceUpdated):
1277         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1278         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1279         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
1280         Instead of using its own logger/identifier member field, reuse its MediaStreamTrackPrivate.
1281         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
1282         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
1283         (WebCore::RealtimeOutgoingAudioSourceCocoa::sourceUpdated):
1284         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
1285         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1286         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
1287
1288 2019-07-17  Kenneth Russell  <kbr@chromium.org>
1289
1290         Make ANGLE work inside WebKit2's sandbox
1291         https://bugs.webkit.org/show_bug.cgi?id=199844
1292
1293         Reviewed by Alex Christensen.
1294
1295         Fix missing #import introduced at the last minute while removing
1296         some debugging code in the last patch.
1297
1298         Tested with San Angeles WebGL demo and some conformance tests.
1299
1300         * platform/graphics/cocoa/WebGLLayer.mm:
1301
1302 2019-07-17  Andres Gonzalez  <andresg_22@apple.com>
1303
1304         Hang in WebCore::AccessibilityRenderObject::visiblePositionRangeForLine.
1305         https://bugs.webkit.org/show_bug.cgi?id=199845
1306         <rdar://problem/53121017>
1307
1308         Reviewed by Chris Fleizach.
1309
1310         - Added check for upper bound NSNotFound for parameter to visiblePositionRangeForLine.
1311         - Fixed signed/unsigned issue for AXTextMarkerRangeForLine attribute.
1312
1313         * accessibility/AccessibilityRenderObject.cpp:
1314         (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine const):
1315         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1316         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1317
1318 2019-07-17  Rob Buis  <rbuis@igalia.com>
1319
1320         Add referrerpolicy attribute support for <script> elements
1321         https://bugs.webkit.org/show_bug.cgi?id=185550
1322
1323         Reviewed by Youenn Fablet.
1324
1325         This patch adds 'referrerpolicy' attribute support for script elements.
1326         If set, the value is restricted to the ReferrerPolicy enum, and
1327         if valid it is used for the script fetch.
1328         If not set or invalid, the current behavior is kept.
1329
1330         Tests: http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http-http.html
1331                http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http.https.html
1332                http/tests/referrer-policy-script/no-referrer-when-downgrade/same-origin.html
1333                http/tests/referrer-policy-script/no-referrer/cross-origin-http-http.html
1334                http/tests/referrer-policy-script/no-referrer/cross-origin-http.https.html
1335                http/tests/referrer-policy-script/no-referrer/same-origin.html
1336                http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http-http.html
1337                http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http.https.html
1338                http/tests/referrer-policy-script/origin-when-cross-origin/same-origin.html
1339                http/tests/referrer-policy-script/origin/cross-origin-http-http.html
1340                http/tests/referrer-policy-script/origin/cross-origin-http.https.html
1341                http/tests/referrer-policy-script/origin/same-origin.html
1342                http/tests/referrer-policy-script/same-origin/cross-origin-http-http.html
1343                http/tests/referrer-policy-script/same-origin/cross-origin-http.https.html
1344                http/tests/referrer-policy-script/same-origin/same-origin.html
1345                http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http-http.html
1346                http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http.https.html
1347                http/tests/referrer-policy-script/strict-origin-when-cross-origin/same-origin.html
1348                http/tests/referrer-policy-script/strict-origin/cross-origin-http-http.html
1349                http/tests/referrer-policy-script/strict-origin/cross-origin-http.https.html
1350                http/tests/referrer-policy-script/strict-origin/same-origin.html
1351                http/tests/referrer-policy-script/unsafe-url/cross-origin-http-http.html
1352                http/tests/referrer-policy-script/unsafe-url/cross-origin-http.https.html
1353                http/tests/referrer-policy-script/unsafe-url/same-origin.html
1354
1355         * bindings/js/CachedScriptFetcher.cpp:
1356         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
1357         * bindings/js/CachedScriptFetcher.h:
1358         (WebCore::CachedScriptFetcher::CachedScriptFetcher):
1359         * dom/InlineClassicScript.h:
1360         * dom/LoadableClassicScript.cpp:
1361         (WebCore::LoadableClassicScript::create):
1362         * dom/LoadableClassicScript.h:
1363         * dom/LoadableModuleScript.cpp:
1364         (WebCore::LoadableModuleScript::create):
1365         (WebCore::LoadableModuleScript::LoadableModuleScript):
1366         * dom/LoadableModuleScript.h:
1367         * dom/LoadableScript.h:
1368         (WebCore::LoadableScript::LoadableScript):
1369         * dom/ScriptElement.cpp:
1370         (WebCore::ScriptElement::requestClassicScript):
1371         (WebCore::ScriptElement::requestModuleScript):
1372         * dom/ScriptElement.h:
1373         * dom/ScriptElementCachedScriptFetcher.h:
1374         (WebCore::ScriptElementCachedScriptFetcher::ScriptElementCachedScriptFetcher):
1375         * html/HTMLIFrameElement.cpp:
1376         (WebCore::HTMLIFrameElement::referrerPolicyForBindings const):
1377         * html/HTMLScriptElement.cpp:
1378         (WebCore::HTMLScriptElement::setReferrerPolicyForBindings):
1379         (WebCore::HTMLScriptElement::referrerPolicyForBindings const):
1380         (WebCore::HTMLScriptElement::referrerPolicy const):
1381         * html/HTMLScriptElement.h:
1382         * html/HTMLScriptElement.idl:
1383         * html/parser/CSSPreloadScanner.cpp:
1384         (WebCore::CSSPreloadScanner::emitRule):
1385         * html/parser/HTMLPreloadScanner.cpp:
1386         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
1387         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
1388         * html/parser/HTMLResourcePreloader.cpp:
1389         (WebCore::PreloadRequest::resourceRequest):
1390         * html/parser/HTMLResourcePreloader.h:
1391         (WebCore::PreloadRequest::PreloadRequest):
1392         * platform/ReferrerPolicy.cpp:
1393         (WebCore::referrerPolicyToString):
1394         * platform/ReferrerPolicy.h:
1395         * svg/SVGScriptElement.h:
1396
1397 2019-07-16  Christopher Reid  <chris.reid@sony.com>
1398
1399         Bytecode cache should use FileSystem
1400         https://bugs.webkit.org/show_bug.cgi?id=199759
1401
1402         Reviewed by Yusuke Suzuki.
1403
1404         * platform/SharedBuffer.cpp:
1405
1406 2019-07-16  Simon Fraser  <simon.fraser@apple.com>
1407
1408         Fix includes and make a constructor explicit to avoid unified-sources-triggered test failures
1409         https://bugs.webkit.org/show_bug.cgi?id=199849
1410
1411         Reviewed by Wenson Hsieh.
1412         
1413         webkit.org/b/199587 triggered some unexpected test failures because of unified sources include
1414         order. The TextStream operator in ScrollingTreeOverflowScrollingNode::dumpProperties() was invoking
1415         the implicit constructor of TransformOperations.
1416
1417         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp: Include TextStream.h
1418         * platform/graphics/transforms/TransformOperations.h: Make ctor explicit.
1419
1420 2019-07-16  Antoine Quint  <graouts@apple.com>
1421
1422         REGRESSION: fast/events/watchos/double-tap-to-zoom* tests crashing in com.apple.WebKit: -[WKContentView(WKInteraction) _singleTapDidReset:]
1423         https://bugs.webkit.org/show_bug.cgi?id=199840
1424         <rdar://problem/52856531>
1425
1426         Reviewed by Wenson Hsieh.
1427
1428         Fix a build error that occured when building for the watchOS Simulator in the debug configuration.
1429
1430         * rendering/RenderLayerCompositor.cpp:
1431         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole):
1432
1433 2019-07-16  Justin Fan  <justin_fan@apple.com>
1434
1435         [WebGPU] Convert GPUComputePipeline LOG statements to generate GPUErrors
1436         https://bugs.webkit.org/show_bug.cgi?id=199773
1437
1438         Reviewed by Myles C. Maxfield.
1439
1440         Generate a GPUError if GPUComputePipeline creation fails.
1441         Rework the WHLSL test harness to take advantage of this.
1442
1443         Test: webgpu/compute-pipeline-errors.html
1444
1445         * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp:
1446         (WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
1447         * Modules/webgpu/WebGPUComputePipelineDescriptor.h:
1448         * Modules/webgpu/WebGPUDevice.cpp:
1449         (WebCore::WebGPUDevice::createComputePipeline const):
1450         * platform/graphics/gpu/GPUBuffer.h:
1451         * platform/graphics/gpu/GPUComputePipeline.h: 
1452                 Now inherits from GPUObjectBase, though this isn't super useful yet
1453                 since GPUComputePipeline itself does not expose any operations that can error. 
1454         * platform/graphics/gpu/GPUDevice.cpp:
1455         (WebCore::GPUDevice::tryCreateComputePipeline const):
1456         * platform/graphics/gpu/GPUDevice.h:
1457         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1458         (WebCore::GPUBuffer::validateBufferUsage):
1459         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
1460         (WebCore::trySetMetalFunctions):
1461         (WebCore::trySetFunctions):
1462         (WebCore::convertComputePipelineDescriptor):
1463         (WebCore::tryCreateMTLComputePipelineState):
1464         (WebCore::GPUComputePipeline::tryCreate):
1465         (WebCore::GPUComputePipeline::GPUComputePipeline):
1466
1467 2019-07-11  Justin Fan  <justin_fan@apple.com>
1468
1469         [WebGPU] Move error scopes out of GPUDevice for more portable error generation
1470         https://bugs.webkit.org/show_bug.cgi?id=199740
1471
1472         Reviewed by Myles C. Maxfield.
1473
1474         Move error generation into a separate RefCounted class to allow GPU objects to generate 
1475         errors independent of any GPUDevice.
1476         Create GPUObjectBase to delegate error generation and refactor GPUBuffer to inherit from GPUObjectBase.
1477
1478         No behavior change or new tests. Error scopes covered by error-scopes-test.html.
1479
1480         * Modules/webgpu/WebGPUDevice.cpp:
1481         (WebCore::WebGPUDevice::WebGPUDevice): Now creates a GPUErrorGenerator.
1482         (WebCore::WebGPUDevice::createBuffer const): Pass the GPUErrorGenerator to any created GPUBuffer.
1483         (WebCore::WebGPUDevice::createBufferMapped const): Ditto.
1484         (WebCore::WebGPUDevice::popErrorScope): Shouldn't be const. Can just ask for the GPUError rather than passing a lambda.
1485         (WebCore::WebGPUDevice::pushErrorScope const): Deleted.
1486         (WebCore::WebGPUDevice::popErrorScope const): Deleted.
1487         * Modules/webgpu/WebGPUDevice.h:
1488         (WebCore::WebGPUDevice::pushErrorScope):
1489         * Sources.txt:
1490         * WebCore.xcodeproj/project.pbxproj:
1491         * platform/graphics/gpu/GPUBuffer.h: Now inherits from GPUObjectBase for error generation ease.
1492         * platform/graphics/gpu/GPUDevice.cpp:
1493         (WebCore::GPUDevice::tryCreateBuffer): Ensure GPUBuffers reference the GPUErrorGenerator.
1494         (WebCore::GPUDevice::pushErrorScope): Deleted. No longer needed here.
1495         (WebCore::GPUDevice::popErrorScope): Deleted.
1496         (WebCore::GPUDevice::registerError): Deleted.
1497         * platform/graphics/gpu/GPUDevice.h: Move error scope logic out.
1498         * platform/graphics/gpu/GPUErrorGenerator.cpp: Added.
1499         (WebCore::GPUErrorGenerator::pushErrorScope):
1500         (WebCore::GPUErrorGenerator::popErrorScope):
1501         (WebCore::GPUErrorGenerator::generateError):
1502         * platform/graphics/gpu/GPUErrorGenerator.h: Added.
1503         (WebCore::GPUErrorGenerator::create):
1504         * platform/graphics/gpu/GPUObjectBase.h: Added.
1505         (WebCore::GPUObjectBase::generateError):
1506         (WebCore::GPUObjectBase::GPUObjectBase):
1507         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Use the GPUErrorGenerator directly during buffer creation.
1508         (WebCore::GPUBuffer::validateBufferUsage):
1509         (WebCore::GPUBuffer::tryCreate):
1510         (WebCore::GPUBuffer::GPUBuffer):
1511         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
1512         (WebCore::GPUQueue::submit): Prevent possible null dereference.
1513
1514 2019-07-10  Justin Fan  <justin_fan@apple.com>
1515
1516         [WebGPU] Implement GPUError and error scopes
1517         https://bugs.webkit.org/show_bug.cgi?id=199655
1518
1519         Reviewed by Myles C. Maxfield.
1520
1521         Add GPUErrorFilter, GPUError, and the ability to push and pop error scopes on a GPUDevice.
1522         This will allow us to check for WebGPU errors from JavaScript.
1523         Currently, only some GPUBuffer creation errors are reported for testing; more errors will follow in later patches.
1524
1525         Test: webgpu/error-scopes-test.html
1526
1527         * Modules/webgpu/GPUErrorFilter.idl: Added.
1528         * Modules/webgpu/GPUOutOfMemoryError.idl: Added.
1529         * Modules/webgpu/GPUValidationError.idl: Added.
1530         * Modules/webgpu/WebGPUDevice.cpp:
1531         (WebCore::WebGPUDevice::pushErrorScope):
1532         (WebCore::WebGPUDevice::popErrorScope): Resolve the Promise here, since GPUDevice shouldn't worry about DOM layer.
1533         * Modules/webgpu/WebGPUDevice.h:
1534         * Modules/webgpu/WebGPUDeviceErrorScopes.cpp: Added.
1535         (WebCore::WebGPUDeviceErrorScopes::pushErrorScope): Delegates to WebGPUDevice.
1536         (WebCore::WebGPUDeviceErrorScopes::popErrorScope): Ditto.
1537         * Modules/webgpu/WebGPUDeviceErrorScopes.h: Added.
1538         * Modules/webgpu/WebGPUDeviceErrorScopes.idl: Added.
1539         * platform/graphics/gpu/GPUBuffer.h:
1540         * platform/graphics/gpu/GPUDevice.cpp: The actual error stack lives here.
1541         (WebCore::GPUDevice::pushErrorScope):
1542         (WebCore::GPUDevice::popErrorScope): Calls a callback with a GPUError, if any.
1543         (WebCore::GPUDevice::registerError): Actually creates GPUErrors.
1544         * platform/graphics/gpu/GPUDevice.h:
1545         * platform/graphics/gpu/GPUError.cpp: Added.
1546         (WebCore::createError): Factory function for various error types.
1547         * platform/graphics/gpu/GPUError.h: Added.
1548         * platform/graphics/gpu/GPUErrorFilter.h: Added.
1549         * platform/graphics/gpu/GPUOutOfMemoryError.h: Added.
1550         (WebCore::GPUOutOfMemoryError::create):
1551         * platform/graphics/gpu/GPUValidationError.cpp: Added.
1552         (WebCore::GPUValidationError::create):
1553         (WebCore::GPUValidationError::GPUValidationError):
1554         * platform/graphics/gpu/GPUValidationError.h: Added.
1555         (WebCore::GPUValidationError::message const):
1556         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1557         (WebCore::GPUBuffer::validateBufferUsage): Create an actual GPUValidationError :)
1558         (WebCore::GPUBuffer::tryCreate): Create GPUOutOfMemoryErrors where appropriate.
1559
1560         Add file/name references:
1561         * CMakeLists.txt:
1562         * DerivedSources-input.xcfilelist:
1563         * DerivedSources-output.xcfilelist:
1564         * DerivedSources.make:
1565         * Sources.txt:
1566         * WebCore.xcodeproj/project.pbxproj:
1567         * bindings/js/WebCoreBuiltinNames.h:
1568
1569         Missing includes:
1570         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
1571
1572 2019-07-16  Commit Queue  <commit-queue@webkit.org>
1573
1574         Unreviewed, rolling out r247493.
1575         https://bugs.webkit.org/show_bug.cgi?id=199841
1576
1577         "The new whlsl-for-loop.html test is failing on the bots"
1578         (Requested by rmorisset on #webkit).
1579
1580         Reverted changeset:
1581
1582         "[WHLSL] Desugar for loops and while loops"
1583         https://bugs.webkit.org/show_bug.cgi?id=199726
1584         https://trac.webkit.org/changeset/247493
1585
1586 2019-07-16  Per Arne Vollan  <pvollan@apple.com>
1587
1588         Prewarm font cache with more fonts
1589         https://bugs.webkit.org/show_bug.cgi?id=199283
1590
1591         Reviewed by Myles C. Maxfield.
1592
1593         Use the existing prewarm method in FontCache to prewarm the cache with a set of font family names.
1594         The font list consists of some of the fonts used by the 10 most popular sites on Alexa top sites.
1595         This is a confirmed improvement in page load time.
1596
1597         No new tests, covered by existing tests.
1598
1599         * page/ProcessWarming.cpp:
1600         (WebCore::ProcessWarming::prewarmGlobally):
1601         * platform/graphics/FontCache.cpp:
1602         (WebCore::FontCache::prewarmGlobally):
1603         * platform/graphics/FontCache.h:
1604         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1605         (WebCore::FontCache::prewarmGlobally):
1606
1607 2019-07-16  Robin Morisset  <rmorisset@apple.com>
1608
1609         [WHLSL] Desugar for loops and while loops
1610         https://bugs.webkit.org/show_bug.cgi?id=199726
1611
1612         Reviewed by Myles C. Maxfield.
1613
1614         This patch makes loops behave a lot more similarly to the spec.
1615         In particular, while loops are just degenerate for loops, so they can be desugared in the parser.
1616         And for loops can themselves be heavily desugared, into having no initializer, one condition and one increment
1617         by putting any initializer in a block around the loop, putting true in the condition if there is none, and putting any litteral in the increment if there is none.
1618
1619         Debugging this patch revealed an unrelated bug where the parser would generate an empty comma expression on ";", which the checker would then choke on.
1620         The parser now generates an empty block in that case (as specified in the spec), which fixes the problem.
1621
1622         Finally, while updating the NameResolver for the new structure of loops I realized that it was needlessly generating extra NameContext.
1623         They are not expected by the spec, that forbids naked variable declarations outside of blocks anyway.
1624         So I removed this unnecessary work, and fixed the parser to correctly forbid such naked variable declarations.
1625
1626         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
1627         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
1628         (WebCore::WHLSL::AST::ForLoop::ForLoop):
1629         (WebCore::WHLSL::AST::ForLoop::condition):
1630         (WebCore::WHLSL::AST::ForLoop::increment):
1631         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
1632         (WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
1633         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Removed.
1634         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1635         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1636         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
1637         (WebCore::WHLSL::ASTDumper::visit):
1638         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
1639         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1640         (WebCore::WHLSL::Checker::visit):
1641         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
1642         (WebCore::WHLSL::NameResolver::visit):
1643         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
1644         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1645         (WebCore::WHLSL::Parser::parseBlockBody):
1646         (WebCore::WHLSL::Parser::parseForLoop):
1647         (WebCore::WHLSL::Parser::parseWhileLoop):
1648         (WebCore::WHLSL::Parser::parseStatement):
1649         (WebCore::WHLSL::Parser::parseEffectfulExpression):
1650         * Modules/webgpu/WHLSL/WHLSLParser.h:
1651         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
1652         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1653         (WebCore::WHLSL::Visitor::visit):
1654         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
1655         * WebCore.xcodeproj/project.pbxproj:
1656
1657 2019-07-16  Tim Horton  <timothy_horton@apple.com>
1658
1659         NSTextFinder holes don't scroll with the page
1660         https://bugs.webkit.org/show_bug.cgi?id=199815
1661         <rdar://problem/52280514>
1662
1663         Reviewed by Simon Fraser.
1664
1665         * rendering/ScrollAlignment.h:
1666
1667 2019-07-16  Youenn Fablet  <youenn@apple.com>
1668
1669         [iOS] Make sure the first camera device in the list is the front camera
1670         https://bugs.webkit.org/show_bug.cgi?id=199811
1671         <rdar://problem/53125157>
1672
1673         Reviewed by Jer Noble.
1674
1675         Some websites call getUserMedia with a deviceId constraint and theey pick the
1676         first deviceId in the list provided by enumerateDevices.
1677         On iOS, this is the back camera which is often not what is expected by WebRTC applications.
1678         Instead, make sure the first camera device is the front camera.
1679
1680         Manually tested.
1681
1682         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1683
1684 2019-07-16  Chris Dumez  <cdumez@apple.com>
1685
1686         Speed up StorageManager::getValues()
1687         https://bugs.webkit.org/show_bug.cgi?id=199812
1688
1689         Reviewed by Alex Christensen.
1690
1691         * storage/StorageMap.cpp:
1692         (WebCore::StorageMap::importItems):
1693         * storage/StorageMap.h:
1694
1695 2019-07-16  Simon Fraser  <simon.fraser@apple.com>
1696
1697         Remove "GraphicsContext 0x7ffd8765f6b0 stack changed by" logging
1698         https://bugs.webkit.org/show_bug.cgi?id=199834
1699
1700         Reviewed by Dean Jackson.
1701
1702         I inadvertently left in a couple of GraphicsContextStateStackChecker (used to detect mismatched
1703         GraphicsContext save/restore) in r246725, so remove them.
1704
1705         * rendering/RenderLayer.cpp:
1706         (WebCore::RenderLayer::paintLayerContents):
1707         * rendering/RenderLayerBacking.cpp:
1708         (WebCore::RenderLayerBacking::paintIntoLayer):
1709
1710 2019-07-16  Wenson Hsieh  <wenson_hsieh@apple.com>
1711
1712         [Text autosizing] [iPadOS] Paragraph text on the front page of LinkedIn.com is not boosted
1713         https://bugs.webkit.org/show_bug.cgi?id=199827
1714         <rdar://problem/53152660>
1715
1716         Reviewed by Zalan Bujtas.
1717
1718         After r247467, we try to avoid boosting some text that might cause vertical overflow due to line height
1719         increasing inside a container that expects a fixed integer number of lines. However, in the case of
1720         linkedin.com, the line height specified is a fixed value of 26px, which greatly exceeds the specified font size
1721         of 14px. In this case, it's safe to boost font size, since doing so would not affect the line height at all.
1722
1723         To handle this case, don't avoid text autosizing due to the "fixed number of lines" heuristic if the line height
1724         is fixed, and is much larger than the font size.
1725
1726         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
1727
1728         * rendering/style/TextSizeAdjustment.cpp:
1729         (WebCore::AutosizeStatus::updateStatus):
1730
1731 2019-07-16  Zalan Bujtas  <zalan@apple.com>
1732
1733         [ContentChangeObserver] Cancel ongoing content observation when tap is failed/cancelled
1734         https://bugs.webkit.org/show_bug.cgi?id=199828
1735         <rdar://problem/53152696>
1736
1737         Reviewed by Wenson Hsieh.
1738
1739         This patch ensures that we stop the content observation (initiated by touch start) when the tap
1740         is cancelled/failed.
1741
1742         Not testable.
1743
1744         * page/ios/ContentChangeObserver.cpp:
1745         (WebCore::ContentChangeObserver::didCancelPotentialTap):
1746         * page/ios/ContentChangeObserver.h:
1747
1748 2019-07-16  Rob Buis  <rbuis@igalia.com>
1749
1750         Remove support for beforeload on link=prefetch
1751         https://bugs.webkit.org/show_bug.cgi?id=199632
1752
1753         Reviewed by Youenn Fablet.
1754
1755         Remove support for beforeload on link=prefetch
1756         by not calling shouldLoadLink for prefetch.
1757         Also make loadLink return void since it always
1758         succeeds.
1759
1760         Tests: http/wpt/prefetch/beforeload-dynamic.html
1761                http/wpt/prefetch/beforeload.html
1762
1763         * html/HTMLLinkElement.cpp:
1764         (WebCore::HTMLLinkElement::process):
1765         * loader/LinkLoader.cpp:
1766         (WebCore::LinkLoader::prefetchIfNeeded):
1767         (WebCore::LinkLoader::loadLink):
1768         * loader/LinkLoader.h:
1769
1770 2019-07-16  Youenn Fablet  <youenn@apple.com>
1771
1772         Hop to main thread for release logging in RealtimeIncomingAudioSource
1773         https://bugs.webkit.org/show_bug.cgi?id=199813
1774
1775         Reviewed by Eric Carlson.
1776
1777         LoggerHelper routines allow logging messages in system console and inspector console.
1778         These routines iterate through a Vector of log observers which is not thread safe.
1779         Document, the main log observer, also expects to be called on the main thread.
1780         Manually tested (writing a layout test for this would require more than 2 seconds).
1781
1782         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
1783         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
1784
1785 2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>
1786
1787         Unreviewed, rolling out r247444.
1788
1789         Caused two scrolling tests to fail on iOS Simulator
1790
1791         Reverted changeset:
1792
1793         "Typing into a cell in a Google Sheet lags behind by one
1794         character"
1795         https://bugs.webkit.org/show_bug.cgi?id=199587
1796         https://trac.webkit.org/changeset/247444
1797
1798 2019-07-15  Zalan Bujtas  <zalan@apple.com>
1799
1800         outlook.live.com has odd viewport with edge gap
1801         https://bugs.webkit.org/show_bug.cgi?id=199822
1802         <rdar://problem/53029072>
1803
1804         Reviewed by Wenson Hsieh.
1805
1806         r244944 introduced a viewport width quirk because at certain screen size outlook.live.com's flex setup produced a slighly broken layout.
1807         We don't seem to need this quirk anymore (composed column's min-width is removed.)
1808
1809         * page/Quirks.cpp:
1810         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const): Deleted.
1811         (WebCore::Quirks::overriddenViewLayoutWidth const): Deleted.
1812         * page/Quirks.h:
1813
1814 2019-07-15  Saam Barati  <sbarati@apple.com>
1815
1816         [WHLSL] Matrix memory layout should match HLSL by laying out columns linearly
1817         https://bugs.webkit.org/show_bug.cgi?id=199215
1818
1819         Reviewed by Myles C. Maxfield.
1820
1821         This patch makes it so that we lay out matrices in memory in the same
1822         way HLSL does. This is by laying out columns linearly in memory. So a float4x4
1823         composed by this series of floats in memory:
1824         [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
1825         
1826         composes this logical matrix:
1827         [[ 0,  4,  8, 12]
1828          [ 1,  5,  9, 13]
1829          [ 2,  6, 10, 14]
1830          [ 3,  7, 11, 15]]
1831         
1832         To implement this, we switch to using an array to represent the memory
1833         contents linear memory layout of a matrix. So the matrix float4x3 will now
1834         be an array<float, 12> in metal. Then, we change the indexed getter and
1835         setter methods for matrices to load and store from and to the correct
1836         memory locations. The memory layout of matrices is observable to WHLSL
1837         when using a matrix as an input/output to a shader.
1838
1839         Test: webgpu/whlsl-matrix-memory-layout.html
1840
1841         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1842         (WebCore::WHLSL::Metal::writeNativeFunction):
1843         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
1844         (WebCore::WHLSL::Metal::writeNativeType):
1845
1846 2019-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1847
1848         [Text autosizing] [iPadOS] Product label text is clipped in portrait mode on the front page of sephora.com
1849         https://bugs.webkit.org/show_bug.cgi?id=199806
1850         <rdar://problem/52902482>
1851
1852         Reviewed by Zalan Bujtas.
1853
1854         On sephora.com, some product label text is currently boosted by idempotent text autosizing, which causes the
1855         labels be vertically clipped. This patch augments the idempotent text autosizing heuristic to avoid this case by
1856         checking if the element to be boosted has a fixed height or max height, whose value is very close to a small
1857         integer multiple of the line height. In this case, it's likely that the website expects the text to be no more
1858         than a few lines' worth of height, so boosting the text is likely to break the page.
1859
1860         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
1861
1862         * rendering/style/RenderStyle.cpp:
1863         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
1864         * rendering/style/TextSizeAdjustment.cpp:
1865         (WebCore::AutosizeStatus::updateStatus):
1866         * rendering/style/TextSizeAdjustment.h:
1867
1868         Rename Fields::DisplayNone to Fields::AvoidSubtree to avoid introducing another bit in RenderStyle's inherited
1869         flags.
1870
1871 2019-07-15  Myles C. Maxfield  <mmaxfield@apple.com>
1872
1873         New York font erroneously gets synthetic bold
1874         https://bugs.webkit.org/show_bug.cgi?id=199653
1875
1876         Unreviewed watchOS build fix.
1877
1878         * page/ProcessWarming.cpp:
1879         (WebCore::ProcessWarming::prewarmGlobally):
1880         * page/cocoa/MemoryReleaseCocoa.mm:
1881         (WebCore::platformReleaseMemory):
1882         * platform/graphics/FontCascadeDescription.cpp:
1883         * platform/graphics/FontDescription.h:
1884         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1885         (WebCore::invalidateFontCache):
1886         (WebCore::lookupFallbackFont):
1887         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1888         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
1889         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
1890         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
1891         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
1892
1893 2019-07-15  Commit Queue  <commit-queue@webkit.org>
1894
1895         Unreviewed, rolling out r247462.
1896         https://bugs.webkit.org/show_bug.cgi?id=199816
1897
1898         completely messed up the patch (Requested by litherum on
1899         #webkit).
1900
1901         Reverted changeset:
1902
1903         "New York font erroneously gets synthetic bold"
1904         https://bugs.webkit.org/show_bug.cgi?id=199653
1905         https://trac.webkit.org/changeset/247462
1906
1907 2019-07-11  Simon Fraser  <simon.fraser@apple.com>
1908
1909         Fix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.
1910
1911         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1912         (WebCore::fontWithFamilySpecialCase):
1913
1914 2019-07-11  Justin Fan  <justin_fan@apple.com>
1915
1916         Unreviewed build fix.
1917
1918         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Missing include.
1919
1920 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
1921
1922         New York font erroneously gets synthetic bold
1923         https://bugs.webkit.org/show_bug.cgi?id=199653
1924         <rdar://problem/51692592>
1925
1926         Reviewed by Simon Fraser.
1927
1928         This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
1929         and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
1930         to expose these fonts to the web because we don't a standardization story for them
1931         yet, but we do want some apps to be able to use them.
1932
1933         WebKit clients who want to use these fonts can set
1934         -[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.
1935
1936         The patch generalizes our existing system-ui infrastructure to handle these three
1937         additional fonts. It also explicitly disables the unsupported dot-prefixed names
1938         so they don't leak out into Web content.
1939
1940         Tests: fast/text/design-system-ui-10.html
1941                fast/text/design-system-ui-11.html
1942                fast/text/design-system-ui-12.html
1943                fast/text/design-system-ui-13.html
1944                fast/text/design-system-ui-14.html
1945                fast/text/design-system-ui-15.html
1946                fast/text/design-system-ui-16.html
1947                fast/text/design-system-ui-2.html
1948                fast/text/design-system-ui-3.html
1949                fast/text/design-system-ui-4.html
1950                fast/text/design-system-ui-5.html
1951                fast/text/design-system-ui-6.html
1952                fast/text/design-system-ui-7.html
1953                fast/text/design-system-ui-8.html
1954                fast/text/design-system-ui-9.html
1955                fast/text/design-system-ui.html
1956
1957         * css/CSSFontFace.cpp:
1958         (WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
1959         * css/CSSFontFace.h:
1960         * css/CSSFontFaceSource.cpp:
1961         (WebCore::CSSFontFaceSource::load):
1962         * css/StyleResolver.cpp:
1963         (WebCore::StyleResolver::initializeFontStyle):
1964         * page/Settings.yaml:
1965         * platform/graphics/FontDescription.cpp:
1966         (WebCore::m_shouldAllowDesignSystemUIFonts):
1967         (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
1968         * platform/graphics/FontDescription.h:
1969         (WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
1970         (WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
1971         (WebCore::FontDescription::operator== const):
1972         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1973         (WebCore::platformFontLookupWithFamily):
1974         (WebCore::fontWithFamily):
1975         * platform/graphics/cocoa/FontCacheCoreText.h:
1976         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1977         (WebCore::systemFontUse):
1978         (WebCore::systemFontCascadeList):
1979         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
1980         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
1981         (WebCore::isSystemFontString): Deleted.
1982         (WebCore::isUIFontTextStyle): Deleted.
1983         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1984         (WebCore::FontPlatformData::ctFont const):
1985         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
1986         (WebCore::SystemFontDatabaseCoreText::createSystemUI):
1987         (WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
1988         (WebCore::SystemFontDatabaseCoreText::createTextStyle):
1989         (WebCore::SystemFontDatabaseCoreText::cascadeList):
1990         (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
1991         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
1992         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
1993         * platform/graphics/ios/FontCacheIOS.mm:
1994         (WebCore::platformFontWithFamilySpecialCase):
1995         * platform/graphics/mac/FontCacheMac.mm:
1996         (WebCore::platformFontWithFamilySpecialCase):
1997         * style/StyleResolveForDocument.cpp:
1998         (WebCore::Style::resolveForDocument):
1999         * svg/graphics/SVGImage.cpp:
2000         (WebCore::SVGImage::dataChanged):
2001         * testing/InternalSettings.cpp:
2002         (WebCore::InternalSettings::Backup::Backup):
2003         (WebCore::InternalSettings::Backup::restoreTo):
2004         (WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
2005         * testing/InternalSettings.h:
2006         * testing/InternalSettings.idl:
2007
2008 2019-07-15  Chris Dumez  <cdumez@apple.com>
2009
2010         Crash under DisplayRefreshMonitorManager::displayWasUpdated()
2011         https://bugs.webkit.org/show_bug.cgi?id=199808
2012         <rdar://problem/53070144>
2013
2014         Reviewed by Geoffrey Garen.
2015
2016         Copy m_monitors before iterating over it because the calling displayLinkFired() on the
2017         monitor may end up calling DisplayRefreshMonitorManager::displayDidRefresh() synchronously,
2018         which removes the monitor from m_monitors.
2019
2020         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2021         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
2022
2023 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
2024
2025         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
2026         https://bugs.webkit.org/show_bug.cgi?id=199783
2027
2028         Reviewed by Mark Lam.
2029
2030         Remove WebAssemblyPrototype.
2031
2032         Tests: imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html
2033                imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html
2034                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.html
2035                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker.html
2036                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.html
2037                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.worker.html
2038                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.html
2039                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker.html
2040                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.html
2041                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html
2042                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html
2043                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html
2044                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.html
2045                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html
2046                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.html
2047                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.worker.html
2048                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.html
2049                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.worker.html
2050                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.html
2051                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.worker.html
2052                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.html
2053                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html
2054                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.html
2055                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html
2056                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.html
2057                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.worker.html
2058                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.html
2059                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.worker.html
2060                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.html
2061                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.worker.html
2062                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.html
2063                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.worker.html
2064                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.html
2065                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.worker.html
2066                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.html
2067                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.worker.html
2068                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.html
2069                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.worker.html
2070                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.html
2071                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker.html
2072                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.html
2073                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.worker.html
2074                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.html
2075                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.worker.html
2076                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.html
2077                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.worker.html
2078                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.html
2079                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.worker.html
2080
2081         * bindings/js/JSDOMWindowBase.cpp:
2082         (WebCore::JSDOMWindowBase::compileStreaming):
2083         (WebCore::JSDOMWindowBase::instantiateStreaming):
2084
2085 2019-07-15  Dean Jackson  <dino@apple.com>
2086
2087         [WebGL] Remove software rendering and simplify context creation on macOS
2088         https://bugs.webkit.org/show_bug.cgi?id=199789
2089
2090         Reviewed by Sam Weinig.
2091
2092         We don't ever want to fall-back to the software renderer. We'd be better
2093         off failing to create the context completely.
2094
2095         Also, the number of fall-back attempts we were making before hitting
2096         the software renderer was overkill. All hardware we support should
2097         handle a 32bpp buffer.
2098
2099         Lastly, we don't want to support supersampling - multisampling only.
2100
2101         I lied… there is one more thing - failing to create the context
2102         was causing an ASSERT trying to remove the GC3D from the global list.
2103
2104         * html/canvas/WebGLRenderingContextBase.cpp:
2105         (WebCore::WebGLRenderingContextBase::create):
2106         * page/Settings.yaml: Remove forceSoftwareWebGL setting.
2107         * platform/graphics/GraphicsContext3DAttributes.h:
2108         * platform/graphics/GraphicsContext3DManager.cpp:
2109         (WebCore::GraphicsContext3DManager::addContext):
2110         (WebCore::GraphicsContext3DManager::removeContext):
2111         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
2112         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2113         (WebCore::GraphicsContext3D::GraphicsContext3D):
2114         (WebCore::setPixelFormat): Deleted.
2115
2116 2019-07-14  Dean Jackson  <dino@apple.com>
2117
2118         Move more WebGL things into unified builds
2119         https://bugs.webkit.org/show_bug.cgi?id=199787
2120
2121         Reviewed by Wenson Hsieh.
2122
2123         Unify as many WebGL files as possible.
2124
2125         * Sources.txt:
2126         * WebCore.xcodeproj/project.pbxproj:
2127         * html/canvas/WebGLFramebuffer.cpp:
2128         * html/canvas/WebGLObject.h: Move a helper function into an inline.
2129         (WebCore::objectOrZero):
2130         * html/canvas/WebGLRenderingContextBase.cpp:
2131         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2132         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2133
2134 2019-07-15  Keith Rollin  <krollin@apple.com>
2135
2136         Add missing webgpu includes
2137         https://bugs.webkit.org/show_bug.cgi?id=199802
2138         <rdar://problem/53119120>
2139
2140         Reviewed by Myles C. Maxfield.
2141
2142         WHLSLFunctionWriter.cpp fails to compile on tvOS and watchOS due to
2143         missing includes. This file likely compiles on other platforms due to
2144         the Unified Sources facility that clumps several implementation files
2145         together, exposing those implementation files to the others' includes.
2146         It fails on tvOS and watchOS due to the different ways these
2147         implementation files can get clumped together on different platforms.
2148
2149         No new tests as there is no functional change.
2150
2151         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2152
2153 2019-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2154
2155         Unreviewed, rolling out r247440.
2156
2157         Broke builds
2158
2159         Reverted changeset:
2160
2161         "[JSC] Improve wasm wpt test results by fixing miscellaneous
2162         issues"
2163         https://bugs.webkit.org/show_bug.cgi?id=199783
2164         https://trac.webkit.org/changeset/247440
2165
2166 2019-07-15  Daniel Bates  <dabates@apple.com>
2167
2168         Typing into a cell in a Google Sheet lags behind by one character
2169         https://bugs.webkit.org/show_bug.cgi?id=199587
2170         <rdar://problem/51616845>
2171
2172         Reviewed by Brent Fulgham.
2173
2174         Add a Google Sheets quirk. Put all DOM timers scheduled from keydown and keypress event listeners
2175         into a holding tank. The timers continue to tick, but are barred from executing their action until
2176         the next text insertion or deletion or 32 ms (on device) have elapsed, whichever is sooner. We only
2177         allocate a holding tank once per document, only if the quirk is active, and this allocation is done
2178         when the document schedules a timer on keydown or keypress. The holding tank lives for the lifetime
2179         of the document.
2180
2181         The story behind the quirk:
2182
2183         On keypress Google Sheets schedules timers and expects that a DOM update will occur (i.e. text
2184         will be inserted or deleted) within the same event loop iteration as the dispatched keypress. The
2185         UI Events spec. [1] makes no such guarantee of when a DOM update must occur in relation to the keypress
2186         event. It could happen in the same event loop iteration as the key press (as Google expects), the
2187         next iteration, 500ms later, 2 minutes later, etc. What the spec does guarantee is that by the time
2188         a DOM input event is dispatched that the DOM will be updated. And this is the solution to the problem
2189         Google Sheets is trying to solve, but is doing so using pre-IE 9 technology (though similar
2190         functionality was available via onpropertychange in IE < 9).
2191
2192         See also <https://github.com/w3c/uievents/issues/238>, which is tracking a spec. text update for
2193         this quirk.
2194
2195         Test: fast/events/ios/dom-update-on-keydown-quirk.html
2196
2197         [1] <https://w3c.github.io/uievents/> (Editor's Draft, 14 October 2018)
2198
2199         * SourcesCocoa.txt:
2200         * WebCore.xcodeproj/project.pbxproj:
2201         Add some files to the project.
2202
2203         * dom/Document.cpp:
2204         (WebCore::Document::domTimerHoldingTank): Added.
2205         * dom/Document.h:
2206         (WebCore::Document::domTimerHoldingTankIfExists): Added.
2207
2208         * page/DOMTimer.cpp:
2209         (WebCore::DOMTimer::install): Put the newly instantiated timer into the holding tank.
2210         (WebCore::DOMTimer::removeById): Remove the timer from the holding tank.
2211         (WebCore::DOMTimer::fired): Check if the timer is in the holding tank. If it is and it is a one-
2212         shot timer then schedule it for the next event loop iteration. If it's a repeating timer just
2213         let it continue ticking. Otherwise, do what we no now and execute the timer's action. The reason
2214         we do not suspend timers in the holding tank is because:
2215             1. Far out timers (Google Sheets registers timers as far out as 5 minutes!) are not penalized.
2216             Though smart supension logic could avoid this. See (3).
2217
2218             2. Empirical observations indicate that the keyboard will perform the insertion or deletion
2219             reasonably quickly (not the same event loop iteration as the keydown, but within two iterations out).
2220             So, the timers in the holding tank are short-lived.
2221
2222             3. Simplifies the code. There is no need to keep additional bookkeeping to track multiple timer
2223             suspension reasons (timers currently can only have one suspension reason) or alternatively defer
2224             scheduling a timer until a later time and computing a new "fair" firing time when scheduled.
2225         * page/EventHandler.cpp:
2226         (WebCore::EventHandler::internalKeyEvent): Place a token on the stack to put all DOM timers
2227         scheduled on keydown and keypress into the holding tank if the quirk is enabled.
2228         * page/Quirks.cpp:
2229         (WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const): Added.
2230         * page/Quirks.h:
2231         * page/Settings.yaml: Added setting so that this quirk can be enabled from a layout test. This setting
2232         also lets us enable the quirk for all sites or for certain third-party apps if desired.
2233         * page/ios/DOMTimerHoldingTank.cpp: Added.
2234         (WebCore::DOMTimerHoldingTank::DOMTimerHoldingTank):
2235         (WebCore::DOMTimerHoldingTank::add):
2236         (WebCore::DOMTimerHoldingTank::remove):
2237         (WebCore::DOMTimerHoldingTank::contains):
2238         (WebCore::DOMTimerHoldingTank::removeAll):
2239         (WebCore::DOMTimerHoldingTank::stopExceededMaximumHoldTimer):
2240         * page/ios/DOMTimerHoldingTank.h: Added.
2241         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
2242         (WebCore::DeferDOMTimersForScope::~DeferDOMTimersForScope):
2243         (WebCore::DeferDOMTimersForScope::isDeferring):
2244
2245 2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>
2246
2247         Unreviewed, rolling out r247397, r247378, r247366.
2248
2249         Broke watchOS builds.
2250
2251         Reverted changesets:
2252
2253         "[WebGPU] Implement GPUError and error scopes"
2254         https://bugs.webkit.org/show_bug.cgi?id=199655
2255         https://trac.webkit.org/changeset/247366/webkit
2256
2257         "[WebGPU] Move error scopes out of GPUDevice for more portable error generation"
2258         https://bugs.webkit.org/show_bug.cgi?id=199740
2259         https://trac.webkit.org/changeset/247397/webkit
2260
2261 2019-07-15  Rob Buis  <rbuis@igalia.com>
2262
2263         MathML WPT test for RadicalDegreeBottomRaisePercent fails
2264         https://bugs.webkit.org/show_bug.cgi?id=183631
2265
2266         Reviewed by Frédéric Wang.
2267
2268         When stretching the radical operator also take thickness
2269         and radical gap into account:
2270         https://mathml-refresh.github.io/mathml-core/#radicals-msqrt-mroot
2271
2272         Test: imported/w3c/web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1.html
2273
2274         * rendering/mathml/RenderMathMLRoot.cpp:
2275         (WebCore::RenderMathMLRoot::layoutBlock):
2276
2277 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
2278
2279         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
2280         https://bugs.webkit.org/show_bug.cgi?id=199783
2281
2282         Reviewed by Mark Lam.
2283
2284         Remove WebAssemblyPrototype.
2285
2286         Tests: imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html
2287                imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html
2288                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.html
2289                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker.html
2290                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.html
2291                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.worker.html
2292                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.html
2293                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker.html
2294                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.html
2295                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html
2296                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html
2297                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html
2298                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.html
2299                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html
2300                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.html
2301                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.worker.html
2302                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.html
2303                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.worker.html
2304                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.html
2305                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.worker.html
2306                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.html
2307                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html
2308                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.html
2309                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html
2310                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.html
2311                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.worker.html
2312                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.html
2313                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.worker.html
2314                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.html
2315                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.worker.html
2316                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.html
2317                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.worker.html
2318                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.html
2319                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.worker.html
2320                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.html
2321                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.worker.html
2322                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.html
2323                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.worker.html
2324                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.html
2325                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker.html
2326                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.html
2327                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.worker.html
2328                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.html
2329                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.worker.html
2330                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.html
2331                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.worker.html
2332                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.html
2333                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.worker.html
2334
2335         * bindings/js/JSDOMWindowBase.cpp:
2336         (WebCore::JSDOMWindowBase::compileStreaming):
2337         (WebCore::JSDOMWindowBase::instantiateStreaming):
2338
2339 2019-07-15  Youenn Fablet  <youenn@apple.com>
2340
2341         Enable a debug WebRTC mode without any encryption
2342         https://bugs.webkit.org/show_bug.cgi?id=199177
2343         <rdar://problem/52074986>
2344
2345         Reviewed by Eric Carlson.
2346
2347         For every RTCPeerConnection, first set whether to use encryption or not
2348         based on page settings.
2349         If encryption is disabled, log it.
2350         Add internals API to toggle the switch from tests.
2351         Test: webrtc/disable-encryption.html
2352
2353         * Modules/mediastream/RTCPeerConnection.cpp:
2354         (WebCore::RTCPeerConnection::RTCPeerConnection):
2355         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2356         (WebCore::createLibWebRTCPeerConnectionBackend):
2357         * inspector/agents/InspectorPageAgent.cpp:
2358         * page/Settings.yaml:
2359         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2360         (WebCore::LibWebRTCProvider::setEnableWebRTCEncryption):
2361         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2362         * testing/Internals.cpp:
2363         (WebCore::Internals::resetToConsistentState):
2364         (WebCore::Internals::setEnableWebRTCEncryption):
2365         * testing/Internals.h:
2366         * testing/Internals.idl:
2367
2368 2019-07-15  Sihui Liu  <sihui_liu@apple.com>
2369
2370         window.openDatabase is not writable
2371         https://bugs.webkit.org/show_bug.cgi?id=199737
2372         <rdar://problem/52551332>
2373
2374         Reviewed by Chris Dumez.
2375
2376         In r246707 we made openDatabase an undetectable attribute of window, and it was set to be read-only. This broke 
2377         some sites which replace window.openDatabase with their own implementation when window.openDatabase does not 
2378         exists or WebSQL is not implemented. 
2379
2380         This patch removes the readonly property and adds a setter for openDatabase.
2381
2382         * Modules/webdatabase/DOMWindowWebDatabase.idl:
2383         * bindings/js/JSDOMWindowCustom.cpp:
2384         (WebCore::JSDOMWindow::setOpenDatabase):
2385
2386 2019-07-15  Youenn Fablet  <youenn@apple.com>
2387
2388         Filter SDP c lines
2389         https://bugs.webkit.org/show_bug.cgi?id=199791
2390
2391         Reviewed by Eric Carlson.
2392
2393         As discussed in https://github.com/rtcweb-wg/mdns-ice-candidates/issues/91,
2394         use 0.0.0.0 for c lines when filtering the SDP.
2395         Covered by updated test.
2396
2397         * Modules/mediastream/PeerConnectionBackend.cpp:
2398         (WebCore::PeerConnectionBackend::filterSDP const):
2399
2400 2019-07-15  Zalan Bujtas  <zalan@apple.com>
2401
2402         naver.com: Video stops when tapping on the video to use buttons
2403         https://bugs.webkit.org/show_bug.cgi?id=199784
2404         <rdar://problem/48068610>
2405
2406         Reviewed by Maciej Stachowiak.
2407
2408         Opt out of simulated mouse event sending for tv.naver.com.
2409         When tv.naver.com receives the simulated mouseUp at touchEnd, it pauses the video right away and calls preventDefault()
2410         which prevents us from running the hover heuristics.
2411
2412         * page/Quirks.cpp:
2413         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2414
2415 2019-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2416
2417         [GTK] GitHub breaks on FreeBSD because of "unsupported browser"
2418         https://bugs.webkit.org/show_bug.cgi?id=199745
2419
2420         Reviewed by Carlos Garcia Campos.
2421
2422         It's been a while since I last updated the fake version numbers in our user agent, both for
2423         the user agent quirks for naughty websites and also the Safari version in our standard user
2424         agent. Update them. This should fix github.com on FreeBSD at least. I also noticed some
2425         wonkiness on Google Docs recently that I thought required this update, but I didn't do
2426         anything about it at the time because I wasn't able to reproduce the issue when I tried
2427         again later.
2428
2429         This could absolutely break websites, because the web is awful, but that's calculated risk.
2430
2431         * platform/UserAgentQuirks.cpp:
2432         (WebCore::UserAgentQuirks::stringForQuirk):
2433         * platform/glib/UserAgentGLib.cpp:
2434         (WebCore::buildUserAgentString):
2435
2436 2019-07-14  Chris Dumez  <cdumez@apple.com>
2437
2438         Add threading assertion to WeakPtrFactory::createWeakPtr()
2439         https://bugs.webkit.org/show_bug.cgi?id=199639
2440
2441         Reviewed by Ryosuke Niwa.
2442
2443         * platform/ScrollableArea.cpp:
2444         * rendering/RenderObject.cpp:
2445
2446 2019-07-14  Dean Jackson  <dino@apple.com>
2447
2448         WebGL not supported on WKWebView on UIKit for Mac
2449         https://bugs.webkit.org/show_bug.cgi?id=199785
2450         <rdar://problem/52911449>
2451
2452         Reviewed by Antoine Quint.
2453
2454         UIKit for Mac was not creating a CGLPixelFormatObj because
2455         it wasn't using the code hidden in PLATFORM(MAC). Instead
2456         we should be guarding for USE(OPENGL).
2457
2458         There are still some inconsistencies: <rdar://53062794>
2459
2460         Test: webgl/smell-test.html
2461
2462         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2463         (WebCore::GraphicsContext3D::GraphicsContext3D):
2464         (WebCore::GraphicsContext3D::allowOfflineRenderers const): We have to return
2465         true for this, since we don't have access to the Window Server.
2466
2467 2019-07-13  Wenson Hsieh  <wenson_hsieh@apple.com>
2468
2469         [Text autosizing] [iPadOS] Further adjust our heuristics to determine text autosizing candidates
2470         https://bugs.webkit.org/show_bug.cgi?id=199780
2471         <rdar://problem/52289088>
2472
2473         Reviewed by Simon Fraser.
2474
2475         Our current idempotent text autosizing candidate heuristic makes the right judgment call most of the time, but
2476         there is still a large batch of text autosizing bugs left unfixed by the first iteration of the heuristic added
2477         in r246781. This patch attempts to address most of these bugs by adjusting the decision-tree-based heuristic
2478         once again, mostly with improvements to the model generation pipeline.
2479
2480         During the first iteration, I placed emphasis on tuning the max tree depth and min leaf size hyperparameters
2481         when coming up with my decision tree, and didn't consider the inclusion or exclusion of each feature as a
2482         hyperparameters. As such, the trees generated using the pipeline tended to use too many features, and as a
2483         result, tended to have cross-validation overall accuracy scores hovering around 73%.
2484
2485         In this revised model generation pipeline, I now consider the inclusion of each feature (along with max depth
2486         and min leaf size, as before) as a hyperparameter. Since this increases the number of hyperparameters by many
2487         orders of magnitude, a naive grid search (as described in the prior ChangeLog entry) is no longer a tractible
2488         procedure for tuning hyperparameters to the training algorithm.
2489
2490         Instead, I now use a stochastic greedy algorithm to search for good sets of hyperparameters; this process begins
2491         with seeding some number (usually 20-24) of "searchers" with completely randomized sets of hyperparameters (i.e.
2492         random max depth, random leaf size, and random subsets of features). I then evaluate the average performance of
2493         each set of hyperparameters by using them to generate 2000 decision trees over 90% of the training data, and
2494         then cross-validating these trees against the remaining 10%. These cross-validation scores are aggregated into a
2495         single confusion matrix, which is then passed into a loss function that computes a single value indicating how
2496         well training with the set of hyperparameters generalized to cross-validation data. After experimenting with
2497         various loss functions, I settled on the following:
2498
2499         `k(false positive rate)^2 + (false negative rate)^2`
2500
2501         ...where a constant k is chosen to penalize false positives (i.e. broken layout) more harshly than false
2502         negatives (small text). Additionally, squaring the false negative and false positive rates seems to help avoid
2503         converging on solutions that heavily favor reducing only false positives or false negatives, or vice versa.
2504
2505         The stochastic algorithm starts by computing a loss value for the randomly generated configuration. Then, for
2506         an indefinite number of iterations, it randomly mutates the configuration (e.g. by adding or removing features,
2507         or changing min leaf size or max tree depth) and computes a new loss value for the mutated configuration. If the
2508         mutated configuration performs better (i.e. achieves lower loss) than the current configuration, I set the
2509         current configuration to be the mutated configuration. Otherwise, I keep the current (non-mutated) configuration
2510         as-is. The stochastic algorithm then proceeds, ad-infinitum, with this current configuration.
2511
2512         Of course, since each mutation is small, this strategy so far is prone to leaving each searcher stuck in local
2513         optima. To mitigate this, for each searcher, I keep track of a side-table of configurations that have already
2514         been tested; when random mutations would normally lead to testing a configuration that has already been tested,
2515         each searcher instead increases the chance of applying additional mutations. This has the effect of searchers
2516         initially exhausting similar configurations, and expanding to test more and more dissimilar configurations as
2517         the local alternatives all turn out to be worse. This allows searchers to effectively jump out of local optima
2518         after being stuck for a long time.
2519
2520         So, using these strategies, I simultaneously ran a handful of searchers until they all appeared to converge
2521         (a process that takes 8-12 hours on my current dataset). Many of the searchers achieved configurations with
2522         cross-validation scores of 81% and above, up from the 73% of the previous attempt. These additionally have the
2523         added bonus of reducing the number of features, often making the final trees themselves shallower and simpler to
2524         understand than before.
2525
2526         This patch introduces one such decision tree generated using a set of hyperparameters acquired via this
2527         stochasic search algorithm; it appears to simultaneously use fewer features, and achieve better cross-validation
2528         performance.
2529
2530         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
2531
2532         * css/StyleResolver.cpp:
2533         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
2534
2535         Adjust the early return to bail if either (1) the element is a candidate and the computed size is already equal
2536         to the boosted size, or (2) the element is not a candidate and the computed size is already equal to the
2537         specified size. Since the autosizing candidate heuristic depends on styles specified on the element itself (as
2538         opposed to styles on any element in the ancestor chain), a parent may be an autosizing candidate, but a child of
2539         it may not.
2540
2541         * rendering/style/RenderStyle.cpp:
2542         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
2543
2544         Revamp the idempotent text autosizing candidate heuristic. See the explanation above for more details.
2545
2546         * rendering/style/RenderStyle.h:
2547
2548         Remove some bits from RenderStyle's autosizeStatus, now that we care about fewer bits of information from the
2549         inherited flags.
2550
2551         * rendering/style/TextSizeAdjustment.cpp:
2552         (WebCore::AutosizeStatus::updateStatus):
2553         * rendering/style/TextSizeAdjustment.h:
2554
2555 2019-07-13  Simon Fraser  <simon.fraser@apple.com>
2556
2557         Don't do async overflow scrolling for visibility:hidden scrollers
2558         https://bugs.webkit.org/show_bug.cgi?id=199779
2559
2560         Reviewed by Dean Jackson.
2561         
2562         An overflow:scroll with visibility:hidden is not scrollable on macOS, even if it has visible
2563         content. So disable async overflow:scroll when the scroller has non-visible visibility (this also
2564         takes visibility on ancestors into account).
2565         
2566         visibility:hidden overflow:scroll can be common because some JS libraries use it
2567         (https://github.com/wnr/element-resize-detector).
2568
2569         Test: compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers.html
2570
2571         * rendering/RenderLayer.cpp:
2572         (WebCore::RenderLayer::canUseCompositedScrolling const): Don't use hasVisibleContent() because
2573         that's affected by  visible children.
2574
2575 2019-07-13  Robin Morisset  <rmorisset@apple.com>
2576
2577         [WHLSL] Return statements don't need to keep track of the function they're in
2578         https://bugs.webkit.org/show_bug.cgi?id=199763
2579
2580         Reviewed by Myles C. Maxfield.
2581
2582         Return::m_function is only used in the Checker, and it can easily enough keep track of the current function.
2583         This means we no longer need to keep track of the current function in the NameResolver, and we can save 8 bytes per Return
2584
2585         Since I was touching the NameResolver I also removed a few pointless overrides of Visitor::visit().
2586
2587         No new tests as there is no intended functional change.
2588
2589         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
2590         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2591         (WebCore::WHLSL::Checker::visit):
2592         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2593         (WebCore::WHLSL::NameResolver::NameResolver):
2594         (WebCore::WHLSL::resolveTypeNamesInFunctions):
2595         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
2596
2597 2019-07-13  Andres Gonzalez  <andresg_22@apple.com>
2598
2599         Add accessibility support to WKDataListSuggestionsView.
2600         https://bugs.webkit.org/show_bug.cgi?id=199772
2601         <rdar://problem/47095851>
2602
2603         Reviewed by Chris Fleizach.
2604
2605         Localizable strings for accessibility announcements.
2606
2607         * en.lproj/Localizable.strings:
2608
2609 2019-07-13  Chris Dumez  <cdumez@apple.com>
2610
2611         Drop non thread-safe usage of WeakPtr in VideoFullscreenInterfaceAVKit
2612         https://bugs.webkit.org/show_bug.cgi?id=199775
2613
2614         Reviewed by Eric Carlson.
2615
2616         The VideoFullscreenInterfaceAVKit constructor was making a weakPtr on the UI Thread
2617         of an WebThread object. The WeakPtr would then be used as a data member throughout
2618         the class on the UIThread. This is not thread-safe.
2619
2620         This patch switches to using a raw pointer instead of a WeakPtr. This is a partial
2621         rollout of r243298, which turned the raw pointer into a WeakPtr for hardening
2622         purposes. For extra safety, this patch updates the VideoFullscreenControllerContext
2623         so that it notifies its clients (i.e. PlaybackSessionInterfaceAVKit) that it is
2624         getting destroyed, so that they can null-out their m_videoFullscreenModel &
2625         m_fullscreenChangeObserver data members. This gives the sames guarantees as WeakPtr
2626         but in a thread-safe way.
2627
2628         This is very similar to the fix that was done for PlaybackSessionInterfaceAVKit in
2629         r247380.
2630
2631         * platform/cocoa/VideoFullscreenModel.h:
2632         (WebCore::VideoFullscreenModelClient::modelDestroyed):
2633         * platform/ios/VideoFullscreenInterfaceAVKit.h:
2634         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2635         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
2636         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
2637         (VideoFullscreenInterfaceAVKit::modelDestroyed):
2638         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2639         (VideoFullscreenControllerContext::~VideoFullscreenControllerContext):
2640
2641 2019-07-13  Zalan Bujtas  <zalan@apple.com>
2642
2643         Cannot bring up custom media controls at all on v.youku.com
2644         https://bugs.webkit.org/show_bug.cgi?id=199699
2645         <rdar://problem/51835327>
2646
2647         Reviewed by Simon Fraser.
2648
2649         The "find the node under the finger" heuristic should only find nodes that are visible to hit-testing.
2650
2651         When the user taps on the screen, we run a "find the best node under the finger" heuristic and use the node's location
2652         to dispatch the associated event (e.g. mousePressed).
2653         Ideally the "best node under the finger" and the final target node for the associated event are the same.
2654         However these two methods configure the hit-testing process differently which could lead to node mismatch.
2655         The "best node" heuristic calls hit-testing with AllowChildFrameContent. This flag allows hit-testing to descend into
2656         subframes even if the subframe is not visible to hit-testing (visibility: hidden).
2657         While event dispatching never descends into subfames through hit-testing, but instead it forwards the dispatching to subframes that are visible to hit-testing.
2658
2659         This patch addresses the mismatching node issue by calling the descending version of hit-testing with a flag that enforces visiblity check before descending into a subframe.
2660
2661         Tests: fast/events/touch/ios/visibility-hidden-iframe-click.html
2662                fast/events/touch/ios/visibility-hidden-nested-iframe-click.html
2663
2664         * page/ios/FrameIOS.mm:
2665         (WebCore::Frame::hitTestResultAtViewportLocation):
2666         * rendering/HitTestRequest.h:
2667         (WebCore::HitTestRequest::skipsChildFrameContentInvisibleToHitTest const):
2668         * rendering/RenderWidget.cpp:
2669         (WebCore::RenderWidget::nodeAtPoint):
2670
2671 2019-07-13  Chris Dumez  <cdumez@apple.com>
2672
2673         Fix non thread-safe usage of makeWeakPtr() in MediaPlayerPrivateAVFoundation
2674         https://bugs.webkit.org/show_bug.cgi?id=199777
2675
2676         Reviewed by Eric Carlson.
2677
2678         The code was calling makeWeakPtr() on a main-thread object, from a background thread.
2679         This is not thread safe. To address the issue, this patches creates the WeakPtr ahead
2680         of time, on the main thread.
2681
2682         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2683         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
2684         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
2685         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
2686         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2687
2688 2019-07-12  Thibault Saunier  <tsaunier@igalia.com>
2689
2690         [GStreamer] Mock GStreamer realtime sources should keep a Ref of their mock realtime media sources
2691         https://bugs.webkit.org/show_bug.cgi?id=194326
2692
2693         WrappedMockRealtimeVideoSource is a subclass of RealtimeMediaSource which is refcounted, we can't
2694         use a unique_ptr on those.
2695
2696         Also changed m_wrappedSource type to its actual type so it is cleaner even if needed
2697         to upcast it to RealtimeMediaSource so some method that are made private in the mock
2698         can still be called.
2699
2700         Reviewed by Youenn Fablet.
2701
2702         This fixes MediaStream tests
2703
2704         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
2705         (WebCore::WrappedMockRealtimeAudioSource::create):
2706         (WebCore::WrappedMockRealtimeAudioSource::asRealtimeMediaSource):
2707         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource):
2708         (WebCore::m_wrappedSource):
2709         (WebCore::MockGStreamerAudioCaptureSource::startProducingData):
2710         (WebCore::MockGStreamerAudioCaptureSource::settings):
2711         (WebCore::MockGStreamerAudioCaptureSource::capabilities):
2712         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
2713         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
2714         (WebCore::WrappedMockRealtimeVideoSource::create):
2715         (WebCore::WrappedMockRealtimeVideoSource::asRealtimeMediaSource):
2716         (WebCore::WrappedMockRealtimeVideoSource::WrappedMockRealtimeVideoSource):
2717         (WebCore::m_wrappedSource):
2718         (WebCore::MockGStreamerVideoCaptureSource::settings):
2719         (WebCore::MockGStreamerVideoCaptureSource::capabilities):
2720         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
2721
2722 2019-07-12  Alex Christensen  <achristensen@webkit.org>
2723
2724         Change RELEASE_ASSERT in DocumentWriter::addData to ASSERT and early return
2725         https://bugs.webkit.org/show_bug.cgi?id=199756
2726         <rdar://problem/51554775>
2727
2728         Reviewed by Brady Eidson.
2729
2730         Attempts to reach this assertion were unsuccessful, but sometimes this assertion crashes.
2731         Let's change it to an early return to prevent crashes.
2732
2733         * loader/DocumentWriter.cpp:
2734         (WebCore::DocumentWriter::addData):
2735
2736 2019-07-12  Justin Fan  <justin_fan@apple.com>
2737
2738         [WebGPU] Move error scopes out of GPUDevice for more portable error generation
2739         https://bugs.webkit.org/show_bug.cgi?id=199740
2740
2741         Reviewed by Myles C. Maxfield.
2742
2743         Move error generation into a separate RefCounted class to allow GPU objects to generate 
2744         errors independent of any GPUDevice.
2745         Create GPUObjectBase to delegate error generation and refactor GPUBuffer to inherit from GPUObjectBase.
2746
2747         No behavior change or new tests. Error scopes covered by error-scopes-test.html.
2748
2749         * Modules/webgpu/WebGPUDevice.cpp:
2750         (WebCore::WebGPUDevice::WebGPUDevice): Now creates a GPUErrorGenerator.
2751         (WebCore::WebGPUDevice::createBuffer const): Pass the GPUErrorGenerator to any created GPUBuffer.
2752         (WebCore::WebGPUDevice::createBufferMapped const): Ditto.
2753         (WebCore::WebGPUDevice::popErrorScope): Shouldn't be const. Can just ask for the GPUError rather than passing a lambda.
2754         (WebCore::WebGPUDevice::pushErrorScope const): Deleted.
2755         (WebCore::WebGPUDevice::popErrorScope const): Deleted.
2756         * Modules/webgpu/WebGPUDevice.h:
2757         (WebCore::WebGPUDevice::pushErrorScope):
2758         * Sources.txt:
2759         * WebCore.xcodeproj/project.pbxproj:
2760         * platform/graphics/gpu/GPUBuffer.h: Now inherits from GPUObjectBase for error generation ease.
2761         * platform/graphics/gpu/GPUDevice.cpp:
2762         (WebCore::GPUDevice::tryCreateBuffer): Ensure GPUBuffers reference the GPUErrorGenerator.
2763         (WebCore::GPUDevice::pushErrorScope): Deleted. No longer needed here.
2764         (WebCore::GPUDevice::popErrorScope): Deleted.
2765         (WebCore::GPUDevice::registerError): Deleted.
2766         * platform/graphics/gpu/GPUDevice.h: Move error scope logic out.
2767         * platform/graphics/gpu/GPUErrorGenerator.cpp: Added.
2768         (WebCore::GPUErrorGenerator::pushErrorScope):
2769         (WebCore::GPUErrorGenerator::popErrorScope):
2770         (WebCore::GPUErrorGenerator::generateError):
2771         * platform/graphics/gpu/GPUErrorGenerator.h: Added.
2772         (WebCore::GPUErrorGenerator::create):
2773         * platform/graphics/gpu/GPUObjectBase.h: Added.
2774         (WebCore::GPUObjectBase::generateError):
2775         (WebCore::GPUObjectBase::GPUObjectBase):
2776         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Use the GPUErrorGenerator directly during buffer creation.
2777         (WebCore::GPUBuffer::validateBufferUsage):
2778         (WebCore::GPUBuffer::tryCreate):
2779         (WebCore::GPUBuffer::GPUBuffer):
2780         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2781         (WebCore::GPUQueue::submit): Prevent possible null dereference.
2782
2783 2019-07-12  Youenn Fablet  <youenn@apple.com>
2784
2785         Add release logging for quota checks
2786         https://bugs.webkit.org/show_bug.cgi?id=199697
2787
2788         Reviewed by Alex Christensen.
2789
2790         Log whether a request to extend quota is made and the result of the request.
2791         This logging should happen in the networking process.
2792         No change of behavior.
2793
2794         * platform/Logging.h:
2795         * storage/StorageQuotaManager.cpp:
2796         (WebCore::StorageQuotaManager::askForMoreSpace):
2797         (WebCore::StorageQuotaManager::processPendingRequests):
2798
2799 2019-07-12  Youenn Fablet  <youenn@apple.com>
2800
2801         Stopping a cloned MediaStream video track should not stop any other video track
2802         https://bugs.webkit.org/show_bug.cgi?id=199635
2803
2804         Reviewed by Eric Carlson.
2805
2806         In case a track is requesting its source to end, the
2807         RealtimeVideoSource should request its own source to end and not stop it directly.
2808
2809         Also, if a track is removing itself as an observer to a RealtimeVideoSource, we should
2810         stop the underlying source only if this one does not have any other observer.
2811         Covered by updated test.
2812
2813         * platform/mediastream/RealtimeMediaSource.cpp:
2814         (WebCore::RealtimeMediaSource::removeObserver):
2815         * platform/mediastream/RealtimeMediaSource.h:
2816         * platform/mediastream/RealtimeVideoSource.cpp:
2817         (WebCore::RealtimeVideoSource::requestToEnd):
2818         (WebCore::RealtimeVideoSource::stopBeingObserved):
2819         * platform/mediastream/RealtimeVideoSource.h:
2820
2821 2019-07-12  Timothy Hatcher  <timothy@apple.com>
2822
2823         Drop DarkModeCSSEnabled as an experimental feature and always enable it.
2824         https://bugs.webkit.org/show_bug.cgi?id=199725
2825         rdar://problem/52970972
2826
2827         Reviewed by Megan Gardner.
2828
2829         Tests: css-dark-mode
2830
2831         * css/CSSComputedStyleDeclaration.cpp:
2832         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
2833         * css/MediaQueryEvaluator.cpp:
2834         (WebCore::prefersColorSchemeEvaluate):
2835         * css/MediaQueryExpression.cpp:
2836         (WebCore::featureWithValidIdent):
2837         (WebCore::isFeatureValidWithoutValue):
2838         * css/parser/CSSPropertyParser.cpp:
2839         (WebCore::CSSPropertyParser::parseSingleValue):
2840         * html/HTMLMetaElement.cpp:
2841         (WebCore::HTMLMetaElement::process):
2842         * page/RuntimeEnabledFeatures.h:
2843         (WebCore::RuntimeEnabledFeatures::setDarkModeCSSEnabled): Deleted.
2844         (WebCore::RuntimeEnabledFeatures::darkModeCSSEnabled const): Deleted.
2845
2846 2019-07-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2847
2848         Refactor ShadowBlur: remove some class variables and use function parameters instead.
2849         https://bugs.webkit.org/show_bug.cgi?id=199511
2850
2851         Reviewed by Said Abou-Hallawa.
2852
2853         On the ShadowBlur class it is confusing to know if the status of the m_layerImage buffer or the
2854         values calculated by calculateLayerBoundingRect() are valid between the different function calls.
2855
2856         To avoid this problem, pass this values as function parameters instead of storing them in the class.
2857
2858         No new tests, no intended behaviour change.
2859
2860         * platform/graphics/ShadowBlur.cpp:
2861         (WebCore::ShadowBlur::ShadowBlur):
2862         (WebCore::ShadowBlur::calculateLayerBoundingRect):
2863         (WebCore::ShadowBlur::drawShadowBuffer):
2864         (WebCore::ShadowBlur::drawRectShadow): Pass the parameters from the callback.
2865         (WebCore::ShadowBlur::drawInsetShadow): Ditto.
2866         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
2867         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
2868         (WebCore::ShadowBlur::drawRectShadowWithTiling):
2869         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
2870         (WebCore::ShadowBlur::drawLayerPieces):
2871         (WebCore::ShadowBlur::drawLayerPiecesAndFillCenter):
2872         (WebCore::ShadowBlur::blurShadowBuffer):
2873         (WebCore::ShadowBlur::blurAndColorShadowBuffer):
2874         (WebCore::ShadowBlur::drawShadowLayer):
2875         * platform/graphics/ShadowBlur.h: Use a struct to pass the values calculated on calculateLayerBoundingRect().
2876
2877 2019-07-12  Adrian Perez de Castro  <aperez@igalia.com>
2878
2879         [ATK] Avoid unneeded call to to core(selection) in listObjectForSelection()
2880         https://bugs.webkit.org/show_bug.cgi?id=199748
2881         <rdar://problem/52995908>
2882
2883         Reviewed by Konstantin Tokarev.
2884
2885         No new tests needed.
2886
2887         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
2888         (listObjectForCoreSelection): Renamed from listObjectForSelection() and remove the
2889         unneeded call to core() now that coreSelection is passed directly to the function.
2890         (optionFromList): Change to pass coreSelection directly to listObjectForCoreSelection().
2891
2892 2019-07-11  Chris Dumez  <cdumez@apple.com>
2893
2894         Fix non-thread safe use of makeWeakPtr() under MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify()
2895         https://bugs.webkit.org/show_bug.cgi?id=199727
2896
2897         Reviewed by Eric Carlson.
2898
2899         Stop calling makeWeakPtr() on a main thread object from a background thread.
2900
2901         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2902         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
2903
2904 2019-07-11  Youenn Fablet  <youenn@apple.com>
2905
2906         Register a MediaStreamTrack as media producer only if it is a capture track
2907         https://bugs.webkit.org/show_bug.cgi?id=199566
2908         <rdar://problem/52761361>
2909
2910         Addressing post-landing comment to simplify setMuted call.
2911         Unreviewed.
2912
2913         * Modules/mediastream/MediaStreamTrack.cpp:
2914         (WebCore::MediaStreamTrack::MediaStreamTrack):
2915
2916 2019-07-11  Youenn Fablet  <youenn@apple.com>
2917
2918         Protect CoreAudioSharedUnit::m_clients for accessing in different threads simultaneously
2919         https://bugs.webkit.org/show_bug.cgi?id=199717
2920
2921         Reviewed by Eric Carlson.
2922
2923         Add a lock whenever accessing to m_clients.
2924         Manual tests show that audio capture still works.
2925
2926         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2927         (WebCore::CoreAudioSharedUnit::addClient):
2928         (WebCore::CoreAudioSharedUnit::removeClient):
2929         (WebCore::CoreAudioSharedUnit::forEachClient const):
2930         (WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
2931         (WebCore::CoreAudioSharedUnit::captureFailed):
2932
2933 2019-07-11  Chris Dumez  <cdumez@apple.com>
2934
2935         Drop non thread-safe usage of WeakPtr in PlaybackSessionInterfaceAVKit
2936         https://bugs.webkit.org/show_bug.cgi?id=199698
2937
2938         Reviewed by Eric Carlson.
2939
2940         The PlaybackSessionInterfaceAVKit constructor was making a weakPtr on the UI Thread
2941         of an WebThread object. The WeakPtr would then be used as a data member throughout
2942         the class on the UIThread. This is not thread-safe.
2943
2944         This patch switches to using a raw pointer instead of a WeakPtr. This is a partial
2945         rollout of r243337, which turned the raw pointer into a WeakPtr for hardening
2946         purposes. For extra safety, this patch updates the VideoFullscreenControllerContext
2947         so that it notifies its clients (i.e. PlaybackSessionInterfaceAVKit) that it is
2948         getting destroyed, so that they can null-out their m_playbackSessionModel data
2949         member. This gives the sames guarantees than WeakPtr but in a thread-safe way.
2950
2951         * platform/cocoa/PlaybackSessionModel.h:
2952         (WebCore::PlaybackSessionModelClient::modelDestroyed):
2953         * platform/ios/PlaybackSessionInterfaceAVKit.h:
2954         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
2955         (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
2956         (WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
2957         (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
2958         (WebCore::PlaybackSessionInterfaceAVKit::modelDestroyed):
2959         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2960         (VideoFullscreenControllerContext::~VideoFullscreenControllerContext):
2961         (VideoFullscreenControllerContext::addClient):
2962         (VideoFullscreenControllerContext::removeClient):
2963
2964 2019-07-11  Simon Fraser  <simon.fraser@apple.com>
2965
2966         Fix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.
2967
2968         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2969         (WebCore::fontWithFamilySpecialCase):
2970
2971 2019-07-11  Justin Fan  <justin_fan@apple.com>
2972
2973         Unreviewed build fix.
2974
2975         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Missing include.
2976
2977 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
2978
2979         New York font erroneously gets synthetic bold
2980         https://bugs.webkit.org/show_bug.cgi?id=199653
2981         <rdar://problem/51692592>
2982
2983         Reviewed by Simon Fraser.
2984
2985         This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
2986         and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
2987         to expose these fonts to the web because we don't a standardization story for them
2988         yet, but we do want some apps to be able to use them.
2989
2990         WebKit clients who want to use these fonts can set
2991         -[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.
2992
2993         The patch generalizes our existing system-ui infrastructure to handle these three
2994         additional fonts. It also explicitly disables the unsupported dot-prefixed names
2995         so they don't leak out into Web content.
2996
2997         Tests: fast/text/design-system-ui-10.html
2998                fast/text/design-system-ui-11.html
2999                fast/text/design-system-ui-12.html
3000                fast/text/design-system-ui-13.html
3001                fast/text/design-system-ui-14.html
3002                fast/text/design-system-ui-15.html
3003                fast/text/design-system-ui-16.html
3004                fast/text/design-system-ui-2.html
3005                fast/text/design-system-ui-3.html
3006                fast/text/design-system-ui-4.html
3007                fast/text/design-system-ui-5.html
3008                fast/text/design-system-ui-6.html
3009                fast/text/design-system-ui-7.html
3010                fast/text/design-system-ui-8.html
3011                fast/text/design-system-ui-9.html
3012                fast/text/design-system-ui.html
3013
3014         * css/CSSFontFace.cpp:
3015         (WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
3016         * css/CSSFontFace.h:
3017         * css/CSSFontFaceSource.cpp:
3018         (WebCore::CSSFontFaceSource::load):
3019         * css/StyleResolver.cpp:
3020         (WebCore::StyleResolver::initializeFontStyle):
3021         * page/Settings.yaml:
3022         * platform/graphics/FontDescription.cpp:
3023         (WebCore::m_shouldAllowDesignSystemUIFonts):
3024         (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
3025         * platform/graphics/FontDescription.h:
3026         (WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
3027         (WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
3028         (WebCore::FontDescription::operator== const):
3029         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3030         (WebCore::platformFontLookupWithFamily):
3031         (WebCore::fontWithFamily):
3032         * platform/graphics/cocoa/FontCacheCoreText.h:
3033         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3034         (WebCore::systemFontUse):
3035         (WebCore::systemFontCascadeList):
3036         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
3037         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
3038         (WebCore::isSystemFontString): Deleted.
3039         (WebCore::isUIFontTextStyle): Deleted.
3040         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3041         (WebCore::FontPlatformData::ctFont const):
3042         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
3043         (WebCore::SystemFontDatabaseCoreText::createSystemUI):
3044         (WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
3045         (WebCore::SystemFontDatabaseCoreText::createTextStyle):
3046         (WebCore::SystemFontDatabaseCoreText::cascadeList):
3047         (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
3048         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
3049         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
3050         * platform/graphics/ios/FontCacheIOS.mm:
3051         (WebCore::platformFontWithFamilySpecialCase):
3052         * platform/graphics/mac/FontCacheMac.mm:
3053         (WebCore::platformFontWithFamilySpecialCase):
3054         * style/StyleResolveForDocument.cpp:
3055         (WebCore::Style::resolveForDocument):
3056         * svg/graphics/SVGImage.cpp:
3057         (WebCore::SVGImage::dataChanged):
3058         * testing/InternalSettings.cpp:
3059         (WebCore::InternalSettings::Backup::Backup):
3060         (WebCore::InternalSettings::Backup::restoreTo):
3061         (WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
3062         * testing/InternalSettings.h:
3063         * testing/InternalSettings.idl:
3064
3065 2019-07-11  Pablo Saavedra  <psaavedra@igalia.com>
3066
3067         [WPE][GTK] Build failure with ENABLE_ACCESSIBILITY=OFF
3068         https://bugs.webkit.org/show_bug.cgi?id=199625
3069
3070         Added ENABLE(ACCESSIBILITY) and replaced HAVE(ACCESSIBILITY)
3071         with ENABLE(ACCESSIBILITY) in the code.
3072
3073         Additionally, the TestRunner code generator now honors the
3074         Conditional IDL format.
3075
3076         No new tests as there is no intended functional change
3077
3078         Reviewed by Konstantin Tokarev.
3079
3080         * accessibility/AXObjectCache.cpp:
3081         * accessibility/AXObjectCache.h:
3082         * accessibility/AccessibilityObject.cpp:
3083         (WebCore::AccessibilityObject::detach):
3084         (WebCore::AccessibilityObject::isDetached const):
3085         * accessibility/AccessibilityObject.h:
3086         * accessibility/atk/AXObjectCacheAtk.cpp:
3087         * accessibility/atk/AccessibilityObjectAtk.cpp:
3088         * accessibility/atk/WebKitAccessible.cpp:
3089         * accessibility/atk/WebKitAccessible.h:
3090         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
3091         * accessibility/atk/WebKitAccessibleHyperlink.h:
3092         * accessibility/atk/WebKitAccessibleInterfaceAction.cpp:
3093         * accessibility/atk/WebKitAccessibleInterfaceAction.h:
3094         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
3095         * accessibility/atk/WebKitAccessibleInterfaceComponent.h:
3096         * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
3097         * accessibility/atk/WebKitAccessibleInterfaceDocument.h:
3098         * accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp:
3099         * accessibility/atk/WebKitAccessibleInterfaceEditableText.h:
3100         * accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
3101         * accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.h:
3102         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
3103         * accessibility/atk/WebKitAccessibleInterfaceHypertext.h:
3104         * accessibility/atk/WebKitAccessibleInterfaceImage.cpp:
3105         * accessibility/atk/WebKitAccessibleInterfaceImage.h:
3106         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
3107         * accessibility/atk/WebKitAccessibleInterfaceSelection.h:
3108         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
3109         * accessibility/atk/WebKitAccessibleInterfaceTable.h:
3110         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
3111         * accessibility/atk/WebKitAccessibleInterfaceTableCell.h:
3112         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3113         * accessibility/atk/WebKitAccessibleInterfaceText.h:
3114         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
3115         * accessibility/atk/WebKitAccessibleInterfaceValue.h:
3116         * accessibility/atk/WebKitAccessibleUtil.cpp:
3117         * accessibility/atk/WebKitAccessibleUtil.h:
3118         * accessibility/ios/AXObjectCacheIOS.mm:
3119         * accessibility/ios/AccessibilityObjectIOS.mm:
3120         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
3121         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3122         * accessibility/mac/AXObjectCacheMac.mm:
3123         * accessibility/mac/AccessibilityObjectBase.mm:
3124         * accessibility/mac/AccessibilityObjectMac.mm:
3125         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3126         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3127         * accessibility/win/AccessibilityObjectWin.cpp:
3128         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
3129         * dom/Document.cpp:
3130         (WebCore::Document::prepareForDestruction):
3131         * editing/FrameSelection.h:
3132         * editing/atk/FrameSelectionAtk.cpp:
3133         * html/HTMLTextFormControlElement.cpp:
3134         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
3135         * testing/Internals.cpp:
3136         (WebCore::Internals::resetToConsistentState):
3137
3138 2019-07-11  Justin Fan  <justin_fan@apple.com>
3139
3140         [WebGPU] Implement GPUError and error scopes
3141         https://bugs.webkit.org/show_bug.cgi?id=199655
3142
3143         Reviewed by Myles C. Maxfield.
3144
3145         Add GPUErrorFilter, GPUError, and the ability to push and pop error scopes on a GPUDevice.
3146         This will allow us to check for WebGPU errors from JavaScript.
3147         Currently, only some GPUBuffer creation errors are reported for testing; more errors will follow in later patches.
3148
3149         Test: webgpu/error-scopes-test.html
3150
3151         * Modules/webgpu/GPUErrorFilter.idl: Added.
3152         * Modules/webgpu/GPUOutOfMemoryError.idl: Added.
3153         * Modules/webgpu/GPUValidationError.idl: Added.
3154         * Modules/webgpu/WebGPUDevice.cpp:
3155         (WebCore::WebGPUDevice::pushErrorScope):
3156         (WebCore::WebGPUDevice::popErrorScope): Resolve the Promise here, since GPUDevice shouldn't worry about DOM layer.
3157         * Modules/webgpu/WebGPUDevice.h:
3158         * Modules/webgpu/WebGPUDeviceErrorScopes.cpp: Added.
3159         (WebCore::WebGPUDeviceErrorScopes::pushErrorScope): Delegates to WebGPUDevice.
3160         (WebCore::WebGPUDeviceErrorScopes::popErrorScope): Ditto.
3161         * Modules/webgpu/WebGPUDeviceErrorScopes.h: Added.
3162         * Modules/webgpu/WebGPUDeviceErrorScopes.idl: Added.
3163         * platform/graphics/gpu/GPUBuffer.h:
3164         * platform/graphics/gpu/GPUDevice.cpp: The actual error stack lives here.
3165         (WebCore::GPUDevice::pushErrorScope):
3166         (WebCore::GPUDevice::popErrorScope): Calls a callback with a GPUError, if any.
3167         (WebCore::GPUDevice::registerError): Actually creates GPUErrors.
3168         * platform/graphics/gpu/GPUDevice.h:
3169         * platform/graphics/gpu/GPUError.cpp: Added.
3170         (WebCore::createError): Factory function for various error types.
3171         * platform/graphics/gpu/GPUError.h: Added.
3172         * platform/graphics/gpu/GPUErrorFilter.h: Added.
3173         * platform/graphics/gpu/GPUOutOfMemoryError.h: Added.
3174         (WebCore::GPUOutOfMemoryError::create):
3175         * platform/graphics/gpu/GPUValidationError.cpp: Added.
3176         (WebCore::GPUValidationError::create):
3177         (WebCore::GPUValidationError::GPUValidationError):
3178         * platform/graphics/gpu/GPUValidationError.h: Added.
3179         (WebCore::GPUValidationError::message const):
3180         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3181         (WebCore::GPUBuffer::validateBufferUsage): Create an actual GPUValidationError :)
3182         (WebCore::GPUBuffer::tryCreate): Create GPUOutOfMemoryErrors where appropriate.
3183
3184         Add file/name references:
3185         * CMakeLists.txt:
3186         * DerivedSources-input.xcfilelist:
3187         * DerivedSources-output.xcfilelist:
3188         * DerivedSources.make:
3189         * Sources.txt:
3190         * WebCore.xcodeproj/project.pbxproj:
3191         * bindings/js/WebCoreBuiltinNames.h:
3192
3193         Missing includes:
3194         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
3195
3196 2019-07-11  Tim Horton  <timothy_horton@apple.com>
3197
3198         Null deref of RenderView under FrameView::setNeedsCompositingConfigurationUpdate
3199         https://bugs.webkit.org/show_bug.cgi?id=199723
3200         <rdar://problem/51554747>
3201
3202         Reviewed by Simon Fraser.
3203
3204         * page/FrameView.cpp:
3205         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
3206         Add a null-check; it looks like it is possible to get here by dismissing
3207         the find overlay (or other page overlay) at an inopportune time.
3208
3209 2019-07-11  Chris Dumez  <cdumez@apple.com>
3210
3211         Pages using Google Tag Manager Google's anti-flicker optimization may take ~5 seconds to do initial paint
3212         https://bugs.webkit.org/show_bug.cgi?id=199704
3213         <rdar://problem/52966461>
3214
3215         Reviewed by Geoffrey Garen.
3216
3217         Apply the same fix as r246764 for when "https://www.googletagmanager.com/gtm.js" load is blocked by a content
3218         extension to avoid delaying initial paint by ~5 seconds. This was tested on https://www.formula1.com/en.html.
3219
3220         * contentextensions/ContentExtensionsBackend.cpp:
3221         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
3222
3223 2019-07-11  Chris Dumez  <cdumez@apple.com>
3224
3225         Disable RGB10 IOSurface pixel format for Mac Catalyst
3226         https://bugs.webkit.org/show_bug.cgi?id=199712
3227         <rdar://problem/52793584>
3228
3229         Reviewed by Beth Dakin.
3230
3231         Disable RGB10 IOSurface pixel format for Mac Catalyst. This format is not supported
3232         on Mac Catalyst and causes us not to render anything.
3233
3234         * platform/graphics/cocoa/IOSurface.h:
3235
3236 2019-07-11  Simon Fraser  <simon.fraser@apple.com>
3237
3238         [iOS WK2] Can't place caret or select in content that overflows a contenteditable element
3239         https://bugs.webkit.org/show_bug.cgi?id=199741
3240         rdar://problem/50545233
3241
3242         Reviewed by Wenson Hsieh.
3243
3244         Various code paths for editing used renderer->absoluteBoundingBoxRect(), which is the border
3245         box of the element (or a set of line boxes for inline elements) converted to absolute
3246         coordinates. This excludes overflow content, but contenteditable needs to be able to
3247         place the caret in overflow content, and allow selection rects to be in the overflow area
3248         (if the element has visible overflow).
3249
3250         Try to clean this up by adding some static helpers on WebPage for accessing the relevant
3251         rects, and use them in code call from visiblePositionInFocusedNodeForPoint(), and
3252         code that is input to selectionClipRect.
3253         
3254         This changes selectionClipRect to use the padding box (excluding borders), which is a progression.
3255
3256         Tests: editing/caret/ios/caret-in-overflow-area.html
3257                editing/selection/ios/place-selection-in-overflow-area.html
3258                editing/selection/ios/selection-extends-into-overflow-area.html
3259
3260         * editing/FrameSelection.cpp:
3261         (WebCore::DragCaretController::editableElementRectInRootViewCoordinates const):
3262
3263 2019-07-11  Jonathan Bedard  <jbedard@apple.com>
3264
3265         [iOS 13] Enable WebKit build
3266         https://bugs.webkit.org/show_bug.cgi?id=199481
3267         <rdar://problem/52619048>
3268
3269         Reviewed by Tim Horton.
3270
3271         No new tests, iOS 13 test expectations will be migrated in the near future.
3272
3273         * platform/ios/LocalCurrentTraitCollection.mm:
3274         (WebCore::LocalCurrentTraitCollection::LocalCurrentTraitCollection): Remove underscore from currentTraitCollection.
3275         (WebCore::LocalCurrentTraitCollection::~LocalCurrentTraitCollection): Remove underscore from setCurrentTraitCollection.
3276
3277 2019-07-11  Chris Dumez  <cdumez@apple.com>
3278
3279         Fix non thread-safe usage of makeWeakPtr() in MediaPlayerPrivateMediaFoundation
3280         https://bugs.webkit.org/show_bug.cgi?id=199700
3281
3282         Reviewed by Eric Carlson.
3283
3284         The code was calling makeWeakPtr() on a main-thread object, from a background thread.
3285         This is not thread safe. To address the issue, this patches creates the WeakPtr ahead
3286         of time, on the main thread. 
3287
3288         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3289         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
3290         (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
3291         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
3292         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
3293         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3294         (WebCore::MediaPlayerPrivateMediaFoundation::ThreadSafeWrapper::create):
3295         (WebCore::MediaPlayerPrivateMediaFoundation::ThreadSafeWrapper::wrapped):
3296         (WebCore::MediaPlayerPrivateMediaFoundation::ThreadSafeWrapper::ThreadSafeWrapper):
3297
3298 2019-07-11  Zalan Bujtas  <zalan@apple.com>
3299
3300         [LFC][IFC] Cleanup InlineFormattingContext::LineLayout class.
3301         https://bugs.webkit.org/show_bug.cgi?id=199702
3302         <rdar://problem/52931733>
3303
3304         Reviewed by Sam Weinig.
3305
3306         Move some structs to .cpp. They don't need to pollute the class declaration. 
3307
3308         * layout/inlineformatting/InlineFormattingContext.h:
3309         (WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const):
3310         (): Deleted.
3311         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3312         (WebCore::Layout::LineInput::HorizontalConstraint::HorizontalConstraint):
3313         (WebCore::Layout::LineInput::LineInput):
3314         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
3315         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::HorizontalConstraint::HorizontalConstraint): Deleted.
3316         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput): Deleted.
3317
3318 2019-07-11  Joanmarie Diggs  <jdiggs@igalia.com>
3319
3320         AX: Implement support for ARIA roles insertion, deletion, subscript, superscript, and time
3321         https://bugs.webkit.org/show_bug.cgi?id=199692
3322
3323         Reviewed by Chris Fleizach.
3324
3325         Create new AccessibilityRole types which correspond to the new ARIA roles and
3326         update AccessibilityRenderObject::determineAccessibilityRole() to assign these
3327         internal roles to the related HTML elements.
3328
3329         Update both ATK and Mac to recognize these new internal roles. In addition, update
3330         the ATK mappings for the ins and del elements to ATK_ROLE_CONTENT_INSERTION and
3331         ATK_ROLE_CONTENT_DELETION respectively. Also expose "insertion" and "deletion" via
3332         the AtkObject xml-roles attribute so that this information is not completely absent
3333         for GTK or WPE built against earlier versions of ATK.
3334
3335         Remove AccessibilityObject's isSubscriptStyleGroup() and isSuperscriptStyleGroup().
3336         These two methods were only being used by ATK and are no longer needed for platform
3337         role mapping.
3338
3339         No new tests. Instead add the roles to the existing role-exposure tests.
3340
3341         * accessibility/AccessibilityObject.cpp:
3342         (WebCore::initializeRoleMap):
3343         (WebCore::AccessibilityObject::isSubscriptStyleGroup const): Deleted.
3344         (WebCore::AccessibilityObject::isSuperscriptStyleGroup const): Deleted.
3345         * accessibility/AccessibilityObject.h:
3346         * accessibility/AccessibilityObjectInterface.h:
3347         * accessibility/AccessibilityRenderObject.cpp:
3348         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3349         * accessibility/atk/WebKitAccessible.cpp:
3350         (webkitAccessibleGetAttributes):
3351         (atkRole):
3352         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3353         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3354         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3355         (createAccessibilityRoleMap):
3356         (-[WebAccessibilityObjectWrapper subrole]):
3357
3358 2019-07-11  Thibault Saunier  <tsaunier@igalia.com>
3359
3360         [GStreamer][MediaStream] Use the new dispatchMediaSampleToObservers to dispatch new buffers
3361         https://bugs.webkit.org/show_bug.cgi?id=199689
3362
3363         Reviewed by Philippe Normand.
3364
3365         We already have tests for this.
3366
3367         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
3368         (WebCore::GStreamerVideoCaptureSource::processNewFrame):
3369         (WebCore::GStreamerVideoCaptureSource::newSampleCallback):
3370         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
3371
3372 2019-07-10  Simon Fraser  <simon.fraser@apple.com>
3373
3374         [iOS WK2] With modal overlay and body overflow:hidden, can't access all the content
3375         https://bugs.webkit.org/show_bug.cgi?id=199693
3376         rdar://problem/51930364
3377
3378         Reviewed by Tim Horton.
3379
3380         A page with overflow:hidden on the root needs to be scrollable if:
3381         * it's zoomed
3382         * the visual viewport is smaller than the layout viewport (including visible keyboard)
3383         * scrolling is required to hide MobileSafari's squishy bars
3384
3385         This patch does the last two, plumbing a "visual viewport is smaller than layout viewport"
3386         bit up from WebCore via the scrolling tree (that way, when it changes we automatically trigger
3387         a commit), and checking for squished bars in WKWebView.
3388
3389         Tested by new API tests.
3390
3391         * page/FrameView.cpp:
3392         (WebCore::FrameView::updateLayoutViewport):
3393         (WebCore::FrameView::layoutOrVisualViewportChanged): Make this not iOS-specific. It's not yet called
3394         in all the right places (doing so has risk because it's exposed via VisualViewport resize events).
3395         (WebCore::FrameView::didUpdateViewportOverrideRects): Deleted.
3396         * page/FrameView.h:
3397         * page/scrolling/AsyncScrollingCoordinator.cpp:
3398         (WebCore::AsyncScrollingCoordinator::frameViewVisualViewportChanged):
3399         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
3400         * page/scrolling/AsyncScrollingCoordinator.h:
3401         * page/scrolling/ScrollingCoordinator.h:
3402         (WebCore::ScrollingCoordinator::frameViewVisualViewportChanged):
3403         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3404         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3405         (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
3406         (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportIsSmallerThanLayoutViewport):
3407         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
3408         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3409         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3410         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
3411         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
3412         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3413
3414 2019-07-10  Robin Morisset  <rmorisset@apple.com>
3415
3416         [WHLSL] Optional<UniqueRef<T>> -> std::unique_ptr in Return/IfStatement/ForLoop
3417         https://bugs.webkit.org/show_bug.cgi?id=199695
3418
3419         Reviewed by Dean Jackson.
3420
3421         Trivial patch that saves 8 bytes per Return/If, and 16 bytes per For loop.
3422
3423         No new tests as there is no intended functional change.
3424
3425         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
3426         (WebCore::WHLSL::AST::ForLoop::ForLoop):
3427         (WebCore::WHLSL::AST::ForLoop::condition):
3428         (WebCore::WHLSL::AST::ForLoop::increment):
3429         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
3430         (WebCore::WHLSL::AST::IfStatement::IfStatement):
3431         (WebCore::WHLSL::AST::IfStatement::elseBody):
3432         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
3433         (WebCore::WHLSL::AST::Return::Return):
3434         (WebCore::WHLSL::AST::Return::value):
3435         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
3436         (WebCore::WHLSL::Parser::parseIfStatement):
3437         (WebCore::WHLSL::Parser::parseForLoop):
3438         (WebCore::WHLSL::Parser::parseStatement):
3439
3440 2019-07-10  Robin Morisset  <rmorisset@apple.com>
3441
3442         [WHLSL] The recursion checker should not have quadratic complexity
3443         https://bugs.webkit.org/show_bug.cgi?id=199688
3444
3445         Reviewed by Saam Barati.
3446
3447         I fix it by using two different hash sets, tracking which functions we have started visiting, and which we have finished visiting.
3448         The difference are those that are currently "on the stack", and calling any of those is an error.
3449         As a bonus, I also overrode visit(Program&), so that we only bother visiting function definitions.
3450
3451         On whlsl-compute.html ran 5 times, this patch reduces the time spent in the recursion checker from 26ms to 12ms.
3452         It is likely to be a much bigger win on larger programs (since it took the complexity from quadratic to linear).
3453
3454         No new tests as there is no intended functional change.
3455
3456         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:
3457
3458 2019-07-10  Sihui Liu  <sihui_liu@apple.com>
3459
3460         Crash at WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator
3461         https://bugs.webkit.org/show_bug.cgi?id=199677
3462         <rdar://problem/52334665>
3463
3464         Reviewed by Alex Christensen.
3465
3466         Add an early return in incrementReverseIterator when setFirstInRemainingRange fails to set m_iterator. This is 
3467         in line with what we did in incrementForwardIterator.
3468
3469         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
3470         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
3471
3472 2019-07-10  Chris Dumez  <cdumez@apple.com>
3473
3474         Stop using GenericTaskQueue from multiple threads
3475         https://bugs.webkit.org/show_bug.cgi?id=199652
3476
3477         Reviewed by Eric Carlson and Geoffrey Garen.
3478
3479         WebCoreAVFLoaderDelegate was calling GenericTaskQueue::enqueueTask() from a background thread,
3480         which is not safe because the implementation of enqueueTask() calls makeWeakPtr() on the
3481         GenericTaskQueue (a main thread object).
3482
3483         Update WebCoreAVFLoaderDelegate to make sure it is on the main thread before it calls
3484         GenericTaskQueue::enqueueTask().
3485
3486         * platform/GenericTaskQueue.h:
3487         Remove last template parameter which was used exclusively by WebCoreAVFLoaderDelegate to try and
3488         make GenericTaskQueue thread-safe.
3489
3490         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3491         (-[WebCoreAVFMovieObserver metadataLoaded]):
3492         (-[WebCoreAVFMovieObserver didEnd:]):
3493         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3494         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
3495         (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
3496         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
3497         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
3498
3499 2019-07-10  Chris Fleizach  <cfleizach@apple.com>
3500
3501         AX: VoiceOver ignored role="presentation" on <table> HTML elements
3502         https://bugs.webkit.org/show_bug.cgi?id=199659
3503
3504         Reviewed by Zalan Bujtas.
3505
3506         Only include a table ancestor if it's a table we care about for accessibility.
3507
3508         Modified Test: accessibility/ios-simulator/tables-lists.html
3509
3510         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3511         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
3512
3513 2019-07-10  Robin Morisset  <rmorisset@apple.com>
3514
3515         [WHLSL] Track code locations correctly throughout the compiler to get good error messages
3516         https://bugs.webkit.org/show_bug.cgi?id=199675
3517
3518         Reviewed by Myles Maxfield.
3519
3520         The basic idea is to go from having each AST node contain its own token to having each AST node contain a pair of offsets into the source,
3521         the offset before its start and the offset after its end. This will let us get good error messages.
3522         As a bonus, it saves a bit of memory as Tokens are larger (one extra word for their type).
3523
3524         The new CodeLocation class is put in Lexer.h, because it has a cyclic dependency on Token, which also has a cyclic dependency on Lexer.
3525
3526         No new tests as there is no intended functional change.
3527
3528         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
3529         (WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
3530         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
3531         (WebCore::WHLSL::AST::ArrayType::ArrayType):
3532         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
3533         (WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
3534         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
3535         (WebCore::WHLSL::AST::BaseFunctionAttribute::BaseFunctionAttribute):
3536         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
3537         (WebCore::WHLSL::AST::BaseSemantic::BaseSemantic):
3538         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
3539         (WebCore::WHLSL::AST::Block::Block):
3540         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
3541         (WebCore::WHLSL::AST::BooleanLiteral::BooleanLiteral):
3542         (WebCore::WHLSL::AST::BooleanLiteral::clone const):
3543         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
3544         (WebCore::WHLSL::AST::Break::Break):
3545         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
3546         (WebCore::WHLSL::AST::BuiltInSemantic::BuiltInSemantic):
3547         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
3548         (WebCore::WHLSL::AST::CallExpression::CallExpression):
3549         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
3550         (WebCore::WHLSL::AST::CommaExpression::CommaExpression):
3551         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
3552         (WebCore::WHLSL::AST::Continue::Continue):
3553         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
3554         (WebCore::WHLSL::AST::DereferenceExpression::DereferenceExpression):
3555         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
3556         (WebCore::WHLSL::AST::DoWhileLoop::DoWhileLoop):
3557         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
3558         (WebCore::WHLSL::AST::DotExpression::DotExpression):
3559         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
3560         (WebCore::WHLSL::AST::EffectfulExpressionStatement::EffectfulExpressionStatement):
3561         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
3562         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
3563         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
3564         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
3565         (WebCore::WHLSL::AST::EnumerationMember::codeLocation const):
3566         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
3567         (WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
3568         (WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap):
3569         (WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
3570         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
3571         (WebCore::WHLSL::AST::Expression::Expression):
3572         (WebCore::WHLSL::AST::Expression::codeLocation const):
3573         (WebCore::WHLSL::AST::Expression::updateCodeLocation):
3574         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
3575         (WebCore::WHLSL::AST::Fallthrough::Fallthrough):
3576         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
3577         (WebCore::WHLSL::AST::FloatLiteral::FloatLiteral):
3578         (WebCore::WHLSL::AST::FloatLiteral::clone const):
3579         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
3580         (WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
3581         (WebCore::WHLSL::AST::FloatLiteralType::clone const):
3582         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
3583         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
3584         (WebCore::WHLSL::AST::ForLoop::ForLoop):
3585         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
3586         (WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
3587         (WebCore::WHLSL::AST::FunctionDeclaration::codeLocation const):
3588         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
3589         (WebCore::WHLSL::AST::GlobalVariableReference::GlobalVariableReference):
3590         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
3591         (WebCore::WHLSL::AST::IfStatement::IfStatement):
3592         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
3593         (WebCore::WHLSL::AST::IndexExpression::IndexExpression):
3594         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
3595         (WebCore::WHLSL::AST::IntegerLiteral::IntegerLiteral):
3596         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
3597         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
3598         (WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
3599         (WebCore::WHLSL::AST::IntegerLiteralType::clone const):
3600         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
3601         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
3602         (WebCore::WHLSL::AST::LogicalExpression::LogicalExpression):
3603         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
3604         (WebCore::WHLSL::AST::LogicalNotExpression::LogicalNotExpression):
3605         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
3606         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
3607         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
3608         (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
3609         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
3610         (WebCore::WHLSL::AST::NamedType::NamedType):
3611         (WebCore::WHLSL::AST::NamedType::codeLocation const):
3612         (WebCore::WHLSL::AST::NamedType::updateCodeLocation):
3613         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
3614         (WebCore::WHLSL::AST::NativeTypeDeclaration::NativeTypeDeclaration):
3615         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
3616         (WebCore::WHLSL::AST::NullLiteral::NullLiteral):
3617         (WebCore::WHLSL::AST::NullLiteral::clone const):
3618         * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h:
3619         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::NumThreadsFunctionAttribute):
3620         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
3621         (WebCore::WHLSL::AST::PointerType::PointerType):
3622         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
3623         (WebCore::WHLSL::AST::PropertyAccessExpression::PropertyAccessExpression):
3624         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
3625         (WebCore::WHLSL::AST::ReadModifyWriteExpression::create):
3626         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
3627         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
3628         (WebCore::WHLSL::AST::ReferenceType::ReferenceType):
3629         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
3630         (WebCore::WHLSL::AST::ResourceSemantic::ResourceSemantic):
3631         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
3632         (WebCore::WHLSL::AST::Return::Return):
3633         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
3634         (WebCore::WHLSL::AST::SpecializationConstantSemantic::SpecializationConstantSemantic):
3635         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
3636         (WebCore::WHLSL::AST::StageInOutSemantic::StageInOutSemantic):
3637         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
3638         (WebCore::WHLSL::AST::Statement::Statement):
3639         (WebCore::WHLSL::AST::Statement::codeLocation const):
3640         (WebCore::WHLSL::AST::Statement::updateCodeLocation):
3641         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
3642         (WebCore::WHLSL::AST::StatementList::StatementList):
3643         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
3644         (WebCore::WHLSL::AST::StructureDefinition::StructureDefinition):
3645         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
3646         (WebCore::WHLSL::AST::StructureElement::StructureElement):
3647         (WebCore::WHLSL::AST::StructureElement::codeLocation const):
3648         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
3649         (WebCore::WHLSL::AST::SwitchCase::SwitchCase):
3650         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
3651         (WebCore::WHLSL::AST::SwitchStatement::SwitchStatement):
3652         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
3653         (WebCore::WHLSL::AST::TernaryExpression::TernaryExpression):
3654         * Modules/webgpu/WHLSL/AST/WHLSLTrap.h:
3655         (WebCore::WHLSL::AST::Trap::Trap):
3656         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
3657         (WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
3658         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp:
3659         (WebCore::WHLSL::AST::TypeReference::wrap):
3660         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
3661         (WebCore::WHLSL::AST::TypeReference::TypeReference):
3662         (WebCore::WHLSL::AST::TypeReference::cloneTypeReference const):
3663         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
3664         (WebCore::WHLSL::AST::UnnamedType::UnnamedType):
3665         (WebCore::WHLSL::AST::UnnamedType::codeLocation const):
3666         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
3667         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::UnsignedIntegerLiteral):
3668         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
3669         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
3670         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
3671         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::clone const):
3672         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
3673         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
3674         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
3675         (WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
3676         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
3677         (WebCore::WHLSL::AST::VariableReference::VariableReference):
3678         (WebCore::WHLSL::AST::VariableReference::wrap):
3679         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
3680         (WebCore::WHLSL::AST::WhileLoop::WhileLoop):
3681         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
3682         (WebCore::WHLSL::AutoInitialize::visit):
3683         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3684         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
3685         (WebCore::WHLSL::resolveWithOperatorLength):
3686         (WebCore::WHLSL::resolveWithReferenceComparator):
3687         (WebCore::WHLSL::resolveByInstantiation):
3688         (WebCore::WHLSL::resolveFunction):
3689         (WebCore::WHLSL::Checker::visit):
3690         (WebCore::WHLSL::argumentTypeForAndOverload):
3691         (WebCore::WHLSL::Checker::finishVisiting):
3692         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
3693         (WebCore::WHLSL::matchAndCommit):
3694         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
3695         (WebCore::WHLSL::Token::typeName):
3696         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
3697         * Modules/webgpu/WHLSL/WHLSLLexer.h:
3698         (WebCore::WHLSL::AST::CodeLocation::CodeLocation):
3699         (WebCore::WHLSL::AST::CodeLocation::startOffset const):
3700         (WebCore::WHLSL::AST::CodeLocation::endOffset const):
3701         (WebCore::WHLSL::Token::startOffset const):
3702         (WebCore::WHLSL::Lexer::errorString):
3703         (WebCore::WHLSL::Token::stringView const):
3704         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
3705         (WebCore::WHLSL::NameResolver::visit):
3706         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
3707         (WebCore::WHLSL::Parser::parse):
3708         (WebCore::WHLSL::Parser::peek):
3709         (WebCore::WHLSL::Parser::peekFurther):
3710         (WebCore::WHLSL::Types::includes):
3711         (WebCore::WHLSL::Types::appendNameTo):
3712         (WebCore::WHLSL::Types<t>::includes):
3713         (WebCore::WHLSL::Types<t>::appendNameTo):
3714         (WebCore::WHLSL::Parser::peekType):
3715         (WebCore::WHLSL::Parser::tryType):
3716         (WebCore::WHLSL::Parser::tryTypes):
3717         (WebCore::WHLSL::Parser::consumeType):
3718         (WebCore::WHLSL::Parser::consumeTypes):
3719         (WebCore::WHLSL::Parser::consumeIntegralLiteral):
3720         (WebCore::WHLSL::Parser::parseConstantExpression):
3721         (WebCore::WHLSL::Parser::parseTypeArgument):
3722         (WebCore::WHLSL::Parser::parseTypeArguments):
3723         (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
3724         (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
3725         (WebCore::WHLSL::Parser::parseType):
3726         (WebCore::WHLSL::Parser::parseTypeDefinition):
3727         (WebCore::WHLSL::Parser::parseBuiltInSemantic):
3728         (WebCore::WHLSL::Parser::parseResourceSemantic):
3729         (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
3730         (WebCore::WHLSL::Parser::parseStageInOutSemantic):
3731         (WebCore::WHLSL::Parser::parseSemantic):
3732         (WebCore::WHLSL::Parser::parseQualifiers):
3733         (WebCore::WHLSL::Parser::parseStructureElement):
3734         (WebCore::WHLSL::Parser::parseStructureDefinition):
3735         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
3736         (WebCore::WHLSL::Parser::parseEnumerationMember):
3737         (WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
3738         (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
3739         (WebCore::WHLSL::Parser::parseAttributeBlock):
3740         (WebCore::WHLSL::Parser::parseParameter):
3741         (WebCore::WHLSL::Parser::parseParameters):
3742         (WebCore::WHLSL::Parser::parseComputeFunctionDeclaration):
3743         (WebCore::WHLSL::Parser::parseVertexOrFragmentFunctionDeclaration):
3744         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
3745         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
3746         (WebCore::WHLSL::Parser::parseFunctionDeclaration):
3747         (WebCore::WHLSL::Parser::parseBlock):
3748         (WebCore::WHLSL::Parser::parseBlockBody):
3749         (WebCore::WHLSL::Parser::parseIfStatement):
3750         (WebCore::WHLSL::Parser::parseSwitchStatement):
3751         (WebCore::WHLSL::Parser::parseSwitchCase):
3752         (WebCore::WHLSL::Parser::parseForLoop):
3753         (WebCore::WHLSL::Parser::parseWhileLoop):
3754         (WebCore::WHLSL::Parser::parseDoWhileLoop):
3755         (WebCore::WHLSL::Parser::parseVariableDeclaration):
3756         (WebCore::WHLSL::Parser::parseVariableDeclarations):
3757         (WebCore::WHLSL::Parser::parseStatement):
3758         (WebCore::WHLSL::Parser::parseEffectfulExpression):
3759         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
3760         (WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
3761         (WebCore::WHLSL::Parser::parseSuffixOperator):
3762         (WebCore::WHLSL::Parser::parseExpression):
3763         (WebCore::WHLSL::Parser::completeTernaryConditional):
3764         (WebCore::WHLSL::Parser::completeAssignment):
3765         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
3766         (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
3767         (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
3768         (WebCore::WHLSL::Parser::completePossibleShift):
3769         (WebCore::WHLSL::Parser::completePossibleAdd):
3770         (WebCore::WHLSL::Parser::completePossibleMultiply):
3771         (WebCore::WHLSL::Parser::parsePossiblePrefix):
3772         (WebCore::WHLSL::Parser::parsePossibleSuffix):
3773         (WebCore::WHLSL::Parser::parseCallExpression):
3774         (WebCore::WHLSL::Parser::parseTerm):
3775         * Modules/webgpu/WHLSL/WHLSLParser.h:
3776         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
3777         (WebCore::WHLSL::anonymousToken):
3778         (WebCore::WHLSL::PreserveLifetimes::PreserveLifetimes):
3779         (WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
3780         (WebCore::WHLSL::preserveVariableLifetimes):
3781         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
3782         (WebCore::WHLSL::PropertyResolver::visit):
3783         (WebCore::WHLSL::wrapAnderCallArgument):
3784         (WebCore::WHLSL::setterCall):
3785         (WebCore::WHLSL::getterCall):
3786         (WebCore::WHLSL::modify):
3787         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
3788         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
3789         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
3790         (WebCore::WHLSL::synthesizeArrayOperatorLength):
3791         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
3792         (WebCore::WHLSL::synthesizeConstructors):
3793         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: