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