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