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