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