15dbb2745e3a02c6180ef85c46403c868e036b6f
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-03-28  Chris Dumez  <cdumez@apple.com>
2
3         Align XMLHttpRequest's open() / send() / abort() with the latest specification
4         https://bugs.webkit.org/show_bug.cgi?id=184108
5
6         Reviewed by Youenn Fablet.
7
8         Align XMLHttpRequest's open() / send() / abort() with the latest specification:
9         - https://xhr.spec.whatwg.org
10
11         No new tests, rebaselined existing layout tests.
12
13         * xml/XMLHttpRequest.cpp:
14         (WebCore::XMLHttpRequest::open):
15         Align with https://xhr.spec.whatwg.org/#the-open()-method:
16         - Change the order of some steps to match the order in the spec. In particular,
17           open() no longer resets the state to UNSENT or abort any existing load when it
18           fails early due to being passed a bad method.
19
20         (WebCore::XMLHttpRequest::createRequest):
21         Align with https://xhr.spec.whatwg.org/#the-send()-method:
22         - Use the simpler "upload listener flag" logic from the spec instead of our more
23           complex m_uploadEventsAllowed flag. This avoids constructing a SecurityOrigin
24           objects on a background thread when XHR is used inside Web Workers, which was
25           not thread-safe.
26         - Set the upload complete flag when the request has no body as per step 9.
27         - After firing the loadstartEvent, return early if the state is no longer OPEN or
28           if the send flag is unset, as per step 11.3.
29
30         (WebCore::XMLHttpRequest::abort):
31         Align with https://xhr.spec.whatwg.org/#the-abort()-method:
32         - Only set the state to UNSENT if the state is still DONE after firing the error
33           events, as per step 3.
34
35         (WebCore::XMLHttpRequest::didSendData):
36         Use new "upload listener flag".
37
38         (WebCore::XMLHttpRequest::dispatchErrorEvents):
39         Align with https://xhr.spec.whatwg.org/#request-error-steps:
40         - Stop firing a progress event in case of error as this is not as per specification
41           and Firefox does not fire those either.
42
43         * xml/XMLHttpRequest.h:
44
45 2018-03-28  Timothy Hatcher  <timothy@apple.com>
46
47         Consolidate NSColor to WebCore::Color conversion and fix system colors.
48
49         https://bugs.webkit.org/show_bug.cgi?id=184096
50         rdar://problem/38918925
51
52         Reviewed by Tim Horton.
53
54         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
55         (CreateCGColorIfDifferent): Use CGColor property on NSColor, don't manually create new CGColor.
56         * platform/graphics/mac/ColorMac.h:
57         * platform/graphics/mac/ColorMac.mm:
58         (WebCore::makeRGBAFromNSColor): Move pattern code from RenderThemeMac's convertNSColorToColor.
59         Also use nextafter for proper RGBA float conversion.
60         * platform/mac/PlatformPasteboardMac.mm:
61         (WebCore::PlatformPasteboard::color): Use colorFromNSColor.
62         * rendering/RenderThemeMac.mm:
63         (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Use colorFromNSColor.
64         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto.
65         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto.
66         (WebCore::RenderThemeMac::systemColor const): Ditto.
67         (WebCore::paintAttachmentTitleBackground): Ditto.
68         (WebCore::convertNSColorToColor): Deleted.
69
70 2018-03-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
71
72         The SVGAnimatedProperty wrappers have to be detached from the referenced values before the SVGAnimatedType is deleted
73         https://bugs.webkit.org/show_bug.cgi?id=183972
74
75         Reviewed by Daniel Bates.
76
77         If the SVGAnimatedType is a list type, e.g. SVGLengthListValues, the wrappers
78         of the animated properties have to be detached from the items in the list
79         before it's deleted.
80
81         * svg/SVGAnimateElementBase.cpp:
82         (WebCore::SVGAnimateElementBase::clearAnimatedType):
83
84 2018-03-28  Ross Kirsling  <ross.kirsling@sony.com>
85
86         MSVC __forceinline slows down JSC release build fivefold after r229391
87         https://bugs.webkit.org/show_bug.cgi?id=184062
88
89         Reviewed by Alex Christensen.
90
91         * platform/graphics/FormatConverter.cpp:
92         Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.
93
94 2018-03-28  Zalan Bujtas  <zalan@apple.com>
95
96         Make it possible to override the screen size
97         https://bugs.webkit.org/show_bug.cgi?id=184111
98         <rdar://problem/38972181>
99
100         Reviewed by Tim Horton.
101
102         We just call screenSize() atm.
103
104         * page/Chrome.cpp:
105         (WebCore::Chrome::overrideScreenSize const):
106         * page/Chrome.h:
107         * page/ChromeClient.h:
108         * platform/HostWindow.h:
109         * platform/PlatformScreen.h:
110         * platform/ios/PlatformScreenIOS.mm:
111         (WebCore::screenRect):
112         (WebCore::overrideScreenSize):
113
114 2018-03-28  Timothy Hatcher  <timothy@apple.com>
115
116         Include the 'text' color keyword as a system color.
117
118         https://bugs.webkit.org/show_bug.cgi?id=184113
119         rdar://problem/38779267
120
121         Reviewed by Tim Horton.
122
123         * css/StyleColor.cpp:
124         (WebCore::StyleColor::isColorKeyword): Don't check CSSValueMenu, it is a system color and is included.
125         (WebCore::StyleColor::isSystemColor): Include CSSValueText. Check CSSValueWebkitFocusRingColor in the range,
126         since it is immediately after CSSValueAppleSystemYellow.
127
128 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
129
130         [iOS] Multiple select appearance doesn't update when selecting or deselecting rows in the picker view
131         https://bugs.webkit.org/show_bug.cgi?id=184110
132         <rdar://problem/38796648>
133
134         Reviewed by Tim Horton.
135
136         HTMLSelectElement::optionSelectedByUser is invoked upon user interaction with a select menu. This currently
137         takes two separate codepaths, depending on whether or not the menu list appearance is being used to render the
138         select. If a menu list appearance is used, we call selectOption(), which updates validity, updates the element
139         renderer, and then dispatches a `change` event if needed.
140
141         However, if updateSelectedState() is used, we only update form validity and then dispatch the `change` event
142         without updating the renderer, leaving it stale.
143
144         Test: fast/forms/ios/ipad/multiple-select-updates-renderer.html
145
146         * html/HTMLSelectElement.cpp:
147         (WebCore::HTMLSelectElement::optionSelectedByUser):
148
149         Update the renderer after updating the DOM to reflect the selected option.
150
151 2018-03-28  Daniel Bates  <dabates@apple.com>
152
153         Substitute "strong password confirmation auto fill" for "strong confirmation password auto fill"
154         <rdar://problem/36518856>
155
156         * English.lproj/Localizable.strings:
157         * platform/LocalizedStrings.cpp:
158         (WebCore::AXAutoFillStrongConfirmationPasswordLabel):
159
160 2018-03-28  Daniel Bates  <dabates@apple.com>
161
162         WebSocket cookie incorrectly stored
163         https://bugs.webkit.org/show_bug.cgi?id=184100
164         <rdar://problem/37928715>
165
166         Reviewed by Brent Fulgham.
167
168         A cookie received in a WebSocket response should be stored with respect to the
169         origin of the WebSocket server in order for it to be sent in a subsequent request.
170
171         Also removed a FIXME about implementing support for the long since
172         deprecated Set-Cookie2 header.
173
174         Test: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html
175
176         * Modules/websockets/WebSocketChannel.cpp:
177         (WebCore::WebSocketChannel::processBuffer):
178         * Modules/websockets/WebSocketHandshake.h:
179
180 2018-03-28  Chris Dumez  <cdumez@apple.com>
181
182         Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
183         https://bugs.webkit.org/show_bug.cgi?id=183962
184         <rdar://problem/38817833>
185
186         Reviewed by Brady Eidson.
187
188         Pass extra bits of information to the UIProcess via NavigationAction:
189         - Is it a cross origin navigation caused by window.open()
190         - Does the navigated frame have an opener
191
192         This information is useful to determine on UIProcess side if we want
193         to swap WebProcess.
194
195         * loader/FrameLoadRequest.h:
196         (WebCore::FrameLoadRequest::setIsCrossOriginWindowOpenNavigation):
197         (WebCore::FrameLoadRequest::isCrossOriginWindowOpenNavigation const):
198         * loader/FrameLoader.cpp:
199         (WebCore::FrameLoader::loadURL):
200         * loader/NavigationAction.h:
201         (WebCore::NavigationAction::setIsCrossOriginWindowOpenNavigation):
202         (WebCore::NavigationAction::isCrossOriginWindowOpenNavigation const):
203         (WebCore::NavigationAction::setOpener):
204         (WebCore::NavigationAction::opener const):
205         * page/DOMWindow.cpp:
206         (WebCore::DOMWindow::createWindow):
207
208 2018-03-28  Chris Dumez  <cdumez@apple.com>
209
210         Thread safety issue in IDBFactory' shouldThrowSecurityException()
211         https://bugs.webkit.org/show_bug.cgi?id=184064
212
213         Reviewed by Ryosuke Niwa.
214
215         shouldThrowSecurityException() gets called on a non-main thread but
216         it ended up using the SchemeRegistry via SecurityOrigin::canAccessDatabase()
217         which calls SecurityOrigin::isLocal().
218
219         Since using the SchemeRegistry from the background thread is not safe
220         (we recently added locks which we're trying to remove), and since SecurityOrigin
221         methods are often called from background threads, this patch make SecurityOrigin::isLocal()
222         safe to call from a background thread. To achieve this, we now query the SchemeRegistry
223         in the SecurityOrigin constructor instead as SecurityOrigin objects are expected to be
224         constructed on the main thread.
225
226         * page/SecurityOrigin.cpp:
227         (WebCore::SecurityOrigin::SecurityOrigin):
228         (WebCore::SecurityOrigin::isLocal const): Deleted.
229         * page/SecurityOrigin.h:
230         (WebCore::SecurityOrigin::isLocal const):
231
232 2018-03-28  Ryan Haddad  <ryanhaddad@apple.com>
233
234         Unreviewed, rolling out r230033.
235
236         The LayoutTests modified in this change fail an assertion on
237         WK1.
238
239         Reverted changeset:
240
241         "[Web Animations] Implement more CSSPropertyBlendingClient
242         methods"
243         https://bugs.webkit.org/show_bug.cgi?id=184077
244         https://trac.webkit.org/changeset/230033
245
246 2018-03-28  Chris Dumez  <cdumez@apple.com>
247
248         WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread
249         https://bugs.webkit.org/show_bug.cgi?id=184068
250
251         Reviewed by Youenn Fablet.
252
253         WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread,
254         which is not safe. We now use SecurityOriginData since we only need an origin String and
255         it is safe to construct a SecurityOriginData on any thread.
256
257         * Modules/websockets/WebSocket.cpp:
258         (WebCore::WebSocket::didReceiveMessage):
259
260 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
261
262         [Extra zoom mode] Make boosted text autosizing values switchable at runtime
263         https://bugs.webkit.org/show_bug.cgi?id=184092
264         <rdar://problem/38939917>
265
266         Reviewed by Tim Horton.
267
268         In r228697, we introduced a new set of boosted text autosizing constants tuned for extra zoom mode, which are
269         currently hard-coded as default values in SettingsBase. However, we've since identified cases where clients may
270         want to opt in or out of boosted text autosizing values and just use the existing values.
271
272         This replaces settings to adjust text autosizing constants with a flag to enable or disable boosted text
273         autosizing; when changed, we update all three text autosizing parameters to their default or boosted values, and
274         then trigger style recalculation.
275
276         Test: TextAutosizingBoost.ChangeAutosizingBoostAtRuntime
277
278         * page/Settings.yaml:
279         * page/SettingsBase.cpp:
280         (WebCore::SettingsBase::shouldEnableTextAutosizingBoostChanged):
281         (WebCore::SettingsBase::defaultOneLineTextMultiplierCoefficient): Deleted.
282         (WebCore::SettingsBase::defaultMultiLineTextMultiplierCoefficient): Deleted.
283         (WebCore::SettingsBase::defaultMaxTextAutosizingScaleIncrease): Deleted.
284
285         Changed these to constant values instead of helper functions, and also introduced boosted text autosizing
286         constants for use in extra zoom mode.
287
288         * page/SettingsBase.h:
289         (WebCore::SettingsBase::oneLineTextMultiplierCoefficient const):
290         (WebCore::SettingsBase::multiLineTextMultiplierCoefficient const):
291         (WebCore::SettingsBase::maxTextAutosizingScaleIncrease const):
292         * rendering/RenderThemeIOS.mm:
293         (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
294
295         Tweak the stylesheet to make `-webkit-text-size-adjust: auto` overridable by web content. Adding the !important
296         is breaking many websites that positioned text such that it is positioned within layout viewport bounds without
297         text autosizing.
298
299 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
300
301         Avoid uninitialized mach ports
302         https://bugs.webkit.org/show_bug.cgi?id=184090
303         <rdar://problem/37261129>
304
305         Reviewed by Chris Dumez.
306
307         It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
308         of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
309         there is a potential for us to try to use invalid ports.
310
311         We should always check return values, and ensure that the mach port variables we seek to initialize are
312         kept in a valid state.
313
314         No new tests, no Web-facing behavior change.
315
316         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
317         (WebCore::attachToAppleGraphicsControl): Initialize masterPort to a default value.
318
319 2018-03-28  Antoine Quint  <graouts@apple.com>
320
321         [Web Animations] Implement more CSSPropertyBlendingClient methods
322         https://bugs.webkit.org/show_bug.cgi?id=184077
323
324         Reviewed by Dean Jackson.
325
326         We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
327         were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
328         the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
329         CSS Transitions as Web Animations feature.
330
331         * animation/KeyframeEffectReadOnly.cpp:
332         (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
333         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
334         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
335         (WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
336         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
337         (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
338         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
339         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
340         * animation/KeyframeEffectReadOnly.h:
341
342 2018-03-28  Antoine Quint  <graouts@apple.com>
343
344         [Web Animations] Comparing two matching FramesTimingFunction objects fails
345         https://bugs.webkit.org/show_bug.cgi?id=184078
346
347         Reviewed by Jon Lee.
348
349         Fix a stupid mistake in the == operator for FramesTimingFunction. Without a correct check, we would mistakenly interrupt and
350         restart any transition with a frames() timing function when we check that the Animation objects are similar.
351
352         * platform/animation/TimingFunction.h:
353
354 2018-03-28  Miguel Gomez  <magomez@igalia.com>
355
356         [GTK][WPE] Remove UpdateAtlas
357         https://bugs.webkit.org/show_bug.cgi?id=184042
358
359         Reviewed by Žan Doberšek.
360
361         Remove UpdateAtlas and AreaAllocator classes. Instead of using UpdateAtlas as a cache
362         of buffers to render tiles with cairo, allocate a new buffer for each tile instead.
363
364         Covered by existent tests.
365
366         * loader/EmptyClients.h:
367         * page/ChromeClient.h:
368         * platform/TextureMapper.cmake:
369         * platform/graphics/texmap/coordinated/AreaAllocator.cpp: Removed.
370         * platform/graphics/texmap/coordinated/AreaAllocator.h: Removed.
371         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
372         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
373         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
374         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
375         * platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
376         (): Deleted.
377         * platform/graphics/texmap/coordinated/UpdateAtlas.cpp: Removed.
378         * platform/graphics/texmap/coordinated/UpdateAtlas.h: Removed.
379         * testing/Internals.cpp:
380         (WebCore::Internals::resetToConsistentState):
381
382 2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>
383
384         Unreviewed, rolling out r230008.
385
386         Lots of HTTP test failures
387
388         Reverted changeset:
389
390         "Remove unused libsoup ResourceHandle implementation"
391         https://bugs.webkit.org/show_bug.cgi?id=184048
392         https://trac.webkit.org/changeset/230008
393
394 2018-03-27  Chris Dumez  <cdumez@apple.com>
395
396         Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
397         https://bugs.webkit.org/show_bug.cgi?id=184029
398
399         Reviewed by Youenn Fablet.
400
401         Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
402         by having it use SecurityOriginData (which is safe to construct on non-main threads) instead of
403         SecurityOrigin (which isn't).
404
405         ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() is already called from non-main thread in
406         FetchLoader, XHR and WebSocket when used in workers. This wasn't safe.
407
408         * loader/DocumentWriter.cpp:
409         (WebCore::DocumentWriter::begin):
410         * page/csp/ContentSecurityPolicy.cpp:
411         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
412         (WebCore::ContentSecurityPolicy::setUpgradeInsecureRequests):
413         (WebCore::ContentSecurityPolicy::takeNavigationRequestsToUpgrade):
414         (WebCore::ContentSecurityPolicy::setInsecureNavigationRequestsToUpgrade):
415         * page/csp/ContentSecurityPolicy.h:
416
417 2018-03-27  Daniel Bates  <dabates@apple.com>
418
419         Attempt to fix media control layout tests after <https://trac.webkit.org/changeset/230006/>
420         (https://bugs.webkit.org/show_bug.cgi?id=179983)
421
422         Exempt elements in user agent shadow DOM from having to perform a potentially CORS-
423         enabled fetch for a mask image to try to fix the following tests from timing out:
424             media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
425             media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html
426
427         * style/StylePendingResources.cpp:
428         (WebCore::Style::loadPendingImage):
429
430 2018-03-27  Per Arne Vollan  <pvollan@apple.com>
431
432         The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
433         https://bugs.webkit.org/show_bug.cgi?id=183923
434         <rdar://problem/38756869>
435
436         Reviewed by Brent Fulgham.
437
438         The test is timing out when we do not interact directly with the WindowServer, causing
439         OpenGL to fall back to software rendering. In this mode, any call to CGLChoosePixelFormat
440         requesting an accelerated pixel format will fail because it cannot determine which GPU is
441         connected to the display.
442
443         OpenGL treats all GPUs as if they were offline when used in a process (like the WebContent
444         process) that does not directly control the display.
445
446         We can get correct behavior if we tell OpenGL which GPU is currently connected to the
447         display, and if we instruct CGLChoosePixelFormat to create an offline renderer pixel format
448         by including the 'kCGLPFAAllowOfflineRenderers' flag in its arguments.
449
450         We can use CGLSetVirtualScreen with an OpenGL display mask that tells the OpenGL framework
451         which GPU it should use.
452
453         See https://developer.apple.com/library/content/technotes/tn2229/_index.html#//apple_ref/doc/uid/DTS40008924-CH1-SUBSECTION7
454         for details on how the virtual screen is found from the OpenGL display mask.
455
456         No new tests, covered by existing tests.
457
458         * WebCore.xcodeproj/project.pbxproj:
459         * platform/graphics/GraphicsContext3D.h:
460         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
461         (WebCore::setPixelFormat):
462         (WebCore::identifyAndSetCurrentGPU):
463         (WebCore::GraphicsContext3D::GraphicsContext3D):
464         (WebCore::GraphicsContext3D::setOpenGLDisplayMask):
465         (WebCore::GraphicsContext3D::allowOfflineRenderers):
466
467 2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>
468
469         [WebAuthN] Implement authenticatorGetAssertion
470         https://bugs.webkit.org/show_bug.cgi?id=183881
471         <rdar://problem/37258628>
472
473         Reviewed by Brent Fulgham.
474
475         This patch does the following few things:
476         1) It implements the spec: https://www.w3.org/TR/webauthn/#op-get-assertion as of 5 December 2017.
477         2) It tweaks encoding/decoding of PublicKeyCredentialRequestOptions such that options can be passed
478         between UI and Web processes.
479         3) It refines the way how LocalAuthenticator::makeCredential find intersection between
480         excludeCredentialDescriptorList and existing credentials in the authenticator, such that it is faster.
481         Basically, it takes the CredentialID from the list and treat it as an ASCII string and put it into a
482         HashSet<String>. It should not matter if a duplicated CredentialID is added. If the hash set is not
483         empty, the algorithm then queries Keychain for all CredentialIDs related to the current RP ID once.
484         For every queried CredentialID, the algorithm then treats it as an ASCII string as well and look for
485         a match in the hash set to produce the intersetction. The new way is also employed in
486         LocalAuthenticator::getAssertion as well.
487         4) It abstracts the way to produce authData and thus reorders a bit of code in
488         LocalAuthenticator::makeCredential.
489
490         Covered by API tests.
491
492         * Modules/webauthn/AuthenticatorManager.cpp:
493         (WebCore::AuthenticatorManager::create const):
494         (WebCore::AuthenticatorManager::discoverFromExternalSource const):
495         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
496         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
497         (WebCore::PublicKeyCredentialRequestOptions::encode const):
498         (WebCore::PublicKeyCredentialRequestOptions::decode):
499         * Modules/webauthn/cocoa/LocalAuthenticator.h:
500         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
501         (WebCore::LocalAuthenticatorInternal::buildAuthData):
502         (WebCore::LocalAuthenticatorInternal::produceHashSet):
503         (WebCore::LocalAuthenticator::makeCredential):
504         (WebCore::LocalAuthenticator::getAssertion):
505         (WebCore::LocalAuthenticator::issueClientCertificate const):
506         * WebCore.xcodeproj/project.pbxproj:
507
508 2018-03-27  Chris Dumez  <cdumez@apple.com>
509
510         Avoid constructing SecurityOrigin objects from non-main threads
511         https://bugs.webkit.org/show_bug.cgi?id=184024
512
513         Reviewed by Youenn Fablet.
514
515         Avoid constructing SecurityOrigin objects from non-main threads as much as possible
516         as it is not safe. This patch gets rid of most offending cases but not all of them
517         yet, which is why I haven't added a ASSERT(isMainThread()) to the SecurityOrigin
518         constructor yet.
519
520         For example, ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() currently
521         gets called from non-main threads and construct a SecurityOrigin. Fixing this
522         will require some refactoring that would have made this patch much larger.
523
524         * loader/DocumentLoader.cpp:
525         (WebCore::DocumentLoader::matchRegistration):
526         * page/EventSource.cpp:
527         (WebCore::EventSource::didReceiveResponse):
528         * page/SecurityOrigin.cpp:
529         (WebCore::SecurityOrigin::SecurityOrigin):
530         * page/SecurityOrigin.h:
531         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
532         * testing/Internals.cpp:
533         (WebCore::Internals::hasServiceWorkerRegistration):
534         * workers/DedicatedWorkerGlobalScope.cpp:
535         (WebCore::DedicatedWorkerGlobalScope::create):
536         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
537         * workers/DedicatedWorkerGlobalScope.h:
538         * workers/DedicatedWorkerThread.cpp:
539         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
540         * workers/DedicatedWorkerThread.h:
541         * workers/WorkerGlobalScope.cpp:
542         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
543         * workers/WorkerGlobalScope.h:
544         * workers/WorkerLocation.cpp:
545         (WebCore::WorkerLocation::origin const):
546         * workers/WorkerThread.cpp:
547         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
548         (WebCore::WorkerThread::workerThread):
549         * workers/WorkerThread.h:
550         * workers/service/SWClientConnection.h:
551         * workers/service/ServiceWorkerContainer.cpp:
552         (WebCore::ServiceWorkerContainer::getRegistration):
553         (WebCore::ServiceWorkerContainer::getRegistrations):
554         * workers/service/ServiceWorkerGlobalScope.cpp:
555         (WebCore::ServiceWorkerGlobalScope::create):
556         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
557         * workers/service/ServiceWorkerGlobalScope.h:
558         * workers/service/ServiceWorkerProvider.cpp:
559         (WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
560         * workers/service/ServiceWorkerProvider.h:
561         * workers/service/context/ServiceWorkerThread.cpp:
562         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
563         (WebCore::fireMessageEvent):
564         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
565         * workers/service/context/ServiceWorkerThread.h:
566
567 2018-03-27  Alex Christensen  <achristensen@webkit.org>
568
569         Remove unused libsoup ResourceHandle implementation
570         https://bugs.webkit.org/show_bug.cgi?id=184048
571
572         Reviewed by Michael Catanzaro.
573
574         This code is unused since r228901 so let's remove it!
575
576         * platform/network/ResourceHandle.h:
577         * platform/network/ResourceHandleInternal.h:
578         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
579         * platform/network/soup/ResourceHandleSoup.cpp:
580         (WebCore::ResourceHandle::~ResourceHandle):
581         (WebCore::ResourceHandleInternal::soupSession):
582         (WebCore::ResourceHandle::cancelledOrClientless):
583         (WebCore::ResourceHandle::ensureReadBuffer):
584         (WebCore::ResourceHandle::currentStreamPosition const):
585         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
586         (WebCore::ResourceHandle::didStartRequest):
587         (WebCore::ResourceHandle::start):
588         (WebCore::ResourceHandle::releaseForDownload):
589         (WebCore::ResourceHandle::sendPendingRequest):
590         (WebCore::ResourceHandle::cancel):
591         (WebCore::ResourceHandle::shouldUseCredentialStorage):
592         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
593         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
594         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
595         (WebCore::ResourceHandle::receivedCredential):
596         (WebCore::ResourceHandle::receivedCancellation):
597         (WebCore::ResourceHandle::receivedChallengeRejection):
598         (WebCore::ResourceHandle::platformSetDefersLoading):
599         (WebCore::sessionFromContext): Deleted.
600         (WebCore::ResourceHandle::create): Deleted.
601         (WebCore::ResourceHandle::ResourceHandle): Deleted.
602         (WebCore::isAuthenticationFailureStatusCode): Deleted.
603         (WebCore::tlsErrorsChangedCallback): Deleted.
604         (WebCore::gotHeadersCallback): Deleted.
605         (WebCore::applyAuthenticationToRequest): Deleted.
606         (WebCore::restartedCallback): Deleted.
607         (WebCore::shouldRedirect): Deleted.
608         (WebCore::shouldRedirectAsGET): Deleted.
609         (WebCore::continueAfterWillSendRequest): Deleted.
610         (WebCore::doRedirect): Deleted.
611         (WebCore::redirectSkipCallback): Deleted.
612         (WebCore::wroteBodyDataCallback): Deleted.
613         (WebCore::cleanupSoupRequestOperation): Deleted.
614         (WebCore::nextMultipartResponsePartCallback): Deleted.
615         (WebCore::sendRequestCallback): Deleted.
616         (WebCore::continueAfterDidReceiveResponse): Deleted.
617         (WebCore::startingCallback): Deleted.
618         (WebCore::networkEventCallback): Deleted.
619         (WebCore::createSoupMessageForHandleAndRequest): Deleted.
620         (WebCore::createSoupRequestAndMessageForHandle): Deleted.
621         (WebCore::ResourceHandle::timeoutFired): Deleted.
622         (WebCore::waitingToSendRequest): Deleted.
623         (WebCore::readCallback): Deleted.
624
625 2018-03-27  Chris Dumez  <cdumez@apple.com>
626
627         Move online state detection from the WebProcess to the NetworkProcess
628         https://bugs.webkit.org/show_bug.cgi?id=183989
629         <rdar://problem/37093299>
630
631         Reviewed by Youenn Fablet.
632
633         Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
634         EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
635         and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
636         its connected WebProcesses via IPC.
637
638         * inspector/agents/InspectorApplicationCacheAgent.cpp:
639         (WebCore::InspectorApplicationCacheAgent::networkStateChanged):
640         * loader/LoaderStrategy.h:
641         * page/Navigator.cpp:
642         (WebCore::Navigator::onLine const):
643         * page/Page.cpp:
644         * platform/network/NetworkStateNotifier.h:
645         * workers/Worker.cpp:
646         (WebCore::Worker::Worker):
647         (WebCore::Worker::notifyFinished):
648         * workers/service/context/ServiceWorkerThread.cpp:
649         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
650         * workers/service/context/ServiceWorkerThreadProxy.cpp:
651         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
652
653 2018-03-27  Daniel Bates  <dabates@apple.com>
654
655         CSS mask images should be retrieved using potentially CORS-enabled fetch
656         https://bugs.webkit.org/show_bug.cgi?id=179983
657         <rdar://problem/35678149>
658
659         Reviewed by Brent Fulgham.
660
661         As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor’s Draft, 23 December 2017)
662         we should fetch CSS mask images using a potentially CORS-enabled fetch.
663
664         Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
665         attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
666         For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
667         fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
668         closely align with the behavior in the spec.
669
670         Test: http/tests/security/css-mask-image.html
671
672         * page/Settings.yaml: Add a setting for toggle "Anonymous" mode fetching of mask images (defaults: true).
673         We need this setting to avoid breaking the developer convenience feature that some modern media controls
674         layout tests employ to load assets from the filesystem as opposed to using the hardcoded data URLs baked
675         into the WebKit binary.
676         * style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
677         LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
678         in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
679         (WebCore::Style::loadPendingImage): Ditto.
680         (WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
681         a mask image or shape-outside image.
682
683 2018-03-27  Zalan Bujtas  <zalan@apple.com>
684
685         RenderBox::parent/firstChild/nextSibling/previousSiblingBox() functions should type check.
686         https://bugs.webkit.org/show_bug.cgi?id=184032
687         <rdar://problem/38384984>
688
689         Reviewed by Antti Koivisto.
690
691         We cannot rely on the correctness of the render tree structure when querying for parent/child/next and previous
692         sibling since some features (multicolumn/spanners) move subtrees out of their original position (which is highly
693         undesired and should not be encouraged at all though).
694         It should also be noted that these functions are not equivalent of typeOfChildren<RenderBox> and the following usage
695             for (auto* boxChild = firstChildBox(); boxChild; boxChild = boxChild->nextSiblingBox())
696         can lead to unexpected result.
697  
698         Test: fast/multicol/parent-box-when-spanner-is-present.html
699
700         * rendering/RenderBox.h:
701         (WebCore::RenderBox::parentBox const):
702         (WebCore::RenderBox::firstChildBox const):
703         (WebCore::RenderBox::lastChildBox const):
704         (WebCore::RenderBox::previousSiblingBox const):
705         (WebCore::RenderBox::nextSiblingBox const):
706         * rendering/RenderListItem.cpp:
707         (WebCore::RenderListItem::positionListMarker):
708         * rendering/RenderListMarker.cpp:
709         (WebCore::RenderListMarker::layout):
710         * rendering/RenderMultiColumnSet.cpp:
711         (WebCore::RenderMultiColumnSet::updateLogicalWidth):
712
713 2018-03-27  Brent Fulgham  <bfulgham@apple.com>
714
715         Further refine cookie read/write logging
716         https://bugs.webkit.org/show_bug.cgi?id=184044
717         <rdar://problem/38915610>
718
719         Reviewed by Chris Dumez.
720
721         Export 'shouldBlockCookies' so that it can be accessed by the WebKit framework.
722
723         * platform/network/NetworkStorageSession.h:
724
725 2018-03-27  Antoine Quint  <graouts@apple.com>
726
727         [Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of Web Animations API for animations tests
728         https://bugs.webkit.org/show_bug.cgi?id=184038
729
730         Reviewed by Dean Jackson.
731
732         Expose a new method to indicate that the runtime flag for CSS Animations and CSS Transitions as Web Animations is enabled.
733
734         * testing/InternalSettings.cpp:
735         (WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
736         * testing/InternalSettings.h:
737         * testing/InternalSettings.idl:
738
739 2018-03-27  Thibault Saunier  <tsaunier@igalia.com>
740
741         [GStreamer] Enhance debugging in the BasePlayer
742         https://bugs.webkit.org/show_bug.cgi?id=184035
743
744         Reviewed by Philippe Normand.
745
746         No behaviour changes so no test were added/enabled.
747
748         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
749         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
750         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
751         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
752         (WebCore::MediaPlayerPrivateGStreamerBase::setVolume):
753         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
754         (WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
755         (WebCore::MediaPlayerPrivateGStreamerBase::muted const):
756         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
757         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
758         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
759         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
760         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
761         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
762         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
763
764 2018-03-27  Eric Carlson  <eric.carlson@apple.com>
765
766         Make AVFoundationEnabled preference available on iOS
767         https://bugs.webkit.org/show_bug.cgi?id=183876
768         <rdar://problem/38726459>
769
770         Reviewed by Youenn Fablet.
771
772         Test: AVFoundationPref API test.
773
774         * html/HTMLAudioElement.idl: There is no need for a runtime setting to enable/disable audio,
775         there is already settings.mediaEnabled.
776         * html/HTMLMediaElement.cpp:
777         (WebCore::HTMLMediaElement::prepareForLoad): Fail if there are no media engines registered.
778         (WebCore::HTMLMediaElement::noneSupported): Return early if m_error has already been set.
779         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Remove a typo.
780
781         * page/RuntimeEnabledFeatures.cpp:
782         (WebCore::RuntimeEnabledFeatures::audioEnabled const): Deleted.
783         * page/RuntimeEnabledFeatures.h:
784
785 2018-03-27  Fujii Hironori  <Hironori.Fujii@sony.com>
786
787         [GTK] Layout test editing/deleting/delete-surrogatepair.html crashing with CRITICAL **: enchant_dict_check: assertion 'g_utf8_validate(word, len, NULL)' failed
788         https://bugs.webkit.org/show_bug.cgi?id=176799
789
790         Reviewed by Carlos Garcia Campos.
791
792         The length of a surrogate-pair UTF-16 character is 2 even though
793         the number of characters is 1. An incorrect string length was
794         passed to enchant_dict_check if the string contains a
795         surrogate-pair character because the length was calculated by
796         applying UTF-16 character position to UTF-8 string.
797
798         No new tests (Covered by existing tests).
799
800         * platform/text/enchant/TextCheckerEnchant.cpp:
801         (WebCore::TextCheckerEnchant::checkSpellingOfWord): Changed the
802         type of an argument `word` from CString to String. Convert a
803         substring of the argument into UTF-8.
804         (WebCore::TextCheckerEnchant::checkSpellingOfString): Pass the
805         original UTF-16 string to checkSpellingOfWord instead of a
806         converted UTF-8 string.
807         * platform/text/enchant/TextCheckerEnchant.h: Changed the type of
808         an argument `word` from CString to String.
809
810 2018-03-26  Ms2ger  <Ms2ger@igalia.com>
811
812         Remove an unnecessary const_cast from BitmapTextureGL::updateContents().
813         https://bugs.webkit.org/show_bug.cgi?id=184007
814
815         Reviewed by Žan Doberšek.
816
817         No new tests.
818
819         * platform/graphics/texmap/BitmapTextureGL.cpp:
820         (WebCore::BitmapTextureGL::updateContents):
821
822 2018-03-23  Antoine Quint  <graouts@apple.com>
823
824         [Web Animations] Make imported/mozilla/css-animations/test_animation-currenttime.html pass reliably
825         https://bugs.webkit.org/show_bug.cgi?id=183819
826
827         Reviewed by Dean Jackson.
828
829         The current time for a CSS Animation exposed via the API should be clamped between 0 and the animation duration.
830
831         * animation/CSSAnimation.cpp:
832         (WebCore::CSSAnimation::bindingsCurrentTime const):
833         * animation/CSSAnimation.h:
834         * animation/WebAnimation.h:
835
836 2018-03-23  Antoine Quint  <graouts@apple.com>
837
838         [Web Animations] Correctly handle timing functions specified by CSS Animations and CSS Transitions
839         https://bugs.webkit.org/show_bug.cgi?id=183935
840
841         Reviewed by Dean Jackson.
842
843         We were incorrectly reflecting the animation-timing-function and transition-timing-function values on the generated
844         DeclarativeAnimation effect timing "easing" property. In fact, those values should only be represented on the keyframes.
845
846         In the case of a CSS Animation, the animation-timing-function property set on the element's style serves as the default
847         value used for all keyframes, and individual keyframes can specify an overriding animation-timing-function. For a CSS
848         Transition, the transition-timing-function property set on the element's style serves as the timing function of the
849         from keyframe.
850
851         To correctly reflect this, we provide a new timingFunctionForKeyframeAtIndex() function on KeyframeEffectReadOnly
852         which will return the right TimingFunction object at a given index, regardless of the animation type. In the case
853         of getKeyframes(), we manually return "linear" for the "to" keyframe since timingFunctionForKeyframeAtIndex()
854         would otherwise return the same timing function as the "from" keyframe. This avoids creating an extra
855         LinearTimingFunction object.
856
857         As a result, a number of Mozilla imported tests progress since we have correct information on the "easing" property
858         of objects returned by getKeyframes() and the "progress" reported by getComputedTiming() now always uses a linear
859         timing function.
860
861         * animation/DeclarativeAnimation.cpp:
862         (WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): The timing function of the backing Animation should
863         not be reflected on the effect's timing object.
864         * animation/KeyframeEffectReadOnly.cpp:
865         (WebCore::KeyframeEffectReadOnly::getKeyframes): Return the correct timing function for a keyframe, and use a "linear"
866         value for the "to" keyframe of a CSS Transition.
867         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
868         (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
869         * animation/KeyframeEffectReadOnly.h:
870
871 2018-03-26  Chris Dumez  <cdumez@apple.com>
872
873         Use SecurityOriginData more consistently in Service Worker code
874         https://bugs.webkit.org/show_bug.cgi?id=183969
875
876         Reviewed by Darin Adler.
877
878         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
879         SecurityOrigin objects unnecessarily.
880
881         I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
882         code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
883         in some cases as callers can now use SecurityOrigin::data() instead of
884         SecurityOriginData::fromSecurityOrigin().
885
886         No new tests, no Web-facing behavior change.
887
888         * Modules/cache/DOMCacheStorage.cpp:
889         (WebCore::DOMCacheStorage::origin const):
890         * Modules/encryptedmedia/CDM.cpp:
891         (WebCore::CDM::storageDirectory const):
892         * Modules/encryptedmedia/MediaKeySession.cpp:
893         (WebCore::MediaKeySession::mediaKeysStorageDirectory const):
894         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
895         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
896         * Modules/indexeddb/IDBFactory.cpp:
897         (WebCore::IDBFactory::openInternal):
898         (WebCore::IDBFactory::deleteDatabase):
899         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
900         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
901         * Modules/webdatabase/Database.cpp:
902         (WebCore::Database::securityOrigin):
903         * Modules/webdatabase/DatabaseContext.cpp:
904         (WebCore::DatabaseContext::securityOrigin const):
905         * Modules/webdatabase/DatabaseContext.h:
906         * Modules/webdatabase/DatabaseManager.cpp:
907         (WebCore::DatabaseManager::fullPathForDatabase):
908         (WebCore::DatabaseManager::detailsForNameAndOrigin):
909         * html/HTMLMediaElement.cpp:
910         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
911         * inspector/agents/InspectorDOMStorageAgent.cpp:
912         (WebCore::InspectorDOMStorageAgent::findStorageArea):
913         * loader/appcache/ApplicationCacheStorage.cpp:
914         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
915         (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
916         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
917         (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
918         (WebCore::ApplicationCacheStorage::store):
919         (WebCore::ApplicationCacheStorage::ensureOriginRecord):
920         * page/DOMWindow.cpp:
921         (WebCore:: const):
922         * page/SecurityOrigin.cpp:
923         (WebCore::SecurityOrigin::SecurityOrigin):
924         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
925         (WebCore::SecurityOrigin::canAccess const):
926         (WebCore::SecurityOrigin::canDisplay const):
927         (WebCore::SecurityOrigin::domainForCachePartition const):
928         (WebCore::SecurityOrigin::isLocal const):
929         (WebCore::SecurityOrigin::toString const):
930         (WebCore::SecurityOrigin::toRawString const):
931         (WebCore::SecurityOrigin::create):
932         (WebCore::SecurityOrigin::isSameSchemeHostPort const):
933         * page/SecurityOrigin.h:
934         (WebCore::SecurityOrigin::protocol const):
935         (WebCore::SecurityOrigin::host const):
936         (WebCore::SecurityOrigin::port const):
937         (WebCore::SecurityOrigin::data const):
938         (WebCore::SecurityOrigin::isHTTPFamily const):
939         * page/SecurityOriginData.cpp:
940         (WebCore::SecurityOriginData::toString const):
941         (WebCore::SecurityOriginData::fromFrame):
942         * page/SecurityOriginData.h:
943         (WebCore::SecurityOriginData::fromURL):
944         * storage/StorageNamespaceProvider.cpp:
945         (WebCore::StorageNamespaceProvider::localStorageArea):
946         * testing/Internals.cpp:
947         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
948         * workers/service/ServiceWorkerContainer.cpp:
949         (WebCore::ServiceWorkerContainer::addRegistration):
950         (WebCore::ServiceWorkerContainer::removeRegistration):
951         (WebCore::ServiceWorkerContainer::updateRegistration):
952         * workers/service/ServiceWorkerRegistrationKey.cpp:
953         (WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
954         * workers/service/ServiceWorkerRegistrationKey.h:
955         * workers/service/server/SWOriginStore.cpp:
956         (WebCore::SWOriginStore::add):
957         (WebCore::SWOriginStore::remove):
958         (WebCore::SWOriginStore::clear):
959         * workers/service/server/SWOriginStore.h:
960         * workers/service/server/SWServer.cpp:
961         (WebCore::SWServer::addRegistration):
962         (WebCore::SWServer::removeRegistration):
963         (WebCore::SWServer::clear):
964         (WebCore::SWServer::tryInstallContextData):
965         (WebCore::SWServer::serverToContextConnectionCreated):
966         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
967         (WebCore::SWServer::unregisterServiceWorkerClient):
968         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
969         * workers/service/server/SWServer.h:
970         * workers/service/server/SWServerToContextConnection.cpp:
971         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
972         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
973         (WebCore::SWServerToContextConnection::connectionForOrigin):
974         * workers/service/server/SWServerToContextConnection.h:
975         (WebCore::SWServerToContextConnection::securityOrigin const):
976         * workers/service/server/SWServerWorker.cpp:
977         (WebCore::SWServerWorker::origin const):
978         (WebCore::SWServerWorker::securityOrigin const):
979         * workers/service/server/SWServerWorker.h:
980
981 2018-03-26  Brent Fulgham  <bfulgham@apple.com>
982
983         Warn against cookie access in the WebContent process using ProcessPrivilege assertions
984         https://bugs.webkit.org/show_bug.cgi?id=183911
985         <rdar://problem/38762306>
986
987         Reviewed by Youenn Fablet.
988
989         Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
990         should never call Cookie API directly. That should only happen in the Networking or
991         UIProcess. 
992
993         Add a new static flag to NetworkStorageSession that indicates if the current process has
994         permission to interact with the Cookie API.
995
996         No new tests since there is no change in behavior.
997
998         * platform/network/NetworkStorageSession.cpp:
999         (WebCore::NetworkStorageSession::NetworkStorageSession):
1000         (WebCore::NetworkStorageSession::processMayUseCookieAPI): Added.
1001         (WebCore::NetworkStorageSession::permitProcessToUseCookieAPI): Added. This also adds
1002         the appropriate flag to the ProcessPrivileges data for the current process.
1003         * platform/network/NetworkStorageSession.h:
1004         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1005         (WebCore::createCFStorageSessionForIdentifier): Do not create cookie storage if the current
1006         process is prohibited from interacting with the Cookie API.
1007         (WebCore::NetworkStorageSession::NetworkStorageSession): Add assertions.
1008         (WebCore::NetworkStorageSession::switchToNewTestingSession): Do not create cookie storage if
1009         the current process is prohibited from interacting with the Cookie API.
1010         (WebCore::NetworkStorageSession::defaultStorageSession): Ditto.
1011         (WebCore::NetworkStorageSession::ensureSession): Ditto.
1012         (WebCore::NetworkStorageSession::cookieStorage const): Ditto.
1013         * platform/network/cocoa/CookieStorageObserver.mm:
1014         (WebCore::CookieStorageObserver::CookieStorageObserver): Assert if accessed from untrusted process.
1015         (WebCore::CookieStorageObserver::startObserving): Ditto.
1016         (WebCore::CookieStorageObserver::stopObserving): Ditto.
1017         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1018         (WebCore::NetworkStorageSession::setCookie):
1019         (WebCore::NetworkStorageSession::setCookies):
1020         (WebCore::NetworkStorageSession::deleteCookie):
1021         (WebCore::nsCookiesToCookieVector):
1022         (WebCore::NetworkStorageSession::getAllCookies):
1023         (WebCore::NetworkStorageSession::getCookies):
1024         (WebCore::NetworkStorageSession::flushCookieStore):
1025         (WebCore::NetworkStorageSession::nsCookieStorage const):
1026         (WebCore::createPrivateStorageSession):
1027         * platform/network/mac/CookieJarMac.mm:
1028         (WebCore::httpCookies):
1029         (WebCore::deleteHTTPCookie):
1030         (WebCore::httpCookiesForURL):
1031         (WebCore::filterCookies):
1032         (WebCore::applyPartitionToCookies):
1033         (WebCore::cookiesInPartitionForURL):
1034         (WebCore::cookiesForSession):
1035         (WebCore::setHTTPCookiesForURL):
1036         (WebCore::deleteAllHTTPCookies):
1037         (WebCore::setCookiesFromDOM):
1038         (WebCore::httpCookieAcceptPolicy):
1039         (WebCore::deleteCookie):
1040         (WebCore::deleteCookiesForHostnames):
1041         (WebCore::deleteAllCookiesModifiedSince):
1042
1043 2018-03-26  Alex Christensen  <achristensen@webkit.org>
1044
1045         Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
1046         https://bugs.webkit.org/show_bug.cgi?id=183965
1047
1048         Reviewed by Chris Dumez.
1049
1050         It turns out that ResourceHandleClient::willCacheResponseAsync didn't do anything and the logic in
1051         ResourceHandleClient::willCacheResponse was not being called.  This makes it so there is one code
1052         path and it executes the logic in ResourceHandleClient::willCacheResponse.
1053
1054         * loader/EmptyFrameLoaderClient.h:
1055         * loader/FrameLoaderClient.h:
1056         * loader/ResourceLoader.h:
1057         * loader/SubresourceLoader.h:
1058         * loader/cocoa/SubresourceLoaderCocoa.mm:
1059         (WebCore::SubresourceLoader::willCacheResponseAsync):
1060         (WebCore::SubresourceLoader::willCacheResponse): Deleted.
1061         * loader/mac/ResourceLoaderMac.mm:
1062         (WebCore::ResourceLoader::willCacheResponseAsync):
1063         (WebCore::ResourceLoader::willCacheResponse): Deleted.
1064         * platform/network/ResourceHandle.h:
1065         * platform/network/ResourceHandleClient.cpp:
1066         (WebCore::ResourceHandleClient::willCacheResponseAsync): Deleted.
1067         * platform/network/ResourceHandleClient.h:
1068         (WebCore::ResourceHandleClient::willCacheResponseAsync):
1069         (WebCore::ResourceHandleClient::shouldCacheResponse):
1070         (WebCore::ResourceHandleClient::willCacheResponse): Deleted.
1071         * platform/network/cf/ResourceHandleCFNet.cpp:
1072         (WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
1073         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1074         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1075         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1076         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueWillCacheResponse): Deleted.
1077         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1078         * platform/network/mac/ResourceHandleMac.mm:
1079         (WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
1080         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
1081         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1082         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
1083         (-[WebCoreResourceHandleAsOperationQueueDelegate continueWillCacheResponse:]): Deleted.
1084
1085 2018-03-26  Miguel Gomez  <magomez@igalia.com>
1086
1087         [GTK][WPE] Upload correct buffer in BitmapTextureGL::updateContents()
1088         https://bugs.webkit.org/show_bug.cgi?id=184004
1089
1090         Reviewed by Žan Doberšek.
1091
1092         Do not upload the original buffer. Upload the result of creating a subImage buffer
1093         if it was required.
1094
1095         Covered by existent tests.
1096
1097         * platform/graphics/texmap/BitmapTextureGL.cpp:
1098         (WebCore::BitmapTextureGL::updateContents):
1099
1100 2018-03-25  Zan Dobersek  <zdobersek@igalia.com>
1101
1102         [TexMap] Clean up TextureMapperPlatformLayer, TextureMapperBackingStore code
1103         https://bugs.webkit.org/show_bug.cgi?id=183985
1104
1105         Reviewed by Michael Catanzaro.
1106
1107         Clean up TextureMapperPlatformLayer and TextureMapperBackingStore
1108         headers and implementation files. Remove dubious whitespace, use #pragma
1109         once, clean up constructors, destructors, method definitions and remove
1110         unnecessary includes in favor of forward declarations where possible.
1111
1112         The TextureMapperPlatformLayer::swapBuffers() method is removed as it
1113         wasn't called or overridden anywhere.
1114
1115         No new tests -- no change in functionality.
1116
1117         * platform/graphics/texmap/TextureMapperBackingStore.cpp:
1118         * platform/graphics/texmap/TextureMapperBackingStore.h:
1119         (WebCore::TextureMapperBackingStore::drawRepaintCounter):
1120         * platform/graphics/texmap/TextureMapperPlatformLayer.h:
1121         (WebCore::TextureMapperPlatformLayer::setClient):
1122         (WebCore::TextureMapperPlatformLayer::TextureMapperPlatformLayer): Deleted.
1123         (WebCore::TextureMapperPlatformLayer::swapBuffers): Deleted.
1124
1125 2018-03-25  Dan Bernstein  <mitz@apple.com>
1126
1127         [Xcode] Remove workaround only needed for deploying to iOS 10.0 and earlier
1128         https://bugs.webkit.org/show_bug.cgi?id=183999
1129
1130         Reviewed by Sam Weinig.
1131
1132         * Configurations/WebCore.xcconfig: Removed build settings.
1133         * Configurations/WebCoreTestSupport.xcconfig: Removed location of phony WebKitLegacy from
1134           frameworks search path.
1135         * Configurations/WebKitLegacyStub.iOS.tbd: Removed.
1136         * WebCore.xcodeproj/project.pbxproj: Removed script build phase from the Derived Sources target.
1137
1138 2018-03-25  Commit Queue  <commit-queue@webkit.org>
1139
1140         Unreviewed, rolling out r229954.
1141         https://bugs.webkit.org/show_bug.cgi?id=184000
1142
1143         Caused many layout tests to crash on Apple High Sierra,
1144         Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
1145         by dydz on #webkit).
1146
1147         Reverted changeset:
1148
1149         "Use SecurityOriginData more consistently in Service Worker
1150         code"
1151         https://bugs.webkit.org/show_bug.cgi?id=183969
1152         https://trac.webkit.org/changeset/229954
1153
1154 2018-03-23  Alex Christensen  <achristensen@webkit.org>
1155
1156         Use completion handlers for ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync
1157         https://bugs.webkit.org/show_bug.cgi?id=183966
1158
1159         Reviewed by Chris Dumez.
1160
1161         No change in behavior.
1162
1163         * loader/ResourceLoader.cpp:
1164         (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
1165         * loader/ResourceLoader.h:
1166         * platform/network/BlobResourceHandle.cpp:
1167         * platform/network/PingHandle.h:
1168         * platform/network/ResourceHandle.h:
1169         * platform/network/ResourceHandleClient.h:
1170         * platform/network/SynchronousLoaderClient.cpp:
1171         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
1172         * platform/network/SynchronousLoaderClient.h:
1173         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1174         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1175         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1176         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1177         * platform/network/mac/ResourceHandleMac.mm:
1178         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
1179         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
1180         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
1181         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1182         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
1183         (-[WebCoreResourceHandleAsOperationQueueDelegate continueCanAuthenticateAgainstProtectionSpace:]): Deleted.
1184
1185 2018-03-24  Chris Dumez  <cdumez@apple.com>
1186
1187         Use SecurityOriginData more consistently in Service Worker code
1188         https://bugs.webkit.org/show_bug.cgi?id=183969
1189
1190         Reviewed by Darin Adler.
1191
1192         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
1193         SecurityOrigin objects unnecessarily.
1194
1195         I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
1196         code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
1197         in some cases as callers can now use SecurityOrigin::data() instead of
1198         SecurityOriginData::fromSecurityOrigin().
1199
1200         No new tests, no Web-facing behavior change.
1201
1202         * Modules/cache/DOMCacheStorage.cpp:
1203         (WebCore::DOMCacheStorage::origin const):
1204         * Modules/encryptedmedia/CDM.cpp:
1205         (WebCore::CDM::storageDirectory const):
1206         * Modules/encryptedmedia/MediaKeySession.cpp:
1207         (WebCore::MediaKeySession::mediaKeysStorageDirectory const):
1208         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1209         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
1210         * Modules/indexeddb/IDBFactory.cpp:
1211         (WebCore::IDBFactory::openInternal):
1212         (WebCore::IDBFactory::deleteDatabase):
1213         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1214         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
1215         * Modules/webdatabase/Database.cpp:
1216         (WebCore::Database::securityOrigin):
1217         * Modules/webdatabase/DatabaseContext.cpp:
1218         (WebCore::DatabaseContext::securityOrigin const):
1219         * Modules/webdatabase/DatabaseContext.h:
1220         * Modules/webdatabase/DatabaseManager.cpp:
1221         (WebCore::DatabaseManager::fullPathForDatabase):
1222         (WebCore::DatabaseManager::detailsForNameAndOrigin):
1223         * html/HTMLMediaElement.cpp:
1224         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
1225         * inspector/agents/InspectorDOMStorageAgent.cpp:
1226         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1227         * loader/appcache/ApplicationCacheStorage.cpp:
1228         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
1229         (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
1230         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
1231         (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
1232         (WebCore::ApplicationCacheStorage::store):
1233         (WebCore::ApplicationCacheStorage::ensureOriginRecord):
1234         * page/DOMWindow.cpp:
1235         (WebCore:: const):
1236         * page/SecurityOrigin.cpp:
1237         (WebCore::SecurityOrigin::SecurityOrigin):
1238         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
1239         (WebCore::SecurityOrigin::canAccess const):
1240         (WebCore::SecurityOrigin::canDisplay const):
1241         (WebCore::SecurityOrigin::domainForCachePartition const):
1242         (WebCore::SecurityOrigin::isLocal const):
1243         (WebCore::SecurityOrigin::toString const):
1244         (WebCore::SecurityOrigin::toRawString const):
1245         (WebCore::SecurityOrigin::create):
1246         (WebCore::SecurityOrigin::isSameSchemeHostPort const):
1247         * page/SecurityOrigin.h:
1248         (WebCore::SecurityOrigin::protocol const):
1249         (WebCore::SecurityOrigin::host const):
1250         (WebCore::SecurityOrigin::port const):
1251         (WebCore::SecurityOrigin::data const):
1252         (WebCore::SecurityOrigin::isHTTPFamily const):
1253         * page/SecurityOriginData.cpp:
1254         (WebCore::SecurityOriginData::toString const):
1255         (WebCore::SecurityOriginData::fromFrame):
1256         * page/SecurityOriginData.h:
1257         (WebCore::SecurityOriginData::fromURL):
1258         * storage/StorageNamespaceProvider.cpp:
1259         (WebCore::StorageNamespaceProvider::localStorageArea):
1260         * testing/Internals.cpp:
1261         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
1262         * workers/service/ServiceWorkerContainer.cpp:
1263         (WebCore::ServiceWorkerContainer::addRegistration):
1264         (WebCore::ServiceWorkerContainer::removeRegistration):
1265         (WebCore::ServiceWorkerContainer::updateRegistration):
1266         * workers/service/ServiceWorkerRegistrationKey.cpp:
1267         (WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
1268         * workers/service/ServiceWorkerRegistrationKey.h:
1269         * workers/service/server/SWOriginStore.cpp:
1270         (WebCore::SWOriginStore::add):
1271         (WebCore::SWOriginStore::remove):
1272         (WebCore::SWOriginStore::clear):
1273         * workers/service/server/SWOriginStore.h:
1274         * workers/service/server/SWServer.cpp:
1275         (WebCore::SWServer::addRegistration):
1276         (WebCore::SWServer::removeRegistration):
1277         (WebCore::SWServer::clear):
1278         (WebCore::SWServer::tryInstallContextData):
1279         (WebCore::SWServer::serverToContextConnectionCreated):
1280         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
1281         (WebCore::SWServer::unregisterServiceWorkerClient):
1282         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
1283         * workers/service/server/SWServer.h:
1284         * workers/service/server/SWServerToContextConnection.cpp:
1285         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
1286         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
1287         (WebCore::SWServerToContextConnection::connectionForOrigin):
1288         * workers/service/server/SWServerToContextConnection.h:
1289         (WebCore::SWServerToContextConnection::securityOrigin const):
1290         * workers/service/server/SWServerWorker.cpp:
1291         (WebCore::SWServerWorker::origin const):
1292         (WebCore::SWServerWorker::securityOrigin const):
1293         * workers/service/server/SWServerWorker.h:
1294
1295 2018-03-24  Commit Queue  <commit-queue@webkit.org>
1296
1297         Unreviewed, rolling out r229792.
1298         https://bugs.webkit.org/show_bug.cgi?id=183980
1299
1300         not actually necessary (Requested by thorton on #webkit).
1301
1302         Reverted changeset:
1303
1304         "Fix the build"
1305         https://trac.webkit.org/changeset/229792
1306
1307 2018-03-23  Tim Horton  <timothy_horton@apple.com>
1308
1309         Fix the geolocation build
1310         https://bugs.webkit.org/show_bug.cgi?id=183975
1311
1312         * Modules/geolocation/ios/GeolocationPositionIOS.mm:
1313         (WebCore::GeolocationPosition::GeolocationPosition):
1314
1315 2018-03-23  Tim Horton  <timothy_horton@apple.com>
1316
1317         Fix the build with no pasteboard
1318         https://bugs.webkit.org/show_bug.cgi?id=183973
1319
1320         Reviewed by Dan Bernstein.
1321
1322         * Configurations/FeatureDefines.xcconfig:
1323         * platform/ios/PlatformPasteboardIOS.mm:
1324
1325 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1326
1327         [Extra zoom mode] Fix some localizable strings after r229878
1328         https://bugs.webkit.org/show_bug.cgi?id=183963
1329
1330         Reviewed by Tim Horton.
1331
1332         The WEB_UI_STRING macro was incorrectly used for certain localized strings pertaining to extra zoom mode. To
1333         correct this, make the "Done" string use WEB_UI_STRING with actual UI-facing text; since day, year and month
1334         labels in the date picker are less generalizable to other UI, leave these as unique keys, but change them to
1335         use WEB_UI_STRING_KEY instead.
1336
1337         Additionally, remove now-unused localizable strings for the text input view controller.
1338
1339         * English.lproj/Localizable.strings:
1340         * platform/LocalizedStrings.cpp:
1341         (WebCore::formControlDoneButtonTitle):
1342         (WebCore::datePickerDayLabelTitle):
1343         (WebCore::datePickerMonthLabelTitle):
1344         (WebCore::datePickerYearLabelTitle):
1345
1346 2018-03-23  Chris Dumez  <cdumez@apple.com>
1347
1348         NetworkStateNotifier::updateStateWithoutNotifying() is inefficient
1349         https://bugs.webkit.org/show_bug.cgi?id=183760
1350         <rdar://problem/37093299>
1351
1352         Reviewed by Ryosuke Niwa.
1353
1354         Update NetworkStateNotifier::updateStateWithoutNotifying() to stop calling
1355         SCDynamicStoreCopyKeyList(). SCDynamicStoreCopyKeyList() is expensive as it
1356         expects its key parameter to be a regular expression and it can match several
1357         keys. It is also unnecessary in our case since we already have an exact key.
1358         We now call the more efficient SCDynamicStoreCopyValue() instead, which is
1359         the right thing to call when we have an exact key.
1360
1361         This change was suggested by the SC team.
1362
1363         This was tested manually as there is no easy way to write an automated test
1364         for this.
1365
1366         In a follow-up, I also plan to call this code in the UIProcess (or NetworkProcess)
1367         to avoid calling it once per WebProcess.
1368
1369         * platform/network/mac/NetworkStateNotifierMac.cpp:
1370         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
1371
1372 2018-03-23  Daniel Bates  <dabates@apple.com>
1373
1374         Unreviewed, rolling out r229868.
1375
1376         Caused media controls tests to timeout. Will investigate
1377         offline.
1378
1379         Reverted changeset:
1380
1381         "CSS mask images should be retrieved using potentially CORS-
1382         enabled fetch"
1383         https://bugs.webkit.org/show_bug.cgi?id=179983
1384         https://trac.webkit.org/changeset/229868
1385
1386 2018-03-23  Mark Lam  <mark.lam@apple.com>
1387
1388         Add pointer profiling hooks to the CSS JIT.
1389         https://bugs.webkit.org/show_bug.cgi?id=183947
1390         <rdar://problem/38803593>
1391
1392         Reviewed by JF Bastien.
1393
1394         No new tests needed.  Covered by existing tests.
1395
1396         * bindings/scripts/CodeGeneratorJS.pm:
1397         (GenerateImplementation):
1398         - Added a missing application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION().
1399
1400         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1401         (WebCore::toJSNewlyCreated):
1402         * bindings/scripts/test/JS/JSMapLike.cpp:
1403         (WebCore::toJSNewlyCreated):
1404         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1405         (WebCore::toJSNewlyCreated):
1406         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1407         (WebCore::toJSNewlyCreated):
1408         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1409         (WebCore::toJSNewlyCreated):
1410         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1411         (WebCore::toJSNewlyCreated):
1412         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1413         (WebCore::toJSNewlyCreated):
1414         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1415         (WebCore::toJSNewlyCreated):
1416         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1417         (WebCore::toJSNewlyCreated):
1418         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1419         (WebCore::toJSNewlyCreated):
1420         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1421         (WebCore::toJSNewlyCreated):
1422         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1423         (WebCore::toJSNewlyCreated):
1424         * bindings/scripts/test/JS/JSTestException.cpp:
1425         (WebCore::toJSNewlyCreated):
1426         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1427         (WebCore::toJSNewlyCreated):
1428         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1429         (WebCore::toJSNewlyCreated):
1430         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1431         (WebCore::toJSNewlyCreated):
1432         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1433         (WebCore::toJSNewlyCreated):
1434         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1435         (WebCore::toJSNewlyCreated):
1436         * bindings/scripts/test/JS/JSTestIterable.cpp:
1437         (WebCore::toJSNewlyCreated):
1438         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1439         (WebCore::toJSNewlyCreated):
1440         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1441         (WebCore::toJSNewlyCreated):
1442         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1443         (WebCore::toJSNewlyCreated):
1444         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1445         (WebCore::toJSNewlyCreated):
1446         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1447         (WebCore::toJSNewlyCreated):
1448         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1449         (WebCore::toJSNewlyCreated):
1450         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1451         (WebCore::toJSNewlyCreated):
1452         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1453         (WebCore::toJSNewlyCreated):
1454         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1455         (WebCore::toJSNewlyCreated):
1456         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1457         (WebCore::toJSNewlyCreated):
1458         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1459         (WebCore::toJSNewlyCreated):
1460         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1461         (WebCore::toJSNewlyCreated):
1462         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1463         (WebCore::toJSNewlyCreated):
1464         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1465         (WebCore::toJSNewlyCreated):
1466         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1467         (WebCore::toJSNewlyCreated):
1468         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1469         (WebCore::toJSNewlyCreated):
1470         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1471         (WebCore::toJSNewlyCreated):
1472         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1473         (WebCore::toJSNewlyCreated):
1474         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1475         (WebCore::toJSNewlyCreated):
1476         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1477         (WebCore::toJSNewlyCreated):
1478         * bindings/scripts/test/JS/JSTestNode.cpp:
1479         (WebCore::toJSNewlyCreated):
1480         * bindings/scripts/test/JS/JSTestObj.cpp:
1481         (WebCore::toJSNewlyCreated):
1482         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1483         (WebCore::toJSNewlyCreated):
1484         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1485         (WebCore::toJSNewlyCreated):
1486         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1487         (WebCore::toJSNewlyCreated):
1488         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1489         (WebCore::toJSNewlyCreated):
1490         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1491         (WebCore::toJSNewlyCreated):
1492         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1493         (WebCore::toJSNewlyCreated):
1494         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1495         (WebCore::toJSNewlyCreated):
1496         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1497         (WebCore::toJSNewlyCreated):
1498         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1499         (WebCore::toJSNewlyCreated):
1500         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1501         (WebCore::toJSNewlyCreated):
1502         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1503         (WebCore::toJSNewlyCreated):
1504         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1505         (WebCore::toJSNewlyCreated):
1506         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1507         (WebCore::toJSNewlyCreated):
1508         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1509         (WebCore::toJSNewlyCreated):
1510         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1511         (WebCore::toJSNewlyCreated):
1512         * css/ElementRuleCollector.cpp:
1513         (WebCore::ElementRuleCollector::ruleMatches):
1514         * cssjit/SelectorCompiler.cpp:
1515         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
1516         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1517         * cssjit/SelectorCompiler.h:
1518         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
1519         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
1520         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
1521         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
1522         * dom/SelectorQuery.cpp:
1523         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
1524         (WebCore::SelectorDataList::execute const):
1525
1526 2018-03-23  Sihui Liu  <sihui_liu@apple.com>
1527
1528         Local storage getItem() for an empty string returned UNDEFINED value.
1529         https://bugs.webkit.org/show_bug.cgi?id=69138
1530         <rdar://problem/13410974>
1531
1532         Reviewed by Brady Eidson.
1533
1534         * platform/sql/SQLiteStatement.cpp:
1535         (WebCore::SQLiteStatement::getColumnBlobAsString):
1536
1537 2018-03-23  Chris Dumez  <cdumez@apple.com>
1538
1539         Promptly terminate service worker processes when they are no longer needed
1540         https://bugs.webkit.org/show_bug.cgi?id=183873
1541         <rdar://problem/38676995>
1542
1543         Reviewed by Youenn Fablet.
1544
1545         The StorageProcess now keeps track of service worker clients for each security
1546         origin. When there is no longer any clients for a given security origin, the
1547         StorageProcess asks the service worker process for the given origin to terminate
1548         and severs its connection to it.
1549
1550         Change is covered by API test.
1551
1552         * workers/service/server/SWServer.cpp:
1553         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
1554         Pass the security origin since this is called when a service worker process
1555         crashes. When a service worker process for origin A crashes, we only want
1556         to mark service workers in origin A as terminated, not ALL of them.
1557
1558         (WebCore::SWServer::registerServiceWorkerClient):
1559         (WebCore::SWServer::unregisterServiceWorkerClient):
1560         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
1561         Tweak logic so that we only relaunch a service worker process if we still
1562         have clients for its security origin.
1563
1564         * workers/service/server/SWServer.h:
1565         (WebCore::SWServer::disableServiceWorkerProcessTerminationDelay):
1566         Add a way to disable the service worker termination delay to facilitate
1567         testing.
1568
1569         * workers/service/server/SWServerToContextConnection.h:
1570
1571 2018-03-23  Brady Eidson  <beidson@apple.com>
1572
1573         Go to back/forward list items after a process-swapped navigation.
1574         <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
1575
1576         Reviewed by Andy Estes.
1577
1578         Covered by new API test.
1579
1580         Most of the changes to WebCore are teaching HistoryItem navigations to know when they should
1581         do a policy check or not.
1582
1583         * WebCore.xcodeproj/project.pbxproj:
1584
1585         * history/BackForwardController.cpp:
1586         (WebCore::BackForwardController::goBackOrForward):
1587         (WebCore::BackForwardController::goBack):
1588         (WebCore::BackForwardController::goForward):
1589
1590         * history/HistoryItem.cpp:
1591         (WebCore::HistoryItem::setStateObject): Actually push state object changes to the UIProcess.
1592           This was a long standing bug that made it difficult to effectively test this change.
1593
1594         * loader/FrameLoader.cpp:
1595         (WebCore::FrameLoader::loadURLIntoChildFrame):
1596         (WebCore::FrameLoader::loadDifferentDocumentItem):
1597         (WebCore::FrameLoader::loadItem):
1598         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
1599         * loader/FrameLoader.h:
1600         * loader/FrameLoaderTypes.h:
1601
1602         * loader/HistoryController.cpp:
1603         (WebCore::HistoryController::goToItem):
1604         (WebCore::HistoryController::setDefersLoading):
1605         (WebCore::HistoryController::recursiveGoToItem):
1606         * loader/HistoryController.h:
1607
1608         * loader/NavigationPolicyCheck.h:
1609
1610         * page/Page.cpp:
1611         (WebCore::Page::goToItem):
1612         * page/Page.h:
1613
1614 2018-03-23  John Wilander  <wilander@apple.com>
1615
1616         Resource Load Statistics: Fix decoder key isPrevalentResource->isVeryPrevalentResource
1617         https://bugs.webkit.org/show_bug.cgi?id=183950
1618         <rdar://problem/38806275>
1619
1620         Reviewed by Brent Fulgham.
1621
1622         * loader/ResourceLoadStatistics.cpp:
1623         (WebCore::ResourceLoadStatistics::decode):
1624             Now isVeryPrevalentResource is decoded to the correct field.
1625
1626 2018-03-23  Youenn Fablet  <youenn@apple.com>
1627
1628         WebProcessPool should not ask to register all clients for each service worker process creation
1629         https://bugs.webkit.org/show_bug.cgi?id=183941
1630
1631         Reviewed by Chris Dumez.
1632
1633         Covered by existing unit tests.
1634         Register all Documents of a process no matter its session ID when asked to.
1635         Make sure that whenever a WebProcess is asked to do so, any further Document will be registered
1636         by calling setMayHaveRegisteredServiceWorkers().
1637         This ensures that a WebProcess created before any service worker but empty at the time a service worker is created
1638         will actually register all its future clients.
1639
1640         Add some assertions to ensure that a client is not registered twice.
1641
1642         * workers/service/ServiceWorkerProvider.cpp:
1643         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
1644         * workers/service/ServiceWorkerProvider.h:
1645         * workers/service/server/SWServer.cpp:
1646         (WebCore::SWServer::registerServiceWorkerClient):
1647
1648 2018-03-23  Eric Carlson  <eric.carlson@apple.com>
1649
1650         HTMLElement factory doesn't need to call MediaPlayer::isAvailable
1651         https://bugs.webkit.org/show_bug.cgi?id=183946
1652         <rdar://problem/38802687>
1653
1654         Reviewed by Youenn Fablet.
1655
1656         Test: media/media-disabled.html
1657
1658         * dom/make_names.pl:
1659         (printConstructorInterior):
1660         * page/Settings.yaml:
1661         * page/SettingsDefaultValues.h:
1662
1663 2018-03-23  David Kilzer  <ddkilzer@apple.com>
1664
1665         Stop using dispatch_set_target_queue()
1666         <https://webkit.org/b/183908>
1667         <rdar://problem/33553533>
1668
1669         Reviewed by Daniel Bates.
1670
1671         No new tests since no change in behavior.
1672
1673         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1674         (WebCore::globaVideoCaptureSerialQueue): Remove use of
1675         dispatch_set_target_queue() by changing dispatch_queue_create()
1676         to dispatch_queue_create_with_target().
1677
1678 2018-03-23  Youenn Fablet  <youenn@apple.com>
1679
1680         Use libwebrtc ObjectiveC H264 encoder and decoder
1681         https://bugs.webkit.org/show_bug.cgi?id=183912
1682
1683         Reviewed by Eric Carlson.
1684
1685         No observable change of behavior.
1686         Made use of libwebrtc WebKit utilities.
1687         Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.
1688
1689         * Configurations/WebCore.xcconfig:
1690         * SourcesCocoa.txt:
1691         * WebCore.xcodeproj/project.pbxproj:
1692         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
1693         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
1694         (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
1695         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
1696         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
1697         (WebCore::LibWebRTCProviderCocoa::setActive):
1698         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
1699         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
1700         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
1701         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
1702         * testing/Internals.cpp: Removed commented out include.
1703
1704 2018-03-23  Youenn Fablet  <youenn@apple.com>
1705
1706         DocumentThreadableLoader should send credentials after redirections and preflight if fetch option credentials is include
1707         https://bugs.webkit.org/show_bug.cgi?id=183928
1708
1709         Reviewed by Chris Dumez.
1710
1711         Tests: imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.html
1712                imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.worker.html
1713
1714         In case mode is include, keep sending credentials even after redirection with preflight.
1715
1716         * loader/DocumentThreadableLoader.cpp:
1717         (WebCore::DocumentThreadableLoader::redirectReceived):
1718
1719 2018-03-23  Tim Horton  <timothy_horton@apple.com>
1720
1721         Fix the build after r229858
1722
1723         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1724
1725 2018-03-23  Youenn Fablet  <youenn@apple.com>
1726
1727         Allow fully whitelisted plug-ins to match non HTTP URLs
1728         https://bugs.webkit.org/show_bug.cgi?id=183938
1729         rdar://problem/38534312
1730
1731         Reviewed by Chris Dumez.
1732
1733         Covered by manual testing and unit testing.
1734
1735         * platform/URL.cpp:
1736         (WebCore::URL::isMatchingDomain const):
1737
1738 2018-03-23  Youenn Fablet  <youenn@apple.com>
1739
1740         ActiveDOMObject should assert that they are destroyed in the thread they are created
1741         https://bugs.webkit.org/show_bug.cgi?id=183671
1742
1743         Reviewed by Chris Dumez.
1744
1745         No change of behavior.
1746         Moved MessagePort assertion to ActiveDOMObject.
1747
1748         * dom/ActiveDOMObject.cpp:
1749         (WebCore::ActiveDOMObject::~ActiveDOMObject):
1750         * dom/ActiveDOMObject.h:
1751         * dom/MessagePort.cpp:
1752         (WebCore::MessagePort::~MessagePort):
1753         * dom/MessagePort.h:
1754
1755 2018-03-23  Youenn Fablet  <youenn@apple.com>
1756
1757         Safari WebKitWebRTCAudioModule crash during <video> tag update when audio track present in MediaStream
1758         https://bugs.webkit.org/show_bug.cgi?id=181180
1759         <rdar://problem/36302375>
1760
1761         Reviewed by Eric Carlson.
1762
1763         Test: webrtc/video-update-often.html
1764
1765         AudioTrackPrivateMediaStreamCocoa needs to be destroyed in the main thread since it owns a Ref to its MediaStreamTrackPrivate.
1766         We can still ref it on a background thread but we always deref it on the main thread.
1767
1768         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1769         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1770         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
1771
1772 2018-03-23  Sergio Villar Senin  <svillar@igalia.com>
1773
1774         [css-grid] Fix auto repeat tracks computation with definite min sizes
1775         https://bugs.webkit.org/show_bug.cgi?id=183933
1776
1777         Reviewed by Javier Fernandez.
1778
1779         Indefinitely sized containers use the specified definite min-size (if any) as available
1780         space in order to compute the number of auto repeat tracks to create. A bug in that code was
1781         causing the grid to be one track larger than expected. That was only happening in the case
1782         of the free space being a multiple of the total size of the autorepeat tracks.
1783
1784         Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html
1785
1786         * rendering/RenderGrid.cpp:
1787         (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
1788
1789 2018-03-23  Miguel Gomez  <magomez@igalia.com>
1790
1791         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
1792         https://bugs.webkit.org/show_bug.cgi?id=183892
1793
1794         Reviewed by Žan Doberšek.
1795
1796         Always use RGBA format on BitmapTextureGL (when no other format is specifically requested). When
1797         the texture is updated from BGRA content, use a flag to indicate the shader to perform a color
1798         conversion during the painting. This way we don't need to swap the R and B components on the CPU.
1799         Also, remove one of the lists in BitmapTexturePool as now all of them have the same format, and
1800         remove the UpdateContentsFlag as we never need to modify the original image data.
1801
1802         Covered by existent tests.
1803
1804         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1805         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
1806         * platform/graphics/texmap/BitmapTexture.cpp:
1807         (WebCore::BitmapTexture::updateContents):
1808         * platform/graphics/texmap/BitmapTexture.h:
1809         * platform/graphics/texmap/BitmapTextureGL.cpp:
1810         (WebCore::BitmapTextureGL::BitmapTextureGL):
1811         (WebCore::BitmapTextureGL::didReset):
1812         (WebCore::BitmapTextureGL::updateContents):
1813         (WebCore::BitmapTextureGL::applyFilters):
1814         (WebCore::swizzleBGRAToRGBA): Deleted.
1815         (WebCore::BitmapTextureGL::updateContentsNoSwizzle): Deleted.
1816         * platform/graphics/texmap/BitmapTextureGL.h:
1817         (WebCore::BitmapTextureGL::colorConvertFlags const):
1818         * platform/graphics/texmap/BitmapTexturePool.cpp:
1819         (WebCore::BitmapTexturePool::acquireTexture):
1820         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
1821         * platform/graphics/texmap/BitmapTexturePool.h:
1822         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1823         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
1824         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
1825         (WebCore::TextureMapperContextAttributes::get):
1826         * platform/graphics/texmap/TextureMapperContextAttributes.h:
1827         * platform/graphics/texmap/TextureMapperGL.cpp:
1828         (WebCore::TextureMapperGL::drawNumber):
1829         (WebCore::TextureMapperGL::drawTexture):
1830         * platform/graphics/texmap/TextureMapperGL.h:
1831         * platform/graphics/texmap/TextureMapperLayer.cpp:
1832         (WebCore::TextureMapperLayer::paintIntoSurface):
1833         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1834         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
1835         * platform/graphics/texmap/TextureMapperTile.cpp:
1836         (WebCore::TextureMapperTile::updateContents):
1837         * platform/graphics/texmap/TextureMapperTile.h:
1838         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
1839         (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
1840         (WebCore::TextureMapperTiledBackingStore::updateContents):
1841         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
1842
1843 2018-03-23  Yusuke Suzuki  <utatane.tea@gmail.com>
1844
1845         [WTF] Add standard containers with FastAllocator specialization
1846         https://bugs.webkit.org/show_bug.cgi?id=183789
1847
1848         Reviewed by Darin Adler.
1849
1850         * Modules/indexeddb/IDBKeyData.h:
1851         * Modules/mediasource/SampleMap.h:
1852         * Modules/mediasource/SourceBuffer.cpp:
1853         * Modules/webauthn/cbor/CBORValue.h:
1854         It did not use FastAllocator for its container.
1855
1856         * page/WheelEventTestTrigger.h:
1857         * platform/audio/PlatformMediaSessionManager.h:
1858         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
1859         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1860         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1861         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1862         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1863         (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
1864         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1865         * platform/wpe/PlatformPasteboardWPE.cpp:
1866         * rendering/OrderIterator.h:
1867
1868 2018-03-23  Antoine Quint  <graouts@apple.com>
1869
1870         [Web Animations] infinite repeat counts aren't reflected for CSS Animations
1871         https://bugs.webkit.org/show_bug.cgi?id=183932
1872
1873         Reviewed by Dean Jackson.
1874
1875         The "infinite" value for animation-repeat-count is reflected as a special value which resolves to -1. We need to check
1876         for this special value before setting the iterations count on the AnimationEffectTimingReadOnly object.
1877
1878         * animation/CSSAnimation.cpp:
1879         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
1880
1881 2018-03-22  Antoine Quint  <graouts@apple.com>
1882
1883         [Web Animations] Correctly cancel animations when a parent gets a "display: none" style or when an element is removed
1884         https://bugs.webkit.org/show_bug.cgi?id=183919
1885
1886         Reviewed by Dean Jackson.
1887
1888         The old CSSAnimationController provided a cancelAnimations(Element&) method that allowed for animations for a given element
1889         to be canceled when a parent element in the hierarchy gets a "display: none" style or if an element with animations is removed.
1890         We add a similar cancelAnimationsForElement(Element&) method on AnimationTimeline and update CSSAnimationController::cancelAnimations()
1891         call sites to use AnimationTimeline::cancelAnimationsForElement() when the flag to use Web Animations is on.
1892
1893         * animation/AnimationTimeline.cpp:
1894         (WebCore::AnimationTimeline::cancelAnimationsForElement): Iterate over all animations for the provided element and call cancel() on them.
1895         * animation/AnimationTimeline.h:
1896         * animation/DocumentTimeline.cpp:
1897         (WebCore::DocumentTimeline::animatedStyleForRenderer): Drive-by fix while I was reviewed call sites to animationsForElement() to make
1898         sure we don't create extra RefPtr<> objects.
1899         * dom/Element.cpp:
1900         (WebCore::Element::removedFromAncestor): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when an
1901         element is removed.
1902         * dom/PseudoElement.cpp:
1903         (WebCore::PseudoElement::clearHostElement): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when
1904         a pseudo-element is removed.
1905         * rendering/updating/RenderTreeUpdater.cpp:
1906         (WebCore::RenderTreeUpdater::tearDownRenderers): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on
1907         for all children elements when an element gets a "display: none" style.
1908
1909 2018-03-23  Antoine Quint  <graouts@apple.com>
1910
1911         [Web Animations] Animated transform styles are ignored when calling getComputedStyle()
1912         https://bugs.webkit.org/show_bug.cgi?id=183918
1913
1914         Reviewed by Dean Jackson.
1915
1916         Strictly looking at whether the renderer has a transform is a bad idea when determining whether a
1917         transform is applied for an element. Looking at the RenderStyle is preferable because in the case
1918         of animations running on the compositor, such as a transform-only animation or transition, the
1919         renderer doesn't necessarily have a transform style on it, since we don't blend properties in
1920         software as the animation progresses. Instead, all of the blending is performed by the compositor,
1921         and only the computed style object has the software-blended transform style on it.
1922
1923         We do need to account for inline renderers though as these do not support transforms.
1924
1925         * css/CSSComputedStyleDeclaration.cpp:
1926         (WebCore::computedTransform):
1927
1928 2018-03-22  Antoine Quint  <graouts@apple.com>
1929
1930         [Web Animations] Support "transition: all" for CSS Transitions as Web Animations
1931         https://bugs.webkit.org/show_bug.cgi?id=183917
1932
1933         Reviewed by Dean Jackson.
1934
1935         We now support "transition: all" CSS Transitions by iterating over all known CSS properties should the mode
1936         of the backing animation be AnimateAll. Any property that we find to have a different value in the previous
1937         and current style will have a backing CSSTransition object created for it. To support this, we now explicitly
1938         provide a CSSPropertyID when creating a CSSTransition since we can no longer infer the transition property
1939         from the backing animation, as Animation objects with mode AnimateAll report CSSPropertyInvalid as their
1940         property.
1941
1942         * animation/AnimationTimeline.cpp:
1943         (WebCore::shouldBackingAnimationBeConsideredForCSSTransition): New method that checks whether a given backing
1944         Animation object is suitable for consideration as a CSSTransition, where the mode must not be either AnimateNone
1945         or AnimateUnknownProperty, and should the mode be AnimateSingleProperty, the property must not be CSSPropertyInvalid.
1946         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): We now assemble the list of previously animated
1947         properties by looking at the m_elementToCSSTransitionByCSSPropertyID map and getting its keys. Then we compile
1948         all backing Animation objects found in the old style that match the conditions enforced by the new method
1949         shouldBackingAnimationBeConsideredForCSSTransition(). Then as we iterate over backing Animation objects found
1950         in the new style, we iterate over all known CSS properties if the mode is AnimateAll, indicating that we're dealing
1951         with a "transition: all" style. If we're dealing with a single property, we only process that single property.
1952         * animation/CSSTransition.cpp:
1953         (WebCore::CSSTransition::create): Expect a new CSSPropertyID parameter when creating a new CSSTransition since
1954         we can no longer infer it from the backing Animation object.
1955         (WebCore::CSSTransition::CSSTransition): Expect a new CSSPropertyID parameter when creating a new CSSTransition
1956         since we can no longer infer it from the backing Animation object.
1957         (WebCore::CSSTransition::matchesBackingAnimationAndStyles const): We can no longer use the == overloaded operator
1958         for backing Animation objects to determine whether their respective properties match since this would compare the
1959         "property" member of both Animation objects and when going from a "transition: all" style to one targeting a single
1960         property, we would falsely identify mis-matching Animation objects. Instead, we pass a false flag to animationsMatch()
1961         which indicates that we don't care about matching the transition property itself.
1962         * animation/CSSTransition.h: Expose a new property() accessor which returns the CSSPropertyID passed at construction.
1963         * animation/KeyframeEffectReadOnly.cpp:
1964         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes): Use the new property() accessor on
1965         CSSTransition to get at the transition property.
1966         * platform/animation/Animation.cpp:
1967         (WebCore::Animation::animationsMatch const): Replace the boolean parameter, which was not in use in WebCore, to indicate
1968         whether we should match the property-related fields. We need this in CSSTransition::matchesBackingAnimationAndStyles().
1969         * platform/animation/Animation.h:
1970
1971 2018-03-22  Tim Horton  <timothy_horton@apple.com>
1972
1973         Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebCore
1974         https://bugs.webkit.org/show_bug.cgi?id=183930
1975         <rdar://problem/38782249>
1976
1977         Reviewed by Dan Bernstein.
1978
1979         * Configurations/Base.xcconfig:
1980         * Configurations/WebCore.xcconfig:
1981         * Configurations/WebCoreTestSupport.xcconfig:
1982
1983 2018-03-22  Commit Queue  <commit-queue@webkit.org>
1984
1985         Unreviewed, rolling out r229876.
1986         https://bugs.webkit.org/show_bug.cgi?id=183929
1987
1988         Some webrtc tests are timing out on iOS simulator (Requested
1989         by youenn on #webkit).
1990
1991         Reverted changeset:
1992
1993         "Use libwebrtc ObjectiveC H264 encoder and decoder"
1994         https://bugs.webkit.org/show_bug.cgi?id=183912
1995         https://trac.webkit.org/changeset/229876
1996
1997 2018-03-22  Megan Gardner  <megan_gardner@apple.com>
1998
1999         Expose more system colors via CSS
2000         https://bugs.webkit.org/show_bug.cgi?id=183764
2001         <rdar://problem/36975898>
2002
2003         Reviewed by Tim Horton.
2004
2005         Test: fast/css/apple-system-control-colors.html
2006
2007         Expose Apple specific system colors via CSS.
2008
2009         * rendering/RenderThemeMac.mm:
2010         (WebCore::RenderThemeMac::systemColor const):
2011
2012 2018-03-22  Nan Wang  <n_wang@apple.com>
2013
2014         AX: Web table row count is incorrect when role row is added to <tr> in DOM
2015         https://bugs.webkit.org/show_bug.cgi?id=183922
2016
2017         Reviewed by Chris Fleizach.
2018
2019         Although the parent table for an ARIA grid row should be an ARIA table, we
2020         should return the native table if the row is native <tr>.
2021
2022         Test: accessibility/row-with-aria-role-in-native-table.html
2023
2024         * accessibility/AccessibilityARIAGridRow.cpp:
2025         (WebCore::AccessibilityARIAGridRow::parentTable const):
2026
2027 2018-03-22  Chris Dumez  <cdumez@apple.com>
2028
2029         Include security origin in the service worker process name
2030         https://bugs.webkit.org/show_bug.cgi?id=183913
2031
2032         Reviewed by Youenn Fablet.
2033
2034         Updated localizable strings.
2035
2036         * English.lproj/Localizable.strings:
2037
2038 2018-03-22  Youenn Fablet  <youenn@apple.com>
2039
2040         Use libwebrtc ObjectiveC H264 encoder and decoder
2041         https://bugs.webkit.org/show_bug.cgi?id=183912
2042
2043         Reviewed by Eric Carlson.
2044
2045         No observable change of behavior.
2046         Made use of libwebrtc WebKit utilities.
2047         Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.
2048
2049         * Configurations/WebCore.xcconfig:
2050         * SourcesCocoa.txt:
2051         * WebCore.xcodeproj/project.pbxproj:
2052         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2053         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
2054         (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
2055         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
2056         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2057         (WebCore::LibWebRTCProviderCocoa::setActive):
2058         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
2059         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
2060         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
2061         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
2062         * testing/Internals.cpp: Removed commented out include.
2063
2064 2018-03-22  Michael Catanzaro  <mcatanzaro@gnome.org>
2065
2066         Unreviewed, fix format string warnings in service worker code
2067
2068         On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
2069
2070         * workers/service/ServiceWorkerContainer.cpp:
2071         (WebCore::ServiceWorkerContainer::addRegistration):
2072         (WebCore::ServiceWorkerContainer::removeRegistration):
2073         (WebCore::ServiceWorkerContainer::updateRegistration):
2074         (WebCore::ServiceWorkerContainer::jobFailedWithException):
2075         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2076         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
2077         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
2078         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2079         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2080
2081 2018-03-22  Daniel Bates  <dabates@apple.com>
2082
2083         Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
2084         https://bugs.webkit.org/show_bug.cgi?id=183907
2085         <rdar://problem/38759127>
2086
2087         Reviewed by Alex Christensen.
2088
2089         Exports SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() so that we can use it from WebKit.
2090
2091         * platform/SchemeRegistry.h:
2092
2093 2018-03-22  Daniel Bates  <dabates@apple.com>
2094
2095         CSS mask images should be retrieved using potentially CORS-enabled fetch
2096         https://bugs.webkit.org/show_bug.cgi?id=179983
2097         <rdar://problem/35678149>
2098
2099         Reviewed by Brent Fulgham.
2100
2101         As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor's Draft, 23 December 2017)
2102         we should fetch CSS mask images using a potentially CORS-enabled fetch.
2103
2104         Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
2105         attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
2106         For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
2107         fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
2108         closely align with the behavior in the spec.
2109
2110         Test: http/tests/security/css-mask-image.html
2111
2112         * style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
2113         LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
2114         in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
2115         (WebCore::Style::loadPendingImage): Ditto.
2116         (WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
2117         a mask image or shape-outside image.
2118
2119 2018-03-22  Zalan Bujtas  <zalan@apple.com>
2120
2121         [Simple line layout] Text with letter spacing is not positioned properly.
2122         https://bugs.webkit.org/show_bug.cgi?id=183079
2123         <rdar://problem/38762569>
2124
2125         Reviewed by Antti Koivisto.
2126
2127         We need to recompute RenderText::m_canUseSimplifiedTextMeasuring when the font cascade changes
2128         since we might not be able to use the fast path anymore.
2129
2130         Test: fast/text/simple-line-layout-dynamic-letter-word-spacing.html
2131
2132         * rendering/RenderText.cpp:
2133         (WebCore::RenderText::styleDidChange):
2134
2135 2018-03-21  Antoine Quint  <graouts@apple.com>
2136
2137         [Web Animations] Make imported/mozilla/css-animations/test_event-dispatch.html pass reliably
2138         https://bugs.webkit.org/show_bug.cgi?id=183845
2139
2140         Reviewed by Dean Jackson.
2141
2142         Finish the work to get DOM events for CSS Animations and CSS Transitions dispatching as specified.
2143
2144         * animation/AnimationEffectReadOnly.cpp: Move timeEpsilon to be shared as part of WebAnimationUtilities.h since we now need it in
2145         WebAnimation::timeToNextRequiredTick().
2146         * animation/AnimationTimeline.cpp:
2147         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): We add a pre-emptive return clause when we know that the AnimationList
2148         for previous and current styles are a match.
2149         * animation/CSSTransition.cpp:
2150         (WebCore::CSSTransition::matchesBackingAnimationAndStyles const): Ensure we have a valid effect before downcasting it.
2151         * animation/DeclarativeAnimation.cpp:
2152         (WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
2153         playState is set correctly and the animation is not idle.
2154         * animation/DocumentTimeline.cpp:
2155         (WebCore::DocumentTimeline::updateAnimationSchedule): We no longer need to pass the current time to timeToNextRequiredTick() since the method has
2156         been reworked to use the animation's current time, which is based on the timeline's current time.
2157         (WebCore::DocumentTimeline::updateAnimations): Avoid creating a copy when iterating over pending hardware animations.
2158         * animation/KeyframeEffectReadOnly.cpp:
2159         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): We should never generate new blending keyframes if the
2160         old and new styles contain the same value, since there would be no transition between two equal values, and we should only look at whether the new
2161         style value and the recorded target value differ to determine if new blending keyframes are necessary.
2162         * animation/WebAnimation.cpp:
2163         (WebCore::WebAnimation::timeToNextRequiredTick const): We correct our scheduling code which was shown to be broken in several of the newly-imported
2164         Mozilla tests. Any running animation is now scheduled to invalidate again on the next tick, and we use timeEpsilon from WebAnimationUtilities.h to
2165         correctly check if we're right at the active threshold, when we also invalidate on the next tick. If our current time is negative, in other words
2166         when the animation has not yet started, we schedule this animation's next tick to be the negative of that value. In all other cases, no invalidation
2167         needs to be scheduled.
2168         * animation/WebAnimation.h: We move updateFinishedState() to private since this method is not actually used outside of WebAnimation.cpp.
2169         * animation/WebAnimationUtilities.h: Move timeEpsilon to be shared as part of WebAnimationUtilities.h.
2170
2171 2018-03-22  Tim Horton  <timothy_horton@apple.com>
2172
2173         Improve readability of WebCore's OTHER_LDFLAGS
2174         https://bugs.webkit.org/show_bug.cgi?id=183909
2175         <rdar://problem/38760992>
2176
2177         Reviewed by Dan Bernstein.
2178
2179         * Configurations/Base.xcconfig:
2180         * Configurations/FeatureDefines.xcconfig:
2181         * Configurations/WebCore.xcconfig:
2182
2183 2018-03-22  Tim Horton  <timothy_horton@apple.com>
2184
2185         Adopt USE(OPENGL[_ES]) in more places
2186         https://bugs.webkit.org/show_bug.cgi?id=183882
2187         <rdar://problem/37912195>
2188
2189         Reviewed by Dan Bernstein.
2190
2191         * platform/graphics/GraphicsContext3D.h:
2192         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2193         (WebCore::hasMuxableGPU):
2194         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
2195         (WebCore::GraphicsContext3D::GraphicsContext3D):
2196         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2197         (WebCore::GraphicsContext3D::makeContextCurrent):
2198         (WebCore::GraphicsContext3D::checkGPUStatus):
2199         (WebCore::GraphicsContext3D::texImageIOSurface2D):
2200         * platform/graphics/cocoa/WebGLLayer.h:
2201         * platform/graphics/cocoa/WebGLLayer.mm:
2202         (-[WebGLLayer initWithGraphicsContext3D:]):
2203         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
2204         (-[WebGLLayer display]):
2205         * platform/graphics/ios/GraphicsContext3DIOS.h:
2206         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
2207         (WebCore::Extensions3DOpenGL::blitFramebuffer):
2208         (WebCore::Extensions3DOpenGL::createVertexArrayOES):
2209         (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
2210         (WebCore::Extensions3DOpenGL::isVertexArrayOES):
2211         (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
2212         * platform/graphics/opengl/Extensions3DOpenGL.h:
2213         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2214         (WebCore::GraphicsContext3D::reshapeFBOs):
2215         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
2216         (WebCore::GraphicsContext3D::renderbufferStorage):
2217         (WebCore::GraphicsContext3D::getIntegerv):
2218         (WebCore::GraphicsContext3D::texImage2D):
2219         (WebCore::GraphicsContext3D::depthRange):
2220         (WebCore::GraphicsContext3D::clearDepth):
2221         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2222         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2223         Make it a bit more clear which code is platform-dependent and which code is GL/GLES-dependent.
2224
2225 2018-03-22  Zan Dobersek  <zdobersek@igalia.com>
2226
2227         [TexMap] Make TextureMapperContextAttributes thread-specific
2228         https://bugs.webkit.org/show_bug.cgi?id=183895
2229
2230         Reviewed by Carlos Garcia Campos.
2231
2232         Store the TextureMapperContextAttributes in a thread-specific manner.
2233         The TextureMapperContextAttributes::get() method is now used to retrieve
2234         a reference to that thread-specific object. If it's not been initialized
2235         yet, then the current GL context is used for the initialization, as it
2236         used to be done in the now-removed initialize() method.
2237
2238         TextureMapperPlatformLayerBuffer::clone() method now doesn't need to
2239         be passed a TextureMapperGL object, since the texture can be created
2240         directly by calling BitmapTextureGL::create(), passing the
2241         TextureMapperContextAttributes object that's retrieved from the
2242         thread-specific storage. This further simplifies the
2243         TextureMapperPlatformLayerProxy::Compositor interface, removing the
2244         texmapGL() getter from it.
2245
2246         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2247         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2248         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
2249         (WebCore::threadSpecificAttributes):
2250         (WebCore::TextureMapperContextAttributes::get):
2251         (WebCore::TextureMapperContextAttributes::initialize): Deleted.
2252         * platform/graphics/texmap/TextureMapperContextAttributes.h:
2253         * platform/graphics/texmap/TextureMapperGL.cpp:
2254         (WebCore::TextureMapperGL::TextureMapperGL):
2255         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2256         (WebCore::TextureMapperPlatformLayerBuffer::clone):
2257         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2258         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2259         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
2260         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2261
2262 2018-03-22  Zalan Bujtas  <zalan@apple.com>
2263
2264         SVG root is skipped while marking percentage height descendants dirty.
2265         https://bugs.webkit.org/show_bug.cgi?id=183877
2266
2267         Reviewed by Antti Koivisto.
2268
2269         Calling continingBlock() to get to the correct container works as long as the ancestor inline element
2270         renderers are wrapped in anonymous blocks (continuation for example).
2271
2272         While the SVG root renderer is an inline renderer, it is not wrapped or normalized in any way,
2273         so containingBlock() will elegantly skip it and return an SVG root ancestor.
2274         dirtyForLayoutFromPercentageHeightDescendants calls containingBlock() to walk up
2275         on the ancestor chain to mark elements dirty. This fails when there's an SVG subtree in the block chain.
2276         This patch marks the SVG subtree chain dirty to ensure that layout will get to all the dirty leaf renderers 
2277         (note that the SVG subtree is supposed to have only statically positioned elements so parent == containing block).
2278
2279         Covered by existing tests.
2280
2281         * rendering/RenderBlock.cpp:
2282         (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
2283
2284 2018-03-22  Adrian Perez de Castro  <aperez@igalia.com>
2285
2286         [WPE][GTK] Build failure when ENABLE_VIDEO, ENABLE_WEB_AUDIO and ENABLE_XSLT are disabled
2287         https://bugs.webkit.org/show_bug.cgi?id=183896
2288
2289         Reviewed by Yusuke Suzuki.
2290
2291         No new tests needed.
2292
2293         * bindings/js/JSWebAnimationCustom.cpp: Add missing #include of Document.h
2294
2295 2018-03-21  Chris Dumez  <cdumez@apple.com>
2296
2297         Regression(r229828): WebKit.NoHistoryItemScrollToFragment API test is failing on iOS
2298         https://bugs.webkit.org/show_bug.cgi?id=183886
2299
2300         Reviewed by Wenson Hsieh.
2301
2302         Since r229828, the FrameLoader needs to call FrameLoaderClient::didDecidePolicyForNavigationAction()
2303         whenever a navigation policy decision is made. I added such a call r229828 to
2304         FrameLoader::continueLoadAfterNavigationPolicy() but forgot to add one to
2305         FrameLoader::continueFragmentScrollAfterNavigationPolicy(), which is the equivalent
2306         for fragment navigations.
2307
2308         * loader/FrameLoader.cpp:
2309         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
2310
2311 2018-03-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
2312
2313         Disconnect the SVGPathSegList items from their SVGPathElement before rebuilding a new list
2314         https://bugs.webkit.org/show_bug.cgi?id=183723
2315         <rdar://problem/38517871>
2316
2317         Reviewed by Daniel Bates.
2318
2319         When setting the "d" attribute directly on a path, we rebuild the list
2320         of path segments held for creating the property tear off. The old path
2321         segments need to get disconnected from the path element. We already do 
2322         that when a path segment is replaced or removed.
2323
2324         Test: svg/dom/reuse-pathseg-after-changing-d.html
2325
2326         * svg/SVGPathElement.cpp:
2327         (WebCore::SVGPathElement::svgAttributeChanged):
2328         * svg/SVGPathSegList.cpp:
2329         (WebCore::SVGPathSegList::clear): SVGPathSegListValues::clearContextAndRoles()
2330         will now be called from SVGPathSegListValues::clear() via SVGListProperty::clearValues().
2331         (WebCore::SVGPathSegList::replaceItem):
2332         (WebCore::SVGPathSegList::removeItem):
2333         (WebCore::SVGPathSegList::clearContextAndRoles): Deleted.
2334         * svg/SVGPathSegList.h: SVGPathSegListValues::clearContextAndRoles() will
2335         now be called from SVGPathSegListValues::clear() via SVGListProperty::initializeValues().
2336         * svg/SVGPathSegListValues.cpp:
2337         (WebCore::SVGPathSegListValues::clearItemContextAndRole):
2338         (WebCore::SVGPathSegListValues::clearContextAndRoles):
2339         * svg/SVGPathSegListValues.h:
2340         (WebCore::SVGPathSegListValues::operator=):
2341         (WebCore::SVGPathSegListValues::clear):
2342
2343 2018-03-21  Antoine Quint  <graouts@apple.com>
2344
2345         [Web Animations] Ensure animationcancel and transitioncancel events are dispatched
2346         https://bugs.webkit.org/show_bug.cgi?id=183864
2347
2348         Reviewed by Dean Jackson.
2349
2350         In order to correctly dispatch animationcancel and transitioncancel events, we must call cancel() on CSSAnimation and CSSTransitions
2351         objects that are removed while in a play or pause phase. Additionally, we cancel declarative animations that are moving from a valid
2352         to a null timeline. Finally, when cancel() is called on a declarative animation, we record the timestamp and manually call
2353         invalidateDOMEvents() passing that timestamp in to ensure that the right phase change is recorded and results in the queuing of
2354         animationcancel and transitioncancel events.
2355
2356         * animation/AnimationTimeline.cpp:
2357         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Make sure we cancel all recorded CSS Animations when we newly get a
2358         "display: none" style. We also call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing animations outright,
2359         for all animations that previously existed but are no longer listed in the current style.
2360         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Like in updateCSSAnimationsForElement(), we cancel all recorded CSS
2361         Transitions when we newly get a "display: none" style. We now use the refactored removeDeclarativeAnimation() method to remove an
2362         a transition for a property that was already transitioned in the previous style but has a new backing Animation object. Finally,
2363         like in updateCSSAnimationsForElement(), we call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing transitions
2364         outright, for all transitions that previously existed but are no longer listed in the current style.
2365         (WebCore::AnimationTimeline::removeDeclarativeAnimation): Refactor code into this new method to remove a declarative animation.
2366         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Cancels a DeclarativeAnimation if it's active or removes it right away.
2367         * animation/AnimationTimeline.h:
2368         * animation/DeclarativeAnimation.cpp:
2369         (WebCore::DeclarativeAnimation::setTimeline): If we're moving from a valid timeline to a null timeline, call cancel() on this animation
2370         such that an animationcancel or transitioncancel event can be dispatched.
2371         (WebCore::DeclarativeAnimation::cancel): Cancelations require the computation of the time at which a declarative animation was canceled,
2372         so we record the animation's active time as it's canceled and manually call invalidateDOMEvents() with that time after the general cancel()
2373         code has run.
2374         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Accept an explicit timestamp for cancel events.
2375         * animation/DeclarativeAnimation.h:
2376         * animation/WebAnimation.h:
2377
2378 2018-03-21  Chris Dumez  <cdumez@apple.com>
2379
2380         ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
2381         https://bugs.webkit.org/show_bug.cgi?id=183787
2382
2383         Reviewed by Wenson Hsieh.
2384
2385         * loader/FrameLoader.cpp:
2386         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2387         * loader/FrameLoaderClient.h:
2388
2389 2018-03-21  Eric Carlson  <eric.carlson@apple.com>
2390
2391         Clean up platform VideoFullscreenLayerManager
2392         https://bugs.webkit.org/show_bug.cgi?id=183859
2393         <rdar://problem/38715419>
2394
2395         Reviewed by Jer Noble.
2396
2397         No new tests, no functional change.
2398
2399         * WebCore.xcodeproj/project.pbxproj:
2400         * platform/graphics/VideoFullscreenLayerManager.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h.
2401         (WebCore::VideoFullscreenLayerManager::~VideoFullscreenLayerManager):
2402         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2403         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2404         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2405         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2406         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
2407         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer const):
2408         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2409         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
2410         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
2411         (WebCore::MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation const):
2412         (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
2413         (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
2414         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2415         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2416         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2417         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformLayer const):
2418         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
2419         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer):
2420         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
2421         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenFrame):
2422         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::requiresTextTrackRepresentation const):
2423         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::syncTextTrackBounds):
2424         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation):
2425         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2426         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2427         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
2428         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
2429         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers):
2430         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer const):
2431         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
2432         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenFrame):
2433         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h.
2434         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm.
2435         (-[WebVideoContainerLayer setBounds:]):
2436         (-[WebVideoContainerLayer setPosition:]):
2437         (WebCore::VideoFullscreenLayerManagerObjC::VideoFullscreenLayerManagerObjC):
2438         (WebCore::VideoFullscreenLayerManagerObjC::setVideoLayer):
2439         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
2440         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame):
2441         (WebCore::VideoFullscreenLayerManagerObjC::didDestroyVideoLayer):
2442         (WebCore::VideoFullscreenLayerManagerObjC::requiresTextTrackRepresentation const):
2443         (WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds):
2444         (WebCore::VideoFullscreenLayerManagerObjC::setTextTrackRepresentation):
2445
2446 2018-03-21  Antoine Quint  <graouts@apple.com>
2447
2448         [Web Animations] Dispatch DOM events for CSS Transitions and CSS Animations implemented as Web Animations
2449         https://bugs.webkit.org/show_bug.cgi?id=183781
2450
2451         Reviewed by Dean Jackson.
2452
2453         Now that we've implemented CSS Animations and CSS Transitions as Web Animations (webkit.org/b/183504) we can dispatch DOM events
2454         for targets of DeclarativeAnimation objects. To do that, we add a new invalidateDOMEvents() method on DeclarativeAnimations which
2455         is called when the timer scheduled after the timing model has been invalidated fires in DocumentTimeline::performInvalidationTask().
2456         When we check for DOM events to dispatch, we look at the last recorded phase and iteration and determine whether the state of the
2457         animation has changed. We use a GenericEventQueue to enqueue the events such that they are dispatched asynchronously at a moment
2458         when it is safe to evaluate script.
2459
2460         * animation/AnimationEffectReadOnly.h: Make currentIteration() public since we now need it in DeclarativeAnimation::invalidateDOMEvents().
2461         * animation/CSSAnimation.cpp:
2462         (WebCore::CSSAnimation::create): Pass the animation target to the constructor instead of its document.
2463         (WebCore::CSSAnimation::CSSAnimation): Pass the animation target to the superclass instead of its document.
2464         * animation/CSSAnimation.h:
2465         * animation/CSSTransition.cpp:
2466         (WebCore::CSSTransition::create): Pass the animation target to the constructor instead of its document.
2467         (WebCore::CSSTransition::CSSTransition): Pass the animation target to the superclass instead of its document.
2468         * animation/CSSTransition.h:
2469         * animation/DeclarativeAnimation.cpp:
2470         (WebCore::DeclarativeAnimation::DeclarativeAnimation): Expect an Element instead of a Document and use that element as the target of the
2471         GenericEventQueue that we initialize. We also register this element as our m_target.
2472         (WebCore::DeclarativeAnimation::~DeclarativeAnimation): Close the GenericEventQueue member upon destruction.
2473         (WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
2474         playState is set correctly and the animation is not idle.
2475         (WebCore::DeclarativeAnimation::phaseWithoutEffect const): Because we may need to get an animation's current phase in invalidateDOMEvents()
2476         after an animation's effect has been removed, we provide an alternate way to compute the phase just by looking at the animation's current time.
2477         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Based on the previous and current pending state, iteration and phase, we enqueue animation
2478         and transition DOM events as specified by the CSS Animations Level 2 and CSS Transitions Level 2 specifications.
2479         (WebCore::DeclarativeAnimation::enqueueDOMEvent): Enqueue an event on the GenericEventQueue based on the animation type.
2480         * animation/DeclarativeAnimation.h:
2481         * animation/DocumentTimeline.cpp:
2482         (WebCore::DocumentTimeline::performInvalidationTask): We call invalidateDOMEvents() on all declarative animations registered with this timeline
2483         now that the timing model has been invalidated.
2484         * dom/EventNames.h: Add the names of newly-implemented events (animationcancel, transitioncancel, transitionrun and transitionstart).
2485         * dom/GlobalEventHandlers.idl: Add new attribute-based event handlers for the newly-implemented events.
2486         * html/HTMLAttributeNames.in: Add new attribute-based event handlers for the newly-implemented events.
2487         * html/HTMLElement.cpp:
2488         (WebCore::HTMLElement::createEventHandlerNameMap): Add new attribute-based event handlers for the newly-implemented events.
2489
2490 2018-03-21  Per Arne Vollan  <pvollan@apple.com>
2491
2492         Compile error when not using IOSurface canvas backing store.
2493         https://bugs.webkit.org/show_bug.cgi?id=183855
2494
2495         Reviewed by Brent Fulgham.
2496
2497         The method IOSurface::createFromImageBuffer is only referenced when IOSurface
2498         is used as canvas backing store.
2499
2500         * platform/graphics/cocoa/IOSurface.h:
2501         * platform/graphics/cocoa/IOSurface.mm:
2502
2503 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2504
2505         [CoordGraphics] Track dirty rects that need update in CoordinatedGraphicsLayer
2506         https://bugs.webkit.org/show_bug.cgi?id=175376
2507
2508         Reviewed by Carlos Garcia Campos.
2509
2510         Follow the GraphicsLayerCA class and track rectangles in need of display
2511         in a Vector object. In case the whole layer needs updating, it's marked
2512         separately, and further rects are ignored.
2513
2514         During layer flush, all the rects are used to invalidate the backing
2515         store, or a single layer-sized rect is used in case the whole layer has
2516         to be updated. We can also bail early from updateContentBuffers() if
2517         there are no dirty rects recorded and there's no pending visible rect
2518         adjustment.
2519
2520         At the end of updateContentBuffers() we now test for an existing
2521         previous backing store before inquiring the backing store if the visible
2522         area is already covered, enabling deletion of this backing store.
2523
2524         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2525         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplay):
2526         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):
2527         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
2528         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2529
2530 2018-03-21  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2531
2532         [WPE] Build failure with ENABLE_VIDEO=OFF when GStreamer is not available
2533         https://bugs.webkit.org/show_bug.cgi?id=183811
2534
2535         Reviewed by Philippe Normand.
2536
2537         Add build guards for USE_GSTREAMER.
2538
2539         No new tests, it is a build fix.
2540
2541         * platform/graphics/gstreamer/GStreamerUtilities.h:
2542
2543 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2544
2545         [Cairo] Draw Cairo patterns with cairo_paint_with_alpha()
2546         https://bugs.webkit.org/show_bug.cgi?id=183774
2547
2548         Reviewed by Carlos Garcia Campos.
2549
2550         In the drawPatternToCairoContext() helper in CairoOperations.cpp source
2551         file, always clip the painting region to the specified rectangle and
2552         then use cairo_paint_with_alpha() to paint the passed-in pattern object,
2553         not relaying rasterization to cairo_fill() when using opaque alpha. We
2554         still clamp the alpha value to the 0.0 - 1.0 range.
2555
2556         No new tests -- no change in behavior.
2557
2558         * platform/graphics/cairo/CairoOperations.cpp:
2559         (WebCore::Cairo::drawPatternToCairoContext):
2560
2561 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2562
2563         [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
2564         https://bugs.webkit.org/show_bug.cgi?id=183771
2565
2566         Reviewed by Carlos Garcia Campos.
2567
2568         TextureMapperLayer::applyAnimationsRecursively() should return true when
2569         the TextureMapperLayer tree has currently-running animations that
2570         require continuous scene update.
2571
2572         TextureMapperAnimation::ApplicationResult gains the hasRunningAnimation
2573         member that's set to true if any of the applied animations are still in
2574         playing state. That information is then returned in syncAnimations(),
2575         and the result is accumulated in the top applyAnimationsRecursively()
2576         call and returned there to the caller.
2577
2578         No new tests -- no change in behavior.
2579
2580         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2581         (WebCore::TextureMapperAnimation::apply):
2582         * platform/graphics/texmap/TextureMapperAnimation.h:
2583         * platform/graphics/texmap/TextureMapperLayer.cpp:
2584         (WebCore::TextureMapperLayer::applyAnimationsRecursively):
2585         (WebCore::TextureMapperLayer::syncAnimations):
2586         * platform/graphics/texmap/TextureMapperLayer.h:
2587
2588 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2589
2590         Use-after-move in SWContextManager::terminateWorker() with Linux x86_64 calling convention
2591         https://bugs.webkit.org/show_bug.cgi?id=183783
2592
2593         Reviewed by Chris Dumez.
2594
2595         In SWContextManager::terminateWorker(), some calling conventions can
2596         end up moving the ServiceWorkerThreadProxy RefPtr into the lambda struct
2597         before that proxy's thread (on which the lambda is bound to execute) is
2598         retrieved.
2599
2600         Avoid this by taking a reference to the thread in a separate earlier
2601         expression, before the RefPtr is moved into the lambda in the following
2602         one.
2603
2604         * workers/service/context/SWContextManager.cpp:
2605         (WebCore::SWContextManager::terminateWorker):
2606
2607 2018-03-21  Timothy Horton  <timothy_horton@apple.com>
2608
2609         Fix the build
2610
2611         * platform/network/cf/FormDataStreamCFNet.cpp:
2612
2613 2018-03-20  Tim Horton  <timothy_horton@apple.com>
2614
2615         Introduce HAVE_MEDIA_PLAYER and HAVE_CORE_VIDEO
2616         https://bugs.webkit.org/show_bug.cgi?id=183803
2617         <rdar://problem/38690487>
2618
2619         Reviewed by Sam Weinig.
2620
2621         * platform/audio/ios/MediaSessionManagerIOS.mm:
2622         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
2623         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
2624         (-[WebMediaSessionHelper initWithCallback:]):
2625         (-[WebMediaSessionHelper dealloc]):
2626         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
2627         * platform/cocoa/CoreVideoSoftLink.cpp:
2628         * platform/cocoa/CoreVideoSoftLink.h:
2629         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2630         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2631         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
2632         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame const):
2633         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2634         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2635         (WebCore::MediaSampleAVFObjC::getRGBAImageData const):
2636         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2637         * platform/graphics/cv/PixelBufferConformerCV.h:
2638         * platform/graphics/cv/TextureCacheCV.h:
2639         * platform/graphics/cv/TextureCacheCV.mm:
2640         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2641         * platform/graphics/cv/VideoTextureCopierCV.h:
2642         Make it possible to disable our dependency on MediaPlayer and CoreVideo.
2643
2644 2018-03-20  Tim Horton  <timothy_horton@apple.com>
2645
2646         Enable the minimal simulator feature flag when appropriate
2647         https://bugs.webkit.org/show_bug.cgi?id=183807
2648
2649         Reviewed by Dan Bernstein.
2650
2651         * Configurations/FeatureDefines.xcconfig:
2652
2653 2018-03-19  Ryosuke Niwa  <rniwa@webkit.org>
2654
2655         Expose content attributes on _WKLinkIconParameters
2656         https://bugs.webkit.org/show_bug.cgi?id=183768
2657
2658         Reviewed by Alex Christensen.
2659
2660         Collect a vector of content attributes upon finding touch and fav-icons in order to expose it in a WebKit API.
2661
2662         Tests: IconLoading.DefaultFavicon
2663
2664         * html/LinkIconCollector.cpp:
2665         (WebCore::LinkIconCollector::iconsOfTypes): Collect attributes.
2666         * loader/DocumentLoader.cpp:
2667         (WebCore::DocumentLoader::startIconLoading): Use an empty vector for /favicon.ico.
2668         * platform/LinkIcon.h:
2669         (WebCore::LinkIcon::encode const): Encode the vector of content attributes.
2670         (WebCore::LinkIcon::decode): Ditto for decoding.
2671
2672 2018-03-20  Zalan Bujtas  <zalan@apple.com>
2673
2674         RenderTreeNeedsLayoutChecker fails with absolutely positioned svg and <use>
2675         https://bugs.webkit.org/show_bug.cgi?id=183718
2676
2677         Reviewed by Antti Koivisto.
2678
2679         This patch ensures after resolving the style for an SVG element with a corresponding element (<use>),
2680         we adjust this style for the cloned SVG element too.
2681
2682         Test: svg/in-html/path-with-absolute-positioned-svg-and-use-crash.html
2683
2684         * css/StyleResolver.cpp:
2685         (WebCore::StyleResolver::adjustSVGElementStyle):
2686         (WebCore::StyleResolver::adjustRenderStyle):
2687         * css/StyleResolver.h:
2688         * svg/SVGElement.cpp:
2689         (WebCore::SVGElement::resolveCustomStyle):
2690
2691 2018-03-20  Brady Eidson  <beidson@apple.com>
2692
2693         First piece of process swapping on navigation.
2694         https://bugs.webkit.org/show_bug.cgi?id=183665
2695
2696         Reviewed by Andy Estes.
2697
2698         Covered by API test(s)
2699
2700         This patch:
2701         - A new PolicyAction::Suspend for future use in this feature
2702         - Makes sure that loads triggered as part of a process swap do *not* re-consult the policy delegate
2703
2704         * loader/DocumentLoader.cpp:
2705         (WebCore::DocumentLoader::continueAfterContentPolicy):
2706
2707         * loader/FrameLoadRequest.h:
2708         (WebCore::FrameLoadRequest::setShouldCheckNavigationPolicy):
2709         (WebCore::FrameLoadRequest::shouldCheckNavigationPolicy const):
2710
2711         * loader/FrameLoader.cpp:
2712         (WebCore::FrameLoader::load):
2713         (WebCore::FrameLoader::loadWithDocumentLoader):
2714         * loader/FrameLoader.h:
2715
2716         * loader/FrameLoaderTypes.h: Add a new Policy type "Suspend" to be used in the future
2717           by the process-swap-on-navigation mechanism.
2718
2719         * loader/PolicyChecker.cpp:
2720         (WebCore::PolicyChecker::checkNavigationPolicy):
2721         (WebCore::PolicyChecker::checkNewWindowPolicy):
2722
2723 2018-03-20  Chris Dumez  <cdumez@apple.com>
2724
2725         QuickLook.NavigationDelegate API test is failing on iOS with async policy delegates
2726         https://bugs.webkit.org/show_bug.cgi?id=183791
2727
2728         Reviewed by Alex Christensen.
2729
2730         Update PreviewLoader to not send data (or call finishFinishLoading) until
2731         the resource response has been processed.
2732
2733         * loader/ios/PreviewLoader.mm:
2734         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
2735         (-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
2736         (-[WebPreviewLoader connectionDidFinishLoading:]):
2737
2738 2018-03-20  Antoine Quint  <graouts@apple.com>
2739
2740         [Web Animations] Update the timing model when pending tasks schedule changes
2741         https://bugs.webkit.org/show_bug.cgi?id=183785
2742
2743         Reviewed by Dean Jackson.
2744
2745         Changing the time at which a pending play or pause task is scheduled changes the pending
2746         state of the animation and thus should notify that the timing model has changed and invalidate
2747         the effect.
2748
2749         * animation/WebAnimation.cpp:
2750         (WebCore::WebAnimation::setTimeToRunPendingPlayTask):
2751         (WebCore::WebAnimation::setTimeToRunPendingPauseTask):
2752         (WebCore::WebAnimation::updatePendingTasks):
2753
2754 2018-03-20  Tim Horton  <timothy_horton@apple.com>
2755
2756         Add and adopt WK_PLATFORM_NAME and adjust default feature defines
2757         https://bugs.webkit.org/show_bug.cgi?id=183758
2758         <rdar://problem/38017644>
2759
2760         Reviewed by Dan Bernstein.
2761
2762         * Configurations/Base.xcconfig:
2763         * Configurations/FeatureDefines.xcconfig:
2764         * WebCore.xcodeproj/project.pbxproj:
2765
2766 2018-03-19  Tim Horton  <timothy_horton@apple.com>
2767
2768         Apply some SDK checks in LocalDefaultSystemAppearance
2769         https://bugs.webkit.org/show_bug.cgi?id=183767
2770         <rdar://problem/38649611>
2771
2772         Reviewed by Zalan Bujtas.
2773
2774         * platform/mac/LocalDefaultSystemAppearance.h:
2775         * platform/mac/LocalDefaultSystemAppearance.mm:
2776         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2777         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
2778
2779 2018-03-19  Chris Dumez  <cdumez@apple.com>
2780
2781         Have one service worker process per security origin
2782         https://bugs.webkit.org/show_bug.cgi?id=183600
2783         <rdar://problem/35280128>
2784
2785         Reviewed by Brady Eidson.
2786
2787         Split service workers from different origins into their own processes
2788         for security reasons.
2789
2790         * workers/service/server/SWServer.cpp:
2791         (WebCore::SWServer::addRegistrationFromStore):
2792         (WebCore::SWServer::clear):
2793         (WebCore::SWServer::tryInstallContextData):
2794         (WebCore::SWServer::serverToContextConnectionCreated):
2795         (WebCore::SWServer::installContextData):
2796         (WebCore::SWServer::runServiceWorkerIfNecessary):
2797         (WebCore::SWServer::markAllWorkersAsTerminated):
2798         * workers/service/server/SWServer.h:
2799         * workers/service/server/SWServerToContextConnection.cpp:
2800         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
2801         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
2802         (WebCore::SWServerToContextConnection::connectionForOrigin):
2803         * workers/service/server/SWServerToContextConnection.h:
2804         (WebCore::SWServerToContextConnection::origin):
2805         * workers/service/server/SWServerWorker.cpp:
2806         (WebCore::SWServerWorker::SWServerWorker):
2807         (WebCore::SWServerWorker::securityOrigin const):
2808         (WebCore::SWServerWorker::contextConnection):
2809         * workers/service/server/SWServerWorker.h:
2810
2811 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
2812
2813         Have select element respect current appearance
2814         https://bugs.webkit.org/show_bug.cgi?id=183753
2815
2816         Reviewed by Tim Horton.
2817
2818         Not currently testable, will add tests in a later patch.
2819
2820         Have the menu lists/select elements follow the system colors.
2821
2822         * rendering/RenderThemeMac.mm:
2823         (WebCore::RenderThemeMac::adjustMenuListStyle const):
2824
2825 2018-03-19  Nan Wang  <n_wang@apple.com>
2826
2827         AX: embedded attachments do not work correctly with text marker APIs on macOS
2828         https://bugs.webkit.org/show_bug.cgi?id=183751
2829
2830         Reviewed by Chris Fleizach.
2831
2832         In WebKit1, embedded attachments are not working well with text marker APIs.
2833         We should use the corresponding attachment view in the following cases:
2834         1. Hit testing on an attachment object.
2835         2. Getting the attachment object at a text marker position.
2836         3. Asking for the associated element with NSAccessibilityAttachmentTextAttribute. 
2837
2838         Not able to construct a layout test because it relies on embedded attachments.
2839
2840         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2841         (AXAttributeStringSetElement):
2842         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
2843         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2844
2845 2018-03-19  Jiewen Tan  <jiewen_tan@apple.com>
2846
2847         Unreviewed, another quick fix for r229699
2848
2849         Restricts ENABLE_WEB_AUTHN to only macOS and iOS.
2850
2851         * Configurations/FeatureDefines.xcconfig:
2852
2853 2018-03-19  Daniel Bates  <dabates@apple.com>
2854
2855         Fix case of Strong Password localized string
2856
2857         * English.lproj/Localizable.strings:
2858         * platform/LocalizedStrings.cpp:
2859         (WebCore::autoFillStrongPasswordLabel):
2860
2861 2018-03-19  Chris Dumez  <cdumez@apple.com>
2862
2863         WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
2864         https://bugs.webkit.org/show_bug.cgi?id=183702
2865         <rdar://problem/38566060>
2866
2867         Reviewed by Alex Christensen.
2868
2869         The issue is that the test calls loadHTMLString then loadRequest right after, without
2870         waiting for the first load to complete first. loadHTMLString is special as it relies
2871         on substitute data and which schedules a timer to commit the data. When doing the
2872         navigation policy check for the following loadRequest(), the substitute data timer
2873         would fire and commit its data and load. This would in turn cancel the pending
2874         navigation policy check for the loadRequest().
2875
2876         With sync policy delegates, this is not an issue because we take care of stopping
2877         all loaders when receiving the policy decision, which happens synchronously. However,
2878         when the policy decision happens asynchronously, the pending substitute data load
2879         does not get cancelled in time and it gets committed.
2880
2881         To address the issue, we now cancel any pending provisional load before doing the
2882         navigation policy check.
2883
2884         Test: fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash-async-delegate.html
2885
2886         * loader/FrameLoader.cpp:
2887         (WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
2888         * loader/FrameLoader.h:
2889         * loader/PolicyChecker.cpp:
2890         (WebCore::PolicyChecker::checkNavigationPolicy):
2891         Cancel any pending provisional load before starting the navigation policy check. This call
2892         needs to be here rather than in the call site of policyChecker().checkNavigationPolicy()
2893         because there is code in PolicyChecker::checkNavigationPolicy() which relies on
2894         FrameLoader::activeDocumentLoader().
2895         Also, we only cancel the provisional load if there is a policy document loader. In some
2896         rare cases (when we receive a redirect after navigation policy has been decided for the
2897         initial request), the provisional document loader needs to receive navigation policy
2898         decisions so we cannot clear the provisional document loader in such case.
2899
2900 2018-03-19  Eric Carlson  <eric.carlson@apple.com>
2901
2902         [Extra zoom mode] Require fullscreen for video playback
2903         https://bugs.webkit.org/show_bug.cgi?id=183742
2904         <rdar://problem/38235862>
2905
2906         Reviewed by Jer Noble.
2907
2908         * Modules/modern-media-controls/media/playback-support.js:
2909         (PlaybackSupport.prototype.syncControl): Always show the play button.
2910         * html/HTMLMediaElement.cpp:
2911         (WebCore::HTMLMediaElement::updatePlayState): Return immediately if playback requires fullscreen
2912         (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Call updatePlayState in case 
2913         playback is pending.
2914         * html/HTMLMediaElement.h:
2915         * platform/cocoa/VideoFullscreenModel.h:
2916         (WebCore::VideoFullscreenModel::presentingViewController): New.
2917         (WebCore::VideoFullscreenModel::createVideoFullscreenViewController): New.
2918         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2919         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2920         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
2921         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
2922         (WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):
2923
2924         * platform/ios/VideoFullscreenInterfaceAVKit.h:
2925         * platform/ios/VideoFullscreenInterfaceAVKit.mm: Wrap AVPlayerLayerView so we can change its
2926         behavior.
2927         (WebAVPlayerLayerView_playerLayer):
2928         (WebAVPlayerLayerView_videoView):
2929         (allocWebAVPlayerLayerViewInstance):
2930         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
2931         (-[WebAVPlayerViewController playerViewControllerShouldHandleDoneButtonTap:]):
2932         (-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
2933         (-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
2934         (-[WebAVPlayerViewController NO_RETURN_DUE_TO_ASSERT]):
2935         (-[WebAVPlayerViewController isPictureInPicturePossible]):
2936         (-[WebAVPlayerViewController isPictureInPictureActive]):
2937         (-[WebAVPlayerViewController isPictureInPictureSuspended]):
2938         (-[WebAVPlayerViewController pictureInPictureActive]):
2939         (-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
2940         (-[WebAVPlayerViewController view]):
2941         (-[WebAVPlayerViewController showsPlaybackControls]):
2942         (-[WebAVPlayerViewController setShowsPlaybackControls:]):
2943         (-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
2944         (-[WebAVPlayerViewController setDelegate:]):
2945         (-[WebAVPlayerViewController setPlayerController:]):
2946         (-[WebAVPlayerViewController avPlayerViewController]):
2947         (-[WebAVPlayerViewController removeFromParentViewController]):
2948         (VideoFullscreenInterfaceAVKit::setupFullscreen):
2949         (fallbackViewController):
2950         (VideoFullscreenInterfaceAVKit::presentingViewController):
2951         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2952         (VideoFullscreenInterfaceAVKit::doSetup):
2953         (WebCore::supportsPictureInPicture):
2954
2955 2018-03-19  Per Arne Vollan  <pvollan@apple.com>
2956
2957         When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
2958         https://bugs.webkit.org/show_bug.cgi?id=183604
2959         <rdar://problem/38305109>
2960
2961         Reviewed by Brent Fulgham.
2962
2963         The call to CVDisplayLinkCreateWithCGDisplay can instead be made in the UIProcess. Notify the WebContent process
2964         about display updates by sending a message from the UIProcess on each screen update. This patch adds an extra
2965         IPC step when notifying the WebContent process about display updates. However, the MotionMark benchmark shows no
2966         performance regression when running it with this patch. A possible explanation for this is that the high priority
2967         display link thread is now running in the UIProcess instead of the WebContent process, which means there will be
2968         more available CPU resources for the WebContent process. A run loop observer is added to make sure that only one
2969         display callback (for each display observer) is executed in a single iteration of the run loop. This will make
2970         sure we are not filling the IPC message queue with unhandled display link messages.
2971
2972         No new tests, covered by existing tests. 
2973
2974         * platform/graphics/DisplayRefreshMonitor.h:
2975         (WebCore::DisplayRefreshMonitor::displayLinkFired):
2976         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2977         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
2978         * platform/graphics/DisplayRefreshMonitorManager.h:
2979         * platform/graphics/mac/DisplayRefreshMonitorMac.h:
2980
2981 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
2982
2983         Ensure local appearance actually mirrors the app's appearance
2984         https://bugs.webkit.org/show_bug.cgi?id=183743
2985
2986         Reviewed by Tim Horton.
2987
2988         Not currently testable, will add tests in a later patch.
2989
2990         Current appearance isn't always accurate by default and needs to be set manually.
2991
2992         * platform/mac/LocalDefaultSystemAppearance.mm:
2993         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2994
2995 2018-03-19  Zan Dobersek  <zdobersek@igalia.com>
2996
2997         Unreviewed GCC 4.9 build-fix after r229672.
2998
2999         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
3000         (Nicosia::createCommand): Don't depend on implicit conversion of the
3001         returning std::unique_ptr<> object, and instead only wrap the
3002         heap-allocated PaintingOperation-derived in a std::unique_ptr<> at the
3003         point of return.
3004
3005 2018-03-18  Commit Queue  <commit-queue@webkit.org>
3006
3007         Unreviewed, rolling out r229689.
3008         https://bugs.webkit.org/show_bug.cgi?id=183735
3009
3010         Causes fast/loader/inner-iframe-loads-data-url-into-parent-on-
3011         unload-crash.html to fail with async delegates (Requested by
3012         cdumez_ on #webkit).
3013
3014         Reverted changeset:
3015
3016         "WebKit.WebsitePoliciesAutoplayQuirks API test times out with
3017         async policy delegates"
3018         https://bugs.webkit.org/show_bug.cgi?id=183702
3019         https://trac.webkit.org/changeset/229689
3020
3021 2018-03-17  Tim Horton  <timothy_horton@apple.com>
3022
3023         Correct redefined fnfErr type
3024         https://bugs.webkit.org/show_bug.cgi?id=183728
3025         <rdar://problem/38590063>
3026
3027         Reviewed by Dan Bernstein.
3028
3029         * platform/network/cf/FormDataStreamCFNet.cpp:
3030         CFStreamError's error parameter takes a SInt32, not an int.
3031         Make sure our redefinition has a compatible type.
3032
3033 2018-03-17  Jiewen Tan  <jiewen_tan@apple.com>
3034
3035         [WebAuthN] Implement authenticatorMakeCredential
3036         https://bugs.webkit.org/show_bug.cgi?id=183527
3037         <rdar://problem/35275886>
3038
3039         Reviewed by Brent Fulgham.
3040
3041         This patch does the following few things:
3042         1) It implements the authenticatorMakeCredential logic from the spec: https://www.w3.org/TR/webauthn/#op-make-cred.
3043         2) It tweaks enocding and deocding of PublicKeyCredentialCreationOptions between UIProccess and WebProcess.
3044         3) It soft links LocalAuthentication.Framework to WebCore, which was linked to WebKit.
3045         4) It creates SPI header for DeviceIdentity.Framework, and provides stubs to link it to WebCore.
3046
3047         Here is a detailed explanantion of 1):
3048         1. A helper class called LocalAuthenticator is crafted to represent Apple platform attached authenticator, i.e.
3049         the devices themselves. All operations are currently restricted to iOS at this moment as macOS lacks attestation
3050         support.
3051         2. To do testing, this helper class is then moved from WebKit to WebCore even though all operations can only happens
3052         in the UIProcess. We currently lack the ability to pretend a https environment in TestWebKitAPI which is required by
3053         the WebAuthN API, and thus it is moved to WebCore to perform unit tesing flavor API tests. This is not enough as it
3054         can't test message exchange between the UI and Web processes. We will address this in a subsequent patch.
3055         3. More on testing: The attestation process is abstracted into a protected method such that the testing enviroment can
3056         override it with self attestation as network access is restricted in the WebKit testing enviroment. Also, swizzlers of
3057         LocalAuthentication API are provided to override the behavoir of LAContext.
3058         4. More on testing: The actual Apple attestation can only happen in real device and with network access, therefore
3059         it can only be covered by manual tests at this moment.
3060         5. Back to LocalAuthenticator, it currently has two public methods:
3061                 5.1. makeCredential(): This method is the one does all the magic.
3062                 + It first checks some parameters.
3063                 + It then invokes LAContext to get user consent.
3064                 + It then talks to Apple Attestation Privacy CA to do attestations.
3065                 + It then stores necessary information into the Keychain.
3066                 + Finally it generates the attestation object.
3067                 5.2 isAvailable():
3068                 To check if a LocalAuthenticator is available or not.
3069         6. Even though files are of .mm format, they are written in a way that mixes NS, CF and C++ types. Here is the rule:
3070                 6.1 Use CF type only if it is requested by APIs.
3071                 6.2 Use NS type to manipulate all Objc objects.
3072                 6.3 Use C++ otherwise.
3073
3074         Covered by API tests.
3075
3076         * Configurations/WebCore.xcconfig:
3077         * Modules/credentialmanagement/CredentialsMessenger.cpp:
3078         (WebCore::getIdFromAttestationObject): Deleted.
3079         Decoding attestation object is tedious. UIProcess will instead return credential ID and attestation object
3080         at the same time. Therefore, this method is removed.
3081         * Modules/credentialmanagement/CredentialsMessenger.h:
3082         (WebCore::CreationReturnBundle::CreationReturnBundle): Deleted.
3083         (WebCore::AssertionReturnBundle::AssertionReturnBundle): Deleted.
3084         * Modules/webauthn/COSEConstants.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
3085         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
3086         (WebCore::PublicKeyCredentialCreationOptions::isolatedPartialCopyPtr const):
3087         (WebCore::PublicKeyCredentialCreationOptions::Parameters::encode const):
3088         (WebCore::PublicKeyCredentialCreationOptions::Parameters::decode):
3089         (WebCore::PublicKeyCredentialCreationOptions::encode const):
3090         (WebCore::PublicKeyCredentialCreationOptions::decode):
3091         * Modules/webauthn/PublicKeyCredentialDescriptor.h:
3092         (WebCore::PublicKeyCredentialDescriptor::encode const):
3093         (WebCore::PublicKeyCredentialDescriptor::decode):
3094         * Modules/webauthn/PublicKeyCredentialType.h:
3095         * Modules/webauthn/cocoa/LocalAuthenticator.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h.
3096         * Modules/webauthn/cocoa/LocalAuthenticator.mm: Added.
3097         (WebCore::LocalAuthenticatorInternal::freePtrs):
3098         (WebCore::LocalAuthenticator::makeCredential const):
3099         (WebCore::LocalAuthenticator::isAvailable const):
3100         (WebCore::LocalAuthenticator::issueClientCertificate const):
3101         * SourcesCocoa.txt:
3102         * WebCore.xcodeproj/project.pbxproj:
3103         * platform/cocoa/LocalAuthenticationSoftLink.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
3104         * platform/cocoa/LocalAuthenticationSoftLink.mm: Added.
3105         * testing/MockCredentialsMessenger.cpp:
3106         (WebCore::MockCredentialsMessenger::setCreationReturnBundle):
3107         (WebCore::MockCredentialsMessenger::makeCredential):
3108         (WebCore::MockCredentialsMessenger::makeCredentialReply):
3109         (WebCore::MockCredentialsMessenger::setAttestationObject): Deleted.
3110         * testing/MockCredentialsMessenger.h:
3111         * testing/MockCredentialsMessenger.idl:
3112
3113 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
3114
3115         Correct debug assertion in Range::borderAndTextRects
3116         https://bugs.webkit.org/show_bug.cgi?id=183710
3117         <rdar://problem/38466976>
3118
3119         Reviewed by Ryosuke Niwa.
3120
3121         A debug assertion will fire if Range::borderAndTextRects is asked to evaluate a set of selected elements, where one of the elements does not have a parent.
3122
3123         We should consider a nullptr parent as satisfying the condition of a parent not being present in the selection set.
3124
3125         Tests: fast/dom/range/range-selection-empty-body.html
3126
3127         * dom/Range.cpp:
3128         (WebCore::Range::borderAndTextRects const):
3129
3130 2018-03-15  Filip Pizlo  <fpizlo@apple.com>
3131
3132         Put the DOM in IsoHeaps
3133         https://bugs.webkit.org/show_bug.cgi?id=183546
3134
3135         Reviewed by Daniel Bates.
3136
3137         No new tests because no change in behavior.
3138         
3139         This puts all descendants of WebCore::Node in isoheaps, so that UAFs on the DOM cannot be
3140         used for RCE attacks. This probably also makes it harder to use UAFs for UXSS, since it means
3141         that DOM UAFs cannot be used for universal read gadgets.
3142         
3143         This looks neutral on Speedometer and membuster, though I did have one round of testing
3144         that led me to believe that membuster was regressed - I just wasn't able to reproduce that
3145         result on subsequent testing.
3146
3147         * Sources.txt:
3148         * WebCore.xcodeproj/project.pbxproj:
3149         * dom/Attr.cpp:
3150         * dom/Attr.h:
3151         * dom/CDATASection.cpp:
3152         * dom/CDATASection.h:
3153         * dom/CharacterData.cpp:
3154         * dom/CharacterData.h:
3155         * dom/Comment.cpp:
3156         * dom/Comment.h:
3157         * dom/ContainerNode.cpp:
3158         * dom/ContainerNode.h:
3159         * dom/Document.cpp:
3160         * dom/Document.h:
3161         * dom/DocumentFragment.cpp:
3162         * dom/DocumentFragment.h:
3163         * dom/DocumentType.cpp:
3164         * dom/DocumentType.h:
3165         * dom/Node.cpp:
3166         * dom/Node.h:
3167         * dom/ProcessingInstruction.cpp:
3168         * dom/ProcessingInstruction.h:
3169         * dom/PseudoElement.cpp:
3170         * dom/PseudoElement.h:
3171         * dom/ShadowRoot.cpp:
3172         * dom/ShadowRoot.h:
3173         * dom/StyledElement.cpp:
3174         * dom/StyledElement.h:
3175         * dom/TemplateContentDocumentFragment.cpp: Added.
3176         * dom/TemplateContentDocumentFragment.h:
3177         * dom/Text.cpp:
3178         * dom/Text.h:
3179         * dom/XMLDocument.cpp: Added.
3180         * dom/XMLDocument.h:
3181         * html/FTPDirectoryDocument.cpp:
3182         * html/FTPDirectoryDocument.h:
3183         * html/FileInputType.cpp:
3184         * html/HTMLAnchorElement.cpp:
3185         * html/HTMLAnchorElement.h:
3186         * html/HTMLAppletElement.cpp:
3187         * html/HTMLAppletElement.h:
3188         * html/HTMLAreaElement.cpp:
3189         * html/HTMLAreaElement.h:
3190         * html/HTMLAttachmentElement.cpp:
3191         * html/HTMLAttachmentElement.h:
3192         * html/HTMLBDIElement.cpp: Added.
3193         * html/HTMLBDIElement.h:
3194         * html/HTMLBRElement.cpp:
3195         * html/HTMLBRElement.h:
3196         * html/HTMLBaseElement.cpp:
3197         * html/HTMLBaseElement.h:
3198         * html/HTMLBodyElement.cpp:
3199         * html/HTMLBodyElement.h:
3200         * html/HTMLButtonElement.cpp:
3201         * html/HTMLButtonElement.h:
3202         * html/HTMLCanvasElement.cpp:
3203         * html/HTMLCanvasElement.h:
3204         * html/HTMLDListElement.cpp:
3205         * html/HTMLDListElement.h:
3206         * html/HTMLDataElement.cpp:
3207         * html/HTMLDataElement.h:
3208         * html/HTMLDataListElement.cpp:
3209         * html/HTMLDataListElement.h:
3210         * html/HTMLDetailsElement.cpp:
3211         * html/HTMLDetailsElement.h:
3212         * html/HTMLDirectoryElement.cpp:
3213         * html/HTMLDirectoryElement.h:
3214         * html/HTMLDivElement.cpp:
3215         * html/HTMLDivElement.h:
3216         * html/HTMLDocument.cpp:
3217         * html/HTMLDocument.h:
3218         * html/HTMLElement.cpp:
3219         * html/HTMLElement.h:
3220         * html/HTMLEmbedElement.cpp:
3221         * html/HTMLEmbedElement.h:
3222         * html/HTMLFieldSetElement.cpp:
3223         * html/HTMLFieldSetElement.h:
3224         * html/HTMLFontElement.cpp:
3225         * html/HTMLFontElement.h:
3226         * html/HTMLFormControlElement.cpp:
3227         * html/HTMLFormControlElement.h:
3228         * html/HTMLFormControlElementWithState.cpp:
3229         * html/HTMLFormControlElementWithState.h:
3230         * html/HTMLFormElement.cpp:
3231         * html/HTMLFormElement.h:
3232         * html/HTMLFrameElement.cpp:
3233         * html/HTMLFrameElement.h:
3234         * html/HTMLFrameElementBase.cpp:
3235         * html/HTMLFrameElementBase.h:
3236         * html/HTMLFrameOwnerElement.cpp:
3237         * html/HTMLFrameOwnerElement.h:
3238         * html/HTMLFrameSetElement.cpp:
3239         * html/HTMLFrameSetElement.h:
3240         * html/HTMLHRElement.cpp:
3241         * html/HTMLHRElement.h:
3242         * html/HTMLHeadElement.cpp:
3243         * html/HTMLHeadElement.h:
3244         * html/HTMLHeadingElement.cpp:
3245         * html/HTMLHeadingElement.h:
3246         * html/HTMLHtmlElement.cpp:
3247         * html/HTMLHtmlElement.h:
3248         * html/HTMLIFrameElement.cpp:
3249         * html/HTMLIFrameElement.h:
3250         * html/HTMLImageElement.cpp:
3251         * html/HTMLImageElement.h:
3252         * html/HTMLInputElement.cpp:
3253         * html/HTMLInputElement.h:
3254         * html/HTMLKeygenElement.cpp:
3255         * html/HTMLKeygenElement.h:
3256         * html/HTMLLIElement.cpp:
3257         * html/HTMLLIElement.h:
3258         * html/HTMLLabelElement.cpp:
3259         * html/HTMLLabelElement.h:
3260         * html/HTMLLegendElement.cpp:
3261         * html/HTMLLegendElement.h:
3262         * html/HTMLLinkElement.cpp:
3263         * html/HTMLLinkElement.h:
3264         * html/HTMLMapElement.cpp:
3265         * html/HTMLMapElement.h:
3266         * html/HTMLMarqueeElement.cpp:
3267         * html/HTMLMarqueeElement.h:
3268         * html/HTMLMenuElement.cpp:
3269         * html/HTMLMenuElement.h:
3270         * html/HTMLMenuItemElement.cpp:
3271         * html/HTMLMenuItemElement.h:
3272         * html/HTMLMetaElement.cpp:
3273         * html/HTMLMetaElement.h:
3274         * html/HTMLMeterElement.cpp:
3275         * html/HTMLMeterElement.h:
3276         * html/HTMLModElement.cpp:
3277         * html/HTMLModElement.h:
3278         * html/HTMLOListElement.cpp:
3279         * html/HTMLOListElement.h:
3280         * html/HTMLObjectElement.cpp:
3281         * html/HTMLObjectElement.h:
3282         * html/HTMLOptGroupElement.cpp:
3283         * html/HTMLOptGroupElement.h:
3284         * html/HTMLOptionElement.cpp:
3285         * html/HTMLOptionElement.h:
3286         * html/HTMLOutputElement.cpp:
3287         * html/HTMLOutputElement.h:
3288         * html/HTMLParagraphElement.cpp:
3289         * html/HTMLParagraphElement.h:
3290         * html/HTMLParamElement.cpp:
3291         * html/HTMLParamElement.h:
3292         * html/HTMLPictureElement.cpp:
3293         * html/HTMLPictureElement.h:
3294         * html/HTMLPlugInElement.cpp:
3295         * html/HTMLPlugInElement.h:
3296         * html/HTMLPlugInImageElement.cpp:
3297         * html/HTMLPlugInImageElement.h:
3298         * html/HTMLPreElement.cpp:
3299         * html/HTMLPreElement.h:
3300         * html/HTMLProgressElement.cpp:
3301         * html/HTMLProgressElement.h:
3302         * html/HTMLQuoteElement.cpp:
3303         * html/HTMLQuoteElement.h:
3304         * html/HTMLScriptElement.cpp:
3305         * html/HTMLScriptElement.h:
3306         * html/HTMLSelectElement.cpp:
3307         * html/HTMLSelectElement.h:
3308         * html/HTMLSlotElement.cpp:
3309         * html/HTMLSlotElement.h:
3310         * html/HTMLSourceElement.cpp:
3311         * html/HTMLSourceElement.h:
3312         * html/HTMLSpanElement.cpp:
3313         * html/HTMLSpanElement.h:
3314         * html/HTMLStyleElement.cpp:
3315         * html/HTMLStyleElement.h:
3316         * html/HTMLSummaryElement.cpp:
3317         * html/HTMLSummaryElement.h:
3318         * html/HTMLTableCaptionElement.cpp:
3319         * html/HTMLTableCaptionElement.h:
3320         * html/HTMLTableCellElement.cpp:
3321         * html/HTMLTableCellElement.h:
3322         * html/HTMLTableColElement.cpp:
3323         * html/HTMLTableColElement.h:
3324         * html/HTMLTableElement.cpp:
3325         * html/HTMLTableElement.h:
3326         * html/HTMLTablePartElement.cpp:
3327         * html/HTMLTablePartElement.h:
3328         * html/HTMLTableRowElement.cpp:
3329         * html/HTMLTableRowElement.h:
3330         * html/HTMLTableSectionElement.cpp:
3331         * html/HTMLTableSectionElement.h:
3332         * html/HTMLTemplateElement.cpp:
3333         * html/HTMLTemplateElement.h:
3334         * html/HTMLTextAreaElement.cpp:
3335         * html/HTMLTextAreaElement.h:
3336         * html/HTMLTextFormControlElement.cpp:
3337         * html/HTMLTextFormControlElement.h:
3338         * html/HTMLTimeElement.cpp:
3339         * html/HTMLTimeElement.h:
3340         * html/HTMLTitleElement.cpp:
3341         * html/HTMLTitleElement.h:
3342         * html/HTMLTrackElement.cpp:
3343         * html/HTMLTrackElement.h:
3344         * html/HTMLUListElement.cpp:
3345         * html/HTMLUListElement.h:
3346         * html/HTMLUnknownElement.cpp: Added.
3347         * html/HTMLUnknownElement.h:
3348         * html/HTMLWBRElement.cpp:
3349         * html/HTMLWBRElement.h:
3350         * html/ImageDocument.cpp:
3351         * html/ImageDocument.h:
3352         * html/LabelableElement.cpp:
3353         * html/LabelableElement.h:
3354         * html/MediaController.cpp:
3355         (MediaController::create): Deleted.
3356         (MediaController::MediaController): Deleted.
3357         (MediaController::addMediaElement): Deleted.
3358         (MediaController::removeMediaElement): Deleted.
3359         (MediaController::containsMediaElement const): Deleted.
3360         (MediaController::buffered const): Deleted.
3361         (MediaController::seekable const): Deleted.
3362         (MediaController::played): Deleted.
3363         (MediaController::duration const): Deleted.
3364         (MediaController::currentTime const): Deleted.
3365         (MediaController::setCurrentTime): Deleted.
3366         (MediaController::unpause): Deleted.
3367         (MediaController::play): Deleted.
3368         (MediaController::pause): Deleted.
3369         (MediaController::setDefaultPlaybackRate): Deleted.
3370         (MediaController::playbackRate const): Deleted.
3371         (MediaController::setPlaybackRate): Deleted.
3372         (MediaController::setVolume): Deleted.
3373         (MediaController::setMuted): Deleted.
3374         (playbackStateWaiting): Deleted.
3375         (playbackStatePlaying): Deleted.
3376         (playbackStateEnded): Deleted.
3377         (MediaController::playbackState const): Deleted.
3378         (MediaController::reportControllerState): Deleted.
3379         (eventNameForReadyState): Deleted.
3380         (MediaController::updateReadyState): Deleted.
3381         (MediaController::updatePlaybackState): Deleted.
3382         (MediaController::updateMediaElements): Deleted.
3383         (MediaController::bringElementUpToSpeed): Deleted.
3384         (MediaController::isBlocked const): Deleted.
3385         (MediaController::hasEnded const): Deleted.
3386         (MediaController::scheduleEvent): Deleted.
3387         (MediaController::asyncEventTimerFired): Deleted.
3388         (MediaController::clearPositionTimerFired): Deleted.
3389         (MediaController::hasAudio const): Deleted.
3390         (MediaController::hasVideo const): Deleted.
3391         (MediaController::hasClosedCaptions const): Deleted.
3392         (MediaController::setClosedCaptionsVisible): Deleted.
3393         (MediaController::supportsScanning const): Deleted.
3394         (MediaController::beginScrubbing): Deleted.
3395         (MediaController::endScrubbing): Deleted.
3396         (MediaController::beginScanning): Deleted.
3397         (MediaController::endScanning): Deleted.
3398         (MediaController::canPlay const): Deleted.
3399         (MediaController::isLiveStream const): Deleted.
3400         (MediaController::hasCurrentSrc const): Deleted.
3401         (MediaController::returnToRealtime): Deleted.
3402         (MediaController::startTimeupdateTimer): Deleted.
3403         (MediaController::scheduleTimeupdateEvent): Deleted.
3404         * html/MediaDocument.cpp:
3405         * html/MediaDocument.h:
3406         * html/PluginDocument.cpp:
3407         * html/PluginDocument.h:
3408         * html/RubyElement.cpp:
3409         * html/RubyElement.h:
3410         * html/RubyTextElement.cpp:
3411         * html/RubyTextElement.h:
3412         * html/TextDocument.cpp:
3413         * html/TextDocument.h:
3414         * html/shadow/AutoFillButtonElement.cpp:
3415         * html/shadow/AutoFillButtonElement.h:
3416         * html/shadow/DetailsMarkerControl.cpp:
3417         * html/shadow/DetailsMarkerControl.h:
3418         * html/shadow/ImageControlsRootElement.cpp:
3419         * html/shadow/ImageControlsRootElement.h:
3420         * html/shadow/MediaControlElementTypes.cpp:
3421         * html/shadow/MediaControlElementTypes.h:
3422         * html/shadow/MediaControlElements.cpp:
3423         * html/shadow/MediaControlElements.h:
3424         * html/shadow/MediaControls.cpp:
3425         * html/shadow/MediaControls.h:
3426         * html/shadow/ProgressShadowElement.cpp:
3427         * html/shadow/ProgressShadowElement.h:
3428         * html/shadow/SliderThumbElement.cpp:
3429         * html/shadow/SliderThumbElement.h:
3430         * html/shadow/SpinButtonElement.cpp:
3431         * html/shadow/SpinButtonElement.h:
3432         * html/shadow/TextControlInnerElements.cpp:
3433         * html/shadow/TextControlInnerElements.h:
3434         * html/shadow/YouTubeEmbedShadowElement.cpp:
3435         * html/shadow/YouTubeEmbedShadowElement.h:
3436         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
3437         * html/shadow/mac/ImageControlsButtonElementMac.h:
3438         * html/shadow/mac/ImageControlsRootElementMac.cpp:
3439         * html/shadow/mac/ImageControlsRootElementMac.h:
3440         * html/track/TextTrackCueGeneric.cpp:
3441         * html/track/VTTCue.cpp:
3442         * html/track/VTTCue.h:
3443         * html/track/WebVTTElement.cpp:
3444         * html/track/WebVTTElement.h:
3445         * loader/SinkDocument.cpp:
3446         * loader/SinkDocument.h:
3447         * mathml/MathMLAnnotationElement.cpp:
3448         * mathml/MathMLAnnotationElement.h:
3449         * mathml/MathMLElement.cpp:
3450         * mathml/MathMLElement.h:
3451         * mathml/MathMLFractionElement.cpp:
3452         * mathml/MathMLFractionElement.h:
3453         * mathml/MathMLMathElement.cpp:
3454         * mathml/MathMLMathElement.h:
3455         * mathml/MathMLMencloseElement.cpp:
3456         * mathml/MathMLMencloseElement.h:
3457         * mathml/MathMLOperatorElement.cpp:
3458         * mathml/MathMLOperatorElement.h:
3459         * mathml/MathMLPaddedElement.cpp:
3460         * mathml/MathMLPaddedElement.h:
3461         * mathml/MathMLPresentationElement.cpp:
3462         * mathml/MathMLPresentationElement.h:
3463         * mathml/MathMLRootElement.cpp:
3464         * mathml/MathMLRootElement.h:
3465         * mathml/MathMLRowElement.cpp:
3466         * mathml/MathMLRowElement.h:
3467         * mathml/MathMLScriptsElement.cpp:
3468         * mathml/MathMLScriptsElement.h:
3469         * mathml/MathMLSelectElement.cpp:
3470         * mathml/MathMLSelectElement.h:
3471         * mathml/MathMLSpaceElement.cpp:
3472         * mathml/MathMLSpaceElement.h:
3473         * mathml/MathMLTokenElement.cpp:
3474         * mathml/MathMLTokenElement.h:
3475         * mathml/MathMLUnderOverElement.cpp:
3476         * mathml/MathMLUnderOverElement.h:
3477         * mathml/MathMLUnknownElement.cpp: Added.
3478         * mathml/MathMLUnknownElement.h:
3479         * svg/SVGAElement.cpp:
3480         * svg/SVGAElement.h:
3481         * svg/SVGAltGlyphDefElement.cpp:
3482         * svg/SVGAltGlyphDefElement.h:
3483         * svg/SVGAltGlyphElement.cpp:
3484         * svg/SVGAltGlyphElement.h:
3485         * svg/SVGAltGlyphItemElement.cpp:
3486         * svg/SVGAltGlyphItemElement.h:
3487         * svg/SVGAnimateColorElement.cpp:
3488         * svg/SVGAnimateColorElement.h:
3489         * svg/SVGAnimateElement.cpp:
3490         * svg/SVGAnimateElement.h:
3491         * svg/SVGAnimateElementBase.cpp:
3492         * svg/SVGAnimateElementBase.h:
3493         * svg/SVGAnimateMotionElement.cpp:
3494         * svg/SVGAnimateMotionElement.h:
3495         * svg/SVGAnimateTransformElement.cpp:
3496         * svg/SVGAnimateTransformElement.h:
3497         * svg/SVGAnimationElement.cpp:
3498         * svg/SVGAnimationElement.h:
3499         * svg/SVGCircleElement.cpp:
3500         * svg/SVGCircleElement.h:
3501         * svg/SVGClipPathElement.cpp:
3502         * svg/SVGClipPathElement.h:
3503         * svg/SVGComponentTransferFunctionElement.cpp:
3504         * svg/SVGComponentTransferFunctionElement.h:
3505         * svg/SVGCursorElement.cpp:
3506         * svg/SVGCursorElement.h:
3507         * svg/SVGDefsElement.cpp:
3508         * svg/SVGDefsElement.h:
3509         * svg/SVGDescElement.cpp:
3510         * svg/SVGDescElement.h:
3511         * svg/SVGDocument.cpp:
3512         * svg/SVGDocument.h:
3513         * svg/SVGElement.cpp:
3514         * svg/SVGElement.h:
3515         * svg/SVGEllipseElement.cpp:
3516         * svg/SVGEllipseElement.h:
3517         * svg/SVGFEBlendElement.cpp:
3518         * svg/SVGFEBlendElement.h:
3519         * svg/SVGFEColorMatrixElement.cpp:
3520         * svg/SVGFEColorMatrixElement.h:
3521         * svg/SVGFEComponentTransferElement.cpp:
3522         * svg/SVGFEComponentTransferElement.h:
3523         * svg/SVGFECompositeElement.cpp:
3524         * svg/SVGFECompositeElement.h:
3525         * svg/SVGFEConvolveMatrixElement.cpp:
3526         * svg/SVGFEConvolveMatrixElement.h:
3527         * svg/SVGFEDiffuseLightingElement.cpp:
3528         * svg/SVGFEDiffuseLightingElement.h:
3529         * svg/SVGFEDisplacementMapElement.cpp:
3530         * svg/SVGFEDisplacementMapElement.h:
3531         * svg/SVGFEDropShadowElement.cpp:
3532         * svg/SVGFEDropShadowElement.h:
3533         * svg/SVGFEFloodElement.cpp:
3534         * svg/SVGFEFloodElement.h:
3535         * svg/SVGFEGaussianBlurElement.cpp:
3536         * svg/SVGFEGaussianBlurElement.h:
3537         * svg/SVGFEImageElement.cpp:
3538         * svg/SVGFEImageElement.h:
3539         * svg/SVGFELightElement.cpp:
3540         * svg/SVGFELightElement.h:
3541         * svg/SVGFEMergeElement.cpp:
3542         * svg/SVGFEMergeElement.h:
3543         * svg/SVGFEMergeNodeElement.cpp:
3544         * svg/SVGFEMergeNodeElement.h:
3545         * svg/SVGFEMorphologyElement.cpp:
3546         * svg/SVGFEMorphologyElement.h:
3547         * svg/SVGFEOffsetElement.cpp:
3548         * svg/SVGFEOffsetElement.h:
3549         * svg/SVGFESpecularLightingElement.cpp:
3550         * svg/SVGFESpecularLightingElement.h:
3551         * svg/SVGFETileElement.cpp:
3552         * svg/SVGFETileElement.h:
3553         * svg/SVGFETurbulenceElement.cpp:
3554         * svg/SVGFETurbulenceElement.h:
3555         * svg/SVGFilterElement.cpp:
3556         * svg/SVGFilterElement.h:
3557         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
3558         * svg/SVGFilterPrimitiveStandardAttributes.h:
3559         * svg/SVGFontFaceElement.cpp:
3560         * svg/SVGFontFaceElement.h:
3561         * svg/SVGFontFaceFormatElement.cpp:
3562         * svg/SVGFontFaceFormatElement.h:
3563         * svg/SVGFontFaceNameElement.cpp:
3564         * svg/SVGFontFaceNameElement.h:
3565         * svg/SVGFontFaceSrcElement.cpp:
3566         * svg/SVGFontFaceSrcElement.h:
3567         * svg/SVGFontFaceUriElement.cpp:
3568         * svg/SVGFontFaceUriElement.h:
3569         * svg/SVGForeignObjectElement.cpp:
3570         * svg/SVGForeignObjectElement.h:
3571         * svg/SVGGElement.cpp:
3572         * svg/SVGGElement.h:
3573         * svg/SVGGlyphElement.cpp:
3574         * svg/SVGGlyphElement.h:
3575         * svg/SVGGlyphRefElement.cpp:
3576         * svg/SVGGlyphRefElement.h:
3577         * svg/SVGGradientElement.cpp:
3578         * svg/SVGGradientElement.h:
3579         * svg/SVGGraphicsElement.cpp:
3580         * svg/SVGGraphicsElement.h:
3581         * svg/SVGHKernElement.cpp:
3582         * svg/SVGHKernElement.h:
3583         * svg/SVGImageElement.cpp:
3584         * svg/SVGImageElement.h:
3585         * svg/SVGLineElement.cpp:
3586         * svg/SVGLineElement.h:
3587         * svg/SVGLinearGradientElement.cpp:
3588         * svg/SVGLinearGradientElement.h:
3589         * svg/SVGMPathElement.cpp:
3590         * svg/SVGMPathElement.h:
3591         * svg/SVGMarkerElement.cpp:
3592         * svg/SVGMarkerElement.h:
3593         * svg/SVGMaskElement.cpp:
3594         * svg/SVGMaskElement.h:
3595         * svg/SVGMetadataElement.cpp:
3596         * svg/SVGMetadataElement.h:
3597         * svg/SVGMissingGlyphElement.cpp:
3598         * svg/SVGMissingGlyphElement.h:
3599         * svg/SVGPathElement.cpp:
3600         * svg/SVGPathElement.h:
3601         * svg/SVGPatternElement.cpp:
3602         * svg/SVGPatternElement.h:
3603         * svg/SVGPolyElement.cpp:
3604         * svg/SVGPolyElement.h:
3605         * svg/SVGPolygonElement.cpp:
3606         * svg/SVGPolygonElement.h:
3607         * svg/SVGPolylineElement.cpp:
3608         * svg/SVGPolylineElement.h:
3609         * svg/SVGRadialGradientElement.cpp:
3610         * svg/SVGRadialGradientElement.h:
3611         * svg/SVGRectElement.cpp:
3612         * svg/SVGRectElement.h:
3613         * svg/SVGSVGElement.cpp:
3614         * svg/SVGSVGElement.h:
3615         * svg/SVGScriptElement.cpp:
3616         * svg/SVGScriptElement.h:
3617         * svg/SVGSetElement.cpp:
3618         * svg/SVGSetElement.h:
3619         * svg/SVGStopElement.cpp:
3620         * svg/SVGStopElement.h:
3621         * svg/SVGStyleElement.cpp:
3622         * svg/SVGStyleElement.h:
3623         * svg/SVGSwitchElement.cpp:
3624         * svg/SVGSwitchElement.h:
3625         * svg/SVGSymbolElement.cpp:
3626         * svg/SVGSymbolElement.h:
3627         * svg/SVGTRefElement.cpp:
3628         * svg/SVGTRefElement.h:
3629         * svg/SVGTSpanElement.cpp:
3630         * svg/SVGTSpanElement.h:
3631         * svg/SVGTextContentElement.cpp:
3632         * svg/SVGTextContentElement.h:
3633         * svg/SVGTextElement.cpp:
3634         * svg/SVGTextElement.h:
3635         * svg/SVGTextPathElement.cpp:
3636         * svg/SVGTextPathElement.h:
3637         * svg/SVGTextPositioningElement.cpp:
3638         * svg/SVGTextPositioningElement.h:
3639         * svg/SVGTitleElement.cpp:
3640         * svg/SVGTitleElement.h:
3641         * svg/SVGUnknownElement.cpp: Added.
3642         * svg/SVGUnknownElement.h:
3643         * svg/SVGUseElement.cpp:
3644         * svg/SVGUseElement.h:
3645         * svg/SVGVKernElement.cpp:
3646         * svg/SVGVKernElement.h:
3647         * svg/SVGViewElement.cpp:
3648         * svg/SVGViewElement.h:
3649         * svg/animation/SVGSMILElement.cpp:
3650         * svg/animation/SVGSMILElement.h:
3651
3652 2018-03-16  Youenn Fablet  <youenn@apple.com>
3653
3654         Ensure Document::responseReceived and clearResource are called on the main thread
3655         https://bugs.webkit.org/show_bug.cgi?id=183709
3656
3657         Reviewed by Chris Dumez.
3658
3659         No change of behavior.
3660
3661         * loader/DocumentLoader.cpp:
3662         (WebCore::DocumentLoader::responseReceived):
3663         (WebCore::DocumentLoader::clearMainResource):
3664
3665 2018-03-16  Chris Dumez  <cdumez@apple.com>
3666
3667         WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
3668         https://bugs.webkit.org/show_bug.cgi?id=183702
3669
3670         Reviewed by Alex Christensen.
3671
3672         The issue is that the test calls loadHTMLString then loadRequest right after, without
3673         waiting for the first load to complete first. loadHTMLString is special as it relies
3674         on substitute data and which schedules a timer to commit the data. When doing the
3675         navigation policy check for the following loadRequest(), the substitute data timer
3676         would fire and commit its data and load. This would in turn cancel the pending
3677         navigation policy check for the loadRequest().
3678
3679         With sync policy delegates, this is not an issue because we take care of stopping
3680         all loaders when receiving the policy decision, which happens synchronously. However,
3681         when the policy decision happens asynchronously, the pending substitute data load
3682         does not get cancelled in time and it gets committed.
3683
3684         To address the issue, this patch updates loadWithDocumentLoader() to cancel any
3685         provisional load when there is an asynchronous navigation policy decision pending.
3686
3687         Change covered by new API test.
3688
3689         * loader/FrameLoader.cpp:
3690         (WebCore::FrameLoader::loadWithDocumentLoader):
3691
3692 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
3693
3694         Set a trap to catch an infrequent form-related nullptr crash
3695         https://bugs.webkit.org/show_bug.cgi?id=183704
3696         <rdar://problem/37579354>
3697
3698         Reviewed by Ryosuke Niwa.
3699
3700         Make FormState a FrameDestructionObserver. We expect all relevant FormState objects to have been
3701         cleaned up prior to the frame being destroyed. If we find such a case, we'd like to see the
3702         stack trace to see what's going on.
3703
3704         * loader/FormState.cpp:
3705         (WebCore::FormState::FormState):
3706         (WebCore::FormState::willDetachPage): RELEASE_ASSERT_NOT_REACHED if we ever get here.
3707         * loader/FormState.h:
3708
3709 2018-03-16  Joanmarie Diggs  <jdiggs@igalia.com>
3710
3711         AX: AccessibilityNodeObject::textForLabelElement() doesn't follow AccName calculation rules
3712         https://bugs.webkit.org/show_bug.cgi?id=183661
3713
3714         Reviewed by Chris Fleizach.
3715
3716         Have AccessibilityNodeObject::textForLabelElement() return the value from
3717         accessibleNameForNode() instead of innerText(). The former falls back on
3718         the latter if there is no author-provided accessible name.
3719
3720         Tests: accessibility/aria-label-on-label-element.html
3721                accessibility/label-with-pseudo-elements.html
3722
3723         * accessibility/AccessibilityNodeObject.cpp:
3724         (WebCore::AccessibilityNodeObject::textForLabelElement const):
3725         (WebCore::AccessibilityNodeObject::titleElementText const):
3726
3727 2018-03-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3728
3729         [Curl] Fix crash on websocket with bad handshake message.
3730         https://bugs.webkit.org/show_bug.cgi?id=183686
3731
3732         Reviewed by Youenn Fablet.
3733
3734         The closing cleanup was called multiple times. Add flag to detect
3735         it is already closed or not.
3736
3737         No new tests because it is covered by existing test:
3738         - LayoutTests/http/tests/websocket/tests/hybi/bad-handshake-crash.html
3739
3740         * platform/network/curl/SocketStreamHandleImpl.h:
3741         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
3742         (WebCore::SocketStreamHandleImpl::platformClose):
3743         (WebCore::SocketStreamHandleImpl::didReceiveData):
3744
3745 2018-03-16  Jer Noble  <jer.noble@apple.com>
3746
3747         Make Fullscreen API an Experimental Feature
3748         https://bugs.webkit.org/show_bug.cgi?id=183662
3749
3750         Reviewed by Jon Lee.
3751
3752         The Fullscreen APIs should be guarded by a Setting, so they are not present in the DOM when the
3753         Experimental Feature is disabled.
3754
3755         * dom/Document.idl:
3756         * dom/Element.idl:
3757
3758 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
3759
3760         Ensure that style is updated when the effective appearance changes
3761         https://bugs.webkit.org/show_bug.cgi?id=183690
3762         <rdar://problem/38385900>
3763
3764         Reviewed by Tim Horton and Wenson Hsieh.
3765
3766         Only exposing a function to outside WebCore, no tests needed.
3767
3768         * page/Page.h:
3769
3770 2018-03-16  Chris Dumez  <cdumez@apple.com>
3771
3772         WebKit.RestoreSessionStateContainingScrollRestorationDefault API test is failing with async policy delegates
3773         https://bugs.webkit.org/show_bug.cgi?id=183679
3774
3775         Reviewed by Alex Christensen.
3776
3777         Update CachedRawResource::didAddClient() to not send data until we've received
3778         the policy decision for the response.
3779
3780         No new tests, covered by new API test.
3781
3782         * loader/DocumentLoader.cpp:
3783         (WebCore::DocumentLoader::handleSubstituteDataLoadNow):
3784         (WebCore::DocumentLoader::responseReceived):
3785         * loader/DocumentLoader.h:
3786         * loader/DocumentThreadableLoader.cpp:
3787         (WebCore::DocumentThreadableLoader::responseReceived):
3788         * loader/DocumentThreadableLoader.h:
3789         * loader/MediaResourceLoader.cpp:
3790         (WebCore::MediaResource::responseReceived):
3791         * loader/MediaResourceLoader.h:
3792         * loader/appcache/ApplicationCacheResourceLoader.cpp:
3793         (WebCore::ApplicationCacheResourceLoader::responseReceived):
3794         * loader/appcache/ApplicationCacheResourceLoader.h:
3795         * loader/cache/CachedRawResource.cpp:
3796         (WebCore::CachedRawResource::didAddClient):
3797         (WebCore::CachedRawResource::responseReceived):
3798         * loader/cache/CachedRawResourceClient.h:
3799         (WebCore::CachedRawResourceClient::responseReceived):
3800         * loader/cache/KeepaliveRequestTracker.cpp:
3801         (WebCore::KeepaliveRequestTracker::responseReceived):
3802         * loader/cache/KeepaliveRequestTracker.h:
3803         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
3804         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3805         (WebCore::WebCoreAVFResourceLoader::responseReceived):
3806
3807 2018-03-16  Youenn Fablet  <youenn@apple.com>
3808
3809         Name Service Worker threads differently from regular Worker threads
3810         https://bugs.webkit.org/show_bug.cgi?id=183698
3811
3812         Reviewed by Chris Dumez.
3813
3814         No observable change of behavior.
3815         For debugging purposes, knowing that a thread is a service worker thread might help give context.
3816         It might also identify on a crash log whether the process is a service worker process or a regular web process.
3817
3818         * workers/WorkerThread.cpp:
3819         (WebCore::WorkerThread::start):
3820         * workers/WorkerThread.h:
3821         (WebCore::WorkerThread::isServiceWorkerThread const):
3822         * workers/service/context/ServiceWorkerThread.h:
3823
3824 2018-03-16  Youenn Fablet  <youenn@apple.com>
3825
3826         IceCandidates leak on webrtc/datachannel/basic.html and other tests
3827         https://bugs.webkit.org/show_bug.cgi?id=183676
3828         <rdar://problem/36116228>
3829
3830         Reviewed by Eric Carlson.
3831
3832         Covered by manual testing using --leaks option on WK1.
3833         WebKit should not release the candidates since libwebrtc is not taking ownership.
3834
3835         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3836         (WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
3837         (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
3838
3839 2018-03-16  Zan Dobersek  <zdobersek@igalia.com>
3840
3841         [Nicosia] Add Cairo-specific GraphicsContext operation recorder
3842         https://bugs.webkit.org/show_bug.cgi?id=183593
3843
3844         Reviewed by Carlos Garcia Campos.
3845
3846         Add Nicosia::CairoOperationRecorder, GraphicsContextImpl implementation
3847         that records all GraphicsContext operations for deferred replay on a
3848         different thread. Recording here mostly consists of storing all the
3849         Cairo resources in a thread-safe manner, which is eased by the atomic
3850         reference counting used in Cairo.
3851
3852         Nicosia::PaintingOperation derivatives are used for operations or state
3853         updates that require recording. Instances of these classes are appended
3854         to a Vector<> object that is then pushed into a thread pool in
3855         Nicosia::PaintingEngineThreaded , replaying all the operations against
3856         the Cairo context established from an associated target Nicosia::Buffer.
3857
3858         This GraphicsContextImpl implementation is now used in the
3859         PaintingContextCairo::ForRecording constructor to construct the
3860         GraphicsContext implementation that will be used for recording.
3861
3862         * platform/TextureMapper.cmake:
3863         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: Added.
3864         (Nicosia::getContext):
3865         (Nicosia::OperationData::arg const const):
3866         (Nicosia::createCommand):
3867         (Nicosia::CairoOperationRecorder::CairoOperationRecorder):
3868         (Nicosia::m_commandList):
3869         (Nicosia::CairoOperationRecorder::updateState):
3870         (Nicosia::CairoOperationRecorder::clearShadow):
3871         (Nicosia::CairoOperationRecorder::setLineCap):
3872         (Nicosia::CairoOperationRecorder::setLineDash):
3873         (Nicosia::CairoOperationRecorder::setLineJoin):
3874         (Nicosia::CairoOperationRecorder::setMiterLimit):
3875         (Nicosia::CairoOperationRecorder::fillRect):
3876         (Nicosia::CairoOperationRecorder::fillRoundedRect):
3877         (Nicosia::CairoOperationRecorder::fillRectWithRoundedHole):
3878         (Nicosia::CairoOperationRecorder::fillPath):
3879         (Nicosia::CairoOperationRecorder::fillEllipse):
3880         (Nicosia::CairoOperationRecorder::strokeRect):
3881         (Nicosia::CairoOperationRecorder::strokePath):
3882         (Nicosia::CairoOperationRecorder::strokeEllipse):
3883         (Nicosia::CairoOperationRecorder::clearRect):
3884         (Nicosia::CairoOperationRecorder::drawGlyphs):
3885         (Nicosia::CairoOperationRecorder::drawImage):
3886         (Nicosia::CairoOperationRecorder::drawTiledImage):
3887         (Nicosia::CairoOperationRecorder::drawNativeImage):
3888         (Nicosia::CairoOperationRecorder::drawPattern):
3889         (Nicosia::CairoOperationRecorder::drawRect):
3890         (Nicosia::CairoOperationRecorder::drawLine):
3891         (Nicosia::CairoOperationRecorder::drawLinesForText):
3892         (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker):
3893         (Nicosia::CairoOperationRecorder::drawEllipse):
3894         (Nicosia::CairoOperationRecorder::drawPath):
3895         (Nicosia::CairoOperationRecorder::drawFocusRing):
3896         (Nicosia::CairoOperationRecorder::save):
3897         (Nicosia::CairoOperationRecorder::restore):
3898         (Nicosia::CairoOperationRecorder::translate):
3899         (Nicosia::CairoOperationRecorder::rotate):
3900         (Nicosia::CairoOperationRecorder::scale):
3901         (Nicosia::CairoOperationRecorder::concatCTM):
3902         (Nicosia::CairoOperationRecorder::setCTM):
3903         (Nicosia::CairoOperationRecorder::getCTM):
3904         (Nicosia::CairoOperationRecorder::beginTransparencyLayer):
3905         (Nicosia::CairoOperationRecorder::endTransparencyLayer):
3906         (Nicosia::CairoOperationRecorder::clip):
3907         (Nicosia::CairoOperationRecorder::clipOut):
3908         (Nicosia::CairoOperationRecorder::clipPath):
3909         (Nicosia::CairoOperationRecorder::clipBounds):
3910         (Nicosia::CairoOperationRecorder::applyDeviceScaleFactor):
3911         (Nicosia::CairoOperationRecorder::roundToDevicePixels):
3912         (Nicosia::CairoOperationRecorder::append):
3913         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: Added.
3914         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
3915         (Nicosia::PaintingContextCairo::ForRecording::ForRecording):
3916
3917 2018-03-16  Zan Dobersek  <zdobersek@igalia.com>
3918
3919         [TexMap] Clean up TextureMapperLayer constructor
3920         https://bugs.webkit.org/show_bug.cgi?id=183634
3921
3922         Reviewed by Michael Catanzaro.
3923
3924         In the TextureMapperLayer header, only declare the constructor, and move
3925         all the previous member initialization to the point of declaration of
3926         these member variables.
3927
3928         In the TextureMapperLayer implementation file, the constructor and
3929         destructor are moved into proper order at the top of the file. The
3930         former is defaulted, and the latter remains unchanged.
3931
3932         No change in behavior.
3933
3934         * platform/graphics/texmap/TextureMapperLayer.cpp:
3935         (WebCore::TextureMapperLayer::~TextureMapperLayer):
3936         * platform/graphics/texmap/TextureMapperLayer.h:
3937
3938 2018-03-16  Miguel Gomez  <magomez@igalia.com>
3939
3940         [GTK] When using EGL, request an OpenGL core profile when possible
3941         https://bugs.webkit.org/show_bug.cgi?id=178719
3942
3943         Reviewed by Carlos Garcia Campos.
3944
3945         When using EGL and OpenGL, try to request a context with version >= 3.2 with a core profile
3946         whenever possible. In order to to this, we require EGL version 1.5 or version 1.4 with the
3947         extension EGL_KHR_create_context. If EGL requirements are not met, or we cannot get a
3948         context with version >= 3.2 then use whatever EGL gives us.
3949
3950         Covered by existent tests.
3951
3952         * platform/graphics/egl/GLContextEGL.cpp:
3953         (WebCore::GLContextEGL::createWindowContext):
3954         (WebCore::GLContextEGL::createPbufferContext):
3955         (WebCore::GLContextEGL::createSurfacelessContext):
3956         (WebCore::GLContextEGL::createContextForEGLVersion):
3957         * platform/graphics/egl/GLContextEGL.h: