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