cfeebcff3cce8d97147c52fd10c2db777abeda53
[WebKit.git] / Source / WebCore / ChangeLog
1 2019-08-04  Youenn Fablet  <youenn@apple.com>
2
3         WebRTC: got incorrect `this` in negotiationneeded event
4         https://bugs.webkit.org/show_bug.cgi?id=200427
5
6         Reviewed by Darin Adler.
7
8         Make sure a dom object created through a JS built-in constructor is added to the wrapper cache.
9
10         Test: webrtc/onnegotiationneeded.html
11
12         * bindings/js/JSDOMBuiltinConstructor.h:
13         (WebCore::createJSObjectFromWrapper):
14         (WebCore::createJSObject):
15
16 2019-08-04  Sam Weinig  <weinig@apple.com>
17
18         Mangled WHLSL names don't need to allocate Strings
19         https://bugs.webkit.org/show_bug.cgi?id=200429
20
21         Reviewed by Saam Barati.
22
23         To avoid allocating strings for each mangled name used to transform WHLSL to Metal, which we'd
24         like to avoid since it is both unnecessarily expensive in time and space, we can instead just
25         store the unique integer identifier that was being used to construct the String. 
26         
27         Since the existing mangled names were all of the form "prefix" + unsigned integer value (where 
28         prefix could be "type", "enumerationMember", "structureElement", "variable" or "function") we
29         strongly type the integer by storing it in a struct (MangledVariableName, MangledTypeName, etc.)
30         When the full name is actually needed, StringTypeAdapter's specialized for the structs are
31         used to write directly into the preallocated buffers of StringBuilders or makeString().
32
33         * Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h: Added.
34         (WebCore::WHLSL::Metal::MangledVariableName):
35         (WebCore::WHLSL::Metal::MangledTypeName):
36         (WebCore::WHLSL::Metal::MangledStructureElementName):
37         (WebCore::WHLSL::Metal::MangledEnumerationMemberName):
38         (WebCore::WHLSL::Metal::MangledFunctionName):
39         Adds structs for each type of mangled name and StringTypeAdapter specializations for
40         each to allow their use in StringBuilder.flexibleAppend() or makeString(). 
41         
42         Additionally, a Variant, MangledOrNativeTypeName, of MangledTypeName and String is 
43         declared to allow for the few cases where a native type (e.g. float4) is needed. The
44         StringTypeAdapter for MangledOrNativeTypeName could be generalized for any Variant
45         in the future, but I left it non-general for now, as it is non-obvious if one would
46         want to store Variant<Types...>, and have each member function construct a temporary
47         StringTypeAdapter, or store a Variant<StringTypeAdapter<Types>...> and perform conversion
48         in the construction.
49
50         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
51         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
52         (WebCore::WHLSL::Metal::internalTypeForSemantic):
53         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature):
54         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath):
55         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding):
56         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::signature):
57         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack):
58         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding):
59         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::signature):
60         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack):
61         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::ComputeEntryPointScaffolding):
62         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature):
63         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::pack):
64         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
65         (WebCore::WHLSL::Metal::EntryPointScaffolding::parameterVariables):
66         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
67         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::FunctionDeclarationWriter):
68         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit):
69         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
70         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
71         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValueWithNullability):
72         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValue):
73         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue):
74         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValue):
75         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValueAndNullability):
76         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue):
77         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
78         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
79         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::RenderFunctionDefinitionWriter):
80         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::createEntryPointScaffolding):
81         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::ComputeFunctionDefinitionWriter):
82         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::createEntryPointScaffolding):
83         (WebCore::WHLSL::Metal::sharedMetalFunctions):
84         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h:
85         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h:
86         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
87         (WebCore::WHLSL::Metal::writeNativeFunction):
88         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
89         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
90         (WebCore::WHLSL::Metal::BaseTypeNameNode::BaseTypeNameNode):
91         (WebCore::WHLSL::Metal::BaseTypeNameNode::mangledName const):
92         (WebCore::WHLSL::Metal::ArrayTypeNameNode::ArrayTypeNameNode):
93         (WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::ArrayReferenceTypeNameNode):
94         (WebCore::WHLSL::Metal::PointerTypeNameNode::PointerTypeNameNode):
95         (WebCore::WHLSL::Metal::ReferenceTypeNameNode::ReferenceTypeNameNode):
96         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter):
97         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations):
98         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
99         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
100         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForEnumerationMember):
101         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForStructureElement):
102         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
103         (WebCore::WHLSL::Metal::TypeNamer::generateNextTypeName):
104         (WebCore::WHLSL::Metal::TypeNamer::generateNextStructureElementName):
105         (WebCore::WHLSL::Metal::TypeNamer::generateNextEnumerationMemberName):
106         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
107         Replace uses of String with the appropriate mangled name type.
108
109         * WebCore.xcodeproj/project.pbxproj:
110         Add WHLSLMangledNames.h
111
112         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
113         (WebCore::trySetFunctions):
114         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
115         (WebCore::trySetFunctions):
116         Convert the mangled names to Strings for passing to Metal API. NOTE: We could avoid having the
117         toString() member function on MangledFunctionName if we allowed makeString() to take a single
118         argument.
119
120 2019-08-04  Chris Dumez  <cdumez@apple.com>
121
122         Ping loads should not prevent page caching
123         https://bugs.webkit.org/show_bug.cgi?id=200418
124         <rdar://problem/53901632>
125
126         Reviewed by Darin Adler.
127
128         We normally prevent page caching if there were any pending subresource loads when navigating,
129         to avoid caching partial / broken content. However, this should not apply to Ping / Beacon
130         loads since those do not impact page rendering and can outlive the page.
131
132         Tests: http/tests/navigation/page-cache-pending-ping-load-cross-origin.html
133                http/tests/navigation/page-cache-pending-ping-load-same-origin.html
134
135         * history/PageCache.cpp:
136         (WebCore::PageCache::addIfCacheable):
137         After we've fired the 'pagehide' event in each frame, stop all the loads again. This is needed
138         since pages are allowed to start ping / beacon loads in their 'pagehide' handlers. If we do not
139         stop those loads, then the next call to canCachePage() would fail because the DocumentLoader is
140         still loading. Note that we're not actually preventing these ping loads from hitting the server
141         since we never cancel page loads and those can outlive their page.
142
143         * loader/DocumentLoader.cpp:
144         (WebCore::shouldPendingCachedResourceLoadPreventPageCache):
145         (WebCore::areAllLoadersPageCacheAcceptable):
146         Make sure that Ping / Beacon / Prefetches / Icon loads do not prevent page caching.
147
148         (WebCore::DocumentLoader::addSubresourceLoader):
149         Tweak assertion that was incorrect since we actually allow ping / beacon loads when the
150         document is about to enter PageCache (while firing pagehide event).
151
152 2019-08-04  Zalan Bujtas  <zalan@apple.com>
153
154         [LFC][TFC] Create formatting context/state.
155         https://bugs.webkit.org/show_bug.cgi?id=200428
156         <rdar://problem/53913625>
157
158         Reviewed by Antti Koivisto.
159
160         * layout/LayoutState.cpp:
161         (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
162         (WebCore::Layout::LayoutState::createFormattingContext):
163
164 2019-08-04  Zalan Bujtas  <zalan@apple.com>
165
166         [LFC] Cleanup preferred width computation
167         https://bugs.webkit.org/show_bug.cgi?id=200426
168         <rdar://problem/53912607>
169
170         Reviewed by Antti Koivisto.
171
172         The intrinsic width for a formatting root box has 2 sets of values now. One set(min/max) is stored in the established formatting context's state
173         while the other is in the formatting context's state where the box lives.
174
175         <div style="position: absolute"><div style="float: left; border: 1px solid green">foobar</div></div>
176
177         The float box participates in the formatting context established by the absolutely position box, but it also establishes an inline formatting context.
178         The min/max width pair in the established context is the width of the "foobar" (same value for min/max). This set is stored in the inline formatting state.
179         However the float box has horizontal border so the "final" min/max width pair is expanded by this border value and stored in the formatting state where
180         the box lives (which is different from the one it establishes).
181
182         This and the "remove the formatting context type classes from the tree" changes open up interesting optimization opportunities.
183         Here is a very simple case:
184         <div style="display: inline-block; width: auto;">
185           <div style="float: left">some text</div>
186           <div style="float: left">some super long .... text</div>
187           <div></div>
188         </div>
189         In order to lay out this content properly, we
190         1. Compute the min/max width of the first float (expensive text measuring)
191         2. Compute the min/max width of the second float (some more expensive text measuring)
192         3. Compute the min/max width of the inline-block (that is pretty much the 2 float's min/max)
193         4. Lay out the 2 floats, the empty div and the inline-block using these min/max width pairs.
194
195         Now if the inline-block box's display value is changed to "block" and the positioning is to absolute (style="display: box; position: absolute;")
196         we currently(on trunk) tear down the render tree, build a new one and run all the steps again from #1 to #4.
197
198         In LFC, we start with the following layout tree
199         <container> -> block formatting context
200           <container> -> inline formatting context
201             <anonymous inline box>
202           <container> -> inline formatting context
203             <anonymous inline box>
204           <container> -> inline formatting context
205         and when the style change happens, we don't need to tear down the tree at all. Not only that, but since every formatting contexts stay the same
206         we can just reuse their states and actually skip all the steps (even the positioning since the absolutely positioned container has static top/bottom/left/right).
207
208         Surprisingly the final layout produces the exact same "display boxes" as the original layout.
209
210         * layout/FormattingContext.h:
211         (WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::expand):
212         * layout/FormattingContextGeometry.cpp:
213         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
214         * layout/FormattingState.h:
215         (WebCore::Layout::FormattingState::setIntrinsicWidthConstraints):
216         (WebCore::Layout::FormattingState::intrinsicWidthConstraints const):
217         (WebCore::Layout::FormattingState::setIntrinsicWidthConstraintsForBox):
218         (WebCore::Layout::FormattingState::clearIntrinsicWidthConstraints):
219         (WebCore::Layout::FormattingState::intrinsicWidthConstraintsForBox const):
220         * layout/blockformatting/BlockFormattingContext.cpp:
221         (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints const):
222         (WebCore::Layout::BlockFormattingContext::computeIntrinsicWidthConstraints const): Deleted.
223         * layout/blockformatting/BlockFormattingContext.h:
224         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
225         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
226         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraintsNeedChildrenWidth): Deleted.
227         * layout/displaytree/DisplayBox.h:
228         (WebCore::Display::Box::horizontalMarginBorderAndPadding const):
229         * layout/inlineformatting/InlineFormattingContext.cpp:
230         (WebCore::Layout::nextInPreOrder):
231         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints const):
232         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot const):
233         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const): Deleted.
234         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const): Deleted.
235         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const): Deleted.
236         * layout/inlineformatting/InlineFormattingContext.h:
237         * layout/tableformatting/TableFormattingContext.cpp:
238         (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints const):
239         * layout/tableformatting/TableFormattingContext.h:
240
241 2019-08-03  Devin Rousso  <drousso@apple.com>
242
243         Web Inspector: DOM: add a special breakpoint for "All Events"
244         https://bugs.webkit.org/show_bug.cgi?id=200285
245
246         Reviewed by Joseph Pecoraro.
247
248         Similar to the existing "All Requests" breakpoint, there should be a way to set a breakpoint
249         that would pause for any DOM event, regardless of the event's name. This is useful for
250         situations where the event name isn't known, or where one simply want's to pause on the next
251         entry to the event loop.
252
253         Along these lines, make the "requestAnimationFrame", "setTimeout", and "setInterval"
254         event breakpoints into special breakpoints that can be added/removed via the create
255         breakpoint context menu. This simplifies the process for setting these breakpoints, and also
256         makes them more discoverable (most people wouldn't consider them to be "events").
257
258         Tests: inspector/dom/breakpoint-for-event-listener.html
259                inspector/dom-debugger/event-animation-frame-breakpoints.html
260                inspector/dom-debugger/event-breakpoint-with-navigation.html
261                inspector/dom-debugger/event-interval-breakpoints.html
262                inspector/dom-debugger/event-listener-breakpoints.html
263                inspector/dom-debugger/event-timeout-breakpoints.html
264
265         * inspector/agents/InspectorDOMDebuggerAgent.h:
266         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
267         (WebCore::InspectorDOMDebuggerAgent::disable):
268         (WebCore::InspectorDOMDebuggerAgent::frameDocumentUpdated):
269         (WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint):
270         (WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint):
271         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
272         (WebCore::InspectorDOMDebuggerAgent::willFireTimer):
273         (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame):
274         (WebCore::InspectorDOMDebuggerAgent::discardBindings): Deleted.
275         Make `eventName` optional for `addEventBreakpoint`/`removeEventBreakpoint`. When omitted,
276         the corresponding breakpoint that is added/removed is treated as a global breakpoint that
277         applies to all events of that type (e.g. a global `listener` breakpoint would pause for any
278         event that is fired).
279
280 2019-08-03  Zalan Bujtas  <zalan@apple.com>
281
282         [LFC] Remove formatting context type leaf classes
283         https://bugs.webkit.org/show_bug.cgi?id=200224
284         <rdar://problem/53661907>
285
286         Reviewed by Antti Koivisto.
287
288         Let's keep the layout tree formatting context type independent.
289
290         * Sources.txt:
291         * WebCore.xcodeproj/project.pbxproj:
292         * layout/inlineformatting/InlineFormattingContext.cpp:
293         (WebCore::Layout::InlineFormattingContext::layout const):
294         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
295         (WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox const):
296         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
297         * layout/inlineformatting/InlineFormattingContext.h:
298         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
299         (WebCore::Layout::inlineItemWidth):
300         (WebCore::Layout::LineLayout::placeInlineItem):
301         * layout/inlineformatting/InlineItem.h:
302         * layout/inlineformatting/InlineTextItem.cpp:
303         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
304         (WebCore::Layout::InlineTextItem::InlineTextItem):
305         (WebCore::Layout::InlineTextItem::split const):
306         * layout/inlineformatting/InlineTextItem.h:
307         (WebCore::Layout::InlineTextItem::inlineBox const): Deleted.
308         * layout/inlineformatting/text/TextUtil.cpp:
309         (WebCore::Layout::TextUtil::width):
310         (WebCore::Layout::TextUtil::split):
311         * layout/inlineformatting/text/TextUtil.h:
312         * layout/layouttree/LayoutBox.cpp:
313         (WebCore::Layout::Box::Box):
314         (WebCore::Layout::Box::~Box):
315         (WebCore::Layout::Box::formattingContextRoot const):
316         (WebCore::Layout::Box::setTextContent):
317         (WebCore::Layout::Box::hasTextContent const):
318         (WebCore::Layout::Box::textContent const):
319         (WebCore::Layout::Box::replaced const):
320         (WebCore::Layout::Box::replaced):
321         (WebCore::Layout::Box::rareDataMap):
322         (WebCore::Layout::Box::rareData const):
323         (WebCore::Layout::Box::ensureRareData):
324         (WebCore::Layout::Box::removeRareData):
325         * layout/layouttree/LayoutBox.h:
326         (WebCore::Layout::Box::isLineBreakBox const):
327         (WebCore::Layout::Box::hasRareData const):
328         (WebCore::Layout::Box::setHasRareData):
329         (WebCore::Layout::Box::isInlineBox const): Deleted.
330         (WebCore::Layout::Box::replaced const): Deleted.
331         (WebCore::Layout::Box::replaced): Deleted.
332         * layout/layouttree/LayoutContainer.h:
333         (WebCore::Layout::Container::firstChild const): Deleted.
334         (WebCore::Layout::Container::lastChild const): Deleted.
335         (WebCore::Layout::Container::hasChild const): Deleted.
336         (WebCore::Layout::Container::hasInFlowChild const): Deleted.
337         (WebCore::Layout::Container::hasInFlowOrFloatingChild const): Deleted.
338         (WebCore::Layout::Container::outOfFlowDescendants const): Deleted.
339         * layout/layouttree/LayoutInlineBox.cpp: Removed.
340         * layout/layouttree/LayoutInlineBox.h: Removed.
341         * layout/layouttree/LayoutLineBreakBox.cpp: Removed.
342         * layout/layouttree/LayoutLineBreakBox.h: Removed.
343         * layout/layouttree/LayoutTreeBuilder.cpp:
344         (WebCore::Layout::TreeBuilder::createLayoutBox):
345         (WebCore::Layout::outputLayoutBox):
346
347 2019-08-03  Zalan Bujtas  <zalan@apple.com>
348
349         [LFC] Remove formatting context type container classes.
350         https://bugs.webkit.org/show_bug.cgi?id=200202
351
352         Reviewed by Antti Koivisto.
353
354         These are formatting context specific classes. Let's try to have a layout tree without such types.
355
356         * Sources.txt:
357         * WebCore.xcodeproj/project.pbxproj:
358         * layout/blockformatting/BlockFormattingContext.cpp:
359         (WebCore::Layout::BlockFormattingContext::computeIntrinsicWidthConstraints const):
360         * layout/inlineformatting/InlineFormattingContext.cpp:
361         (WebCore::Layout::InlineFormattingContext::layout const):
362         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer const):
363         * layout/inlineformatting/InlineFormattingContext.h:
364         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
365         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
366         * layout/inlineformatting/InlineLine.cpp:
367         (WebCore::Layout::Line::appendTextContent):
368         * layout/layouttree/LayoutBlockContainer.cpp: Removed.
369         * layout/layouttree/LayoutBlockContainer.h: Removed.
370         * layout/layouttree/LayoutBox.cpp:
371         (WebCore::Layout::Box::establishesInlineFormattingContext const):
372         (WebCore::Layout::Box::establishesInlineFormattingContextOnly const):
373         (WebCore::Layout::Box::formattingContextRoot const):
374         * layout/layouttree/LayoutBox.h:
375         (WebCore::Layout::Box::isBlockContainer const):
376         (WebCore::Layout::Box::isInlineContainer const):
377         (WebCore::Layout::Box::isInlineBox const):
378         (WebCore::Layout::Box::establishesInlineFormattingContext const): Deleted.
379         (WebCore::Layout::Box::establishesInlineFormattingContextOnly const): Deleted.
380         * layout/layouttree/LayoutInlineContainer.cpp: Removed.
381         * layout/layouttree/LayoutInlineContainer.h: Removed.
382         * layout/layouttree/LayoutIterator.h:
383         (WebCore::Layout::LayoutBoxTraversal::firstChild):
384         * layout/layouttree/LayoutTreeBuilder.cpp:
385         (WebCore::Layout::TreeBuilder::createLayoutTree):
386         (WebCore::Layout::TreeBuilder::createLayoutBox):
387         (WebCore::Layout::TreeBuilder::createTableStructure):
388         (WebCore::Layout::outputLayoutBox):
389         * layout/layouttree/LayoutTreeBuilder.h:
390         * page/FrameViewLayoutContext.cpp:
391         (WebCore::layoutUsingFormattingContext):
392
393 2019-08-02  Robin Morisset  <rmorisset@apple.com>
394
395         [WHLSL] Avoid visiting the full AST in computeDimensions
396         https://bugs.webkit.org/show_bug.cgi?id=200410
397
398         Reviewed by Myles C. Maxfield.
399
400         Avoid visiting the full AST in computeDimensions
401         This cuts the time spent in computeDimensions on compute_boids.html from about 2ms to about 0.002ms.
402
403         No new tests as there is no functional change intended.
404
405         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp:
406         (WebCore::WHLSL::computeDimensions):
407         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
408
409 2019-08-02  Ryosuke Niwa  <rniwa@webkit.org>
410
411         Ref Frame in DOMWindow::screen* functions
412         https://bugs.webkit.org/show_bug.cgi?id=200409
413
414         Reviewed by Simon Fraser.
415
416         Ref Frame in the following functions.
417
418         * page/DOMWindow.cpp:
419         (WebCore::DOMWindow::innerHeight const):
420         (WebCore::DOMWindow::innerWidth const):
421         (WebCore::DOMWindow::screenX const):
422         (WebCore::DOMWindow::screenY const):
423         (WebCore::DOMWindow::scrollX const):
424         (WebCore::DOMWindow::scrollY const):
425
426 2019-08-02  Mark Lam  <mark.lam@apple.com>
427
428         [ARM64E] Harden the diversity of the DOMJIT::Signature::unsafeFunction pointer.
429         https://bugs.webkit.org/show_bug.cgi?id=200292
430         <rdar://problem/53706881>
431
432         Reviewed by Geoffrey Garen.
433
434         * bindings/scripts/CodeGeneratorJS.pm:
435         (GenerateImplementation):
436         - Update to work with the new DOMJIT::Signature constructor.
437
438         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
439         - Re-base test results.
440
441 2019-08-02  Keith Rollin  <krollin@apple.com>
442
443         Consistently use Obj-C boolean literals
444         https://bugs.webkit.org/show_bug.cgi?id=200405
445         <rdar://problem/53880043>
446
447         Reviewed by Simon Fraser, Joseph Pecoraro.
448
449         There are places where we use equivalent but different expressions for
450         Obj-C boolean objects. For example, we use both [NSNumber
451         numberWithBool:YES] and @YES. There are places where both are used in
452         the same function, such as -[WebPreferences initialize]. The boolean
453         literal is in greater use and is more succinct, so standardize on
454         that. Also, change @(YES/NO) to @YES/NO.
455
456         No new tests -- no new or changed functionality.
457
458         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
459         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
460         * platform/graphics/cv/ImageTransferSessionVT.mm:
461         (WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
462         (WebCore::ImageTransferSessionVT::setSize):
463         (WebCore::ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions):
464         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
465         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
466         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
467         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
468         * platform/network/mac/ResourceHandleMac.mm:
469         (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
470
471 2019-08-02  Andres Gonzalez  <andresg_22@apple.com>
472
473         Add accessibility object method to determine whether an element is inside a table cell. Needed for iOS accessibility client.
474         https://bugs.webkit.org/show_bug.cgi?id=200394
475         <rdar://problem/52914964>
476
477         Reviewed by Chris Fleizach.
478
479         Explicitly returning BOOL to avoid error in some compiler configurations.
480         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
481         (-[WebAccessibilityObjectWrapper _accessibilityIsInTableCell]):
482
483 2019-08-02  Devin Rousso  <drousso@apple.com>
484
485         Web Inspector: fix inverted check in InspectorDOMStorageAgent::enable
486         Followup to r248179.
487
488         Rubber-stamped by Joseph Pecoraro.
489
490         * inspector/agents/InspectorDOMStorageAgent.cpp:
491         (WebCore::InspectorDOMStorageAgent::enable):
492
493 2019-08-02  Fujii Hironori  <Hironori.Fujii@sony.com>
494
495         [Curl] Crash while destructing a URL in ~SocketStreamHandle due to data race
496         https://bugs.webkit.org/show_bug.cgi?id=200378
497
498         Reviewed by Ross Kirsling.
499
500         URL::isolatedCopy() is called in the worker thread. URL is using a
501         thread-unsafe ref-counter. It should be called in the main thread.
502
503         Covered by existing tests.
504
505         * platform/network/curl/SocketStreamHandleImpl.h:
506         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
507         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl): Call URL::isolatedCopy() in the main thread.
508         (WebCore::SocketStreamHandleImpl::threadEntryPoint): Added a URL argument.
509
510 2019-08-02  Sihui Liu  <sihui_liu@apple.com>
511
512         API tests using permanent credentials should clear credentials left by previous tests
513         https://bugs.webkit.org/show_bug.cgi?id=199729
514
515         Reviewed by Alex Christensen.
516
517         Update existing API tests.
518
519         * platform/network/CredentialStorage.cpp:
520         (WebCore::CredentialStorage::clearSessionCredentials):
521         (WebCore::CredentialStorage::clearPermanentCredentialsForProtectionSpace): Deleted.
522         * platform/network/CredentialStorage.h:
523         * platform/network/mac/CredentialStorageMac.mm:
524         (WebCore::CredentialStorage::clearPermanentCredentialsForProtectionSpace): Deleted.
525
526 2019-08-02  Devin Rousso  <drousso@apple.com>
527
528         Web Inspector: Storage: disable related agents when the tab is closed
529         https://bugs.webkit.org/show_bug.cgi?id=200117
530
531         Reviewed by Joseph Pecoraro.
532
533         Rework how `enable`/`disable` is used for storage-related agents so that events are not sent
534         and data isn't kept alive when the Storage tab isn't enabled.
535
536         Covered by existing tests.
537
538         * inspector/agents/InspectorApplicationCacheAgent.h:
539         * inspector/agents/InspectorApplicationCacheAgent.cpp:
540         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
541         (WebCore::InspectorApplicationCacheAgent::enable):
542         (WebCore::InspectorApplicationCacheAgent::disable): Added.
543
544         * inspector/agents/InspectorDOMStorageAgent.cpp:
545         (WebCore::InspectorDOMStorageAgent::enable):
546         (WebCore::InspectorDOMStorageAgent::disable):
547
548         * inspector/agents/InspectorDatabaseAgent.cpp:
549         (WebCore::InspectorDatabaseAgent::enable):
550         (WebCore::InspectorDatabaseAgent::disable):
551
552 2019-08-02  Devin Rousso  <drousso@apple.com>
553
554         Web Inspector: Timelines: Develop > Start Timeline Recording doesn't work when focused on a detached inspector window
555         https://bugs.webkit.org/show_bug.cgi?id=200125
556         <rdar://problem/53543008>
557
558         Reviewed by Brian Burg.
559
560         Always show the Timelines tab in Web Inspector whenever timeline recording starts/stops.
561         Notify the UIProcess whenever the timeline recording state changes.
562
563         * inspector/InspectorClient.h:
564         (WebCore::InspectorClient::timelineRecordingChanged): Added.
565
566         * inspector/agents/InspectorTimelineAgent.h:
567         * inspector/agents/InspectorTimelineAgent.cpp:
568         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
569         (WebCore::InspectorTimelineAgent::internalStart):
570         (WebCore::InspectorTimelineAgent::internalStop):
571
572 2019-08-02  Yury Semikhatsky  <yurys@chromium.org>
573
574         Web Inspector: Crash when interacting with Template Content in Console
575         https://bugs.webkit.org/show_bug.cgi?id=196280
576
577         Reviewed by Joseph Pecoraro.
578
579         Test: inspector/dom/inspect-template-node.html
580
581         * bindings/js/JSDOMBindingSecurity.cpp:
582         (WebCore::canAccessDocument): if target element is from a
583         <template> use its host document to check the access. Elements
584         from the host document always have access to its template elements content.
585         * inspector/agents/InspectorDOMAgent.cpp:
586         (WebCore::InspectorDOMAgent::resolveNode): templates are created in
587         special template document which doesn't have a frame, in such case get
588         the frame from the host document.
589
590 2019-08-02  Ryosuke Niwa  <rniwa@webkit.org>
591
592         Harden NodeRareData::m_connectedFrameCount
593         https://bugs.webkit.org/show_bug.cgi?id=200300
594
595         Reviewed by Geoffrey Garen.
596
597         Use unsinged integer type in NodeRareData::m_connectedFrameCount since it's padded anyway.
598
599         * dom/Node.cpp:
600         (WebCore::Node::decrementConnectedSubframeCount): Check that hasRareNode() is true in release builds.
601         * dom/NodeRareData.h:
602
603 2019-08-02  Ryosuke Niwa  <rniwa@webkit.org>
604
605         Document::resume should delay resetting of form control elements.
606         https://bugs.webkit.org/show_bug.cgi?id=200376
607
608         Reviewed by Geoffrey Garen.
609
610         Delay the execution of form control element resets until the next task
611         to avoid synchronously mutating DOM during page cache restoration.
612
613         Test: fast/frames/restoring-page-cache-should-not-run-scripts.html
614
615         * html/HTMLFormElement.cpp:
616         (WebCore::HTMLFormElement::resumeFromDocumentSuspension):
617         * html/HTMLInputElement.cpp:
618         (WebCore::HTMLInputElement::resumeFromDocumentSuspension):
619
620 2019-08-02  Youenn Fablet  <youenn@apple.com>
621
622         [iOS] Directly use RealtimeMediaSourceCenter to compute the media capture  state
623         https://bugs.webkit.org/show_bug.cgi?id=200368
624         <rdar://problem/53191450>
625
626         Unreviewed.
627         Build fix by guarding with MEDIA_STREAM in addition to IOS.
628
629         * dom/Document.cpp:
630         (WebCore::Document::updateIsPlayingMedia):
631         (WebCore::Document::pageMutedStateDidChange):
632
633 2019-08-02  Andres Gonzalez  <andresg_22@apple.com>
634
635         Add accessibility object method to determine whether an element is inside a table cell. Needed for iOS accessibility client.
636         https://bugs.webkit.org/show_bug.cgi?id=200394
637         <rdar://problem/52914964>
638
639         Reviewed by Chris Fleizach.
640
641         Test: accessibility/ios-simulator/element-in-table-cell.html
642
643         Added _accessibilityIsInTableCell needed for iOS accessibility client.
644         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
645         (-[WebAccessibilityObjectWrapper _accessibilityIsInTableCell]):
646
647 2019-08-02  Eric Carlson  <eric.carlson@apple.com>
648
649         [macOS, iOS] webaudio/silent-audio-interrupted-in-background.html sometimes crashes
650         https://bugs.webkit.org/show_bug.cgi?id=200396
651         <rdar://problem/53819720>
652
653         Reviewed by Youenn Fablet.
654
655         No new test, this fixes an existing test.
656
657         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
658         (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC): Drop the
659         lock before clearing m_tapStorage. 
660
661 2019-08-02  Youenn Fablet  <youenn@apple.com>
662
663         [iOS] Directly use RealtimeMediaSourceCenter to compute the media capture  state
664         https://bugs.webkit.org/show_bug.cgi?id=200368
665         <rdar://problem/53191450>
666
667         Reviewed by Eric Carlson.
668
669         Instead of registering a MediaStreamTrack as a media producer to compute capture state,
670         go directly to the sources from the RealtimeMediaSourceCenter.
671         Do the same when requested to mute capture tracks.
672
673         No observable change of behavior.
674         Covered by manual test on iOS and existing tests.
675
676         * Modules/mediastream/MediaStreamTrack.cpp:
677         (WebCore::MediaStreamTrack::MediaStreamTrack):
678         (WebCore::MediaStreamTrack::~MediaStreamTrack):
679         (WebCore::MediaStreamTrack::mediaState const):
680         (WebCore::sourceCaptureState):
681         (WebCore::MediaStreamTrack::captureState):
682         (WebCore::MediaStreamTrack::muteCapture):
683         * Modules/mediastream/MediaStreamTrack.h:
684         * dom/Document.cpp:
685         (WebCore::Document::updateIsPlayingMedia):
686         (WebCore::Document::pageMutedStateDidChange):
687
688 2019-08-02  Chris Dumez  <cdumez@apple.com>
689
690         DOMWindow properties may get GC'd before their Window object
691         https://bugs.webkit.org/show_bug.cgi?id=200359
692
693         Reviewed by Ryosuke Niwa.
694
695         DOMWindow properties may get GC'd before their Window object once their frame is detached. This
696         is unexpected behavior given that these properties persist on the Window after the frame is
697         detached. This patch thus updates their bindings so that they live as long as their window, not
698         their frame.
699
700         Note that this also fixes a thread-safety issue since DOMWindowProperty::frame() would get called
701         from GC threads, although its implementation looks like:
702         """
703           return m_window ? m_window->frame() : nullptr;
704         """
705
706         Because m_window is a WeakPtr<DOMWindow> and because windows get destroyed on the main thread,
707         we could in theory crash when dereferencing m_window->frame() from the GC thread.
708
709         Test: fast/dom/dom-window-property-gc-after-frame-detach.html
710
711         * bindings/js/JSDOMWindowCustom.cpp:
712         (WebCore::JSDOMWindow::visitAdditionalChildren):
713         * bindings/scripts/CodeGeneratorJS.pm:
714         (GenerateImplementation):
715         * bindings/scripts/IDLAttributes.json:
716         * css/StyleMedia.idl:
717         * loader/appcache/DOMApplicationCache.idl:
718         * page/BarProp.idl:
719         * page/DOMSelection.idl:
720         * page/History.idl:
721         * page/Location.idl:
722         * page/Navigator.idl:
723         * page/Screen.idl:
724         * page/VisualViewport.idl:
725         * plugins/DOMMimeTypeArray.idl:
726         * plugins/DOMPluginArray.idl:
727         * storage/Storage.idl:
728
729 2019-08-02  Konstantin Tokarev  <annulen@yandex.ru>
730
731         Remove constructors and operators of FontPlatformData defined only for Freetype
732         https://bugs.webkit.org/show_bug.cgi?id=200379
733
734         Reviewed by Carlos Garcia Campos.
735
736         These methods only make maintenance harder, as all data fields are
737         trivially copyable. Constructors generated by compiler should be used
738         instead.
739
740         * platform/graphics/FontPlatformData.h:
741         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
742
743 2019-08-02  Konstantin Tokarev  <annulen@yandex.ru>
744
745         Remove unused constructor declaration from FontPlatformData
746         https://bugs.webkit.org/show_bug.cgi?id=200371
747
748         Reviewed by Carlos Garcia Campos.
749
750         It is not implemented by any port.
751
752         * platform/graphics/FontPlatformData.h:
753
754 2019-08-01  Chris Dumez  <cdumez@apple.com>
755
756         Pages using MessagePorts should be PageCacheable
757         https://bugs.webkit.org/show_bug.cgi?id=200366
758         <rdar://problem/53837882>
759
760         Reviewed by Geoffrey Garen.
761
762         Allow a page to enter PageCache, even if it has MessagePorts (potentially with
763         pending messages). If there are pending messages on the MessagePorts when
764         entering PageCache, those will get dispatched upon restoring from PageCache.
765
766         Test: fast/history/page-cache-MessagePort-pending-message.html
767
768         * dom/MessagePort.cpp:
769         (WebCore::MessagePort::messageAvailable):
770         (WebCore::MessagePort::dispatchMessages):
771         Do not dispatch messages while in PageCache.
772
773         (WebCore::MessagePort::canSuspendForDocumentSuspension const):
774         Allow pages with MessagePort objects to enter PageCache.
775
776         * dom/ScriptExecutionContext.cpp:
777         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
778         Make sure pending messages on MessagePorts get dispatched asynchronously after restoring
779         from PageCache.
780
781         * loader/DocumentLoader.cpp:
782         (WebCore::areAllLoadersPageCacheAcceptable):
783         Make sure only CachedResources that are still loading upon load cancelation prevent
784         entering PageCache.
785
786 2019-08-01  Konstantin Tokarev  <annulen@yandex.ru>
787
788         Fix compilation of PageConsoleClient with !ENABLE(VIDEO)
789         https://bugs.webkit.org/show_bug.cgi?id=200380
790
791         Reviewed by Joseph Pecoraro.
792
793         * page/PageConsoleClient.cpp:
794         (WebCore::PageConsoleClient::screenshot):
795
796 2019-08-01  Mark Lam  <mark.lam@apple.com>
797
798         Add crash diagnostics for debugging unexpected zapped cells.
799         https://bugs.webkit.org/show_bug.cgi?id=200149
800         <rdar://problem/53570112>
801
802         Reviewed by Yusuke Suzuki.
803
804         No new tests because this is a feature for debugging crashes.  It has been tested
805         manually by modifying the code to force a crash at the point of interest.
806
807         Added some comments to document the hashes of known subspaces.
808
809         * bindings/js/WebCoreJSClientData.cpp:
810         (WebCore::JSVMClientData::JSVMClientData):
811
812 2019-08-01  Saam Barati  <sbarati@apple.com>
813
814         [WHLSL] Do simple nullptr check elimination using basic data flow analysis when generating metal code
815         https://bugs.webkit.org/show_bug.cgi?id=200352
816
817         Reviewed by Myles C. Maxfield.
818
819         When doing metal code generation, we frequently know whether something
820         is null or not. This patch does a basic propagation of this information
821         to avoid emitting excessive null checks in the generated Metal code.
822         This is a 6% speedup (with a p value of 0.0001) in Metal compile times
823         on compute_boids.
824
825         An example of a null check we now eliminate is:
826         ```
827         int x;
828         thread int* ptr = &x; // We know that the lvalue for "x" is non-null, so we produce a non-null rvalue here.
829         *ptr = 42; // We know that the "ptr" rvalue is non-null, so we omit the null check.
830         ```
831
832         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
833         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValueWithNullability):
834         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValue):
835         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue):
836         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValueAndNullability):
837         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue):
838         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
839
840 2019-08-01  Alex Christensen  <achristensen@webkit.org>
841
842         Move FormData zip file generation to NetworkProcess and enable it for all WebKit clients for uploading directories
843         https://bugs.webkit.org/show_bug.cgi?id=200102
844         <rdar://problem/53275114>
845
846         Reviewed by Darin Adler.
847
848         To enable directory uploading in WebKit2, we extended WebKit1's model of asking the application to generate a file for uploading.
849         This means the WebProcess needed access to everything necessary to zip a whole directory, and clients that have not implemented
850         the strange WKBundlePageUIClient callbacks won't be able to upload directories.  Safari's implementation had already been copied
851         to BlobDataFileReference::generateReplacementFile, so I reused that code to do the zipping.  Instead of a complicated model of
852         keeping track of a filename, possibly a generated filename, and whether we think we own the file or not and having nobody clean up,
853         we now do the generation, use, and cleaning up in the network process starting with a new function generateFilesForUpload.
854         This removes unimplemented SPI in WebUIDelegatePrivate in WebKitLegacy and stops calling the WKBundlePageUIClient related to upload
855         file generation and replaces them with automatic behavior equivalent to Safari's implementation of the WKBundlePageUIClient calls.
856         Since we no longer need to do these file operations in the WebProcess, I am also reverting r245322 and r246077 which tightens the sandbox.
857
858         Covered by an API test.
859
860         * Modules/fetch/FetchBody.cpp:
861         (WebCore::FetchBody::extract):
862         (WebCore::FetchBody::bodyAsFormData const):
863         * loader/FormSubmission.cpp:
864         (WebCore::FormSubmission::create):
865         * loader/FrameLoader.cpp:
866         (WebCore::FrameLoader::submitForm):
867         (WebCore::FrameLoader::loadDifferentDocumentItem):
868         * loader/ResourceLoader.cpp:
869         (WebCore::ResourceLoader::didReceiveResponse):
870         (WebCore::ResourceLoader::cleanupForError):
871         * page/Chrome.cpp:
872         (WebCore::ChromeClient::shouldReplaceWithGeneratedFileForUpload): Deleted.
873         (WebCore::ChromeClient::generateReplacementFile): Deleted.
874         * page/ChromeClient.h:
875         * platform/network/FormData.cpp:
876         (WebCore::FormData::FormData):
877         (WebCore::FormData::~FormData):
878         (WebCore::FormData::createMultiPart):
879         (WebCore::FormDataElement::lengthInBytes const):
880         (WebCore::FormData::appendFile):
881         (WebCore::FormData::appendFileRange):
882         (WebCore::FormData::appendMultiPartFileValue):
883         (WebCore::FormData::appendMultiPartKeyValuePairItems):
884         (WebCore::FormData::resolveBlobReferences):
885         (WebCore::generateFileForUpload):
886         (WebCore::FormData::generateFilesForUpload):
887         (WebCore::FormData::generateFiles): Deleted.
888         (WebCore::FormData::hasGeneratedFiles const): Deleted.
889         (WebCore::FormData::hasOwnedGeneratedFiles const): Deleted.
890         (WebCore::FormData::removeGeneratedFilesIfNeeded): Deleted.
891         * platform/network/FormData.h:
892         (WebCore::FormDataElement::FormDataElement):
893         (WebCore::FormDataElement::EncodedFileData::isolatedCopy const):
894         (WebCore::FormDataElement::EncodedFileData::operator== const):
895         (WebCore::FormDataElement::EncodedFileData::encode const):
896         (WebCore::FormDataElement::EncodedFileData::decode):
897         * platform/network/cf/FormDataStreamCFNet.cpp:
898         (WebCore::advanceCurrentStream):
899         (WebCore::formCreate):
900         (WebCore::formFinalize):
901         (WebCore::createHTTPBodyCFReadStream):
902         * platform/network/mac/BlobDataFileReferenceMac.mm:
903         (WebCore::generateFileForUpload):
904         (WebCore::BlobDataFileReference::generateReplacementFile):
905         * xml/XMLHttpRequest.cpp:
906         (WebCore::XMLHttpRequest::send):
907
908 2019-08-01  Wenson Hsieh  <wenson_hsieh@apple.com>
909
910         [Text autosizing] [iPadOS] Add targeted hacks to address some remaining text autosizing issues
911         https://bugs.webkit.org/show_bug.cgi?id=200271
912         <rdar://problem/51734741>
913
914         Reviewed by Zalan Bujtas.
915
916         Makes some targeted adjustments to the text autosizing heuristic, to ensure compatibility with several high-
917         profile websites. See changes below for more detail.
918
919         Tests:  fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidate-special-cases.html
920                 fast/text-autosizing/ios/idempotentmode/line-height-boosting.html
921
922         * css/StyleResolver.cpp:
923         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
924
925         Avoid clipped sidebar links on sohu.com by not performing line-height boosting in the case where the element
926         probably has a small, fixed number of lines. See below for more detail. Additionally, don't attempt to adjust
927         the line height using the boosted font size, in the case where the element is not a candidate for idempotent
928         text autosizing.
929
930         * rendering/style/RenderStyle.cpp:
931         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
932
933         Make various targeted hacks to fix a few websites:
934
935         -   Add a special case for top navigation bar links on yandex.ru, where line height greatly exceeds the
936             specified font size.
937
938         -   Avoid boosting some related video links on v.youku.com by considering the line-clamp CSS property when
939             determining the maximum number of lines of text an element is expected to contain.
940
941         -   Avoid boosting some front page links on asahi.com, which have non-repeating background images.
942
943         -   Add several other adjustments to more aggressively boost pieces of text on Google search results, such as
944             taking the `word-break` CSS property into account.
945
946         The bottom few pixels of sidebar links on naver.com are also no longer clipped after these changes.
947
948         * rendering/style/TextSizeAdjustment.cpp:
949         (WebCore::AutosizeStatus::probablyContainsASmallFixedNumberOfLines):
950
951         Pulls out a piece of the heuristic added to fix sephora.com in r247467 out into a separate helper method. To
952         recap, this heuristic identifies elements with both a fixed height and fixed line height, for which the fixed
953         height is close to an integer multiple of the line height.
954
955         Also makes several small tweaks in the process: (1) change the max difference between fixed line height and
956         font size from 6 to 5 to ensure that some multiline caption text on Google search results is boosted, and (2)
957         replace usages of `lineHeight()` with `specifiedLineHeight()`, which current prevents this function from being
958         truly idempotent.
959
960         (WebCore::AutosizeStatus::updateStatus):
961         * rendering/style/TextSizeAdjustment.h:
962
963 2019-07-31  Mark Lam  <mark.lam@apple.com>
964
965         Rename DOMJIT safe/unsafeFunction to functionWithTypeChecks and functionWithoutTypeChecks.
966         https://bugs.webkit.org/show_bug.cgi?id=200323
967
968         Reviewed by Yusuke Suzuki.
969
970         No new tests.  This is just a refactoring exercise.
971
972         * bindings/scripts/CodeGeneratorJS.pm:
973         (GetArgumentTypeForFunctionWithoutTypeCheck):
974         (GenerateImplementation):
975         (GenerateOperationDefinition):
976         (ToNativeForFunctionWithoutTypeCheck):
977         (GetUnsafeArgumentType): Deleted.
978         (UnsafeToNative): Deleted.
979         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
980         (WebCore::jsTestDOMJITPrototypeFunctionGetAttributeWithoutTypeCheck):
981         (WebCore::jsTestDOMJITPrototypeFunctionItemWithoutTypeCheck):
982         (WebCore::jsTestDOMJITPrototypeFunctionHasAttributeWithoutTypeCheck):
983         (WebCore::jsTestDOMJITPrototypeFunctionGetElementByIdWithoutTypeCheck):
984         (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByNameWithoutTypeCheck):
985         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetAttribute): Deleted.
986         (WebCore::unsafeJsTestDOMJITPrototypeFunctionItem): Deleted.
987         (WebCore::unsafeJsTestDOMJITPrototypeFunctionHasAttribute): Deleted.
988         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementById): Deleted.
989         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementsByName): Deleted.
990
991 2019-08-01  Carlos Garcia Campos  <cgarcia@igalia.com>
992
993         [SOUP] WebSockets: add support for extensions when using web sockets libsoup API
994         https://bugs.webkit.org/show_bug.cgi?id=199943
995
996         Reviewed by Alex Christensen.
997
998         Add SOUP_TYPE_WEBSOCKET_EXTENSION_MANAGER feature to the soup session to enable WebSocket extensions.
999
1000         Tests: http/tests/websocket/tests/hybi/imported/blink/permessage-deflate-comp-bit-onoff.html
1001                http/tests/websocket/tests/hybi/imported/blink/permessage-deflate-invalid-parameter.html
1002                http/tests/websocket/tests/hybi/imported/blink/permessage-deflate-parameter.html
1003                http/tests/websocket/tests/hybi/imported/blink/permessage-deflate-set-bfinal.html
1004                http/tests/websocket/tests/hybi/imported/blink/permessage-deflate-split-frames.html
1005                http/tests/websocket/tests/hybi/imported/blink/permessage-deflate-unsolicited-negotiation-response.html
1006                http/tests/websocket/tests/hybi/imported/blink/permessage-deflate-window-bits.html
1007
1008         * platform/network/soup/SoupNetworkSession.cpp:
1009         (WebCore::SoupNetworkSession::SoupNetworkSession):
1010
1011 2019-08-01  Chris Dumez  <cdumez@apple.com>
1012
1013         [iOS][WK1] Unsafe unsafe of WeakPtr<Document> from UIThread under PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit()
1014         https://bugs.webkit.org/show_bug.cgi?id=200324
1015
1016         Reviewed by Ryosuke Niwa.
1017
1018         The Document is a WebThread object, but a WeakPtr<Document> was dereferenced from the
1019         UIThread in HTMLMediaElement::supportsSeeking(), from the PlaybackSessionInterfaceAVKit
1020         constructor. To address the issue we now grab the WebThread lock before constructing
1021         the PlaybackSessionInterfaceAVKit.
1022
1023         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1024         (VideoFullscreenControllerContext::setUpFullscreen):
1025
1026 2019-08-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1027
1028         [SOUP] Switch to use libsoup WebSockets API
1029         https://bugs.webkit.org/show_bug.cgi?id=200162
1030
1031         Reviewed by Michael Catanzaro.
1032
1033         Use the libsoup WebSockets API unconditionally for libsoup based ports.
1034
1035         * Modules/websockets/ThreadableWebSocketChannel.cpp:
1036         (WebCore::ThreadableWebSocketChannel::create): Do not check the env var anymore.
1037         * platform/SourcesSoup.txt:
1038         * platform/network/SocketStreamHandleImpl.cpp:
1039         * platform/network/StorageSessionProvider.h:
1040         * platform/network/soup/SocketStreamHandleImpl.h:
1041         * platform/network/soup/SocketStreamHandleImplSoup.cpp: Removed.
1042
1043 2019-07-31  Devin Rousso  <drousso@apple.com>
1044
1045         Web Inspector: Debugger: support emulateUserGesture parameter in Debugger.evaluateOnCallFrame
1046         https://bugs.webkit.org/show_bug.cgi?id=200272
1047
1048         Reviewed by Joseph Pecoraro.
1049
1050         When paused, evaluating in the console should still respect the "Emulate User Gesture" checkbox.
1051
1052         Tests: inspector/debugger/evaluateOnCallFrame-emulateUserGesture.html
1053                inspector/debugger/evaluateOnCallFrame-emulateUserGesture-userIsInteracting.html
1054
1055         * inspector/agents/page/PageDebuggerAgent.h:
1056         * inspector/agents/page/PageDebuggerAgent.cpp:
1057         (WebCore::PageDebuggerAgent::evaluateOnCallFrame): Added.
1058
1059 2019-07-31  Saam Barati  <sbarati@apple.com>
1060
1061         [WHLSL] Replace memsetZero function with inline "= { }" code
1062         https://bugs.webkit.org/show_bug.cgi?id=200328
1063
1064         Reviewed by Robin Morisset.
1065
1066         This is a ~20ms metal compile time improvement on compute_boids.
1067
1068         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1069         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
1070         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1071         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1072         (WebCore::WHLSL::Metal::writeNativeFunction):
1073         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
1074
1075 2019-07-31  Andy Estes  <aestes@apple.com>
1076
1077         REGRESSION (r240942): first visually non-empty layout milestone is not reached in media documents until after the video finishes loading
1078         https://bugs.webkit.org/show_bug.cgi?id=200293
1079         <rdar://problem/52937749>
1080
1081         Reviewed by Alex Christensen.
1082
1083         r240942 changed FrameView::qualifiesAsVisuallyNonEmpty() to consider only documents in the
1084         Interactive or Complete ready states as "finished parsing". Documents considered finished
1085         parsing can qualify as visually non-empty even without exceeding the visual character or
1086         pixel thresholds, but documents considered not finished must first exceed one of these
1087         thresholds in order to qualify as visually non-empty.
1088
1089         HTMLDocuments are placed in the Interactive ready state by their HTMLDocumentParsers.
1090         However, HTMLDocument subclasses like ImageDocument and MediaDocument use their own custom
1091         parsers that never set the Interactive ready state on their documents; these documents go
1092         from Loading directly to Complete.
1093
1094         In order for these HTMLDocument subclasses to be considered visually non-empty before they
1095         finish loading they must render something that exceeds the visual character or pixel
1096         thresholds. For image documents, rendering the image is usually enough to cross the
1097         threshold, but for media documents the visual pixel threshold was never crossed because
1098         videos did not contribute to the visually non-empty pixel count.
1099
1100         As a result, media documents are not considered visually non-empty until the main resource
1101         finishes loading. On iOS this means that the layer tree remains frozen until this point,
1102         even though the media might have started autoplaying with audio long before it finished
1103         loading.
1104
1105         Fix this by teaching RenderVideo to contribute the video player's size to FrameView's
1106         visually non-empty pixel count once the video player has loaded enough data to determine its
1107         intrinsic size. Videos that render more than 1024 pixels will qualify a media document as
1108         visually non-empty even when it is still loading its main resource.
1109
1110         Added a new API test.
1111
1112         * rendering/RenderImage.cpp:
1113         (WebCore::RenderImage::imageChanged):
1114         (WebCore::RenderImage::incrementVisuallyNonEmptyPixelCountIfNeeded):
1115         * rendering/RenderImage.h:
1116         * rendering/RenderVideo.cpp:
1117         (WebCore::RenderVideo::updateIntrinsicSize):
1118
1119 2019-07-31  Saam Barati  <sbarati@apple.com>
1120
1121         [WHLSL] Remove UnnamedType copy/move constructors and mark classes as final
1122         https://bugs.webkit.org/show_bug.cgi?id=200188
1123         <rdar://problem/53628171>
1124
1125         Unreviewed followup.
1126
1127         As Darin pointed out in the bugzilla comments, when defining a copy
1128         constructor in C++ (either deleted or an implementation), the move
1129         constructor is implicitly deleted. This match removes the excessive
1130         use of WTF_MAKE_NONMOVABLE when we're already using WTF_MAKE_NONCOPYABLE.
1131
1132         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
1133         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
1134         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
1135         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
1136         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
1137         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
1138
1139 2019-07-31  Zalan Bujtas  <zalan@apple.com>
1140
1141         [ContentChangeObserver] twitch.tv video controls do not always respond to taps in fullscreen
1142         https://bugs.webkit.org/show_bug.cgi?id=200309
1143         <rdar://problem/52964977>
1144
1145         Reviewed by Simon Fraser.
1146
1147         Do not consider an element visible if it is not a descendant of the active fullscreen element.
1148
1149         This patch fixes the cases when the user taps on a button in fullscreen mode while the non-fullscreen content is being mutated and
1150         the ContentChangeObserver mistakenly registers it as a valid, actionable change and as a result we don't fire the click event (stay at hover).
1151
1152         Test: fast/events/touch/ios/content-observation/non-visible-content-change-in-fullscreen-mode.html
1153
1154         * page/ios/ContentChangeObserver.cpp:
1155         (WebCore::fullscreenElement):
1156         (WebCore::ContentChangeObserver::isVisuallyHidden):
1157
1158 2019-07-31  Saam Barati  <sbarati@apple.com>
1159
1160         [WHLSL Remove char/short/half types
1161         https://bugs.webkit.org/show_bug.cgi?id=200312
1162
1163         Reviewed by Myles C. Maxfield.
1164
1165         This patch removes the char/short/half types from WHLSL. Since it's not
1166         supported by all HW, WebGPU is leaving these types out for now. This is
1167         also a huge speedup, since it halves the size of the standard library.
1168         
1169         In the compute_boids demo, WHLSL::prepare goes from running in ~140ms to
1170         running in ~60ms.
1171
1172         Test: webgpu/whlsl/smaller-than-32-bit-types.html
1173
1174         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
1175         (WebCore::WHLSL::Metal::writeNativeType):
1176         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
1177         (WebCore::WHLSL::Intrinsics::addPrimitive):
1178         (WebCore::WHLSL::Intrinsics::addVector):
1179         (WebCore::WHLSL::Intrinsics::addMatrix):
1180         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
1181         (WebCore::WHLSL::Intrinsics::WTF_ARRAY_LENGTH):
1182         (WebCore::WHLSL::Intrinsics::ucharType const): Deleted.
1183         (WebCore::WHLSL::Intrinsics::ushortType const): Deleted.
1184         (WebCore::WHLSL::Intrinsics::charType const): Deleted.
1185         (WebCore::WHLSL::Intrinsics::shortType const): Deleted.
1186         (WebCore::WHLSL::Intrinsics::uchar2Type const): Deleted.
1187         (WebCore::WHLSL::Intrinsics::uchar4Type const): Deleted.
1188         (WebCore::WHLSL::Intrinsics::ushort2Type const): Deleted.
1189         (WebCore::WHLSL::Intrinsics::ushort4Type const): Deleted.
1190         (WebCore::WHLSL::Intrinsics::char2Type const): Deleted.
1191         (WebCore::WHLSL::Intrinsics::char4Type const): Deleted.
1192         (WebCore::WHLSL::Intrinsics::short2Type const): Deleted.
1193         (WebCore::WHLSL::Intrinsics::short4Type const): Deleted.
1194         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
1195         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
1196         (WebCore::WHLSL::isAcceptableFormat):
1197         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
1198         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1199         (WebCore::convertTextureFormat):
1200
1201 2019-07-31  Youenn Fablet  <youenn@apple.com>
1202
1203         Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
1204         https://bugs.webkit.org/show_bug.cgi?id=200241
1205
1206         Reviewed by Myles C. Maxfield.
1207
1208         We can use CTFontCreateForCharactersWithLanguageAndOption instead of CTFontCreateForCharactersWithLanguage
1209         as it allows setting more easily the fallback option.
1210         This allows us to never fallback to user installed fonts.
1211         In such a case, we no longer need to wrap the fonts to change the fallback option.
1212         We also prewarm the fonts with the same SPI and use system fallback as the default value.
1213
1214         Covered by existing tests.
1215
1216         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1217         (WebCore::preparePlatformFont):
1218         (WebCore::lookupFallbackFont):
1219         (WebCore::FontCache::systemFallbackForCharacters):
1220         (WebCore::FontCache::prewarm):
1221         (WebCore::fontFamiliesForPrewarming):
1222
1223 2019-07-31  Devin Rousso  <drousso@apple.com>
1224
1225         Web Inspector: Overlay: add page width/height display
1226         https://bugs.webkit.org/show_bug.cgi?id=199369
1227
1228         Reviewed by Joseph Pecoraro.
1229
1230         Show `${width}px x ${height}px` in the corner where the horizontal and vertical rulers meet.
1231         This way, if the rulers shift due to the highlighted content, the page width/height does too.
1232
1233         * inspector/InspectorOverlay.h:
1234         * inspector/InspectorOverlay.cpp:
1235         (WebCore::truncateWithEllipsis):
1236         (WebCore::InspectorOverlay::drawNodeHighlight):
1237         (WebCore::InspectorOverlay::drawQuadHighlight):
1238         (WebCore::InspectorOverlay::drawRulers):
1239         (WebCore::InspectorOverlay::drawElementTitle):
1240
1241 2019-07-31  Youenn Fablet  <youenn@apple.com>
1242
1243         Owners of MultiChannelResampler should make sure that the output bus given to it has the same number of channels
1244         https://bugs.webkit.org/show_bug.cgi?id=200248
1245         <rdar://problem/53411051>
1246
1247         Reviewed by Eric Carlson.
1248
1249         When a track's number of channels changes, MediaStreamAudioSourceNode is expected
1250         to update its MultiChannelResampler and its output number of channels.
1251         MultiChannelResampler expects to have the same number of channels as the output
1252         but it is not always the case since the channel numbers are changed in different threads
1253         and locks do not help there.
1254
1255         Instead, whenever detecting that the number of channels do not match, render silence
1256         and wait for the next rendering where the number of channels should again match.
1257
1258         Add internals API to change the number of channels from 2 to 1 or 1 to 2
1259         to allow testing that code path (iOS only as MacOS audio capture is in UIProcess).
1260         Covered by updated test.
1261
1262         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
1263         (WebCore::MediaElementAudioSourceNode::process):
1264         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
1265         (WebCore::MediaStreamAudioSourceNode::process):
1266         * platform/audio/MultiChannelResampler.cpp:
1267         (WebCore::MultiChannelResampler::process):
1268         * platform/mediastream/RealtimeMediaSource.h:
1269         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1270         (WebCore::MockRealtimeAudioSourceMac::reconfigure):
1271         * platform/mock/MockRealtimeAudioSource.cpp:
1272         (WebCore::MockRealtimeAudioSource::setChannelCount):
1273         * platform/mock/MockRealtimeAudioSource.h:
1274         (isType):
1275         * platform/mock/MockRealtimeVideoSource.h:
1276         * testing/Internals.cpp:
1277         (WebCore::Internals::setMockAudioTrackChannelNumber):
1278         * testing/Internals.h:
1279         * testing/Internals.idl:
1280
1281 2019-07-31  Chris Dumez  <cdumez@apple.com>
1282
1283         Element.outerHTML is missing attribute prefixes in some cases in HTML documents
1284         https://bugs.webkit.org/show_bug.cgi?id=200283
1285
1286         Reviewed by Ryosuke Niwa.
1287
1288         When HTML serializing a prefixed element attribute, we should always serialize the
1289         prefix as per [1]. However, our code was only serializing the well-known ones (xml,
1290         xmlns & xlink).
1291
1292         [1] https://html.spec.whatwg.org/#attribute's-serialised-name
1293
1294         Test: fast/dom/Element/outerHTML-prefixed-attribute.html
1295
1296         * editing/MarkupAccumulator.cpp:
1297         (WebCore::htmlAttributeSerialization):
1298         (WebCore::MarkupAccumulator::xmlAttributeSerialization):
1299         (WebCore::MarkupAccumulator::appendAttribute):
1300         * editing/MarkupAccumulator.h:
1301
1302 2019-07-31  Loïc Yhuel  <loic.yhuel@softathome.com>
1303
1304         [GStreamer] Fix printf format warnings for 32-bit build in GST traces
1305         https://bugs.webkit.org/show_bug.cgi?id=200299
1306
1307         Reviewed by Xabier Rodriguez-Calvar.
1308
1309         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1310         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage): %zu for size_t
1311         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): Ditto
1312         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1313         (webKitWebSrcCreate): G_GUINT64_FORMAT for uint64_t
1314         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: G_GINT64_FORMAT for int64_t
1315         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Ditto
1316
1317 2019-07-31  Andres Gonzalez  <andresg_22@apple.com>
1318
1319         AX: Re-enable accessibility/set-selected-text-range-after-newline.html test.
1320         https://bugs.webkit.org/show_bug.cgi?id=199431
1321         <rdar://problem/52563340>
1322
1323         Reviewed by Chris Fleizach.
1324
1325         - Re-enabled LayoutTests/accessibility/set-selected-text-range-after-newline.html.
1326         - Put back workaround in visiblePositionForIndexUsingCharacterIterator
1327         that is needed for several accessibility issues.
1328         - This workaround was rolled back because it was thought the cause of:
1329         https://bugs.webkit.org/show_bug.cgi?id=199434
1330         It turned out that the actual cause of that hang was unrelated and was
1331         fixed in:
1332         https://bugs.webkit.org/show_bug.cgi?id=199845
1333
1334         * editing/Editing.cpp:
1335         (WebCore::visiblePositionForIndexUsingCharacterIterator):
1336
1337 2019-07-31  Devin Rousso  <drousso@apple.com>
1338
1339         Web Inspector: Second call to setAttributeNS creates non-prefixed attribute
1340         https://bugs.webkit.org/show_bug.cgi?id=200230
1341         <rdar://problem/53712672>
1342
1343         Reviewed by Joseph Pecoraro.
1344
1345         Original patch by Chris Dumez <cdumez@apple.com>.
1346
1347         Test: inspector/dom/attributeModified.html
1348
1349         * dom/Element.cpp:
1350         (WebCore::Element::didAddAttribute):
1351         (WebCore::Element::didModifyAttribute):
1352         (WebCore::Element::didRemoveAttribute):
1353         Use the fully qualified name, not just the local name, when notifying the inspector frontend
1354         about changes to attributes.
1355
1356 2019-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1357
1358         [GTK] Datalist element support for TextFieldInputType
1359         https://bugs.webkit.org/show_bug.cgi?id=98934
1360
1361         Reviewed by Michael Catanzaro.
1362
1363         Add support for rendering the arrow indicator of text fields having data list.
1364
1365         * rendering/RenderThemeGtk.cpp:
1366         (WebCore::RenderThemeGtk::paintTextField):
1367         (WebCore::RenderThemeGtk::adjustListButtonStyle const):
1368         (WebCore::RenderThemeGtk::paintListButtonForInput):
1369         (WebCore::RenderThemeGtk::adjustSearchFieldStyle const):
1370         * rendering/RenderThemeGtk.h:
1371
1372 2019-07-30  Tim Horton  <timothy_horton@apple.com>
1373
1374         ASSERTion failure under takeSnapshot after r247846
1375
1376         * page/TextIndicator.cpp:
1377         (WebCore::takeSnapshots):
1378         We now sometimes inflate the scale factor; allow this.
1379
1380 2019-07-30  Saam Barati  <sbarati@apple.com>
1381
1382         [WHLSL] Add a fast path for TypeNamer::insert where we've already seen the type
1383         https://bugs.webkit.org/show_bug.cgi?id=200284
1384
1385         Reviewed by Myles C. Maxfield.
1386
1387         This is a ~27% speedup in the WHLSL::prepare for the compute_boids test.
1388         This optimization makes sense since my previous patch to make UnnamedType
1389         ref counted was also a huge speedup. So the TypeNamer is seeing many
1390         UnnamedTypes which are the same pointer value. On compute_boids, this
1391         makes generateMetalCode ~40ms faster.
1392
1393         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
1394         (WebCore::WHLSL::Metal::TypeNamer::insert):
1395
1396 2019-07-29  Ryosuke Niwa  <rniwa@webkit.org>
1397
1398         WorkerGlobalScope::wrapCryptoKey/unwrapCryptoKey should use local heap objects for replies
1399         https://bugs.webkit.org/show_bug.cgi?id=200179
1400         <rdar://problem/52334658>
1401
1402         Reviewed by Brent Fulgham.
1403
1404         Based on the patch by Jiewen Tan.
1405
1406         WorkerGlobalScope::wrapCryptoKey and WorkerGlobalScope::unwrapCryptoKey had a bug that they could exit
1407         the function before the main thread had finished writing to the result vector passed in to these functions
1408         when the worker's runloop receives MessageQueueTerminated before the main thread finishes writing.
1409
1410         Fixed the bug by creating a new temporary Vector inside a ThreadSafeRefCounted object shared between
1411         the main thread and the worker thread, which extends the lifetime of the Vector until when the worker thread
1412         receives the result or when the main thread finishes writing to the Vector, whichever happens last.
1413
1414         Unfortunately no new tests since there is no reproducible test case, and this crash is highly racy.
1415
1416         * workers/WorkerGlobalScope.cpp:
1417         (WebCore::CryptoBufferContainer): Added.
1418         (WebCore::CryptoBufferContainer::create): Added.
1419         (WebCore::CryptoBufferContainer::buffer): Added.
1420         (WebCore::WorkerGlobalScope::wrapCryptoKey):
1421         (WebCore::WorkerGlobalScope::unwrapCryptoKey):
1422
1423 2019-07-30  Saam Barati  <sbarati@apple.com>
1424
1425         [WHLSL] Checker sets wrong type for property access instruction with an ander
1426         https://bugs.webkit.org/show_bug.cgi?id=200282
1427
1428         Reviewed by Myles C. Maxfield.
1429
1430         We were assigning resulting type based on the base value instead of the ander
1431         of the base value. For example, consider:
1432         ```
1433         struct Point { float x; float y; }
1434         compute main(device Point[] buffer) { buffer[0]; }
1435         ```
1436         
1437         The local variable "buffer" is in the "thread" address space. So we would end up
1438         trying to use the thread address space for "buffer[0]". This caused us to
1439         generate invalid Metal code because we would call a "thread" ander with a
1440         "device" pointer. The fix is to use the "device" address space, which is
1441         the type of the ander we were already setting on this property access instruction.
1442
1443         Test: webgpu/whlsl/device-proper-type-checker.html
1444
1445         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1446         (WebCore::WHLSL::Checker::finishVisiting):
1447
1448 2019-07-30  Saam Barati  <sbarati@apple.com>
1449
1450         [WHLSL] Make ASTDumper dump types and address spaces
1451         https://bugs.webkit.org/show_bug.cgi?id=200281
1452
1453         Reviewed by Robin Morisset.
1454
1455         This makes it much easier to gain insight into what type resolution
1456         the checker does. I used this logging to debug https://bugs.webkit.org/show_bug.cgi?id=200282
1457
1458         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
1459         (WebCore::WHLSL::AST::TypeAnnotation::isAbstractLeftValue const):
1460         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
1461         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
1462         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
1463         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
1464         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
1465         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
1466         (WebCore::WHLSL::ASTDumper::visit):
1467
1468 2019-07-30  Brent Fulgham  <bfulgham@apple.com>
1469
1470         [FTW] Refactor Direct2D code to follow Cairo's model to support modern WebKit
1471         https://bugs.webkit.org/show_bug.cgi?id=200270
1472
1473         Reviewed by Dean Jackson.
1474
1475         Refactor the Direct2D code in WebCore so that the core routines can be shared
1476         between GraphicsContext and GraphicsContextImpl. Implement PlatformContext,
1477         BackingStoreBackend, and GraphicsContextImpl for the Direct2D engine.
1478        
1479         This patch effectively just moves code around.
1480
1481         * PlatformFTW.cmake:
1482         * platform/graphics/GraphicsContext.h:
1483         * platform/graphics/GraphicsContextImpl.h:
1484         * platform/graphics/ImageSource.cpp:
1485         * platform/graphics/Pattern.h:
1486         * platform/graphics/displaylists/DisplayListRecorder.cpp:
1487         * platform/graphics/displaylists/DisplayListRecorder.h:
1488         * platform/graphics/win/BackingStoreBackendDirect2D.h: Added.
1489         * platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp: Added.
1490         * platform/graphics/win/BackingStoreBackendDirect2DImpl.h: Added.
1491         * platform/graphics/win/Direct2DOperations.cpp: Added.
1492         * platform/graphics/win/Direct2DOperations.h: Added.
1493         * platform/graphics/win/Direct2DUtilities.cpp: Added.
1494         * platform/graphics/win/Direct2DUtilities.h: Added.
1495         * platform/graphics/win/FontCascadeDirect2D.cpp:
1496         * platform/graphics/win/GradientDirect2D.cpp:
1497         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1498         * platform/graphics/win/GraphicsContextImplDirect2D.cpp: Added.
1499         * platform/graphics/win/GraphicsContextImplDirect2D.h: Added.
1500         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
1501         * platform/graphics/win/ImageBufferDataDirect2D.h:
1502         * platform/graphics/win/ImageBufferDirect2D.cpp:
1503         * platform/graphics/win/NativeImageDirect2D.cpp:
1504         * platform/graphics/win/PathDirect2D.cpp:
1505         * platform/graphics/win/PatternDirect2D.cpp:
1506         * platform/graphics/win/PlatformContextDirect2D.cpp: Added.
1507         * platform/graphics/win/PlatformContextDirect2D.h: Added.
1508         * platform/win/DragImageWin.cpp:
1509         * svg/graphics/SVGImage.cpp:
1510
1511 2019-07-30  Myles C. Maxfield  <mmaxfield@apple.com>
1512
1513         REGRESSION(r241288): Text on Yahoo Japan mobile looks too bold
1514         https://bugs.webkit.org/show_bug.cgi?id=200065
1515         <rdar://problem/50912757>
1516
1517         Reviewed by Simon Fraser.
1518
1519         Before r241288, we were mapping Japanese sans-serif to Hiragino Kaku Gothic ProN, which
1520         has a 300 weight and a 600 weight. However, we can't use that font because it's user-installed,
1521         so in r241288 we switched to using Hiragino Sans, which has a 300 weight, a 600 weight, and an
1522         800 weight. According to the CSS font selection algorithm, sites that request a weight of 700
1523         would get the 800 weight instead of the 600 weight, which caused the text to look too heavy.
1524         Therefore, the apparent visual change is from a weight change from 600 to 800.
1525
1526         In general, this is working as intended. However, text on Yahoo Japan looks too heavy in weight
1527         800. Instead, this patch adds a quirk specific to Yahoo Japan that overwrites any font requests
1528         to give them a weight of 600 instead of 700. This way, the lighter font will be used.
1529
1530         No new tests because quirks cannot be tested.
1531
1532         * css/CSSFontSelector.cpp:
1533         (WebCore::resolveGenericFamily):
1534         (WebCore::CSSFontSelector::fontRangesForFamily):
1535         * page/Quirks.cpp:
1536         (WebCore::Quirks::shouldLightenJapaneseBoldSansSerif const):
1537         * page/Quirks.h:
1538
1539 2019-07-31  Simon Fraser  <simon.fraser@apple.com>
1540
1541         [iPadOS] Enable simulated mouse events on iqiyi.com to fix the video controls
1542         https://bugs.webkit.org/show_bug.cgi?id=200322
1543         rdar://problem/53235709
1544
1545         Reviewed by Wenson Hsieh.
1546         
1547         iqiyi.com needs to get mouseMove events for dragging the video scrubber to work.
1548
1549         * page/Quirks.cpp:
1550         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1551
1552 2019-07-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1553
1554         Unreviewed, fix GTK build after SoupNetworkSession ownership rework.
1555
1556         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1557
1558 2019-07-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1559
1560         [GTK] Compilation errors when GL is disabled
1561         https://bugs.webkit.org/show_bug.cgi?id=200223
1562
1563         Unreviewed, keep trying to fix build with -DENABLE_OPENGL=OFF.
1564
1565         The previous commit was sufficient for the 2.24 branch, but on trunk there are more
1566         problems. This doesn't solve all of them, but it gets us closer.
1567
1568         * SourcesGTK.txt:
1569         * platform/graphics/GLContext.h:
1570
1571 2019-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1572
1573         [SOUP] Move SoupNetworkSession ownership from NetworkStorageSession to NetworkSession
1574         https://bugs.webkit.org/show_bug.cgi?id=200076
1575
1576         Reviewed by Michael Catanzaro.
1577
1578         Remove the SoupNetworkSession from NetworkStorageSession.
1579
1580         * platform/network/NetworkStorageSession.h:
1581         (WebCore::NetworkStorageSession::cookieStorage const): Return the cookie jar.
1582         * platform/network/StorageSessionProvider.h:
1583         (WebCore::StorageSessionProvider::soupSession const): Temporary add this virtual method that is required by
1584         SocketStreamHandleImplSoup. It will be removed once we switch to libsoup WebSockets API soon.
1585         * platform/network/soup/DNSResolveQueueSoup.cpp:
1586         (WebCore::globalDefaultSoupSessionAccessor): Rework the accessor to return the SoupSession directly since
1587         that's what we really want.
1588         (WebCore::DNSResolveQueueSoup::setGlobalDefaultSoupSessionAccessor):
1589         (WebCore::DNSResolveQueueSoup::updateIsUsingProxy):
1590         (WebCore::DNSResolveQueueSoup::platformResolve):
1591         (WebCore::DNSResolveQueueSoup::resolve):
1592         * platform/network/soup/DNSResolveQueueSoup.h:
1593         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1594         (WebCore::NetworkStorageSession::NetworkStorageSession): Create and setup the default cookie jar.
1595         (WebCore::NetworkStorageSession::~NetworkStorageSession): Only disconnect the cookie jar signals.
1596         (WebCore::NetworkStorageSession::setCookieStorage): Update the cookie jar, now we know it's always a new one.
1597         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1598         (WebCore::SocketStreamHandleImpl::create): Use the new virtual method from StorageSessionProvider to get the SoupSession.
1599         * platform/network/soup/SoupNetworkSession.cpp:
1600         (WebCore::SoupNetworkSession::SoupNetworkSession): Remove the SoupCookieJar parameter.
1601         * platform/network/soup/SoupNetworkSession.h:
1602
1603 2019-07-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1604
1605         [GTK] Compilation errors when GL is disabled
1606         https://bugs.webkit.org/show_bug.cgi?id=200223
1607
1608         Unreviewed, fix build with -DENABLE_OPENGL=OFF.
1609
1610         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1611         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1612
1613 2019-07-29  Eric Carlson  <eric.carlson@apple.com>
1614
1615         MediaSource.isTypeSupported claims FLAC-in-MP4 support on iOS and macOS, but plays silence
1616         https://bugs.webkit.org/show_bug.cgi?id=198583
1617         <rdar://problem/51487853>
1618
1619         Reviewed by Maciej Stachowiak.
1620
1621         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h:
1622         (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType): Use anParseExtendedMIMEType:
1623         when it is available.
1624
1625 2019-07-29  Zalan Bujtas  <zalan@apple.com>
1626
1627         [LFC][TFC] <table> initiates a principal block container box called table wrapper box.
1628         https://bugs.webkit.org/show_bug.cgi?id=200198
1629         <rdar://problem/53623803>
1630
1631         Reviewed by Antti Koivisto.
1632
1633         The table wrapper box contains the table box itself and any caption boxes.
1634
1635         * layout/layouttree/LayoutBox.cpp:
1636         (WebCore::Layout::Box::isBlockContainerBox const):
1637         * layout/layouttree/LayoutBox.h:
1638         (WebCore::Layout::Box::isTableCaption const):
1639         (WebCore::Layout::Box::isTableRow const):
1640         (WebCore::Layout::Box::isTableCell const):
1641         * layout/layouttree/LayoutContainer.h:
1642         * layout/layouttree/LayoutTreeBuilder.cpp:
1643         (WebCore::Layout::appendChild):
1644         (WebCore::Layout::TreeBuilder::createLayoutBox):
1645         (WebCore::Layout::TreeBuilder::createTableStructure):
1646         (WebCore::Layout::TreeBuilder::createSubTree):
1647         (WebCore::Layout::outputLayoutBox):
1648         * layout/layouttree/LayoutTreeBuilder.h:
1649
1650 2019-07-29  Justin Fan  <justin_fan@apple.com>
1651
1652         [WebGPU] Replace Vectors with HashSets for tracking resources used by GPUCommandBuffer
1653         https://bugs.webkit.org/show_bug.cgi?id=200200
1654
1655         Reviewed by Myles C. Maxfield.
1656
1657         Resources bound to a command buffer or bind group only need be tracked once rather than once per sub-view. 
1658         This patch cuts GPUQueue.submit validation from 2-12 ms down to ~0 when drawing 12000 triangles in Animometer.
1659
1660         Covered by existing tests; no behavior change expected.
1661
1662         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: Removed unused variable.
1663         * platform/graphics/gpu/GPUBindGroup.h:
1664         (WebCore::GPUBindGroup::boundBuffers const):
1665         (WebCore::GPUBindGroup::boundTextures const):
1666         * platform/graphics/gpu/GPUCommandBuffer.h:
1667         (WebCore::GPUCommandBuffer::usedBuffers const):
1668         (WebCore::GPUCommandBuffer::usedTextures const):
1669         (WebCore::GPUCommandBuffer::useBuffer):
1670         (WebCore::GPUCommandBuffer::useTexture):
1671         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
1672         (WebCore::GPUBindGroup::tryCreate):
1673         (WebCore::GPUBindGroup::GPUBindGroup):
1674
1675 2019-07-29  Zalan Bujtas  <zalan@apple.com>
1676
1677         [LFC][TFC] Introduce Box::establishesTableFormattingContext
1678         https://bugs.webkit.org/show_bug.cgi?id=200060
1679
1680         Reviewed by Antti Koivisto.
1681
1682         https://www.w3.org/TR/CSS22/tables.html
1683
1684         The table generates a principal block container box called the table wrapper box that contains the table box itself and any caption boxes.
1685         The table box is a block-level box that contains the table's internal table boxes.
1686         The table wrapper box is block-level for 'display: table', and inline-level; for 'display: inline-table'. The table wrapper box establishes a block
1687         formatting context, and the table box establishes a table formatting context."
1688
1689         * layout/layouttree/LayoutBox.cpp:
1690         (WebCore::Layout::Box::establishesFormattingContext const):
1691         (WebCore::Layout::Box::establishesTableFormattingContext const):
1692         (WebCore::Layout::Box::isBlockLevelBox const):
1693         (WebCore::Layout::Box::isInlineLevelBox const):
1694         (WebCore::Layout::Box::isBlockContainerBox const):
1695         * layout/layouttree/LayoutBox.h:
1696         (WebCore::Layout::Box::isTableWrapperBox const):
1697         (WebCore::Layout::Box::isTableBox const):
1698
1699 2019-07-29  Zalan Bujtas  <zalan@apple.com>
1700
1701         [ContentChangeObserver] didFinishContentChangeObserving should include the type of content change.
1702         https://bugs.webkit.org/show_bug.cgi?id=200247
1703         <rdar://problem/53681149>
1704
1705         Reviewed by Simon Fraser.
1706
1707         Now we don't have to query the content change observer for the type of the change in the callback.
1708
1709         * loader/EmptyClients.h:
1710         * page/ChromeClient.h:
1711         * page/ios/ContentChangeObserver.cpp:
1712         (WebCore::ContentChangeObserver::adjustObservedState):
1713         * page/ios/EventHandlerIOS.mm:
1714         (WebCore::EventHandler::mouseMoved):
1715
1716 2019-07-29  Sergei Glazunov  <glazunov@google.com>
1717
1718         The maximum subframe count check should not be skipped for empty URLs.
1719         https://bugs.webkit.org/show_bug.cgi?id=200032
1720
1721         Reviewed by Ryosuke Niwa.
1722
1723         Move the check closer to the actual frame creation code in `loadSubframe`.
1724
1725         Test: fast/dom/connected-subframe-counter-overflow.html
1726
1727         * dom/Document.cpp:
1728         (WebCore::Document::prepareForDestruction): Assert that all child frames have been detached.
1729         * html/HTMLFrameElementBase.cpp:
1730         (WebCore::HTMLFrameElementBase::canLoad const):
1731         (WebCore::HTMLFrameElementBase::canLoadURL const):
1732         * html/HTMLFrameOwnerElement.cpp:
1733         (WebCore::HTMLFrameOwnerElement::canAddSubframe const): Deleted.
1734         * html/HTMLFrameOwnerElement.h:
1735         * html/HTMLPlugInImageElement.cpp:
1736         (WebCore::HTMLPlugInImageElement::canLoadURL const):
1737         * loader/SubframeLoader.cpp:
1738         (WebCore::SubframeLoader::loadSubframe):
1739
1740 2019-07-29  Zalan Bujtas  <zalan@apple.com>
1741
1742         [ContentChangeObserver] ChromeClient::observedContentChange() name is misleading
1743         https://bugs.webkit.org/show_bug.cgi?id=200238
1744         <rdar://problem/53677038>
1745
1746         Reviewed by Simon Fraser.
1747
1748         This function indicates that we've finished observing content changes.
1749
1750         * loader/EmptyClients.h:
1751         * page/ChromeClient.h:
1752         * page/ios/ContentChangeObserver.cpp:
1753         (WebCore::ContentChangeObserver::adjustObservedState):
1754         * page/ios/EventHandlerIOS.mm:
1755         (WebCore::EventHandler::mouseMoved):
1756
1757 2019-07-29  Sam Weinig  <weinig@apple.com>
1758
1759         StringBuilder::append(makeString(...)) is inefficient
1760         https://bugs.webkit.org/show_bug.cgi?id=200034
1761
1762         Reviewed by Saam Barati.
1763
1764         Replace uses of StringBuilder::append(makeString(...)) with StringBuilder::flexiblAppend(...).
1765         Where possible, also merged consecutive calls to StringBuilder::append(...) into a single call
1766         to StringBuilder::flexiblAppend(...) to avoid unnecessary additional overflow checks and resizes.
1767         Also where possible, replaced StringBuilder with makeString() if no branching was used during
1768         construction.
1769         
1770         A lot more can be done to improve the efficiency of StringBuilder use in the WHLSL code including:
1771         - Using StringView more prevelently, especially when passing a substring to the StringBuilder.
1772         - Passing existing StringBuilders to functions for them to use rather than returning a String and 
1773           then appending that to another StringBuilder.
1774         - Using custom StringTypeAdapters for generated names, rather than storing them as Strings. 
1775
1776         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
1777         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
1778         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature):
1779         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature):
1780         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath):
1781         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath):
1782         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
1783         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes):
1784         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::signature):
1785         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack):
1786         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack):
1787         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
1788         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::signature):
1789         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack):
1790         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack):
1791         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature):
1792         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1793         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit):
1794         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
1795         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1796         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
1797         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
1798         (WebCore::WHLSL::Metal::generateMetalCodeShared):
1799         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1800         (WebCore::WHLSL::Metal::writeNativeFunction):
1801         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
1802         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::visit):
1803         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
1804         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
1805         (WebCore::WHLSL::Metal::TypeNamer::metalTypes):
1806         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1807         (WebCore::WHLSL::Types::appendNameTo):
1808         * rendering/RenderLayerCompositor.cpp:
1809         (WebCore::RenderLayerCompositor::logLayerInfo):
1810         * testing/Internals.cpp:
1811         (WebCore::Internals::ongoingLoadsDescriptions const):
1812
1813 2019-07-29  Megan Gardner  <megan_gardner@apple.com>
1814
1815         Force Reveal to always lookup from menu
1816         https://bugs.webkit.org/show_bug.cgi?id=200186
1817         <rdar://problem/52967940>
1818
1819         Reviewed by Tim Horton.
1820
1821         We currently only have the 'lookup' menu item, so we should always force the 'lookup' action from it.
1822
1823         Reveal is not currently testable.
1824
1825         * editing/cocoa/DictionaryLookup.mm:
1826         (WebCore::showPopupOrCreateAnimationController):
1827
1828 2019-07-29  Simon Fraser  <simon.fraser@apple.com>
1829
1830         REGRESSION (r246899): Subtitles show twice when controls show/hide on hulu.com
1831         https://bugs.webkit.org/show_bug.cgi?id=200187
1832         rdar://problem/53511121
1833
1834         Reviewed by Zalan Bujtas.
1835
1836         When a layer that painted into shared backing moved, we'd fail to repaint its old position
1837         because the RenderLayer's repaint rects are cleared via BackingSharingState::updateBeforeDescendantTraversal().
1838
1839         Recomputing repaint rects is expensive, so we only want to do it when necessary, which is for
1840         layers that start and stop sharing (going into and out of compositing already recomputes them).
1841         So add logic to RenderLayerBacking::setBackingSharingLayers() that recomputes repaint rects
1842         on layers that will no longer use shared backing, and those that are newly using shared
1843         backing.
1844
1845         Test: compositing/shared-backing/backing-sharing-repaint.html
1846
1847         * rendering/RenderLayer.cpp:
1848         (WebCore::RenderLayer::setBackingProviderLayer):
1849         * rendering/RenderLayerBacking.cpp:
1850         (WebCore::RenderLayerBacking::setBackingSharingLayers):
1851         * rendering/RenderLayerCompositor.cpp:
1852         (WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer):
1853         (WebCore::RenderLayerCompositor::updateBacking):
1854
1855 2019-07-29  Simon Fraser  <simon.fraser@apple.com>
1856
1857         The touch-action property was ignored on replaced elements (canvas, img etc)
1858         https://bugs.webkit.org/show_bug.cgi?id=200205
1859         rdar://problem/53331224
1860
1861         Reviewed by Antti Koivisto.
1862
1863         The event region painting code didn't handle replaced elements correctly,
1864         causing touch-action to get ignored for <canvas>, <img> etc. Fix by handling
1865         region painting in RenderReplaced.
1866
1867         This still doesn't fix <iframe> but I'm not sure what the correct behavior is there
1868         (webkit.org/b/200204).
1869
1870         Test: pointerevents/ios/touch-action-region-replaced-elements.html
1871
1872         * rendering/RenderReplaced.cpp:
1873         (WebCore::RenderReplaced::paint):
1874         (WebCore::RenderReplaced::shouldPaint):
1875
1876 2019-07-29  Philippe Normand  <pnormand@igalia.com>
1877
1878         REGRESSION(r243058): [GStreamer] WebKitWebSrc's internal queue can exhaust the WebProcess memory
1879         https://bugs.webkit.org/show_bug.cgi?id=199998
1880
1881         Reviewed by Xabier Rodriguez-Calvar.
1882
1883         With the webkitwebsrc rewrite the element lost its ability to tell
1884         the resource loader when to pause and resume downloading because
1885         we don't use appsrc and its enough-data/need-data signals anymore.
1886         So new heuristics are introduced with this patch. Downloading of
1887         resources bigger than 2MiB might pause when the internal adapter
1888         has enough data (2% of the full resource) and resume when the
1889         adapter size goes below 20% of those 2%.
1890
1891         No new tests, the media element spec doesn't clearly mandate how
1892         the resource loading should behave when the element is paused or
1893         how aggressively the resource should be downloaded during
1894         playback.
1895
1896         This patch was functionally tested with a 1.3GiB resource loaded
1897         over the local network, the resource was downloaded in ~30MiB
1898         chunks, stopping and resuming every 20 seconds, approximately.
1899
1900         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1901         (webkit_web_src_class_init):
1902         (webKitWebSrcCreate):
1903         (CachedResourceStreamingClient::responseReceived):
1904         (CachedResourceStreamingClient::dataReceived):
1905
1906 2019-07-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1907
1908         WebSockets: workers never use the platform WebSockets path
1909         https://bugs.webkit.org/show_bug.cgi?id=200161
1910
1911         Reviewed by Michael Catanzaro.
1912
1913         A WebCore::WebSocketChannel is created unconditionally in WorkerThreadableWebSocketChannel::Peer.
1914
1915         * Modules/websockets/ThreadableWebSocketChannel.cpp:
1916         (WebCore::ThreadableWebSocketChannel::create): New create method that receives a Document& and creates the
1917         WebSocket channel checking the runtime enabled features to decide.
1918         * Modules/websockets/ThreadableWebSocketChannel.h:
1919         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
1920         (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer): Use ThreadableWebSocketChannel::create().
1921
1922 2019-07-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1923
1924         Multiple context menu actions broken for YouTube videos
1925         https://bugs.webkit.org/show_bug.cgi?id=199999
1926
1927         Reviewed by Eric Carlson.
1928
1929         Do not include CopyMediaLinkItem and OpenMediaInNewWindowItem to the context menu when media URL is not
1930         downloadable or the request can't be handled.
1931
1932         * page/ContextMenuController.cpp:
1933         (WebCore::ContextMenuController::populate):
1934
1935 2019-07-28  Commit Queue  <commit-queue@webkit.org>
1936
1937         Unreviewed, rolling out r247886.
1938         https://bugs.webkit.org/show_bug.cgi?id=200214
1939
1940         "Causes PLT5 regression on some machines" (Requested by mlam|a
1941         on #webkit).
1942
1943         Reverted changeset:
1944
1945         "Add crash diagnostics for debugging unexpected zapped cells."
1946         https://bugs.webkit.org/show_bug.cgi?id=200149
1947         https://trac.webkit.org/changeset/247886
1948
1949 2019-07-28  Tim Horton  <timothy_horton@apple.com>
1950
1951         Fix the release build
1952
1953         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
1954         (WebCore::WHLSL::Metal::TypeNamer::insert):
1955
1956 2019-07-28  Simon Fraser  <simon.fraser@apple.com>
1957
1958         [iOS] Touch regions overlay needs to show touch-action:none
1959         https://bugs.webkit.org/show_bug.cgi?id=200203
1960
1961         Reviewed by Wenson Hsieh.
1962
1963         When I added touch-action overlay painting, I didn't realize that touch-action:none
1964         was an important value to display. But it is, so fix that.
1965
1966         * rendering/RenderLayerBacking.cpp:
1967         (WebCore::patternForTouchAction):
1968
1969 2019-07-27  Saam Barati  <sbarati@apple.com>
1970
1971         [WHLSL] Remove UnnamedType copy/move constructors and mark classes as final
1972         https://bugs.webkit.org/show_bug.cgi?id=200188
1973
1974         Reviewed by Myles C. Maxfield.
1975
1976         Since they are ref counted, you should make taking a ref to them
1977         instead of moving or copying them. This patch encodes that by deleting
1978         the relevant copy/move constructors and assignment operators.
1979
1980         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
1981         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
1982         (WebCore::WHLSL::AST::ArrayType::ArrayType): Deleted.
1983         (WebCore::WHLSL::AST::ArrayType::create): Deleted.
1984         (WebCore::WHLSL::AST::ArrayType::type const): Deleted.
1985         (WebCore::WHLSL::AST::ArrayType::type): Deleted.
1986         (WebCore::WHLSL::AST::ArrayType::numElements const): Deleted.
1987         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
1988         (WebCore::WHLSL::AST::PointerType::PointerType): Deleted.
1989         (WebCore::WHLSL::AST::PointerType::create): Deleted.
1990         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
1991         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
1992         (WebCore::WHLSL::AST::TypeReference::TypeReference): Deleted.
1993         (WebCore::WHLSL::AST::TypeReference::create): Deleted.
1994         (WebCore::WHLSL::AST::TypeReference::name): Deleted.
1995         (WebCore::WHLSL::AST::TypeReference::typeArguments): Deleted.
1996         (WebCore::WHLSL::AST::TypeReference::maybeResolvedType const): Deleted.
1997         (WebCore::WHLSL::AST::TypeReference::resolvedType const): Deleted.
1998         (WebCore::WHLSL::AST::TypeReference::setResolvedType): Deleted.
1999         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
2000
2001 2019-07-27  Justin Fan  <justin_fan@apple.com>
2002
2003         [WebGPU] Update GPUComputePipeline errors to match GPURenderPipeline implementation
2004         https://bugs.webkit.org/show_bug.cgi?id=200097
2005
2006         Reviewed by Myles C. Maxfield.
2007
2008         Remove passing around a functionName in GPUComputePipeline creation in favor of setting it on the GPUErrorScopes.
2009         Also, WebGPU objects no longer create new Ref<>s unless object creation succeeds.
2010
2011         No new tests. Covered by existing tests.
2012
2013         * Modules/webgpu/WebGPUDevice.cpp:
2014         (WebCore::WebGPUDevice::createBuffer const):
2015         (WebCore::WebGPUDevice::createBufferMapped const):
2016         (WebCore::WebGPUDevice::createComputePipeline const):
2017         * platform/graphics/gpu/GPUBuffer.h:
2018         * platform/graphics/gpu/GPUComputePipeline.h:
2019         * platform/graphics/gpu/GPUDevice.cpp:
2020         (WebCore::GPUDevice::tryCreateBuffer):
2021         (WebCore::GPUDevice::tryCreateComputePipeline const):
2022         * platform/graphics/gpu/GPUDevice.h:
2023         * platform/graphics/gpu/GPUErrorScopes.cpp:
2024         (WebCore::GPUErrorScopes::generatePrefixedError): Only validaton errors have messages right now.
2025         * platform/graphics/gpu/GPUErrorScopes.h:
2026         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2027         (WebCore::GPUBuffer::validateBufferUsage):
2028         (WebCore::GPUBuffer::tryCreate):
2029         (WebCore::GPUBuffer::GPUBuffer):
2030         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
2031         (WebCore::trySetMetalFunctions):
2032         (WebCore::trySetFunctions):
2033         (WebCore::convertComputePipelineDescriptor):
2034         (WebCore::tryCreateMTLComputePipelineState):
2035         (WebCore::GPUComputePipeline::tryCreate):
2036         (WebCore::GPUComputePipeline::GPUComputePipeline):
2037         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2038         (WebCore::trySetMetalFunctions):
2039         (WebCore::trySetFunctions):
2040
2041         These classes were made RefCounted in a previous patch; remove their move ctors to fix build.
2042         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
2043         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
2044         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
2045         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
2046         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
2047         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
2048
2049 2019-07-27  Andres Gonzalez  <andresg_22@apple.com>
2050
2051         Expose the aria-label attribute for <video> elements.
2052         https://bugs.webkit.org/show_bug.cgi?id=200169
2053         <rdar://problem/51754558>
2054
2055         Reviewed by Chris Fleizach.
2056
2057         Tests: accessibility/ios-simulator/media-with-aria-label.html
2058                accessibility/media-with-aria-label.html
2059
2060         We now expose the <video> element to accessibility clients as long as auto-play is not enabled.
2061         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2062         (-[WebAccessibilityObjectWrapper accessibilityIsWebInteractiveVideo]):
2063
2064 2019-07-26  Saam Barati  <sbarati@apple.com>
2065
2066         Unreviewed. Remove invalid assertion after r247878.
2067         We were essentially asserting all UnnamedType* were
2068         unique. But my patch made this no longer the case by
2069         design to make things faster.
2070
2071         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
2072         (WebCore::WHLSL::Metal::TypeNamer::insert):
2073
2074 2019-07-26  Mark Lam  <mark.lam@apple.com>
2075
2076         Add crash diagnostics for debugging unexpected zapped cells.
2077         https://bugs.webkit.org/show_bug.cgi?id=200149
2078         <rdar://problem/53570112>
2079
2080         Reviewed by Yusuke Suzuki, Saam Barati, and Michael Saboff.
2081
2082         No new tests because this is a feature for debugging crashes.  It has been tested
2083         manually by modifying the code to force a crash at the point of interest.
2084
2085         Added some comments to document the hashes of known subspaces.
2086
2087         * bindings/js/WebCoreJSClientData.cpp:
2088         (WebCore::JSVMClientData::JSVMClientData):
2089
2090 2019-07-26  Ryosuke Niwa  <rniwa@webkit.org>
2091
2092         Moving right by word boundary right before an object element followed by a br element hangs
2093         https://bugs.webkit.org/show_bug.cgi?id=200144
2094
2095         Reviewed by Simon Fraser.
2096
2097         The bug was caused by an infinite loop inside wordBreakIteratorForMinOffsetBoundary when it's trying to
2098         find the previous word boundary at the beginning of a word after the object element and the br element.
2099         In this case, previousBox is at the br element after the object element in the preceding line, and
2100         logicallyPreviousBox ends up returning the same inline box (that of the br element), causing a hang.
2101
2102         Here's how. In logicallyPreviousBox, previousRootInlineBoxCandidatePosition returns a legacy position
2103         immediately after the object element. The root inline box for this position (previousRoot) is the one
2104         that contains the object element and the br element. However, when previousTextOrLineBreakBox is called
2105         on this root inline box, "box" argument of the function is set to nullptr, and as a result, the function
2106         finds and returns the same inline box of the br element that was passed to logicallyPreviousBox.
2107
2108         Fixed the bug by passing the starting inline box to previousRootInlineBoxCandidatePosition when its
2109         root inline box is the previous root inline box (previousRoot). Also applied the same fix to
2110         logicallyNextBox even though we don't have a reproduction for that case for now (RTL test case is
2111         unaffected by nextRootInlineBoxCandidatePosition).
2112
2113         Tests: editing/selection/move-by-word-visually-across-object-element-1.html
2114                editing/selection/move-by-word-visually-across-object-element-2.html
2115                editing/selection/move-by-word-visually-across-object-element-3.html
2116
2117         * editing/VisibleUnits.cpp:
2118         (WebCore::logicallyPreviousBox): Fixed the bug.
2119         (WebCore::logicallyNextBox): Ditto.
2120
2121 2019-07-26  Brady Eidson  <beidson@apple.com>
2122
2123         Do not fire readystatechange events at documents about to get replaced by javascript URLs.
2124         <rdar://problem/51665406> and https://bugs.webkit.org/show_bug.cgi?id=198786
2125
2126         Reviewed by Ryosuke Niwa.
2127
2128         Test: http/tests/dom/ready-state-on-javascript-replace.html
2129
2130         We were firing too many readystatechange events, more than other browsers.
2131         Our behavior on this test with this patch now matches Chrome.
2132
2133         (There was even an ancient FIXME alluding to this referencing a spec issue, and that issues has long been resolvedv)
2134
2135         * loader/FrameLoader.cpp:
2136         (WebCore::FrameLoader::stopLoading):
2137
2138 2019-07-26  Zalan Bujtas  <zalan@apple.com>
2139
2140         [iPadOS] wix.com cannot select a template to edit or view
2141         https://bugs.webkit.org/show_bug.cgi?id=200174
2142         <rdar://problem/53281296>
2143
2144         Reviewed by Simon Fraser.
2145
2146         Opt out of simulated mouse event sending for template selection on wix.com.
2147         When wix.com receives a simulated mouse event during the touch events, it calls preventDefault() which prevents us from running the hover heuristics -> no click.
2148
2149         * page/Quirks.cpp:
2150         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2151
2152 2019-07-26  Saam Barati  <sbarati@apple.com>
2153
2154         [WHLSL] UnnamedType should be reference counted
2155         https://bugs.webkit.org/show_bug.cgi?id=200098
2156
2157         Reviewed by Dean Jackson.
2158
2159         This patch makes UnnamedType reference counted. The motivation for doing this
2160         is I measured how many times we were cloning UnnamedTypes, and I found we were
2161         doing it ~433,000 times in some of Justin's demos. This is hugely wasteful,
2162         given that an UnnamedType is immutable in the sense that once the type is
2163         resolved, it will never change. So instead of repeatedly cloning the same
2164         type, and having Expression point to a UniqueRef of UnnamedType, we should
2165         instead make UnnamedType reference counted, and have expressions point to a
2166         potentially shared UnnamedType.
2167         
2168         Doing this is hugely beneficial to WHLSL compile times. On Justin's demos,
2169         these are the results I'm getting:
2170         
2171         hello-triangle: neutral
2172         hello-cube: 55% faster
2173         compute-blur: 35% faster
2174         textured-cube: 49% faster
2175
2176         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
2177         (WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
2178         (WebCore::WHLSL::AST::ArrayReferenceType::create):
2179         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
2180         (WebCore::WHLSL::AST::ArrayType::ArrayType):
2181         (WebCore::WHLSL::AST::ArrayType::create):
2182         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
2183         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
2184         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2185         (WebCore::WHLSL::AST::Expression::setType):
2186         (WebCore::WHLSL::AST::Expression::copyTypeTo const):
2187         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
2188         (WebCore::WHLSL::AST::FloatLiteral::clone const):
2189         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
2190         (WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
2191         (WebCore::WHLSL::AST::FloatLiteralType::clone const):
2192         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
2193         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
2194         (WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
2195         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
2196         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
2197         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
2198         (WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
2199         (WebCore::WHLSL::AST::IntegerLiteralType::clone const):
2200         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
2201         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
2202         (WebCore::WHLSL::AST::NullLiteral::clone const):
2203         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
2204         (WebCore::WHLSL::AST::PointerType::PointerType):
2205         (WebCore::WHLSL::AST::PointerType::create):
2206         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
2207         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
2208         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
2209         (WebCore::WHLSL::AST::ReferenceType::ReferenceType):
2210         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
2211         (WebCore::WHLSL::AST::ResolvableType::resolve):
2212         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
2213         (WebCore::WHLSL::AST::StructureElement::StructureElement):
2214         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp:
2215         (WebCore::WHLSL::AST::clone):
2216         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h:
2217         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
2218         (WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
2219         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp:
2220         (WebCore::WHLSL::AST::TypeReference::wrap):
2221         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
2222         (WebCore::WHLSL::AST::TypeReference::create):
2223         (WebCore::WHLSL::AST::TypeReference::cloneTypeReference const): Deleted.
2224         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
2225         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
2226         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
2227         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
2228         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
2229         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::clone const):
2230         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
2231         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
2232         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
2233         (WebCore::WHLSL::Metal::vectorInnerType):
2234         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
2235         (WebCore::WHLSL::Metal::writeNativeType):
2236         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
2237         (WebCore::WHLSL::AutoInitialize::visit):
2238         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
2239         (WebCore::WHLSL::DuplicateFunctionKey::hash const):
2240         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2241         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
2242         (WebCore::WHLSL::resolveWithOperatorLength):
2243         (WebCore::WHLSL::resolveWithReferenceComparator):
2244         (WebCore::WHLSL::resolveByInstantiation):
2245         (WebCore::WHLSL::checkOperatorOverload):
2246         (WebCore::WHLSL::Checker::assignTypes):
2247         (WebCore::WHLSL::matchAndCommit):
2248         (WebCore::WHLSL::commit):
2249         (WebCore::WHLSL::Checker::assignConcreteType):
2250         (WebCore::WHLSL::Checker::assignType):
2251         (WebCore::WHLSL::Checker::forwardType):
2252         (WebCore::WHLSL::Checker::visit):
2253         (WebCore::WHLSL::getUnnamedType):
2254         (WebCore::WHLSL::argumentTypeForAndOverload):
2255         (WebCore::WHLSL::Checker::finishVisiting):
2256         (WebCore::WHLSL::Checker::isBoolType):
2257         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
2258         (WebCore::WHLSL::matchAndCommit):
2259         (WebCore::WHLSL::commit):
2260         (WebCore::WHLSL::inferTypesForTypeArguments):
2261         (WebCore::WHLSL::inferTypesForCallImpl):
2262         * Modules/webgpu/WHLSL/WHLSLInferTypes.h:
2263         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
2264         (WebCore::WHLSL::Intrinsics::addVector):
2265         (WebCore::WHLSL::Intrinsics::addMatrix):
2266         (WebCore::WHLSL::Intrinsics::addTexture):
2267         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2268         (WebCore::WHLSL::Parser::parseTypeArgument):
2269         (WebCore::WHLSL::Parser::parseType):
2270         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
2271         (WebCore::WHLSL::Parser::parseVariableDeclaration):
2272         (WebCore::WHLSL::Parser::parseVariableDeclarations):
2273         * Modules/webgpu/WHLSL/WHLSLParser.h:
2274         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
2275         (WebCore::WHLSL::PreserveLifetimes::PreserveLifetimes):
2276         (WebCore::WHLSL::PreserveLifetimes::makeStructVariableReference):
2277         (WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
2278         (WebCore::WHLSL::preserveVariableLifetimes):
2279         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2280         (WebCore::WHLSL::wrapAnderCallArgument):
2281         (WebCore::WHLSL::anderCallArgument):
2282         (WebCore::WHLSL::setterCall):
2283         (WebCore::WHLSL::getterCall):
2284         (WebCore::WHLSL::modify):
2285         (WebCore::WHLSL::PropertyResolver::visit):
2286         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
2287         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
2288         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
2289         (WebCore::WHLSL::conversionCost):
2290         * Modules/webgpu/WHLSL/WHLSLResolvingType.h:
2291         (WebCore::WHLSL::ResolvingType::ResolvingType):
2292         (WebCore::WHLSL::ResolvingType::getUnnamedType):
2293         (WebCore::WHLSL::ResolvingType::visit):
2294         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
2295         (WebCore::WHLSL::synthesizeArrayOperatorLength):
2296         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
2297         (WebCore::WHLSL::synthesizeConstructors):
2298         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
2299         (WebCore::WHLSL::synthesizeEnumerationFunctions):
2300         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
2301         (WebCore::WHLSL::synthesizeStructureAccessors):
2302         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2303         (WebCore::WHLSL::Visitor::visit):
2304
2305 2019-07-26  Takashi Komori  <Takashi.Komori@sony.com>
2306
2307         [curl] Heap corruption in ~CurlResponse
2308         https://bugs.webkit.org/show_bug.cgi?id=198320
2309
2310         Reviewed by Fujii Hironori.
2311
2312         Stop sharing object which was reffered by two threads to fix crash bug.
2313
2314         No tests needed, no functionality changes.
2315
2316         * platform/network/curl/CurlRequest.cpp:
2317         (WebCore::CurlRequest::start):
2318         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
2319         * platform/network/curl/CurlRequest.h:
2320
2321 2019-07-26  Youenn Fablet  <youenn@apple.com>
2322
2323         slides.google.com: opening speaker notes while presenting causes a fatal error in the web app on iPad
2324         https://bugs.webkit.org/show_bug.cgi?id=199933
2325         <rdar://problem/53034345>
2326
2327         Reviewed by Darin Adler.
2328
2329         docs.google.com might sometimes try to window.open an about URL that not about:blank or about:srcdoc.
2330         In that case, WebKit is opening a window but is considering that the window is cross origin with its opener.
2331         This breaks docs.google.com as they want to access the website.
2332         Add a site-specific hack so as to treat all about URLs being opened through window.open as about:blank.
2333
2334         Manually tested on docs.google.com website.
2335
2336         * page/DOMWindow.cpp:
2337         (WebCore::DOMWindow::createWindow):
2338         (WebCore::DOMWindow::open):
2339         * page/Quirks.cpp:
2340         (WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):
2341         (WebCore::Quirks::shouldOpenAsAboutBlank const):
2342         * page/Quirks.h:
2343
2344 2019-07-26  Alexander Mikhaylenko  <exalm7659@gmail.com>
2345
2346         REGRESSION(r246496): [GTK] Tapping the web view scrolls up a bit
2347         https://bugs.webkit.org/show_bug.cgi?id=200084
2348
2349         Reviewed by Carlos Garcia Campos.
2350
2351         gdk_event_get_scroll_direction() returns false, but also sets direction to GDK_SCROLL_UP if
2352         the direction was GDK_SCROLL_SMOOTH. Relying on zero deltas in this case is not correct, because
2353         they can also be zero with GDK_SCROLL_SMOOTH. In this case, set the direction manually to avoid
2354         that.
2355
2356         See https://gitlab.gnome.org/GNOME/gtk/issues/2048
2357
2358         * platform/gtk/PlatformWheelEventGtk.cpp:
2359         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2360
2361 2019-07-26  Rob Buis  <rbuis@igalia.com>
2362
2363         Make storing cross-origin top-level prefetches in HTTP cache optional
2364         https://bugs.webkit.org/show_bug.cgi?id=199499
2365
2366         Reviewed by Youenn Fablet.
2367
2368         Add Internals API for adding an event listener to prefetch load.
2369
2370         Test: http/wpt/prefetch/link-prefetch-skip-disk-cache.html
2371
2372         * bindings/js/JSEventListener.h:
2373         * dom/EventTarget.h:
2374         (WebCore::EventTarget::addEventListener):
2375         * dom/Node.h:
2376         * html/HTMLLinkElement.h:
2377         * testing/Internals.cpp:
2378         (WebCore::Internals::addPrefetchLoadEventListener):
2379         * testing/Internals.h:
2380         * testing/Internals.idl:
2381
2382 2019-07-25  Tim Horton  <timothy_horton@apple.com>
2383
2384         Subpixel fringes around TextIndicator snapshots at non-integral scale factors
2385         https://bugs.webkit.org/show_bug.cgi?id=200145
2386
2387         Reviewed by Simon Fraser.
2388
2389         * page/FrameSnapshotting.cpp:
2390         (WebCore::snapshotFrameRectWithClip):
2391         * page/FrameSnapshotting.h:
2392         * page/TextIndicator.cpp:
2393         (WebCore::snapshotOptionsForTextIndicatorOptions):
2394         Round the scale factor up, and snappily enclose the clip rects.
2395
2396         TextIndicator doesn't require the use of the precise scale factor that
2397         the page is painted at, but we want it to be sharp, so we overshoot!
2398
2399 2019-07-25  Brent Fulgham  <bfulgham@apple.com>
2400
2401         Use IWICBitmap (rather than ID2D1Bitmap) for NativeImagePtr on FTW
2402         https://bugs.webkit.org/show_bug.cgi?id=200093
2403
2404         Reviewed by Dean Jackson.
2405
2406         When I wrote the original Direct2D code, I did not realize that the backing memory for the
2407         ID2D1Bitmap was inaccessible since it is effectively a representation of GPU memory. There
2408         is no API to access or modify the pixels.
2409
2410         Instead, MSDN documentation indicates that we should be using IWICBitmap objects, which are
2411         converted to ID2D1Bitmap objects when things are ready to be rendered.
2412
2413         This makes it possible to use the TextureMapper backend to do efficient compositing and tile
2414         drawing, since the data backing the bitmap can now be accessed and manipulated, allowing us
2415         to support filters and other effects.
2416
2417         * PlatformFTW.cmake:
2418         * platform/MIMETypeRegistry.cpp:
2419         (WebCore::supportedImageMIMETypesForEncoding):
2420         * platform/graphics/ANGLEWebKitBridge.h:
2421         * platform/graphics/GraphicsContext.h:
2422         * platform/graphics/ImageBuffer.h:
2423         * platform/graphics/NativeImage.h:
2424         * platform/graphics/OpenGLShims.h:
2425         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2426         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2427         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2428         (WebCore::GraphicsContext3D::GraphicsContext3D):
2429         (WebCore::GraphicsContext3D::platformLayer const):
2430         * platform/graphics/texmap/BitmapTexture.cpp:
2431         (WebCore::BitmapTexture::updateContents):
2432         * platform/graphics/texmap/BitmapTextureGL.cpp:
2433         (WebCore::BitmapTextureGL::updateContents):
2434         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
2435         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2436         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2437         (WebCore::GraphicsContext::GraphicsContext):
2438         (WebCore::GraphicsContext::platformInit):
2439         (WebCore::GraphicsContextPlatformPrivate::setAlpha):
2440         (WebCore::GraphicsContext::drawNativeImage):
2441         (WebCore::GraphicsContext::drawDeviceBitmap):
2442         (WebCore::GraphicsContext::releaseWindowsContext):
2443         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
2444         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
2445         (WebCore::GraphicsContextPlatformPrivate::beginDraw):
2446         (WebCore::GraphicsContextPlatformPrivate::endDraw):
2447         (WebCore::GraphicsContext::drawPattern):
2448         (WebCore::GraphicsContext::clipPath):
2449         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
2450         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2451         (WebCore::ImageBufferData::getData const):
2452         (WebCore::ImageBufferData::putData):
2453         * platform/graphics/win/ImageBufferDataDirect2D.h:
2454         (): Deleted.
2455         * platform/graphics/win/ImageBufferDirect2D.cpp:
2456         (WebCore::ImageBuffer::createCompatibleBuffer):
2457         (WebCore::ImageBuffer::ImageBuffer):
2458         (WebCore::createCroppedImageIfNecessary):
2459         (WebCore::createBitmapImageAfterScalingIfNeeded):
2460         (WebCore::ImageBuffer::copyImage const):
2461         (WebCore::ImageBuffer::sinkIntoNativeImage):
2462         (WebCore::ImageBuffer::copyNativeImage const):
2463         (WebCore::ImageBuffer::draw):
2464         * platform/graphics/win/ImageDecoderDirect2D.cpp:
2465         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex):
2466         * platform/graphics/win/ImageDirect2D.cpp:
2467         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
2468         * platform/graphics/win/NativeImageDirect2D.cpp:
2469         (WebCore::imagingFactory):
2470         (WebCore::nativeImageSize):
2471         (WebCore::nativeImageHasAlpha):
2472         (WebCore::nativeImageSinglePixelSolidColor):
2473         (WebCore::drawNativeImage):
2474         (WebCore::clearNativeImageSubimages):
2475         * platform/graphics/win/PathDirect2D.cpp:
2476         (WebCore::Path::strokeContains const):
2477         * platform/graphics/win/PatternDirect2D.cpp:
2478         (WebCore::Pattern::createPlatformPattern const):
2479         * platform/win/PasteboardWin.cpp:
2480         (WebCore::Pasteboard::read):
2481         * rendering/RenderElement.cpp:
2482         (WebCore::RenderElement::shouldRespectImageOrientation const):
2483         * rendering/RenderLayerBacking.cpp:
2484         (WebCore::RenderLayerBacking::adjustTiledBackingCoverage):
2485         * svg/graphics/SVGImage.cpp:
2486         (WebCore::SVGImage::nativeImage):
2487
2488 2019-07-25  Ryosuke Niwa  <rniwa@webkit.org>
2489
2490         REGRESSION (r243637): Some web fonts fail to load on Google docs
2491         https://bugs.webkit.org/show_bug.cgi?id=200106
2492
2493         Reviewed by Geoffrey Garen.
2494
2495         Prior to r243637, WebKit threw an exception if the font family name didn't parse as a CSS identifier in the setter
2496         of `family` IDL attribute of FontFace interface because WebKit implemented the old spec faithfully unlike Chrome
2497         and Firefox which basically treated it as a string and didn't throw any exception. [1]
2498
2499         To account for this browser behavior difference, Google docs implemented a workaround for Safari which is to wrap
2500         some identifiers in font family names with quotation marks: `docs-Amatic SC` as `'docs-Amatic SC'` and
2501         `docs-Playfair Display` as `docs-'Playfair Display'`. Unfortunately, this in turn causes the latest Safari to
2502         not match these font face family with those that appear in stylesheet since we no longer parse it as a CSS identifier.
2503
2504         This patch adds a site specific quirk for Google docs to undo this workaround by stripping away single quotation marks.
2505
2506         [1] See https://github.com/w3c/csswg-drafts/issues/3776 for the context.
2507
2508         * css/FontFace.cpp:
2509         (WebCore::FontFace::create):
2510         (WebCore::FontFace::setFamily):
2511         * css/FontFace.h:
2512         * css/FontFace.idl:
2513         * page/Quirks.cpp:
2514         (WebCore::Quirks::shouldStripQuotationMarkInFontFaceSetFamily const):
2515         * page/Quirks.h:
2516
2517 2019-07-25  Dean Jackson  <dino@apple.com>
2518
2519         Add helper for ignoring deprecated implementation warnings
2520         https://bugs.webkit.org/show_bug.cgi?id=200135
2521
2522         Reviewed by Wenson Hsieh.
2523
2524         Add ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN/END macro which
2525         is IGNORE_WARNINGS_BEGIN("deprecated-implementations")
2526
2527         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2528         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
2529         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2530         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
2531         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
2532         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
2533         (-[WebAccessibilityObjectWrapper accessibilityActionDescription:]):
2534         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2535         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]): Deleted.
2536         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2537         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
2538         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
2539         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2540         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
2541         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
2542
2543 2019-07-25  Saam Barati  <sbarati@apple.com>
2544
2545         Unreviewed. Speculative build fix for tvOS of missing include.
2546
2547         * Modules/webgpu/WHLSL/WHLSLLexer.h:
2548
2549 2019-07-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2550
2551         Unreviewed, fix -Wunused-parameter warning
2552
2553         * testing/Internals.cpp:
2554         (WebCore::Internals::privatePlayerVolume):
2555
2556 2019-07-25  Saam Barati  <sbarati@apple.com>
2557
2558         [WHLSL] Add descriptive error messages
2559         https://bugs.webkit.org/show_bug.cgi?id=195682
2560         <rdar://problem/50746322>
2561
2562         Reviewed by Myles C. Maxfield.
2563
2564         This patch adds error messages to the WHLSL compiler. I'm taking a first pass
2565         at having decent error messages everywhere we set an error. However, we will
2566         probably refine these messages to be more accurate and descriptive over time.
2567         
2568         Passes that can fail no longer return a boolean. Instead, they return Expected<void, Error>.
2569         From Error, we can generate a descriptive error message. Visitor::setError now
2570         requires an Error as an argument. So anywhere in Visitor that might fail is
2571         now required to provide an error message.
2572         
2573         In a follow-up to this, we should actually make our checkFail tests test that
2574         they get the expected error message: https://bugs.webkit.org/show_bug.cgi?id=200049
2575
2576         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
2577         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
2578         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
2579         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
2580         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
2581         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
2582         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
2583         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
2584         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
2585         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
2586         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
2587         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
2588         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
2589         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
2590         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
2591         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
2592         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
2593         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
2594         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
2595         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2596         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
2597         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
2598         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
2599         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
2600         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
2601         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
2602         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
2603         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
2604         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
2605         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
2606         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
2607         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
2608         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
2609         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
2610         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
2611         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
2612         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
2613         * Modules/webgpu/WHLSL/AST/WHLSLQualifier.h:
2614         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
2615         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
2616         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
2617         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
2618         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
2619         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
2620         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
2621         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
2622         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
2623         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
2624         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
2625         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
2626         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
2627         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h:
2628         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
2629         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
2630         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
2631         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
2632         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
2633         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
2634         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
2635         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
2636         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
2637         (WebCore::WHLSL::AutoInitialize::visit):
2638         (WebCore::WHLSL::autoInitializeVariables):
2639         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h:
2640         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
2641         (WebCore::WHLSL::checkDuplicateFunctions):
2642         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h:
2643         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
2644         (WebCore::WHLSL::TextureReferencesChecker::visit):
2645         (WebCore::WHLSL::checkTextureReferences):
2646         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h:
2647         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2648         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
2649         (WebCore::WHLSL::resolveWithOperatorLength):
2650         (WebCore::WHLSL::resolveWithReferenceComparator):
2651         (WebCore::WHLSL::resolveByInstantiation):
2652         (WebCore::WHLSL::resolveFunction):
2653         (WebCore::WHLSL::checkSemantics):
2654         (WebCore::WHLSL::Checker::assignTypes):
2655         (WebCore::WHLSL::Checker::visit):
2656         (WebCore::WHLSL::Checker::recurseAndGetInfo):
2657         (WebCore::WHLSL::Checker::getInfo):
2658         (WebCore::WHLSL::Checker::finishVisiting):
2659         (WebCore::WHLSL::Checker::recurseAndRequireBoolType):
2660         (WebCore::WHLSL::check):
2661         * Modules/webgpu/WHLSL/WHLSLChecker.h:
2662         * Modules/webgpu/WHLSL/WHLSLCodeLocation.h: Added.
2663         (WebCore::WHLSL::CodeLocation::CodeLocation):
2664         (WebCore::WHLSL::CodeLocation::startOffset const):
2665         (WebCore::WHLSL::CodeLocation::endOffset const):
2666         (WebCore::WHLSL::CodeLocation::operator== const):
2667         (WebCore::WHLSL::CodeLocation::operator!= const):
2668         (WebCore::WHLSL::CodeLocation::operator bool const):
2669         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp:
2670         (WebCore::WHLSL::computeDimensions):
2671         * Modules/webgpu/WHLSL/WHLSLError.h: Added.
2672         (WebCore::WHLSL::Error::Error):
2673         (WebCore::WHLSL::Error::codeLocation const):
2674         (WebCore::WHLSL::Error::message const):
2675         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp:
2676         (WebCore::WHLSL::checkFunctionStages):
2677         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h:
2678         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
2679         (WebCore::WHLSL::Gatherer::reset):
2680         (WebCore::WHLSL::Gatherer::visit):
2681         (WebCore::WHLSL::gatherEntryPointItems):
2682         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
2683         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
2684         (WebCore::WHLSL::Lexer::lineAndColumnNumberFromOffset):
2685         (WebCore::WHLSL::Lexer::errorString):
2686         (WebCore::WHLSL::Lexer::lineNumberFromOffset): Deleted.
2687         * Modules/webgpu/WHLSL/WHLSLLexer.h:
2688         (WebCore::WHLSL::CodeLocation::CodeLocation):
2689         (WebCore::WHLSL::Lexer::errorString):
2690         (WebCore::WHLSL::AST::CodeLocation::CodeLocation): Deleted.
2691         (WebCore::WHLSL::AST::CodeLocation::startOffset const): Deleted.
2692         (WebCore::WHLSL::AST::CodeLocation::endOffset const): Deleted.
2693         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2694         (WebCore::WHLSL::NameResolver::~NameResolver):
2695         (WebCore::WHLSL::NameResolver::visit):
2696         (WebCore::WHLSL::resolveNamesInTypes):
2697         (WebCore::WHLSL::resolveTypeNamesInFunctions):
2698         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
2699         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2700         (WebCore::WHLSL::Parser::parse):
2701         (WebCore::WHLSL::intLiteralToInt):
2702         (WebCore::WHLSL::uintLiteralToUint):
2703         (WebCore::WHLSL::floatLiteralToFloat):
2704         (WebCore::WHLSL::recognizeSimpleUnsignedInteger):
2705         (WebCore::WHLSL::Parser::parseTypeArgument):
2706         (WebCore::WHLSL::Parser::parseType):
2707         (WebCore::WHLSL::Parser::parseForLoop):
2708         (WebCore::WHLSL::Parser::parseWhileLoop):
2709         (WebCore::WHLSL::Parser::parseEffectfulExpression):
2710         (WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
2711         (WebCore::WHLSL::Parser::parseSuffixOperator):
2712         (WebCore::WHLSL::Parser::parseExpression):
2713         (WebCore::WHLSL::Parser::completeTernaryConditional):
2714         (WebCore::WHLSL::Parser::completeAssignment):
2715         (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
2716         (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
2717         (WebCore::WHLSL::Parser::completePossibleShift):
2718         (WebCore::WHLSL::Parser::completePossibleAdd):
2719         (WebCore::WHLSL::Parser::completePossibleMultiply):
2720         (WebCore::WHLSL::Parser::parsePossiblePrefix):
2721         (WebCore::WHLSL::Parser::parseCallExpression):
2722         * Modules/webgpu/WHLSL/WHLSLParser.h:
2723         (WebCore::WHLSL::Parser::Error::Error): Deleted.
2724         (WebCore::WHLSL::Parser::Error::dump const): Deleted.
2725         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2726         (WebCore::WHLSL::prepareShared):
2727         (WebCore::WHLSL::prepare):
2728         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
2729         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2730         (WebCore::WHLSL::setterCall):
2731         (WebCore::WHLSL::getterCall):
2732         (WebCore::WHLSL::modify):
2733         (WebCore::WHLSL::PropertyResolver::visit):
2734         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:
2735         (WebCore::WHLSL::checkRecursion):
2736         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.h:
2737         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
2738         (WebCore::WHLSL::checkRecursiveTypes):
2739         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h:
2740         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
2741         (WebCore::WHLSL::includeStandardLibrary):
2742         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
2743         (WebCore::WHLSL::checkStatementBehavior):
2744         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h:
2745         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
2746         (WebCore::WHLSL::synthesizeArrayOperatorLength):
2747         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h:
2748         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
2749         (WebCore::WHLSL::synthesizeConstructors):
2750         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h:
2751         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
2752         (WebCore::WHLSL::synthesizeEnumerationFunctions):
2753         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h:
2754         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
2755         (WebCore::WHLSL::synthesizeStructureAccessors):
2756         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h:
2757         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
2758         (WebCore::WHLSL::Visitor::hasError const):
2759         (WebCore::WHLSL::Visitor::expectedError):
2760         (WebCore::WHLSL::Visitor::checkErrorAndVisit):
2761         (WebCore::WHLSL::Visitor::setError):
2762         (WebCore::WHLSL::Visitor::error const): Deleted.
2763         (): Deleted.
2764         * WebCore.xcodeproj/project.pbxproj:
2765         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
2766         (WebCore::trySetFunctions):
2767
2768 2019-07-25  Saam Barati  <sbarati@apple.com>
2769
2770         [WHLSL] Add optional logging for phase timings
2771         https://bugs.webkit.org/show_bug.cgi?id=200099
2772
2773         Reviewed by Dean Jackson.
2774
2775         As we're doing WHLSL compiler speedup work, it helps to be able to
2776         log phase times. I think a few of us have written such patches locally.
2777         In this patch, I'm adding a way to easily switch this logging on and
2778         off by flipping a "constexpr bool" and rebuilding.
2779
2780         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2781         (WebCore::WHLSL::logPhaseTimes):
2782         (WebCore::WHLSL::PhaseTimer::PhaseTimer):
2783         (WebCore::WHLSL::PhaseTimer::~PhaseTimer):
2784         (WebCore::WHLSL::prepareShared):
2785         (WebCore::WHLSL::prepare):
2786
2787 2019-07-25  Chris Dumez  <cdumez@apple.com>
2788
2789         Avoid some unnecessary HashMap copies
2790         https://bugs.webkit.org/show_bug.cgi?id=200129
2791
2792         Reviewed by Youenn Fablet.
2793
2794         * workers/service/server/SWServer.cpp:
2795         (WebCore::SWServer::addRegistrationFromStore):
2796
2797 2019-07-25  Joshua Watt  <JPEW.hacker@gmail.com>
2798
2799         [WPE] Draw other button types
2800         https://bugs.webkit.org/show_bug.cgi?id=199377
2801
2802         Reviewed by Michael Catanzaro.
2803
2804         There are other button types that should be drawn with the default style
2805         besides just push buttons.
2806
2807         * platform/wpe/ThemeWPE.cpp:
2808         (WebCore::ThemeWPE::paint):
2809         (WebCore::ThemeWPE::paintButton):
2810         * platform/wpe/ThemeWPE.h:
2811
2812 2019-07-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
2813
2814         REGRESSION (r244995): Assertion failure when addEventListener to an SVGElement which has an. instance in shadow tree
2815         https://bugs.webkit.org/show_bug.cgi?id=200083
2816
2817         Reviewed by Ryosuke Niwa.
2818
2819         When adding an event listener to an SVGElement, the same event listener
2820         has to be add to all the instances of SVGElement in the shadow tree. See
2821         SVGElement::addEventListener().
2822
2823         In r244995, an assertion was added to ensure if the event listener is
2824         attached to an event target, the new event target has be the same as the
2825         attached one. This assertion isn't correct for the event targets which 
2826         were copied from the targetElement sub tree of an SVGUseElement to the
2827         shadow tree.
2828
2829         Test: svg/custom/add-event-listener-shadow-tree-element.html
2830
2831         * bindings/js/JSLazyEventListener.cpp:
2832         (WebCore::isCloneInShadowTreeOfSVGUseElement):
2833         (WebCore::JSLazyEventListener::checkValidityForEventTarget):
2834
2835 2019-07-25  Truitt Savell  <tsavell@apple.com>
2836
2837         Unreviewed, rolling out r247821.
2838
2839         Caused two crashing Layout Tests
2840
2841         Reverted changeset:
2842
2843         "Make storing cross-origin top-level prefetches in HTTP cache
2844         optional"
2845         https://bugs.webkit.org/show_bug.cgi?id=199499
2846         https://trac.webkit.org/changeset/247821
2847
2848 2019-07-25  Chris Dumez  <cdumez@apple.com>
2849
2850         Avoid UI Process hangs when the WebContent process is showing JS prompts / alerts
2851         https://bugs.webkit.org/show_bug.cgi?id=200107
2852         <rdar://problem/53034592>
2853
2854         Reviewed by Geoffrey Garen.
2855
2856         Add testing infrastructure for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply.
2857
2858         Test: fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html
2859
2860         * page/ChromeClient.h:
2861         * testing/Internals.cpp:
2862         (WebCore::Internals::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
2863         * testing/Internals.h:
2864         * testing/Internals.idl:
2865
2866 2019-07-25  Rob Buis  <rbuis@igalia.com>
2867
2868         Make storing cross-origin top-level prefetches in HTTP cache optional
2869         https://bugs.webkit.org/show_bug.cgi?id=199499
2870
2871         Reviewed by Youenn Fablet.
2872
2873         Add Internals API for adding an event listener to prefetch load.
2874
2875         Test: http/wpt/prefetch/link-prefetch-skip-disk-cache.html
2876
2877         * bindings/js/JSEventListener.h:
2878         * dom/EventTarget.h:
2879         (WebCore::EventTarget::addEventListener):
2880         * dom/Node.h:
2881         * html/HTMLLinkElement.h:
2882         * testing/Internals.cpp:
2883         (WebCore::Internals::addPrefetchLoadEventListener):
2884         * testing/Internals.h:
2885         * testing/Internals.idl:
2886
2887 2019-07-24  Yusuke Suzuki  <ysuzuki@apple.com>
2888
2889         [bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating too large VA
2890         https://bugs.webkit.org/show_bug.cgi?id=200103
2891
2892         Reviewed by Mark Lam.
2893
2894         No behavior change in WebCore.
2895
2896         * page/MemoryRelease.cpp:
2897         * page/ResourceUsageThread.h:
2898         (WebCore::TagInfo::TagInfo): Deleted.
2899         * page/cocoa/ResourceUsageThreadCocoa.mm:
2900         (WebCore::vmPageSize): Deleted.
2901         (WebCore::logFootprintComparison): Deleted.
2902         (WebCore::displayNameForVMTag): Deleted.
2903         (WebCore::pagesPerVMTag): Deleted.
2904
2905 2019-07-24  Devin Rousso  <drousso@apple.com>
2906
2907         Web Inspector: support `console.screenshot` with detached Nodes that are graphical
2908         https://bugs.webkit.org/show_bug.cgi?id=199309
2909
2910         Reviewed by Joseph Pecoraro.
2911
2912         Test: inspector/console/console-screenshot.html
2913
2914         * page/PageConsoleClient.cpp:
2915         (WebCore::PageConsoleClient::screenshot):
2916
2917 2019-07-24  Saam Barati  <sbarati@apple.com>
2918
2919         [WHLSL] Use bmalloc instead of system malloc for WHLSL data structures
2920         https://bugs.webkit.org/show_bug.cgi?id=200063
2921
2922         Rubber-stamped by Sam Weinig.
2923
2924         This is a 25-30% WHLSL compile time speedup on Justin's textured-cube demo
2925         and a ~40% compile time speedup on the hello-cube demo.
2926         
2927         The phases that speed up from this are:
2928         checker
2929         includeStandardLibrary
2930         autoInitializeVariables
2931         resolveProperties
2932
2933         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
2934         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
2935         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
2936         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
2937         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
2938         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
2939         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
2940         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
2941         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
2942         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
2943         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
2944         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
2945         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
2946         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
2947         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
2948         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
2949         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
2950         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
2951         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
2952         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
2953         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
2954         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2955         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
2956         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
2957         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
2958         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
2959         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
2960         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
2961         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
2962         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
2963         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
2964         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
2965         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
2966         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
2967         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
2968         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
2969         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
2970         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
2971         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
2972         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
2973         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
2974         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h:
2975         * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h:
2976         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
2977         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
2978         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
2979         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
2980         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
2981         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
2982         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
2983         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
2984         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
2985         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
2986         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
2987         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
2988         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
2989         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
2990         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
2991         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
2992         * Modules/webgpu/WHLSL/AST/WHLSLType.h:
2993         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
2994         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
2995         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
2996         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
2997         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
2998         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
2999         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
3000         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
3001         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
3002         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
3003
3004 2019-07-24  Devin Rousso  <drousso@apple.com>
3005
3006         Web Inspector: support `console.screenshot` with ImageData and ImageBitmap
3007         https://bugs.webkit.org/show_bug.cgi?id=199304
3008
3009         Reviewed by Joseph Pecoraro.
3010
3011         Test: inspector/console/console-screenshot.html
3012
3013         * page/PageConsoleClient.cpp:
3014         (WebCore::PageConsoleClient::screenshot):
3015
3016 2019-07-24  Devin Rousso  <drousso@apple.com>
3017
3018         Web Inspector: REGRESSION: Overlay: highlighting a ::before/::after shows the node info of the parent instead
3019         https://bugs.webkit.org/show_bug.cgi?id=200051
3020
3021         Reviewed by Joseph Pecoraro.
3022
3023         When highlighting a pseudo-element, only use the parent node for selector information. All
3024         rendering data should still come from the pseudo-element itself.
3025
3026         * inspector/InspectorOverlay.cpp:
3027         (WebCore::drawShapeHighlight):
3028         (WebCore::InspectorOverlay::drawElementTitle):
3029
3030 2019-07-24  Devin Rousso  <drousso@apple.com>
3031
3032         Web Inspector: support `console.screenshot` with subclasses of CanvasRenderingContext
3033         https://bugs.webkit.org/show_bug.cgi?id=199305
3034
3035         Reviewed by Joseph Pecoraro.
3036
3037         Test: inspector/console/console-screenshot.html
3038
3039         * page/PageConsoleClient.cpp:
3040         (WebCore::canvasRenderingContext):
3041         (WebCore::PageConsoleClient::record):
3042         (WebCore::PageConsoleClient::recordEnd):
3043         (WebCore::PageConsoleClient::screenshot):
3044
3045 2019-07-24  Youenn Fablet  <youenn@apple.com>
3046
3047         Remove MediaPlayerPrivate::supportsMuting()
3048         https://bugs.webkit.org/show_bug.cgi?id=200005
3049
3050         Reviewed by Eric Carlson.
3051
3052         Remove no longer needed interface method.
3053         No change of behavior.
3054
3055         * WebCore.order:
3056         * platform/graphics/MediaPlayer.cpp:
3057         (WebCore::MediaPlayer::setVolume):
3058         (WebCore::MediaPlayer::setMuted):
3059         * platform/graphics/MediaPlayerPrivate.h:
3060         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3061         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3062         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3063         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3064         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3065         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3066
3067 2019-07-24  Tim Horton  <timothy_horton@apple.com>
3068
3069         Daring Fireball long press highlights are unnecessarily inflated due to false illegibility
3070         https://bugs.webkit.org/show_bug.cgi?id=200064
3071
3072         Reviewed by Geoff Garen.
3073
3074         If we consider text illegible on the given estimated background color,
3075         we bail from doing a tightly fitted selection-only TextIndicator and
3076         instead just paint the page without modification into the indicator,
3077         causing ugly overlap and an excessively inflated indicator.
3078
3079         Change the mechanism we use to determine illegibility to be based on
3080         a standard, instead of a constant chosen by hand 13 years ago.
3081
3082         Test: fast/text-indicator/text-indicator-with-low-contrast-text.html
3083
3084         * platform/graphics/ColorUtilities.cpp:
3085         (WebCore::luminance):
3086         Fix a typo.
3087
3088         (WebCore::contrastRatio):
3089         Add a function that computes the contrast ratio given two colors using
3090         the formula from WCAG.
3091
3092         * platform/graphics/ColorUtilities.h:
3093         * rendering/TextPaintStyle.cpp:
3094         (WebCore::textColorIsLegibleAgainstBackgroundColor):
3095         Make use of WCAG's minimum legible contrast ratio instead of an
3096         arbitrary color difference cutoff for determining whether we consider
3097         text legible. It seems sensible and also considers the text on DF readable
3098         (which it seems to be to me!).
3099
3100         * testing/Internals.cpp:
3101         (WebCore::Internals::TextIndicatorInfo::TextIndicatorInfo):
3102         * testing/Internals.h:
3103         * testing/Internals.idl:
3104         Expose all of the text rects to Internals, not just the bounding rect.
3105         Expose some more TextIndicator options to Internals so that we can
3106         turn on the legibility mechanism.
3107
3108 2019-07-24  Devin Rousso  <drousso@apple.com>
3109
3110         Web Inspector: print the target of `console.screenshot` last so the target is the closest item to the image
3111         https://bugs.webkit.org/show_bug.cgi?id=199308
3112
3113         Reviewed by Joseph Pecoraro.
3114
3115         Right now, evaluating `console.screenshot(document, "test", 1);` will log a message to the
3116         console with `#document`, `"test"`, and `1`, all on different lines (togglable by a
3117         disclosure triangle) since `#document` isn't stringifiable.
3118
3119         The ideal situation would be to have `"test"` and `1` logged on the same line, and then have
3120         `#document` be in a disclosure triangle. This way, you can "label" your images using
3121         additional arguments (e.g. `console.screenshot(document.images[1], "second image");`), as
3122         well as provide other data.
3123
3124         If the only argument was the target, it should print as if it was `console.log(target);`.
3125
3126         If there are no arguments, it should print the text "Viewport"` before the image.
3127
3128         Test: inspector/console/console-screenshot.html
3129
3130         * page/PageConsoleClient.cpp:
3131         (WebCore::PageConsoleClient::addMessage):
3132         (WebCore::PageConsoleClient::screenshot):
3133
3134 2019-07-24  Alicia Boya García  <aboya@igalia.com>
3135
3136         [MSE] Reenqueue after removeCodedFrames()
3137         https://bugs.webkit.org/show_bug.cgi?id=199749
3138
3139         Reviewed by Xabier Rodriguez-Calvar.
3140
3141         Before this patch, SourceBuffer::removeCodedFrames() did not trigger
3142         an immediate reenqueue, but rather just set the `needsReenqueuing`
3143         flag, deferring it for the next append... but there may not be another
3144         append! In that case, the removed frames would still wrongly play.
3145
3146         This is the case for instance in tests where a single long media
3147         append is done and then "cropped" with SourceBuffer.erase().
3148
3149         Test: media/media-source/media-source-erase-after-last-append.html
3150
3151         * Modules/mediasource/SourceBuffer.cpp:
3152         (WebCore::SourceBuffer::removeCodedFrames):
3153
3154 2019-07-24  Jer Noble  <jer.noble@apple.com>
3155
3156         Add per-document autoplay quirk for netflix.com.
3157         https://bugs.webkit.org/show_bug.cgi?id=200058
3158
3159         Reviewed by Eric Carlson.
3160
3161         Opt netflix.com into the desktop-style per-document autoplay quirk.
3162
3163         * page/Quirks.cpp:
3164         (WebCore::Quirks::needsPerDocumentAutoplayBehavior const):
3165
3166 2019-07-24  Alicia Boya García  <aboya@igalia.com>
3167
3168         [GStreamer] Don't crash with empty video src
3169         https://bugs.webkit.org/show_bug.cgi?id=200081
3170
3171         When a <video> element is set to load empty or about:blank, a player is still
3172         created, but no pipeline is loaded. This patch fixes some assertion errors that
3173         manifested in that case.
3174
3175         Reviewed by Philippe Normand.
3176
3177         Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html
3178
3179         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3180         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
3181         (WebCore::MediaPlayerPrivateGStreamer::platformDuration const):
3182         (WebCore::MediaPlayerPrivateGStreamer::paused const):
3183
3184 2019-07-23  Justin Fan  <justin_fan@apple.com>
3185
3186         [WebGPU] Implement errors for GPURenderPipeline creation
3187         https://bugs.webkit.org/show_bug.cgi?id=200046
3188
3189         Reviewed by Myles C. Maxfield.
3190
3191         Replacing error logging in GPURenderPipeline creation with GPUError generation. 
3192         Update GPUErrorScopes to re-use an error message prefix for less boiler-plate.
3193
3194         Test: webgpu/render-pipeline-errors.html
3195
3196         * Modules/webgpu/WebGPUDevice.cpp:
3197         (WebCore::WebGPUDevice::createRenderPipeline const):
3198         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
3199         (WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
3200         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
3201         * platform/graphics/gpu/GPUDevice.cpp:
3202         (WebCore::GPUDevice::tryCreateRenderPipeline const):
3203         * platform/graphics/gpu/GPUDevice.h:
3204         * platform/graphics/gpu/GPUErrorScopes.cpp:
3205         (WebCore::GPUErrorScopes::generatePrefixedError):
3206         * platform/graphics/gpu/GPUErrorScopes.h:
3207         (WebCore::GPUErrorScopes::setErrorPrefix):
3208         * platform/graphics/gpu/GPURenderPipeline.h:
3209         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3210         (WebCore::tryCreateMtlDepthStencilState):
3211         (WebCore::trySetVertexInput):
3212         (WebCore::trySetColorStates):
3213         (WebCore::trySetMetalFunctions):
3214         (WebCore::trySetFunctions):
3215         (WebCore::convertRenderPipelineDescriptor):
3216         (WebCore::tryCreateMtlRenderPipelineState):
3217         (WebCore::GPURenderPipeline::tryCreate):
3218         (WebCore::GPURenderPipeline::GPURenderPipeline):
3219
3220 2019-07-23  Konstantin Tokarev  <annulen@yandex.ru>
3221
3222         ImageDecoderDirect2D::hotSpot() should return WTF::nullopt instead of default constructed value
3223         https://bugs.webkit.org/show_bug.cgi?id=200055
3224
3225         Reviewed by Brent Fulgham.
3226
3227         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3228         (WebCore::ImageDecoderDirect2D::hotSpot const):
3229
3230 2019-07-23  Tim Horton  <timothy_horton@apple.com>
3231
3232         Long press hint has half blue shape in Feedly.com
3233         https://bugs.webkit.org/show_bug.cgi?id=200053
3234         <rdar://problem/53323369>
3235
3236         Reviewed by Simon Fraser.
3237
3238         No new tests, because TextIndicator snapshots are not yet testable.
3239
3240         * rendering/RenderLayer.cpp:
3241         (WebCore::RenderLayer::paintForegroundForFragments):
3242         Paint ChildBlockBackgrounds when painting selection AND backgrounds;
3243         only exclude it when doing a selection-only paint.
3244
3245 2019-07-23  Chris Fleizach  <cfleizach@apple.com>
3246
3247         AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
3248         https://bugs.webkit.org/show_bug.cgi?id=199988
3249
3250         Reviewed by Per Arne Vollan.
3251
3252         Implement the reset state to cancel current speech jobs.
3253
3254         * Modules/speech/SpeechSynthesis.cpp:
3255         (WebCore::SpeechSynthesis::startSpeakingImmediately):
3256         (WebCore::SpeechSynthesis::cancel):
3257         * platform/PlatformSpeechSynthesizer.h:
3258         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
3259         (WebCore::PlatformSpeechSynthesizer::resetState):
3260         * platform/mac/PlatformSpeechSynthesizerMac.mm:
3261         (WebCore::PlatformSpeechSynthesizer::resetState):
3262
3263 2019-07-23  Zalan Bujtas  <zalan@apple.com>
3264
3265         [iOS] Tapping the search field on a search results page on zillow.com shows and immediately dismisses the keyboard
3266         https://bugs.webkit.org/show_bug.cgi?id=200044
3267         <rdar://problem/53103732>
3268
3269         Reviewed by Wenson Hsieh.
3270
3271         1. The keyboard gets dismissed as the result of scroll event.
3272         2. The (horizontal)scroll event is initiated by WebKit as we try to re-center the content.
3273         3. The content gets off-centered as the result of the newly constructed drop-down menu which slightly sticks out of the document to the right (layout overflows).
3274
3275         It works with shipping version of iOS because _zoomToFocusRect operates on stale viewport information (see r244494 for the progression).
3276         This patch applies a site specific quirk to restore shipping behavior.
3277
3278         * page/Quirks.cpp:
3279         (WebCore::Quirks::shouldAvoidScrollingWhenFocusedContentIsVisible const):
3280         * page/Quirks.h:
3281
3282 2019-07-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
3283
3284         CanvasRenderingContext2D.setTransfrom() reads only the aliases attributes of DOMMatrix2DInit
3285         https://bugs.webkit.org/show_bug.cgi?id=199850
3286
3287         Reviewed by Simon Fraser.
3288
3289         The validateAndFixup step of DOMMatrix2DInit sets the matrix attributes 
3290         (m** fields) from the aliases attributes (a, b, c, d, e, f) if the former
3291         ones do not exist and the later ones exist. See
3292         https://www.w3.org/TR/geometry-1/#dommatrixinit-dictionary and
3293         DOMMatrixReadOnly::validateAndFixup(DOMMatrix2DInit& init).
3294
3295         Since CanvasRenderingContext2DBase::setTransform() validates and fixes
3296         the input DOMMatrix2DInit, it should rely on matrix attributes.
3297
3298         Test: fast/canvas/setTransfrom-aliases-transform.html
3299
3300         * html/canvas/CanvasRenderingContext2DBase.cpp:
3301         (WebCore::CanvasRenderingContext2DBase::setTransform):
3302
3303 2019-07-24  Simon Fraser  <simon.fraser@apple.com>
3304
3305         [iOS WK2] A top fixed bar can flicker when scrolling with the keyboard up
3306         https://bugs.webkit.org/show_bug.cgi?id=200105
3307         rdar://problem/52871975
3308
3309         Reviewed by Wenson Hsieh.
3310
3311         ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition() computes a visual viewport
3312         from the current scroll position and scrollableAreaSize(). This doesn't know anything about
3313         the impact of keyboards on the visual viewport, so it computes a too-large visual viewport
3314         when the keyboard is up, triggering incorrect manipulations of the layout viewport. This
3315         leads to the top bar flashing to position 0 when it should be hidden off the top.
3316
3317         Fix by feeding into the scrolling tree the height of the visual viewport which takes
3318         FrameView::visualViewportOverrideRect() into account. This is stored on ScrollingStateFrameScrollingNode/
3319         ScrollingTreeFrameScrollingNode.
3320
3321         Test: scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html
3322
3323         * page/FrameView.h:
3324         * page/scrolling/AsyncScrollingCoordinator.cpp:
3325         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
3326         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3327         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3328         (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
3329         (WebCore::ScrollingStateFrameScrollingNode::setOverrideVisualViewportSize):
3330         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
3331         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3332         * page/scrolling/ScrollingTree.cpp:
3333         (WebCore::ScrollingTree::commitTreeState): LOG_WITH_STREAM() doesn't evaluate scrollingTreeAsText()
3334         every time.
3335         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3336         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
3337         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
3338         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
3339         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3340
3341 2019-07-23  Tim Horton  <timothy_horton@apple.com>
3342
3343         Long press hint of AirPods buy buttons are tall and narrow during animation
3344         https://bugs.webkit.org/show_bug.cgi?id=200036
3345         <rdar://problem/53145697>
3346
3347         Reviewed by Wenson Hsieh.
3348
3349         New test: fast/text-indicator/text-indicator-with-tiny-child.html
3350
3351         * dom/Range.cpp:
3352         (WebCore::Range::borderAndTextRects const):
3353         * dom/Range.h:
3354         Add a BoundingRectBehavior that ignores 1x1 and smaller rects.
3355
3356         * page/TextIndicator.cpp:
3357         (WebCore::absoluteBoundingRectForRange):
3358         Enable IgnoreTinyRects.
3359
3360 2019-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3361
3362         [macOS 10.15] Web process crashes when attempting to show the font panel via Font > Show Fonts
3363         https://bugs.webkit.org/show_bug.cgi?id=200021
3364         <rdar://problem/53301325>
3365
3366         Reviewed by Ryosuke Niwa.
3367
3368         In macOS 10.15, attempting to access ~/Library/FontCollections/ from the web process causes a Sandbox violation
3369         and a subsequent crash. This can be triggered by trying to show the font panel via Font > Show Fonts in the
3370         context menu after right clicking.
3371
3372         In the (near) future, we should fix this by moving logic to show the font panel, color panel and styles panel
3373         from the Editor in the web process to the UI process in WebKit2. However, for the time being, we can just work
3374         around this by adding a new EditorClient hook to determine whether to allow the font panel to show; this returns
3375         true in the legacy macOS WebKit port, and false everywhere else.
3376
3377         Test: editing/mac/style/do-not-crash-when-showing-font-panel.html
3378
3379         * editing/mac/EditorMac.mm:
3380         (WebCore::Editor::showFontPanel):
3381         * loader/EmptyClients.cpp:
3382         * page/EditorClient.h:
3383
3384 2019-07-23  Ryosuke Niwa  <rniwa@webkit.org>
3385
3386         WebKit should strip away system font names from the pasted content
3387         https://bugs.webkit.org/show_bug.cgi?id=199975
3388         <rdar://problem/53336353>
3389
3390         Reviewed by Darin Adler.
3391
3392         Cocoa HTML Writer sometimes generate system font names such as ".AppleSystemUIFont", ".SFUI-Regular", and ".SF UI Mono".
3393         We need to strip away these font names upon paste to avoid these font names falling back to Times New Roman.
3394
3395         Added the code to strip these font names away in EditingStyle::mergeStyleFromRulesForSerialization, which is used by
3396         StylizedMarkupAccumulator to generate HTML during copy. This works because WebContentReader::readWebArchive invokes
3397         sanitizeMarkupWithArchive which inserts the pasteboard content into a temporary document then re-serializes back to HTML
3398         using StylizedMarkupAccumulator before the actual pasting happens.
3399
3400         This approach has a few benefits over stripping away these font names in ReplaceSelectionCommand:
3401
3402         1. It would only affect clients that opts-in to copy & paste sanitization. e.g. it won't affect legacy WebKit clients
3403         and those that opt out of pasteboard content sanitization.
3404
3405         2. It preserves font names such as ".SF Blah" that a website may insert as some kind of house keeping purposes if ever.
3406         While we don't have any evidence that there is any such a website but it's a real risk nonetheless. The copy side fix would
3407         only affect cross-site and cross-app pasting, which is rare and less likely to affect real user scenarios.
3408
3409         3. It avoids exposing bogus .Apple* or .SF* font names to websites that directly use event.clipboardData.getData.
3410         Indeed stripping away bogus markup like this is one of the key features / benefit of using copy & paste sanitization.
3411
3412         Test: editing/pasteboard/paste-cocoa-writer-markup-with-system-fonts.html
3413
3414         * editing/EditingStyle.cpp:
3415         (WebCore::usesForbiddenSystemFontAsOnlyFontFamilyName): Added.
3416         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization): Added the code to remove font-family property when needed.
3417         * platform/graphics/FontCache.h:
3418         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3419         (WebCore::isSystemFont): Moved.
3420         (WebCore::FontCache::isSystemFontForbiddenForEditing): Added.
3421         * platform/graphics/freetype/FontCacheFreeType.cpp:
3422         (WebCore::FontCache::isSystemFontForbiddenForEditing): Added. Always returns false.
3423         * platform/graphics/win/FontCacheWin.cpp:
3424         (WebCore::FontCache::isSystemFontForbiddenForEditing): Ditto.
3425
3426 2019-07-22  Yusuke Suzuki  <ysuzuki@apple.com>
3427
3428         [bmalloc] Each IsoPage gets 1MB VA because VMHeap::tryAllocateLargeChunk rounds up
3429         https://bugs.webkit.org/show_bug.cgi?id=200024
3430
3431         Reviewed by Saam Barati.
3432
3433         Changed how we interpret VM tags. Add IsoHeap VM tag support, and rename WebAssembly tag
3434         to Gigacage tag.
3435
3436         * page/ResourceUsageData.h:
3437         * page/ResourceUsageOverlay.h:
3438         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3439         (WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
3440         * page/cocoa/ResourceUsageThreadCocoa.mm:
3441         (WebCore::displayNameForVMTag):
3442         (WebCore::categoryForVMTag):
3443
3444 2019-07-22  Youenn Fablet  <youenn@apple.com>
3445
3446         Fix inspector override conversion in InspectorPageAgent::overrideSetting
3447         https://bugs.webkit.org/show_bug.cgi?id=200017
3448
3449         Reviewed by Devin Rousso.
3450
3451         Covered by inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
3452         which should not fail on bots not having cameras
3453
3454         * inspector/agents/InspectorPageAgent.cpp:
3455         (WebCore::toOptionalBool):
3456         (WebCore::InspectorPageAgent::overrideSetting):
3457         Previously, the conversion for the mock capture value was implicit from a bool pointer to an optional.
3458         Make an explicit conversion as done for regular settings.
3459
3460 2019-07-22  Ross Kirsling  <ross.kirsling@sony.com>
3461
3462         Unreviewed non-unified build fix.
3463
3464         * Modules/webdatabase/DatabaseContext.h:
3465         * html/HTMLDialogElement.cpp:
3466         * html/HTMLScriptElement.cpp:
3467         * inspector/agents/InspectorDatabaseAgent.cpp:
3468         * workers/service/server/SWServerWorker.cpp:
3469         * workers/service/server/SWServerWorker.h:
3470         * worklets/WorkletGlobalScope.cpp:
3471         * worklets/WorkletGlobalScope.h:
3472
3473 2019-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3474
3475         [iOS] [WK1] UIWebView always jumps to the top left corner when scrolling to reveal the selection
3476         https://bugs.webkit.org/show_bug.cgi?id=200013
3477         <rdar://problem/52526901>
3478
3479         Reviewed by Simon Fraser.
3480
3481         After <https://trac.webkit.org/r244141>, we no longer attempt to scroll to reveal the text selection in
3482         UIWebView after changing the selection, due to how we use the legacy document view rect in legacy WebKit when
3483         computing the visual viewport. This causes the viewRect in RenderLayer::scrollRectToVisible to be the same size
3484         as the content size, which then causes us to always scroll to the origin when revealing the selection.
3485
3486         To make selection revealing work again in legacy WebKit, conditionally restore the old behavior of using the
3487         unobscured content rect as the view rect, only in the case where scrolling is delegated and the platform widget
3488         is present.
3489
3490         Test: WebKitLegacy.ScrollToRevealSelection
3491
3492         * page/FrameView.cpp:
3493         (WebCore::FrameView::viewRectExpandedByContentInsets const):
3494         (WebCore::FrameView::visualViewportRectExpandedByContentInsets const): Deleted.
3495
3496         Additionally rename visualViewportRectExpandedByContentInsets to viewRectExpandedByContentInsets, to reflect the
3497         fact that this may either be the visual viewport rect or unobscured content rect.
3498
3499         * page/FrameView.h:
3500         * rendering/RenderLayer.cpp:
3501         (WebCore::RenderLayer::scrollRectToVisible):
3502
3503 2019-07-22  Brent Fulgham  <bfulgham@apple.com>
3504
3505         Correct web audio-related crash in seed reports
3506         https://bugs.webkit.org/show_bug.cgi?id=200009
3507         <rdar://problem/51565203>
3508
3509         Reviewed by Per Arne Vollan.
3510
3511         Update the 'createMix' method to do proper return value checking so that
3512         we can clear the result of MTAudioProcessingTapCreate if the create operation
3513         failed.
3514
3515         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3516         (WebCore::AudioSourceProviderAVFObjC::createMix):
3517
3518 2019-07-22  Per Arne Vollan  <pvollan@apple.com>
3519
3520         Prewarmed font does not find any matches
3521         https://bugs.webkit.org/show_bug.cgi?id=200007
3522
3523         Reviewed by Brent Fulgham.
3524
3525         Prewarming the font name 'SF Pro Text' does not find any matches. The font name ".SF NS Text/Display"
3526         should be used instead. Also add 'Lucida Grande' to the list of prewarmed font, since it is used as
3527         fallback font in many cases.
3528
3529         No new tests, covered by existing tests.
3530
3531         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3532         (WebCore::fontFamiliesForPrewarming):
3533
3534 2019-07-22  Youenn Fablet  <youenn@apple.com>
3535
3536         Make sure the player underlying volume is correctly set after creating a new player
3537         https://bugs.webkit.org/show_bug.cgi?id=199974
3538         <rdar://problem/52762559>
3539
3540         Reviewed by Eric Carlson.
3541
3542         When creating a player before starting to play, the volume might not be correctly initialized.
3543         Fix that by updating the volume like done for rate and muted state.
3544         A future refactoring should probably move that code in MediaPlayer.
3545
3546         Add an internal API to query the volume value from the underlying player.
3547
3548         Test: http/tests/media/audio-volume-zero.html
3549
3550         * html/HTMLMediaElement.cpp:
3551         (WebCore::HTMLMediaElement::updateVolume):
3552         (WebCore::HTMLMediaElement::updatePlayState):
3553         (WebCore::HTMLMediaElement::effectiveVolume const):
3554         (WebCore::HTMLMediaElement::effectiveMuted const):
3555         * html/HTMLMediaElement.h:
3556         * testing/Internals.cpp:
3557         (WebCore::Internals::privatePlayerVolume):
3558         * testing/Internals.h:
3559         * testing/Internals.idl:
3560         * testing/Internals.mm:
3561         (WebCore::Internals::privatePlayerVolume):
3562
3563 2019-07-22  Devin Rousso  <drousso@apple.com>
3564
3565         Web Inspector: Page: mark any WebCore::Setting inspector override as UNLIKELY
3566         https://bugs.webkit.org/show_bug.cgi?id=199925
3567
3568         Reviewed by Joseph Pecoraro.
3569
3570         * Scripts/SettingsTemplates/Settings.cpp.erb:
3571
3572 2019-07-22  Simon Fraser  <simon.fraser@apple.com>
3573
3574         Fix crashes in ScrollingStateNode::insertChild()
3575         https://bugs.webkit.org/show_bug.cgi?id=200023
3576         rdar://problem/53265378
3577
3578         Reviewed by Darin Adler.
3579
3580         Crash data suggest that ScrollingStateNode::insertChild() can be passed an index that
3581         is larger than the size of the vector, causing crashes.
3582
3583         Fix defensively by falling back to append() if the passed index is equal to or larger
3584         than the size of the children vector.
3585
3586         * page/scrolling/ScrollingStateNode.cpp:
3587         (WebCore::ScrollingStateNode::insertChild):
3588
3589 2019-07-22  Simon Fraser  <simon.fraser@apple.com>
3590
3591         Make some constructors explicit
3592         https://bugs.webkit.org/show_bug.cgi?id=199981
3593
3594         Reviewed by Daniel Bates.
3595
3596         Make explicit public constructors of objects that take POD or String& arguments,
3597         to reduce the changes of the compiler doing implicit conversions.
3598
3599         * Modules/indexeddb/server/IndexValueEntry.h:
3600         * Modules/indexeddb/server/IndexValueStore.h:
3601         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
3602         * Modules/webdatabase/ChangeVersionData.h:
3603         (WebCore::ChangeVersionData::ChangeVersionData):
3604         * Modules/webdatabase/OriginLock.h:
3605         * Modules/websockets/WebSocketExtensionParser.h:
3606         (WebCore::WebSocketExtensionParser::WebSocketExtensionParser):
3607         * bindings/js/ScriptCachedFrameData.h:
3608         * contentextensions/URLFilterParser.cpp:
3609         (WebCore::ContentExtensions::PatternParser::PatternParser):
3610         * css/parser/CSSTokenizer.h:
3611         * css/parser/SizesAttributeParser.h:
3612         * dom/SpaceSplitString.cpp:
3613         (WebCore::TokenIsEqualToCStringTokenProcessor::TokenIsEqualToCStringTokenProcessor):
3614         * html/FormController.cpp:
3615         (WebCore::SavedFormState::appendControlState):
3616         (WebCore::SavedFormState::takeControlState):
3617         * loader/ProgressTracker.cpp:
3618         (WebCore::ProgressItem::ProgressItem):
3619         * page/DragController.cpp:
3620         (WebCore::DragController::DragController):
3621         (WebCore::DragController::performDragOperation):
3622         * page/DragController.h:
3623         * page/animation/CSSPropertyAnimation.cpp:
3624         (WebCore::AnimationPropertyWrapperBase::AnimationPropertyWrapperBase):
3625         * page/ios/DOMTimerHoldingTank.h:
3626         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
3627         * platform/CountedUserActivity.h:
3628         (WebCore::CountedUserActivity::CountedUserActivity):
3629         * platform/audio/DirectConvolver.h:
3630         * platform/audio/DownSampler.h:
3631         * platform/audio/DynamicsCompressorKernel.h:
3632         * platform/audio/EqualPowerPanner.h:
3633         * platform/audio/MultiChannelResampler.h:
3634         * platform/audio/ReverbAccumulationBuffer.h:
3635         * platform/audio/ReverbInputBuffer.h:
3636         * platform/audio/SincResampler.cpp:
3637         * platform/audio/UpSampler.h:
3638         * platform/audio/ios/AudioFileReaderIOS.h:
3639         * platform/audio/mac/AudioFileReaderMac.h:
3640         * platform/audio/mac/AudioSessionMac.cpp:
3641         (WebCore::AudioSessionPrivate::AudioSessionPrivate):
3642         * platform/cf/KeyedDecoderCF.h:
3643         * platform/graphics/WidthIterator.cpp:
3644         (WebCore::OriginalAdvancesForCharacterTreatedAsSpace::OriginalAdvancesForCharacterTreatedAsSpace):
3645         * platform/graphics/cocoa/FontCacheCoreText.h:
3646         (WebCore::SynthesisPair::SynthesisPair):
3647         * platform/graphics/displaylists/DisplayListItems.h:
3648         (WebCore::DisplayList::DrawingItem::DrawingItem):
3649         * platform/network/cf/ResourceRequest.h:
3650         (WebCore::ResourceRequest::ResourceRequest):
3651         * platform/text/TextCodecICU.h:
3652         * rendering/RenderTableSection.h:
3653         (WebCore::CellSpan::CellSpan):
3654         * rendering/shapes/RasterShape.cpp:
3655         * rendering/shapes/RasterShape.h:
3656         (WebCore::RasterShapeIntervals::RasterShapeIntervals):
3657         * testing/MockLibWebRTCPeerConnection.h:
3658         (WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate):
3659
3660 2019-07-22  Rob Buis  <rbuis@igalia.com>
3661
3662         Remove some unneeded code in MathOperator
3663         https://bugs.webkit.org/show_bug.cgi?id=199935
3664
3665         Reviewed by Frédéric Wang.
3666
3667         Remove unused method.
3668
3669         No new tests, not changing behavior.
3670
3671         * rendering/mathml/MathOperator.h:
3672
3673 2019-07-21  Konstantin Tokarev  <annulen@yandex.ru>
3674
3675         Add DataListButtonElement.cpp to unified sources
3676         https://bugs.webkit.org/show_bug.cgi?id=199989
3677
3678         Reviewed by Michael Catanzaro.
3679
3680         * Sources.txt:
3681         * WebCore.xcodeproj/project.pbxproj:
3682
3683 2019-07-21  Andres Gonzalez  <andresg_22@apple.com>
3684
3685         Add accessibilityInsertText for text insertion in edit fields.
3686         https://bugs.webkit.org/show_bug.cgi?id=199973
3687
3688         Reviewed by Chris Fleizach.
3689
3690         Renamed accessibilityInsertText to _accessibilityInsertText.
3691
3692         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3693         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
3694         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
3695         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3696         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
3697         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
3698
3699 2019-07-21  Saam Barati  <sbarati@apple.com>
3700
3701         [WHLSL] Checker needs to setError() when a property access node can't commit its base type
3702         https://bugs.webkit.org/show_bug.cgi?id=199978
3703
3704         Reviewed by Dean Jackson.
3705
3706         Test: webgpu/whlsl/null-array-property-access.html
3707
3708         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3709         (WebCore::WHLSL::Checker::finishVisiting):
3710
3711 2019-07-21  Saam Barati  <sbarati@apple.com>
3712
3713         [WHLSL] Return the zero-value enum in the enum-from-integer constructor when the integer is not a valid enum value
3714         https://bugs.webkit.org/show_bug.cgi?id=199853
3715
3716         Reviewed by Dean Jackson.
3717
3718         Test: webgpu/whlsl/enum-integer-constructor.html
3719
3720         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
3721         (WebCore::WHLSL::Metal::writeNativeFunction):
3722
3723 2019-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
3724
3725         [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
3726         https://bugs.webkit.org/show_bug.cgi?id=199912
3727         <rdar://problem/52182454>
3728
3729         Reviewed by Simon Fraser.
3730
3731         This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
3732         text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
3733         CoreText.
3734
3735         Test: fast/text/international/system-language/composition.html
3736
3737         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
3738         (WebCore::Font::getCFStringAttributes const):
3739
3740 2019-07-20  Andres Gonzalez  <andresg_22@apple.com>
3741
3742         Add accessibilityInsertText for text insertion in edit fields.
3743         https://bugs.webkit.org/show_bug.cgi?id=199973
3744
3745         Reviewed by Chris Fleizach.
3746
3747         Tests: accessibility/insert-newline.html
3748                accessibility/ios-simulator/insert-newline.html
3749
3750         Accessibility clients like VoiceOver and Voice Control were entering
3751         text in text fields by replacing the entire content of the field
3752         (SetValue) and then setting the insertion point to the appropriate
3753         offset (SetSelectedTextRange). accessibilityInsertText gives a simpler
3754         interface to clients to insert text at the insertion point location.
3755         In addition, this provides a workaround for the issue encountered with
3756         the previous method when inserting a linebreak.
3757
3758         * accessibility/AccessibilityObject.cpp:
3759         (WebCore::AccessibilityObject::insertText):
3760         * accessibility/AccessibilityObject.h:
3761         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3762         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
3763         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3764         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
3765
3766 2019-07-20  Alexander Mikhaylenko  <exalm7659@gmail.com>
3767
3768         REGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
3769         https://bugs.webkit.org/show_bug.cgi?id=199322
3770
3771         Reviewed by Michael Catanzaro.
3772
3773         Check ENABLE(KINETIC_SCROLLING) instead of ENABLE(ASYNC_SCROLLING) for kinetic scrolling.
3774
3775         * platform/PlatformWheelEvent.h:
3776         * platform/generic/ScrollAnimatorGeneric.cpp:
3777         (WebCore::ScrollAnimatorGeneric::handleWheelEvent):
3778         * platform/gtk/PlatformWheelEventGtk.cpp:
3779         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3780
3781 2019-07-20  Zalan Bujtas  <zalan@apple.com>
3782
3783         [LFC][TFC] Introduce table formatting context.
3784         https://bugs.webkit.org/show_bug.cgi?id=199979
3785         <rdar://problem/53346292>
3786
3787         Reviewed by Antti Koivisto.
3788
3789         Add the basic class structure for the table formatting context.
3790         https://www.w3.org/TR/CSS22/tables.html
3791
3792         * Sources.txt:
3793         * WebCore.xcodeproj/project.pbxproj:
3794         * layout/FormattingState.h:
3795         (WebCore::Layout::FormattingState::isTableFormattingState const):
3796         * layout/tableformatting/TableFormattingContext.cpp: Added.
3797         (WebCore::Layout::TableFormattingContext::TableFormattingContext):
3798         (WebCore::Layout::TableFormattingContext::layout const):
3799         * layout/tableformatting/TableFormattingContext.h: Added.
3800         * layout/tableformatting/TableFormattingState.cpp: Added.
3801         (WebCore::Layout::TableFormattingState::TableFormattingState):
3802         (WebCore::Layout::TableFormattingState::~TableFormattingState):
3803         * layout/tableformatting/TableFormattingState.h: Added.
3804         * layout/tableformatting/TableInvalidation.cpp: Added.
3805         (WebCore::Layout::TableInvalidation::invalidate):
3806         * layout/tableformatting/TableInvalidation.h: Added.
3807
3808 2019-07-20  Zalan Bujtas  <zalan@apple.com>
3809
3810         [LFC][IFC] Add support for mid-word break.
3811         https://bugs.webkit.org/show_bug.cgi?id=199976
3812         <rdar://problem/53337349>
3813
3814         Reviewed by Antti Koivisto.
3815
3816         Introduce leading and trailing InlineTextItem to support incoming and outgoing partial content.
3817         TextUtil::split is a straight copy of SimpleLineLayout::split.
3818
3819         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3820         (WebCore::Layout::inlineItemWidth):
3821         (WebCore::Layout::LineLayout::close):
3822         (WebCore::Layout::LineLayout::placeInlineItem):
3823         (WebCore::Layout::LineLayout::layout):
3824         * layout/inlineformatting/InlineTextItem.cpp:
3825         (WebCore::Layout::InlineTextItem::split const):
3826         (WebCore::Layout::InlineTextItem::split): Deleted.
3827         * layout/inlineformatting/InlineTextItem.h:
3828         (WebCore::Layout::InlineTextItem::inlineBox const):
3829         * layout/inlineformatting/text/TextUtil.cpp:
3830         (WebCore::Layout::TextUtil::split):
3831         * layout/inlineformatting/text/TextUtil.h:
3832
3833 2019-07-20  Zalan Bujtas  <zalan@apple.com>
3834
3835         [Text autosizing] Do not nuke the style on dynamicViewportSizeUpdate
3836         https://bugs.webkit.org/show_bug.cgi?id=199718
3837         <rdar://problem/53344961>
3838
3839         Reviewed by Simon Fraser.
3840
3841         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.
3842         Currently we call setNeedsRecalcStyleInAllFrames() to accomplish it. Unfortunatelly setNeedsRecalcStyleInAllFrames destroys all the style information which means that the
3843         subsequent styleResolve() needs to start from scratch.
3844         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
3845         on a timer so that rapid dynamicViewportSizeUpdate() calls won't trigger redundant layouts.
3846
3847         * css/StyleResolver.cpp:
3848         (WebCore::hasTextChild):
3849         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
3850         (WebCore::hasTextChildren): Deleted.
3851         * css/StyleResolver.h:
3852         * page/FrameView.h:
3853         * page/Page.cpp:
3854         (WebCore::Page::invalidateTextAutoSizeInAllFrames):
3855         * page/Page.h:
3856
3857 2019-07-20  Saam Barati  <sbarati@apple.com>
3858
3859         [WHLSL] Make enums work
3860         https://bugs.webkit.org/show_bug.cgi?id=199634
3861
3862         Reviewed by Robin Morisset.
3863
3864         This patch makes enums work. There were a couple changes needed to do this work:
3865         1. In the metal codegen, we were emitting code like "EnumType.EnumValue"
3866         instead of "EnumType::EnumValue".
3867         
3868         2. Inside the enumeration declaration AST node, we track enums in a HashMap
3869         because we need to look up names of enum values in that map in parts of the
3870         compiler. However, HashMap is not ordered but we were relying on the iteration
3871         order of it to generate the default values of enums. E.g, in: "enum { Foo = 10, Bar }",
3872         Bar should be 11. However, there was no guarantee that we iterated over Bar
3873         after Foo. Instead, we just track the default values as we parse an enum
3874         inside of the parser. This allows us to continue to keep using HashMap without
3875         also adding an auxiliary data structure (or using more memory in some way) to
3876         track the order of the enum elements.
3877         
3878         I've also filed a patch to do follow-up work on implementing the correct
3879         operational behavior when constructing an enum from its underlying type when
3880         the underlying value does not match any enum value:
3881         https://bugs.webkit.org/show_bug.cgi?id=199853
3882
3883         Tests: webgpu/whlsl/enums-2.html
3884                webgpu/whlsl/enums.html
3885
3886         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
3887         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
3888         (WebCore::WHLSL::AST::EnumerationMember::value):
3889         (WebCore::WHLSL::AST::EnumerationMember::setValue): Deleted.
3890         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
3891         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
3892         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
3893         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
3894         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
3895         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
3896         (WebCore::WHLSL::ASTDumper::visit):
3897         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3898         (WebCore::WHLSL::Checker::visit):
3899         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
3900         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
3901         (WebCore::WHLSL::Parser::parseEnumerationMember):
3902         * Modules/webgpu/WHLSL/WHLSLParser.h:
3903         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
3904         (WebCore::WHLSL::Visitor::visit):
3905
3906 2019-07-19  Youenn Fablet  <youenn@apple.com>
3907
3908         Remote WebInspector should enable mock capture devices in UIProcess if doing it in WebProcess
3909         https://bugs.webkit.org/show_bug.cgi?id=199924
3910         <rdar://problem/50552067>
3911
3912         Reviewed by Devin Rousso.
3913
3914         Add necessary API to set mock capture devices override.
3915         In case of desynchronization between webprocess and uiprocess, make sure to return early
3916         and fail capture instead of crashing.
3917
3918         * inspector/InspectorClient.h:
3919         (WebCore::InspectorClient::setMockCaptureDevicesEnabled):
3920         * inspector/agents/InspectorPageAgent.cpp:
3921         (WebCore::InspectorPageAgent::disable):
3922         (WebCore::InspectorPageAgent::overrideSetting):
3923         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3924
3925 2019-07-19  Andy Estes  <aestes@apple.com>
3926
3927         [Apple Pay] Log less in PaymentCoordinator::shouldEnableApplePayAPIs()
3928         https://bugs.webkit.org/show_bug.cgi?id=199958
3929
3930         Reviewed by Tim Horton.
3931
3932         Only log when APIs are disabled due to user scripts.
3933
3934         * Modules/applepay/PaymentCoordinator.cpp:
3935         (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
3936
3937 2019-07-19  Dean Jackson  <dino@apple.com>
3938
3939         Add a menu item to toggle between showing and hiding link previews
3940         https://bugs.webkit.org/show_bug.cgi?id=199940
3941         <rdar://problem/53032288>
3942
3943         Reviewed by Beth Dakin.
3944
3945         New strings for Show/Hide Link Previews.
3946
3947         * en.lproj/Localizable.strings:
3948
3949 2019-07-19  Antoine Quint  <graouts@apple.com>
3950
3951         Links stop working after long-pressing a link (WK1)
3952         https://bugs.webkit.org/show_bug.cgi?id=199952
3953         <rdar://problem/52291860>
3954
3955         Reviewed by Wenson Hsieh.
3956
3957         Test: fast/events/touch/ios/click-after-long-press.html
3958
3959         When EventHandler::tryToBeginDragAtPoint() is called, we must reset m_mousePressed to false so that
3960         WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed() when we would
3961         process the next tap after a drag interaction.
3962
3963         * page/ios/EventHandlerIOS.mm:
3964         (WebCore::EventHandler::tryToBeginDragAtPoint):
3965
3966 2019-07-19  Sihui Liu  <sihui_liu@apple.com>
3967
3968         IndexedDB: error in starting version change transaction may be neglected
3969         https://bugs.webkit.org/show_bug.cgi?id=199818
3970         <rdar://problem/52925738>
3971
3972         Reviewed by Brady Eidson.
3973
3974         For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread 
3975         before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the 
3976         DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
3977         marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange, 
3978         m_databaseInfo could become nullptr.
3979
3980         To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the 
3981         SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of 
3982         ungradeneeded event is dispatched to the IDBRequest.
3983
3984         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3985         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
3986         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
3987         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
3988         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
3989         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
3990         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3991
3992 2019-07-19  Zalan Bujtas  <zalan@apple.com>
3993
3994         [LFC][IFC] Add partial content handling
3995         https://bugs.webkit.org/show_bug.cgi?id=199930
3996
3997         Reviewed by Antti Koivisto.
3998
3999         Move the actual inline item placement to a dedicated functions. This enables us to
4000         construct a dedicated InlineItem for the partial content and pass it in to this function.
4001
4002         <span>The quick brown fox jumps over the lazy dog</span> <- inline content
4003         [The][ ][quick][ ][brown][ ][fox][ ][jumps][ ][over][ ][the][ ][lazy][ ][dog] <- InlineItems
4004
4005         Line breaking:
4006         [The][ ][qu]
4007         [ick] <- Partial InlineItem (position: 6 length: 3) from [quick] (position: 4 length: 5)
4008
4009         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
4010         (WebCore::Layout::LineLayout::close):
4011         (WebCore::Layout::LineLayout::placeInlineItem):
4012         (WebCore::Layout::LineLayout::layout):
4013         (WebCore::Layout::LineInput::LineInput):
4014         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
4015         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
4016         * layout/inlineformatting/InlineTextItem.cpp:
4017         (WebCore::Layout::InlineTextItem::split):
4018         * layout/inlineformatting/InlineTextItem.h:
4019
4020 2019-07-19  Charlie Turner  <cturner@igalia.com>
4021
4022         [GStreamer] Flush get_range calls during PAUSED->READY in WebKitWebSource
4023         https://bugs.webkit.org/show_bug.cgi?id=199934
4024
4025         Reviewed by Xabier Rodriguez-Calvar.
4026
4027         Unit testing not applicable.
4028
4029         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
4030         (webKitWebSrcChangeState): A well-behaved element should unblock streaming threads
4031         during a PAUSED->READY transition, so do that here.
4032
4033 2019-07-19  Rob Buis  <rbuis@igalia.com>
4034
4035         Remove some unneeded code in MathOperator
4036         https://bugs.webkit.org/show_bug.cgi?id=199935
4037
4038         Reviewed by Frédéric Wang.
4039
4040         The initialize method is unneeded since the member
4041         variables all use default initialization.
4042
4043         No new tests, not changing behavior.
4044
4045         * rendering/mathml/MathOperator.cpp:
4046         (WebCore::MathOperator::MathOperator):
4047         (WebCore::MathOperator::GlyphAssemblyData::initialize): Deleted.
4048
4049 2019-07-18  Antoine Quint  <graouts@apple.com>
4050
4051         Enable simulated mouse events quirk for soundcloud.com
4052         https://bugs.webkit.org/show_bug.cgi?id=199908
4053         <rdar://problem/52915981>
4054
4055         Reviewed by Brent Fulgham.
4056
4057         Scrubbing on soundcloud.com relies on mouse events alone when displaying on iPad with the desktop UA string.
4058         Opting into the simulated mouse events quirk makes scrubbing work and we also ensure that page scrolling is
4059         disabled as a result of scrubbing by returning true in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented().
4060
4061         Also making a drive-by fix in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented() to use a reference
4062         instead of a pointer when downcasting a null-checked pointer.
4063
4064         * page/Quirks.cpp:
4065         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
4066         (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
4067
4068 2019-07-18  Per Arne Vollan  <pvollan@apple.com>
4069
4070         Prewarm font cache with more fonts
4071         https://bugs.webkit.org/show_bug.cgi?id=199283
4072
4073         Reviewed by Myles C. Maxfield.
4074
4075         Initialize the list of families requiring system fallback in the prewarming information struct, since
4076         this was part of the orig