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