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