Cleanup AudioTrackPrivateMediaStreamCocoa
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
2
3         Cleanup AudioTrackPrivateMediaStreamCocoa
4         https://bugs.webkit.org/show_bug.cgi?id=193208
5         <rdar://problem/42225870>
6
7         Reviewed by Youenn Fablet.
8
9         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
10         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable): Clear input and
11         output format descriptions after stopping the audio unit.
12
13 2019-01-07  Devin Rousso  <drousso@apple.com>
14
15         Web Inspector: Network: show secure connection details per-request
16         https://bugs.webkit.org/show_bug.cgi?id=191539
17         <rdar://problem/45979891>
18
19         Reviewed by Joseph Pecoraro.
20
21         Test: http/tests/inspector/network/resource-security-connection.html
22
23         * platform/network/NetworkLoadMetrics.h:
24         (WebCore::NetworkLoadMetrics:isolatedCopy):
25         (WebCore::NetworkLoadMetrics:clearNonTimingData):
26         (WebCore::NetworkLoadMetrics:operator==):
27         (WebCore::NetworkLoadMetrics:encode):
28         (WebCore::NetworkLoadMetrics:decode):
29
30         * inspector/agents/InspectorNetworkAgent.cpp:
31         (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
32
33 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
34
35         Deactivate audio session whenever possible
36         https://bugs.webkit.org/show_bug.cgi?id=193188
37         <rdar://problem/42678977>
38
39         Reviewed by Jer Noble.
40
41         Test: media/deactivate-audio-session.html
42
43         * platform/audio/AudioSession.cpp:
44         (WebCore::AudioSession::tryToSetActive):
45         (WebCore::AudioSession::tryToSetActiveInternal):
46         * platform/audio/AudioSession.h:
47         (WebCore::AudioSession::isActive const):
48
49         * platform/audio/PlatformMediaSessionManager.cpp:
50         (WebCore::PlatformMediaSessionManager::removeSession):
51         (WebCore::deactivateAudioSession):
52         (WebCore::PlatformMediaSessionManager::shouldDeactivateAudioSession):
53         (WebCore::PlatformMediaSessionManager::setShouldDeactivateAudioSession):
54         * platform/audio/PlatformMediaSessionManager.h:
55
56         * platform/audio/ios/AudioSessionIOS.mm:
57         (WebCore::AudioSession::tryToSetActiveInternal):
58         (WebCore::AudioSession::tryToSetActive): Deleted.
59
60         * platform/audio/mac/AudioSessionMac.cpp:
61         (WebCore::AudioSession::tryToSetActiveInternal):
62         (WebCore::AudioSession::tryToSetActive): Deleted.
63
64         * testing/Internals.cpp:
65         (WebCore::Internals::audioSessionActive const):
66         * testing/Internals.h:
67         * testing/Internals.idl:
68
69 2019-01-07  David Kilzer  <ddkilzer@apple.com>
70
71         PlatformECKey should use a std::unique_ptr
72         <https://webkit.org/b/193170>
73
74         Reviewed by Brent Fulgham.
75
76         Broadly:
77         - Switch from using raw pointers to using std::unique_ptr<> to
78           hold PlatformECKey.
79         - Introduce PlatformECKeyContainer type to handle different
80           std::unique_ptr<> types on each platform.
81         - Get rid of custom CryptoKeyEC destructors since the
82           std::unique_ptr<> handles that with a Deleter.
83         - Initialize stack variables to nullptr.
84
85         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
86         (WebCore::CryptoKeyEC::keySizeInBits const):
87         (WebCore::CryptoKeyEC::platformGeneratePair):
88         (WebCore::CryptoKeyEC::platformImportRaw):
89         (WebCore::CryptoKeyEC::platformImportJWKPublic):
90         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
91         (WebCore::CryptoKeyEC::platformImportSpki):
92         (WebCore::CryptoKeyEC::platformImportPkcs8):
93         (WebCore::CryptoKeyEC::platformExportRaw const):
94         (WebCore::CryptoKeyEC::platformAddFieldElements const):
95         (WebCore::CryptoKeyEC::platformExportSpki const):
96         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
97         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
98         * crypto/keys/CryptoKeyEC.cpp:
99         (WebCore::CryptoKeyEC::CryptoKeyEC):
100         * crypto/keys/CryptoKeyEC.h:
101         (WebCore::CCECCryptorRefDeleter::operator() const):
102         * crypto/mac/CryptoKeyECMac.cpp:
103         (WebCore::CryptoKeyEC::keySizeInBits const):
104         (WebCore::CryptoKeyEC::platformGeneratePair):
105         (WebCore::CryptoKeyEC::platformImportRaw):
106         (WebCore::CryptoKeyEC::platformExportRaw const):
107         (WebCore::CryptoKeyEC::platformImportJWKPublic):
108         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
109         (WebCore::CryptoKeyEC::platformAddFieldElements const):
110         (WebCore::CryptoKeyEC::platformImportSpki):
111         (WebCore::CryptoKeyEC::platformExportSpki const):
112         (WebCore::CryptoKeyEC::platformImportPkcs8):
113         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
114         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
115
116 2019-01-07  Antti Koivisto  <antti@apple.com>
117
118         UI process side scrollbars for UI side compositing on Mac
119         https://bugs.webkit.org/show_bug.cgi?id=193106
120
121         Reviewed by Tim Horton.
122
123         * page/FrameView.cpp:
124         (WebCore::FrameView::paintScrollCorner):
125         * page/scrolling/AsyncScrollingCoordinator.cpp:
126         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
127
128         Pass scrollbar host layers and the dark appearance bit to the scrolling tree.
129
130         * page/scrolling/ScrollingCoordinator.cpp:
131         (WebCore::ScrollingCoordinator::verticalScrollbarLayerForFrameView):
132         (WebCore::ScrollingCoordinator::horizontalScrollbarLayerForFrameView):
133         * page/scrolling/ScrollingCoordinator.h:
134         (WebCore::ScrollableAreaParameters::ScrollableAreaParameters):
135         (WebCore::ScrollableAreaParameters::operator== const):
136         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
137         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
138         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarLayers):
139         * page/scrolling/ScrollingStateFrameScrollingNode.h:
140         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
141         * page/scrolling/ScrollingTreeScrollingNode.h:
142         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const):
143         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const):
144         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const):
145         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const):
146         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
147         * platform/ScrollableArea.cpp:
148         (WebCore::ScrollableArea::useDarkAppearanceForScrollbars const):
149
150         Factor into a function as this is used in several places.
151
152         * platform/ScrollableArea.h:
153         * platform/mac/NSScrollerImpDetails.h:
154         * platform/mac/ScrollAnimatorMac.mm:
155         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]):
156         * platform/mac/ScrollbarThemeMac.h:
157
158 2019-01-07  Wenson Hsieh  <wenson_hsieh@apple.com>
159
160         Native caret shows up alongside the page's caret when requesting desktop site on jsfiddle.net
161         https://bugs.webkit.org/show_bug.cgi?id=193180
162         <rdar://problem/45971041>
163
164         Reviewed by Tim Horton.
165
166         Adjust a method on RenderObject to additionally detect when the RenderObject is inside of an `overflow: hidden`
167         container that is also empty. See WebKit ChangeLog for more details.
168
169         Test:   editing/selection/ios/hide-selection-in-empty-overflow-hidden-container.html
170                 editing/selection/ios/show-selection-in-empty-overflow-hidden-document.html
171
172         * rendering/RenderObject.cpp:
173         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
174         (WebCore::RenderObject::isTransparentRespectingParentFrames const): Deleted.
175         * rendering/RenderObject.h:
176
177 2019-01-07  Zalan Bujtas  <zalan@apple.com>
178
179         [LFC][BFC] Margin collapsing should not be limited to in-flow non-replaced boxes.
180         https://bugs.webkit.org/show_bug.cgi?id=193183
181
182         Reviewed by Antti Koivisto.
183
184         * layout/FormattingContext.cpp:
185         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
186         * layout/FormattingContextGeometry.cpp:
187         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
188         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
189         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
190         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
191         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
192         * layout/LayoutUnits.h:
193         * layout/blockformatting/BlockFormattingContext.cpp:
194         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
195         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
196         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
197         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
198         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
199         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
200         * layout/inlineformatting/InlineFormattingContext.cpp:
201         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
202
203 2019-01-07  Zalan Bujtas  <zalan@apple.com>
204
205         [LFC][BFC] Move MarginCollapse from BlockFormattingContext::Geometry to BlockFormattingContext
206         https://bugs.webkit.org/show_bug.cgi?id=193181
207
208         Reviewed by Antti Koivisto.
209
210         This is in preparation to share margin collapsing across all boxes in block formatting context.
211
212         * layout/blockformatting/BlockFormattingContext.h:
213         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
214         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
215         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
216         * layout/blockformatting/BlockMarginCollapse.cpp:
217         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore):
218         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter):
219         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore):
220         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter):
221         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild):
222         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild):
223         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
224         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
225         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
226         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
227         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
228         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
229         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling):
230         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
231         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore):
232         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter):
233         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
234         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
235         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): Deleted.
236         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): Deleted.
237         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
238         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
239         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): Deleted.
240         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): Deleted.
241         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): Deleted.
242         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): Deleted.
243         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): Deleted.
244         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
245         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
246         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): Deleted.
247         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): Deleted.
248         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): Deleted.
249
250 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
251
252         [WPE] Use Widget bounds for PlatformScreen rectangle information
253         https://bugs.webkit.org/show_bug.cgi?id=193190
254
255         Reviewed by Philippe Normand.
256
257         Provide a better screen area estimate in screenRect() and
258         screenAvailableRect() return values than the current 1240x640 value by
259         using the Widget's bounds rectangle.
260
261         This approach is only factually correct when the Widget-associated view
262         is displayed in fullscreen, but it provides a better estimate even when
263         displayed in any other case as well. WPE doesn't provide specific API
264         that could enable the embedding environment to provide this information.
265
266         * platform/wpe/PlatformScreenWPE.cpp:
267         (WebCore::screenRect): Return bounds of the Widget object.
268         (WebCore::screenAvailableRect): Relay the call to screenRect().
269
270 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
271
272         Make Gradient::gradientSpaceTransform(), Pattern::patternSpaceTransform() methods const
273         https://bugs.webkit.org/show_bug.cgi?id=193189
274
275         Reviewed by Philippe Normand.
276
277         The transform getter methods on the Gradient and Pattern classes both
278         return const references to the transform objects, and don't modify any
279         internal state. They should be marked const accordingly, allowing
280         invocations of these two methods through const references to Gradient
281         and Pattern objects.
282
283         * platform/graphics/Gradient.h:
284         (WebCore::Gradient::gradientSpaceTransform): Now const.
285         * platform/graphics/Pattern.h:
286         (WebCore::Pattern::patternSpaceTransform): Now const.
287
288 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
289
290         REGRESSION(r239636): ImageDecoder::setEncodedDataStatusChangeCallback() can be called on a null decoder
291         https://bugs.webkit.org/show_bug.cgi?id=193187
292
293         Reviewed by Philippe Normand.
294
295         * platform/graphics/ImageSource.cpp:
296         (WebCore::ImageSource::ensureDecoderAvailable): Bail before calling the
297         setEncodedDataStatusChangeCallback() method when the returned
298         ImageDecoder object is null.
299
300 2019-01-06  Zan Dobersek  <zdobersek@igalia.com>
301
302         [Nicosia] Take over CoordinatedGraphics-named implementation of async scrolling classes
303         https://bugs.webkit.org/show_bug.cgi?id=193133
304
305         Reviewed by Michael Catanzaro.
306
307         Move the CoordinatedGraphics-specific files under
308         page/scrolling/coordinatedgraphics/ to page/scrolling/nicosia/, along
309         with renaming the files and classes accordingly. Implementation will
310         only depend on the Nicosia-specific layer structure and is not specific
311         to the CoordinatedGraphics system.
312
313         * PlatformPlayStation.cmake:
314         * SourcesGTK.txt:
315         * SourcesWPE.txt:
316         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp.
317         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h.
318         * page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp.
319         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp.
320         * page/scrolling/nicosia/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h.
321         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp.
322         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h.
323         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp.
324         * page/scrolling/nicosia/ScrollingTreeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h.
325         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp.
326         * page/scrolling/nicosia/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h.
327         * platform/TextureMapper.cmake:
328
329 2019-01-06  Jiewen Tan  <jiewen_tan@apple.com>
330
331         [WebAuthN] Import U2F command/response converters from Chromium
332         https://bugs.webkit.org/show_bug.cgi?id=193150
333         <rdar://problem/47054028>
334
335         Reviewed by Brent Fulgham.
336
337         This patch imports Chromium's U2F command/response converters:
338         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability
339         1. It directly imports the following files and suit them to WebKit's coding style:
340         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.cc?l=1&rcl=db624110317d01efa78cd32e7be1524190e1beb0
341         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.h?rcl=db624110317d01efa78cd32e7be1524190e1beb0
342         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor_unittest.cc?rcl=db624110317d01efa78cd32e7be1524190e1beb0
343         2. It gathers the following methods into U2fResponseConverter:
344         AuthenticatorMakeCredentialResponse::CreateFromU2fRegisterResponse()
345         AuthenticatorGetAssertionResponse::CreateFromU2fSignResponse()
346         3. It also updates FidoConstants.h, FidoTestData.h and CtapResponseTest.cpp accordingly.
347
348         Besides importing stuff from Chroimum, it also gathers a bunch of constants and helper functions into WebAuthenticationConstants.h
349         and WebAuthenticationUtils.h. It also fixes Bug 183534: 2) and 7).
350
351         Covered by API tests.
352
353         * Modules/webauthn/AuthenticatorCoordinator.cpp:
354         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJsonHash):
355         * Modules/webauthn/WebAuthenticationConstants.h: Copied from Source/WebCore/Modules/webauthn/COSEConstants.h.
356         * Modules/webauthn/WebAuthenticationUtils.cpp: Added.
357         (WebCore::convertBytesToVector):
358         (WebCore::produceRpIdHash):
359         (WebCore::encodeES256PublicKeyAsCBOR):
360         (WebCore::buildAttestedCredentialData):
361         (WebCore::buildAuthData):
362         (WebCore::buildAttestationObject):
363         * Modules/webauthn/WebAuthenticationUtils.h: Renamed from Source/WebCore/Modules/webauthn/COSEConstants.h.
364         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
365         (fido::getCredentialId):
366         (fido::readCTAPGetInfoResponse):
367         * Modules/webauthn/fido/FidoConstants.h:
368         * Modules/webauthn/fido/U2fCommandConstructor.cpp: Added.
369         (fido::WebCore::constructU2fRegisterCommand):
370         (fido::WebCore::constructU2fSignCommand):
371         (fido::isConvertibleToU2fRegisterCommand):
372         (fido::isConvertibleToU2fSignCommand):
373         (fido::convertToU2fRegisterCommand):
374         (fido::convertToU2fCheckOnlySignCommand):
375         (fido::convertToU2fSignCommand):
376         (fido::constructBogusU2fRegistrationCommand):
377         * Modules/webauthn/fido/U2fCommandConstructor.h: Added.
378         * Modules/webauthn/fido/U2fResponseConverter.cpp: Added.
379         (fido::WebCore::extractECPublicKeyFromU2fRegistrationResponse):
380         (fido::WebCore::extractCredentialIdFromU2fRegistrationResponse):
381         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
382         (fido::WebCore::parseX509Length):
383         (fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse):
384         (fido::readU2fRegisterResponse):
385         (fido::readFromU2fSignResponse):
386         * Modules/webauthn/fido/U2fResponseConverter.h: Added.
387         * Modules/webgpu/WebGPUCommandBuffer.cpp:
388         * Sources.txt:
389         * WebCore.xcodeproj/project.pbxproj:
390
391 2019-01-06  David Kilzer  <ddkilzer@apple.com>
392
393         Leak of WTF::Function objects in WebCore::CryptoKeyRSA::generatePair() (64-80 bytes each) in com.apple.WebKit.WebContent running WebKit layout tests
394         <https://webkit.org/b/193177>
395         <rdar://problem/47072196>
396
397         Reviewed by Saam Barati.
398
399         * crypto/mac/CryptoKeyRSAMac.cpp:
400         (WebCore::CryptoKeyRSA::generatePair): Fix the leak by changing
401         raw pointers to heap-allocated __block variables to hold the
402         WTF::Function objects until they are consumed within the block
403         passed to dispatch_async().  The __block variables act like
404         captured variables in a C++ lambda and have the same lifetime as
405         the block that they are captured in.  Note that we would have to
406         convert the source file from C++ to Objective-C++ to use a C++
407         lambda functor with dispatch_async(), which creates its own
408         issue because the comipiler requires a copy constructor to
409         convert the C++ lambda to a block functor, but the copy
410         constructor for the C++ lambda is implicitly deleted because the
411         WTF::Function copy constructor is explicitly deleted.  Whew!
412
413 2019-01-06  Pablo Saavedra  <psaavedra@igalia.com>
414
415         [WPE][GTK] Building with ENABLE_VIDEO=OFF fails trying to use Document MediaPlayback functions.
416         https://bugs.webkit.org/show_bug.cgi?id=193174
417
418         Reviewed by Michael Catanzaro.
419
420         * page/Page.cpp:
421         (WebCore::Page::stopAllMediaPlayback):
422         (WebCore::Page::suspendAllMediaPlayback):
423         (WebCore::Page::resumeAllMediaPlayback):
424
425 2019-01-05  David Kilzer  <ddkilzer@apple.com>
426
427         Leak of two CCRSACryptorRef (4.0 Kbytes/1 page each) in com.apple.WebKit.WebContent running WebKit layout tests
428         <https://webkit.org/b/193154>
429         <rdar://problem/47052993>
430
431         Reviewed by Brent Fulgham.
432
433         Broadly:
434         - Fix leaks by switching from using raw pointers to using
435           std::unique_ptr<>.
436         - Introduce PlatformRSAKeyContainer type to handle different
437           std::unique_ptr<> on each platform.
438         - Get rid of custom CryptoKeyRSA destructors since the
439           std::unique_ptr<> handles that with a Deleter.
440         - Initialize stack variables to nullptr.
441
442         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
443         (WebCore::CryptoKeyRSA::create):
444         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
445         (WebCore::CryptoKeyRSA::keySizeInBits const):
446         (WebCore::CryptoKeyRSA::generatePair):
447         (WebCore::CryptoKeyRSA::importSpki):
448         (WebCore::CryptoKeyRSA::importPkcs8):
449         (WebCore::CryptoKeyRSA::exportSpki const):
450         (WebCore::CryptoKeyRSA::exportPkcs8 const):
451         (WebCore::CryptoKeyRSA::algorithm const):
452         (WebCore::CryptoKeyRSA::exportData const):
453         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
454         * crypto/keys/CryptoKeyRSA.h:
455         (WebCore::CCRSACryptorRefDeleter::operator() const):
456         * crypto/mac/CryptoKeyRSAMac.cpp:
457         (WebCore::getPublicKeyComponents):
458         (WebCore::getPrivateKeyComponents):
459         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
460         (WebCore::CryptoKeyRSA::create):
461         (WebCore::CryptoKeyRSA::exportData const):
462         (WebCore::CryptoKeyRSA::generatePair):
463         (WebCore::CryptoKeyRSA::importSpki):
464         (WebCore::CryptoKeyRSA::importPkcs8):
465         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
466
467 2019-01-05  Zalan Bujtas  <zalan@apple.com>
468
469         Incorrect clipping across compositing boundary.
470         https://bugs.webkit.org/show_bug.cgi?id=193172
471         <rdar://problem/44693008>
472
473         Reviewed by Simon Fraser.
474
475         Use temporary cliprect type when crossing compositing boundary to prevent cliprect caching.
476
477         The issue here is that RenderLayer::backgroundClipRect() could cross compositing boundary by calling parentClipRects() which triggers
478         clip rect update using the wrong painting root. This happens when the layer hierarchy and the compositing context do not match.
479         For clip rect computation, we need to climb up on the layer hierarchy (calling parent layer's cliprect functions)
480         but we also need to make sure that the computed cliprects on any given layer are cached only when the painting root is correct.
481         It ensures that when we paint a layer (with the painting root as entry point), the cached cliprects are always based on its onw painting root. 
482
483         Test: compositing/clipping/cached-cliprect-with-compositing-boundary.html
484
485         * rendering/RenderLayer.cpp:
486         (WebCore::RenderLayer::calculateClipRects const):
487
488 2019-01-05  Youenn Fablet  <youenn@apple.com>
489
490         Service Worker fetch should obey its referrer policy
491         https://bugs.webkit.org/show_bug.cgi?id=193152
492
493         Reviewed by Chris Dumez.
494
495         Pass referrer policy retrieved when fetching the service worker script to the SWServer.
496         The SWServer then stores it persistently and sends it to the manager creating service workers.
497         This manager will then set the referrer policy on the dummy Document of the corresponding service worker.
498
499         Covered by rebased test.
500
501         * workers/WorkerScriptLoader.cpp:
502         (WebCore::WorkerScriptLoader::didReceiveResponse):
503         * workers/WorkerScriptLoader.h:
504         (WebCore::WorkerScriptLoader::referrerPolicy const):
505         * workers/service/SWClientConnection.cpp:
506         (WebCore::SWClientConnection::failedFetchingScript):
507         * workers/service/ServiceWorkerContainer.cpp:
508         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
509         * workers/service/ServiceWorkerContainer.h:
510         * workers/service/ServiceWorkerContextData.cpp:
511         (WebCore::ServiceWorkerContextData::isolatedCopy const):
512         * workers/service/ServiceWorkerContextData.h:
513         (WebCore::ServiceWorkerContextData::encode const):
514         (WebCore::ServiceWorkerContextData::decode):
515         * workers/service/ServiceWorkerFetchResult.h:
516         (WebCore::ServiceWorkerFetchResult::encode const):
517         (WebCore::ServiceWorkerFetchResult::decode):
518         * workers/service/ServiceWorkerJob.cpp:
519         (WebCore::ServiceWorkerJob::notifyFinished):
520         * workers/service/ServiceWorkerJobClient.h:
521         * workers/service/context/ServiceWorkerThreadProxy.cpp:
522         (WebCore::createPageForServiceWorker):
523         * workers/service/server/RegistrationDatabase.cpp:
524         (WebCore::recordsTableSchema):
525         (WebCore::RegistrationDatabase::doPushChanges):
526         (WebCore::RegistrationDatabase::importRecords):
527         * workers/service/server/SWServer.cpp:
528         (WebCore::SWServer::addRegistrationFromStore):
529         (WebCore::SWServer::updateWorker):
530         (WebCore::SWServer::installContextData):
531         * workers/service/server/SWServer.h:
532         * workers/service/server/SWServerJobQueue.cpp:
533         (WebCore::SWServerJobQueue::scriptFetchFinished):
534         * workers/service/server/SWServerWorker.cpp:
535         (WebCore::SWServerWorker::SWServerWorker):
536         (WebCore::SWServerWorker::contextData const):
537         * workers/service/server/SWServerWorker.h:
538
539 2019-01-04  Simon Fraser  <simon.fraser@apple.com>
540
541         Factor legacy WK1 code for fixed and scrolling layers into their own helper class
542         https://bugs.webkit.org/show_bug.cgi?id=193165
543
544         Reviewed by Frédéric Wang.
545
546         RenderLayerCompositor has some code to handle registration of viewport-constrained
547         and scrolling layers which is specific to iOS WK1. To reduce pollution, move this
548         into its own helper class called LegacyWebKitScrollingLayerCoordinator, which is only
549         allocated for iOS WK1.
550         
551         iOS WK1 never has a ScrollingCoordinator, so rather than the check for scrollingCoordinator(),
552         we know that we only made a LegacyWebKitScrollingLayerCoordinator when there's a platform widget
553         (i.e. WK1).
554         
555         * page/ChromeClient.h:
556         * rendering/RenderLayerCompositor.cpp:
557         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
558         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
559         (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
560         (WebCore::RenderLayerCompositor::setIsInWindow):
561         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): No longer check the page cache state; now we
562         destroy the render tree of pages in the page cache, so we should never hit this code path.
563         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
564         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
565         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllViewportConstrainedLayers):
566         (WebCore::scrollbarHasDisplayNone):
567         (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
568         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllScrollingLayers):
569         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate):
570         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
571         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
572         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
573         (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer):
574         (WebCore::updateScrollingLayerWithClient): Deleted.
575         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers): Deleted.
576         (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers): Deleted.
577         (WebCore::RenderLayerCompositor::registerAllScrollingLayers): Deleted.
578         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers): Deleted.
579         * rendering/RenderLayerCompositor.h:
580         (WebCore::LegacyWebKitScrollingLayerCoordinator::LegacyWebKitScrollingLayerCoordinator):
581         * workers/service/ServiceWorkerContainer.cpp:
582         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
583
584 2019-01-05  Zalan Bujtas  <zalan@apple.com>
585
586         [LFC] VerticalMargin should only have the used values.
587         https://bugs.webkit.org/show_bug.cgi?id=193168
588
589         Reviewed by Antti Koivisto.
590
591         Split VerticalMargin into ComputedVerticalMargin and UsedVerticalMargin.
592         ComputedVerticalMargin holds the computed (optional) values while UsedVerticalMargin holds both the
593         collapsed (optional) and the non-collapsed values.
594
595         * layout/FormattingContext.cpp:
596         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
597         * layout/FormattingContext.h:
598         * layout/FormattingContextGeometry.cpp:
599         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
600         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
601         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
602         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
603         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
604         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
605         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): Deleted.
606         * layout/FormattingContextQuirks.cpp:
607         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
608         * layout/LayoutUnits.h:
609         * layout/MarginTypes.h:
610         (WebCore::Layout::UsedVerticalMargin::before const):
611         (WebCore::Layout::UsedVerticalMargin::after const):
612         (WebCore::Layout::UsedVerticalMargin::nonCollapsedValues const):
613         (WebCore::Layout::UsedVerticalMargin::collapsedValues const):
614         (WebCore::Layout::UsedVerticalMargin::hasCollapsedValues const):
615         (WebCore::Layout::UsedVerticalMargin::setCollapsedValues):
616         (WebCore::Layout::UsedVerticalMargin::UsedVerticalMargin):
617         (WebCore::Layout::VerticalMargin::nonCollapsedValues const): Deleted.
618         (WebCore::Layout::VerticalMargin::collapsedValues const): Deleted.
619         (WebCore::Layout::VerticalMargin::setCollapsedValues): Deleted.
620         (WebCore::Layout::VerticalMargin::VerticalMargin): Deleted.
621         (WebCore::Layout::VerticalMargin::usedValues const): Deleted.
622         * layout/blockformatting/BlockFormattingContext.cpp:
623         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
624         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
625         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
626         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
627         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
628         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
629         * layout/blockformatting/BlockMarginCollapse.cpp:
630         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
631         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
632         * layout/displaytree/DisplayBox.h:
633         (WebCore::Display::Box::setVerticalMargin):
634         (WebCore::Display::Box::verticalMargin const):
635         (WebCore::Display::Box::marginBefore const):
636         (WebCore::Display::Box::marginAfter const):
637         * layout/floats/FloatingContext.cpp:
638         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
639         * layout/inlineformatting/InlineFormattingContext.cpp:
640         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
641
642 2019-01-04  Daniel Bates  <dabates@apple.com>
643
644         REGRESSION (r238522): Erratic scrolling on Google flights search result page and vrbo.com
645         https://bugs.webkit.org/show_bug.cgi?id=192996
646         <rdar://problem/46573552>
647
648         Reviewed by Simon Fraser.
649
650         Only scroll a text field if its inner text size changes and it is the currently active and
651         focused element on the page.
652
653         Test: fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html
654
655         * rendering/RenderTextControlSingleLine.cpp:
656         (WebCore::RenderTextControlSingleLine::layout):
657
658 2019-01-04  Alex Christensen  <achristensen@webkit.org>
659
660         Progress towards fixing Mac CMake build
661         https://bugs.webkit.org/show_bug.cgi?id=193105
662
663         Reviewed by Don Olmstead.
664
665         * PlatformMac.cmake:
666         * Sources.txt:
667         * SourcesCocoa.txt:
668         * WebCore.xcodeproj/project.pbxproj:
669         * platform/graphics/gpu/GPURenderPassEncoder.h:
670
671 2019-01-04  Zalan Bujtas  <zalan@apple.com>
672
673         [iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker()
674         https://bugs.webkit.org/show_bug.cgi?id=189608
675         <rdar://problem/44473299>
676
677         Reviewed by Simon Fraser.
678
679         When a frameset/iframe is hidden and we skip layout, clear the dirty flag on its subtree as well.
680
681         Covered by fast/frames/invalid-frameset.html.
682
683         * rendering/RenderFrameSet.cpp:
684         (WebCore::clearSiblingSubtrees):
685         (WebCore::RenderFrameSet::positionFrames):
686         (WebCore::RenderFrameSet::positionFramesWithFlattening):
687
688 2019-01-04  Youenn Fablet  <youenn@apple.com>
689
690         [Fetch API] Implement abortable fetch
691         https://bugs.webkit.org/show_bug.cgi?id=174980
692         <rdar://problem/46861402>
693
694         Reviewed by Chris Dumez.
695
696         Add an AbortSignal to FetchRequest.
697
698         Add support for AbortSignal algorithm.
699         The fetch request signal is added an algorithm to abort the fetch.
700         Update clone algorithm to let signal of the cloned request be following the origin request.
701
702         Update ReadableStream error handling to return an exception instead of a string.
703         This allows passing an AbortError instead of a TypeError as previously done.
704
705         Update FetchBodyOwner to store a loading error either as an exception or as a resource error.
706         The latter is used for passing the error from service worker back to the page.
707         The former is used to pass it to ReadableStream or body accessors.
708
709         Covered by enabled tests.
710
711         * Modules/cache/DOMCache.cpp:
712         (WebCore::DOMCache::put):
713         * Modules/fetch/FetchBody.cpp:
714         (WebCore::FetchBody::consumeAsStream):
715         (WebCore::FetchBody::loadingFailed):
716         * Modules/fetch/FetchBody.h:
717         * Modules/fetch/FetchBodyConsumer.cpp:
718         (WebCore::FetchBodyConsumer::loadingFailed):
719         * Modules/fetch/FetchBodyConsumer.h:
720         * Modules/fetch/FetchBodyOwner.cpp:
721         (WebCore::FetchBodyOwner::arrayBuffer):
722         (WebCore::FetchBodyOwner::blob):
723         (WebCore::FetchBodyOwner::cloneBody):
724         (WebCore::FetchBodyOwner::formData):
725         (WebCore::FetchBodyOwner::json):
726         (WebCore::FetchBodyOwner::text):
727         (WebCore::FetchBodyOwner::loadBlob):
728         (WebCore::FetchBodyOwner::blobLoadingFailed):
729         (WebCore::FetchBodyOwner::consumeBodyAsStream):
730         (WebCore::FetchBodyOwner::setLoadingError):
731         * Modules/fetch/FetchBodyOwner.h:
732         (WebCore::FetchBodyOwner::loadingError const):
733         (WebCore::FetchBodyOwner::loadingException const):
734         * Modules/fetch/FetchBodySource.cpp:
735         (WebCore::FetchBodySource::error):
736         * Modules/fetch/FetchBodySource.h:
737         * Modules/fetch/FetchRequest.cpp:
738         (WebCore::FetchRequest::initializeWith):
739         (WebCore::FetchRequest::clone):
740         * Modules/fetch/FetchRequest.h:
741         (WebCore::FetchRequest::FetchRequest):
742         * Modules/fetch/FetchRequest.idl:
743         * Modules/fetch/FetchRequestInit.h:
744         (WebCore::FetchRequestInit::hasMembers const):
745         * Modules/fetch/FetchRequestInit.idl:
746         * Modules/fetch/FetchResponse.cpp:
747         (WebCore::FetchResponse::clone):
748         (WebCore::FetchResponse::fetch):
749         (WebCore::FetchResponse::BodyLoader::didFail):
750         * Modules/fetch/FetchResponse.h:
751         * bindings/js/ReadableStreamDefaultController.h:
752         (WebCore::ReadableStreamDefaultController::error):
753         * dom/AbortSignal.cpp:
754         (WebCore::AbortSignal::abort):
755         (WebCore::AbortSignal::follow):
756         * dom/AbortSignal.h:
757
758 2019-01-04  Brent Fulgham  <bfulgham@apple.com>
759
760         Parsed protocol of javascript URLs with embedded newlines and carriage returns do not match parsed protocol in Chrome and Firefox
761         https://bugs.webkit.org/show_bug.cgi?id=193155
762         <rdar://problem/40230982>
763
764         Reviewed by Chris Dumez.
765
766         Test: fast/loader/comment-only-javascript-url.html
767
768         Make a special case for URLs beginning with 'javascript:'. We should always
769         treat these as JS URLs, even if the content contained within the URL
770         string might match other parts of the URL parsing spec.
771
772         * html/URLUtils.h:
773         (WebCore::URLUtils<T>::protocol const):
774
775 2019-01-04  Jer Noble  <jer.noble@apple.com>
776
777         [WebKitLegacy] Media playback pauses on scroll
778         https://bugs.webkit.org/show_bug.cgi?id=192829
779
780         Reviewed by Eric Carlson.
781
782         New API tests:
783             WebKitLegacy.ScrollingDoesNotPauseMedia
784             WKWebView.StopAllMediaPlayback
785             WKWebView.SuspendResumeAllMediaPlayback
786
787         Do not use suspendActiveDOMObjects(ReasonForSuspension::PageWillBeSuspended) to pause
788         video. Roll back the changes to HTMLMediaElement, and introduce a new set of Page calls
789         suspendAllMediaPlayback() & resumeAllMediaPlayback() which replaces the removed bahavior.
790
791         * dom/Document.cpp:
792         (WebCore::Document::~Document):
793         (WebCore::Document::stopAllMediaPlayback):
794         (WebCore::Document::suspendAllMediaPlayback):
795         (WebCore::Document::resumeAllMediaPlayback):
796         * dom/Document.h:
797         * html/HTMLMediaElement.cpp:
798         (WebCore::HTMLMediaElement::HTMLMediaElement):
799         (WebCore::HTMLMediaElement::parseAttribute):
800         (WebCore::HTMLMediaElement::didFinishInsertingNode):
801         (WebCore::HTMLMediaElement::setSrcObject):
802         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
803         (WebCore::HTMLMediaElement::suspend):
804         (WebCore::HTMLMediaElement::resume):
805         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
806         * html/HTMLMediaElement.h:
807         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
808         * html/MediaElementSession.cpp:
809         (WebCore::MediaElementSession::playbackPermitted const):
810         * page/Page.cpp:
811         (WebCore::Page::stopAllMediaPlayback):
812         (WebCore::Page::suspendAllMediaPlayback):
813         (WebCore::Page::resumeAllMediaPlayback):
814         * page/Page.h:
815         (WebCore::Page::mediaPlaybackIsSuspended):
816         * platform/audio/PlatformMediaSession.h:
817         * platform/audio/PlatformMediaSessionManager.cpp:
818         (WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument):
819         (WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument):
820         * platform/audio/PlatformMediaSessionManager.h:
821
822 2019-01-04  Chris Dumez  <cdumez@apple.com>
823
824         Add support for toggling device orientation API support per site
825         https://bugs.webkit.org/show_bug.cgi?id=193143
826         <rdar://problem/46605724>
827
828         Reviewed by Alex Christensen.
829
830         Add support for toggling device orientation API support per site via _WKWebsitePolicies.
831
832         * dom/Document.cpp:
833         (WebCore::Document::simulateDeviceOrientationChange):
834         * dom/Document.h:
835         * loader/DocumentLoader.h:
836         (WebCore::DocumentLoader::deviceOrientationEventEnabled const):
837         (WebCore::DocumentLoader::setDeviceOrientationEventEnabled):
838         * page/DOMWindow.cpp:
839         (WebCore::DOMWindow::addEventListener):
840
841 2019-01-04  Jer Noble  <jer.noble@apple.com>
842
843         Web Content process main thread blocked beneath ImageDecoderAVFObjC::readSamples for many seconds on imgur.com
844         https://bugs.webkit.org/show_bug.cgi?id=191806
845         <rdar://problem/46151477>
846
847         Reviewed by Dean Jackson.
848
849         Test: http/tests/images/mp4-partial-load.html
850
851         Rather than use an AVAssetReaderTrackOutput, which will load both sample metadata and sample data
852         synchronously when a sample is requested, use AVAssetReaderSampleReferenceOutput, which only loads
853         sample metadata, including the byte offset and byte length of the sample data. By waiting until the
854         AVAsset signals that it's own metadata is loaded, we can safely parse all the sample metadata without
855         blocking on network loads. Once enough data is loaded, we can replace the byte reference and offset
856         attachements in the sample with actual data, and mark the sample as "complete".
857
858         Because the existing ImageSource assumes that image data parsing will occur synchronously, and that
859         synchronous parsing could cause a hang if the metadata is not loaded, add a new callback method which
860         allows the ImageSource to be notified when the encodedDataStatus changes. The ImageSource notifies the
861         CacheImage, which notifies the RenderImage, and thus the asynchronous parsing will kick off the
862         renderer's animation loop.
863
864         * loader/cache/CachedImage.cpp:
865         (WebCore::CachedImage::CachedImageObserver::encodedDataStatusChanged):
866         (WebCore::CachedImage::encodedDataStatusChanged):
867         * loader/cache/CachedImage.h:
868         * platform/graphics/ImageDecoder.h:
869         (WebCore::ImageDecoder::setEncodedDataStatusChangeCallback):
870         * platform/graphics/ImageObserver.h:
871         (WebCore::ImageObserver::encodedDataStatusChanged):
872         * platform/graphics/ImageSource.cpp:
873         (WebCore::ImageSource::ensureDecoderAvailable):
874         (WebCore::ImageSource::encodedDataStatusChanged):
875         (WebCore::ImageSource::frameDecodingStatusAtIndex):
876         * platform/graphics/ImageSource.h:
877         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
878         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
879         (-[WebCoreSharedBufferResourceLoaderDelegate data]):
880         (WebCore::ImageDecoderAVFObjCSample::byteRange const):
881         (WebCore::ImageDecoderAVFObjC::readSamples):
882         (WebCore::ImageDecoderAVFObjC::setEncodedDataStatusChangeCallback):
883         (WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
884         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
885         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
886         (WebCore::ImageDecoderAVFObjC::sampleIsComplete const):
887
888 2019-01-04  Youenn Fablet  <youenn@apple.com>
889
890         CSP violation reports should bypass CSP checks
891         https://bugs.webkit.org/show_bug.cgi?id=192857
892         <rdar://problem/46887236>
893
894         Reviewed by Chris Dumez.
895
896         For ping loads, pass the option to do CSP checks from PingLoader to LoaderStrategy.
897         This new option is unused by WebKit Legacy.
898         It is used by WebKit loader strategy to only send any CSP response header to network process
899         in case CSP checks should be done.
900
901         This option is used to disable CSP checks for Ping Loads that report CSP violations.
902
903         Test: http/wpt/fetch/csp-reports-bypass-csp-checks.html
904
905         * loader/LoaderStrategy.h:
906         * loader/PingLoader.cpp:
907         (WebCore::PingLoader::loadImage):
908         (WebCore::PingLoader::sendPing):
909         (WebCore::PingLoader::sendViolationReport):
910         (WebCore::PingLoader::startPingLoad):
911         * loader/PingLoader.h:
912         * loader/cache/CachedResource.cpp:
913         (WebCore::CachedResource::load):
914
915 2019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
916
917         [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
918         https://bugs.webkit.org/show_bug.cgi?id=193129
919
920         Reviewed by Tim Horton.
921
922         Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior.
923
924         * Sources.txt:
925         * WebCore.xcodeproj/project.pbxproj:
926         * editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp.
927         (WebCore::nameForUndoRedo):
928         * editing/EditAction.h:
929         * editing/Editor.cpp:
930
931 2019-01-03  Matt Rajca  <mrajca@apple.com>
932
933         Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
934         https://bugs.webkit.org/show_bug.cgi?id=193128
935         rdar://34554231
936
937         Reviewed by Jer Noble.
938
939         Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
940         media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
941         event along with a flag that indicates whether or not autoplay was actually prevented.
942         Moreover, we can include a flag that indicates whether the media element in question
943         is main content. Clients will then know in more cases when media was played with a user
944         gesture, whether or not it has audio, as well as its main content status. While the main
945         content heuristics may not be perfect, they covered the top 20 video-centric websites that
946         this was tested with and are meant to be used by clients for data evaluation purposes.
947
948         As part of this, the PlaybackWithoutUserGesture enum was renamed to AutoplayEventPlaybackState
949         since it now also applies to cases where there is a user gesture. The
950         `m_playbackWithoutUserGestureStartedTime` member variable was also removed in favor of
951         `playbackStartedTime` which also covers all the cases we care about.
952
953         Tests: existing API tests were updated to reflect the new names. New API tests
954         were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
955
956         * html/HTMLMediaElement.cpp:
957         (WebCore::convertEnumerationToString): Update to new enum cases.
958         (WebCore::HTMLMediaElement::setReadyState): Ditto.
959         (WebCore::HTMLMediaElement::play): Ditto.
960         (WebCore::HTMLMediaElement::playInternal): Also cover the case where
961          playback was not prevented but there was a user gesture.
962         (WebCore::HTMLMediaElement::pauseInternal): Use new name.
963         (WebCore::HTMLMediaElement::setVolume): Use new name.
964         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Dispatch the
965          DidPlayMediaWithUserGesture event when playback was started with a user
966          gesture as well.
967         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Use new name.
968         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
969         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
970         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
971         (WebCore::HTMLMediaElement::handleAutoplayEvent): Pass along new media state.
972         (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Use new name.
973         (WebCore::HTMLMediaElement::setAutoplayEventPlaybackState): Stop setting
974          m_playbackWithoutUserGestureStartedTime in favor of using playbackStartedTime.
975         (WebCore::HTMLMediaElement::updateShouldPlay): Use new name.
976         (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Renamed.
977         * html/HTMLMediaElement.h:
978         (WTF::LogArgument<WebCore::HTMLMediaElement::AutoplayEventPlaybackState>::toString): Renamed from...
979         (WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):
980         * html/MediaElementSession.cpp:
981         (WebCore::MediaElementSession::isMainContentForPurposesOfAutoplayEvents const): Don't
982          do the hit testing check for the purposes of autoplay events. It seems to fail on the
983          basic Vimeo player due to overlapping divs.
984         (WebCore::isElementMainContentForPurposesOfAutoplay):
985         (WebCore::MediaElementSession::updateIsMainContent const): Keep the existing behavior
986          here of hit testing.
987         (WebCore::isMainContentForPurposesOfAutoplay): Renamed.
988         * html/MediaElementSession.h:
989         * page/AutoplayEvent.h:
990
991 2019-01-04  Youenn Fablet  <youenn@apple.com>
992
993         Crash in WebCore::ServiceWorkerGlobalScope
994         https://bugs.webkit.org/show_bug.cgi?id=192513
995         <rdar://problem/46563880>
996
997         Reviewed by Alex Christensen.
998
999         Store the identifier in its own variable to make sure we do not use workerThread after being moved.
1000
1001         * workers/service/ServiceWorkerGlobalScope.cpp:
1002         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
1003
1004 2019-01-04  Chris Fleizach  <cfleizach@apple.com>
1005
1006         AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
1007         https://bugs.webkit.org/show_bug.cgi?id=193041
1008         <rdar://problem/46954090>
1009
1010         Reviewed by Zalan Bujtas.
1011
1012         * en.lproj/Localizable.strings:
1013         * platform/cocoa/LocalizedStringsCocoa.mm:
1014         (WebCore::AXHorizontalRuleDescriptionText):
1015
1016 2019-01-04  Zalan Bujtas  <zalan@apple.com>
1017
1018         [LFC] ComputedHorizontalMargin should have optional members
1019         https://bugs.webkit.org/show_bug.cgi?id=193131
1020
1021         Reviewed by Antti Koivisto.
1022
1023         Split HorizontalMargin into UsedHorizontalMargin and ComputedHorizontalMargin. ComputedHorizontalMargin's members are optional.
1024         (see computed vs used values)
1025
1026         * layout/FormattingContext.h:
1027         * layout/FormattingContextGeometry.cpp:
1028         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1029         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1030         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1031         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1032         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1033         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
1034         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted.
1035         * layout/LayoutUnits.h:
1036         * layout/MarginTypes.h:
1037         * layout/Verification.cpp:
1038         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1039         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1040         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1041         * layout/displaytree/DisplayBox.h:
1042         (WebCore::Display::Box::setHorizontalMargin):
1043         (WebCore::Display::Box::setHorizontalComputedMargin):
1044         (WebCore::Display::Box::computedMarginStart const):
1045         (WebCore::Display::Box::computedMarginEnd const):
1046         * layout/floats/FloatAvoider.h:
1047         (WebCore::Layout::FloatAvoider::marginStart const):
1048         (WebCore::Layout::FloatAvoider::marginEnd const):
1049         * layout/inlineformatting/InlineFormattingContext.cpp:
1050         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1051         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1052         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1053
1054 2019-01-04  Zalan Bujtas  <zalan@apple.com>
1055
1056         [LFC][BFC] Use computedValue and usedValue consistently
1057         https://bugs.webkit.org/show_bug.cgi?id=193059
1058
1059         Reviewed by Antti Koivisto.
1060
1061         https://www.w3.org/TR/CSS22/cascade.html#value-stages
1062
1063         6.1.2 Computed values
1064         Specified values are resolved to computed values during the cascade; for example URIs are made absolute and 'em' and 'ex' units
1065         are computed to pixel or absolute lengths. Computing a value never requires the user agent to render the document...
1066
1067         6.1.3 Used values
1068         Computed values are processed as far as possible without formatting the document. Some values, however, can only be determined when the document
1069         is being laid out. For example, if the width of an element is set to be a certain percentage of its containing block, the width cannot be determined
1070         until the width of the containing block has been determined. The used value is the result of taking the computed value and resolving any remaining
1071         dependencies into an absolute value.
1072
1073         * layout/FormattingContext.cpp:
1074         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1075         * layout/FormattingContextGeometry.cpp:
1076         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1077         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1078         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1079         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1080         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1081         * layout/LayoutState.cpp:
1082         (WebCore::Layout::LayoutState::LayoutState):
1083         * layout/LayoutUnits.h:
1084         * layout/Verification.cpp:
1085         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1086         * layout/blockformatting/BlockFormattingContext.cpp:
1087         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1088         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1089         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1090         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1091         * layout/displaytree/DisplayBox.cpp:
1092         (WebCore::Display::Box::Box):
1093         * layout/displaytree/DisplayBox.h:
1094         (WebCore::Display::Box::setHasValidHorizontalComputedMargin):
1095         (WebCore::Display::Box::setHorizontalComputedMargin):
1096         (WebCore::Display::Box::computedMarginStart const):
1097         (WebCore::Display::Box::computedMarginEnd const):
1098         (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): Deleted.
1099         (WebCore::Display::Box::setHorizontalNonComputedMargin): Deleted.
1100         (WebCore::Display::Box::nonComputedMarginStart const): Deleted.
1101         (WebCore::Display::Box::nonComputedMarginEnd const): Deleted.
1102         * layout/floats/FloatAvoider.h:
1103         (WebCore::Layout::FloatAvoider::marginStart const):
1104         (WebCore::Layout::FloatAvoider::marginEnd const):
1105         * layout/inlineformatting/InlineFormattingContext.cpp:
1106         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
1107
1108 2019-01-03  Zalan Bujtas  <zalan@apple.com>
1109
1110         REGRESSION: -webkit-appearance test case crashes
1111         https://bugs.webkit.org/show_bug.cgi?id=189302
1112         <rdar://problem/44143049>
1113
1114         Reviewed by Wenson Hsieh.
1115
1116         The painting and the layout positions of the cancel button need to match in order to be able to interact with it.
1117         This patch removes the previous position inlining attempts.
1118
1119         Test: fast/forms/webkit-appearance-searchfield-cancel-button-crash.html
1120
1121         * rendering/RenderThemeMac.mm:
1122         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1123
1124 2019-01-03  David Kilzer  <ddkilzer@apple.com>
1125
1126         Leak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback (48 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1127         <https://webkit.org/b/193122>
1128         <rdar://problem/47022987>
1129
1130         Reviewed by Youenn Fablet.
1131
1132         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
1133         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::AddRef const):
1134         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::Release const):
1135         - Remove `final` keyword so that
1136           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
1137           can be called.
1138         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
1139         - To fix the leak call
1140           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
1141           to create the object.
1142
1143 2019-01-03  Simon Fraser  <simon.fraser@apple.com>
1144
1145         REGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertically offset (or painting is not offset)
1146         https://bugs.webkit.org/show_bug.cgi?id=193124
1147         rdar://problem/46755409
1148
1149         Reviewed by Tim Horton.
1150
1151         Top content inset feeds into scrolling tree geometry, so when it changes we need to trigger
1152         an update of the root scrolling node, which happens via RenderLayerBacking::updateGeometry().
1153         So set a dirty bit on the root layer in frameViewDidChangeSize(), which is called from the code
1154         path that runs when top content inset changes.
1155
1156         Find banner behavior is not easily testable. platform/mac/fast/events/content-inset-hit-testing.html did not detect the regression.
1157
1158         * rendering/RenderLayerCompositor.cpp:
1159         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1160
1161 2019-01-03  Chris Dumez  <cdumez@apple.com>
1162
1163         Potential infinite recursion in isFrameFamiliarWith(Frame&, Frame&)
1164         https://bugs.webkit.org/show_bug.cgi?id=192997
1165         <rdar://problem/46217271>
1166
1167         Reviewed by Antti Koivisto.
1168
1169         isFrameFamiliarWith(Frame&, Frame&) was called recursively using the passed frames' openers.
1170         The issue is that a Frame can be its opener. There could also be a cycle in the opener chain.
1171
1172         To address the issue, simplify isFrameFamiliarWith() so that it is no longer recursive. We now
1173         only check if the frames belong to the same pages or if their openers do. We no longer check
1174         openers' opener and up.
1175
1176         Note that this function is used to check if a frame is allowed to target another. In practice,
1177         it is unlikely to be useful to navigate an opener's opener and an openee's openee.
1178
1179         Tests: fast/dom/Window/window-open-opener-cycle.html
1180                fast/dom/Window/window-open-self-as-opener.html
1181
1182         * page/FrameTree.cpp:
1183         (WebCore::isFrameFamiliarWith):
1184
1185 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
1186
1187         REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
1188         https://bugs.webkit.org/show_bug.cgi?id=193095
1189         <rdar://problem/47014944>
1190
1191         Reviewed by Zalan Bujtas.
1192         
1193         In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
1194         and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
1195         which continues to affect the appearance of text.
1196         
1197         Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
1198
1199         Test: compositing/contents-format/subpixel-antialiased-text.html
1200
1201         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1202         (WebCore::PlatformCALayer::drawLayerContents):
1203
1204 2019-01-02  David Kilzer  <ddkilzer@apple.com>
1205
1206         Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1207         <https://webkit.org/b/193016>
1208         <rdar://problem/46925703>
1209
1210         Reviewed by Simon Fraser.
1211
1212         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1213         (WebCore::copySampleBufferWithCurrentTimeStamp):
1214         - Change to return RetainPtr<CMSampleBufferRef>.
1215         - Check return value of CMSampleBufferCreateCopyWithNewTiming().
1216         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
1217         - Check return value of copySampleBufferWithCurrentTimeStamp().
1218         - Fix leak by using RetainPtr<CMSampleBufferRef> returned from
1219           copySampleBufferWithCurrentTimeStamp() instead of leaking
1220           `bufferWithCurrentTime` by using retainPtr().
1221         (WebCore::createAudioFormatDescription):
1222         - Extract method from appendAudioSampleBuffer() to return
1223           RetainPtr<CMFormatDescriptionRef> after calling
1224           CMAudioFormatDescriptionCreate().
1225         - Check return value of CMAudioFormatDescriptionCreate().
1226         (WebCore::createAudioSampleBufferWithPacketDescriptions):
1227         - Extract method from appendAudioSampleBuffer() to return
1228           RetainPtr<CMSampleBufferRef> after calling
1229           CMAudioSampleBufferCreateWithPacketDescriptions().
1230         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
1231         - Check return values of createAudioFormatDescription() and
1232           createAudioSampleBufferWithPacketDescriptions().
1233         - Fix leaks by extracting code into helper methods that return
1234           RetainPtr<> objects instead of leaking CMFormatDescriptionRef
1235           directly or leaking `sampleBuffer` by using retainPtr().
1236
1237 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1238
1239         Add support for using the current text selection as the find string on iOS
1240         https://bugs.webkit.org/show_bug.cgi?id=193034
1241         <rdar://problem/45138739>
1242
1243         Reviewed by Tim Horton.
1244
1245         Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
1246         pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
1247         process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
1248         able to trigger find-in-page with this string.
1249
1250         Test: WebKit.UseSelectionAsFindString
1251
1252         * editing/Editor.cpp:
1253         (WebCore::Editor::canCopyExcludingStandaloneImages const):
1254
1255         Make this helper function cross-platform.
1256
1257         * editing/Editor.h:
1258         * editing/EditorCommand.cpp:
1259         (WebCore::createCommandMap):
1260         * editing/cocoa/EditorCocoa.mm:
1261         (WebCore::Editor::takeFindStringFromSelection):
1262
1263         Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
1264         find string (see WebKit/ChangeLog for more details).
1265
1266         * editing/mac/EditorMac.mm:
1267         (WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
1268         (WebCore::Editor::takeFindStringFromSelection): Deleted.
1269         * loader/EmptyClients.cpp:
1270         * page/EditorClient.h:
1271
1272         Add a new editor client method to send the string for find-in-page to the UI process.
1273
1274 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
1275
1276         Web Inspector: Implement `queryObjects` Command Line API
1277         https://bugs.webkit.org/show_bug.cgi?id=176766
1278         <rdar://problem/34890689>
1279
1280         Reviewed by Joseph Pecoraro.
1281
1282         Test: inspector/console/queryObjects.html
1283
1284         * inspector/CommandLineAPIModuleSource.js:
1285         (CommandLineAPI):
1286         (CommandLineAPIImpl.prototype.queryObjects): Added.
1287
1288 2019-01-02  Charles Vazac  <cvazac@gmail.com>
1289
1290         Fix resourcetimingbufferfull bubbles attribute
1291         https://bugs.webkit.org/show_bug.cgi?id=193087
1292
1293         Reviewed by Chris Dumez.
1294
1295         This change is covered by web-platform-tests [1].
1296
1297         [1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20
1298
1299         * page/Performance.cpp:
1300         (WebCore::Performance::resourceTimingBufferFullTimerFired):
1301
1302 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
1303
1304         Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
1305         https://bugs.webkit.org/show_bug.cgi?id=193010
1306
1307         Reviewed by Zalan Bujtas.
1308
1309         Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
1310         and make it an enum class.
1311
1312         * page/FrameView.cpp:
1313         (WebCore::FrameView::scrollLayerID const):
1314         * rendering/RenderLayer.h:
1315         * rendering/RenderLayerBacking.cpp:
1316         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1317         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1318         (WebCore::operator<<):
1319         * rendering/RenderLayerBacking.h:
1320         * rendering/RenderLayerCompositor.cpp:
1321         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
1322         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
1323         (WebCore::scrollCoordinationRoleForNodeType):
1324         (WebCore::RenderLayerCompositor::attachScrollingNode):
1325         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
1326         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1327         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
1328         * rendering/RenderLayerCompositor.h:
1329
1330 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
1331
1332         Don't spin up a CalcParser if the current token is not a function token
1333         https://bugs.webkit.org/show_bug.cgi?id=193067
1334
1335         Reviewed by Zalan Bujtas.
1336
1337         Various functions in CSSPropertyParserHelpers fall back to trying to parse
1338         a calc expression if the normal parsing fails. Don't do this unless the
1339         current token is a function token, which should be slightly more efficient.
1340
1341         * css/parser/CSSPropertyParserHelpers.cpp:
1342         (WebCore::CSSPropertyParserHelpers::consumeInteger):
1343         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
1344         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
1345         (WebCore::CSSPropertyParserHelpers::consumeNumber):
1346         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
1347         (WebCore::CSSPropertyParserHelpers::consumeLength):
1348         (WebCore::CSSPropertyParserHelpers::consumePercent):
1349         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
1350         (WebCore::CSSPropertyParserHelpers::consumeAngle):
1351         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
1352         (WebCore::CSSPropertyParserHelpers::consumeTime):
1353
1354 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
1355
1356         Support css-color-4 rgb functions
1357         https://bugs.webkit.org/show_bug.cgi?id=192321
1358
1359         Reviewed by Zalan Bujtas.
1360         
1361         Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
1362         The differences are:
1363         1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
1364             rgb(128 34 56)
1365             rgb(128 34 56 / 50%)
1366         2. Floating point values are allowed, and rounded:
1367             rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
1368         3. rgba() is a pure alias for rgb(), so these are equivalent:
1369             rgb(128 34 56 / 50%)
1370             rgba(128 34 56 / 50%)
1371             
1372         hsl()/hsla() parsing was already updated to this new syntax in r230861.
1373
1374         Tested by tests in imported/w3c/web-platform-tests/css/css-color/
1375
1376         * css/parser/CSSPropertyParserHelpers.cpp:
1377         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
1378         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
1379         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
1380
1381 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
1382
1383         Handle calc() expressions in gradient color stops
1384         https://bugs.webkit.org/show_bug.cgi?id=193066
1385         rdar://problem/46961985
1386
1387         Reviewed by Sam Weinig.
1388         
1389         Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
1390         for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
1391         calc values as well as angle ones.
1392
1393         Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
1394         just as isPx() etc do.
1395
1396         Test: fast/gradients/conic-calc-stop-position.html
1397
1398         * css/CSSPrimitiveValue.h:
1399         (WebCore::CSSPrimitiveValue::isAngle const):
1400         * css/parser/CSSPropertyParserHelpers.cpp:
1401         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
1402         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
1403
1404 2018-12-31  Keith Miller  <keith_miller@apple.com>
1405
1406         SourceProviders should use an actual URL instead of a string
1407         https://bugs.webkit.org/show_bug.cgi?id=192734
1408
1409         Reviewed by Yusuke Suzuki.
1410
1411         Remove ScriptSourceCode's URL member and make the url() method
1412         reference the URL on the SourceProvider. Also, avoid some
1413         ref count churn.
1414
1415         Additionally, this patch fixes an existing bug in
1416         WorkletGlobalScope() that would use a ScriptSourceCode after
1417         WTFMoving it.
1418
1419         * bindings/js/CachedScriptSourceProvider.h:
1420         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
1421         * bindings/js/ScheduledAction.cpp:
1422         (WebCore::ScheduledAction::execute):
1423         * bindings/js/ScriptController.cpp:
1424         (WebCore::ScriptController::executeScriptInWorld):
1425         (WebCore::ScriptController::executeScript):
1426         * bindings/js/ScriptSourceCode.h:
1427         (WebCore::ScriptSourceCode::ScriptSourceCode):
1428         (WebCore::ScriptSourceCode::m_code):
1429         (WebCore::ScriptSourceCode::url const):
1430         (WebCore::ScriptSourceCode::m_url): Deleted.
1431         * dom/ScriptElement.cpp:
1432         (WebCore::ScriptElement::prepareScript):
1433         (WebCore::ScriptElement::requestModuleScript):
1434         (WebCore::ScriptElement::executePendingScript):
1435         * html/HTMLMediaElement.cpp:
1436         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
1437         * page/Frame.cpp:
1438         (WebCore::Frame::injectUserScriptImmediately):
1439         * workers/WorkerGlobalScope.cpp:
1440         (WebCore::WorkerGlobalScope::importScripts):
1441         * workers/WorkerThread.cpp:
1442         (WebCore::WorkerThread::workerThread):
1443         * worklets/WorkletGlobalScope.cpp:
1444         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
1445         * xml/parser/XMLDocumentParserLibxml2.cpp:
1446         (WebCore::XMLDocumentParser::endElementNs):
1447
1448 2019-01-01  Jeff Miller  <jeffm@apple.com>
1449
1450         Update user-visible copyright strings to include 2019
1451         https://bugs.webkit.org/show_bug.cgi?id=192811
1452
1453         Reviewed by Mark Lam.
1454
1455         * Info.plist:
1456
1457 2018-12-30  David Kilzer  <ddkilzer@apple.com>
1458
1459         clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
1460         <https://webkit.org/b/193058>
1461         <rdar://problem/46979275>
1462
1463         Reviewed by Yusuke Suzuki.
1464
1465         * rendering/BorderEdge.cpp:
1466         (WebCore::BorderEdge::BorderEdge): Reorder initialization to
1467         match new instance variable order.
1468         * rendering/BorderEdge.h: Reorder instance variables to save
1469         8 padding bytes.
1470
1471 2018-12-28  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1472
1473         [JSC] Remove one indirection in JSObject::toStringName
1474         https://bugs.webkit.org/show_bug.cgi?id=193037
1475
1476         Reviewed by Keith Miller.
1477
1478         Use old JSObject::toStringName function here.
1479
1480         * bindings/js/JSDOMConstructorBase.cpp:
1481         (WebCore::JSDOMConstructorBase::className):
1482         (WebCore::JSDOMConstructorBase::toStringName):
1483         * bindings/js/JSDOMConstructorBase.h:
1484         (WebCore::JSDOMConstructorBase::className): Deleted.
1485
1486 2018-12-27  Alex Christensen  <achristensen@webkit.org>
1487
1488         Resurrect Mac CMake build
1489         https://bugs.webkit.org/show_bug.cgi?id=192658
1490
1491         Reviewed by Yusuke Suzuki.
1492
1493         This makes it so JSC and most of WebCore builds.
1494         WebCore's use of ARC seems inconsistent, so I'll fix that later.
1495
1496         * PlatformMac.cmake:
1497         * config.h:
1498
1499 2018-12-26  Jim Mason  <jmason@ibinx.com>
1500
1501         [FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
1502         https://bugs.webkit.org/show_bug.cgi?id=193036
1503
1504         Reviewed by Michael Catanzaro.
1505
1506         * platform/graphics/FontPlatformData.h:
1507         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1508
1509 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
1510
1511         Remove "using namespace std;"
1512         https://bugs.webkit.org/show_bug.cgi?id=192973
1513         <rdar://problem/46937309>
1514
1515         Unreviewed Windows port Debug builds fix.
1516
1517         No new tests since no behavior changes.
1518
1519         * accessibility/win/AXObjectCacheWin.cpp:
1520         (WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.
1521
1522 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
1523
1524         Remove "using namespace std;"
1525         https://bugs.webkit.org/show_bug.cgi?id=192973
1526
1527         Reviewed by Alex Christensen.
1528
1529         Removed "using namespace std" statement, and use std:: prefix.
1530
1531         No new tests since no behavior changes.
1532
1533         * accessibility/win/AXObjectCacheWin.cpp:
1534         * platform/graphics/GraphicsContext3DPrivate.cpp:
1535         * platform/graphics/cairo/ImageBufferCairo.cpp:
1536         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
1537         * platform/graphics/win/FontWin.cpp:
1538         (WebCore::FontCascade::floatWidthForComplexText const):
1539         * platform/graphics/win/GraphicsContextCGWin.cpp:
1540         * platform/graphics/win/GraphicsContextCairoWin.cpp:
1541         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1542         * platform/graphics/win/GraphicsContextWin.cpp:
1543         * platform/graphics/win/SimpleFontDataCGWin.cpp:
1544         * platform/graphics/win/UniscribeController.cpp:
1545         (WebCore::UniscribeController::UniscribeController):
1546         (WebCore::UniscribeController::shapeAndPlaceItem):
1547         * platform/image-decoders/ScalableImageDecoder.cpp:
1548         * platform/text/LocaleICU.cpp:
1549         * platform/text/win/LocaleWin.cpp:
1550         * platform/win/ScrollbarThemeWin.cpp:
1551         * rendering/RenderRubyRun.cpp:
1552         (WebCore::RenderRubyRun::layoutBlock):
1553         * rendering/RenderThemeWin.cpp:
1554         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
1555         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
1556         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
1557         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
1558         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
1559         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
1560         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
1561
1562 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
1563
1564         Change ScrollingNodeType to an enum class
1565         https://bugs.webkit.org/show_bug.cgi?id=193009
1566
1567         Reviewed by Zalan Bujtas.
1568
1569         Change the ScrollingNodeType enum to an enum class.
1570         
1571         No behavior change.
1572
1573         * page/scrolling/AsyncScrollingCoordinator.cpp:
1574         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
1575         * page/scrolling/ScrollingCoordinator.cpp:
1576         (WebCore::operator<<):
1577         * page/scrolling/ScrollingCoordinator.h:
1578         * page/scrolling/ScrollingStateFixedNode.cpp:
1579         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
1580         * page/scrolling/ScrollingStateNode.h:
1581         (WebCore::ScrollingStateNode::isFixedNode const):
1582         (WebCore::ScrollingStateNode::isStickyNode const):
1583         (WebCore::ScrollingStateNode::isFrameScrollingNode const):
1584         (WebCore::ScrollingStateNode::isOverflowScrollingNode const):
1585         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
1586         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
1587         * page/scrolling/ScrollingStateStickyNode.cpp:
1588         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
1589         * page/scrolling/ScrollingStateTree.cpp:
1590         (WebCore::ScrollingStateTree::createNode):
1591         (WebCore::ScrollingStateTree::attachNode):
1592         * page/scrolling/ScrollingTreeNode.h:
1593         (WebCore::ScrollingTreeNode::isFixedNode const):
1594         (WebCore::ScrollingTreeNode::isStickyNode const):
1595         (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
1596         (WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
1597         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
1598         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
1599         * page/scrolling/ios/ScrollingTreeIOS.cpp:
1600         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
1601         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
1602         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
1603         * page/scrolling/mac/ScrollingTreeMac.cpp:
1604         (ScrollingTreeMac::createScrollingTreeNode):
1605         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
1606         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
1607         * platform/graphics/GraphicsLayerClient.h:
1608         * rendering/RenderLayerCompositor.cpp:
1609         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
1610         (WebCore::scrollCoordinationRoleForNodeType):
1611         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
1612         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1613
1614 2018-12-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1615
1616         [HarfBuzz] Width not correctly reported as 0 for zero font size
1617         https://bugs.webkit.org/show_bug.cgi?id=192986
1618
1619         Reviewed by Michael Catanzaro.
1620
1621         Fixes test fast/text/font-size-zero.html
1622
1623         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1624         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
1625         size is zero.
1626
1627 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1628
1629         Use Ref<> as much as possible
1630         https://bugs.webkit.org/show_bug.cgi?id=192808
1631
1632         Reviewed by Alex Christensen.
1633
1634         * Modules/encryptedmedia/NavigatorEME.cpp:
1635         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
1636         * Modules/fetch/FetchBody.cpp:
1637         (WebCore::FetchBody::bodyAsFormData const):
1638         * Modules/geolocation/Geolocation.cpp:
1639         (WebCore::Geolocation::getCurrentPosition):
1640         (WebCore::Geolocation::watchPosition):
1641         * Modules/indexeddb/IDBDatabase.cpp:
1642         (WebCore::IDBDatabase::objectStoreNames const):
1643         * Modules/indexeddb/IDBDatabase.h:
1644         * Modules/indexeddb/IDBObjectStore.cpp:
1645         (WebCore::IDBObjectStore::indexNames const):
1646         * Modules/indexeddb/IDBObjectStore.h:
1647         * Modules/indexeddb/IDBTransaction.cpp:
1648         (WebCore::IDBTransaction::scheduleOperation):
1649         * Modules/indexeddb/IDBTransaction.h:
1650         * Modules/indexeddb/client/TransactionOperation.h:
1651         (WebCore::IDBClient::createTransactionOperation):
1652         * Modules/mediastream/MediaDevices.cpp:
1653         (WebCore::MediaDevices::getUserMedia const):
1654         (WebCore::MediaDevices::getDisplayMedia const):
1655         * Modules/mediastream/UserMediaRequest.cpp:
1656         (WebCore::UserMediaRequest::create):
1657         * Modules/mediastream/UserMediaRequest.h:
1658         * Modules/webaudio/AudioParam.cpp:
1659         (WebCore::AudioParam::calculateFinalValues):
1660         * Modules/webaudio/ScriptProcessorNode.cpp:
1661         (WebCore::ScriptProcessorNode::initialize):
1662         * Modules/webdatabase/SQLStatement.cpp:
1663         (WebCore::SQLStatement::execute):
1664         * Modules/webgpu/WebGPU.cpp:
1665         (WebCore::WebGPU::requestAdapter const):
1666         * Modules/webgpu/WebGPUAdapter.cpp:
1667         (WebCore::WebGPUAdapter::create):
1668         * Modules/webgpu/WebGPUAdapter.h:
1669         * Modules/webgpu/WebGPUBuffer.cpp:
1670         (WebCore::WebGPUBuffer::create):
1671         * Modules/webgpu/WebGPUBuffer.h:
1672         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1673         (WebCore::WebGPUCommandBuffer::create):
1674         (WebCore::WebGPUCommandBuffer::beginRenderPass):
1675         * Modules/webgpu/WebGPUCommandBuffer.h:
1676         * Modules/webgpu/WebGPUDevice.cpp:
1677         (WebCore::WebGPUDevice::create):
1678         (WebCore::WebGPUDevice::createBuffer const):
1679         (WebCore::WebGPUDevice::createShaderModule const):
1680         (WebCore::WebGPUDevice::createRenderPipeline const):
1681         (WebCore::WebGPUDevice::createCommandBuffer const):
1682         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1683         (WebCore::WebGPURenderPassEncoder::create):
1684         * Modules/webgpu/WebGPURenderPassEncoder.h:
1685         * Modules/webgpu/WebGPURenderPipeline.cpp:
1686         (WebCore::WebGPURenderPipeline::create):
1687         * Modules/webgpu/WebGPURenderPipeline.h:
1688         * Modules/webgpu/WebGPUShaderModule.cpp:
1689         (WebCore::WebGPUShaderModule::create):
1690         * Modules/webgpu/WebGPUShaderModule.h:
1691         * Modules/webgpu/WebGPUTexture.cpp:
1692         (WebCore::WebGPUTexture::createDefaultTextureView):
1693         * Modules/webgpu/WebGPUTextureView.cpp:
1694         (WebCore::WebGPUTextureView::create):
1695         * Modules/webgpu/WebGPUTextureView.h:
1696         * accessibility/AXObjectCache.cpp:
1697         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
1698         * accessibility/atk/AXObjectCacheAtk.cpp:
1699         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1700         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
1701         (webkitAccessibleHyperlinkGetStartIndex):
1702         (webkitAccessibleHyperlinkGetEndIndex):
1703         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1704         (getSelectionOffsetsForObject):
1705         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1706         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
1707         * bindings/js/JSDOMGlobalObjectTask.cpp:
1708         * bindings/js/JSDOMWindowBase.cpp:
1709         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
1710         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1711         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
1712         * bindings/js/ScriptControllerMac.mm:
1713         (WebCore::ScriptController::createScriptInstanceForWidget):
1714         * bindings/js/SerializedScriptValue.cpp:
1715         (WebCore::CloneDeserializer::readTerminal):
1716         (WebCore::SerializedScriptValue::create):
1717         * bridge/objc/objc_instance.h:
1718         * bridge/objc/objc_instance.mm:
1719         (ObjcInstance::create):
1720         * css/CSSComputedStyleDeclaration.cpp:
1721         (WebCore::ComputedStyleExtractor::currentColorOrValidColor const):
1722         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
1723         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
1724         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
1725         * css/CSSComputedStyleDeclaration.h:
1726         * css/CSSFontFaceSource.cpp:
1727         (WebCore::CSSFontFaceSource::load):
1728         * css/CSSStyleSheet.cpp:
1729         (WebCore::CSSStyleSheet::rules):
1730         * css/FontFace.cpp:
1731         (WebCore::FontFace::unicodeRange const):
1732         (WebCore::FontFace::featureSettings const):
1733         * css/InspectorCSSOMWrappers.cpp:
1734         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
1735         * css/SVGCSSComputedStyleDeclaration.cpp:
1736         (WebCore::strokeDashArrayToCSSValueList):
1737         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
1738         * css/StyleResolver.cpp:
1739         (WebCore::StyleResolver::createFilterOperations):
1740         * css/StyleRule.cpp:
1741         (WebCore::StyleRuleBase::createCSSOMWrapper const):
1742         * css/StyleRule.h:
1743         * dom/ChildListMutationScope.cpp:
1744         (WebCore::ChildListMutationAccumulator::getOrCreate):
1745         * dom/ChildListMutationScope.h:
1746         * dom/DocumentMarkerController.cpp:
1747         (WebCore::updateRenderedRectsForMarker):
1748         * dom/InlineStyleSheetOwner.cpp:
1749         (WebCore::InlineStyleSheetOwner::createSheet):
1750         * dom/PointerEvent.h:
1751         * dom/UserGestureIndicator.h:
1752         (WebCore::UserGestureToken::create):
1753         * editing/AlternativeTextController.cpp:
1754         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
1755         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
1756         (WebCore::AlternativeTextController::respondToUnappliedEditing):
1757         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
1758         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
1759         * editing/ApplyStyleCommand.cpp:
1760         (WebCore::ApplyStyleCommand::applyBlockStyle):
1761         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
1762         * editing/CompositeEditCommand.cpp:
1763         (WebCore::CompositeEditCommand::targetRanges const):
1764         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
1765         (WebCore::CompositeEditCommand::moveParagraphs):
1766         * editing/DeleteSelectionCommand.cpp:
1767         (WebCore::DeleteSelectionCommand::mergeParagraphs):
1768         * editing/Editing.cpp:
1769         (WebCore::visiblePositionForIndexUsingCharacterIterator):
1770         * editing/EditingStyle.cpp:
1771         (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
1772         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
1773         (WebCore::EditingStyle::prepareToApplyAt):
1774         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
1775         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
1776         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
1777         (WebCore::extractPropertiesNotIn):
1778         * editing/Editor.cpp:
1779         (WebCore::Editor::setBaseWritingDirection):
1780         (WebCore::Editor::setComposition):
1781         * editing/EditorCommand.cpp:
1782         (WebCore::executeApplyParagraphStyle):
1783         (WebCore::executeMakeTextWritingDirectionLeftToRight):
1784         (WebCore::executeMakeTextWritingDirectionNatural):
1785         (WebCore::executeMakeTextWritingDirectionRightToLeft):
1786         * editing/FormatBlockCommand.cpp:
1787         (WebCore::FormatBlockCommand::formatRange):
1788         * editing/RemoveFormatCommand.cpp:
1789         (WebCore::RemoveFormatCommand::doApply):
1790         * editing/ReplaceRangeWithTextCommand.cpp:
1791         (WebCore::ReplaceRangeWithTextCommand::targetRanges const):
1792         * editing/ReplaceSelectionCommand.cpp:
1793         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
1794         (WebCore::handleStyleSpansBeforeInsertion):
1795         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
1796         * editing/SpellingCorrectionCommand.cpp:
1797         (WebCore::SpellingCorrectionCommand::targetRanges const):
1798         * editing/TextCheckingHelper.cpp:
1799         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
1800         * editing/TypingCommand.cpp:
1801         (WebCore::TypingCommand::insertText):
1802         (WebCore::TypingCommand::willAddTypingToOpenCommand):
1803         * editing/VisibleUnits.cpp:
1804         (WebCore::distanceBetweenPositions):
1805         * editing/cocoa/EditorCocoa.mm:
1806         (WebCore::Editor::selectionInWebArchiveFormat):
1807         * editing/ios/DictationCommandIOS.cpp:
1808         (WebCore::DictationCommandIOS::doApply):
1809         * editing/ios/EditorIOS.mm:
1810         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
1811         (WebCore::Editor::removeUnchangeableStyles):
1812         (WebCore::Editor::writeImageToPasteboard):
1813         * editing/mac/EditorMac.mm:
1814         (WebCore::Editor::replaceNodeFromPasteboard):
1815         (WebCore::Editor::imageInWebArchiveFormat):
1816         * editing/markup.cpp:
1817         (WebCore::styleFromMatchedRulesAndInlineDecl):
1818         (WebCore::createFragmentForTransformToFragment):
1819         * fileapi/FileReaderLoader.cpp:
1820         (WebCore::FileReaderLoader::didFinishLoading):
1821         * html/FTPDirectoryDocument.cpp:
1822         (WebCore::createTemplateDocumentData):
1823         * html/HTMLMediaElement.cpp:
1824         (WebCore::HTMLMediaElement::scheduleEvent):
1825         (WebCore::HTMLMediaElement::createMediaControls):
1826         * html/HTMLTableElement.cpp:
1827         (WebCore::HTMLTableElement::createSharedCellStyle):
1828         * html/HTMLTableElement.h:
1829         * html/URLUtils.h:
1830         (WebCore::URLUtils<T>::origin const):
1831         * html/parser/HTMLConstructionSite.cpp:
1832         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
1833         * html/shadow/TextControlInnerElements.cpp:
1834         (WebCore::TextControlInnerElement::resolveCustomStyle):
1835         * html/track/WebVTTParser.cpp:
1836         (WebCore::WebVTTParser::createNewCue):
1837         * inspector/DOMPatchSupport.cpp:
1838         * inspector/InspectorCanvas.cpp:
1839         (WebCore::InspectorCanvas::buildInitialState):
1840         (WebCore::InspectorCanvas::buildAction):
1841         * inspector/InspectorFrontendClientLocal.cpp:
1842         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1843         * inspector/InspectorStyleSheet.cpp:
1844         (WebCore::asCSSRuleList):
1845         (WebCore::InspectorStyle::styleWithProperties const):
1846         (WebCore::InspectorStyleSheet::ensureSourceData):
1847         * inspector/agents/InspectorCanvasAgent.cpp:
1848         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
1849         * inspector/agents/InspectorIndexedDBAgent.cpp:
1850         (WebCore::Inspector::keyPathFromIDBKeyPath):
1851         * inspector/agents/InspectorPageAgent.cpp:
1852         (WebCore::InspectorPageAgent::archive):
1853         * loader/EmptyClients.cpp:
1854         (WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace):
1855         (WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace):
1856         (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
1857         (WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace):
1858         * loader/FrameLoader.cpp:
1859         (WebCore::FrameLoader::loadURL):
1860         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
1861         (WebCore::FrameLoader::loadDifferentDocumentItem):
1862         * loader/WorkerThreadableLoader.cpp:
1863         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
1864         * loader/archive/mhtml/MHTMLParser.cpp:
1865         (WebCore::MHTMLParser::addResourceToArchive):
1866         (WebCore::MHTMLParser::parseNextPart):
1867         * loader/cache/MemoryCache.cpp:
1868         (WebCore::MemoryCache::addImageToCache):
1869         (WebCore::MemoryCache::removeResourcesWithOrigin):
1870         * page/DOMWindow.cpp:
1871         (WebCore::DOMWindow::getMatchedCSSRules const):
1872         (WebCore::DOMWindow::createWindow):
1873         * page/EventHandler.cpp:
1874         (WebCore::textDistance):
1875         * page/Page.cpp:
1876         (WebCore::Page::userStyleSheet const):
1877         * page/animation/CSSPropertyAnimation.cpp:
1878         (WebCore::blendFilterOperations):
1879         * page/ios/FrameIOS.mm:
1880         (WebCore::Frame::initWithSimpleHTMLDocument):
1881         (WebCore::Frame::interpretationsForCurrentRoot const):
1882         * page/mac/ServicesOverlayController.mm:
1883         (WebCore::ServicesOverlayController::Highlight::fadeIn):
1884         (WebCore::ServicesOverlayController::Highlight::fadeOut):
1885         * platform/SharedBuffer.cpp:
1886         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
1887         * platform/audio/HRTFElevation.cpp:
1888         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
1889         * platform/audio/SincResampler.cpp:
1890         (WebCore::SincResampler::consumeSource):
1891         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1892         (WebCore::AudioFileReader::createBus):
1893         * platform/audio/mac/AudioFileReaderMac.cpp:
1894         (WebCore::AudioFileReader::createBus):
1895         * platform/graphics/Icon.h:
1896         (WebCore::Icon::create):
1897         * platform/graphics/InbandTextTrackPrivate.h:
1898         (WebCore::InbandTextTrackPrivate::create):
1899         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1900         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
1901         * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
1902         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1903         (WebCore::fulfillRequestWithKeyData):
1904         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1905         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1906         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1907         (WebCore::MediaSourcePrivateAVFObjC::create):
1908         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
1909         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1910         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1911         (WebCore::SourceBufferPrivateAVFObjC::create):
1912         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
1913         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
1914         * platform/graphics/ca/TileController.cpp:
1915         (WebCore::TileController::createTileLayer):
1916         * platform/graphics/ca/TileController.h:
1917         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1918         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
1919         (WebCore::CACFLayerTreeHost::create):
1920         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1921         (WebCore::GPUBuffer::create):
1922         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1923         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
1924         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
1925         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
1926         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
1927         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1928         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
1929         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
1930         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1931         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
1932         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1933         (WebCore::AppendPipeline::appsinkNewSample):
1934         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
1935         (WebCore::ISOProtectionSystemSpecificHeaderBox::parse):
1936         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
1937         (WebCore::ISOTrackEncryptionBox::parse):
1938         * platform/graphics/texmap/TextureMapperAnimation.cpp:
1939         (WebCore::applyFilterAnimation):
1940         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1941         (WebCore::TextureMapperPlatformLayerBuffer::clone):
1942         * platform/graphics/transforms/TransformOperations.cpp:
1943         (WebCore::TransformOperations::blendByMatchingOperations const):
1944         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1945         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
1946         * platform/mock/mediasource/MockBox.cpp:
1947         (WebCore::MockInitializationBox::MockInitializationBox):
1948         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1949         (WebCore::MockSourceBufferPrivate::create):
1950         (WebCore::MockSourceBufferPrivate::append):
1951         * platform/mock/mediasource/MockSourceBufferPrivate.h:
1952         * platform/mock/mediasource/MockTracks.h:
1953         (WebCore::MockTextTrackPrivate::create):
1954         (WebCore::MockVideoTrackPrivate::create):
1955         * platform/network/FormData.h:
1956         (WebCore::FormData::decode):
1957         * platform/network/cocoa/CookieStorageObserver.h:
1958         * platform/network/cocoa/CookieStorageObserver.mm:
1959         (WebCore::CookieStorageObserver::create):
1960         * platform/network/soup/ResourceRequestSoup.cpp:
1961         (WebCore::appendEncodedBlobItemToSoupMessageBody):
1962         (WebCore::ResourceRequest::updateSoupMessageBody const):
1963         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1964         (WebCore::HyphenationDictionary::createNull):
1965         (WebCore::HyphenationDictionary::create):
1966         * platform/win/SearchPopupMenuWin.cpp:
1967         (WebCore::SearchPopupMenuWin::SearchPopupMenuWin):
1968         (WebCore::SearchPopupMenuWin::popupMenu):
1969         * platform/win/SearchPopupMenuWin.h:
1970         * rendering/RenderThemeIOS.mm:
1971         (WebCore::applyCommonButtonPaddingToStyle):
1972         (WebCore::RenderThemeIOS::paintProgressBar):
1973         (WebCore::RenderThemeIOS::adjustButtonStyle const):
1974         (WebCore::paintAttachmentIcon):
1975         * rendering/svg/SVGRenderTreeAsText.cpp:
1976         (WebCore::writeSVGResourceContainer):
1977         * storage/Storage.cpp:
1978         (WebCore::Storage::create):
1979         (WebCore::Storage::Storage):
1980         * storage/Storage.h:
1981         (WebCore::Storage::area const):
1982         * storage/StorageNamespace.h:
1983         * storage/StorageNamespaceProvider.cpp:
1984         (WebCore::StorageNamespaceProvider::localStorageArea):
1985         * storage/StorageNamespaceProvider.h:
1986         * svg/SVGElement.cpp:
1987         (WebCore::SVGElement::getPresentationAttribute):
1988         * svg/SVGFEBlendElement.cpp:
1989         (WebCore::SVGFEBlendElement::build):
1990         * svg/SVGFEColorMatrixElement.cpp:
1991         (WebCore::SVGFEColorMatrixElement::build):
1992         * svg/SVGFEComponentTransferElement.cpp:
1993         (WebCore::SVGFEComponentTransferElement::build):
1994         * svg/SVGFECompositeElement.cpp:
1995         (WebCore::SVGFECompositeElement::build):
1996         * svg/SVGFEDiffuseLightingElement.cpp:
1997         (WebCore::SVGFEDiffuseLightingElement::build):
1998         * svg/SVGFEDisplacementMapElement.cpp:
1999         (WebCore::SVGFEDisplacementMapElement::build):
2000         * svg/SVGFEDropShadowElement.cpp:
2001         (WebCore::SVGFEDropShadowElement::build):
2002         * svg/SVGFEGaussianBlurElement.cpp:
2003         (WebCore::SVGFEGaussianBlurElement::build):
2004         * svg/SVGFEMergeElement.cpp:
2005         (WebCore::SVGFEMergeElement::build):
2006         * svg/SVGFEMorphologyElement.cpp:
2007         (WebCore::SVGFEMorphologyElement::build):
2008         * svg/SVGFEOffsetElement.cpp:
2009         (WebCore::SVGFEOffsetElement::build):
2010         * svg/SVGFESpecularLightingElement.cpp:
2011         (WebCore::SVGFESpecularLightingElement::build):
2012         * svg/SVGFETileElement.cpp:
2013         (WebCore::SVGFETileElement::build):
2014         * testing/GCObservation.h:
2015         * xml/XSLTProcessor.cpp:
2016         (WebCore::XSLTProcessor::createDocumentFromSource):
2017         * xml/parser/XMLDocumentParser.cpp:
2018         (WebCore::XMLDocumentParser::parseDocumentFragment):
2019
2020 2018-12-21  Chris Dumez  <cdumez@apple.com>
2021
2022         navigator.userAgent in service workers does not reflect customUserAgent set by client
2023         https://bugs.webkit.org/show_bug.cgi?id=192951
2024
2025         Reviewed by Youenn Fablet.
2026
2027         Whenever a service worker client registers itself, also pass its effective user agent.
2028         In the network process, for each origin, we store the latest client's user agent and
2029         use it when starting the service worker.
2030
2031         * dom/Document.cpp:
2032         (WebCore::Document::setServiceWorkerConnection):
2033         * loader/DocumentLoader.cpp:
2034         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
2035         * workers/service/SWClientConnection.h:
2036         * workers/service/server/SWServer.cpp:
2037         (WebCore::SWServer::serviceWorkerClientUserAgent const):
2038         (WebCore::SWServer::installContextData):
2039         (WebCore::SWServer::runServiceWorker):
2040         (WebCore::SWServer::registerServiceWorkerClient):
2041         * workers/service/server/SWServer.h:
2042         * workers/service/server/SWServerToContextConnection.h:
2043         * workers/service/server/SWServerWorker.cpp:
2044         (WebCore::SWServerWorker::userAgent const):
2045         * workers/service/server/SWServerWorker.h:
2046
2047 2018-12-21  Youenn Fablet  <youenn@apple.com>
2048
2049         RTCRtpSender.setParameters() does set active parameter
2050         https://bugs.webkit.org/show_bug.cgi?id=192848
2051
2052         Reviewed by Eric Carlson.
2053
2054         Covered by updated test.
2055
2056         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
2057         (WebCore::updateRTCRtpSendParameters):
2058         The routine was updating the local value, not the out parameter.
2059
2060 2018-12-21  Eric Carlson  <eric.carlson@apple.com>
2061
2062         'ended' Event doesn't fire on MediaStreamTrack when a USB camera is unplugged
2063         https://bugs.webkit.org/show_bug.cgi?id=187896
2064         <rdar://problem/42681445>
2065
2066         Reviewed by Jer Noble.
2067
2068         No new tests, tested manually.
2069
2070         * platform/mediastream/mac/AVVideoCaptureSource.h:
2071         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2072         (WebCore::AVVideoCaptureSource::deviceDisconnected):
2073         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
2074         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
2075         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
2076         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
2077         (WebCore::deviceHasInputStreams):
2078         (WebCore::isValidCaptureDevice):
2079         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
2080         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
2081         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Deleted.
2082         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
2083         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2084         (WebCore::CoreAudioSharedUnit::setCaptureDevice):
2085         (WebCore::CoreAudioSharedUnit::devicesChanged):
2086         (WebCore::CoreAudioSharedUnit::startProducingData):
2087         (WebCore::CoreAudioSharedUnit::startInternal):
2088         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
2089         (WebCore::CoreAudioSharedUnit::captureFailed):
2090         (WebCore::CoreAudioCaptureSourceFactory::devicesChanged):
2091         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
2092         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID): Deleted.
2093         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2094
2095 2018-12-20  Ryosuke Niwa  <rniwa@webkit.org>
2096
2097         REGRESSION(r239353): iOS WK1 Assertion failure in notifyChildNodeRemoved while running
2098         TestWebKitAPI.QuickLook.LegacyQuickLookContent
2099         https://bugs.webkit.org/show_bug.cgi?id=192859
2100         <rdar://problem/46887237>
2101
2102         Reviewed by Antti Koivisto.
2103
2104         After r239353, ScriptDisallowedScope::InMainThread::isScriptAllowed() may return false when the web thread
2105         is inside a delegate callback even when there is a ScriptDisallowedScope defined.
2106
2107         Replace the existign debug assertions which assert !ScriptDisallowedScope::InMainThread::isScriptAllowed()
2108         by a newly added ScriptDisallowedScope::InMainThread::hasDisallowedScope to avoid hitting this assertion.
2109
2110         Tests: TestWebKitAPI.QuickLook.LegacyQuickLookContent
2111
2112         * dom/ContainerNodeAlgorithms.cpp:
2113         (WebCore::notifyChildNodeInserted):
2114         (WebCore::notifyChildNodeRemoved):
2115         * dom/Document.cpp:
2116         (WebCore::Document::nodeChildrenWillBeRemoved):
2117         (WebCore::Document::nodeWillBeRemoved):
2118         * dom/ScriptDisallowedScope.h:
2119         (WebCore::ScriptDisallowedScope::InMainThread::hasDisallowedScope):
2120         * html/HTMLFormElement.cpp:
2121         (WebCore:: const):
2122
2123 2018-12-21  Joseph Pecoraro  <pecoraro@apple.com>
2124
2125         Update status of some WebCore features in features.json
2126         https://bugs.webkit.org/show_bug.cgi?id=192998
2127
2128         Reviewed by Tim Horton.
2129
2130         * features.json:
2131         - Variation Fonts: Supported
2132         - Conic Gradients: Supported in Preview
2133         - Web Share: Supported in Preview
2134         - <datalist>: Supported in Preview
2135         - Intersection Observers: Supported in Preview
2136
2137 2018-12-21  Zalan Bujtas  <zalan@apple.com>
2138
2139         [iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations()
2140         https://bugs.webkit.org/show_bug.cgi?id=192357
2141         <rdar://problem/42852260>
2142
2143         Reviewed by Simon Fraser.
2144
2145         Do not try to paint the file picker when painting is disabled.
2146
2147         * rendering/RenderFileUploadControl.cpp:
2148         (WebCore::RenderFileUploadControl::paintObject):
2149
2150 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
2151
2152         [WebAuthN] userPresence should always be true
2153         https://bugs.webkit.org/show_bug.cgi?id=192835
2154         <rdar://problem/46538788>
2155
2156         Reviewed by Brent Fulgham.
2157
2158         In the current spec as of 7 August 2018, userPresence is suggested to set to the inverse of userVerification.
2159         This doesn't comply with the CTAP spec. Details in: https://github.com/w3c/webauthn/issues/1123.
2160         After discussing with other members of the working group, we decided to make userPresence always default to true.
2161
2162         Covered by exisiting tests.
2163
2164         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
2165         (fido::encodeGetAssertionRequestAsCBOR):
2166
2167 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
2168
2169         [WebAuthN] Import an APDU coder from Chromium
2170         https://bugs.webkit.org/show_bug.cgi?id=192949
2171         <rdar://problem/46879933>
2172
2173         Reviewed by Brent Fulgham.
2174
2175         This patch imports an APDU coder from Chromium. Here is the documentation:
2176         https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
2177         APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.
2178
2179         Here is a list of files that are imported from Chromium:
2180         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
2181         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2182         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2183         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2184         https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2185
2186         Covered by API tests.
2187
2188         * Modules/webauthn/apdu/ApduCommand.cpp: Added.
2189         (apdu::ApduCommand::createFromMessage):
2190         (apdu::ApduCommand::ApduCommand):
2191         (apdu::ApduCommand::getEncodedCommand const):
2192         * Modules/webauthn/apdu/ApduCommand.h: Added.
2193         * Modules/webauthn/apdu/ApduResponse.cpp: Added.
2194         (apdu::ApduResponse::createFromMessage):
2195         (apdu::ApduResponse::ApduResponse):
2196         (apdu::ApduResponse::getEncodedResponse const):
2197         * Modules/webauthn/apdu/ApduResponse.h: Added.
2198         * Sources.txt:
2199         * WebCore.xcodeproj/project.pbxproj:
2200
2201 2018-12-21  Jer Noble  <jer.noble@apple.com>
2202
2203         Convert raw CDMSessionMediaSourceAVFObjC pointer in MediaPlayerPrivateMediaSourceAVFObjC
2204         https://bugs.webkit.org/show_bug.cgi?id=192985
2205         <rdar://problem/46750743>
2206
2207         Reviewed by Eric Carlson.
2208
2209         Make m_session a RefPtr; drive-by fix: make m_mediaElement in WebKitMediaKeys a WeakPtr.
2210
2211         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
2212         (WebCore::WebKitMediaKeys::setMediaElement):
2213         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
2214         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
2215         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2216         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2217         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2218         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
2219
2220 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
2221
2222         CSS variables don't work for colors in "border" property
2223         https://bugs.webkit.org/show_bug.cgi?id=192922
2224
2225         Reviewed by Simon Fraser.
2226
2227         ParseColorFunction no longer consumes anything if the color was not valid.
2228
2229         Test: css-custom-properties-api/border-variable-parsing.html
2230
2231         * css/parser/CSSPropertyParserHelpers.cpp:
2232         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
2233
2234 2018-12-21  Justin Fan  <justin_fan@apple.com>
2235
2236         [WebGPU] GPUBindGroupLayout refactoring: no HashMap, and failure logging
2237         https://bugs.webkit.org/show_bug.cgi?id=192990
2238
2239         Reviewed by Myles C. Maxfield.
2240
2241         Refactor away the unnecessary HashMaps when creating MTLArgumentEncoders in GPUBindGroupLayout creation.
2242         Also update GPUBindGroupLayout::create -> tryCreate, in order to better handle Objective-C exceptions.
2243
2244         No new tests; no change in behavior.
2245
2246         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
2247         (WebCore::WebGPUBindGroupLayout::create):
2248         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
2249         * Modules/webgpu/WebGPUBindGroupLayout.h:
2250         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
2251         * Modules/webgpu/WebGPUDevice.cpp:
2252         (WebCore::WebGPUDevice::createBindGroupLayout const):
2253         * platform/graphics/gpu/GPUBindGroupLayout.h:
2254         * platform/graphics/gpu/GPUDevice.cpp:
2255         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Renamed from ::create*. Now returning a RefPtr. 
2256         (WebCore::GPUDevice::createBindGroupLayout const): Deleted.
2257         * platform/graphics/gpu/GPUDevice.h:
2258         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
2259         (WebCore::appendArgumentToArray):
2260         (WebCore::newEncoder):
2261         (WebCore::GPUBindGroupLayout::tryCreate): Renamed from ::create. Now returning a RefPtr.
2262         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2263         (WebCore::appendArgumentToArrayInMap): Deleted.
2264         (WebCore::GPUBindGroupLayout::create): Deleted.
2265
2266         Deleted unneeded GPUBindGroupLayout.cpp:
2267         * Sources.txt:
2268         * WebCore.xcodeproj/project.pbxproj:
2269         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Removed.
2270
2271 2018-12-21  Alejandro G. Castro  <alex@igalia.com>
2272
2273         [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
2274         https://bugs.webkit.org/show_bug.cgi?id=190466
2275
2276         Reviewed by Youenn Fablet.
2277
2278         Added persistency to the DeviceIdHashSaltStorage.
2279
2280         * platform/glib/FileSystemGlib.cpp:
2281         (WebCore::FileSystem::getFileSize): Implemented this function to
2282         allow sharing code with the statistics storage class.
2283         * platform/glib/KeyedDecoderGlib.cpp:
2284         (WebCore::KeyedDecoderGlib::dictionaryFromGVariant): Added a
2285         condition to control situations where the key is empty, it can
2286         happen if the user modifies the file in the disk.
2287         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Add include
2288         to make work compilation with debug, unified builds.
2289
2290 2018-12-21  Zalan Bujtas  <zalan@apple.com>
2291
2292         Synchronous media query evaluation could destroy current Frame/FrameView.
2293         https://bugs.webkit.org/show_bug.cgi?id=192781
2294         <rdar://problem/34416793>
2295
2296         Reviewed by Chris Dumez.
2297
2298         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
2299
2300         Test: printing/print-with-media-query-destory.html
2301
2302         * loader/DocumentLoader.cpp:
2303         (WebCore::DocumentLoader::finishedLoading):
2304         * page/Frame.cpp:
2305         (WebCore::Frame::setPrinting):
2306         * page/FrameView.cpp:
2307         (WebCore::FrameView::forceLayoutForPagination):
2308         * page/PrintContext.cpp:
2309         (WebCore::PrintContext::PrintContext):
2310         (WebCore::PrintContext::computePageRects):
2311         (WebCore::PrintContext::computePageRectsWithPageSizeInternal):
2312         (WebCore::PrintContext::begin):
2313         (WebCore::PrintContext::computeAutomaticScaleFactor):
2314         (WebCore::PrintContext::spoolPage):
2315         (WebCore::PrintContext::spoolRect):
2316         (WebCore::PrintContext::end):
2317         * page/PrintContext.h:
2318         (WebCore::PrintContext::frame const): Deleted.
2319
2320 2018-12-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2321
2322         Setting the file wrapper and content type of an attachment to a PDF should update its image
2323         https://bugs.webkit.org/show_bug.cgi?id=192984
2324         <rdar://problem/46798028>
2325
2326         Reviewed by Tim Horton.
2327
2328         Allow PDF data to be used to update enclosing image elements when setting the file wrapper for an attachment.
2329         Covered by a new API test: WKAttachmentTests.SetFileWrapperForPDFImageAttachment.
2330
2331         * html/HTMLAttachmentElement.cpp:
2332         (WebCore::mimeTypeIsSuitableForInlineImageAttachment):
2333         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
2334
2335 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
2336
2337         Repeated background images with zero size should display the background color
2338         https://bugs.webkit.org/show_bug.cgi?id=192962
2339
2340         Reviewed by Antti Koivisto.
2341
2342         Test: fast/backgrounds/background-repeat-with-zero-size.html
2343
2344         * platform/LengthSize.h:
2345         (WebCore::LengthSize::isEmpty const):
2346         * rendering/RenderBoxModelObject.cpp:
2347         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2348         * rendering/style/FillLayer.h:
2349         (WebCore::FillLayer::isEmpty const):
2350
2351 2018-12-21  Manuel Rego Casasnovas  <rego@igalia.com>
2352
2353         [css-grid] Fix percentages in relative offsets for grid items
2354         https://bugs.webkit.org/show_bug.cgi?id=190492
2355
2356         Reviewed by Sergio Villar Senin.
2357
2358         The method RenderBoxModelObject::relativePositionOffset() was not considering the case of grid items,
2359         where the containing block is the grid area.
2360         The patch modifies the method so the new code uses overrideContainingBlockContentWidth|Height when required.
2361
2362         Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html
2363
2364         * rendering/RenderBox.cpp: Implement the physical versions of the already existent methods.
2365         (WebCore::RenderBox::overrideContainingBlockContentWidth const):
2366         (WebCore::RenderBox::overrideContainingBlockContentHeight const):
2367         (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
2368         (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
2369         * rendering/RenderBox.h:
2370         * rendering/RenderBoxModelObject.cpp:
2371         (WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method
2372         to take into account overrideContainingBlockContentWidth|Height for grid items.
2373         * rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods
2374         that will be overridden in RenderBox.
2375         (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
2376         (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
2377         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const):
2378         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const):
2379
2380 2018-12-20  Justin Fan  <justin_fan@apple.com>
2381
2382         [WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders
2383         https://bugs.webkit.org/show_bug.cgi?id=192956
2384
2385         Reviewed by Myles Maxfield.
2386
2387         No testable behavior change. Existing tests cover possible crashing.
2388
2389         Add GPUBindGroupLayoutMetal.mm:
2390         * SourcesCocoa.txt:
2391         * WebCore.xcodeproj/project.pbxproj:
2392
2393         Flesh out GPUBindGroupLayout::create:
2394         * platform/graphics/gpu/GPUBindGroupLayout.cpp:
2395         * platform/graphics/gpu/GPUBindGroupLayout.h:
2396         * platform/graphics/gpu/GPUDevice.cpp:
2397         (WebCore::GPUDevice::createBindGroupLayout const):
2398         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Added.
2399         (WebCore::appendArgumentToArrayInMap): Added.
2400         (WebCore::GPUBindGroupLayout::create):
2401         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2402         (WebCore::MTLDataTypeForBindingType): Added.
2403
2404 2018-12-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2405
2406         Unreviewed, remove stray #pragma once added to .cpp file
2407
2408         * svg/properties/SVGAttributeOwnerProxy.cpp:
2409
2410 2018-12-20  Justin Michaud  <justin_michaud@apple.com>
2411
2412         Adding runtime-enabled attribute to Element prevents inlining property access
2413         https://bugs.webkit.org/show_bug.cgi?id=192901
2414
2415         Add a call to flattenDictionaryObject after disabling runtime-enabled attributes.
2416
2417         Reviewed by Ryosuke Niwa.
2418
2419         * bindings/scripts/CodeGeneratorJS.pm:
2420         (GenerateImplementation):
2421         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2422         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
2423         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2424         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
2425         * bindings/scripts/test/JS/JSTestNode.cpp:
2426         (WebCore::JSTestNodePrototype::finishCreation):
2427         * bindings/scripts/test/JS/JSTestObj.cpp:
2428         (WebCore::JSTestObjPrototype::finishCreation):
2429
2430 2018-12-20  Chris Dumez  <cdumez@apple.com>
2431
2432         Use Optional::hasValue() instead of Optional::has_value()
2433         https://bugs.webkit.org/show_bug.cgi?id=192948
2434
2435         Reviewed by Tim Horton.
2436
2437         * bindings/js/DOMPromiseProxy.h:
2438         (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const):
2439         (WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const):
2440         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const):
2441         * dom/DataTransferItemList.h:
2442         (WebCore::DataTransferItemList::hasItems const):
2443         * dom/EventTarget.cpp:
2444         (WebCore::EventTarget::addEventListener):
2445         * html/HTMLMediaElement.cpp:
2446         (WebCore::HTMLMediaElement::captionDisplayMode):
2447         * platform/graphics/MediaPlayer.cpp:
2448         (WebCore::MediaPlayer::wouldTaintOrigin const):
2449         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2450         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
2451         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2452         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
2453         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
2454         (webKitMediaSrcUpdatePresentationSize):
2455         * platform/mac/NSScrollerImpDetails.mm:
2456         (WebCore::ScrollerStyle::recommendedScrollerStyle):
2457         * rendering/RenderListItem.cpp:
2458         (WebCore::RenderListItem::setExplicitValue):
2459
2460 2018-12-20  Chris Dumez  <cdumez@apple.com>
2461
2462         Move HTTPS_UPGRADE code behind a runtime flag, off by default
2463         https://bugs.webkit.org/show_bug.cgi?id=192937
2464
2465         Reviewed by Youenn Fablet.
2466
2467         Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
2468
2469         * page/Settings.yaml:
2470
2471 2018-12-20  Youenn Fablet  <youenn@apple.com>
2472
2473         Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
2474         https://bugs.webkit.org/show_bug.cgi?id=192838
2475
2476         Reviewed by Chris Dumez.
2477
2478         Generate constructor code in case of a Private but not Public constructor.
2479         Make sure this is correctly exposed in global objects.
2480         Add JS built-in constructor implementations for those two objects.
2481
2482         Also add JS built-in constructors for controller and byob request.
2483         To keep existing behavior, JS built-ins calling these constructors need to pass
2484         an additional parameter that allows making the difference between a JS builtin caller or a JS caller.
2485         In the latter case, the constructor will throw.
2486
2487         Covered by existing tests, no observable change of behavior.
2488
2489         * Modules/streams/ReadableByteStreamController.idl:
2490         * Modules/streams/ReadableByteStreamController.js:
2491         (initializeReadableByteStreamController):
2492         (getter.byobRequest):
2493         * Modules/streams/ReadableByteStreamInternals.js:
2494         (privateInitializeReadableByteStreamController): Deleted.
2495         (privateInitializeReadableStreamBYOBRequest): Deleted.
2496         * Modules/streams/ReadableStream.js:
2497         (initializeReadableStream):
2498         * Modules/streams/ReadableStreamBYOBReader.js:
2499         (initializeReadableStreamBYOBReader):
2500         * Modules/streams/ReadableStreamBYOBRequest.idl:
2501         * Modules/streams/ReadableStreamBYOBRequest.js:
2502         (initializeReadableStreamBYOBRequest):
2503         * Modules/streams/ReadableStreamDefaultController.idl:
2504         * Modules/streams/ReadableStreamDefaultController.js:
2505         (initializeReadableStreamDefaultController):
2506         (enqueue):
2507         * Modules/streams/ReadableStreamDefaultReader.js:
2508         (initializeReadableStreamDefaultReader):
2509         * Modules/streams/ReadableStreamInternals.js:
2510         (readableStreamDefaultControllerError): Deleted.
2511         * Sources.txt:
2512         * UnifiedSources-input.xcfilelist:
2513         * WebCore.xcodeproj/project.pbxproj:
2514         * bindings/js/JSDOMBuiltinConstructor.h:
2515         * bindings/js/JSDOMGlobalObject.cpp:
2516         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2517         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed.
2518         * bindings/js/JSReadableStreamPrivateConstructors.h: Removed.
2519         * bindings/scripts/CodeGeneratorJS.pm:
2520         (GeneratePropertiesHashTable):
2521         * bindings/scripts/preprocess-idls.pl:
2522         (shouldExposeInterface):
2523
2524 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
2525
2526         [WebAuthN] Remove hash from Client Data
2527         https://bugs.webkit.org/show_bug.cgi?id=192727
2528         <rdar://problem/46746673>
2529
2530         Reviewed by Brent Fulgham.
2531
2532         The hash algorithm for hashing the client data is enforced to SHA_256 in the latest spec:
2533         https://www.w3.org/TR/webauthn/#sec-client-data. Therefore, we should remove it.
2534
2535         Covered by existing tests.
2536
2537         * Modules/webauthn/AuthenticatorCoordinator.cpp:
2538         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson):
2539
2540 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
2541
2542         [WebAuthN] Add a runtime flag for local authenticator
2543         https://bugs.webkit.org/show_bug.cgi?id=192792
2544         <rdar://problem/46798738>
2545
2546         Reviewed by Brent Fulgham.
2547
2548         No tests.
2549
2550         This patch adds a runtime flag for local authenticator and removes ways to
2551         set the runtime flag for web authentication in LegacyWebKit.
2552
2553         * page/RuntimeEnabledFeatures.h:
2554         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled):
2555         (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const):
2556
2557 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
2558
2559         Pointer lock causes abandoned documents
2560         https://bugs.webkit.org/show_bug.cgi?id=188727
2561         rdar://problem/44248197
2562         
2563         Reviewed by Simon Fraser.
2564
2565         Fixes --world-leaks in these tests:
2566
2567         pointer-lock/locked-element-removed-from-dom.html
2568         pointer-lock/mouse-event-delivery.html
2569         fast/shadow-dom/pointerlockelement-in-slot.html
2570
2571         PointerLockController now uses WeakPtr instead of RefPtr because it has no need to extend the lifetime of a document.
2572
2573         * page/PointerLockController.cpp:
2574         (WebCore::PointerLockController::elementRemoved):
2575         (WebCore::PointerLockController::documentDetached):
2576         (WebCore::PointerLockController::didAcquirePointerLock):
2577         * page/PointerLockController.h:
2578
2579 2018-12-20  Chris Dumez  <cdumez@apple.com>
2580
2581         Use Optional::valueOr() instead of Optional::value_or()
2582         https://bugs.webkit.org/show_bug.cgi?id=192933
2583
2584         Reviewed by Geoffrey Garen.
2585
2586         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2587         (WebCore::convert):
2588         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
2589         * Modules/encryptedmedia/MediaKeySession.cpp:
2590         (WebCore::MediaKeySession::load):
2591         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2592         (WebCore::IDBDatabaseIdentifier::hash const):
2593         * Modules/indexeddb/IDBFactory.cpp:
2594         (WebCore::IDBFactory::open):
2595         * Modules/mediastream/MediaStreamTrack.cpp:
2596         (WebCore::MediaStreamTrack::applyConstraints):
2597         * Modules/mediastream/RTCDTMFSender.cpp:
2598         (WebCore::RTCDTMFSender::insertDTMF):
2599         * Modules/webdatabase/SQLTransaction.cpp:
2600         (WebCore::SQLTransaction::executeSql):
2601         * Modules/webvr/VRFrameData.cpp:
2602         (WebCore::VRFrameData::update):
2603         * animation/AnimationTimeline.cpp:
2604         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
2605         * animation/DeclarativeAnimation.cpp:
2606         (WebCore::DeclarativeAnimation::cancel):
2607         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
2608         * animation/KeyframeEffect.cpp:
2609         (WebCore::computeMissingKeyframeOffsets):
2610         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
2611         * animation/WebAnimation.cpp:
2612         (WebCore::WebAnimation::runPendingPlayTask):
2613         (WebCore::WebAnimation::runPendingPauseTask):
2614         * bindings/js/SerializedScriptValue.cpp:
2615         (WebCore::CloneSerializer::write):
2616         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2617         (WebCore::CryptoAlgorithmHMAC::generateKey):
2618         (WebCore::CryptoAlgorithmHMAC::importKey):
2619         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
2620         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2621         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2622         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
2623         (WebCore::CryptoKeyRSA::importSpki):
2624         (WebCore::CryptoKeyRSA::importPkcs8):
2625         * crypto/keys/CryptoKeyRSA.cpp:
2626         (WebCore::CryptoKeyRSA::importJwk):
2627         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
2628         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2629         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2630         * crypto/mac/CryptoKeyRSAMac.cpp:
2631         (WebCore::CryptoKeyRSA::importSpki):
2632         (WebCore::CryptoKeyRSA::importPkcs8):
2633         * css/CSSComputedStyleDeclaration.cpp:
2634         (WebCore::counterToCSSValue):
2635         * css/CSSFontFace.cpp:
2636         (WebCore::calculateItalicRange):
2637         * css/CSSPrimitiveValue.cpp:
2638         (WebCore::CSSPrimitiveValue::doubleValue const):
2639         * css/CSSStyleSheet.cpp:
2640         (WebCore::CSSStyleSheet::addRule):
2641         * css/DOMMatrix.cpp:
2642         (WebCore::DOMMatrix::rotateSelf):
2643         * css/DOMMatrixReadOnly.cpp:
2644         (WebCore::DOMMatrixReadOnly::validateAndFixup):
2645         * css/StyleBuilderCustom.h:
2646         (WebCore::StyleBuilderCustom::applyValueCounter):
2647         * css/parser/MediaQueryParser.cpp:
2648         (WebCore::MediaQueryParser::commitMediaQuery):
2649         * dom/Document.h:
2650         (WebCore::Document::referrerPolicy const):
2651         * dom/Element.cpp:
2652         (WebCore::toScrollAlignment):
2653         * dom/EventTarget.cpp:
2654         (WebCore::EventTarget::addEventListener):
2655         * dom/MutationObserver.cpp:
2656         (WebCore::MutationObserver::observe):
2657         * editing/cocoa/FontAttributeChangesCocoa.mm:
2658         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
2659         * fileapi/File.cpp:
2660         (WebCore::File::File):
2661         * html/DOMTokenList.cpp:
2662         (WebCore::DOMTokenList::toggle):
2663         * html/HTMLOListElement.h:
2664         * html/ImageBitmap.cpp:
2665         (WebCore::croppedSourceRectangleWithFormatting):
2666         * html/canvas/CanvasPattern.cpp:
2667         (WebCore::CanvasPattern::setTransform):
2668         * html/canvas/CanvasRenderingContext2DBase.cpp:
2669         (WebCore::CanvasRenderingContext2DBase::setTransform):
2670         (WebCore::CanvasRenderingContext2DBase::isPointInPathInternal):
2671         (WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
2672         * html/canvas/Path2D.cpp:
2673         (WebCore::Path2D::addPath):
2674         * inspector/InspectorCanvas.cpp:
2675         (WebCore::InspectorCanvas::buildAction):
2676         * inspector/InspectorFrontendHost.cpp:
2677         (WebCore::populateContextMenu):
2678         * layout/FormattingContext.cpp:
2679         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
2680         * layout/FormattingContextGeometry.cpp:
2681         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2682         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2683         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2684         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2685         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2686         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2687         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
2688         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
2689         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
2690         * layout/FormattingContextQuirks.cpp:
2691         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
2692         * layout/MarginTypes.h:
2693         (WebCore::Layout::VerticalMargin::usedValues const):
2694         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2695         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2696         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2697         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
2698         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2699         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
2700         * layout/displaytree/DisplayBox.h:
2701         (WebCore::Display::Box::width const):
2702         (WebCore::Display::Box::height const):
2703         (WebCore::Display::Box::contentBoxTop const):
2704         (WebCore::Display::Box::contentBoxLeft const):
2705         * layout/floats/FloatingContext.cpp:
2706         (WebCore::Layout::Iterator::set):
2707         * layout/inlineformatting/InlineFormattingContext.cpp:
2708         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
2709         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
2710         * loader/FrameLoader.cpp:
2711         (WebCore::FrameLoader::urlSelected):
2712         * loader/NavigationAction.cpp:
2713         * page/FrameView.cpp:
2714         (WebCore::FrameView::setLayoutViewportOverrideRect):
2715         (WebCore::FrameView::documentToAbsoluteScaleFactor const):
2716         (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
2717         * page/Page.cpp:
2718         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
2719         * page/SecurityOriginData.cpp:
2720         (WebCore::SecurityOriginData::databaseIdentifier const):
2721         * page/SecurityOriginData.h:
2722         (WebCore::SecurityOriginDataHash::hash):
2723         * page/SecurityOriginHash.h:
2724         (WebCore::SecurityOriginHash::hash):
2725         * page/ViewportConfiguration.cpp:
2726         (WebCore::ViewportConfiguration::setViewLayoutSize):
2727         * page/WindowFeatures.cpp:
2728         (WebCore::parseDialogFeatures):
2729         * page/animation/AnimationBase.cpp:
2730         (WebCore::AnimationBase::updateStateMachine):
2731         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
2732         (WebCore::AnimationBase::getTimeToNextEvent const):
2733         (WebCore::AnimationBase::freezeAtTime):
2734         (WebCore::AnimationBase::getElapsedTime const):
2735         * page/animation/CSSAnimationController.cpp:
2736         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
2737         * page/cocoa/ResourceUsageThreadCocoa.mm:
2738         (WebCore::ResourceUsageThread::platformThreadBody):
2739         * page/linux/ResourceUsageThreadLinux.cpp:
2740         (WebCore::ResourceUsageThread::platformThreadBody):
2741         * platform/graphics/ComplexTextController.cpp:
2742         (WebCore::ComplexTextController::offsetForPosition):
2743         * platform/graphics/FontCache.h:
2744         (WebCore::FontDescriptionKey::computeHash const):
2745         * platform/graphics/FontCascade.cpp:
2746         (WebCore::FontCascade::drawText const):
2747         (WebCore::FontCascade::drawEmphasisMarks const):
2748         (WebCore::FontCascade::displayListForTextRun const):
2749         (WebCore::FontCascade::adjustSelectionRectForText const):
2750         (WebCore::FontCascade::codePath const):
2751         * platform/graphics/FontSelectionAlgorithm.cpp:
2752         (WebCore::FontSelectionAlgorithm::styleDistance const):
2753         * platform/graphics/FontSelectionAlgorithm.h:
2754         (WebCore::operator<<):
2755         (WebCore::FontSelectionSpecifiedCapabilities::computeWeight const):
2756         (WebCore::FontSelectionSpecifiedCapabilities::computeWidth const):
2757         (WebCore::FontSelectionSpecifiedCapabilities::computeSlope const):
2758         * platform/graphics/ShadowBlur.cpp:
2759         (WebCore::ShadowBlur::calculateLayerBoundingRect):
2760         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2761         (WebCore::WebCoreAVCFResourceLoader::startLoading):
2762         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2763         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2764         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2765         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
2766         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2767         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
2768         * platform/graphics/ca/GraphicsLayerCA.cpp:
2769         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
2770         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2771         (WebCore::preparePlatformFont):
2772         * platform/graphics/filters/FETurbulence.cpp:
2773         (WebCore::FETurbulence::fillRegion const):
2774         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2775         (WebCore::initializeGStreamer):
2776         * platform/graphics/texmap/TextureMapperLayer.cpp:
2777         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
2778         (WebCore::TextureMapperLayer::replicaTransform):
2779         (WebCore::TextureMapperLayer::syncAnimations):
2780         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2781         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
2782         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
2783         * platform/graphics/transforms/TransformState.cpp:
2784         (WebCore::TransformState::mappedPoint const):
2785         (WebCore::TransformState::mapQuad const):
2786         (WebCore::TransformState::flattenWithTransform):
2787         * platform/network/CacheValidation.cpp:
2788         (WebCore::computeCurrentAge):
2789         (WebCore::computeFreshnessLifetimeForHTTPFamily):
2790         * platform/network/NetworkStateNotifier.cpp:
2791         (WebCore::NetworkStateNotifier::onLine):
2792         * rendering/FloatingObjects.cpp:
2793         (WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom const):
2794         (WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom const):
2795         * rendering/GridBaselineAlignment.cpp:
2796         (WebCore::GridBaselineAlignment::ascentForChild const):
2797         * rendering/GridTrackSizingAlgorithm.cpp:
2798         (WebCore::GridTrack::setGrowthLimit):
2799         (WebCore::GridTrackSizingAlgorithm::initialBaseSize const):
2800         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit const):
2801         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
2802         (WebCore::sortByGridTrackGrowthPotential):
2803         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
2804         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
2805         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
2806         * rendering/PaintInfo.h:
2807         (WebCore::PaintInfo::applyTransform):
2808         * rendering/RenderBox.cpp:
2809         (WebCore::RenderBox::computeLogicalHeight const):
2810         * rendering/RenderCounter.cpp:
2811         (WebCore::planCounter):
2812         * rendering/RenderDeprecatedFlexibleBox.cpp:
2813         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
2814         * rendering/RenderFlexibleBox.cpp:
2815         (WebCore::RenderFlexibleBox::baselinePosition const):
2816         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
2817         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
2818         * rendering/RenderGrid.cpp:
2819         (WebCore::RenderGrid::gridGap const):
2820         (WebCore::RenderGrid::baselinePosition const):
2821         * rendering/RenderLayer.cpp:
2822         (WebCore::RenderLayer::paintLayerByApplyingTransform):
2823         * rendering/RenderListBox.cpp:
2824         (WebCore::RenderListBox::paintItem):
2825         (WebCore::RenderListBox::listIndexIsVisible):
2826         * rendering/RenderMultiColumnSet.cpp:
2827         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const):
2828         * rendering/RenderTable.cpp:
2829         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
2830         * rendering/RenderTableCell.cpp:
2831         (WebCore::RenderTableCell::cellBaselinePosition const):
2832         * rendering/RenderTableSection.cpp:
2833         (WebCore::RenderTableSection::firstLineBaseline const):
2834         * rendering/RenderText.cpp:
2835         (WebCore::RenderText::computePreferredLogicalWidths):
2836         (WebCore::RenderText::previousOffset const):
2837         (WebCore::RenderText::previousOffsetForBackwardDeletion const):
2838         (WebCore::RenderText::nextOffset const):
2839         (WebCore::RenderText::stringView const):
2840         * rendering/RenderView.cpp:
2841         (WebCore::RenderView::layout):
2842         * rendering/mathml/RenderMathMLBlock.cpp:
2843         (WebCore::RenderMathMLBlock::baselinePosition const):
2844         * rendering/mathml/RenderMathMLBlock.h:
2845         (WebCore::RenderMathMLBlock::ascentForChild):
2846         * rendering/style/GridPosition.cpp:
2847         (WebCore::GridPosition::max):
2848         * rendering/style/TextUnderlineOffset.h:
2849         (WebCore::TextUnderlineOffset::lengthOr const):
2850         * rendering/svg/RenderSVGContainer.cpp:
2851         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
2852         * rendering/svg/RenderSVGForeignObject.cpp:
2853         (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
2854         * rendering/svg/RenderSVGImage.cpp:
2855         (WebCore::RenderSVGImage::nodeAtFloatPoint):
2856         * rendering/svg/RenderSVGResourceClipper.cpp:
2857         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
2858         * rendering/svg/RenderSVGResourceFilter.cpp:
2859         (WebCore::RenderSVGResourceFilter::postApplyResource):
2860         * rendering/svg/RenderSVGRoot.cpp:
2861         (WebCore::RenderSVGRoot::nodeAtPoint):
2862         * rendering/svg/RenderSVGShape.cpp:
2863         (WebCore::RenderSVGShape::nodeAtFloatPoint):
2864         * rendering/svg/RenderSVGText.cpp:
2865         (WebCore::RenderSVGText::nodeAtFloatPoint):
2866         * rendering/svg/SVGRenderingContext.cpp:
2867         (WebCore::SVGRenderingContext::clipToImageBuffer):
2868         * svg/SVGToOTFFontConversion.cpp:
2869         (WebCore::SVGToOTFFontConverter::processGlyphElement):
2870         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2871
2872 2018-12-20  Jer Noble  <jer.noble@apple.com>
2873
2874         REGRESSION (r239419): heap-use-after-free in AudioSourceProviderAVFObjC::finalizeCallback()
2875         https://bugs.webkit.org/show_bug.cgi?id=192941
2876         <rdar://problem/46874096>
2877
2878         Reviewed by Brent Fulgham.
2879
2880         Don't delete the locked lock before unlocking the lock. 
2881
2882         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2883         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
2884
2885 2018-12-20  Keith Rollin  <krollin@apple.com>
2886
2887         Improve release-level page-load logging
2888         https://bugs.webkit.org/show_bug.cgi?id=192872
2889         <rdar://problem/46850309>
2890
2891         Reviewed by Chris Dumez.
2892
2893         There are a number of reported bugs that are difficult or impossible
2894         to track down with our current level of logging. Additionally, some
2895         software groups lower in the page-loading stack have requested logging
2896         sufficient for tracking a user-visible error message down to the
2897         requested resource that caused the message. Add more-comprehensive
2898         logging to address these issues/requests.
2899
2900         No new tests -- no changed functionality.
2901
2902         * loader/DocumentLoader.cpp:
2903         (WebCore::DocumentLoader::setMainDocumentError):
2904         (WebCore::DocumentLoader::mainReceivedError):
2905         (WebCore::DocumentLoader::stopLoading):
2906         (WebCore::DocumentLoader::notifyFinished):
2907         (WebCore::DocumentLoader::willSendRequest):
2908         (WebCore::DocumentLoader::continueAfterContentPolicy):
2909         (WebCore::DocumentLoader::startLoadingMainResource):
2910         (WebCore::DocumentLoader::loadMainResource):
2911         (WebCore::DocumentLoader::cancelMainResourceLoad):
2912         * loader/FrameLoader.cpp:
2913         (WebCore::FrameLoader::urlSelected):
2914         (WebCore::FrameLoader::loadURLIntoChildFrame):
2915         (WebCore::FrameLoader::loadArchive):
2916         (WebCore::FrameLoader::loadInSameDocument):
2917         (WebCore::FrameLoader::loadFrameRequest):
2918         (WebCore::FrameLoader::loadURL):
2919         (WebCore::FrameLoader::load):
2920         (WebCore::FrameLoader::loadWithNavigationAction):
2921         (WebCore::FrameLoader::loadWithDocumentLoader):
2922         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2923         (WebCore::FrameLoader::reload):
2924         (WebCore::FrameLoader::setState):
2925         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2926         (WebCore::FrameLoader::loadPostRequest):
2927         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2928         (WebCore::FrameLoader::loadDifferentDocumentItem):
2929         * loader/ProgressTracker.cpp:
2930         (WebCore::ProgressItem::ProgressItem):
2931         (WebCore::ProgressTracker::reset):
2932         (WebCore::ProgressTracker::progressStarted):
2933         (WebCore::ProgressTracker::progressCompleted):
2934         (WebCore::ProgressTracker::finalProgressComplete):
2935         (WebCore::ProgressTracker::incrementProgress):
2936         (WebCore::ProgressTracker::completeProgress):
2937         (WebCore::ProgressTracker::isAlwaysOnLoggingAllowed const):
2938         * loader/ProgressTracker.h:
2939         * loader/ResourceLoader.cpp:
2940         (WebCore::ResourceLoader::loadDataURL):
2941         (WebCore::ResourceLoader::willSendRequestInternal):
2942         (WebCore::ResourceLoader::didFinishLoading):
2943         (WebCore::ResourceLoader::didFail):
2944         (WebCore::ResourceLoader::willSendRequestAsync):
2945         (WebCore::ResourceLoader::wasBlocked):
2946         (WebCore::ResourceLoader::cannotShowURL):
2947         * loader/SubresourceLoader.cpp:
2948         (WebCore::SubresourceLoader::willSendRequestInternal):
2949         (WebCore::=):
2950         (WebCore::SubresourceLoader::didReceiveResponse):
2951         (WebCore::SubresourceLoader::didFinishLoading):
2952         (WebCore::SubresourceLoader::didFail):
2953         (WebCore::SubresourceLoader::willCancel):
2954         * loader/cache/CachedResource.cpp:
2955         (WebCore::CachedResource::load):
2956
2957 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
2958
2959         Switch tabs before retuning PiP video to inline.
2960         https://bugs.webkit.org/show_bug.cgi?id=192767
2961         rdar://problem/46006046
2962
2963         Reviewed by Jer Noble.
2964
2965         No new tests because this code path only happens with a user action on system UI.
2966
2967         When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting.
2968
2969         * platform/mac/VideoFullscreenInterfaceMac.mm:
2970         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
2971
2972 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2973
2974         Unreviewed, fix GTK build after r239410
2975
2976         It added a new file to the build, breaking the unified sources magic that obscured a bug in
2977         URLSoup.h. It forward-declares URL, but this never worked unless the URL.h header was
2978         included via another source file in the unified source bundle.
2979
2980         * platform/network/soup/URLSoup.h:
2981
2982 2018-12-19  Chris Dumez  <cdumez@apple.com>
2983
2984         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
2985         https://bugs.webkit.org/show_bug.cgi?id=192728
2986         <rdar://problem/46746779>
2987
2988         Reviewed by Geoff Garen.
2989
2990         * Modules/*:
2991         * animation/*:
2992         * bindings/*:
2993         * crypto/*:
2994         * css/*:
2995         * dom/*:
2996         * editing/*:
2997         * fileapi/*:
2998         * html/*:
2999         * inspector/*:
3000         * layout/*:
3001         * loader/*:
3002         * mathml/*:
3003         * page/*:
3004         * platform/*:
3005         * plugins/*:
3006         * rendering/*:
3007         * testing/*:
3008         * workers/*:
3009         * xml/*:
3010
3011 2018-12-19  Jer Noble  <jer.noble@apple.com>
3012
3013         Leak of MTAudioProcessingTap (304 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
3014         https://bugs.webkit.org/show_bug.cgi?id=192896
3015         <rdar://46732186>
3016
3017         Reviewed by Eric Carlson.
3018
3019         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3020         (WebCore::AudioSourceProviderAVFObjC::initCallback):
3021
3022 2018-12-19  Timothy Hatcher  <timothy@apple.com>
3023
3024         REGRESSION (r232991): Switching to dark mode in Mail does not update the message view to be transparent
3025         https://bugs.webkit.org/show_bug.cgi?id=188891
3026         rdar://problem/42344352
3027
3028         Reviewed by Simon Fraser.
3029
3030         * rendering/RenderLayerCompositor.cpp:
3031         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
3032         Don't return early when m_layerForOverhangAreas is null to avoid skipping
3033         setRootLayerConfigurationNeedsUpdate() and scheduleCompositingLayerUpdate().
3034
3035 2018-12-19  Justin Fan  <justin_fan@apple.com>
3036
3037         [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
3038         https://bugs.webkit.org/show_bug.cgi?id=192843
3039         <rdar://problem/46820395>
3040
3041         Reviewed by Myles Maxfield.
3042
3043         Test: webgpu/pipeline-layouts.html
3044
3045         Implement the emtpy WebGPUPipelineLayout interface, and enable creation via WebGPUDevice::createPipelineLayout:
3046         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
3047         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
3048         * Modules/webgpu/WebGPUBindGroupLayout.h:
3049         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const): Added getter.
3050         * Modules/webgpu/WebGPUDevice.cpp:
3051         (WebCore::WebGPUDevice::createPipelineLayout const): Added.
3052         * Modules/webgpu/WebGPUDevice.h:
3053         * Modules/webgpu/WebGPUDevice.idl: Enable createPipelineLayout.
3054         * Modules/webgpu/WebGPUPipelineLayout.cpp: Added.
3055         (WebCore::WebGPUPipelineLayout::create):
3056         (WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout):
3057         * Modules/webgpu/WebGPUPipelineLayout.h: Added.
3058         * Modules/webgpu/WebGPUPipelineLayout.idl: Added.
3059         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Added.
3060         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Added.
3061         * platform/graphics/gpu/GPUDevice.cpp:
3062         (WebCore::GPUDevice::createPipelineLayout const): Added.
3063         * platform/graphics/gpu/GPUDevice.h:
3064         * platform/graphics/gpu/GPUPipelineLayout.cpp: Added.
3065         (WebCore::GPUPipelineLayout::create):
3066         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
3067         * platform/graphics/gpu/GPUPipelineLayout.h: Added.
3068         * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Added.
3069
3070         Add files and symbols to project:
3071         * CMakeLists.txt:
3072         * DerivedSources.make:
3073         * Sources.txt:
3074         * WebCore.xcodeproj/project.pbxproj:
3075         * bindings/js/WebCoreBuiltinNames.h:
3076
3077         Add missing include:
3078         * Modules/webgpu/WebGPUQueue.h:
3079
3080 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
3081
3082         SVGUseElement::findTarget should return nullptr when there is a cycle
3083         https://bugs.webkit.org/show_bug.cgi?id=192840
3084
3085         Reviewed by Tim Horton.
3086
3087         r233366 added an early return to updateShadowTree() when there is a cycle between an use element and its target.
3088         Consolidate this cycle detection code with the one in SVGUseElement::findTarget which detected cycles when
3089         the SVG use element itself had a corresponding element.
3090
3091         No new tests since there should be no behavioral change.
3092
3093         * svg/SVGUseElement.cpp:
3094         (WebCore::SVGUseElement::updateShadowTree):
3095         (WebCore::SVGUseElement::findTarget const):
3096
3097 2018-12-19  Myles C. Maxfield  <mmaxfield@apple.com>
3098
3099         [WHLSL] Add a handwritten lexer
3100         https://bugs.webkit.org/show_bug.cgi?id=192294
3101
3102         Reviewed by Jon Lee.
3103
3104         This is infrastructure necessary for https://bugs.webkit.org/show_bug.cgi?id=192355. The
3105         implementation matches the lexing rules in the spec (specifically, the rules that start
3106         with an uppercase letter). The spec is at
3107         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4.
3108
3109         This patch also modifies the lexer according to https://github.com/gpuweb/WHLSL/pull/283.
3110
3111         No new tests because the lexer isn't hooked up yet; there are tests in the parser,
3112         once that gets committed.
3113
3114         * Modules/webgpu/WHLSL/WHLSLLexer.cpp: Added.
3115         (WebCore::WHLSL::Lexer::Token::typeName):
3116         (WebCore::WHLSL::Lexer::recognizeKeyword):
3117         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
3118         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
3119         (WebCore::WHLSL::isWhitespace):
3120         (WebCore::WHLSL::isNewline):
3121         (WebCore::WHLSL::Lexer::skipWhitespace):
3122         (WebCore::WHLSL::Lexer::skipLineComment):
3123         (WebCore::WHLSL::Lexer::skipLongComment):
3124         (WebCore::WHLSL::Lexer::coreDecimalIntLiteral const):
3125         (WebCore::WHLSL::Lexer::decimalIntLiteral const):
3126         (WebCore::WHLSL::Lexer::decimalUintLiteral const):
3127         (WebCore::WHLSL::isHexadecimalCharacter):
3128         (WebCore::WHLSL::Lexer::coreHexadecimalIntLiteral const):
3129         (WebCore::WHLSL::Lexer::hexadecimalIntLiteral const):
3130         (WebCore::WHLSL::Lexer::hexadecimalUintLiteral const):
3131         (WebCore::WHLSL::Lexer::intLiteral const):
3132         (WebCore::WHLSL::Lexer::uintLiteral const):
3133         (WebCore::WHLSL::Lexer::digit const):
3134         (WebCore::WHLSL::Lexer::digitStar const):
3135         (WebCore::WHLSL::Lexer::character const):
3136         (WebCore::WHLSL::Lexer::coreFloatLiteralType1 const):
3137         (WebCore::WHLSL::Lexer::coreFloatLiteral const):
3138         (WebCore::WHLSL::Lexer::floatLiteral const):
3139         (WebCore::WHLSL::Lexer::validIdentifier const):
3140         (WebCore::WHLSL::Lexer::identifier const):
3141         (WebCore::WHLSL::Lexer::operatorName const):
3142         * Modules/webgpu/WHLSL/WHLSLLexer.h: Added.
3143         (WebCore::WHLSL::Lexer::Lexer):
3144         (WebCore::WHLSL::Lexer::consumeToken):
3145         (WebCore::WHLSL::Lexer::unconsumeToken):
3146         (WebCore::WHLSL::Lexer::state const):
3147         (WebCore::WHLSL::Lexer::setState):
3148         (WebCore::WHLSL::Lexer::isFullyConsumed const):
3149         (WebCore::WHLSL::Lexer::errorString):
3150         (WebCore::WHLSL::Lexer::string const):
3151         (WebCore::WHLSL::Lexer::anyCharacter const):
3152         * Sources.txt:
3153         * WebCore.xcodeproj/project.pbxproj:
3154
3155 2018-12-18  Simon Fraser  <simon.fraser@apple.com>
3156
3157         Web Inspector: Timelines: correctly label Intersection Observer callbacks
3158         https://bugs.webkit.org/show_bug.cgi?id=192669
3159         <rdar://problem/46702490>
3160
3161         Reviewed by Joseph Pecoraro.
3162
3163         Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls
3164         to Intersection Observer, Performance Observer and Mutation Observer callbacks so 
3165         that they get correctly labeled in the Inspector timeline.
3166
3167         * dom/MutationObserver.cpp:
3168         (WebCore::MutationObserver::deliver):
3169         * en.lproj/Localizable.strings:
3170         * inspector/InspectorInstrumentation.cpp:
3171         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
3172         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
3173         * inspector/InspectorInstrumentation.h:
3174         (WebCore::InspectorInstrumentation::willFireObserverCallback):
3175         (WebCore::InspectorInstrumentation::didFireObserverCallback):
3176         * inspector/TimelineRecordFactory.cpp:
3177         (WebCore::TimelineRecordFactory::createObserverCallbackData):
3178         * inspector/TimelineRecordFactory.h:
3179         * inspector/agents/InspectorTimelineAgent.cpp:
3180         (WebCore::InspectorTimelineAgent::willFireObserverCallback):
3181         (WebCore::InspectorTimelineAgent::didFireObserverCallback):
3182         (WebCore::toProtocol):
3183         * inspector/agents/InspectorTimelineAgent.h:
3184         * page/IntersectionObserver.cpp:
3185         (WebCore::IntersectionObserver::notify):
3186         * page/PerformanceObserver.cpp:
3187         (WebCore::PerformanceObserver::deliver):
3188
3189 2018-12-19  Claudio Saavedra  <csaavedra@igalia.com>
3190
3191         ContentExtensions: DFANode.cpp:66:44: error: narrowing conversion of '-1' from 'int' to 'char' inside { }
3192         https://bugs.webkit.org/show_bug.cgi?id=192854
3193
3194         Reviewed by Alex Christensen.
3195
3196         * contentextensions/DFANode.h: Define CharRange's chars as signed
3197
3198 2018-12-19  Youenn Fablet  <youenn@apple.com>
3199
3200         Remove RTCRtpTransceiver.setDirection
3201         https://bugs.webkit.org/show_bug.cgi?id=192869
3202
3203         Reviewed by Alex Christensen.
3204
3205         Covered by rebased test.
3206
3207         * Modules/mediastream/RTCRtpTransceiver.idl:
3208
3209 2018-12-19  Jer Noble  <jer.noble@apple.com>
3210
3211         Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync()
3212         https://bugs.webkit.org/show_bug.cgi?id=192856
3213         <rdar://problem/46843245>
3214
3215         Reviewed by Alex Christensen.
3216
3217         Some decoders exposed through VideoToolbox will decode asynchronously even when 
3218         kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore.
3219
3220         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
3221         (WebCore::WebCoreDecompressionSession::decodeSampleSync):
3222
3223 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
3224
3225         Allow clients to set the navigator platform
3226         https://bugs.webkit.org/show_bug.cgi?id=192735
3227
3228         Reviewed by Tim Horton.
3229
3230         Expanded TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm.
3231
3232         Lots of piping to allow the setting of a custom navigator platform.
3233
3234         * loader/DocumentLoader.h:
3235         (WebCore::DocumentLoader::setCustomNavigatorPlatform):
3236         (WebCore::DocumentLoader::customNavigatorPlatform const):
3237         * loader/FrameLoader.cpp:
3238         (WebCore::FrameLoader::navigatorPlatform const):
3239         * loader/FrameLoader.h:
3240         * page/Navigator.cpp:
3241         (WebCore::Navigator::platform const):
3242         * page/Navigator.h:
3243         * page/NavigatorBase.cpp:
3244         (WebCore::NavigatorBase::platform const):
3245         (WebCore::NavigatorBase::platform): Deleted.
3246         * page/NavigatorBase.h:
3247
3248 2018-12-19  Ryan Haddad  <ryanhaddad@apple.com>
3249
3250         Unreviewed, rolling out r239347.
3251
3252         Caused the leaks bot to hit an exception and the new test
3253         crashes on certain configurations.
3254
3255         Reverted changeset:
3256
3257         "Synchronous media query evaluation could destroy current
3258         Frame/FrameView."
3259         https://bugs.webkit.org/show_bug.cgi?id=192781
3260         https://trac.webkit.org/changeset/239347
3261
3262 2018-12-19  Truitt Savell  <tsavell@apple.com>
3263
3264         Unreviewed, rolling out r239358.
3265
3266         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
3267         crash on Debug bots
3268
3269         Reverted changeset:
3270
3271         "Clean up IndexedDB files between tests"
3272         https://bugs.webkit.org/show_bug.cgi?id=192796
3273         https://trac.webkit.org/changeset/239358
3274
3275 2018-12-19  Don Olmstead  <don.olmstead@sony.com>
3276
3277         Sync some include directories in WebCore
3278         https://bugs.webkit.org/show_bug.cgi?id=192819
3279
3280         Reviewed by Michael Catanzaro.
3281
3282         Added missing include directories around features that have only been enabled on
3283         Apple ports. Removes obsolete directories from list and moves harfbuzz directories
3284         into the freetype cmake file.
3285
3286         * CMakeLists.txt:
3287         * platform/FreeType.cmake:
3288
3289 2018-12-19  Alicia Boya García  <aboya@igalia.com>
3290
3291         [MSE] Remove unused method: stopAskingForMoreSamples()
3292         https://bugs.webkit.org/show_bug.cgi?id=192754
3293
3294         Reviewed by Xabier Rodriguez-Calvar.
3295
3296         The stopAskingForMoreSamples() method from SourceBufferPrivate is not
3297         being used by anyone. SourceBuffer is not calling it and no
3298         SourceBufferPrivate is implementing it. Let's remove that noise.
3299
3300         * platform/graphics/SourceBufferPrivate.h:
3301         (WebCore::SourceBufferPrivate::setActive):
3302         (WebCore::SourceBufferPrivate::stopAskingForMoreSamples): Deleted.
3303         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
3304         (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Deleted.
3305         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
3306
3307 2018-12-19  Alicia Boya García  <aboya@igalia.com>
3308
3309         [MSE] Remove dead code: sourceBufferPrivateSeekToTime()
3310         https://bugs.webkit.org/show_bug.cgi?id=192827
3311
3312         Reviewed by Xabier Rodriguez-Calvar.
3313
3314         This patch makes two dead code removal changes in
3315         SourceBufferPrivateClient:
3316
3317         First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
3318         virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
3319         is only inherited by SourceBuffer, it makes no sense to have default
3320         implementations there (they will never be used), moreso it being a
3321         client interface.
3322
3323         Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
3324         to had an empty implementation, which SourceBuffer did not overwrite,
3325         therefore making any calls to it useless.
3326
3327         All calls to sourceBufferPrivateSeekToTime() have been removed:
3328
3329         SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
3330         itself, used to call this method. This patch deletes it completely.
3331
3332         MockSourceBufferPrivate::seekToTime(), which only called this empty
3333         method, has also been removed along with its only usage in
3334         MockMediaSourcePrivate::seekToTime().
3335
3336         * platform/graphics/SourceBufferPrivateClient.h:
3337         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
3338         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
3339         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3340         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3341         (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
3342         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
3343         (WebCore::MockMediaSourcePrivate::seekToTime):
3344         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
3345         (WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
3346         * platform/mock/mediasource/MockSourceBufferPrivate.h:
3347
3348 2018-12-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3349
3350         [EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional
3351         https://bugs.webkit.org/show_bug.cgi?id=192815
3352
3353         Reviewed by Jer Noble.
3354
3355         https://www.w3.org/TR/encrypted-media/#dom-mediakeysystemconfiguration
3356         says that distinctiveIdentifier and persistentState default to
3357         optional. Our implementation does not define a default leaving it
3358         to the first option of the enum, which currently is Required.
3359
3360         * platform/encryptedmedia/CDMKeySystemConfiguration.h:
3361
3362 2018-12-19  Rob Buis  <rbuis@igalia.com>
3363
3364         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
3365         https://bugs.webkit.org/show_bug.cgi?id=192288
3366
3367         Reviewed by Frédéric Wang.
3368
3369         Prefer return value to out parameter for parseAccessControlAllowList.
3370
3371         * loader/CrossOriginPreflightResultCache.cpp:
3372         (WebCore::CrossOriginPreflightResultCacheItem::parse):
3373         * platform/network/HTTPParsers.h:
3374         (WebCore::parseAccessControlAllowList):
3375         * platform/network/ResourceResponseBase.cpp:
3376         (WebCore::ResourceResponseBase::filter):
3377         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
3378
3379 2018-12-18  Zan Dobersek  <zdobersek@igalia.com>
3380
3381         REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab
3382         https://bugs.webkit.org/show_bug.cgi?id=192230
3383
3384         Reviewed by Carlos Garcia Campos.
3385
3386         Single tile can after r235165 be assigned multiple content updates
3387         without a commit occurring between each update, whereas before these
3388         commits were done for each update.
3389
3390         To avoid repeating updates for a single tile purging information about
3391         the previous update, these updates are now accumulated inside a Vector
3392         and then iterated over during the commit phase.
3393
3394         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
3395         (WebCore::CoordinatedBackingStoreTile::addUpdate):
3396         (WebCore::CoordinatedBackingStoreTile::swapBuffers):
3397         (WebCore::CoordinatedBackingStore::updateTile):
3398         (WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted.
3399         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
3400         (WebCore::CoordinatedBackingStoreTile::scale const):
3401
3402 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3403
3404         [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
3405         https://bugs.webkit.org/show_bug.cgi?id=192842
3406         <rdar://problem/46823586>
3407
3408         Reviewed by Tim Horton.
3409
3410         Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
3411         registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
3412         inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
3413         this is internally tracked in <rdar://problem/46830277>.
3414
3415         * platform/ios/PlatformPasteboardIOS.mm:
3416         (WebCore::PlatformPasteboard::write):
3417
3418 2018-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
3419
3420         Unreviewed, add a missing UNUSED_PARAM()
3421
3422         * Modules/mediarecorder/MediaRecorder.cpp:
3423         (WebCore::MediaRecorder::getPrivateImpl):
3424
3425 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
3426
3427         Update CSS Properties and Values API to use new cycle fallback behaviour
3428         https://bugs.webkit.org/show_bug.cgi?id=192800
3429
3430         Reviewed by Antti Koivisto.
3431
3432         Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the
3433         wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. 
3434
3435         * css/CSSCustomPropertyValue.h:
3436         * css/CSSVariableReferenceValue.cpp:
3437         (WebCore::resolveVariableReference):
3438         * css/DOMCSSRegisterCustomProperty.cpp:
3439         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
3440         * css/StyleResolver.cpp:
3441         (WebCore::StyleResolver::applyCascadedCustomProperty):
3442         * css/parser/CSSPropertyParser.cpp:
3443         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
3444
3445 2018-12-18  Daniel Bates  <dabates@apple.com>
3446
3447         Wrong value for key property in keydown and keyup events generated holding Control key
3448         https://bugs.webkit.org/show_bug.cgi?id=192788
3449         <rdar://problem/46795214>
3450
3451         Reviewed by Wenson Hsieh.
3452
3453         Similar to what we do on Mac, compute the DOM key property from the characters ignoring
3454         modifier keys input string when the Control key is held down.
3455
3456         * platform/ios/PlatformEventFactoryIOS.mm:
3457         (WebCore::keyForKeyEvent):
3458         * platform/mac/PlatformEventFactoryMac.mm:
3459         (WebCore::keyForKeyEvent):
3460
3461 2018-12-18  Sihui Liu  <sihui_liu@apple.com>
3462
3463         Clean up IndexedDB files between tests
3464         https://bugs.webkit.org/show_bug.cgi?id=192796
3465
3466         Reviewed by Geoffrey Garen.
3467
3468         We should clean up the IndexedDB files between tests to make sure each test is independent of others.
3469
3470         This patch also fixes some issues in IDB.
3471
3472         Covered by existing tests.
3473
3474         * Modules/indexeddb/server/IDBServer.cpp:
3475         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
3476         We should shut down all open databases instead of databases from open database connections before deleting 
3477         files, because database starts accessing files before connection to database is established.
3478
3479         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3480         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
3481         We should shutdown database after tasks in queue are completed, because tasks have pointer of UniqueIDBDatabase 
3482         and UniqueIDBDatabase can be destructed after shutdown.
3483
3484         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
3485         didDeleteBackingStore can be posted to main thread after immediateCloseForUserDelete, and timer should not be 
3486         invoked during the hard close.
3487
3488         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
3489         Tasks like didOpenBackingStore could be posted from database thread to main thread after 
3490         immediateCloseForUserDelete, but we know the backing store will be deleted soon, so no need to handle any 
3491         database operation. 
3492
3493         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
3494         performPrefetchCursor needs to be aware of whether UniqueIDBDatabase is being closed, so that it will not access 
3495         m_backingStore when m_backingStore may already be deleted. 
3496
3497         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
3498         immediateCloseForUserDelete does not handle transactions that are in the process of commit or abort. 
3499         m_objectStoreTransactionCounts and m_objectStoreWriteTransactions may be used by those transactions in 
3500         transactionCompleted, so they do not need to be cleared here.
3501
3502 2018-12-18  Myles C. Maxfield  <mmaxfield@apple.com>
3503
3504         Thick overlines and line-throughs grow in the wrong direction
3505         https://bugs.webkit.org/show_bug.cgi?id=192264
3506
3507         Reviewed by Dean Jackson.
3508
3509         Overlines should grow upward, and line-throughs should stay centered.
3510
3511         Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
3512
3513         * rendering/TextDecorationPainter.cpp:
3514         (WebCore::TextDecorationPainter::paintTextDecoration):
3515         * style/InlineTextBoxStyle.cpp:
3516         (WebCore::visualOverflowForDecorations):
3517
3518 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
3519
3520         Some iOS app crash in FrameLoader::checkCompleted
3521         https://bugs.webkit.org/show_bug.cgi?id=192804
3522         <rdar://problem/44240573>
3523
3524         Reviewed by Tim Horton.
3525
3526         It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
3527         is trying to send a delegate message. Disable the release assertion while this is happening
3528         so that iOS app would not crash.
3529
3530         Unfortunately no new test as there is no way to easily test UIWebView in iOS,
3531         and this requires a race between the web thread & the main thread.
3532
3533         * dom/ScriptDisallowedScope.h:
3534         (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
3535         * platform/ios/wak/WebCoreThread.h:
3536         * platform/ios/wak/WebCoreThread.mm:
3537         (WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
3538         (WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
3539         (SendDelegateMessage):
3540
3541 2018-12-18  David Kilzer  <ddkilzer@apple.com>
3542
3543         clang-tidy: Use const reference for MediaTime parameter to prevent object copy
3544         <https://webkit.org/b/192814>
3545
3546         Reviewed by Mark Lam.
3547
3548         * bindings/js/JSDOMConvertNumbers.h:
3549         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
3550
3551 2018-12-18  Justin Fan  <justin_fan@apple.com>
3552
3553         [WebGPU] BindGroupLayout and Device::createBindGroupLayout
3554         https://bugs.webkit.org/show_bug.cgi?id=192817
3555
3556         Reviewed by Dean Jackson.
3557
3558         Update bind-group-layouts to test new functionality.
3559
3560         Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
3561         * Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
3562         (WebCore::WebGPUBindGroupLayout::create):
3563         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
3564         * Modules/webgpu/WebGPUBindGroupLayout.h: Added.
3565         * Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
3566         * Modules/webgpu/WebGPUDevice.cpp:
3567         (WebCore::WebGPUDevice::createBindGroupLayout const): Added.
3568         * Modules/webgpu/WebGPUDevice.h:
3569         * Modules/webgpu/WebGPUDevice.idl:
3570         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
3571         (WebCore::GPUBindGroupLayout::tryCreate):
3572         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
3573         * platform/graphics/gpu/GPUBindGroupLayout.h: Added.
3574         * platform/graphics/gpu/GPUDevice.cpp:
3575         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
3576         * platform/graphics/gpu/GPUDevice.h:
3577
3578         Add files and symbols to project:
3579         * CMakeLists.txt:
3580         * DerivedSources.make:
3581         * Sources.txt:
3582         * WebCore.xcodeproj/project.pbxproj:
3583         * bindings/js/WebCoreBuiltinNames.h:
3584
3585         Missing includes that were previously provided via UnifiedSources:
3586         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
3587         * platform/sql/SQLiteFileSystem.h:
3588
3589 2018-12-18  Youenn Fablet  <youenn@apple.com>
3590
3591         Make ReadableStreamXX constructs use PrivateIdentifier
3592         https://bugs.webkit.org/show_bug.cgi?id=192771
3593
3594         Reviewed by Chris Dumez.
3595
3596         PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
3597         Covered by existing binding tests.
3598
3599         * Modules/streams/ReadableByteStreamController.idl:
3600         * Modules/streams/ReadableStreamBYOBReader.idl:
3601         * Modules/streams/ReadableStreamBYOBRequest.idl:
3602         * Modules/streams/ReadableStreamDefaultController.idl:
3603         * Modules/streams/ReadableStreamDefaultReader.idl:
3604         * bindings/scripts/CodeGeneratorJS.pm:
3605         (NeedsConstructorProperty):
3606         * bindings/scripts/preprocess-idls.pl:
3607         (shouldExposeInterface):
3608         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
3609         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
3610         * bindings/scripts/test/TestCustomConstructor.idl: Removed.
3611
3612 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3613
3614         Synchronous media query evaluation could destroy current Frame/FrameView.
3615         https://bugs.webkit.org/show_bug.cgi?id=192781
3616         <rdar://problem/34416793>
3617
3618         Reviewed by Chris Dumez.
3619
3620         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
3621
3622         Test: printing/print-with-media-query-destory.html
3623
3624         * loader/DocumentLoader.cpp:
3625         (WebCore::DocumentLoader::finishedLoading):
3626         * page/Frame.cpp:
3627         (WebCore::Frame::setPrinting):
3628         * page/FrameView.cpp:
3629         (WebCore::FrameView::forceLayoutForPagination):
3630
3631 2018-12-18  Joseph Pecoraro  <pecoraro@apple.com>
3632
3633         Web Inspector: m3u8 content not shown, it should be text
3634         https://bugs.webkit.org/show_bug.cgi?id=192731
3635         <rdar://problem/46747728>
3636
3637         Reviewed by Devin Rousso.
3638
3639         * inspector/NetworkResourcesData.cpp:
3640         (WebCore::NetworkResourcesData::setResourceContent):
3641         Don't clobber data if setting empty content on a resource that has content.
3642
3643         * inspector/agents/InspectorNetworkAgent.cpp:
3644         (WebCore::InspectorNetworkAgent::shouldTreatAsText):
3645         Additional non-"text/" mime types that can be treated as text.
3646
3647         * platform/MIMETypeRegistry.cpp:
3648         (WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
3649         * platform/MIMETypeRegistry.h:
3650         Detect media playlist mime types that are text (m3u8/m3u).
3651
3652 2018-12-18  Daniel Bates  <dabates@apple.com>
3653
3654         Remove <meta http-equiv=set-cookie> support
3655         https://bugs.webkit.org/show_bug.cgi?id=185077
3656         <rdar://problem/41791397>
3657
3658         Reviewed by Brent Fulgham.
3659
3660         Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
3661         the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
3662         removed support for this pragma and Firefox has an open bug to remove it.
3663
3664         * dom/Document.cpp:
3665         (WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
3666         was ignored instead of setting the cookie.
3667         * html/parser/XSSAuditor.cpp:
3668         (WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
3669         as dangerous and erase attribute http-equiv when we find it because we no longer honor
3670         this pragma.
3671
3672 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
3673
3674         CSS Typed OM should expose attributeStyleMap
3675         https://bugs.webkit.org/show_bug.cgi?id=192671
3676
3677         Reviewed by Ryosuke Niwa.
3678
3679         Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
3680         TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.
3681
3682         Test: css-typedom/attributeStyleMap.html
3683
3684         * CMakeLists.txt:
3685         * DerivedSources.make:
3686         * Sources.txt:
3687         * WebCore.xcodeproj/project.pbxproj:
3688         * bindings/js/WebCoreBuiltinNames.h:
3689         * css/ElementCSSInlineStyle.idl:
3690         * css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
3691         * css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
3692         * css/typedom/StylePropertyMapReadOnly.cpp: Added.
3693         (WebCore::StylePropertyMapReadOnly::reifyValue):
3694         (WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
3695         * css/typedom/StylePropertyMapReadOnly.h:
3696         (WebCore::StylePropertyMapReadOnly::create): Deleted.
3697         (WebCore::StylePropertyMapReadOnly::get const): Deleted.
3698         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
3699         * css/typedom/StylePropertyMapReadOnly.idl:
3700         * css/typedom/TypedOMCSSImageValue.h:
3701         * dom/Element.cpp:
3702         (WebCore::Element::attributeStyleMap):
3703         (WebCore::Element::setAttributeStyleMap):
3704         * dom/Element.h:
3705         * dom/ElementRareData.cpp:
3706         * dom/ElementRareData.h:
3707         (WebCore::ElementRareData::attributeStyleMap):
3708         (WebCore::ElementRareData::setAttributeStyleMap):
3709         * dom/StyledElement.cpp:
3710         (WebCore::StyledElement::ensureAttributeStyleMap):
3711         * dom/StyledElement.h:
3712         * html/canvas/CanvasRenderingContext2DBase.cpp:
3713         (WebCore::size):
3714         (WebCore::CanvasRenderingContext2DBase::drawImage):
3715         * platform/graphics/CustomPaintImage.cpp:
3716         (WebCore::extractComputedProperty):
3717         (WebCore::CustomPaintImage::doCustomPaint):
3718
3719 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3720
3721         Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
3722         https://bugs.webkit.org/show_bug.cgi?id=192785
3723         <rdar://problem/45321184>
3724
3725         Reviewed by Tim Horton.
3726
3727         Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
3728         currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
3729         need to know when the user is typing in a text form control, but the page is preventing default text insertion
3730         behavior and instead updating values programmatically.
3731
3732         Test: fast/forms/call-text-did-change-in-text-field-when-typing.html
3733
3734         * html/TextFieldInputType.cpp:
3735         (WebCore::TextFieldInputType::setValue):
3736
3737 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3738
3739         [LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
3740         https://bugs.webkit.org/show_bug.cgi?id=192801
3741
3742         Reviewed by Antti Koivisto.
3743
3744         * layout/blockformatting/BlockFormattingContext.h:
3745         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3746         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3747         * layout/blockformatting/BlockMarginCollapse.cpp:
3748         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
3749
3750 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3751
3752         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
3753         https://bugs.webkit.org/show_bug.cgi?id=192799
3754
3755         Reviewed by Antti Koivisto.
3756
3757         * layout/blockformatting/BlockFormattingContext.h:
3758         * layout/blockformatting/BlockMarginCollapse.cpp:
3759         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
3760         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
3761
3762 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3763
3764         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
3765         https://bugs.webkit.org/show_bug.cgi?id=192798
3766
3767         Reviewed by Antti Koivisto.
3768
3769         * layout/blockformatting/BlockFormattingContext.h:
3770         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3771         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3772         * layout/blockformatting/BlockMarginCollapse.cpp:
3773         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
3774         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
3775         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
3776         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
3777
3778 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3779
3780         [LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
3781         https://bugs.webkit.org/show_bug.cgi?id=192794
3782
3783         Reviewed by Antti Koivisto.
3784
3785         * layout/blockformatting/BlockFormattingContext.h:
3786         * layout/blockformatting/BlockMarginCollapse.cpp:
3787         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
3788         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
3789         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
3790
3791 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3792
3793         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
3794         https://bugs.webkit.org/show_bug.cgi?id=192791
3795
3796         Reviewed by Antti Koivisto.
3797
3798         * layout/blockformatting/BlockMarginCollapse.cpp:
3799         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
3800         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
3801
3802 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3803
3804         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
3805         https://bugs.webkit.org/show_bug.cgi?id=192787
3806
3807         Reviewed by Antti Koivisto.
3808
3809         * layout/blockformatting/BlockFormattingContext.h:
3810         * layout/blockformatting/BlockMarginCollapse.cpp:
3811         (WebCore::Layout::hasClearance):
3812         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
3813         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
3814         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
3815         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
3816
3817 2018-12-17  Fujii Hironori  <Hironori.Fujii@sony.com>
3818
3819         [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
3820         https://bugs.webkit.org/show_bug.cgi?id=192752
3821
3822         Reviewed by Don Olmstead.
3823
3824         No new tests, no behavior changes.
3825
3826         * platform/graphics/win/DIBPixelData.cpp:
3827         Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
3828         * platform/graphics/win/FontPlatformDataWin.cpp:
3829         (WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
3830         * platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
3831         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3832         Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
3833         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
3834         Reorder the initializer list.
3835         (WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
3836         (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
3837         (WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
3838         (WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
3839         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
3840         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
3841         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
3842         (WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
3843         * platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
3844         (WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
3845         (WebCore::Font::boundsForGDIGlyph const): Ditto.
3846         (WebCore::Font::widthForGDIGlyph const): Ditto.
3847         * platform/graphics/win/UniscribeController.cpp:
3848         (WebCore::UniscribeController::UniscribeController):
3849         Reorder the initializer list.
3850         (WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
3851         (WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.
3852
3853 2018-12-17  Eric Carlson  <eric.carlson@apple.com>
3854
3855         [MediaStream] A stream's first video frame should be rendered
3856         https://bugs.webkit.org/show_bug.cgi?id=192629
3857         <rdar://problem/46664353>
3858
3859         Reviewed by Youenn Fablet.
3860
3861         Test: fast/mediastream/media-stream-renders-first-frame.html
3862
3863         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3864         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3865         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
3866         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
3867         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
3868         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
3869         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
3870         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
3871         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
3872         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
3873         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
3874         * platform/mediastream/RealtimeMediaSource.cpp:
3875         (WebCore::RealtimeMediaSource::size const):
3876         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3877         (WebCore::AVVideoCaptureSource::processNewFrame):
3878         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
3879         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
3880
3881 2018-12-17  Justin Michaud  <justin_michaud@apple.com>
3882
3883         Bindings generator should support Conditional= along with CachedAttribute
3884         https://bugs.webkit.org/show_bug.cgi?id=192721
3885
3886         Reviewed by Ryosuke Niwa.
3887
3888         Fix a bug where specifying both attributes causes compilation errors because the compile-time
3889         condition is not included in the derived code.
3890
3891         * bindings/scripts/CodeGeneratorJS.pm:
3892         (GenerateImplementation):
3893         * bindings/scripts/test/JS/JSTestObj.cpp:
3894         (WebCore::jsTestObjCachedAttribute3Getter):
3895         (WebCore::jsTestObjCachedAttribute3):
3896         (WebCore::JSTestObj::visitChildren):
3897         * bindings/scripts/test/JS/JSTestObj.h:
3898         * bindings/scripts/test/TestObj.idl:
3899
3900 2018-12-17  David Kilzer  <ddkilzer@apple.com>
3901
3902         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
3903         <https://webkit.org/b/192707>
3904         <rdar://problem/46734926>
3905
3906         Reviewed by Daniel Bates.
3907
3908         * platform/CPUMonitor.cpp:
3909         (WebCore::CPUMonitor::setCPULimit):
3910         * platform/CPUMonitor.h:
3911         (WebCore::CPUMonitor::setCPULimit):
3912         - Change parameter to const reference to fix unnecessary copies.
3913
3914 2018-12-17  Ryosuke Niwa  <rniwa@webkit.org>
3915
3916         offsetLeft and offsetParent should adjust across shadow boundaries
3917         https://bugs.webkit.org/show_bug.cgi?id=157437
3918         <rdar://problem/26154021>
3919
3920         Reviewed by Simon Fraser.
3921
3922         Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
3923         the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
3924         and https://github.com/w3c/webcomponents/issues/763
3925
3926         The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
3927         In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
3928         the one which is in the same tree as a shadow-inclusive ancestor of the context object.
3929
3930         For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
3931         inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
3932         then its offset parent, etc... until we find the offset parent in the same tree as the context object.
3933
3934         Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
3935         (e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
3936         the same tree as the context object but as well as any offset parent which is in its ancestor trees.
3937
3938         Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html
3939
3940         * dom/Element.cpp:
3941         (WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
3942         (WebCore::collectAncestorTreeScopeAsHashSet): Added.
3943         (WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
3944         which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
3945         (WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
3946         (WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
3947         until it finds the first offset parent which is a shadow-including ancestor.
3948         (WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
3949         (WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
3950         functions meant to be used for bindings code.
3951         * dom/Element.h:
3952         * html/HTMLElement.idl:
3953
3954 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
3955
3956         Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
3957         https://bugs.webkit.org/show_bug.cgi?id=192780
3958         rdar://problem/43394387
3959
3960         Reviewed by Tim Horton.
3961         
3962         macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
3963         memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.
3964         
3965         Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
3966         and consult it when making decisions that affect layer backing store format.
3967
3968         Tested by new results for existing tests.
3969
3970         * platform/graphics/FontCascade.cpp:
3971         (WebCore::FontCascade::isSubpixelAntialiasingAvailable):
3972         * platform/graphics/FontCascade.h:
3973         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3974         (WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
3975         it once.
3976         * rendering/RenderLayerBacking.cpp:
3977         (WebCore::RenderLayerBacking::updateAfterDescendants):