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