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