4ae641dc0086048e4835f2da28da081fc4dbbec7
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-20  Zalan Bujtas  <zalan@apple.com>
2
3         [LFC][IFC] Measure run with non-breakable start/end.
4         https://bugs.webkit.org/show_bug.cgi?id=191850
5
6         Reviewed by Antti Koivisto.
7
8         Line breaking needs to know the complete width of the run including padding etc.
9
10         * layout/Verification.cpp:
11         (WebCore::Layout::collectFlowBoxSubtree):
12         (WebCore::Layout::collectInlineBoxes):
13         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
14         * layout/inlineformatting/InlineFormattingContext.cpp:
15         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
16         * layout/inlineformatting/InlineFormattingContext.h:
17         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
18         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
19         * layout/inlineformatting/InlineLineBreaker.cpp:
20         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
21         (WebCore::Layout::InlineLineBreaker::runWidth const):
22         (WebCore::Layout::InlineLineBreaker::textWidth const):
23         * layout/inlineformatting/InlineLineBreaker.h:
24         * layout/inlineformatting/text/TextUtil.cpp:
25         (WebCore::Layout::TextUtil::hyphenPositionBefore):
26         (WebCore::Layout::TextUtil::width):
27         (WebCore::Layout::TextUtil::fixedPitchWidth):
28         (WebCore::Layout::TextUtil::TextUtil): Deleted.
29         (WebCore::Layout::TextUtil::width const): Deleted.
30         (WebCore::Layout::TextUtil::hyphenPositionBefore const): Deleted.
31         (WebCore::Layout::TextUtil::textWidth const): Deleted.
32         (WebCore::Layout::TextUtil::fixedPitchWidth const): Deleted.
33         * layout/inlineformatting/text/TextUtil.h:
34
35 2018-11-20  Zalan Bujtas  <zalan@apple.com>
36
37         [LFC][IFC] InlineFormattingContext::Line should hold the list of runs for the current line.
38         https://bugs.webkit.org/show_bug.cgi?id=191845
39
40         Reviewed by Antti Koivisto.
41
42         Collect the runs in InlineFormattingContext::Line and transfer them to InlineFormattingState during line closing.
43         (In the most common cases, this is only one extra vector::append() call.)
44
45         * layout/inlineformatting/InlineFormattingContext.cpp:
46         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
47         (WebCore::Layout::InlineFormattingContext::createFinalRuns const):
48         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
49         (WebCore::Layout::InlineFormattingContext::closeLine const):
50         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
51         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
52         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
53         (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const): Deleted.
54         * layout/inlineformatting/InlineFormattingContext.h:
55         (WebCore::Layout::InlineFormattingContext::Line::hasContent const):
56         (WebCore::Layout::InlineFormattingContext::Line::runs):
57         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
58         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
59         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
60         (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns):
61         * layout/inlineformatting/Line.cpp:
62         (WebCore::Layout::InlineFormattingContext::Line::init):
63         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
64         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
65         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
66         (WebCore::Layout::InlineFormattingContext::Line::close):
67         (WebCore::Layout::InlineFormattingContext::Line::Line): Deleted.
68
69 2018-11-20  Zalan Butjas  <zalan@apple.com>
70
71         [LFC][IFC] Introduce InlineItem::nonBreakableStart/End
72         https://bugs.webkit.org/show_bug.cgi?id=191839
73
74         Reviewed by Antti Koivisto.
75
76         Non-breakable start/end marks margin/padding/border space (even when it does not directly come from the associated layout box)
77
78         <span style="padding: 5px"><span>nested content with padding parent</span</span>
79         <nested content with padding parent> <- inline run has 5px non-breakable start/end.
80
81         <span style="border: 5px solid green"><span style="padding-right: 10px; margin-right: 1px">1</span>2</span><span>    3</span>
82         <1> <- inline run has 5px non-breakable start and 11px non-breakable end.
83         <2> <- inline run has 0px non-breakable start and 5px non-breakable end.
84         <3> <- no non-breakable values.
85
86         This is what the runs look like (input to line breaking)
87         <     1           2     >
88         < > (whitespace)
89         <3>
90         The line breaking treats the paddding/border etc space as part of the run and as non-breaking opportunity.
91         With the given runs the first position where we can break the line is at the whitespace.
92
93         * layout/inlineformatting/InlineFormattingContext.cpp:
94         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
95         * layout/inlineformatting/InlineItem.h:
96         (WebCore::Layout::InlineItem::nonBreakableStart const):
97         (WebCore::Layout::InlineItem::nonBreakableEnd const):
98         (WebCore::Layout::InlineItem::addNonBreakableStart):
99         (WebCore::Layout::InlineItem::addNonBreakableEnd):
100
101 2018-11-20  Zalan Bujtas  <zalan@apple.com>
102
103         [LFC][IFC] Move detaching rules from InlineFormattingState to InlineItem
104         https://bugs.webkit.org/show_bug.cgi?id=191838
105
106         Reviewed by Antti Koivisto.
107
108         This is in preparation for adding more context to InlineItem. In addition to
109         detaching rules it will also hold non-breakable start/end information.
110
111         * layout/inlineformatting/InlineFormattingContext.cpp:
112         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
113         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
114         * layout/inlineformatting/InlineFormattingState.cpp:
115         (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
116         (WebCore::Layout::InlineFormattingState::detachingRules const): Deleted.
117         * layout/inlineformatting/InlineFormattingState.h:
118         (WebCore::Layout::InlineFormattingState::setDetachingRules): Deleted.
119         * layout/inlineformatting/InlineItem.h:
120         (WebCore::Layout::InlineItem::addDetachingRule):
121         (WebCore::Layout::InlineItem::detachingRules const):
122
123 2018-11-20  Zalan Bujjtas  <zalan@apple.com>
124
125         [LFC][IFC] InlineRunProvider::append() should just take const InlineItem&.
126         https://bugs.webkit.org/show_bug.cgi?id=191837
127
128         Reviewed by Antti Koivisto.
129
130         This allows us to remove the InlineFormattingState dependency as well.
131
132         * layout/inlineformatting/InlineFormattingContext.cpp:
133         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
134         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
135         * layout/inlineformatting/InlineRunProvider.cpp:
136         (WebCore::Layout::InlineRunProvider::InlineRunProvider):
137         (WebCore::Layout::InlineRunProvider::append):
138         * layout/inlineformatting/InlineRunProvider.h:
139
140 2018-11-20  Thibault Saunier  <tsaunier@igalia.com>
141
142         [GStreamer] Enhance debugging by making sure to print the pipeline in MediaPlayerPrivateGStreamer
143         https://bugs.webkit.org/show_bug.cgi?id=191586
144
145         Reviewed by Xabier Rodriguez-Calvar.
146
147         This is minor changes that do not require tests.
148
149         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
150         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
151         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
152         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
153         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
154         (WebCore::MediaPlayerPrivateGStreamer::commitLoad):
155         (WebCore::MediaPlayerPrivateGStreamer::readyTimerFired):
156         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
157         (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
158         (WebCore::MediaPlayerPrivateGStreamer::play):
159         (WebCore::MediaPlayerPrivateGStreamer::pause):
160         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
161         (WebCore::MediaPlayerPrivateGStreamer::seek):
162         (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
163         (WebCore::MediaPlayerPrivateGStreamer::paused const):
164         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
165         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
166         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
167         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
168         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
169         (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
170         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
171         (WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const):
172         (WebCore::MediaPlayerPrivateGStreamer::totalBytes const):
173         (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
174         (WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback):
175         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
176         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
177         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
178         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
179         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
180         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
181         (WebCore::MediaPlayerPrivateGStreamer::setPreload):
182         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
183
184 2018-11-20  Manuel Rego Casasnovas  <rego@igalia.com>
185
186         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
187         https://bugs.webkit.org/show_bug.cgi?id=191656
188
189         Reviewed by Javier Fernandez.
190
191         We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
192         that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
193         but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
194
195         The patch modifies the method so it takes into account scrollbar size
196         in order to compute the position of the columns/rows depending on the direction and the writing mode.
197
198         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
199                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
200                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
201
202         * rendering/RenderGrid.cpp:
203         (WebCore::RenderGrid::populateGridPositionsForDirection):
204
205 2018-11-19  Ryosuke Niwa  <rniwa@webkit.org>
206
207         Click on node assigned to slot in button's shadow cause loss of button focus
208         https://bugs.webkit.org/show_bug.cgi?id=191694
209         <rdar://problem/46107920>
210
211         Reviewed by Wenson Hsieh.
212
213         Fixed the bug by traversing the parent in the composed tree when looking for an element to focus.
214
215         Test: fast/shadow-dom/focus-slot-parent.html
216
217         * page/EventHandler.cpp:
218         (WebCore::EventHandler::dispatchMouseEvent): Fixed the bug. Also use RefPtr instead of a raw pointer.
219
220 2018-11-19  Fujii Hironori  <Hironori.Fujii@sony.com>
221
222         REGRESSION(r238350) [curl] CertificateInfo.h: error: template specialization requires 'template<>'
223         https://bugs.webkit.org/show_bug.cgi?id=191849
224
225         Unreviewed build fix for clang-cl builds.
226
227         No new tests because there's no behaviour change.
228
229         * platform/network/curl/CertificateInfo.h:
230         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
231         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
232
233 2018-11-19  Basuke Suzuki  <basuke.suzuki@sony.com>
234
235         [Curl] Add API for CertificateInfo.
236         https://bugs.webkit.org/show_bug.cgi?id=191647
237
238         Reviewed by Alex Christensen.
239
240         Minor changes for WebKit API.
241
242         Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp
243
244         * platform/network/curl/CertificateInfo.h:
245         * platform/network/curl/CertificateInfoCurl.cpp:
246         (WebCore::CertificateInfo::CertificateInfo):
247         (WebCore::CertificateInfo::makeCertificate):
248         * platform/network/curl/CurlSSLVerifier.cpp:
249         (WebCore::BIOHolder::asCertificate):
250
251 2018-11-19  Justin Fan  <justin_fan@apple.com>
252
253         [WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormatEnum, and WebGPUSwapChain::configure upgrades
254         https://bugs.webkit.org/show_bug.cgi?id=191794
255
256         Reviewed by Dean Jackson.
257
258         Test: webgpu/textures-textureviews.html
259
260         Implement basic functionality for getting the next WebGPUTexture and TextureView from the WebGPURenderingContext
261         to use as a render destination for the next draw call. Also introduce WebGPUTextureFormatEnum and the ability to 
262         configure the context with a chosen texture format. 
263
264         * CMakeLists.txt:
265         * DerivedSources.make:
266         * Modules/webgpu/GPUSwapChain.h: Texture/Pixel format can now be set.
267         * Modules/webgpu/GPUTexture.h: Added. Interface to a MTLTexture.
268         * Modules/webgpu/GPUTextureFormatEnum.h: Added.
269         * Modules/webgpu/WebGPUDevice.cpp:
270         (WebCore::WebGPUDevice::createRenderPipeline const): Removed now-unnecessary enum class cast.
271         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Rather than duplicate GPURenderPipelineDescriptor::PrimitiveTopology, alias to it.
272         * Modules/webgpu/WebGPUSwapChain.cpp:
273         (WebCore::WebGPUSwapChain::configure): Can now specify a specific texture format for the underlying CAMetalLayer.
274         (WebCore::WebGPUSwapChain::getNextTexture): Added. Request the next drawable texture.
275         * Modules/webgpu/WebGPUSwapChain.h: Expose getNextTexture().
276         * Modules/webgpu/WebGPUSwapChain.idl:
277         * Modules/webgpu/WebGPUTexture.cpp: Added. 
278         (WebCore::WebGPUTexture::create):
279         (WebCore::WebGPUTexture::WebGPUTexture):
280         (WebCore::WebGPUTexture::createDefaultTextureView):
281         * Modules/webgpu/WebGPUTexture.h: Added.
282         * Modules/webgpu/WebGPUTexture.idl: Added.
283         * Modules/webgpu/WebGPUTextureFormatEnum.h: Added. Type alias for GPUTextureFormatEnum.
284         * Modules/webgpu/WebGPUTextureFormatEnum.idl: Added. Used to represent any texture format used by WebGPU.
285         * Modules/webgpu/WebGPUTextureView.cpp: Added.
286         (WebCore::WebGPUTextureView::create):
287         (WebCore::WebGPUTextureView::WebGPUTextureView):
288         * Modules/webgpu/WebGPUTextureView.h: Added.
289         * Modules/webgpu/WebGPUTextureView.idl: Added.
290         * Modules/webgpu/cocoa/GPUSwapChainMetal.mm: 
291         (WebCore::GPUSwapChain::create):
292         (WebCore::GPUSwapChain::setFormat): Called by WebGPUSwapChain::configure().
293         (WebCore::GPUSwapChain::getNextTexture):
294         * Modules/webgpu/cocoa/GPUTextureFormatEnumMetal.mm: Added.
295         (WebCore::convertAndValidate): Convert the WebGPUTextureFormatEnum to a MTLPixelFormat.
296         * Modules/webgpu/cocoa/GPUTextureMetal.mm: Added.
297         (WebCore::GPUTexture::create):
298         (WebCore::GPUTexture::GPUTexture):
299         (WebCore::GPUTexture::createDefaultTextureView): Uses the pixelFormat of the original texture.
300         * Sources.txt:
301         * SourcesCocoa.txt:
302         * WebCore.xcodeproj/project.pbxproj:
303         * bindings/js/WebCoreBuiltinNames.h:
304
305 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
306
307         Web Inspector: "Reload Web Inspector" button no longer partially works
308         https://bugs.webkit.org/show_bug.cgi?id=191773
309         <rdar://problem/46139932>
310
311         Reviewed by Devin Rousso.
312
313         * inspector/InspectorFrontendClient.h:
314         * inspector/InspectorFrontendHost.cpp:
315         (WebCore::InspectorFrontendHost::reopen):
316         * inspector/InspectorFrontendHost.h:
317         * inspector/InspectorFrontendHost.idl:
318         Provide a host call to reopen an inspector window to reload it.
319
320         * testing/Internals.cpp:
321         Stub implementation, this is not used in tests.
322
323 2018-11-19  Rob Buis  <rbuis@igalia.com>
324
325         Setting document.title should have no effect for non SVG/HTML documents
326         https://bugs.webkit.org/show_bug.cgi?id=191643
327
328         Reviewed by Chris Dumez.
329
330         Setting document.title should have no effect for non SVG/HTML documents,
331         see https://html.spec.whatwg.org/multipage/dom.html#document.title.
332
333         Behavior matches Firefox and Chrome.
334
335         Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html
336
337         * dom/Document.cpp:
338         (WebCore::Document::setTitle):
339
340 2018-11-19  Wenson Hsieh  <wenson_hsieh@apple.com>
341
342         Dragging image with a border-image larger than the image element crashes
343         https://bugs.webkit.org/show_bug.cgi?id=191817
344         <rdar://problem/46159222>
345
346         Reviewed by Ryosuke Niwa.
347
348         When dragging an image element, if the image element has:
349
350         (1) box-sizing: border-box;
351         (2) a border-image
352         (3) a border-top-width that is at least as large as the height of the element and/or a border-left-width that is
353             at least as large as the width of the element
354
355         ...then upon drag, we will fail to create a suitable drag image using the bounding box of the image element
356         since the size is empty, thereby causing a crash. To fix this, we bail out of this bounding-rect-dependent
357         codepath for generating a drag image in the case where the bounding rect is empty, and instead fall back to an
358         icon representation for the drag image.
359
360         Test: fast/events/drag-image-with-border-image.html
361
362         * page/DragController.cpp:
363         (WebCore::DragController::doImageDrag):
364
365 2018-11-18  Zan Dobersek  <zdobersek@igalia.com>
366
367         HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap
368         https://bugs.webkit.org/show_bug.cgi?id=191825
369
370         Reviewed by Michael Catanzaro.
371
372         The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry
373         objects is used to map given Unicode codepoints to corresponding
374         glyph indices (which occurs in the harfBuzzGetGlyph() function that's
375         invoked by HarfBuzz).
376
377         The 16-bit unsigned integer as the map's value type is not enough here
378         when the glyph index mapping is done through Freetype -- its API returns
379         32-bit glyph indices, and Cairo assigns this value to the 64-bit
380         unsigned index variable in the cairo_glyph_t struct. The value type is
381         thus bumped to 32 bits to match the unsigned type size of the index's
382         origin.
383
384         * platform/graphics/harfbuzz/HarfBuzzFace.h:
385         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
386
387 2018-11-17  Wenson Hsieh  <wenson_hsieh@apple.com>
388
389         [iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
390         https://bugs.webkit.org/show_bug.cgi?id=191819
391
392         Reviewed by Dan Bernstein.
393
394         Replace UIItemProvider (and related classes) with NSItemProvider.
395
396         * platform/ios/PlatformPasteboardIOS.mm:
397         (WebCore::registerItemToPasteboard):
398         * platform/ios/WebItemProviderPasteboard.h:
399         * platform/ios/WebItemProviderPasteboard.mm:
400         (-[WebItemProviderDataRegistrar registerItemProvider:]):
401         (-[WebItemProviderWritableObjectRegistrar initWithObject:]):
402         (-[WebItemProviderWritableObjectRegistrar representingObject]):
403         (-[WebItemProviderWritableObjectRegistrar registerItemProvider:]):
404         (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
405         (-[WebItemProviderRegistrationInfoList itemProvider]):
406         (-[WebItemProviderPasteboard pasteboardTypes]):
407         (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
408         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
409         (allLoadableClasses):
410         (classForTypeIdentifier):
411         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
412         (-[WebItemProviderPasteboard numberOfFiles]):
413         (-[WebItemProviderPasteboard itemProviderAtIndex:]):
414         (-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
415         * platform/mac/DragDataMac.mm:
416         (WebCore::DragData::containsURL const):
417
418 2018-11-17  Ross Kirsling  <ross.kirsling@sony.com>
419
420         Remove superfluous LayoutUnit initializations
421         https://bugs.webkit.org/show_bug.cgi?id=191791
422
423         Reviewed by Simon Fraser.
424
425         First step toward making LayoutUnit constructors explicit:
426         eliminate `= 0` when constructing LayoutUnit lvalues.
427
428         * editing/Editor.cpp:
429         (WebCore::Editor::firstRectForRange const):
430         * editing/FrameSelection.cpp:
431         (WebCore::FrameSelection::modify):
432         (WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation):
433         * html/shadow/SliderThumbElement.cpp:
434         (WebCore::RenderSliderContainer::computeLogicalHeight const):
435         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
436         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
437         * page/FrameView.cpp:
438         (WebCore::FrameView::forceLayoutForPagination):
439         * page/SpatialNavigation.cpp:
440         (WebCore::scrollInDirection):
441         (WebCore::distanceDataForNode):
442         * rendering/AutoTableLayout.cpp:
443         (WebCore::AutoTableLayout::layout):
444         * rendering/GridTrackSizingAlgorithm.cpp:
445         (WebCore::marginIntrinsicLogicalWidthForChild):
446         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
447         * rendering/InlineFlowBox.cpp:
448         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
449         (WebCore::InlineFlowBox::paintFillLayer):
450         (WebCore::InlineFlowBox::paintBoxDecorations):
451         (WebCore::InlineFlowBox::paintMask):
452         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
453         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
454         * rendering/RenderBlock.cpp:
455         (WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const):
456         (WebCore::RenderBlock::layoutPositionedObject):
457         (WebCore::RenderBlock::selectionGapRectsForRepaint):
458         (WebCore::RenderBlock::paintSelection):
459         (WebCore::RenderBlock::textIndentOffset const):
460         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
461         * rendering/RenderBlockFlow.cpp:
462         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
463         (WebCore::RenderBlockFlow::layoutBlock):
464         (WebCore::RenderBlockFlow::layoutBlockChildren):
465         (WebCore::RenderBlockFlow::marginValuesForChild const):
466         (WebCore::RenderBlockFlow::estimateLogicalTopPosition):
467         (WebCore::RenderBlockFlow::applyBeforeBreak):
468         (WebCore::RenderBlockFlow::applyAfterBreak):
469         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
470         (WebCore::RenderBlockFlow::clearFloats):
471         (WebCore::RenderBlockFlow::lowestFloatLogicalBottom const):
472         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
473         (WebCore::RenderBlockFlow::addOverhangingFloats):
474         (WebCore::RenderBlockFlow::getClearDelta):
475         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
476         * rendering/RenderBlockLineLayout.cpp:
477         (WebCore::setLogicalWidthForTextRun):
478         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
479         (WebCore::RenderBlockFlow::determineStartPosition):
480         * rendering/RenderBox.cpp:
481         (WebCore::RenderBox::fillAvailableMeasure const):
482         (WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const):
483         (WebCore::RenderBox::computeLogicalWidthInFragmentUsing const):
484         (WebCore::RenderBox::computePercentageLogicalHeight const):
485         (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
486         (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
487         (WebCore::RenderBox::computePositionedLogicalHeightUsing const):
488         (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
489         (WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
490         * rendering/RenderBoxModelObject.cpp:
491         (WebCore::RenderBoxModelObject::computedCSSPadding const):
492         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
493         * rendering/RenderDeprecatedFlexibleBox.cpp:
494         (WebCore::marginWidthForChild):
495         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
496         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
497         * rendering/RenderFileUploadControl.cpp:
498         (WebCore::RenderFileUploadControl::paintObject):
499         * rendering/RenderFragmentedFlow.cpp:
500         (WebCore::RenderFragmentedFlow::validateFragments):
501         (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
502         (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
503         * rendering/RenderFrameSet.cpp:
504         (WebCore::RenderFrameSet::paint):
505         * rendering/RenderListItem.cpp:
506         (WebCore::RenderListItem::positionListMarker):
507         * rendering/RenderListMarker.cpp:
508         (WebCore::RenderListMarker::computePreferredLogicalWidths):
509         (WebCore::RenderListMarker::updateMargins):
510         * rendering/RenderMultiColumnSet.cpp:
511         (WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const):
512         * rendering/RenderRubyRun.cpp:
513         (WebCore::RenderRubyRun::layoutBlock):
514         * rendering/RenderTable.cpp:
515         (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
516         (WebCore::RenderTable::layout):
517         (WebCore::RenderTable::offsetWidthForColumn const):
518         (WebCore::RenderTable::offsetHeightForColumn const):
519         (WebCore::RenderTable::outerBorderBefore const):
520         (WebCore::RenderTable::outerBorderAfter const):
521         (WebCore::RenderTable::outerBorderStart const):
522         (WebCore::RenderTable::outerBorderEnd const):
523         * rendering/RenderTableCell.cpp:
524         (WebCore::RenderTableCell::logicalWidthFromColumns const):
525         (WebCore::RenderTableCell::computeIntrinsicPadding):
526         * rendering/RenderTableSection.cpp:
527         (WebCore::RenderTableSection::calcRowLogicalHeight):
528         (WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows):
529         (WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows):
530         (WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight):
531         (WebCore::RenderTableSection::layoutRows):
532         (WebCore::RenderTableSection::calcOuterBorderBefore const):
533         (WebCore::RenderTableSection::calcOuterBorderAfter const):
534         (WebCore::RenderTableSection::calcOuterBorderStart const):
535         (WebCore::RenderTableSection::calcOuterBorderEnd const):
536         * rendering/RootInlineBox.cpp:
537         (WebCore::RootInlineBox::alignBoxesInBlockDirection):
538         (WebCore::RootInlineBox::beforeAnnotationsAdjustment const):
539         (WebCore::RootInlineBox::lineSnapAdjustment const):
540         (WebCore::RootInlineBox::verticalPositionForBox):
541         * rendering/line/BreakingContext.h:
542         (WebCore::inlineLogicalWidth):
543         * rendering/mathml/RenderMathMLBlock.cpp:
544         (WebCore::RenderMathMLBlock::layoutItems):
545         * rendering/mathml/RenderMathMLFraction.cpp:
546         (WebCore::RenderMathMLFraction::layoutBlock):
547         * rendering/mathml/RenderMathMLOperator.cpp:
548         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
549         * rendering/mathml/RenderMathMLRoot.cpp:
550         (WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
551         (WebCore::RenderMathMLRoot::paint):
552         * rendering/mathml/RenderMathMLRow.cpp:
553         (WebCore::RenderMathMLRow::computePreferredLogicalWidths):
554         * rendering/mathml/RenderMathMLScripts.cpp:
555         (WebCore::RenderMathMLScripts::layoutBlock):
556         * rendering/mathml/RenderMathMLUnderOver.cpp:
557         (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
558         (WebCore::RenderMathMLUnderOver::layoutBlock):
559         * rendering/style/RenderStyle.cpp:
560         (WebCore::RenderStyle::getShadowInsetExtent const):
561         * rendering/svg/RenderSVGText.cpp:
562         (WebCore::RenderSVGText::layout):
563
564 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
565
566         Avoid triggering compositing updates when only the root layer is composited
567         https://bugs.webkit.org/show_bug.cgi?id=191813
568
569         Reviewed by Zalan Bujtas.
570
571         If we know that the only composited layer is the root, we can avoid triggering deep
572         compositing updates sometimes, for example when layout changes size or position,
573         or when z-order lists change.
574
575         * rendering/RenderLayer.cpp:
576         (WebCore::RenderLayer::addChild):
577         (WebCore::RenderLayer::removeChild):
578         (WebCore::RenderLayer::updateLayerPosition):
579         (WebCore::RenderLayer::scrollTo):
580         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
581         (WebCore::outputPaintOrderTreeRecursive):
582         * rendering/RenderLayerCompositor.cpp:
583         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant()
584         flag to cut off descendants traversal when possible.
585         (WebCore::RenderLayerCompositor::layerStyleChanged):
586
587 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
588
589         Fix an error in 238354 - !=, not ==.
590         
591         Fixes test failures.
592
593         * rendering/RenderLayerCompositor.cpp:
594         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
595
596 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
597
598         Clarify RenderLayerCompositor::hasAnyAdditionalCompositedLayers() and related code.
599         https://bugs.webkit.org/show_bug.cgi?id=191810
600
601         Reviewed by Zalan Bujtas.
602
603         Rename m_compositedLayerCount to m_contentLayersCount and have it track layers other
604         than the RenderView's layer.
605
606         hasAnyAdditionalCompositedLayers() is really about whether we can drop out of compositing
607         because no content layer is composited, and overlays don't require compositing, so
608         rename it.
609
610         * rendering/RenderLayerCompositor.cpp:
611         (WebCore::RenderLayerCompositor::updateCompositingLayers):
612         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
613         (WebCore::RenderLayerCompositor::needsCompositingForContentOrOverlays const):
614         (WebCore::RenderLayerCompositor::layerBecameComposited):
615         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
616         (WebCore::RenderLayerCompositor::layerTreeAsText):
617         (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): Deleted.
618         * rendering/RenderLayerCompositor.h:
619
620 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
621
622         Rename RenderLayerCompositor::inCompositingMode() to usesCompositing()
623         https://bugs.webkit.org/show_bug.cgi?id=191808
624
625         Reviewed by Zalan Bujtas.
626
627         Other code uses "usesCompositing" so standardize on that (future changes will make
628         "compositing mode" more ambiguous). Also remove a FrameView function that only
629         had one caller.
630
631         * page/FrameView.cpp:
632         (WebCore::FrameView::clearBackingStores):
633         (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange):
634         (WebCore::FrameView::delegatesScrollingDidChange):
635         (WebCore::FrameView::hasCompositedContent const): Deleted.
636         * page/FrameView.h:
637         * rendering/RenderLayer.cpp:
638         (WebCore::RenderLayer::addChild):
639         (WebCore::RenderLayer::removeChild):
640         (WebCore::RenderLayer::rebuildZOrderLists):
641         (WebCore::RenderLayer::updateLayerPosition):
642         (WebCore::RenderLayer::scrollTo):
643         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
644         * rendering/RenderLayerCompositor.cpp:
645         (WebCore::RenderLayerCompositor::updateCompositingPolicy):
646         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
647         (WebCore::RenderLayerCompositor::layerStyleChanged):
648         (WebCore::RenderLayerCompositor::updateBacking):
649         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
650         (WebCore::RenderLayerCompositor::setIsInWindow):
651         (WebCore::RenderLayerCompositor::needsToBeComposited const):
652         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
653         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
654         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
655         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
656         * rendering/RenderLayerCompositor.h:
657         * rendering/RenderView.cpp:
658         (WebCore::RenderView::repaintViewAndCompositedLayers):
659         (WebCore::RenderView::usesCompositing const):
660
661 2018-11-17  Devin Rousso  <drousso@apple.com>
662
663         Web Inspector: Network: add button to show system certificate dialog
664         https://bugs.webkit.org/show_bug.cgi?id=191458
665         <rdar://problem/45977019>
666
667         Reviewed by Joseph Pecoraro.
668
669         Test: http/tests/inspector/network/getSerializedCertificate.html
670
671         * inspector/agents/InspectorNetworkAgent.h:
672         * inspector/agents/InspectorNetworkAgent.cpp:
673         (WebCore::InspectorNetworkAgent::getSerializedCertificate): Added.
674
675         * inspector/InspectorFrontendHost.idl:
676         * inspector/InspectorFrontendHost.h:
677         * inspector/InspectorFrontendHost.cpp:
678         (WebCore::InspectorFrontendHost::supportsShowCertificate): Added.
679         (WebCore::InspectorFrontendHost::showCertificate): Added.
680         * inspector/InspectorFrontendClient.h:
681         (InspectorFrontendClient::showCertificate): Added.
682         * testing/Internals.cpp:
683         (InspectorStubFrontend::showCertificate): Added.
684
685         * platform/network/cf/CertificateInfo.h:
686         (WTF::Persistence::encodeCFData): Added.
687         (WTF::Persistence::decodeCFData): Added.
688         (WTF::Persistence::encodeSecTrustRef): Added.
689         (WTF::Persistence::decodeSecTrustRef): Added.
690         (WTF::Persistence::encodeCertificateChain): Added.
691         (WTF::Persistence::decodeCertificateChain): Added.
692         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
693         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
694         * platform/network/cf/CertificateInfoCFNet.cpp:
695         * platform/network/cocoa/CertificateInfoCocoa.mm:
696
697         * platform/network/curl/CertificateInfo.h:
698         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
699         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
700
701         * platform/network/soup/CertificateInfo.h:
702         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode): Added.
703         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Added.
704         (WTF::Persistence::certificatesDataListFromCertificateInfo): Added.
705         (WTF::Persistence::certificateFromCertificatesDataList): Added.
706         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
707         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
708
709 2018-11-17  Zalan Bujtas  <zalan@apple.com>
710
711         [LFC][IFC] InlineFormattingState::addDetachingRule should accumulate rules.
712         https://bugs.webkit.org/show_bug.cgi?id=191801
713
714         Reviewed by Antti Koivisto.
715
716         before<span style="position: relative">positioned</span>after
717         In the example above the <positioned> inline box has both the BreakAtStart and the BreakAtEnd rules.
718         While walking through the inline tree, we add BreakAtStart first and when we figure it's the last child too,
719         we add BreakAtEnd as well. BreakAtEnd should not clear the BreakAtStart rule.
720
721         Test: fast/inline/simple-inline-with-out-of-flow-descendant2.html
722
723         * layout/inlineformatting/InlineFormattingContext.cpp:
724         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
725         * layout/inlineformatting/InlineFormattingState.cpp:
726         (WebCore::Layout::InlineFormattingState::addDetachingRule):
727         * layout/inlineformatting/InlineFormattingState.h:
728         (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
729
730 2018-11-17  Jonathan Hammer  <jonathan@e3software.com>
731
732         Caret stops blinking after context menu shown
733         https://bugs.webkit.org/show_bug.cgi?id=191715
734
735         Reviewed by Ryosuke Niwa.
736
737         Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that
738         the caret continues to blink even after the context menu is dismissed. The normal
739         way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does
740         not apply in the case of context menus because handleMouseReleaseEvent is not
741         called once the context menu is up.
742
743         Test: fast/events/contextmenu-dismiss-blink-caret.html
744
745         * page/EventHandler.cpp:
746         (WebCore::EventHandler::sendContextMenuEvent):
747         * testing/Internals.cpp:
748         (WebCore::Internals::isCaretBlinkingSuspended):
749         * testing/Internals.h:
750         * testing/Internals.idl:
751
752 2018-11-16  Antoine Quint  <graouts@apple.com>
753
754         [Pointer Events] event.isPrimary doesn't always represent the oldest active touch
755         https://bugs.webkit.org/show_bug.cgi?id=191752
756         <rdar://problem/46129270>
757
758         Reviewed by Dean Jackson.
759
760         Provide isPrimary to the constructor so its value can be determined at the call site.
761
762         Test: pointerevents/ios/pointer-events-is-primary.html
763
764         * dom/PointerEvent.h:
765         * dom/ios/PointerEventIOS.cpp:
766         (WebCore::PointerEvent::create):
767         (WebCore::PointerEvent::PointerEvent):
768         (WebCore::m_isPrimary):
769
770 2018-11-16  Alex Christensen  <achristensen@webkit.org>
771
772         Tweak _showSafeBrowsingWarningWithTitle SPI
773         https://bugs.webkit.org/show_bug.cgi?id=191799
774
775         Reviewed by Wenson Hsieh.
776
777         It turns out I needed to expose both sentinel values used in safe browsing for my application of this SPI in Mac Safari.
778         Allowing the caller to make its own sentinel values is insufficient because the malware confirmation needs to be over the warning.
779         The completion handler parameter should just be a bool indicating whether the user has chosen to continue after all warnings.
780
781         Covered by updated API tests.
782
783         * en.lproj/Localizable.strings:
784         * platform/LocalizedStrings.cpp:
785         (WebCore::formControlCancelButtonTitle):
786         Make "Cancel"'s description a little more generic.
787
788 2018-11-16  Simon Fraser  <simon.fraser@apple.com>
789
790         Optimize composited iframe layer hookup
791         https://bugs.webkit.org/show_bug.cgi?id=191778
792
793         Reviewed by Zalan Bujtas.
794
795         The change made in r238229 can be more targeted; we only need to hook up iframe content
796         layers when the layer is already composited (otherwise the updateBacking() above would have triggered
797         the work), and when it's a RenderWidget layer.
798         
799         Tested by existing tests.
800
801         * rendering/RenderLayer.cpp:
802         (WebCore::outputPaintOrderTreeRecursive):
803         * rendering/RenderLayerCompositor.cpp:
804         (WebCore::RenderLayerCompositor::layerStyleChanged):
805
806 2018-11-16  Ross Kirsling  <ross.kirsling@sony.com>
807
808         Provide default implementation of Widget
809         https://bugs.webkit.org/show_bug.cgi?id=191784
810
811         Reviewed by Michael Catanzaro.
812
813         * SourcesWPE.txt:
814         * platform/Widget.cpp:
815         (WebCore::Widget::Widget):
816         (WebCore::Widget::frameRect const):
817         (WebCore::Widget::~Widget):
818         (WebCore::Widget::setFrameRect):
819         (WebCore::Widget::paint):
820         (WebCore::Widget::setFocus):
821         (WebCore::Widget::setCursor):
822         (WebCore::Widget::show):
823         (WebCore::Widget::hide):
824         (WebCore::Widget::setIsSelected):
825         * platform/gtk/WidgetGtk.cpp:
826         (WebCore::Widget::Widget): Deleted.
827         (WebCore::Widget::frameRect const): Deleted.
828         * platform/win/WidgetWin.cpp:
829         (WebCore::Widget::Widget): Deleted.
830         (WebCore::Widget::frameRect const): Deleted.
831         * platform/wpe/WidgetWPE.cpp: Removed.
832
833 2018-11-16  Chris Dumez  <cdumez@apple.com>
834
835         [macOS] Label "prewarmed" WebContent processes in Activity Monitor
836         https://bugs.webkit.org/show_bug.cgi?id=191765
837         <rdar://problem/45953463>
838
839         Reviewed by Geoffrey Garen.
840
841         * en.lproj/Localizable.strings:
842
843 2018-11-16  Jeremy Jones  <jeremyj@apple.com>
844
845         Enable external playback for video in element fullscreen.
846         https://bugs.webkit.org/show_bug.cgi?id=190359
847         rdar://problem/42560085
848
849         Reviewed by Jer Noble.
850
851         No new tests because we don't have a good way to test external playback.
852
853         Any video that might be auto-pipped from element fullscreen should also enable external playback for video out.
854         PiP and external playback are mutually exclusive. Instead of preventing PiP when external playback is active,
855         allow PiP, but disable external playback while PiP is active.
856
857         * html/HTMLMediaElement.cpp:
858         (WebCore::HTMLMediaElement::setVideoFullscreenStandby):
859         * html/HTMLMediaElement.h:
860         * platform/graphics/MediaPlayer.cpp:
861         (WebCore::MediaPlayer::setVideoFullscreenStandby):
862         (WebCore::MediaPlayer::videoFullscreenStandby const):
863         * platform/graphics/MediaPlayer.h:
864         (WebCore::MediaPlayerClient::mediaPlayerVideoFullscreenStandby const):
865         * platform/graphics/MediaPlayerPrivate.h:
866         (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenStandby):
867         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
868         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenStandby):
869         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
870
871 2018-11-16  Jer Noble  <jer.noble@apple.com>
872
873         Regression(r233865): Causes synchronous IPC in the middle of layout
874         https://bugs.webkit.org/show_bug.cgi?id=188307
875         <rdar://problem/42807306>
876
877         Reviewed by Eric Carlson.
878
879         Revert the changes added in r233865. Rather than make a syncronous call to the UIProcess to
880         query whether the view has been backgrounded while (e.g.) JS has been spinning, perform the
881         steps of the requestFullscreen() method on the next run loop, allowing messages from the
882         UIProcess about page visibilty to be delivered first.
883
884         * dom/Document.cpp:
885         (WebCore::Document::requestFullScreenForElement):
886         * html/HTMLMediaElement.cpp:
887         (WebCore::HTMLMediaElement::enterFullscreen):
888         * html/HTMLMediaElement.h:
889         * page/ChromeClient.h:
890
891 2018-11-16  Ross Kirsling  <ross.kirsling@sony.com>
892
893         Provide default implementation of Cursor
894         https://bugs.webkit.org/show_bug.cgi?id=191772
895
896         Reviewed by Michael Catanzaro.
897
898         * SourcesWPE.txt:
899         * platform/Cursor.cpp:
900         (WebCore::Cursor::ensurePlatformCursor const):
901         * platform/wpe/CursorWPE.cpp: Removed.
902
903 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
904
905         EditorWPE should be EditorLibWPE
906         https://bugs.webkit.org/show_bug.cgi?id=191774
907
908         Reviewed by Michael Catanzaro.
909
910         The platform specific implementations of Editor are all around the
911         platform's Pasteboard. Since the Pasteboard implementation is now based
912         around USE(LIBWPE) EditorWPE should be renamed to EditorLibWPE.
913
914         * SourcesWPE.txt:
915         * editing/libwpe/EditorLibWPE.cpp: Renamed from Source/WebCore/editing/wpe/EditorWPE.cpp.
916
917 2018-11-16  Jeremy Jones  <jeremyj@apple.com>
918
919         Include AirPlay destination name in AirPlay placard.
920         https://bugs.webkit.org/show_bug.cgi?id=191574
921         rdar://problem/45536144
922
923         Reviewed by Eric Carlson.
924
925         Updated existing tests.
926
927         Include the name of the AirPlay destination in the video element's AirPlay placard.
928
929         * Modules/modern-media-controls/controls/airplay-placard.js:
930         (AirplayPlacard):
931         * Modules/modern-media-controls/controls/placard.js:
932         * Modules/modern-media-controls/media/placard-support.js:
933         (PlacardSupport.prototype._updatePlacard):
934         (PlacardSupport.prototype._updateAirPlayPlacard):
935         (PlacardSupport):
936         * en.lproj/modern-media-controls-localized-strings.js:
937
938 2018-11-16  Zalan Bujtas  <zalan@apple.com>
939
940         Add DidFirstMeaningfulPaint milestone.
941         https://bugs.webkit.org/show_bug.cgi?id=191754
942
943         Reviewed by Simon Fraser.
944
945         This milestone fires sone after the paint triggered by the first visually non-empty layout.
946
947         * page/FrameView.cpp:
948         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
949         (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
950         * page/LayoutMilestone.h:
951
952 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
953
954         Provide default implementations of Image and Icon
955         https://bugs.webkit.org/show_bug.cgi?id=191764
956
957         Reviewed by Michael Catanzaro.
958
959         Makes IconWPE and ImageWPE implementations the default.
960
961         * Sources.txt:
962         * SourcesWPE.txt:
963         * platform/graphics/Icon.cpp: Renamed from Source/WebCore/platform/graphics/wpe/IconWPE.cpp.
964         * platform/graphics/Image.cpp:
965         (WebCore::BitmapImage::invalidatePlatformData): Placed here for consistency with implementing ports.
966         (WebCore::Image::loadPlatformResource):
967         * platform/graphics/wpe/ImageWPE.cpp: Removed.
968
969 2018-11-16  Brent Fulgham  <bfulgham@apple.com>
970
971         [Win] Reduce the use of WKSI library calls: CFNetwork
972         https://bugs.webkit.org/show_bug.cgi?id=191718
973         <rdar://problem/46108732>
974
975         Reviewed by Alex Christensen.
976
977         Remove custom WKSI CFNetwork calls, since the SPI is already documented in PAL. Just
978         make the same calls on Windows, like we did for iOS and macOS back in 2017.
979
980         Stop including WebKitSystemInterface.h for files that used to rely on it
981         for font-related features.
982         
983         Tested by existing Windows regression tests. There should be no change in behavior.
984
985         * platform/graphics/win/FontCacheWin.cpp:
986         * platform/graphics/win/FontCustomPlatformData.cpp:
987         * platform/graphics/win/FontPlatformDataCGWin.cpp:
988         * platform/network/cf/CookieStorageCFNet.cpp:
989         * platform/network/cf/CredentialStorageCFNet.cpp:
990         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
991         (WebCore::createPrivateStorageSession):
992         (WebCore::NetworkStorageSession::switchToNewTestingSession):
993         (WebCore::NetworkStorageSession::ensureSession):
994         * platform/network/cf/ResourceError.h:
995         * platform/network/cf/ResourceErrorCF.cpp:
996         (WebCore::getSSLPeerCertificateData):
997         (WebCore::setSSLPeerCertificateData):
998         (WebCore::ResourceError::getSSLPeerCertificateDataBytePtr):
999         (WebCore::ResourceError::platformLazyInit):
1000         (WebCore::ResourceError::cfError const):
1001         * platform/network/cf/ResourceHandleCFNet.cpp:
1002         (WebCore::setClientCertificateInSSLProperties):
1003         (WebCore::ResourceHandle::createCFURLConnection):
1004         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1005         * platform/network/cf/ResourceRequestCFNet.cpp:
1006         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1007
1008 2018-11-16  Timothy Hatcher  <timothy@apple.com>
1009
1010         Add html{color:text} to the simpleUserAgentStyleSheet on macOS.
1011         https://bugs.webkit.org/show_bug.cgi?id=191760
1012
1013         Reviewed by Antti Koivisto.
1014
1015         * css/CSSDefaultStyleSheets.cpp: Added html{color:text} to simpleUserAgentStyleSheet inside
1016         a PLATFORM(MAC) copy of the string.
1017
1018 2018-11-16  Jer Noble  <jer.noble@apple.com>
1019
1020         An early return from updateSchedulingInfo can leave some variables uninitialized.
1021         https://bugs.webkit.org/show_bug.cgi?id=191755
1022         <rdar://problem/39910089>
1023
1024         Reviewed by Brent Fulgham.
1025
1026         * Modules/webaudio/AudioBufferSourceNode.cpp:
1027         (WebCore::AudioBufferSourceNode::process):
1028         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1029         (WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
1030         * Modules/webaudio/OscillatorNode.cpp:
1031         (WebCore::OscillatorNode::process):
1032
1033 2018-11-16  Alicia Boya García  <aboya@igalia.com>
1034
1035         [MSE][GStreamer] Ignore caps notifications when tearing down the pipeline
1036         https://bugs.webkit.org/show_bug.cgi?id=191578
1037
1038         Reviewed by Xabier Rodriguez-Calvar.
1039
1040         Changing the demuxer to READY state (which is done only in the main
1041         thread) triggers the unlinking of its srcpads, which in turns emits a
1042         caps change notification in the previously linked element since they
1043         become unnegotiated again.
1044
1045         We are not interested in caps notifications in these cases, so let's
1046         just ignore caps notifications emitted from the main thread.
1047
1048         This fixes an assertion failure in the debug builds.
1049
1050         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1051         (WebCore::AppendPipeline::AppendPipeline):
1052
1053 2018-11-16  Sihui Liu  <sihui_liu@apple.com>
1054
1055         Storing blobs in IDB on iOS: "Error preparing blob/file"
1056         https://bugs.webkit.org/show_bug.cgi?id=188438
1057         <rdar://problem/43097279>
1058
1059         Reviewed by Alex Christensen.
1060
1061         Grant sandbox extension of temp folder to network process, because we suggested network process had access to 
1062         the folder on iOS device but it didn't. 
1063
1064         This makes some existing tests about IDB blob pass on iOS device.
1065
1066         * Modules/indexeddb/server/IDBBackingStore.h:
1067         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
1068         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
1069         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
1070         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
1071         * Modules/indexeddb/shared/InProcessIDBServer.h:
1072
1073 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
1074
1075         Add USE(LIBWPE) to WebCore
1076         https://bugs.webkit.org/show_bug.cgi?id=191401
1077
1078         Reviewed by Michael Catanzaro.
1079
1080         No new tests. No change in behavior.
1081
1082         Migrates all PLATFORM(WPE) code that calls into wpe_* APIs to
1083         USE(LIBWPE) instead.
1084
1085         Renames classes and files to use the suffix LibWPE.
1086
1087         * PlatformWPE.cmake:
1088         * SourcesWPE.txt:
1089         * platform/Pasteboard.h:
1090         * platform/PasteboardStrategy.h:
1091         * platform/PlatformKeyboardEvent.h:
1092         * platform/PlatformPasteboard.h:
1093         * platform/graphics/PlatformDisplay.cpp:
1094         (WebCore::PlatformDisplay::createPlatformDisplay):
1095         * platform/graphics/PlatformDisplay.h:
1096         * platform/graphics/egl/GLContextEGL.h:
1097         * platform/graphics/egl/GLContextEGLLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp.
1098         (WebCore::GLContextEGL::createWPEContext):
1099         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1100         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1101         * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp.
1102         (WebCore::PlatformDisplayLibWPE::create):
1103         (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE):
1104         (WebCore::PlatformDisplayLibWPE::~PlatformDisplayLibWPE):
1105         (WebCore::PlatformDisplayLibWPE::initialize):
1106         * platform/graphics/libwpe/PlatformDisplayLibWPE.h: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.h.
1107         * platform/libwpe/PasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PasteboardWPE.cpp.
1108         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformKeyboardEventWPE.cpp.
1109         * platform/libwpe/PlatformPasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp.
1110
1111 2018-11-16  Zalan Bujtas  <zalan@apple.com>
1112
1113         [iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click).
1114         https://bugs.webkit.org/show_bug.cgi?id=191712
1115         <rdar://problem/45612900>
1116
1117         Reviewed by Simon Fraser.
1118
1119         In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click.
1120         In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar)
1121         and no need to dispatch a click event.
1122         The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely
1123         only for tooltip-like reasons and it's ok to proceed with the click event.
1124
1125         Test: fast/events/touch/ios/click-instead-of-hover-simple.html
1126
1127         * rendering/updating/RenderTreeUpdater.cpp:
1128         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
1129
1130 2018-11-16  Zalan Bujtas  <zalan@apple.com>
1131
1132         [LFC][IFC] Add support for out-of-flow positioned boxes
1133         https://bugs.webkit.org/show_bug.cgi?id=191726
1134
1135         Reviewed by Antti Koivisto.
1136
1137         While laying out formatting context roots (inline-block, floats) in an inline formatting context, we need to make sure
1138         that their out-of-flow descendants get laid out as well.
1139
1140         Test: fast/inline/simple-inline-with-out-of-flow-descendant.html
1141
1142         * layout/inlineformatting/InlineFormattingContext.cpp:
1143         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1144         * layout/layouttree/LayoutTreeBuilder.cpp: This was returning the wrong context root when the container was also a context root.
1145         (WebCore::Layout::TreeBuilder::createSubTree):
1146
1147 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
1148
1149         [GStreamer][WebRTC] Add API to enable/disable device mocks
1150         https://bugs.webkit.org/show_bug.cgi?id=191699
1151
1152         This basically us to test MediaStream/WebRTC support without
1153         requiring cameras or microphones and is quite useful.
1154
1155         Also fix the GStreamerAudioMock by:
1156           - Stop setting `leaky-upstream` on the GStreamerCapturer queue,
1157             this was usefull when we were trying to bring the MediaStream
1158             sources inside the main pipeline, it is not the case anymore
1159             (and not doable with latest version of LibWebRTC).
1160           - Use a 'ticks' wave on the gstreamer audiotestsrc so the test
1161             stream is similar to what Apple port does.
1162
1163         Reviewed by Xabier Rodriguez-Calvar.
1164
1165         The mocks are already tested and the API is really simple.
1166
1167         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
1168         (WebCore::GStreamerAudioCapturer::createSource):
1169         * platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
1170         * platform/mediastream/gstreamer/GStreamerCapturer.cpp:
1171         (WebCore::GStreamerCapturer::addSink):
1172         * platform/mediastream/gstreamer/GStreamerCapturer.h:
1173
1174 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
1175
1176         [GStreamer][MediaStream] Handle track addition and removal
1177         https://bugs.webkit.org/show_bug.cgi?id=191599
1178
1179         Reviewed by Xabier Rodriguez-Calvar.
1180
1181         Test: fast/mediastream/MediaStream-video-element-remove-track.html
1182
1183         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
1184         (WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver):
1185         (WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver):
1186         (WebCore::webkitMediaStreamSrcFinalize):
1187         (WebCore::webkitMediaStreamSrcChangeState):
1188         (WebCore::webkit_media_stream_src_init):
1189         (WebCore::webkitMediaStreamSrcSetupSrc):
1190         (WebCore::webkitMediaStreamSrcAddTrack):
1191         (WebCore::webkitMediaStreamSrcRemoveTrackByType):
1192         (WebCore::webkitMediaStreamSrcSetStream):
1193
1194 2018-11-16  Zan Dobersek  <zdobersek@igalia.com>
1195
1196         ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
1197         https://bugs.webkit.org/show_bug.cgi?id=191354
1198
1199         Reviewed by Michael Catanzaro.
1200
1201         ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
1202         index validity and, if the index is valid, check for completeness of the
1203         corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
1204         also only retrieve duration for already-complete frames.
1205
1206         Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
1207         as that method goes on and decodes image data to determine specific
1208         information. The ImageSource class that's querying this information
1209         doesn't anticipate this, and doesn't handle the increased memory
1210         consumption of the decoded data, leaving MemoryCache in the blind about
1211         the image resource's actual amount of consumed memory. ImageSource can
1212         instead gracefully handle any incomplete frame by marking the decoding
1213         status for this frame as only partial.
1214
1215         * platform/image-decoders/ScalableImageDecoder.cpp:
1216         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
1217         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
1218         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
1219
1220 2018-11-16  Antoine Quint  <graouts@apple.com>
1221
1222         PointerEvents should not require touch event listeners to be registered
1223         https://bugs.webkit.org/show_bug.cgi?id=191333
1224         <rdar://problem/45857523>
1225
1226         Reviewed by Dean Jackson.
1227
1228         Tests: pointerevents/ios/pointer-events-dispatch-on-touch.html
1229                pointerevents/ios/pointer-events-prevent-default.html
1230
1231         * dom/EventNames.h:
1232         (WebCore::EventNames::isTouchEventType const):
1233         (WebCore::EventNames::touchAndPointerEventNames const):
1234         (WebCore::EventNames::touchEventNames const): Deleted.
1235         * dom/Node.cpp:
1236         (WebCore::Node::moveNodeToNewDocument):
1237
1238 2018-11-15  Zalan Bujtas  <zalan@apple.com>
1239
1240         [iOS] Do not get stuck in indeterminate content observation state.
1241         https://bugs.webkit.org/show_bug.cgi?id=191719
1242
1243         Reviewed by Simon Fraser.
1244
1245         Reset the _WKContentChange flag to WKContentNoChange when the last observing timer is removed and we are in
1246         the "can't decide yet if it's a hover or click" state.
1247         This bug prevents us from firing click event when JS installs and removes the same set of timer(s) during mouse-move dispatch.
1248
1249         Test: fast/events/touch/ios/stuck-with-hover-state.html
1250
1251         * platform/ios/wak/WKContentObservation.cpp:
1252         (WebThreadRemoveObservedContentModifier):
1253
1254 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
1255
1256         REGRESSION (r238090) Composited iframes that resize from zero don't show
1257         https://bugs.webkit.org/show_bug.cgi?id=191733
1258         rdar://problem/46107764
1259
1260         Reviewed by Zalan Bujtas.
1261         
1262         A zero-sized iframe whose contents are composited should not trigger compositing in the
1263         parent document (see code in requiresCompositingForFrame()), but when the <iframe> element
1264         was resized without a style change (e.g. because it's width: 100%, height: 100% and the
1265         parent resizes), there was no code that triggered a compositing update.
1266
1267         Fix by having RenderLayer::updateLayerPosition() trigger an update when the size changes,
1268         for a RenderWidget whose contents are composited.
1269
1270         Test: compositing/iframes/resize-from-zero-size.html
1271
1272         * rendering/RenderLayer.cpp:
1273         (WebCore::RenderLayer::updateLayerPosition):
1274
1275 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
1276
1277         Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
1278         https://bugs.webkit.org/show_bug.cgi?id=158342
1279         rdar://problem/26652811
1280
1281         Reviewed by Zalan Bujtas.
1282         
1283         Patch partly by Frédéric Wang.
1284
1285         This commit fixes an issue when resizing the content of a -webkit-overflow-scrolling: touch
1286         overflow node on iOS. Indeed, the RenderLayerBacking's scrolling layer may not be properly
1287         created and hence the UIProcess receives a null UIScrollView pointer. This triggers an
1288         assertion in debug mode and prevents the user from scrolling the overflow node in release
1289         mode. This was partially fixed by the refactoring of bug 90342 but this commit addresses
1290         the remaining issues by forcing a configuration update after layout in order to ensure that
1291         RenderLayerBacking's scrolling layer is available. For an overflow element that is not yet
1292         composited, trigger a post-layout update that is necessary to check if we need to make it
1293         composited when it gains scrollable overflow.
1294
1295         Tests: fast/scrolling/ios/change-scrollability-on-content-resize-nested.html
1296                fast/scrolling/ios/change-scrollability-on-content-resize.html
1297
1298         * rendering/RenderLayer.cpp:
1299         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Force a configuration update so that
1300         RenderLayerCompositor::updateBackingAndHierarchy will later instantiate
1301         RenderLayerBacking::m_scrollingLayer.
1302
1303 2018-11-15  Fujii Hironori  <Hironori.Fujii@sony.com>
1304
1305         [curl] warning: delete called on non-final 'WebCore::CurlDownload' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
1306         https://bugs.webkit.org/show_bug.cgi?id=191582
1307
1308         Reviewed by Alex Christensen.
1309
1310         No new tests because there's no behaviour change.
1311
1312         * platform/network/curl/CurlDownload.h: Marked CurlDownload final.
1313
1314 2018-11-15  Truitt Savell  <tsavell@apple.com>
1315
1316         Unreviewed, rolling out r238244.
1317
1318         Caused High Sierra test runs to fail early with 50 crashes and
1319         casued 25 API failures.
1320
1321         Reverted changeset:
1322
1323         "[css-logical] Implement flow-relative margin, padding and
1324         border shorthands"
1325         https://bugs.webkit.org/show_bug.cgi?id=188697
1326         https://trac.webkit.org/changeset/238244
1327
1328 2018-11-15  Jer Noble  <jer.noble@apple.com>
1329
1330         AVKit will set videoGravity to a nil string when building against iosmac
1331         https://bugs.webkit.org/show_bug.cgi?id=191573
1332
1333         Reviewed by Dean Jackson.
1334
1335         Workaround AVKit behavior by treating nil videoGravity as the default,
1336         which is AVLayerVideoGravityResizeAspect.
1337
1338         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1339         (-[WebAVPlayerLayer setVideoGravity:]):
1340
1341 2018-11-15  Brent Fulgham  <bfulgham@apple.com>
1342
1343         [Win] Reduce the use of WKSI library calls: Font Handling
1344         https://bugs.webkit.org/show_bug.cgi?id=191701
1345         <rdar://problem/46104809>
1346
1347         Reviewed by Myles C. Maxfield.
1348
1349         Move the old Windows font handling code out of WKSI to our regular
1350         repository. We now handle SPI differently, and don't need to keep
1351         these implementations in a separate library. This should also help
1352         avoid the somewhat frequent build failures caused when WKSI is not
1353         updated in sync with WebKit.
1354
1355         Tested by existing Windows test cases.
1356
1357         * platform/graphics/FontCascade.h:
1358         * platform/graphics/win/FontCGWin.cpp:
1359         (WebCore::FontCascade::drawGlyphs):
1360         (WebCore::FontCascade::setFontSmoothingLevel):
1361         (WebCore::setCGFontSmoothingStyle):
1362         (WebCore::FontCascade::setFontSmoothingStyle):
1363         (WebCore::FontCascade::setFontSmoothingContrast):
1364         (WebCore::clearTypeContrast):
1365         (WebCore::FontCascade::systemFontSmoothingChanged):
1366         (WebCore::FontCascade::setCGContextFontRenderingStyle):
1367         (WebCore::renderingStyleForFont):
1368         (WebCore::FontCascade::getGlyphAdvances):
1369         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
1370         (WebCore::GlyphPage::fill):
1371         * platform/graphics/win/GraphicsContextCGWin.cpp:
1372         (WebCore::GraphicsContext::drawFocusRing):
1373         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
1374         * platform/graphics/win/SimpleFontDataCGWin.cpp:
1375         (WebCore::Font::platformWidthForGlyph const):
1376         * rendering/RenderMediaControls.cpp:
1377         (WebCore::RenderMediaControls::adjustMediaSliderThumbSize):
1378
1379 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
1380
1381         [WebAuthN] Use a real nonce for CTAPHID_INIT
1382         https://bugs.webkit.org/show_bug.cgi?id=191533
1383         <rdar://problem/46103502>
1384
1385         Reviewed by Brent Fulgham.
1386
1387         New tests are added into existing test files.
1388
1389         * Modules/webauthn/fido/FidoConstants.h:
1390
1391 2018-11-15  Justin Fan  <justin_fan@apple.com>
1392
1393         [WebGPU] WebGPUCommandBuffer prototype
1394         https://bugs.webkit.org/show_bug.cgi?id=191663
1395
1396         Reviewed by Dean Jackson.
1397
1398         Begin implementation of WebGPUCommandBuffers as well as GPUQueues (MTLCommandBuffer, MTLCommandQueue).
1399
1400         Test: webgpu/command-buffers.html
1401
1402         * CMakeLists.txt:
1403         * DerivedSources.make:
1404         * Modules/webgpu/GPUCommandBuffer.h: Added. Wrapper class around a MTLCommandBuffer.
1405         * Modules/webgpu/GPUDevice.cpp:
1406         (WebCore::GPUDevice::createCommandBuffer): Added.
1407         (WebCore::GPUDevice::getQueue): Returns RefPtr to the device's singleton queue.
1408         * Modules/webgpu/GPUDevice.h: Now manages the device's GPUQueue.
1409         (WebCore::GPUDevice::platformDevice const):
1410         * Modules/webgpu/GPUQueue.h: Added. Wrapper class around a MTLCommandQueue.
1411         (WebCore::GPUQueue::platformQueue const):
1412         * Modules/webgpu/GPURenderPipeline.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipeline.h.
1413         (WebCore::GPURenderPipeline::platformRenderPipeline const):
1414         * Modules/webgpu/GPUShaderModule.h:
1415         (WebCore::GPUShaderModule::platformShaderModule const):
1416         * Modules/webgpu/GPUSwapChain.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChain.h.
1417         (WebCore::GPUSwapChain::platformLayer const):
1418         * Modules/webgpu/WebGPUCommandBuffer.cpp: Added. Web interface for a GPU device's command buffer.
1419         (WebCore::WebGPUCommandBuffer::create):
1420         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
1421         * Modules/webgpu/WebGPUCommandBuffer.h: Added.
1422         * Modules/webgpu/WebGPUCommandBuffer.idl: Added.
1423         * Modules/webgpu/WebGPUDevice.cpp:
1424         (WebCore::WebGPUDevice::createCommandBuffer const): Added.
1425         * Modules/webgpu/WebGPUDevice.h:
1426         * Modules/webgpu/WebGPUDevice.idl:
1427         * Modules/webgpu/cocoa/GPUCommandBufferMetal.mm: Added. MTLCommandBuffer impl for GPUCommandBuffer.
1428         (WebCore::GPUCommandBuffer::create): Create a MTLCommandBuffer from the MTLCommandQueue.
1429         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
1430         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
1431         (WebCore::GPUDevice::GPUDevice):
1432         * Modules/webgpu/cocoa/GPUQueueMetal.mm: Added. MTLCommandQueue impl for GPUQueue.
1433         (WebCore::GPUQueue::create):
1434         (WebCore::GPUQueue::GPUQueue):
1435         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
1436         (WebCore::GPURenderPipeline::GPURenderPipeline):
1437         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
1438         (WebCore::GPUShaderModule::create):
1439         (WebCore::GPUShaderModule::GPUShaderModule):
1440         * Sources.txt:
1441         * SourcesCocoa.txt:
1442         * WebCore.xcodeproj/project.pbxproj:
1443         * bindings/js/WebCoreBuiltinNames.h:
1444
1445 2018-11-15  Oriol Brufau  <obrufau@igalia.com>
1446
1447         [css-logical] Implement flow-relative margin, padding and border shorthands
1448         https://bugs.webkit.org/show_bug.cgi?id=188697
1449
1450         Reviewed by Simon Fraser and Antti Koivisto.
1451
1452         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
1453                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
1454                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
1455                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
1456                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
1457                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
1458                webexposed/css-properties-as-js-properties.html
1459                webexposed/css-properties-behind-flags.html
1460                webexposed/css-property-listing.html
1461
1462         * css/CSSComputedStyleDeclaration.cpp:
1463         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1464         Allow the new properties to serialize their computed value.
1465
1466         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
1467         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
1468         * css/CSSComputedStyleDeclaration.h:
1469         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
1470         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
1471         shorthands.
1472
1473         * css/CSSProperties.json:
1474         Add the new properties behind the CSSLogicalEnabled runtime flag.
1475
1476         * css/CSSStyleDeclaration.cpp:
1477         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
1478         Prevent CSS properties disabled behind a runtime flag from being exposed in
1479         style declarations.
1480
1481         * css/StyleProperties.cpp:
1482         (WebCore::StyleProperties::getPropertyValue const):
1483         Allow the new properties to serialize their specified value.
1484
1485         (WebCore::StyleProperties::get2Values const):
1486         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
1487
1488         (WebCore::StyleProperties::borderPropertyValue const):
1489         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
1490         corresponding to width, style and color.
1491
1492         (WebCore::MutableStyleProperties::setProperty):
1493         Prevent CSS properties disabled behind a runtime flag from being set a value.
1494
1495         (WebCore::StyleProperties::asText const):
1496         Allow the new properties to be serialized in cssText.
1497         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
1498         and serialize the longhands instead. Note that there could be another shorthand
1499         available which is enabled, but a proper solution would require bug 190496.
1500
1501         * css/StyleProperties.h:
1502         Update declarations of borderPropertyValue and get2Values.
1503
1504         * css/makeprop.pl:
1505         (addProperty):
1506         Add isEnabledCSSProperty function for checking that a CSS property is not
1507         disabled behind a runtime flag.
1508
1509         * css/parser/CSSPropertyParser.cpp:
1510         (WebCore::cssPropertyID):
1511         Prevent CSS properties disabled behind a runtime flag from being exposed in
1512         computed styles.
1513
1514         (WebCore::CSSPropertyParser::addProperty):
1515         Prevent CSS properties disabled behind a runtime flag from being set a value.
1516
1517         (WebCore::CSSPropertyParser::consumeBorder):
1518         Change consumeBorder to provide the caller with the parsed values instead of
1519         setting properties. Then the caller can decide to which properties the values
1520         should be set, and whether border-image should be reset or not.
1521
1522         (WebCore::CSSPropertyParser::consume2ValueShorthand):
1523         (WebCore::CSSPropertyParser::consume4ValueShorthand):
1524         Rename consume4Values to consume4ValueShorthand, and add analogous
1525         consume2ValueShorthand for parsing shorthands with two longhands.
1526
1527         (WebCore::CSSPropertyParser::parseShorthand):
1528         Allow the new properties to be parsed.
1529
1530         * css/parser/CSSPropertyParser.h:
1531         Update declarations of consumeBorder, consume2ValueShorthand and
1532         consume4ValueShorthand.
1533
1534         * inspector/agents/InspectorCSSAgent.cpp:
1535         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
1536         Prevent CSS properties disabled behind a runtime flag from being exposed in
1537         the CSS inspector tool.
1538
1539         * page/RuntimeEnabledFeatures.h:
1540         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
1541         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
1542         Add the CSSLogicalEnabled runtime flag.
1543
1544 2018-11-15  Truitt Savell  <tsavell@apple.com>
1545
1546         Unreviewed, rolling out r238220.
1547
1548         Introduced failing tests to iOS and is slowing down EWS
1549
1550         Reverted changeset:
1551
1552         "[css-grid] Consider scrollbars in
1553         populateGridPositionsForDirection()"
1554         https://bugs.webkit.org/show_bug.cgi?id=191656
1555         https://trac.webkit.org/changeset/238220
1556
1557 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
1558
1559         [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
1560         https://bugs.webkit.org/show_bug.cgi?id=191522
1561
1562         Reviewed by Brent Fulgham.
1563
1564         Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional.
1565         https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria
1566
1567         Covered by existing tests.
1568
1569         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1570         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
1571
1572 2018-11-15  Ross Kirsling  <ross.kirsling@sony.com>
1573
1574         DragImage should have a complete default implementation
1575         https://bugs.webkit.org/show_bug.cgi?id=191666
1576
1577         Reviewed by Dean Jackson.
1578
1579         Move WPE's stub implementation down into the base implementation file.
1580
1581         * SourcesWPE.txt:
1582         * platform/DragImage.cpp:
1583         (WebCore::dragImageSize):
1584         (WebCore::deleteDragImage):
1585         (WebCore::scaleDragImage):
1586         (WebCore::dissolveDragImageToFraction):
1587         (WebCore::createDragImageFromImage):
1588         (WebCore::createDragImageIconForCachedImageFilename):
1589         (WebCore::createDragImageForLink):
1590         * platform/wpe/DragImageWPE.cpp: Removed.
1591
1592 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
1593
1594         [WebAuthN] UserHandle can be null
1595         https://bugs.webkit.org/show_bug.cgi?id=191521
1596
1597         Reviewed by Alex Christensen.
1598
1599         According to the newest spec as of 7 August, 2018: https://www.w3.org/TR/webauthn/#conforming-authenticators-u2f.
1600         UserHandle can now be null.
1601
1602         Covered by existing tests.
1603
1604         * Modules/webauthn/AuthenticatorAssertionResponse.h:
1605         (WebCore::AuthenticatorAssertionResponse::create):
1606         (WebCore::AuthenticatorAssertionResponse::userHandle const):
1607         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
1608         * Modules/webauthn/AuthenticatorAssertionResponse.idl:
1609         * Modules/webauthn/PublicKeyCredential.cpp:
1610         (WebCore::PublicKeyCredential::tryCreate):
1611         * Modules/webauthn/PublicKeyCredentialData.h:
1612         (WebCore::PublicKeyCredentialData::encode const):
1613         (WebCore::PublicKeyCredentialData::decode):
1614         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
1615         (fido::readCTAPGetAssertionResponse):
1616
1617 2018-11-15  Youenn Fablet  <youenn@apple.com>
1618
1619         Modernize RTCPeerConnection handling of pendingActivity
1620         https://bugs.webkit.org/show_bug.cgi?id=191661
1621
1622         Reviewed by Eric Carlson.
1623
1624         makePendingActivity is the modern way to handle set/unset of pending activity.
1625         No change of behavior.
1626
1627         * Modules/mediastream/RTCPeerConnection.cpp:
1628         (WebCore::RTCPeerConnection::create):
1629         (WebCore::RTCPeerConnection::doStop):
1630         * Modules/mediastream/RTCPeerConnection.h:
1631
1632 2018-11-15  Keith Rollin  <krollin@apple.com>
1633
1634         Delete old .xcfilelist files
1635         https://bugs.webkit.org/show_bug.cgi?id=191669
1636         <rdar://problem/46081994>
1637
1638         Reviewed by Chris Dumez.
1639
1640         .xcfilelist files were created and added to the Xcode project files in
1641         https://trac.webkit.org/changeset/238008/webkit. However, they caused
1642         build issues and they were removed from the Xcode projects in
1643         https://trac.webkit.org/changeset/238055/webkit. This check-in removes
1644         the files from the repository altogether. They'll ultimately be
1645         replaced with new files with names that indicate whether the
1646         associated files are inputs to the Run Script phase or are files
1647         created by the Run Script phase.
1648
1649         No new tests -- no changed functionality.
1650
1651         * DerivedSources.xcfilelist: Removed.
1652         * UnifiedSources.xcfilelist: Removed.
1653
1654 2018-11-15  Youenn Fablet  <youenn@apple.com>
1655
1656         Update RTCPeerConnection JS built-ins to be closer to specWe
1657         https://bugs.webkit.org/show_bug.cgi?id=191665
1658
1659         Reviewed by Eric Carlson.
1660
1661         Simplify JS built-ins since we no longer need to support callback versions of the API.
1662         Make sure to have the right number of parameters in the JS built-in functions.
1663         Make some simplification to the code.
1664         Covered by existing tests and rebased test.
1665
1666         * Modules/mediastream/RTCPeerConnection.js:
1667         (createOffer):
1668         (createAnswer):
1669         (setLocalDescription):
1670         (setRemoteDescription):
1671         (addIceCandidate):
1672         * Modules/mediastream/RTCPeerConnectionInternals.js:
1673         (enqueueOperation):
1674         (callbacksAndDictionaryOverload): Deleted.
1675
1676 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
1677
1678         REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari
1679         https://bugs.webkit.org/show_bug.cgi?id=191673
1680         rdar://problem/46083440
1681
1682         Reviewed by Antti Koivisto.
1683
1684         Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer
1685         tree for every Frame. They get re-attached on tab show, and for subframes this involves
1686         the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition().
1687         
1688         The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that
1689         fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary
1690         layer configuration update that gets iframe layers parented.
1691         
1692         This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future
1693         patch will optimize this, and add a layout test.
1694
1695         * rendering/RenderLayerCompositor.cpp:
1696         (WebCore::RenderLayerCompositor::layerStyleChanged):
1697
1698 2018-11-15  Zalan Bujtas  <zalan@apple.com>
1699
1700         [LFC][IFC] Skip non-inflow boxes while splitting the inline runs.
1701         https://bugs.webkit.org/show_bug.cgi?id=191690
1702
1703         Reviewed by Antti Koivisto.
1704
1705         Skip all non-inflow boxes (floats, out-of-flow positioned elements). They don't participate in the inline run context.
1706
1707         * layout/Verification.cpp:
1708         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
1709         * layout/inlineformatting/InlineFormattingContext.cpp:
1710         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1711
1712 2018-11-15  Zalan Bujtas  <zalan@apple.com>
1713
1714         [LFC] FormattingContext base class should not declare computeStaticPosition.
1715         https://bugs.webkit.org/show_bug.cgi?id=191683
1716
1717         Reviewed by Antti Koivisto.
1718
1719         Apparently only BlockFormattingContext uses it.
1720
1721         * layout/FormattingContext.h:
1722         * layout/blockformatting/BlockFormattingContext.h:
1723         * layout/inlineformatting/InlineFormattingContext.cpp:
1724         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): Deleted.
1725         * layout/inlineformatting/InlineFormattingContext.h:
1726
1727 2018-11-14  Zalan Bujtas  <zalan@apple.com>
1728
1729         [LFC][IFC] Add support for in-flow positioned inline boxes.
1730         https://bugs.webkit.org/show_bug.cgi?id=191672
1731
1732         Reviewed by Antti Koivisto.
1733
1734         We might offset the in-flow positioned runs differently once runs are moved over to the display tree.
1735
1736         Test: fast/inline/simple-inline-inflow-positioned.html
1737
1738         * layout/Verification.cpp:
1739         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
1740         * layout/inlineformatting/InlineFormattingContext.cpp:
1741         (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const):
1742         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
1743         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
1744         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1745         * layout/inlineformatting/InlineFormattingContext.h:
1746         * layout/inlineformatting/InlineRun.h:
1747         (WebCore::Layout::InlineRun::moveVertically):
1748         * layout/layouttree/LayoutTreeBuilder.cpp:
1749         (WebCore::Layout::outputInlineRuns):
1750
1751 2018-11-15  Thibault Saunier  <tsaunier@igalia.com>
1752
1753         [GStreamer][WebRTC] Add support for sending silence or silencing an incoming track
1754         https://bugs.webkit.org/show_bug.cgi?id=191631
1755
1756         Reviewed by Xabier Rodriguez-Calvar.
1757
1758         This will be tested once webkit.org/b/186933 is implemented.
1759
1760         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
1761         (WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
1762         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
1763         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
1764
1765 2018-11-15  Antti Koivisto  <antti@apple.com>
1766
1767         REGRESSION(r238178): fast/forms/access-key-mutated.html and fast/forms/access-key-case-insensitive.html are timing out
1768         https://bugs.webkit.org/show_bug.cgi?id=191642
1769
1770         Reviewed by Zalan Bujtas.
1771
1772         Invalidate access key map even when thorttling style recalcs.
1773
1774         * dom/Document.cpp:
1775         (WebCore::Document::scheduleStyleRecalc):
1776
1777 2018-11-15  Antti Koivisto  <antti@apple.com>
1778
1779         Remove fonts from CSSFontFaceSet safely
1780         https://bugs.webkit.org/show_bug.cgi?id=191676
1781
1782         Reviewed by Zalan Bujtas.
1783
1784         Test: fast/text/font-face-set-remove-safely.html
1785
1786         * css/CSSFontFaceSet.cpp:
1787         (WebCore::CSSFontFaceSet::remove):
1788
1789 2018-11-15  Manuel Rego Casasnovas  <rego@igalia.com>
1790
1791         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
1792         https://bugs.webkit.org/show_bug.cgi?id=191656
1793
1794         Reviewed by Javier Fernandez.
1795
1796         We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
1797         that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
1798         but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
1799
1800         The patch modifies the method so it takes into account scrollbar size
1801         in order to compute the position of the columns/rows depending on the direction and the writing mode.
1802
1803         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
1804                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
1805                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
1806
1807         * rendering/RenderGrid.cpp:
1808         (WebCore::RenderGrid::populateGridPositionsForDirection):
1809
1810 2018-11-14  Keith Rollin  <krollin@apple.com>
1811
1812         Move scripts for Derived and Unified Sources to external files
1813         https://bugs.webkit.org/show_bug.cgi?id=191670
1814         <rdar://problem/46082278>
1815
1816         Reviewed by Keith Miller.
1817
1818         Move the scripts in the Generate Derived Sources and Generate Unified
1819         Sources Run Script phases from the Xcode projects to external shell
1820         script files. Then invoke those scripts from the Run Script phases.
1821         This refactoring is being performed to support later work that will
1822         invoke these scripts in other contexts.
1823
1824         The scripts were maintained as-is when making the move. I did a little
1825         reformatting and added 'set -e' to the top of each file, but that's
1826         it.
1827
1828         No new tests -- no changed functionality.
1829
1830         * Scripts/generate-derived-sources.sh: Added.
1831         * Scripts/generate-unified-sources.sh: Added.
1832         * WebCore.xcodeproj/project.pbxproj:
1833
1834 2018-11-14  Keith Rollin  <krollin@apple.com>
1835
1836         Fix #end vs. #endif typo.
1837         https://bugs.webkit.org/show_bug.cgi?id=191668
1838         <rdar://problem/46081704>
1839
1840         Reviewed by Alexey Proskuryakov.
1841
1842         Source/WebCore/SourcesCocoa.txt had a #end that should have been a
1843         #endif. Fix this, an add a check to generate-unified-source-bundles.rb
1844         to detect similar typos.
1845
1846         No new tests -- no changed functionality.
1847
1848         * SourcesCocoa.txt:
1849
1850 2018-11-14  Keith Rollin  <krollin@apple.com>
1851
1852         Remove VideoFullscreenLayerManager.mm from WebCore/SourcesCocoa.txt
1853         https://bugs.webkit.org/show_bug.cgi?id=191667
1854         <rdar://problem/46081286>
1855
1856         Reviewed by Eric Carlson.
1857
1858         VideoFullscreenLayerManager.mm no longer exists.
1859
1860         No new tests -- No changed functionality.
1861
1862         * SourcesCocoa.txt:
1863
1864 2018-11-14  Timothy Hatcher  <timothy@apple.com>
1865
1866         Enabled dark mode CSS support by default.
1867         https://bugs.webkit.org/show_bug.cgi?id=191609
1868         rdar://problem/46046861
1869
1870         Reviewed by Megan Gardner.
1871
1872         * page/RuntimeEnabledFeatures.h: Set m_isDarkModeCSSEnabled to true.
1873
1874 2018-11-14  Timothy Hatcher  <timothy@apple.com>
1875
1876         Default the view background color and text color to different values when in dark mode.
1877         https://bugs.webkit.org/show_bug.cgi?id=191607
1878         rdar://problem/46045854
1879
1880         Reviewed by Dean Jackson.
1881
1882         Test: css-dark-mode/default-colors.html
1883
1884         * css/html.css:
1885         (html): Set color: text on macOS.
1886         * dom/Document.cpp:
1887         (WebCore::Document::processSupportedColorSchemes): Call recalculateBaseBackgroundColor().
1888         * editing/EditingStyle.cpp:
1889         (WebCore::caretColorFromStyle): Added.
1890         (WebCore::EditingStyle::prepareToApplyAt): Use equalIgnoringSemanticColor. Check for
1891         caret-color directly since removeEquivalentProperties fails with semantic colors.
1892         (WebCore::extractPropertiesNotIn): Use equalIgnoringSemanticColor. Check for caret-color
1893         directly since removeEquivalentProperties fails with semantic colors.
1894         * page/Frame.cpp:
1895         (WebCore::Frame::createView): Drop backgroundColor.
1896         * page/Frame.h:
1897         * page/FrameView.cpp:
1898         (WebCore::FrameView::recalculateBaseBackgroundColor): Added.
1899         (WebCore::FrameView::updateBackgroundRecursively): Drop backgroundColor argument.
1900         Calculate the backgroundColor based on the transparent argument only.
1901         * page/FrameView.h:
1902         * platform/graphics/Color.h:
1903         (WebCore::equalIgnoringSemanticColor): Added for EditingStyle.
1904         * rendering/RenderBox.cpp:
1905         (WebCore::RenderBox::styleDidChange): Call recalculateBaseBackgroundColor().
1906         * rendering/RenderLayerBacking.cpp:
1907         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): Use isWhiteColor()
1908         since it ignores the semantic color flag.
1909         * testing/Internals.cpp:
1910         (WebCore::Internals::setViewIsTransparent): Drop backgroundColor.
1911         (WebCore::Internals::viewBaseBackgroundColor): Added.
1912         * testing/Internals.h:
1913         * testing/Internals.idl: Added viewBaseBackgroundColor.
1914
1915 2018-11-14  Justin Fan  <justin_fan@apple.com>
1916
1917         [WebGPU] Code quality concerns raised for 191291: [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
1918         https://bugs.webkit.org/show_bug.cgi?id=191383
1919
1920         Reviewed by Dean Jackson.
1921
1922         Covered by existing WebGPU tests introduced in original patch.
1923
1924         * Modules/webgpu/GPUDevice.h:
1925         * Modules/webgpu/GPUPipelineStageDescriptor.h:
1926         * Modules/webgpu/GPURenderPipelineDescriptor.h: Now a base struct with a guaranteed vertex stage member.
1927         (): Refactored into enum class.
1928         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Removed in favor of init-list construction.
1929         (WebCore::GPURenderPipelineDescriptor::primitiveTopology): Now a proper enum class member.
1930         * Modules/webgpu/GPUShaderModule.h:
1931         * Modules/webgpu/WebGPUDevice.cpp:
1932         (WebCore::WebGPUDevice::createRenderPipeline const):
1933         * Modules/webgpu/WebGPUShaderModule.h:
1934         (WebCore::WebGPUShaderModule::module const):
1935         * Modules/webgpu/WebGPUShaderStage.h: Replaced enum with constants to better reflect IDL.
1936         * Modules/webgpu/cocoa/GPURenderPipeline.h:
1937         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
1938         (WebCore::setFunctionsForPipelineDescriptor):
1939         (WebCore::GPURenderPipeline::create):
1940         * Modules/webgpu/cocoa/GPUSwapChain.h:
1941         * WebCore.xcodeproj/project.pbxproj: Removed GPUPipelineDescriptorBase.
1942
1943 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
1944
1945         Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
1946         https://bugs.webkit.org/show_bug.cgi?id=191612
1947
1948         Reviewed by Matt Baker.
1949
1950         * inspector/InspectorController.cpp:
1951         (WebCore::InspectorController::connectFrontend):
1952         (WebCore::InspectorController::disconnectFrontend):
1953         (WebCore::InspectorController::show):
1954         * inspector/InspectorController.h:
1955         * inspector/WorkerInspectorController.cpp:
1956         (WebCore::WorkerInspectorController::connectFrontend):
1957         (WebCore::WorkerInspectorController::disconnectFrontend):
1958         * page/PageDebuggable.cpp:
1959         (WebCore::PageDebuggable::connect):
1960         (WebCore::PageDebuggable::disconnect):
1961         * page/PageDebuggable.h:
1962         * testing/Internals.cpp:
1963         (WebCore::InspectorStubFrontend::InspectorStubFrontend):
1964         (WebCore::InspectorStubFrontend::closeWindow):
1965         * workers/service/context/ServiceWorkerDebuggable.cpp:
1966         (WebCore::ServiceWorkerDebuggable::connect):
1967         (WebCore::ServiceWorkerDebuggable::disconnect):
1968         * workers/service/context/ServiceWorkerDebuggable.h:
1969         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
1970         (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
1971         (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
1972         * workers/service/context/ServiceWorkerInspectorProxy.h:
1973
1974 2018-11-14  Timothy Hatcher  <timothy@apple.com>
1975
1976         Update prefers-color-scheme media query matching based on GitHub issue #3278.
1977         https://bugs.webkit.org/show_bug.cgi?id=191654
1978         rdar://problem/46074307
1979
1980         Reviewed by Simon Fraser.
1981
1982         Test: css-dark-mode/prefers-color-scheme.html
1983
1984         * css/MediaQueryEvaluator.cpp:
1985         (WebCore::prefersColorSchemeEvaluate): Return true when there is no value. Return false
1986         for `no-preference` since there is no macOS option for no user preference.
1987         * css/MediaQueryExpression.cpp:
1988         (WebCore::isFeatureValidWithoutValue): Added prefers-color-scheme.
1989
1990 2018-11-14  Devin Rousso  <drousso@apple.com>
1991
1992         Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
1993         https://bugs.webkit.org/show_bug.cgi?id=191628
1994
1995         Reviewed by Dean Jackson.
1996
1997         Updated existing test: inspector/model/recording.html
1998
1999         * inspector/InspectorCanvas.h:
2000         * inspector/InspectorCanvas.cpp:
2001         (WebCore::InspectorCanvas::indexForData):
2002         (WebCore::InspectorCanvas::buildInitialState):
2003         (WebCore::InspectorCanvas::buildAction):
2004         Drive-by: prevent de-duplicated objects from being destroyed while recording.
2005
2006 2018-11-14  Stephan Szabo  <stephan.szabo@sony.com>
2007
2008         [Win] Compile Service Worker support
2009         https://bugs.webkit.org/show_bug.cgi?id=191409
2010
2011         Reviewed by Youenn Fablet.
2012
2013         Fix compilation errors when ENABLE(SERVICE_WORKER)
2014         on Windows with clang-cl. Clang on dllexport
2015         platforms does not support specifying the
2016         dllexport on both a class and members of the class
2017         and unistd.h isn't provided but also appeared to
2018         not be used.
2019
2020         No new tests, should be covered by existing tests.
2021
2022         * workers/service/ServiceWorkerProvider.h:
2023         * workers/service/context/SWContextManager.cpp:
2024
2025 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
2026
2027         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
2028         https://bugs.webkit.org/show_bug.cgi?id=191494
2029         <rdar://problem/45469854>
2030
2031         Reviewed by Devin Rousso.
2032
2033         * inspector/InspectorClient.h:
2034         (WebCore::InspectorClient::allowRemoteInspectionToPageDirectly const):
2035         Provide a hook so that a client may wish to allow direct remote inspection of the Page.
2036         This is used by WebKitLegacy only.
2037
2038         * page/Page.cpp:
2039         (Page::Page):
2040         Only enable the PageDebuggable if the client wishes remote inspection of the Page directly.
2041         This is used by WebKitLegacy only.
2042
2043         * inspector/InspectorController.cpp:
2044         (WebCore::InspectorController::connectFrontend):
2045         * inspector/InspectorController.h:
2046         * page/PageDebuggable.cpp:
2047         (WebCore::PageDebuggable::connect):
2048         (WebCore::PageDebuggable::disconnect):
2049         * page/PageDebuggable.h:
2050         When a frontend connects, always enable the developer extras for the Page.
2051         This is pretty much only for the remote path, which allows inspection if developer
2052         extras were not already enabled (iOS). This simplifies the logic, and toggling
2053         developer extras after it was already enabled is not really important.
2054
2055 2018-11-14  Per Arne Vollan  <pvollan@apple.com>
2056
2057         REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
2058         https://bugs.webkit.org/show_bug.cgi?id=190884
2059
2060         Reviewed by Dean Jackson.
2061
2062         Only notify display refresh monitors with matching display ID.
2063
2064         Test: fast/animation/request-animation-frame-in-two-pages.html
2065
2066         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2067         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
2068         * platform/graphics/DisplayRefreshMonitorManager.h:
2069
2070 2018-11-14  Youenn Fablet  <youenn@apple.com>
2071
2072         Convert libwebrtc error types to DOM exceptions
2073         https://bugs.webkit.org/show_bug.cgi?id=191590
2074
2075         Reviewed by Alex Christensen.
2076
2077         Make use of overloaded callback method that provides an error type.
2078         This type is then used to create a DOM exception with the correct type.
2079         Covered by existing tests.
2080
2081         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2082         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
2083         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
2084         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
2085         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
2086         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2087         * Modules/mediastream/libwebrtc/LibWebRTCObservers.h:
2088         (WebCore::toExceptionCode):
2089
2090 2018-11-14  Youenn Fablet  <youenn@apple.com>
2091
2092         Allow to remove MediaStreamPrivate observers when iterating over observers
2093         https://bugs.webkit.org/show_bug.cgi?id=187256
2094
2095         Reviewed by Eric Carlson.
2096
2097         Migrate the observer list from a Vector to a HashSet.
2098         This is more robust to multiple observing and keeping of order of observers is not required.
2099         Copy the set of observers to a vector before iterating over it.
2100         This allows to remove an observer while iterating, which is now used in UserMediaRequest.
2101
2102         Covered by existing tests.
2103
2104         * Modules/mediastream/UserMediaRequest.cpp:
2105         (WebCore::UserMediaRequest::mediaStreamIsReady):
2106         * platform/mediastream/MediaStreamPrivate.cpp:
2107         (WebCore::MediaStreamPrivate::addObserver):
2108         (WebCore::MediaStreamPrivate::removeObserver):
2109         (WebCore::MediaStreamPrivate::forEachObserver const):
2110         (WebCore::MediaStreamPrivate::updateActiveState):
2111         (WebCore::MediaStreamPrivate::addTrack):
2112         (WebCore::MediaStreamPrivate::removeTrack):
2113         (WebCore::MediaStreamPrivate::characteristicsChanged):
2114         * platform/mediastream/MediaStreamPrivate.h:
2115
2116 2018-11-14  Youenn Fablet  <youenn@apple.com>
2117
2118         Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
2119         https://bugs.webkit.org/show_bug.cgi?id=191603
2120
2121         Reviewed by Chris Dumez.
2122
2123         Make sure to check that the sender peer connection backend is matching.
2124         Covered by rebased WPT test.
2125
2126         * Modules/mediastream/RTCPeerConnection.cpp:
2127         (WebCore::RTCPeerConnection::removeTrack):
2128         * Modules/mediastream/RTCRtpSender.cpp:
2129         (WebCore::RTCRtpSender::isCreatedBy const):
2130         * Modules/mediastream/RTCRtpSender.h:
2131
2132 2018-11-14  Fujii Hironori  <Hironori.Fujii@sony.com>
2133
2134         [curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl
2135         https://bugs.webkit.org/show_bug.cgi?id=191620
2136
2137         Reviewed by Alex Christensen.
2138
2139         Remove a abstract class CookieJarCurl which is not needed anymore.
2140         And, rename CookieJarCurlDatabase to CookieJarCurl.
2141
2142         No new tests because there's no behaviour change in WebCore.
2143
2144         * platform/Curl.cmake: Replaced CookieJarCurlDatabase.cpp with CookieJarCurl.cpp.
2145         * platform/network/curl/CookieJarCurl.cpp: Renamed from Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp.
2146         * platform/network/curl/CookieJarCurl.h: Merged CookieJarCurl.h and CookieJarCurlDatabase.h.
2147         * platform/network/curl/CookieJarCurlDatabase.h: Removed.
2148         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2149         (WebCore::NetworkStorageSession::NetworkStorageSession): Replaced CookieJarCurlDatabase with CookieJarCurl.
2150
2151 2018-11-14  Christopher Reid  <chris.reid@sony.com>
2152
2153         [WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp
2154         https://bugs.webkit.org/show_bug.cgi?id=191606
2155
2156         Reviewed by Michael Catanzaro.
2157
2158         No behavior change.
2159
2160         Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString.
2161
2162         * platform/wpe/PlatformKeyboardEventWPE.cpp:
2163         (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
2164         (WebCore::PlatformKeyboardEvent::singleCharacterString):
2165
2166 2018-11-13  Zalan Bujtas  <zalan@apple.com>
2167
2168         [LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
2169         https://bugs.webkit.org/show_bug.cgi?id=191623
2170
2171         Reviewed by Antti Koivisto.
2172
2173         This patch expands the breaking behaviour to support separate start/end breaks.
2174
2175         <span>parent </span><span style="padding: 10px;">start<span> middle </span>end</span><span> parent</span>
2176
2177         input to line breaking -> <parent start middle end parent>
2178         output of line breaking (considering infinite constraint) -> <parent start middle end parent>
2179         due to padding, final runs -> <parent><start middle end><parent>
2180
2181         "parent" -> n/a
2182         "start" -> BreakAtStart
2183         " middle " -> n/a
2184         "end" -> BreakAtEnd
2185         "parent" -> n/a
2186
2187         Another example:
2188         <span>parent </span><span style="padding-right: 10px;">start<span> middle </span>end</span><span> parent</span>
2189
2190         line breaking -> <parent start middle end parent>
2191         due to padding-right, final runs -> <parent start middle end><parent>
2192
2193         "parent" -> n/a
2194         "start" -> n/a
2195         " middle " -> n/a
2196         "end" -> BreakAtEnd
2197         "parent" -> n/a
2198
2199         * layout/inlineformatting/InlineFormattingContext.cpp:
2200         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2201         (WebCore::Layout::InlineFormattingContext::collectInlineContent const): Move to a recursive algorithm (which is fine, inline contents don't tend to be too deep)
2202         (WebCore::Layout::InlineFormattingContext::contentRequiresSeparateRun const): Deleted.
2203         * layout/inlineformatting/InlineFormattingContext.h:
2204         * layout/inlineformatting/InlineFormattingState.cpp:
2205         (WebCore::Layout::InlineFormattingState::detachingRules const):
2206         * layout/inlineformatting/InlineFormattingState.h:
2207         (WebCore::Layout::InlineFormattingState::lastInlineItem const):
2208         (WebCore::Layout::InlineFormattingState::addDetachingRule):
2209
2210 2018-11-14  Youenn Fablet  <youenn@apple.com>
2211
2212         Add support for RTCRtpCodecParameters.sdpFmtpLine
2213         https://bugs.webkit.org/show_bug.cgi?id=191591
2214
2215         Reviewed by Eric Carlson.
2216
2217         Covered by rebased test.
2218
2219         * Modules/mediastream/RTCRtpCodecParameters.h:
2220         * Modules/mediastream/RTCRtpCodecParameters.idl:
2221         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
2222         (WebCore::toRTCCodecParameters):
2223
2224 2018-11-14  Youenn Fablet  <youenn@apple.com>
2225
2226         Add support for transport and peerConnection stats
2227         https://bugs.webkit.org/show_bug.cgi?id=191592
2228
2229         Reviewed by Alex Christensen.
2230
2231         Covered by rebased tests.
2232
2233         * Modules/mediastream/RTCStatsReport.h:
2234         (WebCore::RTCStatsReport::TransportStats::TransportStats):
2235         (WebCore::RTCStatsReport::PeerConnectionStats::PeerConnectionStats):
2236         * Modules/mediastream/RTCStatsReport.idl:
2237         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
2238         (WebCore::fillRTCTransportStats):
2239         (WebCore::fillRTCPeerConnectionStats):
2240         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
2241
2242 2018-11-14  Ali Juma  <ajuma@chromium.org>
2243
2244         Transform of composited layer not updated when layer also needs repaint
2245         https://bugs.webkit.org/show_bug.cgi?id=191598
2246
2247         Reviewed by Simon Fraser.
2248
2249         Trigger a compositing geometry update whenever a RenderLayer's transform changes,
2250         even when other parts of its style have changed in a way that produces a
2251         StyleDifference greater than RecompositeLayer.
2252
2253         Test: compositing/geometry/transform-and-repaint-updates-geometry.html
2254
2255         * rendering/RenderLayerCompositor.cpp:
2256         (WebCore::RenderLayerCompositor::layerStyleChanged):
2257
2258 2018-11-13  Jiewen Tan  <jiewen_tan@apple.com>
2259
2260         [WebAuthN] Support CTAP HID authenticators on macOS
2261         https://bugs.webkit.org/show_bug.cgi?id=188623
2262         <rdar://problem/43353777>
2263
2264         Reviewed by Brent Fulgham and Chris Dumez.
2265
2266         This patch removes AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient to ignore
2267         any incompleted CompletionHandlers as calling them in destructors could cause unexpected cyclic
2268         dependency. Also, it adds a hack to temporarily deal with nullable userhandle.
2269
2270         Tests: http/wpt/webauthn/ctap-hid-failure.https.html
2271                http/wpt/webauthn/ctap-hid-success.https.html
2272                http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html
2273                http/wpt/webauthn/public-key-credential-create-failure-hid.https.html
2274                http/wpt/webauthn/public-key-credential-create-success-hid.https.html
2275                http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html
2276                http/wpt/webauthn/public-key-credential-get-failure-hid.https.html
2277                http/wpt/webauthn/public-key-credential-get-success-hid.https.html
2278
2279         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
2280         (WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient): Deleted.
2281         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
2282         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
2283         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
2284         (fido::readCTAPGetAssertionResponse):
2285         * Modules/webauthn/fido/FidoConstants.h:
2286
2287 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
2288
2289         [WebRTC] Provide default implementation of LibWebRTCProvider
2290         https://bugs.webkit.org/show_bug.cgi?id=191611
2291
2292         Reviewed by Michael Catanzaro.
2293
2294         Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults.
2295
2296         * PlatformWin.cmake:
2297         * platform/GStreamer.cmake:
2298         * platform/SourcesGLib.txt:
2299         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2300         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2301         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp.
2302         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h.
2303         * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed.
2304
2305 2018-11-13  Timothy Hatcher  <timothy@apple.com>
2306
2307         Use a light scrollbar for transparent web views in dark mode.
2308         https://bugs.webkit.org/show_bug.cgi?id=191559
2309         rdar://problem/46000489
2310
2311         Reviewed by Dean Jackson.
2312
2313         Test: css-dark-mode/supported-color-schemes-scrollbar.html
2314
2315         * css/CSSProperties.json: Marked supported-color-schemes as a custom Value.
2316         * css/StyleBuilderCustom.h:
2317         (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes):
2318         * editing/cocoa/WebContentReaderCocoa.mm: Use FrameView's useDarkAppearance().
2319         (WebCore::createFragment):
2320         * inspector/InspectorOverlay.cpp:
2321         (WebCore::InspectorOverlay::paint): Use FrameView's useDarkAppearance().
2322         * page/FrameView.cpp:
2323         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use a light scrollbar for
2324         transparent web views in dark mode.
2325         (WebCore::FrameView::rendererForSupportedColorSchemes const): Added.
2326         Return the body for document element renderer.
2327         (WebCore::FrameView::useDarkAppearance const): Use rendererForSupportedColorSchemes.
2328         (WebCore::FrameView::styleColorOptions const): Added. Ditto.
2329         * page/FrameView.h:
2330         * rendering/style/RenderStyle.cpp:
2331         (WebCore::rareInheritedDataChangeRequiresRepaint): Drive-by fix. Added supportedColorSchemes.
2332         * rendering/style/RenderStyle.h:
2333         (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Added.
2334         (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Added.
2335         (WebCore::RenderStyle::NonInheritedFlags::operator== const): Added supportedColorSchemes.
2336         * svg/graphics/SVGImage.cpp:
2337         (WebCore::SVGImage::draw): Use FrameView's useDarkAppearance().
2338         * testing/Internals.cpp:
2339         (WebCore::Internals::setViewIsTransparent): Added.
2340         (WebCore::Internals::scrollbarOverlayStyle const): Added.
2341         * testing/Internals.h:
2342         * testing/Internals.idl: Added setViewIsTransparent and scrollbarOverlayStyle.
2343
2344 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
2345
2346         [AppleWin] Unreviewed build fix after r238108.
2347
2348         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2349         (printLayer):
2350         (PlatformCALayerWin::embeddedViewID const):
2351         * platform/graphics/ca/win/PlatformCALayerWin.h:
2352
2353 2018-11-13  Youenn Fablet  <youenn@apple.com>
2354
2355         RTCPeerConnection.getTransceivers is not always exposing all transceivers
2356         https://bugs.webkit.org/show_bug.cgi?id=191589
2357
2358         Reviewed by Eric Carlson.
2359
2360         Implement the collect transceiver algorithm using libwebrtc backend.
2361         Call this algorithm everytime transceivers are retrieved from JS.
2362         For Plan B, make this a no-op as this is not supported.
2363         Introduce senders/receivers/transceivers getters where we just look at already created transceivers.
2364
2365         Covered by existing and rebased tests.
2366
2367         * Modules/mediastream/PeerConnectionBackend.h:
2368         (WebCore::PeerConnectionBackend::collectTransceivers):
2369         * Modules/mediastream/RTCPeerConnection.cpp:
2370         (WebCore::RTCPeerConnection::getSenders const):
2371         (WebCore::RTCPeerConnection::getReceivers const):
2372         (WebCore::RTCPeerConnection::getTransceivers const):
2373         * Modules/mediastream/RTCPeerConnection.h:
2374         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2375         (WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
2376         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2377         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2378         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
2379         (WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver):
2380         (WebCore::LibWebRTCPeerConnectionBackend::collectTransceivers):
2381         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
2382         (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
2383         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2384
2385 2018-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
2386
2387         [iOS] Do not show selection UI for editable elements with opacity near zero
2388         https://bugs.webkit.org/show_bug.cgi?id=191442
2389         <rdar://problem/45958625>
2390
2391         Reviewed by Simon Fraser.
2392
2393         Tests: editing/selection/ios/do-not-zoom-to-focused-hidden-contenteditable.html
2394                editing/selection/ios/hide-selection-after-hiding-contenteditable.html
2395                editing/selection/ios/hide-selection-in-contenteditable-nested-transparency.html
2396                editing/selection/ios/hide-selection-in-hidden-contenteditable-frame.html
2397                editing/selection/ios/hide-selection-in-hidden-contenteditable.html
2398
2399         * rendering/RenderObject.cpp:
2400         (WebCore::RenderObject::isTransparentRespectingParentFrames const):
2401
2402         Add a helper function to determine whether a RenderObject is contained within a transparent layer, taking parent
2403         frames into account. A layer is considered transparent if its opacity is less than a small threshold (i.e. 0.01).
2404         Opacity on ancestor elements is applied multiplicatively.
2405
2406         * rendering/RenderObject.h:
2407
2408 2018-11-13  Eric Carlson  <eric.carlson@apple.com>
2409
2410         [MediaStream] Observer AVCaptureDevice "suspended" property
2411         https://bugs.webkit.org/show_bug.cgi?id=191587
2412         <rdar://problem/46030598>
2413
2414         Reviewed by Youenn Fablet.
2415
2416         No new tests, AVCapture can only be tested manually.
2417
2418         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2419         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2420         (WebCore::AVCaptureDeviceManager::captureDevicesInternal): Don't notify of devices "changes"
2421         the first time the device list is scanned.
2422         (WebCore::deviceIsAvailable): Don't check for "isInUseByAnotherApplication", it doesn't
2423         change device availability.
2424         (WebCore::AVCaptureDeviceManager::beginObservingDevices): New, observe "suspended" on all 
2425         devices and add them to the cached list.
2426         (WebCore::AVCaptureDeviceManager::stopObservingDevices): New, opposite of above.
2427         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices): Watch for changes in the list of
2428         devices.
2429         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): Stop observing all cached devices.
2430         (WebCore::AVCaptureDeviceManager::registerForDeviceNotifications):
2431         (-[WebCoreAVCaptureDeviceManagerObserver disconnect]):
2432         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnectedDidChange:]):
2433         (-[WebCoreAVCaptureDeviceManagerObserver observeValueForKeyPath:ofObject:change:context:]):
2434         (WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType): Deleted.
2435         (WebCore::AVCaptureDeviceManager::deviceConnected): Deleted.
2436         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Deleted.
2437         (-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Deleted.
2438         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnected:]): Deleted.
2439
2440         * platform/mediastream/mac/AVVideoCaptureSource.h:
2441         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2442         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): Stop observing "running" (not "rate")
2443         and "suspended".
2444         (WebCore::AVVideoCaptureSource::setupSession): Observe "running" (not "rate"), and "suspended".
2445         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
2446         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
2447
2448 2018-11-13  Devin Rousso  <drousso@apple.com>
2449
2450         Web Inspector: REGRESSION(r238122): fetching the CertificateInfo triggers an ASSERT in workers
2451         https://bugs.webkit.org/show_bug.cgi?id=191597
2452
2453         Reviewed by Joseph Pecoraro.
2454
2455         When WebInspector is open, the `CertificateInfo` for every `ResourceResponse` is now fetched,
2456         meaning that we may try to fetch in situations previously unexpected.
2457
2458         * platform/network/cocoa/ResourceResponseCocoa.mm:
2459         (WebCore::ResourceResponse::platformCertificateInfo const):
2460
2461 2018-11-13  Timothy Hatcher  <timothy@apple.com>
2462
2463         Treat supported-color-schemes as the second highest priority property.
2464         https://bugs.webkit.org/show_bug.cgi?id=191556
2465         rdar://problem/46000076
2466
2467         Reviewed by Dean Jackson.
2468
2469         Test: css-dark-mode/supported-color-schemes-priority.html
2470
2471         * css/CSSProperties.json: Make supported-color-schemes high-priority and add a comment.
2472         * css/StyleResolver.cpp:
2473         (WebCore::StyleResolver::applyMatchedProperties): Manually handle supported-color-schemes
2474         after -webkit-ruby-position, before other properties, so it can affect resolved colors.
2475
2476 2018-11-13  Charlie Turner  <cturner@igalia.com>
2477
2478         [EME][GStreamer] Make CDMInstance's available in decryptors, and factor out some EME utility classes.
2479         https://bugs.webkit.org/show_bug.cgi?id=191316
2480
2481         Reviewed by Xabier Rodriguez-Calvar.
2482
2483         Another preparation in patch getting ready to move the decryption
2484         logic behind the CDMInstance and out of the GStreamer decryptors
2485         themselves. The first step taken here is to arrange for the
2486         instances to always be available in the decryptors when they need
2487         to decrypt content.
2488
2489         In doing so, there were a number of hairy bits of code that could
2490         use some abstraction, so the opportunity was taken to do that as
2491         well.
2492
2493         Covered by tests in media/encrypted-media and
2494         imported/w3c/web-platform-tests/encrypted-media.
2495
2496         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2497         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove
2498         drm-key-needed since it was not being used anywhere.
2499         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2500         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
2501         Factor out the parsing of decryption system information from
2502         GStreamer, since it was not clear what that code was doing unless
2503         you squinted pretty hard. Also remove the duplicated
2504         initialization-data-encountered posting.
2505         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
2506         Refactored to make it a more general method and usable in more
2507         situations. It now has an optional to stop it from eliding init
2508         datas for a different key system. This is required the first time
2509         we post them, since if a CDM instance has already been set, and if
2510         the stream init datas are for different systems, we ended up never
2511         posting an encrypted event.
2512         (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
2513         Actually send a CDMInstance now when in regular playback mode.
2514         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
2515         Remove m_needToSendCredentials, it was not being used.
2516         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
2517         Refactored to use the new initializationDataEncountered.
2518         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
2519         Log the waiting state, since it was currently not clear what that
2520         logging message was even telling you!
2521         (WebCore::extractEventsAndSystemsFromMessage): Deleted.
2522         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2523         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
2524         (WebCore::InitData::InitData): New class that encapsulates both
2525         single instantiation and streaming instantiation.
2526         (WebCore::InitData::append): Used for the streaming mode, when you
2527         are concatenating init datas together.
2528         (WebCore::InitData::payload const):
2529         (WebCore::InitData::systemId const):
2530         (WebCore::InitData::payloadContainerType const):
2531         (WebCore::InitData::isFromDifferentContainer):
2532         (WebCore::ProtectionSystemEvents::ProtectionSystemEvents):
2533         (WebCore::ProtectionSystemEvents::events const):
2534         (WebCore::ProtectionSystemEvents::availableSystems const):
2535         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2536         (webkitMediaCommonEncryptionDecryptTransformInPlace): If you post
2537         waiting-for-key after requesting a CDM instance, it will flap back
2538         to not waiting for a key almost immediately, didn't make sense
2539         positing after requesting an instance. Also post key-received when
2540         we receive the key.
2541         (webkitMediaCommonEncryptionDecryptSinkEventHandler): It has now
2542         been arranged that a CDMInstance will always be present in an OOB
2543         message, so parse it out here.
2544         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2545         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
2546         As above, make sure when posting the OOB that a CDMInstance is present.
2547
2548 2018-11-13  Charlie Turner  <cturner@igalia.com>
2549
2550         Various compiler warnings/errors fixes.
2551         https://bugs.webkit.org/show_bug.cgi?id=191583
2552
2553         Reviewed by Frédéric Wang.
2554
2555         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2556         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
2557         ASSERT is only compiled in DEBUG mode, so guarding with
2558         !LOG_DISABLED is wrong.
2559         * rendering/RenderLayerCompositor.cpp:
2560         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2561         showPaintOrderTree is only compiled in ENABLE(TREE_DEBUGGING)
2562         mode, so guarding with !LOG_DISABLED was wrong.
2563         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2564         Ditto, this time with member .depth.
2565         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): Ditto.
2566         * rendering/svg/SVGRenderSupport.cpp:
2567         (WebCore::SVGRenderSupport::styleChanged): Add another unused
2568         parameter.
2569
2570 2018-11-12  Antoine Quint  <graouts@apple.com>
2571
2572         [Web Animations] Don't schedule animation frames or update style while an accelerated animation is running
2573         https://bugs.webkit.org/show_bug.cgi?id=191542
2574         <rdar://problem/45356027>
2575
2576         Reviewed by Simon Fraser.
2577
2578         Test: animations/no-style-recalc-during-accelerated-animation.html
2579
2580         In order to be more power-efficient, we stop scheduling calls to updateAnimationsAndSendEvents() when running only accelerated
2581         animations. To do that, we prevent scheduling further animation resolution if we're in the process of updating animations, and
2582         when we are done, call the new DocumentTimeline::scheduleNextTick() method that will check whether we have only accelerated
2583         animations running, and in that case check which of those animations needs an update the soonest and starts a timer scheduled
2584         for that time when we'll schedule animation resolution.
2585
2586         By default, animations compute the time until their natural completion but in the case of CSS Animations, we want to make sure
2587         we also update animations in-flight to dispatch "animationiteration" events.
2588
2589         * animation/AnimationEffect.h: Make the simpleIterationProgress() public so it can be called by WebAnimation::timeToNextTick().
2590         * animation/DocumentTimeline.cpp:
2591         (WebCore::DocumentTimeline::DocumentTimeline): Create the m_tickScheduleTimer and set it up to call scheduleAnimationResolutionIfNeeded().
2592         (WebCore::DocumentTimeline::suspendAnimations): If we don't already have a cached current time, cache the current time.
2593         (WebCore::DocumentTimeline::resumeAnimations): Reset the cached current time to ensure we'll get a fresh one when updating animations next.
2594         (WebCore::DocumentTimeline::liveCurrentTime const): Factor the code to compute the current time out of currentTime() so that we can
2595         cache the current time in suspendAnimations() without also automatically clearing the current time.
2596         (WebCore::DocumentTimeline::currentTime): Use liveCurrentTime() and cacheCurrentTime() since much of the code from this function has been
2597         factored out into those. Additionally, we were failing to clear the current time if called inside an animation frame, which we now do correctly
2598         by virtue of using cacheCurrentTime(). This fixes some flakiness.
2599         (WebCore::DocumentTimeline::cacheCurrentTime): Factor the code to cache the current time out of currentTime(). 
2600         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime): No need to clear the current time if we get suspended.
2601         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Prevent scheduling an animation update if we're in the middle of one already,
2602         scheduleNextTick() will be called after animations are updated to see if we should schedule an animation update instead.
2603         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Cancel the m_tickScheduleTimer if we need to unschedule animation resolution.
2604         (WebCore::DocumentTimeline::animationResolutionTimerFired): Factor the call to applyPendingAcceleratedAnimations() out of updateAnimationsAndSendEvents()
2605         and call scheduleNextTick().
2606         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Set the new m_isUpdatingAnimations member variable to true while this function is running.
2607         (WebCore::DocumentTimeline::scheduleNextTick): Schedule an animation update immediately if we have any relevant animation that is not accelerated.
2608         Otherwise, iterate through all animations to figure out the earliest moment at which we need to update animations.
2609         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Use the new WebAnimation::isRunningAccelerated() function.
2610         * animation/DocumentTimeline.h:
2611         * animation/WebAnimation.cpp:
2612         (WebCore::WebAnimation::isRunningAccelerated const): Since we end up checking if an animation is running with an accelerated effect, we introduce a new
2613         function to get that information directly through the WebAnimation object without bothering about its effect.
2614         (WebCore::WebAnimation::resolve): We should only call updateFinishedState() here since timingDidChange() would also notify the timeline about a potential
2615         change in relevance, which is not necessary and which would schedule an animation frame even for animations that are accelerated.
2616         (WebCore::WebAnimation::timeToNextTick const): Compute the time until our animation completion or, in the case of CSS animations, the next iteration.
2617         * animation/WebAnimation.h:
2618
2619 2018-11-13  Miguel Gomez  <magomez@igalia.com>
2620
2621         [GTK][WPE] Incorrect tile coverage when resizing a layer out of the visible area
2622         https://bugs.webkit.org/show_bug.cgi?id=191545
2623
2624         Reviewed by Žan Doberšek.
2625
2626         Keep track of layer size changes even if they happen when the layer is not in the visible
2627         area, so we can update edge tiles when the layer gets visible.
2628
2629         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
2630         (WebCore::TiledBackingStore::createTiles):
2631         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
2632
2633 2018-11-12  Rob Buis  <rbuis@igalia.com>
2634
2635         Content-Type parameter values should allow empty quoted strings
2636         https://bugs.webkit.org/show_bug.cgi?id=191388
2637
2638         Reviewed by Dean Jackson.
2639
2640         According to RFC 2045 and https://mimesniff.spec.whatwg.org/#parsing-a-mime-type empty
2641         quoted strings are acceptable for Content-Type parameter values. They
2642         are accepted by Firefox and Chrome implementations as well.
2643
2644         Test: web-platform-tests/xhr/overridemimetype-blob.html
2645
2646         * platform/network/ParsedContentType.cpp:
2647         (WebCore::parseToken):
2648         (WebCore::parseQuotedString):
2649         (WebCore::parseContentType):
2650         * platform/network/ParsedContentType.h:
2651
2652 2018-11-12  Christopher Reid  <chris.reid@sony.com>
2653
2654         [Curl] Reject entire cookie if the domain fails a tailmatch.
2655         https://bugs.webkit.org/show_bug.cgi?id=191406
2656
2657         Reviewed by Youenn Fablet.
2658
2659         Currently we don't put domain attribute of cookie when it fails a tailmatch. As Firefox
2660         and Chrome do, we are going to reject the entire cookie if the domain fails a tailmatch instead.
2661         Also cleanup Cookie database implementation to make them testable better.
2662
2663         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
2664
2665         * platform/network/curl/CookieJarDB.cpp:
2666         (WebCore::CookieJarDB::canAcceptCookie): Added.
2667         (WebCore::CookieJarDB::setCookie):
2668         * platform/network/curl/CookieUtil.cpp:
2669         (WebCore::CookieUtil::parseCookieAttributes):
2670         (WebCore::CookieUtil::parseCookieHeader):
2671         * platform/network/curl/CookieUtil.h:
2672
2673 2018-11-12  Devin Rousso  <drousso@apple.com>
2674
2675         Web Inspector: Network: show secure certificate details per-request
2676         https://bugs.webkit.org/show_bug.cgi?id=191447
2677         <rdar://problem/30019476>
2678
2679         Reviewed by Joseph Pecoraro.
2680
2681         Test: http/tests/inspector/network/resource-response-security.html
2682
2683         * loader/ResourceLoader.h:
2684         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
2685         * loader/ResourceLoader.cpp:
2686         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added.
2687         Always save certificate information when WebInspector is open.
2688
2689         * platform/network/CertificateInfoBase.h: Added.
2690         (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const):
2691         (WebCore::CertificateInfoBase::summaryInfo const):
2692         (WebCore::CertificateInfoBase::isEmpty const):
2693         * platform/network/cf/CertificateInfo.h:
2694         (WebCore::CertificateInfo::summaryInfo const): Added.
2695         * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
2696         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
2697         (WebCore::CertificateInfo::summaryInfo const): Added.
2698         * platform/network/curl/CertificateInfo.h:
2699         (WebCore::CertificateInfo::summaryInfo const): Added.
2700         (WebCore::CertificateInfo::isEmpty const): Added.
2701         * platform/network/soup/CertificateInfo.h:
2702         (WebCore::CertificateInfo::summaryInfo const): Added.
2703         (WebCore::CertificateInfo::isEmpty const): Added.
2704         Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have
2705         platform-specific code in its implementation.
2706
2707         * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
2708         * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp.
2709         * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp.
2710
2711         * inspector/NetworkResourcesData.h:
2712         (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added.
2713         (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added.
2714         * inspector/NetworkResourcesData.cpp:
2715         (WebCore::NetworkResourcesData::responseReceived):
2716
2717         * inspector/agents/InspectorNetworkAgent.cpp:
2718         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
2719
2720         * PlatformAppleWin.cmake:
2721         * PlatformMac.cmake:
2722         * SourcesCocoa.txt:
2723         * WebCore.xcodeproj/project.pbxproj:
2724         * platform/Curl.cmake:
2725         * platform/SourcesSoup.txt:
2726
2727 2018-11-12  Zalan Bujtas  <zalan@apple.com>
2728
2729         Do not collapse the soon-to-be-parent anon block when we shuffle around the marker item renderer.
2730         https://bugs.webkit.org/show_bug.cgi?id=191554
2731         <rdar://problem/45825265>
2732
2733         Reviewed by Antti Koivisto.
2734
2735         While moving the marker item renderer to its correct subtree, we accidentally remove the soon-to-be parent anonymous block.
2736         Moving a renderer is a 2 step process:
2737         1. Detach the renderer from its current parent
2738         2. Attach it to its new parent.
2739         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
2740         is not needed anymore (except we use it as the new parent).
2741
2742         Test: fast/inline/marker-list-item-move-should-not-crash.html
2743
2744         * rendering/updating/RenderTreeBuilder.cpp:
2745         (WebCore::RenderTreeBuilder::detach):
2746         * rendering/updating/RenderTreeBuilder.h:
2747         * rendering/updating/RenderTreeBuilderBlock.cpp:
2748         (WebCore::RenderTreeBuilder::Block::detach):
2749         * rendering/updating/RenderTreeBuilderBlock.h:
2750         * rendering/updating/RenderTreeBuilderList.cpp:
2751         (WebCore::RenderTreeBuilder::List::updateItemMarker):
2752
2753 2018-11-12  Javier Fernandez  <jfernandez@igalia.com>
2754
2755         [css-grid] Refactoring to make more explicit the orthogonal items' pre-layout logic
2756         https://bugs.webkit.org/show_bug.cgi?id=191358
2757
2758         Reviewed by Manuel Rego Casasnovas.
2759
2760         These changes are just a refactoring to ease the integration of the new Baseline Alignment
2761         logic in a follow up patch.
2762
2763         We need to properly estimate the grid area size of orthogonal items so that we can perform
2764         an accurate pre-layout. This is important because orthogonal items will synthesize their baseline
2765         if they participate in any baseline alignment context.
2766
2767         No new tests, since no behavior change has been introduced in this patch.
2768
2769         * rendering/Grid.cpp:
2770         (WebCore::Grid::setNeedsItemsPlacement):
2771         * rendering/Grid.h:
2772         * rendering/GridTrackSizingAlgorithm.cpp:
2773         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
2774         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
2775         (WebCore::GridTrackSizingAlgorithm::isRelativeGridLengthAsAuto const):
2776         (WebCore::GridTrackSizingAlgorithm::isRelativeSizedTrackAsAuto const):
2777         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
2778         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const):
2779         (WebCore::GridTrackSizingAlgorithm::run):
2780         (WebCore::GridTrackSizingAlgorithm::reset):
2781         * rendering/GridTrackSizingAlgorithm.h:
2782         (WebCore::GridTrackSizingAlgorithmStrategy::gridTrackSize const):
2783         * rendering/RenderGrid.cpp:
2784         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
2785         (WebCore::RenderGrid::layoutBlock):
2786         (WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
2787         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
2788         (WebCore::RenderGrid::placeItemsOnGrid const):
2789         (WebCore::RenderGrid::performGridItemsPreLayout const):
2790         (WebCore::overrideSizeChanged):
2791         (WebCore::hasRelativeBlockAxisSize):
2792         (WebCore::RenderGrid::updateGridAreaLogicalSize const):
2793         (WebCore::RenderGrid::layoutGridItems):
2794         * rendering/RenderGrid.h:
2795
2796 2018-11-12  Sihui Liu  <sihui_liu@apple.com>
2797
2798         imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device
2799         https://bugs.webkit.org/show_bug.cgi?id=191500
2800
2801         Reviewed by Dean Jackson.
2802
2803         When double value is bigger than maximum unsigned int, converting double to unsigned int has
2804         different behaviors on macOS and iOS. On macOS, the result would be 0 while on iOS it would be
2805         maximum unsigned int.
2806
2807         Covered by existing test.
2808
2809         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2810         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
2811         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
2812
2813 2018-11-12  Basuke Suzuki  <basuke.suzuki@sony.com>
2814
2815         [Curl] Add API Test for Curl cookie backend.
2816         https://bugs.webkit.org/show_bug.cgi?id=191493
2817
2818         Reviewed by Youenn Fablet.
2819
2820         Refactoring for cookie backend interface.
2821
2822         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
2823
2824         * platform/FileSystem.h:
2825         * platform/network/curl/CookieJarCurlDatabase.cpp:
2826         (WebCore::cookiesForSession):
2827         (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const):
2828         (WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const):
2829         (WebCore::CookieJarCurlDatabase::getRawCookies const):
2830         * platform/network/curl/CookieJarDB.cpp:
2831         (WebCore::CookieJarDB::openDatabase):
2832         (WebCore::CookieJarDB::checkSQLiteReturnCode):
2833         (WebCore::CookieJarDB::isEnabled const):
2834         (WebCore::CookieJarDB::searchCookies):
2835         (WebCore::CookieJarDB::setCookie):
2836         (WebCore::CookieJarDB::deleteCookie):
2837         (WebCore::CookieJarDB::deleteCookieInternal):
2838         (WebCore::CookieJarDB::deleteCookies):
2839         (WebCore::CookieJarDB::deleteAllCookies):
2840         (WebCore::CookieJarDB::executeSimpleSql):
2841         (WebCore::CookieJarDB::isEnabled): Deleted.
2842         * platform/network/curl/CookieJarDB.h:
2843         * platform/network/curl/CookieUtil.cpp:
2844         (WebCore::CookieUtil::parseCookieHeader):
2845         * platform/network/curl/CookieUtil.h:
2846         * platform/win/FileSystemWin.cpp:
2847         (WebCore::FileSystem::generateTemporaryPath):
2848         (WebCore::FileSystem::openTemporaryFile):
2849         (WebCore::FileSystem::createTemporaryDirectory):
2850         (WebCore::FileSystem::deleteNonEmptyDirectory):
2851
2852 2018-11-12  Tim Horton  <timothy_horton@apple.com>
2853
2854         Make it possible to edit images inline
2855         https://bugs.webkit.org/show_bug.cgi?id=191352
2856         <rdar://problem/30107985>
2857
2858         Reviewed by Dean Jackson.
2859
2860         Tests: editing/images/basic-editable-image.html
2861                editing/images/reparent-editable-image-maintains-strokes.html
2862
2863         Add the beginnings of a mechanism to replace images with a special attribute
2864         with a native drawing view in the UI process.
2865
2866         * page/Settings.yaml:
2867         Add a setting to control whether images become natively editable when they
2868         have the x-apple-editable-image attribute.
2869
2870         * html/HTMLImageElement.cpp:
2871         (WebCore::HTMLImageElement::editableImageViewID const):
2872         Lazily generate an EmbeddedViewID and persist it on the <img> element.
2873
2874         * html/HTMLImageElement.h:
2875         Rearrange the service controls methods to sit before the members.
2876         Add m_editableImageViewID and editableImageViewID().
2877
2878         * platform/graphics/GraphicsLayer.cpp:
2879         (WebCore::GraphicsLayer::nextEmbeddedViewID):
2880         * platform/graphics/GraphicsLayer.h:
2881         (WebCore::GraphicsLayer::setContentsToEmbeddedView):
2882         Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
2883         on Cocoa platforms and when using RemoteLayerTree.
2884         Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
2885         Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
2886         and an EmbeddedViewID to uniquely identify and communicate about the
2887         embedded view (which may move between layers, since it is tied to an element).
2888
2889         * platform/graphics/ca/GraphicsLayerCA.cpp:
2890         (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
2891         (WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
2892         When setting GraphicsLayer's contents to an embedded view, we use
2893         a special PlatformCALayer factory that takes the EmbeddedViewID and type.
2894         GraphicsLayerCARemote will override this and make a correctly-initialized
2895         PlatformCALayerRemote that keeps track of the EmbeddedViewID.
2896
2897         * platform/graphics/ca/GraphicsLayerCA.h:
2898         * platform/graphics/ca/PlatformCALayer.cpp:
2899         (WebCore::operator<<):
2900         * platform/graphics/ca/PlatformCALayer.h:
2901         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2902         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2903         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
2904         (WebCore::PlatformCALayerCocoa::embeddedViewID const):
2905         Add stubs and logging for EmbeddedViewID on PlatformCALayer.
2906         These will be overridden by PlatformCALayerRemote to do more interesting things.
2907
2908         * rendering/RenderImage.cpp:
2909         (WebCore::RenderImage::isEditableImage const):
2910         Add a getter that return true if the setting is enabled and
2911         x-apple-editable-image is empty or true.
2912
2913         (WebCore::RenderImage::requiresLayer const):
2914         RenderImage requires a layer either if RenderReplaced does, or we are an
2915         editable image.
2916
2917         * rendering/RenderImage.h:
2918         * rendering/RenderLayer.cpp:
2919         (WebCore::RenderLayer::shouldBeNormalFlowOnly const):
2920         (WebCore::RenderLayer::calculateClipRects const):
2921         * rendering/RenderLayerBacking.cpp:
2922         (WebCore::RenderLayerBacking::updateConfiguration):
2923         Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
2924
2925         * rendering/RenderLayerCompositor.cpp:
2926         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2927         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2928         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2929         (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
2930         * rendering/RenderLayerCompositor.h:
2931         Make editable images require compositing implicitly.
2932
2933 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
2934
2935         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
2936         https://bugs.webkit.org/show_bug.cgi?id=189230
2937         <rdar://problem/44050379>
2938
2939         Reviewed by Joseph Pecoraro.
2940
2941         Runs all png images through zopflipng. This results in a smaller file
2942         size and takes care of this issue as a byproduct.
2943
2944         * Modules/modern-media-controls/images/iOS/airplay-placard@1x.png:
2945         * Modules/modern-media-controls/images/iOS/airplay-placard@2x.png:
2946         * Modules/modern-media-controls/images/iOS/airplay-placard@3x.png:
2947         * Modules/modern-media-controls/images/iOS/invalid-placard@1x.png:
2948         * Modules/modern-media-controls/images/iOS/invalid-placard@2x.png:
2949         * Modules/modern-media-controls/images/iOS/invalid-placard@3x.png:
2950         * Modules/modern-media-controls/images/iOS/pip-placard@1x.png:
2951         * Modules/modern-media-controls/images/iOS/pip-placard@2x.png:
2952         * Modules/modern-media-controls/images/iOS/pip-placard@3x.png:
2953         * Modules/modern-media-controls/images/macOS/airplay-placard@1x.png:
2954         * Modules/modern-media-controls/images/macOS/airplay-placard@2x.png:
2955         * Modules/modern-media-controls/images/macOS/invalid-placard@1x.png:
2956         * Modules/modern-media-controls/images/macOS/invalid-placard@2x.png:
2957         * Modules/modern-media-controls/images/macOS/pip-placard@1x.png:
2958         * Modules/modern-media-controls/images/macOS/pip-placard@2x.png:
2959         * Resources/AttachmentPlaceholder.png:
2960         * Resources/AttachmentPlaceholder@2x.png:
2961         * Resources/ListButtonArrow.png:
2962         * Resources/ListButtonArrow@2x.png:
2963         * Resources/missingImage.png:
2964         * Resources/missingImage@2x.png:
2965         * Resources/missingImage@3x.png:
2966         * Resources/moveCursor.png:
2967         * Resources/northEastSouthWestResizeCursor.png:
2968         * Resources/northSouthResizeCursor.png:
2969         * Resources/northWestSouthEastResizeCursor.png:
2970         * Resources/nullPlugin.png:
2971         * Resources/nullPlugin@2x.png:
2972         * Resources/panIcon.png:
2973         * Resources/textAreaResizeCorner.png:
2974         * Resources/textAreaResizeCorner@2x.png:
2975         * Resources/urlIcon.png:
2976
2977 2018-11-12  Youenn Fablet  <youenn@apple.com>
2978
2979         RealtimeOutgoing A/V sources should observe their sources only if having a sink
2980         https://bugs.webkit.org/show_bug.cgi?id=191490
2981
2982         Reviewed by Eric Carlson.
2983
2984         Observe the source that generates media based on the sinks:
2985         - Do not observe at creation time
2986         - For first sink, start observing
2987         - When no more sink, stop observing
2988         Apply this principle for both outgoing audio and video sources.
2989         Add locks for the sinks to ensure thread-safety.
2990         Make sinks HashSet which is more robust.
2991
2992         Do some refactoring to better isolate generic outgoing sources from Cocoa/GTK implementations.
2993
2994         Covered by existing tests and updated webrtc/remove-track.html.
2995
2996         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
2997         (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource):
2998         (WebCore::RealtimeOutgoingAudioSource::stop):
2999         (WebCore::RealtimeOutgoingAudioSource::AddSink):
3000         (WebCore::RealtimeOutgoingAudioSource::RemoveSink):
3001         (WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
3002         * platform/mediastream/RealtimeOutgoingAudioSource.h:
3003         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
3004         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
3005         (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource):
3006         (WebCore::RealtimeOutgoingVideoSource::observeSource):
3007         (WebCore::RealtimeOutgoingVideoSource::setSource):
3008         (WebCore::RealtimeOutgoingVideoSource::stop):
3009         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
3010         (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
3011         * platform/mediastream/RealtimeOutgoingVideoSource.h:
3012         (WebCore::RealtimeOutgoingVideoSource::isSilenced const):
3013         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
3014         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
3015         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
3016         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
3017         (WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable):
3018         (WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData):
3019         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
3020         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
3021         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
3022
3023 2018-11-12  Youenn Fablet  <youenn@apple.com>
3024
3025         Support setting stream ids when adding a transceiver
3026         https://bugs.webkit.org/show_bug.cgi?id=191307
3027
3028         Reviewed by Eric Carlson.
3029
3030         Add support for streams in RTCTransceiverInit.
3031         Add plumbing down to libwebrtc.
3032         Covered by rebased tests.
3033
3034         * Modules/mediastream/RTCPeerConnection.h:
3035         * Modules/mediastream/RTCPeerConnection.idl:
3036         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
3037         (WebCore::fromRtpTransceiverInit):
3038
3039 2018-11-12  Antti Koivisto  <antti@apple.com>
3040
3041         Support dynamic pseudo-classes on elements with display: contents
3042         https://bugs.webkit.org/show_bug.cgi?id=181640
3043         <rdar://problem/36605415>
3044
3045         Reviewed by Dean Jackson.
3046
3047         The code for :hover and :active style invalidation assumes that only elements with renderer need invalidation.
3048
3049         This patch fixes '.display-content-element:hover span' case but not '.display-content-element:hover' case but
3050         includes tests for both. The latter is not super useful anyway (as it only affects rendering with inherited
3051         text properties).
3052
3053         Test: fast/css/display-contents-hover-active.html
3054
3055         * dom/Document.cpp:
3056         (WebCore::Document::updateHoverActiveState):
3057
3058             Traverse up in composed tree instead of render tree when invalidating. This has the same order as render tree
3059             but also includes display:content elements. This also allows removing the special display:none case.
3060
3061         * dom/Element.cpp:
3062         (WebCore::Element::setActive):
3063         (WebCore::Element::setHovered):
3064
3065             Also look into display:contents style for invalidation checks.
3066
3067         (WebCore::Element::renderOrDisplayContentsStyle const):
3068
3069             Make this helper an Element member.
3070
3071         * dom/Element.h:
3072         * dom/Node.cpp:
3073         (WebCore::Node::parentElementInComposedTree const):
3074
3075             Support starting from a PseudoElement. This is consistent with ComposedTreeAncestorIterator.
3076
3077         * rendering/updating/RenderTreePosition.cpp:
3078         (WebCore::RenderTreePosition::nextSiblingRenderer const):
3079         * style/StyleTreeResolver.cpp:
3080         (WebCore::Style::TreeResolver::resolveElement):
3081         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
3082         (WebCore::Style::shouldResolveElement):
3083         (WebCore::Style::TreeResolver::resolveComposedTree):
3084         (WebCore::Style::renderOrDisplayContentsStyle): Deleted.
3085
3086             Use the Element::renderOrDisplayContentsStyle() instead.
3087
3088 2018-11-12  Antoine Quint  <graouts@apple.com>
3089
3090         [Web Animations] Turn Web Animations experimental
3091         https://bugs.webkit.org/show_bug.cgi?id=191543
3092
3093         Reviewed by Dean Jackson.
3094
3095         * page/RuntimeEnabledFeatures.h:
3096
3097 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
3098
3099         feFlood with alpha color doesn't work correctly
3100         https://bugs.webkit.org/show_bug.cgi?id=163666
3101
3102         Reviewed by Zalan Bujtas.
3103         
3104         FEFlood::platformApplySoftware() erroneously used colorWithOverrideAlpha()
3105         rather than multiplying the flood color with the flood opacity as other browsers do.
3106
3107         Test: svg/filters/feFlood-with-alpha-color.html
3108
3109         * platform/graphics/Color.cpp:
3110         (WebCore::Color::colorWithAlpha const): I tried using colorWithAlphaMultipliedBy() elsewhere,
3111         and it triggered a behavior change, so add a comment.
3112         * platform/graphics/filters/FEFlood.cpp:
3113         (WebCore::FEFlood::platformApplySoftware):
3114         * svg/SVGStopElement.cpp:
3115         (WebCore::SVGStopElement::stopColorIncludingOpacity const):
3116
3117 2018-11-12  Eric Carlson  <eric.carlson@apple.com>
3118
3119         Require <iframe allow="display"> for an iframe to use getDisplayMedia
3120         https://bugs.webkit.org/show_bug.cgi?id=191505
3121         <rdar://problem/45968811>
3122
3123         Reviewed by Jer Noble.
3124
3125         Test: http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html
3126
3127         * Modules/mediastream/MediaDevicesRequest.cpp:
3128         (WebCore::MediaDevicesRequest::start):
3129         * Modules/mediastream/UserMediaController.cpp:
3130         (WebCore::isAllowedToUse):
3131         (WebCore::UserMediaController::canCallGetUserMedia):
3132         (WebCore::UserMediaController::logGetUserMediaDenial):
3133         * Modules/mediastream/UserMediaController.h:
3134         * Modules/mediastream/UserMediaRequest.cpp:
3135         (WebCore::UserMediaRequest::start):
3136
3137 2018-11-12  Simon Fraser  <simon.fraser@apple.com>
3138
3139         Make compositing updates incremental
3140         https://bugs.webkit.org/show_bug.cgi?id=90342
3141
3142         Reviewed by Antti Koivisto.
3143
3144         Previously, updating compositing layers required two full RenderLayer tree traversals,
3145         and all the work was done for every RenderLayer on each composting update. This could be expensive
3146         on pages with lots of RenderLayers.
3147
3148         These changes make compositing updates more incremental. Compositing updates still require
3149         two tree traversals. The first determines which RenderLayers need to be composited (of those which
3150         weren't already made composited at style-change time), because of reasons that can only be determined
3151         post-layout, and indirect reasons including overlap. The second traversal updates the configuration, geometry
3152         and GraphicsLayer tree for the composited layers. Dependencies on both descendant and ancestor state make
3153         it hard to fold these two traversals together.
3154
3155         In order to minimize the work done during these traversals, dirty bits are stored on RenderLayers,
3156         and propagated to ancestor layers in paint order. There are two sets of bits: those related to the first
3157         "compositing requirements" traversal, and those related to the second "update backing and hierarchy" traversal.
3158         When a RenderLayer gets a dirty bit set, bits are propagated to ancestors to indicate that children need
3159         to be visited.
3160
3161         Sadly entire subtrees can't be skipped during the "compositing requirements" traversal because we still have
3162         to accumulate overlap rects, but RenderLayerCompositor::traverseUnchangedSubtree() is used to minimize
3163         work in that case. Subtrees can be skipped in the "update backing and hierarchy" traversal. Entire traversals can
3164         be skipped if no change has triggered the need for that traversal.
3165         
3166         These changes fix a correctness issue where transform changes now trigger overlap re-evaluation, which causes
3167         more layer geometry updates than before. This regressed the MotionMark "Focus" test, when geometry updates
3168         triggered layer resizes as the filter blur radius changed, which then triggered repaints. This is fixed by
3169         excluding composited filters from the composited bounds (but still taking them into account for overlap).
3170
3171         Care is taken to avoid triggering traversals in non-composited documents (tested by no-updates-in-non-composited-iframe.html).
3172
3173         Code to set the dirty bits is added in various places that change properties that compositing depends on.
3174         
3175         These changes also subsume the patch in 176196; we now never consult properties that rely on layout from the
3176         style change code path, and the only call stack for geometry updates is from the "update backing and hierarchy"
3177         traversal, which is always a pre-order traversal.
3178
3179         Tests: compositing/geometry/stacking-context-change-layer-reparent.html
3180                compositing/layer-creation/change-to-overlap.html
3181                compositing/updates/no-updates-in-non-composited-iframe.html
3182
3183         * html/canvas/WebGLRenderingContextBase.cpp:
3184         (WebCore::WebGLRenderingContextBase::markContextChanged): Need to differentiate between a canvas becoming composited
3185         for the first time, and its pixels changing with a new 'CanvasPixelsChanged' value.
3186         * page/FrameView.cpp:
3187         (WebCore::FrameView::setViewportConstrainedObjectsNeedLayout):
3188         * page/Page.cpp:
3189         (WebCore::Page::setPageScaleFactor):
3190         * platform/graphics/ca/GraphicsLayerCA.cpp:
3191         (WebCore::GraphicsLayerCA::updateBackdropFilters): If we just made a layer for backdrops, we need to update sublayers.
3192         * rendering/RenderBox.cpp:
3193         (WebCore::RenderBox::styleWillChange):
3194         * rendering/RenderLayer.cpp:
3195         (WebCore::RenderLayer::RenderLayer):
3196         (WebCore::RenderLayer::~RenderLayer):
3197         (WebCore::RenderLayer::addChild):
3198         (WebCore::RenderLayer::removeChild):
3199         (WebCore::RenderLayer::shouldBeStackingContext const):
3200         (WebCore::RenderLayer::stackingContext const):
3201         (WebCore::RenderLayer::dirtyZOrderLists):
3202         (WebCore::RenderLayer::dirtyNormalFlowList):
3203         (WebCore::RenderLayer::updateNormalFlowList):
3204         (WebCore::RenderLayer::rebuildZOrderLists):
3205         (WebCore::RenderLayer::setAncestorsHaveCompositingDirtyFlag):
3206         (WebCore::RenderLayer::contentChanged):
3207         (WebCore::RenderLayer::updateLayerPositions):
3208         (WebCore::RenderLayer::updateTransform):
3209         (WebCore::RenderLayer::updateLayerPosition):
3210         (WebCore::RenderLayer::enclosingCompositingLayer const):
3211         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
3212         (WebCore::RenderLayer::clippingRootForPainting const):
3213         (WebCore::RenderLayer::scrollTo):
3214         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
3215         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
3216         (WebCore::RenderLayer::paintLayerContents):
3217         (WebCore::RenderLayer::hitTest):
3218         (WebCore::RenderLayer::hitTestLayer):
3219         (WebCore::RenderLayer::calculateClipRects const):
3220         (WebCore::outputPaintOrderTreeLegend):
3221         (WebCore::outputPaintOrderTreeRecursive):
3222         (WebCore::compositingContainer): Deleted.
3223         * rendering/RenderLayer.h:
3224         (WebCore::RenderLayer::clearZOrderLists):
3225         (WebCore::RenderLayer::paintOrderParent const):
3226         * rendering/RenderLayerBacking.cpp:
3227         (WebCore::RenderLayerBacking::updateCompositedBounds):
3228         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
3229         (WebCore::RenderLayerBacking::updateAfterLayout):
3230         (WebCore::RenderLayerBacking::updateConfigurationAfterStyleChange):
3231         (WebCore::RenderLayerBacking::updateConfiguration):
3232         (WebCore::RenderLayerBacking::updateGeometry):
3233         (WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
3234         (WebCore::RenderLayerBacking::updateMaskingLayer):
3235         (WebCore::RenderLayerBacking::paintsContent const):
3236         (WebCore::RenderLayerBacking::contentChanged):
3237         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
3238         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
3239         (WebCore::RenderLayerBacking::startAnimation):
3240         (WebCore::RenderLayerBacking::animationFinished):
3241         (WebCore::RenderLayerBacking::startTransition):
3242         (WebCore::RenderLayerBacking::transitionFinished):
3243         (WebCore::RenderLayerBacking::setCompositedBounds):
3244         * rendering/RenderLayerBacking.h:
3245         * rendering/RenderLayerCompositor.cpp:
3246         (WebCore::RenderLayerCompositor::CompositingState::CompositingState):
3247         (WebCore::RenderLayerCompositor::enableCompositingMode):
3248         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
3249         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlagsAfterLayout):
3250         (WebCore::RenderLayerCompositor::willRecalcStyle):
3251         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
3252         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3253         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3254         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
3255         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
3256         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
3257         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
3258         (WebCore::RenderLayerCompositor::logLayerInfo):
3259         (WebCore::clippingChanged):
3260         (WebCore::styleAffectsLayerGeometry):
3261         (WebCore::RenderLayerCompositor::layerStyleChanged):
3262         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
3263         (WebCore::RenderLayerCompositor::updateBacking):
3264         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
3265         (WebCore::RenderLayerCompositor::layerWasAdded):
3266         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
3267         (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
3268         (WebCore::RenderLayerCompositor::computeExtent const):
3269         (WebCore::RenderLayerCompositor::addToOverlapMap):
3270         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
3271         (WebCore::RenderLayerCompositor::rootLayerConfigurationChanged):
3272         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
3273         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
3274         (WebCore::RenderLayerCompositor::needsToBeComposited const):
3275         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
3276         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
3277         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
3278         (WebCore::RenderLayerCompositor::clippedByAncestor const):
3279         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
3280         (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
3281         (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
3282         (WebCore::RenderLayerCompositor::requiresCompositingForFilters const):
3283         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
3284         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
3285         (WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
3286         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
3287         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
3288         (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
3289         (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):
3290         (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
3291         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
3292         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
3293         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
3294         (WebCore::operator<<):
3295         (WebCore::RenderLayerCompositor::setCompositingLayersNeedRebuild): Deleted.
3296         (WebCore::checkIfDescendantClippingContextNeedsUpdate): Deleted.
3297         (WebCore::isScrollableOverflow): Deleted.
3298         (WebCore::styleHasTouchScrolling): Deleted.
3299         (WebCore::styleChangeRequiresLayerRebuild): Deleted.
3300         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Deleted.
3301         (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged): Deleted.
3302         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): Deleted.
3303         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): Deleted.
3304         * rendering/RenderLayerCompositor.h:
3305         * rendering/RenderTreeAsText.cpp:
3306         (WebCore::writeLayers):
3307
3308 2018-11-12  Rob Buis  <rbuis@igalia.com>
3309
3310         CSSCalcOperation constructor wastes 6KB of Vector capacity on cnn.com
3311         https://bugs.webkit.org/show_bug.cgi?id=190839
3312
3313         Reviewed by Frédéric Wang.
3314
3315         The CSSCalcOperation ctor that takes a leftSide and rightSide parameter
3316         wastes memory since it will always have size 2 but claims the
3317         default Vector size. So make sure to reserve an initial capacity of 2.
3318
3319         * css/CSSCalculationValue.cpp:
3320
3321 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3322
3323         WTFMove(xxx) is used in arguments while other arguments touch xxx
3324         https://bugs.webkit.org/show_bug.cgi?id=191544
3325
3326         Reviewed by Alex Christensen.
3327
3328         The order of the evaluation of C++ arguments is undefined. If we use WTFMove(xxx),
3329         xxx should not be touched in the other arguments. This patch fixes such uses in
3330         IDB code.
3331
3332         * Modules/indexeddb/IDBObjectStore.cpp:
3333         (WebCore::IDBObjectStore::deleteIndex):
3334         * Modules/indexeddb/IDBTransaction.cpp:
3335         (WebCore::IDBTransaction::scheduleOperation):
3336         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3337         (WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
3338         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3339         (WebCore::IDBServer::MemoryObjectStore::registerIndex):
3340
3341 2018-11-12  Zalan Bujtas  <zalan@apple.com>
3342
3343         [LFC][IFC] Construct dedicated runs when the inline element requires it.
3344         https://bugs.webkit.org/show_bug.cgi?id=191509
3345
3346         Reviewed by Antti Koivisto.
3347
3348         In certain cases, a run can overlap multiple inline elements like this:
3349
3350         <span>normal text content</span><span style="position: relative; left: 10px;">but this one needs a dedicated run</span><span>end of text</span>
3351
3352         The content above generates one long run <normal text contentbut this one needs dedicated runend of text> <- input to line breaking.
3353         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.
3354
3355         * layout/inlineformatting/InlineFormattingContext.cpp:
3356         (WebCore::Layout::InlineFormattingContext::layout const):
3357         (WebCore::Layout::contentRequiresSeparateRun):
3358         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
3359         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
3360         (WebCore::Layout::InlineFormattingContext::closeLine const):
3361         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
3362         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3363         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
3364         * layout/inlineformatting/InlineFormattingContext.h:
3365         (WebCore::Layout::InlineFormattingContext::inlineFormattingState const):
3366         * layout/inlineformatting/InlineLineBreaker.cpp:
3367         (WebCore::Layout::InlineLineBreaker::nextRun): mid-word breaking is not implemented yet.
3368         * layout/inlineformatting/InlineRun.h:
3369         (WebCore::Layout::InlineRun::overlapsMultipleInlineItems const):
3370         * layout/inlineformatting/InlineRunProvider.cpp:
3371         (WebCore::Layout::InlineRunProvider::processInlineTextItem):
3372         * layout/inlineformatting/InlineRunProvider.h:
3373         (WebCore::Layout::InlineRunProvider::Run::TextContext::expand):
3374         (WebCore::Layout::InlineRunProvider::Run::textContext):
3375         (WebCore::Layout::InlineRunProvider::Run::TextContext::setStart): Deleted.
3376         (WebCore::Layout::InlineRunProvider::Run::TextContext::setLength): Deleted.
3377
3378 2018-11-12  Jer Noble  <jer.noble@apple.com>
3379
3380         [MSE] Frame re-ordering can cause iframes to never be enqueued
3381         https://bugs.webkit.org/show_bug.cgi?id=191485
3382
3383         Reviewed by Eric Carlson.
3384
3385         Test: media/media-source/media-source-dropped-iframe.html
3386
3387         Some frame re-ordering techniques result in files where the first frame has a
3388         decode timestamp < 0, but a presentation timestamp >= 0. When appending these
3389         samples to existing content, we can fail to enqueue the first frame because its
3390         DTS overlaps an existing sample, but the presentation timestamp does not.
3391         Rather than try to only enqueue samples whose decode timestamps are > than the
3392         greatest decode end timestamp (minus some fudge factor), allow all frames to be
3393         added to the decode queue if they are strictly ordered greater than the last
3394         enqueued frame.
3395
3396         * Modules/mediasource/SourceBuffer.cpp:
3397         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
3398         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3399         (WebCore::SourceBuffer::provideMediaData):
3400         (WebCore::SourceBuffer::reenqueueMediaForTime):
3401
3402 2018-11-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3403
3404         IDBTransaction does not use "RefPtr<IDBTransaction> self"
3405         https://bugs.webkit.org/show_bug.cgi?id=190436