Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-08  Jonathan Hammer  <jonathan@e3software.com>
2
3         Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove
4         https://bugs.webkit.org/show_bug.cgi?id=191228
5         <rdar://problem/45786830>
6
7         Reviewed by Wenson Hsieh.
8
9         DragController::beginDrag should not call cleanupAfterSystemDrag because
10         the drag is still in progress even after the call to m_client.beginDrag()
11         returns. This is in contrast to DragController::doSystemDrag, where the
12         call to cleanupAfterSystemDrag is appropriate because the drag has
13         concluded by the time m_client.startDrag() returns.
14
15         Test: fast/events/drag-and-drop-move-not-copy.html
16
17         * page/DragController.cpp:
18         (WebCore::DragController::beginDrag):
19
20 2018-11-08  Zalan Bujtas  <zalan@apple.com>
21
22         [BFC][IFC] InlineFormattingContext::Line::alignRuns() should take care of all the alignments.
23         https://bugs.webkit.org/show_bug.cgi?id=191414
24
25         Reviewed by Antti Koivisto.
26
27         * layout/inlineformatting/Line.cpp:
28         (WebCore::Layout::InlineFormattingContext::Line::close):
29
30 2018-11-08  Jiewen Tan  <jiewen_tan@apple.com>
31
32         [WebAuthN] Import CTAP device request/response converters from Chromium
33         https://bugs.webkit.org/show_bug.cgi?id=190784
34         <rdar://problem/45460333>
35
36         Reviewed by Brent Fulgham.
37
38         This patch imports Chromium's CTAP device request/response converters:
39         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-encoding
40         1. It directly imports the following files and suit them to WebKit's coding style:
41         https://cs.chromium.org/chromium/src/device/fido/device_response_converter.cc?l=20&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
42         https://cs.chromium.org/chromium/src/device/fido/device_response_converter.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
43         https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
44         https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
45         https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
46         https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
47         https://cs.chromium.org/chromium/src/device/fido/ctap_request_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
48         https://cs.chromium.org/chromium/src/device/fido/ctap_response_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
49         https://cs.chromium.org/chromium/src/device/fido/fido_test_data.h?l=1&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
50         2. It gathers the following methods into DeviceRequestConverter:
51         CtapGetAssertionRequest::EncodeAsCBOR()
52         CtapMakeCredentialRequest::EncodeAsCBOR()
53         PublicKeyCredentialDescriptor::ConvertToCBOR()
54         PublicKeyCredentialParams::ConvertToCBOR()
55         PublicKeyCredentialRpEntity::ConvertToCBOR()
56         PublicKeyCredentialUserEntity::ConvertToCBOR()
57         3. It also apply a patch from Chromium to CBORValue:
58         https://chromium.googlesource.com/chromium/src/+/7b6fbff35cd8e4d508f08e1cd93b4aa0a0dc402c%5E%21/
59
60         Besides importing things from Chromium, it also implements UserVerificationRequirement for both
61         PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions such that both options
62         can specify more dimensions of a desired authenticator.
63
64         Covered by API tests.
65
66         * CMakeLists.txt:
67         * DerivedSources.make:
68         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
69         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::encode const):
70         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
71         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
72         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
73         (WebCore::PublicKeyCredentialRequestOptions::encode const):
74         (WebCore::PublicKeyCredentialRequestOptions::decode):
75         * Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
76         * Modules/webauthn/UserVerificationRequirement.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
77         * Modules/webauthn/UserVerificationRequirement.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
78         * Modules/webauthn/cbor/CBORValue.cpp:
79         (cbor::CBORValue::CBORValue):
80         (cbor::CBORValue::getBool const):
81         * Modules/webauthn/cbor/CBORValue.h:
82         * Modules/webauthn/fido/AuthenticatorGetInfoResponse.cpp: Added.
83         (fido::toArrayValue):
84         (fido::AuthenticatorGetInfoResponse::AuthenticatorGetInfoResponse):
85         (fido::AuthenticatorGetInfoResponse::setMaxMsgSize):
86         (fido::AuthenticatorGetInfoResponse::setPinProtocols):
87         (fido::AuthenticatorGetInfoResponse::setExtensions):
88         (fido::AuthenticatorGetInfoResponse::setOptions):
89         (fido::encodeAsCBOR):
90         * Modules/webauthn/fido/AuthenticatorGetInfoResponse.h: Added.
91         * Modules/webauthn/fido/AuthenticatorSupportedOptions.cpp: Added.
92         (fido::AuthenticatorSupportedOptions::setSupportsResidentKey):
93         (fido::AuthenticatorSupportedOptions::setUserVerificationAvailability):
94         (fido::AuthenticatorSupportedOptions::setUserPresenceRequired):
95         (fido::AuthenticatorSupportedOptions::setClientPinAvailability):
96         (fido::AuthenticatorSupportedOptions::setIsPlatformDevice):
97         (fido::convertToCBOR):
98         * Modules/webauthn/fido/AuthenticatorSupportedOptions.h: Added.
99         * Modules/webauthn/fido/DeviceRequestConverter.cpp: Added.
100         (fido::convertRpEntityToCBOR):
101         (fido::convertUserEntityToCBOR):
102         (fido::convertParametersToCBOR):
103         (fido::convertDescriptorToCBOR):
104         (fido::encodeMakeCredenitalRequestAsCBOR):
105         (fido::encodeGetAssertionRequestAsCBOR):
106         (fido::encodeEmptyAuthenticatorRequest):
107         * Modules/webauthn/fido/DeviceRequestConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.h.
108         * Modules/webauthn/fido/DeviceResponseConverter.cpp: Added.
109         (fido::convertStringToProtocolVersion):
110         (fido::getResponseCode):
111         (fido::getCredentialId):
112         (fido::readCTAPMakeCredentialResponse):
113         (fido::readCTAPGetAssertionResponse):
114         (fido::readCTAPGetInfoResponse):
115         * Modules/webauthn/fido/DeviceResponseConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.cpp.
116         * Modules/webauthn/fido/FidoConstants.cpp:
117         (fido::isCtapDeviceResponseCode):
118         (fido::publicKeyCredentialTypeToString):
119         * Modules/webauthn/fido/FidoConstants.h:
120         * Sources.txt:
121         * WebCore.xcodeproj/project.pbxproj:
122
123 2018-11-07  Justin Michaud  <justin_michaud@apple.com>
124
125         CSS Painting API should pass size, arguments and input properties to paint callback
126         https://bugs.webkit.org/show_bug.cgi?id=191309
127
128         Reviewed by Chris Dumez.
129
130         Call paint() callback with input properties and arguments. This patch adds a stub for 
131         the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without 
132         any syntax checking to the paint callback.
133
134         Test: fast/css-custom-paint/properties.html
135
136         * CMakeLists.txt:
137         * DerivedSources.make:
138         * Sources.txt:
139         * WebCore.xcodeproj/project.pbxproj:
140         * bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
141         (WebCore::toJSNewlyCreated):
142         (WebCore::toJS):
143         * bindings/js/WebCoreBuiltinNames.h:
144         * css/CSSPaintCallback.h:
145         * css/CSSPaintCallback.idl:
146         * css/CSSPaintImageValue.cpp:
147         (WebCore::CSSPaintImageValue::image):
148         * css/CSSPaintImageValue.h:
149         * css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
150         (WebCore::CSSPaintSize::create):
151         (WebCore::CSSPaintSize::width const):
152         (WebCore::CSSPaintSize::height const):
153         (WebCore::CSSPaintSize::CSSPaintSize):
154         * css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
155         * css/parser/CSSPropertyParserHelpers.cpp:
156         (WebCore::CSSPropertyParserHelpers::consumeCustomPaint):
157         * css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
158         * css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
159         * css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
160         (WebCore::CSSStyleValue::isUnitValue):
161         (WebCore::CSSStyleValue::isUnparsedValue):
162         * css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
163         * css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
164         * css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
165         * css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
166         * css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
167         * css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
168         (WebCore::StylePropertyMapReadOnly::create):
169         (WebCore::StylePropertyMapReadOnly::get):
170         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly):
171         * css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
172         * platform/graphics/CustomPaintImage.cpp:
173         (WebCore::CustomPaintImage::CustomPaintImage):
174         (WebCore::CustomPaintImage::doCustomPaint):
175         * platform/graphics/CustomPaintImage.h:
176
177 2018-11-07  Brent Fulgham  <bfulgham@apple.com>
178
179         Provide better Font fallbacks for DirectX backend
180         https://bugs.webkit.org/show_bug.cgi?id=191412
181         <rdar://problem/45899207>
182
183         Reviewed by Zalan Bujtas.
184
185         Registration of custom fonts through GDI are not always visible
186         through the DirectWrite/GDI bridging layer. If a font is not located,
187         locate the closest matching avialable font rather than failing.
188
189         * platform/graphics/FontPlatformData.h:
190         * platform/graphics/win/FontCustomPlatformData.cpp:
191         (WebCore::FontCustomPlatformData::fontPlatformData): Use new font
192         fallback logic.
193         * platform/graphics/win/FontPlatformDataDirect2D.cpp:
194         (WebCore::FontPlatformData::platformDataInit):
195         (WebCore::FontPlatformData::platformIsEqual const):
196         (WebCore::FontPlatformData::createFallbackFont): Added.
197
198 2018-11-07  Zalan Bujtas  <zalan@apple.com>
199
200         Click and touch event listeners on the body don't work
201         https://bugs.webkit.org/show_bug.cgi?id=191392
202         <rdar://problem/5844416>
203
204         Reviewed by Simon Fraser.
205
206         Remove the old quirk of ignoring onclick handlers on the body and beyond.
207
208         Test: fast/events/click-handler-on-body-simple.html
209
210         * page/ios/FrameIOS.mm:
211         (WebCore::Frame::nodeRespondingToClickEvents):
212
213 2018-11-07  Brent Fulgham  <bfulgham@apple.com>
214
215         [Windows][DirectX] Update canvas code to pass more tests
216         https://bugs.webkit.org/show_bug.cgi?id=191337
217         <rdar://problem/45878801>
218
219         Reviewed by Dean Jackson.
220
221         Update the Direct2D code paths to comply with our canvas tests, improving the
222         the test results scores to 579/770.
223
224         PathDirect2D was updated with an implementation of 'addArcTo' based on work by
225         Dirk Schulze <vbs85@gmx.de> (see https://hg.mozilla.org/mozilla-central/rev/b116b49459f8).
226
227         Tests: canvas/philip/tests
228
229         * platform/graphics/ImageBuffer.cpp:
230         (WebCore::ImageBuffer::createCompatibleBuffer): Direct2D needs access to the graphics
231         context to create the buffer.
232         * platform/graphics/ImageBuffer.h:
233         * platform/graphics/Path.h:
234         * platform/graphics/win/GraphicsContextDirect2D.cpp:
235         (WebCore::GraphicsContext::drawPattern): Flush needed.
236         (WebCore::GraphicsContext::drawRect): Ditto.
237         (WebCore::GraphicsContextPlatformPrivate::setMiterLimit): Correct for Direct2D definition of miter limit.
238         (WebCore::GraphicsContextPlatformPrivate::strokeStyleProperties const): Added helper function.
239         (WebCore::GraphicsContextPlatformPrivate::recomputeStrokeStyle): Update for new helper.
240         (WebCore::GraphicsContext::drawLine): Ditto.
241         (WebCore::drawWithShadowHelper): Ditto.
242         (WebCore::GraphicsContext::fillRect): Add flush.
243         (WebCore::GraphicsContext::platformFillRoundedRect): Update for helper.
244         (WebCore::GraphicsContext::clipPath): Add flush.
245         (WebCore::GraphicsContext::strokeRect): Ditto.
246         (WebCore::GraphicsContext::drawLineForText): Update for upstream changes.
247         (WebCore::GraphicsContext::drawLinesForText): Ditto.
248         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
249         * platform/graphics/win/ImageBufferDirect2D.cpp:
250         (WebCore::createCroppedImageIfNecessary): Add missing implementations.
251         (WebCore::createBitmapImageAfterScalingIfNeeded): Ditto.
252         (WebCore::ImageBuffer::copyImage const): Ditto.
253         (WebCore::ImageBuffer::sinkIntoImage): Ditto.
254         (WebCore::ImageBuffer::fastCopyImageMode): Ditto.
255         (WebCore::ImageBuffer::sinkIntoNativeImage): Ditto.
256         (WebCore::ImageBuffer::copyNativeImage const): Ditto.
257         * platform/graphics/win/PathDirect2D.cpp:
258         (WebCore::Path::operator=):
259         (WebCore::Path::drawDidComplete): This should never have been const.
260         It manipulates the path!
261         (WebCore::Path::transform): Properly transform existing geometries.
262         (WebCore::Path::openFigureAtCurrentPointIfNecessary): Added.
263         (WebCore::Path::moveTo):
264         (WebCore::Path::addLineTo): Make sure figure starts at a valid point.
265         (WebCore::Path::addQuadCurveTo): Ditto.
266         (WebCore::Path::addBezierCurveTo): Ditto.
267         (WebCore::Path::addArcTo): Add implementation.
268         (WebCore::Path::closeSubpath):
269         (WebCore::drawArcSection):
270         (WebCore::Path::addArc): Update to build large arcs out of small arc segments. If the
271         arc is effectively a complete circle, use the ellipse drawing routines.
272         (WebCore::Path::addRect): Make sure we start at a valid starting point.
273         (WebCore::Path::addEllipse): Correct for definition of D2D ellipse.
274         (WebCore::Path::drawDidComplete const): Deleted.
275         * platform/graphics/win/SimpleFontDataDirect2D.cpp:
276         (WebCore::Font::platformWidthForGlyph const):
277         * rendering/svg/RenderSVGResourceClipper.cpp:
278         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
279         * rendering/svg/RenderSVGResourceFilter.cpp:
280         (WebCore::RenderSVGResourceFilter::applyResource):
281         * rendering/svg/RenderSVGResourceMasker.cpp:
282         (WebCore::RenderSVGResourceMasker::applyResource):
283         * rendering/svg/SVGRenderingContext.cpp:
284         (WebCore::SVGRenderingContext::createImageBuffer):
285         * rendering/svg/SVGRenderingContext.h:
286
287 2018-11-07  Wenson Hsieh  <wenson_hsieh@apple.com>
288
289         Add an editing command for creating and inserting child lists
290         https://bugs.webkit.org/show_bug.cgi?id=191335
291         <rdar://problem/45814050>
292
293         Reviewed by Ryosuke Niwa.
294
295         Currently, insertOrderedList and insertUnorderedList only toggle or change list state (i.e. if the selection is
296         in an ordered or unordered list, reinserting the same list type removes the current list, and inserting a
297         different list type changes the enclosing list).
298
299         However, for certain internal clients (e.g. Mail), if the start of the selection is enclosed by a list item, we
300         instead create a new list item and insert it after the enclosing list item, and then create a new list within
301         that list item. Currently, this logic is implemented in Mail for legacy-WebKit-based Mail compose. This patch
302         brings this logic into WebKit in the form of a new editing command.
303
304         Tests: editing/execCommand/insert-nested-lists-in-table.html
305                editing/execCommand/insert-nested-lists-with-pre.html
306                editing/execCommand/insert-nested-lists.html
307
308         * Sources.txt:
309         * WebCore.xcodeproj/project.pbxproj:
310         * editing/Editor.cpp:
311         (WebCore::Editor::insertOrderedList):
312         (WebCore::Editor::insertUnorderedList):
313         * editing/EditorCommand.cpp:
314         (WebCore::executeInsertOrderedList):
315         (WebCore::executeInsertUnorderedList):
316         (WebCore::executeInsertNestedUnorderedList):
317         (WebCore::executeInsertNestedOrderedList):
318         (WebCore::createCommandMap):
319         * editing/IndentOutdentCommand.cpp:
320         (WebCore::IndentOutdentCommand::outdentParagraph):
321         * editing/InsertListCommand.cpp:
322         (WebCore::InsertListCommand::doApply):
323         (WebCore::InsertListCommand::editingAction const):
324         * editing/InsertListCommand.h:
325
326         Change a couple of `enum`s into `enum class`es.
327
328         * editing/InsertNestedListCommand.cpp: Added.
329         (WebCore::InsertNestedListCommand::insertUnorderedList):
330         (WebCore::InsertNestedListCommand::insertOrderedList):
331         (WebCore::InsertNestedListCommand::doApply):
332         * editing/InsertNestedListCommand.h: Added.
333
334         Add a new edit command to insert a new list (as a child of any containing list). If the start of the selection
335         is in a list item, we create a new list item, move the selection into the list item, and increment its list
336         level; otherwise, simply fall back to inserting a list.
337
338         * editing/ModifySelectionListLevel.cpp:
339         (WebCore::IncreaseSelectionListLevelCommand::doApply):
340         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
341         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered):
342         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered):
343         * editing/ModifySelectionListLevel.h:
344
345         Expose this constructor, allowing other edit commands to change selection list level as a composite edit
346         command. Also, change an `enum` into an `enum class`.
347
348         (WebCore::IncreaseSelectionListLevelCommand::create):
349
350 2018-11-07  Chris Dumez  <cdumez@apple.com>
351
352         ASSERT(renderer()) under HTMLTextAreaElement::updateValue()
353         https://bugs.webkit.org/show_bug.cgi?id=191391
354         <rdar://problem/34219633>
355
356         Reviewed by Geoffrey Garen.
357
358         Update HTMLTextFormControlElement::didEditInnerTextValue() to not call subtreeHasChanged()
359         if the element has no renderer, similarly to what is already done in 
360         HTMLTextFormControlElement::setRangeText() and HTMLInputElement::setEditingValue().
361
362         Test: editing/inserting/inset-html-textarea-without-renderer.html
363
364         * html/HTMLTextFormControlElement.cpp:
365         (WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
366
367 2018-11-07  Youenn Fablet  <youenn@apple.com>
368
369         Allow setting RTCRtpTransceiver.direction
370         https://bugs.webkit.org/show_bug.cgi?id=191346
371
372         Reviewed by Eric Carlson.
373
374         Remove readonly from the direction attribute.
375         Keep setDirection for now as it is in use, with an intent to remove it.
376         Driven-by fix as in some cases, the rtc source track might be changed
377         and current implementation is not expecting that.
378         In such a case, stop observing the old track (which should no longer call us)
379         before observing the new one.
380
381         Covered by rebased tests.
382
383         * Modules/mediastream/RTCRtpTransceiver.idl:
384         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
385         (WebCore::RealtimeIncomingAudioSource::setSourceTrack):
386         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
387         (WebCore::RealtimeIncomingVideoSource::setSourceTrack):
388
389 2018-11-07  Sihui Liu  <sihui_liu@apple.com>
390
391         RELEASE_ASSERT(!m_hardClosedForUserDelete) fails in WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer
392         https://bugs.webkit.org/show_bug.cgi?id=191326
393         <rdar://problem/45769269>
394
395         Reviewed by Geoffrey Garen.
396
397         UniqueIDBDatabase should ignore incoming requests or operations when it is already marked as
398         hardClosedForUserDelete.
399
400         Test: IndexedDB.IndexedDBUserDelete.
401
402         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
403         (WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore):
404         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
405         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
406         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
407         (WebCore::IDBServer::UniqueIDBDatabaseConnection::deleteTransaction):
408         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
409         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
410         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
411
412 2018-11-07  Myles C. Maxfield  <mmaxfield@apple.com>
413
414         Positioned text underline can look like a strike-through
415         https://bugs.webkit.org/show_bug.cgi?id=191341
416
417         Reviewed by Simon Fraser.
418
419         We should just clamp the value so it can't go above the baseline.
420
421         We shouldn't do this at parse time because it's totally reasonable for text-underline-position: under to want
422         a negative text-underline-offset. Instead, we just do it at used value time.
423
424         Test: fast/css3-text/css3-text-decoration/text-underline-negative.html
425
426         * style/InlineTextBoxStyle.cpp:
427         (WebCore::computeUnderlineOffset):
428
429 2018-11-07  Chris Dumez  <cdumez@apple.com>
430
431         Unreviewed, fix iOS build with recent SDKs.
432
433         * platform/network/cocoa/ResourceResponseCocoa.mm:
434         (WebCore::ResourceResponse::platformCertificateInfo const):
435
436 2018-11-07  Chris Dumez  <cdumez@apple.com>
437
438         Unreviewed, fix iOS build with recent SDKs.
439
440         * platform/network/cocoa/ResourceResponseCocoa.mm:
441         (WebCore::ResourceResponse::platformCertificateInfo const):
442
443 2018-11-07  Myles C. Maxfield  <mmaxfield@apple.com>
444
445         Dotted underlines that skip descenders are invisible
446         https://bugs.webkit.org/show_bug.cgi?id=191403
447
448         Reviewed by Simon Fraser.
449
450         Turns out our underline bounding boxes had negative width. When drawing the full
451         underline that was fine because it was handled by the 2D graphics engine, but when
452         we try to split up the box into dots, our "for" loop was taking 0 iterations (because
453         the end was before the start).
454
455         Test: fast/css3-text/css3-text-decoration/text-underline-style.html
456
457         * platform/graphics/cairo/GraphicsContextCairo.cpp:
458         (WebCore::GraphicsContext::drawLineForText):
459         * platform/graphics/cg/GraphicsContextCG.cpp:
460         (WebCore::GraphicsContext::drawLineForText):
461         * platform/graphics/win/GraphicsContextDirect2D.cpp:
462         (WebCore::GraphicsContext::drawLineForText):
463
464 2018-11-07  Andy Estes  <aestes@apple.com>
465
466         Crash in WebCore::PaymentRequest::canMakePayment when Apple Pay payment method data is missing
467         https://bugs.webkit.org/show_bug.cgi?id=191331
468
469         Reviewed by Alexey Proskuryakov.
470
471         Apple Pay requires merchants specify an ApplePayRequest (which contains several required
472         fields) as payment method data when constructing a new PaymentRequest. If the
473         ApplePayRequest is missing required fields, or is missing entirely, canMakePayment() should
474         resolve to false.
475
476         We would properly resolve to false when an ApplePayRequest was specified with missing
477         required fields, but we would crash when the ApplePayRequest was missing entirely.
478
479         This patch fixes the crash by checking for an empty JSValue before trying to convert it to
480         an ApplePayRequest struct. Because we stringify ApplePayRequests in the PaymentRequest
481         constructor then parse them again in canMakePayments, an undefined or null payment method
482         data stringifies to a null String, which then parses to an empty JSValue.
483
484         Added test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
485
486         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
487         (WebCore::ApplePayPaymentHandler::convertData):
488         * Modules/paymentrequest/PaymentRequest.cpp:
489         (WebCore::PaymentRequest::canMakePayment):
490
491 2018-11-07  Simon Fraser  <simon.fraser@apple.com>
492
493         Revert 237849: it breaks MotionMark
494         https://bugs.webkit.org/show_bug.cgi?id=191398
495
496         Reviewed by Simon Fraser.
497
498         This change broke painting while the test is running.
499
500         * rendering/RenderLayerCompositor.cpp:
501         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
502
503 2018-11-07  Don Olmstead  <don.olmstead@sony.com>
504
505         Simplify macros in platform
506         https://bugs.webkit.org/show_bug.cgi?id=191378
507
508         Reviewed by Michael Catanzaro.
509
510         No new tests. No change in behavior.
511
512         Modifies a few cases where a platform macro could be simplified.
513
514         * page/EventHandler.cpp:
515         * platform/network/DNS.h:
516         * platform/network/NetworkStateNotifier.h:
517
518 2018-11-07  Simon Fraser  <simon.fraser@apple.com>
519
520         Some WK1 repaint tests are flakey
521         https://bugs.webkit.org/show_bug.cgi?id=190627
522
523         Reviewed by Zalan Bujtas.
524
525         Repaint tracking in GraphicsLayerCA was sensitive to whether there were already dirty
526         rects on the layer, since tracking happened after checks against existing dirty rects.
527         This caused some WK1 repaint tests to be flakey, since there's no guarantee that
528         no repaints happen between the last layer flush and a test calling startTrackingRepaints().
529
530         Fix by moving the repaint tracking to before the checks against existing dirty rects.
531         This is more similar to how repaint tracking on FrameView works.
532
533         * platform/graphics/ca/GraphicsLayerCA.cpp:
534         (WebCore::GraphicsLayerCA::setNeedsDisplayInRect):
535
536 2018-11-07  Dean Jackson  <dino@apple.com>
537
538         [iOS] WebGL leaks exact GPU type
539         https://bugs.webkit.org/show_bug.cgi?id=191393
540
541         Reviewed by Tim Horton.
542
543         The fully exposed renderer info shouldn't be necessary
544         on iOS, where the GPUs and drivers are consistent
545         enough that people shouldn't need to write code specifically
546         for them. Reduce the ability to fingerprint by simply
547         returning "Apple GPU".
548
549         The other option would have been to disable the extension,
550         but I think it might still be useful to know you're on
551         an iOS device.
552
553         Test: fast/canvas/webgl/hide-some-renderer-info.html
554
555         * html/canvas/WebGL2RenderingContext.cpp: Return "Apple GPU"
556         on iOS.
557         (WebCore::WebGL2RenderingContext::getParameter):
558         * html/canvas/WebGLRenderingContext.cpp: Ditto.
559         (WebCore::WebGLRenderingContext::getParameter):
560
561 2018-11-07  Daniel Bates  <dabates@apple.com>
562
563         Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
564         https://bugs.webkit.org/show_bug.cgi?id=190141
565
566         Reviewed by Darin Adler.
567
568         Remove the runtime application check for WebKitTestRunner as we no longer need this
569         now that WebKitTestRunner and DumpRenderTree override +[UIKeyboard isInHardwareKeyboardMode].
570
571         * platform/RuntimeApplicationChecks.h:
572         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
573         (WebCore::IOSApplication::isWebKitTestRunner): Deleted.
574
575 2018-11-07  Joseph Pecoraro  <pecoraro@apple.com>
576
577         Web Inspector: Fix "Javascript" => "JavaScript" enum in protocol generated objects
578         https://bugs.webkit.org/show_bug.cgi?id=191340
579
580         Reviewed by Devin Rousso.
581
582         * inspector/agents/InspectorMemoryAgent.cpp:
583         (WebCore::InspectorMemoryAgent::collectSample):
584         Use new enum name.
585
586 2018-11-07  Dan Bernstein  <mitz@apple.com>
587
588         Add a pseudoclass that matches img elements that are backed by an attachment
589         https://bugs.webkit.org/show_bug.cgi?id=191286
590         <rdar://problem/45823554>
591
592         Reviewed by Dean Jackson.
593
594         Test: fast/css/has-attachment.html
595
596         Added a :has-attachment pseudoclass, enabled only when the attachment element is enabled at
597         runtime, that matches elements (currently only img elements qualify) that have an attachment
598         element in their shadow DOM.
599
600         * css/CSSSelector.cpp:
601         (WebCore::CSSSelector::selectorText const): Handle the new PseudoClassHasAttachment value.
602         * css/CSSSelector.h: Added a new value to the PseudoClassType enum.
603
604         * css/SelectorChecker.cpp:
605         (WebCore::SelectorChecker::checkOne const): Check the new PseudoClassHasAttachment value
606           using the new hasAttachment test function.
607
608         * css/SelectorCheckerTestFunctions.h:
609         (WebCore::hasAttachment): Added. Tests if the element is an img element that has an
610           attachment.
611
612         * css/SelectorPseudoClassAndCompatibilityElementMap.in: Added has-attachment.
613
614         * css/parser/CSSParserContext.cpp:
615         (WebCore::CSSParserContext::CSSParserContext): Initialize new attachmentEnabled member based
616           on RuntimeEnabledFeatures.
617         (WebCore::operator==): Compare new attachmentEnabled member.
618         * css/parser/CSSParserContext.h:
619         (WebCore::CSSParserContextHash::hash): Include new attachmentEnabled member.
620
621         * css/parser/CSSSelectorParser.cpp:
622         (WebCore::CSSSelectorParser::consumePseudo): Reject :has-attachment if the attachment
623           element is not enabled.
624
625         * cssjit/SelectorCompiler.cpp:
626         (WebCore::SelectorCompiler::addPseudoClassType): Handle PseudoClassHasAttachment.
627
628 2018-11-07  Don Olmstead  <don.olmstead@sony.com>
629
630         Make generic MainThreadSharedTimer implementation
631         https://bugs.webkit.org/show_bug.cgi?id=191327
632
633         Reviewed by Michael Catanzaro.
634
635         No new tests. No change in behavior.
636
637         Moves generic implementation for MainThreadSharedTimerGlib.cpp into
638         MainThreadSharedTimer.cpp.
639
640         * platform/MainThreadSharedTimer.cpp:
641         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
642         (WebCore::MainThreadSharedTimer::setFireInterval):
643         (WebCore::MainThreadSharedTimer::stop):
644         (WebCore::MainThreadSharedTimer::invalidate):
645         * platform/MainThreadSharedTimer.h:
646         * platform/SourcesGLib.txt:
647         * platform/glib/MainThreadSharedTimerGLib.cpp: Removed.
648
649 2018-11-07  Ali Juma  <ajuma@chromium.org>
650
651         IntersectionObserverEntry doesn't keep JS wrappers of rects alive
652         https://bugs.webkit.org/show_bug.cgi?id=191330
653
654         Reviewed by Chris Dumez.
655
656         Retain wrappers of each rect in an IntersectionObserverEntry as long as the entry's wrapper
657         is alive, by adding these wrappers as opaque roots.
658
659         Test: intersection-observer/intersection-observer-entry-keeps-js-wrappers-of-rects-alive.html
660
661         * bindings/js/JSIntersectionObserverEntryCustom.cpp:
662         (WebCore::JSIntersectionObserverEntry::visitAdditionalChildren):
663         * dom/DOMRectReadOnly.idl:
664         * page/IntersectionObserverEntry.h:
665         (WebCore::IntersectionObserverEntry::rootBounds const): Make this return a raw pointer instead of a RefPtr so that it
666         can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which can be called from non-main threads.
667         (WebCore::IntersectionObserverEntry::boundingClientRect const): Ditto.
668         (WebCore::IntersectionObserverEntry::intersectionRect const): Ditto.
669
670 2018-11-07  Simon Fraser  <simon.fraser@apple.com>
671
672         TileController::tileSize() should not have side effects
673         https://bugs.webkit.org/show_bug.cgi?id=191349
674
675         Reviewed by Zalan Bujtas.
676
677         Calling TileController::tileSize() would recompute a new tile size and set m_tileSizeLocked,
678         which caused test failures if logging was enabled when running tests.
679
680         * platform/graphics/ca/TileController.cpp:
681         (WebCore::TileController::tileSize const):
682         (WebCore::TileController::computeTileSize):
683         * platform/graphics/ca/TileController.h:
684         * platform/graphics/ca/TileGrid.cpp:
685         (WebCore::TileGrid::revalidateTiles):
686
687 2018-11-07  Charlie Turner  <cturner@igalia.com>
688
689         [EME][GStreamer] Ensure key id buffers are present and simplify lifetime management of ClearKey class.
690         https://bugs.webkit.org/show_bug.cgi?id=191157
691
692         Reviewed by Xabier Rodriguez-Calvar.
693
694         This is in preparation for moving the clearkey decryptor behind a
695         new decrypt API in CDMInstance, which will be sent into the
696         pipeline to handle key management and decryption. This is for a
697         later patch.
698
699         Covered by existing clear key tests in media/encrypted-media.
700
701         * platform/graphics/gstreamer/GStreamerCommon.h:
702         (WebCore::GstMappedBuffer::data const): Add a const data accessor,
703         since we are now providing operator=='s on const objects of this
704         class that need const access to the data pointer.
705         (WebCore::GstMappedBuffer::operator==): Add a swap of the new
706         equality operator so you don't have to remember to have the
707         GstBuffer on the RHS of the equality all the time.
708         (WebCore::operator==): Define an equality operator between Gst
709         buffers and WebCore's mapped buffers. Gst creates a ref and a
710         separate read view under the covers in the memcmp call, so we do
711         not need to map the buffer ourselves.
712         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
713         (webkit_media_clear_key_decrypt_class_init): Remove setup/release
714         bindings.
715         (webkit_media_clear_key_decrypt_init): Initialize gcrypt cipher
716         here once instead of for every buffer to be decrypted.
717         (webKitMediaClearKeyDecryptorFinalize): And destroy the cipher
718         context when the decryptor is destroyed.
719         (webKitMediaClearKeyDecryptorFindAndSetKey): Factor out the key
720         retrieval and context setting in this method, call it for each
721         sample.
722         (webKitMediaClearKeyDecryptorDecrypt): Base key id buffer into
723         this function, and remove cipher creation / destroy methods.
724         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
725         (webkit_media_common_encryption_decrypt_class_init): Remove
726         setup/release bindings.
727         (webkitMediaCommonEncryptionDecryptTransformInPlace): Ensure a key
728         id is present and pass it to the decrypt class method.
729         (webKitMediaCommonEncryptionDecryptDefaultSetupCipher): Deleted.
730         (webKitMediaCommonEncryptionDecryptDefaultReleaseCipher): Deleted.
731         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
732
733 2018-11-07  Frederic Wang  <fwang@igalia.com>
734
735         [Cairo] Move state change operations from GraphicsContextCairo to CairoOperations
736         https://bugs.webkit.org/show_bug.cgi?id=179610
737
738         Unreviewed build fix.
739
740         * platform/graphics/cairo/GraphicsContextCairo.cpp: Add missing include.
741
742 2018-11-06  Joseph Pecoraro  <pecoraro@apple.com>
743
744         ServiceWorker Inspector: Uncaught Exception: null is not an object (evaluating 'resource.target.addResource')
745         https://bugs.webkit.org/show_bug.cgi?id=191339
746
747         Reviewed by Matt Baker.
748
749         * workers/service/ServiceWorkerJob.cpp:
750         (WebCore::ServiceWorkerJob::fetchScriptWithContext):
751         Use the Service Worker's identifier, not this static but otherwise unknown identifier.
752
753 2018-11-06  Youenn Fablet  <youenn@apple.com>
754
755         sender.replaceTrack() fails with InvalidStateError if the transceiver.direction is "inactive"
756         https://bugs.webkit.org/show_bug.cgi?id=191202
757
758         Reviewed by Eric Carlson.
759
760         Covered by updated test.
761
762         * Modules/mediastream/RTCPeerConnection.cpp:
763         (WebCore::RTCPeerConnection::removeTrack):
764         Update as per spec, in particular make sure to not stop the sender when removing the track.
765
766 2018-11-06  Justin Fan  <justin_fan@apple.com>
767
768         [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
769         https://bugs.webkit.org/show_bug.cgi?id=191291
770
771         Reviewed by Myles Maxfield.
772
773         Test: webgpu/render-pipelines.html
774         Also update test webgpu/webgpu-basics.html to create a WebGPURenderPipeline.
775
776         Begin implementation of WebGPURenderPipeline and WebGPUSwapChain. A WebGPURenderPipeline is backed by a
777         GPURenderPipeline, created lazily using the properties of the passed-in WebGPURenderPipelineDescriptor.
778         On Metal-supported systems, GPURenderPipeline is an interface to a MTLRenderPipelineState.
779         The MTLRenderPipelineState is created with the WebGPUDevice currently configured on the WebGPURenderingContext.
780
781         * CMakeLists.txt:
782         * Configurations/FeatureDefines.xcconfig:
783         * DerivedSources.make:
784         * Modules/webgpu/GPUDevice.cpp:
785         (WebCore::GPUDevice::createRenderPipeline const):
786         * Modules/webgpu/GPUDevice.h:
787         * Modules/webgpu/GPUPipelineDescriptorBase.h:
788         * Modules/webgpu/GPUPipelineStageDescriptor.h:
789         * Modules/webgpu/GPURenderPipelineDescriptor.h:
790         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
791         (WebCore::GPURenderPipelineDescriptor::primitiveTopology):
792         * Modules/webgpu/WebGPUDevice.cpp:
793         (WebCore::WebGPUDevice::createRenderPipeline const):
794         * Modules/webgpu/WebGPUDevice.h:
795         (WebCore::WebGPUDevice::adapter const):
796         (WebCore::WebGPUDevice::device const):
797         * Modules/webgpu/WebGPUDevice.idl:
798         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
799         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
800         * Modules/webgpu/WebGPUPipelineStageDescriptor.h:
801         * Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
802         * Modules/webgpu/WebGPURenderPipeline.cpp:
803         (WebCore::WebGPURenderPipeline::create):
804         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
805         * Modules/webgpu/WebGPURenderPipeline.h:
806         * Modules/webgpu/WebGPURenderPipeline.idl:
807         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
808         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
809         * Modules/webgpu/WebGPURenderingContext.cpp:
810         (WebCore::WebGPURenderingContext::create):
811         (WebCore::WebGPURenderingContext::WebGPURenderingContext):
812         * Modules/webgpu/WebGPURenderingContext.h:
813         * Modules/webgpu/WebGPUShaderModule.h:
814         (WebCore::WebGPUShaderModule::module const):
815         * Modules/webgpu/WebGPUShaderStage.h:
816         * Modules/webgpu/WebGPUShaderStage.idl:
817         * Modules/webgpu/WebGPUSwapChain.cpp:
818         (WebCore::WebGPUSwapChain::configure):
819         (WebCore::WebGPUSwapChain::reshape):
820         (WebCore::WebGPUSwapChain::markLayerComposited):
821         * Modules/webgpu/WebGPUSwapChain.h:
822         (WebCore::WebGPUSwapChain::WebGPUSwapChain):
823         * Modules/webgpu/WebGPUSwapChain.idl:
824         * Modules/webgpu/cocoa/GPURenderPipeline.h:
825         (WebCore::GPURenderPipeline::platformRenderPipeline const):
826         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm: Added.
827         (WebCore::setFunctionsForPipelineDescriptor):
828         (WebCore::GPURenderPipeline::create):
829         (WebCore::GPURenderPipeline::GPURenderPipeline):
830         * Modules/webgpu/cocoa/GPUSwapChain.h:
831         (WebCore::GPUSwapChain::platformLayer const):
832         * Modules/webgpu/cocoa/GPUSwapChainMetal.mm:
833         (WebCore::GPUSwapChain::create):
834         (WebCore::GPUSwapChain::GPUSwapChain):
835         (WebCore::GPUSwapChain::setDevice):
836         (WebCore::GPUSwapChain::reshape):
837         (WebCore::GPUSwapChain::present):
838         * Sources.txt:
839         * SourcesCocoa.txt:
840         * WebCore.xcodeproj/project.pbxproj:
841         * bindings/js/WebCoreBuiltinNames.h:
842
843 2018-11-06  Youenn Fablet  <youenn@apple.com>
844
845         Add support for sender/receiver getCapabilities
846         https://bugs.webkit.org/show_bug.cgi?id=191192
847
848         Reviewed by Eric Carlson.
849
850         Expose sender/receiver RTCRtpCapabilities to JS.
851         Add corresponding IDL and plumbing down to libwebrtc peer connection factory.
852         Covered by rebased tests.
853
854         * CMakeLists.txt:
855         * DerivedSources.make:
856         * Modules/mediastream/PeerConnectionBackend.cpp:
857         (WebCore::PeerConnectionBackend::receiverCapabilities):
858         (WebCore::PeerConnectionBackend::senderCapabilities):
859         * Modules/mediastream/PeerConnectionBackend.h:
860         * Modules/mediastream/RTCRtpCapabilities.idl: Added.
861         * Modules/mediastream/RTCRtpReceiver.cpp:
862         (WebCore::RTCRtpReceiver::getCapabilities):
863         * Modules/mediastream/RTCRtpReceiver.h:
864         * Modules/mediastream/RTCRtpReceiver.idl:
865         * Modules/mediastream/RTCRtpSender.cpp:
866         (WebCore::RTCRtpSender::getCapabilities):
867         * Modules/mediastream/RTCRtpSender.h:
868         * Modules/mediastream/RTCRtpSender.idl:
869         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
870         (WebCore::PeerConnectionBackend::receiverCapabilities):
871         (WebCore::PeerConnectionBackend::senderCapabilities):
872         * Sources.txt:
873         * WebCore.xcodeproj/project.pbxproj:
874         * platform/mediastream/RTCPMuxPolicy.h:
875         * platform/mediastream/RTCRtpCapabilities.h: Added.
876         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
877         (WebCore::typeFromKind):
878         (WebCore::fromStdString):
879         (WebCore::toChannels):
880         (WebCore::toRTCRtpCapabilities):
881         (WebCore::LibWebRTCProvider::receiverCapabilities):
882         (WebCore::LibWebRTCProvider::senderCapabilities):
883         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
884
885 2018-11-06  Youenn Fablet  <youenn@apple.com>
886
887         Calling sender.replaceTrack() twice produces a new transceiver and its corresponding m= section
888         https://bugs.webkit.org/show_bug.cgi?id=191261
889
890         Reviewed by Eric Carlson.
891
892         Handle the case of replacing a track in a sender that has no track.
893         In particular, do not create a new m-section as was implied by plan B implementation.
894         Instead, set the track directly on the rtc sender.
895         Covered by webrtc/video-addTransceiver.html.
896
897         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
898         (WebCore::LibWebRTCMediaEndpoint::createSourceAndRTCTrack):
899         (WebCore::LibWebRTCMediaEndpoint::addTransceiver):
900         (WebCore::LibWebRTCMediaEndpoint::setSenderSourceFromTrack):
901         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
902         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
903         (WebCore::LibWebRTCPeerConnectionBackend::setSenderSourceFromTrack):
904         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
905         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
906         (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
907
908 2018-11-06  Chris Dumez  <cdumez@apple.com>
909
910         Post too much text to iFrame could crash webkit
911         https://bugs.webkit.org/show_bug.cgi?id=190947
912         <rdar://problem/45678231>
913
914         Reviewed by Geoffrey Garen.
915
916         Optimize SuffixTree (Which is used by XSSAuditor) to stop storing each Node's
917         children as a static array of 128 pointers and use a dynamic array (vector)
918         instead. This uses way less memory. Also make SuffixTree and SuffixTree::Node
919         as fast allocated for performance. This part of the change is based on the
920         following Blink change:
921         - https://chromium.googlesource.com/chromium/src.git/+/6ca590e1c7edaa7c56cac9e3e3c39cf398ca8d4d
922
923         Also update the XSSAuditor to construct the SuffixTree lazily since there are
924         many cases (including the one in this bug) where we were spending a significant
925         amount of time building the SuffixTree and then never querying it.
926
927         * html/parser/XSSAuditor.cpp:
928         (WebCore::XSSAuditor::init):
929         (WebCore::XSSAuditor::decodedHTTPBodySuffixTree):
930         (WebCore::XSSAuditor::isContainedInRequest):
931         * html/parser/XSSAuditor.h:
932         * platform/text/SuffixTree.h:
933         (WebCore::SuffixTree::mightContain):
934         (WebCore::SuffixTree::Node::Node):
935         (WebCore::SuffixTree::Node::~Node):
936         (WebCore::SuffixTree::Node::find):
937         (WebCore::SuffixTree::Node::end):
938         (WebCore::SuffixTree::build):
939         (WebCore::SuffixTree<Codebook>::Node::childAt):
940         (WebCore::SuffixTree::Node::at): Deleted.
941
942 2018-11-06  Youenn Fablet  <youenn@apple.com>
943
944         Support onremovetrack for RTCPeerConnection removed tracks
945         https://bugs.webkit.org/show_bug.cgi?id=191299
946
947         Reviewed by Eric Carlson.
948
949         When applying SDP, LibWebRTCMediaEndpoint gets notified of a removed track.
950         In that case, make sure to remove it from its remote stream(s) so as
951         to notify the application of the changes.
952         Work around the receiver missing the list of streams by storing in a map
953         the list of the remote streams for a given remote track.
954
955         Covered by rebased test.
956
957         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
958         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
959         (WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
960         (WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
961         (WebCore::LibWebRTCMediaEndpoint::stop):
962         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
963
964 2018-11-06  Timothy Hatcher  <timothy@apple.com>
965
966         REGRESSION (r237878): css-dark-mode/supported-color-schemes.html is failing on Mojave
967         https://bugs.webkit.org/show_bug.cgi?id=191338
968
969         Reviewed by Dean Jackson.
970
971         * page/Page.cpp:
972         (WebCore::Page::appearanceDidChange): Add back call to didChangeStyleSheetEnvironment().
973         It was dropped by mistake when I moved code to appearanceDidChange(). This is needed to
974         update styles for semantic colors and from controls when the media prefers-color-scheme
975         media query is not used on the page.
976
977 2018-11-06  Youenn Fablet  <youenn@apple.com>
978
979         Make mDNS ICE Candidate an experimental flag again
980         https://bugs.webkit.org/show_bug.cgi?id=191262
981
982         Reviewed by Dean Jackson.
983
984         Rename mdnsICECandidatesEnabled to webRTCICECandidatesEnabled.
985         This allows grouping the WebRTC runtime flags.
986         No change of behavior.
987
988         * Modules/mediastream/PeerConnectionBackend.cpp:
989         (WebCore::PeerConnectionBackend::newICECandidate):
990         * page/RuntimeEnabledFeatures.h:
991         (WebCore::RuntimeEnabledFeatures::webRTCMDNSICECandidatesEnabled const):
992         (WebCore::RuntimeEnabledFeatures::setWebRTCMDNSICECandidatesEnabled):
993         (WebCore::RuntimeEnabledFeatures::mdnsICECandidatesEnabled const): Deleted.
994         (WebCore::RuntimeEnabledFeatures::setMDNSICECandidatesEnabled): Deleted.
995
996 2018-11-06  Myles C. Maxfield  <mmaxfield@apple.com>
997
998         Implement text-underline-offset and text-decoration-thickness
999         https://bugs.webkit.org/show_bug.cgi?id=190774
1000
1001         Reviewed by Dean Jackson.
1002
1003         Because of our existing infrastructure for text decorations, adding support for these
1004         is fairly simple. This patch updates our existing functions to handle thick & placed
1005         underlines, as well as updating our repaint code to correcly handle repainting them.
1006         It also handles animations.
1007
1008         Tests: animations/text-decoration-thickness.html
1009                animations/text-underline-offset.html
1010                fast/css3-text/css3-text-decoration/text-decoration-offset-2.html
1011                fast/css3-text/css3-text-decoration/text-decoration-offset-3.html
1012                fast/css3-text/css3-text-decoration/text-decoration-offset-auto-length.html
1013                fast/css3-text/css3-text-decoration/text-decoration-offset-baseline.html
1014                fast/css3-text/css3-text-decoration/text-decoration-offset-from-font-auto.html
1015                fast/css3-text/css3-text-decoration/text-decoration-offset-from-font-length.html
1016                fast/css3-text/css3-text-decoration/text-decoration-offset-repaint.html
1017                fast/css3-text/css3-text-decoration/text-decoration-offset-under-auto.html
1018                fast/css3-text/css3-text-decoration/text-decoration-offset-under-length.html
1019                fast/css3-text/css3-text-decoration/text-decoration-offset.html
1020                fast/css3-text/css3-text-decoration/text-decoration-thickness-length.html
1021                fast/css3-text/css3-text-decoration/text-decoration-thickness-repaint.html
1022
1023         * page/animation/CSSPropertyAnimation.cpp:
1024         (WebCore::blendFunc):
1025         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1026         * platform/graphics/FontMetrics.h:
1027         (WebCore::FontMetrics::underlinePosition const):
1028         (WebCore::FontMetrics::setUnderlinePosition):
1029         (WebCore::FontMetrics::underlineThickness const):
1030         (WebCore::FontMetrics::setUnderlineThickness):
1031         * platform/graphics/cocoa/FontCocoa.mm:
1032         (WebCore::Font::platformInit):
1033         * rendering/InlineFlowBox.cpp:
1034         (WebCore::InlineFlowBox::addToLine):
1035         * rendering/SimpleLineLayout.cpp:
1036         (WebCore::SimpleLineLayout::canUseForStyle):
1037         * rendering/TextDecorationPainter.cpp:
1038         (WebCore::TextDecorationPainter::paintTextDecoration):
1039         * rendering/style/RenderStyle.cpp:
1040         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
1041         * rendering/style/TextDecorationThickness.h:
1042         (WebCore::TextDecorationThickness::resolve const):
1043         * style/InlineTextBoxStyle.cpp:
1044         (WebCore::computeUnderlineOffset):
1045         (WebCore::visualOverflowForDecorations):
1046         * style/InlineTextBoxStyle.h:
1047         (WebCore::textDecorationStrokeThickness): Deleted.
1048
1049 2018-11-06  John Wilander  <wilander@apple.com>
1050
1051         Resource Load Statistics: Remove cap on partitioned cache max age if it matches a network reload (redirect-only)
1052         https://bugs.webkit.org/show_bug.cgi?id=189760
1053         <rdar://problem/44612242>
1054
1055         Reviewed by Youenn Fablet and Antti Koivisto.
1056
1057         No new tests. Existing test fleshed out.
1058
1059         * platform/network/ResourceResponseBase.cpp:
1060         (WebCore::ResourceResponseBase::isRedirection const):
1061         * platform/network/ResourceResponseBase.h:
1062         (WebCore::ResourceResponseBase::isRedirection const): Deleted.
1063             Moved to the implementation file so that I can export it without warning.
1064
1065 2018-11-06  Myles C. Maxfield  <mmaxfield@apple.com>
1066
1067         Spelling dots are drawn in the wrong place
1068         https://bugs.webkit.org/show_bug.cgi?id=190764
1069
1070         Reviewed by Dean Jackson.
1071
1072         - Dots should not be clipped.
1073         - Dots should be horizontally centered.
1074         - Dots should be drawn behind the text.
1075         - Distance from the baseline to the top of the dot should be 11.035% of font size.
1076         - Dot diameter should be 13.247% of the font size.
1077         - Distance between the dots (right side of the left dot to left side of the right dot) should be 9.457% of the font size.
1078         - The "font size" used in these calculations should be clamped so it's 10px <= font size <= 40px.
1079
1080         Tests: editing/spelling/spelling-dots-position-2.html
1081                editing/spelling/spelling-dots-position-3.html
1082                editing/spelling/spelling-dots-position.html
1083                editing/spelling/spelling-dots-repaint.html
1084
1085         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1086         (WebCore::colorForMarkerLineStyle): Align iOS and macOS implementations.
1087         (WebCore::GraphicsContext::drawDotsForDocumentMarker): Place the dots correctly.
1088         * rendering/InlineFlowBox.cpp:
1089         (WebCore::InlineFlowBox::addToLine): The KnownToHaveNoOverflow flag should be cleared if the element has spelling dots,
1090             because there is no guarantee the spelling dots will lie inside the layout rect of the element.
1091         (WebCore::InlineFlowBox::addTextBoxVisualOverflow): Update the repaint rects to include splling dot positions.
1092         * rendering/InlineFlowBox.h: Comments should explain why, not say what.
1093         * rendering/InlineTextBox.cpp:
1094         (WebCore::InlineTextBox::paint): Draw the dots behind the text.
1095         (WebCore::InlineTextBox::hasMarkers const): Convenience.
1096         (WebCore::InlineTextBox::paintPlatformDocumentMarkers): Refactor bounds information into a helper function.
1097         (WebCore::InlineTextBox::calculateUnionOfAllDocumentMarkerBounds const): Use for repaint rect calculation.
1098         (WebCore::InlineTextBox::calculateDocumentMarkerBounds const): Place the dots correctly.
1099         (WebCore::InlineTextBox::paintPlatformDocumentMarker): Call the helper method.
1100         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
1101         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Deleted.
1102         * rendering/InlineTextBox.h: Declare the helper methods.
1103         * rendering/SimpleLineLayout.cpp: Simple line layout doesn't know how to paint spelling dots, so make the presence of
1104             spelling dots opt us out of SLL.
1105         (WebCore::SimpleLineLayout::canUseForWithReason):
1106         * rendering/SimpleLineLayoutCoverage.cpp:
1107         (WebCore::SimpleLineLayout::printReason):
1108         * rendering/SimpleLineLayoutCoverage.h: Add a new opt-out reason.
1109
1110 2018-11-06  Per Arne Vollan  <pvollan@apple.com>
1111
1112         REGRESSION (r230523): Caps lock indicator not shown in password field
1113         https://bugs.webkit.org/show_bug.cgi?id=190056
1114
1115         Reviewed by Ryosuke Niwa.
1116
1117         When WindowServer access is blocked, GetCurrentModifiers() always returns 0. Instead of calling
1118         GetCurrentModifiers(), store the current modifiers from the key event argument in the method
1119         WebKit::WebPage::keyEvent, and use the stored value to detect if Caps lock is on. Additionally,
1120         the modifiers needs to be updated when the window becomes active.
1121
1122         Test: fast/events/detect-caps-lock.html
1123
1124         * Sources.txt:
1125         * platform/PlatformKeyboardEvent.h:
1126         * platform/graphics/FontTaggedSettings.cpp:
1127         * platform/mac/KeyEventMac.mm:
1128         (WebCore::PlatformKeyboardEvent::currentCapsLockState):
1129         (WebCore::PlatformKeyboardEvent::getCurrentModifierState):
1130         * testing/Internals.cpp:
1131         (WebCore::Internals::capsLockIsOn):
1132         * testing/Internals.h:
1133         * testing/Internals.idl:
1134
1135 2018-11-06  Javier Fernandez  <jfernandez@igalia.com>
1136
1137         CSS grid elements with justify-content: space-around have extra whitespace, sometimes a lot
1138         https://bugs.webkit.org/show_bug.cgi?id=191308
1139
1140         Reviewed by Dean Jackson.
1141
1142         The CSS WG resolved [1] that Content Alignment should account to the
1143         track sizing algorithm.
1144
1145         The sizing algorithm has been modified so that two new steps (1.5
1146         and 2.5) were added to compute the Content Alignment offsets after
1147         resolving the columns' and rows' sizes respectively.
1148
1149         This change decouples the Content Alignment logic from the tracks
1150         position, so that we can use it as part of the track sizing algorithm.
1151
1152         I also had to store the whole ContentAlignmentData structure in two
1153         class attributes. We need both, position and distribution offsets, to
1154         be used in different parts of the layout logic.
1155
1156         [1] https://github.com/w3c/csswg-drafts/issues/2557
1157
1158         Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-001.html
1159                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-002.html
1160                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-003.html
1161                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-004.html
1162                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-cols-filled-shrinkwrap-001.html
1163                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-cols-spanned-shrinkwrap-001.html
1164                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-rows-filled-shrinkwrap-001.html
1165                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-rows-spanned-shrinkwrap-001.html
1166
1167         * rendering/GridTrackSizingAlgorithm.cpp:
1168         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
1169         * rendering/RenderGrid.cpp:
1170         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
1171         (WebCore::RenderGrid::layoutBlock):
1172         (WebCore::RenderGrid::gridItemOffset const):
1173         (WebCore::RenderGrid::trackSizesForComputedStyle const):
1174         (WebCore::RenderGrid::populateGridPositionsForDirection):
1175         (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
1176         (WebCore::contentDistributionOffset):
1177         (WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
1178         (WebCore::RenderGrid::nonCollapsedTracks const):
1179         * rendering/RenderGrid.h:
1180         (WebCore::ContentAlignmentData::isValid):
1181         (WebCore::ContentAlignmentData::defaultOffsets):
1182
1183 2018-11-06  Sihui Liu  <sihui_liu@apple.com>
1184
1185         IndexedDB: WAL file keeps growing
1186         https://bugs.webkit.org/show_bug.cgi?id=191294
1187         <rdar://problem/41333493>
1188
1189         Reviewed by Chris Dumez.
1190
1191         When we quit apps, the database connection may not be shut down properly, and WAL file will be retained on disk.
1192         On the next open of database connection, new logs will be appended to the original WAL file, which keeps 
1193         increasing size of the WAL file. We should do a manual checkpoint when we open a IndexedDB to make sure previous
1194         log is written to database and truncate WAL file.
1195
1196         Test: IndexedDB.IndexedDBTempFileSize
1197
1198         * platform/sql/SQLiteDatabase.cpp:
1199         (WebCore::SQLiteDatabase::open):
1200
1201 2018-11-06  Ali Juma  <ajuma@chromium.org>
1202
1203         IntersectionObserver doesn't keep target's JS wrapper alive
1204         https://bugs.webkit.org/show_bug.cgi?id=190235
1205
1206         Reviewed by Ryosuke Niwa.
1207
1208         Retain JS wrappers of targets in queued entries using a vector of GCReachableRef owned by
1209         IntersectionObserver, which gets cleared after the entries have been delivered.
1210
1211         Make IntersectionObserver::takeRecords return a struct which has both the vector of GCReachableRefs
1212         for targets and the vector of intersection observer entries, so that the GCReachableRefs survive
1213         until the creation of JS wrappers for the entries.
1214
1215         Modify IntersectionObserver::hasPendingActivity to keep the observer alive while it has
1216         entries to deliver.
1217
1218         Tests: intersection-observer/intersection-observer-entry-keeps-js-wrapper-of-target-alive.html
1219                intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive.html
1220                intersection-observer/target-deleted.html
1221
1222         * Sources.txt:
1223         * WebCore.xcodeproj/project.pbxproj:
1224         * bindings/js/JSIntersectionObserverEntryCustom.cpp:
1225         (WebCore::JSIntersectionObserverEntry::visitAdditionalChildren): Keep the target element's wrapper alive while the
1226         IntersectionObserverEntry's wrapper is alive.
1227         * page/IntersectionObserver.cpp:
1228         (WebCore::IntersectionObserver::takeRecords): Change return type to include GCReachableRefs for each record's target, so that
1229         each target can be kept until a JS wrapper is constructed for its IntersectionObserverEntry.
1230         (WebCore::IntersectionObserver::appendQueuedEntry):
1231         (WebCore::IntersectionObserver::notify): Erase GCReachableRefs for targets after delivering the corresponding records.
1232         (WebCore::IntersectionObserver::hasPendingActivity const): Keep the IntersectionObserver alive until queued entries are delivered.
1233         (WebCore::IntersectionObserver::stop):
1234         * page/IntersectionObserver.h:
1235         * page/IntersectionObserver.idl:
1236         * page/IntersectionObserverEntry.h:
1237         (WebCore::IntersectionObserverEntry::target const): Make this return a raw pointer instead of a RefPtr so that it
1238         can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which runs on the GC thread (it's illegal to ref a Node
1239         on a non-main thread).
1240         * page/IntersectionObserverEntry.idl:
1241
1242 2018-11-06  Timothy Hatcher  <timothy@apple.com>
1243
1244         <picture> container doesn't update when prefers-color-scheme media query changes
1245         https://bugs.webkit.org/show_bug.cgi?id=190913
1246         rdar://problem/45608456
1247
1248         Reviewed by Dean Jackson.
1249
1250         Test: css-dark-mode/prefers-color-scheme-picture-element.html
1251
1252         * css/MediaQueryEvaluator.cpp:
1253         (WebCore::isAppearanceDependent): Added.
1254         (WebCore::MediaQueryEvaluator::evaluate const): Keep track of appearanceDependentResults.
1255         * css/MediaQueryEvaluator.h:
1256         * css/StyleResolver.cpp:
1257         (WebCore::StyleResolver::addAppearanceDependentMediaQueryResult): Added.
1258         (WebCore::StyleResolver::hasMediaQueriesAffectedByAppearanceChange const): Added.
1259         * css/StyleResolver.h:
1260         (WebCore::StyleResolver::hasAppearanceDependentMediaQueries const): Added.
1261         * dom/Document.cpp:
1262         (WebCore::Document::evaluateMediaQueryList): Call checkAppearanceDependentPictures.
1263         (WebCore::Document::checkAppearanceDependentPictures): Added.
1264         (WebCore::Document::addAppearanceDependentPicture): Added.
1265         (WebCore::Document::removeAppearanceDependentPicture): Added.
1266         * dom/Document.h:
1267         * html/HTMLImageElement.cpp:
1268         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Call addAppearanceDependentPicture.
1269         * html/HTMLPictureElement.cpp:
1270         (WebCore::HTMLPictureElement::~HTMLPictureElement): Call removeAppearanceDependentPicture.
1271         (WebCore::HTMLPictureElement::didMoveToNewDocument): Ditto.
1272         (WebCore::HTMLPictureElement::appearanceChangeAffectedPicture const): Added.
1273         * html/HTMLPictureElement.h:
1274         * page/Page.cpp:
1275         (WebCore::Page::appearanceDidChange): Added.
1276         (WebCore::Page::setUseSystemAppearance): Call appearanceDidChange.
1277         (WebCore::Page::setUseDarkAppearance): Call appearanceDidChange.
1278         * page/Page.h:
1279         * style/StyleScope.cpp:
1280         (WebCore::Style::Scope::evaluateMediaQueriesForAppearanceChange): Added.
1281         * style/StyleScope.h:
1282
1283 2018-11-06  Ryan Haddad  <ryanhaddad@apple.com>
1284
1285         Unreviewed, rolling out r237834.
1286
1287         Tests for this change crash on iOS Simulator
1288
1289         Reverted changeset:
1290
1291         "Spelling dots are drawn in the wrong place"
1292         https://bugs.webkit.org/show_bug.cgi?id=190764
1293         https://trac.webkit.org/changeset/237834
1294
1295 2018-11-06  Antoine Quint  <graouts@apple.com>
1296
1297         [Web Animations] transitions/remove-transition-style.html crashes with GuardMalloc on
1298         https://bugs.webkit.org/show_bug.cgi?id=191304
1299         <rdar://problem/45819476>
1300
1301         Reviewed by Dean Jackson.
1302
1303         Ensure we remove animations from the m_allAnimations ListHashSet upon destruction.
1304
1305         * animation/AnimationTimeline.cpp:
1306         (WebCore::AnimationTimeline::forgetAnimation):
1307         (WebCore::AnimationTimeline::cancelDeclarativeAnimation):
1308         * animation/AnimationTimeline.h:
1309         * animation/DocumentTimeline.cpp:
1310         (WebCore::DocumentTimeline::getAnimations const):
1311         * animation/WebAnimation.cpp:
1312         (WebCore::WebAnimation::~WebAnimation):
1313
1314 2018-11-06  Youenn Fablet  <youenn@apple.com>
1315
1316         RealtimeOutgoingAudioSourceCocoa should unobserve its source at destruction time
1317         https://bugs.webkit.org/show_bug.cgi?id=191295
1318
1319         Reviewed by Eric Carlson.
1320
1321         Make RealtimeOutgoingAudioSource subclasses unobserve their source
1322         inside their destructor instead of RealtimeOutgoingAudioSource.
1323         This is consistent with how starting to observe works.
1324         Covered by existing tests.
1325
1326         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
1327         (WebCore::RealtimeOutgoingAudioSource::unobserveSource):
1328         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1329         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
1330         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC):
1331         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
1332         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
1333         (WebCore::RealtimeOutgoingAudioSourceCocoa::~RealtimeOutgoingAudioSourceCocoa):
1334         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
1335
1336 2018-11-06  Youenn Fablet  <youenn@apple.com>
1337
1338         Make sure RTCIceCandidateStats address is undefined for host and peer reflexive case
1339         https://bugs.webkit.org/show_bug.cgi?id=191263
1340
1341         Reviewed by Eric Carlson.
1342
1343         Test: webrtc/datachannel/getStats-no-prflx-remote-candidate.html
1344
1345         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
1346         (WebCore::fillRTCIceCandidateStats):
1347
1348 2018-11-06  Thibault Saunier  <tsaunier@igalia.com>
1349
1350         [GStreamer][WebRTC] Handle setting max number of frame between keyframes
1351         https://bugs.webkit.org/show_bug.cgi?id=190682
1352
1353         Reviewed by Philippe Normand.
1354
1355         That has been manually checked.
1356
1357         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
1358         (gst_webrtc_video_encoder_get_property):
1359         (gst_webrtc_video_encoder_set_property):
1360         (register_known_encoder):
1361         (gst_webrtc_video_encoder_class_init):
1362         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1363         (WebCore::GStreamerVideoEncoder::InitEncode):
1364
1365 2018-11-03  Alex Christensen  <achristensen@webkit.org>
1366
1367         [Mac] Implement safe browsing in WebKit
1368         https://bugs.webkit.org/show_bug.cgi?id=188871
1369
1370         Reviewed by Tim Horton.
1371
1372         * en.lproj/Localizable.strings:
1373
1374 2018-11-06  Ali Juma  <ajuma@chromium.org>
1375
1376         [IntersectionObserver] Account for CSS zoom when computing client rects
1377         https://bugs.webkit.org/show_bug.cgi?id=191282
1378
1379         Reviewed by Simon Fraser.
1380
1381         When computing rects for an IntersectionObserverEntry, account for the effective zoom when
1382         converting from absolute to client coordinates.
1383
1384         Test: web-platform-tests/intersection-observer/bounding-box.html
1385
1386         * dom/Document.cpp:
1387         (WebCore::Document::updateIntersectionObservations):
1388
1389 2018-11-06  Thibault Saunier  <tsaunier@igalia.com>
1390
1391         [GStreamer][WebRTC] Implement black frame generation
1392         https://bugs.webkit.org/show_bug.cgi?id=190684
1393
1394         Reviewed by Xabier Rodriguez-Calvar.
1395
1396         Avoiding webrtc/video-mute-vp8.html to crash but it still fails because
1397         we are missing the canvas bridging code.
1398
1399         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
1400         (WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame):
1401         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
1402
1403 2018-11-06  Thibault Saunier  <tsaunier@igalia.com>
1404
1405         [GStreamer][WebRTC] Do not try to handle framerate modulation in the encoder
1406         https://bugs.webkit.org/show_bug.cgi?id=190683
1407
1408         Reviewed by Philippe Normand.
1409
1410         This has to already be handled in capturing pipeline or in libwebrtc itself.
1411
1412         No other encoder implementation do that, and libwebrtc is not happy with encoder that do not output the exact number of frames that have been passed in.
1413
1414         No regressions detected and libwebrtc is happier this way, less warning output and no more frame corruption in H264 streams found.
1415
1416         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1417         (WebCore::GStreamerVideoEncoder::InitEncode):
1418
1419 2018-11-06  Frederic Wang  <fwang@igalia.com>
1420
1421         Unreviewed, follow-up of previous commit.
1422
1423         Actually move OptionSet in the header since it's used there too.
1424
1425         * page/WindowFeatures.cpp:
1426         * page/WindowFeatures.h:
1427
1428 2018-11-06  Frederic Wang  <fwang@igalia.com>
1429
1430         Unreviewed build fix.
1431
1432         * page/WindowFeatures.cpp: Add missing header for OptionSet.
1433         * platform/graphics/FontTaggedSettings.cpp: Add missing header for IntegerHash.
1434
1435 2018-11-06  Antoine Quint  <graouts@apple.com>
1436
1437         [Web Animations] Don't reset pending tasks when setting a null effect
1438         https://bugs.webkit.org/show_bug.cgi?id=191301
1439         <rdar://problem/45838422>
1440
1441         Reviewed by Dean Jackson.
1442
1443         The issue https://github.com/w3c/csswg-drafts/issues/2077 has changed the Web Animations API such that
1444         we no longer reset pending tasks when setting a null effect on an animation.
1445
1446         * animation/WebAnimation.cpp:
1447         (WebCore::WebAnimation::setEffect):
1448
1449 2018-11-06  Antoine Quint  <graouts@apple.com>
1450
1451         [Web Animations] Update the API to allow the "auto" composite value
1452         https://bugs.webkit.org/show_bug.cgi?id=191300
1453         <rdar://problem/45838373>
1454
1455         Reviewed by Dean Jackson.
1456
1457         The Web Animations API has been changed such that the various "composite" properties are no longer optional and instead
1458         allow an "auto" value in their enumeration.
1459
1460         * CMakeLists.txt:
1461         * DerivedSources.make:
1462         * Sources.txt:
1463         * WebCore.xcodeproj/project.pbxproj:
1464         * animation/CompositeOperationOrAuto.h: Copied from Source/WebCore/animation/KeyframeEffect.idl.
1465         * animation/CompositeOperationOrAuto.idl: Copied from Source/WebCore/animation/KeyframeEffect.idl.
1466         * animation/KeyframeEffect.cpp:
1467         (WebCore::processKeyframeLikeObject):
1468         (WebCore::processIterableKeyframes):
1469         (WebCore::processPropertyIndexedKeyframes):
1470         (WebCore::KeyframeEffect::getKeyframes):
1471         * animation/KeyframeEffect.h:
1472         * animation/KeyframeEffect.idl:
1473
1474 2018-11-06  Antoine Quint  <graouts@apple.com>
1475
1476         [Web Animations] Update the API to implement Animation.updatePlaybackRate()
1477         https://bugs.webkit.org/show_bug.cgi?id=186510
1478         <rdar://problem/41000641>
1479
1480         Reviewed by Dean Jackson.
1481
1482         The Web Animations API has been changed to allow for changes to an animation's playback rate both synchronously,
1483         with the existing "playbackRate" property, and asynchronously, with the new updatePlaybackRate() method. In this
1484         patch we update the various procedures to account for pending playback rate changes and the notion of an "effective
1485         playback rate".
1486
1487         * animation/WebAnimation.cpp:
1488         (WebCore::WebAnimation::setEffect):
1489         (WebCore::WebAnimation::setTimeline):
1490         (WebCore::WebAnimation::setStartTime):
1491         (WebCore::WebAnimation::setCurrentTime):
1492         (WebCore::WebAnimation::effectivePlaybackRate const):
1493         (WebCore::WebAnimation::setPlaybackRate):
1494         (WebCore::WebAnimation::updatePlaybackRate):
1495         (WebCore::WebAnimation::applyPendingPlaybackRate):
1496         (WebCore::WebAnimation::playState const):
1497         (WebCore::WebAnimation::resetPendingTasks):
1498         (WebCore::WebAnimation::finish):
1499         (WebCore::WebAnimation::play):
1500         (WebCore::WebAnimation::runPendingPlayTask):
1501         (WebCore::WebAnimation::reverse):
1502         (WebCore::WebAnimation::runPendingPauseTask):
1503         * animation/WebAnimation.h:
1504         (WebCore::WebAnimation::playbackRate const):
1505         * animation/WebAnimation.idl:
1506
1507 2018-11-06  Antoine Quint  <graouts@apple.com>
1508
1509         [Web Animations] Implement getTiming() and updateTiming()
1510         https://bugs.webkit.org/show_bug.cgi?id=186511
1511         <rdar://problem/41000677>
1512
1513         Reviewed by Dean Jackson.
1514
1515         The Web Animations API has been further simplified by removing the AnimationEffectTiming and AnimationEffectTimingReadOnly
1516         interfaces, removing the "timing" property on AnimationEffect replacing it with getTiming() and updateTiming() methods. This
1517         does not change the features of the API but simply how they are exposed.
1518
1519         * CMakeLists.txt:
1520         * DerivedSources.make:
1521         * Sources.txt:
1522         * WebCore.xcodeproj/project.pbxproj:
1523         * animation/AnimationEffect.cpp:
1524         (WebCore::AnimationEffect::AnimationEffect):
1525         (WebCore::AnimationEffect::~AnimationEffect):
1526         (WebCore::AnimationEffect::phase const):
1527         (WebCore::AnimationEffect::activeTime const):
1528         (WebCore::AnimationEffect::overallProgress const):
1529         (WebCore::AnimationEffect::simpleIterationProgress const):
1530         (WebCore::AnimationEffect::currentIteration const):
1531         (WebCore::AnimationEffect::currentDirection const):
1532         (WebCore::AnimationEffect::transformedProgress const):
1533         (WebCore::AnimationEffect::getTiming):
1534         (WebCore::AnimationEffect::getComputedTiming):
1535         (WebCore::AnimationEffect::updateTiming):
1536         (WebCore::AnimationEffect::setIterationStart):
1537         (WebCore::AnimationEffect::setIterations):
1538         (WebCore::AnimationEffect::endTime const):
1539         (WebCore::AnimationEffect::setDelay):
1540         (WebCore::AnimationEffect::setEndDelay):
1541         (WebCore::AnimationEffect::setFill):
1542         (WebCore::AnimationEffect::setIterationDuration):
1543         (WebCore::AnimationEffect::setDirection):
1544         (WebCore::AnimationEffect::setTimingFunction):
1545         (WebCore::AnimationEffect::activeDuration const):
1546         * animation/AnimationEffect.h:
1547         (WebCore::AnimationEffect::delay const):
1548         (WebCore::AnimationEffect::endDelay const):
1549         (WebCore::AnimationEffect::fill const):
1550         (WebCore::AnimationEffect::iterationStart const):
1551         (WebCore::AnimationEffect::iterations const):
1552         (WebCore::AnimationEffect::iterationDuration const):
1553         (WebCore::AnimationEffect::direction const):
1554         (WebCore::AnimationEffect::timingFunction const):
1555         * animation/AnimationEffect.idl:
1556         * animation/AnimationEffectTiming.idl: Removed.
1557         * animation/AnimationEffectTimingReadOnly.cpp: Removed.
1558         * animation/AnimationEffectTimingReadOnly.h: Removed.
1559         * animation/AnimationEffectTimingReadOnly.idl: Removed.
1560         * animation/CSSAnimation.cpp:
1561         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
1562         * animation/CSSTransition.cpp:
1563         (WebCore::CSSTransition::setTimingProperties):
1564         * animation/DeclarativeAnimation.cpp:
1565         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
1566         * animation/DocumentTimeline.cpp:
1567         * animation/EffectTiming.idl:
1568         * animation/KeyframeEffect.cpp:
1569         (WebCore::KeyframeEffect::create):
1570         (WebCore::KeyframeEffect::KeyframeEffect):
1571         (WebCore::KeyframeEffect::copyPropertiesFromSource):
1572         (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
1573         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1574         (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
1575         * animation/KeyframeEffect.h:
1576         * animation/OptionalEffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTiming.h.
1577         * animation/OptionalEffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTiming.cpp.
1578         * animation/WebAnimation.cpp:
1579         (WebCore::WebAnimation::effectTimingDidChange):
1580         (WebCore::WebAnimation::updatePlaybackRate):
1581         * animation/WebAnimation.h:
1582         (WebCore::WebAnimation::isRelevant const):
1583         * bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp: Removed.
1584         * bindings/js/WebCoreBuiltinNames.h:
1585
1586 2018-11-06  Antoine Quint  <graouts@apple.com>
1587
1588         [Web Animations] Update the Web Animations API to remove all the ReadOnly interfaces
1589         https://bugs.webkit.org/show_bug.cgi?id=186512
1590         <rdar://problem/41000691>
1591
1592         Reviewed by Dean Jackson.
1593
1594         The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch,
1595         we make the following changes, not adding code but merely merging and renaming files:
1596
1597         - AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface
1598         - KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface
1599         - ComputedTimingProperties is now named ComputedEffectTiming
1600         - AnimationEffectTimingProperties is now named EffectTiming
1601
1602         * CMakeLists.txt:
1603         * DerivedSources.make:
1604         * Sources.txt:
1605         * WebCore.xcodeproj/project.pbxproj:
1606         * animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp.
1607         (WebCore::AnimationEffect::~AnimationEffect):
1608         (WebCore::AnimationEffect::timingDidChange):
1609         (WebCore::AnimationEffect::localTime const):
1610         (WebCore::AnimationEffect::phase const):
1611         (WebCore::AnimationEffect::activeTime const):
1612         (WebCore::AnimationEffect::overallProgress const):
1613         (WebCore::AnimationEffect::simpleIterationProgress const):
1614         (WebCore::AnimationEffect::currentIteration const):
1615         (WebCore::AnimationEffect::currentDirection const):
1616         (WebCore::AnimationEffect::directedProgress const):
1617         (WebCore::AnimationEffect::transformedProgress const):
1618         (WebCore::AnimationEffect::iterationProgress const):
1619         (WebCore::AnimationEffect::getComputedTiming):
1620         * animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h.
1621         (WebCore::AnimationEffect::isKeyframeEffect const):
1622         * animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl.
1623         * animation/AnimationEffectTimingReadOnly.cpp:
1624         * animation/AnimationEffectTimingReadOnly.h:
1625         (WebCore::AnimationEffectTimingReadOnly::setEffect):
1626         * animation/AnimationTimeline.cpp:
1627         (WebCore::AnimationTimeline::removeAnimation):
1628         (WebCore::AnimationTimeline::cssAnimationForElementAndProperty):
1629         * animation/CSSTransition.cpp:
1630         * animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h.
1631         * animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl.
1632         * animation/DeclarativeAnimation.cpp:
1633         (WebCore::DeclarativeAnimation::initialize):
1634         (WebCore::DeclarativeAnimation::flushPendingStyleChanges const):
1635         (WebCore::DeclarativeAnimation::phaseWithoutEffect const):
1636         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
1637         * animation/DeclarativeAnimation.h:
1638         * animation/DocumentTimeline.cpp:
1639         (WebCore::DocumentTimeline::getAnimations const):
1640         (WebCore::DocumentTimeline::transitionDidComplete):
1641         (WebCore::DocumentTimeline::computeExtentOfAnimation const):
1642         (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const):
1643         (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const):
1644         (WebCore::DocumentTimeline::animatedStyleForRenderer):
1645         (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
1646         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
1647         (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
1648         (WebCore::DocumentTimeline::resolveAnimationsForElement):
1649         * animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h.
1650         * animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl.
1651         * animation/KeyframeEffect.cpp:
1652         (WebCore::invalidateElement):
1653         (WebCore::CSSPropertyIDToIDLAttributeName):
1654         (WebCore::IDLAttributeNameToAnimationPropertyName):
1655         (WebCore::computeMissingKeyframeOffsets):
1656         (WebCore::processKeyframeLikeObject):
1657         (WebCore::processIterableKeyframes):
1658         (WebCore::processPropertyIndexedKeyframes):
1659         (WebCore::KeyframeEffect::create):
1660         (WebCore::KeyframeEffect::KeyframeEffect):
1661         (WebCore::KeyframeEffect::copyPropertiesFromSource):
1662         (WebCore::KeyframeEffect::getKeyframes):
1663         (WebCore::KeyframeEffect::processKeyframes):
1664         (WebCore::KeyframeEffect::updateBlendingKeyframes):
1665         (WebCore::KeyframeEffect::forceLayoutIfNeeded):
1666         (WebCore::KeyframeEffect::setBlendingKeyframes):
1667         (WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists):
1668         (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const):
1669         (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists):
1670         (WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists):
1671         (WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists):
1672         (WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes):
1673         (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes):
1674         (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes):
1675         (WebCore::KeyframeEffect::computedNeedsForcedLayout):
1676         (WebCore::KeyframeEffect::computeStackingContextImpact):
1677         (WebCore::KeyframeEffect::setTarget):
1678         (WebCore::KeyframeEffect::apply):
1679         (WebCore::KeyframeEffect::invalidate):
1680         (WebCore::KeyframeEffect::computeShouldRunAccelerated):
1681         (WebCore::KeyframeEffect::getAnimatedStyle):
1682         (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
1683         (WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex):
1684         (WebCore::KeyframeEffect::updateAcceleratedAnimationState):
1685         (WebCore::KeyframeEffect::addPendingAcceleratedAction):
1686         (WebCore::KeyframeEffect::animationDidSeek):
1687         (WebCore::KeyframeEffect::animationSuspensionStateDidChange):
1688         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1689         (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
1690         (WebCore::KeyframeEffect::renderer const):
1691         (WebCore::KeyframeEffect::currentStyle const):
1692         (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
1693         (WebCore::containsRotation):
1694         (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const):
1695         (WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const):
1696         * animation/KeyframeEffect.h:
1697         (WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe):
1698         (WebCore::KeyframeEffect::target const):
1699         (WebCore::KeyframeEffect::iterationComposite const):
1700         (WebCore::KeyframeEffect::composite const):
1701         (WebCore::KeyframeEffect::isRunningAccelerated const):
1702         (WebCore::KeyframeEffect::hasPendingAcceleratedAction const):
1703         (WebCore::KeyframeEffect::hasBlendingKeyframes const):
1704         (WebCore::KeyframeEffect::animatedProperties const):
1705         * animation/KeyframeEffect.idl:
1706         * animation/KeyframeEffectOptions.h:
1707         * animation/KeyframeEffectOptions.idl:
1708         * animation/KeyframeEffectReadOnly.cpp: Removed.
1709         * animation/KeyframeEffectReadOnly.h: Removed.
1710         * animation/KeyframeEffectReadOnly.idl: Removed.
1711         * animation/WebAnimation.cpp:
1712         (WebCore::WebAnimation::create):
1713         (WebCore::WebAnimation::setEffect):
1714         (WebCore::WebAnimation::setEffectInternal):
1715         (WebCore::WebAnimation::setTimeline):
1716         (WebCore::WebAnimation::applyPendingAcceleratedActions):
1717         (WebCore::WebAnimation::computeRelevance):
1718         * animation/WebAnimation.h:
1719         (WebCore::WebAnimation::effect const):
1720         * animation/WebAnimation.idl:
1721         * bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp.
1722         (WebCore::toJSNewlyCreated):
1723         (WebCore::toJS):
1724         * bindings/js/JSWebAnimationCustom.cpp:
1725         (WebCore::constructJSWebAnimation):
1726         * bindings/js/WebCoreBuiltinNames.h:
1727         * dom/Document.cpp:
1728
1729 2018-11-06  Rob Buis  <rbuis@igalia.com>
1730
1731         Some minor X-Content-Type-Options parsing issues
1732         https://bugs.webkit.org/show_bug.cgi?id=191107
1733
1734         Reviewed by Darin Adler.
1735
1736         Implement new parsing rules for X-Content-Type-Options [1]:
1737         https://github.com/whatwg/fetch/pull/818
1738
1739         [1] https://fetch.spec.whatwg.org/#x-content-type-options-header
1740
1741         Test: web-platform-tests/fetch/nosniff/parsing-nosniff.html
1742
1743         * platform/network/HTTPParsers.cpp:
1744         (WebCore::isHTTPTabOrSpace):
1745         (WebCore::parseContentTypeOptionsHeader):
1746
1747 2018-11-06  Frederic Wang  <fwang@igalia.com>
1748
1749         Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
1750         https://bugs.webkit.org/show_bug.cgi?id=158342
1751
1752         Reviewed by Simon Fraser.
1753
1754         Resizing the content of a -webkit-overflow-scrolling:touch overflow node on iOS may make it
1755         scrollable. However, the RenderLayerBacking's scrolling layer is not properly created
1756         when RenderLayerCompositor::updateScrollCoordinatedLayer is called and hence the UIProcess
1757         receives a null UIScrollView pointer when ScrollingTreeScrollingNodeDelegateIOS performs the
1758         associated update. In debug mode this hits an ASSERT and in release mode the overflow node
1759         remains unscrollable from the user's point of view. This patch fixes this issue by ensuring
1760         the RenderLayerBacking's scrolling layer is created during updateScrollCoordinatedStatus.
1761
1762         Test: fast/scrolling/ios/update-scroll-coordinated-status.html
1763
1764         * rendering/RenderLayerCompositor.cpp:
1765         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Call updateConfiguration()
1766         to ensure the scrolling layer is present and indicate whether a rebuild is necessary.
1767
1768 2018-11-05  Zan Dobersek  <zdobersek@igalia.com>
1769
1770         Place Fontconfig-specific RefPtr specializations in RefPtrFontconfig.h
1771         https://bugs.webkit.org/show_bug.cgi?id=191267
1772
1773         Reviewed by Michael Catanzaro.
1774
1775         Move the Fontconfig-specific RefPtr specialization declarations from
1776         RefPtrCairo.h to RefPtrFontconfig.h, with definitions moved to the new
1777         RefPtrFontconfig.cpp implementation file. These specializations are
1778         not tied to Cairo in any way.
1779
1780         * platform/FreeType.cmake:
1781         * platform/graphics/FontPlatformData.h:
1782         * platform/graphics/cairo/RefPtrCairo.cpp:
1783         * platform/graphics/cairo/RefPtrCairo.h:
1784         * platform/graphics/freetype/FontCacheFreeType.cpp:
1785         * platform/graphics/freetype/RefPtrFontconfig.cpp: Added.
1786         (WTF::refIfNotNull):
1787         (WTF::derefIfNotNull):
1788         * platform/graphics/freetype/RefPtrFontconfig.h: Copied from Source/WebCore/platform/graphics/cairo/RefPtrCairo.h.
1789
1790 2018-11-05  Don Olmstead  <don.olmstead@sony.com>
1791
1792         [CMake] Fix WebCore/Modules includes
1793         https://bugs.webkit.org/show_bug.cgi?id=191287
1794
1795         Reviewed by Fujii Hironori.
1796
1797         No new tests. No change in behavior.
1798
1799         Add in applicationmanifest to the list of includes and sort the
1800         modules directory.
1801
1802         * CMakeLists.txt:
1803
1804 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
1805
1806         Cache glyph paths and share underline skipping code between all the ports
1807         https://bugs.webkit.org/show_bug.cgi?id=191239
1808
1809         Reviewed by Alex Christensen.
1810
1811         I was hoping that caching the glyph paths was going to be a performance progression,
1812         but it turns out that the additional overhead of WebCore::Path compensated for it.
1813         In total, the performance is the same (my testing says that this patch is a 1%
1814         progression, but that's within the noise).
1815
1816         Because the ink skipping logic is now shared among all ports, Windows now gets it for
1817         free.
1818
1819         Test: PerformanceTests/Layout/underline.html
1820
1821         * platform/graphics/Font.cpp:
1822         (WebCore::Font::pathForGlyph const):
1823         * platform/graphics/Font.h:
1824         * platform/graphics/FontCascade.cpp:
1825         (WebCore::computeUnderlineType):
1826         (WebCore::GlyphIterationState::GlyphIterationState):
1827         (WebCore::findIntersectionPoint):
1828         (WebCore::updateX):
1829         (WebCore::findPathIntersections):
1830         (WebCore::GlyphToPathTranslator::GlyphToPathTranslator):
1831         (WebCore::GlyphToPathTranslator::containsMorePaths):
1832         (WebCore::GlyphToPathTranslator::path):
1833         (WebCore::GlyphToPathTranslator::extents):
1834         (WebCore::GlyphToPathTranslator::underlineType):
1835         (WebCore::GlyphToPathTranslator::advance):
1836         (WebCore::FontCascade::dashesForIntersectionsWithRect const):
1837         * platform/graphics/FontCascade.h:
1838         * platform/graphics/GlyphMetricsMap.h:
1839         (WebCore::GlyphMetricsMap::existingMetricsForGlyph):
1840         (WebCore::GlyphMetricsMap::GlyphMetricsPage::existingMetricsForGlyph const):
1841         (WebCore::GlyphMetricsMap<std::optional<Path>>::unknownMetrics):
1842         * platform/graphics/TextRun.h:
1843         * platform/graphics/cairo/FontCairo.cpp:
1844         (WebCore::Font::platformPathForGlyph const):
1845         (WebCore::GlyphIterationState::GlyphIterationState): Deleted.
1846         (WebCore::findIntersectionPoint): Deleted.
1847         (WebCore::updateX): Deleted.
1848         (WebCore::findPathIntersections): Deleted.
1849         (): Deleted.
1850         (WebCore::CairoGlyphToPathTranslator::path): Deleted.
1851         (WebCore::CairoGlyphToPathTranslator::extents): Deleted.
1852         (WebCore::CairoGlyphToPathTranslator::underlineType): Deleted.
1853         (WebCore::CairoGlyphToPathTranslator::advance): Deleted.
1854         (WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted.
1855         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1856         (WebCore::GlyphIterationState::GlyphIterationState): Deleted.
1857         (WebCore::findIntersectionPoint): Deleted.
1858         (WebCore::updateX): Deleted.
1859         (WebCore::findPathIntersections): Deleted.
1860         (): Deleted.
1861         (WebCore::MacGlyphToPathTranslator::path): Deleted.
1862         (WebCore::MacGlyphToPathTranslator::extents): Deleted.
1863         (WebCore::MacGlyphToPathTranslator::underlineType): Deleted.
1864         (WebCore::MacGlyphToPathTranslator::advance): Deleted.
1865         (WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted.
1866         * platform/graphics/cocoa/FontCocoa.mm:
1867         (WebCore::Font::platformPathForGlyph const):
1868         * rendering/TextDecorationPainter.cpp:
1869         (WebCore::drawSkipInkUnderline):
1870         (WebCore::TextDecorationPainter::paintTextDecoration):
1871
1872 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
1873
1874         Clean up text decoration drawing code
1875         https://bugs.webkit.org/show_bug.cgi?id=191245
1876
1877         Reviewed by Zalan Bujtas.
1878
1879         This is some general clean up of the text decorations code. There is no behavior change.
1880
1881         This patch modifies GraphicsContext::drawLineForText() & friends to accept a FloatRect instead of a FloatPoint + float width.
1882         This is helpful because it allows for easier bounding box calculations.
1883         This patch also removes some redundant computations that the skip:ink codepath was performing.
1884         This patch also refactors the wavy decoration parameters to not use out params.
1885
1886         No new tests because there is no behavior change.
1887
1888         * platform/graphics/GraphicsContext.cpp:
1889         (WebCore::GraphicsContext::computeUnderlineBoundsForText):
1890         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
1891         * platform/graphics/GraphicsContext.h:
1892         * platform/graphics/GraphicsContextImpl.h:
1893         * platform/graphics/cg/GraphicsContextCG.cpp:
1894         (WebCore::GraphicsContext::drawLineForText):
1895         (WebCore::GraphicsContext::drawLinesForText):
1896         * platform/graphics/displaylists/DisplayListItems.cpp:
1897         (WebCore::DisplayList::DrawLinesForText::apply const):
1898         (WebCore::DisplayList::DrawLinesForText::localBounds const):
1899         (WebCore::DisplayList::operator<<):
1900         * platform/graphics/displaylists/DisplayListItems.h:
1901         (WebCore::DisplayList::DrawLinesForText::create):
1902         (WebCore::DisplayList::DrawLinesForText::thickness const):
1903         (WebCore::DisplayList::DrawLinesForText::DrawLinesForText):
1904         * platform/graphics/displaylists/DisplayListRecorder.cpp:
1905         (WebCore::DisplayList::Recorder::drawLinesForText):
1906         * platform/graphics/displaylists/DisplayListRecorder.h:
1907         * rendering/InlineTextBox.cpp:
1908         (WebCore::InlineTextBox::paintMarkedTextDecoration):
1909         (WebCore::InlineTextBox::paintCompositionUnderline const):
1910         * rendering/SimpleLineLayoutFunctions.cpp:
1911         (WebCore::SimpleLineLayout::paintFlow):
1912         * rendering/TextDecorationPainter.cpp:
1913         (WebCore::strokeWavyTextDecoration):
1914         (WebCore::translateIntersectionPointsToSkipInkBoundaries):
1915         (WebCore::TextDecorationPainter::TextDecorationPainter):
1916         (WebCore::TextDecorationPainter::paintTextDecoration):
1917         (WebCore::drawSkipInkUnderline): Deleted.
1918         * rendering/TextDecorationPainter.h:
1919         (WebCore::TextDecorationPainter::setInlineTextBox):
1920         (WebCore::TextDecorationPainter::setWidth):
1921         (WebCore::TextDecorationPainter::setFont): Deleted.
1922         (WebCore::TextDecorationPainter::setBaseline): Deleted.
1923         * style/InlineTextBoxStyle.cpp:
1924         (WebCore::getWavyStrokeParameters):
1925         (WebCore::visualOverflowForDecorations):
1926         * style/InlineTextBoxStyle.h:
1927
1928 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
1929
1930         Fix the Windows build after r237835
1931         https://bugs.webkit.org/show_bug.cgi?id=191242
1932
1933         Reviewed by Simon Fraser.
1934
1935         * rendering/style/TextDecorationThickness.h:
1936         (WebCore::TextDecorationThickness::operator== const):
1937
1938 2018-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1939
1940         [iOS] Swatch appears squished and off-center in inputs of type color
1941         https://bugs.webkit.org/show_bug.cgi?id=191279
1942         <rdar://problem/45816319>
1943
1944         Reviewed by Tim Horton.
1945
1946         This patch makes some small adjustments to color inputs on iOS to bring them closer to the intended design.
1947         See comments below for more details.
1948
1949         Tests:  fast/forms/color/color-input-uses-color-well-appearance.html
1950                 fast/forms/color/input-appearance-color.html
1951
1952         * css/html.css:
1953
1954         Adjust the UA stylesheet for color inputs on iOS.
1955
1956         * rendering/RenderTheme.cpp:
1957         (WebCore::RenderTheme::paintDecorations):
1958
1959         When painting decorations for `ColorWellPart`, treat it as a standard button instead of the square button
1960         appearance.
1961
1962         (WebCore::RenderTheme::colorInputStyleSheet const):
1963
1964         Add `-webkit-appearance: color-well;` to the stylesheet for color inputs. Previously, this was special-cased on
1965         iOS, where color input elements had appearances of `textfield`; however, this patch makes some adjustments to
1966         RenderThemeIOS, allowing us to use `color-well` on iOS.
1967
1968         * rendering/RenderTheme.h:
1969         (WebCore::RenderTheme::platformUsesColorWellAppearance const): Deleted.
1970
1971         Remove this from RenderTheme. This is no longer necessary, since all platforms now use
1972         `-webkit-appearance: color-well;`.
1973
1974         * rendering/RenderThemeIOS.h:
1975         * rendering/RenderThemeIOS.mm:
1976         (WebCore::RenderThemeIOS::adjustButtonStyle const):
1977
1978         When painting buttons for color inputs, don't add rounded corners that are present by default for regular
1979         buttons.
1980
1981 2018-11-05  Eric Carlson  <eric.carlson@apple.com>
1982
1983         [MediaStream] An audio track should be muted when capture is interrupted by the OS.
1984         https://bugs.webkit.org/show_bug.cgi?id= 191283
1985          <rdar://problem/45773103>
1986
1987         Reviewed by Jon Lee.
1988
1989         Test: fast/mediastream/media-stream-track-interrupted.html
1990
1991         * platform/mediastream/RealtimeMediaSource.cpp:
1992         (WebCore::RealtimeMediaSource::setInterruptedForTesting):
1993         * platform/mediastream/RealtimeMediaSource.h:
1994         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1995         (WebCore::CoreAudioCaptureSource::beginInterruption):
1996         (WebCore::CoreAudioCaptureSource::endInterruption):
1997         * testing/Internals.cpp:
1998         (WebCore::Internals::setMediaStreamSourceInterrupted):
1999         * testing/Internals.h:
2000         * testing/Internals.idl:
2001
2002 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
2003
2004         Parsing support for text-underline-offset and text-decoration-thickness
2005         https://bugs.webkit.org/show_bug.cgi?id=191242
2006
2007         Reviewed by Simon Fraser.
2008
2009         Before we can implement the properties properly, we have to parse them.
2010
2011         https://github.com/w3c/csswg-drafts/issues/3118#issuecomment-432297480 describes the grammar:
2012         text-underline-position: auto | [ [ under | from-font] || [ left | right ] ]
2013         text-underline-offset: auto | <length>
2014         text-decoration-thickness: auto | from-font | <length>
2015
2016         This patch also takes the opportunity to update the grammar of text-underline-position to match the spec,
2017         and to add an alias to the unprefixed version.
2018
2019         We still don't support the left and right values on text-underline-position. We should add those eventually.
2020
2021         Tests: fast/css3-text/css3-text-decoration/text-decoration-thickness-parse.html
2022                fast/css3-text/css3-text-decoration/text-underline-offset-parse.html
2023
2024         * WebCore.xcodeproj/project.pbxproj:
2025         * css/CSSComputedStyleDeclaration.cpp:
2026         (WebCore::textUnderlineOffsetToCSSValue):
2027         (WebCore::textDecorationThicknessToCSSValue):
2028         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2029         * css/CSSPrimitiveValueMappings.h:
2030         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2031         (WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
2032         (WebCore::CSSPrimitiveValue::operator OptionSet<TextUnderlinePosition> const): Deleted.
2033         * css/CSSProperties.json:
2034         * css/CSSValueKeywords.in:
2035         * css/StyleBuilderConverter.h:
2036         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
2037         (WebCore::StyleBuilderConverter::convertTextUnderlineOffset):
2038         (WebCore::StyleBuilderConverter::convertTextDecorationThickness):
2039         * css/StyleResolver.cpp:
2040         (WebCore::shouldApplyPropertyInParseOrder):
2041         * css/parser/CSSPropertyParser.cpp:
2042         (WebCore::consumeTextUnderlineOffset):
2043         (WebCore::consumeTextDecorationThickness):
2044         (WebCore::CSSPropertyParser::parseSingleValue):
2045         * rendering/style/RenderStyle.h:
2046         (WebCore::RenderStyle::textUnderlinePosition const):
2047         (WebCore::RenderStyle::textUnderlineOffset const):
2048         (WebCore::RenderStyle::textDecorationThickness const):
2049         (WebCore::RenderStyle::setTextUnderlinePosition):
2050         (WebCore::RenderStyle::setTextUnderlineOffset):
2051         (WebCore::RenderStyle::setTextDecorationThickness):
2052         (WebCore::RenderStyle::initialTextUnderlinePosition):
2053         (WebCore::RenderStyle::initialTextUnderlineOffset):
2054         (WebCore::RenderStyle::initialTextDecorationThickness):
2055         * rendering/style/RenderStyleConstants.h:
2056         * rendering/style/StyleRareInheritedData.cpp:
2057         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2058         (WebCore::StyleRareInheritedData::operator== const):
2059         * rendering/style/StyleRareInheritedData.h:
2060         * rendering/style/TextDecorationThickness.h: Added.
2061         (WebCore::TextDecorationThickness::createWithAuto):
2062         (WebCore::TextDecorationThickness::createFromFont):
2063         (WebCore::TextDecorationThickness::createWithLength):
2064         (WebCore::TextDecorationThickness::isAuto const):
2065         (WebCore::TextDecorationThickness::isFromFont const):
2066         (WebCore::TextDecorationThickness::isLength const):
2067         (WebCore::TextDecorationThickness::setLengthValue):
2068         (WebCore::TextDecorationThickness::lengthValue const):
2069         (WebCore::TextDecorationThickness::operator== const):
2070         (WebCore::TextDecorationThickness::operator!= const):
2071         (WebCore::TextDecorationThickness::TextDecorationThickness):
2072         (WebCore::operator<<):
2073         * rendering/style/TextUnderlineOffset.h: Added.
2074         (WebCore::TextUnderlineOffset::createWithAuto):
2075         (WebCore::TextUnderlineOffset::createWithLength):
2076         (WebCore::TextUnderlineOffset::isAuto const):
2077         (WebCore::TextUnderlineOffset::isLength const):
2078         (WebCore::TextUnderlineOffset::setLengthValue):
2079         (WebCore::TextUnderlineOffset::lengthValue const):
2080         (WebCore::TextUnderlineOffset::lengthOr const):
2081         (WebCore::TextUnderlineOffset::operator== const):
2082         (WebCore::TextUnderlineOffset::operator!= const):
2083         (WebCore::TextUnderlineOffset::TextUnderlineOffset):
2084         (WebCore::operator<<):
2085         * style/InlineTextBoxStyle.cpp:
2086         (WebCore::computeUnderlineOffset):
2087         * style/InlineTextBoxStyle.h:
2088
2089 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
2090
2091         Spelling dots are drawn in the wrong place
2092         https://bugs.webkit.org/show_bug.cgi?id=190764
2093
2094         Reviewed by Dean Jackson.
2095
2096         - Dots should not be clipped.
2097         - Dots should be horizontally centered.
2098         - Dots should be drawn behind the text.
2099         - Distance from the baseline to the top of the dot should be 11.035% of font size.
2100         - Dot diameter should be 13.247% of the font size.
2101         - Distance between the dots (right side of the left dot to left side of the right dot) should be 9.457% of the font size.
2102         - The "font size" used in these calculations should be clamped so it's 10px <= font size <= 40px.
2103
2104         Tests: editing/spelling/spelling-dots-position-2.html
2105                editing/spelling/spelling-dots-position-3.html
2106                editing/spelling/spelling-dots-position.html
2107                editing/spelling/spelling-dots-repaint.html
2108
2109         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
2110         (WebCore::colorForMarkerLineStyle): Align iOS and macOS implementations.
2111         (WebCore::GraphicsContext::drawDotsForDocumentMarker): Place the dots correctly.
2112         * rendering/InlineFlowBox.cpp:
2113         (WebCore::InlineFlowBox::addToLine): The KnownToHaveNoOverflow flag should be cleared if the element has spelling dots,
2114             because there is no guarantee the spelling dots will lie inside the layout rect of the element.
2115         (WebCore::InlineFlowBox::addTextBoxVisualOverflow): Update the repaint rects to include splling dot positions.
2116         * rendering/InlineFlowBox.h: Comments should explain why, not say what.
2117         * rendering/InlineTextBox.cpp:
2118         (WebCore::InlineTextBox::paint): Draw the dots behind the text.
2119         (WebCore::InlineTextBox::hasMarkers const): Convenience.
2120         (WebCore::InlineTextBox::paintPlatformDocumentMarkers): Refactor bounds information into a helper function.
2121         (WebCore::InlineTextBox::calculateUnionOfAllDocumentMarkerBounds const): Use for repaint rect calculation.
2122         (WebCore::InlineTextBox::calculateDocumentMarkerBounds const): Place the dots correctly.
2123         (WebCore::InlineTextBox::paintPlatformDocumentMarker): Call the helper method.
2124         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
2125         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Deleted.
2126         * rendering/InlineTextBox.h: Declare the helper methods.
2127         * rendering/SimpleLineLayout.cpp: Simple line layout doesn't know how to paint spelling dots, so make the presence of
2128             spelling dots opt us out of SLL.
2129         (WebCore::SimpleLineLayout::canUseForWithReason):
2130         * rendering/SimpleLineLayoutCoverage.cpp:
2131         (WebCore::SimpleLineLayout::printReason):
2132         * rendering/SimpleLineLayoutCoverage.h: Add a new opt-out reason.
2133
2134 2018-11-05  Dean Jackson  <dino@apple.com>
2135
2136         Attempted build fix.
2137
2138         * dom/messageports/MessagePortChannelRegistry.cpp:
2139
2140 2018-11-05  Chris Dumez  <cdumez@apple.com>
2141
2142         Crash under DOMWindow::postMessageTimerFired()
2143         https://bugs.webkit.org/show_bug.cgi?id=191217
2144         <rdar://problem/40888466>
2145
2146         Reviewed by Geoffrey Garen.
2147
2148         Protect the frame in DOMWindow::postMessageTimerFired() before calling dispatchEvent() as dispatching the
2149         event may cause JS to run and this JS may cause the frame to be destroyed, in which case we will crash
2150         when trying to use the frame on the next line.
2151
2152         Test: fast/dom/Window/remove-frame-in-message-event-handler.html
2153
2154         * page/DOMWindow.cpp:
2155         (WebCore::DOMWindow::postMessageTimerFired):
2156
2157 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
2158
2159         [GStreamer] Fix EncodedImage timestamps to match what libWebRTC expects
2160         https://bugs.webkit.org/show_bug.cgi?id=190035
2161
2162         Reviewed by Philippe Normand.
2163
2164         We can't rely on GStreamer timestamps to pass to EncodedImages after encoding
2165         because libWebRTC doesn't use the timestamp we fed it but does
2166         some computation on the input timestamp in the images we pass in before it passes
2167         them back to the encoder. Then internally LibWebRTC relies on those exact timestamps
2168         passed into the encoder to do checks and compute RTP timestamps so we need to carefully
2169         pass the exact timestamps to LibWebRTC (in practice we still use GStreamer timestamps in
2170         all the GStreamer processing pipelines as the WebRTC object basically wraps the "same"
2171         `GstSample` all around, but we are not synced on the clock anyway).
2172
2173         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
2174         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
2175         (WebCore::LibWebRTCVideoFrameFromGStreamerSample):
2176         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h:
2177         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
2178         (WebCore::GStreamerVideoDecoder::newSampleCallback):
2179         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2180         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
2181         (WebCore::GStreamerVideoEncoder::newSampleCallback):
2182
2183 2018-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2184
2185         [iOS] Changing view scale sometimes does not zoom the page to the new initial scale when the page is zoomed in when ignoring meta viewport
2186         https://bugs.webkit.org/show_bug.cgi?id=191226
2187         <rdar://problem/45781765>
2188
2189         Reviewed by Tim Horton.
2190
2191         When `_setViewScale:` SPI is used to adjust the layout scale factor of the page, we multiply minimum, initial
2192         and maximum scales by the given layout scale factor to adjust for a larger or smaller minimum layout size.
2193         However, in the case where the layout size scale factor is greater than 1 and we're also forcing the viewport to
2194         be scalable, we override the default minimum scale with 1 (i.e. `forceAlwaysUserScalableMinimumScale`). This
2195         means that the might be off by a small margin due to rounding error when computing the content width and view
2196         width (see: r237743).
2197
2198         This means that in the case where (1) the viewport is forced to be user-scalable, and (2) we're ignoring meta
2199         viewport parameters, and (3) `_viewScale` exceeds 1, we may end up computing a slightly different minimum scale
2200         than the default minimum scale multiplied by the layout size scale factor; subsequently, the page scale factor
2201         will be slightly different from initial scale, such that we'll no longer zoom to the new initial scale when
2202         changing view scale.
2203
2204         This patch adjusts `forceAlwaysUserScalableMinimumScale` and `forceAlwaysUserScalableMaximumScale` to take the
2205         current layout scale factor into account when computing min and max scales when the viewport is forced to be
2206         always scalable.
2207
2208         Test: fast/viewport/ios/minimum-scale-after-changing-view-scale.html
2209
2210         * page/ViewportConfiguration.cpp:
2211         (WebCore::ViewportConfiguration::minimumScale const):
2212         * page/ViewportConfiguration.h:
2213         (WebCore::ViewportConfiguration::maximumScale const):
2214         (WebCore::ViewportConfiguration::forceAlwaysUserScalableMaximumScale const):
2215         (WebCore::ViewportConfiguration::forceAlwaysUserScalableMinimumScale const):
2216
2217         Turn these from constant values to const functions on ViewportConfiguration, which factor in the current
2218         viewport layout size scale factor.
2219
2220 2018-11-05  Dean Jackson  <dino@apple.com>
2221
2222         Expose a constructor for PointerEvent from PlatformTouchEvent
2223         https://bugs.webkit.org/show_bug.cgi?id=191238
2224         <rdar://problem/45795682>
2225
2226         Reviewed by Antoine Quint.
2227
2228         Implement a constructor that takes a PlatformTouchEvent to
2229         create a PointerEvent. At the moment the code to call this
2230         constructor will live in WebKitAdditions, so no new tests
2231         yet.
2232
2233         * SourcesCocoa.txt: Add PointerEventIOS.cpp.
2234         * WebCore.xcodeproj/project.pbxproj: Ditto.
2235         * dom/EventNames.h: Add macros for pointerdown, pointermove,
2236              pointerup, pointercancel.
2237         * dom/PointerEvent.cpp: Remove JSC namespace.
2238         * dom/PointerEvent.h: Add create and constructor that takes
2239              a PlatformTouchEvent.
2240         * dom/ios/PointerEventIOS.cpp: Added.
2241
2242 2018-11-05  Ryan Haddad  <ryanhaddad@apple.com>
2243
2244         Unreviewed, rolling out r237785.
2245
2246         Introduced layout test and API test failures on macOS and iOS.
2247
2248         Reverted changeset:
2249
2250         "[iOS] Issue initial paint soon after the visuallyNonEmpty
2251         milestone is fired."
2252         https://bugs.webkit.org/show_bug.cgi?id=191078
2253         https://trac.webkit.org/changeset/237785
2254
2255 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
2256
2257         [GStreamer][WebRTC] Error out when simulcast is activated
2258         https://bugs.webkit.org/show_bug.cgi?id=190678
2259
2260         Reviewed by Philippe Normand.
2261
2262         Implementing it is not for now yet.
2263
2264         Tests for simulcast have been disabled as they now fail (instead of crashing).
2265
2266         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2267         (WebCore::GStreamerVideoEncoder::InitEncode):
2268
2269 2018-11-05  Youenn Fablet  <youenn@apple.com>
2270
2271         RealtimeOutgoingAudioSource subclasses should observe its source when fully constructed
2272         https://bugs.webkit.org/show_bug.cgi?id=191241
2273
2274         Reviewed by Eric Carlson.
2275
2276         Moving the logic to observe the audio source to the point where the
2277         RealtimeOutgoingAudioSource subclass is fully initialized.
2278         Covered by existing tests.
2279
2280         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
2281         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
2282         (WebCore::RealtimeOutgoingAudioSource::observeSource):
2283         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2284         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
2285         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::RealtimeOutgoingAudioSourceLibWebRTC):
2286         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
2287         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
2288
2289 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
2290
2291         [GStreamer][WebRTC] Add webrtcencoder bin to cleanup and refactor the way we set encoders
2292         https://bugs.webkit.org/show_bug.cgi?id=190674
2293
2294         Reviewed by Philippe Normand.
2295
2296         webrtcencoder is a simple GstBin with a set of well known GStreamer encoders which
2297         it can use to implement encoding for different formats exposing a trimmed down unified API.
2298
2299         It also adds proper handling of H264 profiles.
2300
2301         The added files follow GStreamer coding style as we aim at upstreaming the element
2302         in the future.
2303
2304         This is a refactoring so current tests already cover it.
2305
2306         * platform/GStreamer.cmake:
2307         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2308         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
2309         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: Added.
2310         (gst_webrtc_video_encoder_get_property):
2311         (gst_webrtc_video_encoder_set_bitrate):
2312         (gst_webrtc_video_encoder_set_format):
2313         (gst_webrtc_video_encoder_set_property):
2314         (register_known_encoder):
2315         (setup_x264enc):
2316         (setup_vp8enc):
2317         (setup_openh264enc):
2318         (set_bitrate_kbit_per_sec):
2319         (set_bitrate_bit_per_sec):
2320         (gst_webrtc_video_encoder_class_init):
2321         (gst_webrtc_video_encoder_init):
2322         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.h: Added.
2323         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2324         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
2325         (WebCore::GStreamerVideoEncoder::InitEncode):
2326         (WebCore::GStreamerVideoEncoder::createEncoder):
2327         (WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
2328         (WebCore::GStreamerVideoEncoder::ImplementationName const):
2329         (WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
2330
2331 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
2332
2333         [GStreamer][WebRTC] properly mark H.264 stream type in the "decoder"
2334         https://bugs.webkit.org/show_bug.cgi?id=190676
2335
2336         Reviewed by Philippe Normand.
2337
2338         Avoiding to have h264parse make assumption (which might be wrong at some
2339         point).
2340
2341         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
2342         (WebCore::GStreamerVideoDecoder::GetCapsForFrame):
2343
2344 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
2345
2346         [GStreamer] Do not sync libwerbtc stream on the clock
2347         https://bugs.webkit.org/show_bug.cgi?id=190677
2348
2349         The approach here is basically to let libwebrtc do all the
2350         synchronisation for us, and the same way as it is done in apple ports,
2351         we basically try to display what libwebrtc outputs as fast as possible.
2352
2353         Reviewed by Philippe Normand.
2354
2355         Manually tested
2356
2357         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2358         (WebCore::setSyncOnSink):
2359         (WebCore::MediaPlayerPrivateGStreamer::syncOnClock):
2360         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
2361         (WebCore::MediaPlayerPrivateGStreamer::load):
2362         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2363
2364 2018-11-05  Ali Juma  <ajuma@chromium.org>
2365
2366         [IntersectionObserver] Fix isIntersecting computation when 0 is not a threshold
2367         https://bugs.webkit.org/show_bug.cgi?id=191210
2368
2369         Reviewed by Simon Fraser.
2370
2371         isIntersecting should be false if the intersection ratio is smaller than the
2372         smallest threshold value. Update the computation of isIntersecting to depend on
2373         the current thresholdIndex.
2374
2375         Test: imported/w3c/web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.html
2376
2377         * dom/Document.cpp:
2378         (WebCore::Document::updateIntersectionObservations):
2379
2380 2018-11-05  Rob Buis  <rbuis@igalia.com>
2381
2382         Remove some virtual methods in CachedRawResource
2383         https://bugs.webkit.org/show_bug.cgi?id=191251
2384
2385         Reviewed by Frédéric Wang.
2386
2387         Since CachedRawResource is final no need to introduce new virtual
2388         methods in CachedRawResource. This patch also removes an outdated
2389         comment and forward declaration.
2390
2391         No new tests since no change in functionality.
2392
2393         * loader/cache/CachedRawResource.h:
2394
2395 2018-11-05  Philippe Normand  <pnormand@igalia.com>
2396
2397         [GStreamer] Move elements registration to GStreamerCommon
2398         https://bugs.webkit.org/show_bug.cgi?id=191189
2399
2400         Reviewed by Xabier Rodriguez-Calvar.
2401
2402         It was a bit odd to have this in the base player class and to have
2403         sub-classes calling a static function of the super-class.
2404
2405         Covered by existing tests.
2406
2407         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2408         (WebCore::initializeGStreamerAndRegisterWebKitElements):
2409         * platform/graphics/gstreamer/GStreamerCommon.h:
2410         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2411         (WebCore::MediaPlayerPrivateGStreamer::isAvailable):
2412         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
2413         (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
2414         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2415         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2416         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2417         (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
2418         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
2419         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
2420         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
2421
2422 2018-11-04  Rob Buis  <rbuis@igalia.com>
2423
2424         Remove ENABLE_OPENCL fully
2425         https://bugs.webkit.org/show_bug.cgi?id=191172
2426
2427         Reviewed by Yusuke Suzuki.
2428
2429         Forgot to simplify this, no need for applyAll anymore
2430         since it just calls apply.
2431
2432         No new tests since no change in functionality.
2433
2434         * platform/graphics/filters/FilterEffect.h:
2435         (WebCore::FilterEffect::applyAll): Deleted.
2436         * rendering/svg/RenderSVGResourceFilter.cpp:
2437         (WebCore::RenderSVGResourceFilter::postApplyResource):
2438
2439 2018-11-04  Zalan Bujtas  <zalan@apple.com>
2440
2441         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
2442         https://bugs.webkit.org/show_bug.cgi?id=191078
2443         <rdar://problem/45736178>
2444
2445         Reviewed by Antti Koivisto.
2446
2447         1. Improve visuallyNonEmpty milestone confidence level.
2448             Ignore whitespace and non visible text content.
2449             Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
2450             Check if the html/body is actually visible.
2451
2452         2. Issue initial paint soon after the milestone fires.
2453             Use a 0ms timer to flush the initial paint.
2454             Throttle additional flushes for 500ms (remove the non-initial 1.5 throttling)
2455
2456         3. Suspend optional style recalcs and layouts while painting is being throttled.
2457            When parsing yields we initiate a 0ms style recalc/layout timer.
2458            These optional layouts produce content that we have no intention to paint. 
2459
2460         * dom/Document.cpp:
2461         (WebCore::Document::scheduleStyleRecalc):
2462         (WebCore::Document::shouldScheduleLayout):
2463         * page/ChromeClient.h:
2464         * page/FrameView.cpp:
2465         (WebCore::FrameView::resetLayoutMilestones):
2466         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
2467         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
2468         (WebCore::FrameView::updateIsVisuallyNonEmpty):
2469         * page/FrameView.h:
2470         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
2471         * platform/graphics/FontCascade.h:
2472         * rendering/RenderText.cpp: Check whether the text is actually visible at this point.
2473         (WebCore::RenderText::RenderText):
2474
2475 2018-11-04  Zalan Bujtas  <zalan@apple.com>
2476
2477         [LFC][BFC] Add support for percentage height in quirks mode.
2478         https://bugs.webkit.org/show_bug.cgi?id=191232
2479
2480         Reviewed by Antti Koivisto.
2481
2482         In quirks mode, we go and travers the containing block chain to find a block level
2483         box with fixed height value to resolve the percentage value.
2484
2485         Test: fast/block/basic/quirk-mode-percent-height.html
2486
2487         * layout/FormattingContextGeometry.cpp:
2488         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
2489         * layout/Verification.cpp:
2490         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
2491
2492 2018-11-04  Zalan Bujtas  <zalan@apple.com>
2493
2494         [LFC][BCF] Add support for block level non-replaced inflow height percentage
2495         https://bugs.webkit.org/show_bug.cgi?id=191229
2496
2497         Reviewed by Antti Koivisto.
2498
2499         Test: fast/block/basic/child-block-level-box-with-height-percent.html
2500
2501         * layout/FormattingContext.h:
2502         * layout/FormattingContextGeometry.cpp:
2503         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
2504         (WebCore::Layout::computedHeightValue): Deleted.
2505         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2506         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2507
2508 2018-11-04  Youenn Fablet  <youenn@apple.com>
2509
2510         RealtimeOutgoingAudioSource should use DestructionThread::Main
2511         https://bugs.webkit.org/show_bug.cgi?id=191230
2512
2513         Reviewed by Eric Carlson.
2514
2515         Covered by imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html
2516         that should no longer crash in debug.
2517
2518         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2519
2520 2018-11-04  Youenn Fablet  <youenn@apple.com>
2521
2522         IDB should allow storing RTCCertificate
2523         https://bugs.webkit.org/show_bug.cgi?id=191077
2524
2525         Reviewed by Chris Dumez.
2526
2527         Add support for serialization/deserialization of RTCCertificate.
2528         Store the origin in RTCCertificate and make sure that a certificate
2529         with a different origin cannot be used to create a RTCPeerConnection.
2530
2531         Test: imported/w3c/web-platform-tests/webrtc/RTCCertificate-postMessage.html
2532
2533         * Modules/mediastream/PeerConnectionBackend.cpp:
2534         (WebCore::PeerConnectionBackend::generateCertificate):
2535         * Modules/mediastream/RTCCertificate.cpp:
2536         (WebCore::RTCCertificate::create):
2537         (WebCore::RTCCertificate::RTCCertificate):
2538         * Modules/mediastream/RTCCertificate.h:
2539         (WebCore::RTCCertificate::origin const):
2540         * Modules/mediastream/RTCPeerConnection.cpp:
2541         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
2542         * Modules/mediastream/RTCPeerConnection.h:
2543         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
2544         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback):
2545         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
2546         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h:
2547         * bindings/js/SerializedScriptValue.cpp:
2548         (WebCore::CloneSerializer::dumpIfTerminal):
2549         (WebCore::CloneDeserializer::CachedString::takeString):
2550         (WebCore::CloneDeserializer::readRTCCertificate):
2551         (WebCore::CloneDeserializer::readTerminal):
2552
2553 2018-11-04  Youenn Fablet  <youenn@apple.com>
2554
2555         Add support for RTCMuxPolicy
2556         https://bugs.webkit.org/show_bug.cgi?id=191188
2557
2558         Reviewed by Eric Carlson.
2559
2560         Add support for RTCMuxPolicy dictionary option for both constructor and setConfiguration.
2561         Make sure setConfiguration throws if trying to change this policy.
2562         Pipe this parameter up to libwebrtc.
2563         Covered by rebased test.
2564
2565         * Modules/mediastream/RTCConfiguration.h:
2566         * Modules/mediastream/RTCConfiguration.idl:
2567         * Modules/mediastream/RTCPeerConnection.cpp:
2568         (WebCore::iceServersFromConfiguration):
2569         (WebCore::RTCPeerConnection::initializeConfiguration):
2570         (WebCore::RTCPeerConnection::setConfiguration):
2571         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2572         (WebCore::rtcpMuxPolicyfromConfiguration):
2573         (WebCore::configurationFromMediaEndpointConfiguration):
2574         * WebCore.xcodeproj/project.pbxproj:
2575         * platform/mediastream/MediaEndpointConfiguration.cpp:
2576         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
2577         * platform/mediastream/MediaEndpointConfiguration.h:
2578         * platform/mediastream/RTCPMuxPolicy.h: Added.
2579
2580 2018-11-03  Devin Rousso  <drousso@apple.com>
2581
2582         Web Inspector: Canvas: capture changes to <canvas> that would affect the recorded context
2583         https://bugs.webkit.org/show_bug.cgi?id=190854
2584
2585         Reviewed by Matt Baker.
2586
2587         Updated existing tests: inspector/canvas/recording-2d.html
2588                                 inspector/canvas/recording-bitmaprenderer.html
2589                                 inspector/canvas/recording-webgl.html
2590
2591         * html/HTMLCanvasElement.idl:
2592         Apply `CallTracingCallback=recordCanvasAction` to the `width` and `height` attributes so
2593         that they are recorded through the same path as `CanvasRenderingContext`.
2594
2595         * html/CanvasBase.h:
2596         * html/CanvasBase.cpp:
2597         (WebCore::CanvasBase::callTracingActive const): Added.
2598
2599         * bindings/js/CallTracer.h:
2600         * bindings/js/CallTracer.cpp:
2601         (WebCore::CallTracer::recordCanvasAction):
2602
2603
2604 2018-11-03  Andy Estes  <aestes@apple.com>
2605
2606         [Payment Request] PaymentResponse.retry()'s errorFields should be optional
2607         https://bugs.webkit.org/show_bug.cgi?id=191212
2608
2609         Reviewed by Youenn Fablet.
2610
2611         Per WebIDL, the errorFields argument to PaymentResponse.retry() should be optional. See
2612         <https://github.com/w3c/payment-request/issues/804> for details.
2613
2614         Added test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
2615
2616         * Modules/paymentrequest/PaymentResponse.idl:
2617
2618 2018-11-02  Zalan Bujtas  <zalan@apple.com>
2619
2620         [LFC][BFC] Resolve percentage height values.
2621         https://bugs.webkit.org/show_bug.cgi?id=191224
2622
2623         Reviewed by Antti Koivisto.
2624
2625         10.5 Content height: the 'height' property
2626         The percentage is calculated with respect to the height of the generated box's containing block.
2627         If the height of the containing block is not specified explicitly (i.e., it depends on content height),
2628         and this element is not absolutely positioned, the used height is calculated as if 'auto' was specified.
2629
2630         https://www.w3.org/TR/CSS22/visudet.html#propdef-height
2631
2632         Test: fast/block/basic/height-percentage-simple.html
2633
2634         * layout/FormattingContextGeometry.cpp:
2635         (WebCore::Layout::isHeightAuto):
2636         (WebCore::Layout::computedHeightValue):
2637         (WebCore::Layout::contentHeightForFormattingContextRoot):
2638         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
2639         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
2640         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2641         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2642         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2643         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2644
2645 2018-11-03  Eric Carlson  <eric.carlson@apple.com>
2646
2647         [MediaStream] enumerateDevices should not expose devices that are not available to getUserMedia
2648         https://bugs.webkit.org/show_bug.cgi?id=191177
2649         <rdar://problem/45747873>
2650
2651         Reviewed by Jer Noble.
2652
2653         Test: http/tests/media/media-stream/enumerate-devices-iframe-allow-attribute.html
2654
2655         * Modules/mediastream/MediaDevicesRequest.cpp:
2656         (WebCore::MediaDevicesRequest::start): Only expose devices that are available to gUM.
2657
2658         * Modules/mediastream/UserMediaController.cpp:
2659         (WebCore::isSecure): Moved from UserMediaRequest.cpp.
2660         (WebCore::isAllowedToUse): Ditto.
2661         (WebCore::UserMediaController::canCallGetUserMedia): Modified from UserMediaRequest.cpp.
2662         (WebCore::UserMediaController::logGetUserMediaDenial): Log reason for denial.
2663         * Modules/mediastream/UserMediaController.h:
2664
2665         * Modules/mediastream/UserMediaRequest.cpp:
2666         (WebCore::UserMediaRequest::start): Use UserMediaController::canCallGetUserMedia.
2667         (WebCore::isSecure): Deleted.
2668         (WebCore::isAllowedToUse): Deleted.
2669         (WebCore::canCallGetUserMedia): Deleted.
2670
2671 2018-11-02  Justin Michaud  <justin_michaud@apple.com>
2672
2673         Add new global object and preliminary Worklets support for CSS painting api
2674         https://bugs.webkit.org/show_bug.cgi?id=190979
2675
2676         Reviewed by Chris Dumez.
2677
2678         Test: fast/css-custom-paint/worklet.html
2679
2680         Add a new ScriptExecutionContext and global object to run worklets in. This is mostly copy+paste
2681         from Workers, but without any of the threading. Worklet.addModule does not yet support loading scripts
2682         or doing cross origin checking. There are quite a few parts of the ScriptExecutionContext api that are
2683         left as ASSERT_NOT_REACHED().
2684
2685         * CMakeLists.txt:
2686         * DerivedSources.make:
2687         * Sources.txt:
2688         * WebCore.xcodeproj/project.pbxproj:
2689         * bindings/js/JSDOMGlobalObject.cpp:
2690         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
2691         * bindings/js/JSPaintWorkletGlobalScopeCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp.
2692         (WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren):
2693         (WebCore::JSPaintWorkletGlobalScope::registerPaint):
2694         * bindings/js/JSWorkletGlobalScopeBase.cpp: Added.
2695         (WebCore::JSWorkletGlobalScopeBase::JSWorkletGlobalScopeBase):
2696         (WebCore::JSWorkletGlobalScopeBase::finishCreation):
2697         (WebCore::JSWorkletGlobalScopeBase::clearDOMGuardedObjects):
2698         (WebCore::JSWorkletGlobalScopeBase::visitChildren):
2699         (WebCore::JSWorkletGlobalScopeBase::destroy):
2700         (WebCore::JSWorkletGlobalScopeBase::scriptExecutionContext const):
2701         (WebCore::JSWorkletGlobalScopeBase::supportsRichSourceInfo):
2702         (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScript):
2703         (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScriptBeforeTimeout):
2704         (WebCore::JSWorkletGlobalScopeBase::javaScriptRuntimeFlags):
2705         (WebCore::toJS):
2706         (WebCore::toJSWorkletGlobalScope):
2707         * bindings/js/JSWorkletGlobalScopeBase.h: Added.
2708         (WebCore::JSWorkletGlobalScopeBase::wrapped const):
2709         (WebCore::JSWorkletGlobalScopeBase::proxy const):
2710         (WebCore::JSWorkletGlobalScopeBase::createStructure):
2711         (WebCore::toJS):
2712         * bindings/js/ScriptState.cpp:
2713         (WebCore::execStateFromWorkerGlobalScope):
2714         (WebCore::execStateFromWorkletGlobalScope):
2715         * bindings/js/ScriptState.h:
2716         * bindings/js/WebCoreBuiltinNames.h:
2717         * bindings/scripts/CodeGeneratorJS.pm:
2718         (IsDOMGlobalObject):
2719         (ShouldUseGlobalObjectPrototype):
2720         (GenerateHeader):
2721         (GenerateRuntimeEnableConditionalStringForExposed):
2722         (GenerateImplementation):
2723         * bindings/scripts/preprocess-idls.pl:
2724         * css/CSSPaintImageValue.cpp:
2725         (WebCore::CSSPaintImageValue::image):
2726         * css/DOMCSSPaintWorklet.cpp:
2727         (WebCore::DOMCSSPaintWorklet::ensurePaintWorklet):
2728         (WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope): Deleted.
2729         * css/DOMCSSPaintWorklet.h:
2730         * css/DOMCSSPaintWorklet.idl:
2731         * dom/Document.cpp:
2732         (WebCore::Document::ensureCSSPaintWorklet):
2733         (WebCore::Document::setCSSPaintWorkletGlobalScope):
2734         (WebCore::Document::ensureCSSPaintWorkletGlobalScope): Deleted.
2735         * dom/Document.h:
2736         (WebCore::Document::getCSSPaintWorkletGlobalScope):
2737         * dom/EventTargetFactory.in:
2738         * dom/ScriptExecutionContext.cpp:
2739         (WebCore::ScriptExecutionContext::vm):
2740         (WebCore::ScriptExecutionContext::execState):
2741         * dom/ScriptExecutionContext.h:
2742         (WebCore::ScriptExecutionContext::isWorkletGlobalScope const):
2743         * inspector/agents/worker/WorkerDebuggerAgent.cpp:
2744         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
2745         * inspector/agents/worker/WorkerRuntimeAgent.cpp:
2746         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
2747         * platform/graphics/CustomPaintImage.cpp:
2748         (WebCore::CustomPaintImage::CustomPaintImage):
2749         (WebCore::CustomPaintImage::doCustomPaint):
2750         * platform/graphics/CustomPaintImage.h:
2751         * worklets/PaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
2752         (WebCore::PaintWorkletGlobalScope::create):
2753         (WebCore::PaintWorkletGlobalScope::PaintWorkletGlobalScope):
2754         (WebCore::PaintWorkletGlobalScope::devicePixelRatio):
2755         (WebCore::PaintWorkletGlobalScope::addRegisteredPaint):
2756         * worklets/PaintWorkletGlobalScope.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.h.
2757         * worklets/PaintWorkletGlobalScope.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
2758         * worklets/Worklet.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
2759         (WebCore::Worklet::create):
2760         (WebCore::Worklet::Worklet):
2761         (WebCore::Worklet::addModule):
2762         * worklets/Worklet.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
2763         * worklets/Worklet.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
2764         * worklets/WorkletConsoleClient.cpp: Copied from Source/WebCore/inspector/agents/worker/WorkerDebuggerAgent.cpp.
2765         (WebCore::WorkletConsoleClient::WorkletConsoleClient):
2766         (WebCore::WorkletConsoleClient::messageWithTypeAndLevel):
2767         (WebCore::WorkletConsoleClient::count):
2768         (WebCore::WorkletConsoleClient::time):
2769         (WebCore::WorkletConsoleClient::timeEnd):
2770         (WebCore::WorkletConsoleClient::profile):
2771         (WebCore::WorkletConsoleClient::profileEnd):
2772         (WebCore::WorkletConsoleClient::takeHeapSnapshot):
2773         (WebCore::WorkletConsoleClient::timeStamp):
2774         (WebCore::WorkletConsoleClient::record):
2775         (WebCore::WorkletConsoleClient::recordEnd):
2776         * worklets/WorkletConsoleClient.h: Added.
2777         * worklets/WorkletGlobalScope.cpp: Added.
2778         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
2779         (WebCore::WorkletGlobalScope::~WorkletGlobalScope):
2780         (WebCore::WorkletGlobalScope::evaluate):
2781         (WebCore::WorkletGlobalScope::isJSExecutionForbidden const):
2782         (WebCore::WorkletGlobalScope::disableEval):
2783         (WebCore::WorkletGlobalScope::disableWebAssembly):
2784         (WebCore::WorkletGlobalScope::completeURL const):
2785         (WebCore::WorkletGlobalScope::logExceptionToConsole):
2786         (WebCore::WorkletGlobalScope::addConsoleMessage):
2787         (WebCore::WorkletGlobalScope::addMessage):
2788         * worklets/WorkletGlobalScope.h: Added.
2789         (WebCore::WorkletGlobalScope::isPaintWorkletGlobalScope const):
2790         (WebCore::WorkletGlobalScope::identifier const):
2791         (WebCore::WorkletGlobalScope::script):
2792         (WebCore::WorkletGlobalScope::jsRuntimeFlags const):
2793         (isType):
2794         * worklets/WorkletGlobalScope.idl: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
2795         * worklets/WorkletScriptController.cpp: Added.
2796         (WebCore::WorkletScriptController::WorkletScriptController):
2797         (WebCore::WorkletScriptController::~WorkletScriptController):
2798         (WebCore::WorkletScriptController::forbidExecution):
2799         (WebCore::WorkletScriptController::isExecutionForbidden const):
2800         (WebCore::WorkletScriptController::disableEval):
2801         (WebCore::WorkletScriptController::disableWebAssembly):
2802         (WebCore::WorkletScriptController::initScriptWithSubclass):
2803         (WebCore::WorkletScriptController::initScript):
2804         (WebCore::WorkletScriptController::evaluate):
2805         (WebCore::WorkletScriptController::setException):
2806         * worklets/WorkletScriptController.h: Added.
2807         (WebCore::WorkletScriptController::workletGlobalScopeWrapper):
2808         (WebCore::WorkletScriptController::vm):
2809         (WebCore::WorkletScriptController::initScriptIfNeeded):
2810
2811 2018-11-02  Myles C. Maxfield  <mmaxfield@apple.com>
2812
2813         Clean up drawLineForDocumentMarker()
2814         https://bugs.webkit.org/show_bug.cgi?id=191215
2815
2816         Reviewed by Zalan Bujtas.
2817
2818         In preparation for https://bugs.webkit.org/show_bug.cgi?id=190764, I need to do a little bit of refactoring.
2819         This patch has no behavior change; it just does the following:
2820
2821         1. Renames drawLineForDocumentMarker() to drawDotsForDocumentMarker(), because 2 of the 3 implementations draw dots
2822         2. Moves our implementation back into GraphicsContext, because it's simpler and  GraphicsContext is already platform-
2823                specific.
2824         3. The signature used to accept a location and a width, but without a height, it's difficult to know what the bounding
2825                box is. In particular, knowing the bounding box must be possible without a GraphicsContext. So, I've modified
2826                the signature to accept a rectangle instead. The GraphicsContext draws only within this rectangle.
2827
2828         No new tests because there is no behavior change.
2829
2830         * platform/graphics/GraphicsContext.h:
2831         * platform/graphics/GraphicsContextImpl.h:
2832         * platform/graphics/cairo/CairoOperations.cpp:
2833         (WebCore::Cairo::drawDotsForDocumentMarker):
2834         (WebCore::Cairo::drawLineForDocumentMarker): Deleted.
2835         * platform/graphics/cairo/CairoOperations.h:
2836         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2837         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
2838         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
2839         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
2840         (WebCore::GraphicsContextImplCairo::drawDotsForDocumentMarker):
2841         (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker): Deleted.
2842         * platform/graphics/cairo/GraphicsContextImplCairo.h:
2843         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2844         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
2845         (WebCore::colorForMarkerLineStyle):
2846         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
2847         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
2848         * platform/graphics/displaylists/DisplayListItems.cpp:
2849         (WebCore::DisplayList::Item::sizeInBytes):
2850         (WebCore::DisplayList::DrawDotsForDocumentMarker::apply const):
2851         (WebCore::DisplayList::DrawDotsForDocumentMarker::localBounds const):
2852         (WebCore::DisplayList::operator<<):
2853         (WebCore::DisplayList::DrawLineForDocumentMarker::apply const): Deleted.
2854         (WebCore::DisplayList::DrawLineForDocumentMarker::localBounds const): Deleted.
2855         * platform/graphics/displaylists/DisplayListItems.h:
2856         (WebCore::DisplayList::DrawDotsForDocumentMarker::create):
2857         (WebCore::DisplayList::DrawDotsForDocumentMarker::rect const):
2858         (WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker):
2859         (WebCore::DisplayList::DrawLineForDocumentMarker::create): Deleted.
2860         (WebCore::DisplayList::DrawLineForDocumentMarker::point const): Deleted.
2861         (WebCore::DisplayList::DrawLineForDocumentMarker::width const): Deleted.
2862         (WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker): Deleted.
2863         * platform/graphics/displaylists/DisplayListRecorder.cpp:
2864         (WebCore::DisplayList::Recorder::drawDotsForDocumentMarker):
2865         (WebCore::DisplayList::Recorder::drawLineForDocumentMarker): Deleted.
2866         * platform/graphics/displaylists/DisplayListRecorder.h:
2867         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
2868         (Nicosia::CairoOperationRecorder::drawDotsForDocumentMarker):
2869         (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker): Deleted.
2870         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
2871         * platform/graphics/win/GraphicsContextCGWin.cpp:
2872         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
2873         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
2874         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2875         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
2876         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
2877         * rendering/InlineTextBox.cpp:
2878         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
2879         * rendering/RenderTheme.cpp:
2880         (WebCore::RenderTheme::drawLineForDocumentMarker): Deleted.
2881         * rendering/RenderTheme.h:
2882         * rendering/RenderThemeCocoa.h:
2883         * rendering/RenderThemeCocoa.mm:
2884         (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Deleted.
2885         * rendering/RenderThemeIOS.h:
2886         * rendering/RenderThemeIOS.mm:
2887         (WebCore::RenderThemeIOS::colorForMarkerLineStyle): Deleted.
2888         * rendering/RenderThemeMac.h:
2889         * rendering/RenderThemeMac.mm:
2890         (WebCore::RenderThemeMac::colorForMarkerLineStyle): Deleted.
2891
2892 2018-11-02  Ali Juma  <ajuma@chromium.org>
2893
2894         requestAnimationFrame causes bad location of position:fixed inside overflow:auto and iframe
2895         https://bugs.webkit.org/show_bug.cgi?id=176243
2896
2897         Reviewed by Simon Fraser.
2898
2899         When a new layer tree is committed to the UIProcess, the positions of layers for fixed
2900         or sticky nodes in the newly-committed tree can be stale, because of scrolling that has
2901         happened in the UIProcess since the tree was updated in the WebProcess. To handle this,
2902         RemoteLayerTreeDrawingAreaProxy::commitLayerTree updates the positions of these layers
2903         by calling RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling, which
2904         leads to a recursive traversal of the ScrollingTree to update each such layer. However,
2905         since ScrollingTreeFrameScrollingNodeIOS didn't implement updateLayersAfterAncestorChange,
2906         this traversal never descended into scrolling nodes within an iframe, so the layers for
2907         these nodes were left with stale positions.
2908
2909         Implement ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange so that
2910         fixed and sticky layers within an iframe do get their positions updated when a new layer
2911         tree is committed.
2912
2913         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
2914         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2915         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange):
2916
2917 2018-11-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2918
2919         [iOS] Changing view scale sometimes does not zoom the page to the new initial scale, when the page is at initial scale
2920         https://bugs.webkit.org/show_bug.cgi?id=191180
2921         <rdar://problem/45744786>
2922
2923         Reviewed by Simon Fraser.
2924
2925         When computing the minimum scale in ViewportConfiguration::minimumScale, if our content width or height is
2926         shorter than the view width or height, then we recompute the minimum scale such that the content dimensions will
2927         fill the bounds of the view by setting the minimum scale to the view width or height divided by the content
2928         width or height.
2929
2930         Suppose the minimum scale is equal to some value `s`; additionally, let `w_c` denote the content width and `w_v`
2931         denote the view width (as integers). If `w_v / s` is not an integral value, the computed content width `w_c` may
2932         be rounded, such that `w_v / w_c` is not precisely equal to `s`. In the case that `w_v / w_c` is ever so
2933         slightly larger than `s`, we will end up overriding the minimum scale `s` with `w_v / w_c`.
2934
2935         As a result, specifying a viewport with a decimal `minimum-scale` will sometimes cause the computed minimum
2936         scale of the viewport (and platform view) to be very slightly different from the minimum scale. The new layout
2937         test below exercises this scenario, specifying a viewport with minimum and initial scales of 0.94 that results
2938         in `ViewportConfiguration::minimumScale` returning 0.94158.
2939
2940         With the `WebPage::setViewportConfigurationViewLayoutSize` check added in r237127, this means setting
2941         `_viewScale:` when the page is at initial scale sometimes doesn't zoom the page to the new initial scale when it
2942         should, since the page scale factor and the initial scale are different enough such that
2943         `areEssentiallyEqualAsFloat` returns false.
2944
2945         This patch addresses these issues by snapping to the minimum scale if the computed scale that fits content
2946         dimensions to view dimensions results in a minimum scale that is close enough to the configuration's minimum
2947         scale, such that the difference can be attributed to rounding error when computing content or view dimensions.
2948
2949         Test: fast/viewport/ios/viewport-minimum-and-initial-scale.html
2950
2951         * page/ViewportConfiguration.cpp:
2952         (WebCore::ViewportConfiguration::minimumScale const):
2953
2954 2018-11-02  Philippe Normand  <pnormand@igalia.com>
2955
2956         [GTK][WPE] Unreviewed, another --no-video --no-web-audio build fix following r237677
2957
2958         * inspector/agents/InspectorDOMAgent.cpp:
2959         (WebCore::InspectorDOMAgent::addEventListenersToNode):
2960
2961 2018-11-02  Daniel Bates  <dabates@apple.com>
2962
2963         [iOS] Normalize character string based on key code
2964         https://bugs.webkit.org/show_bug.cgi?id=191120
2965
2966         Reviewed by Tim Horton.
2967
2968         Following r236417 (https://bugs.webkit.org/show_bug.cgi?id=189604) we always have a valid key code
2969         for a special key (e.g. page up) and can simplify the character string normalization code.
2970
2971         No functionality changed. So, no new tests.
2972
2973         * platform/ios/WebEvent.mm:
2974         (normalizedStringWithAppKitCompatibilityMapping): Modified to take a key code and wrote algorithm
2975         in terms of it.
2976
2977         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
2978         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
2979         Pass the key code for the event to normalizedStringWithAppKitCompatibilityMapping().
2980
2981 2018-11-02  Daniel Bates  <dabates@apple.com>
2982
2983         [iOS] WebKit should dispatch DOM events when a modifier key is pressed
2984         https://bugs.webkit.org/show_bug.cgi?id=190487
2985
2986         Reviewed by Tim Horton.
2987
2988         Add support for modifier flags change events.
2989
2990         * platform/ios/PlatformEventFactoryIOS.mm:
2991         (WebCore::modifiersForEvent): Modifier keys do not have an associated character and do not
2992         participate in key repeat.
2993         (WebCore::keyIdentifierForKeyEvent): Identify modifier keys, returning "Unidentified" if
2994         the modifier key is unidentified. This matches the behavior on Mac.
2995         (WebCore::keyForKeyEvent): Identify modifier keys, returning the empty string if the modifier
2996         key is unidentified. This matches the behavior on Mac.
2997         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
2998         * platform/ios/WebEvent.h:
2999
3000         * platform/ios/WebEvent.mm:
3001         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
3002         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
3003         Modifier keys do not have an associated character and do not participate in key repeat.
3004
3005         (-[WebEvent _eventDescription]): Modified to print a description for a keydown or keyup event
3006         that represents a modifier flags change.
3007         (-[WebEvent characters]): Modifier keys do not have an associated character. Assert this
3008         invariant as it is a programming error. On Mac, the same operation would result in a
3009         NSInternalInconsistencyException exception being raised.
3010         (-[WebEvent charactersIgnoringModifiers]): Ditto.
3011
3012 2018-11-02  Ali Juma  <ajuma@chromium.org>
3013
3014         Allow cross-document intersection observing
3015         https://bugs.webkit.org/show_bug.cgi?id=165746
3016
3017         Reviewed by Simon Fraser.
3018
3019         Add logic to compute the intersection between the viewport and an element in a
3020         subframe.
3021
3022         Add a FloatRect version of ScrollView::rootViewToContents, and FloatRect versions
3023         of the methods it calls.
3024
3025         Test: http/tests/intersection-observer/intermediate-frame-changes.html
3026         Also covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer.
3027
3028         * dom/Document.cpp:
3029         (WebCore::computeClippedRectInRootContentsSpace):
3030         (WebCore::computeIntersectionState):
3031         (WebCore::Document::updateIntersectionObservations):
3032         * page/FrameView.cpp:
3033         (WebCore::FrameView::viewportContentsChanged):
3034         (WebCore::FrameView::convertFromContainingViewToRenderer const):
3035         (WebCore::FrameView::convertFromContainingView const):
3036         * page/FrameView.h:
3037         * platform/ScrollView.cpp:
3038         (WebCore::ScrollView::viewToContents const):
3039         (WebCore::ScrollView::contentsToView const):
3040         (WebCore::ScrollView::rootViewToContents const):
3041         * platform/ScrollView.h:
3042         * platform/Widget.cpp:
3043         (WebCore::Widget::convertFromRootView const):
3044         (WebCore::Widget::convertFromContainingView const):
3045         * platform/Widget.h:
3046
3047 2018-11-02  Rob Buis  <rbuis@igalia.com>
3048
3049         Remove ENABLE_OPENCL fully
3050         https://bugs.webkit.org/show_bug.cgi?id=191172
3051
3052         Reviewed by Yusuke Suzuki.
3053
3054         No new tests since no change in functionality.
3055
3056         * platform/graphics/filters/FilterEffect.h:
3057         (WebCore::FilterEffect::hasResult const):
3058         (WebCore::FilterEffect::applyAll):
3059         (WebCore::FilterEffect::openCLImage): Deleted.
3060         (WebCore::FilterEffect::setOpenCLImage): Deleted.
3061
3062 2018-11-02  Zalan Bujtas  <zalan@apple.com>
3063
3064         [LFC][IFC] Add support for intrinsic width calculation
3065         https://bugs.webkit.org/show_bug.cgi?id=191144
3066
3067         Reviewed by Antti Koivisto.
3068
3069         This is the inline formatting version of the shrink-to-fit computation. It generates inline runs
3070         and uses InlineLineBreaker to compute min/max width. This is very similar to ::layout.
3071
3072         Test: fast/inline/simple-shrink-to-fit-inline-block.html
3073
3074         * layout/inlineformatting/InlineFormattingContext.cpp:
3075         (WebCore::Layout::InlineFormattingContext::layout const):
3076         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
3077         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
3078         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
3079         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
3080         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
3081         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
3082         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const): Deleted.
3083         * layout/inlineformatting/InlineFormattingContext.h:
3084
3085 2018-11-02  Zalan Bujtas  <zalan@apple.com>
3086
3087         [LFC][BFC] BlockFormattingContext::instrinsicWidthConstraints logic should look similar to ::layout
3088         https://bugs.webkit.org/show_bug.cgi?id=191181
3089
3090         Reviewed by Antti Koivisto.
3091
3092         * layout/blockformatting/BlockFormattingContext.cpp:
3093         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
3094
3095 2018-11-02  Zalan Bujtas  <zalan@apple.com>
3096
3097         [LFC] Align shrink-to-fit width computation with the layout implementation.
3098         https://bugs.webkit.org/show_bug.cgi?id=191179
3099
3100         Reviewed by Antti Koivisto.
3101
3102         There are many similarities between layout and shrink-to-fit.
3103         They both operate on formatting roots only (shrink-to-fit -> float, out-of-flow, inline-block) and in both cases
3104         the algoritm depends on what type of formatting context the element establishes.
3105
3106         This patch is in preparation for transforming the "shrink-to-fit" width computation to make it behave more like layout.
3107         With this change the instrinsicWidthConstraints() computation happens in the formatting context that the element establishes (similar to layout).
3108
3109         * layout/FormattingContext.cpp:
3110         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
3111         * layout/FormattingContext.h:
3112         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
3113         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
3114         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3115         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3116         * layout/FormattingContextGeometry.cpp:
3117         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
3118         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3119         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3120         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
3121         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
3122         * layout/blockformatting/BlockFormattingContext.cpp:
3123         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3124         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
3125         * layout/blockformatting/BlockFormattingContext.h:
3126         * layout/inlineformatting/InlineFormattingContext.cpp:
3127         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
3128         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
3129         * layout/inlineformatting/InlineFormattingContext.h:
3130         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3131         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
3132
3133 2018-11-01  Antoine Quint  <graouts@apple.com>
3134
3135         [Web Animations] Make document.getAnimations() return declarative animations in the correct order
3136         https://bugs.webkit.org/show_bug.cgi?id=191153
3137
3138         Reviewed by Dean Jackson.
3139
3140         The Web Animations spec has the notion of "composite order" which determines the order in which animations should
3141         be returned when document.getAnimations() is called. The CSS Transitions and CSS Animations specifications also
3142         determine the composite order of their respective animation classes, as well as the notion of "owning element",
3143         the element that was the animation target when specified through style, prior to any manipulation via the Web
3144         Animations API. We implement these two notions so that we can pass the document.getAnimations() tests for
3145         declarative animations.
3146
3147         It is important that we have the notion of an "owning element" since when a CSS Transition or CSS Animation is
3148         modified via the Web Animations API in a way that an animation created through CSS we must consider no longer
3149         as a declarative animation but as a regular Web Animation. In this patch, we remove the DeclarativeAnimation's
3150         target(), which returned a reference, to owningElement(), which returns a pointer and return nullptr once the
3151         declarative animation has been modified.
3152
3153         In order to also keep a correct count of declarative animations applied to elements, we correctly add transitions
3154         that have completed to a list of completed transitions, as specified by the CSS Transitions spec. We have had this
3155         list declared in AnimationTimeline.h for a while but never actually did the work to add items to it. Thanks to that,
3156         AnimationTimeline::updateCSSTransitionsForElement() now correctly accounts for completed transitions so that they
3157         may be canceled if overridden with a new animation, correctly removing their "owning element".
3158
3159         Finally, now that we have saner lists of animations per classes, we can apply the right sorting routines to match
3160         the composite order for CSS Transitions, CSS Animations and Web Animations, keeping a list of all animations created
3161         in order as the final criterion for sorting.
3162
3163         * animation/AnimationTimeline.cpp:
3164         (WebCore::AnimationTimeline::animationTimingDidChange): Make sure this animation is tracked on the list of all animations
3165         created for this timeline in the order in which they were created, which is needed to sort animations correctly when
3166         document.getAnimations() is called.
3167         (WebCore::AnimationTimeline::animationWasAddedToElement): We've removed the relevantMapForAnimation() method which we used
3168         to determine which map we should add an animation to based on its class and instead have code that accounts for not just
3169         the animation's class, but also whether it has an owning element since a valid owning element is required to qualify as
3170         a CSS Transition or CSS Animation, regardless of the animation's original class.
3171         (WebCore::removeAnimationFromMapForElement): Adding this helper to remove an animation from the provided animation map so
3172         that animationWasRemovedFromElement() can call this with all of the various animation maps.
3173         (WebCore::AnimationTimeline::animationWasRemovedFromElement): Check all of the various animation maps to see which may
3174         contain the animation we're trying to remove as the owning element might have been cleared by the time this function is
3175         called and looking at the animation's class would not be sufficient to determine which animation map the animation was in.
3176         (WebCore::AnimationTimeline::removeDeclarativeAnimationFromListsForOwningElement): New function in which the logic from
3177         animationWasRemovedFromElement() that dealt with removing animations from the list of running CSS Animations/Transitions as
3178         well as completed CSS Transitions was factored out. This allowed us to also call this function from
3179         DeclarativeAnimation::disassociateFromOwningElement().
3180         (WebCore::AnimationTimeline::elementWasRemoved): We no longer need to remove an animation as canceling it will remove it
3181         correctly when DocumentTimeline::updateAnimationsAndSendEvents() is called.
3182         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Call cancelDeclarativeAnimation() instead of the removed
3183         cancelOrRemoveDeclarativeAnimation() when a CSS Animation should be canceled.
3184         (WebCore::AnimationTimeline::ensureRunningTransitionsByProperty): Now that we correctly remove transitions from the list
3185         of running transitions once they've completed or have been canceled, we need a helper to always get a valid map of running
3186         transitions for a given element as that map can be cleared while updateCSSTransitionsForElement() is running. 
3187         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Call cancelDeclarativeAnimation() instead of the removed
3188         cancelOrRemoveDeclarativeAnimation() when a CSS Transition should be canceled. Additionally we always get the list of running
3189         transitions for a given element as it can be cleared by a prior cancelation.
3190         (WebCore::AnimationTimeline::cancelDeclarativeAnimation): New function replacing cancelOrRemoveDeclarativeAnimation() in which
3191         we call the new DeclarativeAnimation::cancelFromStyle() function on the provided animation and then remove the animation from
3192         all known lists, including the new list of all animations. We do this final part so that the animation gets re-added as if it
3193         were a new animation since canceling a declarative animation via a style change removes its declarative-ness. This guarantees
3194         that a declarative animation that is canceled through style but then resumed through the Web Animations API sorts after any
3195         declarative animation with an owning element.
3196         (WebCore::AnimationTimeline::relevantMapForAnimation): Deleted.
3197         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Deleted.
3198         * animation/AnimationTimeline.h:
3199         (WebCore::AnimationTimeline::timingModelDidChange): Deleted. This was left over in the patch where we implemented the "update
3200         animations and send events" procedure.
3201         (WebCore::AnimationTimeline::animations const): Deleted.
3202         * animation/CSSAnimation.cpp:
3203         (WebCore::CSSAnimation::create): Some refactoring to make the handling of a declarative animation's owning element part of the
3204         DeclarativeAnimation constructor.
3205         * animation/CSSTransition.cpp:
3206         (WebCore::CSSTransition::create): Some refactoring to make the handling of a declarative animation's owning element part of the
3207         DeclarativeAnimation constructor.
3208         * animation/DeclarativeAnimation.cpp:
3209         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
3210         (WebCore::DeclarativeAnimation::tick): Make sure we disassociate from the animation's owning element once we transition from a
3211         relevant state to an idle state. This will catch any changes made via the Web Animations API to a declarative animation when the
3212         "update animations and send events" procedure is run.
3213         (WebCore::DeclarativeAnimation::disassociateFromOwningElement): Remove this animation from the list of declarative animations on
3214         the associated timeline and make owningElement() nullptr so that document.getAnimations() will know to sort this animation with other
3215         Web Animations created via the Web Animations API.
3216         (WebCore::DeclarativeAnimation::initialize):
3217         (WebCore::DeclarativeAnimation::cancelFromStyle): New method called from AnimationTimeline::cancelDeclarativeAnimation() which
3218         cancels the animation but also disassociates it from its owning element.
3219         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
3220         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
3221         * animation/DeclarativeAnimation.h:
3222         (WebCore::DeclarativeAnimation::owningElement const):
3223         (WebCore::DeclarativeAnimation::target const): Deleted.
3224         * animation/DocumentTimeline.cpp:
3225         (WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): Adding a new utility used when sorting both
3226         CSS Transitions and CSS Animations by tree order when their owning element differ, with special logic for pseudo-elements.
3227         (WebCore::DocumentTimeline::getAnimations const): Filter and sort animations according to their composite order.
3228         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Compile a list of transitions that move to a finished state to
3229         the list of completed transitions so that they may be canceled correctly in AnimationTimeline::updateCSSTransitionsForElement().
3230         (WebCore::DocumentTimeline::transitionDidComplete):
3231         * animation/DocumentTimeline.h:
3232
3233 2018-11-02  Zan Dobersek  <zdobersek@igalia.com>
3234
3235         PNGImageDecoder: report no repetition for non-animated images
3236         https://bugs.webkit.org/show_bug.cgi?id=191068
3237
3238         Reviewed by Michael Catanzaro.
3239
3240         When building with APNG support enabled, the
3241         PNGImageDecoder::repetitionCount() method until now reported  infinite
3242         repetition count for all PNG images, even the ones that were not
3243         animated. This is now changed so that no repetition is reported for
3244         non-animated images.
3245
3246         * platform/image-decoders/png/PNGImageDecoder.cpp:
3247         (WebCore::PNGImageDecoder::repetitionCount const):
3248
3249 2018-11-02  Justin Fan  <justin_fan@apple.com>
3250
3251         [WebGPU] Experimental prototype for MSL shaders
3252         https://bugs.webkit.org/show_bug.cgi?id=191084
3253
3254         Reviewed by Dean Jackson.
3255
3256         Begin implementation for WebGPUDevice and WebGPUShaderModule and associated descriptor objects.
3257
3258         Test: webgpu/webgpu-basics.html
3259         Test: webgpu/shader-modules.html
3260
3261         * CMakeLists.txt:
3262         * DerivedSources.make:
3263         * Modules/webgpu/GPUDevice.cpp: 
3264         (WebCore::GPUDevice::createShaderModule const):
3265         * Modules/webgpu/GPUDevice.h: 
3266         (WebCore::GPUDevice::platformDevice const):
3267         * Modules/webgpu/GPUShaderModule.h:
3268         (WebCore::GPUShaderModule::platformShaderModule const):
3269         * Modules/webgpu/GPUShaderModuleDescriptor.h:
3270         * Modules/webgpu/WebGPU.cpp:
3271         (WebCore::WebGPU::requestAdapter const):
3272         * Modules/webgpu/WebGPUAdapter.cpp:
3273         (WebCore::WebGPUAdapter::create):
3274         (WebCore::WebGPUAdapter::createDevice):
3275         * Modules/webgpu/WebGPUAdapter.h:
3276         * Modules/webgpu/WebGPUAdapter.idl:
3277         * Modules/webgpu/WebGPUDevice.cpp:
3278         (WebCore::WebGPUDevice::create):
3279         (WebCore::WebGPUDevice::WebGPUDevice):
3280         (WebCore::WebGPUDevice::createShaderModule const):
3281         * Modules/webgpu/WebGPUDevice.h:
3282         * Modules/webgpu/WebGPUDevice.idl:
3283         * Modules/webgpu/WebGPUShaderModule.cpp:
3284         (WebCore::WebGPUShaderModule::create):
3285         (WebCore::WebGPUShaderModule::WebGPUShaderModule):
3286         * Modules/webgpu/WebGPUShaderModule.h:
3287         * Modules/webgpu/WebGPUShaderModule.idl:
3288         * Modules/webgpu/WebGPUShaderModuleDescriptor.h:
3289         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
3290         * Modules/webgpu/WebGPUSwapChain.cpp:
3291         (WebCore::WebGPUSwapChain::configure):
3292         * Modules/webgpu/WebGPUSwapChain.h:
3293         * Modules/webgpu/WebGPUSwapChain.idl:
3294         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
3295         (WebCore::GPUDevice::create):
3296         (WebCore::GPUDevice::GPUDevice):
3297         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
3298         (WebCore::GPUShaderModule::create):
3299         (WebCore::GPUShaderModule::GPUShaderModule):
3300         * Sources.txt:
3301         * SourcesCocoa.txt:
3302         * WebCore.xcodeproj/project.pbxproj:
3303         * bindings/js/WebCoreBuiltinNames.h:
3304         * platform/Logging.h:
3305
3306 2018-11-01  Jiewen Tan  <jiewen_tan@apple.com>
3307
3308         Replace CommonRandom SPI with API
3309         https://bugs.webkit.org/show_bug.cgi?id=191178
3310         <rdar://problem/45722391>
3311
3312         Reviewed by Brent Fulgham.
3313
3314         The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace
3315         all SPI usages with API.
3316
3317         No change of behaviors.
3318
3319         * crypto/CommonCryptoUtilities.h:
3320         * crypto/mac/CryptoKeyMac.cpp:
3321         (WebCore::CryptoKey::randomData):
3322         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
3323         (WebCore::createAndStoreMasterKey):
3324         (WebCore::wrapSerializedCryptoKey):
3325         * page/Crypto.cpp:
3326         (WebCore::Crypto::getRandomValues):
3327
3328 2018-11-01  Chris Dumez  <cdumez@apple.com>
3329
3330         [WebIDL] Rename CallWith=ScriptState to CallWith=ExecState
3331         https://bugs.webkit.org/show_bug.cgi?id=191162
3332
3333         Reviewed by Alex Christensen.
3334
3335         Rename CallWith=ScriptState to CallWith=ExecState in our Web IDL as ScriptState is no longer a thing
3336         in modern WebKit. The implementation is actually passed an ExecState nowadays.
3337
3338         * Modules/applepay/ApplePaySession.idl:
3339         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
3340         * Modules/fetch/FetchBody.idl:
3341         * Modules/indexeddb/IDBCursor.idl:
3342         * Modules/indexeddb/IDBFactory.idl:
3343         * Modules/indexeddb/IDBIndex.idl:
3344         * Modules/indexeddb/IDBKeyRange.idl:
3345         * Modules/indexeddb/IDBObjectStore.idl:
3346         * Modules/mediastream/RTCPeerConnection.idl:
3347         * animation/Animatable.idl:
3348         * animation/KeyframeEffect.idl:
3349         * animation/KeyframeEffectReadOnly.idl:
3350         * bindings/scripts/CodeGeneratorJS.pm:
3351         (GenerateCallWith):
3352         (GenerateConstructorDefinition):
3353         * bindings/scripts/IDLAttributes.json:
3354         * bindings/scripts/test/JS/JSTestObj.cpp:
3355         (WebCore::jsTestObjWithExecStateAttributeGetter):
3356         (WebCore::jsTestObjWithExecStateAttribute):
3357         (WebCore::setJSTestObjWithExecStateAttributeSetter):
3358         (WebCore::setJSTestObjWithExecStateAttribute):
3359         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttributeGetter):
3360         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttribute):
3361         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttributeSetter):
3362         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttribute):
3363         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeGetter):
3364         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
3365         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeSetter):
3366         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
3367         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody):
3368         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoid):
3369         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjBody):
3370         (WebCore::jsTestObjPrototypeFunctionWithExecStateObj):
3371         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody):
3372         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidException):
3373         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjExceptionBody):
3374         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjException):
3375         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody):
3376         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecState):
3377         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjExceptionBody):
3378         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjException):
3379         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpacesBody):
3380         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpaces):
3381         (WebCore::jsTestObjWithScriptStateAttributeGetter): Deleted.
3382         (WebCore::jsTestObjWithScriptStateAttribute): Deleted.
3383         (WebCore::setJSTestObjWithScriptStateAttributeSetter): Deleted.
3384         (WebCore::setJSTestObjWithScriptStateAttribute): Deleted.
3385         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter): Deleted.
3386         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
3387         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeSetter): Deleted.
3388         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
3389         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter): Deleted.
3390         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
3391         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeSetter): Deleted.
3392         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
3393         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidBody): Deleted.
3394         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoid): Deleted.
3395         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjBody): Deleted.
3396         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj): Deleted.
3397         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidExceptionBody): Deleted.
3398         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException): Deleted.
3399         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjExceptionBody): Deleted.
3400         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException): Deleted.
3401         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateBody): Deleted.
3402         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState): Deleted.
3403         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjExceptionBody): Deleted.
3404         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException): Deleted.
3405         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpacesBody): Deleted.
3406         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces): Deleted.
3407         * bindings/scripts/test/TestObj.idl:
3408         * bindings/scripts/test/TestPromiseRejectionEvent.idl:
3409         * crypto/SubtleCrypto.idl:
3410         * dom/Element.idl:
3411         * dom/ErrorEvent.idl:
3412         * dom/MessagePort.idl:
3413         * dom/MouseEvent.idl:
3414         * html/HTMLCanvasElement.idl:
3415         * html/HTMLFrameElement.idl:
3416         * html/OffscreenCanvas.idl:
3417         * html/track/DataCue.idl:
3418         * inspector/CommandLineAPIHost.idl:
3419         * page/DOMWindow.idl:
3420         * page/RemoteDOMWindow.idl:
3421         * page/WindowOrWorkerGlobalScope.idl:
3422         * testing/Internals.idl:
3423         * workers/DedicatedWorkerGlobalScope.idl:
3424         * workers/Worker.idl:
3425
3426 2018-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
3427
3428         Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
3429         https://bugs.webkit.org/show_bug.cgi?id=189693
3430
3431         Reviewed by Yusuke Suzuki.
3432
3433         No new tests because there's no behaviro changes.
3434
3435         * platform/SharedBuffer.cpp: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
3436         * xml/XSLTProcessorLibxslt.cpp: Ditto.
3437         * xml/parser/XMLDocumentParserLibxml2.cpp: Ditto.
3438
3439 2018-11-01  John Wilander  <wilander@apple.com>
3440
3441         In WebCore::ResourceLoadObserver, use document.sessionID().isEphemeral() when possible and check for page existence when not
3442         https://bugs.webkit.org/show_bug.cgi?id=191119
3443         <rdar://problem/44176965>
3444
3445         Reviewed by Chris Dumez.
3446
3447         New API test added.
3448
3449         * loader/ResourceLoadObserver.cpp:
3450         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3451         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3452
3453 2018-11-01  Devin Rousso  <drousso@apple.com>
3454
3455         Web Inspector: Network: remove unnecessary media event tracking
3456         https://bugs.webkit.org/show_bug.cgi?id=191174
3457
3458         Reviewed by Joseph Pecoraro.
3459
3460         No new tests, as this simply removes some event listeners for the WebInspector frontend.
3461
3462         * inspector/agents/InspectorDOMAgent.cpp:
3463         (WebCore::InspectorDOMAgent::addEventListenersToNode):
3464
3465 2018-11-01  Chris Dumez  <cdumez@apple.com>
3466
3467         Location object sans browsing context
3468         https://bugs.webkit.org/show_bug.cgi?id=191060
3469
3470         Reviewed by Geoffrey Garen.
3471
3472         As per https://github.com/whatwg/html/pull/4076, a Location object's URL should be "about:blank" when
3473         it does not have a browsing context (Frame), not "".
3474
3475         No new tests, rebaselined existing tests.
3476
3477         * page/Location.cpp:
3478         (WebCore::Location::url const):
3479         (WebCore::Location::href const):
3480         (WebCore::Location::protocol const):
3481         (WebCore::Location::host const):
3482         (WebCore::Location::hostname const):
3483         (WebCore::Location::port const):
3484         (WebCore::Location::pathname const):
3485         (WebCore::Location::search const):
3486         (WebCore::Location::origin const):
3487         (WebCore::Location::hash const):
3488
3489 2018-11-01  Sihui Liu  <sihui_liu@apple.com>
3490
3491         Add a storage limit for IndexedDB
3492         https://bugs.webkit.org/show_bug.cgi?id=190598
3493         <rdar://problem/44654715>
3494
3495         Reviewed by Chris Dumez.
3496
3497         Set a storage limit in IndexedDB for each pair of mainFrameOrigin and openingOrigin. 
3498         IndexedDB will return a QuotaExceededError if limit is reached.
3499
3500         If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is 
3501         half the free disk space.
3502
3503         Test: storage/indexeddb/storage-limit.html
3504
3505         * Modules/indexeddb/server/IDBBackingStore.h:
3506         * Modules/indexeddb/server/IDBServer.cpp:
3507         (WebCore::IDBServer::IDBServer::createBackingStore):
3508         (WebCore::IDBServer::IDBServer::setPerOriginQuota):
3509         * Modules/indexeddb/server/IDBServer.h:
3510         (WebCore::IDBServer::IDBServer::perOriginQuota const):
3511         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3512         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3513         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
3514         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
3515         (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
3516         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
3517         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
3518         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
3519         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
3520         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
3521         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
3522         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
3523         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
3524         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3525         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3526         (WebCore::IDBServer::UniqueIDBDatabase::setQuota):
3527         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3528
3529 2018-11-01  Justin Michaud  <justin_michaud@apple.com>
3530
3531         CSS Custom Properties API Should Support syntax="*" and "<length>", and handle cycles properly
3532         https://bugs.webkit.org/show_bug.cgi?id=191042
3533
3534         Reviewed by Antti Koivisto.
3535
3536         Refactor code so that:
3537         - All properties applied in StyleResolver::applyMatchedProperties are only applied once. 
3538         - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
3539           every time they were referenced, and again in RenderStyle.
3540         - The font-size property is applied after its variable references, but before custom properties that depend on it.
3541         - Cycles are detected at the same time as resolution.
3542         - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
3543           If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
3544           This behaviour matches chrome, but is not documented in the spec. 
3545         - Custom property values have more explicit resolved/unresolved state.
3546         - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
3547
3548         Tests: css-custom-properties-api/crash.html
3549                css-custom-properties-api/cycles.html
3550                css-custom-properties-api/inline.html
3551
3552         * css/CSSComputedStyleDeclaration.cpp:
3553         (WebCore::ComputedStyleExtractor::customPropertyValue):
3554         * css/CSSCustomPropertyValue.cpp:
3555         (WebCore::CSSCustomPropertyValue::equals const):
3556         (WebCore::CSSCustomPropertyValue::customCSSText const):
3557         (WebCore::CSSCustomPropertyValue::tokens const):
3558         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
3559         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
3560         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
3561         * css/CSSCustomPropertyValue.h:
3562         * css/CSSRegisteredCustomProperty.cpp:
3563         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
3564         * css/CSSRegisteredCustomProperty.h:
3565         * css/CSSVariableData.cpp:
3566         (WebCore::CSSVariableData::CSSVariableData):
3567         (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
3568         (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
3569         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
3570         (WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
3571         (WebCore::CSSVariableData::resolveVariableReference const): Deleted.
3572         (WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
3573         (WebCore::CSSVariableData::resolveTokenRange const): Deleted.
3574         * css/CSSVariableData.h:
3575         (WebCore::CSSVariableData::create):
3576         (WebCore::CSSVariableData::createResolved): Deleted.
3577         (WebCore::CSSVariableData::needsVariableResolution const): Deleted.
3578         (WebCore::CSSVariableData::CSSVariableData): Deleted.
3579         * css/CSSVariableReferenceValue.cpp:
3580         (WebCore::resolveVariableFallback):
3581         (WebCore::resolveVariableReference):
3582         (WebCore::resolveTokenRange):
3583         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
3584         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
3585         * css/CSSVariableReferenceValue.h:
3586         (WebCore::CSSVariableReferenceValue::create):
3587         (WebCore::CSSVariableReferenceValue::equals const):
3588         (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
3589         * css/DOMCSSRegisterCustomProperty.cpp:
3590         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
3591         * css/PropertySetCSSStyleDeclaration.cpp:
3592         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
3593         * css/StyleBuilderCustom.h:
3594         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
3595         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
3596         * css/StyleProperties.cpp:
3597         (WebCore::MutableStyleProperties::setCustomProperty):
3598         * css/StyleProperties.h:
3599         * css/StyleResolver.cpp:
3600         (WebCore::StyleResolver::State::setStyle):
3601         (WebCore::StyleResolver::styleForKeyframe):
3602         (WebCore::StyleResolver::styleForPage):
3603         (WebCore::StyleResolver::applyMatchedProperties):
3604         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
3605         (WebCore::StyleResolver::applyProperty):
3606         (WebCore::StyleResolver::resolvedVariableValue const):
3607         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
3608         (WebCore::StyleResolver::CascadedProperties::Property::apply):
3609         (WebCore::StyleResolver::applyCascadedCustomProperty):
3610         (WebCore::StyleResolver::applyCascadedProperties):
3611         * css/StyleResolver.h:
3612         * css/parser/CSSParser.cpp:
3613         (WebCore::CSSParser::parseValueWithVariableReferences):
3614         * css/parser/CSSParser.h:
3615         * css/parser/CSSPropertyParser.cpp:
3616         (WebCore::CSSPropertyParser::CSSPropertyParser):
3617         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
3618         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
3619         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
3620         (WebCore::CSSPropertyParser::parseValueStart):
3621         (WebCore::CSSPropertyParser::parseSingleValue):
3622         * css/parser/CSSPropertyParser.h:
3623         * css/parser/CSSVariableParser.cpp:
3624         (WebCore::CSSVariableParser::parseDeclarationValue):
3625         * dom/ConstantPropertyMap.cpp:
3626         (WebCore::ConstantPropertyMap::setValueForProperty):
3627         (WebCore::variableDataForPositivePixelLength):
3628         (WebCore::variableDataForPositiveDuration):
3629         * rendering/style/RenderStyle.cpp:
3630         (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
3631         * rendering/style/RenderStyle.h:
3632         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
3633         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
3634         * rendering/style/StyleCustomPropertyData.h:
3635         (WebCore::StyleCustomPropertyData::operator== const):
3636         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
3637         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
3638         (): Deleted.
3639
3640 2018-11-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
3641
3642         [CG] Adopt CG SPI for non-even cornered rounded rects
3643         https://bugs.webkit.org/show_bug.cgi?id=190155
3644
3645         Reviewed by Simon Fraser.
3646
3647         Instead of creating bezier curves for the non-even corners of the rounded
3648         rects, we should use the optimized SPI provided by CG.
3649
3650         * platform/graphics/cg/PathCG.cpp:
3651         (WebCore::Path::platformAddPathForRoundedRect):
3652
3653 2018-11-01  Youenn Fablet  <youenn@apple.com>
3654
3655         RTCTrackEvent.streams should be SameObject
3656         https://bugs.webkit.org/show_bug.cgi?id=191130
3657
3658         Reviewed by Eric Carlson.
3659
3660         Mimick SameObject using CachedAttribute.
3661         Covered by rebased test.
3662
3663         * Modules/mediastream/RTCTrackEvent.idl:
3664
3665 2018-10-31  Zalan Bujtas  <zalan@apple.com>
3666
3667         [LFC][IFC] Add support for inline-block elements.
3668         https://bugs.webkit.org/show_bug.cgi?id=191143
3669
3670         Reviewed by Antti Koivisto.
3671
3672         This patch add support for laying out non-shrink-to-width inline-block elements.
3673
3674         Test: fast/inline/simple-inline-block.html
3675
3676         * layout/FormattingContext.h:
3677         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3678         * layout/FormattingContextGeometry.cpp:
3679         (WebCore::Layout::contentHeightForFormattingContextRoot):
3680         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
3681         * layout/inlineformatting/InlineFormattingContext.cpp:
3682         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
3683         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3684         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
3685         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
3686         * layout/layouttree/LayoutInlineContainer.cpp:
3687         (WebCore::Layout::InlineContainer::establishesInlineFormattingContext const):
3688         * layout/layouttree/LayoutInlineContainer.h:
3689         * layout/layouttree/LayoutTreeBuilder.cpp:
3690         (WebCore::Layout::TreeBuilder::createSubTree):
3691
3692 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
3693
3694         Fix build with VIDEO and WEB_AUDIO disabled
3695         https://bugs.webkit.org/show_bug.cgi?id=191147
3696
3697         Reviewed by Philippe Normand.
3698
3699         Supported or not, there were a few build fixes needed
3700         to be able to build WebKit with media disabled. Mostly
3701         low-hanging fruits.
3702
3703         * Modules/mediasource/VideoPlaybackQuality.cpp:
3704         * Modules/mediasource/VideoPlaybackQuality.h:
3705         * Modules/mediasource/VideoPlaybackQuality.idl:
3706         * dom/Document.cpp:
3707         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
3708         * inspector/agents/InspectorDOMAgent.cpp:
3709         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
3710         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
3711         * inspector/agents/InspectorDOMAgent.h:
3712         * rendering/RenderThemeGtk.cpp:
3713
3714 2018-10-31  Devin Rousso  <drousso@apple.com>
3715
3716         Web Inspector: Canvas: create a setting for auto-recording newly created contexts
3717         https://bugs.webkit.org/show_bug.cgi?id=190856
3718
3719         Reviewed by Brian Burg.
3720
3721         Test: inspector/canvas/setRecordingAutoCaptureFrameCount.html
3722
3723         * inspector/agents/InspectorCanvasAgent.h:
3724         (WebCore::InspectorCanvasAgent::RecordingOptions): Added.
3725         * inspector/agents/InspectorCanvasAgent.cpp:
3726         (WebCore::InspectorCanvasAgent::enable):
3727         (WebCore::InspectorCanvasAgent::disable):
3728         (WebCore::InspectorCanvasAgent::setRecordingAutoCaptureFrameCount): Added.
3729         (WebCore::InspectorCanvasAgent::startRecording):
3730         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
3731         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
3732         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
3733         (WebCore::InspectorCanvasAgent::startRecording): Added.
3734         Unify the different functions that are able to start a recording to use a single path.
3735
3736         * inspector/InspectorCanvas.h:
3737         * inspector/InspectorCanvas.cpp:
3738         (WebCore::InspectorCanvas::resetRecordingData):
3739         (WebCore::InspectorCanvas::recordAction):
3740         (WebCore::InspectorCanvas::setFrameCount): Added.
3741         (WebCore::InspectorCanvas::overFrameCount const): Added.
3742
3743 2018-10-31  Devin Rousso  <drousso@apple.com>
3744
3745         Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls
3746         https://bugs.webkit.org/show_bug.cgi?id=190641
3747         <rdar://problem/45319049>
3748
3749         Reviewed by Joseph Pecoraro.
3750
3751         No new tests, as low power mode is indeterminate. Should not affect functionality.
3752
3753         * inspector/agents/InspectorDOMAgent.h:
3754         * inspector/agents/InspectorDOMAgent.cpp:
3755         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
3756         (WebCore::InspectorDOMAgent::addEventListenersToNode):
3757         (WebCore::InspectorDOMAgent::mediaMetricsTimerFired): Added.
3758
3759 2018-10-31  Alicia Boya García  <aboya@igalia.com>
3760
3761         [MSE] Use tolerance when growing the coded frame group
3762         https://bugs.webkit.org/show_bug.cgi?id=190085
3763
3764         Reviewed by Jer Noble.
3765
3766         Test: media/media-source/media-source-append-acb-tolerance.html
3767
3768         This patch introduces a millisecond tolerance in the range of
3769         potential frames that should be erased frame from the track buffer
3770         when the coded frame group is growing.
3771
3772         This is necessary because some files have imprecise overlapping
3773         timestamps (especially WebM files).
3774
3775         This fixes a stall when seeking back and forth in YouTube with WebM
3776         video.
3777
3778         A test case simulating the problem with video/mock using timestamps
3779         similar to those of a typical 30 fps WebM video is also added.
3780
3781         * Modules/mediasource/SourceBuffer.cpp:
3782         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3783
3784 2018-10-31  Jer Noble  <jer.noble@apple.com>
3785
3786         MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.B0') is inproperly rejected
3787         https://bugs.webkit.org/show_bug.cgi?id=191129
3788
3789         Reviewed by Eric Carlson.
3790
3791         Test: media/media-source/media-source-istypesupported-case-sensitive.html
3792
3793         According to RFC 2045: "All media type values, subtype values, and parameter names as
3794         defined are case-insensitive. However, parameter values are case-sensitive unless otherwise
3795         specified for the specific parameter." So rather than fold the entire ContentType into lower-
3796         case, leave the original string intact and require clients to enforce case-insensitivity.
3797
3798         * Modules/mediasource/MediaSource.cpp:
3799         (WebCore::MediaSource::isTypeSupported):
3800
3801 2018-10-31  Jer Noble  <jer.noble@apple.com>
3802
3803         Unreivewed build fix; fix the non-HAVE_AVCONTENTKEYSESSION builds by adding guards around
3804         access of m_cdmInstance.
3805
3806         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3807         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
3808
3809 2018-10-31  YUHAN WU  <yuhan_wu@apple.com>
3810
3811         MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
3812         https://bugs.webkit.org/show_bug.cgi?id=190778
3813         <rdar://problem/45703574>
3814
3815         Reviewed by Youenn Fablet.
3816
3817         Add a include to fix the unified build error.
3818
3819         No tests since no new functionality.
3820
3821         * Modules/webgpu/WebGPUDevice.cpp:
3822
3823 2018-10-26  Jer Noble  <jer.noble@apple.com>
3824
3825         [EME][Cocoa] Cannot play unmuxed video and audio fMP4 streams encrypted with different keys via MSE
3826         https://bugs.webkit.org/show_bug.cgi?id=190946
3827
3828         Reviewed by Eric Carlson.
3829
3830         Use separate AVContentKeySessions per CDMInstanceSession (rather than one AVContentKeySession per
3831         CDMInstance).
3832
3833         - Add a mechanism for sending a message out from platform/CDMInstance to MediaKeySession without
3834           requiring MediaKeySession to send a callback first.
3835
3836         - Move all the AVContentKeySession delegate methods from CDMInstanceFairPlayStreamingAVFObjC to
3837           CDMInstanceSessionFairPlayStreamingAVFObjC.
3838
3839         - Add a mechanism for requesting the correct CDMInstanceSession for a given KeyID.
3840
3841         - Support key renewal through a "renew" message.
3842
3843         - Remember the keyID in SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID()
3844           and ask for the correct CDMInstanceSession for that keyID in attemptToDecrypt().
3845
3846         - Pass the CDMInstance down from MediaPlayerPrivateMediaSourceAVFObjC -> SourceBufferPrivateAVFObjC.
3847
3848         * Modules/encryptedmedia/MediaKeySession.cpp:
3849         (WebCore::MediaKeySession::sendMessage):
3850         * Modules/encryptedmedia/MediaKeySession.h:
3851         * platform/encryptedmedia/CDMInstanceSession.h:
3852         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
3853         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3854         (-[WebCoreFPSContentKeySessionDelegate initWithParent:]):
3855         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
3856         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession):
3857         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3858         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForKeyIDs const):
3859         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
3860         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::~CDMInstanceSessionFairPlayStreamingAVFObjC):
3861         (WebCore::keyIDsForRequest):
3862         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
3863         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
3864         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
3865         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
3866         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
3867         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
3868         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
3869         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
3870         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
3871         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
3872         (WebCore::requestStatusToCDMStatus):
3873         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
3874         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3875         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
3876         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3877         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3878         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
3879         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceAttached):
3880         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceDetached):
3881         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
3882         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3883         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3884         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3885         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
3886         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
3887         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
3888         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
3889         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
3890         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
3891         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
3892         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceAttached):
3893         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceDetached):
3894         (WebCore::MediaSourcePrivateAVFObjC::attemptToDecryptWithInstance):
3895         (WebCore::MediaSourcePrivateAVFObjC::waitingForKey const):
3896         (WebCore::MediaSourcePrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3897         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3898         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3899         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
3900         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
3901         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
3902         (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
3903         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3904
3905 2018-10-31  Zach Li  <zacharyli323@gmail.com>
3906
3907    &nb