Addressing post-review feedback on r235619.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-09-11  Per Arne Vollan  <pvollan@apple.com>
2
3         Addressing post-review feedback on r235619.
4         https://bugs.webkit.org/show_bug.cgi?id=187925
5
6         Unreviewed.
7
8         * testing/Internals.cpp:
9         (WebCore::Internals::primaryScreenDisplayID):
10         * testing/Internals.h:
11
12 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
13
14         [macOS] [WK2] Support changing foreground colors via color panel
15         https://bugs.webkit.org/show_bug.cgi?id=189382
16         <rdar://problem/44227311>
17
18         Reviewed by Ryosuke Niwa.
19
20         Small adjustments to support changing foreground text color using NSColorPanel in WebKit2. See comments below.
21         Tested by FontManagerTests.ChangeFontColorWithColorPanel.
22
23         * editing/EditingStyle.cpp:
24         (WebCore::StyleChange::extractTextStyles):
25
26         Support setting foreground text color with alpha by using a styled span element rather than a font element with
27         attributes. To do this, only populate `StyleChange::m_applyFontColor` if the color is opaque. This is because
28         the font element does not support `rgba()` syntax, so any font colors here with alpha that are serialized to
29         `rgba()` result in a garbage value for the computed color style.
30
31         * editing/FontAttributeChanges.cpp:
32         (WebCore::FontAttributeChanges::editAction const):
33
34         Add a helper to return the relevant EditAction describing this set of FontAttributeChanges.
35
36         * editing/FontAttributeChanges.h:
37         (WebCore::FontChanges::isEmpty const):
38
39 2018-09-11  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
40
41         Shrink size of ResourseResponseBase
42         https://bugs.webkit.org/show_bug.cgi?id=189501
43
44         Reviewed by Simon Fraser.
45
46         We reduce the size of ResourceResponseBase by the following two optimizations.
47
48         1. Use bitfields for bool flags and reorder them.
49
50         2. Use Markable<> in CacheControlDirectives, which is held by ResourceResponseBase.
51
52         This patch reduces the size of ResourceResponseBase from 416 to 392 bytes.
53
54         No behavior change.
55
56         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
57         (WebCore::WebCoreAVFResourceLoader::responseReceived):
58         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
59         * platform/network/CacheValidation.h:
60         (WebCore::CacheControlDirectives::CacheControlDirectives):
61         * platform/network/ResourceResponseBase.cpp:
62         (WebCore::ResourceResponseBase::ResourceResponseBase):
63         (WebCore::ResourceResponseBase::contentRange const):
64         * platform/network/ResourceResponseBase.h:
65         (WebCore::ResourceResponseBase::decode):
66
67 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
68
69         Unreviewed, fix some -Wreturn-type warnings
70
71         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
72         (WebCore::sourceFromNewReceiver):
73         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
74         (WebCore::toRTCRtpTransceiverDirection):
75         (WebCore::fromRTCRtpTransceiverDirection):
76
77 2018-09-11  Jiewen Tan  <jiewen_tan@apple.com>
78
79         Unreviewed, a speculative build fix for r235888.
80
81         * Modules/mediastream/MediaDevices.h:
82         Add class Document forward declaration.
83
84 2018-09-11  Woodrow Wang  <woodrow_wang@apple.com>
85
86         Add Web API Statistics Collection
87         https://bugs.webkit.org/show_bug.cgi?id=187773
88         <rdar://problem/44155162>
89
90         Reviewed by Brent Fulgham.
91
92         Added data collection for web API statistics, specifically regarding the canvas, font loads, 
93         screen functions, and navigator functions. The data collection code is placed under a runtime 
94         enabled feature flag. The statistics are stored in a ResourceLoadStatistics object and written 
95         to a plist on disk. Added a new file CanvasActivityRecord.h and CanvasActivityRecord.cpp which
96         includes a struct to keep track of HTML5 canvas element read and writes. 
97
98         Tests: http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
99                http/tests/webAPIStatistics/font-load-data-collection.html
100                http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
101                http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
102
103         * Sources.txt:
104         * WebCore.xcodeproj/project.pbxproj:
105         * css/CSSFontFaceSource.cpp:
106         (WebCore::CSSFontFaceSource::load):
107         * css/CSSFontSelector.cpp:
108         (WebCore::CSSFontSelector::fontRangesForFamily):
109         (WebCore::CSSFontSelector::fallbackFontAt):
110
111         The following are the functions where we'd like to record a canvas read.
112
113         * html/HTMLCanvasElement.cpp:
114         (WebCore::HTMLCanvasElement::toDataURL):
115         (WebCore::HTMLCanvasElement::toBlob):
116         (WebCore::HTMLCanvasElement::getImageData):
117         (WebCore::HTMLCanvasElement::toMediaSample):
118         (WebCore::HTMLCanvasElement::captureStream):
119
120         The following are the functions where we'd like to record a canvas write.
121
122         * html/canvas/CanvasRenderingContext2D.cpp:
123         (WebCore::CanvasRenderingContext2D::measureText):
124         (WebCore::CanvasRenderingContext2D::drawTextInternal):
125
126         The following files and functions handle the CanvasActivityRecord struct and
127         its respective functions.
128
129         * loader/CanvasActivityRecord.cpp: Added.
130         (WebCore::CanvasActivityRecord::recordWrittenOrMeasuredText):
131         (WebCore::CanvasActivityRecord::mergeWith):
132         * loader/CanvasActivityRecord.h: Added.
133         (WebCore::CanvasActivityRecord::encode const):
134         (WebCore::CanvasActivityRecord::decode):
135
136         * loader/DocumentThreadableLoader.cpp:
137         * loader/FrameLoader.cpp:
138         * loader/ResourceLoadObserver.cpp:
139         (WebCore::ResourceLoadObserver::logFontLoad):
140         (WebCore::ResourceLoadObserver::logCanvasRead):
141         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
142         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
143         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
144
145         Before, entries in the ResourceLoadStatistics involving HashSets used "origin" as the key. 
146         Now the encodeHashSet function has been generalized to take any key to encode the entries 
147         in the HashSet. Also added functionality to encode an OptionSet by converting it to its 
148         raw bitmask state. 
149
150         * loader/ResourceLoadObserver.h:
151         * loader/ResourceLoadStatistics.cpp:
152         (WebCore::encodeHashSet):
153         (WebCore::encodeOriginHashSet):
154         (WebCore::encodeOptionSet):
155         (WebCore::encodeFontHashSet):
156         (WebCore::encodeCanvasActivityRecord):
157         (WebCore::ResourceLoadStatistics::encode const):
158         (WebCore::decodeHashSet):
159         (WebCore::decodeOriginHashSet):
160         (WebCore::decodeOptionSet):
161         (WebCore::decodeFontHashSet):
162         (WebCore::decodeCanvasActivityRecord):
163         (WebCore::ResourceLoadStatistics::decode):
164         (WebCore::navigatorAPIEnumToString):
165         (WebCore::screenAPIEnumToString):
166         (WebCore::appendNavigatorAPIOptionSet):
167         (WebCore::appendScreenAPIOptionSet):
168         (WebCore::ResourceLoadStatistics::toString const):
169         (WebCore::ResourceLoadStatistics::merge):
170         * loader/ResourceLoadStatistics.h:
171         * loader/ResourceTiming.cpp:
172
173         The following are the navigator functions recorded for the web API statistics.
174
175         * page/Navigator.cpp:
176         (WebCore::Navigator::appVersion const):
177         (WebCore::Navigator::userAgent const):
178         (WebCore::Navigator::plugins):
179         (WebCore::Navigator::mimeTypes):
180         (WebCore::Navigator::cookieEnabled const):
181         (WebCore::Navigator::javaEnabled const):
182
183         The following are the screen functions recorded for the web API statistics.
184
185         * page/Screen.cpp:
186         (WebCore::Screen::height const):
187         (WebCore::Screen::width const):
188         (WebCore::Screen::colorDepth const):
189         (WebCore::Screen::pixelDepth const):
190         (WebCore::Screen::availLeft const):
191         (WebCore::Screen::availTop const):
192         (WebCore::Screen::availHeight const):
193         (WebCore::Screen::availWidth const):
194
195 2018-09-11  Pablo Saavedra  <psaavedra@igalia.com>
196
197         playbackControlsManagerUpdateTimerFired and
198         m_playbackControlsManagerUpdateTimer must be
199         guarded with ENABLE(VIDEO), otherwise the following
200         error occurs with the VIDEO feature turned off:
201
202           error: 'MediaElementSession' has not been declared
203
204         Add missing #if ENABLE(VIDEO) Page.cpp and Page.h
205         https://bugs.webkit.org/show_bug.cgi?id=189500
206
207         Reviewed by Anders Carlsson.
208
209         * page/Page.cpp:
210         (WebCore::Page::Page):
211         (WebCore::Page::schedulePlaybackControlsManagerUpdate):
212         * page/Page.h:
213
214 2018-09-11  Frederic Wang  <fwang@igalia.com>
215
216         Refactor filter list checking code
217         https://bugs.webkit.org/show_bug.cgi?id=185087
218
219         Reviewed by Antonio Gomes.
220
221         No new tests, behavior unchanged.
222
223         * page/animation/KeyframeAnimation.h: Add missing forward-declaration FilterOperations.
224
225 == Rolled over to ChangeLog-2018-09-11 ==