5a78fa93c149e51a86b3fb0180f5f75ef6b72d62
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         [iOSMac] Dropping text selections from web content into editable elements crashes the web process
4         https://bugs.webkit.org/show_bug.cgi?id=192113
5         <rdar://problem/46323701>
6
7         Reviewed by Ryosuke Niwa.
8
9         In iOSMac, registering invalid UTIs on NSItemProvider when starting a drag or handling a drop does not work.
10         Since iOS writes and reads only "Apple Web Archive pasteboard type" (a.k.a. `WebArchivePboardType`) during drag
11         and drop as well as copy and paste, we fail to read or write any web archive data, and subsequently fall back to
12         reading RTF or flat RTFD, both of which are not supported in iOSMac, since UIFoundation links against the
13         system's macOS WebKit stack.
14
15         To fix this, we add support for reading and writing com.apple.webarchive (`kUTTypeWebArchive`) on iOS, so that
16         WebKit-based iOSMac applications can understand web archive data from the host running macOS, and the host can
17         also understand web archive data written by the iOSMac app. Additionally, don't allow reading RTF and flat RTFD
18         as web content in iOSMac. (Note that writing RTF and flat RTFD is still safe, since it does not depend on
19         UIFoundation.framework but rather `WebCore::HTMLConverter`).
20
21         Test: DragAndDropTests.ModernWebArchiveType
22
23         * editing/cocoa/WebContentReaderCocoa.mm:
24         (WebCore::createFragment):
25
26         Additionally make sure that we never call into UIFoundation's NSAttributedString to markup conversion codepath
27         by making `createFragment` an empty stub on iOSMac.
28
29         * platform/ios/PasteboardIOS.mm:
30         (WebCore::supportedImageTypes):
31         (WebCore::isTypeAllowedByReadingPolicy):
32         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
33         (WebCore::Pasteboard::supportedWebContentPasteboardTypes):
34         * platform/ios/PlatformPasteboardIOS.mm:
35         (WebCore::PlatformPasteboard::write):
36
37 2018-11-28  Commit Queue  <commit-queue@webkit.org>
38
39         Unreviewed, rolling out r238653 and r238656.
40         https://bugs.webkit.org/show_bug.cgi?id=192130
41
42         Breaks iOS build (Requested by smfr on #webkit).
43
44         Reverted changesets:
45
46         "Move Lookup Code for better cross platform usage"
47         https://bugs.webkit.org/show_bug.cgi?id=191732
48         https://trac.webkit.org/changeset/238653
49
50         "Attempt to fix the iOS build by only including RevealSPI.h
51         when it's needed."
52         https://trac.webkit.org/changeset/238656
53
54 2018-11-28  Simon Fraser  <simon.fraser@apple.com>
55
56         Attempt to fix the iOS build by only including RevealSPI.h when it's needed.
57
58         * editing/cocoa/DictionaryLookup.mm:
59
60 2018-11-28  Alex Christensen  <achristensen@webkit.org>
61
62         Modernize BlobRegistry::writeBlobsToTemporaryFiles
63         https://bugs.webkit.org/show_bug.cgi?id=192117
64
65         Reviewed by Dean Jackson.
66
67         No change in behavior.  Just use CompletionHandlers and the new sendWithAsyncReply instead of two way messaging
68         and manual completion handler management.
69
70         * bindings/js/SerializedScriptValue.cpp:
71         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
72         * platform/network/BlobRegistry.h:
73         * platform/network/BlobRegistryImpl.cpp:
74         (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
75         * platform/network/BlobRegistryImpl.h:
76
77 2018-11-15  Megan Gardner  <megan_gardner@apple.com>
78
79         Move Lookup Code for better cross platform usage
80         https://bugs.webkit.org/show_bug.cgi?id=191732
81
82         Reviewed by Alex Christensen.
83
84         Not currenlty testable
85
86         DictionaryLookup uses Reveal now, which is slated to be cross-platform.
87         That patch gates the parts of DictionaryLookup that currently do not have
88         an available implementation on iOS. Once Reveal is ready, this code will be
89         replaced or expanded upon, as appropriate.
90
91         * editing/mac/DictionaryLookup.h:
92         * editing/mac/DictionaryLookup.mm:
93         (WebCore::showPopupOrCreateAnimationController):
94         (WebCore::DictionaryLookup::showPopup):
95         (WebCore::DictionaryLookup::hidePopup):
96         (WebCore::DictionaryLookup::animationControllerForPopup):
97
98 2018-11-28  Christopher Reid  <chris.reid@sony.com>
99
100         SQLiteDatabase::open is constantly printing "SQLite database failed to checkpoint: database table is locked" errors
101         https://bugs.webkit.org/show_bug.cgi?id=192111
102
103         Reviewed by Alex Christensen.
104
105         Ensure the journal_mode=WAL statement is finalized before wal_checkpoint is executed.
106
107         * platform/sql/SQLiteDatabase.cpp:
108         (WebCore::SQLiteDatabase::open):
109
110 2018-11-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
111
112         Updating href on linearGradient and radialGradient doesn't update its rendering
113         https://bugs.webkit.org/show_bug.cgi?id=191934
114
115         Reviewed by Ryosuke Niwa.
116
117         Mark the gradient renderer for repaint when the value of the 'href'
118         attribute changes.
119
120         Tests: fast/shadow-dom/svg-linear-gradient-dynamic-update-href-in-shadow-tree.html
121                fast/shadow-dom/svg-radial-gradient-dynamic-update-href-in-shadow-tree.html
122                svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop.html
123                svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.html
124
125         * svg/SVGGradientElement.cpp:
126         (WebCore::SVGGradientElement::svgAttributeChanged):
127
128
129 2018-11-28  Youenn Fablet  <youenn@apple.com>
130
131         imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-transceivers.https.html is flaky on iOS simulator
132         https://bugs.webkit.org/show_bug.cgi?id=192037
133
134         Reviewed by Eric Carlson.
135
136         The stats report JS map should be created when resolving the stats promise with WebCore RTCStatsReport.
137         But resolving the promise might fail in case of a page being suspended.
138         In that case, no JSRTCStatsReport is created and there is no backing map.
139         Update the code to reflect that.
140         Covered by existing test.
141
142         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
143         (WebCore::LibWebRTCMediaEndpoint::getStats):
144         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
145         (WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector):
146         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
147         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h:
148
149 2018-11-28  Keith Rollin  <krollin@apple.com>
150
151         Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files
152         https://bugs.webkit.org/show_bug.cgi?id=192031
153         <rdar://problem/46286816>
154
155         Reviewed by Alex Christensen.
156
157         The Generate Derived Sources and Generate Unified Sources build phases
158         in Xcode need to have their inputs and outputs specified. This
159         specification will come in the form of .xcfilelist files that will be
160         attached to these build phases. There is one .xcfilelist file that
161         lists the input file and one that lists the output files. As part of
162         this work, the various generate-{derived,unified}-sources scripts that
163         are executed in these Generate build phases are modified to help in
164         the creation of these .xcfilelist files. In particular, they can now
165         be invoked with command-line parameters. These parameters are then
166         used to alter the normal execution of these scripts, causing them to
167         produce the .xcfilelist files as opposed to actually generating the
168         files that are listed in those files.
169
170         No new tests -- no changed functionality.
171
172         * Scripts/generate-derived-sources.sh:
173         * Scripts/generate-unified-sources.sh:
174
175 2018-11-28  Keith Rollin  <krollin@apple.com>
176
177         Revert print_all_generated_files work in r238008; tighten up target specifications
178         https://bugs.webkit.org/show_bug.cgi?id=192025
179         <rdar://problem/46284301>
180
181         Reviewed by Alex Christensen.
182
183         In r238008, I added a facility for DerivedSources.make makefiles to
184         print out the list of files that they generate. This output was used
185         in the generation of .xcfilelist files used to specify the output of
186         the associated Generate Derived Sources build phases in Xcode. This
187         approach worked, but it meant that people would need to follow a
188         specific convention to keep this mechanism working.
189
190         Instead of continuing this approach, I'm going to implement a new
191         facility based on the output of `make` when passed the -d flag (which
192         prints dependency information). This new mechanism is completely
193         automatic and doesn't need maintainers to follow a convention. To that
194         end, remove most of the work performed in r238008 that supports the
195         print_all_generated_files target.
196
197         At the same time, it's important for the sets of targets and their
198         dependencies to be complete and correct. Therefore, also include
199         changes to bring those up-to-date. As part of that, you'll see
200         prevalent use of a particular technique. Here's an example:
201
202             BYTECODE_FILES = \
203                 Bytecodes.h \
204                 BytecodeIndices.h \
205                 BytecodeStructs.h \
206                 InitBytecodes.asm \
207             #
208             BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES))
209
210             all : $(BYTECODE_FILES)
211
212             $(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb
213                 ...
214
215         These lines indicate a set of generated files (those specified in
216         BYTECODE_FILES). These files are generated by the BytecodeList.rb
217         tool. But, as opposed to the normal rule where a single foo.output is
218         generated by foo.input plus some additional dependencies, this rule
219         produces multiple output files from a tool whose connection to the
220         output files is not immediately clear. A special approach is needed
221         where a single rule produces multiple output files. The normal way to
222         implement this is to use an .INTERMEDIATE target. However, we used
223         this approach in the past and ran into a problem with it, addressing
224         it with an alternate approach in r210507. The above example shows this
225         approach. The .'s in the list of target files are replaced with %'s,
226         and the result is used as the left side of the dependency rule.
227
228         No new tests -- no changed functionality.
229
230         * DerivedSources.make:
231
232 2018-11-28  Alex Christensen  <achristensen@webkit.org>
233
234         Remove dead code from an earlier attempt at implementing safe browsing
235         https://bugs.webkit.org/show_bug.cgi?id=192067
236
237         Reviewed by Chris Dumez.
238
239         * WebCore.xcodeproj/project.pbxproj:
240         * loader/EmptyClients.cpp:
241         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
242         * loader/EmptyFrameLoaderClient.h:
243         * loader/FrameLoadRequest.h:
244         (WebCore::FrameLoadRequest::setShouldSkipSafeBrowsingCheck): Deleted.
245         (WebCore::FrameLoadRequest::shouldSkipSafeBrowsingCheck): Deleted.
246         * loader/FrameLoader.cpp:
247         (WebCore::FrameLoader::loadArchive):
248         (WebCore::FrameLoader::loadURL):
249         (WebCore::FrameLoader::load):
250         (WebCore::FrameLoader::loadWithNavigationAction):
251         (WebCore::FrameLoader::loadWithDocumentLoader):
252         (WebCore::FrameLoader::loadPostRequest):
253         * loader/FrameLoader.h:
254         (WebCore::FrameLoader::loadWithDocumentLoader):
255         (WebCore::FrameLoader::loadWithNavigationAction):
256         * loader/FrameLoaderClient.h:
257         * loader/PolicyChecker.cpp:
258         (WebCore::PolicyChecker::checkNavigationPolicy):
259         * loader/PolicyChecker.h:
260         * loader/ShouldSkipSafeBrowsingCheck.h: Removed.
261
262 2018-11-28  Alex Christensen  <achristensen@webkit.org>
263
264         Add SessionIDs wherever BlobURLs are used in SerializedScriptValue
265         https://bugs.webkit.org/show_bug.cgi?id=192062
266
267         Reviewed by Dean Jackson.
268
269         Just adding infrastructure for fixing "the blob bug"
270
271         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
272         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
273         (WebCore::IDBDatabaseIdentifier::isolatedCopy const):
274         * Modules/indexeddb/IDBDatabaseIdentifier.h:
275         (WebCore::IDBDatabaseIdentifier::hash const):
276         (WebCore::IDBDatabaseIdentifier::sessionID const):
277         (WebCore::IDBDatabaseIdentifier::encode const):
278         (WebCore::IDBDatabaseIdentifier::decode):
279         * Modules/indexeddb/IDBFactory.cpp:
280         (WebCore::IDBFactory::openInternal):
281         (WebCore::IDBFactory::deleteDatabase):
282         * Modules/indexeddb/IDBTransaction.cpp:
283         (WebCore::IDBTransaction::putOrAddOnServer):
284         * Modules/indexeddb/IDBValue.cpp:
285         (WebCore::IDBValue::IDBValue):
286         (WebCore::IDBValue::setAsIsolatedCopy):
287         * Modules/indexeddb/IDBValue.h:
288         (WebCore::IDBValue::sessionID const):
289         (WebCore::IDBValue::encode const):
290         (WebCore::IDBValue::decode):
291         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
292         (WebCore::IDBServer::MemoryIndexCursor::currentData):
293         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
294         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
295         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
296         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
297         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
298         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
299         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
300         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
301         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
302         (WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
303         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
304         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
305         * bindings/js/IDBBindingUtilities.cpp:
306         (WebCore::deserializeIDBValueToJSValue):
307         * bindings/js/SerializedScriptValue.cpp:
308         (WebCore::CloneSerializer::serialize):
309         (WebCore::CloneSerializer::CloneSerializer):
310         (WebCore::CloneSerializer::dumpIfTerminal):
311         (WebCore::CloneDeserializer::deserialize):
312         (WebCore::CloneDeserializer::CloneDeserializer):
313         (WebCore::SerializedScriptValue::SerializedScriptValue):
314         (WebCore::SerializedScriptValue::create):
315         (WebCore::SerializedScriptValue::deserialize):
316         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
317         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously):
318         * bindings/js/SerializedScriptValue.h:
319         (WebCore::SerializedScriptValue::sessionID const):
320
321 2018-11-28  Justin Fan  <justin_fan@apple.com>
322
323         [WebGPU] Begin implementation of WebGPURenderPassEncoder and barebones WebGPURenderPassDescriptor
324         https://bugs.webkit.org/show_bug.cgi?id=191990
325
326         Reviewed by Dean Jackson.
327
328         Begin implementation of WebGPURenderPassEncoder and its parent interface, WebGPUProgrammablePassEncoder.
329         Also add code to allow creation of a primitive WebGPURenderPassDescriptor with the sole purpose of providing 
330         a WebGPUTextureView reference to the render pass creation function, WebGPUCommandBuffer::beginRenderPass().
331
332         Test: webgpu/render-passes.html
333
334         * CMakeLists.txt:
335         * DerivedSources.make:
336         * Modules/webgpu/WebGPUCommandBuffer.cpp:
337         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
338         (WebCore::WebGPUCommandBuffer::beginRenderPass): Added. Returns a WebGPURenderPassEncoder upon success.
339         * Modules/webgpu/WebGPUCommandBuffer.h:
340         * Modules/webgpu/WebGPUCommandBuffer.idl:
341         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Added.
342         * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Added.
343         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: Added. Empty (for now) interface parenting WebGPURenderPassEncoder.
344         * Modules/webgpu/WebGPURenderPassDescriptor.h:
345         * Modules/webgpu/WebGPURenderPassDescriptor.idl: Added. Directly handles a WebGPUTextureView attachment; all other color attachment properties set by implementation for now.
346         * Modules/webgpu/WebGPURenderPassEncoder.cpp: Added.
347         (WebCore::WebGPURenderPassEncoder::create):
348         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
349         (WebCore::WebGPURenderPassEncoder::passEncoder const):
350         * Modules/webgpu/WebGPURenderPassEncoder.h: Added. Interface to GPURenderPassEncoder.
351         * Modules/webgpu/WebGPURenderPassEncoder.idl: Added. Allows WebGPU developer to encode commands for the WebGPUCommandBuffer.
352         * Modules/webgpu/WebGPUTextureView.cpp:
353         (WebCore::WebGPUTextureView::WebGPUTextureView):
354         * Modules/webgpu/WebGPUTextureView.h:
355         (WebCore::WebGPUTextureView::texture):
356         * Sources.txt:
357         * SourcesCocoa.txt:
358         * WebCore.xcodeproj/project.pbxproj:
359         * bindings/js/WebCoreBuiltinNames.h:
360         * platform/graphics/gpu/GPUCommandBuffer.h:
361         (WebCore::GPUCommandBuffer::platformCommandBuffer const):
362         * platform/graphics/gpu/GPUProgrammablePassEncoder.h: Added. Base class for GPURenderPassEncoder.
363         * platform/graphics/gpu/GPURenderPassDescriptor.h: Added.
364         * platform/graphics/gpu/GPURenderPassEncoder.h: Added. Wrapper class for MTLRenderCommandEncoder.
365         * platform/graphics/gpu/GPUTexture.h:
366         (WebCore::GPUTexture::platformTexture const):
367         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Added.
368         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Added.
369         (WebCore::GPURenderPassEncoder::create): Creates the backing MTLRenderCommandEncoder; returns null if this fails. 
370         (WebCore::GPURenderPassEncoder::GPURenderPassEncoder):
371         (WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): End encoding before destroying the MTLCommandEncoder to prevent an exception.
372         (WebCore::GPURenderPassEncoder::platformPassEncoder const):
373
374 2018-11-28  Rob Buis  <rbuis@igalia.com>
375
376         [XHR] Document.lastModified doesn't work for non-rendered documents
377         https://bugs.webkit.org/show_bug.cgi?id=179375
378
379         Reviewed by Alexey Proskuryakov.
380
381         Add setOverrideLastModified to override last modified date for
382         standalone Documents.
383
384         Behavior matches Firefox and Chrome.
385
386         Test: web-platform-tests/xhr/responsexml-document-properties.htm
387
388         * dom/Document.cpp:
389         (WebCore::Document::overrideLastModified):
390         (WebCore::Document::lastModified const): no need to test m_frame since that's already done in loader().
391         (WebCore::Document::lastModified): Deleted.
392         * dom/Document.h:
393         * xml/XMLHttpRequest.cpp:
394
395 2018-11-28  Yongjun Zhang  <yongjun_zhang@apple.com>
396
397         Allow WebKit clients to specify a minimum effective width for layout.
398         https://bugs.webkit.org/show_bug.cgi?id=191499
399         <rdar://problem/45362678>
400
401         Reviewed by Wenson Hsieh.
402
403         If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device
404         width. For clients that wish to lay out the content with a different width value, we would need to add a way
405         to specify the effective width for layout.
406
407         Tests: fast/viewport/ios/ipad/viewport-overriden-by-minimum-effective-width-if-ignore-meta-viewport.html
408                fast/viewport/ios/ipad/viewport-unchanged-by-minimum-effective-width-if-not-ignore-meta-viewport.html
409
410         * page/ViewportConfiguration.cpp:
411         (WebCore::ViewportConfiguration::setViewLayoutSize): Add a new argument effectiveWidth.
412         (WebCore::ViewportConfiguration::nativeWebpageParameters): Make sure minimumScale for nativeWebpageParameters
413             is small enough so that it won't clamp out the initial scale. If content is wider than the viewport, this
414             ensures we can still zoom out the page.
415         (WebCore::ViewportConfiguration::updateConfiguration): update _minimumEffectiveDeviceWidth and apply that to
416             the layout size scale computation.
417         (WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor): A helper method to return the effective
418             layout scale factor which is also effected by _minimumEffectiveDeviceWidth.
419         (WebCore::ViewportConfiguration::updateMinimumLayoutSize): Update m_minimumLayoutSize based on effectiveLayoutSizeScaleFactor().
420         (WebCore::ViewportConfiguration::description const): Also dump m_minimumEffectiveDeviceWidth.
421         * page/ViewportConfiguration.h: Add a member variable m_minimumEffectiveDeviceWidth.
422
423 2018-11-28  Stephan Szabo  <stephan.szabo@sony.com>
424
425         Make generic EventHandler methods
426         https://bugs.webkit.org/show_bug.cgi?id=192032
427
428         Reviewed by Michael Catanzaro.
429
430         No new tests. No new behavior.
431
432         Move mostly generic for non-Apple platform implementations
433         of methods from EventHandlerGlib into EventHandler. Two
434         of these also had different Windows implementations, so
435         to limit behavior change from this, those are currently
436         overridden for Windows as well as Mac and IOS.
437
438         * page/EventHandler.cpp:
439         (WebCore::EventHandler::passMousePressEventToSubframe):
440         (WebCore::EventHandler::passMouseReleaseEventToSubframe):
441         (WebCore::EventHandler::widgetDidHandleWheelEvent):
442         (WebCore::EventHandler::tabsToAllFormControls const):
443         (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
444         (WebCore::EventHandler::passMouseDownEventToWidget):
445         (WebCore::EventHandler::focusDocumentView):
446         (WebCore::EventHandler::eventActivatedView const):
447         (WebCore::EventHandler::passMouseMoveEventToSubframe):
448         * page/win/EventHandlerWin.cpp:
449         (WebCore::EventHandler::passMouseMoveEventToSubframe):
450         (WebCore::EventHandler::passMousePressEventToSubframe): Deleted.
451         (WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted.
452         (WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted.
453         (WebCore::EventHandler::tabsToAllFormControls const): Deleted.
454         (WebCore::EventHandler::focusDocumentView): Deleted.
455         (WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted.
456         (WebCore::EventHandler::accessKeyModifiers): Deleted.
457         * platform/glib/EventHandlerGLib.cpp:
458         (WebCore::EventHandler::tabsToAllFormControls const): Deleted.
459         (WebCore::EventHandler::focusDocumentView): Deleted.
460         (WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted.
461         (WebCore::EventHandler::passMouseDownEventToWidget): Deleted.
462         (WebCore::EventHandler::eventActivatedView const): Deleted.
463         (WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted.
464         (WebCore::EventHandler::passMousePressEventToSubframe): Deleted.
465         (WebCore::EventHandler::passMouseMoveEventToSubframe): Deleted.
466         (WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted.
467         (WebCore::EventHandler::accessKeyModifiers): Deleted.
468
469 2018-11-28  Zalan Bujtas  <zalan@apple.com>
470
471         [LFC][Quirk] Use non-collapsed vertical margin values when the container is stretched to the size of the ICB.
472         https://bugs.webkit.org/show_bug.cgi?id=192078
473
474         Reviewed by Antti Koivisto.
475
476         This quirk happens when the body height is 0 which means its vertical margins collapse through (top and bottom margins are adjoining).
477         However now that we stretch the body they don't collapse through anymore, so we need to use the non-collapsed values instead.
478
479         * layout/LayoutUnits.h:
480         (WebCore::Layout::HeightAndMargin::usedMarginValues const):
481         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
482         (WebCore::Layout::stretchHeightToInitialContainingBlock):
483
484 2018-11-28  Zalan Bujtas  <zalan@apple.com>
485
486         [LFC] Add support for quirk container's collapsing top margin in quirks mode.
487         https://bugs.webkit.org/show_bug.cgi?id=192070
488
489         Reviewed by Antti Koivisto.
490
491         In quirk mode when the top margin collapsing is computed for a quirk container (body, table cell) and the canditate margin value is
492         also a quirk value, we just ignore it.
493
494         * layout/blockformatting/BlockMarginCollapse.cpp:
495         (WebCore::Layout::isQuirkContainer):
496         (WebCore::Layout::hasMarginTopQuirkValue):
497         (WebCore::Layout::shouldIgnoreMarginTopInQuirkContext):
498         (WebCore::Layout::isMarginTopCollapsedWithParent):
499         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
500         * layout/layouttree/LayoutBox.h:
501         (WebCore::Layout::Box::isTableCell const):
502
503 2018-11-28  Ali Juma  <ajuma@chromium.org>
504
505         Intersection Observer: rootMargin: '' gives weird results
506         https://bugs.webkit.org/show_bug.cgi?id=191975
507
508         Reviewed by Simon Fraser.
509
510         When converting the rootMargin string into a LengthBox, explicitly construct a Length
511         of size 0px for each dimension, instead of using Length's default constructor. The
512         default constructor creates a Length with value Auto, which causes us to incorrectly
513         apply a non-zero rootMargin.
514
515         Test: imported/w3c/web-platform-tests/intersection-observer/empty-root-margin.html
516
517         * page/IntersectionObserver.cpp:
518         (WebCore::parseRootMargin):
519
520 2018-11-28  Thibault Saunier  <tsaunier@igalia.com>
521
522         [WebRTC][GStreamer] Make sure to have the default microphone on the top of the list
523         https://bugs.webkit.org/show_bug.cgi?id=192026
524
525         Reviewed by Philippe Normand.
526
527         Otherwise we might end up picking a useless one in some applications
528         (not sure what those application do though).
529
530         GStreamer patch proposed as https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/34/diffs
531
532         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
533         (WebCore::sortDevices):
534         (WebCore::GStreamerCaptureDeviceManager::addDevice):
535         (WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices):
536         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h:
537
538 2018-11-28  Thibault Saunier  <tsaunier@igalia.com>
539
540         [WebRTC][GStreamer] Tag all cameras with as 'Unknown' facing mode
541         https://bugs.webkit.org/show_bug.cgi?id=192028
542
543         Reviewed by Philippe Normand.
544
545         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
546         (WebCore::GStreamerVideoCaptureSource::capabilities):
547
548 2018-11-28  Thibault Saunier  <tsaunier@igalia.com>
549
550         [WebRTC][GStreamer] Use a GUniquePtr to hold the GstAudioConverter in our OutgoingAudioSource
551         https://bugs.webkit.org/show_bug.cgi?id=192027
552
553         Reviewed by Xabier Rodriguez-Calvar.
554
555         Cleaning up a bit the code.
556
557         It is a minor refactoring, no new test required.
558
559         * platform/graphics/gstreamer/GUniquePtrGStreamer.h:
560         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
561         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC):
562         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable):
563         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
564         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h:
565
566 2018-11-28  Thibault Saunier  <tsaunier@igalia.com>
567
568         [GStreamer][WebRTC] Do not run device monitor for device type we do not handle
569         https://bugs.webkit.org/show_bug.cgi?id=191904
570
571         This is useless work and it throws warning about use GstDeviceMonitor without filters.
572
573         Reviewed by Philippe Normand.
574
575         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
576         (WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices):
577
578 2018-11-27  Rob Buis  <rbuis@igalia.com>
579
580         Block more ports (427, 548, 6697)
581         https://bugs.webkit.org/show_bug.cgi?id=186092
582
583         Reviewed by Frédéric Wang.
584
585         Block port 427, ports 548 and 6697 are aleady blocked and
586         are tested by the updated request-bad-port.html wpt test.
587
588         Behavior matches Firefox and Chrome.
589
590         Test: web-platform-tests/fetch/api/request/request-bad-port.html
591
592         * platform/URL.cpp:
593         (WebCore::portAllowed):
594
595 2018-11-27  Youenn Fablet  <youenn@apple.com>
596
597         Log WebRTC stats in inspector console only when setting is verbose
598         https://bugs.webkit.org/show_bug.cgi?id=192014
599
600         Reviewed by Eric Carlson.
601
602         Add a WebRTCStats channel that is used by default to output WebRTC stats in console.
603         When WebRTC Debug logging is enabled, log WebRTC stats in WebRTC channel,
604         so that they appear as debug information in Web Inspector.
605
606         No change of JS behavior.
607         Covered by manually testing what is logged in inspector and console.
608
609         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
610         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
611         * platform/Logging.h:
612
613 2018-11-27  Simon Fraser  <simon.fraser@apple.com>
614
615         Fix the mis-spelled "m_clienstWaitingForAsyncDecoding"
616         https://bugs.webkit.org/show_bug.cgi?id=192060
617
618         Reviewed by Wenson Hsieh.
619
620         Fix the mis-spelling of "m_clienstWaitingForAsyncDecoding".
621
622         * loader/cache/CachedImage.cpp:
623         (WebCore::CachedImage::didRemoveClient):
624         (WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
625         (WebCore::CachedImage::addClientWaitingForAsyncDecoding):
626         (WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
627         (WebCore::CachedImage::allClientsRemoved):
628         (WebCore::CachedImage::clear):
629         (WebCore::CachedImage::createImage):
630         (WebCore::CachedImage::imageFrameAvailable):
631         * loader/cache/CachedImage.h:
632
633 2018-11-27  Mark Lam  <mark.lam@apple.com>
634
635         ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac.
636         https://bugs.webkit.org/show_bug.cgi?id=192055
637         <rdar://problem/46288783>
638
639         Reviewed by Saam Barati.
640
641         No new tests needed.  Removing an invalid configuration that is not used in WebCore.
642
643         * Configurations/FeatureDefines.xcconfig:
644
645 2018-11-27  Jiewen Tan  <jiewen_tan@apple.com>
646
647         Remove kCCNotVerified
648         https://bugs.webkit.org/show_bug.cgi?id=192034
649         <rdar://problem/46235863>
650
651         Reviewed by Alexey Proskuryakov.
652
653         No change of behaviours.
654
655         * crypto/CommonCryptoUtilities.h:
656         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
657         (WebCore::verifyRSASSA_PKCS1_v1_5):
658
659 2018-11-27  Simon Fraser  <simon.fraser@apple.com>
660
661         Avoid triggering compositing updates when only the root layer is composited
662         https://bugs.webkit.org/show_bug.cgi?id=191813
663
664         Reviewed by Zalan Bujtas.
665
666         If we know that the only composited layer is the root, we can avoid triggering deep
667         compositing updates sometimes, for example when layout changes size or position,
668         or when z-order lists change.
669
670         * rendering/RenderLayer.cpp:
671         (WebCore::RenderLayer::addChild):
672         (WebCore::RenderLayer::removeChild):
673         (WebCore::RenderLayer::updateLayerPosition):
674         (WebCore::RenderLayer::scrollTo):
675         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
676         (WebCore::outputPaintOrderTreeRecursive):
677         * rendering/RenderLayerCompositor.cpp:
678         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant()
679         flag to cut off descendants traversal when possible.
680         (WebCore::RenderLayerCompositor::layerStyleChanged):
681
682 2018-11-27  Eric Carlson  <eric.carlson@apple.com>
683
684         Refactor duplicate code for calling into media controls
685         https://bugs.webkit.org/show_bug.cgi?id=192040
686         <rdar://problem/46278931>
687
688         Reviewed by Youenn Fablet.
689
690         No new tests, no functional change.
691
692         * html/HTMLMediaElement.cpp:
693         (WebCore::HTMLMediaElement::setupAndCallJS):
694         (WebCore::HTMLMediaElement::updateCaptionContainer):
695         (WebCore::HTMLMediaElement::configureTextTrackDisplay):
696         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
697         (WebCore::HTMLMediaElement::setControllerJSProperty):
698         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
699         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
700         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
701         * html/HTMLMediaElement.h:
702
703 2018-11-27  Simon Fraser  <simon.fraser@apple.com>
704
705         Momentum scrolling ends at the wrong place when a scrolling overflow element has a non-zero border
706         https://bugs.webkit.org/show_bug.cgi?id=191322
707
708         Reviewed by Dean Jackson.
709         
710         The scrolling momentum logic in ScrollController::handleWheelEvent() which computes whether the scroll is pinned
711         to the end makes use of ScrollableArea::visibleContentRect(). RenderLayer's implementation of this was incorrect when
712         the layer's element had borders, causing the momentum scroll to stop early.
713         
714         Fix by using the correct size (visible size, not layer size).
715
716         Test: fast/scrolling/momentum-scroll-with-borders.html
717
718         * rendering/RenderLayer.cpp:
719         (WebCore::RenderLayer::visibleContentRectInternal const):
720
721 2018-11-27  Simon Fraser  <simon.fraser@apple.com>
722
723         Composited and tiled layers fail to update on scrolling in WebView
724         https://bugs.webkit.org/show_bug.cgi?id=191821
725         rdar://problem/46009272
726
727         Reviewed by Zalan Bujtas.
728         
729         We relied on AppKit calling -[NSView viewWillDraw] on scrolling to trigger compositing
730         layer flushes which are necessary to update backing store attachment, and tile coverage
731         for tiled layers. However, we no longer get these reliably in WebView, so explicitly trigger
732         flushes if necessary from FrameView::scrollOffsetChangedViaPlatformWidgetImpl().
733         didChangeVisibleRect() is the same code path used by iOS UIWebView for the same purpose.
734
735         Tests: compositing/backing/backing-store-attachment-scroll.html
736                compositing/tiling/tile-coverage-on-scroll.html
737
738         * page/FrameView.cpp:
739         (WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
740         * platform/graphics/ca/GraphicsLayerCA.cpp:
741         (WebCore::GraphicsLayerCA::updateCoverage):
742
743 2018-11-27  Timothy Hatcher  <timothy@apple.com>
744
745         Web Inspector: Add support for forcing color scheme appearance in DOM tree.
746         https://bugs.webkit.org/show_bug.cgi?id=191820
747         rdar://problem/46153172
748
749         Reviewed by Devin Rousso.
750
751         Test: inspector/css/force-page-appearance.html
752
753         * inspector/InspectorInstrumentation.cpp:
754         (WebCore::InspectorInstrumentation::defaultAppearanceDidChangeImpl):
755         * inspector/InspectorInstrumentation.h:
756         (WebCore::InspectorInstrumentation::defaultAppearanceDidChange):
757         * inspector/agents/InspectorPageAgent.cpp:
758         (WebCore::InspectorPageAgent::enable): Fire defaultAppearanceDidChange() on macOS Majave.
759         (WebCore::InspectorPageAgent::disable): Call setForcedAppearance() with empty string.
760         (WebCore::InspectorPageAgent::defaultAppearanceDidChange): Added.
761         (WebCore::InspectorPageAgent::setForcedAppearance): Added.
762         * inspector/agents/InspectorPageAgent.h:
763         * page/Page.cpp:
764         (WebCore::Page::setUseDarkAppearance): Call InspectorInstrumentation::defaultAppearanceDidChange().
765         (WebCore::Page::useDarkAppearance const): Return override value if not nullopt.
766         (WebCore::Page::setUseDarkAppearanceOverride): Added.
767         * page/Page.h:
768         (WebCore::Page::defaultUseDarkAppearance const): Added.
769
770 2018-11-27  Tim Horton  <timothy_horton@apple.com>
771
772         Serialize and deserialize editable image strokes
773         https://bugs.webkit.org/show_bug.cgi?id=192002
774         <rdar://problem/30900149>
775
776         Reviewed by Dean Jackson.
777
778         Test: editing/images/paste-editable-image.html
779
780         * html/HTMLImageElement.cpp:
781         (WebCore::HTMLImageElement::parseAttribute):
782         (WebCore::HTMLImageElement::insertedIntoAncestor):
783         (WebCore::HTMLImageElement::didFinishInsertingNode):
784         (WebCore::HTMLImageElement::removedFromAncestor):
785         (WebCore::HTMLImageElement::hasEditableImageAttribute const):
786         (WebCore::HTMLImageElement::updateEditableImage):
787         Call updateEditableImage() from didFinishInsertingNode instead of insertedIntoAncestor.
788         This is helpful because it means we get the final, deduplicated attachment identifier
789         instead of the original one when cloning or pasting.
790
791         This also means that isConnected() is now always accurate when updateEditableImage()
792         is called, so we can remove the argument that allowed us to lie from inside insertedIntoAncestor.
793
794         * html/HTMLImageElement.h:
795         * rendering/RenderImage.cpp:
796         (WebCore::RenderImage::isEditableImage const):
797         Make use of hasEditableImage instead of separately checking for the attribute.
798
799 2018-11-16  Jiewen Tan  <jiewen_tan@apple.com>
800
801         Disallow loading webarchives as iframes
802         https://bugs.webkit.org/show_bug.cgi?id=191728
803         <rdar://problem/45524528>
804
805         Reviewed by Youenn Fablet.
806
807         Disallow loading webarchives as iframes. We don't allow loading remote webarchives.
808         Now, this policy is hardened to disallow loading webarchives as iframes for local
809         documents as well.
810
811         To allow old tests still be able to run, a flag is added to always allow loading local
812         webarchives in document. The flag can be set via window.internals.
813
814         Tests: webarchive/loading/test-loading-archive-subresource.html
815                webarchive/loading/test-loading-top-archive.html
816
817         * dom/Document.h:
818         (WebCore::Document::setAlwaysAllowLocalWebarchive):
819         (WebCore::Document::alwaysAllowLocalWebarchive):
820         * loader/DocumentLoader.cpp:
821         (WebCore::disallowWebArchive):
822         (WebCore::DocumentLoader::continueAfterContentPolicy):
823         (WebCore::isRemoteWebArchive): Deleted.
824         * testing/Internals.cpp:
825         (WebCore::Internals::setAlwaysAllowLocalWebarchive const):
826         * testing/Internals.h:
827         * testing/Internals.idl:
828
829 2018-11-27  Jer Noble  <jer.noble@apple.com>
830
831         Unregister CDMSessionMediaSourceAVFObjC for error notifications during destruction.
832         https://bugs.webkit.org/show_bug.cgi?id=191985
833         <rdar://problem/45972018>
834
835         Reviewed by Eric Carlson.
836
837         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
838         (WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC):
839
840 2018-11-27  Thibault Saunier  <tsaunier@igalia.com>
841
842         [GStreamer][WebRTC] Use LibWebRTC provided vp8 decoders and encoders
843         https://bugs.webkit.org/show_bug.cgi?id=191861
844
845         The GStreamer implementations are less feature full and less tested, now that Apple
846         also use the LibWebRTC provided implementations it makes a lot of sense for us to
847         do the same.
848
849         Basically everything related to temporal scalability is not implemented in GStreamer.
850
851         We should make sure to use GStreamer elements on low powered platforms and for
852         accelerated encoders and decoders.
853
854         Reviewed by Philippe Normand.
855
856         This is mostly refactoring, no new test required.
857
858         * platform/graphics/gstreamer/GStreamerCommon.h: Added GstMappedFrame similar to GstMappedBuffer but for video frames.
859         (WebCore::GstMappedFrame::GstMappedFrame):
860         (WebCore::GstMappedFrame::get):
861         (WebCore::GstMappedFrame::ComponentData):
862         (WebCore::GstMappedFrame::ComponentStride):
863         (WebCore::GstMappedFrame::info):
864         (WebCore::GstMappedFrame::width):
865         (WebCore::GstMappedFrame::height):
866         (WebCore::GstMappedFrame::format):
867         (WebCore::GstMappedFrame::~GstMappedFrame):
868         (WebCore::GstMappedFrame::operator bool const):
869         * platform/graphics/gstreamer/GUniquePtrGStreamer.h:
870         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
871         (WebCore::GStreamerVideoFrameLibWebRTC::ToI420): Implemented support for converting frame formats with the GstVideoConverter API
872         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
873         (WebCore::GStreamerVideoDecoder::GstDecoderFactory):
874         (WebCore::GStreamerVideoDecoder::HasGstDecoder):
875         (WebCore::VP8Decoder::Create): Creates a `webrtc::LibvpxVp8Decoder()` if GStreamer decoder would be the LibVPX based one.
876         (WebCore::GStreamerVideoDecoderFactory::CreateVideoDecoder):
877         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
878         (gst_webrtc_video_encoder_class_init):
879         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Stop using vp8enc and use LibWebRTC based implementation
880         (WebCore::GStreamerH264Encoder::GStreamerH264Encoder): Renamed H264Encoder to GStreamerH264Encoder to be more coherent with what is done in LibVPX
881         (WebCore::GStreamerVP8Encoder::GStreamerVP8Encoder): Renamed VP8Encoder to GStreamerVP8Encoder to be more coherent with what is done in LibVPX
882         (WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder):
883         (WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const):
884
885 2018-11-27  Javier Fernandez  <jfernandez@igalia.com>
886
887         [css-grid] align-self center and position sticky don't work together
888         https://bugs.webkit.org/show_bug.cgi?id=191963
889
890         Reviewed by Manuel Rego Casasnovas.
891
892         This is a fix for a regression introduced in r515391, where we landed
893         the implementation of alignment for positioned objects in a Grid Layout
894         container.
895
896         We assumed that items with non-static positions shouldn't honor the
897         CSS Box Alignment properties. This is only true for out-of-flow items,
898         absolute or fixed positioned elements. However, sticky positioned
899         elements are treated as relative positioned items, but they indeed use
900         non-static position to define their behavior.
901
902         No new tests, this change is covered by current tests and make several cases to pass now.
903
904         * rendering/RenderGrid.cpp:
905         (WebCore::RenderGrid::columnAxisPositionForChild const):
906         (WebCore::RenderGrid::rowAxisPositionForChild const):
907
908 2018-11-26  Daniel Bates  <dabates@apple.com>
909
910         REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown
911         https://bugs.webkit.org/show_bug.cgi?id=191969
912         <rdar://problem/46247569>
913
914         Reviewed by Dean Jackson.
915
916         Following r238078 we now support drawing the caps lock indicator in password fields on iOS.
917         However it is not meaningful to show the caps lock indicator when the Strong Password button
918         is visible because the password field is not editable. We should not paint the caps lock
919         indicator when the Strong Password button is visible.
920
921         Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button.html
922                fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html
923
924         * html/TextFieldInputType.cpp:
925         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps
926         lock indicator when the password field has the Strong Password button.
927         (WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to
928         update the visibility of the caps lock indicator when the auto fill button has changed.
929
930 2018-11-26  Ryan Haddad  <ryanhaddad@apple.com>
931
932         Unreviewed, rolling out r238357.
933
934         One of the layout tests added with this change is failing on Mojave.
935
936         Reverted changeset:
937         "REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown"
938         https://bugs.webkit.org/show_bug.cgi?id=191969
939         https://trac.webkit.org/changeset/238513
940
941 2018-11-26  Tim Horton  <timothy_horton@apple.com>
942
943         Insert <attachment> elements under editable images to make their backing data accessible
944         https://bugs.webkit.org/show_bug.cgi?id=191844
945         <rdar://problem/30900149>
946
947         Reviewed by Simon Fraser.
948
949         Test: editing/images/editable-image-creates-attachment.html
950
951         * html/HTMLImageElement.cpp:
952         (WebCore::HTMLImageElement::parseAttribute):
953         (WebCore::HTMLImageElement::insertedIntoAncestor):
954         (WebCore::HTMLImageElement::removedFromAncestor):
955         When the x-apple-editable-image attribute changes, or the element is
956         moved into or out of a document, call updateEditableImage.
957
958         (WebCore::HTMLImageElement::editableImageViewID const):
959         Adopt EditableImageReference.
960
961         (WebCore::HTMLImageElement::updateEditableImage):
962         When the image element moves into a document, the setting is on, and
963         the appropriate attribute is applied, add an <attachment> into the
964         shadow DOM, and inform the UI process both of the editable image's
965         creation and that it should be associated with the new attachment.
966
967         Use an EditableImageReference to extend the lifetime of the
968         corresponding editable image in the UI process, and to communicate
969         the attachment association.
970
971         If the element was cloned from another editable image element, use the
972         EditableImageReference and attachmentID from the original; the embedded
973         view will be re-parented under this element's layer, and the attachment
974         will be cloned (with a new ID) by editing code if the element is parented.
975
976         (WebCore::HTMLImageElement::attachmentIdentifier const):
977         (WebCore::HTMLImageElement::copyNonAttributePropertiesFromElement):
978         Store the aforementioned bits of information when cloned so that we can
979         reconstitute the appropriate attachment data and embedded view.
980
981         * html/HTMLImageElement.h:
982         * page/ChromeClient.h:
983
984         * Sources.txt:
985         * WebCore.xcodeproj/project.pbxproj:
986         * page/EditableImageReference.cpp: Added.
987         (WebCore::EditableImageReference::EditableImageReference):
988         (WebCore::EditableImageReference::~EditableImageReference):
989         (WebCore::EditableImageReference::associateWithAttachment):
990         * page/EditableImageReference.h: Added.
991         (WebCore::EditableImageReference::create):
992         (WebCore::EditableImageReference::embeddedViewID const):
993         Add EditableImageReference, which manages the lifetime of the UI-side
994         EditableImage and helps clients communicate about it. It is refcounted
995         so that cloned <img> elements can potentially borrow the UI-side state
996         (in the case where they end up getting parented).
997
998         * page/NavigatorBase.cpp:
999         Fix an unrelated unified build failure that I exposed.
1000
1001 2018-11-26  Jer Noble  <jer.noble@apple.com>
1002
1003         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
1004         https://bugs.webkit.org/show_bug.cgi?id=190951
1005         <rdar://problem/45213065>
1006
1007         Reviewed by Alex Christensen.
1008
1009         Request the correct route policy and context from the VideoFullscreenModel.
1010
1011         * platform/cocoa/VideoFullscreenModel.h:
1012         (WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID):
1013         * platform/cocoa/VideoFullscreenModelVideoElement.h:
1014         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
1015         (WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID):
1016         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1017         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1018         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
1019         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
1020         (VideoFullscreenInterfaceAVKit::doSetup):
1021
1022 2018-11-24  Ryosuke Niwa  <rniwa@webkit.org>
1023
1024         SVG use element inside a shadow tree cannot reference an element in the same tree
1025         https://bugs.webkit.org/show_bug.cgi?id=174977
1026         <rdar://problem/33665636>
1027
1028         Reviewed by Zalan Bujtas.
1029
1030         Make fragment URL references used by SVGelements within a shadow tree to refer to other elements
1031         in the same shadow tree. To do this, this patch makes targetElementFromIRIString take a TreeScope
1032         instead of a Document, and updates its call sites.
1033
1034         This patch updates the most uses of targetElementFromIRIString except CSS cursor image, altGraph,
1035         and glyphRef since the cursor image isn't really a SVG feature, and there aren't really real world
1036         use cases in which altGraph and glyphRef are used within shadow trees.
1037
1038         Tests: fast/shadow-dom/svg-animate-href-change-in-shadow-tree.html
1039                fast/shadow-dom/svg-animate-href-in-shadow-tree.html
1040                fast/shadow-dom/svg-feimage-href-in-shadow-tree.html
1041                fast/shadow-dom/svg-linear-gradient-href-in-shadow-tree.html
1042                fast/shadow-dom/svg-mpath-href-change-in-shadow-tree.html
1043                fast/shadow-dom/svg-mpath-href-in-shadow-tree.html
1044                fast/shadow-dom/svg-radial-gradient-href-in-shadow-tree.html
1045                fast/shadow-dom/svg-text-path-href-change-in-shadow-tree.html
1046                fast/shadow-dom/svg-text-path-href-in-shadow-tree.html
1047                fast/shadow-dom/svg-thref-href-change-in-shadow-tree.html
1048                fast/shadow-dom/svg-thref-href-in-shadow-tree.html
1049                fast/shadow-dom/svg-use-href-change-in-shadow-tree.html
1050                fast/shadow-dom/svg-use-href-in-shadow-tree.html
1051
1052         * accessibility/AccessibilitySVGElement.cpp:
1053         (WebCore::AccessibilitySVGElement::targetForUseElement const):
1054         * css/CSSCursorImageValue.cpp:
1055         * rendering/svg/RenderSVGTextPath.cpp:
1056         (WebCore::RenderSVGTextPath::layoutPath const):
1057         * svg/SVGAltGlyphElement.cpp:
1058         (WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
1059         * svg/SVGFEImageElement.cpp:
1060         (WebCore::SVGFEImageElement::buildPendingResource):
1061         (WebCore::SVGFEImageElement::build):
1062         * svg/SVGGlyphRefElement.cpp:
1063         (WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
1064         * svg/SVGLinearGradientElement.cpp:
1065         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
1066         * svg/SVGMPathElement.cpp:
1067         (WebCore::SVGMPathElement::buildPendingResource):
1068         (WebCore::SVGMPathElement::pathElement):
1069         * svg/SVGRadialGradientElement.cpp:
1070         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
1071         * svg/SVGTRefElement.cpp:
1072         (WebCore::SVGTRefElement::buildPendingResource):
1073         * svg/SVGTextPathElement.cpp:
1074         (WebCore::SVGTextPathElement::buildPendingResource):
1075         * svg/SVGURIReference.cpp:
1076         (WebCore::SVGURIReference::targetElementFromIRIString):
1077         * svg/SVGURIReference.h:
1078         * svg/SVGUseElement.cpp:
1079         (WebCore::SVGUseElement::updateShadowTree):
1080         (WebCore::SVGUseElement::findTarget const):
1081         * svg/animation/SVGSMILElement.cpp:
1082         (WebCore::SVGSMILElement::buildPendingResource):
1083         (WebCore::SVGSMILElement::insertedIntoAncestor):
1084         * svg/graphics/filters/SVGFEImage.cpp:
1085         (WebCore::FEImage::FEImage):
1086         (WebCore::FEImage::createWithIRIReference):
1087         (WebCore::FEImage::referencedRenderer const):
1088         * svg/graphics/filters/SVGFEImage.h:
1089
1090 2018-11-26  Truitt Savell  <tsavell@apple.com>
1091
1092         Unreviewed, rolling out r238357.
1093
1094         Casued three css tests to fail and crash on ios sim
1095
1096         Reverted changeset:
1097
1098         "Avoid triggering compositing updates when only the root layer
1099         is composited"
1100         https://bugs.webkit.org/show_bug.cgi?id=191813
1101         https://trac.webkit.org/changeset/238357
1102
1103 2018-11-26  Daniel Bates  <dabates@apple.com>
1104
1105         Caret disappears at end of password field when caps lock indicator is shown; password field
1106         not scrolled when caps lock indicator is shown
1107         https://bugs.webkit.org/show_bug.cgi?id=191164
1108         <rdar://problem/45738179>
1109
1110         Reviewed by Dean Jackson.
1111
1112         Fixes an issue where the caret may be occluded by- or paint on top of- the caps lock indicator on
1113         Mac and iOS, respectively.
1114
1115         If there has not been a previous selection in a focused password field, including a caret
1116         selection made by pressing the arrow keys, then we never scroll the password field to reveal
1117         the current selection when the caps lock indicator is made visible. When the caps lock indicator
1118         is made visible or hidden the size of the inner text renderer changes as it shrinks or expands
1119         to make space for the caps lock indicator or to fill the void of the now hidden caps lock indicator,
1120         respectively. We should detect such size changes and schedule an update and reveal of the current
1121         selection after layout.
1122
1123         Test: fast/forms/password-scrolled-after-caps-lock-toggled.html
1124
1125         * editing/FrameSelection.cpp:
1126         (WebCore::FrameSelection::setNeedsSelectionUpdate): Modified to take an enum to override the current
1127         selection reveal mode for the next update.
1128         * editing/FrameSelection.h:
1129         * rendering/RenderTextControlSingleLine.cpp:
1130         (WebCore::RenderTextControlSingleLine::layout): Schedule post-layout a selection update that
1131         reveals the current selection. We pass FrameSelection::RevealSelectionAfterUpdate::Forced to ensure
1132         that the scheduled selection update scrolls to the reveal the current selection regardless of selection
1133         reveal mode. This is necessary because typing into a password field does not change the current
1134         selection reveal mode.
1135
1136 2018-11-26  Daniel Bates  <dabates@apple.com>
1137
1138         Placeholder text is not repainted after caps lock indicator is hidden
1139         https://bugs.webkit.org/show_bug.cgi?id=191968
1140         <rdar://problem/46247234>
1141
1142         Reviewed by Zalan Bujtas.
1143
1144         Fixes an issue where the placeholder text in a password field is not repainted when the
1145         caps lock indicator is hidden.
1146
1147         The placeholder renderer is special. It is an excluded child renderer and does not take
1148         part in normal flow layout. It is also created and destroyed as needed. The caps lock
1149         indicator is also special in that it is implemented as a RenderImage and we do not know
1150         its dimensions before it is loaded and the load happens asynchronously. As a result we
1151         detect when the inner text size changes and mark the placeholder as dirty as a way to
1152         keep the dimensions of the placeholder in sync with the dimensions of the inner text.
1153
1154         Test: fast/repaint/placeholder-after-caps-lock-hidden.html
1155
1156         * rendering/RenderTextControlSingleLine.cpp:
1157         (WebCore::RenderTextControlSingleLine::layout): Mark the placeholder as needing layout
1158         the size of the inner text changes.
1159
1160 2018-11-26  Jeremy Jones  <jeremyj@apple.com>
1161
1162         Picture-in-picture window size changes unnecesarily when URL changes.
1163         https://bugs.webkit.org/show_bug.cgi?id=191787
1164
1165         Reviewed by Jer Noble.
1166
1167         When loading a new URL, the video dimensions are temporarily 0,0. Instead of 
1168         defaulting back to 4:3 sized pip window temporarily, keep the old dimensions until
1169         there is a new valid size.
1170
1171         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1172         (VideoFullscreenInterfaceAVKit::videoDimensionsChanged):
1173
1174 2018-11-26  Andy Estes  <aestes@apple.com>
1175
1176         [Cocoa] Make it easier to encode NSObjects
1177         https://bugs.webkit.org/show_bug.cgi?id=191948
1178
1179         Reviewed by Dean Jackson.
1180
1181         * Modules/applepay/Payment.h: Changed the PKPayment * constructor to take a
1182         RetainPtr<PKPayment>&& instead.
1183         * Modules/applepay/PaymentContact.h: Ditto for PKContact.
1184         * Modules/applepay/PaymentMerchantSession.h: Ditto for PKPaymentMerchantSession.
1185         * Modules/applepay/PaymentMethod.h: Ditto for PKPaymentMethod.
1186         * Modules/applepay/cocoa/PaymentCocoa.mm:
1187         (WebCore::Payment::Payment): Moved definition out-of-line.
1188         (WebCore::Payment::pkPayment const): Ditto.
1189         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1190         (WebCore::PaymentContact::PaymentContact): Ditto.
1191         (WebCore::PaymentContact::pkContact const): Ditto.
1192         * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
1193         (WebCore::PaymentMethod::PaymentMethod): Ditto.
1194         (WebCore::PaymentMethod::pkPaymentMethod const): Ditto.
1195
1196 2018-11-26  Daniel Bates  <dabates@apple.com>
1197
1198         REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown
1199         https://bugs.webkit.org/show_bug.cgi?id=191969
1200         <rdar://problem/46247569>
1201
1202         Reviewed by Dean Jackson.
1203
1204         Following r238078 we now support drawing the caps lock indicator in password fields on iOS.
1205         However it is not meaningful to show the caps lock indicator when the Strong Password button
1206         is visible because the password field is not editable. We should not paint the caps lock
1207         indicator when the Strong Password button is visible.
1208
1209         Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-when-after-hiding-auto-fill-strong-password-button.html
1210                fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html
1211
1212         * html/TextFieldInputType.cpp:
1213         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps
1214         lock indicator when the password field has the Strong Password button.
1215         (WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to
1216         update the visibility of the caps lock indicator when the auto fill button has changed.
1217
1218 2018-11-26  Sam Weinig  <sam@webkit.org>
1219
1220         Streamline ListHashSet use in floating object code
1221         https://bugs.webkit.org/show_bug.cgi?id=191957
1222
1223         Reviewed by Alex Christensen.
1224
1225         Simplify use of ListHashSet by using new raw pointer overloads and
1226         making use of reversed order of template arguments in the find() and
1227         contains() overloads that take hash translators.  
1228
1229         * rendering/FloatingObjects.cpp:
1230         (WebCore::FloatingObjects::remove):
1231         Use raw pointer overloads of contains and remove. Remove seperate call
1232         to find / check agains end() which is unnecessary as remove() already
1233         does that.
1234         
1235         * rendering/FloatingObjects.h:
1236         (WebCore::FloatingObjectHashFunctions::hash):
1237         (WebCore::FloatingObjectHashFunctions::equal):
1238         (WebCore::FloatingObjectHashTranslator::hash):
1239         (WebCore::FloatingObjectHashTranslator::equal):
1240         Add hash()/equal() overloads for the raw pointer cases. As the FIXME
1241         notes, this could be simplified by changing PtrHashBase to use designated
1242         bottleneck functions for hash() and equal().
1243
1244         * rendering/RenderBlockFlow.cpp:
1245         (WebCore::RenderBlockFlow::containsFloat const):
1246         (WebCore::RenderBlockFlow::insertFloatingObject):
1247         (WebCore::RenderBlockFlow::removeFloatingObject):
1248         (WebCore::RenderBlockFlow::hasOverhangingFloat):
1249         (WebCore::RenderBlockFlow::addIntrudingFloats):
1250         Use simplified calls.
1251         
1252         * rendering/RenderBlockLineLayout.cpp:
1253         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1254         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
1255         Use simplified calls.
1256
1257 2018-11-26  Jeremy Jones  <jeremyj@apple.com>
1258
1259         Use Full Screen consistently in localizable strings.
1260         https://bugs.webkit.org/show_bug.cgi?id=190363
1261         rdar://problem/43882333
1262
1263         Reviewed by Jon Lee.
1264
1265         No new tests because only change is to localizable strings.
1266
1267         Rename "Fullscreen" to "Full Screen" in localizable strings for consistency.
1268
1269         * English.lproj/Localizable.strings:
1270         * platform/LocalizedStrings.cpp:
1271         (WebCore::contextMenuItemTagEnterVideoFullscreen):
1272         (WebCore::contextMenuItemTagExitVideoFullscreen):
1273         (WebCore::localizedMediaControlElementHelpText):
1274
1275 2018-11-26  Brent Fulgham  <bfulgham@apple.com>
1276
1277         [Win] Reduce the use of WKSI library calls: CoreAnimation
1278         https://bugs.webkit.org/show_bug.cgi?id=191777
1279         <rdar://problem/46140542>
1280
1281         Reviewed by Zalan Bujtas.
1282
1283         Update the Windows build of WebKit to refer to the SPI headers, rather than WebKitSystemInterface.
1284         Move a small amount of glue code from WKSI to WebCore, and remove any includes or link
1285         directives for WebKitSystemInterface.lib.
1286         
1287         No new tests. No change in behavior.
1288
1289         * platform/graphics/BitmapImage.cpp:
1290         * platform/graphics/ca/win/CACFLayerTreeHost.h:
1291         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1292         (layerTreeHostForLayer):
1293         * platform/graphics/cg/GraphicsContextCG.cpp:
1294         * platform/graphics/cg/PathCG.cpp:
1295         * platform/graphics/cg/PatternCG.cpp:
1296         * platform/graphics/win/WKCAImageQueue.cpp:
1297
1298 2018-11-25  Zalan Bujtas  <zalan@apple.com>
1299
1300         [LFC][IFC] Use float box's margin box to adjust the line constraints.
1301         https://bugs.webkit.org/show_bug.cgi?id=191961
1302
1303         Reviewed by Antti Koivisto.
1304
1305         Test: fast/inline/inline-content-with-float-and-margin.html
1306
1307         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
1308         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
1309         * layout/inlineformatting/InlineFormattingContext.cpp:
1310         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
1311
1312 2018-11-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1313
1314         [GTK] Accessing default web context before gtk_init results in drawing failure (Gtk-WARNING **: drawing failure for widget 'WebKitWebView': invalid value for an input Visual*)
1315         https://bugs.webkit.org/show_bug.cgi?id=150303
1316
1317         Reviewed by Michael Catanzaro.
1318
1319         Ensure gtk has been initialized before trying to get the default display.
1320
1321         * platform/graphics/PlatformDisplay.cpp:
1322         (WebCore::PlatformDisplay::createPlatformDisplay):
1323
1324 2018-11-26  Javier Fernandez  <jfernandez@igalia.com>
1325
1326         [css-grid] absolute positioned child is sized wrongly when using auto-fit, generating spurious collapsed tracks
1327         https://bugs.webkit.org/show_bug.cgi?id=191938
1328
1329         Reviewed by Manuel Rego Casasnovas.
1330
1331         The guttersSize function has a complex logic to compute the gaps in a
1332         specific GridSpan, considering different scenarios of collapsed tracks
1333         for such span.
1334
1335         The first case is avoiding the duplicated gap because of trailing
1336         collapsed tracks.
1337
1338         The second case considered is looking for non-empty tracks before the
1339         GridSpan end, if it points to an empty track, so we must add this gap.
1340
1341         The last case is to consider the gap of non-empty tracks after the
1342         GridSpan end line, if it points to an empty track.
1343
1344         There are several cases that are not considered or incorrectly computed.
1345         This patch addresses those cases; basically, we should only consider gaps
1346         when there are non-empty tracks before and after the collapsed tracks.
1347         Additionally, we should avoid duplicating the gaps size adding both,
1348         before and after non-empty track's gap.
1349
1350         No new tests, this change is covered by current tests and make several cases to pass now.
1351
1352         * rendering/RenderGrid.cpp:
1353         (WebCore::RenderGrid::guttersSize const):
1354
1355 2018-11-26  Manuel Rego Casasnovas  <rego@igalia.com>
1356
1357         [css-grid] Fix grid container sizing under min-content height
1358         https://bugs.webkit.org/show_bug.cgi?id=191889
1359
1360         Reviewed by Javier Fernandez.
1361
1362         The spec is quite clear
1363         (https://drafts.csswg.org/css-sizing/#valdef-width-min-content):
1364           "min-content
1365              If specified for the inline axis, use the min-content inline size;
1366              otherwise behaves as the property’s initial value."
1367
1368         So if a grid container has "height: min-content" it should behave
1369         the same than with "height: auto".
1370
1371         The patch removes computeIntrinsicLogicalContentHeightUsing() in
1372         RenderGrid as we don't need a custom one anymore.
1373         We can also get rid of m_minContentHeight and m_maxContentHeight
1374         attributes that were only used for this logic.
1375
1376         Test: fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html
1377               fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html
1378               imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001.html
1379
1380         * rendering/RenderGrid.cpp:
1381         (WebCore::RenderGrid::layoutBlock):
1382         (WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
1383         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
1384         * rendering/RenderGrid.h:
1385
1386 2018-11-25  Zalan Bujtas  <zalan@apple.com>
1387
1388         [LFC] Remove PointInContainingBlock and PositionInContainingBlock
1389         https://bugs.webkit.org/show_bug.cgi?id=191954
1390
1391         Reviewed by Antti Koivisto.
1392
1393         Use Point and Position instead. Points and positions are by default in the containing block's coordinate system.
1394
1395         * layout/FormattingContextGeometry.cpp:
1396         (WebCore::Layout::contentHeightForFormattingContextRoot):
1397         * layout/LayoutUnits.h:
1398         (WebCore::Layout::Position::operator LayoutUnit const):
1399         (WebCore::Layout::operator<):
1400         (WebCore::Layout::operator==):
1401         * layout/floats/FloatAvoider.cpp:
1402         (WebCore::Layout::FloatAvoider::FloatAvoider):
1403         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
1404         (WebCore::Layout::FloatAvoider::horizontalPositionCandidate):
1405         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
1406         * layout/floats/FloatBox.cpp:
1407         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
1408         (WebCore::Layout::FloatBox::verticalPositionCandidate):
1409         (WebCore::Layout::FloatBox::initialVerticalPosition const):
1410         * layout/floats/FloatingContext.cpp:
1411         (WebCore::Layout::FloatingContext::positionForFloat const):
1412         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
1413         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1414         (WebCore::Layout::FloatingContext::floatingPosition const):
1415         (WebCore::Layout::FloatingPair::horizontalConstraints const):
1416         (WebCore::Layout::FloatingPair::bottom const):
1417         * layout/floats/FloatingContext.h:
1418         * layout/floats/FloatingState.cpp:
1419         (WebCore::Layout::FloatingState::constraints const):
1420         (WebCore::Layout::FloatingState::bottom const):
1421         * layout/floats/FloatingState.h:
1422         (WebCore::Layout::FloatingState::FloatItem::bottom const):
1423         * layout/inlineformatting/InlineFormattingContext.cpp:
1424         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
1425
1426 2018-11-25  Zalan Bujtas  <zalan@apple.com>
1427
1428         [LFC] Rename Layout::Position to Layout::Point
1429         https://bugs.webkit.org/show_bug.cgi?id=191950
1430
1431         Reviewed by Antti Koivisto.
1432
1433         It actually represents a point.
1434
1435         * layout/FormattingContext.cpp:
1436         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
1437         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
1438         * layout/FormattingContext.h:
1439         * layout/LayoutUnits.h:
1440         (WebCore::Layout::Point::Point):
1441         (WebCore::Layout::Point::moveBy):
1442         (WebCore::Layout::Position::operator LayoutPoint const): Deleted.
1443         (WebCore::Layout::Position::Position): Deleted.
1444         (WebCore::Layout::Position::moveBy): Deleted.
1445         * layout/blockformatting/BlockFormattingContext.h:
1446         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1447         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1448         * layout/floats/FloatingState.cpp:
1449         (WebCore::Layout::FloatingState::constraints const):
1450
1451 2018-11-25  Zalan Bujtas  <zalan@apple.com>
1452
1453         [LFC] Floating code should use typed positions (PositionInContextRoot).
1454         https://bugs.webkit.org/show_bug.cgi?id=191949
1455
1456         Reviewed by Antti Koivisto.
1457
1458         Use PositionInContextRoot instead of LayoutUnit.
1459
1460         * layout/floats/FloatingState.cpp:
1461         (WebCore::Layout::FloatingState::constraints const):
1462         (WebCore::Layout::FloatingState::bottom const):
1463         * layout/floats/FloatingState.h:
1464         (WebCore::Layout::FloatingState::leftBottom const):
1465         (WebCore::Layout::FloatingState::rightBottom const):
1466         (WebCore::Layout::FloatingState::bottom const):
1467
1468 2018-11-25  Zalan Bujtas  <zalan@apple.com>
1469
1470         Fix build after r238472.
1471
1472         * layout/inlineformatting/InlineFormattingContext.cpp:
1473         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1474         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1475         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
1476         * layout/inlineformatting/InlineLineBreaker.cpp:
1477         (WebCore::Layout::InlineLineBreaker::textWidth const):
1478
1479 2018-11-25  Tim Horton  <timothy_horton@apple.com>
1480
1481         Make it possible to insert editable images with a gesture
1482         https://bugs.webkit.org/show_bug.cgi?id=191937
1483
1484         Reviewed by Wenson Hsieh.
1485
1486         Tests:
1487             editing/images/redo-insert-editable-image-maintains-strokes.html,
1488             editing/images/undo-insert-editable-image.html,
1489             editing/images/basic-editable-image-from-execCommand.html
1490
1491         * Sources.txt:
1492         * WebCore.xcodeproj/project.pbxproj:
1493         * Source/WebCore/editing/EditorCommand.cpp:
1494         * Source/WebCore/en.lproj/Localizable.strings:
1495         * editing/EditAction.h:
1496         * editing/Editor.cpp:
1497         (WebCore::Editor::insertEditableImage):
1498         * editing/Editor.h:
1499         * editing/InsertEditableImageCommand.cpp: Added.
1500         (WebCore::InsertEditableImageCommand::InsertEditableImageCommand):
1501         (WebCore::InsertEditableImageCommand::doApply):
1502         * editing/InsertEditableImageCommand.h: Added.
1503         (WebCore::InsertEditableImageCommand::create):
1504         * editing/VisibleSelection.cpp:
1505         Add an editor command that inserts an editable image.
1506         It will likely get a bit more complicated, but for now it just inserts
1507         a 100% by 300px editable image.
1508
1509 2018-11-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1510
1511         [Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and WebEditorClient.mm
1512         https://bugs.webkit.org/show_bug.cgi?id=191945
1513
1514         Reviewed by Anders Carlsson.
1515
1516         Run `update-webkit-localizable-strings`.
1517
1518         * en.lproj/Localizable.strings:
1519
1520 2018-11-24  Sam Weinig  <sam@webkit.org>
1521
1522         Remove now unnecessary specialized ListHashSet from InlineItem.h
1523         https://bugs.webkit.org/show_bug.cgi?id=191946
1524
1525         Reviewed by Zalan Bujtas.
1526
1527         Now that ListHashSet supports raw pointer overloads for smart pointers,
1528         we can fix the FIXME in InlineItem.h and remove the specialized ListHashSet
1529         and ListHashSet::find calls.
1530
1531         * layout/inlineformatting/InlineFormattingContext.cpp:
1532         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1533         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1534         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1535         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
1536         * layout/inlineformatting/InlineItem.h:
1537         (WebCore::Layout::InlineItemHashFunctions::hash): Deleted.
1538         (WebCore::Layout::InlineItemHashFunctions::equal): Deleted.
1539         (WebCore::Layout::InlineItemHashTranslator::hash): Deleted.
1540         (WebCore::Layout::InlineItemHashTranslator::equal): Deleted.
1541         * layout/inlineformatting/InlineLineBreaker.cpp:
1542         (WebCore::Layout::InlineLineBreaker::textWidth const):
1543
1544 2018-11-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1545
1546         [Cocoa] Add WKWebView SPI to trigger and remove data detection
1547         https://bugs.webkit.org/show_bug.cgi?id=191918
1548         <rdar://problem/36185051>
1549
1550         Reviewed by Tim Horton.
1551
1552         Add a helper method on DataDetection to remove all data detected links in the given document. See WebKit changes
1553         for more detail.
1554
1555         * editing/cocoa/DataDetection.h:
1556         * editing/cocoa/DataDetection.mm:
1557         (WebCore::DataDetection::removeDataDetectedLinksInDocument):
1558
1559 2018-11-24  Andy Estes  <aestes@apple.com>
1560
1561         [Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function
1562         https://bugs.webkit.org/show_bug.cgi?id=191899
1563
1564         Reviewed by Dean Jackson.
1565
1566         * editing/cocoa/DataDetection.mm:
1567         * editing/cocoa/FontAttributesCocoa.mm:
1568         * editing/cocoa/FontShadowCocoa.mm:
1569         * platform/cocoa/DataDetectorsCoreSoftLink.h:
1570         * platform/graphics/cocoa/ColorCocoa.mm:
1571         * platform/ios/PlatformScreenIOS.mm:
1572
1573 2018-11-23  Jiewen Tan  <jiewen_tan@apple.com>
1574
1575         [WebAuthN] Enable Web Authentication as an experimental feature for macOS
1576         https://bugs.webkit.org/show_bug.cgi?id=191932
1577         rdar://problem/46225210
1578
1579         Reviewed by Brent Fulgham.
1580
1581         Add myself to the contact of Web Authentication.
1582
1583         * features.json:
1584
1585 2018-11-23  Ryosuke Niwa  <rniwa@webkit.org>
1586
1587         REGRESSION (r236785): Nullptr crash in StyledMarkupAccumulator::traverseNodesForSerialization
1588         https://bugs.webkit.org/show_bug.cgi?id=191921
1589
1590         Reviewed by Dean Jackson.
1591
1592         The bug was caused by traverseNodesForSerialization not being able to traverse past the end of shadow root
1593         when skipping children of a node for which enterNode returns false because  it was using NodeTraversal's
1594         nextSkippingChildren instead of a member function which supports traversing the composed tree.
1595
1596         Fixed the crash by using variant of nextSkippingChildren which knows how to traverse past the last node
1597         in a shadow tree. Also added more assertions to help debug issues like this in the future.
1598
1599         Test: editing/pasteboard/copy-paste-across-shadow-boundaries-5.html
1600
1601         * editing/markup.cpp:
1602         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
1603
1604 2018-11-22  Ryosuke Niwa  <rniwa@webkit.org>
1605
1606         Updating href on textPath doesn't update its rendering
1607         https://bugs.webkit.org/show_bug.cgi?id=191920
1608
1609         Reviewed by Dean Jackson.
1610
1611         Fixed the bug by invalidating the RenderSVGResource in SVGTextPathElement::svgAttributeChanged
1612         in addition to updating the pending resources.
1613
1614         Test: svg/text/textpath-reference-update.html
1615
1616         * svg/SVGTextPathElement.cpp:
1617         (WebCore::SVGTextPathElement::svgAttributeChanged):
1618
1619 2018-11-23  Ross Kirsling  <ross.kirsling@sony.com>
1620
1621         Introduce user-defined literal for LayoutUnit
1622         https://bugs.webkit.org/show_bug.cgi?id=191915
1623
1624         Reviewed by Dean Jackson.
1625
1626         * platform/LayoutUnit.h:
1627         Introduce a user-defined literal for LayoutUnit, _lu, replacing the existing "fromPixel" factory function.
1628
1629         * layout/FormattingContextGeometry.cpp:
1630         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1631         * layout/inlineformatting/InlineLineBreaker.cpp:
1632         * page/FrameView.cpp:
1633         * page/FrameViewLayoutContext.h:
1634         * page/Page.cpp:
1635         * page/SpatialNavigation.h:
1636         * platform/ScrollableArea.cpp:
1637         * rendering/EllipsisBox.cpp:
1638         * rendering/FlexibleBoxAlgorithm.cpp:
1639         * rendering/FloatingObjects.cpp:
1640         * rendering/GridLayoutFunctions.cpp:
1641         * rendering/GridTrackSizingAlgorithm.cpp:
1642         * rendering/InlineFlowBox.cpp:
1643         * rendering/InlineTextBox.cpp:
1644         * rendering/LayoutState.h:
1645         * rendering/LogicalSelectionOffsetCaches.h:
1646         * rendering/RenderBlock.cpp:
1647         * rendering/RenderBlock.h:
1648         * rendering/RenderBlockFlow.cpp:
1649         * rendering/RenderBlockFlow.h:
1650         * rendering/RenderBlockLineLayout.cpp:
1651         * rendering/RenderBox.cpp:
1652         * rendering/RenderBoxModelObject.cpp:
1653         * rendering/RenderDeprecatedFlexibleBox.cpp:
1654         * rendering/RenderDeprecatedFlexibleBox.h:
1655         * rendering/RenderElement.cpp:
1656         * rendering/RenderFlexibleBox.cpp:
1657         * rendering/RenderFlexibleBox.h:
1658         * rendering/RenderFragmentContainer.cpp:
1659         * rendering/RenderFragmentedFlow.cpp:
1660         * rendering/RenderGrid.cpp:
1661         * rendering/RenderGrid.h:
1662         * rendering/RenderImage.cpp:
1663         * rendering/RenderLayer.cpp:
1664         * rendering/RenderListMarker.cpp:
1665         * rendering/RenderMultiColumnFlow.cpp:
1666         * rendering/RenderMultiColumnSet.cpp:
1667         * rendering/RenderReplaced.cpp:
1668         * rendering/RenderReplaced.h:
1669         * rendering/RenderRubyRun.h:
1670         * rendering/RenderTable.cpp:
1671         * rendering/RenderTable.h:
1672         * rendering/RenderTableSection.cpp:
1673         * rendering/RenderTheme.cpp:
1674         * rendering/RenderTreeAsText.cpp:
1675         * rendering/RenderView.cpp:
1676         * rendering/RootInlineBox.h:
1677         * rendering/SimpleLineLayout.cpp:
1678         * rendering/SimpleLineLayoutPagination.cpp:
1679         * rendering/TableLayout.h:
1680         * rendering/line/BreakingContext.h:
1681         * rendering/line/LineLayoutState.h:
1682         * rendering/line/LineWidth.h:
1683         * rendering/mathml/MathOperator.cpp:
1684         * rendering/mathml/MathOperator.h:
1685         * rendering/mathml/RenderMathMLBlock.h:
1686         * rendering/mathml/RenderMathMLFraction.cpp:
1687         * rendering/mathml/RenderMathMLFraction.h:
1688         * rendering/mathml/RenderMathMLMath.cpp:
1689         * rendering/mathml/RenderMathMLMath.h:
1690         * rendering/mathml/RenderMathMLMenclose.h:
1691         * rendering/mathml/RenderMathMLOperator.cpp:
1692         * rendering/mathml/RenderMathMLOperator.h:
1693         * rendering/mathml/RenderMathMLPadded.h:
1694         * rendering/mathml/RenderMathMLRoot.cpp:
1695         * rendering/mathml/RenderMathMLRoot.h:
1696         * rendering/mathml/RenderMathMLRow.h:
1697         * rendering/mathml/RenderMathMLScripts.cpp:
1698         * rendering/mathml/RenderMathMLScripts.h:
1699         * rendering/mathml/RenderMathMLSpace.h:
1700         * rendering/mathml/RenderMathMLToken.cpp:
1701         * rendering/mathml/RenderMathMLToken.h:
1702         * rendering/mathml/RenderMathMLUnderOver.h:
1703         * rendering/shapes/ShapeOutsideInfo.cpp:
1704         * rendering/style/CollapsedBorderValue.h:
1705         Update all instances of LayoutUnit(), LayoutUnit(0), LayoutUnit { 0 }, etc. and add any other
1706         literal conversions that will be needed when making non-int LayoutUnit constructors explicit.
1707         For good measure, also mark all default values for LayoutUnit parameters.
1708
1709 2018-11-23  Jim Mason  <jmason@ibinx.com>
1710
1711         [GTK] Scrollbars not following gtk-primary-button-warps-slider setting
1712         https://bugs.webkit.org/show_bug.cgi?id=191067
1713
1714         Updated code per the style guide, removed unreachable break (non-semantic change)
1715
1716         Reviewed by Michael Catanzaro.
1717
1718         * platform/gtk/ScrollbarThemeGtk.cpp:
1719         (WebCore::ScrollbarThemeGtk::handleMousePressEvent):
1720
1721 2018-11-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1722
1723         Enable drag and drop support for iOSMac
1724         https://bugs.webkit.org/show_bug.cgi?id=191818
1725         <rdar://problem/43907454>
1726
1727         Reviewed by Dean Jackson.
1728
1729         Enables drag and drop by default on iOSMac by switching on ENABLE_DATA_INTERACTION and ENABLE_DRAG_SUPPORT. This
1730         enables support for dragging links, text selections, and images, though many advanced features (e.g. custom
1731         pasteboard data) will require additional support from the platform.
1732
1733         * Configurations/FeatureDefines.xcconfig:
1734         * platform/ios/PlatformPasteboardIOS.mm:
1735         (WebCore::PlatformPasteboard::informationForItemAtIndex):
1736         (WebCore::registerItemToPasteboard):
1737         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
1738         * platform/ios/WebItemProviderPasteboard.mm:
1739         (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
1740         (-[WebItemProviderPasteboard numberOfFiles]):
1741
1742         Disable codepaths which attempt to access or set `teamData` or `preferredPresentationStyle` on `NSItemProvider`
1743         in iOSMac, since these are currently unimplemented.
1744
1745 2018-11-23  Zalan Butjas  <zalan@apple.com>
1746
1747         [LFC][IFC] Add support for variable height runs.
1748         https://bugs.webkit.org/show_bug.cgi?id=191925
1749
1750         Reviewed by Antti Koivisto.
1751
1752         https://www.w3.org/TR/CSS22/visudet.html#inline-box-height
1753
1754         10.8 Line height calculations: the 'line-height' and 'vertical-align' properties
1755
1756         The height of each inline-level box in the line box is calculated. For replaced elements, inline-block elements,
1757         and inline-table elements, this is the height of their margin box; for inline boxes, this is their 'line-height'.
1758
1759         The line box height is the distance between the uppermost box top and the lowermost box bottom.
1760
1761         The minimum height consists of a minimum height above the baseline and a minimum depth below it,
1762         exactly as if each line box starts with a zero-width inline box with the element's font and line height properties.
1763         We call that imaginary box a "strut." (The name is inspired by TeX.).
1764
1765         Test: fast/inline/inline-content-with-image-simple.html
1766
1767         * layout/Verification.cpp:
1768         (WebCore::Layout::checkForMatchingNonTextRuns):
1769         (WebCore::Layout::checkForMatchingTextRuns):
1770         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
1771         * layout/inlineformatting/InlineFormattingContext.cpp:
1772         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
1773         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1774         (WebCore::Layout::InlineFormattingContext::createFinalRuns const):
1775         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
1776         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
1777         * layout/inlineformatting/InlineFormattingContext.h:
1778         (WebCore::Layout::InlineFormattingContext::Line::logicalHeight const):
1779         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1780         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
1781         * layout/inlineformatting/InlineRun.h:
1782         (WebCore::Layout::InlineRun::logicalWidth const):
1783         (WebCore::Layout::InlineRun::logicalHeight const):
1784         (WebCore::Layout::InlineRun::setLogicalWidth):
1785         (WebCore::Layout::InlineRun::width const): Deleted.
1786         (WebCore::Layout::InlineRun::height const): Deleted.
1787         (WebCore::Layout::InlineRun::setWidth): Deleted.
1788         * layout/inlineformatting/Line.cpp:
1789         (WebCore::Layout::InlineFormattingContext::Line::init):
1790         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
1791         (WebCore::Layout::InlineFormattingContext::Line::close):
1792         * layout/layouttree/LayoutTreeBuilder.cpp:
1793         (WebCore::Layout::outputInlineRuns):
1794
1795 2018-11-23  Antti Koivisto  <antti@apple.com>
1796
1797         UI side compositing doesn't paint on Mac
1798         https://bugs.webkit.org/show_bug.cgi?id=191908
1799
1800         Reviewed by Tim Horton.
1801
1802         For clarity put RGB10 and RGB10A8 formats behind PLATFORM(IOS_FAMILY). They are not supported on Mac.
1803
1804         * platform/graphics/cocoa/IOSurface.h:
1805         * platform/graphics/cocoa/IOSurface.mm:
1806         (WebCore::IOSurface::IOSurface):
1807         (WebCore::IOSurface::ensurePlatformContext):
1808         (WebCore::IOSurface::format const):
1809         (WebCore::operator<<):
1810
1811 2018-11-23  Javier Fernandez  <jfernandez@igalia.com>
1812
1813         [css-grid] Implement Baseline Alignment for grid items
1814         https://bugs.webkit.org/show_bug.cgi?id=145566
1815
1816         Reviewed by Manuel Rego Casasnovas.
1817
1818         This patch impements the Baseline Self-Alignment feature for grid items according to
1819         the CSS Box Alignment specification [1].
1820
1821         This new layout logic is handled by the Self-Alignment (justify-self and align-self)
1822         and Default-Alignment (justify-items and align-items) CSS properties.
1823
1824         This feature allows users to align the grid items sharing a Baseline Alignment Context,
1825         either row or column contexts, based on their respective baselines.
1826
1827         [1] https://drafts.csswg.org/css-align-3/#baseline-align-self
1828
1829         Tests: fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html
1830                fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html
1831                fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html
1832                fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html
1833                fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html
1834                fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html
1835
1836         * Sources.txt:
1837         * rendering/GridBaselineAlignment.cpp: Added.
1838         (WebCore::GridBaselineAlignment::marginOverForChild const):
1839         (WebCore::GridBaselineAlignment::marginUnderForChild const):
1840         (WebCore::GridBaselineAlignment::logicalAscentForChild const):
1841         (WebCore::GridBaselineAlignment::ascentForChild const):
1842         (WebCore::GridBaselineAlignment::descentForChild const):
1843         (WebCore::GridBaselineAlignment::isDescentBaselineForChild const):
1844         (WebCore::GridBaselineAlignment::isHorizontalBaselineAxis const):
1845         (WebCore::GridBaselineAlignment::isOrthogonalChildForBaseline const):
1846         (WebCore::GridBaselineAlignment::isParallelToBaselineAxisForChild const):
1847         (WebCore::GridBaselineAlignment::baselineGroupForChild const):
1848         (WebCore::GridBaselineAlignment::updateBaselineAlignmentContext):
1849         (WebCore::GridBaselineAlignment::baselineOffsetForChild const):
1850         (WebCore::GridBaselineAlignment::clear):
1851         (WebCore::BaselineGroup::BaselineGroup):
1852         (WebCore::BaselineGroup::update):
1853         (WebCore::BaselineGroup::isOppositeBlockFlow const):
1854         (WebCore::BaselineGroup::isOrthogonalBlockFlow const):
1855         (WebCore::BaselineGroup::isCompatible const):
1856         (WebCore::BaselineContext::BaselineContext):
1857         (WebCore::BaselineContext::sharedGroup const):
1858         (WebCore::BaselineContext::updateSharedGroup):
1859         (WebCore::BaselineContext::findCompatibleSharedGroup):
1860         * rendering/GridBaselineAlignment.h: Added.
1861         (WebCore::BaselineGroup::maxAscent const):
1862         (WebCore::BaselineGroup::maxDescent const):
1863         (WebCore::BaselineGroup::size const):
1864         (WebCore::isBaselinePosition):
1865         (WebCore::GridBaselineAlignment::setBlockFlow):
1866         * rendering/GridLayoutFunctions.h:
1867         * rendering/GridTrackSizingAlgorithm.cpp:
1868         (WebCore::gridAxisForDirection):
1869         (WebCore::gridDirectionForAxis):
1870         (WebCore::GridTrackSizingAlgorithm::availableSpace const):
1871         (WebCore::GridTrackSizingAlgorithm::isIntrinsicSizedGridArea const):
1872         (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
1873         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
1874         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
1875         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1876         (WebCore::GridTrackSizingAlgorithm::canParticipateInBaselineAlignment const):
1877         (WebCore::GridTrackSizingAlgorithm::participateInBaselineAlignment const):
1878         (WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext):
1879         (WebCore::GridTrackSizingAlgorithm::baselineOffsetForChild const):
1880         (WebCore::GridTrackSizingAlgorithm::clearBaselineItemsCache):
1881         (WebCore::GridTrackSizingAlgorithm::cacheBaselineAlignedItem):
1882         (WebCore::GridTrackSizingAlgorithm::copyBaselineItemsCache):
1883         (WebCore::GridTrackSizingAlgorithm::setup):
1884         (WebCore::GridTrackSizingAlgorithm::computeBaselineAlignmentContext):
1885         * rendering/GridTrackSizingAlgorithm.h:
1886         * rendering/RenderBlockFlow.cpp:
1887         (WebCore::RenderBlockFlow::firstLineBaseline const):
1888         * rendering/RenderGrid.cpp:
1889         (WebCore::RenderGrid::layoutBlock):
1890         (WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
1891         (WebCore::RenderGrid::placeItemsOnGrid const):
1892         (WebCore::RenderGrid::performGridItemsPreLayout const):
1893         (WebCore::synthesizedBaselineFromMarginBox):
1894         (WebCore::RenderGrid::isBaselineAlignmentForChild const):
1895         (WebCore::RenderGrid::baselinePosition const):
1896         (WebCore::RenderGrid::firstLineBaseline const):
1897         (WebCore::RenderGrid::inlineBlockBaseline const):
1898         (WebCore::RenderGrid::columnAxisBaselineOffsetForChild const):
1899         (WebCore::RenderGrid::rowAxisBaselineOffsetForChild const):
1900         (WebCore::RenderGrid::columnAxisOffsetForChild const):
1901         (WebCore::RenderGrid::rowAxisOffsetForChild const):
1902         * rendering/RenderGrid.h:
1903
1904 2018-11-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1905
1906         Address post-review feedback after r238438
1907         https://bugs.webkit.org/show_bug.cgi?id=191913
1908
1909         Reviewed by Ryosuke Niwa.
1910
1911         Replace `bool` arguments to `FrameSelection::setSelectedRange`, `Editor::replaceSelectionWithText`, and
1912         `Editor::replaceSelectionWithFragment` with `enum class`es instead. In particular, introduce the following:
1913
1914         FrameSelection::ShouldCloseTyping { No, Yes }
1915         Editor::SelectReplacement { No, Yes }
1916         Editor::SmartReplace { No, Yes }
1917         Editor::MatchStyle { No, Yes }
1918
1919         * accessibility/AccessibilityObject.cpp:
1920         (WebCore::AccessibilityObject::selectText):
1921         * editing/Editor.cpp:
1922         (WebCore::Editor::handleTextEvent):
1923         (WebCore::Editor::replaceSelectionWithFragment):
1924         (WebCore::Editor::replaceSelectionWithText):
1925         (WebCore::Editor::setComposition):
1926         (WebCore::Editor::markMisspellingsAfterTypingToWord):
1927         (WebCore::Editor::changeBackToReplacedString):
1928         (WebCore::Editor::transpose):
1929         (WebCore::Editor::insertAttachment):
1930
1931         At various call sites, replace boolean arguments with named enums.
1932
1933         * editing/Editor.h:
1934         * editing/EditorCommand.cpp:
1935         (WebCore::expandSelectionToGranularity):
1936         (WebCore::executeDeleteToMark):
1937         (WebCore::executeSelectToMark):
1938         * editing/FrameSelection.cpp:
1939         (WebCore::FrameSelection::setSelectedRange):
1940         * editing/FrameSelection.h:
1941         * page/Page.cpp:
1942         (WebCore::replaceRanges):
1943
1944         Avoid a bit of ref-count churn, and adjust a few functions to take `const Vector&`s instead of `Vector&&`s.
1945
1946         (WebCore::Page::replaceRangesWithText):
1947         (WebCore::Page::replaceSelectionWithText):
1948         * page/Page.h:
1949
1950 2018-11-21  Ryosuke Niwa  <rniwa@webkit.org>
1951
1952         Modernize SVGURIReference::targetElementFromIRIString
1953         https://bugs.webkit.org/show_bug.cgi?id=191898
1954
1955         Reviewed by Daniel Bates.
1956
1957         Made targetElementFromIRIString return an element and the fragment identifier,
1958         and merged urlFromIRIStringWithFragmentIdentifier into it.
1959
1960         Also replaced the code computing the full URL using the base URL after removing
1961         the fragment identifier and rejoining it later with a single call to completeURL.
1962
1963         No new tests since there should be no observable behavior change.
1964
1965         * accessibility/AccessibilitySVGElement.cpp:
1966         (WebCore::AccessibilitySVGElement::targetForUseElement const):
1967         * css/CSSCursorImageValue.cpp:
1968         (WebCore::CSSCursorImageValue::updateCursorElement):
1969         * rendering/svg/RenderSVGTextPath.cpp:
1970         (WebCore::RenderSVGTextPath::layoutPath const):
1971         * svg/SVGAltGlyphElement.cpp:
1972         (WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
1973         * svg/SVGFEImageElement.cpp:
1974         (WebCore::SVGFEImageElement::buildPendingResource):
1975         * svg/SVGGlyphRefElement.cpp:
1976         (WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
1977         * svg/SVGLinearGradientElement.cpp:
1978         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
1979         * svg/SVGMPathElement.cpp:
1980         (WebCore::SVGMPathElement::buildPendingResource):
1981         (WebCore::SVGMPathElement::pathElement):
1982         * svg/SVGRadialGradientElement.cpp:
1983         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
1984         * svg/SVGTRefElement.cpp:
1985         (WebCore::SVGTRefElement::detachTarget):
1986         (WebCore::SVGTRefElement::buildPendingResource):
1987         * svg/SVGTextPathElement.cpp:
1988         (WebCore::SVGTextPathElement::buildPendingResource):
1989         * svg/SVGURIReference.cpp:
1990         (WebCore::SVGURIReference::targetElementFromIRIString):
1991         (WebCore::urlFromIRIStringWithFragmentIdentifier): Deleted.
1992         * svg/SVGURIReference.h:
1993         * svg/SVGUseElement.cpp:
1994         (WebCore::SVGUseElement::findTarget const):
1995         * svg/animation/SVGSMILElement.cpp:
1996         (WebCore::SVGSMILElement::buildPendingResource):
1997         * svg/graphics/filters/SVGFEImage.cpp:
1998         (WebCore::FEImage::referencedRenderer const):
1999
2000 2018-11-22  Dean Jackson  <dino@apple.com>
2001
2002         Implement WebGPUQueue and device.getQueue()
2003         https://bugs.webkit.org/show_bug.cgi?id=191911
2004         <rdar://problem/46214871>
2005
2006         Reviewed by Antoine Quint.
2007
2008         Implement WebGPUDevice::getQueue(), which creates a WebGPUQueue
2009         instance if necessary. Also link WebGPUQueue to the existing
2010         GPUQueue object, and expose the label IDL property.
2011
2012         This patch is based on some work from Justin Fan.
2013
2014         Test: webgpu/queue-creation.html
2015
2016         * DerivedSources.make:
2017         * Sources.txt:
2018         * WebCore.xcodeproj/project.pbxproj:
2019             New files.
2020
2021         * Modules/webgpu/WebGPUCommandBuffer.h:
2022         (WebCore::WebGPUCommandBuffer::commandBuffer const):
2023             Expose a GPUCommandBuffer getter, used when submitting (even though
2024             the actual GPU submission isn't implemented yet).
2025
2026         * Modules/webgpu/WebGPUDevice.cpp:
2027         (WebCore::WebGPUDevice::getQueue):
2028         * Modules/webgpu/WebGPUDevice.h:
2029         * Modules/webgpu/WebGPUDevice.idl:
2030             Implement getQueue().
2031
2032         * Modules/webgpu/WebGPUQueue.cpp:
2033         (WebCore::WebGPUQueue::create):
2034         (WebCore::WebGPUQueue::WebGPUQueue):
2035         (WebCore::WebGPUQueue::submit):
2036         * Modules/webgpu/WebGPUQueue.h:
2037         (WebCore::WebGPUQueue::label const):
2038         (WebCore::WebGPUQueue::setLabel):
2039         * Modules/webgpu/WebGPUQueue.idl:
2040             New class. Mostly sends stuff onto GPUQueue.
2041
2042         * bindings/js/WebCoreBuiltinNames.h:
2043             Add WebGPUQueue.
2044
2045         * platform/graphics/gpu/GPUQueue.h:
2046         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2047         (WebCore::GPUQueue::create):
2048         (WebCore::GPUQueue::submit):
2049         (WebCore::GPUQueue::label const):
2050         (WebCore::GPUQueue::setLabel const):
2051             "label" getter/setter that uses
2052             the underlying MTLCommandQueue label property, but prefixes
2053             it with a WebKit identifier, so it can be correctly
2054             identified in system crash logs as coming from WebGPU.
2055
2056 2018-11-22  Zalan Bujtas  <zalan@apple.com>
2057
2058         [LFC][IFC] Merge addNonBreakableStart/NonBreakableEnd calls.
2059         https://bugs.webkit.org/show_bug.cgi?id=191903
2060
2061         Reviewed by Antti Koivisto.
2062
2063         * layout/inlineformatting/InlineFormattingContext.cpp:
2064         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2065
2066 2018-11-22  Zalan Bujtas  <zalan@apple.com>
2067
2068         [LFC][IFC] Offset formatting context root runs with horizontal margins.
2069         https://bugs.webkit.org/show_bug.cgi?id=191900
2070
2071         Reviewed by Antti Koivisto.
2072
2073         Inline runs generated by formatting roots (inline-block) need to be adjusted with the horizontal margins.
2074         (The test case has padding and border as well, but they are _inside_ the formatting context.)
2075
2076         Test: fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html
2077
2078         * layout/inlineformatting/InlineFormattingContext.cpp:
2079         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2080
2081 2018-11-22  Simon Fraser  <simon.fraser@apple.com>
2082
2083         Extremely small monospace text size when SVG is included as an img
2084         https://bugs.webkit.org/show_bug.cgi?id=191834
2085
2086         Reviewed by Myles C. Maxfield.
2087
2088         Give defaultFixedFontSize a reasonable default value in Settings, so that clients
2089         who omit to set it (like SVGImages) don't get broken rendering.
2090
2091         Test: svg/text/monospace-text-size-in-img.html
2092
2093         * page/Settings.yaml:
2094
2095 2018-11-22  Javier Fernandez  <jfernandez@igalia.com>
2096
2097         Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline
2098         https://bugs.webkit.org/show_bug.cgi?id=191881
2099
2100         Reviewed by Manuel Rego Casasnovas.
2101
2102         We should use the font's descent value when wriring-mode flips line flow (vertical-lr).
2103
2104         This change also fixes bug 170175, since Flexbox use the same code to determine the first
2105         line baseline of a flex item.
2106
2107         Test: fast/writing-mode/vertical-align-table-baseline-latin.html
2108
2109         * rendering/RenderBlockFlow.cpp:
2110         (WebCore::RenderBlockFlow::firstLineBaseline const):
2111
2112 2018-11-21  Ryosuke Niwa  <rniwa@webkit.org>
2113
2114         Phantom focus/blur events fire on clicking between text input fields when listening with addEventListener
2115         https://bugs.webkit.org/show_bug.cgi?id=179990
2116
2117         Reviewed by Tim Horton.
2118
2119         The bug was caused by TemporarySelectionChange which is used by TextIndicator::createWithRange
2120         to set and restore the selection putting the focus on the newly mouse-down'ed input element
2121         and restoring the focus back to the input element which originally had the focus immediately.
2122
2123         Fixed the bug by avoiding to set the focus since only selection highlights need to be updated here.
2124         Also made TemporarySelectionOption an enum class.
2125
2126         Unfortunately, no new tests since force click testing is broken :( See <rdar://problem/31301721>.
2127
2128         * editing/Editor.cpp:
2129         (WebCore::TemporarySelectionChange::TemporarySelectionChange):
2130         (WebCore::TemporarySelectionChange::~TemporarySelectionChange):
2131         (WebCore::TemporarySelectionChange::setSelection): Extracted. Fixed the bug by adding
2132         FrameSelection::DoNotSetFocus to the option when TemporarySelectionOption::DoNotSetFocus is set.
2133         * editing/Editor.h:
2134         * page/DragController.cpp:
2135         (WebCore::DragController::performDragOperation):
2136         * page/TextIndicator.cpp:
2137         (WebCore::TextIndicator::createWithRange): Set TemporarySelectionOption::DoNotSetFocus.
2138
2139 2018-11-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2140
2141         [Cocoa] [WebKit2] Add support for replacing find-in-page text matches
2142         https://bugs.webkit.org/show_bug.cgi?id=191786
2143         <rdar://problem/45813871>
2144
2145         Reviewed by Ryosuke Niwa.
2146
2147         Add support for replacing Find-in-Page matches. See below for details. Covered by new layout tests as well as a
2148         new API test.
2149
2150         Tests: editing/find/find-and-replace-adjacent-words.html
2151                editing/find/find-and-replace-at-editing-boundary.html
2152                editing/find/find-and-replace-basic.html
2153                editing/find/find-and-replace-in-subframes.html
2154                editing/find/find-and-replace-no-matches.html
2155                editing/find/find-and-replace-noneditable-matches.html
2156                editing/find/find-and-replace-replacement-text-input-events.html
2157
2158         API test: WebKit.FindAndReplace
2159
2160         * page/Page.cpp:
2161         (WebCore::replaceRanges):
2162         (WebCore::Page::replaceRangesWithText):
2163
2164         Add a helper that, given a list of Ranges, replaces each range with the given text. To do this, we first map
2165         each Range to editing offsets within the topmost editable root for each Range. This results in a map of editable
2166         root to list of editing offsets we need to replace. To apply the replacements, for each editable root in the
2167         map, we iterate over each replacement range (i.e. an offset and length), set the current selection to contain
2168         that replacement range, and use `Editor::replaceSelectionWithText`. To prevent prior text replacements from
2169         clobbering the offsets of latter text replacement ranges, we also iterate backwards through text replacement
2170         ranges when performing each replacement.
2171
2172         Likewise, we also apply text replacement to each editing container in backwards order: for nodes in the same
2173         frame, we compare their position in the document, and for nodes in different frames, we instead compare their
2174         frames in frame tree traversal order.
2175
2176         We map Ranges to editing offsets and back when performing text replacement because each text replacement may
2177         split or merge text nodes, which causes adjacent Ranges to shrink or extend while replacing text. In an earlier
2178         attempt to implement this, I simply iterated over each Range to replace and carried out text replacement for
2179         each Range. This led to incorrect behavior in some cases, such as replacing adjacent matches. Thus, by computing
2180         the set of text replacement offsets prior to replacing any text, we're able to target the correct ranges for
2181         replacement.
2182
2183         (WebCore::Page::replaceSelectionWithText):
2184
2185         Add a helper method on Page to replace the current selection with some text. This simply calls out to
2186         `Editor::replaceSelectionWithText`.
2187
2188         * page/Page.h:
2189
2190 2018-11-21  Andy Estes  <aestes@apple.com>
2191
2192         [Cocoa] Create a soft-linking file for PassKit
2193         https://bugs.webkit.org/show_bug.cgi?id=191875
2194         <rdar://problem/46203215>
2195
2196         Reviewed by Myles Maxfield.
2197
2198         * Modules/applepay/cocoa/PaymentContactCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
2199         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm: Ditto.
2200         * SourcesCocoa.txt: Removed @no-unify from PaymentMerchantSessionCocoa.mm.
2201         * WebCore.xcodeproj/project.pbxproj: Removed PaymentMerchantSessionCocoa.mm from the WebCore target.
2202         * rendering/RenderThemeCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
2203
2204 2018-11-21  Zalan Bujtas  <zalan@apple.com>
2205
2206         [LFC] LayoutState should always be initialized with the initial containing block.
2207         https://bugs.webkit.org/show_bug.cgi?id=191896
2208
2209         Reviewed by Antti Koivisto.
2210
2211         There should always be only one LayoutState per layout tree (it does not mean that layout always starts at the ICB).
2212         The ICB is a special formatting context root because it does not have a parent formatting context. All the other formatting contexts
2213         first need to be laid out (partially at least e.g margin) in their parent formatting context.
2214         Having a non-null parent formatting context as root could lead to undefined behaviour.
2215
2216         * layout/LayoutFormattingState.cpp:
2217         (WebCore::Layout::LayoutState::LayoutState):
2218         (WebCore::Layout::LayoutState::initializeRoot): Deleted.
2219         * layout/LayoutFormattingState.h:
2220         * layout/Verification.cpp:
2221         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
2222         * page/FrameViewLayoutContext.cpp:
2223         (WebCore::layoutUsingFormattingContext):
2224
2225 2018-11-21  Zalan Bujtas  <zalan@apple.com>
2226
2227         [LFC][IFC] Horizontal margins should be considered as non-breakable space
2228         https://bugs.webkit.org/show_bug.cgi?id=191894
2229
2230         Reviewed by Antti Koivisto.
2231
2232         Like padding and border, horizontal margins also force run breaks and offset them.
2233
2234         Test: fast/inline/inline-content-with-margin-left-right.html
2235
2236         * layout/inlineformatting/InlineFormattingContext.cpp:
2237         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2238
2239 2018-11-20  Ryosuke Niwa  <rniwa@webkit.org>
2240
2241         Mutation observers doesn't get notified of character data mutation made by the parser
2242         https://bugs.webkit.org/show_bug.cgi?id=191874
2243
2244         Reviewed by Antti Koivisto.
2245
2246         Fixed the bug that CharacterData::parserAppendData was never notifying MutationObserver.
2247
2248         Test: fast/dom/MutationObserver/observe-parser-character-data-change.html
2249
2250         * dom/CharacterData.cpp:
2251         (WebCore::CharacterData::parserAppendData):
2252
2253 2018-11-21  Claudio Saavedra  <csaavedra@igalia.com>
2254
2255         [SOUP] Follow-up robustness improvements to the certificate decoder
2256         https://bugs.webkit.org/show_bug.cgi?id=191892
2257
2258         Reviewed by Michael Catanzaro.
2259
2260         If at any point the certificate fails to be constructed from
2261         the DER data, bail out. Likewise, if the certificate returned
2262         is NULL, return false from the decoder to notify the failure
2263         to decode it.
2264
2265         * platform/network/soup/CertificateInfo.h:
2266         (WTF::Persistence::certificateFromCertificatesDataList):
2267         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
2268
2269 2018-11-21  Zalan Bujtas  <zalan@apple.com>
2270
2271         [LFC][IFC] Border should be considered as non-breakable space
2272         https://bugs.webkit.org/show_bug.cgi?id=191891
2273
2274         Reviewed by Antti Koivisto.
2275
2276         Like padding, border also forces run breaks and offsets them.
2277
2278         Test: fast/inline/inline-content-with-border-left-right.html
2279
2280         * layout/inlineformatting/InlineFormattingContext.cpp:
2281         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2282
2283 2018-11-21  Zalan Bujtas  <zalan@apple.com>
2284
2285         [LFC][IFC] Use contains and containsAll in InlineFormattingContext::splitInlineRunIfNeeded consistently
2286         https://bugs.webkit.org/show_bug.cgi?id=191890
2287
2288         Rearrange the comment numbers to match the logic below.
2289
2290         Reviewed by Antti Koivisto.
2291
2292         * layout/inlineformatting/InlineFormattingContext.cpp:
2293         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2294
2295 2018-11-20  Dean Jackson  <dino@apple.com>
2296
2297         Move WebGPU platform code to platform/graphics/gpu
2298         https://bugs.webkit.org/show_bug.cgi?id=191867
2299         <rdar://problem/46190993>
2300
2301         Reviewed by Antoine Quint.
2302
2303         The underlying implementation of WebGPU doesn't need to live in
2304         Modules, since it technically could be used by other parts of the system. It
2305         makes more sense for it to be in platform/graphics/gpu.
2306
2307         Move...
2308         - Modules/webgpu/GPU* -> platform/graphics/gpu
2309         - Modules/webgpu/cocoa -> platform/graphics/gpu/cocoa
2310         - platform/graphics/gpu/GPULegacy* -> platform/graphics/gpu/legacy/
2311         - platform/graphics/gpu/cocoa/GPULegacy* -> platform/graphics/gpu/legacy/cocoa
2312
2313         * Sources.txt:
2314         * SourcesCocoa.txt:
2315         * WebCore.xcodeproj/project.pbxproj:
2316         * platform/graphics/gpu/GPUCommandBuffer.h: Renamed from Source/WebCore/Modules/webgpu/GPUCommandBuffer.h.
2317         * platform/graphics/gpu/GPUDevice.cpp: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.cpp.
2318         (WebCore::GPUDevice::createShaderModule const):
2319         (WebCore::GPUDevice::createRenderPipeline const):
2320         (WebCore::GPUDevice::createCommandBuffer):
2321         (WebCore::GPUDevice::getQueue):
2322         * platform/graphics/gpu/GPUDevice.h: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.h.
2323         (WebCore::GPUDevice::platformDevice const):
2324         * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineDescriptorBase.h.
2325         * platform/graphics/gpu/GPUPipelineStageDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineStageDescriptor.h.
2326         * platform/graphics/gpu/GPUQueue.h: Renamed from Source/WebCore/Modules/webgpu/GPUQueue.h.
2327         (WebCore::GPUQueue::platformQueue const):
2328         * platform/graphics/gpu/GPURenderPipeline.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipeline.h.
2329         (WebCore::GPURenderPipeline::platformRenderPipeline const):
2330         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipelineDescriptor.h.
2331         * platform/graphics/gpu/GPUShaderModule.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModule.h.
2332         (WebCore::GPUShaderModule::platformShaderModule const):
2333         * platform/graphics/gpu/GPUShaderModuleDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModuleDescriptor.h.
2334         * platform/graphics/gpu/GPUSwapChain.h: Renamed from Source/WebCore/Modules/webgpu/GPUSwapChain.h.
2335         (WebCore::GPUSwapChain::platformLayer const):
2336         * platform/graphics/gpu/GPUTexture.h: Renamed from Source/WebCore/Modules/webgpu/GPUTexture.h.
2337         * platform/graphics/gpu/GPUTextureFormatEnum.h: Renamed from Source/WebCore/Modules/webgpu/GPUTextureFormatEnum.h.
2338         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUCommandBufferMetal.mm.
2339         (WebCore::GPUCommandBuffer::create):
2340         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
2341         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUDeviceMetal.mm.
2342         (WebCore::GPUDevice::create):
2343         (WebCore::GPUDevice::GPUDevice):
2344         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUQueueMetal.mm.
2345         (WebCore::GPUQueue::create):
2346         (WebCore::GPUQueue::GPUQueue):
2347         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipelineMetal.mm.
2348         (WebCore::setFunctionsForPipelineDescriptor):
2349         (WebCore::GPURenderPipeline::create):
2350         (WebCore::GPURenderPipeline::GPURenderPipeline):
2351         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUShaderModuleMetal.mm.
2352         (WebCore::GPUShaderModule::create):
2353         (WebCore::GPUShaderModule::GPUShaderModule):
2354         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChainMetal.mm.
2355         (WebCore::GPUSwapChain::create):
2356         (WebCore::GPUSwapChain::GPUSwapChain):
2357         (WebCore::GPUSwapChain::setDevice):
2358         (WebCore::platformTextureFormatForGPUTextureFormat):
2359         (WebCore::GPUSwapChain::setFormat):
2360         (WebCore::GPUSwapChain::reshape):
2361         (WebCore::GPUSwapChain::getNextTexture):
2362         (WebCore::GPUSwapChain::present):
2363         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUTextureMetal.mm.
2364         (WebCore::GPUTexture::create):
2365         (WebCore::GPUTexture::GPUTexture):
2366         (WebCore::GPUTexture::createDefaultTextureView):
2367         * platform/graphics/gpu/legacy/GPULegacyBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.cpp.
2368         (WebCore::GPULegacyBuffer::~GPULegacyBuffer):
2369         (WebCore::GPULegacyBuffer::length const):
2370         * platform/graphics/gpu/legacy/GPULegacyBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.h.
2371         (WebCore::GPULegacyBuffer::contents const):
2372         (WebCore::GPULegacyBuffer::metal const):
2373         * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.cpp.
2374         (WebCore::GPULegacyCommandBuffer::~GPULegacyCommandBuffer):
2375         * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.h.
2376         (WebCore::GPULegacyCommandBuffer::metal const):
2377         * platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.cpp.
2378         (WebCore::GPULegacyCommandQueue::~GPULegacyCommandQueue):
2379         * platform/graphics/gpu/legacy/GPULegacyCommandQueue.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.h.
2380         (WebCore::GPULegacyCommandQueue::metal const):
2381         * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.cpp.
2382         (WebCore::GPULegacyComputeCommandEncoder::~GPULegacyComputeCommandEncoder):
2383         * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.h.
2384         * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.cpp.
2385         (WebCore::GPULegacyComputePipelineState::~GPULegacyComputePipelineState):
2386         * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.h.
2387         (WebCore::GPULegacyComputePipelineState::metal const):
2388         * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.cpp.
2389         (WebCore::GPULegacyDepthStencilDescriptor::~GPULegacyDepthStencilDescriptor):
2390         * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.h.
2391         (WebCore::GPULegacyDepthStencilDescriptor::metal const):
2392         * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.cpp.
2393         (WebCore::GPULegacyDepthStencilState::~GPULegacyDepthStencilState):
2394         * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.h.
2395         (WebCore::GPULegacyDepthStencilState::metal const):
2396         * platform/graphics/gpu/legacy/GPULegacyDevice.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.cpp.
2397         (WebCore::GPULegacyDevice::~GPULegacyDevice):
2398         * platform/graphics/gpu/legacy/GPULegacyDevice.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.h.
2399         (WebCore::GPULegacyDevice::layer const):
2400         (WebCore::GPULegacyDevice::metal const):
2401         (WebCore::GPULegacyDevice::markLayerComposited const):
2402         * platform/graphics/gpu/legacy/GPULegacyDrawable.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.cpp.
2403         (WebCore::GPULegacyDrawable::~GPULegacyDrawable):
2404         * platform/graphics/gpu/legacy/GPULegacyDrawable.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.h.
2405         * platform/graphics/gpu/legacy/GPULegacyEnums.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyEnums.h.
2406         * platform/graphics/gpu/legacy/GPULegacyFunction.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.cpp.
2407         (WebCore::GPULegacyFunction::~GPULegacyFunction):
2408         * platform/graphics/gpu/legacy/GPULegacyFunction.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.h.
2409         (WebCore::GPULegacyFunction::metal const):
2410         * platform/graphics/gpu/legacy/GPULegacyLibrary.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.cpp.
2411         (WebCore::GPULegacyLibrary::~GPULegacyLibrary):
2412         * platform/graphics/gpu/legacy/GPULegacyLibrary.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.h.
2413         (WebCore::GPULegacyLibrary::metal const):
2414         * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.cpp.
2415         (WebCore::GPULegacyRenderCommandEncoder::~GPULegacyRenderCommandEncoder):
2416         * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.h.
2417         * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.cpp.
2418         (WebCore::GPULegacyRenderPassAttachmentDescriptor::~GPULegacyRenderPassAttachmentDescriptor):
2419         * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.h.
2420         * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.cpp.
2421         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::~GPULegacyRenderPassColorAttachmentDescriptor):
2422         * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.h.
2423         * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.cpp.
2424         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::~GPULegacyRenderPassDepthAttachmentDescriptor):
2425         * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.h.
2426         * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.cpp.
2427         (WebCore::GPULegacyRenderPassDescriptor::~GPULegacyRenderPassDescriptor):
2428         * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.h.
2429         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp.
2430         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::~GPULegacyRenderPipelineColorAttachmentDescriptor):
2431         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.h.
2432         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.cpp.
2433         (WebCore::GPULegacyRenderPipelineDescriptor::~GPULegacyRenderPipelineDescriptor):
2434         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.h.
2435         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.cpp.
2436         (WebCore::GPULegacyRenderPipelineState::~GPULegacyRenderPipelineState):
2437         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.h.
2438         * platform/graphics/gpu/legacy/GPULegacySize.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacySize.h.
2439         * platform/graphics/gpu/legacy/GPULegacyTexture.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.cpp.
2440         (WebCore::GPULegacyTexture::~GPULegacyTexture):
2441         * platform/graphics/gpu/legacy/GPULegacyTexture.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.h.
2442         * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.cpp.
2443         (WebCore::GPULegacyTextureDescriptor::~GPULegacyTextureDescriptor):
2444         * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.h.
2445         * platform/graphics/gpu/legacy/cocoa/GPULegacyBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyBufferMetal.mm.
2446         (WebCore::GPULegacyBuffer::GPULegacyBuffer):
2447         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandBufferMetal.mm.
2448         (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
2449         (WebCore::GPULegacyCommandBuffer::presentDrawable const):
2450         (WebCore::GPULegacyCommandBuffer::commit const):
2451         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandQueueMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandQueueMetal.mm.
2452         (WebCore::GPULegacyCommandQueue::GPULegacyCommandQueue):
2453         (WebCore::GPULegacyCommandQueue::label const):
2454         (WebCore::GPULegacyCommandQueue::setLabel const):
2455         * platform/graphics/gpu/legacy/cocoa/GPULegacyComputeCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputeCommandEncoderMetal.mm.
2456         (WebCore::MTLSizeMake):
2457         (WebCore::GPULegacyComputeCommandEncoder::GPULegacyComputeCommandEncoder):
2458         (WebCore::GPULegacyComputeCommandEncoder::setComputePipelineState const):
2459         (WebCore::GPULegacyComputeCommandEncoder::setBuffer const):
2460         (WebCore::GPULegacyComputeCommandEncoder::dispatch const):
2461         (WebCore::GPULegacyComputeCommandEncoder::endEncoding const):
2462         * platform/graphics/gpu/legacy/cocoa/GPULegacyComputePipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputePipelineStateMetal.mm.
2463         (WebCore::GPULegacyComputePipelineState::GPULegacyComputePipelineState):
2464         * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilDescriptorMetal.mm.
2465         (WebCore::GPULegacyDepthStencilDescriptor::GPULegacyDepthStencilDescriptor):
2466         (WebCore::GPULegacyDepthStencilDescriptor::depthWriteEnabled const):
2467         (WebCore::GPULegacyDepthStencilDescriptor::setDepthWriteEnabled const):
2468         (WebCore::GPULegacyDepthStencilDescriptor::depthCompareFunction const):
2469         (WebCore::GPULegacyDepthStencilDescriptor::setDepthCompareFunction const):
2470         * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilStateMetal.mm.
2471         (WebCore::GPULegacyDepthStencilState::GPULegacyDepthStencilState):
2472         (WebCore::GPULegacyDepthStencilState::label const):
2473         (WebCore::GPULegacyDepthStencilState::setLabel const):
2474         * platform/graphics/gpu/legacy/cocoa/GPULegacyDeviceMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDeviceMetal.mm.
2475         (WebCore::GPULegacyDevice::GPULegacyDevice):
2476         (WebCore::GPULegacyDevice::disconnect):
2477         (WebCore::GPULegacyDevice::reshape const):
2478         (WebCore::GPULegacyDevice::platformLayer const):
2479         (WebCore::GPULegacyDevice::operator! const):
2480         * platform/graphics/gpu/legacy/cocoa/GPULegacyDrawableMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDrawableMetal.mm.
2481         (WebCore::GPULegacyDrawable::GPULegacyDrawable):
2482         (WebCore::GPULegacyDrawable::release):
2483         (WebCore::GPULegacyDrawable::metal const):
2484         (WebCore::GPULegacyDrawable::texture const):
2485         * platform/graphics/gpu/legacy/cocoa/GPULegacyFunctionMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyFunctionMetal.mm.
2486         (WebCore::GPULegacyFunction::GPULegacyFunction):
2487         (WebCore::GPULegacyFunction::name const):
2488         (WebCore::GPULegacyFunction::operator! const):
2489         * platform/graphics/gpu/legacy/cocoa/GPULegacyLibraryMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyLibraryMetal.mm.
2490         (WebCore::GPULegacyLibrary::GPULegacyLibrary):
2491         (WebCore::GPULegacyLibrary::label const):
2492         (WebCore::GPULegacyLibrary::setLabel const):
2493         (WebCore::GPULegacyLibrary::functionNames const):
2494         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderCommandEncoderMetal.mm.
2495         (WebCore::GPULegacyRenderCommandEncoder::GPULegacyRenderCommandEncoder):
2496         (WebCore::GPULegacyRenderCommandEncoder::setRenderPipelineState const):
2497         (WebCore::GPULegacyRenderCommandEncoder::setDepthStencilState const):
2498         (WebCore::GPULegacyRenderCommandEncoder::setVertexBuffer const):
2499         (WebCore::GPULegacyRenderCommandEncoder::setFragmentBuffer const):
2500         (WebCore::GPULegacyRenderCommandEncoder::drawPrimitives const):
2501         (WebCore::GPULegacyRenderCommandEncoder::endEncoding const):
2502         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassAttachmentDescriptorMetal.mm.
2503         (WebCore::GPULegacyRenderPassAttachmentDescriptor::GPULegacyRenderPassAttachmentDescriptor):
2504         (WebCore::GPULegacyRenderPassAttachmentDescriptor::loadAction const):
2505         (WebCore::GPULegacyRenderPassAttachmentDescriptor::setLoadAction const):
2506         (WebCore::GPULegacyRenderPassAttachmentDescriptor::storeAction const):
2507         (WebCore::GPULegacyRenderPassAttachmentDescriptor::setStoreAction const):
2508         (WebCore::GPULegacyRenderPassAttachmentDescriptor::setTexture const):
2509         (WebCore::GPULegacyRenderPassAttachmentDescriptor::metal const):
2510         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm.
2511         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::GPULegacyRenderPassColorAttachmentDescriptor):
2512         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::clearColor const):
2513         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::setClearColor const):
2514         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::metal const):
2515         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm.
2516         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::GPULegacyRenderPassDepthAttachmentDescriptor):
2517         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::clearDepth const):
2518         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::setClearDepth const):
2519         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::metal const):
2520         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDescriptorMetal.mm.
2521         (WebCore::GPULegacyRenderPassDescriptor::GPULegacyRenderPassDescriptor):
2522         (WebCore::GPULegacyRenderPassDescriptor::colorAttachments const):
2523         (WebCore::GPULegacyRenderPassDescriptor::depthAttachment const):
2524         (WebCore::GPULegacyRenderPassDescriptor::metal const):
2525         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm.
2526         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::GPULegacyRenderPipelineColorAttachmentDescriptor):
2527         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::pixelFormat const):
2528         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::setPixelFormat const):
2529         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::metal const):
2530         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineDescriptorMetal.mm.
2531         (WebCore::GPULegacyRenderPipelineDescriptor::GPULegacyRenderPipelineDescriptor):
2532         (WebCore::GPULegacyRenderPipelineDescriptor::depthAttachmentPixelFormat const):
2533         (WebCore::GPULegacyRenderPipelineDescriptor::setDepthAttachmentPixelFormat const):
2534         (WebCore::GPULegacyRenderPipelineDescriptor::setVertexFunction const):
2535         (WebCore::GPULegacyRenderPipelineDescriptor::setFragmentFunction const):
2536         (WebCore::GPULegacyRenderPipelineDescriptor::colorAttachments const):
2537         (WebCore::GPULegacyRenderPipelineDescriptor::reset const):
2538         (WebCore::GPULegacyRenderPipelineDescriptor::metal const):
2539         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineStateMetal.mm.
2540         (WebCore::GPULegacyRenderPipelineState::GPULegacyRenderPipelineState):
2541         (WebCore::GPULegacyRenderPipelineState::label const):
2542         (WebCore::GPULegacyRenderPipelineState::setLabel const):
2543         (WebCore::GPULegacyRenderPipelineState::metal const):
2544         * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureDescriptorMetal.mm.
2545         (WebCore::GPULegacyTextureDescriptor::GPULegacyTextureDescriptor):
2546         (WebCore::GPULegacyTextureDescriptor::width const):
2547         (WebCore::GPULegacyTextureDescriptor::setWidth const):
2548         (WebCore::GPULegacyTextureDescriptor::height const):
2549         (WebCore::GPULegacyTextureDescriptor::setHeight const):
2550         (WebCore::GPULegacyTextureDescriptor::sampleCount const):
2551         (WebCore::GPULegacyTextureDescriptor::setSampleCount const):
2552         (WebCore::GPULegacyTextureDescriptor::textureType const):
2553         (WebCore::GPULegacyTextureDescriptor::setTextureType const):
2554         (WebCore::GPULegacyTextureDescriptor::storageMode const):
2555         (WebCore::GPULegacyTextureDescriptor::setStorageMode const):
2556         (WebCore::GPULegacyTextureDescriptor::usage const):
2557         (WebCore::GPULegacyTextureDescriptor::setUsage const):
2558         (WebCore::GPULegacyTextureDescriptor::metal const):
2559         * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureMetal.mm.
2560         (WebCore::GPULegacyTexture::GPULegacyTexture):
2561         (WebCore::GPULegacyTexture::width const):
2562         (WebCore::GPULegacyTexture::height const):
2563         (WebCore::GPULegacyTexture::metal const):
2564
2565 2018-11-21  Adrian Perez de Castro  <aperez@igalia.com>
2566
2567         [SOUP] Certificate decoder always returns GByteArray with zero size
2568         https://bugs.webkit.org/show_bug.cgi?id=191888
2569
2570         Reviewed by Žan Doberšek.
2571
2572         No new tests needed.
2573
2574         * platform/network/soup/CertificateInfo.h:
2575         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Add missing
2576         call to g_byte_array_set_size() to make sure byteArray->len has the
2577         correct value.
2578
2579 2018-11-21  Zalan Butjas  <zalan@apple.com>
2580
2581         [LFC][IFC] Take nonBreakableStart/End into use.
2582         https://bugs.webkit.org/show_bug.cgi?id=191873
2583
2584         Reviewed by Antti Koivisto.
2585
2586         Offset the final inline runs with the nonBreakableStart/End values.
2587         (This patch also fixes relative positioned run verification.)
2588
2589         Test: fast/inline/inline-content-with-padding-left-right.html
2590
2591         * layout/Verification.cpp:
2592         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
2593         * layout/inlineformatting/InlineFormattingContext.cpp:
2594         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2595
2596 2018-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2597
2598         REGRESSION(r237845): [cairo] Hyperlink underscore layout issue
2599         https://bugs.webkit.org/show_bug.cgi?id=191630
2600
2601         Reviewed by Michael Catanzaro.
2602
2603         Only flip Y in GlyphToPathTranslator for ports using CG.
2604
2605         * platform/graphics/FontCascade.cpp:
2606         (WebCore::GlyphToPathTranslator::GlyphToPathTranslator):
2607
2608 2018-11-21  Alicia Boya García  <aboya@igalia.com>
2609
2610         [MSE][GStreamer] Refactor AppendPipeline deinitialization
2611         https://bugs.webkit.org/show_bug.cgi?id=191759
2612
2613         Reviewed by Xabier Rodriguez-Calvar.
2614
2615         AppendPipeline currently has a method, clearPlayerPrivate(), that the
2616         client code uses to deinitialize most of the AppendPipeline... just
2617         before actually destructing it in the next line of code.
2618
2619         Since at that point there should not be alive RefPtr's pointing to the
2620         AppendPipeline there is no need for this kind of pre-deinitialization
2621         in this usage pattern. Instead, we can just rely on C++ destructors,
2622         cleaning the code a bit and removing the potential for the question
2623         "what if `clearPlayerPrivate() has been called before?`": it has not.
2624
2625         Assertions have been added to ensure that there is only one alive
2626         RefPtr pointing to AppendPipeline, therefore guaranteeing its immediate
2627         destruction.
2628
2629         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2630         (WebCore::AppendPipeline::~AppendPipeline):
2631         (WebCore::AppendPipeline::deinitialize):
2632         (WebCore::AppendPipeline::clearPlayerPrivate): Deleted.
2633         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2634         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2635         (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
2636         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2637         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
2638
2639 2018-11-20  Dean Jackson  <dino@apple.com>
2640
2641         Removing using namespace WebCore from WebLayer
2642         https://bugs.webkit.org/show_bug.cgi?id=191870
2643         <rdar://problem/46192206>
2644
2645         Rubber-stamped by Sam Weinig.
2646
2647         Remove "using namespace WebCore" from WebLayer.mm
2648         because it will cause type clashes in unified source
2649         builds.
2650
2651         * platform/graphics/mac/WebLayer.mm:
2652         (-[WebLayer drawInContext:]):
2653         (-[WebSimpleLayer setNeedsDisplay]):
2654         (-[WebSimpleLayer setNeedsDisplayInRect:]):
2655         (-[WebSimpleLayer display]):
2656         (-[WebSimpleLayer drawInContext:]):
2657
2658 2018-11-20  Ryosuke Niwa  <rniwa@webkit.org>
2659
2660         Input element gains focus when a selectstart event listener on document prevents the default action
2661         https://bugs.webkit.org/show_bug.cgi?id=191714
2662         <rdar://problem/46174389>
2663
2664         Reviewed by Antti Koivisto.
2665
2666         The bug was caused by WebKit keep firing selectstart upon mousemove after the drag had already started
2667         when preventDefault had been called in the previous firings of selectstart event. Because input element
2668         has its own editable element and fires selectstart on the input element itself, which won't be prevented
2669         by selectstart on docuemnt, this allowed the selection to be set inside the input element even though
2670         the mouse cursor was simply passing over the input element after the drag had already started.
2671
2672         Fixed the bug by not firing selectstart if the default action had been prevented by the initial firing
2673         of selectstart by setting m_mouseDownMayStartDrag to false. This also matches the behaviors of Chrome
2674         and Firefox.
2675
2676         Test: fast/events/selectstart-prevent-default-should-not-focus-input.html
2677
2678         * page/EventHandler.cpp:
2679         (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
2680         (WebCore::EventHandler::updateSelectionForMouseDrag):
2681
2682 2018-11-20  Christopher Reid  <chris.reid@sony.com>
2683
2684         Remove the need for LocalizedStringsWPE.cpp
2685         https://bugs.webkit.org/show_bug.cgi?id=191854
2686
2687         Reviewed by Michael Catanzaro.
2688
2689         No change in behavior.
2690
2691         Consolidate "Search the Web" as the default search context menu text on non-COCOA ports.
2692
2693         GTK, WPE, and non-CF WIN all had the same default localizedString function
2694         of String::fromUTF8. Move that to LocalizedString.cpp as the default implementation
2695         for all ports not using CF.
2696
2697         * en.lproj/Localizable.strings:
2698         * platform/LocalizedStrings.cpp:
2699         * platform/gtk/LocalizedStringsGtk.cpp:
2700         * platform/win/LocalizedStringsWin.cpp:
2701         * platform/wpe/LocalizedStringsWPE.cpp: Removed.
2702
2703 2018-11-20  Zan Dobersek  <zdobersek@igalia.com>
2704
2705         Segfaults on https://terminalizer.com/
2706         https://bugs.webkit.org/show_bug.cgi?id=191805
2707
2708         Reviewed by Michael Catanzaro.
2709
2710         In HarfBuzzFace, the CacheEntry's HashMap object that caches Unicode
2711         codepoints and their corresponding glyph indices should allow zero
2712         values as valid keys since zero is a valid Unicode codepoint.
2713
2714         This change enables properly caching zero codepoints, avoiding
2715         repetitive additions to the HashMap cache that end up in a crash.
2716
2717         * platform/graphics/harfbuzz/HarfBuzzFace.h: Move the elongated
2718         GlyphCache type alias to the public section of HarfBuzzFace class
2719         declaration, making it reusable in the helper HarfBuzzFontData struct.
2720         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2721
2722 2018-11-20  Antti Koivisto  <antti@apple.com>
2723
2724         Update hover state in composed tree
2725         https://bugs.webkit.org/show_bug.cgi?id=191860
2726
2727         Reviewed by Zalan Bujtas.
2728
2729         The code was already mostly switched over from render tree to composed tree.
2730         This patch replaces the remaining common ancestor search code with a DOM based equivalent.
2731
2732         * dom/Document.cpp:
2733         (WebCore::findNearestCommonComposedAncestor):
2734         (WebCore::Document::updateHoverActiveState):
2735         (WebCore::nearestCommonHoverAncestor): Deleted.
2736         * rendering/RenderBlock.cpp:
2737         (WebCore::RenderBlock::hoverAncestor const): Deleted.
2738         * rendering/RenderBlock.h:
2739         * rendering/RenderElement.cpp:
2740         (WebCore::RenderElement::hoverAncestor const): Deleted.
2741
2742         No longer needed.
2743
2744         * rendering/RenderElement.h:
2745
2746 2018-11-20  Zalan Bujtas  <zalan@apple.com>
2747
2748         [LFC][IFC] Measure run with non-breakable start/end.
2749         https://bugs.webkit.org/show_bug.cgi?id=191850
2750
2751         Reviewed by Antti Koivisto.
2752
2753         Line breaking needs to know the complete width of the run including padding etc.
2754
2755         * layout/Verification.cpp:
2756         (WebCore::Layout::collectFlowBoxSubtree):
2757         (WebCore::Layout::collectInlineBoxes):
2758         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2759         * layout/inlineformatting/InlineFormattingContext.cpp:
2760         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2761         * layout/inlineformatting/InlineFormattingContext.h:
2762         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2763         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
2764         * layout/inlineformatting/InlineLineBreaker.cpp:
2765         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
2766         (WebCore::Layout::InlineLineBreaker::runWidth const):
2767         (WebCore::Layout::InlineLineBreaker::textWidth const):
2768         * layout/inlineformatting/InlineLineBreaker.h:
2769         * layout/inlineformatting/text/TextUtil.cpp:
2770         (WebCore::Layout::TextUtil::hyphenPositionBefore):
2771         (WebCore::Layout::TextUtil::width):
2772         (WebCore::Layout::TextUtil::fixedPitchWidth):
2773         (WebCore::Layout::TextUtil::TextUtil): Deleted.
2774         (WebCore::Layout::TextUtil::width const): Deleted.
2775         (WebCore::Layout::TextUtil::hyphenPositionBefore const): Deleted.
2776         (WebCore::Layout::TextUtil::textWidth const): Deleted.
2777         (WebCore::Layout::TextUtil::fixedPitchWidth const): Deleted.
2778         * layout/inlineformatting/text/TextUtil.h:
2779
2780 2018-11-20  Zalan Bujtas  <zalan@apple.com>
2781
2782         [LFC][IFC] InlineFormattingContext::Line should hold the list of runs for the current line.
2783         https://bugs.webkit.org/show_bug.cgi?id=191845
2784
2785         Reviewed by Antti Koivisto.
2786
2787         Collect the runs in InlineFormattingContext::Line and transfer them to InlineFormattingState during line closing.
2788         (In the most common cases, this is only one extra vector::append() call.)
2789
2790         * layout/inlineformatting/InlineFormattingContext.cpp:
2791         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2792         (WebCore::Layout::InlineFormattingContext::createFinalRuns const):
2793         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
2794         (WebCore::Layout::InlineFormattingContext::closeLine const):
2795         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
2796         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2797         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
2798         (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const): Deleted.
2799         * layout/inlineformatting/InlineFormattingContext.h:
2800         (WebCore::Layout::InlineFormattingContext::Line::hasContent const):
2801         (WebCore::Layout::InlineFormattingContext::Line::runs):
2802         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2803         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
2804         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
2805         (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns):
2806         * layout/inlineformatting/Line.cpp:
2807         (WebCore::Layout::InlineFormattingContext::Line::init):
2808         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
2809         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
2810         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
2811         (WebCore::Layout::InlineFormattingContext::Line::close):
2812         (WebCore::Layout::InlineFormattingContext::Line::Line): Deleted.
2813
2814 2018-11-20  Zalan Butjas  <zalan@apple.com>
2815
2816         [LFC][IFC] Introduce InlineItem::nonBreakableStart/End
2817         https://bugs.webkit.org/show_bug.cgi?id=191839
2818
2819         Reviewed by Antti Koivisto.
2820
2821         Non-breakable start/end marks margin/padding/border space (even when it does not directly come from the associated layout box)
2822
2823         <span style="padding: 5px"><span>nested content with padding parent</span</span>
2824         <nested content with padding parent> <- inline run has 5px non-breakable start/end.
2825
2826         <span style="border: 5px solid green"><span style="padding-right: 10px; margin-right: 1px">1</span>2</span><span>    3</span>
2827         <1> <- inline run has 5px non-breakable start and 11px non-breakable end.
2828         <2> <- inline run has 0px non-breakable start and 5px non-breakable end.
2829         <3> <- no non-breakable values.
2830
2831         This is what the runs look like (input to line breaking)
2832         <     1           2     >
2833         < > (whitespace)
2834         <3>
2835         The line breaking treats the paddding/border etc space as part of the run and as non-breaking opportunity.
2836         With the given runs the first position where we can break the line is at the whitespace.
2837
2838         * layout/inlineformatting/InlineFormattingContext.cpp:
2839         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2840         * layout/inlineformatting/InlineItem.h:
2841         (WebCore::Layout::InlineItem::nonBreakableStart const):
2842         (WebCore::Layout::InlineItem::nonBreakableEnd const):
2843         (WebCore::Layout::InlineItem::addNonBreakableStart):
2844         (WebCore::Layout::InlineItem::addNonBreakableEnd):
2845
2846 2018-11-20  Zalan Bujtas  <zalan@apple.com>
2847
2848         [LFC][IFC] Move detaching rules from InlineFormattingState to InlineItem
2849         https://bugs.webkit.org/show_bug.cgi?id=191838
2850
2851         Reviewed by Antti Koivisto.
2852
2853         This is in preparation for adding more context to InlineItem. In addition to
2854         detaching rules it will also hold non-breakable start/end information.
2855
2856         * layout/inlineformatting/InlineFormattingContext.cpp:
2857         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2858         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2859         * layout/inlineformatting/InlineFormattingState.cpp:
2860         (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
2861         (WebCore::Layout::InlineFormattingState::detachingRules const): Deleted.
2862         * layout/inlineformatting/InlineFormattingState.h:
2863         (WebCore::Layout::InlineFormattingState::setDetachingRules): Deleted.
2864         * layout/inlineformatting/InlineItem.h:
2865         (WebCore::Layout::InlineItem::addDetachingRule):
2866         (WebCore::Layout::InlineItem::detachingRules const):
2867
2868 2018-11-20  Zalan Bujjtas  <zalan@apple.com>
2869
2870         [LFC][IFC] InlineRunProvider::append() should just take const InlineItem&.
2871         https://bugs.webkit.org/show_bug.cgi?id=191837
2872
2873         Reviewed by Antti Koivisto.
2874
2875         This allows us to remove the InlineFormattingState dependency as well.
2876
2877         * layout/inlineformatting/InlineFormattingContext.cpp:
2878         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2879         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2880         * layout/inlineformatting/InlineRunProvider.cpp:
2881         (WebCore::Layout::InlineRunProvider::InlineRunProvider):
2882         (WebCore::Layout::InlineRunProvider::append):
2883         * layout/inlineformatting/InlineRunProvider.h:
2884
2885 2018-11-20  Thibault Saunier  <tsaunier@igalia.com>
2886
2887         [GStreamer] Enhance debugging by making sure to print the pipeline in MediaPlayerPrivateGStreamer
2888         https://bugs.webkit.org/show_bug.cgi?id=191586
2889
2890         Reviewed by Xabier Rodriguez-Calvar.
2891
2892         This is minor changes that do not require tests.
2893
2894         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2895         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
2896         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
2897         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
2898         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
2899         (WebCore::MediaPlayerPrivateGStreamer::commitLoad):
2900         (WebCore::MediaPlayerPrivateGStreamer::readyTimerFired):
2901         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
2902         (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
2903         (WebCore::MediaPlayerPrivateGStreamer::play):
2904         (WebCore::MediaPlayerPrivateGStreamer::pause):
2905         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
2906         (WebCore::MediaPlayerPrivateGStreamer::seek):
2907         (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
2908         (WebCore::MediaPlayerPrivateGStreamer::paused const):
2909         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
2910         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
2911         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
2912         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
2913         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2914         (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
2915         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
2916         (WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const):
2917         (WebCore::MediaPlayerPrivateGStreamer::totalBytes const):
2918         (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
2919         (WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback):
2920         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
2921         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
2922         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
2923         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2924         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
2925         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
2926         (WebCore::MediaPlayerPrivateGStreamer::setPreload):
2927         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2928
2929 2018-11-20  Manuel Rego Casasnovas  <rego@igalia.com>
2930
2931         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
2932         https://bugs.webkit.org/show_bug.cgi?id=191656
2933
2934         Reviewed by Javier Fernandez.
2935
2936         We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
2937         that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
2938         but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
2939
2940         The patch modifies the method so it takes into account scrollbar size
2941         in order to compute the position of the columns/rows depending on the direction and the writing mode.
2942
2943         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
2944                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
2945                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
2946
2947         * rendering/RenderGrid.cpp:
2948         (WebCore::RenderGrid::populateGridPositionsForDirection):
2949
2950 2018-11-19  Ryosuke Niwa  <rniwa@webkit.org>
2951
2952         Click on node assigned to slot in button's shadow cause loss of button focus
2953         https://bugs.webkit.org/show_bug.cgi?id=191694
2954         <rdar://problem/46107920>
2955
2956         Reviewed by Wenson Hsieh.
2957
2958         Fixed the bug by traversing the parent in the composed tree when looking for an element to focus.
2959
2960         Test: fast/shadow-dom/focus-slot-parent.html
2961
2962         * page/EventHandler.cpp:
2963         (WebCore::EventHandler::dispatchMouseEvent): Fixed the bug. Also use RefPtr instead of a raw pointer.
2964
2965 2018-11-19  Fujii Hironori  <Hironori.Fujii@sony.com>
2966
2967         REGRESSION(r238350) [curl] CertificateInfo.h: error: template specialization requires 'template<>'
2968         https://bugs.webkit.org/show_bug.cgi?id=191849
2969
2970         Unreviewed build fix for clang-cl builds.
2971
2972         No new tests because there's no behaviour change.
2973
2974         * platform/network/curl/CertificateInfo.h:
2975         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
2976         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
2977
2978 2018-11-19  Basuke Suzuki  <basuke.suzuki@sony.com>
2979
2980         [Curl] Add API for CertificateInfo.
2981         https://bugs.webkit.org/show_bug.cgi?id=191647
2982
2983         Reviewed by Alex Christensen.
2984
2985         Minor changes for WebKit API.
2986
2987         Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp
2988
2989         * platform/network/curl/CertificateInfo.h:
2990         * platform/network/curl/CertificateInfoCurl.cpp:
2991         (WebCore::CertificateInfo::CertificateInfo):
2992         (WebCore::CertificateInfo::makeCertificate):
2993         * platform/network/curl/CurlSSLVerifier.cpp:
2994         (WebCore::BIOHolder::asCertificate):
2995
2996 2018-11-19  Justin Fan  <justin_fan@apple.com>
2997
2998         [WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormatEnum, and WebGPUSwapChain::configure upgrades
2999         https://bugs.webkit.org/show_bug.cgi?id=191794
3000
3001         Reviewed by Dean Jackson.
3002
3003         Test: webgpu/textures-textureviews.html
3004
3005         Implement basic functionality for getting the next WebGPUTexture and TextureView from the WebGPURenderingContext
3006         to use as a render destination for the next draw call. Also introduce WebGPUTextureFormatEnum and the ability to 
3007         configure the context with a chosen texture format. 
3008
3009         * CMakeLists.txt:
3010         * DerivedSources.make:
3011         * Modules/webgpu/GPUSwapChain.h: Texture/Pixel format can now be set.
3012         * Modules/webgpu/GPUTexture.h: Added. Interface to a MTLTexture.
3013         * Modules/webgpu/GPUTextureFormatEnum.h: Added.
3014         * Modules/webgpu/WebGPUDevice.cpp:
3015         (WebCore::WebGPUDevice::createRenderPipeline const): Removed now-unnecessary enum class cast.
3016         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Rather than duplicate GPURenderPipelineDescriptor::PrimitiveTopology, alias to it.
3017         * Modules/webgpu/WebGPUSwapChain.cpp:
3018         (WebCore::WebGPUSwapChain::configure): Can now specify a specific texture format for the underlying CAMetalLayer.
3019         (WebCore::WebGPUSwapChain::getNextTexture): Added. Request the next drawable texture.
3020         * Modules/webgpu/WebGPUSwapChain.h: Expose getNextTexture().
3021         * Modules/webgpu/WebGPUSwapChain.idl:
3022         * Modules/webgpu/WebGPUTexture.cpp: Added. 
3023         (WebCore::WebGPUTexture::create):
3024         (WebCore::WebGPUTexture::WebGPUTexture):
3025         (WebCore::WebGPUTexture::createDefaultTextureView):
3026         * Modules/webgpu/WebGPUTexture.h: Added.
3027         * Modules/webgpu/WebGPUTexture.idl: Added.
3028         * Modules/webgpu/WebGPUTextureFormatEnum.h: Added. Type alias for GPUTextureFormatEnum.
3029         * Modules/webgpu/WebGPUTextureFormatEnum.idl: Added. Used to represent any texture format used by WebGPU.
3030         * Modules/webgpu/WebGPUTextureView.cpp: Added.
3031         (WebCore::WebGPUTextureView::create):
3032         (WebCore::WebGPUTextureView::WebGPUTextureView):
3033         * Modules/webgpu/WebGPUTextureView.h: Added.
3034         * Modules/webgpu/WebGPUTextureView.idl: Added.
3035         * Modules/webgpu/cocoa/GPUSwapChainMetal.mm: 
3036         (WebCore::GPUSwapChain::create):
3037         (WebCore::GPUSwapChain::setFormat): Called by WebGPUSwapChain::configure().
3038         (WebCore::GPUSwapChain::getNextTexture):
3039         * Modules/webgpu/cocoa/GPUTextureFormatEnumMetal.mm: Added.
3040         (WebCore::convertAndValidate): Convert the WebGPUTextureFormatEnum to a MTLPixelFormat.
3041         * Modules/webgpu/cocoa/GPUTextureMetal.mm: Added.
3042         (WebCore::GPUTexture::create):
3043         (WebCore::GPUTexture::GPUTexture):
3044         (WebCore::GPUTexture::createDefaultTextureView): Uses the pixelFormat of the original texture.
3045         * Sources.txt:
3046         * SourcesCocoa.txt:
3047         * WebCore.xcodeproj/project.pbxproj:
3048         * bindings/js/WebCoreBuiltinNames.h:
3049
3050 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
3051
3052         Web Inspector: "Reload Web Inspector" button no longer partially works
3053         https://bugs.webkit.org/show_bug.cgi?id=191773
3054         <rdar://problem/46139932>
3055
3056         Reviewed by Devin Rousso.
3057
3058         * inspector/InspectorFrontendClient.h:
3059         * inspector/InspectorFrontendHost.cpp:
3060         (WebCore::InspectorFrontendHost::reopen):
3061         * inspector/InspectorFrontendHost.h:
3062         * inspector/InspectorFrontendHost.idl:
3063         Provide a host call to reopen an inspector window to reload it.
3064
3065         * testing/Internals.cpp:
3066         Stub implementation, this is not used in tests.
3067
3068 2018-11-19  Rob Buis  <rbuis@igalia.com>
3069
3070         Setting document.title should have no effect for non SVG/HTML documents
3071         https://bugs.webkit.org/show_bug.cgi?id=191643
3072
3073         Reviewed by Chris Dumez.
3074
3075         Setting document.title should have no effect for non SVG/HTML documents,
3076         see https://html.spec.whatwg.org/multipage/dom.html#document.title.
3077
3078         Behavior matches Firefox and Chrome.
3079
3080         Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html
3081
3082         * dom/Document.cpp:
3083         (WebCore::Document::setTitle):
3084
3085 2018-11-19  Wenson Hsieh  <wenson_hsieh@apple.com>
3086
3087         Dragging image with a border-image larger than the image element crashes
3088         https://bugs.webkit.org/show_bug.cgi?id=191817
3089         <rdar://problem/46159222>
3090
3091         Reviewed by Ryosuke Niwa.
3092
3093         When dragging an image element, if the image element has:
3094
3095         (1) box-sizing: border-box;
3096         (2) a border-image
3097         (3) a border-top-width that is at least as large as the height of the element and/or a border-left-width that is
3098             at least as large as the width of the element
3099
3100         ...then upon drag, we will fail to create a suitable drag image using the bounding box of the image element
3101         since the size is empty, thereby causing a crash. To fix this, we bail out of this bounding-rect-dependent
3102         codepath for generating a drag image in the case where the bounding rect is empty, and instead fall back to an
3103         icon representation for the drag image.
3104
3105         Test: fast/events/drag-image-with-border-image.html
3106
3107         * page/DragController.cpp:
3108         (WebCore::DragController::doImageDrag):
3109
3110 2018-11-18  Zan Dobersek  <zdobersek@igalia.com>
3111
3112         HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap
3113         https://bugs.webkit.org/show_bug.cgi?id=191825
3114
3115         Reviewed by Michael Catanzaro.
3116
3117         The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry
3118         objects is used to map given Unicode codepoints to corresponding
3119         glyph indices (which occurs in the harfBuzzGetGlyph() function that's
3120         invoked by HarfBuzz).
3121
3122         The 16-bit unsigned integer as the map's value type is not enough here
3123         when the glyph index mapping is done through Freetype -- its API returns
3124         32-bit glyph indices, and Cairo assigns this value to the 64-bit
3125         unsigned index variable in the cairo_glyph_t struct. The value type is
3126         thus bumped to 32 bits to match the unsigned type size of the index's
3127         origin.
3128
3129         * platform/graphics/harfbuzz/HarfBuzzFace.h:
3130         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
3131
3132 2018-11-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3133
3134         [iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
3135         https://bugs.webkit.org/show_bug.cgi?id=191819
3136
3137         Reviewed by Dan Bernstein.
3138
3139         Replace UIItemProvider (and related classes) with NSItemProvider.
3140
3141         * platform/ios/PlatformPasteboardIOS.mm:
3142         (WebCore::registerItemToPasteboard):
3143         * platform/ios/WebItemProviderPasteboard.h:
3144         * platform/ios/WebItemProviderPasteboard.mm:
3145         (-[WebItemProviderDataRegistrar registerItemProvider:]):
3146         (-[WebItemProviderWritableObjectRegistrar initWithObject:]):
3147         (-[WebItemProviderWritableObjectRegistrar representingObject]):
3148         (-[WebItemProviderWritableObjectRegistrar registerItemProvider:]):
3149         (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
3150         (-[WebItemProviderRegistrationInfoList itemProvider]):
3151         (-[WebItemProviderPasteboard pasteboardTypes]):
3152         (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
3153         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
3154         (allLoadableClasses):
3155         (classForTypeIdentifier):
3156         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
3157         (-[WebItemProviderPasteboard numberOfFiles]):
3158         (-[WebItemProviderPasteboard itemProviderAtIndex:]):
3159         (-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
3160         * platform/mac/DragDataMac.mm:
3161         (WebCore::DragData::containsURL const):
3162
3163 2018-11-17  Ross Kirsling  <ross.kirsling@sony.com>
3164
3165         Remove superfluous LayoutUnit initializations
3166         https://bugs.webkit.org/show_bug.cgi?id=191791
3167
3168         Reviewed by Simon Fraser.
3169
3170         First step toward making LayoutUnit constructors explicit:
3171         eliminate `= 0` when constructing LayoutUnit lvalues.
3172
3173         * editing/Editor.cpp:
3174         (WebCore::Editor::firstRectForRange const):
3175         * editing/FrameSelection.cpp:
3176         (WebCore::FrameSelection::modify):
3177         (WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation):
3178         * html/shadow/SliderThumbElement.cpp:
3179         (WebCore::RenderSliderContainer::computeLogicalHeight const):
3180         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3181         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
3182         * page/FrameView.cpp:
3183         (WebCore::FrameView::forceLayoutForPagination):
3184         * page/SpatialNavigation.cpp:
3185         (WebCore::scrollInDirection):
3186         (WebCore::distanceDataForNode):
3187         * rendering/AutoTableLayout.cpp:
3188         (WebCore::AutoTableLayout::layout):
3189         * rendering/GridTrackSizingAlgorithm.cpp:
3190         (WebCore::marginIntrinsicLogicalWidthForChild):
3191         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
3192         * rendering/InlineFlowBox.cpp:
3193         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
3194         (WebCore::InlineFlowBox::paintFillLayer):
3195         (WebCore::InlineFlowBox::paintBoxDecorations):
3196         (WebCore::InlineFlowBox::paintMask):
3197         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
3198         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
3199         * rendering/RenderBlock.cpp:
3200         (WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const):
3201         (WebCore::RenderBlock::layoutPositionedObject):
3202         (WebCore::RenderBlock::selectionGapRectsForRepaint):
3203         (WebCore::RenderBlock::paintSelection):
3204         (WebCore::RenderBlock::textIndentOffset const):
3205         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
3206         * rendering/RenderBlockFlow.cpp:
3207         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
3208         (WebCore::RenderBlockFlow::layoutBlock):
3209         (WebCore::RenderBlockFlow::layoutBlockChildren):
3210         (WebCore::RenderBlockFlow::marginValuesForChild const):
3211         (WebCore::RenderBlockFlow::estimateLogicalTopPosition):
3212         (WebCore::RenderBlockFlow::applyBeforeBreak):
3213         (WebCore::RenderBlockFlow::applyAfterBreak):
3214         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
3215         (WebCore::RenderBlockFlow::clearFloats):
3216         (WebCore::RenderBlockFlow::lowestFloatLogicalBottom const):
3217         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
3218         (WebCore::RenderBlockFlow::addOverhangingFloats):
3219         (WebCore::RenderBlockFlow::getClearDelta):
3220         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
3221         * rendering/RenderBlockLineLayout.cpp:
3222         (WebCore::setLogicalWidthForTextRun):
3223         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
3224         (WebCore::RenderBlockFlow::determineStartPosition):
3225         * rendering/RenderBox.cpp:
3226         (WebCore::RenderBox::fillAvailableMeasure const):
3227         (WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const):
3228         (WebCore::RenderBox::computeLogicalWidthInFragmentUsing const):
3229         (WebCore::RenderBox::computePercentageLogicalHeight const):
3230         (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
3231         (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
3232         (WebCore::RenderBox::computePositionedLogicalHeightUsing const):
3233         (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
3234         (WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
3235         * rendering/RenderBoxModelObject.cpp:
3236         (WebCore::RenderBoxModelObject::computedCSSPadding const):
3237         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
3238         * rendering/RenderDeprecatedFlexibleBox.cpp:
3239         (WebCore::marginWidthForChild):
3240         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
3241         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
3242         * rendering/RenderFileUploadControl.cpp:
3243         (WebCore::RenderFileUploadControl::paintObject):
3244         * rendering/RenderFragmentedFlow.cpp:
3245         (WebCore::RenderFragmentedFlow::validateFragments):
3246         (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
3247         (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
3248         * rendering/RenderFrameSet.cpp:
3249         (WebCore::RenderFrameSet::paint):
3250         * rendering/RenderListItem.cpp:
3251         (WebCore::RenderListItem::positionListMarker):
3252         * rendering/RenderListMarker.cpp:
3253         (WebCore::RenderListMarker::computePreferredLogicalWidths):
3254         (WebCore::RenderListMarker::updateMargins):
3255         * rendering/RenderMultiColumnSet.cpp:
3256         (WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const):
3257         * rendering/RenderRubyRun.cpp:
3258         (WebCore::RenderRubyRun::layoutBlock):
3259         * rendering/RenderTable.cpp:
3260         (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
3261         (WebCore::RenderTable::layout):
3262         (WebCore::RenderTable::offsetWidthForColumn const):
3263         (WebCore::RenderTable::offsetHeightForColumn const):
3264         (WebCore::RenderTable::outerBorderBefore const):
3265         (WebCore::RenderTable::outerBorderAfter const):
3266         (WebCore::RenderTable::outerBorderStart const):
3267         (WebCore::RenderTable::outerBorderEnd const):
3268         * rendering/RenderTableCell.cpp:
3269         (WebCore::RenderTableCell::logicalWidthFromColumns const):
3270         (WebCore::RenderTableCell::computeIntrinsicPadding):
3271         * rendering/RenderTableSection.cpp:
3272         (WebCore::RenderTableSection::calcRowLogicalHeight):
3273         (WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows):
3274         (WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows):
3275         (WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight):
3276         (WebCore::RenderTableSection::layoutRows):
3277         (WebCore::RenderTableSection::calcOuterBorderBefore const):
3278         (WebCore::RenderTableSection::calcOuterBorderAfter const):
3279         (WebCore::RenderTableSection::calcOuterBorderStart const):
3280         (WebCore::RenderTableSection::calcOuterBorderEnd const):
3281         * rendering/RootInlineBox.cpp:
3282         (WebCore::RootInlineBox::alignBoxesInBlockDirection):
3283         (WebCore::RootInlineBox::beforeAnnotationsAdjustment const):
3284         (WebCore::RootInlineBox::lineSnapAdjustment const):
3285         (WebCore::RootInlineBox::verticalPositionForBox):
3286         * rendering/line/BreakingContext.h:
3287         (WebCore::inlineLogicalWidth):
3288         * rendering/mathml/RenderMathMLBlock.cpp:
3289         (WebCore::RenderMathMLBlock::layoutItems):
3290         * rendering/mathml/RenderMathMLFraction.cpp:
3291         (WebCore::RenderMathMLFraction::layoutBlock):
3292         * rendering/mathml/RenderMathMLOperator.cpp:
3293         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
3294         * rendering/mathml/RenderMathMLRoot.cpp:
3295         (WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
3296         (WebCore::RenderMathMLRoot::paint):
3297         * rendering/mathml/RenderMathMLRow.cpp:
3298         (WebCore::RenderMathMLRow::computePreferredLogicalWidths):
3299         * rendering/mathml/RenderMathMLScripts.cpp:
3300         (WebCore::RenderMathMLScripts::layoutBlock):
3301         * rendering/mathml/RenderMathMLUnderOver.cpp:
3302         (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
3303         (WebCore::RenderMathMLUnderOver::layoutBlock):
3304         * rendering/style/RenderStyle.cpp:
3305         (WebCore::RenderStyle::getShadowInsetExtent const):
3306         * rendering/svg/RenderSVGText.cpp:
3307         (WebCore::RenderSVGText::layout):
3308
3309 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
3310
3311         Avoid triggering compositing updates when only the root layer is composited
3312         https://bugs.webkit.org/show_bug.cgi?id=191813
3313
3314         Reviewed by Zalan Bujtas.
3315
3316         If we know that the only composited layer is the root, we can avoid triggering deep
3317         compositing updates sometimes, for example when layout changes size or position,
3318         or when z-order lists change.
3319
3320         * rendering/RenderLayer.cpp:
3321         (WebCore::RenderLayer::addChild):
3322         (WebCore::RenderLayer::removeChild):
3323         (WebCore::RenderLayer::updateLayerPosition):
3324         (WebCore::RenderLayer::scrollTo):
3325         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
3326         (WebCore::outputPaintOrderTreeRecursive):
3327         * rendering/RenderLayerCompositor.cpp:
3328         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant()
3329         flag to cut off descendants traversal when possible.
3330         (WebCore::RenderLayerCompositor::layerStyleChanged):
3331
3332 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
3333
3334         Fix an error in 238354 - !=, not ==.
3335         
3336         Fixes test failures.
3337
3338         * rendering/RenderLayerCompositor.cpp:
3339         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
3340
3341 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
3342
3343         Clarify RenderLayerCompositor::hasAnyAdditionalCompositedLayers() and related code.
3344         https://bugs.webkit.org/show_bug.cgi?id=191810
3345
3346         Reviewed by Zalan Bujtas.
3347
3348         Rename m_compositedLayerCount to m_contentLayersCount and have it track layers other
3349         than the RenderView's layer.
3350
3351         hasAnyAdditionalCompositedLayers() is really about whether we can drop out of compositing
3352         because no content layer is composited, and overlays don't require compositing, so
3353         rename it.
3354
3355         * rendering/RenderLayerCompositor.cpp:
3356         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3357         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3358         (WebCore::RenderLayerCompositor::needsCompositingForContentOrOverlays const):
3359         (WebCore::RenderLayerCompositor::layerBecameComposited):
3360         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
3361         (WebCore::RenderLayerCompositor::layerTreeAsText):
3362         (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): Deleted.
3363         * rendering/RenderLayerCompositor.h:
3364
3365 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
3366
3367         Rename RenderLayerCompositor::inCompositingMode() to usesCompositing()
3368         https://bugs.webkit.org/show_bug.cgi?id=191808
3369
3370         Reviewed by Zalan Bujtas.
3371
3372         Other code uses "usesCompositing" so standardize on that (future changes will make
3373         "compositing mode" more ambiguous). Also remove a FrameView function that only
3374         had one caller.
3375
3376         * page/FrameView.cpp:
3377         (WebCore::FrameView::clearBackingStores):
3378         (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange):
3379         (WebCore::FrameView::delegatesScrollingDidChange):
3380         (WebCore::FrameView::hasCompositedContent const): Deleted.
3381         * page/FrameView.h:
3382         * rendering/RenderLayer.cpp:
3383         (WebCore::RenderLayer::addChild):
3384         (WebCore::RenderLayer::removeChild):
3385         (WebCore::RenderLayer::rebuildZOrderLists):
3386         (WebCore::RenderLayer::updateLayerPosition):
3387         (WebCore::RenderLayer::scrollTo):
3388         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
3389         * rendering/RenderLayerCompositor.cpp:
3390         (WebCore::RenderLayerCompositor::updateCompositingPolicy):
3391         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3392         (WebCore::RenderLayerCompositor::layerStyleChanged):
3393         (WebCore::RenderLayerCompositor::updateBacking):
3394         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
3395         (WebCore::RenderLayerCompositor::setIsInWindow):
3396         (WebCore::RenderLayerCompositor::needsToBeComposited const):
3397         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
3398         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
3399         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
3400         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
3401         * rendering/RenderLayerCompositor.h:
3402         * rendering/RenderView.cpp:
3403         (WebCore::RenderView::repaintViewAndCompositedLayers):
3404         (WebCore::RenderView::usesCompositing const):
3405
3406 2018-11-17  Devin Rousso  <drousso@apple.com>
3407
3408         Web Inspector: Network: add button to show system certificate dialog
3409         https://bugs.webkit.org/show_bug.cgi?id=191458
3410         <rdar://problem/45977019>
3411
3412         Reviewed by Joseph Pecoraro.
3413
3414         Test: http/tests/inspector/network/getSerializedCertificate.html
3415
3416         * inspector/agents/InspectorNetworkAgent.h:
3417         * inspector/agents/InspectorNetworkAgent.cpp:
3418         (WebCore::InspectorNetworkAgent::getSerializedCertificate): Added.
3419
3420         * inspector/InspectorFrontendHost.idl:
3421         * inspector/InspectorFrontendHost.h:
3422         * inspector/InspectorFrontendHost.cpp:
3423         (WebCore::InspectorFrontendHost::supportsShowCertificate): Added.
3424         (WebCore::InspectorFrontendHost::showCertificate): Added.
3425         * inspector/InspectorFrontendClient.h:
3426         (InspectorFrontendClient::showCertificate): Added.
3427         * testing/Internals.cpp:
3428         (InspectorStubFrontend::showCertificate): Added.
3429
3430         * platform/network/cf/CertificateInfo.h:
3431         (WTF::Persistence::encodeCFData): Added.
3432         (WTF::Persistence::decodeCFData): Added.
3433         (WTF::Persistence::encodeSecTrustRef): Added.
3434         (WTF::Persistence::decodeSecTrustRef): Added.
3435         (WTF::Persistence::encodeCertificateChain): Added.
3436         (WTF::Persistence::decodeCertificateChain): Added.
3437         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
3438         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
3439         * platform/network/cf/CertificateInfoCFNet.cpp:
3440         * platform/network/cocoa/CertificateInfoCocoa.mm:
3441
3442         * platform/network/curl/CertificateInfo.h:
3443         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
3444         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
3445
3446         * platform/network/soup/CertificateInfo.h:
3447         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode): Added.
3448         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Added.
3449         (WTF::Persistence::certificatesDataListFromCertificateInfo): Added.
3450         (WTF::Persistence::certificateFromCertificatesDataList): Added.
3451         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
3452         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
3453
3454 2018-11-17  Zalan Bujtas  <zalan@apple.com>
3455
3456         [LFC][IFC] InlineFormattingState::addDetachingRule should accumulate rules.
3457         https://bugs.webkit.org/show_bug.cgi?id=191801
3458
3459         Reviewed by Antti Koivisto.
3460
3461         before<span style="position: relative">positioned</span>after
3462         In the example above the <positioned> inline box has both the BreakAtStart and the BreakAtEnd rules.
3463         While walking through the inline tree, we add BreakAtStart first and when we figure it's the last child too,
3464         we add BreakAtEnd as well. BreakAtEnd should not clear the BreakAtStart rule.
3465
3466         Test: fast/inline/simple-inline-with-out-of-flow-descendant2.html
3467
3468         * layout/inlineformatting/InlineFormattingContext.cpp:
3469         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
3470         * layout/inlineformatting/InlineFormattingState.cpp:
3471         (WebCore::Layout::InlineFormattingState::addDetachingRule):
3472         * layout/inlineformatting/InlineFormattingState.h:
3473         (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
3474
3475 2018-11-17  Jonathan Hammer  <jonathan@e3software.com>
3476
3477         Caret stops blinking after context menu shown
3478         https://bugs.webkit.org/show_bug.cgi?id=191715
3479
3480         Reviewed by Ryosuke Niwa.
3481
3482         Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that
3483         the caret continues to blink even after the context menu is dismissed. The normal
3484         way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does
3485         not apply in the case of context menus because handleMouseReleaseEvent is not
3486         called once the context menu is up.
3487
3488         Test: fast/events/contextmenu-dismiss-blink-caret.html
3489
3490         * page/EventHandler.cpp:
3491         (WebCore::EventHandler::sendContextMenuEvent):
3492         * testing/Internals.cpp:
3493         (WebCore::Internals::isCaretBlinkingSuspended):
3494         * testing/Internals.h:
3495         * testing/Internals.idl:
3496
3497 2018-11-16  Antoine Quint  <graouts@apple.com>
3498
3499         [Pointer Events] event.isPrimary doesn't always represent the oldest active touch
3500         https://bugs.webkit.org/show_bug.cgi?id=191752
3501         <rdar://problem/46129270>
3502
3503         Reviewed by Dean Jackson.
3504
3505         Provide isPrimary to the constructor so its value can be determined at the call site.
3506
3507         Test: pointerevents/ios/pointer-events-is-primary.html
3508
3509         * dom/PointerEvent.h:
3510         * dom/ios/PointerEventIOS.cpp:
3511         (WebCore::PointerEvent::create):
3512         (WebCore::PointerEvent::PointerEvent):
3513         (WebCore::m_isPrimary):
3514
3515 2018-11-16  Alex Christensen  <achristensen@webkit.org>
3516
3517         Tweak _showSafeBrowsingWarningWithTitle SPI
3518         https://bugs.webkit.org/show_bug.cgi?id=191799
3519
3520         Reviewed by Wenson Hsieh.
3521
3522         It turns out I needed to expose both sentinel values used in safe browsing for my application of this SPI in Mac Safari.
3523         Allowing the caller to make its own sentinel values is insufficient because the malware confirmation needs to be over the warning.
3524         The completion handler parameter should just be a bool indicating whether the user has chosen to continue after all warnings.
3525
3526         Covered by updated API tests.
3527
3528         * en.lproj/Localizable.strings:
3529         * platform/LocalizedStrings.cpp:
3530         (WebCore::formControlCancelButtonTitle):
3531         Make "Cancel"'s description a little more generic.
3532
3533 2018-11-16  Simon Fraser  <simon.fraser@apple.com>
3534
3535         Optimize composited iframe layer hookup
3536         https://bugs.webkit.org/show_bug.cgi?id=191778
3537
3538         Reviewed by Zalan Bujtas.
3539
3540         The change made in r238229 can be more targeted; we only need to hook up iframe content
3541         layers when the layer is already composited (otherwise the updateBacking() above would have triggered
3542         the work), and when it's a RenderWidget layer.
3543         
3544         Tested by existing tests.
3545
3546         * rendering/RenderLayer.cpp:
3547         (WebCore::outputPaintOrderTreeRecursive):
3548         * rendering/RenderLayerCompositor.cpp:
3549         (WebCore::RenderLayerCompositor::layerStyleChanged):
3550
3551 2018-11-16  Ross Kirsling  <ross.kirsling@sony.com>
3552
3553         Provide default implementation of Widget
3554         https://bugs.webkit.org/show_bug.cgi?id=191784
3555
3556         Reviewed by Michael Catanzaro.
3557
3558         * SourcesWPE.txt:
3559         * platform/Widget.cpp:
3560         (WebCore::Widget::Widget):
3561         (WebCore::Widget::frameRect const):
3562         (WebCore::Widget::~Widget):
3563         (WebCore::Widget::setFrameRect):
3564         (WebCore::Widget::paint):
3565         (WebCore::Widget::setFocus):
3566         (WebCore::Widget::setCursor):
3567         (WebCore::Widget::show):
3568         (WebCore::Widget::hide):
3569         (WebCore::Widget::setIsSelected):
3570         * platform/gtk/WidgetGtk.cpp:
3571         (WebCore::Widget::Widget): Deleted.
3572         (WebCore::Widget::frameRect const): Deleted.
3573         * platform/win/WidgetWin.cpp:
3574         (WebCore::Widget::Widget): Deleted.
3575         (WebCore::Widget::frameRect const): Deleted.
3576         * platform/wpe/WidgetWPE.cpp: Removed.
3577
3578 2018-11-16  Chris Dumez  <cdumez@apple.com>
3579
3580         [macOS] Label "prewarmed" WebContent processes in Activity Monitor
3581         https://bugs.webkit.org/show_bug.cgi?id=191765
3582         <rdar://problem/45953463>
3583
3584         Reviewed by Geoffrey Garen.
3585
3586         * en.lproj/Localizable.strings:
3587
3588 2018-11-16  Jeremy Jones  <jeremyj@apple.com>
3589
3590         Enable external playback for video in element fullscreen.
3591         https://bugs.webkit.org/show_bug.cgi?id=190359
3592         rdar://problem/42560085
3593
3594         Reviewed by Jer Noble.
3595
3596         No new tests because we don't have a good way to test external playback.
3597
3598         Any video that might be auto-pipped from element fullscreen should also enable external playback for video out.
3599         PiP and external playback are mutually exclusive. Instead of preventing PiP when external playback is active,
3600         allow PiP, but disable external playback while PiP is active.
3601
3602         * html/HTMLMediaElement.cpp:
3603         (WebCore::HTMLMediaElement::setVideoFullscreenStandby):
3604         * html/HTMLMediaElement.h:
3605         * platform/graphics/MediaPlayer.cpp:
3606         (WebCore::MediaPlayer::setVideoFullscreenStandby):
3607         (WebCore::MediaPlayer::videoFullscreenStandby const):
3608         * platform/graphics/MediaPlayer.h:
3609         (WebCore::MediaPlayerClient::mediaPlayerVideoFullscreenStandby const):
3610         * platform/graphics/MediaPlayerPrivate.h:
3611         (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenStandby):
3612         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3613         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenStandby):
3614         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
3615
3616 2018-11-16  Jer Noble  <jer.noble@apple.com>
3617
3618         Regression(r233865): Causes synchronous IPC in the middle of layout
3619         https://bugs.webkit.org/show_bug.cgi?id=188307
3620         <rdar://problem/42807306>
3621
3622         Reviewed by Eric Carlson.
3623
3624         Revert the changes added in r233865. Rather than make a syncronous call to the UIProcess to
3625         query whether the view has been backgrounded while (e.g.) JS has been spinning, perform the
3626         steps of the requestFullscreen() method on the next run loop, allowing messages from the
3627         UIProcess about page visibilty to be delivered first.
3628
3629         * dom/Document.cpp:
3630         (WebCore::Document::requestFullScreenForElement):
3631         * html/HTMLMediaElement.cpp:
3632         (WebCore::HTMLMediaElement::enterFullscreen):
3633         * html/HTMLMediaElement.h:
3634         * page/ChromeClient.h:
3635
3636 2018-11-16  Ross Kirsling  <ross.kirsling@sony.com>
3637
3638         Provide default implementation of Cursor
3639         https://bugs.webkit.org/show_bug.cgi?id=191772
3640
3641         Reviewed by Michael Catanzaro.
3642
3643         * SourcesWPE.txt:
3644         * platform/Cursor.cpp:
3645         (WebCore::Cursor::ensurePlatformCursor const):
3646         * platform/wpe/CursorWPE.cpp: Removed.
3647
3648 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
3649
3650         EditorWPE should be EditorLibWPE
3651         https://bugs.webkit.org/show_bug.cgi?id=191774
3652
3653         Reviewed by Michael Catanzaro.
3654
3655         The platform specific implementations of Editor are all around the
3656         platform's Pasteboard. Since the Pasteboard implementation is now based
3657         around USE(LIBWPE) EditorWPE should be renamed to EditorLibWPE.
3658
3659         * SourcesWPE.txt:
3660         * editing/libwpe/EditorLibWPE.cpp: Renamed from Source/WebCore/editing/wpe/EditorWPE.cpp.
3661
3662 2018-11-16  Jeremy Jones  <jeremyj@apple.com>
3663
3664         Include AirPlay destination name in AirPlay placard.
3665         https://bugs.webkit.org/show_bug.cgi?id=191574
3666         rdar://problem/45536144
3667
3668         Reviewed by Eric Carlson.
3669
3670         Updated existing tests.
3671
3672         Include the name of the AirPlay destination in the video element's AirPlay placard.
3673
3674         * Modules/modern-media-controls/controls/airplay-placard.js:
3675         (AirplayPlacard):
3676         * Modules/modern-media-controls/controls/placard.js:
3677         * Modules/modern-media-controls/media/placard-support.js:
3678         (PlacardSupport.prototype._updatePlacard):
3679         (PlacardSupport.prototype._updateAirPlayPlacard):
3680         (PlacardSupport):
3681         * en.lproj/modern-media-controls-localized-strings.js:
3682
3683 2018-11-16  Zalan Bujtas  <zalan@apple.com>
3684
3685         Add DidFirstMeaningfulPaint milestone.
3686         https://bugs.webkit.org/show_bug.cgi?id=191754
3687
3688         Reviewed by Simon Fraser.
3689
3690         This milestone fires sone after the paint triggered by the first visually non-empty layout.
3691
3692         * page/FrameView.cpp:
3693         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
3694         (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
3695         * page/LayoutMilestone.h:
3696
3697 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
3698
3699         Provide default implementations of Image and Icon
3700         https://bugs.webkit.org/show_bug.cgi?id=191764
3701
3702         Reviewed by Michael Catanzaro.
3703
3704         Makes IconWPE and ImageWPE implementations the default.
3705
3706         * Sources.txt:
3707         * SourcesWPE.txt:
3708         * platform/graphics/Icon.cpp: Renamed from Source/WebCore/platform/graphics/wpe/IconWPE.cpp.
3709         * platform/graphics/Image.cpp:
3710         (WebCore::BitmapImage::invalidatePlatformData): Placed here for consistency with implementing ports.
3711         (WebCore::Image::loadPlatformResource):
3712         * platform/graphics/wpe/ImageWPE.cpp: Removed.
3713
3714 2018-11-16  Brent Fulgham  <bfulgham@apple.com>
3715
3716         [Win] Reduce the use of WKSI library calls: CFNetwork
3717         https://bugs.webkit.org/show_bug.cgi?id=191718
3718         <rdar://problem/46108732>
3719
3720         Reviewed by Alex Christensen.
3721
3722         Remove custom WKSI CFNetwork calls, since the SPI is already documented in PAL. Just
3723         make the same calls on Windows, like we did for iOS and macOS back in 2017.
3724
3725         Stop including WebKitSystemInterface.h for files that used to rely on it
3726         for font-related features.
3727         
3728         Tested by existing Windows regression tests. There should be no change in behavior.
3729
3730         * platform/graphics/win/FontCacheWin.cpp:
3731         * platform/graphics/win/FontCustomPlatformData.cpp:
3732         * platform/graphics/win/FontPlatformDataCGWin.cpp:
3733         * platform/network/cf/CookieStorageCFNet.cpp:
3734         * platform/network/cf/CredentialStorageCFNet.cpp:
3735         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3736         (WebCore::createPrivateStorageSession):
3737         (WebCore::NetworkStorageSession::switchToNewTestingSession):
3738         (WebCore::NetworkStorageSession::ensureSession):
3739         * platform/network/cf/ResourceError.h:
3740         * platform/network/cf/ResourceErrorCF.cpp:
3741         (WebCore::getSSLPeerCertificateData):
3742         (WebCore::setSSLPeerCertificateData):
3743         (WebCore::ResourceError::getSSLPeerCertificateDataBytePtr):
3744         (WebCore::ResourceError::platformLazyInit):
3745         (WebCore::ResourceError::cfError const):
3746         * platform/network/cf/ResourceHandleCFNet.cpp:
3747         (WebCore::setClientCertificateInSSLProperties):
3748         (WebCore::ResourceHandle::createCFURLConnection):
3749         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
3750         * platform/network/cf/ResourceRequestCFNet.cpp:
3751         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3752
3753 2018-11-16  Timothy Hatcher  <timothy@apple.com>
3754
3755         Add html{color:text} to the simpleUserAgentStyleSheet on macOS.
3756         https://bugs.webkit.org/show_bug.cgi?id=191760
3757
3758         Reviewed by Antti Koivisto.
3759
3760         * css/CSSDefaultStyleSheets.cpp: Added html{color:text} to simpleUserAgentStyleSheet inside
3761         a PLATFORM(MAC) copy of the string.
3762
3763 2018-11-16  Jer Noble  <jer.noble@apple.com>
3764
3765         An early return from updateSchedulingInfo can leave some variables uninitialized.
3766         https://bugs.webkit.org/show_bug.cgi?id=191755
3767         <rdar://problem/39910089>
3768
3769         Reviewed by Brent Fulgham.
3770
3771         * Modules/webaudio/AudioBufferSourceNode.cpp:
3772         (WebCore::AudioBufferSourceNode::process):
3773         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3774         (WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
3775         * Modules/webaudio/OscillatorNode.cpp:
3776         (WebCore::OscillatorNode::process):
3777
3778 2018-11-16  Alicia Boya García  <aboya@igalia.com>
3779
3780         [MSE][GStreamer] Ignore caps notifications when tearing down the pipeline
3781         https://bugs.webkit.org/show_bug.cgi?id=191578
3782
3783         Reviewed by Xabier Rodriguez-Calvar.
3784
3785         Changing the demuxer to READY state (which is done only in the main
3786         thread) triggers the unlinking of its srcpads, which in turns emits a
3787         caps change notification in the previously linked element since they
3788         become unnegotiated again.
3789
3790         We are not interested in caps notifications in these cases, so let's
3791         just ignore caps notifications emitted from the main thread.
3792
3793         This fixes an assertion failure in the debug builds.
3794
3795         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3796         (WebCore::AppendPipeline::AppendPipeline):
3797
3798 2018-11-16  Sihui Liu  <sihui_liu@apple.com>
3799
3800         Storing blobs in IDB on iOS: "Error preparing blob/file"
3801         https://bugs.webkit.org/show_bug.cgi?id=188438
3802         <rdar://problem/43097279>
3803
3804         Reviewed by Alex Christensen.
3805
3806         Grant sandbox extension of temp folder to network process, because we suggested network process had access to 
3807         the folder on iOS device but it didn't. 
3808
3809         This makes some existing tests about IDB blob pass on iOS device.
3810
3811         * Modules/indexeddb/server/IDBBackingStore.h:
3812         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
3813         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
3814         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
3815         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
3816         * Modules/indexeddb/shared/InProcessIDBServer.h:
3817
3818 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
3819
3820         Add USE(LIBWPE) to WebCore
3821         https://bugs.webkit.org/show_bug.cgi?id=191401
3822
3823         Reviewed by Michael Catanzaro.
3824
3825         No new tests. No change in behavior.
3826
3827         Migrates all PLATFORM(WPE) code that calls into wpe_* APIs to
3828         USE(LIBWPE) instead.
3829
3830         Renames classes and files to use the suffix LibWPE.
3831
3832         * PlatformWPE.cmake:
3833         * SourcesWPE.txt:
3834         * platform/Pasteboard.h:
3835         * platform/PasteboardStrategy.h:
3836         * platform/PlatformKeyboardEvent.h:
3837         * platform/PlatformPasteboard.h:
3838         * platform/graphics/PlatformDisplay.cpp:
3839         (WebCore::PlatformDisplay::createPlatformDisplay):
3840         * platform/graphics/PlatformDisplay.h:
3841         * platform/graphics/egl/GLContextEGL.h:
3842         * platform/graphics/egl/GLContextEGLLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp.
3843         (WebCore::GLContextEGL::createWPEContext):
3844         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3845         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
3846         * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp.
3847         (WebCore::PlatformDisplayLibWPE::create):
3848         (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE):
3849         (WebCore::PlatformDisplayLibWPE::~PlatformDisplayLibWPE):
3850         (WebCore::PlatformDisplayLibWPE::initialize):
3851         * platform/graphics/libwpe/PlatformDisplayLibWPE.h: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.h.
3852         * platform/libwpe/PasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PasteboardWPE.cpp.
3853         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformKeyboardEventWPE.cpp.
3854         * platform/libwpe/PlatformPasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp.
3855
3856 2018-11-16  Zalan Bujtas  <zalan@apple.com>
3857
3858         [iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click).
3859         https://bugs.webkit.org/show_bug.cgi?id=191712
3860         <rdar://problem/45612900>
3861
3862         Reviewed by Simon Fraser.
3863
3864         In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click.
3865         In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar)
3866         and no need to dispatch a click event.
3867         The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely
3868         only for tooltip-like reasons and it's ok to proceed with the click event.
3869
3870         Test: fast/events/touch/ios/click-instead-of-hover-simple.html
3871
3872         * rendering/updating/RenderTreeUpdater.cpp:
3873         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
3874
3875 2018-11-16  Zalan Bujtas  <zalan@apple.com>
3876
3877         [LFC][IFC] Add support for out-of-flow positioned boxes
3878         https://bugs.webkit.org/show_bug.cgi?id=191726
3879
3880         Reviewed by Antti Koivisto.
3881
3882         While laying out formatting context roots (inline-block, floats) in an inline formatting context, we need to make sure
3883         that their out-of-flow descendants get laid out as well.
3884
3885         Test: fast/inline/simple-inline-with-out-of-flow-descendant.html
3886
3887         * layout/inlineformatting/InlineFormattingContext.cpp:
3888         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
3889         * layout/layouttree/LayoutTreeBuilder.cpp: This was returning the wrong context root when the container was also a context root.
3890         (WebCore::Layout::TreeBuilder::createSubTree):
3891
3892 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
3893
3894         [GStreamer][WebRTC] Add API to enable/disable device mocks
3895         https://bugs.webkit.org/show_bug.cgi?id=191699
3896
3897         This basically us to test MediaStream/WebRTC support without
3898         requiring cameras or microphones and is quite useful.
3899
3900         Also fix the GStreamerAudioMock by:
3901           - Stop setting `leaky-upstream` on the GStreamerCapturer queue,
3902             this was usefull when we were trying to bring the MediaStream
3903             sources inside the main pipeline, it is not the case anymore
3904             (and not doable with latest version of LibWebRTC).
3905           - Use a 'ticks' wave on the gstreamer audiotestsrc so the test
3906             stream is similar to what Apple port does.
3907
3908         Reviewed by Xabier Rodriguez-Calvar.
3909
3910         The mocks are already tested and the API is really simple.
3911
3912         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
3913         (WebCore::GStreamerAudioCapturer::createSource):
3914         * platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
3915         * platform/mediastream/gstreamer/GStreamerCapturer.cpp:
3916         (WebCore::GStreamerCapturer::addSink):
3917         * platform/mediastream/gstreamer/GStreamerCapturer.h:
3918
3919 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
3920
3921         [GStreamer][MediaStream] Handle track addition and removal
3922         https://bugs.webkit.org/show_bug.cgi?id=191599
3923
3924         Reviewed by Xabier Rodriguez-Calvar.
3925
3926         Test: fast/mediastream/MediaStream-video-element-remove-track.html
3927
3928         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
3929         (WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver):
3930         (WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver):
3931         (WebCore::webkitMediaStreamSrcFinalize):
3932         (WebCore::webkitMediaStreamSrcChangeState):
3933         (WebCore::webkit_media_stream_src_init):
3934         (WebCore::webkitMediaStreamSrcSetupSrc):
3935         (WebCore::webkitMediaStreamSrcAddTrack):
3936         (WebCore::webkitMediaStreamSrcRemoveTrackByType):
3937         (WebCore::webkitMediaStreamSrcSetStream):
3938
3939 2018-11-16  Zan Dobersek  <zdobersek@igalia.com>
3940
3941         ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
3942         https://bugs.webkit.org/show_bug.cgi?id=191354
3943
3944         Reviewed by Michael Catanzaro.
3945
3946         ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
3947         index validity and, if the index is valid, check for completeness of the
3948         corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
3949         also only retrieve duration for already-complete frames.
3950
3951         Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()