[Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2
3         [Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
4         https://bugs.webkit.org/show_bug.cgi?id=189530
5
6         Reviewed by Alex Christensen.
7
8         Curl port uses the start time libcurl provided. But there's a lug between main thread and Curl thread.
9         Record the start time of request instead of libcurl's start timing and use it to measure the metrics.
10         Also respondEnd was not correctly recorded and fixed.
11
12         No new tests because it cannot be measured from DRT.
13
14         * platform/network/ResourceHandleInternal.h:
15         * platform/network/curl/CurlContext.cpp:
16         (WebCore::CurlHandle::getNetworkLoadMetrics):
17         * platform/network/curl/CurlContext.h:
18         * platform/network/curl/CurlRequest.cpp:
19         (WebCore::CurlRequest::start):
20         (WebCore::CurlRequest::setupTransfer):
21         (WebCore::CurlRequest::didCompleteTransfer):
22         (WebCore::CurlRequest::updateNetworkLoadMetrics):
23         * platform/network/curl/CurlRequest.h:
24         (WebCore::CurlRequest::setStartTime):
25         * platform/network/curl/ResourceHandleCurl.cpp:
26         (WebCore::ResourceHandle::start):
27         (WebCore::ResourceHandle::restartRequestWithCredential):
28         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
29         (WebCore::ResourceHandle::willSendRequest):
30         (WebCore::ResourceHandle::continueAfterWillSendRequest):
31
32 2018-09-14  Justin Fan  <justin_fan@apple.com>
33
34         WebGL 2 conformance: rgb-format-support.html
35         https://bugs.webkit.org/show_bug.cgi?id=189610
36         <rdar://problem/44403343>
37
38         Reviewed by Dean Jackson.
39
40         Implementing getInternalformatParameter (emulating on macOS) and updating 
41         renderbufferStorage{Multisample} for WebGL 2 conformance. 
42
43         Test: webgl/2.0.0/conformance2/rendering/rgb-format-support.html enabled.
44
45         * html/canvas/WebGL2RenderingContext.cpp:
46         (WebCore::isRenderableInternalformat):
47         (WebCore::WebGL2RenderingContext::getInternalformatParameter):
48         (WebCore::WebGL2RenderingContext::renderbufferStorageMultisample):
49         (WebCore::WebGL2RenderingContext::renderbufferStorage):
50         (WebCore::WebGL2RenderingContext::baseInternalFormatFromInternalFormat):
51         (WebCore::WebGL2RenderingContext::isIntegerFormat):
52         * platform/graphics/GraphicsContext3D.h:
53         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
54         (WebCore::GraphicsContext3D::getInternalformativ):
55         (WebCore::GraphicsContext3D::renderbufferStorageMultisample):
56
57 2018-09-14  Justin Michaud  <justin_michaud@apple.com>
58
59         Add support for spreadMethod=reflect and repeat on SVG gradients (for CoreGraphics platforms)
60         https://bugs.webkit.org/show_bug.cgi?id=5968
61
62         Add support for spreadMethod=repeat and reflect. Also, the opacity of a gradient is now
63         the result of multiplying stop-opacity with the opacity of the color.
64
65         Reviewed by Simon Fraser.
66
67         Tests: svg/gradients/spreadMethod-expected.svg
68                svg/gradients/spreadMethod.svg
69                svg/gradients/spreadMethodAlpha-expected.svg
70                svg/gradients/spreadMethodAlpha.svg
71                svg/gradients/spreadMethodClose0-expected-mismatch.svg
72                svg/gradients/spreadMethodClose0.svg
73                svg/gradients/spreadMethodClose1-expected-mismatch.svg
74                svg/gradients/spreadMethodClose1.svg
75                svg/gradients/spreadMethodClose2-expected.svg
76                svg/gradients/spreadMethodClose2.svg
77                svg/gradients/spreadMethodDiagonal-expected.svg
78                svg/gradients/spreadMethodDiagonal.svg
79                svg/gradients/spreadMethodDiagonal2-expected.svg
80                svg/gradients/spreadMethodDiagonal2.svg
81                svg/gradients/spreadMethodDuplicateStop-expected.svg
82                svg/gradients/spreadMethodDuplicateStop.svg
83                svg/gradients/spreadMethodReversed-expected.svg
84                svg/gradients/spreadMethodReversed.svg
85                svg/gradients/stopAlpha-expected.svg
86                svg/gradients/stopAlpha.svg
87
88         * platform/graphics/cg/GradientCG.cpp:
89         (WebCore::Gradient::paint):
90         * svg/SVGStopElement.cpp:
91         (WebCore::SVGStopElement::stopColorIncludingOpacity const):
92
93 2018-09-14  Ryan Haddad  <ryanhaddad@apple.com>
94
95         Unreviewed, attempt to fix the iOSMac build after r236015.
96
97         * platform/graphics/cv/PixelBufferResizer.mm:
98         (WebCore::PixelBufferResizer::PixelBufferResizer):
99
100 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
101
102         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
103         https://bugs.webkit.org/show_bug.cgi?id=189521
104
105         Reviewed by Tim Horton.
106         
107         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
108         
109         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
110         
111         All the other changes are just to adapt to the new ownership patterns.
112         
113         I verified that no GraphicsLayers were leaked or abandoned after this change.
114
115         No behavior change.
116
117         * page/PageOverlayController.cpp:
118         (WebCore::PageOverlayController::layerWithDocumentOverlays):
119         (WebCore::PageOverlayController::layerWithViewOverlays):
120         (WebCore::PageOverlayController::installPageOverlay):
121         (WebCore::PageOverlayController::uninstallPageOverlay):
122         (WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
123         (WebCore::PageOverlayController::didChangeViewSize):
124         (WebCore::PageOverlayController::didChangeDocumentSize):
125         (WebCore::PageOverlayController::didChangeSettings):
126         (WebCore::PageOverlayController::paintContents):
127         (WebCore::PageOverlayController::didChangeOverlayFrame):
128         (WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
129         * page/PageOverlayController.h:
130         * page/mac/ServicesOverlayController.h:
131         (WebCore::ServicesOverlayController::Highlight::layer const):
132         * page/mac/ServicesOverlayController.mm:
133         (WebCore::ServicesOverlayController::Highlight::Highlight):
134         (WebCore::ServicesOverlayController::Highlight::invalidate):
135         (WebCore::ServicesOverlayController::Highlight::fadeIn):
136         (WebCore::ServicesOverlayController::Highlight::fadeOut):
137         (WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
138         (WebCore::ServicesOverlayController::determineActiveHighlight):
139         * platform/graphics/GraphicsLayer.cpp:
140         (WebCore::GraphicsLayer::GraphicsLayer):
141         (WebCore::GraphicsLayer::willBeDestroyed):
142         (WebCore::GraphicsLayer::setChildren):
143         (WebCore::GraphicsLayer::addChild):
144         (WebCore::GraphicsLayer::addChildAtIndex):
145         (WebCore::GraphicsLayer::addChildBelow):
146         (WebCore::GraphicsLayer::addChildAbove):
147         (WebCore::GraphicsLayer::replaceChild):
148         (WebCore::GraphicsLayer::removeAllChildren):
149         (WebCore::GraphicsLayer::removeFromParent):
150         (WebCore::GraphicsLayer::setMaskLayer):
151         (WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
152         (WebCore::GraphicsLayer::distributeOpacity):
153         (WebCore::GraphicsLayer::traverse):
154         (WebCore::dumpChildren):
155         * platform/graphics/GraphicsLayer.h:
156         (WebCore::GraphicsLayer::children const):
157         (WebCore::GraphicsLayer::children):
158         (WebCore::GraphicsLayer::maskLayer const):
159         (WebCore::GraphicsLayer::replicaLayer const):
160         (WebCore::GraphicsLayer::beingDestroyed const):
161         (WebCore::GraphicsLayer:: const): Deleted.
162         * platform/graphics/GraphicsLayerFactory.h:
163         * platform/graphics/ca/GraphicsLayerCA.cpp:
164         (WebCore::GraphicsLayer::create):
165         (WebCore::GraphicsLayerCA::setChildren):
166         (WebCore::GraphicsLayerCA::addChild):
167         (WebCore::GraphicsLayerCA::addChildAtIndex):
168         (WebCore::GraphicsLayerCA::addChildBelow):
169         (WebCore::GraphicsLayerCA::addChildAbove):
170         (WebCore::GraphicsLayerCA::replaceChild):
171         (WebCore::GraphicsLayerCA::setMaskLayer):
172         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
173         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
174         (WebCore::GraphicsLayerCA::updateSublayerList):
175         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
176         * platform/graphics/ca/GraphicsLayerCA.h:
177         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
178         (WebCore::GraphicsLayer::create):
179         (WebCore::GraphicsLayerTextureMapper::setChildren):
180         (WebCore::GraphicsLayerTextureMapper::addChild):
181         (WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
182         (WebCore::GraphicsLayerTextureMapper::addChildAbove):
183         (WebCore::GraphicsLayerTextureMapper::addChildBelow):
184         (WebCore::GraphicsLayerTextureMapper::replaceChild):
185         (WebCore::GraphicsLayerTextureMapper::setMaskLayer):
186         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
187         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
188         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
189         (WebCore::GraphicsLayer::create):
190         (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
191         (WebCore::CoordinatedGraphicsLayer::addChild):
192         (WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
193         (WebCore::CoordinatedGraphicsLayer::addChildAbove):
194         (WebCore::CoordinatedGraphicsLayer::addChildBelow):
195         (WebCore::CoordinatedGraphicsLayer::replaceChild):
196         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
197         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
198         (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
199         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
200         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
201         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
202         (WebCore::GraphicsLayer::create):
203         (WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
204         (WebCore::GraphicsLayerDirect2D::initialize): Deleted.
205         (WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
206         (WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
207         (WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
208         * rendering/RenderLayerBacking.cpp:
209         (WebCore::RenderLayerBacking::createGraphicsLayer):
210         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
211         (WebCore::RenderLayerBacking::updateConfiguration):
212         (WebCore::RenderLayerBacking::updateInternalHierarchy):
213         (WebCore::RenderLayerBacking::updateMaskingLayer):
214         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
215         (WebCore::RenderLayerBacking::updateScrollingLayers):
216         * rendering/RenderLayerBacking.h:
217         * rendering/RenderLayerCompositor.cpp:
218         (WebCore::RenderLayerCompositor::updateCompositingLayers):
219         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
220         (WebCore::RenderLayerCompositor::setCompositingParent):
221         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
222         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
223         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
224         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
225         (WebCore::RenderLayerCompositor::updateLayerForHeader):
226         (WebCore::RenderLayerCompositor::updateLayerForFooter):
227         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
228         (WebCore::RenderLayerCompositor::ensureRootLayer):
229         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
230         * rendering/RenderLayerCompositor.h:
231
232 2018-09-14  Eric Carlson  <eric.carlson@apple.com>
233
234         Support arbitrary video resolution in getUserMedia API
235         https://bugs.webkit.org/show_bug.cgi?id=178109
236         <rdar://problem/35083128>
237
238         Reviewed by Youenn Fablet.
239
240         Support arbitrary video resolutions by configuring the camera to capture at the closest
241         larger size it supports and scaling/cropping frames as necessary.
242
243         No new tests, existing tests updated.
244
245         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
246         * Modules/webaudio/MediaStreamAudioSource.cpp:
247         (WebCore::MediaStreamAudioSource::capabilities): Make non-const, it wasn't helpful.
248         (WebCore::MediaStreamAudioSource::settings): Ditto.
249         (WebCore::MediaStreamAudioSource::capabilities const): Deleted.
250         (WebCore::MediaStreamAudioSource::settings const): Deleted.
251         * Modules/webaudio/MediaStreamAudioSource.h:
252
253         * SourcesCocoa.txt: Add PixelBufferResizer.
254
255         * WebCore.xcodeproj/project.pbxproj: Ditto.
256
257         * platform/cocoa/CoreVideoSoftLink.h:
258         * platform/cocoa/VideoToolboxSoftLink.cpp:
259         * platform/cocoa/VideoToolboxSoftLink.h:
260
261         * platform/graphics/cv/PixelBufferResizer.h: Added.
262         (WebCore::PixelBufferResizer::canResizeTo):
263         * platform/graphics/cv/PixelBufferResizer.mm: Added.
264         (WebCore::PixelBufferResizer::PixelBufferResizer):
265         (WebCore::PixelBufferResizer::resize):
266
267         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
268         (WebCore::RealtimeIncomingAudioSource::capabilities): Make non-const, it wasn't helpful.
269         (WebCore::RealtimeIncomingAudioSource::settings): Ditto.
270         (WebCore::RealtimeIncomingAudioSource::capabilities const): Deleted.
271         (WebCore::RealtimeIncomingAudioSource::settings const): Deleted.
272         * platform/mediastream/RealtimeIncomingAudioSource.h:
273
274         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
275         (WebCore::RealtimeIncomingVideoSource::capabilities): Make non-const, it wasn't helpful.
276         (WebCore::RealtimeIncomingVideoSource::settings): Ditto.
277         (WebCore::RealtimeIncomingVideoSource::capabilities const): Deleted.
278         (WebCore::RealtimeIncomingVideoSource::settings const): Deleted.
279         * platform/mediastream/RealtimeIncomingVideoSource.h:
280
281         * platform/mediastream/RealtimeMediaSource.cpp:
282         (WebCore::RealtimeMediaSource::supportsConstraint):
283         (WebCore::RealtimeMediaSource::supportsConstraint const): Deleted.
284         * platform/mediastream/RealtimeMediaSource.h:
285
286         * platform/mediastream/RealtimeVideoSource.cpp:
287         (WebCore::RealtimeVideoSource::presets):
288         (WebCore::RealtimeVideoSource::setSupportedPresets):
289         (WebCore::standardVideoSizes):
290         (WebCore::RealtimeVideoSource::updateCapabilities): Make non-const, it wasn't helpful.
291         (WebCore::presetSupportsFrameRate):
292         (WebCore::RealtimeVideoSource::supportsCaptureSize):
293         (WebCore::RealtimeVideoSource::shouldUsePreset):
294         (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate):
295         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
296         (WebCore::RealtimeVideoSource::addSupportedCapabilities const): Deleted.
297         * platform/mediastream/RealtimeVideoSource.h:
298         (WebCore::VideoPresetData::encode const):
299         (WebCore::VideoPresetData::decode):
300         (WebCore::VideoPreset::create):
301         (WebCore::VideoPreset::VideoPreset):
302         (WebCore::RealtimeVideoSource::prefersPreset):
303         (WebCore::RealtimeVideoSource::canResizeVideoFrames const):
304         (WebCore::RealtimeVideoSource::setDefaultSize):
305         (WebCore::RealtimeVideoSource::observedFrameRate const):
306         (WebCore::VideoPreset::encode const): Deleted.
307         (WebCore::VideoPreset::decode): Deleted.
308
309         * platform/mediastream/mac/AVVideoCaptureSource.h:
310         (WebCore::AVVideoCaptureSource::videoPresets): Deleted.
311         * platform/mediastream/mac/AVVideoCaptureSource.mm:
312         (WebCore::AVVideoPreset::create):
313         (WebCore::AVVideoPreset::AVVideoPreset):
314         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
315         (WebCore::AVVideoCaptureSource::settings):
316         (WebCore::AVVideoCaptureSource::capabilities): Make non-const, it wasn't helpful.
317         (WebCore::AVVideoCaptureSource::setFrameRate):
318         (WebCore::AVVideoCaptureSource::prefersPreset):
319         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
320         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
321         (WebCore::AVVideoCaptureSource::setupCaptureSession):
322         (WebCore::AVVideoCaptureSource::processNewFrame):
323         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
324         (WebCore::AVVideoCaptureSource::isFrameRateSupported):
325         (WebCore::AVVideoCaptureSource::generatePresets):
326         (WebCore::updateSizeMinMax): Deleted.
327         (WebCore::updateAspectRatioMinMax): Deleted.
328         (WebCore::AVVideoCaptureSource::settings const): Deleted.
329         (WebCore::AVVideoCaptureSource::capabilities const): Deleted.
330         (WebCore::AVVideoCaptureSource::sizeForPreset): Deleted.
331         (WebCore::AVVideoCaptureSource::setPreset): Deleted.
332         (WebCore::AVVideoCaptureSource::setSizeAndFrameRate): Deleted.
333         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Deleted.
334         (WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate): Deleted.
335
336         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
337         (WebCore::CoreAudioCaptureSource::capabilities): Make non-const, it wasn't helpful.
338         (WebCore::CoreAudioCaptureSource::settings): Ditto.
339         (WebCore::CoreAudioCaptureSource::capabilities const): Deleted.
340         (WebCore::CoreAudioCaptureSource::settings const): Deleted.
341         * platform/mediastream/mac/CoreAudioCaptureSource.h:
342
343         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
344         (WebCore::DisplayCaptureSourceCocoa::capabilities): Make non-const, it wasn't helpful.
345         (WebCore::DisplayCaptureSourceCocoa::settings): Ditto.
346         (WebCore::DisplayCaptureSourceCocoa::capabilities const): Deleted.
347         (WebCore::DisplayCaptureSourceCocoa::settings const): Deleted.
348         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
349
350         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
351         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
352         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
353         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
354         (WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset):
355         * platform/mock/MockMediaDevice.h:
356         (WebCore::MockCameraProperties::decode):
357
358         * platform/mock/MockRealtimeAudioSource.cpp:
359         (WebCore::MockRealtimeAudioSource::settings): Make non-const, it wasn't helpful.
360         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
361         (WebCore::MockRealtimeAudioSource::settings const): Deleted.
362         (WebCore::MockRealtimeAudioSource::capabilities const): Deleted.
363         * platform/mock/MockRealtimeAudioSource.h:
364
365         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
366         (WebCore::defaultDevices): Change video device presets to trigger resize code more often.
367
368         * platform/mock/MockRealtimeVideoSource.cpp:
369         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
370         (WebCore::MockRealtimeVideoSource::generatePresets):
371         (WebCore::MockRealtimeVideoSource::capabilities): Make non-const, it wasn't helpful.
372         (WebCore::MockRealtimeVideoSource::settings): Ditto.
373         (WebCore::MockRealtimeVideoSource::capabilities const): Deleted.
374         (WebCore::MockRealtimeVideoSource::settings const): Deleted.
375         * platform/mock/MockRealtimeVideoSource.h:
376
377 2018-09-14  Frederic Wang  <fwang@igalia.com>
378
379         Bug 189541 - Build error in FontDescriptionKey::computeHash when compiling FontTaggedSettings and FontCascadeFonts together
380         https://bugs.webkit.org/show_bug.cgi?id=189541
381
382         Reviewed by Alex Christensen.
383
384         FontDescriptionKey::computeHash() from In FontCache.h requires implicit instantiation of the
385         FontTaggedSettings::hash() template function. This instantiation may happen before
386         FontTaggedSettings::hash() is actually fully specialized in FontTaggedSettings.cpp. To avoid
387         compiler errors when FontCache.h and FontTaggedSettings.cpp are in the same translation unit,
388         we declare full specialization of the hash() functions in FontTaggedSettings.h.
389
390         No new tests, behavior unchanged.
391
392         * platform/graphics/FontCache.h: Explicitly include FontTaggedSettings to avoid possible future breakage.
393         * platform/graphics/FontTaggedSettings.h: Declare full specialization of FontTaggedSettings::hash().
394
395 2018-09-14  Ryan Haddad  <ryanhaddad@apple.com>
396
397         Unreviewed, rolling out r235990.
398
399         Introduced TestWebKitAPI.NowPlayingTest timeouts on iOS
400
401         Reverted changeset:
402
403         "Enable USE_MEDIAREMOTE on iOS"
404         https://bugs.webkit.org/show_bug.cgi?id=189096
405         https://trac.webkit.org/changeset/235990
406
407 2018-09-14  Jer Noble  <jer.noble@apple.com>
408
409         Turn SourceBufferChangeTypeEnabled on by default
410         https://bugs.webkit.org/show_bug.cgi?id=189527
411
412         Reviewed by Eric Carlson.
413
414         * page/Settings.yaml:
415
416 2018-09-14  Devin Rousso  <webkit@devinrousso.com>
417
418         Web Inspector: Record actions performed on ImageBitmapRenderingContext
419         https://bugs.webkit.org/show_bug.cgi?id=181341
420
421         Reviewed by Joseph Pecoraro.
422
423         Test: inspector/canvas/recording-bitmaprenderer.html
424
425         * html/canvas/ImageBitmapRenderingContext.idl:
426
427         * inspector/InspectorCanvas.cpp:
428         (WebCore::shouldSnapshotBitmapRendererAction):
429         (WebCore::InspectorCanvas::recordAction):
430
431         * inspector/agents/InspectorCanvasAgent.cpp:
432         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
433
434         * page/PageConsoleClient.cpp:
435         (canvasRenderingContext):
436
437 2018-09-14  David Kilzer  <ddkilzer@apple.com>
438
439         REGRESSION (r235954): Fix build failure on watchOS
440         <https://webkit.org/b/189605>
441
442         Reviewed by Geoffrey Garen.
443
444         Remove `using WebCore::IndexedDB::KeyType;` from
445         Source/WebCore/Modules/indexeddb/IDBKey.h and fix all the
446         resulting build failures.
447
448         * Modules/indexeddb/IDBKey.cpp:
449         (WebCore::IDBKey::IDBKey):
450         (WebCore::IDBKey::isValid const):
451         (WebCore::IDBKey::compare const):
452         * Modules/indexeddb/IDBKey.h:
453         (WebCore::IDBKey::createNumber):
454         (WebCore::IDBKey::createDate):
455         (WebCore::IDBKey::type const):
456         (WebCore::IDBKey::array const):
457         (WebCore::IDBKey::string const):
458         (WebCore::IDBKey::date const):
459         (WebCore::IDBKey::number const):
460         (WebCore::IDBKey::binary const):
461         (WebCore::IDBKey::compareTypes):
462         (WebCore::IDBKey::IDBKey):
463         * Modules/indexeddb/IDBKeyData.cpp:
464         (WebCore::IDBKeyData::IDBKeyData):
465         (WebCore::IDBKeyData::maybeCreateIDBKey const):
466         (WebCore::IDBKeyData::isolatedCopy):
467         (WebCore::IDBKeyData::encode const):
468         (WebCore::IDBKeyData::decode):
469         (WebCore::IDBKeyData::compare const):
470         (WebCore::IDBKeyData::loggingString const):
471         (WebCore::IDBKeyData::setArrayValue):
472         (WebCore::IDBKeyData::setBinaryValue):
473         (WebCore::IDBKeyData::setStringValue):
474         (WebCore::IDBKeyData::setDateValue):
475         (WebCore::IDBKeyData::setNumberValue):
476         (WebCore::IDBKeyData::isValid const):
477         (WebCore::IDBKeyData::operator== const):
478         * Modules/indexeddb/IDBKeyData.h:
479         (WebCore::IDBKeyData::IDBKeyData):
480         (WebCore::IDBKeyData::minimum):
481         (WebCore::IDBKeyData::maximum):
482         (WebCore::IDBKeyData::type const):
483         (WebCore::IDBKeyData::hash const):
484         (WebCore::IDBKeyData::string const):
485         (WebCore::IDBKeyData::date const):
486         (WebCore::IDBKeyData::number const):
487         (WebCore::IDBKeyData::binary const):
488         (WebCore::IDBKeyData::array const):
489         (WebCore::IDBKeyData::encode const):
490         (WebCore::IDBKeyData::decode):
491         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
492         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
493         * bindings/js/IDBBindingUtilities.cpp:
494         (WebCore::toJS):
495
496 2018-09-14  Xabier Rodriguez Calvar  <calvaris@igalia.com>
497
498         [EME] Add support the waitingforkey event
499         https://bugs.webkit.org/show_bug.cgi?id=189616
500
501         Reviewed by Philippe Normand.
502
503         Crossplatform support to fire the waitingforkey event from the
504         player to the element. The element implements the W3C specified
505         algorithm.
506
507         * html/HTMLMediaElement.cpp:
508         (WebCore::HTMLMediaElement::mediaPlayerWaitingForKey):
509         (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
510         * html/HTMLMediaElement.h:
511         * platform/graphics/MediaPlayer.cpp:
512         (WebCore::MediaPlayer::waitingForKey):
513         * platform/graphics/MediaPlayer.h:
514         (WebCore::MediaPlayerClient::mediaPlayerWaitingForKey):
515
516 2018-09-14  Mike Gorse  <mgorse@suse.com>
517
518         builtins directory causes name conflict on Python 3
519         https://bugs.webkit.org/show_bug.cgi?id=189552
520
521         Reviewed by Michael Catanzaro.
522
523         No new tests (No behavior change).
524
525         * CMakeLists.txt: builtins -> wkbuiltins.
526         * DerivedSources.make: builtins -> wkbuiltins.
527
528 2018-09-13  Ryosuke Niwa  <rniwa@webkit.org>
529
530         Capturing event listeners are called during bubbling phase for shadow hosts
531         https://bugs.webkit.org/show_bug.cgi?id=174288
532         <rdar://problem/33530455>
533
534         Reviewed by Darin Adler.
535
536         Implemented the new behavior proposed in https://github.com/whatwg/dom/pull/686 [1] to fix the problem
537         that capturing event listeners on a shadow host is invoked during bubbling phase when an event is
538         dispatched within its shadow tree.
539
540         To see why this is a problem, suppose we fire a composed event at span#target in the following DOM tree:
541           section#hostParent
542             + div#host -- ShadowRoot
543                             - p#parent
544                                 - span#target
545         Then capturing and bubbling event listeners on #target, #parent, #host, and #hostParent are invoked in
546         the following order in WebKit & Chrome right now:
547
548         1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
549         2. #parent, capturing, eventPhase: CAPTURING_PHASE
550         3. #target, capturing, eventPhase: AT_TARGET
551         4. #target, non-capturing, eventPhase: AT_TARGET
552         5. #parent, non-capturing, eventPhase: BUBBLING_PHASE
553         6. #host, capturing, eventPhase: AT_TARGET
554         7. #host, non-capturing, eventPhase: AT_TARGET
555         8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
556
557         This is counter-intuitive because capturing event listeners on #host isn't invoked until bubblign phase
558         started. A more natural ordering would be:
559
560         1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
561         2. #host, capturing, eventPhase: AT_TARGET
562         3. #parent, capturing, eventPhase: CAPTURING_PHASE
563         4. #target, capturing, eventPhase: AT_TARGET
564         5. #target, non-capturing, eventPhase: AT_TARGET
565         6. #parent, non-capturing, eventPhase: BUBBLING_PHASE
566         7. #host, non-capturing, eventPhase: AT_TARGET
567         8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
568
569         This also happens to be the order by which Gecko's current shadow DOM implementation invoke event listners.
570         This patch implements this new behavior using the spec-change proposed in [1]. Note that this patch also
571         impacts the invocation order of event listeners when there is no shadow tree. Namely, before this patch,
572         event listeners on the event's target is invoked in the registration order. After this patch, all capturing
573         event listeners are invoked before bubbling event listeners are invoked.
574
575         To implement this behavior, this patch introduces EventTarget::EventInvokePhase indicating whether we're
576         in the capturing phase or bubbling phase to EventTarget::fireEventListeners. We can't use Event's eventPhase
577         enum because that's set to Event::Phase::AT_TARGET when we're at a shadow host.
578
579         Test: fast/shadow-dom/capturing-and-bubbling-event-listeners-across-shadow-trees.html
580
581         * Modules/modern-media-controls/media/media-controller-support.js:
582         (MediaControllerSupport.prototype.enable): Use capturing event listeners so that we can update the states of
583         media controls before author scripts recieve the event.
584         (MediaControllerSupport.prototype.disable): Ditto.
585         * dom/EventContext.cpp:
586         (WebCore::EventContext::handleLocalEvents const):
587         (WebCore::MouseOrFocusEventContext::handleLocalEvents const):
588         (WebCore::TouchEventContext::handleLocalEvents const):
589         * dom/EventContext.h:
590         * dom/EventDispatcher.cpp:
591         (WebCore::dispatchEventInDOM): Invoke capturing event listners even when target and current target are same.
592         This happens when the current target is a shadow host and event's target is in its shadow tree. Also merged
593         the special code path for the event's target with the code in the bubbling phase.
594         * dom/EventPath.cpp:
595         (WebCore::WindowEventContext::handleLocalEvents const):
596         * dom/EventTarget.cpp:
597         (WebCore::EventTarget::dispatchEvent): Invoke capturing and bubbling event listeners in the order.
598         (WebCore::EventTarget::fireEventListeners):
599         (WebCore::EventTarget::innerInvokeEventListeners): Renamed from fireEventListeners to match the spec. Use
600         EventInvokePhase to filter out event listeners so that we can invoke capturing event listners before bubbling
601         event listeners even when eventPhase is Event::Phase::AT_TARGET.
602         * dom/EventTarget.h:
603         * dom/Node.cpp:
604         (WebCore::Node::handleLocalEvents):
605         * dom/Node.h:
606         * html/HTMLFormElement.cpp:
607         (WebCore::HTMLFormElement::handleLocalEvents):
608         * html/HTMLFormElement.h:
609         * page/DOMWindow.cpp:
610         (WebCore::DOMWindow::dispatchEvent):
611
612 2018-09-13  Megan Gardner  <megan_gardner@apple.com>
613
614         Fix color stop blending in conic gradients for stops past 1
615         https://bugs.webkit.org/show_bug.cgi?id=189532
616         <rdar://problem/44158221>
617
618         Reviewed by Simon Fraser.
619
620         Calculation was wrong, fixed it, and wrote a test that failed
621         without the change, and passes with it.
622
623         Test: fast/gradients/conic-repeating-last-stop.html
624
625         * css/CSSGradientValue.cpp:
626         (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
627
628 2018-09-13  Chris Dumez  <cdumez@apple.com>
629
630         Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible
631         https://bugs.webkit.org/show_bug.cgi?id=189590
632         <rdar://problem/44422725>
633
634         Reviewed by Geoffrey Garen.
635
636         Set a flag on the navigation action to indicate if the page was opened via window.open() without 'noopener'.
637
638         Test: http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html
639
640         * loader/FrameLoader.cpp:
641         (WebCore::FrameLoader::loadURL):
642         * loader/NavigationAction.h:
643         (WebCore::NavigationAction::openedViaWindowOpenWithOpener const):
644         (WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener):
645         * page/DOMWindow.cpp:
646         (WebCore::DOMWindow::createWindow):
647         * page/Page.h:
648         (WebCore::Page::openedViaWindowOpenWithOpener const):
649         (WebCore::Page::setOpenedViaWindowOpenWithOpener):
650
651 2018-09-13  Jer Noble  <jer.noble@apple.com>
652
653         Enable USE_MEDIAREMOTE on iOS
654         https://bugs.webkit.org/show_bug.cgi?id=189096
655
656         Reviewed by Eric Carlson.
657
658         Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
659         Now Playing implementation on iOS and Mac.
660
661         * SourcesCocoa.txt:
662         * WebCore.xcodeproj/project.pbxproj:
663         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
664         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
665         * platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
666         (PlatformMediaSessionManager::sharedManager):
667         (PlatformMediaSessionManager::sharedManagerIfExists):
668         (MediaSessionManagerCocoa::updateSessionState):
669         (MediaSessionManagerCocoa::beginInterruption):
670         (MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
671         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
672         (MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
673         (MediaSessionManagerCocoa::removeSession):
674         (MediaSessionManagerCocoa::sessionWillEndPlayback):
675         (MediaSessionManagerCocoa::clientCharacteristicsChanged):
676         (MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
677         (MediaSessionManagerCocoa::nowPlayingEligibleSession):
678         (MediaSessionManagerCocoa::updateNowPlayingInfo):
679         * platform/audio/ios/MediaSessionManagerIOS.h:
680         (): Deleted.
681         * platform/audio/ios/MediaSessionManagerIOS.mm:
682         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
683         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
684         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
685         (WebCore::MediaSessionManageriOS::removeSession): Deleted.
686         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
687         (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
688         * platform/audio/mac/MediaSessionManagerMac.h: Removed.
689
690 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
691
692         Remove the workaround for friend class LazyNeverDestroyed<X> statements for MSVC
693         https://bugs.webkit.org/show_bug.cgi?id=189576
694
695         Reviewed by Alex Christensen.
696
697         Old MSVC can't compile "friend class LazyNeverDestroyed<X>"
698         statements, but "friend LazyNeverDestroyed<X>".
699
700         No new tests (No behavior change).
701
702         * css/CSSInheritedValue.h: Removed the code for COMPILER(MSVC).
703         Removed 'class' keyword in "friend class LazyNeverDestroyed<X>"
704         statement.
705         * css/CSSInitialValue.h: Ditto.
706         * css/CSSPrimitiveValue.h: Ditto.
707         * css/CSSRevertValue.h: Ditto.
708         * css/CSSUnsetValue.h: Ditto.
709
710 2018-09-13  Ms2ger  <Ms2ger@igalia.com>
711
712         [GLib] Fix format string in KeyedEncoderGlib::beginObject().
713         https://bugs.webkit.org/show_bug.cgi?id=189585
714
715         Reviewed by Michael Catanzaro.
716
717         This appears to fix the following assertion locally:
718
719         GLib-CRITICAL **: g_variant_builder_add_value: assertion '!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed
720
721         Covered by existing tests.
722
723         * platform/glib/KeyedEncoderGlib.cpp:
724         (WebCore::KeyedEncoderGlib::beginObject):
725
726 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
727
728         Unreviewed, rolling out r235953.
729
730         Caused layout test crashes under GuardMalloc.
731
732         Reverted changeset:
733
734         "Make GraphicsLayers ref-counted, so their tree can persist
735         when disconnected from RenderLayerBackings"
736         https://bugs.webkit.org/show_bug.cgi?id=189521
737         https://trac.webkit.org/changeset/235953
738
739 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
740
741         Remove a MSVC workaround in XPath::Step::NodeTest
742         https://bugs.webkit.org/show_bug.cgi?id=189578
743
744         Reviewed by Alex Christensen.
745
746         XPath::Step::NodeTest has a special code for MSVC bug workaround.
747         It has been introduced in 5 years ago in Bug 121082 Comment 19.
748
749         I think it is safe just to remove the workaround.
750
751         No new tests (No behavior change).
752
753         * xml/XPathStep.h: Removed the MSVC workaround.
754
755 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
756
757         Remove a MSVC workaround in InspectorStyle::styleWithProperties
758         https://bugs.webkit.org/show_bug.cgi?id=189577
759
760         Reviewed by Alex Christensen.
761
762         No new tests (No behavior change).
763
764         * inspector/InspectorStyleSheet.cpp:
765         (WebCore::InspectorStyle::styleWithProperties const): Use 'auto' for the type of 'status'.
766
767 2018-09-13  Alex Christensen  <achristensen@webkit.org>
768
769         Use a Variant instead of a union in CSSSelector
770         https://bugs.webkit.org/show_bug.cgi?id=188559
771
772         Reviewed by Antti Koivisto.
773
774         No change in behavior. This just makes some of the existing problems more obvious and easy to fix.
775
776         I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
777         I only have m_isForPage when assertions are enabled because it's only used for an assertion.
778         The rest is pretty straightforward translating union syntax to Variant syntax.
779         I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.
780
781         * css/CSSSelector.cpp:
782         (WebCore::CSSSelector::CSSSelector):
783         (WebCore::CSSSelector::createRareData):
784         (WebCore::CSSSelector::setAttribute):
785         (WebCore::CSSSelector::setArgument):
786         (WebCore::CSSSelector::setLangArgumentList):
787         (WebCore::CSSSelector::setSelectorList):
788         (WebCore::CSSSelector::setNth):
789         (WebCore::CSSSelector::matchNth const):
790         (WebCore::CSSSelector::nthA const):
791         (WebCore::CSSSelector::nthB const):
792         (WebCore::CSSSelector::RareData::RareData):
793         * css/CSSSelector.h:
794         (WebCore::CSSSelector::argument const):
795         (WebCore::CSSSelector::langArgumentList const):
796         (WebCore::CSSSelector::selectorList const):
797         (WebCore::CSSSelector::attribute const):
798         (WebCore::CSSSelector::attributeCanonicalLocalName const):
799         (WebCore::CSSSelector::setValue):
800         (WebCore::CSSSelector::CSSSelector):
801         (WebCore::CSSSelector::~CSSSelector):
802         (WebCore::CSSSelector::tagQName const):
803         (WebCore::CSSSelector::tagLowercaseLocalName const):
804         (WebCore::CSSSelector::value const):
805         (WebCore::CSSSelector::serializingValue const):
806         (WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
807         (WebCore::CSSSelector::RareData::create): Deleted.
808         * css/parser/CSSParserImpl.cpp:
809         (WebCore::CSSParserImpl::parsePageSelector):
810         * css/parser/CSSParserSelector.h:
811
812 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
813
814         [Win][Clang] error: type 'float' cannot be narrowed to 'LONG' (aka 'long') in initializer list in WheelEventWin.cpp
815         https://bugs.webkit.org/show_bug.cgi?id=189575
816
817         Reviewed by Alex Christensen.
818
819         No new tests (No behavior change).
820
821         * platform/win/WheelEventWin.cpp:
822         (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use flooredIntPoint to convert FloatPoint to POINT.
823
824 2018-09-13  Youenn Fablet  <youenn@apple.com>
825
826         Introduce RTCRtpSendParameters
827         https://bugs.webkit.org/show_bug.cgi?id=189563
828
829         Reviewed by Eric Carlson.
830
831         Introduce RTCRtpSendParameters to match the WebRTC specification.
832         Split RTCRtpPrameters fields accordingly and update call sites.
833
834         Covered by updated test.
835
836         * CMakeLists.txt:
837         * DerivedSources.make:
838         * Modules/mediastream/PeerConnectionBackend.h:
839         * Modules/mediastream/RTCRtpCodingParameters.h: Added
840         * Modules/mediastream/RTCRtpCodingParameters.idl: Added
841         * Modules/mediastream/RTCRtpDecodingParameters.h: Added
842         * Modules/mediastream/RTCRtpDecodingParameters.idl: Added
843         * Modules/mediastream/RTCRtpEncodingParameters.h:
844         * Modules/mediastream/RTCRtpEncodingParameters.idl:
845         * Modules/mediastream/RTCRtpParameters.h:
846         * Modules/mediastream/RTCRtpParameters.idl:
847         * Modules/mediastream/RTCRtpReceiver.cpp:
848         * Modules/mediastream/RTCRtpSendParameters.h: Added.
849         (WebCore::RTCRtpSendParameters::RTCRtpSendParameters):
850         * Modules/mediastream/RTCRtpSendParameters.idl: Added.
851         * Modules/mediastream/RTCRtpSender.cpp:
852         (WebCore::RTCRtpSender::getParameters):
853         (WebCore::RTCRtpSender::setParameters):
854         * Modules/mediastream/RTCRtpSender.h:
855         * Modules/mediastream/RTCRtpSender.idl:
856         * Modules/mediastream/RTCRtpSenderBackend.h:
857         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
858         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
859         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
860         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
861         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
862         (WebCore::toRTCRtpParameters):
863         (WebCore::toRTCRtpSendParameters):
864         (WebCore::fromRTCRtpSendParameters):
865         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
866         * Sources.txt:
867         * WebCore.xcodeproj/project.pbxproj:
868
869 2018-09-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
870
871         [GStreamer][EME] decrypt-key-needed message renamed to drm-cdm-instance-needed
872         https://bugs.webkit.org/show_bug.cgi?id=189547
873
874         Reviewed by Philippe Normand.
875
876         decrypt-key-needed message renamed to drm-cdm-instance-needed.
877
878         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
879         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Apart from
880         renaming the message, removed the class prefix for
881         dispatchCDMInstance.
882         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
883         (webkitMediaCommonEncryptionDecryptTransformInPlace):
884
885 2018-09-11  Ryosuke Niwa  <rniwa@webkit.org>
886
887         imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion
888         https://bugs.webkit.org/show_bug.cgi?id=189493
889
890         Reviewed by Alex Christensen.
891
892         The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced
893         by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot.
894         When a form (or any other) element has more than one ref inside removeDetachedChildren,
895         addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder.
896
897         However, when a form associated element of this form element appears later in the tree order,
898         FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot.
899
900         Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial
901         operations happening in this function so this should be safe.
902
903         Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html
904
905         * html/FormAssociatedElement.cpp:
906         (WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug.
907
908 2018-09-12  Dan Bernstein  <mitz@apple.com>
909
910         [Cocoa] Complete support for Paste as Quotation
911         https://bugs.webkit.org/show_bug.cgi?id=189504
912
913         Reviewed by Wenson Hsieh.
914
915         Tests: editing/pasteboard/4930986-1-paste-as-quotation.html
916                editing/pasteboard/4930986-2-paste-as-quotation.html
917                editing/pasteboard/4930986-3-paste-as-quotation.html
918
919         * editing/Editor.cpp:
920           Added ClipboardEventKind::PasteAsQuotation.
921         (WebCore::eventNameForClipboardEvent): Map PasteAsQuotation to the "paste" DOM event name.
922         (WebCore::createDataTransferForClipboardEvent): Place the unquoted content in the event.
923           This means that currently event handlers can’t emulate pasting as quotation, because they
924           neither have the quoted content nor knowledge that quoting has been requested. We could
925           change this in the future if needed.
926         (WebCore::Editor::paste): Updated for change in pasteWithPasteboard’s argument type.
927         (WebCore::Editor::pasteAsQuotation): Added. Similar to paste, but passes
928           PasteOption::AsQuotation to pasteWithPasteboard.
929         (WebCore::Editor::quoteFragmentForPasting): Added. Quoting for pasting consists of enclosing
930           the fragment in a blockquote element with the "type" attribute set to "cite" and the
931           "class" attribute set to a well-known value, which is used to trigger special behavior in
932           ReplaceSelectionCommand. The behavior includes removing the "class" attribute in the end,
933           so eventually, we could stop using this form of in-band signaling.
934         * editing/Editor.h: Declared PasteOption enum class to encompass the existing allowPlainText
935           and MailBlockquoteHandling arguments to pasteWithPasteboard as well as the new AsQuotation
936           behavior.
937
938         * editing/EditorCommand.cpp:
939         (WebCore::executePasteAsQuotation): Added. Similar to executing Paste.
940         (WebCore::createCommandMap): Added an entry for PasteAsQuotation, based on the Paste entry.
941
942         * editing/cocoa/EditorCocoa.mm:
943         (WebCore::Editor::webContentFromPasteboard): Moved from EditorIOS.mm and EditorMac.mm to
944           here.
945
946         * editing/gtk/EditorGtk.cpp:
947         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
948           quote the fragment if needed.
949
950         * editing/ios/EditorIOS.mm:
951         (WebCore::Editor::pasteWithPasteboard): Ditto.
952         (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
953
954         * editing/mac/EditorMac.mm:
955         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
956           quote the fragment if needed.
957         (WebCore::Editor::readSelectionFromPasteboard): Updated for new OptionSet argument to
958           pasteWithPasteboard.
959         (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
960
961         * editing/win/EditorWin.cpp:
962         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
963           quote the fragment if needed.
964
965         * editing/wpe/EditorWPE.cpp:
966         (WebCore::Editor::pasteWithPasteboard): Ditto.
967
968 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
969
970         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
971         https://bugs.webkit.org/show_bug.cgi?id=189521
972
973         Reviewed by Tim Horton.
974         
975         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
976         
977         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
978         
979         All the other changes are just to adapt to the new ownership patterns.
980         
981         I verified that no GraphicsLayers were leaked or abandoned after this change.
982
983         No behavior change.
984
985         * page/PageOverlayController.cpp:
986         (WebCore::PageOverlayController::layerWithDocumentOverlays):
987         (WebCore::PageOverlayController::layerWithViewOverlays):
988         (WebCore::PageOverlayController::installPageOverlay):
989         (WebCore::PageOverlayController::uninstallPageOverlay):
990         (WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
991         (WebCore::PageOverlayController::didChangeViewSize):
992         (WebCore::PageOverlayController::didChangeDocumentSize):
993         (WebCore::PageOverlayController::didChangeSettings):
994         (WebCore::PageOverlayController::paintContents):
995         (WebCore::PageOverlayController::didChangeOverlayFrame):
996         (WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
997         * page/PageOverlayController.h:
998         * page/mac/ServicesOverlayController.h:
999         (WebCore::ServicesOverlayController::Highlight::layer const):
1000         * page/mac/ServicesOverlayController.mm:
1001         (WebCore::ServicesOverlayController::Highlight::Highlight):
1002         (WebCore::ServicesOverlayController::Highlight::invalidate):
1003         (WebCore::ServicesOverlayController::Highlight::fadeIn):
1004         (WebCore::ServicesOverlayController::Highlight::fadeOut):
1005         (WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
1006         (WebCore::ServicesOverlayController::determineActiveHighlight):
1007         * platform/graphics/GraphicsLayer.cpp:
1008         (WebCore::GraphicsLayer::GraphicsLayer):
1009         (WebCore::GraphicsLayer::willBeDestroyed):
1010         (WebCore::GraphicsLayer::setChildren):
1011         (WebCore::GraphicsLayer::addChild):
1012         (WebCore::GraphicsLayer::addChildAtIndex):
1013         (WebCore::GraphicsLayer::addChildBelow):
1014         (WebCore::GraphicsLayer::addChildAbove):
1015         (WebCore::GraphicsLayer::replaceChild):
1016         (WebCore::GraphicsLayer::removeAllChildren):
1017         (WebCore::GraphicsLayer::removeFromParent):
1018         (WebCore::GraphicsLayer::setMaskLayer):
1019         (WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
1020         (WebCore::GraphicsLayer::distributeOpacity):
1021         (WebCore::GraphicsLayer::traverse):
1022         (WebCore::dumpChildren):
1023         * platform/graphics/GraphicsLayer.h:
1024         (WebCore::GraphicsLayer::children const):
1025         (WebCore::GraphicsLayer::children):
1026         (WebCore::GraphicsLayer::maskLayer const):
1027         (WebCore::GraphicsLayer::replicaLayer const):
1028         (WebCore::GraphicsLayer::beingDestroyed const):
1029         (WebCore::GraphicsLayer:: const): Deleted.
1030         * platform/graphics/GraphicsLayerFactory.h:
1031         * platform/graphics/ca/GraphicsLayerCA.cpp:
1032         (WebCore::GraphicsLayer::create):
1033         (WebCore::GraphicsLayerCA::setChildren):
1034         (WebCore::GraphicsLayerCA::addChild):
1035         (WebCore::GraphicsLayerCA::addChildAtIndex):
1036         (WebCore::GraphicsLayerCA::addChildBelow):
1037         (WebCore::GraphicsLayerCA::addChildAbove):
1038         (WebCore::GraphicsLayerCA::replaceChild):
1039         (WebCore::GraphicsLayerCA::setMaskLayer):
1040         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
1041         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1042         (WebCore::GraphicsLayerCA::updateSublayerList):
1043         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1044         * platform/graphics/ca/GraphicsLayerCA.h:
1045         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1046         (WebCore::GraphicsLayer::create):
1047         (WebCore::GraphicsLayerTextureMapper::setChildren):
1048         (WebCore::GraphicsLayerTextureMapper::addChild):
1049         (WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
1050         (WebCore::GraphicsLayerTextureMapper::addChildAbove):
1051         (WebCore::GraphicsLayerTextureMapper::addChildBelow):
1052         (WebCore::GraphicsLayerTextureMapper::replaceChild):
1053         (WebCore::GraphicsLayerTextureMapper::setMaskLayer):
1054         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
1055         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
1056         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1057         (WebCore::GraphicsLayer::create):
1058         (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
1059         (WebCore::CoordinatedGraphicsLayer::addChild):
1060         (WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
1061         (WebCore::CoordinatedGraphicsLayer::addChildAbove):
1062         (WebCore::CoordinatedGraphicsLayer::addChildBelow):
1063         (WebCore::CoordinatedGraphicsLayer::replaceChild):
1064         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
1065         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
1066         (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
1067         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
1068         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1069         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
1070         (WebCore::GraphicsLayer::create):
1071         (WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
1072         (WebCore::GraphicsLayerDirect2D::initialize): Deleted.
1073         (WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
1074         (WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
1075         (WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
1076         * rendering/RenderLayerBacking.cpp:
1077         (WebCore::RenderLayerBacking::createGraphicsLayer):
1078         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
1079         (WebCore::RenderLayerBacking::updateConfiguration):
1080         (WebCore::RenderLayerBacking::updateInternalHierarchy):
1081         (WebCore::RenderLayerBacking::updateMaskingLayer):
1082         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
1083         (WebCore::RenderLayerBacking::updateScrollingLayers):
1084         * rendering/RenderLayerBacking.h:
1085         * rendering/RenderLayerCompositor.cpp:
1086         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1087         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
1088         (WebCore::RenderLayerCompositor::setCompositingParent):
1089         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1090         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1091         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
1092         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
1093         (WebCore::RenderLayerCompositor::updateLayerForHeader):
1094         (WebCore::RenderLayerCompositor::updateLayerForFooter):
1095         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1096         (WebCore::RenderLayerCompositor::ensureRootLayer):
1097         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
1098         * rendering/RenderLayerCompositor.h:
1099
1100 2018-09-12  Alex Christensen  <achristensen@webkit.org>
1101
1102         Expose fewer of URL's internal members
1103         https://bugs.webkit.org/show_bug.cgi?id=189528
1104
1105         Reviewed by Chris Dumez.
1106
1107         * loader/appcache/ApplicationCacheStorage.cpp:
1108         (WebCore::urlHostHash):
1109         * platform/URL.cpp:
1110         (WebCore::URL::hostStart const):
1111         (WebCore::protocolHostAndPortAreEqual):
1112         (WebCore::hostsAreEqual):
1113         * platform/URL.h:
1114         (WebCore::URL::hostStart const): Deleted.
1115         (WebCore::URL::hostEnd const): Deleted.
1116
1117 2018-09-12  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1118
1119         [Curl] Implement correct total received bytes.
1120         https://bugs.webkit.org/show_bug.cgi?id=189555
1121
1122         Reviewed by Alex Christensen.
1123
1124         Curl port only reported total network received bytes before decoding.
1125
1126         No new test. InspectorTest is only available for WebKitTestRunner.
1127
1128         * platform/network/curl/CurlRequest.cpp:
1129         (WebCore::CurlRequest::didReceiveData):
1130         (WebCore::CurlRequest::updateNetworkLoadMetrics):
1131         * platform/network/curl/CurlRequest.h:
1132
1133 2018-09-12  Youenn Fablet  <youenn@apple.com>
1134
1135         Split RTCRtpParameters idl and header file
1136         https://bugs.webkit.org/show_bug.cgi?id=189524
1137
1138         Reviewed by Eric Carlson.
1139
1140         This will be easier to manage and will allow to more easily introduce sender/receiver parameters.
1141         No change of behavior.
1142
1143         * CMakeLists.txt:
1144         * DerivedSources.make:
1145         * Modules/mediastream/RTCDegradationPreference.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1146         * Modules/mediastream/RTCDegradationPreference.idl: Added.
1147         * Modules/mediastream/RTCDtxStatus.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1148         * Modules/mediastream/RTCDtxStatus.idl: Added.
1149         * Modules/mediastream/RTCPriorityType.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1150         * Modules/mediastream/RTCPriorityType.idl: Added.
1151         * Modules/mediastream/RTCRtpCodecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1152         * Modules/mediastream/RTCRtpCodecParameters.idl: Added.
1153         * Modules/mediastream/RTCRtpEncodingParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1154         * Modules/mediastream/RTCRtpEncodingParameters.idl: Added.
1155         * Modules/mediastream/RTCRtpFecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1156         * Modules/mediastream/RTCRtpFecParameters.idl: Added.
1157         * Modules/mediastream/RTCRtpHeaderExtensionParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1158         * Modules/mediastream/RTCRtpHeaderExtensionParameters.idl: Added.
1159         * Modules/mediastream/RTCRtpParameters.h:
1160         * Modules/mediastream/RTCRtpParameters.idl:
1161         * Modules/mediastream/RTCRtpRtxParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1162         * Modules/mediastream/RTCRtpRtxParameters.idl: Added.
1163         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1164         (WebCore::toRTCEncodingParameters):
1165         (WebCore::fromRTCEncodingParameters):
1166         (WebCore::toRTCHeaderExtensionParameters):
1167         (WebCore::fromRTCHeaderExtensionParameters):
1168         (WebCore::toRTCCodecParameters):
1169         (WebCore::toRTCRtpParameters):
1170         (WebCore::fromRTCRtpParameters):
1171         * Sources.txt:
1172         * WebCore.xcodeproj/project.pbxproj:
1173
1174 2018-09-12  Ali Juma  <ajuma@chromium.org>
1175
1176         [IntersectionObserver] Implement rootMargin expansion
1177         https://bugs.webkit.org/show_bug.cgi?id=189525
1178
1179         Reviewed by Simon Fraser.
1180
1181         Expand the root intersection rectangle by the observer's rootMargin when computing
1182         intersections.
1183
1184         Test: imported/w3c/web-platform-tests/intersection-observer/root-margin.html
1185
1186         * dom/Document.cpp:
1187         (WebCore::expandRootBoundsWithRootMargin):
1188         (WebCore::computeIntersectionRects):
1189         * page/IntersectionObserver.h:
1190         (WebCore::IntersectionObserver::rootMarginBox const):
1191         * platform/graphics/FloatRect.h:
1192         (WebCore::FloatRect::expand):
1193
1194 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
1195
1196         [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
1197         https://bugs.webkit.org/show_bug.cgi?id=189542
1198
1199         Reviewed by Alex Christensen.
1200
1201         No new tests (No behavior change).
1202
1203         * platform/graphics/win/IntPointWin.cpp:
1204         (WebCore::IntPoint::operator POINTS const): Narrowed m_x and m_y by using static_cast.
1205
1206 2018-09-12  Guillaume Emont  <guijemont@igalia.com>
1207
1208         Add IGNORE_WARNING_.* macros
1209         https://bugs.webkit.org/show_bug.cgi?id=188996
1210
1211         Reviewed by Michael Catanzaro.
1212
1213         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
1214         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1215         * accessibility/mac/AXObjectCacheMac.mm:
1216         (WebCore::AXObjectCache::postPlatformNotification):
1217         * accessibility/mac/AccessibilityObjectMac.mm:
1218         (WebCore::AccessibilityObject::overrideAttachmentParent):
1219         (WebCore::AccessibilityObject::accessibilityIgnoreAttachment const):
1220         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1221         (-[WebAccessibilityObjectWrapper renderWidgetChildren]):
1222         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
1223         (-[WebAccessibilityObjectWrapper role]):
1224         (-[WebAccessibilityObjectWrapper roleDescription]):
1225         * bridge/objc/WebScriptObject.mm:
1226         * bridge/objc/objc_class.mm:
1227         (JSC::Bindings::ObjcClass::fieldNamed const):
1228         * crypto/CommonCryptoUtilities.cpp:
1229         (WebCore::getCommonCryptoDigestAlgorithm):
1230         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
1231         (WebCore::encryptAES_GCM):
1232         (WebCore::decyptAES_GCM):
1233         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
1234         (WebCore::wrapSerializedCryptoKey):
1235         (WebCore::unwrapSerializedCryptoKey):
1236         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
1237         * css/makeSelectorPseudoElementsMap.py:
1238         * editing/TextIterator.cpp:
1239         * editing/mac/EditorMac.mm:
1240         (WebCore::Editor::pasteWithPasteboard):
1241         (WebCore::Editor::takeFindStringFromSelection):
1242         (WebCore::Editor::replaceNodeFromPasteboard):
1243         * page/mac/EventHandlerMac.mm:
1244         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
1245         * page/mac/ServicesOverlayController.mm:
1246         (WebCore::ServicesOverlayController::Highlight::paintContents):
1247         * platform/LocalizedStrings.cpp:
1248         (WebCore::formatLocalizedString):
1249         * platform/ScreenProperties.h:
1250         (WebCore::ScreenData::decode):
1251         * platform/gamepad/mac/HIDGamepadProvider.cpp:
1252         (WebCore::HIDGamepadProvider::stopMonitoringInput):
1253         * platform/graphics/PlatformDisplay.cpp:
1254         (WebCore::PlatformDisplay::sharedDisplay):
1255         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
1256         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1257         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
1258         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1259         (WebCore::CDMSessionAVStreamSession::update):
1260         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1261         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1262         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
1263         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
1264         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
1265         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1266         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1267         (WebCore::IGNORE_CLANG_WARNING_END):
1268         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1269         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1270         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
1271         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
1272         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1273         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1274         (WebCore::IGNORE_CLANG_WARNING_END):
1275         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1276         (PlatformCALayer::drawLayerContents):
1277         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1278         (WebCore::FontCascade::fontForCombiningCharacterSequence const):
1279         * platform/graphics/cg/ImageDecoderCG.cpp:
1280         (WebCore::ImageDecoderCG::createFrameImageAtIndex):
1281         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1282         (WebCore::GraphicsContext::drawLineForDocumentMarker):
1283         * platform/graphics/cocoa/WebGLLayer.h:
1284         (IGNORE_CLANG_WARNING):
1285         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1286         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1287         * platform/graphics/mac/IconMac.mm:
1288         (WebCore::Icon::Icon):
1289         * platform/graphics/mac/PDFDocumentImageMac.mm:
1290         (WebCore::PDFDocumentImage::drawPDFPage):
1291         * platform/graphics/mac/WebKitNSImageExtras.mm:
1292         (-[NSImage _web_lockFocusWithDeviceScaleFactor:]):
1293         * platform/ios/DragImageIOS.mm:
1294         * platform/mac/DragImageMac.mm:
1295         (WebCore::scaleDragImage):
1296         (WebCore::createDragImageForLink):
1297         * platform/mac/LegacyNSPasteboardTypes.h:
1298         * platform/mac/LocalCurrentGraphicsContext.mm:
1299         (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
1300         * platform/mac/PasteboardMac.mm:
1301         (WebCore::Pasteboard::createForCopyAndPaste):
1302         (WebCore::Pasteboard::createForDragAndDrop):
1303         (WebCore::setDragImageImpl):
1304         * platform/mac/PlatformEventFactoryMac.mm:
1305         (WebCore::globalPoint):
1306         * platform/mac/SSLKeyGeneratorMac.mm:
1307         * platform/mac/ScrollViewMac.mm:
1308         (WebCore::ScrollView::platformContentsToScreen const):
1309         (WebCore::ScrollView::platformScreenToContents const):
1310         * platform/mac/ThemeMac.mm:
1311         (WebCore::drawCellFocusRingWithFrameAtTime):
1312         * platform/mac/WebPlaybackControlsManager.mm:
1313         * platform/mac/WidgetMac.mm:
1314         (WebCore::Widget::paint):
1315         * platform/mediastream/RealtimeIncomingAudioSource.h:
1316         * platform/mediastream/RealtimeIncomingVideoSource.h:
1317         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1318         * platform/mediastream/RealtimeOutgoingVideoSource.h:
1319         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
1320         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1321         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1322         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
1323         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
1324         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1325         * platform/network/cf/ResourceHandleCFNet.cpp:
1326         (WebCore::ResourceHandle::createCFURLConnection):
1327         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1328         (WebCore::SocketStreamHandleImpl::reportErrorToClient):
1329         * platform/network/create-http-header-name-table:
1330         * platform/text/TextEncoding.cpp:
1331         * testing/MockLibWebRTCPeerConnection.h:
1332         * xml/XPathGrammar.cpp:
1333
1334 2018-09-12  Pablo Saavedra  <psaavedra@igalia.com>
1335
1336         Linking against libWPEWebKit-0.1.so is not posible when WPE is build with ENABLE_VIDEO=OFF and ENABLE_WEB_AUDIO=OFF
1337         https://bugs.webkit.org/show_bug.cgi?id=189540
1338
1339         Reviewed by Philippe Normand.
1340
1341         Related issues:
1342
1343         This issue is related with changes in https://bugs.webkit.org/show_bug.cgi?id=183080
1344         This issue is introduced in https://bugs.webkit.org/show_bug.cgi?id=186547
1345
1346         No new tests, no changes in the functionality.
1347
1348         * platform/GStreamer.cmake:
1349         * platform/SourcesGLib.txt:
1350         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
1351         (WebCore::LibWebRTCProvider::webRTCAvailable):
1352
1353 2018-09-11  Zan Dobersek  <zdobersek@igalia.com>
1354
1355         Unreviewed WPE build fix.
1356
1357         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1358         Add extra header inclusions to get this code building after the unified
1359         sources system shifted it into a different translation unit.
1360
1361 2018-09-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1362
1363         [Curl] WebInspector doesn't display request headers added during processing.
1364         https://bugs.webkit.org/show_bug.cgi?id=189531
1365
1366         Reviewed by Alex Christensen.
1367
1368         While processing the request, Curl port network layer adds some headers to the request
1369         such as cookies. Those headers should be displayed in the WebInspector.
1370
1371         Tested on MiniBrowser.
1372
1373         * platform/network/curl/CurlRequest.cpp:
1374         (WebCore::CurlRequest::didReceiveHeader):
1375         (WebCore::CurlRequest::didCompleteTransfer):
1376         (WebCore::CurlRequest::updateNetworkLoadMetrics):
1377         * platform/network/curl/CurlRequest.h:
1378
1379 2018-09-11  James Savage  <james.savage@apple.com>
1380
1381         Follow up to:
1382         Expose -apple-system-container-border color to internal web views.
1383         https://bugs.webkit.org/show_bug.cgi?id=189178.
1384
1385         Reviewed by Timothy Hatcher.
1386
1387         * rendering/RenderThemeMac.mm:
1388         (WebCore::RenderThemeMac::systemColor const): Add a separate #if block for
1389         Mojave. When I used CSSValueAppleSystemFindHighlightBackground as a template
1390         for this change, I had to write out the condition in the first change, but
1391         mistakenly thought I could reuse the block here. Turns out the versions were
1392         different, and I could not.
1393
1394 2018-09-11  Youenn Fablet  <youenn@apple.com>
1395
1396         Remove MediaDevices NoInterfaceObject
1397         https://bugs.webkit.org/show_bug.cgi?id=189512
1398
1399         Reviewed by Alex Christensen.
1400
1401         Covered by rebased WPT tests.
1402
1403         * Modules/mediastream/MediaDevices.idl:
1404
1405 2018-09-11  Jer Noble  <jer.noble@apple.com>
1406
1407         [MediaCapabilities] Implement MediaEngineConfigurationFactory registration
1408         https://bugs.webkit.org/show_bug.cgi?id=189438
1409
1410         Reviewed by Eric Carlson.
1411
1412         Implement a mechanism to register platform-specific MediaEngineConfigurationFactory methods, and a mechanism to iterate
1413         over those registered factories when createDecodingConfiguration() and createEncodingConfiguration() are called.
1414
1415         The Factory has been radically simplified; the concept of MediaEngineDecodingConfiguration
1416         and MediaEngineEncodingConfiguration and its subclasess have been removed. Since the primary
1417         objects representing video and audio configurations are IDLDictionaries, the native objects
1418         are just structs full of POD types (and Strings). Since these have no dependencies on
1419         higher-level HTML concepts, they can be moved into platform/ and accessed from there. This
1420         patch also converts MediaCapabilitiesInfo to an Interface, so its implementation also can
1421         become a struct and live in platform/. The MediaEngineDecodingConfigurationMock and
1422         MediaEngineEncodingConfigurationMock have been consolidated in a single class which simply
1423         parses MediaDecodingConfiguration and MediaEncodingConifguration objects (now that they live
1424         in Platform) and return a MediaCapabilitiesInfo object (now that it does too).
1425
1426         * Modules/mediacapabilities/MediaCapabilities.cpp:
1427         (WebCore::isValidVideoConfiguration):
1428         (WebCore::MediaCapabilities::decodingInfo):
1429         (WebCore::MediaCapabilities::encodingInfo):
1430         * Modules/mediacapabilities/MediaCapabilitiesInfo.h: Removed.
1431         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
1432         * Modules/mediacapabilities/VideoConfiguration.idl:
1433         * Sources.txt:
1434         * WebCore.xcodeproj/project.pbxproj:
1435         * platform/MediaCapabilitiesInfo.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
1436         * platform/mediacapabilities/AudioConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/AudioConfiguration.h.
1437         * platform/mediacapabilities/MediaConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaConfiguration.h.
1438         * platform/mediacapabilities/MediaDecodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.h.
1439         * platform/mediacapabilities/MediaDecodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
1440         * platform/mediacapabilities/MediaEncodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.h.
1441         * platform/mediacapabilities/MediaEncodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingType.h.
1442         * platform/mediacapabilities/MediaEngineConfiguration.cpp: Removed.
1443         * platform/mediacapabilities/MediaEngineConfiguration.h: Removed.
1444         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
1445         (WebCore::factories):
1446         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
1447         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
1448         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
1449         * platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Removed.
1450         * platform/mediacapabilities/VideoConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/VideoConfiguration.h.
1451         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
1452         * platform/mock/MediaEngineConfigurationFactoryMock.cpp: Added.
1453         (WebCore::canDecodeMedia):
1454         (WebCore::canSmoothlyDecodeMedia):
1455         (WebCore::canPowerEfficientlyDecodeMedia):
1456         (WebCore::canEncodeMedia):
1457         (WebCore::canSmoothlyEncodeMedia):
1458         (WebCore::canPowerEfficientlyEncodeMedia):
1459         (WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
1460         (WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
1461         * platform/mock/MediaEngineConfigurationFactoryMock.h: Renamed from Source/WebCore/platform/mediacapabilities/MediaEngineDecodingConfiguration.h.
1462         * platform/mock/MediaEngineDecodingConfigurationMock.cpp: Removed.
1463         * platform/mock/MediaEngineDecodingConfigurationMock.h: Removed.
1464         * platform/mock/MediaEngineEncodingConfigurationMock.cpp: Removed.
1465         * platform/mock/MediaEngineEncodingConfigurationMock.h: Removed.
1466
1467 2018-09-08  Ryosuke Niwa  <rniwa@webkit.org>
1468
1469         :first-child, :last-child, :nth-child, and :nth-of-type don't work on shadow root's children
1470         https://bugs.webkit.org/show_bug.cgi?id=166748
1471         <rdar://problem/29649177>
1472
1473         Reviewed by Yusuke Suzuki.
1474
1475         Added the support for matching positional pseudo classes. For now, we invalidate whenever a child node
1476         of a non-UA ShadowRoot is mutated instead of a fine-grained style invalidation as done for regular elements.
1477
1478         Tests: fast/shadow-dom/nth-node-on-shadow-child-invalidation.html
1479                fast/shadow-dom/nth-node-on-shadow-child-no-jit.html
1480                fast/shadow-dom/nth-node-on-shadow-child.html
1481
1482         * css/SelectorChecker.cpp:
1483         (WebCore::SelectorChecker::checkOne const):
1484         * cssjit/SelectorCompiler.cpp:
1485         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElementOrShadowRoot):
1486         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild):
1487         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLastChild):
1488         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild):
1489         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate):
1490         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
1491         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
1492         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate):
1493         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
1494         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
1495         * dom/ShadowRoot.cpp:
1496         (WebCore::ShadowRoot::childrenChanged): Invalidate the subtree whenever a child node is mutated.
1497         * dom/ShadowRoot.h:
1498         * domjit/DOMJITHelpers.h:
1499         (WebCore::DOMJIT::branchTestIsShadowRootFlagOnNode): Added.
1500         (WebCore::DOMJIT::branchTestIsElementOrShadowRootFlagOnNode): Added.
1501
1502 2018-09-11  Per Arne Vollan  <pvollan@apple.com>
1503
1504         Addressing post-review feedback on r235619.
1505         https://bugs.webkit.org/show_bug.cgi?id=187925
1506
1507         Unreviewed.
1508
1509         * testing/Internals.cpp:
1510         (WebCore::Internals::primaryScreenDisplayID):
1511         * testing/Internals.h:
1512
1513 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1514
1515         [macOS] [WK2] Support changing foreground colors via color panel
1516         https://bugs.webkit.org/show_bug.cgi?id=189382
1517         <rdar://problem/44227311>
1518
1519         Reviewed by Ryosuke Niwa.
1520
1521         Small adjustments to support changing foreground text color using NSColorPanel in WebKit2. See comments below.
1522         Tested by FontManagerTests.ChangeFontColorWithColorPanel.
1523
1524         * editing/EditingStyle.cpp:
1525         (WebCore::StyleChange::extractTextStyles):
1526
1527         Support setting foreground text color with alpha by using a styled span element rather than a font element with
1528         attributes. To do this, only populate `StyleChange::m_applyFontColor` if the color is opaque. This is because
1529         the font element does not support `rgba()` syntax, so any font colors here with alpha that are serialized to
1530         `rgba()` result in a garbage value for the computed color style.
1531
1532         * editing/FontAttributeChanges.cpp:
1533         (WebCore::FontAttributeChanges::editAction const):
1534
1535         Add a helper to return the relevant EditAction describing this set of FontAttributeChanges.
1536
1537         * editing/FontAttributeChanges.h:
1538         (WebCore::FontChanges::isEmpty const):
1539
1540 2018-09-11  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1541
1542         Shrink size of ResourseResponseBase
1543         https://bugs.webkit.org/show_bug.cgi?id=189501
1544
1545         Reviewed by Simon Fraser.
1546
1547         We reduce the size of ResourceResponseBase by the following two optimizations.
1548
1549         1. Use bitfields for bool flags and reorder them.
1550
1551         2. Use Markable<> in CacheControlDirectives, which is held by ResourceResponseBase.
1552
1553         This patch reduces the size of ResourceResponseBase from 416 to 392 bytes.
1554
1555         No behavior change.
1556
1557         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1558         (WebCore::WebCoreAVFResourceLoader::responseReceived):
1559         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
1560         * platform/network/CacheValidation.h:
1561         (WebCore::CacheControlDirectives::CacheControlDirectives):
1562         * platform/network/ResourceResponseBase.cpp:
1563         (WebCore::ResourceResponseBase::ResourceResponseBase):
1564         (WebCore::ResourceResponseBase::contentRange const):
1565         * platform/network/ResourceResponseBase.h:
1566         (WebCore::ResourceResponseBase::decode):
1567
1568 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1569
1570         Unreviewed, fix some -Wreturn-type warnings
1571
1572         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1573         (WebCore::sourceFromNewReceiver):
1574         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1575         (WebCore::toRTCRtpTransceiverDirection):
1576         (WebCore::fromRTCRtpTransceiverDirection):
1577
1578 2018-09-11  Jiewen Tan  <jiewen_tan@apple.com>
1579
1580         Unreviewed, a speculative build fix for r235888.
1581
1582         * Modules/mediastream/MediaDevices.h:
1583         Add class Document forward declaration.
1584
1585 2018-09-11  Woodrow Wang  <woodrow_wang@apple.com>
1586
1587         Add Web API Statistics Collection
1588         https://bugs.webkit.org/show_bug.cgi?id=187773
1589         <rdar://problem/44155162>
1590
1591         Reviewed by Brent Fulgham.
1592
1593         Added data collection for web API statistics, specifically regarding the canvas, font loads, 
1594         screen functions, and navigator functions. The data collection code is placed under a runtime 
1595         enabled feature flag. The statistics are stored in a ResourceLoadStatistics object and written 
1596         to a plist on disk. Added a new file CanvasActivityRecord.h and CanvasActivityRecord.cpp which
1597         includes a struct to keep track of HTML5 canvas element read and writes. 
1598
1599         Tests: http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
1600                http/tests/webAPIStatistics/font-load-data-collection.html
1601                http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
1602                http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
1603
1604         * Sources.txt:
1605         * WebCore.xcodeproj/project.pbxproj:
1606         * css/CSSFontFaceSource.cpp:
1607         (WebCore::CSSFontFaceSource::load):
1608         * css/CSSFontSelector.cpp:
1609         (WebCore::CSSFontSelector::fontRangesForFamily):
1610         (WebCore::CSSFontSelector::fallbackFontAt):
1611
1612         The following are the functions where we'd like to record a canvas read.
1613
1614         * html/HTMLCanvasElement.cpp:
1615         (WebCore::HTMLCanvasElement::toDataURL):
1616         (WebCore::HTMLCanvasElement::toBlob):
1617         (WebCore::HTMLCanvasElement::getImageData):
1618         (WebCore::HTMLCanvasElement::toMediaSample):
1619         (WebCore::HTMLCanvasElement::captureStream):
1620
1621         The following are the functions where we'd like to record a canvas write.
1622
1623         * html/canvas/CanvasRenderingContext2D.cpp:
1624         (WebCore::CanvasRenderingContext2D::measureText):
1625         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1626
1627         The following files and functions handle the CanvasActivityRecord struct and
1628         its respective functions.
1629
1630         * loader/CanvasActivityRecord.cpp: Added.
1631         (WebCore::CanvasActivityRecord::recordWrittenOrMeasuredText):
1632         (WebCore::CanvasActivityRecord::mergeWith):
1633         * loader/CanvasActivityRecord.h: Added.
1634         (WebCore::CanvasActivityRecord::encode const):
1635         (WebCore::CanvasActivityRecord::decode):
1636
1637         * loader/DocumentThreadableLoader.cpp:
1638         * loader/FrameLoader.cpp:
1639         * loader/ResourceLoadObserver.cpp:
1640         (WebCore::ResourceLoadObserver::logFontLoad):
1641         (WebCore::ResourceLoadObserver::logCanvasRead):
1642         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
1643         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
1644         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
1645
1646         Before, entries in the ResourceLoadStatistics involving HashSets used "origin" as the key. 
1647         Now the encodeHashSet function has been generalized to take any key to encode the entries 
1648         in the HashSet. Also added functionality to encode an OptionSet by converting it to its 
1649         raw bitmask state. 
1650
1651         * loader/ResourceLoadObserver.h:
1652         * loader/ResourceLoadStatistics.cpp:
1653         (WebCore::encodeHashSet):
1654         (WebCore::encodeOriginHashSet):
1655         (WebCore::encodeOptionSet):
1656         (WebCore::encodeFontHashSet):
1657         (WebCore::encodeCanvasActivityRecord):
1658         (WebCore::ResourceLoadStatistics::encode const):
1659         (WebCore::decodeHashSet):
1660         (WebCore::decodeOriginHashSet):
1661         (WebCore::decodeOptionSet):
1662         (WebCore::decodeFontHashSet):
1663         (WebCore::decodeCanvasActivityRecord):
1664         (WebCore::ResourceLoadStatistics::decode):
1665         (WebCore::navigatorAPIEnumToString):
1666         (WebCore::screenAPIEnumToString):
1667         (WebCore::appendNavigatorAPIOptionSet):
1668         (WebCore::appendScreenAPIOptionSet):
1669         (WebCore::ResourceLoadStatistics::toString const):
1670         (WebCore::ResourceLoadStatistics::merge):
1671         * loader/ResourceLoadStatistics.h:
1672         * loader/ResourceTiming.cpp:
1673
1674         The following are the navigator functions recorded for the web API statistics.
1675
1676         * page/Navigator.cpp:
1677         (WebCore::Navigator::appVersion const):
1678         (WebCore::Navigator::userAgent const):
1679         (WebCore::Navigator::plugins):
1680         (WebCore::Navigator::mimeTypes):
1681         (WebCore::Navigator::cookieEnabled const):
1682         (WebCore::Navigator::javaEnabled const):
1683
1684         The following are the screen functions recorded for the web API statistics.
1685
1686         * page/Screen.cpp:
1687         (WebCore::Screen::height const):
1688         (WebCore::Screen::width const):
1689         (WebCore::Screen::colorDepth const):
1690         (WebCore::Screen::pixelDepth const):
1691         (WebCore::Screen::availLeft const):
1692         (WebCore::Screen::availTop const):
1693         (WebCore::Screen::availHeight const):
1694         (WebCore::Screen::availWidth const):
1695
1696 2018-09-11  Pablo Saavedra  <psaavedra@igalia.com>
1697
1698         playbackControlsManagerUpdateTimerFired and
1699         m_playbackControlsManagerUpdateTimer must be
1700         guarded with ENABLE(VIDEO), otherwise the following
1701         error occurs with the VIDEO feature turned off:
1702
1703           error: 'MediaElementSession' has not been declared
1704
1705         Add missing #if ENABLE(VIDEO) Page.cpp and Page.h
1706         https://bugs.webkit.org/show_bug.cgi?id=189500
1707
1708         Reviewed by Anders Carlsson.
1709
1710         * page/Page.cpp:
1711         (WebCore::Page::Page):
1712         (WebCore::Page::schedulePlaybackControlsManagerUpdate):
1713         * page/Page.h:
1714
1715 2018-09-11  Frederic Wang  <fwang@igalia.com>
1716
1717         Refactor filter list checking code
1718         https://bugs.webkit.org/show_bug.cgi?id=185087
1719
1720         Reviewed by Antonio Gomes.
1721
1722         No new tests, behavior unchanged.
1723
1724         * page/animation/KeyframeAnimation.h: Add missing forward-declaration FilterOperations.
1725
1726 == Rolled over to ChangeLog-2018-09-11 ==