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