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