Remove MediaDevices NoInterfaceObject
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-09-11  Youenn Fablet  <youenn@apple.com>
2
3         Remove MediaDevices NoInterfaceObject
4         https://bugs.webkit.org/show_bug.cgi?id=189512
5
6         Reviewed by Alex Christensen.
7
8         Covered by rebased WPT tests.
9
10         * Modules/mediastream/MediaDevices.idl:
11
12 2018-09-11  Jer Noble  <jer.noble@apple.com>
13
14         [MediaCapabilities] Implement MediaEngineConfigurationFactory registration
15         https://bugs.webkit.org/show_bug.cgi?id=189438
16
17         Reviewed by Eric Carlson.
18
19         Implement a mechanism to register platform-specific MediaEngineConfigurationFactory methods, and a mechanism to iterate
20         over those registered factories when createDecodingConfiguration() and createEncodingConfiguration() are called.
21
22         The Factory has been radically simplified; the concept of MediaEngineDecodingConfiguration
23         and MediaEngineEncodingConfiguration and its subclasess have been removed. Since the primary
24         objects representing video and audio configurations are IDLDictionaries, the native objects
25         are just structs full of POD types (and Strings). Since these have no dependencies on
26         higher-level HTML concepts, they can be moved into platform/ and accessed from there. This
27         patch also converts MediaCapabilitiesInfo to an Interface, so its implementation also can
28         become a struct and live in platform/. The MediaEngineDecodingConfigurationMock and
29         MediaEngineEncodingConfigurationMock have been consolidated in a single class which simply
30         parses MediaDecodingConfiguration and MediaEncodingConifguration objects (now that they live
31         in Platform) and return a MediaCapabilitiesInfo object (now that it does too).
32
33         * Modules/mediacapabilities/MediaCapabilities.cpp:
34         (WebCore::isValidVideoConfiguration):
35         (WebCore::MediaCapabilities::decodingInfo):
36         (WebCore::MediaCapabilities::encodingInfo):
37         * Modules/mediacapabilities/MediaCapabilitiesInfo.h: Removed.
38         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
39         * Modules/mediacapabilities/VideoConfiguration.idl:
40         * Sources.txt:
41         * WebCore.xcodeproj/project.pbxproj:
42         * platform/MediaCapabilitiesInfo.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
43         * platform/mediacapabilities/AudioConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/AudioConfiguration.h.
44         * platform/mediacapabilities/MediaConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaConfiguration.h.
45         * platform/mediacapabilities/MediaDecodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.h.
46         * platform/mediacapabilities/MediaDecodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
47         * platform/mediacapabilities/MediaEncodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.h.
48         * platform/mediacapabilities/MediaEncodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingType.h.
49         * platform/mediacapabilities/MediaEngineConfiguration.cpp: Removed.
50         * platform/mediacapabilities/MediaEngineConfiguration.h: Removed.
51         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
52         (WebCore::factories):
53         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
54         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
55         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
56         * platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Removed.
57         * platform/mediacapabilities/VideoConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/VideoConfiguration.h.
58         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
59         * platform/mock/MediaEngineConfigurationFactoryMock.cpp: Added.
60         (WebCore::canDecodeMedia):
61         (WebCore::canSmoothlyDecodeMedia):
62         (WebCore::canPowerEfficientlyDecodeMedia):
63         (WebCore::canEncodeMedia):
64         (WebCore::canSmoothlyEncodeMedia):
65         (WebCore::canPowerEfficientlyEncodeMedia):
66         (WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
67         (WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
68         * platform/mock/MediaEngineConfigurationFactoryMock.h: Renamed from Source/WebCore/platform/mediacapabilities/MediaEngineDecodingConfiguration.h.
69         * platform/mock/MediaEngineDecodingConfigurationMock.cpp: Removed.
70         * platform/mock/MediaEngineDecodingConfigurationMock.h: Removed.
71         * platform/mock/MediaEngineEncodingConfigurationMock.cpp: Removed.
72         * platform/mock/MediaEngineEncodingConfigurationMock.h: Removed.
73
74 2018-09-08  Ryosuke Niwa  <rniwa@webkit.org>
75
76         :first-child, :last-child, :nth-child, and :nth-of-type don't work on shadow root's children
77         https://bugs.webkit.org/show_bug.cgi?id=166748
78         <rdar://problem/29649177>
79
80         Reviewed by Yusuke Suzuki.
81
82         Added the support for matching positional pseudo classes. For now, we invalidate whenever a child node
83         of a non-UA ShadowRoot is mutated instead of a fine-grained style invalidation as done for regular elements.
84
85         Tests: fast/shadow-dom/nth-node-on-shadow-child-invalidation.html
86                fast/shadow-dom/nth-node-on-shadow-child-no-jit.html
87                fast/shadow-dom/nth-node-on-shadow-child.html
88
89         * css/SelectorChecker.cpp:
90         (WebCore::SelectorChecker::checkOne const):
91         * cssjit/SelectorCompiler.cpp:
92         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElementOrShadowRoot):
93         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild):
94         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLastChild):
95         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild):
96         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate):
97         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
98         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
99         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate):
100         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
101         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
102         * dom/ShadowRoot.cpp:
103         (WebCore::ShadowRoot::childrenChanged): Invalidate the subtree whenever a child node is mutated.
104         * dom/ShadowRoot.h:
105         * domjit/DOMJITHelpers.h:
106         (WebCore::DOMJIT::branchTestIsShadowRootFlagOnNode): Added.
107         (WebCore::DOMJIT::branchTestIsElementOrShadowRootFlagOnNode): Added.
108
109 2018-09-11  Per Arne Vollan  <pvollan@apple.com>
110
111         Addressing post-review feedback on r235619.
112         https://bugs.webkit.org/show_bug.cgi?id=187925
113
114         Unreviewed.
115
116         * testing/Internals.cpp:
117         (WebCore::Internals::primaryScreenDisplayID):
118         * testing/Internals.h:
119
120 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
121
122         [macOS] [WK2] Support changing foreground colors via color panel
123         https://bugs.webkit.org/show_bug.cgi?id=189382
124         <rdar://problem/44227311>
125
126         Reviewed by Ryosuke Niwa.
127
128         Small adjustments to support changing foreground text color using NSColorPanel in WebKit2. See comments below.
129         Tested by FontManagerTests.ChangeFontColorWithColorPanel.
130
131         * editing/EditingStyle.cpp:
132         (WebCore::StyleChange::extractTextStyles):
133
134         Support setting foreground text color with alpha by using a styled span element rather than a font element with
135         attributes. To do this, only populate `StyleChange::m_applyFontColor` if the color is opaque. This is because
136         the font element does not support `rgba()` syntax, so any font colors here with alpha that are serialized to
137         `rgba()` result in a garbage value for the computed color style.
138
139         * editing/FontAttributeChanges.cpp:
140         (WebCore::FontAttributeChanges::editAction const):
141
142         Add a helper to return the relevant EditAction describing this set of FontAttributeChanges.
143
144         * editing/FontAttributeChanges.h:
145         (WebCore::FontChanges::isEmpty const):
146
147 2018-09-11  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
148
149         Shrink size of ResourseResponseBase
150         https://bugs.webkit.org/show_bug.cgi?id=189501
151
152         Reviewed by Simon Fraser.
153
154         We reduce the size of ResourceResponseBase by the following two optimizations.
155
156         1. Use bitfields for bool flags and reorder them.
157
158         2. Use Markable<> in CacheControlDirectives, which is held by ResourceResponseBase.
159
160         This patch reduces the size of ResourceResponseBase from 416 to 392 bytes.
161
162         No behavior change.
163
164         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
165         (WebCore::WebCoreAVFResourceLoader::responseReceived):
166         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
167         * platform/network/CacheValidation.h:
168         (WebCore::CacheControlDirectives::CacheControlDirectives):
169         * platform/network/ResourceResponseBase.cpp:
170         (WebCore::ResourceResponseBase::ResourceResponseBase):
171         (WebCore::ResourceResponseBase::contentRange const):
172         * platform/network/ResourceResponseBase.h:
173         (WebCore::ResourceResponseBase::decode):
174
175 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
176
177         Unreviewed, fix some -Wreturn-type warnings
178
179         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
180         (WebCore::sourceFromNewReceiver):
181         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
182         (WebCore::toRTCRtpTransceiverDirection):
183         (WebCore::fromRTCRtpTransceiverDirection):
184
185 2018-09-11  Jiewen Tan  <jiewen_tan@apple.com>
186
187         Unreviewed, a speculative build fix for r235888.
188
189         * Modules/mediastream/MediaDevices.h:
190         Add class Document forward declaration.
191
192 2018-09-11  Woodrow Wang  <woodrow_wang@apple.com>
193
194         Add Web API Statistics Collection
195         https://bugs.webkit.org/show_bug.cgi?id=187773
196         <rdar://problem/44155162>
197
198         Reviewed by Brent Fulgham.
199
200         Added data collection for web API statistics, specifically regarding the canvas, font loads, 
201         screen functions, and navigator functions. The data collection code is placed under a runtime 
202         enabled feature flag. The statistics are stored in a ResourceLoadStatistics object and written 
203         to a plist on disk. Added a new file CanvasActivityRecord.h and CanvasActivityRecord.cpp which
204         includes a struct to keep track of HTML5 canvas element read and writes. 
205
206         Tests: http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
207                http/tests/webAPIStatistics/font-load-data-collection.html
208                http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
209                http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
210
211         * Sources.txt:
212         * WebCore.xcodeproj/project.pbxproj:
213         * css/CSSFontFaceSource.cpp:
214         (WebCore::CSSFontFaceSource::load):
215         * css/CSSFontSelector.cpp:
216         (WebCore::CSSFontSelector::fontRangesForFamily):
217         (WebCore::CSSFontSelector::fallbackFontAt):
218
219         The following are the functions where we'd like to record a canvas read.
220
221         * html/HTMLCanvasElement.cpp:
222         (WebCore::HTMLCanvasElement::toDataURL):
223         (WebCore::HTMLCanvasElement::toBlob):
224         (WebCore::HTMLCanvasElement::getImageData):
225         (WebCore::HTMLCanvasElement::toMediaSample):
226         (WebCore::HTMLCanvasElement::captureStream):
227
228         The following are the functions where we'd like to record a canvas write.
229
230         * html/canvas/CanvasRenderingContext2D.cpp:
231         (WebCore::CanvasRenderingContext2D::measureText):
232         (WebCore::CanvasRenderingContext2D::drawTextInternal):
233
234         The following files and functions handle the CanvasActivityRecord struct and
235         its respective functions.
236
237         * loader/CanvasActivityRecord.cpp: Added.
238         (WebCore::CanvasActivityRecord::recordWrittenOrMeasuredText):
239         (WebCore::CanvasActivityRecord::mergeWith):
240         * loader/CanvasActivityRecord.h: Added.
241         (WebCore::CanvasActivityRecord::encode const):
242         (WebCore::CanvasActivityRecord::decode):
243
244         * loader/DocumentThreadableLoader.cpp:
245         * loader/FrameLoader.cpp:
246         * loader/ResourceLoadObserver.cpp:
247         (WebCore::ResourceLoadObserver::logFontLoad):
248         (WebCore::ResourceLoadObserver::logCanvasRead):
249         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
250         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
251         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
252
253         Before, entries in the ResourceLoadStatistics involving HashSets used "origin" as the key. 
254         Now the encodeHashSet function has been generalized to take any key to encode the entries 
255         in the HashSet. Also added functionality to encode an OptionSet by converting it to its 
256         raw bitmask state. 
257
258         * loader/ResourceLoadObserver.h:
259         * loader/ResourceLoadStatistics.cpp:
260         (WebCore::encodeHashSet):
261         (WebCore::encodeOriginHashSet):
262         (WebCore::encodeOptionSet):
263         (WebCore::encodeFontHashSet):
264         (WebCore::encodeCanvasActivityRecord):
265         (WebCore::ResourceLoadStatistics::encode const):
266         (WebCore::decodeHashSet):
267         (WebCore::decodeOriginHashSet):
268         (WebCore::decodeOptionSet):
269         (WebCore::decodeFontHashSet):
270         (WebCore::decodeCanvasActivityRecord):
271         (WebCore::ResourceLoadStatistics::decode):
272         (WebCore::navigatorAPIEnumToString):
273         (WebCore::screenAPIEnumToString):
274         (WebCore::appendNavigatorAPIOptionSet):
275         (WebCore::appendScreenAPIOptionSet):
276         (WebCore::ResourceLoadStatistics::toString const):
277         (WebCore::ResourceLoadStatistics::merge):
278         * loader/ResourceLoadStatistics.h:
279         * loader/ResourceTiming.cpp:
280
281         The following are the navigator functions recorded for the web API statistics.
282
283         * page/Navigator.cpp:
284         (WebCore::Navigator::appVersion const):
285         (WebCore::Navigator::userAgent const):
286         (WebCore::Navigator::plugins):
287         (WebCore::Navigator::mimeTypes):
288         (WebCore::Navigator::cookieEnabled const):
289         (WebCore::Navigator::javaEnabled const):
290
291         The following are the screen functions recorded for the web API statistics.
292
293         * page/Screen.cpp:
294         (WebCore::Screen::height const):
295         (WebCore::Screen::width const):
296         (WebCore::Screen::colorDepth const):
297         (WebCore::Screen::pixelDepth const):
298         (WebCore::Screen::availLeft const):
299         (WebCore::Screen::availTop const):
300         (WebCore::Screen::availHeight const):
301         (WebCore::Screen::availWidth const):
302
303 2018-09-11  Pablo Saavedra  <psaavedra@igalia.com>
304
305         playbackControlsManagerUpdateTimerFired and
306         m_playbackControlsManagerUpdateTimer must be
307         guarded with ENABLE(VIDEO), otherwise the following
308         error occurs with the VIDEO feature turned off:
309
310           error: 'MediaElementSession' has not been declared
311
312         Add missing #if ENABLE(VIDEO) Page.cpp and Page.h
313         https://bugs.webkit.org/show_bug.cgi?id=189500
314
315         Reviewed by Anders Carlsson.
316
317         * page/Page.cpp:
318         (WebCore::Page::Page):
319         (WebCore::Page::schedulePlaybackControlsManagerUpdate):
320         * page/Page.h:
321
322 2018-09-11  Frederic Wang  <fwang@igalia.com>
323
324         Refactor filter list checking code
325         https://bugs.webkit.org/show_bug.cgi?id=185087
326
327         Reviewed by Antonio Gomes.
328
329         No new tests, behavior unchanged.
330
331         * page/animation/KeyframeAnimation.h: Add missing forward-declaration FilterOperations.
332
333 == Rolled over to ChangeLog-2018-09-11 ==