Enable USE_MEDIAREMOTE on iOS
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-09-13  Jer Noble  <jer.noble@apple.com>
2
3         Enable USE_MEDIAREMOTE on iOS
4         https://bugs.webkit.org/show_bug.cgi?id=189096
5
6         Reviewed by Eric Carlson.
7
8         Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
9         Now Playing implementation on iOS and Mac.
10
11         * SourcesCocoa.txt:
12         * WebCore.xcodeproj/project.pbxproj:
13         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
14         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
15         * platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
16         (PlatformMediaSessionManager::sharedManager):
17         (PlatformMediaSessionManager::sharedManagerIfExists):
18         (MediaSessionManagerCocoa::updateSessionState):
19         (MediaSessionManagerCocoa::beginInterruption):
20         (MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
21         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
22         (MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
23         (MediaSessionManagerCocoa::removeSession):
24         (MediaSessionManagerCocoa::sessionWillEndPlayback):
25         (MediaSessionManagerCocoa::clientCharacteristicsChanged):
26         (MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
27         (MediaSessionManagerCocoa::nowPlayingEligibleSession):
28         (MediaSessionManagerCocoa::updateNowPlayingInfo):
29         * platform/audio/ios/MediaSessionManagerIOS.h:
30         (): Deleted.
31         * platform/audio/ios/MediaSessionManagerIOS.mm:
32         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
33         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
34         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
35         (WebCore::MediaSessionManageriOS::removeSession): Deleted.
36         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
37         (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
38         * platform/audio/mac/MediaSessionManagerMac.h: Removed.
39
40 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
41
42         Remove the workaround for friend class LazyNeverDestroyed<X> statements for MSVC
43         https://bugs.webkit.org/show_bug.cgi?id=189576
44
45         Reviewed by Alex Christensen.
46
47         Old MSVC can't compile "friend class LazyNeverDestroyed<X>"
48         statements, but "friend LazyNeverDestroyed<X>".
49
50         No new tests (No behavior change).
51
52         * css/CSSInheritedValue.h: Removed the code for COMPILER(MSVC).
53         Removed 'class' keyword in "friend class LazyNeverDestroyed<X>"
54         statement.
55         * css/CSSInitialValue.h: Ditto.
56         * css/CSSPrimitiveValue.h: Ditto.
57         * css/CSSRevertValue.h: Ditto.
58         * css/CSSUnsetValue.h: Ditto.
59
60 2018-09-13  Ms2ger  <Ms2ger@igalia.com>
61
62         [GLib] Fix format string in KeyedEncoderGlib::beginObject().
63         https://bugs.webkit.org/show_bug.cgi?id=189585
64
65         Reviewed by Michael Catanzaro.
66
67         This appears to fix the following assertion locally:
68
69         GLib-CRITICAL **: g_variant_builder_add_value: assertion '!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed
70
71         Covered by existing tests.
72
73         * platform/glib/KeyedEncoderGlib.cpp:
74         (WebCore::KeyedEncoderGlib::beginObject):
75
76 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
77
78         Unreviewed, rolling out r235953.
79
80         Caused layout test crashes under GuardMalloc.
81
82         Reverted changeset:
83
84         "Make GraphicsLayers ref-counted, so their tree can persist
85         when disconnected from RenderLayerBackings"
86         https://bugs.webkit.org/show_bug.cgi?id=189521
87         https://trac.webkit.org/changeset/235953
88
89 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
90
91         Remove a MSVC workaround in XPath::Step::NodeTest
92         https://bugs.webkit.org/show_bug.cgi?id=189578
93
94         Reviewed by Alex Christensen.
95
96         XPath::Step::NodeTest has a special code for MSVC bug workaround.
97         It has been introduced in 5 years ago in Bug 121082 Comment 19.
98
99         I think it is safe just to remove the workaround.
100
101         No new tests (No behavior change).
102
103         * xml/XPathStep.h: Removed the MSVC workaround.
104
105 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
106
107         Remove a MSVC workaround in InspectorStyle::styleWithProperties
108         https://bugs.webkit.org/show_bug.cgi?id=189577
109
110         Reviewed by Alex Christensen.
111
112         No new tests (No behavior change).
113
114         * inspector/InspectorStyleSheet.cpp:
115         (WebCore::InspectorStyle::styleWithProperties const): Use 'auto' for the type of 'status'.
116
117 2018-09-13  Alex Christensen  <achristensen@webkit.org>
118
119         Use a Variant instead of a union in CSSSelector
120         https://bugs.webkit.org/show_bug.cgi?id=188559
121
122         Reviewed by Antti Koivisto.
123
124         No change in behavior. This just makes some of the existing problems more obvious and easy to fix.
125
126         I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
127         I only have m_isForPage when assertions are enabled because it's only used for an assertion.
128         The rest is pretty straightforward translating union syntax to Variant syntax.
129         I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.
130
131         * css/CSSSelector.cpp:
132         (WebCore::CSSSelector::CSSSelector):
133         (WebCore::CSSSelector::createRareData):
134         (WebCore::CSSSelector::setAttribute):
135         (WebCore::CSSSelector::setArgument):
136         (WebCore::CSSSelector::setLangArgumentList):
137         (WebCore::CSSSelector::setSelectorList):
138         (WebCore::CSSSelector::setNth):
139         (WebCore::CSSSelector::matchNth const):
140         (WebCore::CSSSelector::nthA const):
141         (WebCore::CSSSelector::nthB const):
142         (WebCore::CSSSelector::RareData::RareData):
143         * css/CSSSelector.h:
144         (WebCore::CSSSelector::argument const):
145         (WebCore::CSSSelector::langArgumentList const):
146         (WebCore::CSSSelector::selectorList const):
147         (WebCore::CSSSelector::attribute const):
148         (WebCore::CSSSelector::attributeCanonicalLocalName const):
149         (WebCore::CSSSelector::setValue):
150         (WebCore::CSSSelector::CSSSelector):
151         (WebCore::CSSSelector::~CSSSelector):
152         (WebCore::CSSSelector::tagQName const):
153         (WebCore::CSSSelector::tagLowercaseLocalName const):
154         (WebCore::CSSSelector::value const):
155         (WebCore::CSSSelector::serializingValue const):
156         (WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
157         (WebCore::CSSSelector::RareData::create): Deleted.
158         * css/parser/CSSParserImpl.cpp:
159         (WebCore::CSSParserImpl::parsePageSelector):
160         * css/parser/CSSParserSelector.h:
161
162 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
163
164         [Win][Clang] error: type 'float' cannot be narrowed to 'LONG' (aka 'long') in initializer list in WheelEventWin.cpp
165         https://bugs.webkit.org/show_bug.cgi?id=189575
166
167         Reviewed by Alex Christensen.
168
169         No new tests (No behavior change).
170
171         * platform/win/WheelEventWin.cpp:
172         (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use flooredIntPoint to convert FloatPoint to POINT.
173
174 2018-09-13  Youenn Fablet  <youenn@apple.com>
175
176         Introduce RTCRtpSendParameters
177         https://bugs.webkit.org/show_bug.cgi?id=189563
178
179         Reviewed by Eric Carlson.
180
181         Introduce RTCRtpSendParameters to match the WebRTC specification.
182         Split RTCRtpPrameters fields accordingly and update call sites.
183
184         Covered by updated test.
185
186         * CMakeLists.txt:
187         * DerivedSources.make:
188         * Modules/mediastream/PeerConnectionBackend.h:
189         * Modules/mediastream/RTCRtpCodingParameters.h: Added
190         * Modules/mediastream/RTCRtpCodingParameters.idl: Added
191         * Modules/mediastream/RTCRtpDecodingParameters.h: Added
192         * Modules/mediastream/RTCRtpDecodingParameters.idl: Added
193         * Modules/mediastream/RTCRtpEncodingParameters.h:
194         * Modules/mediastream/RTCRtpEncodingParameters.idl:
195         * Modules/mediastream/RTCRtpParameters.h:
196         * Modules/mediastream/RTCRtpParameters.idl:
197         * Modules/mediastream/RTCRtpReceiver.cpp:
198         * Modules/mediastream/RTCRtpSendParameters.h: Added.
199         (WebCore::RTCRtpSendParameters::RTCRtpSendParameters):
200         * Modules/mediastream/RTCRtpSendParameters.idl: Added.
201         * Modules/mediastream/RTCRtpSender.cpp:
202         (WebCore::RTCRtpSender::getParameters):
203         (WebCore::RTCRtpSender::setParameters):
204         * Modules/mediastream/RTCRtpSender.h:
205         * Modules/mediastream/RTCRtpSender.idl:
206         * Modules/mediastream/RTCRtpSenderBackend.h:
207         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
208         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
209         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
210         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
211         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
212         (WebCore::toRTCRtpParameters):
213         (WebCore::toRTCRtpSendParameters):
214         (WebCore::fromRTCRtpSendParameters):
215         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
216         * Sources.txt:
217         * WebCore.xcodeproj/project.pbxproj:
218
219 2018-09-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
220
221         [GStreamer][EME] decrypt-key-needed message renamed to drm-cdm-instance-needed
222         https://bugs.webkit.org/show_bug.cgi?id=189547
223
224         Reviewed by Philippe Normand.
225
226         decrypt-key-needed message renamed to drm-cdm-instance-needed.
227
228         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
229         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Apart from
230         renaming the message, removed the class prefix for
231         dispatchCDMInstance.
232         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
233         (webkitMediaCommonEncryptionDecryptTransformInPlace):
234
235 2018-09-11  Ryosuke Niwa  <rniwa@webkit.org>
236
237         imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion
238         https://bugs.webkit.org/show_bug.cgi?id=189493
239
240         Reviewed by Alex Christensen.
241
242         The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced
243         by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot.
244         When a form (or any other) element has more than one ref inside removeDetachedChildren,
245         addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder.
246
247         However, when a form associated element of this form element appears later in the tree order,
248         FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot.
249
250         Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial
251         operations happening in this function so this should be safe.
252
253         Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html
254
255         * html/FormAssociatedElement.cpp:
256         (WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug.
257
258 2018-09-12  Dan Bernstein  <mitz@apple.com>
259
260         [Cocoa] Complete support for Paste as Quotation
261         https://bugs.webkit.org/show_bug.cgi?id=189504
262
263         Reviewed by Wenson Hsieh.
264
265         Tests: editing/pasteboard/4930986-1-paste-as-quotation.html
266                editing/pasteboard/4930986-2-paste-as-quotation.html
267                editing/pasteboard/4930986-3-paste-as-quotation.html
268
269         * editing/Editor.cpp:
270           Added ClipboardEventKind::PasteAsQuotation.
271         (WebCore::eventNameForClipboardEvent): Map PasteAsQuotation to the "paste" DOM event name.
272         (WebCore::createDataTransferForClipboardEvent): Place the unquoted content in the event.
273           This means that currently event handlers can’t emulate pasting as quotation, because they
274           neither have the quoted content nor knowledge that quoting has been requested. We could
275           change this in the future if needed.
276         (WebCore::Editor::paste): Updated for change in pasteWithPasteboard’s argument type.
277         (WebCore::Editor::pasteAsQuotation): Added. Similar to paste, but passes
278           PasteOption::AsQuotation to pasteWithPasteboard.
279         (WebCore::Editor::quoteFragmentForPasting): Added. Quoting for pasting consists of enclosing
280           the fragment in a blockquote element with the "type" attribute set to "cite" and the
281           "class" attribute set to a well-known value, which is used to trigger special behavior in
282           ReplaceSelectionCommand. The behavior includes removing the "class" attribute in the end,
283           so eventually, we could stop using this form of in-band signaling.
284         * editing/Editor.h: Declared PasteOption enum class to encompass the existing allowPlainText
285           and MailBlockquoteHandling arguments to pasteWithPasteboard as well as the new AsQuotation
286           behavior.
287
288         * editing/EditorCommand.cpp:
289         (WebCore::executePasteAsQuotation): Added. Similar to executing Paste.
290         (WebCore::createCommandMap): Added an entry for PasteAsQuotation, based on the Paste entry.
291
292         * editing/cocoa/EditorCocoa.mm:
293         (WebCore::Editor::webContentFromPasteboard): Moved from EditorIOS.mm and EditorMac.mm to
294           here.
295
296         * editing/gtk/EditorGtk.cpp:
297         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
298           quote the fragment if needed.
299
300         * editing/ios/EditorIOS.mm:
301         (WebCore::Editor::pasteWithPasteboard): Ditto.
302         (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
303
304         * editing/mac/EditorMac.mm:
305         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
306           quote the fragment if needed.
307         (WebCore::Editor::readSelectionFromPasteboard): Updated for new OptionSet argument to
308           pasteWithPasteboard.
309         (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
310
311         * editing/win/EditorWin.cpp:
312         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
313           quote the fragment if needed.
314
315         * editing/wpe/EditorWPE.cpp:
316         (WebCore::Editor::pasteWithPasteboard): Ditto.
317
318 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
319
320         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
321         https://bugs.webkit.org/show_bug.cgi?id=189521
322
323         Reviewed by Tim Horton.
324         
325         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
326         
327         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
328         
329         All the other changes are just to adapt to the new ownership patterns.
330         
331         I verified that no GraphicsLayers were leaked or abandoned after this change.
332
333         No behavior change.
334
335         * page/PageOverlayController.cpp:
336         (WebCore::PageOverlayController::layerWithDocumentOverlays):
337         (WebCore::PageOverlayController::layerWithViewOverlays):
338         (WebCore::PageOverlayController::installPageOverlay):
339         (WebCore::PageOverlayController::uninstallPageOverlay):
340         (WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
341         (WebCore::PageOverlayController::didChangeViewSize):
342         (WebCore::PageOverlayController::didChangeDocumentSize):
343         (WebCore::PageOverlayController::didChangeSettings):
344         (WebCore::PageOverlayController::paintContents):
345         (WebCore::PageOverlayController::didChangeOverlayFrame):
346         (WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
347         * page/PageOverlayController.h:
348         * page/mac/ServicesOverlayController.h:
349         (WebCore::ServicesOverlayController::Highlight::layer const):
350         * page/mac/ServicesOverlayController.mm:
351         (WebCore::ServicesOverlayController::Highlight::Highlight):
352         (WebCore::ServicesOverlayController::Highlight::invalidate):
353         (WebCore::ServicesOverlayController::Highlight::fadeIn):
354         (WebCore::ServicesOverlayController::Highlight::fadeOut):
355         (WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
356         (WebCore::ServicesOverlayController::determineActiveHighlight):
357         * platform/graphics/GraphicsLayer.cpp:
358         (WebCore::GraphicsLayer::GraphicsLayer):
359         (WebCore::GraphicsLayer::willBeDestroyed):
360         (WebCore::GraphicsLayer::setChildren):
361         (WebCore::GraphicsLayer::addChild):
362         (WebCore::GraphicsLayer::addChildAtIndex):
363         (WebCore::GraphicsLayer::addChildBelow):
364         (WebCore::GraphicsLayer::addChildAbove):
365         (WebCore::GraphicsLayer::replaceChild):
366         (WebCore::GraphicsLayer::removeAllChildren):
367         (WebCore::GraphicsLayer::removeFromParent):
368         (WebCore::GraphicsLayer::setMaskLayer):
369         (WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
370         (WebCore::GraphicsLayer::distributeOpacity):
371         (WebCore::GraphicsLayer::traverse):
372         (WebCore::dumpChildren):
373         * platform/graphics/GraphicsLayer.h:
374         (WebCore::GraphicsLayer::children const):
375         (WebCore::GraphicsLayer::children):
376         (WebCore::GraphicsLayer::maskLayer const):
377         (WebCore::GraphicsLayer::replicaLayer const):
378         (WebCore::GraphicsLayer::beingDestroyed const):
379         (WebCore::GraphicsLayer:: const): Deleted.
380         * platform/graphics/GraphicsLayerFactory.h:
381         * platform/graphics/ca/GraphicsLayerCA.cpp:
382         (WebCore::GraphicsLayer::create):
383         (WebCore::GraphicsLayerCA::setChildren):
384         (WebCore::GraphicsLayerCA::addChild):
385         (WebCore::GraphicsLayerCA::addChildAtIndex):
386         (WebCore::GraphicsLayerCA::addChildBelow):
387         (WebCore::GraphicsLayerCA::addChildAbove):
388         (WebCore::GraphicsLayerCA::replaceChild):
389         (WebCore::GraphicsLayerCA::setMaskLayer):
390         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
391         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
392         (WebCore::GraphicsLayerCA::updateSublayerList):
393         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
394         * platform/graphics/ca/GraphicsLayerCA.h:
395         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
396         (WebCore::GraphicsLayer::create):
397         (WebCore::GraphicsLayerTextureMapper::setChildren):
398         (WebCore::GraphicsLayerTextureMapper::addChild):
399         (WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
400         (WebCore::GraphicsLayerTextureMapper::addChildAbove):
401         (WebCore::GraphicsLayerTextureMapper::addChildBelow):
402         (WebCore::GraphicsLayerTextureMapper::replaceChild):
403         (WebCore::GraphicsLayerTextureMapper::setMaskLayer):
404         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
405         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
406         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
407         (WebCore::GraphicsLayer::create):
408         (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
409         (WebCore::CoordinatedGraphicsLayer::addChild):
410         (WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
411         (WebCore::CoordinatedGraphicsLayer::addChildAbove):
412         (WebCore::CoordinatedGraphicsLayer::addChildBelow):
413         (WebCore::CoordinatedGraphicsLayer::replaceChild):
414         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
415         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
416         (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
417         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
418         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
419         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
420         (WebCore::GraphicsLayer::create):
421         (WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
422         (WebCore::GraphicsLayerDirect2D::initialize): Deleted.
423         (WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
424         (WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
425         (WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
426         * rendering/RenderLayerBacking.cpp:
427         (WebCore::RenderLayerBacking::createGraphicsLayer):
428         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
429         (WebCore::RenderLayerBacking::updateConfiguration):
430         (WebCore::RenderLayerBacking::updateInternalHierarchy):
431         (WebCore::RenderLayerBacking::updateMaskingLayer):
432         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
433         (WebCore::RenderLayerBacking::updateScrollingLayers):
434         * rendering/RenderLayerBacking.h:
435         * rendering/RenderLayerCompositor.cpp:
436         (WebCore::RenderLayerCompositor::updateCompositingLayers):
437         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
438         (WebCore::RenderLayerCompositor::setCompositingParent):
439         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
440         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
441         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
442         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
443         (WebCore::RenderLayerCompositor::updateLayerForHeader):
444         (WebCore::RenderLayerCompositor::updateLayerForFooter):
445         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
446         (WebCore::RenderLayerCompositor::ensureRootLayer):
447         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
448         * rendering/RenderLayerCompositor.h:
449
450 2018-09-12  Alex Christensen  <achristensen@webkit.org>
451
452         Expose fewer of URL's internal members
453         https://bugs.webkit.org/show_bug.cgi?id=189528
454
455         Reviewed by Chris Dumez.
456
457         * loader/appcache/ApplicationCacheStorage.cpp:
458         (WebCore::urlHostHash):
459         * platform/URL.cpp:
460         (WebCore::URL::hostStart const):
461         (WebCore::protocolHostAndPortAreEqual):
462         (WebCore::hostsAreEqual):
463         * platform/URL.h:
464         (WebCore::URL::hostStart const): Deleted.
465         (WebCore::URL::hostEnd const): Deleted.
466
467 2018-09-12  Basuke Suzuki  <Basuke.Suzuki@sony.com>
468
469         [Curl] Implement correct total received bytes.
470         https://bugs.webkit.org/show_bug.cgi?id=189555
471
472         Reviewed by Alex Christensen.
473
474         Curl port only reported total network received bytes before decoding.
475
476         No new test. InspectorTest is only available for WebKitTestRunner.
477
478         * platform/network/curl/CurlRequest.cpp:
479         (WebCore::CurlRequest::didReceiveData):
480         (WebCore::CurlRequest::updateNetworkLoadMetrics):
481         * platform/network/curl/CurlRequest.h:
482
483 2018-09-12  Youenn Fablet  <youenn@apple.com>
484
485         Split RTCRtpParameters idl and header file
486         https://bugs.webkit.org/show_bug.cgi?id=189524
487
488         Reviewed by Eric Carlson.
489
490         This will be easier to manage and will allow to more easily introduce sender/receiver parameters.
491         No change of behavior.
492
493         * CMakeLists.txt:
494         * DerivedSources.make:
495         * Modules/mediastream/RTCDegradationPreference.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
496         * Modules/mediastream/RTCDegradationPreference.idl: Added.
497         * Modules/mediastream/RTCDtxStatus.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
498         * Modules/mediastream/RTCDtxStatus.idl: Added.
499         * Modules/mediastream/RTCPriorityType.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
500         * Modules/mediastream/RTCPriorityType.idl: Added.
501         * Modules/mediastream/RTCRtpCodecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
502         * Modules/mediastream/RTCRtpCodecParameters.idl: Added.
503         * Modules/mediastream/RTCRtpEncodingParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
504         * Modules/mediastream/RTCRtpEncodingParameters.idl: Added.
505         * Modules/mediastream/RTCRtpFecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
506         * Modules/mediastream/RTCRtpFecParameters.idl: Added.
507         * Modules/mediastream/RTCRtpHeaderExtensionParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
508         * Modules/mediastream/RTCRtpHeaderExtensionParameters.idl: Added.
509         * Modules/mediastream/RTCRtpParameters.h:
510         * Modules/mediastream/RTCRtpParameters.idl:
511         * Modules/mediastream/RTCRtpRtxParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
512         * Modules/mediastream/RTCRtpRtxParameters.idl: Added.
513         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
514         (WebCore::toRTCEncodingParameters):
515         (WebCore::fromRTCEncodingParameters):
516         (WebCore::toRTCHeaderExtensionParameters):
517         (WebCore::fromRTCHeaderExtensionParameters):
518         (WebCore::toRTCCodecParameters):
519         (WebCore::toRTCRtpParameters):
520         (WebCore::fromRTCRtpParameters):
521         * Sources.txt:
522         * WebCore.xcodeproj/project.pbxproj:
523
524 2018-09-12  Ali Juma  <ajuma@chromium.org>
525
526         [IntersectionObserver] Implement rootMargin expansion
527         https://bugs.webkit.org/show_bug.cgi?id=189525
528
529         Reviewed by Simon Fraser.
530
531         Expand the root intersection rectangle by the observer's rootMargin when computing
532         intersections.
533
534         Test: imported/w3c/web-platform-tests/intersection-observer/root-margin.html
535
536         * dom/Document.cpp:
537         (WebCore::expandRootBoundsWithRootMargin):
538         (WebCore::computeIntersectionRects):
539         * page/IntersectionObserver.h:
540         (WebCore::IntersectionObserver::rootMarginBox const):
541         * platform/graphics/FloatRect.h:
542         (WebCore::FloatRect::expand):
543
544 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
545
546         [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
547         https://bugs.webkit.org/show_bug.cgi?id=189542
548
549         Reviewed by Alex Christensen.
550
551         No new tests (No behavior change).
552
553         * platform/graphics/win/IntPointWin.cpp:
554         (WebCore::IntPoint::operator POINTS const): Narrowed m_x and m_y by using static_cast.
555
556 2018-09-12  Guillaume Emont  <guijemont@igalia.com>
557
558         Add IGNORE_WARNING_.* macros
559         https://bugs.webkit.org/show_bug.cgi?id=188996
560
561         Reviewed by Michael Catanzaro.
562
563         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
564         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
565         * accessibility/mac/AXObjectCacheMac.mm:
566         (WebCore::AXObjectCache::postPlatformNotification):
567         * accessibility/mac/AccessibilityObjectMac.mm:
568         (WebCore::AccessibilityObject::overrideAttachmentParent):
569         (WebCore::AccessibilityObject::accessibilityIgnoreAttachment const):
570         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
571         (-[WebAccessibilityObjectWrapper renderWidgetChildren]):
572         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
573         (-[WebAccessibilityObjectWrapper role]):
574         (-[WebAccessibilityObjectWrapper roleDescription]):
575         * bridge/objc/WebScriptObject.mm:
576         * bridge/objc/objc_class.mm:
577         (JSC::Bindings::ObjcClass::fieldNamed const):
578         * crypto/CommonCryptoUtilities.cpp:
579         (WebCore::getCommonCryptoDigestAlgorithm):
580         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
581         (WebCore::encryptAES_GCM):
582         (WebCore::decyptAES_GCM):
583         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
584         (WebCore::wrapSerializedCryptoKey):
585         (WebCore::unwrapSerializedCryptoKey):
586         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
587         * css/makeSelectorPseudoElementsMap.py:
588         * editing/TextIterator.cpp:
589         * editing/mac/EditorMac.mm:
590         (WebCore::Editor::pasteWithPasteboard):
591         (WebCore::Editor::takeFindStringFromSelection):
592         (WebCore::Editor::replaceNodeFromPasteboard):
593         * page/mac/EventHandlerMac.mm:
594         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
595         * page/mac/ServicesOverlayController.mm:
596         (WebCore::ServicesOverlayController::Highlight::paintContents):
597         * platform/LocalizedStrings.cpp:
598         (WebCore::formatLocalizedString):
599         * platform/ScreenProperties.h:
600         (WebCore::ScreenData::decode):
601         * platform/gamepad/mac/HIDGamepadProvider.cpp:
602         (WebCore::HIDGamepadProvider::stopMonitoringInput):
603         * platform/graphics/PlatformDisplay.cpp:
604         (WebCore::PlatformDisplay::sharedDisplay):
605         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
606         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
607         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
608         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
609         (WebCore::CDMSessionAVStreamSession::update):
610         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
611         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
612         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
613         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
614         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
615         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
616         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
617         (WebCore::IGNORE_CLANG_WARNING_END):
618         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
619         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
620         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
621         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
622         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
623         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
624         (WebCore::IGNORE_CLANG_WARNING_END):
625         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
626         (PlatformCALayer::drawLayerContents):
627         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
628         (WebCore::FontCascade::fontForCombiningCharacterSequence const):
629         * platform/graphics/cg/ImageDecoderCG.cpp:
630         (WebCore::ImageDecoderCG::createFrameImageAtIndex):
631         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
632         (WebCore::GraphicsContext::drawLineForDocumentMarker):
633         * platform/graphics/cocoa/WebGLLayer.h:
634         (IGNORE_CLANG_WARNING):
635         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
636         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
637         * platform/graphics/mac/IconMac.mm:
638         (WebCore::Icon::Icon):
639         * platform/graphics/mac/PDFDocumentImageMac.mm:
640         (WebCore::PDFDocumentImage::drawPDFPage):
641         * platform/graphics/mac/WebKitNSImageExtras.mm:
642         (-[NSImage _web_lockFocusWithDeviceScaleFactor:]):
643         * platform/ios/DragImageIOS.mm:
644         * platform/mac/DragImageMac.mm:
645         (WebCore::scaleDragImage):
646         (WebCore::createDragImageForLink):
647         * platform/mac/LegacyNSPasteboardTypes.h:
648         * platform/mac/LocalCurrentGraphicsContext.mm:
649         (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
650         * platform/mac/PasteboardMac.mm:
651         (WebCore::Pasteboard::createForCopyAndPaste):
652         (WebCore::Pasteboard::createForDragAndDrop):
653         (WebCore::setDragImageImpl):
654         * platform/mac/PlatformEventFactoryMac.mm:
655         (WebCore::globalPoint):
656         * platform/mac/SSLKeyGeneratorMac.mm:
657         * platform/mac/ScrollViewMac.mm:
658         (WebCore::ScrollView::platformContentsToScreen const):
659         (WebCore::ScrollView::platformScreenToContents const):
660         * platform/mac/ThemeMac.mm:
661         (WebCore::drawCellFocusRingWithFrameAtTime):
662         * platform/mac/WebPlaybackControlsManager.mm:
663         * platform/mac/WidgetMac.mm:
664         (WebCore::Widget::paint):
665         * platform/mediastream/RealtimeIncomingAudioSource.h:
666         * platform/mediastream/RealtimeIncomingVideoSource.h:
667         * platform/mediastream/RealtimeOutgoingAudioSource.h:
668         * platform/mediastream/RealtimeOutgoingVideoSource.h:
669         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
670         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
671         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
672         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
673         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
674         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
675         * platform/network/cf/ResourceHandleCFNet.cpp:
676         (WebCore::ResourceHandle::createCFURLConnection):
677         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
678         (WebCore::SocketStreamHandleImpl::reportErrorToClient):
679         * platform/network/create-http-header-name-table:
680         * platform/text/TextEncoding.cpp:
681         * testing/MockLibWebRTCPeerConnection.h:
682         * xml/XPathGrammar.cpp:
683
684 2018-09-12  Pablo Saavedra  <psaavedra@igalia.com>
685
686         Linking against libWPEWebKit-0.1.so is not posible when WPE is build with ENABLE_VIDEO=OFF and ENABLE_WEB_AUDIO=OFF
687         https://bugs.webkit.org/show_bug.cgi?id=189540
688
689         Reviewed by Philippe Normand.
690
691         Related issues:
692
693         This issue is related with changes in https://bugs.webkit.org/show_bug.cgi?id=183080
694         This issue is introduced in https://bugs.webkit.org/show_bug.cgi?id=186547
695
696         No new tests, no changes in the functionality.
697
698         * platform/GStreamer.cmake:
699         * platform/SourcesGLib.txt:
700         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
701         (WebCore::LibWebRTCProvider::webRTCAvailable):
702
703 2018-09-11  Zan Dobersek  <zdobersek@igalia.com>
704
705         Unreviewed WPE build fix.
706
707         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
708         Add extra header inclusions to get this code building after the unified
709         sources system shifted it into a different translation unit.
710
711 2018-09-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
712
713         [Curl] WebInspector doesn't display request headers added during processing.
714         https://bugs.webkit.org/show_bug.cgi?id=189531
715
716         Reviewed by Alex Christensen.
717
718         While processing the request, Curl port network layer adds some headers to the request
719         such as cookies. Those headers should be displayed in the WebInspector.
720
721         Tested on MiniBrowser.
722
723         * platform/network/curl/CurlRequest.cpp:
724         (WebCore::CurlRequest::didReceiveHeader):
725         (WebCore::CurlRequest::didCompleteTransfer):
726         (WebCore::CurlRequest::updateNetworkLoadMetrics):
727         * platform/network/curl/CurlRequest.h:
728
729 2018-09-11  James Savage  <james.savage@apple.com>
730
731         Follow up to:
732         Expose -apple-system-container-border color to internal web views.
733         https://bugs.webkit.org/show_bug.cgi?id=189178.
734
735         Reviewed by Timothy Hatcher.
736
737         * rendering/RenderThemeMac.mm:
738         (WebCore::RenderThemeMac::systemColor const): Add a separate #if block for
739         Mojave. When I used CSSValueAppleSystemFindHighlightBackground as a template
740         for this change, I had to write out the condition in the first change, but
741         mistakenly thought I could reuse the block here. Turns out the versions were
742         different, and I could not.
743
744 2018-09-11  Youenn Fablet  <youenn@apple.com>
745
746         Remove MediaDevices NoInterfaceObject
747         https://bugs.webkit.org/show_bug.cgi?id=189512
748
749         Reviewed by Alex Christensen.
750
751         Covered by rebased WPT tests.
752
753         * Modules/mediastream/MediaDevices.idl:
754
755 2018-09-11  Jer Noble  <jer.noble@apple.com>
756
757         [MediaCapabilities] Implement MediaEngineConfigurationFactory registration
758         https://bugs.webkit.org/show_bug.cgi?id=189438
759
760         Reviewed by Eric Carlson.
761
762         Implement a mechanism to register platform-specific MediaEngineConfigurationFactory methods, and a mechanism to iterate
763         over those registered factories when createDecodingConfiguration() and createEncodingConfiguration() are called.
764
765         The Factory has been radically simplified; the concept of MediaEngineDecodingConfiguration
766         and MediaEngineEncodingConfiguration and its subclasess have been removed. Since the primary
767         objects representing video and audio configurations are IDLDictionaries, the native objects
768         are just structs full of POD types (and Strings). Since these have no dependencies on
769         higher-level HTML concepts, they can be moved into platform/ and accessed from there. This
770         patch also converts MediaCapabilitiesInfo to an Interface, so its implementation also can
771         become a struct and live in platform/. The MediaEngineDecodingConfigurationMock and
772         MediaEngineEncodingConfigurationMock have been consolidated in a single class which simply
773         parses MediaDecodingConfiguration and MediaEncodingConifguration objects (now that they live
774         in Platform) and return a MediaCapabilitiesInfo object (now that it does too).
775
776         * Modules/mediacapabilities/MediaCapabilities.cpp:
777         (WebCore::isValidVideoConfiguration):
778         (WebCore::MediaCapabilities::decodingInfo):
779         (WebCore::MediaCapabilities::encodingInfo):
780         * Modules/mediacapabilities/MediaCapabilitiesInfo.h: Removed.
781         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
782         * Modules/mediacapabilities/VideoConfiguration.idl:
783         * Sources.txt:
784         * WebCore.xcodeproj/project.pbxproj:
785         * platform/MediaCapabilitiesInfo.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
786         * platform/mediacapabilities/AudioConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/AudioConfiguration.h.
787         * platform/mediacapabilities/MediaConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaConfiguration.h.
788         * platform/mediacapabilities/MediaDecodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.h.
789         * platform/mediacapabilities/MediaDecodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
790         * platform/mediacapabilities/MediaEncodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.h.
791         * platform/mediacapabilities/MediaEncodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingType.h.
792         * platform/mediacapabilities/MediaEngineConfiguration.cpp: Removed.
793         * platform/mediacapabilities/MediaEngineConfiguration.h: Removed.
794         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
795         (WebCore::factories):
796         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
797         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
798         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
799         * platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Removed.
800         * platform/mediacapabilities/VideoConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/VideoConfiguration.h.
801         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
802         * platform/mock/MediaEngineConfigurationFactoryMock.cpp: Added.
803         (WebCore::canDecodeMedia):
804         (WebCore::canSmoothlyDecodeMedia):
805         (WebCore::canPowerEfficientlyDecodeMedia):
806         (WebCore::canEncodeMedia):
807         (WebCore::canSmoothlyEncodeMedia):
808         (WebCore::canPowerEfficientlyEncodeMedia):
809         (WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
810         (WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
811         * platform/mock/MediaEngineConfigurationFactoryMock.h: Renamed from Source/WebCore/platform/mediacapabilities/MediaEngineDecodingConfiguration.h.
812         * platform/mock/MediaEngineDecodingConfigurationMock.cpp: Removed.
813         * platform/mock/MediaEngineDecodingConfigurationMock.h: Removed.
814         * platform/mock/MediaEngineEncodingConfigurationMock.cpp: Removed.
815         * platform/mock/MediaEngineEncodingConfigurationMock.h: Removed.
816
817 2018-09-08  Ryosuke Niwa  <rniwa@webkit.org>
818
819         :first-child, :last-child, :nth-child, and :nth-of-type don't work on shadow root's children
820         https://bugs.webkit.org/show_bug.cgi?id=166748
821         <rdar://problem/29649177>
822
823         Reviewed by Yusuke Suzuki.
824
825         Added the support for matching positional pseudo classes. For now, we invalidate whenever a child node
826         of a non-UA ShadowRoot is mutated instead of a fine-grained style invalidation as done for regular elements.
827
828         Tests: fast/shadow-dom/nth-node-on-shadow-child-invalidation.html
829                fast/shadow-dom/nth-node-on-shadow-child-no-jit.html
830                fast/shadow-dom/nth-node-on-shadow-child.html
831
832         * css/SelectorChecker.cpp:
833         (WebCore::SelectorChecker::checkOne const):
834         * cssjit/SelectorCompiler.cpp:
835         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElementOrShadowRoot):
836         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild):
837         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLastChild):
838         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild):
839         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate):
840         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
841         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
842         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate):
843         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
844         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
845         * dom/ShadowRoot.cpp:
846         (WebCore::ShadowRoot::childrenChanged): Invalidate the subtree whenever a child node is mutated.
847         * dom/ShadowRoot.h:
848         * domjit/DOMJITHelpers.h:
849         (WebCore::DOMJIT::branchTestIsShadowRootFlagOnNode): Added.
850         (WebCore::DOMJIT::branchTestIsElementOrShadowRootFlagOnNode): Added.
851
852 2018-09-11  Per Arne Vollan  <pvollan@apple.com>
853
854         Addressing post-review feedback on r235619.
855         https://bugs.webkit.org/show_bug.cgi?id=187925
856
857         Unreviewed.
858
859         * testing/Internals.cpp:
860         (WebCore::Internals::primaryScreenDisplayID):
861         * testing/Internals.h:
862
863 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
864
865         [macOS] [WK2] Support changing foreground colors via color panel
866         https://bugs.webkit.org/show_bug.cgi?id=189382
867         <rdar://problem/44227311>
868
869         Reviewed by Ryosuke Niwa.
870
871         Small adjustments to support changing foreground text color using NSColorPanel in WebKit2. See comments below.
872         Tested by FontManagerTests.ChangeFontColorWithColorPanel.
873
874         * editing/EditingStyle.cpp:
875         (WebCore::StyleChange::extractTextStyles):
876
877         Support setting foreground text color with alpha by using a styled span element rather than a font element with
878         attributes. To do this, only populate `StyleChange::m_applyFontColor` if the color is opaque. This is because
879         the font element does not support `rgba()` syntax, so any font colors here with alpha that are serialized to
880         `rgba()` result in a garbage value for the computed color style.
881
882         * editing/FontAttributeChanges.cpp:
883         (WebCore::FontAttributeChanges::editAction const):
884
885         Add a helper to return the relevant EditAction describing this set of FontAttributeChanges.
886
887         * editing/FontAttributeChanges.h:
888         (WebCore::FontChanges::isEmpty const):
889
890 2018-09-11  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
891
892         Shrink size of ResourseResponseBase
893         https://bugs.webkit.org/show_bug.cgi?id=189501
894
895         Reviewed by Simon Fraser.
896
897         We reduce the size of ResourceResponseBase by the following two optimizations.
898
899         1. Use bitfields for bool flags and reorder them.
900
901         2. Use Markable<> in CacheControlDirectives, which is held by ResourceResponseBase.
902
903         This patch reduces the size of ResourceResponseBase from 416 to 392 bytes.
904
905         No behavior change.
906
907         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
908         (WebCore::WebCoreAVFResourceLoader::responseReceived):
909         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
910         * platform/network/CacheValidation.h:
911         (WebCore::CacheControlDirectives::CacheControlDirectives):
912         * platform/network/ResourceResponseBase.cpp:
913         (WebCore::ResourceResponseBase::ResourceResponseBase):
914         (WebCore::ResourceResponseBase::contentRange const):
915         * platform/network/ResourceResponseBase.h:
916         (WebCore::ResourceResponseBase::decode):
917
918 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
919
920         Unreviewed, fix some -Wreturn-type warnings
921
922         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
923         (WebCore::sourceFromNewReceiver):
924         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
925         (WebCore::toRTCRtpTransceiverDirection):
926         (WebCore::fromRTCRtpTransceiverDirection):
927
928 2018-09-11  Jiewen Tan  <jiewen_tan@apple.com>
929
930         Unreviewed, a speculative build fix for r235888.
931
932         * Modules/mediastream/MediaDevices.h:
933         Add class Document forward declaration.
934
935 2018-09-11  Woodrow Wang  <woodrow_wang@apple.com>
936
937         Add Web API Statistics Collection
938         https://bugs.webkit.org/show_bug.cgi?id=187773
939         <rdar://problem/44155162>
940
941         Reviewed by Brent Fulgham.
942
943         Added data collection for web API statistics, specifically regarding the canvas, font loads, 
944         screen functions, and navigator functions. The data collection code is placed under a runtime 
945         enabled feature flag. The statistics are stored in a ResourceLoadStatistics object and written 
946         to a plist on disk. Added a new file CanvasActivityRecord.h and CanvasActivityRecord.cpp which
947         includes a struct to keep track of HTML5 canvas element read and writes. 
948
949         Tests: http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
950                http/tests/webAPIStatistics/font-load-data-collection.html
951                http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
952                http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
953
954         * Sources.txt:
955         * WebCore.xcodeproj/project.pbxproj:
956         * css/CSSFontFaceSource.cpp:
957         (WebCore::CSSFontFaceSource::load):
958         * css/CSSFontSelector.cpp:
959         (WebCore::CSSFontSelector::fontRangesForFamily):
960         (WebCore::CSSFontSelector::fallbackFontAt):
961
962         The following are the functions where we'd like to record a canvas read.
963
964         * html/HTMLCanvasElement.cpp:
965         (WebCore::HTMLCanvasElement::toDataURL):
966         (WebCore::HTMLCanvasElement::toBlob):
967         (WebCore::HTMLCanvasElement::getImageData):
968         (WebCore::HTMLCanvasElement::toMediaSample):
969         (WebCore::HTMLCanvasElement::captureStream):
970
971         The following are the functions where we'd like to record a canvas write.
972
973         * html/canvas/CanvasRenderingContext2D.cpp:
974         (WebCore::CanvasRenderingContext2D::measureText):
975         (WebCore::CanvasRenderingContext2D::drawTextInternal):
976
977         The following files and functions handle the CanvasActivityRecord struct and
978         its respective functions.
979
980         * loader/CanvasActivityRecord.cpp: Added.
981         (WebCore::CanvasActivityRecord::recordWrittenOrMeasuredText):
982         (WebCore::CanvasActivityRecord::mergeWith):
983         * loader/CanvasActivityRecord.h: Added.
984         (WebCore::CanvasActivityRecord::encode const):
985         (WebCore::CanvasActivityRecord::decode):
986
987         * loader/DocumentThreadableLoader.cpp:
988         * loader/FrameLoader.cpp:
989         * loader/ResourceLoadObserver.cpp:
990         (WebCore::ResourceLoadObserver::logFontLoad):
991         (WebCore::ResourceLoadObserver::logCanvasRead):
992         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
993         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
994         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
995
996         Before, entries in the ResourceLoadStatistics involving HashSets used "origin" as the key. 
997         Now the encodeHashSet function has been generalized to take any key to encode the entries 
998         in the HashSet. Also added functionality to encode an OptionSet by converting it to its 
999         raw bitmask state. 
1000
1001         * loader/ResourceLoadObserver.h:
1002         * loader/ResourceLoadStatistics.cpp:
1003         (WebCore::encodeHashSet):
1004         (WebCore::encodeOriginHashSet):
1005         (WebCore::encodeOptionSet):
1006         (WebCore::encodeFontHashSet):
1007         (WebCore::encodeCanvasActivityRecord):
1008         (WebCore::ResourceLoadStatistics::encode const):
1009         (WebCore::decodeHashSet):
1010         (WebCore::decodeOriginHashSet):
1011         (WebCore::decodeOptionSet):
1012         (WebCore::decodeFontHashSet):
1013         (WebCore::decodeCanvasActivityRecord):
1014         (WebCore::ResourceLoadStatistics::decode):
1015         (WebCore::navigatorAPIEnumToString):
1016         (WebCore::screenAPIEnumToString):
1017         (WebCore::appendNavigatorAPIOptionSet):
1018         (WebCore::appendScreenAPIOptionSet):
1019         (WebCore::ResourceLoadStatistics::toString const):
1020         (WebCore::ResourceLoadStatistics::merge):
1021         * loader/ResourceLoadStatistics.h:
1022         * loader/ResourceTiming.cpp:
1023
1024         The following are the navigator functions recorded for the web API statistics.
1025
1026         * page/Navigator.cpp:
1027         (WebCore::Navigator::appVersion const):
1028         (WebCore::Navigator::userAgent const):
1029         (WebCore::Navigator::plugins):
1030         (WebCore::Navigator::mimeTypes):
1031         (WebCore::Navigator::cookieEnabled const):
1032         (WebCore::Navigator::javaEnabled const):
1033
1034         The following are the screen functions recorded for the web API statistics.
1035
1036         * page/Screen.cpp:
1037         (WebCore::Screen::height const):
1038         (WebCore::Screen::width const):
1039         (WebCore::Screen::colorDepth const):
1040         (WebCore::Screen::pixelDepth const):
1041         (WebCore::Screen::availLeft const):
1042         (WebCore::Screen::availTop const):
1043         (WebCore::Screen::availHeight const):
1044         (WebCore::Screen::availWidth const):
1045
1046 2018-09-11  Pablo Saavedra  <psaavedra@igalia.com>
1047
1048         playbackControlsManagerUpdateTimerFired and
1049         m_playbackControlsManagerUpdateTimer must be
1050         guarded with ENABLE(VIDEO), otherwise the following
1051         error occurs with the VIDEO feature turned off:
1052
1053           error: 'MediaElementSession' has not been declared
1054
1055         Add missing #if ENABLE(VIDEO) Page.cpp and Page.h
1056         https://bugs.webkit.org/show_bug.cgi?id=189500
1057
1058         Reviewed by Anders Carlsson.
1059
1060         * page/Page.cpp:
1061         (WebCore::Page::Page):
1062         (WebCore::Page::schedulePlaybackControlsManagerUpdate):
1063         * page/Page.h:
1064
1065 2018-09-11  Frederic Wang  <fwang@igalia.com>
1066
1067         Refactor filter list checking code
1068         https://bugs.webkit.org/show_bug.cgi?id=185087
1069
1070         Reviewed by Antonio Gomes.
1071
1072         No new tests, behavior unchanged.
1073
1074         * page/animation/KeyframeAnimation.h: Add missing forward-declaration FilterOperations.
1075
1076 == Rolled over to ChangeLog-2018-09-11 ==