1 2018-01-19 Daniel Bates <dabates@apple.com>
3 Update frame-ancestor directive to match Content Security Policy Level 3
4 https://bugs.webkit.org/show_bug.cgi?id=178891
5 <rdar://problem/35209458>
7 Reviewed by Alex Christensen.
9 Derived from Blink e667cc2e501fabab3605b838e4ee0d642a9c4a59:
10 <https://chromium.googlesource.com/chromium/src.git/+/e667cc2e501fabab3605b838e4ee0d642a9c4a59>
12 Update frame-ancestor directive to match against the origin of the ancestor document per the
13 Content Security Policy Level 3 spec.: <https://w3c.github.io/webappsec-csp/> (15 January 2018).
14 Specifically this change in behavior was made to CSP 3 in <https://github.com/w3c/webappsec/issues/311>.
15 In earlier versions of the spec, the frame-ancestor directive matched against the URL of the
18 Disregarding allow-same-origin sandboxed iframes, a document with policy "frame-ancestor 'self'"
19 will be blocked from loading in a sandboxed iframe as a result of this change.
21 Tests: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-allow-same-origin-sandboxed-cross-url-allow.html
22 http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-sandboxed-cross-url-block.html
24 * page/csp/ContentSecurityPolicyDirectiveList.cpp:
25 (WebCore::checkFrameAncestors):
27 2018-01-19 Basuke Suzuki <Basuke.Suzuki@sony.com>
29 [Curl] Add timeout support to XMLHttpRequest
30 https://bugs.webkit.org/show_bug.cgi?id=181876
32 Reviewed by Alex Christensen
34 * platform/network/ResourceRequestBase.cpp:
35 * platform/network/curl/CurlContext.cpp:
36 (WebCore::CurlHandle::setTimeout):
37 * platform/network/curl/CurlContext.h:
38 * platform/network/curl/CurlRequest.cpp:
39 (WebCore::CurlRequest::setupTransfer):
40 (WebCore::CurlRequest::didCompleteTransfer):
41 * platform/network/curl/ResourceError.h:
42 * platform/network/curl/ResourceErrorCurl.cpp:
43 (WebCore::ResourceError::httpError):
45 2018-01-19 Yoav Weiss <yoav@yoav.ws>
47 Support for preconnect Link headers
48 https://bugs.webkit.org/show_bug.cgi?id=181657
50 Reviewed by Darin Adler.
52 Move the preconnect functionality into its own function, and
53 also call this function when Link headers are processed.
55 Test: http/tests/preconnect/link-header-rel-preconnect-http.php
57 * loader/LinkLoader.cpp:
58 (WebCore::LinkLoader::loadLinksFromHeader): Call preconnectIfNeeded.
59 (WebCore::LinkLoader::preconnectIfNeeded): Preconnect to a host functionality moved here.
60 (WebCore::LinkLoader::loadLink): Call preconnectIfNeeded.
61 * loader/LinkLoader.h:
63 2018-01-19 Joseph Pecoraro <pecoraro@apple.com>
65 AppCache: Log a Deprecation warning to the Console when AppCache is used
66 https://bugs.webkit.org/show_bug.cgi?id=181778
68 Reviewed by Alex Christensen.
70 * html/HTMLHtmlElement.cpp:
71 (WebCore::HTMLHtmlElement::insertedByParser):
73 2018-01-19 Chris Dumez <cdumez@apple.com>
75 ASSERT(registration || isTerminating()) hit in SWServerWorker::skipWaiting()
76 https://bugs.webkit.org/show_bug.cgi?id=181761
77 <rdar://problem/36594564>
79 Reviewed by Youenn Fablet.
81 There is a short period of time, early in the registration process where a
82 SWServerWorker object exists for a registration but is not in the registration's
83 installing/waiting/active slots yet. As a result, if a registration is cleared
84 during this period (for e.g. due to the user clearing all website data), that
85 SWServerWorker will not be terminated. We then hit assertion later on when this
86 worker is trying to do things (like call skipWaiting).
88 To address the issue, we now keep a reference this SWServerWorker on the
89 registration, via a new SWServerRegistration::m_preInstallationWorker data member.
90 When the registration is cleared, we now take care of terminating this worker.
92 No new tests, covered by existing tests that crash flakily in debug builds.
94 * workers/WorkerThread.cpp:
95 (WebCore::WorkerThread::stop):
96 if the mutex is locked, then the worker thread is still starting. We spin the
97 runloop and try to stop again later. This avoids the deadlock shown in
98 Bug 181763 as the worker thread may need to interact with the main thread
101 * workers/service/server/SWServer.cpp:
102 (WebCore::SWServer::installContextData):
103 * workers/service/server/SWServerJobQueue.cpp:
104 (WebCore::SWServerJobQueue::scriptContextFailedToStart):
105 (WebCore::SWServerJobQueue::install):
106 * workers/service/server/SWServerRegistration.cpp:
107 (WebCore::SWServerRegistration::~SWServerRegistration):
108 (WebCore::SWServerRegistration::setPreInstallationWorker):
109 (WebCore::SWServerRegistration::clear):
110 * workers/service/server/SWServerRegistration.h:
111 (WebCore::SWServerRegistration::preInstallationWorker const):
113 2018-01-19 Chris Dumez <cdumez@apple.com>
115 Service worker registrations restored from disk may not be reused when the JS calls register() again
116 https://bugs.webkit.org/show_bug.cgi?id=181810
117 <rdar://problem/36591711>
119 Reviewed by Youenn Fablet.
121 The issue was that when restoring a registration from disk, we would not set its active worker right
122 away. We only set it later in installContextData(). installContextData() is only called after we’ve
123 launched the service worker process and established a connection to it.
125 However, we would start processing jobs (such as registrations) before we’ve established the connection
126 to the service worker process. SWServerJobQueue::runRegisterJob(), in order to reuse an existing
127 registration checks the registration’s active worker has the right script URL. The issue was that when
128 this code would execute, we may not have set the registration’s active service worker yet, in which case,
129 we would update the existing registration instead of reusing it as-is.
131 To address the issue, we now delay the processing of jobs until the connection to the service worker
132 process has been established and we've installed all pending contexts via installContextData().
134 Changed is covered by new API test.
136 * workers/service/server/SWServer.cpp:
137 (WebCore::SWServer::Connection::scheduleJobInServer):
138 (WebCore::SWServer::scheduleJob):
139 (WebCore::SWServer::serverToContextConnectionCreated):
140 * workers/service/server/SWServer.h:
142 2018-01-19 James Craig <jcraig@apple.com>
144 AX: when invert colors is on, double-invert image and picture elements in UserAgentStyleSheet
145 https://bugs.webkit.org/show_bug.cgi?id=181281
146 <rdar://problem/36291776>
148 Reviewed by Simon Fraser.
150 Updated "Smart Invert" to include img and picture element inversion and tests.
152 Tests: accessibility/smart-invert-reference.html
153 accessibility/smart-invert.html
156 (@media (inverted-colors)):
157 (img:not(picture>img), picture, video):
159 2018-01-19 Chris Dumez <cdumez@apple.com>
161 The WebContent process should not process incoming IPC while waiting for a sync IPC reply
162 https://bugs.webkit.org/show_bug.cgi?id=181560
164 Reviewed by Ryosuke Niwa.
166 Add internals API for testing purposes.
168 Test: fast/misc/testIncomingSyncIPCMessageWhileWaitingForSyncReply.html
170 * page/ChromeClient.h:
171 * testing/Internals.cpp:
172 (WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
173 * testing/Internals.h:
174 * testing/Internals.idl:
176 2018-01-19 Keith Miller <keith_miller@apple.com>
178 HaveInternalSDK includes should be "#include?"
179 https://bugs.webkit.org/show_bug.cgi?id=179670
181 Reviewed by Dan Bernstein.
183 * Configurations/Base.xcconfig:
185 2018-01-19 Daniel Bates <dabates@apple.com>
187 Fix misspelling; substitute willDetachRenderer for willDetatchRenderer.
189 * html/HTMLPlugInImageElement.cpp:
190 (WebCore::HTMLPlugInImageElement::willDetachRenderers):
191 * plugins/PluginViewBase.h:
192 (WebCore::PluginViewBase::willDetachRenderer):
193 (WebCore::PluginViewBase::willDetatchRenderer): Deleted.
195 2018-01-19 Jonathan Bedard <jbedard@apple.com>
197 Unreviewed build fix, remove unused lambda captures.
199 * dom/messageports/MessagePortChannel.cpp:
200 (WebCore::MessagePortChannel::takeAllMessagesForPort):
201 * dom/messageports/MessagePortChannelRegistry.cpp:
202 (WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
204 2018-01-19 Antoine Quint <graouts@apple.com>
206 [Web Animations] Expose timing properties (delay, endDelay, fill, iterationStart, iterations, direction) and getComputedTiming()
207 https://bugs.webkit.org/show_bug.cgi?id=181857
208 <rdar://problem/36660081>
210 Reviewed by Dean Jackson.
212 We start the work to implement the rest of the Web Animations timing and animation model by exposing more properties on
213 AnimationEffectTiming to control delay (delay, endDelay), looping (iterationStart, iterations), fill and direction.
214 Additionally, we expose the getComputedTiming() method on AnimationEffect, although it currently lacks some computed
215 properties that will come in later patch as we implement various processes defined by the spec. We also update the
216 existing duration() method on AnimationEffectTiming to be called iterationDuration() to match the terms used in the
219 Finally, we make all new properties, and update existing ones, that expose a time value go through the new utility
220 function secondsToWebAnimationsAPITime() to guarantee rounded values with microseconds precision, as advised by
221 the Web Animations specification.
224 * DerivedSources.make:
226 * WebCore.xcodeproj/project.pbxproj:
227 * animation/AnimationEffect.cpp:
228 (WebCore::AnimationEffect::localTime const):
229 (WebCore::AnimationEffect::getComputedTiming):
230 * animation/AnimationEffect.h:
231 * animation/AnimationEffect.idl:
232 * animation/AnimationEffectTiming.cpp:
233 (WebCore::AnimationEffectTiming::AnimationEffectTiming):
234 (WebCore::AnimationEffectTiming::setIterationStart):
235 (WebCore::AnimationEffectTiming::setIterations):
236 (WebCore::AnimationEffectTiming::bindingsDuration const):
237 (WebCore::AnimationEffectTiming::setBindingsDuration):
238 (WebCore::AnimationEffectTiming::endTime const):
239 (WebCore::AnimationEffectTiming::activeDuration const):
240 * animation/AnimationEffectTiming.h:
241 * animation/AnimationEffectTiming.idl:
242 * animation/AnimationPlaybackEvent.cpp:
243 (WebCore::AnimationPlaybackEvent::bindingsCurrentTime const):
244 (WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
245 * animation/AnimationTimeline.cpp:
246 (WebCore::AnimationTimeline::bindingsCurrentTime):
247 * animation/ComputedTimingProperties.h: Added.
248 * animation/ComputedTimingProperties.idl: Added. We set nullable double values to a default value of "null" since
249 otherwise setting those properties to a null value would not set the properties in the converted JS dictionary.
250 * animation/KeyframeEffect.cpp:
251 (WebCore::KeyframeEffect::create): Handle new timing properties passed in the KeyframeEffectOptions dictionary.
252 (WebCore::KeyframeEffect::applyAtLocalTime):
253 (WebCore::KeyframeEffect::getAnimatedStyle):
254 (WebCore::KeyframeEffect::startOrStopAccelerated):
255 * animation/WebAnimation.cpp:
256 (WebCore::WebAnimation::bindingsStartTime const):
257 (WebCore::WebAnimation::bindingsCurrentTime const):
258 (WebCore::WebAnimation::effectEndTime const):
259 (WebCore::WebAnimation::timeToNextRequiredTick const):
260 * animation/WebAnimationUtilities.h: Added.
261 (WebCore::secondsToWebAnimationsAPITime):
263 2018-01-19 Alex Christensen <achristensen@webkit.org>
265 Remove dead networking code
266 https://bugs.webkit.org/show_bug.cgi?id=181813
268 Reviewed by Tim Horton.
270 CFURLConnection is only used on Windows.
272 * platform/network/cf/ResourceError.h:
273 * platform/network/cf/ResourceRequest.h:
274 (WebCore::ResourceRequest::encodingRequiresPlatformData const):
275 * platform/network/cf/ResourceRequestCFNet.cpp:
276 (WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
277 (WebCore::ResourceRequest::doUpdatePlatformRequest):
278 (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
279 (WebCore::ResourceRequest::doUpdateResourceRequest):
280 (WebCore::ResourceRequest::setStorageSession):
281 * platform/network/cf/ResourceResponse.h:
282 (WebCore::ResourceResponse::ResourceResponse):
284 2018-01-19 Alex Christensen <achristensen@webkit.org>
286 Remove unused WebViewPrivate _allowCookies
287 https://bugs.webkit.org/show_bug.cgi?id=181812
289 Reviewed by Tim Horton.
291 This SPI was in the original iOS upstreaming and has not been used in many years.
293 * platform/network/ResourceRequestBase.cpp:
294 (WebCore::ResourceRequestBase::setDefaultAllowCookies): Deleted.
295 (WebCore::ResourceRequestBase::defaultAllowCookies): Deleted.
296 * platform/network/ResourceRequestBase.h:
297 (WebCore::ResourceRequestBase::ResourceRequestBase):
299 2018-01-18 Brady Eidson <beidson@apple.com>
301 Make in-process MessagePorts be (mostly) asynchronous
302 https://bugs.webkit.org/show_bug.cgi?id=181454
304 Reviewed by Alex Christensen.
306 No new tests (Covered *brutally* by existing tests)
308 Part of making MessagePorts be a thing we can pass across processes is making them work async.
310 The existing "MessagePortChannel" method of abstraction was not cut out for this.
311 This patch gets rid of MessagePortChannel and adds a new MessagePortChannelProvider abstraction.
312 It then gets the new machinery working in-process (with some pieces of out-of-process in place)
314 One synchronous behavior this patch maintains is the hasPendingActivity() check used to support GC.
315 That will (creatively) be made async in the next followup.
317 More generally from MessagePorts, this patch also adds a "MessageWithMessagePorts" object to be used
318 with all forms of postMessage(). Much better.
322 * WebCore.xcodeproj/project.pbxproj:
324 * dom/InProcessMessagePortChannel.cpp: Removed.
325 * dom/InProcessMessagePortChannel.h: Removed.
326 * dom/MessagePortChannel.cpp: Removed.
327 * dom/MessagePortChannel.h: Removed.
329 * dom/MessageChannel.cpp:
330 (WebCore::MessageChannel::create):
331 (WebCore::MessageChannel::MessageChannel):
332 (WebCore::m_port2): Deleted.
333 * dom/MessageChannel.h:
334 (WebCore::MessageChannel::create): Deleted.
336 * dom/MessagePort.cpp:
337 (WebCore::MessagePort::create):
338 (WebCore::MessagePort::MessagePort):
339 (WebCore::MessagePort::~MessagePort):
340 (WebCore::MessagePort::entangle):
341 (WebCore::MessagePort::postMessage):
342 (WebCore::MessagePort::disentangle):
343 (WebCore::MessagePort::messageAvailable):
344 (WebCore::MessagePort::start):
345 (WebCore::MessagePort::close):
346 (WebCore::MessagePort::contextDestroyed):
347 (WebCore::MessagePort::dispatchMessages):
348 (WebCore::MessagePort::hasPendingActivity const):
349 (WebCore::MessagePort::locallyEntangledPort const):
350 (WebCore::MessagePort::disentanglePorts):
351 (WebCore::MessagePort::entanglePorts):
352 (WebCore::MessagePort::entangleWithRemote): Deleted.
355 * dom/MessagePortIdentifier.h:
356 (WebCore::MessagePortIdentifier::logString const):
358 * dom/ScriptExecutionContext.cpp:
359 (WebCore::ScriptExecutionContext::processMessageWithMessagePortsSoon):
360 (WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
361 (WebCore::ScriptExecutionContext::processMessagePortMessagesSoon): Deleted.
362 * dom/ScriptExecutionContext.h:
364 Add a single object that represents two intertwined ports, tracks their pending
365 messages, tracks which process they're in, etc etc:
366 * dom/messageports/MessagePortChannel.cpp: Added.
367 (WebCore::MessagePortChannel::create):
368 (WebCore::MessagePortChannel::MessagePortChannel):
369 (WebCore::MessagePortChannel::~MessagePortChannel):
370 (WebCore::MessagePortChannel::includesPort):
371 (WebCore::MessagePortChannel::entanglePortWithProcess):
372 (WebCore::MessagePortChannel::disentanglePort):
373 (WebCore::MessagePortChannel::closePort):
374 (WebCore::MessagePortChannel::postMessageToRemote):
375 (WebCore::MessagePortChannel::takeAllMessagesForPort):
376 (WebCore::MessagePortChannel::hasAnyMessagesPendingOrInFlight const):
377 * dom/messageports/MessagePortChannel.h: Added.
378 (WebCore::MessagePortChannel::port1 const):
379 (WebCore::MessagePortChannel::port2 const):
380 (WebCore::MessagePortChannel::logString const):
382 Abstraction for creating and operating on MessagePorts in a potentially cross-process way:
383 * dom/messageports/MessagePortChannelProvider.cpp: Added.
384 (WebCore::MessagePortChannelProvider::singleton):
385 (WebCore::MessagePortChannelProvider::setSharedProvider):
386 * dom/messageports/MessagePortChannelProvider.h: Added.
387 (WebCore::MessagePortChannelProvider::~MessagePortChannelProvider):
389 Adds a concrete implementation of that provider to be used in-process (e.g. WK1):
390 * dom/messageports/MessagePortChannelProviderImpl.cpp: Added.
391 (WebCore::MessagePortChannelProviderImpl::~MessagePortChannelProviderImpl):
392 (WebCore::MessagePortChannelProviderImpl::performActionOnAppropriateThread):
393 (WebCore::MessagePortChannelProviderImpl::createNewMessagePortChannel):
394 (WebCore::MessagePortChannelProviderImpl::entangleLocalPortInThisProcessToRemote):
395 (WebCore::MessagePortChannelProviderImpl::messagePortDisentangled):
396 (WebCore::MessagePortChannelProviderImpl::messagePortClosed):
397 (WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
398 (WebCore::MessagePortChannelProviderImpl::takeAllMessagesForPort):
399 (WebCore::MessagePortChannelProviderImpl::hasMessagesForPorts_temporarySync):
400 * dom/messageports/MessagePortChannelProviderImpl.h: Added.
402 Adds a main thread object to handle the set of all MessagePortChannels that are open.
403 For now it lives in the WebProcess, but for out-of-process it will live in the UIProcess:
404 * dom/messageports/MessagePortChannelRegistry.cpp: Added.
405 (WebCore::MessagePortChannelRegistry::~MessagePortChannelRegistry):
406 (WebCore::MessagePortChannelRegistry::didCreateMessagePortChannel):
407 (WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
408 (WebCore::MessagePortChannelRegistry::messagePortChannelDestroyed):
409 (WebCore::MessagePortChannelRegistry::didEntangleLocalToRemote):
410 (WebCore::MessagePortChannelRegistry::didDisentangleMessagePort):
411 (WebCore::MessagePortChannelRegistry::didCloseMessagePort):
412 (WebCore::MessagePortChannelRegistry::didPostMessageToRemote):
413 (WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
414 (WebCore::MessagePortChannelRegistry::hasMessagesForPorts_temporarySync): This is named against style
415 and weird on purpose - to call attention to how bad it is and how it's temporary.
416 (WebCore::MessagePortChannelRegistry::existingChannelContainingPort):
417 * dom/messageports/MessagePortChannelRegistry.h: Added.
419 Add an object that represents a "SerializedScriptValue for the message payload and the ports
420 that are being transferred along with that payload". This is used in all forms of postMessage():
421 * dom/messageports/MessageWithMessagePorts.cpp: Added.
422 * dom/messageports/MessageWithMessagePorts.h: Added.
424 * page/DOMWindow.cpp:
425 (WebCore::PostMessageTimer::PostMessageTimer):
426 (WebCore::PostMessageTimer::event):
427 (WebCore::DOMWindow::postMessage):
429 * platform/Logging.h:
431 * workers/DedicatedWorkerGlobalScope.cpp:
432 (WebCore::DedicatedWorkerGlobalScope::postMessage):
434 * workers/Worker.cpp:
435 (WebCore::Worker::postMessage):
437 * workers/WorkerGlobalScopeProxy.h:
439 * workers/WorkerMessagingProxy.cpp:
440 (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
441 (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
442 * workers/WorkerMessagingProxy.h:
444 * workers/WorkerObjectProxy.h:
446 * workers/service/ServiceWorker.cpp:
447 (WebCore::ServiceWorker::postMessage):
449 * workers/service/ServiceWorkerClient.cpp:
450 (WebCore::ServiceWorkerClient::postMessage):
452 * workers/service/context/SWContextManager.cpp:
453 (WebCore::SWContextManager::postMessageToServiceWorker):
455 * workers/service/context/ServiceWorkerThread.cpp:
456 (WebCore::fireMessageEvent):
457 (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
458 * workers/service/context/ServiceWorkerThread.h:
460 2018-01-18 Ryan Haddad <ryanhaddad@apple.com>
462 Unreviewed build fix, removed unused lambda capture.
464 * workers/service/context/SWContextManager.cpp:
465 (WebCore::SWContextManager::ServiceWorkerTerminationRequest::ServiceWorkerTerminationRequest):
467 2018-01-18 Chris Dumez <cdumez@apple.com>
469 We should be able to terminate service workers that are unresponsive
470 https://bugs.webkit.org/show_bug.cgi?id=181563
471 <rdar://problem/35280031>
473 Reviewed by Alex Christensen.
475 Test: http/tests/workers/service/postmessage-after-terminating-hung-worker.html
477 * workers/service/context/SWContextManager.cpp:
478 (WebCore::SWContextManager::terminateWorker):
479 Before calling WorkerThread::stop(), set a timer with the given timeout parameter.
480 If the worker thread has not stopped when the timer fires, forcefully exit the
481 service worker process. The StorageProcess will take care of relaunching the
482 service worker process if it exits abruptly.
484 (WebCore::SWContextManager::serviceWorkerFailedToTerminate):
485 Log error message if we failed to terminate a service worker and call exit().
487 (WebCore::SWContextManager::ServiceWorkerTerminationRequest::ServiceWorkerTerminationRequest):
489 * workers/service/context/SWContextManager.h:
491 2018-01-18 Youenn Fablet <youenn@apple.com>
493 Do not go to the storage process when loading a main resource if there is no service worker registered
494 https://bugs.webkit.org/show_bug.cgi?id=181395
496 Reviewed by Chris Dumez.
498 No observable behavior change.
499 Instead of creating a connection to know whether there is a potential service worker,
500 Ask the service worker provider that will use the connection if needed.
501 Otherwise, it will use a default value provided by the UIProcess.
503 Tested by cleaning all service workers and checking the computed value of the default value,
504 then observing whether pages registering service workers work well.
506 * loader/DocumentLoader.cpp:
507 (WebCore::DocumentLoader::startLoadingMainResource):
508 * workers/service/ServiceWorkerProvider.cpp:
509 (WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
510 * workers/service/ServiceWorkerProvider.h:
512 2018-01-18 Dan Bernstein <mitz@apple.com>
514 [Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions
515 https://bugs.webkit.org/show_bug.cgi?id=181803
517 Reviewed by Tim Horton.
519 * Configurations/Base.xcconfig: Updated.
520 * Configurations/DebugRelease.xcconfig: Ditto.
521 * Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
522 * Configurations/Version.xcconfig: Updated.
523 * Configurations/macOSTargetConditionals.xcconfig: Added. Defines helper build settings
524 useful for defining settings that depend on the target macOS version.
526 2018-01-18 Chris Dumez <cdumez@apple.com>
528 Service Workers restored from persistent storage have 'redundant' state
529 https://bugs.webkit.org/show_bug.cgi?id=181749
530 <rdar://problem/36556486>
532 Reviewed by Youenn Fablet.
534 Tested by new API test.
536 * workers/service/server/SWServer.cpp:
537 (WebCore::SWServer::installContextData):
538 Make sure the SWServerWorker's state is set to "activated" after it is assigned to
539 the registrations' active slot. Otherwise, it stays in its default state (redundant).
541 2018-01-18 Antti Koivisto <antti@apple.com>
543 REGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
544 https://bugs.webkit.org/show_bug.cgi?id=181460
545 <rdar://problem/36379776>
547 Reviewed by Ryosuke Niwa.
549 * css/parser/CSSParser.cpp:
550 (WebCore::CSSParserContext::CSSParserContext):
552 Don't do the expensive security origin test if the supplied sheet base URL is null. This
553 is true for rules coming from the same document.
555 2018-01-18 Antti Koivisto <antti@apple.com>
557 REGRESSION (r223604): Setting :before/after pseudo element on <noscript> asserts
558 https://bugs.webkit.org/show_bug.cgi?id=181795
559 <rdar://problem/36334524>
561 Reviewed by David Kilzer.
563 <noscript> disallows renderer generation outside CSS mechanisms, however we would still construct
564 PseudoElements for them during style resolution. These were never removed properly because the
565 pseudo element removal was tied to render tree teardown. Without proper removal the associated
566 animations were also not canceled.
568 Test: fast/css-generated-content/noscript-pseudo-anim-crash.html
571 (WebCore::Element::removedFromAncestor):
573 Take care to get rid of PseudoElements when the element is removed from the tree.
574 This also cancels any associated animations.
576 2018-01-18 Chris Fleizach <cfleizach@apple.com>
578 AX: Aria-activedescendant not supported
579 https://bugs.webkit.org/show_bug.cgi?id=161734
580 <rdar://problem/28202679>
582 Reviewed by Joanmarie Diggs.
584 When a combo-box owns/controls a list/listbox/grid/tree, the owned element needs to check the active-descendant of the combobox when
585 checking if it has selected children.
586 The target of the selection change notification should also be the owned element in these cases.
588 Test: accessibility/aria-combobox-controlling-list.html
590 * accessibility/AccessibilityObject.cpp:
591 (WebCore::AccessibilityObject::selectedListItem):
592 * accessibility/AccessibilityObject.h:
593 * accessibility/AccessibilityRenderObject.cpp:
594 (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
595 (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
596 (WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
597 (WebCore::AccessibilityRenderObject::selectedChildren):
598 * accessibility/AccessibilityRenderObject.h:
599 * accessibility/mac/AXObjectCacheMac.mm:
600 (WebCore::AXObjectCache::postPlatformNotification):
602 2018-01-17 Per Arne Vollan <pvollan@apple.com>
604 REGRESSION (r224780): Text stroke not applied to video captions.
605 https://bugs.webkit.org/show_bug.cgi?id=181743
606 <rdar://problem/35874338>
608 Reviewed by Simon Fraser.
610 Tests: media/track/track-css-visible-stroke-expected.html
611 media/track/track-css-visible-stroke.html
613 After r224780, it is no longer possible to mix text stroke styles with webkit
614 legacy text stroke styles.
616 * css/StyleResolver.cpp:
617 (WebCore::isValidCueStyleProperty):
618 * page/CaptionUserPreferencesMediaAF.cpp:
619 (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS const):
621 2018-01-18 Andy Estes <aestes@apple.com>
623 [Payment Request] Support a default shipping address for Apple Pay
624 https://bugs.webkit.org/show_bug.cgi?id=181754
625 <rdar://problem/36009733>
627 Reviewed by Brady Eidson.
629 Move shippingContact from ApplePayPaymentRequest to ApplePayRequestBase. This allows
630 merchants to specify a default shipping address when using Apple Pay with Payment Request.
632 This also fixes a bug found during testing where
633 +[NSPersonNameComponentsFormatter localizedStringFromPersonNameComponents:style:options:]
634 would throw an exception when passed a nil NSPersonNameComponents.
636 Test: http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html
638 * Modules/applepay/ApplePayPaymentRequest.h:
639 * Modules/applepay/ApplePayPaymentRequest.idl:
640 * Modules/applepay/ApplePayRequestBase.cpp:
641 (WebCore::convertAndValidate):
642 * Modules/applepay/ApplePayRequestBase.h:
643 * Modules/applepay/ApplePayRequestBase.idl:
644 * Modules/applepay/ApplePaySession.cpp:
645 (WebCore::convertAndValidate):
646 * Modules/applepay/ApplePaySessionPaymentRequest.h:
647 (WebCore::ApplePaySessionPaymentRequest::version const):
648 (WebCore::ApplePaySessionPaymentRequest::setVersion):
649 * Modules/applepay/cocoa/PaymentContactCocoa.mm:
651 * Modules/applepay/paymentrequest/ApplePayRequest.idl:
652 * testing/MockPaymentCoordinator.cpp:
653 (WebCore::MockPaymentCoordinator::showPaymentUI):
654 (WebCore::MockPaymentCoordinator::completeMerchantValidation):
655 * testing/MockPaymentCoordinator.h:
657 2018-01-18 Wenson Hsieh <wenson_hsieh@apple.com>
659 [iOS] Specify -[NSURL _title] for the associated URL when copying an image element
660 https://bugs.webkit.org/show_bug.cgi?id=181783
661 <rdar://problem/35785445>
663 Reviewed by Ryosuke Niwa.
665 Always specify the -[NSURL _title] to be either the title specified in a PasteboardImage's inner PasteboardURL,
666 or if no title is specified, fall back to the user-visible URL string. This is because at least one internal
667 client always tries to use the -_title property to determine the title of a pasted URL, or if none is specified,
668 the -suggestedName. Since we need to set suggestedName to the preferred file name of the copied image and we
669 don't want the suggested name to become the title of the link, we need to explicitly set the link title.
671 In doing so, this patch also fixes a bug wherein we forget to set the _title of the NSURL we're registering to
674 Tests: ActionSheetTests.CopyImageElementWithHREFAndTitle (new)
675 ActionSheetTests.CopyImageElementWithHREF (modified)
677 * platform/ios/PlatformPasteboardIOS.mm:
678 (WebCore::PlatformPasteboard::write):
680 2018-01-17 Jer Noble <jer.noble@apple.com>
682 WebVTT served via HLS never results in cues
683 https://bugs.webkit.org/show_bug.cgi?id=181773
685 Reviewed by Eric Carlson.
687 Test: http/tests/media/hls/hls-webvtt-tracks.html
689 Three independant errors conspired to keep in-band WebVTT samples from parsing:
691 - The definition of ISOWebVTTCue::boxTypeName() was incorrect.
692 - ISOWebVTTCue::parse() didn't call it's superclass's parse() method (leading to an incorrect size and offset).
693 - Use String::fromUTF8() rather than String.adopt(StringVector&&).
695 * platform/graphics/iso/ISOVTTCue.cpp:
696 (WebCore::ISOWebVTTCue::parse):
697 * platform/graphics/iso/ISOVTTCue.h:
698 (WebCore::ISOWebVTTCue::boxTypeName):
700 2018-01-17 John Wilander <wilander@apple.com>
702 Resource Load Statistics: Block cookies for prevalent resources without user interaction
703 https://bugs.webkit.org/show_bug.cgi?id=177394
704 <rdar://problem/34613960>
706 Reviewed by Alex Christensen.
708 Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
709 http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
710 http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
711 http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html
713 * platform/network/NetworkStorageSession.h:
714 Now exports NetworkStorageSession::nsCookieStorage().
715 * platform/network/cf/NetworkStorageSessionCFNet.cpp:
716 (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
719 2018-01-17 Dean Jackson <dino@apple.com>
721 Remove linked-on test for Snow Leopard
722 https://bugs.webkit.org/show_bug.cgi?id=181770
724 Reviewed by Eric Carlson.
726 Remove a very old linked-on-or-after test.
728 * platform/graphics/ca/GraphicsLayerCA.cpp:
730 2018-01-17 Matt Lewis <jlewis3@apple.com>
732 Unreviewed, rolling out r227098.
734 This broke the build.
738 "Remove linked-on test for Snow Leopard"
739 https://bugs.webkit.org/show_bug.cgi?id=181770
740 https://trac.webkit.org/changeset/227098
742 2018-01-17 Dean Jackson <dino@apple.com>
744 Remove linked-on test for Snow Leopard
745 https://bugs.webkit.org/show_bug.cgi?id=181770
747 Reviewed by Eric Carlson.
749 Remove a very old linked-on-or-after test.
751 * platform/graphics/ca/GraphicsLayerCA.cpp:
753 2018-01-17 Stephan Szabo <stephan.szabo@sony.com>
755 [Curl] Use ResourceRequest::encodeWithPlatformData()
756 https://bugs.webkit.org/show_bug.cgi?id=181768
758 Reviewed by Alex Christensen.
760 No new tests, assertion hit in downstream port, should be covered by
763 * platform/network/curl/ResourceRequest.h:
764 (WebCore::ResourceRequest::encodeWithPlatformData const):
765 (WebCore::ResourceRequest::decodeWithPlatformData):
767 2018-01-17 Eric Carlson <eric.carlson@apple.com>
769 Use existing RGB colorspace instead of creating a new one
770 https://bugs.webkit.org/show_bug.cgi?id=181765
771 <rdar://problem/36595753>
773 Reviewed by Dean Jackson.
775 * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
776 (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Use sRGBColorSpaceRef instead
777 of creating a new static colorspace.
779 2018-01-17 Matt Lewis <jlewis3@apple.com>
781 Unreviewed, rolling out r227076.
783 This breaks internal builds
787 "Resource Load Statistics: Block cookies for prevalent
788 resources without user interaction"
789 https://bugs.webkit.org/show_bug.cgi?id=177394
790 https://trac.webkit.org/changeset/227076
792 2018-01-17 Ryosuke Niwa <rniwa@webkit.org>
794 input and textarea elements should reveal selection in setSelection when focused
795 https://bugs.webkit.org/show_bug.cgi?id=181715
796 <rdar://problem/36570546>
798 Reviewed by Zalan Bujtas.
800 Made input and textarea elements reveal selection in FrameSelection::setSelection instead of by directly
801 invoking FrameSelection::revealSelection in their respective updateFocusAppearance to unify code paths.
803 Also added options to reveal selection up to the main frame to SetSelectionOption to be used in iOS.
805 * editing/FrameSelection.cpp:
806 (WebCore::FrameSelection::FrameSelection):
807 (WebCore::FrameSelection::moveWithoutValidationTo): Takes SelectionRevealMode as an argument and converts
808 sets appropriate selection options.
809 (WebCore::FrameSelection::setSelection): Reconstruct SelectionRevealMode out of selection option sets.
810 (WebCore::FrameSelection::updateAndRevealSelection):
811 * editing/FrameSelection.h:
812 (WebCore::FrameSelection): Added RevealSelectionUpToMainFrame as a SelectionRevealMode and replaced
813 m_shouldRevealSelection by m_selectionRevealMode.
814 * html/HTMLInputElement.cpp:
815 (WebCore::HTMLInputElement::updateFocusAppearance): Pass SelectionRevealMode to HTMLTextFormControlElement's
816 select and restoreCachedSelection instead of directly invoking FrameSelection::revealSelection.
817 * html/HTMLTextAreaElement.cpp:
818 (WebCore::HTMLTextAreaElement::updateFocusAppearance): Ditto.
819 * html/HTMLTextFormControlElement.cpp:
820 (WebCore::HTMLTextFormControlElement::select):
821 (WebCore::HTMLTextFormControlElement::setSelectionRange):
822 (WebCore::HTMLTextFormControlElement::restoreCachedSelection):
823 * html/HTMLTextFormControlElement.h:
825 2018-01-17 Michael Catanzaro <mcatanzaro@igalia.com>
827 WEBKIT_FRAMEWORK should not modify file-global include directories
828 https://bugs.webkit.org/show_bug.cgi?id=181656
830 Reviewed by Konstantin Tokarev.
835 2018-01-17 Michael Catanzaro <mcatanzaro@igalia.com>
837 [GTK] Try even harder not to static link WTF into libwebkit2gtk
838 https://bugs.webkit.org/show_bug.cgi?id=181751
840 Reviewed by Alex Christensen.
842 We don't want two copies of WTF. It should only be in libjavascriptcoregtk.
846 2018-01-17 Zalan Bujtas <zalan@apple.com>
848 Multicol: RenderMultiColumnFlow should not inherit the flow state
849 https://bugs.webkit.org/show_bug.cgi?id=181762
850 <rdar://problem/35448565>
852 Reviewed by Simon Fraser.
854 Do not compute the inherited flow state flag for RenderMultiColumnFlow.
855 It is (by definition) always inside a fragmented flow.
857 Test: fast/multicol/crash-when-out-of-flow-positioned-becomes-in-flow.html
859 * rendering/RenderObject.cpp:
860 (WebCore::RenderObject::computedFragmentedFlowState):
862 2018-01-17 Alex Christensen <achristensen@webkit.org>
864 Deprecate Application Cache
865 https://bugs.webkit.org/show_bug.cgi?id=181764
867 Reviewed by Geoffrey Garen.
871 2018-01-17 Wenson Hsieh <wenson_hsieh@apple.com>
873 [iOS simulator] API test WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage is failing
874 https://bugs.webkit.org/show_bug.cgi?id=181758
876 Reviewed by Tim Horton.
878 This test is failing because Editor::clientReplacementURLForResource expects a MIME type, but on iOS, the type
879 paramter passed into WebContentReader::readImage is a UTI; subsequently, the bundle editing delegate receives
880 a MIME type that's actually a UTI, which is incorrect. To address this, ensure that a MIME type is passed to
881 bundle SPI by converting the type in WebContentReader::readImage to a MIME type.
883 * editing/cocoa/WebContentReaderCocoa.mm:
884 (WebCore::WebContentReader::readImage):
886 2018-01-17 Antti Koivisto <antti@apple.com>
888 REGRESSION (r226385?): Crash in com.apple.WebCore: WebCore::MediaQueryEvaluator::evaluate const + 32
889 https://bugs.webkit.org/show_bug.cgi?id=181742
890 <rdar://problem/36334726>
892 Reviewed by David Kilzer.
894 Test: fast/media/mediaqueryevaluator-crash.html
896 * css/MediaQueryEvaluator.cpp:
897 (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
899 Use WeakPtr<Document> instead of a plain Frame pointer.
901 (WebCore::MediaQueryEvaluator::evaluate const):
903 Get the frame via document.
905 * css/MediaQueryEvaluator.h:
907 (WebCore::Document::prepareForDestruction):
909 Take care to clear style resolver.
911 2018-01-17 Youenn Fablet <youenn@apple.com>
913 Put fetch request keepAlive behind a runtime flag
914 https://bugs.webkit.org/show_bug.cgi?id=181592
916 Reviewed by Chris Dumez.
918 No change of behavior.
920 * Modules/fetch/FetchRequest.idl:
921 * page/RuntimeEnabledFeatures.h:
922 (WebCore::RuntimeEnabledFeatures::fetchAPIKeepAliveEnabled const):
923 (WebCore::RuntimeEnabledFeatures::setFetchAPIKeepAliveEnabled):
925 2018-01-17 Per Arne Vollan <pvollan@apple.com>
927 [Win] Use switch when converting from ResourceRequestCachePolicy to platform cache policy.
928 https://bugs.webkit.org/show_bug.cgi?id=181686
930 Reviewed by Alex Christensen.
932 No new tests, covered by existing tests.
934 A switch will make the function easier on the eyes. Also, use the function in places where the ResourceRequestCachePolicy
935 is just casted to a platform cache policy.
937 * platform/network/cf/ResourceRequestCFNet.cpp:
938 (WebCore::toPlatformRequestCachePolicy):
940 2018-01-17 John Wilander <wilander@apple.com>
942 Resource Load Statistics: Block cookies for prevalent resources without user interaction
943 https://bugs.webkit.org/show_bug.cgi?id=177394
944 <rdar://problem/34613960>
946 Reviewed by Alex Christensen.
948 Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
949 http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
950 http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
951 http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html
953 * platform/network/NetworkStorageSession.h:
954 Now exports NetworkStorageSession::nsCookieStorage().
955 * platform/network/cf/NetworkStorageSessionCFNet.cpp:
956 (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
959 2018-01-17 Daniel Bates <dabates@apple.com>
961 REGRESSION (r222795): Cardiogram never signs in
962 https://bugs.webkit.org/show_bug.cgi?id=181693
963 <rdar://problem/36286293>
965 Reviewed by Ryosuke Niwa.
967 Exempt Cardiogram from the XHR header restrictions in r222795.
969 Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
970 However Cardiogram also depends on such functionality.
972 Test: fast/xmlhttprequest/set-dangerous-headers-from-file-when-setting-enabled.html
974 * page/Settings.yaml:
975 * platform/RuntimeApplicationChecks.h:
976 * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
977 (WebCore::IOSApplication::isCardiogram):
978 * xml/XMLHttpRequest.cpp:
979 (WebCore::XMLHttpRequest::setRequestHeader):
981 2018-01-17 Daniel Bates <dabates@apple.com>
983 ASSERTION FAILED: !m_completionHandler in PingHandle::~PingHandle()
984 https://bugs.webkit.org/show_bug.cgi?id=181746
985 <rdar://problem/36586248>
987 Reviewed by Chris Dumez.
989 Call PingHandle::pingLoadComplete() with an error when NSURLConnection queries
990 whether the ping is able to respond to an authentication request. (Pings do not
991 respond to authenticate requests.) It will call the completion handler, nullify
992 the completion handler, and deallocate the PingHandle. Nullifying the completion
993 handler is necessary to avoid the assertion failure in ~PingHandle().
995 Test: http/tests/misc/before-unload-load-image.html
997 * platform/network/PingHandle.h:
999 2018-01-17 Daniel Bates <dabates@apple.com>
1001 WebCoreResourceHandleAsOperationQueueDelegate/ResourceHandleCFURLConnectionDelegateWithOperationQueue may
1002 be deleted in main thread callback
1003 https://bugs.webkit.org/show_bug.cgi?id=181747
1004 <rdar://problem/36588120>
1006 Reviewed by Alex Christensen.
1008 Retain the delegate (e.g. WebCoreResourceHandleAsOperationQueueDelegate) before scheduling
1009 a main thread callback and blocking on a semaphore for its reply because the main thread
1010 callback can do anything, including deleting the delegate, before the non-main thread
1011 has a chance to execute. For instance, a PingHandle will delete itself (and hence delete
1012 its resource handle delegate) in most of the code paths invoked by the delegate.
1014 * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1015 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
1016 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1017 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1018 (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1019 * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1020 (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
1021 (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
1022 (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
1023 (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
1025 2018-01-17 Chris Dumez <cdumez@apple.com>
1027 'fetch' event may be sent to a service worker before its state is set to 'activated'
1028 https://bugs.webkit.org/show_bug.cgi?id=181698
1029 <rdar://problem/36554856>
1031 Reviewed by Youenn Fablet.
1033 'fetch' event may be sent to a service worker before its state is set to 'activated'.
1034 When the registration's active worker needs to intercept a load, and its state is 'activating',
1035 we queue the request to send the fetch event in SWServerWorker::m_whenActivatedHandlers.
1036 Once the SWServerWorker::setState() is called with 'activated' state, we then call the
1037 handlers in m_whenActivatedHandlers to make send the fetch event now that the worker is
1038 activated. The issue is that even though the worker is activated and its state was set to
1039 'activated' on Storage process side, we had not yet notified the ServiceWorker process
1040 of the service worker's new state yet.
1042 To address the issue, we now make sure that SWServerWorker::m_whenActivatedHandlers are
1043 called *after* we've sent the IPC to the ServiceWorker process to update the worker's
1044 state to 'activated'. Also, we now call ServiceWorkerFetch::dispatchFetchEvent()
1045 asynchronously in a postTask() as the service worker's state is also updated asynchronously
1046 in a postTask. This is as per specification [1], which says to "queue a task" to fire
1049 [1] https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)
1051 No new tests, covered by imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html
1052 which hits the new assertion without the fix.
1054 * workers/service/context/ServiceWorkerFetch.cpp:
1055 (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
1056 Add assertions to make sure that we dispatch the fetch event on the right worker and
1057 that the worker is in 'activated' state.
1059 * workers/service/context/ServiceWorkerThread.cpp:
1060 (WebCore::ServiceWorkerThread::postFetchTask):
1061 Queue a task to fire the fetch event as per:
1062 - https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)
1063 We need to match the specification exactly here or things will happen in the wrong
1064 order. In particular, things like "update registration state" and "update worker state"
1065 might happen *after* firing the fetch event, even though the IPC for "update registration/worker
1066 state" was sent before the "fire fetch event" one, because the code for updating a registration/
1067 worker state already queues a task, as per the specification.
1069 * workers/service/server/SWServerRegistration.cpp:
1070 (WebCore::SWServerRegistration::updateWorkerState):
1071 * workers/service/server/SWServerRegistration.h:
1072 * workers/service/server/SWServerWorker.cpp:
1073 (WebCore::SWServerWorker::setState):
1074 Move code to send the IPC to the Service Worker process whenever the service worker's state
1075 needs to be updated from SWServerRegistration::updateWorkerState() to SWServerWorker::setState().
1076 This way, we can make sure the IPC is sent *before* we call the m_whenActivatedHandlers handlers,
1077 as they may also send IPC to the Service Worker process, and we need to make sure this IPC happens
1078 after so that the service worker is in the right state.
1080 2018-01-17 Stephan Szabo <stephan.szabo@sony.com>
1082 Page.cpp only sees forward declaration of ApplicationStateChangeListener when ENABLE(VIDEO) is off
1083 https://bugs.webkit.org/show_bug.cgi?id=181713
1085 Reviewed by Darin Adler.
1087 No new tests (build fix).
1089 * page/Page.cpp: Add include for ApplicationStateChangeListener
1091 2018-01-17 Wenson Hsieh <wenson_hsieh@apple.com>
1093 Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
1094 https://bugs.webkit.org/show_bug.cgi?id=181637
1095 <rdar://problem/36508471>
1097 Reviewed by Tim Horton.
1099 Before carrying out blob URL conversion for pasted or dropped rich content, let the editor client replace
1100 subresource URLs in WebKit2 by calling out to new injected bundle SPI. See comments below for more detail.
1102 Tests: WKAttachmentTests.InjectedBundleReplaceURLsWhenPastingAttributedString
1103 WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage
1105 * editing/Editor.cpp:
1106 (WebCore::Editor::clientReplacementURLForResource):
1109 Add a new helper to call out to the editor client for a URL string to replace a given ArchiveResource. In
1110 WebKit2, this calls out to the injected bundle's new `replacementURLForResource` SPI hook.
1112 * editing/cocoa/WebContentReaderCocoa.mm:
1113 (WebCore::shouldReplaceSubresourceURL):
1114 (WebCore::replaceRichContentWithAttachments):
1115 (WebCore::replaceSubresourceURLsWithURLsFromClient):
1117 Add a new static helper to replace subresource URLs in the given DocumentFragment with URLs supplied by the
1118 editor client. Additionally builds a list of ArchiveResources that have not been replaced, for use at call sites
1119 so that we don't unnecessarily create more Blobs for ArchiveResources that have already been replaced.
1121 (WebCore::createFragmentAndAddResources):
1122 (WebCore::sanitizeMarkupWithArchive):
1124 Tweak web content reading codepaths to first replace subresource URLs with editor-client-supplied URLs.
1126 (WebCore::WebContentReader::readImage):
1127 (WebCore::shouldConvertToBlob): Deleted.
1129 Rename this helper to shouldReplaceSubresourceURL, blob URL replacement is no longer the only scenario in which
1130 we replace resource URLs, but in both cases, we still want to ignore `http:`-family and `data:` URLs.
1132 * loader/EmptyClients.cpp:
1133 * page/EditorClient.h:
1135 2018-01-17 Yacine Bandou <yacine.bandou_ext@softathome.com>
1136 [EME][GStreamer] Add the full-sample encryption support in the GStreamer ClearKey decryptor
1137 https://bugs.webkit.org/show_bug.cgi?id=180080
1139 Reviewed by Xabier Rodriguez-Calvar.
1141 Currently the GStreamer clearKey decryptor doesn't support the full-sample encryption,
1142 where the buffer is entirely encrypted, it supports only the sub-sample encryption.
1144 Test: media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
1146 * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
1147 (webKitMediaClearKeyDecryptorDecrypt):
1149 2018-01-17 Zan Dobersek <zdobersek@igalia.com>
1151 Unreviewed follow-up to r227051.
1153 * platform/graphics/cairo/CairoOperations.h: Fix declaration of the
1154 fillRoundedRect() function by removing the bool parameter that's not
1155 used at all in the definition. This went unspotted due to the unified
1156 source build including the implementation file before fillRoundedRect()
1157 usage in GrapihcsContextCairo.cpp, leaving the declaration undefined
1158 and instead using the definition directly.
1160 2018-01-17 Zan Dobersek <zdobersek@igalia.com>
1162 [Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
1163 https://bugs.webkit.org/show_bug.cgi?id=181725
1165 Reviewed by Carlos Garcia Campos.
1167 Don't duplicate global alpha and image interpolation quality state
1168 values on the PlatformContextCairo. Instead, retrieve them from
1169 the managing GraphicsContextState when necessary.
1171 For Cairo operations, the FillSource and StrokeSource containers now
1172 store the global alpha value, using it during the operation executions.
1173 For drawNativeImage(), the global alpha and interpolation quality values
1174 are passed through arguments.
1176 In PlatformContextCairo, the two values are no longer stored on the
1177 internally-managed stack, and the getter-setter pairs for the two values
1178 are removed. In drawSurfaceToContext(), the two values are now expected
1179 to be passed through the method arguments.
1181 No new tests -- no change in behavior.
1183 * platform/graphics/cairo/CairoOperations.cpp:
1184 (WebCore::Cairo::prepareForFilling):
1185 (WebCore::Cairo::prepareForStroking):
1186 (WebCore::Cairo::drawPathShadow):
1187 (WebCore::Cairo::fillCurrentCairoPath):
1188 (WebCore::Cairo::FillSource::FillSource):
1189 (WebCore::Cairo::StrokeSource::StrokeSource):
1190 (WebCore::Cairo::strokeRect):
1191 (WebCore::Cairo::strokePath):
1192 (WebCore::Cairo::drawGlyphs):
1193 (WebCore::Cairo::drawNativeImage):
1194 (WebCore::Cairo::State::setGlobalAlpha): Deleted.
1195 (WebCore::Cairo::State::setImageInterpolationQuality): Deleted.
1196 * platform/graphics/cairo/CairoOperations.h:
1197 * platform/graphics/cairo/GraphicsContextCairo.cpp:
1198 (WebCore::GraphicsContext::drawNativeImage):
1199 (WebCore::GraphicsContext::setPlatformAlpha):
1200 (WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
1201 * platform/graphics/cairo/PlatformContextCairo.cpp:
1202 (WebCore::PlatformContextCairo::save):
1203 (WebCore::PlatformContextCairo::drawSurfaceToContext):
1204 (WebCore::PlatformContextCairo::State::State): Deleted.
1205 (WebCore::PlatformContextCairo::setImageInterpolationQuality): Deleted.
1206 (WebCore::PlatformContextCairo::imageInterpolationQuality const): Deleted.
1207 (WebCore::PlatformContextCairo::globalAlpha const): Deleted.
1208 (WebCore::PlatformContextCairo::setGlobalAlpha): Deleted.
1209 * platform/graphics/cairo/PlatformContextCairo.h:
1210 * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1211 (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
1213 2018-01-17 Philippe Normand <pnormand@igalia.com>
1215 REGRESSION(r226973/r226974): Four multimedia tests failing
1216 https://bugs.webkit.org/show_bug.cgi?id=181696
1218 Reviewed by Carlos Garcia Campos.
1220 This patch reverts some of the changes of the above revisions so as to fix layout test failures.
1222 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1223 (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Properly
1224 prepare stalled event when an error was detected.
1225 (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): Revert to previous version.
1226 (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Ditto.
1227 (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
1228 Emit progress event also when streaming but not when an error was
1230 (WebCore::MediaPlayerPrivateGStreamer::totalBytes const): use isLiveStream like everywhere else.
1231 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1232 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1233 (webkit_web_src_init): Revert to keep-alive FALSE by default.
1235 2018-01-17 Zan Dobersek <zdobersek@igalia.com>
1237 [Cairo] Move prepareForFilling(), prepareForStroking() code to CairoOperations
1238 https://bugs.webkit.org/show_bug.cgi?id=181721
1240 Reviewed by Carlos Garcia Campos.
1242 Move the prepareForFilling() and prepareForStroking() code off of the
1243 PlatformContextCairo class and into static functions inside the
1244 CairoOperations implementation files. The original methods weren't
1245 called from any place other than the Cairo operations, and they only
1246 operated with the cairo_t object that's stored in and retrievable from
1247 the PlatformContextCairo object.
1249 No new tests -- no change in behavior.
1251 * platform/graphics/cairo/CairoOperations.cpp:
1252 (WebCore::Cairo::reduceSourceByAlpha):
1253 (WebCore::Cairo::prepareCairoContextSource):
1254 (WebCore::Cairo::clipForPatternFilling):
1255 (WebCore::Cairo::prepareForFilling):
1256 (WebCore::Cairo::prepareForStroking):
1257 (WebCore::Cairo::drawPathShadow):
1258 (WebCore::Cairo::fillCurrentCairoPath):
1259 (WebCore::Cairo::strokeRect):
1260 (WebCore::Cairo::strokePath):
1261 (WebCore::Cairo::drawGlyphs):
1262 * platform/graphics/cairo/PlatformContextCairo.cpp:
1263 (WebCore::reduceSourceByAlpha): Deleted.
1264 (WebCore::prepareCairoContextSource): Deleted.
1265 (WebCore::PlatformContextCairo::prepareForFilling): Deleted.
1266 (WebCore::PlatformContextCairo::prepareForStroking): Deleted.
1267 (WebCore::PlatformContextCairo::clipForPatternFilling): Deleted.
1268 * platform/graphics/cairo/PlatformContextCairo.h:
1270 2018-01-17 Zan Dobersek <zdobersek@igalia.com>
1272 [Cairo] Use one-time ShadowBlur objects when performing shadowing
1273 https://bugs.webkit.org/show_bug.cgi?id=181720
1275 Reviewed by Carlos Garcia Campos.
1277 Don't maintain a ShadowBlur object in the PlatformContextCairo class.
1278 Instead, use temporary ShadowBlur objects whenever shadowing is needed,
1279 providing all the shadow state information to it and drawing shadow into
1280 the given GraphicsContext object.
1282 ShadowBlur constructors are cleaned up. The 'shadows ignored' argument
1283 can now also be provided to the variant that accepts explicit shadow
1284 attributes, but the argument is false by default.
1286 In CairoOperations, the ShadowBlurUsage functionality is rolled into the
1287 new ShadowState class. ShadowState parameter is now used for operations
1288 that might need to perform shadow painting. Call sites are modified
1291 Cairo::State::setShadowValues() and Cairo::State::clearShadow() are
1292 removed, since the ShadowBlur object that was modified through those is
1293 being removed from the PlatformContextCairo class. We still have to flip
1294 the Y-axis of the shadow offset in GraphicsContext::setPlatformShadow()
1295 when shadows are ignoring transformations.
1297 No new tests -- no change in behavior.
1299 * platform/graphics/ShadowBlur.cpp:
1300 (WebCore::ShadowBlur::ShadowBlur):
1301 * platform/graphics/ShadowBlur.h:
1302 * platform/graphics/cairo/CairoOperations.cpp:
1303 (WebCore::Cairo::drawPathShadow):
1304 (WebCore::Cairo::drawGlyphsShadow):
1305 (WebCore::Cairo::ShadowState::ShadowState):
1306 (WebCore::Cairo::ShadowState::isVisible const):
1307 (WebCore::Cairo::ShadowState::isRequired const):
1308 (WebCore::Cairo::fillRect):
1309 (WebCore::Cairo::fillRoundedRect):
1310 (WebCore::Cairo::fillRectWithRoundedHole):
1311 (WebCore::Cairo::fillPath):
1312 (WebCore::Cairo::strokeRect):
1313 (WebCore::Cairo::strokePath):
1314 (WebCore::Cairo::drawGlyphs):
1315 (WebCore::Cairo::drawNativeImage):
1316 (WebCore::Cairo::State::setShadowValues): Deleted.
1317 (WebCore::Cairo::State::clearShadow): Deleted.
1318 (WebCore::Cairo::ShadowBlurUsage::ShadowBlurUsage): Deleted.
1319 (WebCore::Cairo::ShadowBlurUsage::required const): Deleted.
1320 * platform/graphics/cairo/CairoOperations.h:
1321 * platform/graphics/cairo/FontCairo.cpp:
1322 (WebCore::FontCascade::drawGlyphs):
1323 * platform/graphics/cairo/GraphicsContextCairo.cpp:
1324 (WebCore::GraphicsContext::restorePlatformState):
1325 (WebCore::GraphicsContext::drawNativeImage):
1326 (WebCore::GraphicsContext::fillPath):
1327 (WebCore::GraphicsContext::strokePath):
1328 (WebCore::GraphicsContext::fillRect):
1329 (WebCore::GraphicsContext::setPlatformShadow):
1330 (WebCore::GraphicsContext::clearPlatformShadow):
1331 (WebCore::GraphicsContext::strokeRect):
1332 (WebCore::GraphicsContext::platformFillRoundedRect):
1333 (WebCore::GraphicsContext::fillRectWithRoundedHole):
1334 * platform/graphics/cairo/PlatformContextCairo.cpp:
1335 (WebCore::PlatformContextCairo::drawSurfaceToContext):
1336 * platform/graphics/cairo/PlatformContextCairo.h:
1337 (WebCore::PlatformContextCairo::shadowBlur): Deleted.
1338 * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1339 (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
1341 2018-01-17 Zan Dobersek <zdobersek@igalia.com>
1343 CanvasImageData: createImageData() parameter should not be nullable
1344 https://bugs.webkit.org/show_bug.cgi?id=181670
1346 Reviewed by Sam Weinig.
1348 createImageData() method on the CanvasImageData interface should not
1349 treat the ImageData parameter as nullable, but should instead reject any
1350 null values with a TypeError, as demanded by the specification.
1352 No new tests -- current tests covering createImageData(null) are updated
1353 to properly cover new behavior of throwing a TypeError exception.
1355 * html/canvas/CanvasImageData.idl:
1356 * html/canvas/CanvasRenderingContext2DBase.cpp:
1357 (WebCore::CanvasRenderingContext2DBase::createImageData const):
1358 * html/canvas/CanvasRenderingContext2DBase.h:
1360 2018-01-16 Fujii Hironori <Hironori.Fujii@sony.com>
1362 [CMake] Remove WebCoreDerivedSources library target
1363 https://bugs.webkit.org/show_bug.cgi?id=181664
1365 Reviewed by Carlos Garcia Campos.
1367 After unified source build has been introduced, CMake Visual
1368 Studio build suffers complicated unnecessary recompilation issues
1369 because Visual Studio invokes scripts twice in both WebCore and
1370 WebCoreDerivedSources projects (Bug 181117).
1372 WebCoreDerivedSources library has been introduced in r198766 to
1373 avoid command line length limit of CMake Ninja build on macOS.
1374 Fortunately, unified source build has reduced the number of source
1375 files to compile, WebCore doesn't need to be split anymore.
1377 No new tests (No behavior change)
1379 * CMakeLists.txt: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES. Removed WebCoreDerivedSources library target.
1380 Do not compile each JavaScript Builtins.cpp files because the unified source WebCoreJSBuiltins.cpp is already included.
1381 * PlatformGTK.cmake: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES.
1382 * PlatformWin.cmake: Ditto.
1384 2018-01-16 Simon Fraser <simon.fraser@apple.com>
1386 Can't scroll iframe after toggling it to display:none and back
1387 https://bugs.webkit.org/show_bug.cgi?id=181708
1388 rdar://problem/13234778
1390 Reviewed by Tim Horton.
1392 Nothing updated the FrameView's set of scrollable areas when a subframe came back from display:none.
1393 Mirror the existing virtual removeChild() by making addChild() virtual, and using it to mark
1394 the FrameView's scrollable area set as dirty.
1396 Test: tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe.html
1398 * page/FrameView.cpp:
1399 (WebCore::FrameView::addChild):
1401 * platform/ScrollView.h:
1403 2018-01-16 Chris Dumez <cdumez@apple.com>
1405 SWServerWorker::m_contextConnectionIdentifier may get out of date
1406 https://bugs.webkit.org/show_bug.cgi?id=181687
1407 <rdar://problem/36548111>
1409 Reviewed by Brady Eidson.
1411 SWServerWorker::m_contextConnectionIdentifier may get out of date. This happens when the
1412 context process crashes and is relaunched.
1414 No new tests, added assertion in terminateWorkerInternal() that hits without this fix.
1416 * workers/service/server/SWServer.cpp:
1417 (WebCore::SWServer::runServiceWorker):
1418 (WebCore::SWServer::terminateWorkerInternal):
1419 (WebCore::SWServer::unregisterServiceWorkerClient):
1420 * workers/service/server/SWServerWorker.h:
1421 (WebCore::SWServerWorker::setContextConnectionIdentifier):
1423 2018-01-16 Jer Noble <jer.noble@apple.com>
1425 Reset MediaSourcePrivateAVFObjC's m_sourceBufferWithSelectedVideo when the underlying SourceBufferPrivate is removed.
1426 https://bugs.webkit.org/show_bug.cgi?id=181707
1427 <rdar://problem/34809474>
1429 Reviewed by Eric Carlson.
1431 Test: media/media-source/media-source-remove-unload-crash.html
1433 * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1434 (WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
1436 2018-01-12 Jiewen Tan <jiewen_tan@apple.com>
1438 [WebAuthN] Implement dummy WebAuthN IDLs
1439 https://bugs.webkit.org/show_bug.cgi?id=181627
1440 <rdar://problem/36459864>
1442 Reviewed by Alex Christensen.
1444 This patch implements dummy WebAuthN IDLs and connect them with Credential Management as well.
1445 All implementations in this patch are subject to change when real implementations land. The
1446 purpose here on the other hand is to have IDLs, bindings and implementations connected. This
1447 patch should handle all IDLs that we need.
1452 * DerivedSources.make:
1453 * Modules/credentialmanagement/CredentialCreationOptions.h:
1454 * Modules/credentialmanagement/CredentialCreationOptions.idl:
1455 * Modules/credentialmanagement/CredentialRequestOptions.h:
1456 * Modules/credentialmanagement/CredentialRequestOptions.idl:
1457 * Modules/webauthn/AuthenticatorAssertionResponse.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
1458 (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
1459 (WebCore::AuthenticatorAssertionResponse::~AuthenticatorAssertionResponse):
1460 (WebCore::AuthenticatorAssertionResponse::authenticatorData):
1461 (WebCore::AuthenticatorAssertionResponse::signature):
1462 (WebCore::AuthenticatorAssertionResponse::userHandle):
1463 * Modules/webauthn/AuthenticatorAssertionResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
1464 * Modules/webauthn/AuthenticatorAssertionResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
1465 * Modules/webauthn/AuthenticatorAttestationResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
1466 (WebCore::AuthenticatorAttestationResponse::AuthenticatorAttestationResponse):
1467 (WebCore::AuthenticatorAttestationResponse::~AuthenticatorAttestationResponse):
1468 (WebCore::AuthenticatorAttestationResponse::attestationObject):
1469 * Modules/webauthn/AuthenticatorAttestationResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
1470 * Modules/webauthn/AuthenticatorAttestationResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
1471 * Modules/webauthn/AuthenticatorResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
1472 (WebCore::AuthenticatorResponse::AuthenticatorResponse):
1473 (WebCore::AuthenticatorResponse::~AuthenticatorResponse):
1474 (WebCore::AuthenticatorResponse::clientDataJSON):
1475 * Modules/webauthn/AuthenticatorResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
1476 * Modules/webauthn/AuthenticatorResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
1477 * Modules/webauthn/PublicKeyCredential.cpp:
1478 (WebCore::PublicKeyCredential::rawId):
1479 (WebCore::PublicKeyCredential::response):
1480 (WebCore::PublicKeyCredential::getClientExtensionResults):
1481 (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
1482 * Modules/webauthn/PublicKeyCredential.h:
1483 * Modules/webauthn/PublicKeyCredential.idl:
1484 * Modules/webauthn/PublicKeyCredentialCreationOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
1485 * Modules/webauthn/PublicKeyCredentialCreationOptions.idl: Added.
1486 * Modules/webauthn/PublicKeyCredentialDescriptor.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
1487 * Modules/webauthn/PublicKeyCredentialDescriptor.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
1488 * Modules/webauthn/PublicKeyCredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
1489 * Modules/webauthn/PublicKeyCredentialRequestOptions.idl: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
1490 * Modules/webauthn/PublicKeyCredentialType.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
1491 * Modules/webauthn/PublicKeyCredentialType.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
1493 * WebCore.xcodeproj/project.pbxproj:
1494 * bindings/js/WebCoreBuiltinNames.h:
1496 2018-01-16 Zalan Bujtas <zalan@apple.com>
1498 AX: Do not trigger layout in updateBackingStore() unless it is safe to do so
1499 https://bugs.webkit.org/show_bug.cgi?id=181703
1500 <rdar://problem/36365706>
1502 Reviewed by Ryosuke Niwa.
1504 Document::isSafeToUpdateStyleOrLayout() can tell whether it is safe to run layout.
1506 Unable to create test with WebInspector involved.
1508 * accessibility/AccessibilityObject.cpp:
1509 (WebCore::AccessibilityObject::updateBackingStore):
1511 (WebCore::Document::isSafeToUpdateStyleOrLayout const):
1512 (WebCore::Document::updateStyleIfNeeded):
1513 (WebCore::Document::updateLayout):
1514 (WebCore::isSafeToUpdateStyleOrLayout): Deleted.
1517 2018-01-16 Ryan Haddad <ryanhaddad@apple.com>
1519 Unreviewed, rolling out r226962.
1521 The LayoutTest added with this change is a flaky timeout.
1525 "Support for preconnect Link headers"
1526 https://bugs.webkit.org/show_bug.cgi?id=181657
1527 https://trac.webkit.org/changeset/226962
1529 2018-01-16 Simon Fraser <simon.fraser@apple.com>
1531 Text looks bad on some CSS spec pages
1532 https://bugs.webkit.org/show_bug.cgi?id=181700
1533 rdar://problem/36552107
1535 Reviewed by Tim Horton.
1537 When making new tiles in a TileController, we failed to set their "supports antialiased layer text"
1538 setting, so tile caches could end up with a mixture of layers that do and do not support
1539 antialiased layer text.
1541 No tests because the tiled drawing tests don't dump out tiles inside of tile caches.
1543 * platform/graphics/ca/TileController.cpp:
1544 (WebCore::TileController::createTileLayer):
1546 2018-01-16 Said Abou-Hallawa <sabouhallawa@apple.com>
1548 REGRESSION(r221292): svg/animations/animateTransform-pattern-transform.html crashes with security assertion
1549 https://bugs.webkit.org/show_bug.cgi?id=179986
1551 Reviewed by Simon Fraser.
1553 This patch reverts all or parts of the following changes-sets
1554 <http://trac.webkit.org/changeset/221292>
1555 <http://trac.webkit.org/changeset/197967>
1556 <http://trac.webkit.org/changeset/196670>
1558 A JS statement like this:
1559 var item = text.x.animVal.getItem(0);
1561 Creates the following C++ objects:
1562 SVGAnimatedListPropertyTearOff<SVGLengthListValues> for 'text.x'
1563 SVGListPropertyTearOff<SVGLengthListValues> for 'text.x.animVal'
1564 SVGPropertyTearOff<SVGLengthValue> for 'text.x.animVal.getItem(0)'
1566 If 'item' changes, the attribute 'x' of the element '<text>' will change
1567 as well. But this binding works only in one direction. If the attribute
1568 'x' of the element '<text>' changes, e.g.:
1570 text.setAttribute('x', '10,20,30');
1572 This will detach 'item' from the element <text> and any further changes
1573 in 'item' won't affect the attribute 'x' of element <text>.
1575 The one direction binding can only work if this chain of tear-off objects
1576 is kept connected. This is implemented by RefCounted back pointers from
1577 SVGPropertyTearOff and SVGListPropertyTearOff to SVGAnimatedListPropertyTearOff.
1579 The security crashes and the memory leaks are happening because of the
1580 raw forward pointers:
1581 -- SVGAnimatedListPropertyTearOff maintains raw pointers of type
1582 SVGListPropertyTearOff for m_baseVal and m_animVal
1583 -- The m_wrappers and m_animatedWrappers of SVGAnimatedListPropertyTearOff
1584 are vectors of raw pointer Vector<SVGLength*>
1586 To control the life cycle of the raw pointers, SVGListPropertyTearOff and
1587 SVGPropertyTearOff call SVGAnimatedListPropertyTearOff::propertyWillBeDeleted()
1588 to notify it they are going to be deleted. In propertyWillBeDeleted(), we
1589 clear the pointers so they are not used after being freed. This mechanism
1590 has been error-prone and we've never got it 100% right.
1592 The solution we need to adopt with SVG tear-off objects is the following:
1593 -- All the forward pointers should be weak pointers.
1594 -- All the back pointers should be ref pointers.
1596 This solution may not look intuitive but it solves the bugs and keeps the
1597 one direction binding. The forward weak pointers allows the tear-off
1598 objects to go aways if no reference from JS exists. The back ref pointers
1599 maintains the chain of objects and guarantees the correct binding.
1601 * svg/SVGPathSegList.h:
1602 * svg/SVGTransformList.h:
1603 * svg/properties/SVGAnimatedListPropertyTearOff.h:
1604 (WebCore::SVGAnimatedListPropertyTearOff::baseVal):
1605 (WebCore::SVGAnimatedListPropertyTearOff::animVal):
1606 * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
1607 * svg/properties/SVGAnimatedProperty.h:
1608 (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const):
1609 (WebCore::SVGAnimatedProperty::propertyWillBeDeleted): Deleted.
1610 * svg/properties/SVGAnimatedPropertyTearOff.h:
1611 * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
1612 * svg/properties/SVGListProperty.h:
1613 (WebCore::SVGListProperty::initializeValuesAndWrappers):
1614 (WebCore::SVGListProperty::getItemValuesAndWrappers):
1615 (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
1616 (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
1617 (WebCore::SVGListProperty::removeItemValuesAndWrappers):
1618 (WebCore::SVGListProperty::appendItemValuesAndWrappers):
1619 (WebCore::SVGListProperty::createWeakPtr const):
1620 * svg/properties/SVGListPropertyTearOff.h:
1621 (WebCore::SVGListPropertyTearOff::removeItemFromList):
1622 (WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff): Deleted.
1623 * svg/properties/SVGPropertyTearOff.h:
1624 (WebCore::SVGPropertyTearOff::createWeakPtr const):
1625 (WebCore::SVGPropertyTearOff::~SVGPropertyTearOff):
1627 2018-01-16 Eric Carlson <eric.carlson@apple.com>
1629 AVSampleBufferDisplayLayer should be flushed when application activates
1630 https://bugs.webkit.org/show_bug.cgi?id=181623
1631 <rdar://problem/36487738>
1633 Reviewed by Darin Adler.
1635 No new tests, I wasn't able to reproduce it in a test.
1637 * WebCore.xcodeproj/project.pbxproj:
1639 (WebCore::Document::addApplicationStateChangeListener): New.
1640 (WebCore::Document::removeApplicationStateChangeListener): Ditto.
1641 (WebCore::Document::forEachApplicationStateChangeListener): Ditto.
1644 * html/HTMLMediaElement.cpp:
1645 (WebCore::HTMLMediaElement::registerWithDocument): Register for application state changes.
1646 (WebCore::HTMLMediaElement::unregisterWithDocument): Unregister.
1647 (WebCore::HTMLMediaElement::applicationWillResignActive): Pass through to the player.
1648 (WebCore::HTMLMediaElement::applicationDidBecomeActive): Ditto.
1649 * html/HTMLMediaElement.h:
1651 * page/ApplicationStateChangeListener.h: Added.
1652 (WebCore::ApplicationStateChangeListener::applicationWillResignActive):
1653 (WebCore::ApplicationStateChangeListener::applicationDidBecomeActive):
1655 (WebCore::Page::forEachDocument):
1656 (WebCore::Page::applicationWillResignActive):
1657 (WebCore::Page::applicationDidEnterBackground):
1658 (WebCore::Page::applicationWillEnterForeground):
1659 (WebCore::Page::applicationDidBecomeActive):
1661 * platform/graphics/MediaPlayer.cpp:
1662 (WebCore::MediaPlayer::applicationWillResignActive):
1663 (WebCore::MediaPlayer::applicationDidBecomeActive):
1664 * platform/graphics/MediaPlayer.h:
1665 * platform/graphics/MediaPlayerPrivate.h:
1666 (WebCore::MediaPlayerPrivateInterface::applicationWillResignActive):
1667 (WebCore::MediaPlayerPrivateInterface::applicationDidBecomeActive):
1669 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1670 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1671 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Switch
1673 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Ditto.
1674 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueCorrectedVideoSample): Split out of enqueueVideoSample.
1675 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Move code that updates
1676 the display later to enqueueCorrectedVideoSample. Rearrange logic to the image painter sample
1677 buffer has the correct timestamp.
1678 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerErrorDidChange): Switch to release logging.
1679 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Ditto.
1680 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive): f the display
1681 layer is in the "failed" state, flush the renderer and update the display mode.
1682 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Switch to release logging.
1683 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Ditto.
1684 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad): Ditto.
1685 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareToPlay): Ditto.
1686 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Ditto.
1687 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Ditto.
1688 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Ditto.
1689 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume): Ditto.
1690 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted): Ditto.
1691 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateReadyState) Ditto.:
1692 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::logChannel const): Ditto.
1693 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes): Deleted.
1695 2018-01-16 Michael Catanzaro <mcatanzaro@igalia.com>
1697 PAL should link to JavaScriptCore rather than WTF
1698 https://bugs.webkit.org/show_bug.cgi?id=181683
1700 Reviewed by Konstantin Tokarev.
1702 Do not link directly to JavaScriptCore. Get it via PAL.
1706 2018-01-16 Zach Li <zachli@apple.com>
1708 Add pop-up policy support in website policies.
1709 https://bugs.webkit.org/show_bug.cgi?id=181544.
1710 rdar://problem/30521400.
1712 Reviewed by Alex Christensen.
1714 * loader/DocumentLoader.h:
1715 Introduce pop-up policy getter and setter. Initialize
1716 the policy as Default.
1717 (WebCore::DocumentLoader::popUpPolicy const):
1718 (WebCore::DocumentLoader::setPopUpPolicy):
1719 * page/DOMWindow.cpp:
1720 (WebCore::DOMWindow::allowPopUp):
1721 Pop-up policy specified on a per-page basis holds
1722 precedence over the global policy. If no pop-up policy
1723 is specified during navigation, global policy is used.
1725 2018-01-16 Jer Noble <jer.noble@apple.com>
1727 Crash playing audio-only HLS stream via hls.js (MSE)
1728 https://bugs.webkit.org/show_bug.cgi?id=181691
1729 <rdar://problem/32967295>
1731 Reviewed by Eric Carlson.
1733 Add a weak-link check to the block called by -[AVSampleBufferDisplayLayer requestMediaDataWhenReadyOnQueue:usingBlock:].
1735 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1736 (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1737 (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
1738 (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
1740 2018-01-16 Simon Fraser <simon.fraser@apple.com>
1742 Rename applyHorizontalScale/applyVerticalScale in SVG filters, and related cleanup
1743 https://bugs.webkit.org/show_bug.cgi?id=181684
1745 Reviewed by Alex Christensen.
1747 Rename the confusing applyHorizontalScale/applyVerticalScale to scaledByFilterResolution(),
1748 and have it take and return a FloatSize. Change callers to do math in terms of FloatSizes.
1750 Add inflate(size) to each of the rect classes.
1752 * platform/graphics/FloatRect.h:
1753 (WebCore::FloatRect::inflate):
1754 * platform/graphics/IntRect.h:
1755 (WebCore::IntRect::inflate):
1756 * platform/graphics/LayoutRect.h:
1757 (WebCore::LayoutRect::inflate):
1758 * platform/graphics/filters/FEDisplacementMap.cpp:
1759 (WebCore::FEDisplacementMap::platformApplySoftware):
1760 * platform/graphics/filters/FEDropShadow.cpp:
1761 (WebCore::FEDropShadow::determineAbsolutePaintRect):
1762 (WebCore::FEDropShadow::platformApplySoftware):
1763 * platform/graphics/filters/FEGaussianBlur.cpp:
1764 (WebCore::FEGaussianBlur::calculateUnscaledKernelSize):
1765 (WebCore::FEGaussianBlur::calculateKernelSize):
1766 (WebCore::FEGaussianBlur::determineAbsolutePaintRect):
1767 (WebCore::FEGaussianBlur::platformApplySoftware):
1768 * platform/graphics/filters/FEGaussianBlur.h:
1769 * platform/graphics/filters/FEMorphology.cpp:
1770 (WebCore::FEMorphology::determineAbsolutePaintRect):
1771 (WebCore::FEMorphology::platformApplySoftware):
1772 * platform/graphics/filters/FEOffset.cpp:
1773 (WebCore::FEOffset::determineAbsolutePaintRect):
1774 (WebCore::FEOffset::platformApplySoftware):
1775 * platform/graphics/filters/Filter.h:
1776 (WebCore::Filter::setSourceImage):
1777 (WebCore::Filter::scaledByFilterResolution const):
1778 (WebCore::Filter::applyHorizontalScale const): Deleted.
1779 (WebCore::Filter::applyVerticalScale const): Deleted.
1780 * platform/graphics/filters/FilterOperations.cpp:
1781 (WebCore::outsetSizeForBlur):
1782 * rendering/FilterEffectRenderer.h:
1783 * svg/graphics/filters/SVGFilter.cpp:
1784 (WebCore::SVGFilter::scaledByFilterResolution const):
1785 (WebCore::SVGFilter::applyHorizontalScale const): Deleted.
1786 (WebCore::SVGFilter::applyVerticalScale const): Deleted.
1787 * svg/graphics/filters/SVGFilter.h:
1789 2018-01-16 Fujii Hironori <Hironori.Fujii@sony.com>
1791 [CMake][Mac] Fix the build errors
1792 https://bugs.webkit.org/show_bug.cgi?id=181665
1794 Reviewed by Alex Christensen.
1796 No new tests (No behavior change)
1798 * CMakeLists.txt: Added Modules/paymentrequest/MerchantValidationEvent.idl to compile.
1799 * PlatformMac.cmake: Added Modules/paymentrequest/MerchantValidationEvent.cpp to compile.
1800 Added workers/service/context and Modules/applicationmanifest as forwarding header paths.
1802 2018-01-16 Wenson Hsieh <wenson_hsieh@apple.com>
1804 [Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted
1805 https://bugs.webkit.org/show_bug.cgi?id=181638
1806 <rdar://problem/36508702>
1808 Reviewed by Dan Bernstein.
1810 Adjust the `didInsertAttachment` codepath to additionally propagate the attachment element's `src`.
1811 Additionally, fix an issue with insertion and removal client notifications wherein the client can receive
1812 insertion calls without corresponding removal calls, or vice versa. This is an existing issue, but matters more
1813 now because we actually need to access the attachment element for its `src` when propagating changes to the
1814 client. See below for details.
1816 Test: WKAttachmentTests.AttachmentUpdatesWhenInsertingRichMarkup
1819 (WebCore::Document::attachmentElementsByIdentifier const):
1820 * editing/Editor.cpp:
1821 (WebCore::Editor::notifyClientOfAttachmentUpdates):
1822 * page/EditorClient.h:
1823 (WebCore::EditorClient::didInsertAttachment):
1825 (WebCore::Frame::setDocument):
1827 When a Frame's document changes, inform the client that the attachments in the previous document are going away.
1828 For each attachment currently connected to the document, we have either (1) already informed the client that it
1829 was inserted, or (2) the attachment is pending an insertion call to the client. If (1) is the case, then we'll
1830 tell the client that the attachment is removed, which will balance out the earlier insertion call. If (2) is the
1831 case, then we'll remove the previously inserted attachment identifier from the set of attachment identifiers
1832 pending insertion, and the client won't be informed of insertions or removals.
1834 2018-01-16 Antoine Quint <graouts@apple.com>
1836 Use traits for animation timing functions
1837 https://bugs.webkit.org/show_bug.cgi?id=181651
1839 Reviewed by Dean Jackson.
1841 Cleaning up Dean's previous patch as suggested by Darin's post-commit review comments. The
1842 downcast function can match const automatically and it's a better style to put the * inside
1843 the downcast call rather than outside.
1845 * css/CSSComputedStyleDeclaration.cpp:
1846 (WebCore::createTimingFunctionValue):
1847 * platform/animation/TimingFunction.cpp:
1848 (WebCore::operator<<):
1849 (WebCore::TimingFunction::transformTime const):
1850 * platform/animation/TimingFunction.h:
1851 * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
1852 (WebCore::toCAMediaTimingFunction):
1854 2018-01-16 Philippe Normand <pnormand@igalia.com>
1856 [GStreamer] Live streaming cleanups
1857 https://bugs.webkit.org/show_bug.cgi?id=181672
1859 Reviewed by Michael Catanzaro.
1861 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1862 (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Switch to
1863 streaming code path when no content-length was reported by the
1864 http source element.
1865 (WebCore::MediaPlayerPrivateGStreamer::totalBytes const): Return early when streaming.
1866 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1867 (CachedResourceStreamingClient::responseReceived): Emit headers as
1868 an element message, like souphttpsrc.
1870 2018-01-15 Philippe Normand <pnormand@igalia.com>
1872 [GStreamer] misc fixes and cleanups
1873 https://bugs.webkit.org/show_bug.cgi?id=181647
1875 Reviewed by Michael Catanzaro.
1877 * platform/graphics/MediaPlayer.cpp:
1878 (WebCore::convertEnumerationToString): New utility function to convert preload enum to string.
1879 * platform/graphics/MediaPlayerEnums.h: Ditto.
1880 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1881 (WebCore::MediaPlayerPrivateGStreamer::load): Debug tweak
1882 (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): Ditto
1883 (WebCore::MediaPlayerPrivateGStreamer::play): Ditto
1884 (WebCore::MediaPlayerPrivateGStreamer::paused const): Ditto
1885 (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): Prevent useless state update.
1886 (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Ditto.
1887 (WebCore::MediaPlayerPrivateGStreamer::updateStates): Debug tweak.
1888 (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): Ditto.
1889 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1890 Remove useless handlesSyncMessage method.
1891 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1892 (WebCore::MediaPlayerPrivateGStreamerBase::setMuted): Prevent useless state update.
1893 (WebCore::MediaPlayerPrivateGStreamerBase::muted const): Debug tweak.
1894 (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): Ditto.
1895 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1896 (webkit_web_src_init): Enable keepAlive by default like in souphttpsrc.
1897 (webKitWebSrcStart): Debug tweak.
1898 (webKitWebSrcQueryWithParent): Ditto.
1899 (webKitWebSrcNeedData): Ditto.
1900 (CachedResourceStreamingClient::responseReceived): Change appsrc
1901 stream-type when we wan't seek. Also update caps like souphttpsrc
1903 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: Add forward declaration of MediaPlayer.
1904 * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
1905 (WebCore::MediaSourceClientGStreamerMSE::append): Fix compilation warning.
1907 2018-01-16 Yacine Bandou <yacine.bandou_ext@softathome.com>
1909 [WPE] Two clearkey tests failing since r226621
1910 https://bugs.webkit.org/show_bug.cgi?id=181532
1912 Reviewed by Xabier Rodriguez-Calvar.
1914 Whith a fake initData, we can have a pssh size nul, thus we should check it.
1915 We saw this issue in the subtest "initData longer than 64Kb characters" in
1916 the clearkey-generate-request-disallowed-input layout test.
1918 * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1919 (WebCore::extractKeyidsLocationFromCencInitData):
1921 2018-01-15 Yoav Weiss <yoav@yoav.ws>
1923 Support for preconnect Link headers
1924 https://bugs.webkit.org/show_bug.cgi?id=181657
1926 Reviewed by Darin Adler.
1928 Move the preconnect functionality into its own function, and
1929 also call this function when Link headers are processed.
1931 Test: http/tests/preconnect/link-header-rel-preconnect-http.php
1933 * loader/LinkLoader.cpp:
1934 (WebCore::LinkLoader::loadLinksFromHeader): Call preconnect.
1935 (WebCore::LinkLoader::preconnect): Preconnect to a host functionality moved here.
1936 (WebCore::LinkLoader::preload): Renamed `preloadIfNeeded` to `preload`.
1937 (WebCore::LinkLoader::loadLink): Call preconnect.
1938 * loader/LinkLoader.h:
1940 2018-01-15 Michael Catanzaro <mcatanzaro@igalia.com>
1942 Improve use of ExportMacros
1943 https://bugs.webkit.org/show_bug.cgi?id=181652
1945 Reviewed by Konstantin Tokarev.
1949 * platform/PlatformExportMacros.h:
1951 2018-01-15 Konstantin Tokarev <annulen@yandex.ru>
1953 image-rendering should affect scaling of border-image
1954 https://bugs.webkit.org/show_bug.cgi?id=169440
1956 Reviewed by Michael Catanzaro.
1958 Test: fast/borders/border-image-pixelated.html
1960 * rendering/style/NinePieceImage.cpp:
1961 (WebCore::NinePieceImage::paint):
1963 2018-01-15 Tomas Popela <tpopela@redhat.com>
1965 2.19.3 ACCELERATED_2D_CANVAS support is broken
1966 https://bugs.webkit.org/show_bug.cgi?id=180799
1968 Reviewed by Michael Catanzaro.
1970 * html/canvas/CanvasRenderingContext2DBase.cpp:
1971 (WebCore::CanvasRenderingContext2DBase::didDraw):
1973 2018-01-15 Basuke Suzuki <Basuke.Suzuki@sony.com>
1975 [Curl] Enable HTTP/2
1976 https://bugs.webkit.org/show_bug.cgi?id=181551
1978 Reviewed by Michael Catanzaro.
1980 Start supporting HTTP/2 protocol. The first step is just enabling the HTTP/2 on Curl backend.
1981 Next step will be to enable multiplexing feature.
1983 No new tests because we don't have HTTP/2 test backend yet.
1985 * platform/network/curl/CurlContext.cpp:
1986 (WebCore::CurlContext::isHttp2Enabled const):
1987 (WebCore::CurlHandle::enableHttp):
1988 (WebCore::CurlHandle::enableHttpGetRequest):
1989 (WebCore::CurlHandle::enableHttpHeadRequest):
1990 (WebCore::CurlHandle::enableHttpPostRequest):
1991 (WebCore::CurlHandle::enableHttpPutRequest):
1992 (WebCore::CurlHandle::setHttpCustomRequest):
1993 * platform/network/curl/CurlContext.h:
1995 2018-01-15 Dean Jackson <dino@apple.com>
1997 Use a helper function for checked arithmetic in WebGL validation
1998 https://bugs.webkit.org/show_bug.cgi?id=181620
1999 <rdar://problem/36485879>
2001 Reviewed by Eric Carlson.
2003 Eric recommended using a templated helper function to do
2004 a common arithmetic check in WebGL validation.
2006 * html/canvas/WebGL2RenderingContext.cpp:
2007 (WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
2008 * html/canvas/WebGLRenderingContext.cpp:
2009 (WebCore::WebGLRenderingContext::validateIndexArrayConservative):
2010 * html/canvas/WebGLRenderingContextBase.cpp:
2011 (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
2012 (WebCore::WebGLRenderingContextBase::validateDrawArrays):
2013 (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0):
2014 (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
2015 * html/canvas/WebGLRenderingContextBase.h:
2016 (WebCore::WebGLRenderingContextBase::checkedAddAndMultiply): New helper.
2018 2018-01-15 Dean Jackson <dino@apple.com>
2020 Use traits for animation timing functions
2021 https://bugs.webkit.org/show_bug.cgi?id=181651
2022 <rdar://problem/36525328>
2024 Reviewed by Antoine Quint.
2026 Use the type traits for TimingFunction classes, so
2027 we can is<> and downcast<>.
2029 * css/CSSComputedStyleDeclaration.cpp:
2030 (WebCore::createTimingFunctionValue):
2031 * platform/animation/TimingFunction.cpp:
2032 (WebCore::TimingFunction::transformTime const):
2033 * platform/animation/TimingFunction.h:
2034 * platform/graphics/ca/GraphicsLayerCA.cpp:
2035 (WebCore::animationHasStepsTimingFunction):
2036 (WebCore::animationHasFramesTimingFunction):
2037 * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
2038 (WebCore::toCAMediaTimingFunction):
2040 2018-01-15 Youenn Fablet <youenn@apple.com>
2042 RealtimeMediaSource should be ThreadSafeRefCounted
2043 https://bugs.webkit.org/show_bug.cgi?id=181649
2045 Reviewed by Eric Carlson.
2047 Difficult to write a test as this is really racy.
2048 RealtimeIncomingVideoSourceCocoa::OnFrame is taking a reference on a background thread
2049 to send a task to the main thread.
2050 This requires it to be thread safe ref counted.
2052 * platform/mediastream/RealtimeMediaSource.h:
2054 2018-01-15 Philippe Normand <pnormand@igalia.com>
2056 Prevent useless MediaPlayer mute state notifications
2057 https://bugs.webkit.org/show_bug.cgi?id=181646
2059 Reviewed by Carlos Garcia Campos.
2061 On GTK port the mute change notification was triggering the test
2062 runner to think the whole page mute state had changed and that
2063 media elements were muted. The simplest solution is to propagate
2064 the notification only if the state actually changed.
2066 * platform/graphics/MediaPlayer.cpp:
2067 (WebCore::MediaPlayer::muteChanged): Propagate mute notification
2068 only if the mute state actually changed.
2070 2018-01-15 Sebastian Dröge <sebastian@centricular.com>
2072 [GStreamer] Don't wait for draw condition variable when shutting down.
2073 https://bugs.webkit.org/show_bug.cgi?id=180978
2075 Reviewed by Carlos Garcia Campos.
2077 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2078 (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2079 (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
2080 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2081 By also waiting for the draw condition variable while shutting down,
2082 it is possible that the GStreamer video sink is waiting for the main
2083 thread to actually render the current frame, while at the same time
2084 the main thread is waiting for the GStreamer video sink to shut down,
2085 resulting in a deadlock.
2087 2018-01-13 Minsheng Liu <lambda@liu.ms>
2089 MathML Lengths should take zoom level into account
2090 https://bugs.webkit.org/show_bug.cgi?id=180029
2092 Reviewed by Frédéric Wang.
2094 The patch applies the effective zoom factor to physical units in toUserUnits().
2096 Test: mathml/presentation/mspace-units-with-zoom.html
2098 * rendering/mathml/RenderMathMLBlock.cpp:
2099 (WebCore::toUserUnits):
2101 2018-01-12 Chris Dumez <cdumez@apple.com>
2103 ASSERTION FAILED: registration || isTerminating() in WebCore::SWServerWorker::skipWaiting()
2104 https://bugs.webkit.org/show_bug.cgi?id=181603
2105 <rdar://problem/36476050>
2107 Reviewed by Youenn Fablet.
2109 No new tests, covered by existing tests that crash flakily.
2111 * workers/service/server/SWServer.cpp:
2112 (WebCore::SWServer::terminateWorkerInternal):
2113 If the connection to the context process is gone, make sure we make the worker as terminated
2114 so that it does not stay in Running state and in SWServer::m_runningOrTerminatingWorkers.
2116 * workers/service/server/SWServerRegistration.cpp:
2117 (WebCore::SWServerRegistration::~SWServerRegistration):
2118 Add assertions to make sure none of the registration's workers are still running when
2119 the registration is destroyed.
2121 (WebCore::SWServerRegistration::updateRegistrationState):
2122 Make sure registration workers that are overwritten are not still running.
2124 * workers/service/server/SWServerWorker.cpp:
2125 (WebCore::SWServerWorker::setState):
2126 If a worker's state is set to redundant, make sure we also terminate it.
2128 2018-01-12 Commit Queue <commit-queue@webkit.org>
2130 Unreviewed, rolling out r226927.
2131 https://bugs.webkit.org/show_bug.cgi?id=181621
2133 Breaks 32-bit and iOS release for some reason that i don't
2134 understand yet (Requested by dino on #webkit).
2138 "Use a helper function for checked arithmetic in WebGL
2140 https://bugs.webkit.org/show_bug.cgi?id=181620
2141 https://trac.webkit.org/changeset/226927
2143 2018-01-12 Myles C. Maxfield <mmaxfield@apple.com>
2145 Data URL fonts split in the middle of an alphabet cause random letters to disappear
2146 https://bugs.webkit.org/show_bug.cgi?id=175845
2147 <rdar://problem/33996578>
2149 Reviewed by Brent Fulgham.
2151 It is fairly common practice for a font foundry to split a font up into two files such that a semi-random
2152 half of the alphabet is present in one of the files, and the other half is present in the other file. This
2153 practice involves representing the files as data URLs, so as to minimize the time it takes to load them.
2155 Because resource loading is asynchronous (even for data URLs), it is possible today to get a paint after
2156 the first file is loaded but before the second file is loaded. Indeed, because of the way font fallback
2157 works, we will never start loading the second file until a layout has occurred with the first font.
2159 Because a site usually only uses this pattern for a handful of fonts, and I've never seen this pattern
2160 being used for CJK fonts, it isn't very expensive to opportunistically decode these data URLs eagerly.
2161 Using this method doesn't actually guarantee that the two fonts will load in between successive paints,
2162 but it at least makes this much more likely. This patch implements this strategy, along with a size
2163 threshold to make sure that we won't decode any super large data URLs when it isn't necessary.
2165 Test: fast/text/font-load-data-partitioned-alphabet.html
2167 * css/CSSFontFace.cpp:
2168 (WebCore::CSSFontFace::opportunisticallyStartFontDataURLLoading):
2169 * css/CSSFontFace.h:
2170 * css/CSSFontFaceSource.cpp:
2171 (WebCore::CSSFontFaceSource::opportunisticallyStartFontDataURLLoading):
2172 * css/CSSFontFaceSource.h:
2173 * css/CSSFontSelector.cpp:
2174 (WebCore::CSSFontSelector::opportunisticallyStartFontDataURLLoading):
2175 * css/CSSFontSelector.h:
2176 * platform/graphics/FontCascadeFonts.cpp:
2177 (WebCore::opportunisticallyStartFontDataURLLoading):
2178 (WebCore::FontCascadeFonts::glyphDataForVariant):
2179 * platform/graphics/FontSelector.h:
2181 2018-01-12 Alex Christensen <achristensen@webkit.org>
2183 History state should be updated during client redirects with asynchronous policy decisions
2184 https://bugs.webkit.org/show_bug.cgi?id=181358
2185 <rdar://problem/35547689>
2187 Reviewed by Andy Estes.
2189 When decidePolicyForNavigationAction is responded to asynchronously during a client redirect,
2190 HistoryController::updateForRedirectWithLockedBackForwardList does not update the history because
2191 the document loader has not been marked as a client redirect because the FrameLoader only looks
2192 at its provisional document loader to mark it as a client redirect. When decidePolicyForNavigationAction
2193 is responded to asynchronously, though, the FrameLoader's provisional document loader has moved to
2194 its policy document loader. To get both asynchronous and synchronous cases, let's just mark the document
2195 loader as a client redirect whether it's the provisional or policy document loader.
2197 Covered by a new API test.
2199 * loader/FrameLoader.cpp:
2200 (WebCore::FrameLoader::loadURL):
2201 (WebCore::FrameLoader::loadPostRequest):
2203 2018-01-12 Dean Jackson <dino@apple.com>
2205 Use a helper function for checked arithmetic in WebGL validation
2206 https://bugs.webkit.org/show_bug.cgi?id=181620
2207 <rdar://problem/36485879>
2209 Reviewed by Eric Carlson.
2211 Eric recommended using a templated helper function to do
2212 a common arithmetic check in WebGL validation.
2214 * html/canvas/WebGL2RenderingContext.cpp:
2215 (WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
2216 * html/canvas/WebGLRenderingContext.cpp:
2217 (WebCore::WebGLRenderingContext::validateIndexArrayConservative):
2218 * html/canvas/WebGLRenderingContextBase.cpp:
2219 (WebCore::WebGLRenderingContextBase::checkedAddAndMultiply): New helper.
2220 (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
2221 (WebCore::WebGLRenderingContextBase::validateDrawArrays):
2222 (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0):
2223 (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
2224 * html/canvas/WebGLRenderingContextBase.h:
2226 2018-01-12 Myles C. Maxfield <mmaxfield@apple.com>
2228 [Cocoa] CTFontCopyDefaultCascadeListForLanguages() can return nullptr
2229 https://bugs.webkit.org/show_bug.cgi?id=181615
2230 <rdar://problem/36334637>
2232 Reviewed by Jon Lee.
2234 Speculative fix. We are getting crash reports saying that this call can return nullptr, and we
2237 No new tests because I couldn't find the specific input that causes it to return nullptr. (I
2238 tried running this code with every 0, 1, and 2 length locale string, every weight value, and
2239 every italic value, and couldn't get it to crash. I also inspected the code to figure out what
2240 values would cause it to return nullptr, and I couldn't find anything other than if the system
2241 has a totally busted font setup.)
2243 * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2244 (WebCore::SystemFontDatabase::computeCascadeList):
2246 2018-01-11 Dean Jackson <dino@apple.com>
2248 [WebGL] Simulated vertexAttrib0 can sometimes cause OUT_OF_MEMORY errors
2249 https://bugs.webkit.org/show_bug.cgi?id=181558
2250 <rdar://problem/36189833>
2252 Reviewed by Eric Carlson.
2254 Very large element indices in the ELEMENT_ARRAY_BUFFER meant that
2255 our simulated vertexAttrib0 buffer might be too large. We need
2256 to check for out-of-memory, but we can also detect some of the issues
2257 earlier in our validation code. Additionally, make sure that we don't
2258 accidentally cast an unsigned to a signed.
2260 Test: fast/canvas/webgl/simulated-vertexAttrib0-invalid-indicies.html
2262 * html/canvas/WebGL2RenderingContext.cpp:
2263 (WebCore::WebGL2RenderingContext::validateIndexArrayConservative): Update validation
2264 code to look for overflow, rather than relying on looking for sign changes.
2265 * html/canvas/WebGLRenderingContext.cpp:
2266 (WebCore::WebGLRenderingContext::validateIndexArrayConservative): Ditto.
2267 * html/canvas/WebGLRenderingContextBase.cpp:
2268 (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
2269 (WebCore::WebGLRenderingContextBase::drawArrays): Check that we were able to simulate.
2270 (WebCore::WebGLRenderingContextBase::drawElements):
2271 (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): Update validation code, and
2272 use GC3Duint, since that's what the indicies are.
2273 (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Ditto.
2274 (WebCore::WebGLRenderingContextBase::drawArraysInstanced): Check that we were able to simulate.
2275 (WebCore::WebGLRenderingContextBase::drawElementsInstanced):
2276 * html/canvas/WebGLRenderingContextBase.h:
2278 2018-01-12 Wenson Hsieh <wenson_hsieh@apple.com>
2280 Large in-place attachment elements cause the document width to expand when inserted
2281 https://bugs.webkit.org/show_bug.cgi?id=181614
2283 Reviewed by Dan Bernstein.
2285 Make in-place images and videos have a max-width of 100%, so that large attachments aren't inserted with full
2286 display size, causing the document and viewport width to expand.
2288 * html/HTMLAttachmentElement.cpp:
2289 (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
2291 2018-01-12 Keith Rollin <krollin@apple.com>
2293 Logged JSON should escape "'s and \'s in strings.
2294 https://bugs.webkit.org/show_bug.cgi?id=181608
2296 Reviewed by Brent Fulgham.
2298 No new tests -- no new functionality, just changed logging. The
2299 efficacy of the logging was verified by inspecting its output.
2301 * loader/ResourceLoadObserver.cpp:
2302 (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2304 2018-01-12 Dean Jackson <dino@apple.com>
2306 drawElements should be invalid if vertexAttrib0 doesn't have data
2307 https://bugs.webkit.org/show_bug.cgi?id=181609
2308 <rdar://problem/36392883>
2310 Reviewed by Antoine Quint.
2312 If a vertex attribute has been enabled, but no data provided, then
2313 draw validation should fail.
2315 Test: fast/canvas/webgl/drawElements-empty-vertex-data.html
2317 * html/canvas/WebGLRenderingContextBase.cpp:
2318 (WebCore::WebGLRenderingContextBase::validateVertexAttributes): If there were
2319 never any data in the vertex buffer, then we incorrectly compared with 0.
2321 2018-01-12 Youenn Fablet <youenn@apple.com>
2323 FormDataElement::lengthInBytes should use ThreadableBlobRegistry
2324 https://bugs.webkit.org/show_bug.cgi?id=181554
2326 Reviewed by Chris Dumez.
2328 Covered by updated test.
2330 Fix blobRegistry() use and add support for creating a response that may trigger the issue.
2333 * platform/network/FormData.cpp:
2334 (WebCore::FormDataElement::lengthInBytes const): Was using directly blobRegistry() while ThreadableBlobRegistry is more appropriate
2335 in case this is called from workers.
2336 * Modules/fetch/FetchBody.h:
2337 * Modules/fetch/FetchResponse.h:
2339 * testing/ServiceWorkerInternals.cpp:
2340 (WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse):
2341 * testing/ServiceWorkerInternals.h:
2342 * testing/ServiceWorkerInternals.idl:
2344 2018-01-12 Jer Noble <jer.noble@apple.com>
2346 Wrap CDMFairPlayStreaming and related classes in ENABLE(ENCRYPTED_MEDIA) checks
2347 https://bugs.webkit.org/show_bug.cgi?id=181602
2349 Reviewed by Maciej Stachowiak.
2351 * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
2352 * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
2353 * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2355 2018-01-12 Youenn Fablet <youenn@apple.com>
2357 WebProcess should pass the registration identifier and not the worker identifier for fetch events
2358 https://bugs.webkit.org/show_bug.cgi?id=181591
2360 Reviewed by Chris Dumez.
2362 Test: http/wpt/service-workers/update-service-worker.https.html
2364 Store service worker registration identifier in ResourceLoaderOptions instead of service worker identifier.
2366 * loader/DocumentThreadableLoader.cpp:
2367 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2368 (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
2369 * loader/ResourceLoaderOptions.h:
2370 * loader/WorkerThreadableLoader.cpp:
2371 (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2372 * loader/cache/CachedResourceLoader.cpp:
2373 (WebCore::CachedResourceLoader::prepareFetch):
2374 (WebCore::CachedResourceLoader::determineRevalidationPolicy const):
2375 * loader/cache/CachedResourceRequest.cpp:
2376 (WebCore::CachedResourceRequest::setSelectedServiceWorkerRegistrationIdentifierIfNeeded):
2377 (WebCore::CachedResourceRequest::setNavigationServiceWorkerRegistrationData):
2378 (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded): Deleted.
2379 * loader/cache/CachedResourceRequest.h:
2380 * workers/WorkerScriptLoader.cpp:
2381 (WebCore::WorkerScriptLoader::loadSynchronously):
2382 (WebCore::WorkerScriptLoader::loadAsynchronously):
2383 * workers/service/server/SWServer.cpp:
2384 (WebCore::SWServer::activeWorkerFromRegistrationID):
2385 * workers/service/server/SWServer.h:
2387 2018-01-12 Fujii Hironori <Hironori.Fujii@sony.com>
2389 [Win][CMake] Remove all-in-one file for WebCore DerivedSources
2390 https://bugs.webkit.org/show_bug.cgi?id=181582
2392 Reviewed by Alex Christensen.
2394 Those source files are compiled in unified source build nowadays.
2396 No new tests (No behavior change)
2398 * CMakeLists.txt: Removed calling PROCESS_ALLINONE_FILE.
2399 * DerivedSources.cpp: Removed.
2400 * WebCoreMacros.cmake: Removed a macro PROCESS_ALLINONE_FILE.
2402 2018-01-12 Fujii Hironori <Hironori.Fujii@sony.com>
2404 [WinCairo][CMake] Use ${CURL_LIBRARY} instead of specifying the library name libcurl_imp explicitly
2405 https://bugs.webkit.org/show_bug.cgi?id=181578
2407 Reviewed by Alex Christensen.
2409 vcpkg has libcurl.lib, not libcurl_imp.lib.
2411 No new tests because no behavior change.
2413 * PlatformWinCairo.cmake: Link ${CURL_LIBRARY} instead of libcurl_imp.
2415 2018-01-12 Jer Noble <jer.noble@apple.com>
2417 WebGL video texture black in Safari 11.0.2 and wrong colored in Safari Preview 11.1
2418 https://bugs.webkit.org/show_bug.cgi?id=181445
2419 <rdar://problem/36383183>
2421 Reviewed by Dean Jackson.
2423 Tests: added compile-time correctness tests for YCbCrMatrix values.
2425 Perform the derivation from YCbCr coefficients into matrices in constexpr expressions
2426 at compile-time. This allows us to also perform compile-time correctness checks to catch
2427 regressions which may cause incorrect color conversions.
2429 Since we now have general-purpose derivation of matrix values from coefficients,
2430 adding missing specificed matrices is trivial, so add support for SMPTE 240M and BT.2020
2433 * platform/graphics/cv/VideoTextureCopierCV.cpp:
2434 (WebCore::GLfloatColor::GLfloatColor):
2435 (WebCore::GLfloatColor::abs):
2436 (WebCore::GLfloatColor::isApproximatelyEqualTo const):
2437 (WebCore::YCbCrMatrix::operator Vector<GLfloat> const):
2438 (WebCore::YCbCrMatrix::YCbCrMatrix):
2439 (WebCore::YCbCrMatrix::operator* const):
2440 (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
2442 2018-01-12 Antoine Quint <graouts@apple.com>
2444 Add support for the frames() timing function
2445 https://bugs.webkit.org/show_bug.cgi?id=181585
2446 <rdar://problem/36463317>
2450 Implement the frames() timing function as specified in the CSS Timing Functions Level 1
2451 specification, specifically https://www.w3.org/TR/css-timing-1/#frames-timing-functions.
2452 A frames timing function is a type of timing function that divides the input time into a
2453 specified number of intervals of equal length.
2455 Test: transitions/frames-timing-function.html
2457 * css/CSSComputedStyleDeclaration.cpp:
2458 (WebCore::createTimingFunctionValue):
2459 * css/CSSTimingFunctionValue.cpp:
2460 (WebCore::CSSFramesTimingFunctionValue::customCSSText const):
2461 (WebCore::CSSFramesTimingFunctionValue::equals const):
2462 * css/CSSTimingFunctionValue.h:
2463 * css/CSSToStyleMap.cpp:
2464 (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
2466 (WebCore::CSSValue::equals const):
2467 (WebCore::CSSValue::cssText const):
2468 (WebCore::CSSValue::destroy):
2470 (WebCore::CSSValue::isFramesTimingFunctionValue const):
2471 * css/CSSValueKeywords.in:
2472 * css/parser/CSSPropertyParser.cpp:
2473 (WebCore::consumeSteps):
2474 (WebCore::consumeFrames):
2475 (WebCore::consumeAnimationTimingFunction):
2476 * platform/animation/TimingFunction.cpp:
2477 (WebCore::operator<<):
2478 (WebCore::TimingFunction::transformTime const):
2479 * platform/animation/TimingFunction.h:
2480 (WebCore::TimingFunction::isFramesTimingFunction const):
2481 * platform/graphics/ca/GraphicsLayerCA.cpp:
2482 (WebCore::animationHasFramesTimingFunction):
2483 (WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
2485 2018-01-12 Commit Queue <commit-queue@webkit.org>
2487 Unreviewed, rolling out r226721.
2488 https://bugs.webkit.org/show_bug.cgi?id=181583
2490 Lets do a slightly different fix (Requested by anttik on
2495 "REGRESSION(r225650): The scores of MotionMark tests Multiply
2496 and Leaves dropped by 8%"
2497 https://bugs.webkit.org/show_bug.cgi?id=181460
2498 https://trac.webkit.org/changeset/226721
2500 2018-01-11 Keith Miller <keith_miller@apple.com>
2502 Rename ENABLE_ASYNC_ITERATION to ENABLE_JS_ASYNC_ITERATION
2503 https://bugs.webkit.org/show_bug.cgi?id=181573
2505 Reviewed by Simon Fraser.
2507 * Configurations/FeatureDefines.xcconfig:
2509 2018-01-11 Jiewen Tan <jiewen_tan@apple.com>
2511 [WebAuthN] Import a CBOR coder from Chromium
2512 https://bugs.webkit.org/show_bug.cgi?id=181522
2513 <rdar://problem/36055729>
2515 Reviewed by Brent Fulgham.
2517 This patch imports a CBOR coder including encoder and decoder from Chromium. CBOR encoder
2518 is needed for WebAuthN to encode attestation object into binaries. When supporting extensions
2519 in the future, CBOR encoder/decoder will be needed as well. Implementating and maintaining
2520 a fully-fledged CBOR coder doesn't seem to align with WebKit's best interests. Therefore,
2521 importing a most suitable third party implementation will be wise.
2523 In this patch, it fully integrate the whole coder into our codebase. Those changes includes:
2524 1. Substitute data structures that enjoy a better WTF version.
2525 2. Replacing marcos.
2526 3. Implementating workarounds for some functionalities that we lack fundamental types' support.
2527 4. Changing the coding style to match ours.
2529 This patch doesn't intend to improve the logic of the original codebase. Hence some of the
2530 coding logic might not match what WebKit ususally has.
2532 Here is a full list of Chromium changes that constructed this CBOR coder in chronological order:
2533 6efcf495521d18d060027762f48bb292d6979136,
2534 9eb43fd347890b4c6cf54c4bd7ec1bbb88e381e1,
2535 31c85e74fd567772f18e0a41be468d04af721f21,
2536 68672fdcad280a8ff69b91927d38d0eabf2c87f2,
2537 0ca8667c0584fb21c0748ebd7468d32889759a07,
2538 df763d790d7e45d70116bdefacbfd4f9faa8995e,
2539 6d30c4a621c65314db63eb56e87c19ab75627b26,
2540 50fe92953f4739f17a62303fedbf8db9234317c8,
2541 47be22c3603424d1832d046a348ff3f982500288,
2542 98a59e46948b2c71608926004fac8192b0ff2208,
2543 07540c6d850ed6e0fa508d63c20a8ce96d751de6,
2544 06ae32d640c8e4b86ea8914a80ee419ea16e56d8.
2546 Covered by API tests.
2548 * Modules/webauthn/cbor/CBORBinary.h: Added.
2549 * Modules/webauthn/cbor/CBORReader.cpp: Added.
2550 (cbor::CBORReader::CBORReader):
2551 (cbor::CBORReader::~CBORReader):
2552 (cbor::CBORReader::read):
2553 (cbor::CBORReader::decodeCBOR):
2554 (cbor::CBORReader::readVariadicLengthInteger):
2555 (cbor::CBORReader::decodeValueToNegative):
2556 (cbor::CBORReader::decodeValueToUnsigned):
2557 (cbor::CBORReader::readSimpleValue):
2558 (cbor::CBORReader::readString):
2559 Workarounds applied.
2560 (cbor::CBORReader::readBytes):
2561 (cbor::CBORReader::readCBORArray):
2562 (cbor::CBORReader::readCBORMap):
2563 (cbor::CBORReader::canConsume):
2564 (cbor::CBORReader::checkMinimalEncoding):
2565 (cbor::CBORReader::checkExtraneousData):
2566 (cbor::CBORReader::checkDuplicateKey):
2567 (cbor::CBORReader::hasValidUTF8Format):
2568 Workarounds applied.
2569 (cbor::CBORReader::checkOutOfOrderKey):
2570 (cbor::CBORReader::getErrorCode):
2571 (cbor::CBORReader::errorCodeToString):
2572 * Modules/webauthn/cbor/CBORReader.h: Added.
2573 * Modules/webauthn/cbor/CBORValue.cpp: Added.
2574 (cbor::CBORValue::CBORValue):
2575 (cbor::CBORValue::operator=):
2576 (cbor::CBORValue::~CBORValue):
2577 (cbor::CBORValue::clone const):
2578 (cbor::CBORValue::getInteger const):
2579 (cbor::CBORValue::getUnsigned const):
2580 (cbor::CBORValue::getNegative const):
2581 (cbor::CBORValue::getString const):
2582 (cbor::CBORValue::getByteString const):
2583 (cbor::CBORValue::getArray const):
2584 (cbor::CBORValue::getMap const):
2585 (cbor::CBORValue::getSimpleValue const):
2586 (cbor::CBORValue::internalMoveConstructFrom):
2587 (cbor::CBORValue::internalCleanup):
2588 * Modules/webauthn/cbor/CBORValue.h: Added.
2589 * Modules/webauthn/cbor/CBORWriter.cpp: Added.
2590 (cbor::CBORWriter::~CBORWriter):
2591 (cbor::CBORWriter::write):
2592 (cbor::CBORWriter::CBORWriter):
2593 (cbor::CBORWriter::encodeCBOR):
2594 Workarounds applied.
2595 (cbor::CBORWriter::startItem):
2596 (cbor::CBORWriter::setAdditionalInformation):
2597 (cbor::CBORWriter::setUint):
2598 (cbor::CBORWriter::getNumUintBytes):
2599 * Modules/webauthn/cbor/CBORWriter.h: Added.
2601 * WebCore.xcodeproj/project.pbxproj:
2603 2018-01-11 Chris Dumez <cdumez@apple.com>
2605 Setting Window.opener to null should disown its opener
2606 https://bugs.webkit.org/show_bug.cgi?id=181505
2607 <rdar://problem/36443151>
2609 Reviewed by Ryosuke Niwa.
2611 Setting Window.opener to null should disown its opener as per:
2612 - https://html.spec.whatwg.org/#dom-opener
2614 With this change, tabs opened by clicking link inside Gmail no
2615 longer have the Gmail window as opener.
2617 Tests: fast/dom/Window/window-opener-set-to-null.html
2618 fast/dom/Window/window-opener-shadowing.html
2620 * bindings/js/JSDOMWindowCustom.cpp:
2621 (WebCore::JSDOMWindow::setOpener):
2622 * page/DOMWindow.cpp:
2623 (WebCore::DOMWindow::disownOpener):
2625 * page/DOMWindow.idl:
2627 2018-01-11 Myles C. Maxfield <mmaxfield@apple.com>
2629 [Cocoa] Star character disappears when bolded
2630 https://bugs.webkit.org/show_bug.cgi?id=181568
2631 <rdar://problem/18755569>
2633 Reviewed by Simon Fraser.
2635 We had some code in ComplexTextController to ask the FontCache for a font, given the name
2636 of a particular font CoreText used inside a CTRun. This is wrong for two reasons: fonts
2637 are not identifiable by PostScript name (in the general case), and because the lookup
2638 procedure requires a FontDescription, the result may yield a font that is not the one
2639 looked up. The goal of this code was simply to preserve the rendering mode of the font,
2640 but we removed support for these rendering modes years ago. So the solution is to skip
2641 that lookup and use the CoreText font directly.
2643 Test: fast/text/unknown-font.html
2645 * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2646 (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2648 2018-01-11 Keith Rollin <krollin@apple.com>
2650 Add optional logging of ITP-related user interaction information
2651 https://bugs.webkit.org/show_bug.cgi?id=181556
2653 Reviewed by Brent Fulgham.
2655 In order to support the tracking of the efficacy of Intelligent
2656 Tracking Protection, add some logging indicating when the user
2657 interacts with a page in a way that affects cookie partitioning. This
2658 logging is off by default, and is enabled with `defaults write -g
2659 WebKitLogCookieInformation -bool true`.
2661 No new tests -- no changed functionality.
2663 * loader/ResourceLoadObserver.cpp:
2664 (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2665 * loader/ResourceLoadObserver.h:
2666 (WebCore::ResourceLoadObserver::shouldLogUserInteraction const):
2667 (WebCore::ResourceLoadObserver::setShouldLogUserInteraction):
2669 2018-01-11 James Craig <jcraig@apple.com>
2671 AX: when invert colors is on, double-invert video elements in UserAgentStyleSheet
2672 https://bugs.webkit.org/show_bug.cgi?id=168447
2673 <rdar://problem/30559874>
2675 Reviewed by Simon Fraser.
2677 Double-invert video when platform "invert colors" setting is enabled. Behavior matches
2678 current "Smart Invert" feature of Safari Reader on macOS/iOS and other iOS native apps.
2680 Tests: accessibility/smart-invert-reference.html
2681 accessibility/smart-invert.html
2683 * Modules/modern-media-controls/controls/media-controls.css:
2684 (@media (inverted-colors)):
2688 (@media (inverted-colors)):
2691 2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
2693 Don't load inline data when requesting info for an attachment element backed by a file path
2694 https://bugs.webkit.org/show_bug.cgi?id=181550
2696 Reviewed by Tim Horton.
2698 When requesting data for an attachment element that is backed by a file path, we currently trigger a load in the
2699 web process to fetch contents of the attachment data as inline data in the AttachmentInfo. This is unnecessary,
2700 since the file path of the attachment element must have come from the UI process anyways, so it is sufficient to
2701 simply send the file path to the UI process and have the UI process read the contents of the path as a memory-
2704 This patch lets HTMLAttachmentElement skip over resource loading codepaths when creating an AttachmentInfo for
2705 the client, and also teaches _WKAttachment to read a AttachmentInfo's filepath as memory-mapped data if a file
2706 path is present, and no inline data was specified.
2708 Covered by existing API tests.
2710 * html/HTMLAttachmentElement.cpp:
2711 (WebCore::HTMLAttachmentElement::requestInfo):
2713 2018-01-10 Ryosuke Niwa <rniwa@webkit.org>
2715 Make elements of zero width or height focusable
2716 https://bugs.webkit.org/show_bug.cgi?id=181516
2718 Reviewed by Chris Dumez.
2720 Don't check render box's size or bounding rect when deciding whether an element is focusable.
2721 New behavior matches that of Firefox and Chrome.
2723 Test: fast/events/focus-zero-size-element.html
2726 (WebCore::Element::isFocusable): Only update the style.
2727 * html/HTMLFormControlElement.cpp:
2728 (WebCore::HTMLFormControlElement::isFocusable const): Deleted.
2729 * html/HTMLFormControlElement.h:
2730 * mathml/MathMLElement.cpp:
2731 (WebCore::MathMLElement::isFocusable const): Deleted. As far as I can tell, no math ml element is focusable.
2732 * mathml/MathMLElement.h:
2733 * svg/SVGAElement.cpp:
2734 (WebCore::SVGAElement::isFocusable const): Deleted.
2735 * svg/SVGAElement.h:
2737 2018-01-11 Filip Pizlo <fpizlo@apple.com>
2739 Rename MarkedAllocator to BlockDirectory and AllocatorAttributes to CellAttributes
2740 https://bugs.webkit.org/show_bug.cgi?id=181543
2742 Rubber stamped by Michael Saboff.
2744 No new tests because I'm just renaming things.
2746 * ForwardingHeaders/heap/BlockDirectoryInlines.h: Copied from Source/WebCore/ForwardingHeaders/heap/MarkedAllocatorInlines.h.
2747 * ForwardingHeaders/heap/MarkedAllocatorInlines.h: Removed.
2748 * bindings/js/DOMGCOutputConstraint.cpp:
2750 2018-01-11 Alex Christensen <achristensen@webkit.org>
2752 REGRESSION(r225003): Loading hangs in environments where dispatch_async does not work
2753 https://bugs.webkit.org/show_bug.cgi?id=181553
2754 <rdar://problem/35733938>
2756 Reviewed by Eric Carlson.
2758 There is an environment where dispatch_async does not work, but performSelectorOnMainThread works.
2759 r225003 broke loading in this environment. This fixes it and updates the test that r225003 fixed.
2760 It failed sometimes because loading was happening in a different order than html parsing, so I made
2761 the test not depend on html parsing timing by updating media/video-src-remove.html.
2763 * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2764 (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
2766 2018-01-11 Dean Jackson <dino@apple.com>
2768 Rolling out 226814. It crashes on some bots.
2770 2018-01-11 Dean Jackson <dino@apple.com>
2772 [WebGL] Simulated vertexAttrib0 can sometimes cause OUT_OF_MEMORY errors
2773 https://bugs.webkit.org/show_bug.cgi?id=181558
2774 <rdar://problem/36189833>
2776 Reviewed by Eric Carlson.
2778 Very large element indices in the ELEMENT_ARRAY_BUFFER meant that
2779 our simulated vertexAttrib0 buffer might be too large. We need
2780 to check for out-of-memory, but we can also detect some of the issues
2781 earlier in our validation code. Additionally, make sure that we don't
2782 accidentally cast an unsigned to a signed.
2784 Test: fast/canvas/webgl/simulated-vertexAttrib0-invalid-indicies.html
2786 * html/canvas/WebGL2RenderingContext.cpp:
2787 (WebCore::WebGL2RenderingContext::validateIndexArrayConservative): Update validation
2788 code to look for overflow, rather than relying on looking for sign changes.
2789 * html/canvas/WebGLRenderingContext.cpp:
2790 (WebCore::WebGLRenderingContext::validateIndexArrayConservative): Ditto.
2791 * html/canvas/WebGLRenderingContextBase.cpp:
2792 (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
2793 (WebCore::WebGLRenderingContextBase::drawArrays): Check that we were able to simulate.
2794 (WebCore::WebGLRenderingContextBase::drawElements):
2795 (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): Update validation code, and
2796 use GC3Duint, since that's what the indicies are.
2797 (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Ditto.
2798 (WebCore::WebGLRenderingContextBase::drawArraysInstanced): Check that we were able to simulate.
2799 (WebCore::WebGLRenderingContextBase::drawElementsInstanced):
2800 * html/canvas/WebGLRenderingContextBase.h:
2802 2018-01-11 Chris Dumez <cdumez@apple.com>
2804 ASSERTION FAILED: registration in WebCore::SWServerWorker::skipWaiting()
2805 https://bugs.webkit.org/show_bug.cgi?id=181222
2806 <rdar://problem/36332686>
2808 Reviewed by Youenn Fablet.
2810 Replace assertion in SWServerWorker::skipWaiting() that assumes the worker
2811 has a registration. Nowadays, a SWServerWorker can stay alive for a short
2812 period without having a registration, while it is terminating.
2814 No new tests, unskipped existing test.
2816 * workers/service/server/SWServerWorker.cpp:
2817 (WebCore::SWServerWorker::skipWaiting):
2819 2018-01-11 Antti Koivisto <antti@apple.com>
2821 Don't call RenderElement::setStyle when nothing changes
2822 https://bugs.webkit.org/show_bug.cgi?id=181530
2824 Reviewed by Zalan Bujtas.
2826 * style/StyleChange.h:
2828 Remove 'Force' value. This essentially meant 'compute style for all descendants and call setStyle unconditionally'.
2829 Using this value lost information about whether anything actually changed in a particular style as it was automatically
2830 inherited by all descendants. The 'compute all descendants' part of the behavior is what is actually needed.
2832 Instead add separate DescendantsToResolve enum for communicating what else to compute.
2834 * style/StyleTreeResolver.cpp:
2835 (WebCore::Style::TreeResolver::Parent::Parent):
2836 (WebCore::Style::computeDescendantsToResolve):
2838 Figure out which descendants will need resolving based on how the current elements style changed.
2840 (WebCore::Style::TreeResolver::resolveElement):
2841 (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2842 (WebCore::Style::TreeResolver::pushParent):
2843 (WebCore::Style::shouldResolveElement):
2845 Use DescendantsToResolve as input.
2847 (WebCore::Style::TreeResolver::resolveComposedTree):
2848 * style/StyleTreeResolver.h:
2849 * style/StyleUpdate.h:
2850 (WebCore::Style::ElementUpdates::ElementUpdates):
2852 Add DescendantsToResolve.
2854 2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
2856 Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareToDragPromisedBlob
2857 https://bugs.webkit.org/show_bug.cgi?id=181497
2859 Reviewed by Tim Horton.
2861 Refactor drag initiation with DOMFile-backed attachment elements. See WebKit ChangeLog for more information. No
2862 change in behavior; promised blob dragging covered by WKAttachment API tests.
2864 * loader/EmptyClients.cpp:
2865 * page/DragClient.h:
2866 (WebCore::DragClient::prepareToDragPromisedBlob): Deleted.
2867 * page/DragController.cpp:
2868 (WebCore::DragController::startDrag):
2869 (WebCore::DragController::doImageDrag):
2870 (WebCore::DragController::doSystemDrag):
2871 (WebCore::DragController::promisedBlobInfo):
2872 (WebCore::DragController::dragAttachmentElement): Deleted.
2873 * page/DragController.h:
2874 * platform/DragItem.h:
2875 (WebCore::DragItem::encode const):
2876 (WebCore::DragItem::decode):
2878 2018-01-11 Youenn Fablet <youenn@apple.com>
2880 RTCController should disable ICE candidate filtering in case of getUserMedia based on the RTCPerrConnection origin
2881 https://bugs.webkit.org/show_bug.cgi?id=180851
2883 Reviewed by Eric Carlson.
2885 Test: http/wpt/webrtc/third-party-frame-ice-candidate-filtering.html
2887 RTCController now stores all the client origins (top+frame origins) of frames that got access to camera/microphone access.
2888 For any such client origin, PeerConnection objects ICE candidate filtering is disabled.
2889 ICE candidate filtering is reset whenever navigating/reloading the page.
2891 * Modules/mediastream/RTCController.cpp:
2892 (WebCore::RTCController::reset):
2893 (WebCore::matchDocumentOrigin):
2894 (WebCore::RTCController::shouldDisableICECandidateFiltering):
2895 (WebCore::RTCController::add):
2896 (WebCore::RTCController::disableICECandidateFilteringForAllOrigins):
2897 (WebCore::RTCController::disableICECandidateFiltering):
2898 (WebCore::RTCController::enableICECandidateFiltering):
2899 * Modules/mediastream/RTCController.h:
2900 * Modules/mediastream/RTCPeerConnection.cpp:
2901 (WebCore::RTCPeerConnection::create):
2902 * Modules/mediastream/UserMediaRequest.cpp:
2903 (WebCore::UserMediaRequest::allow):
2905 (WebCore::Page::disableICECandidateFiltering):
2906 * testing/Internals.cpp:
2907 (WebCore::Internals::setICECandidateFiltering):
2909 2018-01-11 Ali Juma <ajuma@chromium.org>
2911 window.visualViewport should behave as [SameObject]
2912 https://bugs.webkit.org/show_bug.cgi?id=181548
2914 Reviewed by Chris Dumez.
2916 Add 'GenerateIsReachable' to VisualViewport so that window.visualViewport's
2917 JS wrapper object doesn't get garbage collected too soon.
2919 Test: fast/visual-viewport/visual-viewport-same-object.html
2921 * page/VisualViewport.idl:
2923 2018-01-11 Basuke Suzuki <Basuke.Suzuki@sony.com>
2925 [Curl] Extract multipart handling from ResourceHandle to CurlRequest.
2926 https://bugs.webkit.org/show_bug.cgi?id=181506
2928 Reviewed by Alex Christensen.
2930 Rename old MultipartHandle class to CurlMultipartHandle and modernize it. Also move the responsibility
2931 of handling multi part from ResourceHandle to CurlRequest. This is required for upcoming NetworkLoadTask.
2933 No new tests because no new behavior.
2935 * platform/Curl.cmake:
2936 * platform/network/curl/CurlMultipartHandle.cpp: Renamed from Source/WebCore/platform/network/curl/MultipartHandle.cpp.
2937 (WebCore::CurlMultipartHandle::createIfNeeded):
2938 (WebCore::CurlMultipartHandle::extractBoundary):
2939 (WebCore::CurlMultipartHandle::extractBoundaryFromContentType):
2940 (WebCore::CurlMultipartHandle::CurlMultipartHandle):
2941 (WebCore::CurlMultipartHandle::didReceiveData):
2942 (WebCore::CurlMultipartHandle::didComplete):
2943 (WebCore::CurlMultipartHandle::processContent):
2944 (WebCore::CurlMultipartHandle::checkForBoundary):
2945 (WebCore::CurlMultipartHandle::matchedLength):
2946 (WebCore::CurlMultipartHandle::parseHeadersIfPossible):
2947 * platform/network/curl/CurlMultipartHandle.h: Renamed from Source/WebCore/platform/network/curl/MultipartHandle.h.
2948 (WebCore::CurlMultipartHandle::~CurlMultipartHandle):
2949 * platform/network/curl/CurlMultipartHandleClient.h: Added.
2950 (WebCore::CurlMultipartHandleClient::~CurlMultipartHandleClient):
2951 * platform/network/curl/CurlRequest.cpp:
2952 (WebCore::CurlRequest::CurlRequest):
2953 (WebCore::CurlRequest::didReceiveHeader):
2954 (WebCore::CurlRequest::didReceiveData):
2955 (WebCore::CurlRequest::didReceiveHeaderFromMultipart):
2956 (WebCore::CurlRequest::didReceiveDataFromMultipart):
2957 (WebCore::CurlRequest::didCompleteTransfer):
2958 (WebCore::CurlRequest::finalizeTransfer):
2959 (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
2960 (WebCore::CurlRequest::invokeDidReceiveResponse):
2961 (WebCore::CurlRequest::completeDidReceiveResponse):
2962 * platform/network/curl/CurlRequest.h:
2963 (WebCore::CurlRequest::create):
2964 * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2965 (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
2966 (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
2967 (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
2968 (WebCore::ResourceHandleCurlDelegate::curlDidComplete):
2969 * platform/network/curl/ResourceHandleCurlDelegate.h:
2971 2018-01-11 Zalan Bujtas <zalan@apple.com>
2973 RenderTreeUpdater::current() returns null_ptr when mutation is done through Document::resolveStyle.
2974 https://bugs.webkit.org/show_bug.cgi?id=181513
2975 <rdar://problem/36367085>
2977 Reviewed by Antti Koivisto.
2979 This patch ensures that we use a valid RenderTreeBuilder even when
2980 Document::resolveStyle (incorrectly) triggers tree mutation.
2981 It can be reverted soon after the incorrect mutations are taken care of.
2983 Test: fast/forms/button-set-text-crash.html
2985 * rendering/RenderButton.cpp:
2986 (WebCore::RenderButton::setText):
2987 * rendering/RenderMenuList.cpp:
2988 (RenderMenuList::setText):
2990 2018-01-11 Antoine Quint <graouts@apple.com>
2992 Only listen to webkitplaybacktargetavailabilitychanged when media controls are visible to the user
2993 https://bugs.webkit.org/show_bug.cgi?id=181547
2994 <rdar://problem/35947650>
2996 Reviewed by Eric Carlson.
2998 Because listening to "webkitplaybacktargetavailabilitychanged" events incurs some higher power usage on iOS,
2999 we only listen to such events when controls are visible to the user. In other words, the MediaControls need to
3000 have both "visible" set to "true" and "faded" set to "false". To support this, we add a delegate method on
3001 MediaControls such that it can tell the MediaController that the "visible" property changed. With this message,
3002 MediaController can inform its MediaControllerSupport objects that user visibility of the controls changed, which
3003 lets AirplaySupport disable itself when controls are no longer visible.
3005 Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-with-hidden-controls.html
3007 * Modules/modern-media-controls/controls/media-controls.js:
3008 (MediaControls.prototype.set visible):
3009 * Modules/modern-media-controls/media/airplay-support.js:
3010 (AirplaySupport.prototype.controlsUserVisibilityDidChange):
3011 * Modules/modern-media-controls/media/media-controller-support.js:
3012 (MediaControllerSupport.prototype.controlsUserVisibilityDidChange):
3013 * Modules/modern-media-controls/media/media-controller.js:
3014 (MediaController.prototype.mediaControlsVisibilityDidChange):
3015 (MediaController.prototype.mediaControlsFadedStateDidChange):
3016 (MediaController.prototype._controlsUserVisibilityDidChange):
3018 2018-01-11 Antoine Quint <graouts@apple.com>
3020 [iOS] There should be no controls markup generated in fullscreen
3021 https://bugs.webkit.org/show_bug.cgi?id=181540
3022 <rdar://problem/35060379>
3024 Reviewed by Eric Carlson.
3026 We completely forgo the display of any content when fullscreen on iOS by setting the
3027 "visible" flag to "false" on the MediaControls, which will prevent any DOM content from
3030 * Modules/modern-media-controls/media/media-controller.js:
3031 (MediaController.prototype.handleEvent):
3032 (MediaController.prototype._updateiOSFullscreenProperties):
3034 (MediaController.prototype._updateSupportingObjectsEnabledState): Deleted.
3036 2018-01-11 Alex Christensen <achristensen@webkit.org>
3038 Revert changes accidentally committed with r226789.
3039 https://bugs.webkit.org/show_bug.cgi?id=181423
3041 I had some local changes I did not mean to commit.
3043 * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3044 (scheduledWithCustomRunLoopMode):
3045 (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
3046 (WebCore::if): Deleted.
3047 (WebCore::>::fromCallable): Deleted.
3049 2018-01-10 Simon Fraser <simon.fraser@apple.com>
3051 On macOS, getBoundingClientRect gives incorrect values when pinch-zoomed
3052 https://bugs.webkit.org/show_bug.cgi?id=181511
3053 rdar://problem/33741427
3055 Reviewed by Zalan Bujtas.
3057 When reverting "client coordinates are relative to layout viewport" in r219829
3058 I broke documentToClientOffset() on macOS by failing to take pinch zoom scale into
3059 account (frameScaleFactor() is always 1 on iOs, so this bug doesn't manifest there).
3061 Covered by existing tests.
3063 * page/FrameView.cpp:
3064 (WebCore::FrameView::documentToClientOffset const):
3066 2018-01-11 Youenn Fablet <youenn@apple.com>
3068 Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legacy flag by default
3069 https://bugs.webkit.org/show_bug.cgi?id=181480
3071 Reviewed by Eric Carlson.
3073 No change of behavior.
3075 * page/RuntimeEnabledFeatures.h: Set default value to false.
3077 2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
3079 [Attachment Support] Support moving attachment elements in editable areas using drag and drop
3080 https://bugs.webkit.org/show_bug.cgi?id=181337
3081 <rdar://problem/36324813>
3083 Reviewed by Tim Horton.
3085 Makes slight adjustments to attachment-specific drag and drop logic to ensure that moving attachments via drag
3086 and drop behaves correctly. See per-change comments for more detail.
3088 Tests: WKAttachmentTests.DragInPlaceVideoAttachmentElement
3089 WKAttachmentTests.MoveAttachmentElementAsIconByDragging
3090 WKAttachmentTests.MoveInPlaceAttachmentElementByDragging
3092 * editing/cocoa/EditorCocoa.mm:
3093 (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
3095 Stop vending the private web archive pasteboard type for attachments, for now. This works around issues where an
3096 attachment element that is dragged and dropped within the same page may lose its blob backing data if we try to
3097 remove and insert it as a fragment from the archive. Providing a web archive would allow us to avoid destroying
3098 and recreating an attachment element when dragging within the same page, but this is a nice-to-have optimization
3099 we can re-enable after investigation in a subsequent patch.
3101 * html/HTMLAttachmentElement.cpp:
3102 (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
3104 Add `draggable=false` to the image element of an in-place attachment element.
3106 * page/DragController.cpp:
3107 (WebCore::enclosingAttachmentElement):
3108 (WebCore::DragController::draggableElement const):
3110 Tweak single-selected-attachment handling to account for in-place attachments. Since the hit-tested node is
3111 inside the shadow subtree of the attachment element, the condition needs to check for the startElement as well
3112 as the startElement's shadow host.
3114 (WebCore::DragController::startDrag):
3116 Make two tweaks here. First, don't require a RenderAttachment to drag an attachment element (this is required
3117 for dragging in-place attachments). This was added in r217083 to address <rdar://problem/32282831>, but is no
3118 longer correct, since attachments may now be displayed in-place.
3120 Secondly, only restore the previous selection if the attachment is in a richly contenteditable area. This was
3121 added to prevent the selection highlight from appearing in when dragging non-editable attachment elements in the
3122 Mail viewer. However, to allow drag moves to occur, we need the selection to persist after drag start.
3124 2018-01-04 Filip Pizlo <fpizlo@apple.com>
3126 CodeBlocks should be in IsoSubspaces
3127 https://bugs.webkit.org/show_bug.cgi?id=180884
3129 Reviewed by Saam Barati.
3131 No new tests because no new behavior.
3133 Adopting new parallel constraint API, so that more of the logic of doing parallel
3134 constraint solving is shared between the DOM's output constraints and JSC's output
3137 * bindings/js/DOMGCOutputConstraint.cpp:
3138 (WebCore::DOMGCOutputConstraint::executeImpl):
3139 (WebCore::DOMGCOutputConstraint::doParallelWorkImpl): Deleted.
3140 (WebCore::DOMGCOutputConstraint::finishParallelWorkImpl): Deleted.
3141 * bindings/js/DOMGCOutputConstraint.h:
3143 2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
3145 [Attachment Support] Support dragging attachment elements out as files on iOS
3146 https://bugs.webkit.org/show_bug.cgi?id=181199
3147 <rdar://problem/36299316>
3149 Reviewed by Tim Horton, Andy Estes and Joseph Pecoraro.
3151 Adds support for dragging "files" (i.e. creating item providers with preferred attachment presentation styles)
3152 from attachment elements on iOS for Mail. See below for more detail.
3154 Tests: WKAttachmentTestsIOS.DragAttachmentInsertedAsData
3155 WKAttachmentTestsIOS.DragAttachmentInsertedAsFile
3157 * page/DragController.cpp:
3158 (WebCore::DragController::platformContentTypeForBlobType const):
3159 (WebCore::DragController::dragAttachmentElement):
3160 * page/DragController.h:
3161 * page/mac/DragControllerMac.mm:
3162 (WebCore::DragController::platformContentTypeForBlobType const):
3164 Add a private method to convert the type of a promised blob to a platform type. For Cocoa platforms, this
3165 converts the blob type (either a UTI or a MIME type) to a UTI for the platform to consume.
3167 * platform/ios/WebItemProviderPasteboard.h:
3168 * platform/ios/WebItemProviderPasteboard.mm:
3170 Refactor WebItemProviderRegistrationInfo. WebItemProviderRegistrationInfo currently encapsulates a single item
3171 provider registration call, and contains either a type identifier and data buffer, or an NSItemProviderWriting-
3172 conformant object. To register an item provider using a WebItemProviderRegistrationInfo, the item provider
3173 pasteboard currently checks to see whether the info contains an object or a type and data.
3175 This patch removes WebItemProviderRegistrationInfo and replaces it with WebItemProviderDataRegistrar. Objects
3176 that implement this protocol know how to take an NSItemProvider and register data to it. So far, there are
3177 three implementations below.
3179 (-[WebItemProviderDataRegistrar initWithData:type:]):
3180 (-[WebItemProviderDataRegistrar typeIdentifier]):
3181 (-[WebItemProviderDataRegistrar data]):
3182 (-[WebItemProviderDataRegistrar typeIdentifierForClient]):
3183 (-[WebItemProviderDataRegistrar dataForClient]):
3184 (-[WebItemProviderDataRegistrar registerItemProvider:]):
3185 (-[WebItemProviderDataRegistrar description]):
3187 A data registrar takes a UTI and data buffer, and registers the UTI to the data. This replaces a
3188 WebItemProviderRegistrationInfo with both a type and data, but no representing object.
3190 (-[WebItemProviderWritableObjectRegistrar initWithObject:]):
3191 (-[WebItemProviderWritableObjectRegistrar representingObjectForClient]):
3192 (-[WebItemProviderWritableObjectRegistrar registerItemProvider:]):
3193 (-[WebItemProviderWritableObjectRegistrar description]):
3195 The writable object registrar writes an NSItemProviderWriting-conformant object to an item provider. This
3196 replaces a WebItemProviderRegistrationInfo with only a representing object.
3198 (-[WebItemProviderPromisedFileRegistrar initWithType:callback:]):
3199 (-[WebItemProviderPromisedFileRegistrar registerItemProvider:]):
3200 (-[WebItemProviderPromisedFileRegistrar description]):
3201 (-[WebItemProviderRegistrationInfoList addData:forType:]):
3202 (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
3203 (-[WebItemProviderRegistrationInfoList addPromisedType:fileCallback:]):
3205 Helper methods to add new registrars to a registration info list.
3207 (-[WebItemProviderRegistrationInfoList itemAtIndex:]):
3208 (-[WebItemProviderRegistrationInfoList enumerateItems:]):
3209 (-[WebItemProviderRegistrationInfoList itemProvider]):
3210 (-[WebItemProviderRegistrationInfoList description]):
3211 (-[WebItemProviderRegistrationInfo initWithRepresentingObject:typeIdentifier:data:]): Deleted.
3212 (-[WebItemProviderRegistrationInfo representingObject]): Deleted.
3213 (-[WebItemProviderRegistrationInfo typeIdentifier]): Deleted.
3215 2018-01-11 Michael Saboff <msaboff@apple.com>
3217 Add a DOM gadget for Spectre testing
3218 https://bugs.webkit.org/show_bug.cgi?id=181351
3220 Reviewed by Ryosuke Niwa.
3222 This change is used to test Spectre mitigations.
3224 Added a new DOM class to test for Spectre issues in the DOM layer.
3225 This additional functionality is disabled by default and must be enabled
3226 through the JSC option "enableSpectreGadgets".
3229 * DerivedSources.make:
3231 * WebCore.xcodeproj/project.pbxproj:
3232 * bindings/js/WebCoreBuiltinNames.h:
3233 * dom/SpectreGadget.cpp: Added.
3234 (WebCore::SpectreGadget::SpectreGadget):
3235 (WebCore::SpectreGadget::create):
3236 (WebCore::SpectreGadget::setReadLength):
3237 (WebCore::SpectreGadget::charCodeAt):
3238 (WebCore::SpectreGadget::clflushReadLength):
3239 * dom/SpectreGadget.h: Added.
3240 * dom/SpectreGadget.idl: Added.
3241 * page/RuntimeEnabledFeatures.cpp:
3242 (WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const):
3243 * page/RuntimeEnabledFeatures.h:
3245 2018-01-11 Philippe Normand <pnormand@igalia.com>
3247 [GTK] media/muted-video-is-playing-audio.html is timing out
3248 https://bugs.webkit.org/show_bug.cgi?id=163781
3250 Reviewed by Carlos Garcia Campos.
3252 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3253 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Sprinkle some debugging.
3254 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
3255 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3256 (WebCore::MediaPlayerPrivateGStreamerBase::setMuted): Ditto.
3258 2018-01-10 Andy Estes <aestes@apple.com>
3260 [Payment Request] Rename ApplePayMerchantValidationEvent to MerchantValidationEvent
3261 https://bugs.webkit.org/show_bug.cgi?id=181437
3262 <rdar://problem/36376481>
3264 Reviewed by Tim Horton.
3266 Renamed ApplePayMerchantValidationEvent to MerchantValidationEvent and changed complete() to accept a Promise.
3268 Test: http/tests/paymentrequest/payment-request-merchant-validation.https.html
3270 * DerivedSources.make:
3271 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3272 (WebCore::ApplePayPaymentHandler::merchantValidationCompleted):
3273 (WebCore::ApplePayPaymentHandler::validateMerchant):
3274 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
3275 * Modules/paymentrequest/MerchantValidationEvent.cpp: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.cpp.
3276 (WebCore::MerchantValidationEvent::create):
3277 (WebCore::MerchantValidationEvent::MerchantValidationEvent):
3278 (WebCore::MerchantValidationEvent::eventInterface const):
3279 (WebCore::MerchantValidationEvent::complete):
3280 * Modules/paymentrequest/MerchantValidationEvent.h: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.h.
3281 * Modules/paymentrequest/MerchantValidationEvent.idl: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.idl.
3282 * Modules/paymentrequest/PaymentHandler.h:
3283 * Modules/paymentrequest/PaymentRequest.cpp:
3284 (WebCore::PaymentRequest::completeMerchantValidation):
3285 * Modules/paymentrequest/PaymentRequest.h:
3286 * Modules/paymentrequest/PaymentRequest.idl:
3287 * WebCore.xcodeproj/project.pbxproj:
3289 * dom/EventNames.in:
3291 2018-01-10 Basuke Suzuki <Basuke.Suzuki@sony.com>
3293 [Curl] Cross-protocol, cross-site scripting (XPXSS) using HTML forms
3294 Nhttps://bugs.webkit.org/show_bug.cgi?id=153088
3296 Reviewed by Alex Christensen.
3298 No new tests because it's covered by existing tests.
3300 * platform/network/curl/CurlContext.cpp:
3301 (WebCore::CurlHandle::getHttpVersion):
3302 * platform/network/curl/CurlContext.h:
3303 * platform/network/curl/CurlRequest.cpp:
3304 (WebCore::CurlRequest::didReceiveHeader):
3305 * platform/network/curl/CurlResponse.h:
3306 (WebCore::CurlResponse::isolatedCopy const):
3307 * platform/network/curl/ResourceResponseCurl.cpp:
3308 (WebCore::ResourceResponse::ResourceResponse):
3309 (WebCore::ResourceResponse::setStatusLine):
3311 2018-01-10 Wenson Hsieh <wenson_hsieh@apple.com>
3313 REGRESSION(r222507): Composition highlight doesn't render when using IME
3314 https://bugs.webkit.org/show_bug.cgi?id=181485
3315 <rdar://problem/35896516>
3317 Reviewed by Ryosuke Niwa.
3319 Fixes the order of arguments passed to paintTextSubrangeBackground from paintCompositionBackground.
3321 Test: editing/marked-text-appearance.html
3323 * rendering/InlineTextBox.cpp:
3324 (WebCore::InlineTextBox::paintCompositionBackground):
3326 2018-01-10 Youenn Fablet <youenn@apple.com>
3328 Use no-cache fetch mode when loading main documents with location.reload()
3329 https://bugs.webkit.org/show_bug.cgi?id=181285
3331 Reviewed by Alex Christensen.
3333 Covered by rebased tests.
3335 Start to translate cache policy used for navigation as FetchOptions::Cache.
3336 This allows ensuring service workers receive the right cache mode when intercepting navigation loads.
3337 To not change current navigation behavior, ReturnCacheDataElseLoad and ReturnCacheDataDontLoad still trigger default fetch cache mode.
3339 For Reload and ReloadExpiredOnly frame load types, using no-cache mode is more efficient than reload mode,
3340 as a conditional request will be sent if possible. This applies to location.reload which is consistent with other browsers.
3341 Keep reload mode for ReloadFromOrigin.
3343 * loader/DocumentLoader.cpp:
3344 (WebCore::toFetchOptionsCache):
3345 (WebCore::DocumentLoader::loadMainResource):
3346 * loader/FrameLoader.cpp:
3347 (WebCore::FrameLoader::loadFrameRequest):
3348 (WebCore::FrameLoader::loadURL):
3349 (WebCore::FrameLoader::load):
3350 (WebCore::FrameLoader::reload):
3351 (WebCore::FrameLoader::defaultRequestCachingPolicy):
3352 (WebCore::FrameLoader::loadDifferentDocumentItem):
3353 * loader/NavigationScheduler.cpp:
3355 2018-01-10 Commit Queue <commit-queue@webkit.org>
3357 Unreviewed, rolling out r226667 and r226673.
3358 https://bugs.webkit.org/show_bug.cgi?id=181488
3360 This caused a flaky crash. (Requested by mlewis13 on #webkit).
3362 Reverted changesets:
3364 "CodeBlocks should be in IsoSubspaces"
3365 https://bugs.webkit.org/show_bug.cgi?id=180884
3366 https://trac.webkit.org/changeset/226667
3368 "REGRESSION (r226667): CodeBlocks should be in IsoSubspaces"
3369 https://bugs.webkit.org/show_bug.cgi?id=180884
3370 https://trac.webkit.org/changeset/226673
3372 2018-01-10 Antti Koivisto <antti@apple.com>
3374 REGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
3375 https://bugs.webkit.org/show_bug.cgi?id=181460
3376 <rdar://problem/36379776>
3378 Reviewed by Ryosuke Niwa.
3380 * css/parser/CSSParser.cpp:
3381 (WebCore::CSSParserContext::CSSParserContext):
3383 Don't do the expensive security origin test if the sheet base URL and document URL are identical.
3384 This is true for inline style and inline stylesheets.
3386 2018-01-10 Antti Koivisto <antti@apple.com>
3388 Try to fix windows build.
3390 * css/RuleFeature.cpp:
3391 (WebCore::RuleFeatureSet::computeNextMatchElement):
3393 2018-01-10 Zalan Bujtas <zalan@apple.com>
3395 [RenderTreeBuilder] Move RenderRuby's moveChildren logic to RenderTreeBuilder
3396 https://bugs.webkit.org/show_bug.cgi?id=181470
3397 <rdar://problem/36397683>
3399 Reviewed by Antti Koivisto.
3401 This is about moving code, no cleanup and/or normalization (unfortunately it also means
3402 some temporary changes).
3404 No change in functionality.
3406 * rendering/RenderBlockFlow.h:
3407 * rendering/RenderRubyBase.cpp:
3408 (WebCore::RenderRubyBase::moveChildren): Deleted.
3409 (WebCore::RenderRubyBase::mergeChildrenWithBase): Deleted.
3410 (WebCore::RenderRubyBase::moveInlineChildren): Deleted.
3411 (WebCore::RenderRubyBase::moveBlockChildren): Deleted.
3412 * rendering/RenderRubyBase.h:
3413 * rendering/RenderRubyRun.cpp:
3414 (WebCore::RenderRubyRun::takeChild):
3415 * rendering/updating/RenderTreeBuilder.cpp:
3416 (WebCore::RenderTreeBuilder::moveRubyChildren):
3417 * rendering/updating/RenderTreeBuilder.h:
3418 * rendering/updating/RenderTreeBuilderRuby.cpp:
3419 (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
3420 (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
3421 (WebCore::RenderTreeBuilder::Ruby::moveChildren):
3422 (WebCore::RenderTreeBuilder::Ruby::moveChildrenInternal):
3423 (WebCore::RenderTreeBuilder::Ruby::insertChild):
3424 * rendering/updating/RenderTreeBuilderRuby.h:
3426 2018-01-10 Philippe Normand <pnormand@igalia.com>