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