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