Remove RTCRtpTransceiver.setDirection
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-12-19  Youenn Fablet  <youenn@apple.com>
2
3         Remove RTCRtpTransceiver.setDirection
4         https://bugs.webkit.org/show_bug.cgi?id=192869
5
6         Reviewed by Alex Christensen.
7
8         Covered by rebased test.
9
10         * Modules/mediastream/RTCRtpTransceiver.idl:
11
12 2018-12-19  Jer Noble  <jer.noble@apple.com>
13
14         Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync()
15         https://bugs.webkit.org/show_bug.cgi?id=192856
16         <rdar://problem/46843245>
17
18         Reviewed by Alex Christensen.
19
20         Some decoders exposed through VideoToolbox will decode asynchronously even when 
21         kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore.
22
23         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
24         (WebCore::WebCoreDecompressionSession::decodeSampleSync):
25
26 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
27
28         Allow clients to set the navigator platform
29         https://bugs.webkit.org/show_bug.cgi?id=192735
30
31         Reviewed by Tim Horton.
32
33         Expanded TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm.
34
35         Lots of piping to allow the setting of a custom navigator platform.
36
37         * loader/DocumentLoader.h:
38         (WebCore::DocumentLoader::setCustomNavigatorPlatform):
39         (WebCore::DocumentLoader::customNavigatorPlatform const):
40         * loader/FrameLoader.cpp:
41         (WebCore::FrameLoader::navigatorPlatform const):
42         * loader/FrameLoader.h:
43         * page/Navigator.cpp:
44         (WebCore::Navigator::platform const):
45         * page/Navigator.h:
46         * page/NavigatorBase.cpp:
47         (WebCore::NavigatorBase::platform const):
48         (WebCore::NavigatorBase::platform): Deleted.
49         * page/NavigatorBase.h:
50
51 2018-12-19  Ryan Haddad  <ryanhaddad@apple.com>
52
53         Unreviewed, rolling out r239347.
54
55         Caused the leaks bot to hit an exception and the new test
56         crashes on certain configurations.
57
58         Reverted changeset:
59
60         "Synchronous media query evaluation could destroy current
61         Frame/FrameView."
62         https://bugs.webkit.org/show_bug.cgi?id=192781
63         https://trac.webkit.org/changeset/239347
64
65 2018-12-19  Truitt Savell  <tsavell@apple.com>
66
67         Unreviewed, rolling out r239358.
68
69         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
70         crash on Debug bots
71
72         Reverted changeset:
73
74         "Clean up IndexedDB files between tests"
75         https://bugs.webkit.org/show_bug.cgi?id=192796
76         https://trac.webkit.org/changeset/239358
77
78 2018-12-19  Don Olmstead  <don.olmstead@sony.com>
79
80         Sync some include directories in WebCore
81         https://bugs.webkit.org/show_bug.cgi?id=192819
82
83         Reviewed by Michael Catanzaro.
84
85         Added missing include directories around features that have only been enabled on
86         Apple ports. Removes obsolete directories from list and moves harfbuzz directories
87         into the freetype cmake file.
88
89         * CMakeLists.txt:
90         * platform/FreeType.cmake:
91
92 2018-12-19  Alicia Boya García  <aboya@igalia.com>
93
94         [MSE] Remove unused method: stopAskingForMoreSamples()
95         https://bugs.webkit.org/show_bug.cgi?id=192754
96
97         Reviewed by Xabier Rodriguez-Calvar.
98
99         The stopAskingForMoreSamples() method from SourceBufferPrivate is not
100         being used by anyone. SourceBuffer is not calling it and no
101         SourceBufferPrivate is implementing it. Let's remove that noise.
102
103         * platform/graphics/SourceBufferPrivate.h:
104         (WebCore::SourceBufferPrivate::setActive):
105         (WebCore::SourceBufferPrivate::stopAskingForMoreSamples): Deleted.
106         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
107         (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Deleted.
108         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
109
110 2018-12-19  Alicia Boya García  <aboya@igalia.com>
111
112         [MSE] Remove dead code: sourceBufferPrivateSeekToTime()
113         https://bugs.webkit.org/show_bug.cgi?id=192827
114
115         Reviewed by Xabier Rodriguez-Calvar.
116
117         This patch makes two dead code removal changes in
118         SourceBufferPrivateClient:
119
120         First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
121         virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
122         is only inherited by SourceBuffer, it makes no sense to have default
123         implementations there (they will never be used), moreso it being a
124         client interface.
125
126         Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
127         to had an empty implementation, which SourceBuffer did not overwrite,
128         therefore making any calls to it useless.
129
130         All calls to sourceBufferPrivateSeekToTime() have been removed:
131
132         SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
133         itself, used to call this method. This patch deletes it completely.
134
135         MockSourceBufferPrivate::seekToTime(), which only called this empty
136         method, has also been removed along with its only usage in
137         MockMediaSourcePrivate::seekToTime().
138
139         * platform/graphics/SourceBufferPrivateClient.h:
140         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
141         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
142         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
143         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
144         (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
145         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
146         (WebCore::MockMediaSourcePrivate::seekToTime):
147         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
148         (WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
149         * platform/mock/mediasource/MockSourceBufferPrivate.h:
150
151 2018-12-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
152
153         [EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional
154         https://bugs.webkit.org/show_bug.cgi?id=192815
155
156         Reviewed by Jer Noble.
157
158         https://www.w3.org/TR/encrypted-media/#dom-mediakeysystemconfiguration
159         says that distinctiveIdentifier and persistentState default to
160         optional. Our implementation does not define a default leaving it
161         to the first option of the enum, which currently is Required.
162
163         * platform/encryptedmedia/CDMKeySystemConfiguration.h:
164
165 2018-12-19  Rob Buis  <rbuis@igalia.com>
166
167         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
168         https://bugs.webkit.org/show_bug.cgi?id=192288
169
170         Reviewed by Frédéric Wang.
171
172         Prefer return value to out parameter for parseAccessControlAllowList.
173
174         * loader/CrossOriginPreflightResultCache.cpp:
175         (WebCore::CrossOriginPreflightResultCacheItem::parse):
176         * platform/network/HTTPParsers.h:
177         (WebCore::parseAccessControlAllowList):
178         * platform/network/ResourceResponseBase.cpp:
179         (WebCore::ResourceResponseBase::filter):
180         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
181
182 2018-12-18  Zan Dobersek  <zdobersek@igalia.com>
183
184         REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab
185         https://bugs.webkit.org/show_bug.cgi?id=192230
186
187         Reviewed by Carlos Garcia Campos.
188
189         Single tile can after r235165 be assigned multiple content updates
190         without a commit occurring between each update, whereas before these
191         commits were done for each update.
192
193         To avoid repeating updates for a single tile purging information about
194         the previous update, these updates are now accumulated inside a Vector
195         and then iterated over during the commit phase.
196
197         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
198         (WebCore::CoordinatedBackingStoreTile::addUpdate):
199         (WebCore::CoordinatedBackingStoreTile::swapBuffers):
200         (WebCore::CoordinatedBackingStore::updateTile):
201         (WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted.
202         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
203         (WebCore::CoordinatedBackingStoreTile::scale const):
204
205 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
206
207         [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
208         https://bugs.webkit.org/show_bug.cgi?id=192842
209         <rdar://problem/46823586>
210
211         Reviewed by Tim Horton.
212
213         Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
214         registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
215         inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
216         this is internally tracked in <rdar://problem/46830277>.
217
218         * platform/ios/PlatformPasteboardIOS.mm:
219         (WebCore::PlatformPasteboard::write):
220
221 2018-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
222
223         Unreviewed, add a missing UNUSED_PARAM()
224
225         * Modules/mediarecorder/MediaRecorder.cpp:
226         (WebCore::MediaRecorder::getPrivateImpl):
227
228 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
229
230         Update CSS Properties and Values API to use new cycle fallback behaviour
231         https://bugs.webkit.org/show_bug.cgi?id=192800
232
233         Reviewed by Antti Koivisto.
234
235         Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the
236         wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. 
237
238         * css/CSSCustomPropertyValue.h:
239         * css/CSSVariableReferenceValue.cpp:
240         (WebCore::resolveVariableReference):
241         * css/DOMCSSRegisterCustomProperty.cpp:
242         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
243         * css/StyleResolver.cpp:
244         (WebCore::StyleResolver::applyCascadedCustomProperty):
245         * css/parser/CSSPropertyParser.cpp:
246         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
247
248 2018-12-18  Daniel Bates  <dabates@apple.com>
249
250         Wrong value for key property in keydown and keyup events generated holding Control key
251         https://bugs.webkit.org/show_bug.cgi?id=192788
252         <rdar://problem/46795214>
253
254         Reviewed by Wenson Hsieh.
255
256         Similar to what we do on Mac, compute the DOM key property from the characters ignoring
257         modifier keys input string when the Control key is held down.
258
259         * platform/ios/PlatformEventFactoryIOS.mm:
260         (WebCore::keyForKeyEvent):
261         * platform/mac/PlatformEventFactoryMac.mm:
262         (WebCore::keyForKeyEvent):
263
264 2018-12-18  Sihui Liu  <sihui_liu@apple.com>
265
266         Clean up IndexedDB files between tests
267         https://bugs.webkit.org/show_bug.cgi?id=192796
268
269         Reviewed by Geoffrey Garen.
270
271         We should clean up the IndexedDB files between tests to make sure each test is independent of others.
272
273         This patch also fixes some issues in IDB.
274
275         Covered by existing tests.
276
277         * Modules/indexeddb/server/IDBServer.cpp:
278         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
279         We should shut down all open databases instead of databases from open database connections before deleting 
280         files, because database starts accessing files before connection to database is established.
281
282         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
283         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
284         We should shutdown database after tasks in queue are completed, because tasks have pointer of UniqueIDBDatabase 
285         and UniqueIDBDatabase can be destructed after shutdown.
286
287         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
288         didDeleteBackingStore can be posted to main thread after immediateCloseForUserDelete, and timer should not be 
289         invoked during the hard close.
290
291         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
292         Tasks like didOpenBackingStore could be posted from database thread to main thread after 
293         immediateCloseForUserDelete, but we know the backing store will be deleted soon, so no need to handle any 
294         database operation. 
295
296         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
297         performPrefetchCursor needs to be aware of whether UniqueIDBDatabase is being closed, so that it will not access 
298         m_backingStore when m_backingStore may already be deleted. 
299
300         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
301         immediateCloseForUserDelete does not handle transactions that are in the process of commit or abort. 
302         m_objectStoreTransactionCounts and m_objectStoreWriteTransactions may be used by those transactions in 
303         transactionCompleted, so they do not need to be cleared here.
304
305 2018-12-18  Myles C. Maxfield  <mmaxfield@apple.com>
306
307         Thick overlines and line-throughs grow in the wrong direction
308         https://bugs.webkit.org/show_bug.cgi?id=192264
309
310         Reviewed by Dean Jackson.
311
312         Overlines should grow upward, and line-throughs should stay centered.
313
314         Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
315
316         * rendering/TextDecorationPainter.cpp:
317         (WebCore::TextDecorationPainter::paintTextDecoration):
318         * style/InlineTextBoxStyle.cpp:
319         (WebCore::visualOverflowForDecorations):
320
321 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
322
323         Some iOS app crash in FrameLoader::checkCompleted
324         https://bugs.webkit.org/show_bug.cgi?id=192804
325         <rdar://problem/44240573>
326
327         Reviewed by Tim Horton.
328
329         It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
330         is trying to send a delegate message. Disable the release assertion while this is happening
331         so that iOS app would not crash.
332
333         Unfortunately no new test as there is no way to easily test UIWebView in iOS,
334         and this requires a race between the web thread & the main thread.
335
336         * dom/ScriptDisallowedScope.h:
337         (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
338         * platform/ios/wak/WebCoreThread.h:
339         * platform/ios/wak/WebCoreThread.mm:
340         (WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
341         (WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
342         (SendDelegateMessage):
343
344 2018-12-18  David Kilzer  <ddkilzer@apple.com>
345
346         clang-tidy: Use const reference for MediaTime parameter to prevent object copy
347         <https://webkit.org/b/192814>
348
349         Reviewed by Mark Lam.
350
351         * bindings/js/JSDOMConvertNumbers.h:
352         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
353
354 2018-12-18  Justin Fan  <justin_fan@apple.com>
355
356         [WebGPU] BindGroupLayout and Device::createBindGroupLayout
357         https://bugs.webkit.org/show_bug.cgi?id=192817
358
359         Reviewed by Dean Jackson.
360
361         Update bind-group-layouts to test new functionality.
362
363         Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
364         * Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
365         (WebCore::WebGPUBindGroupLayout::create):
366         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
367         * Modules/webgpu/WebGPUBindGroupLayout.h: Added.
368         * Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
369         * Modules/webgpu/WebGPUDevice.cpp:
370         (WebCore::WebGPUDevice::createBindGroupLayout const): Added.
371         * Modules/webgpu/WebGPUDevice.h:
372         * Modules/webgpu/WebGPUDevice.idl:
373         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
374         (WebCore::GPUBindGroupLayout::tryCreate):
375         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
376         * platform/graphics/gpu/GPUBindGroupLayout.h: Added.
377         * platform/graphics/gpu/GPUDevice.cpp:
378         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
379         * platform/graphics/gpu/GPUDevice.h:
380
381         Add files and symbols to project:
382         * CMakeLists.txt:
383         * DerivedSources.make:
384         * Sources.txt:
385         * WebCore.xcodeproj/project.pbxproj:
386         * bindings/js/WebCoreBuiltinNames.h:
387
388         Missing includes that were previously provided via UnifiedSources:
389         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
390         * platform/sql/SQLiteFileSystem.h:
391
392 2018-12-18  Youenn Fablet  <youenn@apple.com>
393
394         Make ReadableStreamXX constructs use PrivateIdentifier
395         https://bugs.webkit.org/show_bug.cgi?id=192771
396
397         Reviewed by Chris Dumez.
398
399         PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
400         Covered by existing binding tests.
401
402         * Modules/streams/ReadableByteStreamController.idl:
403         * Modules/streams/ReadableStreamBYOBReader.idl:
404         * Modules/streams/ReadableStreamBYOBRequest.idl:
405         * Modules/streams/ReadableStreamDefaultController.idl:
406         * Modules/streams/ReadableStreamDefaultReader.idl:
407         * bindings/scripts/CodeGeneratorJS.pm:
408         (NeedsConstructorProperty):
409         * bindings/scripts/preprocess-idls.pl:
410         (shouldExposeInterface):
411         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
412         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
413         * bindings/scripts/test/TestCustomConstructor.idl: Removed.
414
415 2018-12-18  Zalan Bujtas  <zalan@apple.com>
416
417         Synchronous media query evaluation could destroy current Frame/FrameView.
418         https://bugs.webkit.org/show_bug.cgi?id=192781
419         <rdar://problem/34416793>
420
421         Reviewed by Chris Dumez.
422
423         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
424
425         Test: printing/print-with-media-query-destory.html
426
427         * loader/DocumentLoader.cpp:
428         (WebCore::DocumentLoader::finishedLoading):
429         * page/Frame.cpp:
430         (WebCore::Frame::setPrinting):
431         * page/FrameView.cpp:
432         (WebCore::FrameView::forceLayoutForPagination):
433
434 2018-12-18  Joseph Pecoraro  <pecoraro@apple.com>
435
436         Web Inspector: m3u8 content not shown, it should be text
437         https://bugs.webkit.org/show_bug.cgi?id=192731
438         <rdar://problem/46747728>
439
440         Reviewed by Devin Rousso.
441
442         * inspector/NetworkResourcesData.cpp:
443         (WebCore::NetworkResourcesData::setResourceContent):
444         Don't clobber data if setting empty content on a resource that has content.
445
446         * inspector/agents/InspectorNetworkAgent.cpp:
447         (WebCore::InspectorNetworkAgent::shouldTreatAsText):
448         Additional non-"text/" mime types that can be treated as text.
449
450         * platform/MIMETypeRegistry.cpp:
451         (WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
452         * platform/MIMETypeRegistry.h:
453         Detect media playlist mime types that are text (m3u8/m3u).
454
455 2018-12-18  Daniel Bates  <dabates@apple.com>
456
457         Remove <meta http-equiv=set-cookie> support
458         https://bugs.webkit.org/show_bug.cgi?id=185077
459         <rdar://problem/41791397>
460
461         Reviewed by Brent Fulgham.
462
463         Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
464         the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
465         removed support for this pragma and Firefox has an open bug to remove it.
466
467         * dom/Document.cpp:
468         (WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
469         was ignored instead of setting the cookie.
470         * html/parser/XSSAuditor.cpp:
471         (WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
472         as dangerous and erase attribute http-equiv when we find it because we no longer honor
473         this pragma.
474
475 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
476
477         CSS Typed OM should expose attributeStyleMap
478         https://bugs.webkit.org/show_bug.cgi?id=192671
479
480         Reviewed by Ryosuke Niwa.
481
482         Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
483         TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.
484
485         Test: css-typedom/attributeStyleMap.html
486
487         * CMakeLists.txt:
488         * DerivedSources.make:
489         * Sources.txt:
490         * WebCore.xcodeproj/project.pbxproj:
491         * bindings/js/WebCoreBuiltinNames.h:
492         * css/ElementCSSInlineStyle.idl:
493         * css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
494         * css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
495         * css/typedom/StylePropertyMapReadOnly.cpp: Added.
496         (WebCore::StylePropertyMapReadOnly::reifyValue):
497         (WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
498         * css/typedom/StylePropertyMapReadOnly.h:
499         (WebCore::StylePropertyMapReadOnly::create): Deleted.
500         (WebCore::StylePropertyMapReadOnly::get const): Deleted.
501         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
502         * css/typedom/StylePropertyMapReadOnly.idl:
503         * css/typedom/TypedOMCSSImageValue.h:
504         * dom/Element.cpp:
505         (WebCore::Element::attributeStyleMap):
506         (WebCore::Element::setAttributeStyleMap):
507         * dom/Element.h:
508         * dom/ElementRareData.cpp:
509         * dom/ElementRareData.h:
510         (WebCore::ElementRareData::attributeStyleMap):
511         (WebCore::ElementRareData::setAttributeStyleMap):
512         * dom/StyledElement.cpp:
513         (WebCore::StyledElement::ensureAttributeStyleMap):
514         * dom/StyledElement.h:
515         * html/canvas/CanvasRenderingContext2DBase.cpp:
516         (WebCore::size):
517         (WebCore::CanvasRenderingContext2DBase::drawImage):
518         * platform/graphics/CustomPaintImage.cpp:
519         (WebCore::extractComputedProperty):
520         (WebCore::CustomPaintImage::doCustomPaint):
521
522 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
523
524         Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
525         https://bugs.webkit.org/show_bug.cgi?id=192785
526         <rdar://problem/45321184>
527
528         Reviewed by Tim Horton.
529
530         Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
531         currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
532         need to know when the user is typing in a text form control, but the page is preventing default text insertion
533         behavior and instead updating values programmatically.
534
535         Test: fast/forms/call-text-did-change-in-text-field-when-typing.html
536
537         * html/TextFieldInputType.cpp:
538         (WebCore::TextFieldInputType::setValue):
539
540 2018-12-18  Zalan Bujtas  <zalan@apple.com>
541
542         [LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
543         https://bugs.webkit.org/show_bug.cgi?id=192801
544
545         Reviewed by Antti Koivisto.
546
547         * layout/blockformatting/BlockFormattingContext.h:
548         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
549         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
550         * layout/blockformatting/BlockMarginCollapse.cpp:
551         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
552
553 2018-12-18  Zalan Bujtas  <zalan@apple.com>
554
555         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
556         https://bugs.webkit.org/show_bug.cgi?id=192799
557
558         Reviewed by Antti Koivisto.
559
560         * layout/blockformatting/BlockFormattingContext.h:
561         * layout/blockformatting/BlockMarginCollapse.cpp:
562         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
563         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
564
565 2018-12-18  Zalan Bujtas  <zalan@apple.com>
566
567         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
568         https://bugs.webkit.org/show_bug.cgi?id=192798
569
570         Reviewed by Antti Koivisto.
571
572         * layout/blockformatting/BlockFormattingContext.h:
573         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
574         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
575         * layout/blockformatting/BlockMarginCollapse.cpp:
576         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
577         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
578         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
579         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
580
581 2018-12-18  Zalan Bujtas  <zalan@apple.com>
582
583         [LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
584         https://bugs.webkit.org/show_bug.cgi?id=192794
585
586         Reviewed by Antti Koivisto.
587
588         * layout/blockformatting/BlockFormattingContext.h:
589         * layout/blockformatting/BlockMarginCollapse.cpp:
590         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
591         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
592         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
593
594 2018-12-18  Zalan Bujtas  <zalan@apple.com>
595
596         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
597         https://bugs.webkit.org/show_bug.cgi?id=192791
598
599         Reviewed by Antti Koivisto.
600
601         * layout/blockformatting/BlockMarginCollapse.cpp:
602         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
603         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
604
605 2018-12-18  Zalan Bujtas  <zalan@apple.com>
606
607         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
608         https://bugs.webkit.org/show_bug.cgi?id=192787
609
610         Reviewed by Antti Koivisto.
611
612         * layout/blockformatting/BlockFormattingContext.h:
613         * layout/blockformatting/BlockMarginCollapse.cpp:
614         (WebCore::Layout::hasClearance):
615         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
616         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
617         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
618         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
619
620 2018-12-17  Fujii Hironori  <Hironori.Fujii@sony.com>
621
622         [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
623         https://bugs.webkit.org/show_bug.cgi?id=192752
624
625         Reviewed by Don Olmstead.
626
627         No new tests, no behavior changes.
628
629         * platform/graphics/win/DIBPixelData.cpp:
630         Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
631         * platform/graphics/win/FontPlatformDataWin.cpp:
632         (WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
633         * platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
634         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
635         Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
636         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
637         Reorder the initializer list.
638         (WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
639         (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
640         (WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
641         (WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
642         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
643         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
644         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
645         (WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
646         * platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
647         (WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
648         (WebCore::Font::boundsForGDIGlyph const): Ditto.
649         (WebCore::Font::widthForGDIGlyph const): Ditto.
650         * platform/graphics/win/UniscribeController.cpp:
651         (WebCore::UniscribeController::UniscribeController):
652         Reorder the initializer list.
653         (WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
654         (WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.
655
656 2018-12-17  Eric Carlson  <eric.carlson@apple.com>
657
658         [MediaStream] A stream's first video frame should be rendered
659         https://bugs.webkit.org/show_bug.cgi?id=192629
660         <rdar://problem/46664353>
661
662         Reviewed by Youenn Fablet.
663
664         Test: fast/mediastream/media-stream-renders-first-frame.html
665
666         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
667         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
668         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
669         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
670         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
671         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
672         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
673         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
674         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
675         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
676         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
677         * platform/mediastream/RealtimeMediaSource.cpp:
678         (WebCore::RealtimeMediaSource::size const):
679         * platform/mediastream/mac/AVVideoCaptureSource.mm:
680         (WebCore::AVVideoCaptureSource::processNewFrame):
681         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
682         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
683
684 2018-12-17  Justin Michaud  <justin_michaud@apple.com>
685
686         Bindings generator should support Conditional= along with CachedAttribute
687         https://bugs.webkit.org/show_bug.cgi?id=192721
688
689         Reviewed by Ryosuke Niwa.
690
691         Fix a bug where specifying both attributes causes compilation errors because the compile-time
692         condition is not included in the derived code.
693
694         * bindings/scripts/CodeGeneratorJS.pm:
695         (GenerateImplementation):
696         * bindings/scripts/test/JS/JSTestObj.cpp:
697         (WebCore::jsTestObjCachedAttribute3Getter):
698         (WebCore::jsTestObjCachedAttribute3):
699         (WebCore::JSTestObj::visitChildren):
700         * bindings/scripts/test/JS/JSTestObj.h:
701         * bindings/scripts/test/TestObj.idl:
702
703 2018-12-17  David Kilzer  <ddkilzer@apple.com>
704
705         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
706         <https://webkit.org/b/192707>
707         <rdar://problem/46734926>
708
709         Reviewed by Daniel Bates.
710
711         * platform/CPUMonitor.cpp:
712         (WebCore::CPUMonitor::setCPULimit):
713         * platform/CPUMonitor.h:
714         (WebCore::CPUMonitor::setCPULimit):
715         - Change parameter to const reference to fix unnecessary copies.
716
717 2018-12-17  Ryosuke Niwa  <rniwa@webkit.org>
718
719         offsetLeft and offsetParent should adjust across shadow boundaries
720         https://bugs.webkit.org/show_bug.cgi?id=157437
721         <rdar://problem/26154021>
722
723         Reviewed by Simon Fraser.
724
725         Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
726         the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
727         and https://github.com/w3c/webcomponents/issues/763
728
729         The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
730         In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
731         the one which is in the same tree as a shadow-inclusive ancestor of the context object.
732
733         For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
734         inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
735         then its offset parent, etc... until we find the offset parent in the same tree as the context object.
736
737         Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
738         (e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
739         the same tree as the context object but as well as any offset parent which is in its ancestor trees.
740
741         Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html
742
743         * dom/Element.cpp:
744         (WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
745         (WebCore::collectAncestorTreeScopeAsHashSet): Added.
746         (WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
747         which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
748         (WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
749         (WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
750         until it finds the first offset parent which is a shadow-including ancestor.
751         (WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
752         (WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
753         functions meant to be used for bindings code.
754         * dom/Element.h:
755         * html/HTMLElement.idl:
756
757 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
758
759         Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
760         https://bugs.webkit.org/show_bug.cgi?id=192780
761         rdar://problem/43394387
762
763         Reviewed by Tim Horton.
764         
765         macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
766         memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.
767         
768         Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
769         and consult it when making decisions that affect layer backing store format.
770
771         Tested by new results for existing tests.
772
773         * platform/graphics/FontCascade.cpp:
774         (WebCore::FontCascade::isSubpixelAntialiasingAvailable):
775         * platform/graphics/FontCascade.h:
776         * platform/graphics/cocoa/FontCascadeCocoa.mm:
777         (WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
778         it once.
779         * rendering/RenderLayerBacking.cpp:
780         (WebCore::RenderLayerBacking::updateAfterDescendants):
781         * testing/Internals.cpp:
782         (WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore::
783
784 2018-12-17  Daniel Bates  <dabates@apple.com>
785
786         Make DocumentMarker::allMarkers() constexpr
787         https://bugs.webkit.org/show_bug.cgi?id=192634
788
789         Reviewed by Simon Fraser.
790
791         The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
792         it constexpr to do just that.
793
794         * dom/DocumentMarker.h:
795         (WebCore::DocumentMarker::allMarkers):
796
797 2018-12-17  Justin Fan  <justin_fan@apple.com>
798
799         [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
800         https://bugs.webkit.org/show_bug.cgi?id=192726
801
802         Reviewed by Myles C. Maxfield.
803
804         Test: webgpu/bind-group-layouts.html
805         Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
806         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
807         * Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
808         * Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
809         * Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
810         * Modules/webgpu/WebGPUShaderStageBit.h: Added.
811         * Modules/webgpu/WebGPUShaderStageBit.idl: Added.
812         * platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
813         * platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.
814
815         Add the new symbols and files to the project:
816         * CMakeLists.txt:
817         * DerivedSources.make:
818         * Sources.txt:
819         * WebCore.xcodeproj/project.pbxproj:
820         * bindings/js/WebCoreBuiltinNames.h:
821
822         Small FIXME update for later:
823         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
824         (WebCore::GPURenderPassEncoder::setVertexBuffers):
825
826 2018-12-17  Zalan Bujtas  <zalan@apple.com>
827
828         Unreviewed build fix.
829
830         * page/ios/FrameIOS.mm:
831         (WebCore::Frame::interpretationsForCurrentRoot const):
832
833 2018-12-17  Zalan Bujtas  <zalan@apple.com>
834
835         Reproducible ASSERTion failure when toggling layer borders with find-in-page up
836         https://bugs.webkit.org/show_bug.cgi?id=192762
837         <rdar://problem/46676873>
838
839         Reviewed by Simon Fraser.
840
841         DocumentMarkerController::markersFor() should take a reference instead of a Node*.
842
843         Test: editing/document-marker-null-check.html
844
845         * dom/DocumentMarkerController.cpp:
846         (DocumentMarkerController::hasMarkers):
847         * dom/DocumentMarkerController.h:
848         * editing/AlternativeTextController.cpp:
849         (WebCore::AlternativeTextController::respondToChangedSelection):
850         * editing/Editor.cpp:
851         (WebCore::Editor::selectionStartHasMarkerFor const):
852         * rendering/InlineTextBox.cpp:
853         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
854         * rendering/RenderReplaced.cpp:
855         (WebCore::RenderReplaced::paint):
856         * rendering/RenderText.cpp:
857         (WebCore::RenderText::draggedContentRangesBetweenOffsets const):
858         * rendering/SimpleLineLayout.cpp:
859         (WebCore::SimpleLineLayout::canUseForWithReason):
860         * testing/Internals.cpp:
861         (WebCore::Internals::markerCountForNode):
862
863 2018-12-17  Commit Queue  <commit-queue@webkit.org>
864
865         Unreviewed, rolling out r239265 and r239274.
866         https://bugs.webkit.org/show_bug.cgi?id=192765
867
868         unorm_normalize is deprecated, and broke an internal build
869         (Requested by Truitt on #webkit).
870
871         Reverted changesets:
872
873         "[GTK][WPE] Need a function to convert internal URI to display
874         ("pretty") URI"
875         https://bugs.webkit.org/show_bug.cgi?id=174816
876         https://trac.webkit.org/changeset/239265
877
878         "Fix the Apple Internal Mac build with a newer SDK"
879         https://trac.webkit.org/changeset/239274
880
881 2018-12-17  Daniel Bates  <dabates@apple.com>
882
883         [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
884         https://bugs.webkit.org/show_bug.cgi?id=192633
885
886         Reviewed by Wenson Hsieh.
887
888         UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
889         input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
890         for binary compatibility.
891
892         * platform/ios/WebEvent.h:
893         * platform/ios/WebEvent.mm:
894         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.
895
896 2018-12-17  Matt Lewis  <jlewis3@apple.com>
897
898         Unreviewed, rolling out r239254.
899
900         This broke the Windows 10 Debug build
901
902         Reverted changeset:
903
904         "Replace many uses of String::format with more type-safe
905         alternatives"
906         https://bugs.webkit.org/show_bug.cgi?id=192742
907         https://trac.webkit.org/changeset/239254
908
909 2018-12-17  Antoine Quint  <graouts@apple.com>
910
911         [Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
912         https://bugs.webkit.org/show_bug.cgi?id=192758
913
914         Reviewed by Dean Jackson.
915
916         We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
917         gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
918         less bookkeeping to perform.
919
920         No new test since there is no user-observable change.
921
922         * animation/WebAnimation.cpp:
923         (WebCore::WebAnimation::updateFinishedState):
924         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
925         (WebCore::WebAnimation::performMicrotask): Deleted.
926         * animation/WebAnimation.h:
927
928 2018-12-17  Antoine Quint  <graouts@apple.com>
929
930         [Web Animations] Ensure we don't update an animation's finished state twice when updating animations
931         https://bugs.webkit.org/show_bug.cgi?id=192757
932
933         Reviewed by Dean Jackson.
934
935         When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
936         twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of
937         whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
938         next call to resolve(), unless any of the timing properties have changed in the meantime.
939
940         No new test since there is no user-observable change.
941
942         * animation/WebAnimation.cpp:
943         (WebCore::WebAnimation::timingDidChange):
944         (WebCore::WebAnimation::tick):
945         (WebCore::WebAnimation::resolve):
946         * animation/WebAnimation.h:
947
948 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
949
950         REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
951         https://bugs.webkit.org/show_bug.cgi?id=192725
952         rdar://problem/46011418
953
954         Reviewed by Antoine Quint.
955
956         There were two problems with backing store attachment and animation.
957         
958         First, animations are an input into the "backing store attached" logic, so when they change
959         we should set the CoverageRectChanged bit on GraphicsLayerCA.
960         
961         Secondly, when an ancestor has unknown animation extent, all its descendants need to
962         get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
963         the current layer has no animation extent.
964
965         Tests: compositing/backing/animate-into-view-with-descendant.html
966                compositing/backing/animate-into-view.html
967
968         * platform/graphics/ca/GraphicsLayerCA.cpp:
969         (WebCore::GraphicsLayerCA::addAnimation):
970         (WebCore::GraphicsLayerCA::removeAnimation):
971         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
972
973 2018-12-17  Zalan Bujtas  <zalan@apple.com>
974
975         [LFC][BFC][MarginCollapsing] Unify margin collapse function naming
976         https://bugs.webkit.org/show_bug.cgi?id=192747
977
978         Reviewed by Antti Koivisto.
979
980         Rename some margin collapse getters.
981
982         * layout/blockformatting/BlockFormattingContext.h:
983         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
984         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
985         * layout/blockformatting/BlockMarginCollapse.cpp:
986         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
987         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
988         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
989         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
990         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
991         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
992         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
993         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
994         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
995         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
996         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
997         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
998         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
999         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
1000         (WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
1001         (WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
1002         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
1003         (WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
1004         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
1005         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.
1006
1007 2018-12-17  David Kilzer  <ddkilzer@apple.com>
1008
1009         clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
1010         <https://webkit.org/b/192751>
1011         <rdar://problem/46771623>
1012
1013         Reviewed by Daniel Bates.
1014
1015         Change loop variables to const references to avoid unnecessary
1016         copies.
1017
1018         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1019         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
1020         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1021         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
1022         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1023         (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
1024         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1025         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
1026         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
1027         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
1028         (WebCore::IDBDatabaseInfo::loggingString const):
1029         * Modules/mediasource/SourceBuffer.cpp:
1030         (WebCore::removeSamplesFromTrackBuffer):
1031         * accessibility/AccessibilityRenderObject.cpp:
1032         (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
1033         * accessibility/AccessibilityTableRow.cpp:
1034         (WebCore::AccessibilityTableRow::headerObject):
1035         * animation/KeyframeEffect.cpp:
1036         (WebCore::KeyframeEffect::computedNeedsForcedLayout):
1037         * crypto/keys/CryptoKeyRSA.cpp:
1038         (WebCore::CryptoKeyRSA::importJwk):
1039         (WebCore::CryptoKeyRSA::exportJwk const):
1040         * css/CSSComputedStyleDeclaration.cpp:
1041         (WebCore::OrderedNamedLinesCollector::appendLines const):
1042         * dom/DataTransfer.cpp:
1043         (WebCore::readURLsFromPasteboardAsString):
1044         * dom/TreeScope.cpp:
1045         (WebCore::TreeScope::elementsFromPoint):
1046         * html/track/WebVTTParser.cpp:
1047         (WebCore::WebVTTParser::checkAndStoreRegion):
1048         * inspector/agents/InspectorTimelineAgent.cpp:
1049         (WebCore::InspectorTimelineAgent::setInstruments):
1050         * page/Page.cpp:
1051         (WebCore::Page::updateIntersectionObservations):
1052         * page/TextIndicator.cpp:
1053         (WebCore::estimatedBackgroundColorForRange):
1054         * page/animation/KeyframeAnimation.cpp:
1055         (WebCore::KeyframeAnimation::computeLayoutDependency):
1056         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1057         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
1058         * platform/graphics/ca/GraphicsLayerCA.cpp:
1059         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
1060         (WebCore::GraphicsLayerCA::updateAnimations):
1061         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
1062         * platform/graphics/mac/ImageMac.mm:
1063         (WebCore::BitmapImage::tiffRepresentation):
1064         * rendering/HitTestResult.cpp:
1065         (WebCore::HitTestResult::append):
1066         * testing/Internals.cpp:
1067         (WebCore::Internals::acceleratedAnimationsForElement):
1068
1069 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
1070
1071         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
1072         https://bugs.webkit.org/show_bug.cgi?id=174816
1073
1074         Reviewed by Michael Catanzaro.
1075
1076         Tests: enabled fast/url/user-visible/.
1077
1078         * testing/Internals.cpp:
1079         (WebCore::Internals::userVisibleString): Enable method on all platforms.
1080
1081 2018-12-15  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1082
1083         Null pointer dereference in JSC::WriteBarrierBase()
1084         https://bugs.webkit.org/show_bug.cgi?id=191252
1085
1086         Reviewed by Keith Miller.
1087
1088         * bindings/js/JSCustomElementRegistryCustom.cpp:
1089         (WebCore::JSCustomElementRegistry::whenDefined):
1090         * bindings/js/JSDOMPromiseDeferred.cpp:
1091         (WebCore::createDeferredPromise):
1092         * bindings/js/JSDOMPromiseDeferred.h:
1093         (WebCore::DeferredPromise::create):
1094         (WebCore::callPromiseFunction):
1095         * bindings/js/JSDOMWindowBase.cpp:
1096         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
1097         (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
1098         * bindings/js/ScriptModuleLoader.cpp:
1099         (WebCore::ScriptModuleLoader::fetch):
1100         (WebCore::rejectPromise):
1101
1102 2018-12-15  Darin Adler  <darin@apple.com>
1103
1104         Use warning-ignoring macros more consistently and simply
1105         https://bugs.webkit.org/show_bug.cgi?id=192743
1106
1107         Reviewed by Mark Lam.
1108
1109         * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
1110         IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
1111         files like this one with non-clang compilers, and no need to worry about
1112         them when choosing the macro.
1113
1114         * crypto/mac/CryptoKeyRSAMac.cpp:
1115         (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
1116
1117         * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
1118         the "unknown-pragmas" trick, which the macro should take care of.
1119         * css/makevalues.pl: Ditto.
1120         * platform/ColorData.gperf: Ditto.
1121
1122         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1123         (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
1124         (see rationale above for Objective-C++).
1125
1126         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1127         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
1128         ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
1129         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1130         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.
1131
1132         * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
1133         (see rationale above for Objective-C++).
1134
1135         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1136         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
1137         Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
1138
1139         * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
1140         (see rationale above for Objective-C++).
1141
1142         * platform/network/cocoa/ResourceResponseCocoa.mm:
1143         (WebCore::ResourceResponse::platformCertificateInfo const): Use
1144         ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
1145
1146 2018-12-15  Darin Adler  <darin@apple.com>
1147
1148         Replace many uses of String::format with more type-safe alternatives
1149         https://bugs.webkit.org/show_bug.cgi?id=192742
1150
1151         Reviewed by Mark Lam.
1152
1153         A while back, String::format was more efficient than string concatenation,
1154         but that is no longer true, and we should prefer String::number, makeString,
1155         or concatenation with the "+" operator to String::format for new code.
1156
1157         This is not as good for programmers who are fond of printf formatting
1158         style, and in some cases it's a little harder to read the strings
1159         interspersed with variables rather than a format string, but it's better
1160         in a few ways:
1161
1162         - more efficient (I didn't measure the difference, but it's definitely
1163           slower to use String::Format which calls vsnprintf twice than to use
1164           the WTF code)
1165         - works in a type-safe way without a need to use a format specifier such
1166           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
1167           subtle differences between platforms
1168         - allows us to use StringView in some cases to sidestep the need to
1169           allocate temporary WTF::String objects
1170         - does not require converting each WTF::String to a C string, allowing
1171           us to remove many cases of ".utf8().data()" and similar expressions,
1172           eliminating the allocation of temporary WTF::CString objects
1173
1174         This patch covers a batch of easiest-to-convert call sites.
1175         Later patches will allow us to deprecate or remove String::format.
1176
1177         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1178         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
1179         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
1180         (WebCore::IDBCursorInfo::loggingString const): Ditto.
1181         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
1182         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
1183         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
1184         (WebCore::IDBGetRecordData::loggingString const): Ditto.
1185         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
1186         (WebCore::IDBIndexInfo::loggingString const): Ditto.
1187         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
1188         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
1189         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
1190         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1191         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
1192         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
1193         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
1194         * Modules/webdatabase/Database.cpp:
1195         (WebCore::formatErrorMessage): Ditto.
1196         * Modules/webdatabase/SQLError.h:
1197         (WebCore::SQLError::create): Ditto.
1198
1199         * bindings/scripts/CodeGeneratorJS.pm:
1200         (GenerateImplementation): Use makeString.
1201
1202         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1203         * bindings/scripts/test/JS/JSMapLike.cpp:
1204         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1205         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1206         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1207         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1208         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1209         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1210         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1211         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1212         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1213         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1214         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1215         * bindings/scripts/test/JS/JSTestException.cpp:
1216         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1217         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1218         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1219         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1220         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1221         * bindings/scripts/test/JS/JSTestInterface.cpp:
1222         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1223         * bindings/scripts/test/JS/JSTestIterable.cpp:
1224         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1225         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1226         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1227         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1228         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1229         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1230         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1231         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1232         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1233         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1234         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1235         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1236         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1237         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1238         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1239         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1240         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1241         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1242         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1243         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1244         * bindings/scripts/test/JS/JSTestNode.cpp:
1245         * bindings/scripts/test/JS/JSTestObj.cpp:
1246         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1247         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1248         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1249         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1250         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1251         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1252         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1253         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1254         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1255         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1256         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1257         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1258         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1259         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1260         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1261         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1262         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1263         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1264         Updated expected results.
1265 :
1266         * css/parser/CSSPropertyParserHelpers.cpp:
1267         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
1268         and makeString.
1269
1270         * html/HTMLSelectElement.cpp:
1271         (WebCore::HTMLSelectElement::setLength): Use makeString.
1272         * html/ImageDocument.cpp:
1273         (WebCore::ImageDocument::imageUpdated): Ditto.
1274         * html/parser/XSSAuditor.cpp:
1275         (WebCore::XSSAuditor::init): Ditto.
1276         * inspector/InspectorFrontendClientLocal.cpp:
1277         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
1278         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
1279         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
1280         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
1281         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
1282         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
1283         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
1284         * page/MemoryRelease.cpp:
1285         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
1286
1287         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1288         (WebCore::formatByteNumber): Use String::number.
1289         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
1290
1291         * page/cocoa/ResourceUsageThreadCocoa.mm:
1292         (WebCore::logFootprintComparison): Use makeString.
1293         * platform/animation/TimingFunction.cpp:
1294         (WebCore::TimingFunction::cssText const): Ditto.
1295
1296         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1297         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
1298         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
1299         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
1300
1301         * platform/graphics/ca/GraphicsLayerCA.cpp:
1302         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
1303         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
1304         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
1305         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
1306         * platform/mock/MockRealtimeVideoSource.cpp:
1307         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
1308
1309         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
1310
1311         * platform/network/ParsedContentRange.cpp:
1312         (WebCore::ParsedContentRange::headerValue const): Use makeString.
1313
1314         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
1315         compiler conditionals and reorganized the start/stop of namespaces.
1316         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
1317
1318         * platform/sql/SQLiteDatabase.cpp:
1319         (WebCore::unauthorizedSQLFunction): Use makeString.
1320         * rendering/RenderLayerCompositor.cpp:
1321         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
1322         * workers/service/server/RegistrationDatabase.cpp:
1323         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
1324         (WebCore::RegistrationDatabase::importRecords): Ditto.
1325
1326 2018-12-15  Youenn Fablet  <youenn@apple.com>
1327
1328         Make RTCRtpSender.setParameters to activate specific encodings
1329         https://bugs.webkit.org/show_bug.cgi?id=192732
1330
1331         Reviewed by Eric Carlson.
1332
1333         The conversion between libwebrtc and WebCore is lossy for send parameters.
1334         Libwebrtc checking the differences of values, call to setParameters will often fail.
1335
1336         Given some parameters cannot be exposed, the sender backend keeps the
1337         current set of parameters when gathered and reuses them when parameters are set.
1338
1339         For encodings, we only change activate/maxBitRate/maxFrameRate as
1340         these are the most important parameters to be able to modify.
1341
1342         Covered by added tests in webrtc/video.html.
1343
1344         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1345         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
1346         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
1347         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
1348         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1349         (WebCore::fromRTCRtpSendParameters):
1350         (WebCore::fromRTCEncodingParameters): Deleted.
1351         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
1352
1353 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
1354
1355         Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
1356         https://bugs.webkit.org/show_bug.cgi?id=192724
1357         <rdar://problem/46745911>
1358
1359         Reviewed by Devin Rousso.
1360
1361         iOS never installs the InspectorOverlay page as a page overlay.
1362         It also uses its own node highlighting painting. Avoid any work
1363         and resources associated with the overlay page for iOS.
1364
1365         * inspector/InspectorOverlay.cpp:
1366         (WebCore::InspectorOverlay::paint):
1367         (WebCore::InspectorOverlay::update):
1368         (WebCore::InspectorOverlay::overlayPage):
1369         (WebCore::evaluateCommandInOverlay):
1370
1371 2018-12-14  Youenn Fablet  <youenn@apple.com>
1372
1373         MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
1374         https://bugs.webkit.org/show_bug.cgi?id=192720
1375
1376         Reviewed by Eric Carlson.
1377
1378         Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
1379         as the latter is a ref counted object.
1380         Made some refactoring to return early in case of error.
1381
1382         Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
1383         the MediaRecorder will stop listening for its tracks.
1384         Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.
1385
1386         Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html
1387
1388         * Modules/mediarecorder/MediaRecorder.cpp:
1389         (WebCore::MediaRecorder::didAddOrRemoveTrack):
1390         (WebCore::MediaRecorder::setNewRecordingState): Deleted.
1391         * Modules/mediarecorder/MediaRecorder.h:
1392         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
1393         (WebCore::MediaRecorderPrivateAVFImpl::create):
1394         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
1395         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
1396         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
1397         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
1398         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
1399         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
1400         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
1401         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1402         (WebCore::MediaRecorderPrivateWriter::create):
1403         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
1404         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
1405         (WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.
1406
1407 2018-12-14  Youenn Fablet  <youenn@apple.com>
1408
1409         getSenders/getReceivers() should not return closed transceiver senders/receivers
1410         https://bugs.webkit.org/show_bug.cgi?id=192706
1411
1412         Reviewed by Eric Carlson.
1413
1414         Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a
1415         This forces us to compute the sender/receiver list at getter call time.
1416         Updated the internal call sites of senders to use the list of transceivers instead.
1417
1418         Covered by updated WPT tests.
1419
1420         * Modules/mediastream/RTCPeerConnection.cpp:
1421         (WebCore::RTCPeerConnection::addTrack):
1422         (WebCore::RTCPeerConnection::getSenders const):
1423         (WebCore::RTCPeerConnection::getReceivers const):
1424         * Modules/mediastream/RTCPeerConnection.h:
1425         * Modules/mediastream/RTCRtpTransceiver.cpp:
1426         (WebCore::RTCRtpTransceiver::stopped const):
1427         (WebCore::RtpTransceiverSet::append):
1428         (WebCore::RtpTransceiverSet::senders const):
1429         (WebCore::RtpTransceiverSet::receivers const):
1430         * Modules/mediastream/RTCRtpTransceiver.h:
1431         (WebCore::RtpTransceiverSet::senders const): Deleted.
1432         (WebCore::RtpTransceiverSet::receivers const): Deleted.
1433         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1434         (WebCore::findExistingSender):
1435         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1436
1437 2018-12-14  David Kilzer  <ddkilzer@apple.com>
1438
1439         clang-tidy: Fix unnecessary copy of objects for operator==() methods
1440         <https://webkit.org/b/192712>
1441         <rdar://problem/46739332>
1442
1443         Reviewed by Andy Estes.
1444
1445         * contentextensions/HashableActionList.h:
1446         (WebCore::ContentExtensions::HashableActionList::operator== const):
1447         (WebCore::ContentExtensions::HashableActionList::operator!= const):
1448         * platform/network/FormData.h:
1449         (WebCore::FormDataElement::EncodedFileData::operator== const):
1450         (WebCore::FormDataElement::EncodedBlobData::operator== const):
1451         - Change arguments from const to const reference to avoid
1452           copies.
1453
1454 2018-12-14  Jer Noble  <jer.noble@apple.com>
1455
1456         CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&)
1457         https://bugs.webkit.org/show_bug.cgi?id=192713
1458         <rdar://problem/46739706>
1459
1460         Reviewed by Eric Carlson.
1461
1462         A callback is being called twice, and the second time has a null Promise. Instead of these
1463         callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and
1464         have ASSERTS() that they are called once-and-only-once.
1465
1466         * platform/encryptedmedia/CDMInstanceSession.h:
1467         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1468         (WebCore::CDMInstanceSessionClearKey::closeSession):
1469         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1470         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
1471         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
1472         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
1473         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
1474         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
1475
1476 2018-12-14  David Kilzer  <ddkilzer@apple.com>
1477
1478         clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/
1479         <https://webkit.org/b/192708>
1480         <rdar://problem/46735907>
1481
1482         Reviewed by Jer Noble.
1483
1484         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1485         (WebCore::toSample):
1486         - Make argument a const reference.
1487
1488         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1489         - Update method signatures for implementation changes.
1490         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1491         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAsset):
1492         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
1493         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
1494         - Make RetainPtr<> argument an rvalue reference and use WTFMove().
1495         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
1496         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
1497         - Make RetainPtr<> argument a const reference.
1498
1499         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1500         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
1501         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
1502         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
1503         - Change for loop keys to be const references.
1504
1505         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1506         - Update method signatures for implementation changes.
1507         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1508         (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime):
1509         (WebCore::SourceBufferPrivateAVFObjC::seekToTime):
1510         - Make Mediatime arguments a const reference.
1511
1512 2018-12-14  Simon Fraser  <simon.fraser@apple.com>
1513
1514         REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear
1515         https://bugs.webkit.org/show_bug.cgi?id=188655
1516         rdar://problem/43382687
1517
1518         Reviewed by Antoine Quint.
1519
1520         The logic that computes animation extent, used by backing store attachment code, failed
1521         to account for the behavior where a keyframe animation with a missing 0% keyframe uses
1522         the transform from the unanimated style. This resulted in the computed extent being wrong,
1523         which caused us to remove the layer's backing store in some scenarios.
1524
1525         Fix both animation code paths to use the renderer style if the first keyframe doesn't
1526         contain a transform.
1527
1528         Tests: compositing/backing/backing-store-attachment-empty-keyframe.html
1529                legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html
1530
1531         * animation/KeyframeEffect.cpp:
1532         (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
1533         * page/animation/KeyframeAnimation.cpp:
1534         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
1535
1536 2018-12-14  Chris Dumez  <cdumez@apple.com>
1537
1538         [PSON] Stop exposing PolicyAction::Suspend to WebCore
1539         https://bugs.webkit.org/show_bug.cgi?id=192701
1540
1541         Reviewed by Brady Eidson.
1542
1543         Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore.
1544
1545         * loader/DocumentLoader.cpp:
1546         (WebCore::DocumentLoader::continueAfterContentPolicy):
1547         * loader/FrameLoaderTypes.h:
1548         * loader/PolicyChecker.cpp:
1549         (WebCore::PolicyChecker::checkNavigationPolicy):
1550         (WebCore::PolicyChecker::checkNewWindowPolicy):
1551
1552 2018-12-14  Youenn Fablet  <youenn@apple.com>
1553
1554         IDB should store RTCCertificate
1555         https://bugs.webkit.org/show_bug.cgi?id=192599
1556
1557         Reviewed by Brady Eidson.
1558
1559         In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate.
1560         Instead, create an empty object so that the deserialization can still succeed.
1561         This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper.
1562
1563         Test: webrtc/certificates-indexeddb.html
1564
1565         * bindings/js/SerializedScriptValue.cpp:
1566         (WebCore::CloneDeserializer::readTerminal):
1567
1568 2018-12-14  Zalan Bujtas  <zalan@apple.com>
1569
1570         [LFC][BFC] Transition to logical margin types.
1571         https://bugs.webkit.org/show_bug.cgi?id=192699
1572
1573         Reviewed by Antti Koivisto.
1574
1575         This is in preparation for moving over to logical types.
1576         (This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin))
1577
1578         * layout/FormattingContext.cpp:
1579         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1580         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1581         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1582         * layout/FormattingContext.h:
1583         * layout/FormattingContextGeometry.cpp:
1584         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
1585         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1586         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1587         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1588         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1589         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1590         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1591         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1592         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1593         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1594         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1595         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1596         * layout/FormattingContextQuirks.cpp:
1597         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1598         * layout/MarginTypes.h:
1599         (WebCore::Layout::VerticalMargin::usedValues const):
1600         * layout/Verification.cpp:
1601         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1602         * layout/blockformatting/BlockFormattingContext.cpp:
1603         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
1604         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
1605         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
1606         (WebCore::Layout::hasPrecomputedMarginBefore):
1607         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1608         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1609         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1610         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1611         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1612         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted.
1613         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted.
1614         (WebCore::Layout::hasPrecomputedMarginTop): Deleted.
1615         * layout/blockformatting/BlockFormattingContext.h:
1616         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1617         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1618         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1619         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1620         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1621         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1622         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
1623         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore):
1624         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter):
1625         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted.
1626         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted.
1627         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1628         (WebCore::Layout::hasMarginBeforeQuirkValue):
1629         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1630         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore):
1631         (WebCore::Layout::hasMarginTopQuirkValue): Deleted.
1632         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted.
1633         * layout/blockformatting/BlockMarginCollapse.cpp:
1634         (WebCore::Layout::isMarginBeforeCollapsedWithSibling):
1635         (WebCore::Layout::isMarginAfterCollapsedWithSibling):
1636         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent):
1637         (WebCore::Layout::isMarginAfterCollapsedThrough):
1638         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
1639         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
1640         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
1641         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
1642         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
1643         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
1644         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent):
1645         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter):
1646         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
1647         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
1648         (WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted.
1649         (WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted.
1650         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted.
1651         (WebCore::Layout::isMarginBottomCollapsedThrough): Deleted.
1652         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
1653         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted.
1654         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
1655         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
1656         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted.
1657         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted.
1658         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
1659         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
1660         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
1661         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted.
1662         * layout/displaytree/DisplayBox.cpp:
1663         (WebCore::Display::Box::Box):
1664         (WebCore::Display::Box::marginBox const):
1665         (WebCore::Display::Box::nonCollapsedMarginBox const):
1666         * layout/displaytree/DisplayBox.h:
1667         (WebCore::Display::Box::rectWithMargin const):
1668         (WebCore::Display::Box::estimatedMarginBefore const):
1669         (WebCore::Display::Box::setEstimatedMarginBefore):
1670         (WebCore::Display::Box::top const):
1671         (WebCore::Display::Box::topLeft const):
1672         (WebCore::Display::Box::setVerticalMargin):
1673         (WebCore::Display::Box::marginBefore const):
1674         (WebCore::Display::Box::marginStart const):
1675         (WebCore::Display::Box::marginAfter const):
1676         (WebCore::Display::Box::marginEnd const):
1677         (WebCore::Display::Box::nonCollapsedMarginBefore const):
1678         (WebCore::Display::Box::nonCollapsedMarginAfter const):
1679         (WebCore::Display::Box::nonComputedMarginStart const):
1680         (WebCore::Display::Box::nonComputedMarginEnd const):
1681         (WebCore::Display::Box::estimatedMarginTop const): Deleted.
1682         (WebCore::Display::Box::setEstimatedMarginTop): Deleted.
1683         (WebCore::Display::Box::marginTop const): Deleted.
1684         (WebCore::Display::Box::marginLeft const): Deleted.
1685         (WebCore::Display::Box::marginBottom const): Deleted.
1686         (WebCore::Display::Box::marginRight const): Deleted.
1687         (WebCore::Display::Box::nonCollapsedMarginTop const): Deleted.
1688         (WebCore::Display::Box::nonCollapsedMarginBottom const): Deleted.
1689         (WebCore::Display::Box::nonComputedMarginLeft const): Deleted.
1690         (WebCore::Display::Box::nonComputedMarginRight const): Deleted.
1691         * layout/floats/FloatAvoider.cpp:
1692         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
1693         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
1694         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
1695         * layout/floats/FloatAvoider.h:
1696         (WebCore::Layout::FloatAvoider::marginBefore const):
1697         (WebCore::Layout::FloatAvoider::marginAfter const):
1698         (WebCore::Layout::FloatAvoider::marginStart const):
1699         (WebCore::Layout::FloatAvoider::marginEnd const):
1700         (WebCore::Layout::FloatAvoider::marginBoxWidth const):
1701         (WebCore::Layout::FloatAvoider::marginTop const): Deleted.
1702         (WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
1703         (WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
1704         (WebCore::Layout::FloatAvoider::marginRight const): Deleted.
1705         * layout/floats/FloatBox.cpp:
1706         (WebCore::Layout::FloatBox::rect const):
1707         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
1708         (WebCore::Layout::FloatBox::verticalPositionCandidate):
1709         (WebCore::Layout::FloatBox::initialVerticalPosition const):
1710         * layout/floats/FloatingContext.cpp:
1711         (WebCore::Layout::FloatingContext::positionForFloat const):
1712         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1713         * layout/inlineformatting/InlineFormattingContext.cpp:
1714         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1715
1716 2018-12-14  Zalan Bujtas  <zalan@apple.com>
1717
1718         [LFC][BFC] Introduce VerticalMargin and HorizontalMargin types.
1719         https://bugs.webkit.org/show_bug.cgi?id=192692
1720
1721         Reviewed by Antti Koivisto.
1722
1723         This is in preparation for completing block margin collapsing.
1724
1725         * WebCore.xcodeproj/project.pbxproj:
1726         * layout/FormattingContext.cpp:
1727         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1728         * layout/FormattingContext.h:
1729         * layout/FormattingContextGeometry.cpp:
1730         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1731         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1732         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1733         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1734         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1735         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1736         * layout/LayoutState.cpp:
1737         (WebCore::Layout::LayoutState::LayoutState):
1738         * layout/LayoutUnits.h:
1739         (WebCore::Layout::HeightAndMargin::usedMarginValues const): Deleted.
1740         * layout/MarginTypes.h: Added.
1741         (WebCore::Layout::VerticalMargin::nonCollapsedValues const):
1742         (WebCore::Layout::VerticalMargin::collapsedValues const):
1743         (WebCore::Layout::VerticalMargin::setCollapsedValues):
1744         (WebCore::Layout::VerticalMargin::VerticalMargin):
1745         (WebCore::Layout::VerticalMargin::usedValues const):
1746         * layout/blockformatting/BlockFormattingContext.cpp:
1747         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1748         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1749         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1750         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1751         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1752         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1753         * layout/displaytree/DisplayBox.cpp:
1754         (WebCore::Display::Box::Box):
1755         * layout/displaytree/DisplayBox.h:
1756         (WebCore::Display::Box::setHorizontalMargin):
1757         (WebCore::Display::Box::setVerticalMargin):
1758         (WebCore::Display::Box::setHorizontalNonComputedMargin):
1759         (WebCore::Display::Box::verticalMargin const):
1760         (WebCore::Display::Box::marginTop const):
1761         (WebCore::Display::Box::marginLeft const):
1762         (WebCore::Display::Box::marginBottom const):
1763         (WebCore::Display::Box::marginRight const):
1764         (WebCore::Display::Box::nonCollapsedMarginTop const):
1765         (WebCore::Display::Box::nonCollapsedMarginBottom const):
1766         (WebCore::Display::Box::setVerticalNonCollapsedMargin): Deleted.
1767         * layout/floats/FloatingContext.cpp:
1768         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1769         * layout/inlineformatting/InlineFormattingContext.cpp:
1770         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
1771
1772 2018-12-14  Fujii Hironori  <Hironori.Fujii@sony.com>
1773
1774         [Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
1775         https://bugs.webkit.org/show_bug.cgi?id=192693
1776
1777         Reviewed by Ross Kirsling.
1778
1779         No new tests, no behavior changes.
1780
1781         * platform/win/ClipboardUtilitiesWin.cpp: Reordered ClipboardDataItem members to match with the initializer list.
1782         * platform/win/CursorWin.cpp:
1783         (WebCore::loadCursorByName): Changed the argument type of 'name' to const char*.
1784         * platform/win/DefWndProcWindowClass.cpp:
1785         (WebCore::defWndProcWindowClassName): Removed an unused variable 'atom'.
1786         * platform/win/DragImageWin.cpp: Removed an unused variable 'MinDragLabelWidthBeforeClip'.
1787         * platform/win/PasteboardWin.cpp:
1788         (WebCore::createGlobalImageFileDescriptor): Removed an unused variable 'hr'.
1789         (WebCore::createGlobalHDropContent): Use reinterpret_cast to suppress warning.
1790         * platform/win/PlatformMouseEventWin.cpp:
1791         (WebCore::PlatformMouseEvent::PlatformMouseEvent): Reordered the initializer list.
1792         * platform/win/PopupMenuWin.cpp:
1793         (WebCore::PopupMenuWin::paint): Removed an unused variable 'itemCount'.
1794         * platform/win/PopupMenuWin.h: Marked override methods with 'override'.
1795         * platform/win/SSLKeyGeneratorWin.cpp:
1796         (WebCore::getSupportedKeySizes): Removed WebCore namespace prefix in WebCore namespace.
1797         (WebCore::signedPublicKeyAndChallengeString): Ditto.
1798         * platform/win/SearchPopupMenuDB.cpp:
1799         (WebCore::SearchPopupMenuDB::createPreparedStatement): Use ASSERT_UNUSED instead of ASSERT.
1800         * platform/win/StructuredExceptionHandlerSuppressor.h: Enclosed m_savedExceptionRegistration with #if defined(_M_IX86).
1801         * platform/win/SystemInfo.cpp:
1802         (WebCore::osVersionForUAString): Added default case.
1803
1804 2018-12-13  Youenn Fablet  <youenn@apple.com>
1805
1806         RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected
1807         https://bugs.webkit.org/show_bug.cgi?id=192685
1808
1809         Reviewed by Eric Carlson.
1810
1811         In case the remote description contains a rejected m section,
1812         the corresponding transceiver should be marked as stopped.
1813         Libwebrtc backend has that information so pipe it up to JS.
1814
1815         Covered by updated WPT test.
1816
1817         * Modules/mediastream/RTCRtpTransceiver.cpp:
1818         (WebCore::RTCRtpTransceiver::stopped const):
1819         * Modules/mediastream/RTCRtpTransceiver.h:
1820         (WebCore::RTCRtpTransceiver::stopped const): Deleted.
1821         * Modules/mediastream/RTCRtpTransceiverBackend.h:
1822         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
1823         (WebCore::LibWebRTCRtpTransceiverBackend::stopped const):
1824         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
1825
1826 2018-12-13  Mark Lam  <mark.lam@apple.com>
1827
1828         Ensure that StructureFlags initialization always starts with Base::StructureFlags.
1829         https://bugs.webkit.org/show_bug.cgi?id=192686
1830
1831         Reviewed by Keith Miller.
1832
1833         No new tests needed because there's no new functionality.  Just refactoring.
1834
1835         * bindings/js/JSDOMWindowProperties.h:
1836         * bindings/scripts/CodeGeneratorJS.pm:
1837         (GenerateHeader):
1838         (GeneratePrototypeDeclaration):
1839         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1840         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
1841         * bindings/scripts/test/JS/JSTestEventTarget.h:
1842         * bindings/scripts/test/JS/JSTestGlobalObject.h:
1843         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
1844         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
1845         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
1846         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
1847         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
1848         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
1849         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
1850         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
1851         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
1852         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
1853         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
1854         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
1855         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
1856         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
1857         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
1858         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
1859         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
1860         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
1861         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
1862         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
1863         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
1864         * bindings/scripts/test/JS/JSTestObj.h:
1865         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1866         * bindings/scripts/test/JS/JSTestPluginInterface.h:
1867         * bindings/scripts/test/JS/JSTestTypedefs.h:
1868
1869 2018-12-13  Ryosuke Niwa  <rniwa@webkit.org>
1870
1871         Make HTMLConverter work across shadow boundaries
1872         https://bugs.webkit.org/show_bug.cgi?id=192640
1873
1874         Reviewed by Wenson Hsieh.
1875
1876         Made HTMLConverter work with shadow boundaries by replacing the various tree traversal functions.
1877
1878         Tests: editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html
1879                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html
1880                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html
1881                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html
1882                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html
1883                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html
1884                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html
1885                editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-3.html
1886
1887         * dom/Position.cpp:
1888         (WebCore::commonShadowIncludingAncestor): Moved from markup.cpp to be shared between HTMLConverter
1889         and serializePreservingVisualAppearanceInternal.
1890         * dom/Position.h:
1891         * editing/cocoa/HTMLConverter.mm:
1892         (HTMLConverter::convert):
1893         (HTMLConverterCaches::propertyValueForNode):
1894         (HTMLConverterCaches::floatPropertyValueForNode):
1895         (HTMLConverter::_blockLevelElementForNode):
1896         (HTMLConverterCaches::colorPropertyValueForNode):
1897         (HTMLConverter::aggregatedAttributesForAncestors):
1898         (HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
1899         (HTMLConverter::_processElement):
1900         (HTMLConverter::_traverseNode):
1901         (HTMLConverter::_traverseFooterNode):
1902         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
1903         (WebCore::attributedStringFromSelection):
1904         * editing/markup.cpp:
1905         (WebCore::commonShadowIncludingAncestor): Moved to Position.cpp.
1906
1907 2018-12-13  Youenn Fablet  <youenn@apple.com>
1908
1909         Trying to play a media element synchronously after setting srcObject should succeed without user gesture
1910         https://bugs.webkit.org/show_bug.cgi?id=192679
1911
1912         Reviewed by Eric Carlson.
1913
1914         Check the srcObject mediaProvider value which is set synchronously.
1915         Covered by updated fast/mediastream/local-audio-playing-event.html.
1916
1917         * html/HTMLMediaElement.h:
1918         (WebCore::HTMLMediaElement::hasMediaStreamSrcObject const):
1919
1920 2018-12-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1921
1922         [iOS] Support dropping contact card data (public.vcard) in editable content
1923         https://bugs.webkit.org/show_bug.cgi?id=192570
1924         <rdar://problem/35626913>
1925
1926         Reviewed by Tim Horton.
1927
1928         Adds support for accepting vCard (.vcf) data via drop on iOS. See below for more details.
1929
1930         Tests:  DragAndDropTests.ExternalSourceContactIntoEditableAreas
1931                 DragAndDropTests.ExternalSourceMapItemAndContactToUploadArea
1932                 DragAndDropTests.ExternalSourceMapItemIntoEditableAreas
1933                 WKAttachmentTestsIOS.InsertDroppedContactAsAttachment
1934                 WKAttachmentTestsIOS.InsertDroppedMapItemAsAttachment
1935
1936         * editing/WebContentReader.h:
1937         * editing/cocoa/WebContentReaderCocoa.mm:
1938         (WebCore::attachmentForFilePath):
1939
1940         Pull out logic to create an attachment from a file path out into a static helper. Use this in `readFilePaths`
1941         as well as `readVirtualContactFile`.
1942
1943         (WebCore::WebContentReader::readFilePaths):
1944         (WebCore::WebContentReader::readVirtualContactFile):
1945
1946         Add a pasteboard reading method that reads a vCard file (with an optional URL) as web content. The resulting
1947         fragment consists of either an anchor and an attachment element, or just an attachment element if the URL is
1948         empty. In the case of an `MKMapItem`, the URL is populated, so we generate both elements; when dragging a
1949         contact, there is no associated URL, so we only have an attachment.
1950
1951         * platform/Pasteboard.h:
1952         * platform/ios/PasteboardIOS.mm:
1953         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
1954
1955         Augment this to take the current `PasteboardItemInfo` as well; use this item information to get a file path for
1956         "public.vcard" data, which is then passed on to the web content reader. Additionally, by returning
1957         `ReaderResult::DidNotReadType` here, we prevent the web content reader from extracting the plain text contents
1958         of the vCard and dumping it as plain text in the editable element (this would otherwise happen, since
1959         "public.vcard" conforms to "public.text").
1960
1961         (WebCore::Pasteboard::read):
1962         (WebCore::Pasteboard::readRespectingUTIFidelities):
1963         * platform/ios/WebItemProviderPasteboard.mm:
1964         (-[NSItemProvider web_fileUploadContentTypes]):
1965
1966         Prevent the "com.apple.mapkit.map-item" UTI from being considered as file upload content. This special case is
1967         tricky, since "com.apple.mapkit.map-item" conforms to "public.content", yet its corresponding data is only
1968         suitable for deserialization into an `MKMapItem`.
1969
1970 2018-12-13  Devin Rousso  <drousso@apple.com>
1971
1972         Web Inspector: remove DOM.BackendNodeId and associated commands/events
1973         https://bugs.webkit.org/show_bug.cgi?id=192478
1974
1975         Reviewed by Matt Baker.
1976
1977         Removing unused code, so no change in functionality.
1978
1979         * inspector/agents/InspectorDOMAgent.h:
1980         * inspector/agents/InspectorDOMAgent.cpp:
1981         (WebCore::InspectorDOMAgent::discardBindings):
1982         (WebCore::InspectorDOMAgent::backendNodeIdForNode): Deleted.
1983         (WebCore::InspectorDOMAgent::releaseBackendNodeIds): Deleted.
1984         (WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend): Deleted.
1985
1986 2018-12-13  Chris Dumez  <cdumez@apple.com>
1987
1988         [PSON] We should not need to navigate to 'about:blank' to suspend pages
1989         https://bugs.webkit.org/show_bug.cgi?id=192668
1990         <rdar://problem/46701466>
1991
1992         Reviewed by Alex Christensen.
1993
1994         * history/PageCache.cpp:
1995         (WebCore::PageCache::addIfCacheable):
1996         * history/PageCache.h:
1997         * loader/DocumentLoader.cpp:
1998         (WebCore::DocumentLoader::redirectReceived):
1999         (WebCore::DocumentLoader::willSendRequest):
2000         (WebCore::DocumentLoader::startLoadingMainResource):
2001         * loader/DocumentLoader.h:
2002         * loader/FrameLoader.cpp:
2003         (WebCore::FrameLoader::init):
2004         (WebCore::FrameLoader::stopAllLoaders):
2005         (WebCore::FrameLoader::setDocumentLoader):
2006         (WebCore::FrameLoader::commitProvisionalLoad):
2007         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2008         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2009         * loader/FrameLoaderTypes.h:
2010         * loader/PolicyChecker.cpp:
2011         (WebCore::PolicyChecker::checkNavigationPolicy):
2012         * loader/PolicyChecker.h:
2013
2014 2018-12-13  Per Arne Vollan  <pvollan@apple.com>
2015
2016         [macOS] Inline WebVTT styles should override styles from Captions settings in System Preferences
2017         https://bugs.webkit.org/show_bug.cgi?id=192638
2018
2019         Reviewed by Eric Carlson.
2020
2021         It is currently not possible to override caption styles generated from System Preferences with inline
2022         WebVTT styles without adding !important. The reason for this is that the generated styles from
2023         System preferences are author styles which have higher priority than the inline WebVTT styles, which
2024         are user agent styles in the video user agent shadow tree. This can be fixed by moving the generated
2025         styles to the video user agent shadow tree. Inline WebVTT styles will then have higher priority since
2026         they are added after the generated styles. This patch also fixes a problem where inline styles could be
2027         added twice to the video user agent shadow root.
2028
2029         Test: media/track/track-cue-css.html
2030
2031         * dom/ExtensionStyleSheets.cpp:
2032         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
2033         * html/track/VTTCue.cpp:
2034         (WebCore::VTTCue::getDisplayTree):
2035         * page/CaptionUserPreferences.cpp:
2036         (WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
2037         * page/Page.cpp:
2038         (WebCore::Page::setCaptionUserPreferencesStyleSheet):
2039
2040 2018-12-13  Jer Noble  <jer.noble@apple.com>
2041
2042         Fix leak of AVPlayer boundaryTimeObserver object.
2043         https://bugs.webkit.org/show_bug.cgi?id=192674
2044
2045         Reviewed by Eric Carlson.
2046
2047         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2048         (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):
2049
2050 2018-12-13  Brent Fulgham  <bfulgham@apple.com>
2051
2052         Don't attempt to animate invalid CSS properties
2053         https://bugs.webkit.org/show_bug.cgi?id=192630
2054         <rdar://problem/46664433>
2055
2056         Reviewed by Antoine Quint.
2057
2058         Inherited animation properties can cause child elements to think they need to animate CSS properties
2059         that they do not support, leading to nullptr crashes.
2060
2061         Recognize that CSSPropertyInvalid is a potential requested animation property, and handle it
2062         cleanly.
2063
2064         Tests: animations/invalid-property-animation.html
2065
2066         * page/animation/CompositeAnimation.cpp:
2067         (WebCore::CompositeAnimation::updateTransitions):
2068         * svg/SVGAnimateElementBase.cpp:
2069         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2070
2071 2018-12-13  Timothy Hatcher  <timothy@apple.com>
2072
2073         REGRESSION (r230064): Focus rings on webpages are fainter than in native UI.
2074         https://bugs.webkit.org/show_bug.cgi?id=192639
2075         rdar://problem/42669297
2076
2077         Reviewed by Tim Horton.
2078
2079         The focus ring color passed to CoreGraphics is expected to be opaque, since they
2080         will apply opacity when drawing (because opacity is normally animated).
2081         We were getting this by accident before when the old `RenderThemeMac::systemColor()`
2082         used the old `convertNSColorToColor()`, which ignored alpha on NSColor.
2083         Existing tests use fixed test focus ring color.
2084
2085         * css/StyleResolver.cpp:
2086         (WebCore::StyleResolver::colorFromPrimitiveValue const): Use RenderTheme singleton for `focusRingColor()`.
2087         * html/canvas/CanvasRenderingContext2D.cpp:
2088         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Ditto.
2089         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
2090         (WebCore::drawFocusRingAtTime): Use `CGContextStateSaver`.
2091         * platform/mac/ThemeMac.mm:
2092         (WebCore::drawCellFocusRingWithFrameAtTime): Force alpha to 1 on the focus ring color. Use `CGContextStateSaver`.
2093         * rendering/RenderElement.cpp:
2094         (WebCore::RenderElement::paintFocusRing): Use RenderTheme singleton for `focusRingColor()`.
2095         * rendering/RenderImage.cpp:
2096         (WebCore::RenderImage::paintAreaElementFocusRing): Ditto.
2097         * rendering/RenderTheme.cpp:
2098         (WebCore::RenderTheme::focusRingColor const): Made const. Cache the result of `platformFocusRingColor()`.
2099         * rendering/RenderTheme.h: Made `focusRingColor()` a member function instead of static.
2100         * rendering/RenderThemeMac.mm:
2101         (WebCore::RenderThemeMac::platformFocusRingColor const): Force alpha to 1 on the focus ring color.
2102         (WebCore::RenderThemeMac::systemColor const): Use `focusRingColor()`, instead of caching color here.
2103
2104 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
2105
2106         [MediaStream] Calculate width or height when constraints contain only the other
2107         https://bugs.webkit.org/show_bug.cgi?id=192632
2108         <rdar://problem/46665734>
2109
2110         Unreviewed, remove an unneeded assert.
2111
2112         * platform/mediastream/RealtimeVideoSource.cpp:
2113         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers):
2114
2115 2018-12-13  Zach Li  <zachli@apple.com>
2116
2117         Update Credit Card AutoFill button icon
2118         https://bugs.webkit.org/show_bug.cgi?id=192637
2119         rdar://problem/46545006
2120
2121         Reviewed by Chris Dumez.
2122
2123         * css/html.css:
2124         (input::-webkit-credit-card-auto-fill-button):
2125
2126 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
2127
2128         [MediaStream] Calculate width or height when constraints contain only the other
2129         https://bugs.webkit.org/show_bug.cgi?id=192632
2130         <rdar://problem/46665734>
2131
2132         Reviewed by Youenn Fablet.
2133
2134         Test: fast/mediastream/constraint-intrinsic-size.html
2135
2136         * platform/graphics/RemoteVideoSample.cpp:
2137         (WebCore::RemoteVideoSample::create): Log errors with RELEASE_LOG_ERROR.
2138
2139         * platform/graphics/cv/ImageTransferSessionVT.h:
2140         (WebCore::ImageTransferSessionVT::pixelFormat const): New.
2141
2142         * platform/mediastream/RealtimeMediaSource.cpp:
2143         (WebCore::RealtimeMediaSource::setSizeAndFrameRate): Replace current size with new size.
2144         (WebCore::RealtimeMediaSource::setSize): Don't notify about width and height.
2145         (WebCore::RealtimeMediaSource::size const): Use intrinsic size when necessary.
2146         (WebCore::RealtimeMediaSource::setIntrinsicSize): New.
2147         (WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Deleted.
2148         * platform/mediastream/RealtimeMediaSource.h:
2149
2150         * platform/mediastream/RealtimeVideoSource.cpp:
2151         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): No more remoteVideoSampleAvailable.
2152
2153         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2154         (WebCore::DisplayCaptureSourceCocoa::settings): Report size correctly.
2155         (WebCore::DisplayCaptureSourceCocoa::frameSize const): Use intrinsicSize().
2156         (WebCore::DisplayCaptureSourceCocoa::emitFrame): No more remoteVideoSampleAvailable.
2157         (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): Deleted.
2158         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
2159         (WebCore::DisplayCaptureSourceCocoa::intrinsicSize const): Deleted.
2160
2161         * platform/mock/MockRealtimeVideoSource.cpp:
2162         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Report intrinsic size.
2163         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Minor cleanup.
2164         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRateWithPreset):  Report intrinsic size.
2165         (WebCore::MockRealtimeVideoSource::drawText): Don't render preset info for display source.
2166         * platform/mock/MockRealtimeVideoSource.h:
2167
2168 2018-12-13  David Kilzer  <ddkilzer@apple.com>
2169
2170         clang-tidy: loop variable is copied but only used as const reference in Document.cpp, Element.cpp
2171         <https://webkit.org/b/192661>
2172         <rdar://problem/46694035>
2173
2174         Reviewed by Daniel Bates.
2175
2176         * dom/Document.cpp:
2177         (WebCore::Document::updateIntersectionObservations):
2178         (WebCore::Document::notifyIntersectionObserversTimerFired):
2179         * dom/Element.cpp:
2180         (WebCore::Element::didMoveToNewDocument):
2181         (WebCore::Element::disconnectFromIntersectionObservers):
2182         - Change loop variables from `auto` to `const auto&` to prevent
2183           unnecessary copies of WeakPtr<IntersectionObserver> or
2184           struct IntersectionObserverRegistration objects.
2185
2186 2018-12-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2187
2188         [FreeType] Remove HarfBuzzFace
2189         https://bugs.webkit.org/show_bug.cgi?id=192589
2190
2191         Reviewed by Michael Catanzaro.
2192
2193         This was used to share the common implementation with the chromium port, but now that only freetype based ports
2194         use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
2195         since we are already caching glyphs in Font.
2196
2197         * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
2198         * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
2199         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
2200         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2201         (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
2202         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
2203         OpenType math.
2204         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2205         (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
2206         (WebCore::doubleToHarfBuzzPosition): Ditto.
2207         (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
2208         functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
2209         (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
2210         (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
2211         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
2212         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
2213         * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
2214         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
2215         * platform/graphics/harfbuzz/HbUniquePtr.h:
2216         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
2217         * platform/graphics/opentype/OpenTypeMathData.cpp:
2218         (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
2219
2220 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2221
2222         [FreeType] Add initial implementation of variation fonts
2223         https://bugs.webkit.org/show_bug.cgi?id=192151
2224
2225         Reviewed by Michael Catanzaro.
2226
2227         * css/CSSFontFaceSource.cpp:
2228         (WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
2229         * loader/cache/CachedFont.cpp:
2230         (WebCore::CachedFont::platformDataFromCustomData): Ditto.
2231         * platform/graphics/FontPlatformData.h:
2232         (WebCore::FontPlatformData::isFixedWidth const):
2233         * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
2234         * platform/graphics/freetype/FontCacheFreeType.cpp:
2235         (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
2236         pattern.
2237         (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
2238         (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
2239         before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
2240         (WebCore::defaultVariationValues): Parse font variations table.
2241         (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
2242         * platform/graphics/freetype/FontCacheFreeType.h: Added.
2243         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2244         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
2245         (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
2246         (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
2247         (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
2248         FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
2249         (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
2250         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2251         (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
2252         FC_FONT_VARIATIONS value from the pattern.
2253         (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
2254         pattern.
2255         (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
2256         (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
2257         (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
2258         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2259         (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
2260         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2261         (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
2262         * platform/graphics/win/FontCustomPlatformData.cpp:
2263         (WebCore::FontCustomPlatformData::fontPlatformData):
2264         * platform/graphics/win/FontCustomPlatformData.h:
2265
2266 2018-12-12  Fujii Hironori  <Hironori.Fujii@sony.com>
2267
2268         [Win][Clang][WebKitLegacy] WebFrame.cpp: warning: delete called on non-final 'WebFrame' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
2269         https://bugs.webkit.org/show_bug.cgi?id=192618
2270
2271         Reviewed by Alex Christensen.
2272
2273         No new tests, no behavior changes.
2274
2275         * platform/win/PopupMenuWin.h:
2276         * platform/win/WCDataObject.cpp:
2277         * platform/win/WCDataObject.h:
2278
2279 2018-12-12  Simon Fraser  <simon.fraser@apple.com>
2280
2281         REGRESSION (r238090): CAPCHA UI jumps to the wrong location
2282         https://bugs.webkit.org/show_bug.cgi?id=192651
2283         rdar://problem/46531919
2284
2285         Reviewed by Zalan Bujtas.
2286         
2287         When a RenderLayer becomes non-composited because of a style change, we need to set a dirty
2288         bit to say that descendants need their geometry updated (because they now have to
2289         compute their positions relative to a different ancestor). This wasn't happening
2290         in the layerStyleChanged() code path.
2291         
2292         In the code path that did do this correctly (in the computeCompositingRequirements() tree walk),
2293         we can address a FIXME and only dirty direct children, not all descendants (that code was
2294         written before the child-only dirty bit existed).
2295
2296         Test: compositing/geometry/update-child-geometry-on-compositing-change.html
2297
2298         * rendering/RenderLayerCompositor.cpp:
2299         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2300         (WebCore::RenderLayerCompositor::layerStyleChanged):
2301
2302 2018-12-13  Ryosuke Niwa  <rniwa@webkit.org>
2303
2304         Make TextInputController.legacyAttributedString take DOM nodes and offsets
2305         https://bugs.webkit.org/show_bug.cgi?id=192653
2306
2307         Reviewed by Wenson Hsieh.
2308
2309         No new tests since there should be no observable behavioral change other than
2310         TextInputController API in DumpRenderTree.
2311
2312         * editing/cocoa/HTMLConverter.h:
2313         * editing/cocoa/HTMLConverter.mm:
2314         (WebCore::attributedStringFromSelection):
2315         (WebCore::attributedStringBetweenStartAndEnd): Added.
2316
2317 2018-12-12  Ryosuke Niwa  <rniwa@webkit.org>
2318
2319         Fix macOS builds after r239145.
2320
2321         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2322
2323 2018-12-12  Simon Fraser  <simon.fraser@apple.com>
2324
2325         REGRESSION (r238357): Pins on Yelp map disappear
2326         https://bugs.webkit.org/show_bug.cgi?id=192597
2327         rdar://problem/46578285
2328
2329         Reviewed by Zalan Bujtas.
2330
2331         RenderLayerCompositor::updateBackingAndHierarchy() had a bug where if a RenderLayer gained
2332         a negative z-order child (triggering creation of a foreground layer), we'd fail to 
2333         call the "setChildren()" with the vector containing that foreground layer.
2334         
2335         When updateBackingAndHierarchy() stops visiting descendants because none are composited,
2336         it may still have to update the child list with the foreground layer, so make sure
2337         the code handles this case.
2338
2339         Tests: compositing/z-order/add-negative-z-child.html
2340                compositing/z-order/rebuild-sibling-of-layer-with-foreground-layer.html
2341
2342         * rendering/RenderLayer.cpp:
2343         (WebCore::outputPaintOrderTreeRecursive):
2344         * rendering/RenderLayerCompositor.cpp:
2345         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2346
2347 2018-12-12  YUHAN WU  <yuhan_wu@apple.com>
2348
2349         Implement non-timeslice mode encoding for MediaRecorder
2350         https://bugs.webkit.org/show_bug.cgi?id=192069
2351         <rdar://problem/46443290>
2352
2353         Reviewed by Eric Carlson.
2354
2355         Implement the encoding for non-timeslice mode of MediaRecorder.
2356         It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods.
2357         Add a API in internals to allow testings to turn on the mock source.
2358
2359         Test: http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html
2360
2361         * Modules/mediarecorder/MediaRecorder.cpp:
2362         (WebCore::MediaRecorder::create):
2363         (WebCore::MediaRecorder::setCustomPrivateRecorderCreator):
2364         (WebCore::MediaRecorder::getPrivateImpl):
2365         (WebCore::MediaRecorder::MediaRecorder):
2366         (WebCore::MediaRecorder::stopRecording):
2367         (WebCore::MediaRecorder::stopRecordingInternal):
2368         (WebCore::MediaRecorder::createRecordingDataBlob):
2369         (WebCore::MediaRecorder::scheduleDeferredTask):
2370         * Modules/mediarecorder/MediaRecorder.h:
2371         * Modules/mediarecorder/MediaRecorder.idl:
2372         * SourcesCocoa.txt:
2373         * WebCore.xcodeproj/project.pbxproj:
2374         * platform/mediarecorder/MediaRecorderPrivate.h:
2375         (WebCore::MediaRecorderPrivate::stopRecording):
2376         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added.
2377         (WebCore::MediaRecorderPrivateAVFImpl::create):
2378         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
2379         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
2380         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
2381         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
2382         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
2383         (WebCore::MediaRecorderPrivateAVFImpl::mimeType):
2384         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added.
2385         * platform/mediarecorder/MediaRecorderPrivateMock.cpp:
2386         (WebCore::MediaRecorderPrivateMock::fetchData):
2387         (WebCore::MediaRecorderPrivateMock::mimeType):
2388         * platform/mediarecorder/MediaRecorderPrivateMock.h:
2389         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: added.
2390         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added.
2391         (WebCore::MediaRecorderPrivateWriter::clear):
2392         (WebCore::MediaRecorderPrivateWriter::setupWriter):
2393         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
2394         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
2395         (WebCore::copySampleBufferWithCurrentTimeStamp):
2396         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
2397         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
2398         (WebCore::MediaRecorderPrivateWriter::stopRecording):
2399         * testing/Internals.cpp:
2400         (WebCore::createRecorderMockSource):
2401         (WebCore::Internals::setCustomPrivateRecorderCreator):
2402         * testing/Internals.h:
2403         * testing/Internals.idl:
2404
2405 2018-12-12  Justin Fan  <justin_fan@apple.com>
2406
2407         [WebGPU] Vertex buffers and WebGPUInputState
2408         https://bugs.webkit.org/show_bug.cgi?id=192611
2409
2410         Reviewed by Dean Jackson.
2411
2412         Test: webgpu/vertex-buffer-triangle-strip.html
2413
2414         Basic implementation of vertex buffers with Metal shading language in WebGPU. In 
2415         WebGPURenderPipelineDescriptor, refactor to match updated shader stage structure and add 
2416         WebGPUInputStateDescriptor. Also implement WebGPURenderPassEncoder::setVertexBuffers.
2417
2418         Add symbols and files for WebGPUIndexFormat, WebGPUInputStateDescriptor, WebGPUInputStepMode, 
2419         WebGPUVertexAttributeDescriptor, WebGPUVertexFormat, WebGPUVertexInputDescriptor:
2420         * CMakeLists.txt:
2421         * DerivedSources.make:
2422         * Sources.txt:
2423         * WebCore.xcodeproj/project.pbxproj:
2424         * bindings/js/WebCoreBuiltinNames.h:
2425
2426         Add and implement interfaces and dictionaries for WebGPUInputState:
2427         * Modules/webgpu/WebGPUBuffer.cpp:
2428         (WebCore::WebGPUBuffer::WebGPUBuffer):
2429         * Modules/webgpu/WebGPUBuffer.h:
2430         (WebCore::WebGPUBuffer::buffer const): Added getter for backing GPUBuffer.
2431         * Modules/webgpu/WebGPUBufferDescriptor.h:
2432         * Modules/webgpu/WebGPUBufferDescriptor.idl: Moving WebGPUBufferUsage out into its own IDL.
2433         * Modules/webgpu/WebGPUDevice.h:
2434         * Modules/webgpu/WebGPUIndexFormat.h: Added.
2435         * Modules/webgpu/WebGPUIndexFormat.idl: Added. 
2436         * Modules/webgpu/WebGPUInputStateDescriptor.h: Added.
2437         * Modules/webgpu/WebGPUInputStateDescriptor.idl: Added.
2438         * Modules/webgpu/WebGPUInputStepMode.h: Added.
2439         * Modules/webgpu/WebGPUInputStepMode.idl: Added.
2440         * Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Added.
2441         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl: Added.
2442         * Modules/webgpu/WebGPUVertexFormat.h: Added.
2443         * Modules/webgpu/WebGPUVertexFormat.idl: Added.
2444         * Modules/webgpu/WebGPUVertexInputDescriptor.h: Added.
2445         * Modules/webgpu/WebGPUVertexInputDescriptor.idl: Added.
2446         * platform/graphics/gpu/GPUInputStateDescriptor.h: Added.
2447         * platform/graphics/gpu/GPURenderPassEncoder.h: Added.
2448         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Added.
2449         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h: Added.
2450         * platform/graphics/gpu/GPUVertexInputDescriptor.h: Added.
2451
2452         Refactor to support updated structure of pipeline descriptor in sketch IDL:
2453         * Modules/webgpu/WebGPUDevice.cpp:
2454         (WebCore::validateAndConvertPipelineStage):
2455         (WebCore::WebGPUDevice::createRenderPipeline const):
2456         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
2457         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
2458         * Modules/webgpu/WebGPUPipelineStageDescriptor.h:
2459         * Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
2460         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
2461         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
2462         * Modules/webgpu/WebGPUShaderStage.*: Removed.
2463
2464         Add and implement setVertexBuffers:
2465         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2466         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Added. 
2467         * Modules/webgpu/WebGPURenderPassEncoder.h:
2468         * Modules/webgpu/WebGPURenderPassEncoder.idl: 
2469         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2470         (WebCore::GPURenderPassEncoder::setVertexBuffers):
2471         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2472         (WebCore::setInputStateForPipelineDescriptor):
2473         (WebCore::GPURenderPipeline::create):
2474
2475 2018-12-12  Tim Horton  <timothy_horton@apple.com>
2476
2477         REGRESSION (r237565): >20 Find in Page highlights in one tile results in a single giant highlight
2478         https://bugs.webkit.org/show_bug.cgi?id=192642
2479         <rdar://problem/46498246>
2480
2481         Reviewed by Geoffrey Garen.
2482
2483         No new tests; adjusted an existing test instead.
2484
2485         * platform/graphics/PathUtilities.cpp:
2486         (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
2487         Instead of uniting when we fail to shrink-wrap, just return the original rects.
2488         This seems like a more reasonable default in most cases.
2489
2490 2018-12-12  Vivek Seth  <v_seth@apple.com>
2491
2492         HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
2493         https://bugs.webkit.org/show_bug.cgi?id=192375
2494         <rdar://problem/45851159>
2495
2496         Reviewed by Chris Dumez.
2497
2498         Use simulated redirect to tell clients that HTTPS Upgrade happened.
2499
2500         * platform/network/ResourceResponseBase.cpp:
2501         (WebCore::ResourceResponseBase::syntheticRedirectResponse):
2502         * platform/network/ResourceResponseBase.h:
2503         * platform/network/mac/WebCoreURLResponse.mm:
2504         (WebCore::synthesizeRedirectResponseIfNecessary):
2505
2506 2018-12-12  Chris Dumez  <cdumez@apple.com>
2507
2508         Add a preference to enable / disable devicemotion and deviceorientation events
2509         https://bugs.webkit.org/show_bug.cgi?id=192631
2510         <rdar://problem/46646244>
2511
2512         Reviewed by Geoffrey Garen.
2513
2514         Add setting to toggle support for the deviceorientation / devicemotion events:
2515         - https://w3c.github.io/deviceorientation/
2516
2517         * page/DOMWindow.cpp:
2518         (WebCore::DOMWindow::addEventListener):
2519         * page/Settings.yaml:
2520
2521 2018-12-11  Ryosuke Niwa  <rniwa@webkit.org>
2522
2523         Make HTMLConverter take two Positions in preparation to make it work with shadow DOM
2524         https://bugs.webkit.org/show_bug.cgi?id=192613
2525
2526         Reviewed by Darin Adler.
2527
2528         This patch makes HTMLConverter store two Position's instead of a Range so that HTMLConverter can work with
2529         a selection which spans across shadow boundaries in the future.
2530
2531         No new tests since there should be no observable behavioral change.
2532
2533         * editing/cocoa/EditorCocoa.mm:
2534         (WebCore::Editor::writeSelectionToPasteboard): Uses the newly introduced writeSelectionToPasteboard.
2535         (WebCore::Editor::writeSelection): Ditto.
2536         * editing/cocoa/HTMLConverter.h:
2537         * editing/cocoa/HTMLConverter.mm:
2538         (HTMLConverter::HTMLConverter): Now takes two Position's.
2539         (HTMLConverter::convert): Updated to work with Position's.
2540         (HTMLConverter::_processText): Ditto.
2541         (HTMLConverter::_traverseNode): Ditto.
2542         (HTMLConverter::_traverseFooterNode): Ditto.
2543         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Ditto.
2544         (WebCore::attributedStringFromRange): Ditto.
2545         (WebCore::attributedStringFromSelection): Added. For now, we first create a Range via toNormalizedRange
2546         in order to preserve the exact behavior.
2547
2548 2018-12-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2549
2550         Unreviewed manual rollout of r239100-r239102 and r239116
2551         https://bugs.webkit.org/show_bug.cgi?id=192151
2552         <rdar://problem/46655586>
2553
2554         * css/CSSFontFaceSource.cpp:
2555         (WebCore::CSSFontFaceSource::font):
2556         * loader/cache/CachedFont.cpp:
2557         (WebCore::CachedFont::platformDataFromCustomData):
2558         * platform/FreeType.cmake:
2559         * platform/graphics/FontPlatformData.h:
2560         (WebCore::FontPlatformData::isFixedWidth const): Deleted.
2561         * platform/graphics/cairo/FontCustomPlatformData.h:
2562         * platform/graphics/freetype/FontCacheFreeType.cpp:
2563         (WebCore::FontCache::systemFallbackForCharacters):
2564         (WebCore::FontCache::createFontPlatformData):
2565         (WebCore::getFontPropertiesFromPattern): Deleted.
2566         (WebCore::defaultVariationValues): Deleted.
2567         (WebCore::buildVariationSettings): Deleted.
2568         * platform/graphics/freetype/FontCacheFreeType.h: Removed.
2569         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2570         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
2571         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
2572         (WebCore::FontCustomPlatformData::fontPlatformData):
2573         (WebCore::FontCustomPlatformData::supportsFormat):
2574         (WebCore::defaultFontconfigOptions): Deleted.
2575         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2576         (WebCore::setCairoFontOptionsFromFontConfigPattern):
2577         (WebCore::getDefaultFontconfigOptions):
2578         (WebCore::FontPlatformData::FontPlatformData):
2579         (WebCore::FontPlatformData::operator=):
2580         (WebCore::FontPlatformData::harfBuzzFace const):
2581         (WebCore::FontPlatformData::platformIsEqual const):
2582         (WebCore::FontPlatformData::buildScaledFont):
2583         (WebCore::FontPlatformData::fcPattern const): Deleted.
2584         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): Deleted.
2585         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2586         (WebCore::Font::platformCreateScaledFont const):
2587         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2588         (WebCore::fontFeatures):
2589         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2590         (WebCore::floatToHarfBuzzPosition): Deleted.
2591         (WebCore::doubleToHarfBuzzPosition): Deleted.
2592         (WebCore::harfBuzzFontFunctions): Deleted.
2593         (WebCore::findScriptForVerticalGlyphSubstitution): Deleted.
2594         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Added.
2595         (WebCore::HarfBuzzFace::CacheEntry::CacheEntry):
2596         (WebCore::HarfBuzzFace::CacheEntry::~CacheEntry):
2597         (WebCore::HarfBuzzFace::cache):
2598         (WebCore::HarfBuzzFace::HarfBuzzFace):
2599         (WebCore::HarfBuzzFace::~HarfBuzzFace):
2600         (WebCore::findScriptForVerticalGlyphSubstitution):
2601         (WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution):
2602         * platform/graphics/harfbuzz/HarfBuzzFace.h: Added.
2603         (WebCore::HarfBuzzFace::CacheEntry::create):
2604         (WebCore::HarfBuzzFace::CacheEntry::face):
2605         (WebCore::HarfBuzzFace::CacheEntry::glyphCache):
2606         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Added.
2607         (WebCore::floatToHarfBuzzPosition):
2608         (WebCore::doubleToHarfBuzzPosition):
2609         (WebCore::CairoGetGlyphWidthAndExtents):
2610         (WebCore::harfBuzzGetGlyph):
2611         (WebCore::harfBuzzGetGlyphHorizontalAdvance):
2612         (WebCore::harfBuzzGetGlyphHorizontalOrigin):
2613         (WebCore::harfBuzzGetGlyphExtents):
2614         (WebCore::harfBuzzCairoTextGetFontFuncs):
2615         (WebCore::harfBuzzCairoGetTable):
2616         (WebCore::HarfBuzzFace::createFace):
2617         (WebCore::HarfBuzzFace::createFont):
2618         * platform/graphics/harfbuzz/HbUniquePtr.h:
2619         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Deleted.
2620         * platform/graphics/opentype/OpenTypeMathData.cpp:
2621         (WebCore::OpenTypeMathData::OpenTypeMathData):
2622         * platform/graphics/win/FontCustomPlatformData.cpp:
2623         (WebCore::FontCustomPlatformData::fontPlatformData):
2624         * platform/graphics/win/FontCustomPlatformData.h:
2625         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
2626         (WebCore::FontCustomPlatformData::fontPlatformData):
2627
2628 2018-12-12  Chris Dumez  <cdumez@apple.com>
2629
2630         Unreviewed attempt to fix Windows Cairo build after r239100.
2631
2632         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
2633         (WebCore::FontCustomPlatformData::fontPlatformData):
2634
2635 2018-12-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2636
2637         [iOS] A few API tests are failing after r239086
2638         https://bugs.webkit.org/show_bug.cgi?id=192608
2639
2640         Reviewed by Zalan Bujtas.
2641
2642         These test failures were caused by a missing Vector size check in `Pasteboard::readFilePaths` before accessing
2643         the first item. Fix this by adding a helper method on PasteboardItemInfo to grab the file path for the highest
2644         fidelity pasteboard item (returning the null string if there are none), and use this in a few places that grab
2645         the highest fidelity path using Vector::first().
2646
2647         While `Pasteboard::readRespectingUTIFidelities` does have a bounds check before accessing the list of paths,
2648         this patch still replaces it with a call to `pathForHighestFidelityItem()`, so that the intent is more clear.
2649
2650         * platform/PasteboardItemInfo.h:
2651         (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
2652         * platform/ios/PasteboardIOS.mm:
2653         (WebCore::Pasteboard::readRespectingUTIFidelities):
2654         (WebCore::Pasteboard::readFilePaths):
2655
2656 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2657
2658         Unreviewed. Fix WPE build after r239101.
2659
2660         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Include <hb-ot.h>
2661
2662 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2663
2664         [FreeType] Remove HarfBuzzFace
2665         https://bugs.webkit.org/show_bug.cgi?id=192589
2666
2667         Reviewed by Michael Catanzaro.
2668
2669         This was used to share the common implementation with the chromium port, but now that only freetype based ports
2670         use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
2671         since we are already caching glyphs in Font.
2672
2673         * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
2674         * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
2675         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
2676         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2677         (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
2678         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
2679         OpenType math.
2680         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2681         (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
2682         (WebCore::doubleToHarfBuzzPosition): Ditto.
2683         (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
2684         functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
2685         (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
2686         (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
2687         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
2688         * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
2689         * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
2690         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
2691         * platform/graphics/harfbuzz/HbUniquePtr.h:
2692         (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
2693         * platform/graphics/opentype/OpenTypeMathData.cpp:
2694         (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
2695
2696 2018-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2697
2698         [FreeType] Add initial implementation of variation fonts
2699         https://bugs.webkit.org/show_bug.cgi?id=192151
2700
2701         Reviewed by Michael Catanzaro.
2702
2703         * css/CSSFontFaceSource.cpp:
2704         (WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
2705         * loader/cache/CachedFont.cpp:
2706         (WebCore::CachedFont::platformDataFromCustomData): Ditto.
2707         * platform/graphics/FontPlatformData.h:
2708         (WebCore::FontPlatformData::isFixedWidth const):
2709         * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
2710         * platform/graphics/freetype/FontCacheFreeType.cpp:
2711         (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
2712         pattern.
2713         (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
2714         (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
2715         before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
2716         (WebCore::defaultVariationValues): Parse font variations table.
2717         (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
2718         * platform/graphics/freetype/FontCacheFreeType.h: Added.
2719         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2720         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
2721         (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
2722         (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
2723         (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
2724         FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
2725         (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
2726         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2727         (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
2728         FC_FONT_VARIATIONS value from the pattern.
2729         (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
2730         pattern.
2731         (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
2732         (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
2733         (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
2734         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2735         (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
2736         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2737         (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
2738         * platform/graphics/win/FontCustomPlatformData.cpp:
2739         (WebCore::FontCustomPlatformData::fontPlatformData):
2740         * platform/graphics/win/FontCustomPlatformData.h:
2741
2742 2018-12-11  Justin Michaud  <justin_michaud@apple.com>
2743
2744         Implement feature flag for CSS Typed OM
2745         https://bugs.webkit.org/show_bug.cgi?id=192610
2746
2747         Reviewed by Ryosuke Niwa.
2748
2749         * Configurations/FeatureDefines.xcconfig:
2750         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
2751         * css/typedom/StylePropertyMapReadOnly.h:
2752         * css/typedom/StylePropertyMapReadOnly.idl:
2753         * css/typedom/TypedOMCSSImageValue.h:
2754         * css/typedom/TypedOMCSSImageValue.idl:
2755         * css/typedom/TypedOMCSSNumericValue.h:
2756         * css/typedom/TypedOMCSSNumericValue.idl:
2757         * css/typedom/TypedOMCSSStyleValue.h:
2758         * css/typedom/TypedOMCSSStyleValue.idl:
2759         * css/typedom/TypedOMCSSUnitValue.h:
2760         * css/typedom/TypedOMCSSUnitValue.idl:
2761         * css/typedom/TypedOMCSSUnparsedValue.h:
2762         * css/typedom/TypedOMCSSUnparsedValue.idl:
2763         * features.json:
2764         * html/ImageBitmap.cpp:
2765         * html/ImageBitmap.h:
2766         * html/canvas/CanvasDrawImage.idl:
2767         * html/canvas/CanvasFillStrokeStyles.idl:
2768         * html/canvas/CanvasRenderingContext2DBase.cpp:
2769         * html/canvas/CanvasRenderingContext2DBase.h:
2770         * inspector/InspectorCanvas.cpp:
2771         (WebCore::InspectorCanvas::buildAction):
2772         * page/RuntimeEnabledFeatures.h:
2773         (WebCore::RuntimeEnabledFeatures::setCSSTypedOMEnabled):
2774         (WebCore::RuntimeEnabledFeatures::cssTypedOMEnabled const):
2775         * page/WindowOrWorkerGlobalScope.idl:
2776
2777 2018-12-10  Ryosuke Niwa  <rniwa@webkit.org>
2778
2779         connectedCallback is invoked during the removal of the element inside another element's connectedCallback
2780         https://bugs.webkit.org/show_bug.cgi?id=183586
2781         <rdar://problem/38403504>
2782
2783         Reviewed by Frédéric Wang.
2784
2785         Align WebKit's behavior with Chrome/Firefox with regards to https://github.com/w3c/webcomponents/issues/760
2786
2787         After much discussion, it's unclear that there is a clear path forward to fixing the oddness that
2788         the presence of a custom element reaction changes the timing at which another reaction callback gets invoked.
2789         So matching Chrome/Firefox behaviors in this case seems the path of the least resistance to interoperability.
2790
2791         Namely, this patch makes WebKit not insert a custom element to the appropriate element queue when the element
2792         does not have a matching reaction callback. Put it another way, steps 3-5 in would be done before step 6 in:
2793         https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction
2794             1. Let definition be element's custom element definition.
2795             2. Let callback be the value of the entry in definition's lifecycle callbacks with key callbackName.
2796             3. If callback is null, then return
2797             4. If callbackName is "attributeChangedCallback", then:
2798                 1. Let attributeName be the first element of args.
2799                 2. If definition's observed attributes does not contain attributeName, then return.
2800             5. Add a new callback reaction to element's custom element reaction queue, with callback function callback
2801                and arguments args.
2802             6. Enqueue an element on the appropriate element queue given element.
2803
2804         Test: fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html
2805
2806         * dom/CustomElementReactionQueue.cpp:
2807         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
2808         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
2809         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
2810         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
2811         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
2812         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
2813         (WebCore::CustomElementReactionQueue::enqueueElementOnAppropriateElementQueue): Renamed from ensureCurrentQueue.
2814         * dom/CustomElementReactionQueue.h:
2815
2816 2018-12-11  Justin Fan  <justin_fan@apple.com>
2817
2818         [WebGPU] Implement WebGPUBuffer, and some nullibility consistency in WebGPU
2819         https://bugs.webkit.org/show_bug.cgi?id=192516
2820
2821         Reviewed by Dean Jackson.
2822
2823         Test: webgpu/buffers.html
2824
2825         Enable basic creation of WebGPUBuffers, and fix nullability inconsitencies in WebGPU implementation.
2826
2827         Add necessary symbols and files for Web/GPUBuffer, Web/GPUBufferUsage, and Web/GPUBufferDescriptor:
2828         * CMakeLists.txt:
2829         * DerivedSources.make:
2830         * Sources.txt:
2831         * SourcesCocoa.txt:
2832         * WebCore.xcodeproj/project.pbxproj:
2833         * bindings/js/WebCoreBuiltinNames.h:
2834
2835         * Modules/webgpu/WebGPUBuffer.cpp: Added.
2836         (WebCore::WebGPUBuffer::create):
2837         (WebCore::WebGPUBuffer::WebGPUBuffer):
2838         * Modules/webgpu/WebGPUBuffer.h: Added.
2839         (WebCore::WebGPUBuffer::mapping const):
2840         (WebCore::WebGPUBuffer::unmap): Unimplemented stub, for now, as Metal equivalent is unclear.
2841         (WebCore::WebGPUBuffer::destroy): Unimplemented stub.
2842         * Modules/webgpu/WebGPUBuffer.idl: Added.
2843         * Modules/webgpu/WebGPUBufferDescriptor.h: Added.
2844         * Modules/webgpu/WebGPUBufferDescriptor.idl: Added.
2845         * Modules/webgpu/WebGPUDevice.cpp:
2846         (WebCore::WebGPUDevice::createBuffer const): Added.
2847         * platform/graphics/gpu/GPUBuffer.h:
2848         (WebCore::GPUBuffer::platformBuffer const):
2849         (WebCore::GPUBuffer::mapping const):
2850         * platform/graphics/gpu/GPUBufferDescriptor.h: Added.
2851         * platform/graphics/gpu/GPUDevice.cpp:
2852         (WebCore::GPUDevice::createBuffer const): Added.
2853         * platform/graphics/gpu/GPUDevice.h:
2854         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Added.
2855         (WebCore::GPUBuffer::create): Attempt to create a page-aligned Gigacage to back the GPUBuffer's ArrayBuffer. 
2856         (WebCore::GPUBuffer::GPUBuffer):
2857         (WebCore::GPUBuffer::~GPUBuffer): Dereference mapped ArrayBuffer first.
2858
2859         Small benign edits, most to make nullability more consistent in WebGPU classes:
2860         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2861         (WebCore::WebGPUCommandBuffer::create):
2862         (WebCore::WebGPUCommandBuffer::beginRenderPass):
2863         * Modules/webgpu/WebGPUCommandBuffer.h:
2864         * Modules/webgpu/WebGPUDevice.cpp:
2865         (WebCore::WebGPUDevice::create):
2866         (WebCore::WebGPUDevice::WebGPUDevice):
2867         (WebCore::WebGPUDevice::createShaderModule const):
2868         (WebCore::WebGPUDevice::createRenderPipeline const):
2869         (WebCore::WebGPUDevice::createCommandBuffer const):
2870         * Modules/webgpu/WebGPUDevice.h:
2871         (WebCore::WebGPUDevice::device const):
2872         * Modules/webgpu/WebGPUDevice.idl:
2873         * Modules/webgpu/WebGPUQueue.cpp:
2874         (WebCore::WebGPUQueue::create):
2875         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2876         (WebCore::WebGPURenderPassEncoder::create):
2877         * Modules/webgpu/WebGPURenderPassEncoder.h:
2878         * Modules/webgpu/WebGPUShaderModule.cpp:
2879         (WebCore::WebGPUShaderModule::create):
2880         (WebCore::WebGPUShaderModule::WebGPUShaderModule):
2881         * Modules/webgpu/WebGPUShaderModule.h:
2882         (WebCore::WebGPUShaderModule::module const):
2883         * Modules/webgpu/WebGPUSwapChain.idl: Sync with IDL changes.
2884         * Modules/webgpu/WebGPUTexture.cpp:
2885         (WebCore::WebGPUTexture::create):
2886         (WebCore::WebGPUTexture::createDefaultTextureView):
2887         * Modules/webgpu/WebGPUTextureView.cpp:
2888         (WebCore::WebGPUTextureView::create):
2889         * Modules/webgpu/WebGPUTextureView.h:
2890         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2891         (WebCore::GPUQueue::create):
2892         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2893         (WebCore::GPURenderPipeline::create):
2894         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
2895         (WebCore::GPUShaderModule::create):
2896         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2897         (WebCore::GPUSwapChain::setDevice):
2898         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
2899         (WebCore::GPUTexture::GPUTexture):
2900
2901 2018-12-11  Fujii Hironori  <Hironori.Fujii@sony.com>
2902
2903         [Win][Clang] Fix warning -Wmissing-field-initializers
2904         https://bugs.webkit.org/show_bug.cgi?id=192584
2905
2906         Reviewed by Yusuke Suzuki.
2907
2908         Initialize a struct with '{ }' instead of '= {0}'.
2909
2910         No new tests, no behavior changes.
2911
2912         * platform/graphics/win/FontCacheWin.cpp:
2913         (WebCore::FontCache::lastResortFallbackFont):
2914         * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
2915         (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow):
2916         * platform/win/ClipboardUtilitiesWin.cpp:
2917         (WebCore::setFileDescriptorData):
2918         (WebCore::setFileContentData):
2919         (WebCore::setUCharData):
2920         (WebCore::setUtf8Data):
2921         (WebCore::setCFData):
2922         * platform/win/CursorWin.cpp:
2923         (WebCore::createSharedCursor):
2924         * platform/win/DefWndProcWindowClass.cpp:
2925         (WebCore::registerClass):
2926         * platform/win/DragImageWin.cpp:
2927         (WebCore::createDragImageIconForCachedImageFilename):
2928         * platform/win/PasteboardWin.cpp:
2929         (WebCore::writeURL):
2930         (WebCore::Pasteboard::writeString):
2931         (WebCore::Pasteboard::writeRangeToDataObject):
2932         (WebCore::Pasteboard::writePlainTextToDataObject):
2933         (WebCore::writeFileToDataObject):
2934         (WebCore::Pasteboard::writeMarkup):
2935         * platform/win/PopupMenuWin.cpp:
2936         (WebCore::PopupMenuWin::show):
2937         * platform/win/SSLKeyGeneratorWin.cpp:
2938         (WebCore::WebCore::signedPublicKeyAndChallengeString):
2939
2940 2018-12-11  Jer Noble  <jer.noble@apple.com>
2941
2942         Globally namespaced objects shouldn't use framework-prefixed names
2943         https://bugs.webkit.org/show_bug.cgi?id=192600
2944
2945         Reviewed by Eric Carlson.
2946
2947         Rename CMSampleBufferIs... -> isCMSampleBuffer...
2948
2949         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2950         (WebCore::isCMSampleBufferRandomAccess):
2951         (WebCore::isCMSampleBufferNonDisplaying):
2952         (WebCore::MediaSampleAVFObjC::flags const):
2953         (WebCore::CMSampleBufferIsRandomAccess): Deleted.
2954         (WebCore::CMSampleBufferIsNonDisplaying): Deleted.
2955
2956 2018-12-11  Brent Fulgham  <bfulgham@apple.com>
2957
2958         Don't attempt to compute animated values when there is no relevant animation
2959         https://bugs.webkit.org/show_bug.cgi?id=192591
2960         <rdar://problem/34336946>
2961
2962         Reviewed by Dean Jackson.
2963
2964         Check if the property is supposed to be animated, or has animatable features, before
2965         attempting to calculate the current animated value.
2966
2967         Test: svg/animations/avoid-calculating-for-non-animating-elements.html
2968
2969         * svg/SVGAnimateElementBase.cpp:
2970         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2971
2972 2018-12-11  Chris Dumez  <cdumez@apple.com>
2973
2974         Unreviewed, fix typos in console log from r239087.
2975
2976         * page/DOMWindow.cpp:
2977         (WebCore::DOMWindow::addEventListener):
2978
2979 2018-12-11  Tim Horton  <timothy_horton@apple.com>
2980
2981         WebCore shouldn't have a Objective-C class named NSCursor
2982         https://bugs.webkit.org/show_bug.cgi?id=192602
2983         <rdar://problem/46615532>
2984
2985         Reviewed by Wenson Hsieh.
2986
2987         * platform/ios/wak/WAKAppKitStubs.h:
2988         * platform/ios/wak/WAKAppKitStubs.m:
2989         (+[NSCursor setHiddenUntilMouseMoves:]): Deleted.
2990         Get rid of the class.
2991         Also remove a comment that seems to have detached from wherever it's supposed to be.
2992
2993 2018-12-11  Chris Dumez  <cdumez@apple.com>
2994
2995         Restrict DeviceMotion / DeviceOrientation APIs to secure contexts
2996         https://bugs.webkit.org/show_bug.cgi?id=192595
2997         <rdar://problem/46382603>
2998
2999         Reviewed by Dean Jackson.
3000
3001         Tests: http/tests/events/device-orientation-motion-non-secure-context.html
3002                http/tests/events/device-orientation-motion-secure-context.html
3003
3004         * page/DOMWindow.cpp:
3005         (WebCore::DOMWindow::addEventListener):
3006         * page/SecurityOrigin.h:
3007         (WebCore::SecurityOrigin::setIsPotentiallyTrustworthy):
3008         * testing/Internals.cpp:
3009         (WebCore::Internals::markContextAsInsecure):
3010         (WebCore::Internals::postTask):
3011         * testing/Internals.h:
3012         * testing/Internals.idl:
3013
3014 2018-12-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3015
3016         [iOS] Send the full list of file upload URLs and types in PasteboardItemInfo
3017         https://bugs.webkit.org/show_bug.cgi?id=192598
3018         Work towards <rdar://problem/35626913>
3019
3020         Reviewed by Tim Horton.
3021
3022         Refactors PasteboardItemInfo to contain lists of file URLs and corresponding pasteboard types, instead of just
3023         a "preferred" file upload URL and type. See below for more details.
3024
3025         * platform/PasteboardItemInfo.h:
3026         (WebCore::PasteboardItemInfo::pathForContentType const):
3027
3028         Add a helper method to find a file upload URL corresponding to a given type.
3029
3030         (WebCore::PasteboardItemInfo::encode const):
3031         (WebCore::PasteboardItemInfo::decode):
3032
3033         Change `pathForFileUpload` to `pathsForFileUpload`, and `contentTypeForFileUpload` to `contentTypesForFileUpload`.
3034
3035         * platform/ios/AbstractPasteboard.h:
3036         * platform/ios/PasteboardIOS.mm:
3037         (WebCore::Pasteboard::readRespectingUTIFidelities):
3038
3039         Adjust this to take the file path for the highest fidelity representation in `pathsForContentType`.
3040
3041         (WebCore::Pasteboard::readFilePaths):
3042         * platform/ios/PlatformPasteboardIOS.mm:
3043         (WebCore::PlatformPasteboard::informationForItemAtIndex):
3044         * platform/ios/WebItemProviderPasteboard.h:
3045         * platform/ios/WebItemProviderPasteboard.mm:
3046         (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
3047         (-[NSItemProvider web_fileUploadContentTypes]):
3048
3049         Replace `web_containsFileUploadContent` with `web_fileUploadContentTypes`, which returns the full list of file
3050         upload content types (rather than just a `BOOL` indicating whether one or more of these types exist).
3051
3052         (-[WebItemProviderPasteboard fileUploadURLsAtIndex:fileTypes:]):
3053         (-[WebItemProviderPasteboard numberOfFiles]):
3054         (-[NSItemProvider web_containsFileUploadContent]): Deleted.
3055         (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]): Deleted.
3056
3057         Replaced with `-fileUploadURLsAtIndex:fileTypes:`. This implementation currently just returns the highest
3058         fidelity loaded type identifier, but this is wrong because it doesn't take into account inline data types that
3059         shouldn't be represented as data for file uploads (for instance, it never makes sense to upload the internal
3060         data serialization for an `NSURL` as a file on the web).
3061
3062         Instead, use existing logic in `web_fileUploadContentTypes` to determine which file types can be treated as file
3063         uploads, and return all of these file types that we've loaded.
3064
3065 2018-12-11  Don Olmstead  <don.olmstead@sony.com>
3066
3067         Resource Load Statistics: Use common implementation within NetworkStorageSession
3068         https://bugs.webkit.org/show_bug.cgi?id=192592
3069
3070         Reviewed by Alex Christensen.
3071
3072         There's nothing within the resource load statistics implementation contained
3073         in NetworkStorageSessionCFNet that was CF specific. All of the resource load
3074         statistics methods are moved from that file to the root NetworkStorageSession
3075         implementation.
3076
3077         * platform/network/NetworkStorageSession.cpp:
3078         (WebCore::getPartitioningDomain):
3079         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
3080         (WebCore::NetworkStorageSession::shouldBlockCookies const):
3081         (WebCore::NetworkStorageSession::maxAgeCacheCap):
3082         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
3083         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
3084         (WebCore::NetworkStorageSession::removePrevalentDomains):
3085         (WebCore::NetworkStorageSession::hasStorageAccess const):
3086         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
3087         (WebCore::NetworkStorageSession::grantStorageAccess):
3088         (WebCore::NetworkStorageSession::removeStorageAccessForFrame):
3089         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
3090         (WebCore::NetworkStorageSession::removeAllStorageAccess):
3091         (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources):
3092         (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources):
3093         * platform/network/NetworkStorageSession.h:
3094         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3095         (WebCore::getPartitioningDomain): Deleted.
3096         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const): Deleted.
3097         (WebCore::NetworkStorageSession::shouldBlockCookies const): Deleted.
3098         (WebCore::NetworkStorageSession::maxAgeCacheCap): Deleted.
3099         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): Deleted.
3100         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): Deleted.
3101         (WebCore::NetworkStorageSession::removePrevalentDomains): Deleted.
3102         (WebCore::NetworkStorageSession::hasStorageAccess const): Deleted.
3103         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const): Deleted.
3104         (WebCore::NetworkStorageSession::grantStorageAccess): Deleted.
3105         (WebCore::NetworkStorageSession::removeStorageAccessForFrame): Deleted.
3106         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
3107         (WebCore::NetworkStorageSession::removeAllStorageAccess): Deleted.
3108         (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): Deleted.
3109         (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): Deleted.
3110
3111 2018-12-11  Devin Rousso  <drousso@apple.com>
3112
3113         Web Inspector: overlay bounds rulers don't match element when page is scrolled
3114         https://bugs.webkit.org/show_bug.cgi?id=192577
3115
3116         Reviewed by Joseph Pecoraro.
3117
3118         When drawing the highlight for a node, the canvas is translated based on the scroll position
3119         of the node. This translation was not applied to the bounds calculations, which meant that
3120         the bounds always drew where the node would have been if it wasn't scrolled.
3121
3122         * inspector/InspectorOverlayPage.js:
3123         (Bounds.prototype.get minX):
3124         (Bounds.prototype.get minY):
3125         (Bounds.prototype.get maxX):
3126         (Bounds.prototype.get maxY):
3127         (Bounds.prototype.offset): Added.
3128         (drawNodeHighlight):
3129         Drive-by: draw bounds for every node being highlighted instead of just the first one.
3130         Drive-by: switch the bounds color to be a semi-transparent red for more visibility/contrast.
3131
3132 2018-12-11  Andy Estes  <aestes@apple.com>
3133
3134         Introduce makeBlockPtr for lambdas
3135         https://bugs.webkit.org/show_bug.cgi?id=192594
3136
3137         Reviewed by Alex Christensen.
3138
3139         Adopted makeBlockPtr.
3140
3141         * platform/cocoa/FileMonitorCocoa.mm:
3142         (WebCore::FileMonitor::FileMonitor):
3143         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
3144         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
3145         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm:
3146         (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
3147         * platform/network/cocoa/WebCoreNSURLSession.mm:
3148         (-[WebCoreNSURLSession addDelegateOperation:]):
3149         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
3150         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3151         (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
3152
3153 2018-12-10  Brent Fulgham  <bfulgham@apple.com>
3154
3155         SVGViewSpec objects should mark relevant SVG elements
3156         https://bugs.webkit.org/show_bug.cgi?id=192567
3157         <rdar://problem/46491325>
3158
3159         Reviewed by Ryosuke Niwa.
3160
3161         SVGViewSpec elements reflect the state of an underlying SVGElement. Teach the mark algorithm to
3162         recognize the relevant SVGElement as active as long as the SVGViewSpec is active.
3163
3164         Update SVGElement so that it can vend WeakPtrs. I also noticed that SVGAttributeOwner used a bare
3165         pointer to the SVGElement, so switched to a WeakPtr.
3166
3167         Test: svg/animations/view-dependency-crash.html
3168
3169         * Sources.txt: Add new files.
3170         * WebCore.xcodeproj/project.pbxproj: Ditto.
3171         * bindings/js/JSSVGViewSpecCustom.cpp: Added.
3172         (WebCore::JSSVGViewSpec::visitAdditionalChildren):
3173         * svg/SVGElement.h:
3174         * svg/SVGPathElement.h:
3175         * svg/SVGViewSpec.cpp:
3176         (WebCore::SVGViewSpec::SVGViewSpec): Hold a weak pointer (rather than a bare pointer) to the underlying element.
3177         * svg/SVGViewSpec.h:
3178         * svg/SVGViewSpec.idl:
3179         * svg/properties/SVGAttributeOwnerProxy.cpp: Added.
3180         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Hold a weak pointer (rather than a bare pointer) to
3181         the underling SVGElement.
3182         (WebCore::SVGAttributeOwnerProxy::element const): Ditto.
3183         * svg/properties/SVGAttributeOwnerProxy.h:
3184         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Move implementation to cpp file.
3185         (WebCore::SVGAttributeOwnerProxy::element const): Ditto.
3186         * svg/properties/SVGAttributeOwnerProxyImpl.h: Update for WeakPtr use.
3187
3188 2018-12-10  Benjamin Poulain  <benjamin@webkit.org>
3189
3190         <rdar://problem/45296285> Content blocker rule "raw" blocks media elements from loading
3191         https://bugs.webkit.org/show_bug.cgi?id=192439
3192
3193         Reviewed by Dean Jackson.
3194
3195         This broken when WebKit switched to NSURLSession.
3196         In CachedResourceLoader::requestResource(), toResourceType() was turning media load into RAW.
3197
3198         Test: http/tests/contentextensions/video-element-resource-type.html
3199
3200         * loader/ResourceLoadInfo.cpp:
3201         (WebCore::toResourceType):
3202
3203 2018-12-10  Don Olmstead  <don.olmstead@sony.com>
3204
3205         Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
3206         https://bugs.webkit.org/show_bug.cgi?id=192573
3207
3208         Reviewed by Simon Fraser.
3209
3210         * Configurations/FeatureDefines.xcconfig:
3211
3212 2018-12-10  Justin Michaud  <justin_michaud@apple.com>
3213
3214         CS Painting API should support multiple worklets.
3215         https://bugs.webkit.org/show_bug.cgi?id=192335
3216
3217         Reviewed by Dean Jackson.
3218
3219         Adds a new map to support separate paint worklet global scopes (one for each worklet). Also
3220         adds some tests and a fix for a repaint bug that this oncovered, where changing a custom property required
3221         for paint would not trigger a repaint if there had not been a valid value set before.
3222
3223         Test: fast/css-custom-paint/multiple-worklets.html
3224
3225         * css/CSSPaintImageValue.cpp:
3226         (WebCore::CSSPaintImageValue::image):
3227         * css/StyleResolver.cpp:
3228         (WebCore::StyleResolver::applyProperty):
3229         * dom/Document.cpp:
3230         (WebCore::Document::prepareForDestruction):
3231         (WebCore::Document::paintWorkletGlobalScope):
3232         (WebCore::Document::setPaintWorkletGlobalScope):
3233         * dom/Document.h:
3234         (WebCore::Document::paintWorkletGlobalScope): Deleted.
3235         * rendering/style/RenderStyle.cpp:
3236         (WebCore::changedCustomPaintWatchedProperty):
3237         * worklets/Worklet.cpp:
3238         (WebCore::Worklet::addModule):
3239         * worklets/WorkletGlobalScope.cpp:
3240         (WebCore::WorkletGlobalScope::prepareForDestruction):
3241
3242 2018-12-10  Youenn Fablet  <youenn@apple.com>
3243
3244         Remove derived classes of RealtimeMediaSourceCenter
3245         https://bugs.webkit.org/show_bug.cgi?id=192546
3246
3247         Reviewed by Eric Carlson.
3248
3249         Remove virtual methods of RealtimeMediaSourceCenter and remove derived classes of it.
3250         Instead port specific implementation directly implement the needed default factory methods.
3251
3252         Renamed some methods for improved consistency.
3253         Moved some static variables as RealtimeMediaSourceCenter members.
3254
3255         No change of behavior.
3256
3257         * WebCore.xcodeproj/project.pbxproj:
3258         * page/DeprecatedGlobalSettings.cpp:
3259         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
3260         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
3261         (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
3262         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices):
3263         (WebCore::RealtimeMediaSourceCenter::setVideoCapturePageState):
3264         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
3265         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
3266         (WebCore::RealtimeMediaSourceCenter::audioCaptureFactory):
3267         (WebCore::RealtimeMediaSourceCenter::setVideoFactory):
3268         (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
3269         (WebCore::RealtimeMediaSourceCenter::videoCaptureFactory):
3270         (WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory):
3271         (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
3272         (WebCore::RealtimeMediaSourceCenter::displayCaptureFactory):
3273         * platform/mediastream/RealtimeMediaSourceCenter.h:
3274         * platform/mediastream/RealtimeVideoSource.cpp:
3275         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
3276         (WebCore::RealtimeVideoSource::prepareToProduceData):
3277         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
3278         (WebCore::RealtimeMediaSourceCenter::singleton):
3279         (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
3280         (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
3281         (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
3282         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: Removed.
3283         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3284         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
3285         (WebCore::AVVideoCaptureSource::setupCaptureSession):
3286         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
3287         (WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
3288         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
3289         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3290         (WebCore::RealtimeMediaSourceCenter::singleton):
3291         (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
3292         (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
3293         (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
3294         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: Removed.
3295         * platform/mock/MockRealtimeAudioSource.cpp:
3296         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
3297         (WebCore::MockRealtimeAudioSource::startProducingData):
3298         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3299         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
3300         (WebCore::MockRealtimeMediaSourceCenter::audioCaptureFactory):
3301         (WebCore::MockRealtimeMediaSourceCenter::videoCaptureFactory):
3302         * platform/mock/MockRealtimeMediaSourceCenter.h:
3303
3304 2018-12-10  Youenn Fablet  <youenn@apple.com>
3305
3306         DataChannels created asynchronously never open and are unusable
3307         https://bugs.webkit.org/show_bug.cgi?id=192566
3308
3309         Reviewed by Eric Carlson.
3310
3311         For every new data channel (remote or local), we should check the underlying backend state.
3312         This allows firing events if needed.
3313         We were not always doing that which was prohibiting sending some open
3314         events for data channels created after the SCTP connection is set up.
3315
3316         Covered by updated test.
3317
3318         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
3319         (WebCore::LibWebRTCDataChannelHandler::channelEvent):
3320         (WebCore::LibWebRTCDataChannelHandler::setClient):
3321         (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
3322         (WebCore::LibWebRTCDataChannelHandler::checkState):
3323         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
3324
3325 2018-12-10  Ryosuke Niwa  <rniwa@webkit.org>
3326
3327         Use WeakPtr to refer to VTTCue in VTTCueBox
3328         https://bugs.webkit.org/show_bug.cgi?id=192575
3329
3330         Reviewed by Eric Carlson.
3331
3332         Address the FIXME in VTTCue::~VTTCue by clearing VTTCueBox::m_cue when VTTCue goes away.
3333         This is implemented by simply using WeakPtr.
3334
3335         No new tests since there shoul be no behaivoral change.
3336
3337         * html/track/TextTrackCueGeneric.cpp:
3338         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
3339         * html/track/VTTCue.cpp:
3340         (WebCore::VTTCueBox::VTTCueBox):
3341         (WebCore::VTTCueBox::getCue const):
3342         (WebCore::VTTCueBox::applyCSSProperties):
3343         (WebCore::VTTCue::~VTTCue):
3344         * html/track/VTTCue.h:
3345         (WebCore::VTTCueBox::fontSizeFromCaptionUserPrefs const):
3346
3347 2018-12-10  Mark Lam  <mark.lam@apple.com>
3348
3349         PropertyAttribute needs a CustomValue bit.
3350         https://bugs.webkit.org/show_bug.cgi?id=191993
3351         <rdar://problem/46264467>
3352
3353         Reviewed by Saam Barati.
3354
3355         This patch revealed a bug in the CodeGenerator where a constructor property is
3356         set with a ReadOnly attribute.  This conflicts with the WebIDL link (see clause
3357         12 in https://heycam.github.io/webidl/#interface-prototype-object) which states
3358         that it should be [Writable].  The ReadOnly attribute is now removed.
3359
3360         On the WebCore side, this change is covered by existing tests.
3361
3362         * bindings/scripts/CodeGeneratorJS.pm:
3363         (GenerateImplementation):
3364         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3365         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
3366
3367 2018-12-10  Antti Koivisto  <antti@apple.com>
3368
3369         Rename "forced style recalc" to "full style rebuild"
3370         https://bugs.webkit.org/show_bug.cgi?id=192572
3371
3372         Reviewed by Zalan Bujtas.
3373
3374         The old name is confusing.
3375
3376         * css/CSSComputedStyleDeclaration.cpp:
3377         (WebCore::hasValidStyleForProperty):
3378         * dom/Document.cpp:
3379         (WebCore::Document::scheduleStyleRebuild):
3380         (WebCore::Document::scheduleStyleRecalc):
3381         (WebCore::Document::unscheduleStyleRecalc):
3382         (WebCore::Document::hasPendingStyleRebuild const):
3383         (WebCore::Document::resolveStyle):
3384         (WebCore::Document::needsStyleRecalc const):
3385         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
3386         (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
3387