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