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