[Win] Reduce the use of WKSI library calls: Font Handling
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-15  Brent Fulgham  <bfulgham@apple.com>
2
3         [Win] Reduce the use of WKSI library calls: Font Handling
4         https://bugs.webkit.org/show_bug.cgi?id=191701
5         <rdar://problem/46104809>
6
7         Reviewed by Myles C. Maxfield.
8
9         Move the old Windows font handling code out of WKSI to our regular
10         repository. We now handle SPI differently, and don't need to keep
11         these implementations in a separate library. This should also help
12         avoid the somewhat frequent build failures caused when WKSI is not
13         updated in sync with WebKit.
14
15         Tested by existing Windows test cases.
16
17         * platform/graphics/FontCascade.h:
18         * platform/graphics/win/FontCGWin.cpp:
19         (WebCore::FontCascade::drawGlyphs):
20         (WebCore::FontCascade::setFontSmoothingLevel):
21         (WebCore::setCGFontSmoothingStyle):
22         (WebCore::FontCascade::setFontSmoothingStyle):
23         (WebCore::FontCascade::setFontSmoothingContrast):
24         (WebCore::clearTypeContrast):
25         (WebCore::FontCascade::systemFontSmoothingChanged):
26         (WebCore::FontCascade::setCGContextFontRenderingStyle):
27         (WebCore::renderingStyleForFont):
28         (WebCore::FontCascade::getGlyphAdvances):
29         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
30         (WebCore::GlyphPage::fill):
31         * platform/graphics/win/GraphicsContextCGWin.cpp:
32         (WebCore::GraphicsContext::drawFocusRing):
33         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
34         * platform/graphics/win/SimpleFontDataCGWin.cpp:
35         (WebCore::Font::platformWidthForGlyph const):
36         * rendering/RenderMediaControls.cpp:
37         (WebCore::RenderMediaControls::adjustMediaSliderThumbSize):
38
39 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
40
41         [WebAuthN] Use a real nonce for CTAPHID_INIT
42         https://bugs.webkit.org/show_bug.cgi?id=191533
43         <rdar://problem/46103502>
44
45         Reviewed by Brent Fulgham.
46
47         New tests are added into existing test files.
48
49         * Modules/webauthn/fido/FidoConstants.h:
50
51 2018-11-15  Justin Fan  <justin_fan@apple.com>
52
53         [WebGPU] WebGPUCommandBuffer prototype
54         https://bugs.webkit.org/show_bug.cgi?id=191663
55
56         Reviewed by Dean Jackson.
57
58         Begin implementation of WebGPUCommandBuffers as well as GPUQueues (MTLCommandBuffer, MTLCommandQueue).
59
60         Test: webgpu/command-buffers.html
61
62         * CMakeLists.txt:
63         * DerivedSources.make:
64         * Modules/webgpu/GPUCommandBuffer.h: Added. Wrapper class around a MTLCommandBuffer.
65         * Modules/webgpu/GPUDevice.cpp:
66         (WebCore::GPUDevice::createCommandBuffer): Added.
67         (WebCore::GPUDevice::getQueue): Returns RefPtr to the device's singleton queue.
68         * Modules/webgpu/GPUDevice.h: Now manages the device's GPUQueue.
69         (WebCore::GPUDevice::platformDevice const):
70         * Modules/webgpu/GPUQueue.h: Added. Wrapper class around a MTLCommandQueue.
71         (WebCore::GPUQueue::platformQueue const):
72         * Modules/webgpu/GPURenderPipeline.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipeline.h.
73         (WebCore::GPURenderPipeline::platformRenderPipeline const):
74         * Modules/webgpu/GPUShaderModule.h:
75         (WebCore::GPUShaderModule::platformShaderModule const):
76         * Modules/webgpu/GPUSwapChain.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChain.h.
77         (WebCore::GPUSwapChain::platformLayer const):
78         * Modules/webgpu/WebGPUCommandBuffer.cpp: Added. Web interface for a GPU device's command buffer.
79         (WebCore::WebGPUCommandBuffer::create):
80         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
81         * Modules/webgpu/WebGPUCommandBuffer.h: Added.
82         * Modules/webgpu/WebGPUCommandBuffer.idl: Added.
83         * Modules/webgpu/WebGPUDevice.cpp:
84         (WebCore::WebGPUDevice::createCommandBuffer const): Added.
85         * Modules/webgpu/WebGPUDevice.h:
86         * Modules/webgpu/WebGPUDevice.idl:
87         * Modules/webgpu/cocoa/GPUCommandBufferMetal.mm: Added. MTLCommandBuffer impl for GPUCommandBuffer.
88         (WebCore::GPUCommandBuffer::create): Create a MTLCommandBuffer from the MTLCommandQueue.
89         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
90         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
91         (WebCore::GPUDevice::GPUDevice):
92         * Modules/webgpu/cocoa/GPUQueueMetal.mm: Added. MTLCommandQueue impl for GPUQueue.
93         (WebCore::GPUQueue::create):
94         (WebCore::GPUQueue::GPUQueue):
95         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
96         (WebCore::GPURenderPipeline::GPURenderPipeline):
97         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
98         (WebCore::GPUShaderModule::create):
99         (WebCore::GPUShaderModule::GPUShaderModule):
100         * Sources.txt:
101         * SourcesCocoa.txt:
102         * WebCore.xcodeproj/project.pbxproj:
103         * bindings/js/WebCoreBuiltinNames.h:
104
105 2018-11-15  Oriol Brufau  <obrufau@igalia.com>
106
107         [css-logical] Implement flow-relative margin, padding and border shorthands
108         https://bugs.webkit.org/show_bug.cgi?id=188697
109
110         Reviewed by Simon Fraser and Antti Koivisto.
111
112         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
113                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
114                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
115                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
116                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
117                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
118                webexposed/css-properties-as-js-properties.html
119                webexposed/css-properties-behind-flags.html
120                webexposed/css-property-listing.html
121
122         * css/CSSComputedStyleDeclaration.cpp:
123         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
124         Allow the new properties to serialize their computed value.
125
126         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
127         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
128         * css/CSSComputedStyleDeclaration.h:
129         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
130         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
131         shorthands.
132
133         * css/CSSProperties.json:
134         Add the new properties behind the CSSLogicalEnabled runtime flag.
135
136         * css/CSSStyleDeclaration.cpp:
137         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
138         Prevent CSS properties disabled behind a runtime flag from being exposed in
139         style declarations.
140
141         * css/StyleProperties.cpp:
142         (WebCore::StyleProperties::getPropertyValue const):
143         Allow the new properties to serialize their specified value.
144
145         (WebCore::StyleProperties::get2Values const):
146         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
147
148         (WebCore::StyleProperties::borderPropertyValue const):
149         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
150         corresponding to width, style and color.
151
152         (WebCore::MutableStyleProperties::setProperty):
153         Prevent CSS properties disabled behind a runtime flag from being set a value.
154
155         (WebCore::StyleProperties::asText const):
156         Allow the new properties to be serialized in cssText.
157         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
158         and serialize the longhands instead. Note that there could be another shorthand
159         available which is enabled, but a proper solution would require bug 190496.
160
161         * css/StyleProperties.h:
162         Update declarations of borderPropertyValue and get2Values.
163
164         * css/makeprop.pl:
165         (addProperty):
166         Add isEnabledCSSProperty function for checking that a CSS property is not
167         disabled behind a runtime flag.
168
169         * css/parser/CSSPropertyParser.cpp:
170         (WebCore::cssPropertyID):
171         Prevent CSS properties disabled behind a runtime flag from being exposed in
172         computed styles.
173
174         (WebCore::CSSPropertyParser::addProperty):
175         Prevent CSS properties disabled behind a runtime flag from being set a value.
176
177         (WebCore::CSSPropertyParser::consumeBorder):
178         Change consumeBorder to provide the caller with the parsed values instead of
179         setting properties. Then the caller can decide to which properties the values
180         should be set, and whether border-image should be reset or not.
181
182         (WebCore::CSSPropertyParser::consume2ValueShorthand):
183         (WebCore::CSSPropertyParser::consume4ValueShorthand):
184         Rename consume4Values to consume4ValueShorthand, and add analogous
185         consume2ValueShorthand for parsing shorthands with two longhands.
186
187         (WebCore::CSSPropertyParser::parseShorthand):
188         Allow the new properties to be parsed.
189
190         * css/parser/CSSPropertyParser.h:
191         Update declarations of consumeBorder, consume2ValueShorthand and
192         consume4ValueShorthand.
193
194         * inspector/agents/InspectorCSSAgent.cpp:
195         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
196         Prevent CSS properties disabled behind a runtime flag from being exposed in
197         the CSS inspector tool.
198
199         * page/RuntimeEnabledFeatures.h:
200         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
201         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
202         Add the CSSLogicalEnabled runtime flag.
203
204 2018-11-15  Truitt Savell  <tsavell@apple.com>
205
206         Unreviewed, rolling out r238220.
207
208         Introduced failing tests to iOS and is slowing down EWS
209
210         Reverted changeset:
211
212         "[css-grid] Consider scrollbars in
213         populateGridPositionsForDirection()"
214         https://bugs.webkit.org/show_bug.cgi?id=191656
215         https://trac.webkit.org/changeset/238220
216
217 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
218
219         [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
220         https://bugs.webkit.org/show_bug.cgi?id=191522
221
222         Reviewed by Brent Fulgham.
223
224         Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional.
225         https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria
226
227         Covered by existing tests.
228
229         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
230         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
231
232 2018-11-15  Ross Kirsling  <ross.kirsling@sony.com>
233
234         DragImage should have a complete default implementation
235         https://bugs.webkit.org/show_bug.cgi?id=191666
236
237         Reviewed by Dean Jackson.
238
239         Move WPE's stub implementation down into the base implementation file.
240
241         * SourcesWPE.txt:
242         * platform/DragImage.cpp:
243         (WebCore::dragImageSize):
244         (WebCore::deleteDragImage):
245         (WebCore::scaleDragImage):
246         (WebCore::dissolveDragImageToFraction):
247         (WebCore::createDragImageFromImage):
248         (WebCore::createDragImageIconForCachedImageFilename):
249         (WebCore::createDragImageForLink):
250         * platform/wpe/DragImageWPE.cpp: Removed.
251
252 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
253
254         [WebAuthN] UserHandle can be null
255         https://bugs.webkit.org/show_bug.cgi?id=191521
256
257         Reviewed by Alex Christensen.
258
259         According to the newest spec as of 7 August, 2018: https://www.w3.org/TR/webauthn/#conforming-authenticators-u2f.
260         UserHandle can now be null.
261
262         Covered by existing tests.
263
264         * Modules/webauthn/AuthenticatorAssertionResponse.h:
265         (WebCore::AuthenticatorAssertionResponse::create):
266         (WebCore::AuthenticatorAssertionResponse::userHandle const):
267         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
268         * Modules/webauthn/AuthenticatorAssertionResponse.idl:
269         * Modules/webauthn/PublicKeyCredential.cpp:
270         (WebCore::PublicKeyCredential::tryCreate):
271         * Modules/webauthn/PublicKeyCredentialData.h:
272         (WebCore::PublicKeyCredentialData::encode const):
273         (WebCore::PublicKeyCredentialData::decode):
274         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
275         (fido::readCTAPGetAssertionResponse):
276
277 2018-11-15  Youenn Fablet  <youenn@apple.com>
278
279         Modernize RTCPeerConnection handling of pendingActivity
280         https://bugs.webkit.org/show_bug.cgi?id=191661
281
282         Reviewed by Eric Carlson.
283
284         makePendingActivity is the modern way to handle set/unset of pending activity.
285         No change of behavior.
286
287         * Modules/mediastream/RTCPeerConnection.cpp:
288         (WebCore::RTCPeerConnection::create):
289         (WebCore::RTCPeerConnection::doStop):
290         * Modules/mediastream/RTCPeerConnection.h:
291
292 2018-11-15  Keith Rollin  <krollin@apple.com>
293
294         Delete old .xcfilelist files
295         https://bugs.webkit.org/show_bug.cgi?id=191669
296         <rdar://problem/46081994>
297
298         Reviewed by Chris Dumez.
299
300         .xcfilelist files were created and added to the Xcode project files in
301         https://trac.webkit.org/changeset/238008/webkit. However, they caused
302         build issues and they were removed from the Xcode projects in
303         https://trac.webkit.org/changeset/238055/webkit. This check-in removes
304         the files from the repository altogether. They'll ultimately be
305         replaced with new files with names that indicate whether the
306         associated files are inputs to the Run Script phase or are files
307         created by the Run Script phase.
308
309         No new tests -- no changed functionality.
310
311         * DerivedSources.xcfilelist: Removed.
312         * UnifiedSources.xcfilelist: Removed.
313
314 2018-11-15  Youenn Fablet  <youenn@apple.com>
315
316         Update RTCPeerConnection JS built-ins to be closer to specWe
317         https://bugs.webkit.org/show_bug.cgi?id=191665
318
319         Reviewed by Eric Carlson.
320
321         Simplify JS built-ins since we no longer need to support callback versions of the API.
322         Make sure to have the right number of parameters in the JS built-in functions.
323         Make some simplification to the code.
324         Covered by existing tests and rebased test.
325
326         * Modules/mediastream/RTCPeerConnection.js:
327         (createOffer):
328         (createAnswer):
329         (setLocalDescription):
330         (setRemoteDescription):
331         (addIceCandidate):
332         * Modules/mediastream/RTCPeerConnectionInternals.js:
333         (enqueueOperation):
334         (callbacksAndDictionaryOverload): Deleted.
335
336 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
337
338         REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari
339         https://bugs.webkit.org/show_bug.cgi?id=191673
340         rdar://problem/46083440
341
342         Reviewed by Antti Koivisto.
343
344         Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer
345         tree for every Frame. They get re-attached on tab show, and for subframes this involves
346         the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition().
347         
348         The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that
349         fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary
350         layer configuration update that gets iframe layers parented.
351         
352         This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future
353         patch will optimize this, and add a layout test.
354
355         * rendering/RenderLayerCompositor.cpp:
356         (WebCore::RenderLayerCompositor::layerStyleChanged):
357
358 2018-11-15  Zalan Bujtas  <zalan@apple.com>
359
360         [LFC][IFC] Skip non-inflow boxes while splitting the inline runs.
361         https://bugs.webkit.org/show_bug.cgi?id=191690
362
363         Reviewed by Antti Koivisto.
364
365         Skip all non-inflow boxes (floats, out-of-flow positioned elements). They don't participate in the inline run context.
366
367         * layout/Verification.cpp:
368         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
369         * layout/inlineformatting/InlineFormattingContext.cpp:
370         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
371
372 2018-11-15  Zalan Bujtas  <zalan@apple.com>
373
374         [LFC] FormattingContext base class should not declare computeStaticPosition.
375         https://bugs.webkit.org/show_bug.cgi?id=191683
376
377         Reviewed by Antti Koivisto.
378
379         Apparently only BlockFormattingContext uses it.
380
381         * layout/FormattingContext.h:
382         * layout/blockformatting/BlockFormattingContext.h:
383         * layout/inlineformatting/InlineFormattingContext.cpp:
384         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): Deleted.
385         * layout/inlineformatting/InlineFormattingContext.h:
386
387 2018-11-14  Zalan Bujtas  <zalan@apple.com>
388
389         [LFC][IFC] Add support for in-flow positioned inline boxes.
390         https://bugs.webkit.org/show_bug.cgi?id=191672
391
392         Reviewed by Antti Koivisto.
393
394         We might offset the in-flow positioned runs differently once runs are moved over to the display tree.
395
396         Test: fast/inline/simple-inline-inflow-positioned.html
397
398         * layout/Verification.cpp:
399         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
400         * layout/inlineformatting/InlineFormattingContext.cpp:
401         (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const):
402         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
403         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
404         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
405         * layout/inlineformatting/InlineFormattingContext.h:
406         * layout/inlineformatting/InlineRun.h:
407         (WebCore::Layout::InlineRun::moveVertically):
408         * layout/layouttree/LayoutTreeBuilder.cpp:
409         (WebCore::Layout::outputInlineRuns):
410
411 2018-11-15  Thibault Saunier  <tsaunier@igalia.com>
412
413         [GStreamer][WebRTC] Add support for sending silence or silencing an incoming track
414         https://bugs.webkit.org/show_bug.cgi?id=191631
415
416         Reviewed by Xabier Rodriguez-Calvar.
417
418         This will be tested once webkit.org/b/186933 is implemented.
419
420         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
421         (WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
422         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
423         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
424
425 2018-11-15  Antti Koivisto  <antti@apple.com>
426
427         REGRESSION(r238178): fast/forms/access-key-mutated.html and fast/forms/access-key-case-insensitive.html are timing out
428         https://bugs.webkit.org/show_bug.cgi?id=191642
429
430         Reviewed by Zalan Bujtas.
431
432         Invalidate access key map even when thorttling style recalcs.
433
434         * dom/Document.cpp:
435         (WebCore::Document::scheduleStyleRecalc):
436
437 2018-11-15  Antti Koivisto  <antti@apple.com>
438
439         Remove fonts from CSSFontFaceSet safely
440         https://bugs.webkit.org/show_bug.cgi?id=191676
441
442         Reviewed by Zalan Bujtas.
443
444         Test: fast/text/font-face-set-remove-safely.html
445
446         * css/CSSFontFaceSet.cpp:
447         (WebCore::CSSFontFaceSet::remove):
448
449 2018-11-15  Manuel Rego Casasnovas  <rego@igalia.com>
450
451         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
452         https://bugs.webkit.org/show_bug.cgi?id=191656
453
454         Reviewed by Javier Fernandez.
455
456         We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
457         that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
458         but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
459
460         The patch modifies the method so it takes into account scrollbar size
461         in order to compute the position of the columns/rows depending on the direction and the writing mode.
462
463         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
464                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
465                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
466
467         * rendering/RenderGrid.cpp:
468         (WebCore::RenderGrid::populateGridPositionsForDirection):
469
470 2018-11-14  Keith Rollin  <krollin@apple.com>
471
472         Move scripts for Derived and Unified Sources to external files
473         https://bugs.webkit.org/show_bug.cgi?id=191670
474         <rdar://problem/46082278>
475
476         Reviewed by Keith Miller.
477
478         Move the scripts in the Generate Derived Sources and Generate Unified
479         Sources Run Script phases from the Xcode projects to external shell
480         script files. Then invoke those scripts from the Run Script phases.
481         This refactoring is being performed to support later work that will
482         invoke these scripts in other contexts.
483
484         The scripts were maintained as-is when making the move. I did a little
485         reformatting and added 'set -e' to the top of each file, but that's
486         it.
487
488         No new tests -- no changed functionality.
489
490         * Scripts/generate-derived-sources.sh: Added.
491         * Scripts/generate-unified-sources.sh: Added.
492         * WebCore.xcodeproj/project.pbxproj:
493
494 2018-11-14  Keith Rollin  <krollin@apple.com>
495
496         Fix #end vs. #endif typo.
497         https://bugs.webkit.org/show_bug.cgi?id=191668
498         <rdar://problem/46081704>
499
500         Reviewed by Alexey Proskuryakov.
501
502         Source/WebCore/SourcesCocoa.txt had a #end that should have been a
503         #endif. Fix this, an add a check to generate-unified-source-bundles.rb
504         to detect similar typos.
505
506         No new tests -- no changed functionality.
507
508         * SourcesCocoa.txt:
509
510 2018-11-14  Keith Rollin  <krollin@apple.com>
511
512         Remove VideoFullscreenLayerManager.mm from WebCore/SourcesCocoa.txt
513         https://bugs.webkit.org/show_bug.cgi?id=191667
514         <rdar://problem/46081286>
515
516         Reviewed by Eric Carlson.
517
518         VideoFullscreenLayerManager.mm no longer exists.
519
520         No new tests -- No changed functionality.
521
522         * SourcesCocoa.txt:
523
524 2018-11-14  Timothy Hatcher  <timothy@apple.com>
525
526         Enabled dark mode CSS support by default.
527         https://bugs.webkit.org/show_bug.cgi?id=191609
528         rdar://problem/46046861
529
530         Reviewed by Megan Gardner.
531
532         * page/RuntimeEnabledFeatures.h: Set m_isDarkModeCSSEnabled to true.
533
534 2018-11-14  Timothy Hatcher  <timothy@apple.com>
535
536         Default the view background color and text color to different values when in dark mode.
537         https://bugs.webkit.org/show_bug.cgi?id=191607
538         rdar://problem/46045854
539
540         Reviewed by Dean Jackson.
541
542         Test: css-dark-mode/default-colors.html
543
544         * css/html.css:
545         (html): Set color: text on macOS.
546         * dom/Document.cpp:
547         (WebCore::Document::processSupportedColorSchemes): Call recalculateBaseBackgroundColor().
548         * editing/EditingStyle.cpp:
549         (WebCore::caretColorFromStyle): Added.
550         (WebCore::EditingStyle::prepareToApplyAt): Use equalIgnoringSemanticColor. Check for
551         caret-color directly since removeEquivalentProperties fails with semantic colors.
552         (WebCore::extractPropertiesNotIn): Use equalIgnoringSemanticColor. Check for caret-color
553         directly since removeEquivalentProperties fails with semantic colors.
554         * page/Frame.cpp:
555         (WebCore::Frame::createView): Drop backgroundColor.
556         * page/Frame.h:
557         * page/FrameView.cpp:
558         (WebCore::FrameView::recalculateBaseBackgroundColor): Added.
559         (WebCore::FrameView::updateBackgroundRecursively): Drop backgroundColor argument.
560         Calculate the backgroundColor based on the transparent argument only.
561         * page/FrameView.h:
562         * platform/graphics/Color.h:
563         (WebCore::equalIgnoringSemanticColor): Added for EditingStyle.
564         * rendering/RenderBox.cpp:
565         (WebCore::RenderBox::styleDidChange): Call recalculateBaseBackgroundColor().
566         * rendering/RenderLayerBacking.cpp:
567         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): Use isWhiteColor()
568         since it ignores the semantic color flag.
569         * testing/Internals.cpp:
570         (WebCore::Internals::setViewIsTransparent): Drop backgroundColor.
571         (WebCore::Internals::viewBaseBackgroundColor): Added.
572         * testing/Internals.h:
573         * testing/Internals.idl: Added viewBaseBackgroundColor.
574
575 2018-11-14  Justin Fan  <justin_fan@apple.com>
576
577         [WebGPU] Code quality concerns raised for 191291: [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
578         https://bugs.webkit.org/show_bug.cgi?id=191383
579
580         Reviewed by Dean Jackson.
581
582         Covered by existing WebGPU tests introduced in original patch.
583
584         * Modules/webgpu/GPUDevice.h:
585         * Modules/webgpu/GPUPipelineStageDescriptor.h:
586         * Modules/webgpu/GPURenderPipelineDescriptor.h: Now a base struct with a guaranteed vertex stage member.
587         (): Refactored into enum class.
588         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Removed in favor of init-list construction.
589         (WebCore::GPURenderPipelineDescriptor::primitiveTopology): Now a proper enum class member.
590         * Modules/webgpu/GPUShaderModule.h:
591         * Modules/webgpu/WebGPUDevice.cpp:
592         (WebCore::WebGPUDevice::createRenderPipeline const):
593         * Modules/webgpu/WebGPUShaderModule.h:
594         (WebCore::WebGPUShaderModule::module const):
595         * Modules/webgpu/WebGPUShaderStage.h: Replaced enum with constants to better reflect IDL.
596         * Modules/webgpu/cocoa/GPURenderPipeline.h:
597         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
598         (WebCore::setFunctionsForPipelineDescriptor):
599         (WebCore::GPURenderPipeline::create):
600         * Modules/webgpu/cocoa/GPUSwapChain.h:
601         * WebCore.xcodeproj/project.pbxproj: Removed GPUPipelineDescriptorBase.
602
603 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
604
605         Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
606         https://bugs.webkit.org/show_bug.cgi?id=191612
607
608         Reviewed by Matt Baker.
609
610         * inspector/InspectorController.cpp:
611         (WebCore::InspectorController::connectFrontend):
612         (WebCore::InspectorController::disconnectFrontend):
613         (WebCore::InspectorController::show):
614         * inspector/InspectorController.h:
615         * inspector/WorkerInspectorController.cpp:
616         (WebCore::WorkerInspectorController::connectFrontend):
617         (WebCore::WorkerInspectorController::disconnectFrontend):
618         * page/PageDebuggable.cpp:
619         (WebCore::PageDebuggable::connect):
620         (WebCore::PageDebuggable::disconnect):
621         * page/PageDebuggable.h:
622         * testing/Internals.cpp:
623         (WebCore::InspectorStubFrontend::InspectorStubFrontend):
624         (WebCore::InspectorStubFrontend::closeWindow):
625         * workers/service/context/ServiceWorkerDebuggable.cpp:
626         (WebCore::ServiceWorkerDebuggable::connect):
627         (WebCore::ServiceWorkerDebuggable::disconnect):
628         * workers/service/context/ServiceWorkerDebuggable.h:
629         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
630         (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
631         (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
632         * workers/service/context/ServiceWorkerInspectorProxy.h:
633
634 2018-11-14  Timothy Hatcher  <timothy@apple.com>
635
636         Update prefers-color-scheme media query matching based on GitHub issue #3278.
637         https://bugs.webkit.org/show_bug.cgi?id=191654
638         rdar://problem/46074307
639
640         Reviewed by Simon Fraser.
641
642         Test: css-dark-mode/prefers-color-scheme.html
643
644         * css/MediaQueryEvaluator.cpp:
645         (WebCore::prefersColorSchemeEvaluate): Return true when there is no value. Return false
646         for `no-preference` since there is no macOS option for no user preference.
647         * css/MediaQueryExpression.cpp:
648         (WebCore::isFeatureValidWithoutValue): Added prefers-color-scheme.
649
650 2018-11-14  Devin Rousso  <drousso@apple.com>
651
652         Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
653         https://bugs.webkit.org/show_bug.cgi?id=191628
654
655         Reviewed by Dean Jackson.
656
657         Updated existing test: inspector/model/recording.html
658
659         * inspector/InspectorCanvas.h:
660         * inspector/InspectorCanvas.cpp:
661         (WebCore::InspectorCanvas::indexForData):
662         (WebCore::InspectorCanvas::buildInitialState):
663         (WebCore::InspectorCanvas::buildAction):
664         Drive-by: prevent de-duplicated objects from being destroyed while recording.
665
666 2018-11-14  Stephan Szabo  <stephan.szabo@sony.com>
667
668         [Win] Compile Service Worker support
669         https://bugs.webkit.org/show_bug.cgi?id=191409
670
671         Reviewed by Youenn Fablet.
672
673         Fix compilation errors when ENABLE(SERVICE_WORKER)
674         on Windows with clang-cl. Clang on dllexport
675         platforms does not support specifying the
676         dllexport on both a class and members of the class
677         and unistd.h isn't provided but also appeared to
678         not be used.
679
680         No new tests, should be covered by existing tests.
681
682         * workers/service/ServiceWorkerProvider.h:
683         * workers/service/context/SWContextManager.cpp:
684
685 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
686
687         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
688         https://bugs.webkit.org/show_bug.cgi?id=191494
689         <rdar://problem/45469854>
690
691         Reviewed by Devin Rousso.
692
693         * inspector/InspectorClient.h:
694         (WebCore::InspectorClient::allowRemoteInspectionToPageDirectly const):
695         Provide a hook so that a client may wish to allow direct remote inspection of the Page.
696         This is used by WebKitLegacy only.
697
698         * page/Page.cpp:
699         (Page::Page):
700         Only enable the PageDebuggable if the client wishes remote inspection of the Page directly.
701         This is used by WebKitLegacy only.
702
703         * inspector/InspectorController.cpp:
704         (WebCore::InspectorController::connectFrontend):
705         * inspector/InspectorController.h:
706         * page/PageDebuggable.cpp:
707         (WebCore::PageDebuggable::connect):
708         (WebCore::PageDebuggable::disconnect):
709         * page/PageDebuggable.h:
710         When a frontend connects, always enable the developer extras for the Page.
711         This is pretty much only for the remote path, which allows inspection if developer
712         extras were not already enabled (iOS). This simplifies the logic, and toggling
713         developer extras after it was already enabled is not really important.
714
715 2018-11-14  Per Arne Vollan  <pvollan@apple.com>
716
717         REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
718         https://bugs.webkit.org/show_bug.cgi?id=190884
719
720         Reviewed by Dean Jackson.
721
722         Only notify display refresh monitors with matching display ID.
723
724         Test: fast/animation/request-animation-frame-in-two-pages.html
725
726         * platform/graphics/DisplayRefreshMonitorManager.cpp:
727         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
728         * platform/graphics/DisplayRefreshMonitorManager.h:
729
730 2018-11-14  Youenn Fablet  <youenn@apple.com>
731
732         Convert libwebrtc error types to DOM exceptions
733         https://bugs.webkit.org/show_bug.cgi?id=191590
734
735         Reviewed by Alex Christensen.
736
737         Make use of overloaded callback method that provides an error type.
738         This type is then used to create a DOM exception with the correct type.
739         Covered by existing tests.
740
741         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
742         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
743         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
744         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
745         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
746         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
747         * Modules/mediastream/libwebrtc/LibWebRTCObservers.h:
748         (WebCore::toExceptionCode):
749
750 2018-11-14  Youenn Fablet  <youenn@apple.com>
751
752         Allow to remove MediaStreamPrivate observers when iterating over observers
753         https://bugs.webkit.org/show_bug.cgi?id=187256
754
755         Reviewed by Eric Carlson.
756
757         Migrate the observer list from a Vector to a HashSet.
758         This is more robust to multiple observing and keeping of order of observers is not required.
759         Copy the set of observers to a vector before iterating over it.
760         This allows to remove an observer while iterating, which is now used in UserMediaRequest.
761
762         Covered by existing tests.
763
764         * Modules/mediastream/UserMediaRequest.cpp:
765         (WebCore::UserMediaRequest::mediaStreamIsReady):
766         * platform/mediastream/MediaStreamPrivate.cpp:
767         (WebCore::MediaStreamPrivate::addObserver):
768         (WebCore::MediaStreamPrivate::removeObserver):
769         (WebCore::MediaStreamPrivate::forEachObserver const):
770         (WebCore::MediaStreamPrivate::updateActiveState):
771         (WebCore::MediaStreamPrivate::addTrack):
772         (WebCore::MediaStreamPrivate::removeTrack):
773         (WebCore::MediaStreamPrivate::characteristicsChanged):
774         * platform/mediastream/MediaStreamPrivate.h:
775
776 2018-11-14  Youenn Fablet  <youenn@apple.com>
777
778         Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
779         https://bugs.webkit.org/show_bug.cgi?id=191603
780
781         Reviewed by Chris Dumez.
782
783         Make sure to check that the sender peer connection backend is matching.
784         Covered by rebased WPT test.
785
786         * Modules/mediastream/RTCPeerConnection.cpp:
787         (WebCore::RTCPeerConnection::removeTrack):
788         * Modules/mediastream/RTCRtpSender.cpp:
789         (WebCore::RTCRtpSender::isCreatedBy const):
790         * Modules/mediastream/RTCRtpSender.h:
791
792 2018-11-14  Fujii Hironori  <Hironori.Fujii@sony.com>
793
794         [curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl
795         https://bugs.webkit.org/show_bug.cgi?id=191620
796
797         Reviewed by Alex Christensen.
798
799         Remove a abstract class CookieJarCurl which is not needed anymore.
800         And, rename CookieJarCurlDatabase to CookieJarCurl.
801
802         No new tests because there's no behaviour change in WebCore.
803
804         * platform/Curl.cmake: Replaced CookieJarCurlDatabase.cpp with CookieJarCurl.cpp.
805         * platform/network/curl/CookieJarCurl.cpp: Renamed from Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp.
806         * platform/network/curl/CookieJarCurl.h: Merged CookieJarCurl.h and CookieJarCurlDatabase.h.
807         * platform/network/curl/CookieJarCurlDatabase.h: Removed.
808         * platform/network/curl/NetworkStorageSessionCurl.cpp:
809         (WebCore::NetworkStorageSession::NetworkStorageSession): Replaced CookieJarCurlDatabase with CookieJarCurl.
810
811 2018-11-14  Christopher Reid  <chris.reid@sony.com>
812
813         [WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp
814         https://bugs.webkit.org/show_bug.cgi?id=191606
815
816         Reviewed by Michael Catanzaro.
817
818         No behavior change.
819
820         Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString.
821
822         * platform/wpe/PlatformKeyboardEventWPE.cpp:
823         (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
824         (WebCore::PlatformKeyboardEvent::singleCharacterString):
825
826 2018-11-13  Zalan Bujtas  <zalan@apple.com>
827
828         [LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
829         https://bugs.webkit.org/show_bug.cgi?id=191623
830
831         Reviewed by Antti Koivisto.
832
833         This patch expands the breaking behaviour to support separate start/end breaks.
834
835         <span>parent </span><span style="padding: 10px;">start<span> middle </span>end</span><span> parent</span>
836
837         input to line breaking -> <parent start middle end parent>
838         output of line breaking (considering infinite constraint) -> <parent start middle end parent>
839         due to padding, final runs -> <parent><start middle end><parent>
840
841         "parent" -> n/a
842         "start" -> BreakAtStart
843         " middle " -> n/a
844         "end" -> BreakAtEnd
845         "parent" -> n/a
846
847         Another example:
848         <span>parent </span><span style="padding-right: 10px;">start<span> middle </span>end</span><span> parent</span>
849
850         line breaking -> <parent start middle end parent>
851         due to padding-right, final runs -> <parent start middle end><parent>
852
853         "parent" -> n/a
854         "start" -> n/a
855         " middle " -> n/a
856         "end" -> BreakAtEnd
857         "parent" -> n/a
858
859         * layout/inlineformatting/InlineFormattingContext.cpp:
860         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
861         (WebCore::Layout::InlineFormattingContext::collectInlineContent const): Move to a recursive algorithm (which is fine, inline contents don't tend to be too deep)
862         (WebCore::Layout::InlineFormattingContext::contentRequiresSeparateRun const): Deleted.
863         * layout/inlineformatting/InlineFormattingContext.h:
864         * layout/inlineformatting/InlineFormattingState.cpp:
865         (WebCore::Layout::InlineFormattingState::detachingRules const):
866         * layout/inlineformatting/InlineFormattingState.h:
867         (WebCore::Layout::InlineFormattingState::lastInlineItem const):
868         (WebCore::Layout::InlineFormattingState::addDetachingRule):
869
870 2018-11-14  Youenn Fablet  <youenn@apple.com>
871
872         Add support for RTCRtpCodecParameters.sdpFmtpLine
873         https://bugs.webkit.org/show_bug.cgi?id=191591
874
875         Reviewed by Eric Carlson.
876
877         Covered by rebased test.
878
879         * Modules/mediastream/RTCRtpCodecParameters.h:
880         * Modules/mediastream/RTCRtpCodecParameters.idl:
881         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
882         (WebCore::toRTCCodecParameters):
883
884 2018-11-14  Youenn Fablet  <youenn@apple.com>
885
886         Add support for transport and peerConnection stats
887         https://bugs.webkit.org/show_bug.cgi?id=191592
888
889         Reviewed by Alex Christensen.
890
891         Covered by rebased tests.
892
893         * Modules/mediastream/RTCStatsReport.h:
894         (WebCore::RTCStatsReport::TransportStats::TransportStats):
895         (WebCore::RTCStatsReport::PeerConnectionStats::PeerConnectionStats):
896         * Modules/mediastream/RTCStatsReport.idl:
897         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
898         (WebCore::fillRTCTransportStats):
899         (WebCore::fillRTCPeerConnectionStats):
900         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
901
902 2018-11-14  Ali Juma  <ajuma@chromium.org>
903
904         Transform of composited layer not updated when layer also needs repaint
905         https://bugs.webkit.org/show_bug.cgi?id=191598
906
907         Reviewed by Simon Fraser.
908
909         Trigger a compositing geometry update whenever a RenderLayer's transform changes,
910         even when other parts of its style have changed in a way that produces a
911         StyleDifference greater than RecompositeLayer.
912
913         Test: compositing/geometry/transform-and-repaint-updates-geometry.html
914
915         * rendering/RenderLayerCompositor.cpp:
916         (WebCore::RenderLayerCompositor::layerStyleChanged):
917
918 2018-11-13  Jiewen Tan  <jiewen_tan@apple.com>
919
920         [WebAuthN] Support CTAP HID authenticators on macOS
921         https://bugs.webkit.org/show_bug.cgi?id=188623
922         <rdar://problem/43353777>
923
924         Reviewed by Brent Fulgham and Chris Dumez.
925
926         This patch removes AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient to ignore
927         any incompleted CompletionHandlers as calling them in destructors could cause unexpected cyclic
928         dependency. Also, it adds a hack to temporarily deal with nullable userhandle.
929
930         Tests: http/wpt/webauthn/ctap-hid-failure.https.html
931                http/wpt/webauthn/ctap-hid-success.https.html
932                http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html
933                http/wpt/webauthn/public-key-credential-create-failure-hid.https.html
934                http/wpt/webauthn/public-key-credential-create-success-hid.https.html
935                http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html
936                http/wpt/webauthn/public-key-credential-get-failure-hid.https.html
937                http/wpt/webauthn/public-key-credential-get-success-hid.https.html
938
939         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
940         (WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient): Deleted.
941         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
942         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
943         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
944         (fido::readCTAPGetAssertionResponse):
945         * Modules/webauthn/fido/FidoConstants.h:
946
947 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
948
949         [WebRTC] Provide default implementation of LibWebRTCProvider
950         https://bugs.webkit.org/show_bug.cgi?id=191611
951
952         Reviewed by Michael Catanzaro.
953
954         Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults.
955
956         * PlatformWin.cmake:
957         * platform/GStreamer.cmake:
958         * platform/SourcesGLib.txt:
959         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
960         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
961         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp.
962         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h.
963         * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed.
964
965 2018-11-13  Timothy Hatcher  <timothy@apple.com>
966
967         Use a light scrollbar for transparent web views in dark mode.
968         https://bugs.webkit.org/show_bug.cgi?id=191559
969         rdar://problem/46000489
970
971         Reviewed by Dean Jackson.
972
973         Test: css-dark-mode/supported-color-schemes-scrollbar.html
974
975         * css/CSSProperties.json: Marked supported-color-schemes as a custom Value.
976         * css/StyleBuilderCustom.h:
977         (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes):
978         * editing/cocoa/WebContentReaderCocoa.mm: Use FrameView's useDarkAppearance().
979         (WebCore::createFragment):
980         * inspector/InspectorOverlay.cpp:
981         (WebCore::InspectorOverlay::paint): Use FrameView's useDarkAppearance().
982         * page/FrameView.cpp:
983         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use a light scrollbar for
984         transparent web views in dark mode.
985         (WebCore::FrameView::rendererForSupportedColorSchemes const): Added.
986         Return the body for document element renderer.
987         (WebCore::FrameView::useDarkAppearance const): Use rendererForSupportedColorSchemes.
988         (WebCore::FrameView::styleColorOptions const): Added. Ditto.
989         * page/FrameView.h:
990         * rendering/style/RenderStyle.cpp:
991         (WebCore::rareInheritedDataChangeRequiresRepaint): Drive-by fix. Added supportedColorSchemes.
992         * rendering/style/RenderStyle.h:
993         (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Added.
994         (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Added.
995         (WebCore::RenderStyle::NonInheritedFlags::operator== const): Added supportedColorSchemes.
996         * svg/graphics/SVGImage.cpp:
997         (WebCore::SVGImage::draw): Use FrameView's useDarkAppearance().
998         * testing/Internals.cpp:
999         (WebCore::Internals::setViewIsTransparent): Added.
1000         (WebCore::Internals::scrollbarOverlayStyle const): Added.
1001         * testing/Internals.h:
1002         * testing/Internals.idl: Added setViewIsTransparent and scrollbarOverlayStyle.
1003
1004 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
1005
1006         [AppleWin] Unreviewed build fix after r238108.
1007
1008         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1009         (printLayer):
1010         (PlatformCALayerWin::embeddedViewID const):
1011         * platform/graphics/ca/win/PlatformCALayerWin.h:
1012
1013 2018-11-13  Youenn Fablet  <youenn@apple.com>
1014
1015         RTCPeerConnection.getTransceivers is not always exposing all transceivers
1016         https://bugs.webkit.org/show_bug.cgi?id=191589
1017
1018         Reviewed by Eric Carlson.
1019
1020         Implement the collect transceiver algorithm using libwebrtc backend.
1021         Call this algorithm everytime transceivers are retrieved from JS.
1022         For Plan B, make this a no-op as this is not supported.
1023         Introduce senders/receivers/transceivers getters where we just look at already created transceivers.
1024
1025         Covered by existing and rebased tests.
1026
1027         * Modules/mediastream/PeerConnectionBackend.h:
1028         (WebCore::PeerConnectionBackend::collectTransceivers):
1029         * Modules/mediastream/RTCPeerConnection.cpp:
1030         (WebCore::RTCPeerConnection::getSenders const):
1031         (WebCore::RTCPeerConnection::getReceivers const):
1032         (WebCore::RTCPeerConnection::getTransceivers const):
1033         * Modules/mediastream/RTCPeerConnection.h:
1034         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1035         (WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
1036         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1037         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1038         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1039         (WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver):
1040         (WebCore::LibWebRTCPeerConnectionBackend::collectTransceivers):
1041         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
1042         (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
1043         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1044
1045 2018-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1046
1047         [iOS] Do not show selection UI for editable elements with opacity near zero
1048         https://bugs.webkit.org/show_bug.cgi?id=191442
1049         <rdar://problem/45958625>
1050
1051         Reviewed by Simon Fraser.
1052
1053         Tests: editing/selection/ios/do-not-zoom-to-focused-hidden-contenteditable.html
1054                editing/selection/ios/hide-selection-after-hiding-contenteditable.html
1055                editing/selection/ios/hide-selection-in-contenteditable-nested-transparency.html
1056                editing/selection/ios/hide-selection-in-hidden-contenteditable-frame.html
1057                editing/selection/ios/hide-selection-in-hidden-contenteditable.html
1058
1059         * rendering/RenderObject.cpp:
1060         (WebCore::RenderObject::isTransparentRespectingParentFrames const):
1061
1062         Add a helper function to determine whether a RenderObject is contained within a transparent layer, taking parent
1063         frames into account. A layer is considered transparent if its opacity is less than a small threshold (i.e. 0.01).
1064         Opacity on ancestor elements is applied multiplicatively.
1065
1066         * rendering/RenderObject.h:
1067
1068 2018-11-13  Eric Carlson  <eric.carlson@apple.com>
1069
1070         [MediaStream] Observer AVCaptureDevice "suspended" property
1071         https://bugs.webkit.org/show_bug.cgi?id=191587
1072         <rdar://problem/46030598>
1073
1074         Reviewed by Youenn Fablet.
1075
1076         No new tests, AVCapture can only be tested manually.
1077
1078         * platform/mediastream/mac/AVCaptureDeviceManager.h:
1079         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1080         (WebCore::AVCaptureDeviceManager::captureDevicesInternal): Don't notify of devices "changes"
1081         the first time the device list is scanned.
1082         (WebCore::deviceIsAvailable): Don't check for "isInUseByAnotherApplication", it doesn't
1083         change device availability.
1084         (WebCore::AVCaptureDeviceManager::beginObservingDevices): New, observe "suspended" on all 
1085         devices and add them to the cached list.
1086         (WebCore::AVCaptureDeviceManager::stopObservingDevices): New, opposite of above.
1087         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices): Watch for changes in the list of
1088         devices.
1089         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): Stop observing all cached devices.
1090         (WebCore::AVCaptureDeviceManager::registerForDeviceNotifications):
1091         (-[WebCoreAVCaptureDeviceManagerObserver disconnect]):
1092         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnectedDidChange:]):
1093         (-[WebCoreAVCaptureDeviceManagerObserver observeValueForKeyPath:ofObject:change:context:]):
1094         (WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType): Deleted.
1095         (WebCore::AVCaptureDeviceManager::deviceConnected): Deleted.
1096         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Deleted.
1097         (-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Deleted.
1098         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnected:]): Deleted.
1099
1100         * platform/mediastream/mac/AVVideoCaptureSource.h:
1101         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1102         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): Stop observing "running" (not "rate")
1103         and "suspended".
1104         (WebCore::AVVideoCaptureSource::setupSession): Observe "running" (not "rate"), and "suspended".
1105         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
1106         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
1107
1108 2018-11-13  Devin Rousso  <drousso@apple.com>
1109
1110         Web Inspector: REGRESSION(r238122): fetching the CertificateInfo triggers an ASSERT in workers
1111         https://bugs.webkit.org/show_bug.cgi?id=191597
1112
1113         Reviewed by Joseph Pecoraro.
1114
1115         When WebInspector is open, the `CertificateInfo` for every `ResourceResponse` is now fetched,
1116         meaning that we may try to fetch in situations previously unexpected.
1117
1118         * platform/network/cocoa/ResourceResponseCocoa.mm:
1119         (WebCore::ResourceResponse::platformCertificateInfo const):
1120
1121 2018-11-13  Timothy Hatcher  <timothy@apple.com>
1122
1123         Treat supported-color-schemes as the second highest priority property.
1124         https://bugs.webkit.org/show_bug.cgi?id=191556
1125         rdar://problem/46000076
1126
1127         Reviewed by Dean Jackson.
1128
1129         Test: css-dark-mode/supported-color-schemes-priority.html
1130
1131         * css/CSSProperties.json: Make supported-color-schemes high-priority and add a comment.
1132         * css/StyleResolver.cpp:
1133         (WebCore::StyleResolver::applyMatchedProperties): Manually handle supported-color-schemes
1134         after -webkit-ruby-position, before other properties, so it can affect resolved colors.
1135
1136 2018-11-13  Charlie Turner  <cturner@igalia.com>
1137
1138         [EME][GStreamer] Make CDMInstance's available in decryptors, and factor out some EME utility classes.
1139         https://bugs.webkit.org/show_bug.cgi?id=191316
1140
1141         Reviewed by Xabier Rodriguez-Calvar.
1142
1143         Another preparation in patch getting ready to move the decryption
1144         logic behind the CDMInstance and out of the GStreamer decryptors
1145         themselves. The first step taken here is to arrange for the
1146         instances to always be available in the decryptors when they need
1147         to decrypt content.
1148
1149         In doing so, there were a number of hairy bits of code that could
1150         use some abstraction, so the opportunity was taken to do that as
1151         well.
1152
1153         Covered by tests in media/encrypted-media and
1154         imported/w3c/web-platform-tests/encrypted-media.
1155
1156         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1157         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove
1158         drm-key-needed since it was not being used anywhere.
1159         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1160         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1161         Factor out the parsing of decryption system information from
1162         GStreamer, since it was not clear what that code was doing unless
1163         you squinted pretty hard. Also remove the duplicated
1164         initialization-data-encountered posting.
1165         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
1166         Refactored to make it a more general method and usable in more
1167         situations. It now has an optional to stop it from eliding init
1168         datas for a different key system. This is required the first time
1169         we post them, since if a CDM instance has already been set, and if
1170         the stream init datas are for different systems, we ended up never
1171         posting an encrypted event.
1172         (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
1173         Actually send a CDMInstance now when in regular playback mode.
1174         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
1175         Remove m_needToSendCredentials, it was not being used.
1176         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
1177         Refactored to use the new initializationDataEncountered.
1178         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
1179         Log the waiting state, since it was currently not clear what that
1180         logging message was even telling you!
1181         (WebCore::extractEventsAndSystemsFromMessage): Deleted.
1182         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1183         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
1184         (WebCore::InitData::InitData): New class that encapsulates both
1185         single instantiation and streaming instantiation.
1186         (WebCore::InitData::append): Used for the streaming mode, when you
1187         are concatenating init datas together.
1188         (WebCore::InitData::payload const):
1189         (WebCore::InitData::systemId const):
1190         (WebCore::InitData::payloadContainerType const):
1191         (WebCore::InitData::isFromDifferentContainer):
1192         (WebCore::ProtectionSystemEvents::ProtectionSystemEvents):
1193         (WebCore::ProtectionSystemEvents::events const):
1194         (WebCore::ProtectionSystemEvents::availableSystems const):
1195         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1196         (webkitMediaCommonEncryptionDecryptTransformInPlace): If you post
1197         waiting-for-key after requesting a CDM instance, it will flap back
1198         to not waiting for a key almost immediately, didn't make sense
1199         positing after requesting an instance. Also post key-received when
1200         we receive the key.
1201         (webkitMediaCommonEncryptionDecryptSinkEventHandler): It has now
1202         been arranged that a CDMInstance will always be present in an OOB
1203         message, so parse it out here.
1204         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1205         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
1206         As above, make sure when posting the OOB that a CDMInstance is present.
1207
1208 2018-11-13  Charlie Turner  <cturner@igalia.com>
1209
1210         Various compiler warnings/errors fixes.
1211         https://bugs.webkit.org/show_bug.cgi?id=191583
1212
1213         Reviewed by Frédéric Wang.
1214
1215         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1216         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
1217         ASSERT is only compiled in DEBUG mode, so guarding with
1218         !LOG_DISABLED is wrong.
1219         * rendering/RenderLayerCompositor.cpp:
1220         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1221         showPaintOrderTree is only compiled in ENABLE(TREE_DEBUGGING)
1222         mode, so guarding with !LOG_DISABLED was wrong.
1223         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1224         Ditto, this time with member .depth.
1225         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): Ditto.
1226         * rendering/svg/SVGRenderSupport.cpp:
1227         (WebCore::SVGRenderSupport::styleChanged): Add another unused
1228         parameter.
1229
1230 2018-11-12  Antoine Quint  <graouts@apple.com>
1231
1232         [Web Animations] Don't schedule animation frames or update style while an accelerated animation is running
1233         https://bugs.webkit.org/show_bug.cgi?id=191542
1234         <rdar://problem/45356027>
1235
1236         Reviewed by Simon Fraser.
1237
1238         Test: animations/no-style-recalc-during-accelerated-animation.html
1239
1240         In order to be more power-efficient, we stop scheduling calls to updateAnimationsAndSendEvents() when running only accelerated
1241         animations. To do that, we prevent scheduling further animation resolution if we're in the process of updating animations, and
1242         when we are done, call the new DocumentTimeline::scheduleNextTick() method that will check whether we have only accelerated
1243         animations running, and in that case check which of those animations needs an update the soonest and starts a timer scheduled
1244         for that time when we'll schedule animation resolution.
1245
1246         By default, animations compute the time until their natural completion but in the case of CSS Animations, we want to make sure
1247         we also update animations in-flight to dispatch "animationiteration" events.
1248
1249         * animation/AnimationEffect.h: Make the simpleIterationProgress() public so it can be called by WebAnimation::timeToNextTick().
1250         * animation/DocumentTimeline.cpp:
1251         (WebCore::DocumentTimeline::DocumentTimeline): Create the m_tickScheduleTimer and set it up to call scheduleAnimationResolutionIfNeeded().
1252         (WebCore::DocumentTimeline::suspendAnimations): If we don't already have a cached current time, cache the current time.
1253         (WebCore::DocumentTimeline::resumeAnimations): Reset the cached current time to ensure we'll get a fresh one when updating animations next.
1254         (WebCore::DocumentTimeline::liveCurrentTime const): Factor the code to compute the current time out of currentTime() so that we can
1255         cache the current time in suspendAnimations() without also automatically clearing the current time.
1256         (WebCore::DocumentTimeline::currentTime): Use liveCurrentTime() and cacheCurrentTime() since much of the code from this function has been
1257         factored out into those. Additionally, we were failing to clear the current time if called inside an animation frame, which we now do correctly
1258         by virtue of using cacheCurrentTime(). This fixes some flakiness.
1259         (WebCore::DocumentTimeline::cacheCurrentTime): Factor the code to cache the current time out of currentTime(). 
1260         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime): No need to clear the current time if we get suspended.
1261         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Prevent scheduling an animation update if we're in the middle of one already,
1262         scheduleNextTick() will be called after animations are updated to see if we should schedule an animation update instead.
1263         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Cancel the m_tickScheduleTimer if we need to unschedule animation resolution.
1264         (WebCore::DocumentTimeline::animationResolutionTimerFired): Factor the call to applyPendingAcceleratedAnimations() out of updateAnimationsAndSendEvents()
1265         and call scheduleNextTick().
1266         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Set the new m_isUpdatingAnimations member variable to true while this function is running.
1267         (WebCore::DocumentTimeline::scheduleNextTick): Schedule an animation update immediately if we have any relevant animation that is not accelerated.
1268         Otherwise, iterate through all animations to figure out the earliest moment at which we need to update animations.
1269         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Use the new WebAnimation::isRunningAccelerated() function.
1270         * animation/DocumentTimeline.h:
1271         * animation/WebAnimation.cpp:
1272         (WebCore::WebAnimation::isRunningAccelerated const): Since we end up checking if an animation is running with an accelerated effect, we introduce a new
1273         function to get that information directly through the WebAnimation object without bothering about its effect.
1274         (WebCore::WebAnimation::resolve): We should only call updateFinishedState() here since timingDidChange() would also notify the timeline about a potential
1275         change in relevance, which is not necessary and which would schedule an animation frame even for animations that are accelerated.
1276         (WebCore::WebAnimation::timeToNextTick const): Compute the time until our animation completion or, in the case of CSS animations, the next iteration.
1277         * animation/WebAnimation.h:
1278
1279 2018-11-13  Miguel Gomez  <magomez@igalia.com>
1280
1281         [GTK][WPE] Incorrect tile coverage when resizing a layer out of the visible area
1282         https://bugs.webkit.org/show_bug.cgi?id=191545
1283
1284         Reviewed by Žan Doberšek.
1285
1286         Keep track of layer size changes even if they happen when the layer is not in the visible
1287         area, so we can update edge tiles when the layer gets visible.
1288
1289         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1290         (WebCore::TiledBackingStore::createTiles):
1291         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1292
1293 2018-11-12  Rob Buis  <rbuis@igalia.com>
1294
1295         Content-Type parameter values should allow empty quoted strings
1296         https://bugs.webkit.org/show_bug.cgi?id=191388
1297
1298         Reviewed by Dean Jackson.
1299
1300         According to RFC 2045 and https://mimesniff.spec.whatwg.org/#parsing-a-mime-type empty
1301         quoted strings are acceptable for Content-Type parameter values. They
1302         are accepted by Firefox and Chrome implementations as well.
1303
1304         Test: web-platform-tests/xhr/overridemimetype-blob.html
1305
1306         * platform/network/ParsedContentType.cpp:
1307         (WebCore::parseToken):
1308         (WebCore::parseQuotedString):
1309         (WebCore::parseContentType):
1310         * platform/network/ParsedContentType.h:
1311
1312 2018-11-12  Christopher Reid  <chris.reid@sony.com>
1313
1314         [Curl] Reject entire cookie if the domain fails a tailmatch.
1315         https://bugs.webkit.org/show_bug.cgi?id=191406
1316
1317         Reviewed by Youenn Fablet.
1318
1319         Currently we don't put domain attribute of cookie when it fails a tailmatch. As Firefox
1320         and Chrome do, we are going to reject the entire cookie if the domain fails a tailmatch instead.
1321         Also cleanup Cookie database implementation to make them testable better.
1322
1323         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
1324
1325         * platform/network/curl/CookieJarDB.cpp:
1326         (WebCore::CookieJarDB::canAcceptCookie): Added.
1327         (WebCore::CookieJarDB::setCookie):
1328         * platform/network/curl/CookieUtil.cpp:
1329         (WebCore::CookieUtil::parseCookieAttributes):
1330         (WebCore::CookieUtil::parseCookieHeader):
1331         * platform/network/curl/CookieUtil.h:
1332
1333 2018-11-12  Devin Rousso  <drousso@apple.com>
1334
1335         Web Inspector: Network: show secure certificate details per-request
1336         https://bugs.webkit.org/show_bug.cgi?id=191447
1337         <rdar://problem/30019476>
1338
1339         Reviewed by Joseph Pecoraro.
1340
1341         Test: http/tests/inspector/network/resource-response-security.html
1342
1343         * loader/ResourceLoader.h:
1344         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
1345         * loader/ResourceLoader.cpp:
1346         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added.
1347         Always save certificate information when WebInspector is open.
1348
1349         * platform/network/CertificateInfoBase.h: Added.
1350         (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const):
1351         (WebCore::CertificateInfoBase::summaryInfo const):
1352         (WebCore::CertificateInfoBase::isEmpty const):
1353         * platform/network/cf/CertificateInfo.h:
1354         (WebCore::CertificateInfo::summaryInfo const): Added.
1355         * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
1356         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
1357         (WebCore::CertificateInfo::summaryInfo const): Added.
1358         * platform/network/curl/CertificateInfo.h:
1359         (WebCore::CertificateInfo::summaryInfo const): Added.
1360         (WebCore::CertificateInfo::isEmpty const): Added.
1361         * platform/network/soup/CertificateInfo.h:
1362         (WebCore::CertificateInfo::summaryInfo const): Added.
1363         (WebCore::CertificateInfo::isEmpty const): Added.
1364         Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have
1365         platform-specific code in its implementation.
1366
1367         * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
1368         * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp.
1369         * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp.
1370
1371         * inspector/NetworkResourcesData.h:
1372         (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added.
1373         (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added.
1374         * inspector/NetworkResourcesData.cpp:
1375         (WebCore::NetworkResourcesData::responseReceived):
1376
1377         * inspector/agents/InspectorNetworkAgent.cpp:
1378         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
1379
1380         * PlatformAppleWin.cmake:
1381         * PlatformMac.cmake:
1382         * SourcesCocoa.txt:
1383         * WebCore.xcodeproj/project.pbxproj:
1384         * platform/Curl.cmake:
1385         * platform/SourcesSoup.txt:
1386
1387 2018-11-12  Zalan Bujtas  <zalan@apple.com>
1388
1389         Do not collapse the soon-to-be-parent anon block when we shuffle around the marker item renderer.
1390         https://bugs.webkit.org/show_bug.cgi?id=191554
1391         <rdar://problem/45825265>
1392
1393         Reviewed by Antti Koivisto.
1394
1395         While moving the marker item renderer to its correct subtree, we accidentally remove the soon-to-be parent anonymous block.
1396         Moving a renderer is a 2 step process:
1397         1. Detach the renderer from its current parent
1398         2. Attach it to its new parent.
1399         During step #1, we check if there is a chance to collapse anonymous blocks. In this case the soon-to-be-parent is a sibling anonymous block which, after detaching the marker sibling
1400         is not needed anymore (except we use it as the new parent).
1401
1402         Test: fast/inline/marker-list-item-move-should-not-crash.html
1403
1404         * rendering/updating/RenderTreeBuilder.cpp:
1405         (WebCore::RenderTreeBuilder::detach):
1406         * rendering/updating/RenderTreeBuilder.h:
1407         * rendering/updating/RenderTreeBuilderBlock.cpp:
1408         (WebCore::RenderTreeBuilder::Block::detach):
1409         * rendering/updating/RenderTreeBuilderBlock.h:
1410         * rendering/updating/RenderTreeBuilderList.cpp:
1411         (WebCore::RenderTreeBuilder::List::updateItemMarker):
1412
1413 2018-11-12  Javier Fernandez  <jfernandez@igalia.com>
1414
1415         [css-grid] Refactoring to make more explicit the orthogonal items' pre-layout logic
1416         https://bugs.webkit.org/show_bug.cgi?id=191358
1417
1418         Reviewed by Manuel Rego Casasnovas.
1419
1420         These changes are just a refactoring to ease the integration of the new Baseline Alignment
1421         logic in a follow up patch.
1422
1423         We need to properly estimate the grid area size of orthogonal items so that we can perform
1424         an accurate pre-layout. This is important because orthogonal items will synthesize their baseline
1425         if they participate in any baseline alignment context.
1426
1427         No new tests, since no behavior change has been introduced in this patch.
1428
1429         * rendering/Grid.cpp:
1430         (WebCore::Grid::setNeedsItemsPlacement):
1431         * rendering/Grid.h:
1432         * rendering/GridTrackSizingAlgorithm.cpp:
1433         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
1434         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
1435         (WebCore::GridTrackSizingAlgorithm::isRelativeGridLengthAsAuto const):
1436         (WebCore::GridTrackSizingAlgorithm::isRelativeSizedTrackAsAuto const):
1437         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
1438         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const):
1439         (WebCore::GridTrackSizingAlgorithm::run):
1440         (WebCore::GridTrackSizingAlgorithm::reset):
1441         * rendering/GridTrackSizingAlgorithm.h:
1442         (WebCore::GridTrackSizingAlgorithmStrategy::gridTrackSize const):
1443         * rendering/RenderGrid.cpp:
1444         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
1445         (WebCore::RenderGrid::layoutBlock):
1446         (WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
1447         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
1448         (WebCore::RenderGrid::placeItemsOnGrid const):
1449         (WebCore::RenderGrid::performGridItemsPreLayout const):
1450         (WebCore::overrideSizeChanged):
1451         (WebCore::hasRelativeBlockAxisSize):
1452         (WebCore::RenderGrid::updateGridAreaLogicalSize const):
1453         (WebCore::RenderGrid::layoutGridItems):
1454         * rendering/RenderGrid.h:
1455
1456 2018-11-12  Sihui Liu  <sihui_liu@apple.com>
1457
1458         imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device
1459         https://bugs.webkit.org/show_bug.cgi?id=191500
1460
1461         Reviewed by Dean Jackson.
1462
1463         When double value is bigger than maximum unsigned int, converting double to unsigned int has
1464         different behaviors on macOS and iOS. On macOS, the result would be 0 while on iOS it would be
1465         maximum unsigned int.
1466
1467         Covered by existing test.
1468
1469         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1470         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
1471         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
1472
1473 2018-11-12  Basuke Suzuki  <basuke.suzuki@sony.com>
1474
1475         [Curl] Add API Test for Curl cookie backend.
1476         https://bugs.webkit.org/show_bug.cgi?id=191493
1477
1478         Reviewed by Youenn Fablet.
1479
1480         Refactoring for cookie backend interface.
1481
1482         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
1483
1484         * platform/FileSystem.h:
1485         * platform/network/curl/CookieJarCurlDatabase.cpp:
1486         (WebCore::cookiesForSession):
1487         (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const):
1488         (WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const):
1489         (WebCore::CookieJarCurlDatabase::getRawCookies const):
1490         * platform/network/curl/CookieJarDB.cpp:
1491         (WebCore::CookieJarDB::openDatabase):
1492         (WebCore::CookieJarDB::checkSQLiteReturnCode):
1493         (WebCore::CookieJarDB::isEnabled const):
1494         (WebCore::CookieJarDB::searchCookies):
1495         (WebCore::CookieJarDB::setCookie):
1496         (WebCore::CookieJarDB::deleteCookie):
1497         (WebCore::CookieJarDB::deleteCookieInternal):
1498         (WebCore::CookieJarDB::deleteCookies):
1499         (WebCore::CookieJarDB::deleteAllCookies):
1500         (WebCore::CookieJarDB::executeSimpleSql):
1501         (WebCore::CookieJarDB::isEnabled): Deleted.
1502         * platform/network/curl/CookieJarDB.h:
1503         * platform/network/curl/CookieUtil.cpp:
1504         (WebCore::CookieUtil::parseCookieHeader):
1505         * platform/network/curl/CookieUtil.h:
1506         * platform/win/FileSystemWin.cpp:
1507         (WebCore::FileSystem::generateTemporaryPath):
1508         (WebCore::FileSystem::openTemporaryFile):
1509         (WebCore::FileSystem::createTemporaryDirectory):
1510         (WebCore::FileSystem::deleteNonEmptyDirectory):
1511
1512 2018-11-12  Tim Horton  <timothy_horton@apple.com>
1513
1514         Make it possible to edit images inline
1515         https://bugs.webkit.org/show_bug.cgi?id=191352
1516         <rdar://problem/30107985>
1517
1518         Reviewed by Dean Jackson.
1519
1520         Tests: editing/images/basic-editable-image.html
1521                editing/images/reparent-editable-image-maintains-strokes.html
1522
1523         Add the beginnings of a mechanism to replace images with a special attribute
1524         with a native drawing view in the UI process.
1525
1526         * page/Settings.yaml:
1527         Add a setting to control whether images become natively editable when they
1528         have the x-apple-editable-image attribute.
1529
1530         * html/HTMLImageElement.cpp:
1531         (WebCore::HTMLImageElement::editableImageViewID const):
1532         Lazily generate an EmbeddedViewID and persist it on the <img> element.
1533
1534         * html/HTMLImageElement.h:
1535         Rearrange the service controls methods to sit before the members.
1536         Add m_editableImageViewID and editableImageViewID().
1537
1538         * platform/graphics/GraphicsLayer.cpp:
1539         (WebCore::GraphicsLayer::nextEmbeddedViewID):
1540         * platform/graphics/GraphicsLayer.h:
1541         (WebCore::GraphicsLayer::setContentsToEmbeddedView):
1542         Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
1543         on Cocoa platforms and when using RemoteLayerTree.
1544         Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
1545         Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
1546         and an EmbeddedViewID to uniquely identify and communicate about the
1547         embedded view (which may move between layers, since it is tied to an element).
1548
1549         * platform/graphics/ca/GraphicsLayerCA.cpp:
1550         (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
1551         (WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
1552         When setting GraphicsLayer's contents to an embedded view, we use
1553         a special PlatformCALayer factory that takes the EmbeddedViewID and type.
1554         GraphicsLayerCARemote will override this and make a correctly-initialized
1555         PlatformCALayerRemote that keeps track of the EmbeddedViewID.
1556
1557         * platform/graphics/ca/GraphicsLayerCA.h:
1558         * platform/graphics/ca/PlatformCALayer.cpp:
1559         (WebCore::operator<<):
1560         * platform/graphics/ca/PlatformCALayer.h:
1561         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1562         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1563         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1564         (WebCore::PlatformCALayerCocoa::embeddedViewID const):
1565         Add stubs and logging for EmbeddedViewID on PlatformCALayer.
1566         These will be overridden by PlatformCALayerRemote to do more interesting things.
1567
1568         * rendering/RenderImage.cpp:
1569         (WebCore::RenderImage::isEditableImage const):
1570         Add a getter that return true if the setting is enabled and
1571         x-apple-editable-image is empty or true.
1572
1573         (WebCore::RenderImage::requiresLayer const):
1574         RenderImage requires a layer either if RenderReplaced does, or we are an
1575         editable image.
1576
1577         * rendering/RenderImage.h:
1578         * rendering/RenderLayer.cpp:
1579         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
1580         (WebCore::RenderLayer::calculateClipRects const):
1581         * rendering/RenderLayerBacking.cpp:
1582         (WebCore::RenderLayerBacking::updateConfiguration):
1583         Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
1584
1585         * rendering/RenderLayerCompositor.cpp:
1586         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
1587         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1588         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1589         (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
1590         * rendering/RenderLayerCompositor.h:
1591         Make editable images require compositing implicitly.
1592
1593 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
1594
1595         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
1596         https://bugs.webkit.org/show_bug.cgi?id=189230
1597         <rdar://problem/44050379>
1598
1599         Reviewed by Joseph Pecoraro.
1600
1601         Runs all png images through zopflipng. This results in a smaller file
1602         size and takes care of this issue as a byproduct.
1603
1604         * Modules/modern-media-controls/images/iOS/airplay-placard@1x.png:
1605         * Modules/modern-media-controls/images/iOS/airplay-placard@2x.png:
1606         * Modules/modern-media-controls/images/iOS/airplay-placard@3x.png:
1607         * Modules/modern-media-controls/images/iOS/invalid-placard@1x.png:
1608         * Modules/modern-media-controls/images/iOS/invalid-placard@2x.png:
1609         * Modules/modern-media-controls/images/iOS/invalid-placard@3x.png:
1610         * Modules/modern-media-controls/images/iOS/pip-placard@1x.png:
1611         * Modules/modern-media-controls/images/iOS/pip-placard@2x.png:
1612         * Modules/modern-media-controls/images/iOS/pip-placard@3x.png:
1613         * Modules/modern-media-controls/images/macOS/airplay-placard@1x.png:
1614         * Modules/modern-media-controls/images/macOS/airplay-placard@2x.png:
1615         * Modules/modern-media-controls/images/macOS/invalid-placard@1x.png:
1616         * Modules/modern-media-controls/images/macOS/invalid-placard@2x.png:
1617         * Modules/modern-media-controls/images/macOS/pip-placard@1x.png:
1618         * Modules/modern-media-controls/images/macOS/pip-placard@2x.png:
1619         * Resources/AttachmentPlaceholder.png:
1620         * Resources/AttachmentPlaceholder@2x.png:
1621         * Resources/ListButtonArrow.png:
1622         * Resources/ListButtonArrow@2x.png:
1623         * Resources/missingImage.png:
1624         * Resources/missingImage@2x.png:
1625         * Resources/missingImage@3x.png:
1626         * Resources/moveCursor.png:
1627         * Resources/northEastSouthWestResizeCursor.png:
1628         * Resources/northSouthResizeCursor.png:
1629         * Resources/northWestSouthEastResizeCursor.png:
1630         * Resources/nullPlugin.png:
1631         * Resources/nullPlugin@2x.png:
1632         * Resources/panIcon.png:
1633         * Resources/textAreaResizeCorner.png:
1634         * Resources/textAreaResizeCorner@2x.png:
1635         * Resources/urlIcon.png:
1636
1637 2018-11-12  Youenn Fablet  <youenn@apple.com>
1638
1639         RealtimeOutgoing A/V sources should observe their sources only if having a sink
1640         https://bugs.webkit.org/show_bug.cgi?id=191490
1641
1642         Reviewed by Eric Carlson.
1643
1644         Observe the source that generates media based on the sinks:
1645         - Do not observe at creation time
1646         - For first sink, start observing
1647         - When no more sink, stop observing
1648         Apply this principle for both outgoing audio and video sources.
1649         Add locks for the sinks to ensure thread-safety.
1650         Make sinks HashSet which is more robust.
1651
1652         Do some refactoring to better isolate generic outgoing sources from Cocoa/GTK implementations.
1653
1654         Covered by existing tests and updated webrtc/remove-track.html.
1655
1656         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
1657         (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource):
1658         (WebCore::RealtimeOutgoingAudioSource::stop):
1659         (WebCore::RealtimeOutgoingAudioSource::AddSink):
1660         (WebCore::RealtimeOutgoingAudioSource::RemoveSink):
1661         (WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
1662         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1663         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
1664         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
1665         (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource):
1666         (WebCore::RealtimeOutgoingVideoSource::observeSource):
1667         (WebCore::RealtimeOutgoingVideoSource::setSource):
1668         (WebCore::RealtimeOutgoingVideoSource::stop):
1669         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
1670         (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
1671         * platform/mediastream/RealtimeOutgoingVideoSource.h:
1672         (WebCore::RealtimeOutgoingVideoSource::isSilenced const):
1673         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
1674         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
1675         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
1676         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
1677         (WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable):
1678         (WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData):
1679         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
1680         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
1681         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
1682
1683 2018-11-12  Youenn Fablet  <youenn@apple.com>
1684
1685         Support setting stream ids when adding a transceiver
1686         https://bugs.webkit.org/show_bug.cgi?id=191307
1687
1688         Reviewed by Eric Carlson.
1689
1690         Add support for streams in RTCTransceiverInit.
1691         Add plumbing down to libwebrtc.
1692         Covered by rebased tests.
1693
1694         * Modules/mediastream/RTCPeerConnection.h:
1695         * Modules/mediastream/RTCPeerConnection.idl:
1696         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1697         (WebCore::fromRtpTransceiverInit):
1698
1699 2018-11-12  Antti Koivisto  <antti@apple.com>
1700
1701         Support dynamic pseudo-classes on elements with display: contents
1702         https://bugs.webkit.org/show_bug.cgi?id=181640
1703         <rdar://problem/36605415>
1704
1705         Reviewed by Dean Jackson.
1706
1707         The code for :hover and :active style invalidation assumes that only elements with renderer need invalidation.
1708
1709         This patch fixes '.display-content-element:hover span' case but not '.display-content-element:hover' case but
1710         includes tests for both. The latter is not super useful anyway (as it only affects rendering with inherited
1711         text properties).
1712
1713         Test: fast/css/display-contents-hover-active.html
1714
1715         * dom/Document.cpp:
1716         (WebCore::Document::updateHoverActiveState):
1717
1718             Traverse up in composed tree instead of render tree when invalidating. This has the same order as render tree
1719             but also includes display:content elements. This also allows removing the special display:none case.
1720
1721         * dom/Element.cpp:
1722         (WebCore::Element::setActive):
1723         (WebCore::Element::setHovered):
1724
1725             Also look into display:contents style for invalidation checks.
1726
1727         (WebCore::Element::renderOrDisplayContentsStyle const):
1728
1729             Make this helper an Element member.
1730
1731         * dom/Element.h:
1732         * dom/Node.cpp:
1733         (WebCore::Node::parentElementInComposedTree const):
1734
1735             Support starting from a PseudoElement. This is consistent with ComposedTreeAncestorIterator.
1736
1737         * rendering/updating/RenderTreePosition.cpp:
1738         (WebCore::RenderTreePosition::nextSiblingRenderer const):
1739         * style/StyleTreeResolver.cpp:
1740         (WebCore::Style::TreeResolver::resolveElement):
1741         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1742         (WebCore::Style::shouldResolveElement):
1743         (WebCore::Style::TreeResolver::resolveComposedTree):
1744         (WebCore::Style::renderOrDisplayContentsStyle): Deleted.
1745
1746             Use the Element::renderOrDisplayContentsStyle() instead.
1747
1748 2018-11-12  Antoine Quint  <graouts@apple.com>
1749
1750         [Web Animations] Turn Web Animations experimental
1751         https://bugs.webkit.org/show_bug.cgi?id=191543
1752
1753         Reviewed by Dean Jackson.
1754
1755         * page/RuntimeEnabledFeatures.h:
1756
1757 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
1758
1759         feFlood with alpha color doesn't work correctly
1760         https://bugs.webkit.org/show_bug.cgi?id=163666
1761
1762         Reviewed by Zalan Bujtas.
1763         
1764         FEFlood::platformApplySoftware() erroneously used colorWithOverrideAlpha()
1765         rather than multiplying the flood color with the flood opacity as other browsers do.
1766
1767         Test: svg/filters/feFlood-with-alpha-color.html
1768
1769         * platform/graphics/Color.cpp:
1770         (WebCore::Color::colorWithAlpha const): I tried using colorWithAlphaMultipliedBy() elsewhere,
1771         and it triggered a behavior change, so add a comment.
1772         * platform/graphics/filters/FEFlood.cpp:
1773         (WebCore::FEFlood::platformApplySoftware):
1774         * svg/SVGStopElement.cpp:
1775         (WebCore::SVGStopElement::stopColorIncludingOpacity const):
1776
1777 2018-11-12  Eric Carlson  <eric.carlson@apple.com>
1778
1779         Require <iframe allow="display"> for an iframe to use getDisplayMedia
1780         https://bugs.webkit.org/show_bug.cgi?id=191505
1781         <rdar://problem/45968811>
1782
1783         Reviewed by Jer Noble.
1784
1785         Test: http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html
1786
1787         * Modules/mediastream/MediaDevicesRequest.cpp:
1788         (WebCore::MediaDevicesRequest::start):
1789         * Modules/mediastream/UserMediaController.cpp:
1790         (WebCore::isAllowedToUse):
1791         (WebCore::UserMediaController::canCallGetUserMedia):
1792         (WebCore::UserMediaController::logGetUserMediaDenial):
1793         * Modules/mediastream/UserMediaController.h:
1794         * Modules/mediastream/UserMediaRequest.cpp:
1795         (WebCore::UserMediaRequest::start):
1796
1797 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
1798
1799         Make compositing updates incremental
1800         https://bugs.webkit.org/show_bug.cgi?id=90342
1801
1802         Reviewed by Antti Koivisto.
1803
1804         Previously, updating compositing layers required two full RenderLayer tree traversals,
1805         and all the work was done for every RenderLayer on each composting update. This could be expensive
1806         on pages with lots of RenderLayers.
1807
1808         These changes make compositing updates more incremental. Compositing updates still require
1809         two tree traversals. The first determines which RenderLayers need to be composited (of those which
1810         weren't already made composited at style-change time), because of reasons that can only be determined
1811         post-layout, and indirect reasons including overlap. The second traversal updates the configuration, geometry
1812         and GraphicsLayer tree for the composited layers. Dependencies on both descendant and ancestor state make
1813         it hard to fold these two traversals together.
1814
1815         In order to minimize the work done during these traversals, dirty bits are stored on RenderLayers,
1816         and propagated to ancestor layers in paint order. There are two sets of bits: those related to the first
1817         "compositing requirements" traversal, and those related to the second "update backing and hierarchy" traversal.
1818         When a RenderLayer gets a dirty bit set, bits are propagated to ancestors to indicate that children need
1819         to be visited.
1820
1821         Sadly entire subtrees can't be skipped during the "compositing requirements" traversal because we still have
1822         to accumulate overlap rects, but RenderLayerCompositor::traverseUnchangedSubtree() is used to minimize
1823         work in that case. Subtrees can be skipped in the "update backing and hierarchy" traversal. Entire traversals can
1824         be skipped if no change has triggered the need for that traversal.
1825         
1826         These changes fix a correctness issue where transform changes now trigger overlap re-evaluation, which causes
1827         more layer geometry updates than before. This regressed the MotionMark "Focus" test, when geometry updates
1828         triggered layer resizes as the filter blur radius changed, which then triggered repaints. This is fixed by
1829         excluding composited filters from the composited bounds (but still taking them into account for overlap).
1830
1831         Care is taken to avoid triggering traversals in non-composited documents (tested by no-updates-in-non-composited-iframe.html).
1832
1833         Code to set the dirty bits is added in various places that change properties that compositing depends on.
1834         
1835         These changes also subsume the patch in 176196; we now never consult properties that rely on layout from the
1836         style change code path, and the only call stack for geometry updates is from the "update backing and hierarchy"
1837         traversal, which is always a pre-order traversal.
1838
1839         Tests: compositing/geometry/stacking-context-change-layer-reparent.html
1840                compositing/layer-creation/change-to-overlap.html
1841                compositing/updates/no-updates-in-non-composited-iframe.html
1842
1843         * html/canvas/WebGLRenderingContextBase.cpp:
1844         (WebCore::WebGLRenderingContextBase::markContextChanged): Need to differentiate between a canvas becoming composited
1845         for the first time, and its pixels changing with a new 'CanvasPixelsChanged' value.
1846         * page/FrameView.cpp:
1847         (WebCore::FrameView::setViewportConstrainedObjectsNeedLayout):
1848         * page/Page.cpp:
1849         (WebCore::Page::setPageScaleFactor):
1850         * platform/graphics/ca/GraphicsLayerCA.cpp:
1851         (WebCore::GraphicsLayerCA::updateBackdropFilters): If we just made a layer for backdrops, we need to update sublayers.
1852         * rendering/RenderBox.cpp:
1853         (WebCore::RenderBox::styleWillChange):
1854         * rendering/RenderLayer.cpp:
1855         (WebCore::RenderLayer::RenderLayer):
1856         (WebCore::RenderLayer::~RenderLayer):
1857         (WebCore::RenderLayer::addChild):
1858         (WebCore::RenderLayer::removeChild):
1859         (WebCore::RenderLayer::shouldBeStackingContext const):
1860         (WebCore::RenderLayer::stackingContext const):
1861         (WebCore::RenderLayer::dirtyZOrderLists):
1862         (WebCore::RenderLayer::dirtyNormalFlowList):
1863         (WebCore::RenderLayer::updateNormalFlowList):
1864         (WebCore::RenderLayer::rebuildZOrderLists):
1865         (WebCore::RenderLayer::setAncestorsHaveCompositingDirtyFlag):
1866         (WebCore::RenderLayer::contentChanged):
1867         (WebCore::RenderLayer::updateLayerPositions):
1868         (WebCore::RenderLayer::updateTransform):
1869         (WebCore::RenderLayer::updateLayerPosition):
1870         (WebCore::RenderLayer::enclosingCompositingLayer const):
1871         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
1872         (WebCore::RenderLayer::clippingRootForPainting const):
1873         (WebCore::RenderLayer::scrollTo):
1874         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
1875         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
1876         (WebCore::RenderLayer::paintLayerContents):
1877         (WebCore::RenderLayer::hitTest):
1878         (WebCore::RenderLayer::hitTestLayer):
1879         (WebCore::RenderLayer::calculateClipRects const):
1880         (WebCore::outputPaintOrderTreeLegend):
1881         (WebCore::outputPaintOrderTreeRecursive):
1882         (WebCore::compositingContainer): Deleted.
1883         * rendering/RenderLayer.h:
1884         (WebCore::RenderLayer::clearZOrderLists):
1885         (WebCore::RenderLayer::paintOrderParent const):
1886         * rendering/RenderLayerBacking.cpp:
1887         (WebCore::RenderLayerBacking::updateCompositedBounds):
1888         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
1889         (WebCore::RenderLayerBacking::updateAfterLayout):
1890         (WebCore::RenderLayerBacking::updateConfigurationAfterStyleChange):
1891         (WebCore::RenderLayerBacking::updateConfiguration):
1892         (WebCore::RenderLayerBacking::updateGeometry):
1893         (WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
1894         (WebCore::RenderLayerBacking::updateMaskingLayer):
1895         (WebCore::RenderLayerBacking::paintsContent const):
1896         (WebCore::RenderLayerBacking::contentChanged):
1897         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
1898         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
1899         (WebCore::RenderLayerBacking::startAnimation):
1900         (WebCore::RenderLayerBacking::animationFinished):
1901         (WebCore::RenderLayerBacking::startTransition):
1902         (WebCore::RenderLayerBacking::transitionFinished):
1903         (WebCore::RenderLayerBacking::setCompositedBounds):
1904         * rendering/RenderLayerBacking.h:
1905         * rendering/RenderLayerCompositor.cpp:
1906         (WebCore::RenderLayerCompositor::CompositingState::CompositingState):
1907         (WebCore::RenderLayerCompositor::enableCompositingMode):
1908         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
1909         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlagsAfterLayout):
1910         (WebCore::RenderLayerCompositor::willRecalcStyle):
1911         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
1912         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1913         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1914         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1915         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1916         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
1917         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
1918         (WebCore::RenderLayerCompositor::logLayerInfo):
1919         (WebCore::clippingChanged):
1920         (WebCore::styleAffectsLayerGeometry):
1921         (WebCore::RenderLayerCompositor::layerStyleChanged):
1922         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
1923         (WebCore::RenderLayerCompositor::updateBacking):
1924         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
1925         (WebCore::RenderLayerCompositor::layerWasAdded):
1926         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
1927         (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
1928         (WebCore::RenderLayerCompositor::computeExtent const):
1929         (WebCore::RenderLayerCompositor::addToOverlapMap):
1930         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
1931         (WebCore::RenderLayerCompositor::rootLayerConfigurationChanged):
1932         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1933         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
1934         (WebCore::RenderLayerCompositor::needsToBeComposited const):
1935         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
1936         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1937         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1938         (WebCore::RenderLayerCompositor::clippedByAncestor const):
1939         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
1940         (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
1941         (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
1942         (WebCore::RenderLayerCompositor::requiresCompositingForFilters const):
1943         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
1944         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
1945         (WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
1946         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
1947         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
1948         (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
1949         (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):
1950         (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
1951         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
1952         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
1953         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
1954         (WebCore::operator<<):
1955         (WebCore::RenderLayerCompositor::setCompositingLayersNeedRebuild): Deleted.
1956         (WebCore::checkIfDescendantClippingContextNeedsUpdate): Deleted.
1957         (WebCore::isScrollableOverflow): Deleted.
1958         (WebCore::styleHasTouchScrolling): Deleted.
1959         (WebCore::styleChangeRequiresLayerRebuild): Deleted.
1960         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Deleted.
1961         (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged): Deleted.
1962         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): Deleted.
1963         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): Deleted.
1964         * rendering/RenderLayerCompositor.h:
1965         * rendering/RenderTreeAsText.cpp:
1966         (WebCore::writeLayers):
1967
1968 2018-11-12  Rob Buis  <rbuis@igalia.com>
1969
1970         CSSCalcOperation constructor wastes 6KB of Vector capacity on cnn.com
1971         https://bugs.webkit.org/show_bug.cgi?id=190839
1972
1973         Reviewed by Frédéric Wang.
1974
1975         The CSSCalcOperation ctor that takes a leftSide and rightSide parameter
1976         wastes memory since it will always have size 2 but claims the
1977         default Vector size. So make sure to reserve an initial capacity of 2.
1978
1979         * css/CSSCalculationValue.cpp:
1980
1981 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1982
1983         WTFMove(xxx) is used in arguments while other arguments touch xxx
1984         https://bugs.webkit.org/show_bug.cgi?id=191544
1985
1986         Reviewed by Alex Christensen.
1987
1988         The order of the evaluation of C++ arguments is undefined. If we use WTFMove(xxx),
1989         xxx should not be touched in the other arguments. This patch fixes such uses in
1990         IDB code.
1991
1992         * Modules/indexeddb/IDBObjectStore.cpp:
1993         (WebCore::IDBObjectStore::deleteIndex):
1994         * Modules/indexeddb/IDBTransaction.cpp:
1995         (WebCore::IDBTransaction::scheduleOperation):
1996         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1997         (WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
1998         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1999         (WebCore::IDBServer::MemoryObjectStore::registerIndex):
2000
2001 2018-11-12  Zalan Bujtas  <zalan@apple.com>
2002
2003         [LFC][IFC] Construct dedicated runs when the inline element requires it.
2004         https://bugs.webkit.org/show_bug.cgi?id=191509
2005
2006         Reviewed by Antti Koivisto.
2007
2008         In certain cases, a run can overlap multiple inline elements like this:
2009
2010         <span>normal text content</span><span style="position: relative; left: 10px;">but this one needs a dedicated run</span><span>end of text</span>
2011
2012         The content above generates one long run <normal text contentbut this one needs dedicated runend of text> <- input to line breaking.
2013         However, since the middle run is positioned, it needs to be moved independently from the rest of the content, hence it needs a dedicated inline run.
2014
2015         * layout/inlineformatting/InlineFormattingContext.cpp:
2016         (WebCore::Layout::InlineFormattingContext::layout const):
2017         (WebCore::Layout::contentRequiresSeparateRun):
2018         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2019         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
2020         (WebCore::Layout::InlineFormattingContext::closeLine const):
2021         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
2022         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2023         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2024         * layout/inlineformatting/InlineFormattingContext.h:
2025         (WebCore::Layout::InlineFormattingContext::inlineFormattingState const):
2026         * layout/inlineformatting/InlineLineBreaker.cpp:
2027         (WebCore::Layout::InlineLineBreaker::nextRun): mid-word breaking is not implemented yet.
2028         * layout/inlineformatting/InlineRun.h:
2029         (WebCore::Layout::InlineRun::overlapsMultipleInlineItems const):
2030         * layout/inlineformatting/InlineRunProvider.cpp:
2031         (WebCore::Layout::InlineRunProvider::processInlineTextItem):
2032         * layout/inlineformatting/InlineRunProvider.h:
2033         (WebCore::Layout::InlineRunProvider::Run::TextContext::expand):
2034         (WebCore::Layout::InlineRunProvider::Run::textContext):
2035         (WebCore::Layout::InlineRunProvider::Run::TextContext::setStart): Deleted.
2036         (WebCore::Layout::InlineRunProvider::Run::TextContext::setLength): Deleted.
2037
2038 2018-11-12  Jer Noble  <jer.noble@apple.com>
2039
2040         [MSE] Frame re-ordering can cause iframes to never be enqueued
2041         https://bugs.webkit.org/show_bug.cgi?id=191485
2042
2043         Reviewed by Eric Carlson.
2044
2045         Test: media/media-source/media-source-dropped-iframe.html
2046
2047         Some frame re-ordering techniques result in files where the first frame has a
2048         decode timestamp < 0, but a presentation timestamp >= 0. When appending these
2049         samples to existing content, we can fail to enqueue the first frame because its
2050         DTS overlaps an existing sample, but the presentation timestamp does not.
2051         Rather than try to only enqueue samples whose decode timestamps are > than the
2052         greatest decode end timestamp (minus some fudge factor), allow all frames to be
2053         added to the decode queue if they are strictly ordered greater than the last
2054         enqueued frame.
2055
2056         * Modules/mediasource/SourceBuffer.cpp:
2057         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
2058         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2059         (WebCore::SourceBuffer::provideMediaData):
2060         (WebCore::SourceBuffer::reenqueueMediaForTime):
2061
2062 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2063
2064         IDBTransaction does not use "RefPtr<IDBTransaction> self"
2065         https://bugs.webkit.org/show_bug.cgi?id=190436
2066
2067         Reviewed by Alex Christensen.
2068
2069         It seems that `RefPtr<IDBTransaction> self;` is not effective since it does not capture anything.
2070         Use `protectedThis = makeRef(*this)` instead.
2071
2072         No behavior change.
2073
2074         * Modules/indexeddb/IDBTransaction.cpp:
2075         (WebCore::IDBTransaction::IDBTransaction):
2076
2077 2018-11-12  Alicia Boya García  <aboya@igalia.com>
2078
2079         [MSE][GStreamer] Introduce AbortableTaskQueue
2080         https://bugs.webkit.org/show_bug.cgi?id=190902
2081
2082         Reviewed by Xabier Rodriguez-Calvar.
2083
2084         A new synchronization primitive is introduced: AbortableTaskQueue,
2085         which allows to send work to the main thread from a background thread
2086         with the option to perform two-phase cancellation (startAborting() and
2087         finishAborting()).
2088
2089         This new primitive has been used to overhaul GstBus messaging in
2090         AppendPipeline. A lot of code made redundant has been deleted in the
2091         process and lots of internal functions were now able to be made
2092         private. As part of the refactor all glib signals in AppendPipeline
2093         now use lambdas. All usages of WTF::isMainThread() in AppendPipeline
2094         have been replaced by isMainThread() for consistency with the rest of
2095         WebKit.
2096
2097         Two-phase cancellation is still not used in AppendPipeline as of this
2098         patch, but it will be used in a future patch that makes use of
2099         GStreamer flushes to implement correct MSE abort semantics. There are
2100         unit tests to ensure it works correctly, even if it's still not used.
2101
2102         * WebCore.xcodeproj/project.pbxproj:
2103         * platform/AbortableTaskQueue.h: Added.
2104         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2105         (WebCore::AppendPipeline::dumpAppendState):
2106         (WebCore::AppendPipeline::AppendPipeline):
2107         (WebCore::AppendPipeline::~AppendPipeline):
2108         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
2109         (WebCore::AppendPipeline::handleAppsinkNewSampleFromAnyThread):
2110         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
2111         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2112         (WebCore::AppendPipeline::sourceBufferPrivate):
2113         (WebCore::AppendPipeline::appsinkCaps):
2114         (WebCore::AppendPipeline::track):
2115         (WebCore::AppendPipeline::demuxerSrcPadCaps):
2116         (WebCore::AppendPipeline::playerPrivate):
2117
2118 2018-11-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2119
2120         [GStreamer][EME] waitingforkey event should consider decryptors' waiting status
2121         https://bugs.webkit.org/show_bug.cgi?id=191459
2122
2123         Reviewed by Carlos Garcia Campos.
2124
2125         The new cross platform architecture to report waitingforkey and
2126         recover from it requires a more accurate knowledge of what is
2127         going on with the decryptors because events are reported only once
2128         (per key exchange run) and crossplatform only continues if we are
2129         actually ready to continue, meaning that no decryptors are
2130         waiting.
2131
2132         * platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added
2133         GstIterator deleter.
2134         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2135         (WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey): Bail
2136         out if we are requested to not wait anymore but there are still
2137         waiting decryptors.
2138         (WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
2139         Query the pipeline, just a query after pipeline is built and
2140         manual inspection during build. The query is optimal but sometimes
2141         we can get this request when the pipeline is under construction so
2142         queries do not arrive at the decryptors and we have to deliver it
2143         by ourselves.
2144         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
2145         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2146         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
2147         Deleted because it is now inlined.
2148         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2149         (webKitMediaClearKeyDecryptorDecrypt): Fixed small compiler warning.
2150         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2151         (webkit_media_common_encryption_decrypt_class_init): Override
2152         query method.
2153         (webkitMediaCommonEncryptionDecryptTransformInPlace): When the
2154         decryptor is going to block to wait, report before. When the
2155         decryptor receives the key, report it got it.
2156         (webkitMediaCommonEncryptionDecryptSinkEventHandler): Do not
2157         handle waitingforkey here.
2158         (webkitMediaCommonEncryptionDecryptorQueryHandler): Report if the
2159         decryptor is waiting.
2160
2161 2018-11-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2162
2163         [GTK] Silence ATK_XY_PARENT warnings
2164         https://bugs.webkit.org/show_bug.cgi?id=191504
2165
2166         Reviewed by Carlos Garcia Campos.
2167
2168         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
2169         (atkToContents):
2170         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2171         (textExtents):
2172         * accessibility/atk/WebKitAccessibleUtil.cpp:
2173         (contentsRelativeToAtkCoordinateType):
2174
2175 2018-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2176
2177         Implement a new edit command to change the enclosing list type
2178         https://bugs.webkit.org/show_bug.cgi?id=191487
2179         <rdar://problem/45955922>
2180
2181         Reviewed by Ryosuke Niwa.
2182
2183         Add support for a new edit command that changes the type of the enclosing list element around the selection from
2184         unordered to ordered list and vice versa. This new edit command is exposed only to internal WebKit2 clients, via
2185         SPI on WKWebView (`-_changeListType:`).
2186
2187         This is currently intended for use in Mail compose, but may also be adopted by legacy Notes in the future. As
2188         such, the behavior of this editing command mostly matches shipping behavior in Mail compose (which is currently
2189         implemented entirely by Mail). See below for more details.
2190
2191         Test:   editing/execCommand/change-list-type.html
2192                 WKWebViewEditActions.ChangeListType
2193
2194         * Sources.txt:
2195         * WebCore.xcodeproj/project.pbxproj:
2196         * editing/ChangeListTypeCommand.cpp: Added.
2197         (WebCore::listConversionTypeForSelection):
2198         (WebCore::ChangeListTypeCommand::listConversionType):
2199
2200         Helper that returns a potential list conversion command that may be executed at the given document's selection,
2201         if any exists. We also use existing logic from Mail here to determine which list to change, by walking up the
2202         DOM from the lowest common ancestor container of the current selection until we hit the first list element.
2203
2204         (WebCore::ChangeListTypeCommand::createNewList):
2205
2206         Helper method to create a new list element to replace the given list, and then clone element data from the given
2207         list to the new list. This addresses an existing bug in Mail, wherein changing list type for an enclosing list
2208         which contains inline style properties drops the inline styles, because existing logic in Mail that implements
2209         this editing command only copies the `class` attribute of the old list to the new list.
2210
2211         (WebCore::ChangeListTypeCommand::doApply):
2212
2213         Apply the edit command by running the following steps:
2214         -   Find the enclosing list element, if any (see above).
2215         -   Create a new list element of the opposite type as the enclosing list, and clone over element data from the
2216             list element being replaced.
2217         -   Insert the new list next to the original list.
2218         -   Move all children of the original list to the new list.
2219         -   Remove the original list.
2220         -   Set the selection to the end of the new list.
2221
2222         * editing/ChangeListTypeCommand.h: Added.
2223         * editing/EditAction.h:
2224
2225         Add a pair of new edit actions for conversion from unordered list to ordered list and vice versa.
2226
2227         * editing/Editor.cpp:
2228         (WebCore::Editor::changeSelectionListType):
2229
2230         Implement this by creating and applying a new ChangeListTypeCommand.
2231
2232         (WebCore::Editor::canChangeSelectionListType): Deleted.
2233
2234         Remove this for now, since there's no need for it until full support for edit command validation is implemented.
2235
2236         * editing/Editor.h:
2237         * testing/Internals.cpp:
2238         (WebCore::Internals::changeSelectionListType):
2239         * testing/Internals.h:
2240         * testing/Internals.idl:
2241
2242         Add internal hooks to change list type from layout tests.
2243
2244 2018-11-11  Daniel Bates  <dabates@apple.com>
2245
2246         [iOS] Draw caps lock indicator in password fields
2247         https://bugs.webkit.org/show_bug.cgi?id=190565
2248         <rdar://problem/45262343>
2249
2250         Reviewed by Dean Jackson.
2251
2252         Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
2253         fields on iOS more closely match the behavior of password fields on Mac.
2254
2255         The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
2256         In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
2257         Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
2258         WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
2259         the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
2260         web views listen for keyboard availability changes so as to update the the caps lock state when
2261         a hardware keyboard is detached or attached.
2262
2263         * WebCore.xcodeproj/project.pbxproj:
2264         * page/EventHandler.cpp:
2265         (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
2266         so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
2267         (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
2268         * page/EventHandler.h:
2269         * platform/cocoa/KeyEventCocoa.mm:
2270         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
2271         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
2272         * platform/ios/KeyEventIOS.mm:
2273         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
2274         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
2275         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
2276         * platform/ios/WebEvent.h:
2277         * platform/ios/WebEvent.mm:
2278         (+[WebEvent modifierFlags]): Added.
2279         * platform/mac/KeyEventMac.mm:
2280         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
2281         by both Mac and iOS.
2282         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
2283         by both Mac and iOS.
2284         * rendering/RenderThemeCocoa.h:
2285         * rendering/RenderThemeCocoa.mm:
2286         (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
2287         * rendering/RenderThemeIOS.h:
2288         * rendering/RenderThemeIOS.mm:
2289         (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
2290         * rendering/RenderThemeMac.h:
2291         * rendering/RenderThemeMac.mm:
2292         (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
2293         shared by both Mac and iOS.
2294
2295 2018-11-11  Zalan Bujtas  <zalan@apple.com>
2296
2297         [LFC][BFC] In-flow positioned logic is really formatting context dependent.
2298         https://bugs.webkit.org/show_bug.cgi?id=191512
2299
2300         Reviewed by Simon Fraser.
2301
2302         Move block formatting context specific code from FormattingContext to BlockFormattingContext.
2303
2304         * layout/FormattingContext.cpp:
2305         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const): Deleted.
2306         * layout/FormattingContext.h:
2307         * layout/FormattingContextGeometry.cpp:
2308         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
2309         * layout/blockformatting/BlockFormattingContext.cpp:
2310         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
2311         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const): Deleted.
2312         * layout/blockformatting/BlockFormattingContext.h:
2313         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2314         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): Deleted.
2315         * layout/inlineformatting/InlineFormattingContext.cpp:
2316         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): Deleted.
2317         * layout/inlineformatting/InlineFormattingContext.h:
2318
2319 2018-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
2320
2321         Address post-review comments after r237955
2322         https://bugs.webkit.org/show_bug.cgi?id=191496
2323
2324         Reviewed by Darin Adler.
2325
2326         * rendering/TextDecorationPainter.cpp:
2327         (WebCore::TextDecorationPainter::paintTextDecoration):
2328         * style/InlineTextBoxStyle.cpp:
2329         (WebCore::computeUnderlineOffset):
2330         * style/InlineTextBoxStyle.h:
2331
2332 2018-11-11  Benjamin Poulain  <benjamin@webkit.org>
2333
2334         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
2335         https://bugs.webkit.org/show_bug.cgi?id=191492
2336
2337         Reviewed by Alex Christensen.
2338
2339         Rename file.
2340
2341         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2342         * page/mac/EventHandlerMac.mm:
2343         * platform/mac/URLMac.mm:
2344         * platform/mac/WebCoreNSURLExtras.mm:
2345         * platform/mac/WebCoreObjCExtras.mm:
2346         * rendering/RenderThemeMac.mm:
2347
2348 2018-11-10  Benjamin Poulain  <benjamin@webkit.org>
2349
2350         Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
2351         https://bugs.webkit.org/show_bug.cgi?id=191492
2352
2353         Reviewed by Alex Christensen.
2354
2355         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2356         * page/mac/EventHandlerMac.mm:
2357         * platform/mac/URLMac.mm:
2358         * platform/mac/WebCoreNSURLExtras.mm:
2359         * platform/mac/WebCoreObjCExtras.mm:
2360         * rendering/RenderThemeMac.mm:
2361         (WebCore::RenderThemeMac::systemColor const):
2362
2363 2018-11-10  Megan Gardner  <megan_gardner@apple.com>
2364
2365         Fix build for 32bit Mac
2366         https://bugs.webkit.org/show_bug.cgi?id=191511
2367
2368         Unreviewed Build Fix.
2369
2370         Build fix, not tests needed.
2371
2372         Make the apporiate delecrations for 32-bit mac support.
2373
2374         * editing/mac/DictionaryLookup.mm:
2375
2376 2018-11-10  Simon Fraser  <simon.fraser@apple.com>
2377
2378         Remove support for -webkit-svg-shadow
2379         https://bugs.webkit.org/show_bug.cgi?id=187429
2380         <rdar://problem/41920735>
2381
2382         Reviewed by Dean Jackson.
2383         
2384         -webkit-svg-shadow was a non-standard hack for online iWork, and they no longer use it,
2385         so remove it. No other browser supports it, and chromestatus say it's used on less than
2386         0.000001% of pages.
2387
2388         * css/CSSComputedStyleDeclaration.cpp:
2389         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2390         * css/CSSProperties.json:
2391         * css/SVGCSSComputedStyleDeclaration.cpp:
2392         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2393         * css/StyleBuilderCustom.h:
2394         (WebCore::StyleBuilderCustom::applyInitialWebkitSvgShadow): Deleted.
2395         (WebCore::StyleBuilderCustom::applyInheritWebkitSvgShadow): Deleted.
2396         (WebCore::StyleBuilderCustom::applyValueWebkitSvgShadow): Deleted.
2397         * css/parser/CSSPropertyParser.cpp:
2398         (WebCore::CSSPropertyParser::parseSingleValue):
2399         * rendering/RenderElement.cpp:
2400         (WebCore::RenderElement::didAttachChild):
2401         * rendering/svg/RenderSVGImage.cpp:
2402         (WebCore::RenderSVGImage::layout):
2403         * rendering/svg/RenderSVGImage.h:
2404         * rendering/svg/RenderSVGModelObject.cpp:
2405         (WebCore::RenderSVGModelObject::RenderSVGModelObject):
2406         * rendering/svg/RenderSVGModelObject.h:
2407         (WebCore::RenderSVGModelObject::repaintRectInLocalCoordinatesExcludingSVGShadow const): Deleted.
2408         (WebCore::RenderSVGModelObject::hasSVGShadow const): Deleted.
2409         (WebCore::RenderSVGModelObject::setHasSVGShadow): Deleted.
2410         * rendering/svg/RenderSVGRoot.cpp:
2411         (WebCore::RenderSVGRoot::RenderSVGRoot):
2412         (WebCore::RenderSVGRoot::updateCachedBoundaries):
2413         * rendering/svg/RenderSVGRoot.h:
2414         * rendering/svg/RenderSVGShape.cpp:
2415         (WebCore::RenderSVGShape::updateRepaintBoundingBox):
2416         * rendering/svg/RenderSVGShape.h:
2417         * rendering/svg/SVGRenderSupport.cpp:
2418         (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
2419         (WebCore::SVGRenderSupport::layoutChildren):
2420         (WebCore::SVGRenderSupport::styleChanged):
2421         (WebCore::SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow): Deleted.
2422         (WebCore::SVGRenderSupport::rendererHasSVGShadow): Deleted.
2423         (WebCore::SVGRenderSupport::setRendererHasSVGShadow): Deleted.
2424         (WebCore::SVGRenderSupport::intersectRepaintRectWithShadows): Deleted.
2425         (WebCore::SVGRenderSupport::childAdded): Deleted.
2426         * rendering/svg/SVGRenderSupport.h:
2427
2428 2018-11-10  Ryan Haddad  <ryanhaddad@apple.com>
2429
2430         Unreviewed, rolling out r238065.
2431
2432         Breaks internal builds.
2433
2434         Reverted changeset:
2435
2436         "Make it possible to edit images inline"
2437         https://bugs.webkit.org/show_bug.cgi?id=191352
2438         https://trac.webkit.org/changeset/238065
2439
2440 2018-11-10  Tim Horton  <timothy_horton@apple.com>
2441
2442         Make it possible to edit images inline
2443         https://bugs.webkit.org/show_bug.cgi?id=191352
2444         <rdar://problem/30107985>
2445
2446         Reviewed by Dean Jackson.
2447
2448         Tests: editing/images/basic-editable-image.html
2449                editing/images/reparent-editable-image-maintains-strokes.html
2450
2451         Add the beginnings of a mechanism to replace images with a special attribute
2452         with a native drawing view in the UI process.
2453
2454         * page/Settings.yaml:
2455         Add a setting to control whether images become natively editable when they
2456         have the x-apple-editable-image attribute.
2457
2458         * html/HTMLImageElement.cpp:
2459         (WebCore::HTMLImageElement::editableImageViewID const):
2460         Lazily generate an EmbeddedViewID and persist it on the <img> element.
2461
2462         * html/HTMLImageElement.h:
2463         Rearrange the service controls methods to sit before the members.
2464         Add m_editableImageViewID and editableImageViewID().
2465
2466         * platform/graphics/GraphicsLayer.cpp:
2467         (WebCore::GraphicsLayer::nextEmbeddedViewID):
2468         * platform/graphics/GraphicsLayer.h:
2469         (WebCore::GraphicsLayer::setContentsToEmbeddedView):
2470         Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
2471         on Cocoa platforms and when using RemoteLayerTree.
2472         Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
2473         Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
2474         and an EmbeddedViewID to uniquely identify and communicate about the
2475         embedded view (which may move between layers, since it is tied to an element).
2476
2477         * platform/graphics/ca/GraphicsLayerCA.cpp:
2478         (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
2479         (WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
2480         When setting GraphicsLayer's contents to an embedded view, we use
2481         a special PlatformCALayer factory that takes the EmbeddedViewID and type.
2482         GraphicsLayerCARemote will override this and make a correctly-initialized
2483         PlatformCALayerRemote that keeps track of the EmbeddedViewID.
2484
2485         * platform/graphics/ca/GraphicsLayerCA.h:
2486         * platform/graphics/ca/PlatformCALayer.cpp:
2487         (WebCore::operator<<):
2488         * platform/graphics/ca/PlatformCALayer.h:
2489         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2490         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2491         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
2492         (WebCore::PlatformCALayerCocoa::embeddedViewID const):
2493         Add stubs and logging for EmbeddedViewID on PlatformCALayer.
2494         These will be overridden by PlatformCALayerRemote to do more interesting things.
2495
2496         * rendering/RenderImage.cpp:
2497         (WebCore::RenderImage::isEditableImage const):
2498         Add a getter that return true if the setting is enabled and
2499         x-apple-editable-image is empty or true.
2500
2501         (WebCore::RenderImage::requiresLayer const):
2502         RenderImage requires a layer either if RenderReplaced does, or we are an
2503         editable image.
2504
2505         * rendering/RenderImage.h:
2506         * rendering/RenderLayer.cpp:
2507         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
2508         (WebCore::RenderLayer::calculateClipRects const):
2509         * rendering/RenderLayerBacking.cpp:
2510         (WebCore::RenderLayerBacking::updateConfiguration):
2511         Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
2512
2513         * rendering/RenderLayerCompositor.cpp:
2514         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2515         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2516         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2517         (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
2518         * rendering/RenderLayerCompositor.h:
2519         Make editable images require compositing implicitly.
2520
2521 2018-11-09  Zalan Bujtas  <zalan@apple.com>
2522
2523         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
2524         https://bugs.webkit.org/show_bug.cgi?id=191078
2525         <rdar://problem/45736178>
2526
2527         Reviewed by Antti Koivisto.
2528
2529         1. Improve visuallyNonEmpty milestone confidence level.
2530             Ignore whitespace and non visible text content.
2531             Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
2532             Check if the html/body is actually visible.
2533
2534         2. Issue initial paint soon after the milestone fires.
2535             Use a 0ms timer to flush the initial paint.
2536             Throttle additional flushes for 500ms and 1.5s (original behaviour).
2537
2538         3. Suspend optional style recalcs and layouts while painting is being throttled.
2539            When parsing yields we initiate a 0ms style recalc/layout timer.
2540            These optional layouts produce content that we have no intention to paint. 
2541
2542         * dom/Document.cpp:
2543         (WebCore::Document::scheduleStyleRecalc):
2544         (WebCore::Document::shouldScheduleLayout):
2545         * page/ChromeClient.h:
2546         * page/FrameView.cpp:
2547         (WebCore::FrameView::resetLayoutMilestones):
2548         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
2549         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
2550         (WebCore::FrameView::updateIsVisuallyNonEmpty):
2551         * page/FrameView.h:
2552         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
2553         * platform/graphics/FontCascade.h:
2554         * rendering/RenderText.cpp: Check whether the text is actually visible at this point.
2555         (WebCore::RenderText::RenderText):
2556
2557 2018-11-09  John Wilander  <wilander@apple.com>
2558
2559         Add ability to configure document.cookie lifetime cap through user defaults
2560         https://bugs.webkit.org/show_bug.cgi?id=191480
2561         <rdar://problem/45240871>
2562
2563         Reviewed by Chris Dumez.
2564
2565         No new tests. Existing test makes sure we don't regress.
2566
2567         This change makes the capped lifetime in seconds configurable through
2568         user defaults.
2569
2570         * platform/network/NetworkStorageSession.h:
2571         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2572         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
2573         (WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies): Deleted.
2574             Renamed setAgeCapForClientSideCookies().
2575         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2576         (WebCore::filterCookies):
2577         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
2578
2579 2018-11-09  Ryan Haddad  <ryanhaddad@apple.com>
2580
2581         Unreviewed, rolling out r238047.
2582
2583         Introduced layout test failures on iOS simulator.
2584
2585         Reverted changeset:
2586
2587         "[iOS] Draw caps lock indicator in password fields"
2588         https://bugs.webkit.org/show_bug.cgi?id=190565
2589         https://trac.webkit.org/changeset/238047
2590
2591 2018-11-09  Tim Horton  <timothy_horton@apple.com>
2592
2593         Normal-flow-only flex items don't correctly respect z-index
2594         https://bugs.webkit.org/show_bug.cgi?id=191486
2595
2596         Reviewed by Simon Fraser.
2597
2598         Test: css3/flexbox/z-index-with-normal-flow-only.html
2599
2600         * rendering/RenderLayer.cpp:
2601         (WebCore::canCreateStackingContext):
2602         r125693 did not ensure that flex items which would otherwise be
2603         normal-flow-only would be put into the z-order tree when necessary.
2604         Fix by respecting the same trigger we use to make layers for flex items;
2605         namely, not having auto z-index.
2606
2607 2018-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2608
2609         [Cocoa] Implement SPI on WKWebView to increase and decrease list levels
2610         https://bugs.webkit.org/show_bug.cgi?id=191471
2611         <rdar://problem/45952472>
2612
2613         Reviewed by Tim Horton.
2614
2615         Add new method stubs for changing the list type for the current selection (to be implemented in a future patch).
2616
2617         * editing/Editor.cpp:
2618         (WebCore::Editor::canChangeSelectionListType):
2619         (WebCore::Editor::changeSelectionListType):
2620         * editing/Editor.h:
2621
2622 2018-11-09  Keith Rollin  <krollin@apple.com>
2623
2624         Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
2625
2626         Remove the use of .xcfilelists until their side-effects are better
2627         understood.
2628
2629         * WebCore.xcodeproj/project.pbxproj:
2630
2631 2018-11-09  Jer Noble  <jer.noble@apple.com>
2632
2633         SourceBuffer throws an error when appending a second init segment after changeType().
2634         https://bugs.webkit.org/show_bug.cgi?id=191474
2635
2636         Reviewed by Eric Carlson.
2637
2638         Test: media/media-source/media-source-changetype-second-init.html
2639
2640         When encountering an initialization segment after changeType(), add the parsed codec types
2641         to the list of allowed codecs.
2642
2643         * Modules/mediasource/SourceBuffer.cpp:
2644         (WebCore::SourceBuffer::validateInitializationSegment):
2645         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2646         (WebCore::MockMediaPlayerMediaSource::supportsType):
2647         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2648         (WebCore::MockSourceBufferPrivate::canSwitchToType):
2649         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2650
2651 2018-11-09  Eric Carlson  <eric.carlson@apple.com>
2652
2653         [MediaStream] AVVideoCaptureSource reports incorrect size when frames are scaled
2654         https://bugs.webkit.org/show_bug.cgi?id=191479
2655         <rdar://problem/45952201>
2656
2657         Reviewed by Jer Noble.
2658
2659         No new tests, tested manually.
2660
2661         * platform/mediastream/RealtimeVideoSource.cpp:
2662         (WebCore::RealtimeVideoSource::standardVideoSizes): Drive-by fix: add a few more standard
2663         video frame sizes, correct a typo.
2664         (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): Drive-by fix: don't consider
2665         rescaled sized when we already have an exact or aspect ratio match because it won't be used.
2666
2667         * platform/mediastream/mac/AVVideoCaptureSource.h:
2668         (WebCore::AVVideoCaptureSource::width const): Deleted.
2669         (WebCore::AVVideoCaptureSource::height const): Deleted.
2670         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2671         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): Delete m_requestedSize.
2672         (WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete m_width and m_height.
2673         (WebCore::AVVideoCaptureSource::processNewFrame): Don't call setSize with captured size,
2674         the frame may be resized before deliver.
2675
2676 2018-11-09  Ross Kirsling  <ross.kirsling@sony.com>
2677
2678         Unreviewed MSVC build fix after r238039 (and r238046).
2679
2680         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2681         * bindings/js/JSWorkerGlobalScopeBase.h:
2682
2683 2018-11-09  Basuke Suzuki  <basuke.suzuki@sony.com>
2684
2685         [Curl][WebKit] Implement Proxy configuration API.
2686         https://bugs.webkit.org/show_bug.cgi?id=189053
2687
2688         Reviewed by Youenn Fablet.
2689
2690         Added API to set proxy from the app.
2691
2692         No new tests because there's no behaviour change in WebCore.
2693
2694         * platform/network/NetworkStorageSession.h:
2695         * platform/network/curl/CurlContext.h:
2696         (WebCore::CurlContext::setProxySettings):
2697         * platform/network/curl/CurlProxySettings.h:
2698         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2699         (WebCore::NetworkStorageSession::setProxySettings const):
2700
2701 2018-11-09  Antti Koivisto  <antti@apple.com>
2702
2703         Use OptionSet for layout milestones
2704         https://bugs.webkit.org/show_bug.cgi?id=191470
2705
2706         Reviewed by Dean Jackson.
2707
2708         * WebCore.xcodeproj/project.pbxproj:
2709         * loader/EmptyFrameLoaderClient.h:
2710         * loader/FrameLoader.cpp:
2711         (WebCore::FrameLoader::didReachLayoutMilestone):
2712         * loader/FrameLoader.h:
2713         * loader/FrameLoaderClient.h:
2714         * page/FrameView.cpp:
2715         (WebCore::FrameView::FrameView):
2716         (WebCore::FrameView::addPaintPendingMilestones):
2717         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
2718         (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
2719         * page/FrameView.h:
2720         * page/LayoutMilestone.h: Copied from Source/WebCore/page/LayoutMilestones.h.
2721
2722         Renamed to appease WK2 IPC code generation.
2723
2724         * page/LayoutMilestones.h: Removed.
2725         * page/Page.cpp:
2726         (WebCore::Page::addLayoutMilestones):
2727         (WebCore::Page::removeLayoutMilestones):
2728         (WebCore::Page::isCountingRelevantRepaintedObjects const):
2729         * page/Page.h:
2730         (WebCore::Page::requestedLayoutMilestones const):
2731
2732 2018-11-09  Daniel Bates  <dabates@apple.com>
2733
2734         [iOS] Draw caps lock indicator in password fields
2735         https://bugs.webkit.org/show_bug.cgi?id=190565
2736         <rdar://problem/45262343>
2737
2738         Reviewed by Dean Jackson.
2739
2740         Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
2741         fields on iOS more closely match the behavior of password fields on Mac. For now, we only draw the
2742         indicator when caps locks is enabled via the hardware keyboard. We will look to support the software
2743         keyboard in a subsequent commit (see <https://bugs.webkit.org/show_bug.cgi?id=191475>).
2744
2745         The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
2746         In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
2747         Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
2748         WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
2749         the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
2750         web views listen for keyboard availability changes so as to update the the caps lock state when
2751         a hardware keyboard is detached or attached.
2752
2753         * WebCore.xcodeproj/project.pbxproj:
2754         * page/EventHandler.cpp:
2755         (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
2756         so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
2757         (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
2758         * page/EventHandler.h:
2759         * platform/cocoa/KeyEventCocoa.mm:
2760         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
2761         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
2762         * platform/ios/KeyEventIOS.mm:
2763         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
2764         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
2765         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
2766         * platform/ios/WebEvent.h:
2767         * platform/ios/WebEvent.mm:
2768         (+[WebEvent modifierFlags]): Added.
2769         * platform/mac/KeyEventMac.mm:
2770         (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
2771         by both Mac and iOS.
2772         (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
2773         by both Mac and iOS.
2774         * rendering/RenderThemeCocoa.h:
2775         * rendering/RenderThemeCocoa.mm:
2776         (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
2777         * rendering/RenderThemeIOS.h:
2778         * rendering/RenderThemeIOS.mm:
2779         (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
2780         * rendering/RenderThemeMac.h:
2781         * rendering/RenderThemeMac.mm:
2782         (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
2783         shared by both Mac and iOS.
2784
2785 2018-11-09  Chris Dumez  <cdumez@apple.com>
2786
2787         Unreviewed attempt to fix WinCairo build after r238039.
2788
2789         * bindings/js/JSWorkerGlobalScopeBase.h:
2790
2791 2018-11-09  Fujii Hironori  <Hironori.Fujii@sony.com>
2792
2793         Extensions3DOpenGLES.h:  warning: 'blitFramebuffer' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
2794         https://bugs.webkit.org/show_bug.cgi?id=191451
2795
2796         Reviewed by Dean Jackson.
2797
2798         No new tests because there is no behavior change.
2799
2800         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
2801         (WebCore::Extensions3DOpenGLES::setEXTContextLostCallback): Deleted unused method.
2802         * platform/graphics/opengl/Extensions3DOpenGLES.h: Marked 'override'.
2803
2804 2018-11-09  Andy Estes  <aestes@apple.com>
2805
2806         [Payment Request] canMakePayment() should not consider serialized payment method data
2807         https://bugs.webkit.org/show_bug.cgi?id=191432
2808
2809         Reviewed by Dean Jackson.
2810
2811         In https://github.com/w3c/payment-request/pull/806, we're changing the specification of
2812         canMakePayment() to not consider serialized payment method data when deciding if a payment
2813         method is supported. For Apple Pay, this means we resolve to true for
2814         "https://apple.com/apple-pay", even if an ApplePayRequest is omitted or is missing required
2815         fields.
2816
2817         Added test cases to
2818         http/tests/paymentrequest/payment-request-canmakepayment-method.https.html and
2819         http/tests/paymentrequest/payment-request-show-method.https.html.
2820
2821         * Modules/paymentrequest/PaymentRequest.cpp:
2822         (WebCore::PaymentRequest::canMakePayment):
2823
2824 2018-11-09  Andy Estes  <aestes@apple.com>
2825
2826         [Payment Request] PaymentResponse.details should be updated when the user accepts a retried payment
2827         https://bugs.webkit.org/show_bug.cgi?id=191440
2828
2829         Reviewed by Dean Jackson.
2830
2831         PaymentResponse.details was being initialized in the PaymentResponse constructor and never
2832         updated when the user accepts a retried payment. We need to update it.
2833
2834         Added a test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
2835
2836         * Modules/paymentrequest/PaymentRequest.cpp:
2837         (WebCore::PaymentRequest::accept):
2838         * Modules/paymentrequest/PaymentResponse.cpp:
2839         (WebCore::PaymentResponse::PaymentResponse):
2840         (WebCore::PaymentResponse::setDetailsFunction):
2841         * Modules/paymentrequest/PaymentResponse.h:
2842
2843 2018-11-09  Fujii Hironori  <Hironori.Fujii@sony.com>
2844
2845         MediaPlayerPrivateMediaFoundation.h: warning: 'GetService' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
2846         https://bugs.webkit.org/show_bug.cgi?id=191453
2847
2848         Reviewed by Per Arne Vollan.
2849
2850         No new tests because there is no behavior change.
2851
2852         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Marked with 'override' and removed 'virtual'.
2853
2854 2018-11-09  Chris Dumez  <cdumez@apple.com>
2855
2856         Unreviewed attempt to fix internal build on macOS.
2857
2858         'Export' is defined in several headers.
2859
2860         * bindings/js/JSDOMGlobalObject.cpp:
2861         * bindings/js/JSDOMGlobalObject.h:
2862         * bridge/jsc/BridgeJSC.cpp:
2863         * bridge/jsc/BridgeJSC.h:
2864
2865 2018-11-09  Chris Dumez  <cdumez@apple.com>
2866
2867         HTML form validation bubble disappears
2868         https://bugs.webkit.org/show_bug.cgi?id=191418
2869
2870         Reviewed by Simon Fraser.
2871
2872         If we validate a form and find an invalid form control, we'll scroll it into view and show
2873         the validation bubble. However, scrolling the element into view may be an asynchronous
2874         operation, in which case it would discard the validation bubble prematurely because scrolling
2875         hides the validation bubble. To address the issue, we now show the validation message
2876         asynchronously after focusing the element (and potentially scrolling it into view).
2877
2878         Test: fast/forms/scroll-into-view-and-show-validation-message.html
2879
2880         * html/HTMLFormControlElement.cpp:
2881         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
2882
2883 2018-11-09  Brent Fulgham  <bfulgham@apple.com>
2884
2885         [Windows][DirectX] Be more rigors about BeginFigure/EndFigure and Close operations. 
2886         https://bugs.webkit.org/show_bug.cgi?id=191452
2887         <rdar://problem/45933964>
2888
2889         Reviewed by Zalan Bujtas.
2890
2891         Do a better job of balancing the BeginFigure/EndFigure calls in
2892         the PathDirect2D implementation. Failure to do so puts the Geometry sink
2893         into an error state that prevents it from producing drawing output.
2894       
2895
2896         * platform/graphics/Path.h:
2897         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2898         (WebCore::GraphicsContext::drawPath): Flush is needed here.
2899         (WebCore::GraphicsContext::fillPath): Ditto.
2900         (WebCore::GraphicsContext::strokePath): Ditto.
2901         * platform/graphics/win/PathDirect2D.cpp:
2902         (WebCore::Path::drawDidComplete):
2903         (WebCore::Path::closeAnyOpenGeometries):
2904         (WebCore::Path::transform):
2905         (WebCore::Path::openFigureAtCurrentPointIfNecessary):
2906         (WebCore::Path::moveTo):
2907         (WebCore::Path::closeSubpath):
2908
2909 2018-11-09  Jer Noble  <jer.noble@apple.com>
2910
2911         [Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html test
2912         https://bugs.webkit.org/show_bug.cgi?id=191396
2913
2914         Reviewed by Eric Carlson.
2915
2916         When changeType() is called, exempt video and text tracks (in addition to just audio tracks)
2917         from "same codec" requirements.
2918
2919         * Modules/mediasource/SourceBuffer.cpp:
2920         (WebCore::SourceBuffer::validateInitializationSegment):
2921
2922 2018-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2923
2924         REGRESSION(r236365): [GTK] Many form-related tests are failing
2925         https://bugs.webkit.org/show_bug.cgi?id=189993
2926
2927         Reviewed by Michael Catanzaro.
2928
2929         Only the first form data element is added to the message body due to a return added by mistake in r236365.
2930
2931         * platform/network/soup/ResourceRequestSoup.cpp:
2932         (WebCore::ResourceRequest::updateSoupMessageBody const): Remove return.
2933
2934 2018-11-09  Zalan Bujtas  <zalan@apple.com>
2935
2936         [LFC][IFC] Move some code from InlineFormattingContext::Line to InlineFormattingContext/Geometry
2937         https://bugs.webkit.org/show_bug.cgi?id=191445
2938
2939         Reviewed by Antti Koivisto.
2940
2941         The idea here is that Line should not have to deal with all the post processig tasks like the runs final aligments.
2942         (The line class would eventually turn into a collection of random things).
2943
2944         * layout/inlineformatting/InlineFormattingContext.cpp:
2945         (WebCore::Layout::InlineFormattingContext::closeLine const):
2946         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
2947         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2948         * layout/inlineformatting/InlineFormattingContext.h:
2949         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const):
2950         (WebCore::Layout::InlineFormattingContext::Line::lastRunType const):
2951         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2952         (WebCore::Layout::InlineFormattingContext::Geometry::adjustedLineLogicalLeft):
2953         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
2954         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
2955         * layout/inlineformatting/Line.cpp:
2956         (WebCore::Layout::InlineFormattingContext::Line::Line):
2957         (WebCore::Layout::InlineFormattingContext::Line::init):
2958         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
2959         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
2960         (WebCore::Layout::InlineFormattingContext::Line::close):
2961         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
2962         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight): Deleted.
2963         (WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities): Deleted.
2964         (WebCore::Layout::InlineFormattingContext::Line::justifyRuns): Deleted.
2965
2966 2018-11-09  Philippe Normand  <pnormand@igalia.com>
2967
2968         Unreviewed, GStreamer build warning fix
2969
2970         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2971         (WebCore::GStreamerVideoEncoder::newSampleCallback): Timesamp()
2972         returns a uint32_t, fix format string accordingly.
2973
2974 2018-11-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
2975
2976         Add an SPI to allow WebView clients to add additional supported image formats
2977         https://bugs.webkit.org/show_bug.cgi?id=190454
2978
2979         Reviewed by Simon Fraser.
2980
2981         Add an SPI to allow additional supported image formats in WebView. These
2982         additional formats can be set in the WKWebViewConfiguration as an NSArray
2983         of NStrings. Each string represents an image source type aka UTI.
2984
2985         The ImageSourceType in the functions' names will be replaced by ImageType.
2986         ImageType in this context is the image UTI (Uniform Type Identifier).
2987
2988         * platform/MIMETypeRegistry.cpp:
2989         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
2990         (WebCore::MIMETypeRegistry::additionalSupportedImageMIMETypes):
2991         (WebCore::supportedImageMIMETypesForEncoding):
2992         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
2993         * platform/MIMETypeRegistry.h:
2994         * platform/graphics/cg/ImageDecoderCG.cpp:
2995         (WebCore::ImageDecoderCG::filenameExtension const):
2996         (WebCore::ImageDecoderCG::encodedDataStatus const):
2997         * platform/graphics/cg/ImageSourceCG.h:
2998         * platform/graphics/cg/ImageSourceCGMac.mm:
2999         (WebCore::MIMETypeForImageType):
3000         (WebCore::preferredExtensionForImageType):
3001         (WebCore::MIMETypeForImageSourceType): Deleted.
3002         (WebCore::preferredExtensionForImageSourceType): Deleted.
3003         * platform/graphics/cg/ImageSourceCGWin.cpp:
3004         (WebCore::MIMETypeForImageType):
3005         (WebCore::preferredExtensionForImageType):
3006         (WebCore::MIMETypeForImageSourceType): Deleted.
3007         (WebCore::preferredExtensionForImageSourceType): Deleted.
3008         * platform/graphics/cg/UTIRegistry.cpp:
3009         (WebCore::defaultSupportedImageTypes):
3010         (WebCore::additionalSupportedImageTypes):
3011         (WebCore::setAdditionalSupportedImageTypes):
3012         (WebCore::isSupportedImageType):
3013         (WebCore::supportedDefaultImageSourceTypes): Deleted.
3014         (WebCore::isSupportImageSourceType): Deleted.
3015         * platform/graphics/cg/UTIRegistry.h:
3016
3017 2018-11-08  Megan Gardner  <megan_gardner@apple.com>
3018
3019         Adopt Reveal Framework to replace Lookup
3020         https://bugs.webkit.org/show_bug.cgi?id=191097
3021
3022         Reviewed by Tim Horton.
3023
3024         Reveal is not currently testable.
3025
3026         The Reveal framework does the same job as Lookup and DataDectors.
3027         In this patch we switch from using Lookup to determine what text
3028         to select and define to using Reveal and RVItems. Since this
3029         code needs to work on older systems, and Reveal is newer, we also need
3030         to keep around the old code for old systems so that they can also
3031         continue to work. Eventually we will remove this code and also likly switch
3032         to passing RVItems across from the web process rather than making them
3033         on each side.
3034
3035         * SourcesCocoa.txt:
3036         * WebCore.xcodeproj/project.pbxproj:
3037         * editing/mac/DictionaryLookup.h:
3038         * editing/mac/DictionaryLookup.mm:
3039
3040         Create a delegate to respond to Reveal and help draw the string or highlight.
3041
3042         (-[WebRevealHighlight initWithHighlightRect:useDefaultHighlight:attributedString:]):
3043         (-[WebRevealHighlight setClearTextIndicator:]):
3044         (-[WebRevealHighlight revealContext:rectsForItem:]):
3045         (-[WebRevealHighlight revealContext:drawRectsForItem:]):
3046         (-[WebRevealHighlight revealContext:shouldUseDefaultHighlightForItem:]):
3047         (-[WebRevealHighlight revealContext:stopHighlightingItem:]):
3048         (WebCore::showPopupOrCreateAnimationController):
3049
3050         Unify the code paths and utalize the Reveal framework to create and/or display the popovers.
3051
3052         (WebCore::DictionaryLookup::showPopup):
3053         (WebCore::DictionaryLookup::animationControllerForPopup):
3054
3055         Pipe the new callback through.
3056
3057         (WebCore::tokenRange): Deleted.
3058
3059         Only used with Lookup
3060
3061         (WebCore::selectionContainsPosition): Deleted.
3062
3063         Only used with Lookup.
3064
3065         * editing/mac/DictionaryLookupLegacy.mm: Copied from Source/WebCore/editing/mac/DictionaryLookup.mm.
3066
3067         Keep a copy of the previous implementation of DictionaryLookup, because Reveal not available on older
3068         system.
3069
3070         (WebCore::tokenRange):
3071         (WebCore::selectionContainsPosition):
3072         (WebCore::expandSelectionByCharacters):
3073         (WebCore::showPopupOrCreateAnimationController):
3074         (WebCore::DictionaryLookup::showPopup):
3075         (WebCore::DictionaryLookup::hidePopup):
3076         (WebCore::DictionaryLookup::animationControllerForPopup):
3077
3078 2018-11-08  Keith Rollin  <krollin@apple.com>
3079
3080         Create .xcfilelist files
3081         https://bugs.webkit.org/show_bug.cgi?id=191324
3082         <rdar://problem/45852819>
3083
3084         Reviewed by Alex Christensen.
3085
3086         As part of preparing for enabling XCBuild, create and use .xcfilelist
3087         files. These files are using during Run Script build phases in an
3088         Xcode project. If a Run Script build phase produces new files that are
3089         used later as inputs to subsequent build phases, XCBuild needs to know
3090         about these files. These files can be either specified in an "output
3091         files" section of the Run Script phase editor, or in .xcfilelist files
3092         that are associated with the Run Script build phase.
3093
3094         This patch takes the second approach. It consists of three sets of changes:
3095
3096         - Modify the DerivedSources.make files to have a
3097           'print_all_generated_files" target that produces a list of the files
3098           they create.
3099
3100         - Create a shell script that produces .xcfilelist files from the
3101           output of the previous step, as well as for the files created in the
3102           Generate Unified Sources build steps.
3103
3104         - Add the new .xcfilelist files to the associated projects.
3105
3106         Note that, with these changes, the Xcode workspace and projects can no
3107         longer be fully loaded into Xcode 9. Xcode will attempt to load the
3108         projects that have .xcfilelist files associated with them, but will
3109         fail and display a placeholder for those projects instead. It's
3110         expected that all developers are using Xcode 10 by now and that not
3111         being able to load into Xcode 9 is not a practical issue. Keep in mind
3112         that this is strictly an IDE issue, and that the projects can still be
3113         built with `xcodebuild`.
3114
3115         Also note that the shell script that creates the .xcfilelist files can
3116         also be used to verify that the set of files that's currently checked
3117         in is up-to-date. This checking can be used as part of a check-in hook
3118         or part of check-webkit-style to sooner catch cases where the
3119         .xcfilelist files need to be regenerated.
3120
3121         No new tests -- no changed functionality.
3122
3123         * DerivedSources.make:
3124         * DerivedSources.xcfilelist: Added.
3125         * UnifiedSources.xcfilelist: Added.
3126         * WebCore.xcodeproj/project.pbxproj:
3127
3128 2018-11-08  Don Olmstead  <don.olmstead@sony.com>
3129
3130         Provide generic implementation of SSLKeyGenerator functions
3131         https://bugs.webkit.org/show_bug.cgi?id=191428
3132
3133         Reviewed by Michael Catanzaro.
3134
3135         No new tests. No change in behavior.
3136
3137         Both SSLKeyGeneratorGLib and SSLKeyGeneratorIOS were stub
3138         implementations. Since <keygen> is deprecated it looks unlikely that
3139         an implementation is actually needed, however an implementation is
3140         needed until support is reomved.
3141
3142         * Sources.txt:
3143         * SourcesCocoa.txt:
3144         * WebCore.xcodeproj/project.pbxproj:
3145         * platform/SSLKeyGenerator.cpp: Added.
3146         (WebCore::getSupportedKeySizes):
3147         (WebCore::signedPublicKeyAndChallengeString):
3148         * platform/SourcesGLib.txt:
3149         * platform/glib/SSLKeyGeneratorGLib.cpp: Removed.
3150         * platform/ios/SSLKeyGeneratorIOS.cpp: Removed.
3151
3152 2018-11-07  Myles C. Maxfield  <mmaxfield@apple.com>
3153
3154         Unprefix text-decoration CSS3 properties
3155         https://bugs.webkit.org/show_bug.cgi?id=127193
3156
3157         Reviewed by Dean Jackson.
3158
3159         The properties are stable, and there is interop.
3160
3161         Test: fast/css3-text/css3-text-decoration/unprefix.html
3162
3163         * css/CSSComputedStyleDeclaration.cpp:
3164         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3165         * css/CSSProperties.json:
3166         * css/StyleResolver.cpp:
3167         (WebCore::shouldApplyPropertyInParseOrder):
3168         (WebCore::isValidVisitedLinkProperty):
3169         * css/parser/CSSParserFastPaths.cpp:
3170         (WebCore::isColorPropertyID):
3171         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3172         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3173         * css/parser/CSSPropertyParser.cpp:
3174         (WebCore::CSSPropertyParser::parseSingleValue):
3175         * editing/cocoa/DataDetection.mm:
3176         (WebCore::DataDetection::detectContentInRange):
3177         * rendering/TextDecorationPainter.cpp:
3178         (WebCore::decorationColor):
3179         * rendering/style/RenderStyle.cpp:
3180         (WebCore::RenderStyle::colorIncludingFallback const):
3181         (WebCore::RenderStyle::visitedDependentColor const):
3182
3183 2018-11-08  Timothy Hatcher  <timothy@apple.com>
3184
3185         Add experimental support for a `supported-color-schemes` CSS property.
3186         https://bugs.webkit.org/show_bug.cgi?id=191319
3187         rdar://problem/45852261
3188
3189         Reviewed by Dean Jackson.
3190
3191         Tests: css-dark-mode/parse-supported-color-schemes.html
3192                css-dark-mode/supported-color-schemes-css.html
3193
3194         * WebCore.xcodeproj/project.pbxproj:
3195         * css/CSSComputedStyleDeclaration.cpp:
3196         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3197         * css/CSSProperties.json:
3198         * css/CSSValueKeywords.in:
3199         * css/StyleBuilderConverter.h:
3200         (WebCore::StyleBuilderConverter::updateSupportedColorSchemes):
3201         (WebCore::StyleBuilderConverter::convertSupportedColorSchemes):
3202         * css/StyleResolver.cpp:
3203         (WebCore::StyleResolver::colorFromPrimitiveValue const):
3204         * css/parser/CSSPropertyParser.cpp:
3205         (WebCore::consumeSupportedColorSchemes):
3206         (WebCore::CSSPropertyParser::parseSingleValue):
3207         * dom/Document.cpp:
3208         (WebCore::Document::resetLinkColor):
3209         (WebCore::Document::resetVisitedLinkColor):
3210         (WebCore::Document::resetActiveLinkColor):
3211         (WebCore::Document::processSupportedColorSchemes):
3212         (WebCore::Document::useDarkAppearance const):
3213         (WebCore::Document::styleColorOptions const):
3214         * dom/Document.h:
3215         * editing/cocoa/WebContentReaderCocoa.mm:
3216         (WebCore::createFragment):
3217         * html/canvas/CanvasRenderingContext2D.cpp:
3218         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
3219         * inspector/InspectorOverlay.cpp:
3220         (WebCore::InspectorOverlay::paint):
3221         * page/FrameView.cpp:
3222         (WebCore::FrameView::useDarkAppearance const):
3223         (WebCore::FrameView::paintScrollCorner):
3224         * platform/mac/DragImageMac.mm:
3225         (WebCore::createDragImageForLink):
3226         * rendering/InlineFlowBox.cpp:
3227         (WebCore::InlineFlowBox::paintBoxDecorations):
3228         * rendering/InlineTextBox.cpp:
3229         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
3230         * rendering/RenderBox.cpp:
3231         (WebCore::RenderBox::paintRootBoxFillLayers):
3232         (WebCore::RenderBox::paintBackground):
3233         * rendering/RenderElement.cpp:
3234         (WebCore::RenderElement::selectionColor const):
3235         (WebCore::RenderElement::selectionBackgroundColor const):
3236         (WebCore::RenderElement::paintFocusRing):
3237         * rendering/RenderImage.cpp:
3238         (WebCore::RenderImage::paintAreaElementFocusRing):
3239         * rendering/RenderLayerBacking.cpp:
3240         (WebCore::RenderLayerBacking::paintContents):
3241         * rendering/RenderLayerCompositor.cpp:
3242         (WebCore::RenderLayerCompositor::paintContents):
3243         * rendering/RenderListBox.cpp:
3244         (WebCore::RenderListBox::paintItemForeground):
3245         (WebCore::RenderListBox::paintItemBackground):
3246         * rendering/RenderObject.cpp:
3247         (WebCore::RenderObject::useDarkAppearance const):
3248         (WebCore::RenderObject::styleColorOptions const):
3249         * rendering/RenderObject.h:
3250         * rendering/RenderTableCell.cpp:
3251         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
3252         * rendering/RenderTheme.cpp:
3253         (WebCore::RenderTheme::paint):
3254         * rendering/RenderTheme.h:
3255         (WebCore::RenderTheme::usingDarkAppearance const): Deleted.
3256         * rendering/RenderThemeMac.h:
3257         * rendering/RenderThemeMac.mm:
3258         (WebCore::RenderThemeMac::documentViewFor const):
3259         (WebCore::RenderThemeMac::adjustMenuListStyle const):
3260         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
3261         (WebCore::RenderThemeMac::paintSliderThumb):
3262         (WebCore::RenderThemeMac::usingDarkAppearance const): Deleted.
3263         * rendering/style/RenderStyle.h:
3264         (WebCore::RenderStyle::supportedColorSchemes const):
3265         (WebCore::RenderStyle::setSupportedColorSchemes):
3266         (WebCore::RenderStyle::initialSupportedColorSchemes):
3267         * rendering/style/RenderStyleConstants.h:
3268         * rendering/style/StyleRareInheritedData.cpp:
3269         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3270         (WebCore::StyleRareInheritedData::operator== const):
3271         * rendering/style/StyleRareInheritedData.h:
3272         * rendering/style/StyleSupportedColorSchemes.h: Added.
3273         (WebCore::StyleSupportedColorSchemes::StyleSupportedColorSchemes):
3274         (WebCore::StyleSupportedColorSchemes::operator== const):
3275         (WebCore::StyleSupportedColorSchemes::operator!= const):
3276         (WebCore::StyleSupportedColorSchemes::isAuto const):
3277         (WebCore::StyleSupportedColorSchemes::isOnly const):
3278         (WebCore::StyleSupportedColorSchemes::colorSchemes const):
3279         (WebCore::StyleSupportedColorSchemes::add):
3280         (WebCore::StyleSupportedColorSchemes::contains const):
3281         (WebCore::StyleSupportedColorSchemes::setAllowsTransformations):
3282         (WebCore::StyleSupportedColorSchemes::allowsTransformations const):
3283         * svg/graphics/SVGImage.cpp:
3284         (WebCore::SVGImage::draw):
3285
3286 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
3287
3288         Web Inspector: Restrict domains at the target level instead of only at the window level
3289         https://bugs.webkit.org/show_bug.cgi?id=191344
3290
3291         Reviewed by Devin Rousso.
3292
3293         * inspector/WorkerInspectorController.cpp:
3294         (WebCore::WorkerInspectorController::WorkerInspectorController):
3295         Remove Inspector domain from workers. It was unused anyways.
3296
3297 2018-11-08  Dean Jackson  <dino@apple.com>
3298
3299         Add a String literal that returns a String
3300         https://bugs.webkit.org/show_bug.cgi?id=191425
3301         <rdar://problem/45914556>
3302
3303         Reviewed by Sam Weinig.
3304
3305         Use _str where possible.
3306
3307         API Test in WPT.
3308
3309         * Modules/fetch/FetchRequest.cpp:
3310         (WebCore::computeReferrer):
3311         * Modules/indexeddb/IDBKeyPath.cpp:
3312         (WebCore::loggingString):
3313         * Modules/webdatabase/OriginLock.cpp:
3314         (WebCore::OriginLock::lockFileNameForPath):
3315         * css/CSSBasicShapes.cpp:
3316         (WebCore::updateCornerRadiusWidthAndHeight):
3317         * html/canvas/WebGL2RenderingContext.cpp:
3318         (WebCore::WebGL2RenderingContext::getParameter):
3319         * html/canvas/WebGLRenderingContext.cpp:
3320         (WebCore::WebGLRenderingContext::getParameter):
3321         * loader/LinkHeader.cpp:
3322         (WebCore::parseParameterValue):
3323         * loader/LinkLoader.cpp:
3324         (WebCore::LinkLoader::preloadIfNeeded):
3325         * page/NavigatorBase.cpp:
3326         (WebCore::NavigatorBase::platform):
3327         * platform/DateComponents.cpp:
3328         (WebCore::DateComponents::toString const):
3329         * platform/mac/PlatformEventFactoryMac.mm:
3330         (WebCore::keyIdentifierForKeyEvent):
3331         * rendering/RenderListMarker.cpp:
3332         (WebCore::RenderListMarker::suffix const):
3333         * rendering/RenderMenuList.cpp:
3334         (RenderMenuList::setText):
3335         * testing/InternalSettings.cpp:
3336         (WebCore::InternalSettings::userInterfaceDirectionPolicy):
3337         (WebCore::InternalSettings::systemLayoutDirection):
3338         * testing/Internals.cpp:
3339         (WebCore::Internals::shadowRootType const):
3340         (WebCore::Internals::getCurrentCursorInfo):
3341
3342 2018-11-08  Jonathan Hammer  <jonathan@e3software.com>
3343
3344         Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove
3345         https://bugs.webkit.org/show_bug.cgi?id=191228
3346         <rdar://problem/45786830>
3347
3348         Reviewed by Wenson Hsieh.
3349
3350         DragController::beginDrag should not call cleanupAfterSystemDrag because
3351         the drag is still in progress even after the call to m_client.beginDrag()
3352         returns. This is in contrast to DragController::doSystemDrag, where the
3353         call to cleanupAfterSystemDrag is appropriate because the drag has
3354         concluded by the time m_client.startDrag() returns.
3355
3356         Test: fast/events/drag-and-drop-move-not-copy.html
3357
3358         * page/DragController.cpp:
3359         (WebCore::DragController::beginDrag):
3360
3361 2018-11-08  Zalan Bujtas  <zalan@apple.com>
3362
3363         [BFC][IFC] InlineFormattingContext::Line::alignRuns() should take care of all the alignments.
3364         https://bugs.webkit.org/show_bug.cgi?id=191414
3365
3366         Reviewed by Antti Koivisto.
3367
3368         * layout/inlineformatting/Line.cpp:
3369         (WebCore::Layout::InlineFormattingContext::Line::close):
3370
3371 2018-11-08  Jiewen Tan  <jiewen_tan@apple.com>
3372
3373         [WebAuthN] Import CTAP device request/response converters from Chromium
3374         https://bugs.webkit.org/show_bug.cgi?id=190784
3375         <rdar://problem/45460333>
3376
3377         Reviewed by Brent Fulgham.
3378
3379         This patch imports Chromium's CTAP device request/response converters:
3380         https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-encoding
3381         1. It directly imports the following files and suit them to WebKit's coding style:
3382         https://cs.chromium.org/chromium/src/device/fido/device_response_converter.cc?l=20&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3383         https://cs.chromium.org/chromium/src/device/fido/device_response_converter.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3384         https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3385         https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3386         https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3387         https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3388         https://cs.chromium.org/chromium/src/device/fido/ctap_request_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3389         https://cs.chromium.org/chromium/src/device/fido/ctap_response_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3390         https://cs.chromium.org/chromium/src/device/fido/fido_test_data.h?l=1&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
3391         2. It gathers the following methods into DeviceRequestConverter:
3392         CtapGetAssertionRequest::EncodeAsCBOR()
3393         CtapMakeCredentialRequest::EncodeAsCBOR()
3394         PublicKeyCredentialDescriptor::ConvertToCBOR()
3395         PublicKeyCredentialParams::ConvertToCBOR()
3396         PublicKeyCredentialRpEntity::ConvertToCBOR()
3397         PublicKeyCredenti