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