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