1 2018-07-24 Eric Carlson <eric.carlson@apple.com>
3 [MediaStream] Restructure getDisplayMedia classes
4 https://bugs.webkit.org/show_bug.cgi?id=187905
5 <rdar://problem/42500215>
9 * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
11 2018-07-24 Antoine Quint <graouts@apple.com>
13 [Web Animations] Crash when setting "animation: none" after clearing an animation's effect
14 https://bugs.webkit.org/show_bug.cgi?id=187952
16 Reviewed by Dean Jackson.
18 Test: webanimations/setting-css-animation-none-after-clearing-effect.html
20 We need to ensure that the animation we're trying to remove has not had its effect cleared via the
21 Web Animations API since its creation before trying to check its phase.
23 * animation/AnimationTimeline.cpp:
24 (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
26 2018-07-24 Antoine Quint <graouts@apple.com>
28 [Web Animations] Crash accessing CSSAnimation::bindingsCurrentTime when effect has been set to null
29 https://bugs.webkit.org/show_bug.cgi?id=187950
30 <rdar://problem/42515747>
32 Reviewed by Dean Jackson.
34 Test: webanimations/accessing-current-time-after-clearing-css-animation-effect.html
36 While a CSSAnimation has an effect created for it by the implementation, the developer may yet manipulate
37 its effect via the Web Animations API and set it to null. As such, we must not assume it's always non-null.
39 * animation/CSSAnimation.cpp:
40 (WebCore::CSSAnimation::bindingsCurrentTime const):
42 2018-07-24 Zalan Bujtas <zalan@apple.com>
44 [LFC][IFC] BlockContainer::establishesInlineFormattingContext should only check the first inflow child.
45 https://bugs.webkit.org/show_bug.cgi?id=187965
47 Reviewed by Antti Koivisto.
49 * layout/layouttree/LayoutBlockContainer.cpp:
50 (WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):
52 2018-07-24 Myles C. Maxfield <mmaxfield@apple.com>
54 [Cocoa] Stop crashing in lastResortFallbackFont()
55 https://bugs.webkit.org/show_bug.cgi?id=187936
59 CoreText can get into a state where both Times and Lucida Grande are inaccessible.
60 Instead of crashing, we should use the real LastResort, which is backed by a section
61 in the .rodata of the CoreText dylib, and as such should always exist.
63 * platform/graphics/FontCache.cpp:
64 (WebCore::FontCache::fontForFamily):
65 * platform/graphics/cocoa/FontCacheCoreText.cpp:
66 (WebCore::FontCache::lastResortFallbackFont):
68 2018-07-24 Daniel Bates <dabates@apple.com>
70 Cannot view PDF's on my.gov.au: "Refused to load https://my.gov.au/attachment/viewAttachment because it
71 appears in neither the object-src directive nor the default-src directive of the Content Security Policy"
72 https://bugs.webkit.org/show_bug.cgi?id=187870
73 <rdar://problem/41190880>
75 Reviewed by Dean Jackson.
77 Fixes an issue where opening attachments on my.gov.au would show a "Blocked Plug-in" message.
79 Opening an attachment on my.gov.au opens a same-origin plugin document in a child window. Currently
80 same-origin plugin documents inherit their CSP policy from their opener. If the opener's CSP policy
81 disallows embedding plugins then the plugin document would be blocked from loading a plugin. For now
82 we relax the inheritance model such that we only inherit the plugin-types and report-uri directives
85 Developers that want to block plugin content from being loaded in a same-origin child window must now
86 serve such plugin content with a CSP policy that includes "object-src 'none'". This matches the behavior
87 described in the second Note in section object-src of the CSP 3 spec: <https://w3c.github.io/webappsec-csp/#directive-object-src>
88 (Editor's Draft, 10 July 2018). It also makes the behavior in WebKit more closely aligned with the
89 behavior of Chrome and Firefox.
91 Tests: http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window.html
92 http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report.php
93 http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window.html
96 (WebCore::Document::initContentSecurityPolicy): For plugin documents that have an opener call ContentSecurityPolicy::createPolicyForPluginDocumentFrom()
97 to only inherit the plugin-types and report-uri directives from its opener's CSP policy. Otherwise, call ContentSecurityPolicy::copyStateFrom()
98 to inherit all directives from the owner frame as we do now.
99 * page/csp/ContentSecurityPolicy.cpp:
100 (WebCore::ContentSecurityPolicy::createPolicyForPluginDocumentFrom): Create a new policy from the specified policy
101 inheriting only the plugin-types and report-uri directives.
102 * page/csp/ContentSecurityPolicy.h: Define a new PolicyFrom enumerator, InheritedForPluginDocument, for plugin documents
103 loaded in a child window.
104 * page/csp/ContentSecurityPolicyDirectiveList.cpp:
105 (WebCore::ContentSecurityPolicyDirectiveList::parse): When policyFrom is InheritedForPluginDocument then only
106 recognize the plugin-types and report-uri directives when parsing the policy.
108 2018-07-24 Daniel Bates <dabates@apple.com>
110 Rename Document::firstPartyForSameSiteCookies() to siteForCookies()
111 https://bugs.webkit.org/show_bug.cgi?id=187892
113 Reviewed by Dean Jackson.
115 Standardize on the spec. language "site for cookies" for the names of the setter and getter
116 on Document. The latest description of Same-Site cookies is in <https://httpwg.org/http-extensions/rfc6265bis.html>.
118 No functionality changed. So, no new tests.
121 (WebCore::Document::siteForCookies const):
122 (WebCore::Document::setSiteForCookies):
123 (WebCore::Document::firstPartyForSameSiteCookies const): Deleted.
124 (WebCore::Document::setFirstPartyForSameSiteCookies): Deleted.
125 * loader/FrameLoader.cpp:
126 (WebCore::FrameLoader::setFirstPartyForCookies):
127 (WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded):
128 * workers/service/context/ServiceWorkerThreadProxy.cpp:
129 (WebCore::createPageForServiceWorker):
130 * xml/XSLTProcessor.cpp:
131 (WebCore::XSLTProcessor::createDocumentFromSource):
133 2018-07-24 Ross Kirsling <ross.kirsling@sony.com>
135 WebCore::URL::hostIsIPAddress needs a Windows implementation
136 https://bugs.webkit.org/show_bug.cgi?id=187859
138 Reviewed by Fujii Hironori.
141 (WebCore::isIPv4Address): Added.
142 (WebCore::isIPv6Address): Added.
143 (WebCore::URL::hostIsIPAddress):
144 Turn this stub into a platform-agnostic default implementation.
146 2018-07-24 Eric Carlson <eric.carlson@apple.com>
148 [MediaStream] Restructure getDisplayMedia classes
149 https://bugs.webkit.org/show_bug.cgi?id=187905
151 Reviewed by Dean Jackson.
153 No new tests, no functional changes.
155 * platform/mediastream/CaptureDeviceManager.h:
156 (WebCore::CaptureDeviceManager::refreshCaptureDevices): Deleted, no need for it to be a
158 * platform/mediastream/mac/AVCaptureDeviceManager.h:
160 * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: refreshCaptureDevices is
163 * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
164 (WebCore::DisplayCaptureManagerCocoa::captureDevices):
165 (WebCore::DisplayCaptureManagerCocoa::updateDisplayCaptureDevices): Moved functionality
166 to ScreenDisplayCaptureSourceMac.
167 (WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID): Ditto.
168 (WebCore::displayReconfigurationCallBack): Deleted, moved to ScreenDisplayCaptureSourceMac.
169 (WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa): Deleted.
170 (WebCore::DisplayCaptureManagerCocoa::refreshCaptureDevices): Deleted.
171 * platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
173 * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
174 (WebCore::roundUpToMacroblockMultiple): Moved from ScreenDisplayCaptureSourceMac.
175 (WebCore::DisplayCaptureSourceCocoa::applySize): Ditto.
176 (WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Ditto.
177 (WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Ditto.
178 * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
180 * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
181 * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
182 (WebCore::updateDisplayID):
183 (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Fix log message.
184 (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
185 (WebCore::ScreenDisplayCaptureSourceMac::applySize): Update for base class changes.
186 (WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate): Ditto.
187 (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
188 (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDeviceWithPersistentID): Moved from
189 DisplayCaptureManagerCocoa.
190 (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices): Ditto.
191 (WebCore::roundUpToMacroblockMultiple): Moved to DisplayCaptureSourceCocoa.
192 (WebCore::ScreenDisplayCaptureSourceMac::updateDisplayID): Ditto.
193 (WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer): Ditto.
194 (WebCore::ScreenDisplayCaptureSourceMac::pixelBufferFromIOSurface): Ditto.
196 2018-07-24 Zalan Bujtas <zalan@apple.com>
198 [LFC] Move geometry data structures to a dedicated file
199 https://bugs.webkit.org/show_bug.cgi?id=187939
201 Reviewed by Antti Koivisto.
203 * WebCore.xcodeproj/project.pbxproj:
204 * layout/FormattingContext.h:
205 (WebCore::Layout::FormattingContext::Geometry::Position::operator LayoutPoint const): Deleted.
206 * layout/FormattingContextGeometry.cpp:
207 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
208 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
209 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
210 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
211 (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
212 (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
213 (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
214 (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
215 (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
216 (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
217 (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
218 (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
219 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
220 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
221 (WebCore::Layout::FormattingContext::Geometry::computedBorder):
222 (WebCore::Layout::FormattingContext::Geometry::computedPadding):
223 (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
224 (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
225 * layout/blockformatting/BlockFormattingContext.h:
226 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
227 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
228 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
229 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
230 (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
231 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
232 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
233 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
234 * layout/displaytree/DisplayBox.h:
235 (WebCore::Display::Box::setHorizontalMargin):
236 (WebCore::Display::Box::setVerticalMargin):
237 (WebCore::Display::Box::setVerticalNonCollapsedMargin):
238 (WebCore::Display::Box::setBorder):
239 (WebCore::Display::Box::setPadding):
241 2018-07-24 Thibault Saunier <tsaunier@igalia.com>
243 [GStreamer] Implement bitrate modulation support in GStreamer based libwebrtc Encoders
244 https://bugs.webkit.org/show_bug.cgi?id=187643
246 Reviewed by Philippe Normand.
248 Problem being that we do not have a proper unified encoder API in GStreamer, some work
249 started at https://bugzilla.gnome.org/show_bug.cgi?id=796716 but it is quite controversial
250 and meanwhile we should just move forward working around that limitation.
253 * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
254 (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
255 (WebCore::GStreamerVideoEncoder::InitEncode):
256 (WebCore::GStreamerVideoEncoder::getBitrateSetter):
257 (WebCore::GStreamerVideoEncoder::createEncoder):
258 (WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
259 (WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
260 (WebCore::GStreamerVideoEncoder::CreateEncoder): Deleted.
262 2018-07-24 Zan Dobersek <zdobersek@igalia.com>
264 REGRESSION(r234055): inverted return values in MediaPlayer::wouldTaintOrigin()
265 https://bugs.webkit.org/show_bug.cgi?id=187944
267 Reviewed by Carlos Garcia Campos.
269 The MediaPlayer::wouldTaintOrigin(), as introduced in r234055, should
270 return false when the URL protocol is `data:`, and should return true
271 when the given SecurityOrigin cannot access the media URL.
273 This matches behavior of CanvasRenderingContext::wouldTaintOrigin()
274 which the new method falls back to when the MediaPlayerPrivate
275 implementation doesn't or can't determine the would-taint result.
277 This fixes a bunch of failing and timing-out WebGL test cases on ports
278 using GStreamer (on which the MediaPlayerPrivate derivate doesn't
279 implement the wouldTaintOrigin() method).
281 * platform/graphics/MediaPlayer.cpp:
282 (WebCore::MediaPlayer::wouldTaintOrigin const):
284 2018-07-24 Zan Dobersek <zdobersek@igalia.com>
286 [TextureMapper] Separate repaint counter state from debug visuals
287 https://bugs.webkit.org/show_bug.cgi?id=187946
289 Reviewed by Carlos Garcia Campos.
291 Instead of managing the repaint counter visibility along with the
292 debug border visuals, do that together with the repaint count value.
294 TextureMapperLayer::setRepaintCount() is renamed to setRepaintCounter()
295 and now also sets the repaint counter visibility state instead of the
296 setDebugVisuals() method.
298 GraphicsLayerTextureMapper implementation is adjusted appropriately.
299 The unused setRepaintCount() method is also removed.
301 CoordinatedGraphicsLayerState now holds repaint counter state (both
302 visibility and count value) in a struct that's separate from debug
303 border state. CoordinatedGraphicsLayer implementation now updates
304 that state accordingly.
306 No new tests -- no change in behavior.
308 * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
309 (WebCore::GraphicsLayerTextureMapper::setShowRepaintCounter):
310 (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
311 (WebCore::GraphicsLayerTextureMapper::setRepaintCount): Deleted.
312 * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
313 * platform/graphics/texmap/TextureMapperLayer.cpp:
314 (WebCore::TextureMapperLayer::setDebugVisuals):
315 (WebCore::TextureMapperLayer::setRepaintCounter):
316 (WebCore::TextureMapperLayer::setRepaintCount): Deleted.
317 * platform/graphics/texmap/TextureMapperLayer.h:
318 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
319 (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
320 (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
321 (WebCore::CoordinatedGraphicsLayer::syncLayerState):
322 * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
323 (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
324 (WebCore::DebugVisuals::DebugVisuals): Deleted.
326 2018-07-24 Thibault Saunier <tsaunier@igalia.com>
328 [WPE][GTK] Implement PeerConnection API on top of libwebrtc
329 https://bugs.webkit.org/show_bug.cgi?id=186932
331 Reviewed by Philippe Normand.
333 Enabled many webrtc tests.
335 * platform/GStreamer.cmake: Build new files
336 * platform/graphics/gstreamer/GStreamerCommon.cpp: Fix minor style issues
337 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Add a way to give precise name to pipelines
338 and give useful names to pipelines with sources comming from a PeerConnection
339 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.
340 * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: Added. Implement a subclass of webrtc::VideoFrame
341 to represent a kNative GStreamer video frame.
342 * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: Added. Ditto.
343 * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp: Handle incoming audio samples from libwebrtc.
344 * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.h: Ditto.
345 * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp: Handle incoming video frames from libwebrtc.
346 * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.h: Ditto.
347 * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: Handle passing locally captured audio sample to libwebrtc.
348 * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: Ditto.
349 * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp: Handle passing locally captured vidoe frames to libwebrtc.
350 * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: Added. Implement a video decoder factory and LibWebRTC Video decoders based on GStreamer.
351 * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.h: Added. Ditto.
352 * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Added. Implement a video encoder factory and LibWebRTC H264/VP8 Video encoders based on GStreamer.
353 * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: Added. Ditto.
354 * platform/mediastream/libwebrtc/LibWebRTCAudioFormat.h: Add information about signness of the LibWebRTC audio format.
355 * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: Add support for newly added Encoder/Decoder factories.
356 * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h: Ditto.
358 2018-07-24 Dirk Schulze <krit@webkit.org>
360 [css-masking] Black backdrop on -webkit-clip-path on SVG root
361 https://bugs.webkit.org/show_bug.cgi?id=187880
363 Reviewed by Simon Fraser.
365 For SVG document root elements, we currently clip twice:
366 In RenderLayer and SVGRenderSupport.
367 Avoid clipping in RenderLayer which currently clips before we established a
368 backdrop for an SVG document.
370 Tests: svg/clip-path/clip-path-on-svg-005-expected.svg
371 svg/clip-path/clip-path-on-svg-005.svg
373 * rendering/RenderLayer.cpp:
374 (WebCore::RenderLayer::setupClipPath): Skip actual clipping.
376 2018-07-24 Zan Dobersek <zdobersek@igalia.com>
378 [Nicosia] Add TextureMapperAnimations member to CompositingLayer::LayerState
379 https://bugs.webkit.org/show_bug.cgi?id=187941
381 Reviewed by Carlos Garcia Campos.
383 Nicosia::CompositingLayer::LayerState gains a TextureMapperAnimations
384 member that will be assigned a list of all active animations during each
385 layer flush. Despite the name, TextureMapperAnimations doesn't depend on
386 any other TextureMapper class. It might be renamed and moved in the
387 future, but for now it's used as-is.
389 In CoordinatedGraphicsLayer, the syncAnimations() method now flips on
390 the animationsChanged flag in the LayerState::Delta struct. This causes
391 all the active animations to be copied over into the layer state in
392 flushCompositingStateForThisLayerOnly().
394 * platform/graphics/nicosia/NicosiaPlatformLayer.h:
395 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
396 (WebCore::CoordinatedGraphicsLayer::syncAnimations):
397 (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
399 2018-07-24 Zan Dobersek <zdobersek@igalia.com>
401 [Nicosia] Add FilterOperations member to CompositionLayer::LayerState
402 https://bugs.webkit.org/show_bug.cgi?id=187901
404 Reviewed by Carlos Garcia Campos.
406 Nicosia::CompositionLayer::LayerState gains a FilterOperations member
407 that can be assigned the list of filter operations for a given layer.
408 The corresponding filtersChanged boolean is added to LayerState::Delta.
410 CoordinatedGraphicsLayer::syncFilters() flips on that delta member,
411 which in turn causes the FilterOperations value to be updated during
412 the layer flush, in flushCompositingStateForThisLayerOnly().
414 * platform/graphics/nicosia/NicosiaPlatformLayer.h:
415 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
416 (WebCore::CoordinatedGraphicsLayer::syncFilters):
417 (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
419 2018-07-24 Zan Dobersek <zdobersek@igalia.com>
421 [CoordGraphics] Use adjusted position, anchor point, size values for Nicosia::CompositionLayer state
422 https://bugs.webkit.org/show_bug.cgi?id=187899
424 Reviewed by Carlos Garcia Campos.
426 As is done for the CoordinatedGraphicsLayerState, the scale-adjusted
427 position, anchor point and size values should be used when updating the
428 corresponding Nicosia::CompositionLayer::LayerState members.
430 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
431 (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
433 2018-07-23 Manuel Rego Casasnovas <rego@igalia.com>
435 [css-grid] Add support for calc() in gutter properties
436 https://bugs.webkit.org/show_bug.cgi?id=187902
438 Reviewed by Simon Fraser.
440 The parsing was already accepting calc() in grid row and column gaps,
441 however the code was not taking that into account properly.
442 If the calc() had a percentage it was ignored and that's wrong.
444 The fix is just a change in the ceck at RenderGrid::availableSpaceForGutters().
446 Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002-rtl.html
447 imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002.html
448 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-011.html
449 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-012.html
451 * rendering/RenderGrid.cpp:
452 (WebCore::RenderGrid::availableSpaceForGutters const):
454 2018-07-23 Aditya Keerthi <akeerthi@apple.com>
456 Remove extraneous #endif in html.css
457 https://bugs.webkit.org/show_bug.cgi?id=187934
459 Reviewed by Tim Horton.
461 * css/html.css: Remove extraneous #endif.
463 2018-07-23 Sihui Liu <sihui_liu@apple.com>
465 CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
466 https://bugs.webkit.org/show_bug.cgi?id=187927
468 Reviewed by Chris Dumez.
470 IDBKeyData is valid only when each key of it is valid.
472 Test: LayoutTests/storage/indexeddb/index-multientry.html
474 * Modules/indexeddb/IDBKeyData.cpp:
475 (WebCore::IDBKeyData::isValid const):
476 * Modules/indexeddb/IDBKeyData.h:
477 (WebCore::IDBKeyData::isValid const): Deleted.
479 2018-07-23 Ben Richards <benton_richards@apple.com>
481 We should cache the compiled sandbox profile in a data vault
482 https://bugs.webkit.org/show_bug.cgi?id=184991
484 Reviewed by Ryosuke Niwa.
486 Added functionality to FileHandle so that it can lock a file while open.
487 Added a function to FileSystem to delete non empty directories.
489 * platform/FileHandle.cpp:
490 (WebCore::FileHandle::FileHandle):
491 (WebCore::FileHandle::open):
492 (WebCore::FileHandle::close):
493 * platform/FileHandle.h:
494 * platform/FileSystem.h:
495 * platform/cocoa/FileSystemCocoa.mm:
496 (WebCore::FileSystem::deleteNonEmptyDirectory):
498 2018-07-23 Justin Fan <justin_fan@apple.com>
500 [macOS] Ensure that WebGL contexts are always set to an accelerated virtual screen
501 https://bugs.webkit.org/show_bug.cgi?id=187923
503 Reviewed by Dean Jackson.
505 On eGPU displays, it is possible that CGL does not match the preferred renderer.
506 In this case, and when the web process is blocked from accessing the window server,
507 3D contexts *may* default to the software renderer. Ensure that even if this occurs,
508 we set the context to use a hardware-accelerated renderer/virtual screen.
510 No new tests. Existing behavior covered by existing tests.
511 Requires multiple screens, at least one attached to an eGPU, to stress.
513 * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
514 (WebCore::identifyAndSetCurrentGPU):
516 2018-07-23 Sam Weinig <sam@webkit.org>
518 Convert some obvious never-null pointers to references in the editing code
519 https://bugs.webkit.org/show_bug.cgi?id=187914
521 Reviewed by Dean Jackson.
523 Fixup trivial cases of never-null pointers that really should be references.
525 * editing/ApplyStyleCommand.cpp:
526 (WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
527 (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
528 (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
529 (WebCore::ApplyStyleCommand::removeCSSStyle):
530 (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
531 (WebCore::ApplyStyleCommand::applyInlineStyleChange):
532 * editing/EditingStyle.cpp:
533 (WebCore::EditingStyle::overrideWithStyle):
534 (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
535 (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement const):
536 (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes const):
537 (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes const):
538 (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode const):
539 (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
540 (WebCore::EditingStyle::mergeInlineStyleOfElement):
541 (WebCore::EditingStyle::wrappingStyleForSerialization):
542 (WebCore::EditingStyle::legacyFontSize const):
543 (WebCore::StyleChange::StyleChange):
544 (WebCore::StyleChange::extractTextStyles):
545 (WebCore::legacyFontSizeFromCSSValue):
546 * editing/EditingStyle.h:
547 (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
548 * editing/Editor.cpp:
549 (WebCore::Editor::selectionStartCSSPropertyValue):
550 * editing/ReplaceSelectionCommand.cpp:
551 (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
552 (WebCore::isInlineNodeWithStyle):
553 * editing/markup.cpp:
554 (WebCore::StyledMarkupAccumulator::appendElement):
555 (WebCore::StyledMarkupAccumulator::serializeNodes):
557 2018-07-23 Per Arne Vollan <pvollan@apple.com>
559 WebCore::primaryScreenDisplayID() always return 0
560 https://bugs.webkit.org/show_bug.cgi?id=187922
561 <rdar://problem/42286933>
563 Reviewed by Geoffrey Garen.
565 This function should return a valid display ID.
567 No new tests. Testing this requires a dual monitor setup.
569 * platform/mac/PlatformScreenMac.mm:
570 (WebCore::primaryScreenDisplayID):
572 2018-07-23 Nan Wang <n_wang@apple.com>
574 AX: Press tab to highlight items on a webpage is not working with voiceover enabled
575 https://bugs.webkit.org/show_bug.cgi?id=187824
577 Reviewed by Zalan Bujtas.
579 We are deferring posting focused element change notification when the document needs a
580 style recalculation. However, we only perform the cache update after a layout is completed.
581 Added a timer to perform the cache update in the next runloop when non-layout type of mutation
584 Test: accessibility/mac/tab-focus-post-notification.html
586 * accessibility/AXObjectCache.cpp:
587 (WebCore::AXObjectCache::AXObjectCache):
588 (WebCore::AXObjectCache::~AXObjectCache):
589 (WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
590 (WebCore::AXObjectCache::performCacheUpdateTimerFired):
591 * accessibility/AXObjectCache.h:
592 (WebCore::AXObjectCache::AXObjectCache):
593 (WebCore::AXObjectCache::performCacheUpdateTimerFired):
595 2018-07-23 Chris Dumez <cdumez@apple.com>
597 WebResourceLoadStatisticsStore fails to unregister itself as a MessageReceiver in its destructor
598 https://bugs.webkit.org/show_bug.cgi?id=187910
599 <rdar://problem/42356526>
601 Reviewed by Brent Fulgham.
603 Add internals API that causes the ResourceLoadObserver to notify its observer, and avoid waiting
604 for the 5 second delay.
606 * testing/Internals.cpp:
607 (WebCore::Internals::notifyResourceLoadObserver):
608 * testing/Internals.h:
609 * testing/Internals.idl:
611 2018-07-23 Zalan Bujtas <zalan@apple.com>
613 [LCF][IFC] Add support for hyphenation.
614 https://bugs.webkit.org/show_bug.cgi?id=187913
616 Reviewed by Antti Koivisto.
618 Move the hyphenation logic over from SimpleLineLayout::TextFragmentIterator.
620 * layout/inlineformatting/textlayout/Runs.h:
621 (WebCore::Layout::TextRun::hasHyphen const):
622 (WebCore::Layout::LayoutRun::setHasHyphen):
623 (WebCore::Layout::LayoutRun::hasHyphen const):
624 (WebCore::Layout::LayoutRun::LayoutRun):
625 (WebCore::Layout::TextRun::createNonWhitespaceRunWithHyphen):
626 (WebCore::Layout::TextRun::TextRun):
627 * layout/inlineformatting/textlayout/TextContentProvider.cpp:
628 (WebCore::Layout::TextContentProvider::findTextItemSlow const):
629 (WebCore::Layout::TextContentProvider::width const):
630 (WebCore::Layout::TextContentProvider::hyphenPositionBefore const):
631 * layout/inlineformatting/textlayout/TextContentProvider.h:
632 * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
633 (WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
634 (WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
635 (WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
636 (WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
637 (WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
638 (WebCore::Layout::SimpleLineBreaker::Line::append):
639 (WebCore::Layout::SimpleLineBreaker::Line::reset):
640 (WebCore::Layout::SimpleLineBreaker::Style::Style):
641 (WebCore::Layout::SimpleLineBreaker::handleLineEnd):
642 (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
643 (WebCore::Layout::SimpleLineBreaker::hyphenPositionBefore const):
644 (WebCore::Layout::SimpleLineBreaker::adjustSplitPositionWithHyphenation const):
645 (WebCore::Layout::SimpleLineBreaker::split const):
646 * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
648 2018-07-23 Antoine Quint <graouts@apple.com>
650 [Web Animations] Querying the current time of a finished CSSAnimation after removing its target leads to a crash
651 https://bugs.webkit.org/show_bug.cgi?id=187906
653 Reviewed by Dean Jackson.
655 Test: webanimations/accessing-current-time-after-finished-css-animation-target-removal.html
657 Because we carelessly look at a CSSAnimation's effect's timing in DeclarativeAnimation::bindingsCurrentTime
658 without checking that the effect is non-null, we can crash in the case where the animation is finished and
659 its target element has been removed, which caused the effect to be set to null.
661 We do not actually fix the lack of a null check, which will be the scope of a different patch, but instead
662 ensure that we do _not_ set the animation's effect to null when its target is removed, which used to be
663 performed via a call to WebAnimation::remove(). Instead, we introduce AnimationTimeline::elementWasRemoved()
664 which notifies the timeline of an element being removed such that we may stop referencing any animation
665 targeting this element from the various data structures holding strong references to the animation in question,
666 and we then cancel the animation silently, which is a new option that ensures promises aren't resolved or
667 rejected as a result.
669 Finally, the WebAnimation and AnimationEffectReadOnly classes established a ref-cycle as WebAnimation has
670 `RefPtr<AnimationEffectReadOnly> m_effect` and AnimationEffectReadOnly has `RefPtr<WebAnimation> m_animation`.
671 While it is correct that WebAnimation owns its effect, which is established by the DOM API, the
672 reverse is not correct since we only hold the reverse internally for the benefit of our implementation.
673 As such, we change AnimationEffectReadOnly's m_animation to be a WeakPtr<WebAnimation>. This means not
674 calling WebAnimation::remove() and simply removing the animation from the animation maps on the timeline
675 is sufficient to guarantee that the document timeline will not leak (and with it the document).
677 * animation/AnimationEffectReadOnly.h:
678 (WebCore::AnimationEffectReadOnly::setAnimation):
679 * animation/AnimationTimeline.cpp:
680 (WebCore::AnimationTimeline::elementWasRemoved):
681 * animation/AnimationTimeline.h:
682 * animation/WebAnimation.cpp:
683 (WebCore::WebAnimation::cancel):
684 (WebCore::WebAnimation::resetPendingTasks):
685 * animation/WebAnimation.h:
687 (WebCore::Element::removedFromAncestor):
688 * rendering/updating/RenderTreeUpdater.cpp:
689 (WebCore::RenderTreeUpdater::tearDownRenderers):
691 2018-07-23 Aditya Keerthi <akeerthi@apple.com>
693 [iOS] Add support for input[type=color]
694 https://bugs.webkit.org/show_bug.cgi?id=187871
696 Reviewed by Tim Horton.
698 * css/html.css: Remove unwanted styling for color inputs with a list attribute.
699 * html/ColorInputType.cpp: Make the element focusable.
700 (WebCore::ColorInputType::isMouseFocusable const):
701 (WebCore::ColorInputType::isKeyboardFocusable const):
702 * html/ColorInputType.h:
703 * html/HTMLInputElement.h: Expose isColorControl() to WebKit.
705 (WebCore::Chrome::createColorChooser):
707 2018-07-22 Dean Jackson <dino@apple.com>
709 fullscreen env() variables should have initial values
710 https://bugs.webkit.org/show_bug.cgi?id=187897
711 <rdar://problem/42485682>
713 Reviewed by Sam Weinig.
715 The env() values for fullscreen properties need to be
716 initialized, rather than wait for values to be set from WebKit.
717 Without this, feature detection doesn't work, and properties
718 won't parse correctly.
720 Test: fullscreen/fullscreen-env-initial.html
722 * dom/ConstantPropertyMap.cpp:
723 (WebCore::ConstantPropertyMap::buildValues): Initialize the fullscreen values.
724 (WebCore::ConstantPropertyMap::updateConstantsForFullscreen): Renamed function, because it
725 also updates the duration value.
726 (WebCore::ConstantPropertyMap::didChangeFullscreenInsets): Call new name.
727 (WebCore::ConstantPropertyMap::updateConstantsForFullscreenInsets): Deleted.
728 * dom/ConstantPropertyMap.h:
730 (WebCore::Page::setFullscreenAutoHideDuration): Don't change the value if it doesn't need it.
731 * page/Page.h: Add accessor for fullscreenAutoHideDuration. Also add a member variable.
732 (WebCore::Page::fullscreenAutoHideDuration const):
734 2018-07-22 Zalan Bujtas <zalan@apple.com>
736 [LFC][IFC] Add center/right/justify line alignment support.
737 https://bugs.webkit.org/show_bug.cgi?id=187890
739 Reviewed by Antti Koivisto.
741 Move over some more code from simple line layout.
742 (though text-align: justify is more preformant as now expansion opportunities are added as we process the text runs
743 -as opposed to iterting through the runs again when we reach the end of the line.)
745 * layout/inlineformatting/textlayout/Runs.h:
746 (WebCore::Layout::LayoutRun::setLeft):
747 (WebCore::Layout::LayoutRun::setExpansion):
748 * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
749 (WebCore::Layout::SimpleLineBreaker::Line::Line):
750 (WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
751 (WebCore::Layout::SimpleLineBreaker::Line::adjustedLeftForTextAlign const):
752 (WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
753 (WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
754 (WebCore::Layout::expansionOpportunity):
755 (WebCore::Layout::expansionBehavior):
756 (WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
757 (WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
758 (WebCore::Layout::SimpleLineBreaker::Line::append):
759 (WebCore::Layout::SimpleLineBreaker::Line::collapseTrailingWhitespace):
760 (WebCore::Layout::SimpleLineBreaker::Line::reset):
761 (WebCore::Layout::SimpleLineBreaker::Style::Style):
762 (WebCore::Layout::SimpleLineBreaker::handleLineEnd):
763 (WebCore::Layout::SimpleLineBreaker::handleLineStart):
764 (WebCore::Layout::isTextAlignRight):
765 (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
766 * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
767 (WebCore::Layout::SimpleLineBreaker::Line::setAvailableWidth):
768 (WebCore::Layout::SimpleLineBreaker::Line::setCollapseWhitespace):
770 2018-07-21 Zalan Bujtas <zalan@apple.com>
772 [LFC][IFC] Add verification for inline text runs.
773 https://bugs.webkit.org/show_bug.cgi?id=187879
775 Reviewed by Antti Koivisto.
777 * layout/Verification.cpp:
778 (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
779 (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
780 (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
781 (WebCore::Layout::verifyAndOutputSubtree):
782 (WebCore::Layout::outputMismatchingBoxInformationIfNeeded): Deleted.
783 * layout/inlineformatting/InlineFormattingContext.cpp:
784 (WebCore::Layout::InlineFormattingContext::layout const):
785 * layout/inlineformatting/InlineFormattingState.h:
786 (WebCore::Layout::InlineFormattingState::addLayoutRuns):
787 (WebCore::Layout::InlineFormattingState::layoutRuns const):
788 * layout/layouttree/LayoutTreeBuilder.cpp:
789 (WebCore::Layout::outputLayoutBox):
790 (WebCore::Layout::outputLayoutTree):
791 (WebCore::Layout::TreeBuilder::showLayoutTree):
793 2018-07-21 Zalan Bujtas <zalan@apple.com>
795 [LFC] Do not use virtual methods to construct floating/formatting states.
796 https://bugs.webkit.org/show_bug.cgi?id=187875
798 Reviewed by Antti Koivisto.
800 LayoutContext::establishedFormattingState() does not require FormattingContext anymore only the root of the context.
802 * layout/FormattingContext.cpp:
803 (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
804 * layout/FormattingContext.h:
805 * layout/LayoutContext.cpp:
806 (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
807 (WebCore::Layout::LayoutContext::formattingStateForBox const):
808 (WebCore::Layout::LayoutContext::establishedFormattingState):
809 * layout/LayoutContext.h:
810 * layout/blockformatting/BlockFormattingContext.cpp:
811 (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
812 (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
813 (WebCore::Layout::BlockFormattingContext::createFormattingState const): Deleted.
814 (WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const): Deleted.
815 * layout/blockformatting/BlockFormattingContext.h:
816 * layout/inlineformatting/InlineFormattingContext.cpp:
817 (WebCore::Layout::InlineFormattingContext::createFormattingState const): Deleted.
818 (WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const): Deleted.
819 * layout/inlineformatting/InlineFormattingContext.h:
821 2018-07-21 Zalan Bujtas <zalan@apple.com>
823 [LFC][BFC] Do not collapse top/bottom margin with first/last inflow child from a non-block formatting context.
824 https://bugs.webkit.org/show_bug.cgi?id=187867
826 Reviewed by Antti Koivisto.
828 The box's top/bottom margin never collapses with a non-block inflow child.
830 * layout/blockformatting/BlockMarginCollapse.cpp:
831 (WebCore::Layout::isMarginTopCollapsedWithSibling):
832 (WebCore::Layout::isMarginBottomCollapsedWithSibling):
833 (WebCore::Layout::isMarginTopCollapsedWithParent):
834 (WebCore::Layout::isMarginBottomCollapsedThrough):
835 (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
836 (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop):
837 (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop):
838 (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom):
839 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
840 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
841 (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
842 (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
843 (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom):
844 * layout/layouttree/LayoutBox.cpp:
845 (WebCore::Layout::Box::establishesBlockFormattingContextOnly const): <div style="overflow: hidden">foobar</div> establishes both inline and block formatting context (inline wins though).
846 * layout/layouttree/LayoutBox.h: establishesBlockFormattingContext() does not need to be virtual since we can determine it by looking at the box's style. -while in case
847 of inline formatting context, it is about the content.
849 2018-07-20 Jer Noble <jer.noble@apple.com>
851 REGRESSION (r233974): Cannot close pip'd video; pops back into PiP.
852 https://bugs.webkit.org/show_bug.cgi?id=187873
856 When the PIP machinery on Mac wants to close the PIP window (due to the close button being clicked), it does
857 not consult our -shouldClosePiP handler; it just tells us that we're going to close. So we never setup the
858 necessary state on the WebProcess side and still think that our "targetIsFullscreen". When we get the "stop"
859 action, just request exit fullscreen, but set up the _pipState to think we're already exiting (because we are).
861 * platform/mac/VideoFullscreenInterfaceMac.mm:
862 (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
864 2018-07-20 Justin Fan <justin_fan@apple.com>
866 Safari WebGL does not consistently provide correct GPU context on eGPU systems
867 https://bugs.webkit.org/show_bug.cgi?id=187750
868 <rdar://problem/39531436>
870 Reviewed by Dean Jackson.
872 Move GraphicsContext3DManager into its own class, and notify it when page/Chrome receives a
873 windowScreenDidChange message. Add a private data struct to track which hostWindow created each context.
874 Upon notification, Manager updates the contexts that match the hostWindow with the
875 provided displayID. Each context matches displayID to rendererID (set during process creation
876 if window server is blocked), which is matched to a virtual screen, and updates its GPU accordingly.
878 No new tests. This requires multiple GPUs or eGPUs, each with attached display(s), to test.
880 * WebCore.xcodeproj/project.pbxproj:
882 (WebCore::Chrome::windowScreenDidChange): Now calls GraphicsContext3DManager::screenDidChange().
883 * platform/PlatformScreen.h:
884 * platform/ScreenProperties.h: Add rendererID to struct.
885 (WebCore::ScreenData::encode const):
886 (WebCore::ScreenData::decode):
887 * platform/graphics/GraphicsContext3D.h:
888 * platform/graphics/GraphicsContext3DManager.cpp: Added (copied out of GraphicsContext3DCocoa.mm).
889 (WebCore::attachToAppleGraphicsControl):
890 (WebCore::hasMuxCapability):
891 (WebCore::hasMuxableGPU):
892 (WebCore::GraphicsContext3DManager::sharedManager):
893 (WebCore::displayWasReconfigured):
894 (WebCore::GraphicsContext3DManager::updateAllContexts):
895 (WebCore::GraphicsContext3DManager::screenDidChange):
896 (WebCore::GraphicsContext3DManager::addContext):
897 (WebCore::GraphicsContext3DManager::removeContext):
898 (WebCore::GraphicsContext3DManager::hostWindowForContext const):
899 (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance):
900 (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
901 (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
902 (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
903 (WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
904 * platform/graphics/GraphicsContext3DManager.h: Added (copied out of GraphicsContext3DCocoa.mm).
905 (WebCore::GraphicsContext3DManager::hasTooManyContexts const):
906 (WebCore::GraphicsContext3DManager::GraphicsContext3DManager):
907 * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
908 (WebCore::GraphicsContext3D::create):
909 (WebCore::GraphicsContext3D::createShared):
910 (WebCore::identifyAndSetCurrentGPU): Now matches rendererIDs to determine virtual screen.
911 (WebCore::GraphicsContext3D::GraphicsContext3D):
912 (WebCore::GraphicsContext3D::~GraphicsContext3D):
913 (WebCore::GraphicsContext3D::setContextVisibility):
914 (WebCore::GraphicsContext3D::simulateContextChanged):
915 (WebCore::GraphicsContext3D::screenDidChange):
916 (WebCore::attachToAppleGraphicsControl): Deleted.
917 (WebCore::hasMuxCapability): Deleted.
918 (WebCore::hasMuxableGPU): Deleted.
919 (WebCore::GraphicsContext3DManager::GraphicsContext3DManager): Deleted.
920 (WebCore::GraphicsContext3DManager::hasTooManyContexts const): Deleted.
921 (WebCore::manager): Deleted.
922 (WebCore::displayWasReconfigured): Deleted.
923 (WebCore::GraphicsContext3DManager::updateAllContexts): Deleted.
924 (WebCore::GraphicsContext3DManager::addContext): Deleted.
925 (WebCore::GraphicsContext3DManager::removeContext): Deleted.
926 (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance): Deleted.
927 (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance): Deleted.
928 (WebCore::GraphicsContext3DManager::updateHighPerformanceState): Deleted.
929 (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): Deleted.
930 (WebCore::GraphicsContext3DManager::recycleContextIfNecessary): Deleted.
931 * platform/mac/PlatformScreenMac.mm: Provide a display's rendererID.
932 (WebCore::rendererIDForDisplayMask):
933 (WebCore::collectScreenProperties):
934 (WebCore::rendererIDForDisplay):
935 (WebCore::primaryRendererID):
937 2018-07-19 Simon Fraser <simon.fraser@apple.com>
939 Remove completed animations from GraphicsLayer, thus avoiding excessive backing store allocation
940 https://bugs.webkit.org/show_bug.cgi?id=187844
941 rdar://problem/40387294
943 Reviewed by Dean Jackson.
945 A keyframe animation which animates 3D transforms, and is fill-forwards, currently
946 leaves the GraphicsLayer in a state where it has a "running" animation. However, the
947 logic that computes animation extent in RenderLayerBacking::updateGeometry() only does
948 so for running or paused animations. GraphicsLayer then thinks that it has an active
949 transform animation with unknown extent, and refuses to detach its backing store.
951 This triggers excessive layer creation on some sites (e.g. https://www.kqed.org).
953 Fix by always removing animations from the GraphicsLayer when they finish, whether
954 or not they fill forwards. This is done by having KeyframeAnimation::onAnimationEnd()
955 always call endAnimation().
957 This change only fixes the non-Web Animation code path. webkit.org/b/187845 exists
958 to fix the other code path.
960 Also improve some logging that would have revealed this problem sooner.
962 Test: compositing/backing/backing-store-attachment-fill-forwards-animation.html
964 * page/animation/AnimationBase.h:
965 (WebCore::AnimationBase::endAnimation):
966 * page/animation/ImplicitAnimation.cpp:
967 (WebCore::ImplicitAnimation::endAnimation):
968 * page/animation/ImplicitAnimation.h:
969 * page/animation/KeyframeAnimation.cpp:
970 (WebCore::KeyframeAnimation::endAnimation):
971 (WebCore::KeyframeAnimation::onAnimationEnd):
972 * page/animation/KeyframeAnimation.h:
973 * platform/graphics/ca/GraphicsLayerCA.cpp:
974 (WebCore::GraphicsLayerCA::addAnimation):
975 (WebCore::GraphicsLayerCA::updateCoverage):
977 2018-07-20 Ryosuke Niwa <rniwa@apple.com>
979 Picking a color from the color panel for typing attributes needs to inverse transform through color-filter
980 https://bugs.webkit.org/show_bug.cgi?id=187846
982 Reviewed by Simon Fraser.
984 This patch refines the color inversion for editing introduced in r234005 so that font panels and WebKit embedders
985 can get and set inverted colors using attributed strings for a selected text in an editable region.
987 More specifically, when font panels or WebKit embedders set a font color or a background color via WebView's
988 _applyStyleToSelection and _applyEditingStyleToSelection, WebKit would automatically invert the color before inserting
989 into DOM so that the color visible to the user matches that's given to WebKit. Conversely,
990 [WebView attributedSubstringFromRange:nsRange] now return the color visible to the user, i.e. the color after
991 the color filter had been applied, so that some WebKit embedders can present the visually identical color to the user.
993 Because DOM never sees the color filter's effect in the computed style, etc... this patch reverts the change made to
994 StyleChange in r234005 to avoid inverting the color passed to execCommand. This makes editing apps which is unaware
995 of the dark mode or -apple-color-filter continue to function (because the color picker implemented in DOM will be
996 applied of the same color filter before being presented to the user).
998 Finally, this patch introduces a testing hook in applyCommandToFrame so that executing foreColor or backColor with
999 the soruce of CommandFromMenuOrKeyBinding would trigger the same code path as the one taken by Objective-C
1001 Tests: editing/execCommand/set-backColor-with-color-filter-from-scripts.html
1002 editing/execCommand/set-foreColor-with-color-filter-from-scripts.html
1003 editing/mac/attributed-string/attribute-string-for-copy-with-color-filter.html
1004 editing/style/set-backColor-with-color-filter.html
1005 editing/style/set-foreColor-with-color-filter.html
1007 * editing/EditingStyle.cpp:
1008 (WebCore::EditingStyle::inverseTransformColorIfNeeded): Added.
1009 (WebCore::StyleChange::StyleChange): Revert the change made in r234005 since this code is also used by execCommand
1010 which is not desirable, and won't work for background color.
1011 (WebCore::StyleChange::extractTextStyles): Ditto.
1012 * editing/EditingStyle.h:
1013 * editing/Editor.cpp:
1014 (WebCore::Editor::applyStyle):
1015 (WebCore::Editor::applyStyleToSelection): Call EditingStyle::inverseTransformColorIfNeeded when ColorFilterMode is
1018 * editing/EditorCommand.cpp:
1019 (WebCore::applyCommandToFrame): Added the aforementioned testing hook.
1020 * editing/cocoa/HTMLConverter.mm:
1021 (WebCore::editingAttributedStringFromRange): Take the color filtr into account. Some WebKit embedders use this
1022 function to compute the font color in the selected text. Note that this function is mostly used for input methods
1023 so the color doesn't really matter, and its implementation is distinct from that of HTMLConverter.
1025 2018-07-19 Jer Noble <jer.noble@apple.com>
1027 HLS resources with remote subresources will not taint canvasses.
1028 https://bugs.webkit.org/show_bug.cgi?id=187731
1029 <rdar://problem/42290703>
1031 Reviewed by Brady Eidson.
1033 Test: http/tests/security/canvas-remote-read-remote-video-hls.html
1035 Most media sources are single-resource; they are accessed from a single origin. HLS manifests can contain many
1036 subresources from arbitrary origins, and canvases should be tainted when painted from media elements whose
1037 subresources were retrieved from tainting origins.
1039 Add a new method to HTMLMediaElement, wouldTaintOrigin(), taking a SecurityOrigin, and returning whether the
1040 media element would taint that origin. This gets piped all the way down to MediaPlayerPrivateAVFoundationObjC
1041 which uses WebCoreNSURLSession to track all the origins of all the responses which resulted from the media
1044 Drive-by fix: also fix this issue for media elements which render to an AudioContext.
1046 Drive-by fix #2: CanvasRenderingContext2DBase::createPattern() needs to check the return value of
1047 ImageBuffer::create() before using it.
1049 * Modules/webaudio/MediaElementAudioSourceNode.cpp:
1050 (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
1051 * html/HTMLMediaElement.cpp:
1052 (WebCore::HTMLMediaElement::didAttachRenderers):
1053 (WebCore::HTMLMediaElement::didDetachRenderers):
1054 (WebCore::HTMLMediaElement::scheduleUpdateShouldAutoplay):
1055 * html/HTMLMediaElement.h:
1056 (WebCore::HTMLMediaElement::wouldTaintOrigin const):
1057 * html/canvas/CanvasRenderingContext.cpp:
1058 (WebCore::CanvasRenderingContext::wouldTaintOrigin):
1059 * html/canvas/CanvasRenderingContext2DBase.cpp:
1060 (WebCore::CanvasRenderingContext2DBase::createPattern):
1061 * platform/graphics/MediaPlayer.cpp:
1062 (WebCore::MediaPlayer::wouldTaintOrigin const):
1063 * platform/graphics/MediaPlayer.h:
1064 * platform/graphics/MediaPlayerPrivate.h:
1065 (WebCore::MediaPlayerPrivateInterface::hasSingleSecurityOrigin const):
1066 (WebCore::MediaPlayerPrivateInterface::wouldTaintOrigin const):
1067 * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1068 (WebCore::CDMSessionAVContentKeySession::update):
1069 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1070 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1071 (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
1072 * platform/network/cocoa/WebCoreNSURLSession.h:
1073 * platform/network/cocoa/WebCoreNSURLSession.mm:
1074 (-[WebCoreNSURLSession task:didReceiveResponseFromOrigin:]):
1075 (-[WebCoreNSURLSession wouldTaintOrigin:]):
1076 (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
1078 2018-07-20 Zalan Bujtas <zalan@apple.com>
1080 Update FrameView::paintContents to use release logging.
1081 https://bugs.webkit.org/show_bug.cgi?id=187854
1082 <rdar://problem/42432371>
1084 Reviewed by Simon Fraser.
1086 Adding release logging helps identifying blank content cases.
1088 * page/FrameView.cpp:
1089 (WebCore::FrameView::paintContents):
1091 2018-07-20 Jer Noble <jer.noble@apple.com>
1093 First Auto-PiP from Fullscreen too small & animation blocks
1094 https://bugs.webkit.org/show_bug.cgi?id=187745
1095 <rdar://problem/42316583>
1097 Reviewed by Jon Lee.
1099 1) When Auto-PiPing, we don't have the luxury of setting up the fullscreen state
1100 ahead of time; we get notified that PiP has already started. The area of the code
1101 which does this just-in-time setup needs to set the video layer's frame so that the
1102 transform within the PiP window is correct.
1104 2) We generate a placeholder image when going into fullscreen, but we need to do
1105 so synchronously. Create the AVPlayerItemVideoOutput up front at AVPlayerItem creation
1106 time wherever AVPIVO is available.
1108 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1109 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1110 * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1111 (VideoFullscreenInterfaceAVKit::doSetup):
1113 2018-07-20 Antoine Quint <graouts@apple.com>
1115 DeclarativeAnimation should suspend, resume, & stop m_eventQueue
1116 https://bugs.webkit.org/show_bug.cgi?id=187216
1117 <rdar://problem/41669739>
1119 Reviewed by Ryosuke Niwa.
1121 Suspend, resume and close the GenericEventQueue for DeclarativeAnimation as instructed through the DOMActiveObject protocol.
1123 * animation/DeclarativeAnimation.cpp:
1124 (WebCore::DeclarativeAnimation::stop):
1125 (WebCore::DeclarativeAnimation::suspend):
1126 (WebCore::DeclarativeAnimation::resume):
1127 * animation/DeclarativeAnimation.h:
1128 * animation/WebAnimation.h:
1130 2018-07-20 Zalan Bujtas <zalan@apple.com>
1132 [LFC][Inline formatting context] Add basic text content handling.
1133 https://bugs.webkit.org/show_bug.cgi?id=187860
1135 Reviewed by Antti Koivisto.
1137 InlineFormattingContext::layout() walks through the formatting root's descendant list in a post-order fashion and
1138 feeds the TextContentProvider.
1139 Eventually this would turn into a more generic loop where we stop and process the text content when finding a non-text content box (float, inline-box etc), but right now
1140 this is about text content only.
1142 * layout/displaytree/DisplayBox.h:
1143 (WebCore::Display::Box::contentBoxBottom const):
1144 (WebCore::Display::Box::contentBoxRight const):
1145 * layout/inlineformatting/InlineFormattingContext.cpp:
1146 (WebCore::Layout::InlineFormattingContext::layout const):
1147 * layout/inlineformatting/textlayout/TextContentProvider.cpp:
1148 (WebCore::Layout::TextContentProvider::textRuns): Add a helper function to support the case when all we need is just the run list in one go.
1149 * layout/inlineformatting/textlayout/TextContentProvider.h:
1150 * layout/layouttree/LayoutBox.cpp:
1151 (WebCore::Layout::Box::isDescendantOf const):
1152 * layout/layouttree/LayoutBox.h:
1153 * layout/layouttree/LayoutInlineBox.h:
1154 (WebCore::Layout::InlineBox::textContent const):
1156 2018-07-20 Youenn Fablet <youenn@apple.com>
1158 FetchResponse should close its stream when loading finishes
1159 https://bugs.webkit.org/show_bug.cgi?id=187790
1161 Reviewed by Chris Dumez.
1163 It simplifies for a FetchResponse to push all its data into its stream if already created at end of load time.
1164 Did some refactoring in FetchBodyOwner to have a cleaner relationship with the stream source.
1165 Did a minor refactoring to expose the error description when loading fails as part of the rejected promise.
1166 This is consistent to errors sent back through callbacks.
1168 Covered by existing tests.
1170 * Modules/fetch/FetchBodyOwner.cpp:
1171 (WebCore::FetchBodyOwner::~FetchBodyOwner):
1172 * Modules/fetch/FetchBodyOwner.h:
1173 * Modules/fetch/FetchBodySource.cpp:
1174 (WebCore::FetchBodySource::FetchBodySource):
1175 (WebCore::FetchBodySource::setActive):
1176 (WebCore::FetchBodySource::setInactive):
1177 (WebCore::FetchBodySource::doStart):
1178 (WebCore::FetchBodySource::doPull):
1179 (WebCore::FetchBodySource::doCancel):
1180 (WebCore::FetchBodySource::cleanBodyOwner):
1181 * Modules/fetch/FetchBodySource.h:
1182 * Modules/fetch/FetchResponse.cpp:
1183 (WebCore::FetchResponse::BodyLoader::didSucceed):
1184 (WebCore::FetchResponse::BodyLoader::didFail):
1186 2018-07-20 Jer Noble <jer.noble@apple.com>
1188 REGRESSION(r233969): ASSERT in -[WebAVPlayerLayer setVideoGravity:]
1189 https://bugs.webkit.org/show_bug.cgi?id=187814
1190 <rdar://problem/42391869>
1192 Reviewed by Eric Carlson.
1194 After r233969 caused models to disassociate themselves from interfaces, it is now possible that an
1195 VideoFullscreenInterfaceAVKit can have a nil model. We should null-check, not ASSERT, now that the
1196 assertion no longer holds true.
1198 * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1199 (-[WebAVPlayerLayer layoutSublayers]):
1200 (-[WebAVPlayerLayer resolveBounds]):
1201 (-[WebAVPlayerLayer setVideoGravity:]):
1203 2018-07-19 Antoine Quint <graouts@apple.com>
1205 Flaky crash in AnimationTimeline::cancelOrRemoveDeclarativeAnimation
1206 https://bugs.webkit.org/show_bug.cgi?id=187530
1207 <rdar://problem/42095186>
1209 Reviewed by Dean Jackson.
1211 We would crash in cancelOrRemoveDeclarativeAnimation() because updateCSSAnimationsForElement() would pass
1212 nullptr values due to the return value of cssAnimationsByName.take(nameOfAnimationToRemove). This is because
1213 we would create animations for animation names that may be empty or not match an existing @keyframes rule.
1214 Not only was that wasteful, but it was also non-compliant, and as a result of fixing this we're actually
1215 seeing a progression in the CSS Animations WPT tests.
1217 * animation/AnimationTimeline.cpp:
1218 (WebCore::shouldConsiderAnimation): New function that performs all required steps to see if a provided animation
1219 is valid and has a name that is not "none", not the empty string and matches the name of a @keyframes rule.
1220 (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
1221 * animation/KeyframeEffectReadOnly.cpp:
1222 (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): We no longer need to check whether we have
1223 an empty animation name since we're no longer creating CSSAnimation objects in that circumstance.
1224 * css/StyleResolver.cpp:
1225 (WebCore::StyleResolver::isAnimationNameValid): Add a new method that checks whether the provided animation name
1226 a known @keyframes rule.
1227 * css/StyleResolver.h:
1229 2018-07-19 Chris Dumez <cdumez@apple.com>
1231 Crash under WebCore::DocumentWriter::addData()
1232 https://bugs.webkit.org/show_bug.cgi?id=187819
1233 <rdar://problem/41328743>
1235 Reviewed by Brady Eidson.
1237 When AppCache is used a DocumentLoader may start a NetworkLoad even though it has substitute data.
1238 In DocumentLoader::continueAfterContentPolicy(), if we have substitute data we commit this data
1239 and call finishLoad(). However, if the case where there was a NetworkLoad started, we'll send the
1240 ContinueDidReceiveResponse IPC back to the network process and it will start sending us data for
1241 the load. This could lead to crashes such as <rdar://problem/41328743> since the DocumentLoader
1242 has already committed data and finished loading when it gets the data from the network process.
1244 To address the issue, we now call clearMainResource() in continueAfterContentPolicy(), after we've
1245 decided to commit the substitute data. This effectively removes the DocumentLoader as a client of
1246 the CachedResource so that its will not be notified of following load progress. We do not cancel
1247 the load as other CachedResourceClients may be interested in the load (ApplicationCacheResourceLoader
1248 in particular, in order to update its cached data).
1250 * loader/DocumentLoader.cpp:
1251 (WebCore::DocumentLoader::continueAfterContentPolicy):
1253 2018-07-19 Dean Jackson <dino@apple.com>
1255 CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebCore: std::optional<WTF::Vector<WebCore::PluginInfo, 0ul, WTF::CrashOnOverflow, 16ul> >::operator* & + 73
1256 https://bugs.webkit.org/show_bug.cgi?id=187820
1257 <rdar://problem/42017759>
1259 Reviewed by Antoine Quint.
1261 Speculative fix for this crash, which is accessing an optional without checking
1262 if it exists. The crash logs didn't point to a reproducible test case.
1264 * plugins/PluginData.cpp:
1265 (WebCore::PluginData::supportsWebVisibleMimeTypeForURL const): Return false if
1266 the optional doesn't exist.
1268 2018-07-19 Antoine Quint <graouts@apple.com>
1270 Ensure DocumentTimeline is kept alive until the VM::whenIdle callback is called
1271 https://bugs.webkit.org/show_bug.cgi?id=187692
1273 Reviewed by Ryosuke Niwa.
1275 Ensure we keep the DocumentTimeline alive until the VM::whenIdle callback is called.
1277 * animation/DocumentTimeline.cpp:
1278 (WebCore::DocumentTimeline::currentTime):
1280 2018-07-18 Simon Fraser <simon.fraser@apple.com>
1282 Setting foreground color when editing should take color-filter into account, and report the correct foreground color for collapsed selections
1283 https://bugs.webkit.org/show_bug.cgi?id=187778
1285 Reviewed by Ryosuke Niwa.
1287 Fix two aspects of editing with color-filter:
1289 1. When setting foreground color, inverse-transform the color through -apple-color-filter so that the user gets the color
1290 they chose when in Dark Mode. Tested by editing/style/exec-command-foreColor-with-color-filter.html.
1292 2. When retrieving the style of the collapsed selection, take color filter into account so that color picker
1293 reflects the color the users sees, instead of the content color. Tested by editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html
1295 Add two additional tests that ensure that -apple-color-filter does not impact the NSAttributedString code
1296 path, since -apple-color-filter should not affect the behavior of Copy.
1298 Tests: editing/mac/attributed-string/attrib-string-colors-with-color-filter.html
1299 editing/mac/attributed-string/attrib-string-range-with-color-filter.html
1300 editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html
1301 editing/style/exec-command-foreColor-with-color-filter.html
1303 * editing/EditingStyle.cpp:
1304 (WebCore::StyleChange::StyleChange):
1305 (WebCore::StyleChange::extractTextStyles):
1306 * editing/EditingStyle.h:
1307 * editing/cocoa/EditorCocoa.mm:
1308 (WebCore::Editor::fontAttributesForSelectionStart const):
1309 * platform/graphics/filters/FilterOperation.cpp:
1310 (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
1311 * platform/graphics/filters/FilterOperation.h:
1312 (WebCore::FilterOperation::inverseTransformColor const):
1313 * platform/graphics/filters/FilterOperations.cpp:
1314 (WebCore::FilterOperations::transformColor const):
1315 (WebCore::FilterOperations::inverseTransformColor const):
1316 * platform/graphics/filters/FilterOperations.h:
1318 2018-07-19 David Fenton <david_fenton@apple.com>
1320 Unreviewed, rolling out r233994.
1322 Caused EWS and bot failures due to assertions added
1326 "FetchResponse should close its stream when loading finishes"
1327 https://bugs.webkit.org/show_bug.cgi?id=187790
1328 https://trac.webkit.org/changeset/233994
1330 2018-07-19 Jer Noble <jer.noble@apple.com>
1332 REGRESSION(r233926): media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html is a TIMEOUT failure
1333 https://bugs.webkit.org/show_bug.cgi?id=187813
1335 Reviewed by Jon Lee.
1337 In r233926, we changed the behavior of entering PiP to exit fullscreen only after entering PiP completes. The
1338 test in question will immediately request "inline" presentation mode once the PiP animation begins, and thus
1339 it's asking to "exit fullscreen" when both in standard fullscreen and also in PiP. The fix is not to bail out
1340 early if we're in standard (element) fullscreen, but to allow the remaining steps to complete and exit PiP as
1343 * html/HTMLMediaElement.cpp:
1344 (WebCore::HTMLMediaElement::exitFullscreen):
1346 2018-07-19 Zalan Bujtas <zalan@apple.com>
1348 [LFC] Introduce simple line breaker.
1349 https://bugs.webkit.org/show_bug.cgi?id=187688
1351 Reviewed by Antti Koivisto.
1353 This patch takes the simple line layout implementation and refactors it in a way it is no longer requires a RenderBlockFlow object to run on.
1354 Also this patch decouples text run generation and line breaking (and this implementation is going to replace the current simple line layout codebase)
1356 TextContentProvider: Acts both as the container for all the text content (including hard line breaks) and as an iterator for the generated text runs.
1357 SimpleTextRunGenerator: TextContentProvider uses it as the text run generator for simple content (in the future we'll have a ComplexTextRunGenerator).
1358 SimpleLineBreaker: Input -> text runs + line constraints; Output -> layout runs after line breaking.
1361 * WebCore.xcodeproj/project.pbxproj:
1362 * layout/inlineformatting/textlayout/ContentProvider.cpp: Added.
1363 (WebCore::Layout::TextContentProvider::TextItem::Style::Style):
1364 (WebCore::Layout::TextContentProvider::ContentProvider):
1365 (WebCore::Layout::TextContentProvider::~ContentProvider):
1366 (WebCore::Layout::TextContentProvider::appendText):
1367 (WebCore::Layout::TextContentProvider::appendLineBreak):
1368 (WebCore::Layout::TextContentProvider::width const):
1369 (WebCore::Layout::TextContentProvider::textWidth const):
1370 (WebCore::Layout::TextContentProvider::fixedPitchWidth const):
1371 (WebCore::Layout::TextContentProvider::toTextItemIndex const):
1372 (WebCore::Layout::TextContentProvider::length const):
1373 (WebCore::Layout::TextContentProvider::iterator):
1374 (WebCore::Layout::TextContentProvider::findNextRun):
1375 (WebCore::Layout::TextContentProvider::current const):
1376 * layout/inlineformatting/textlayout/ContentProvider.h: Added.
1377 (WebCore::Layout::TextContentProvider::textContent const):
1378 (WebCore::Layout::TextContentProvider::hardLineBreaks const):
1379 (WebCore::Layout::TextContentProvider::Iterator::current const):
1380 (WebCore::Layout::TextContentProvider::contains const):
1381 (WebCore::Layout::TextContentProvider::Iterator::Iterator):
1382 (WebCore::Layout::TextContentProvider::Iterator::operator++):
1383 * layout/inlineformatting/textlayout/Runs.h: Added.
1384 (WebCore::Layout::TextRun::isWhitespace const):
1385 (WebCore::Layout::TextRun::isNonWhitespace const):
1386 (WebCore::Layout::TextRun::isLineBreak const):
1387 (WebCore::Layout::TextRun::isSoftLineBreak const):
1388 (WebCore::Layout::TextRun::isHardLineBreak const):
1389 (WebCore::Layout::TextRun::isValid const):
1390 (WebCore::Layout::TextRun::isCollapsed const):
1391 (WebCore::Layout::TextRun::type const):
1392 (WebCore::Layout::TextRun::setIsCollapsed):
1393 (WebCore::Layout::TextRun::setWidth):
1394 (WebCore::Layout::LayoutRun::start const):
1395 (WebCore::Layout::LayoutRun::end const):
1396 (WebCore::Layout::LayoutRun::length const):
1397 (WebCore::Layout::LayoutRun::left const):
1398 (WebCore::Layout::LayoutRun::right const):
1399 (WebCore::Layout::LayoutRun::width const):
1400 (WebCore::Layout::LayoutRun::isEndOfLine const):
1401 (WebCore::Layout::LayoutRun::setEnd):
1402 (WebCore::Layout::LayoutRun::setRight):
1403 (WebCore::Layout::LayoutRun::setIsEndOfLine):
1404 (WebCore::Layout::LayoutRun::LayoutRun):
1405 (WebCore::Layout::TextRun::createWhitespaceRun):
1406 (WebCore::Layout::TextRun::createNonWhitespaceRun):
1407 (WebCore::Layout::TextRun::createSoftLineBreakRun):
1408 (WebCore::Layout::TextRun::createHardLineBreakRun):
1409 (WebCore::Layout::TextRun::TextRun):
1410 (WebCore::Layout::TextRun::start const):
1411 (WebCore::Layout::TextRun::end const):
1412 (WebCore::Layout::TextRun::length const):
1413 (WebCore::Layout::TextRun::width const):
1414 * layout/inlineformatting/textlayout/simple/SimpleContentProvider.cpp: Added.
1415 (WebCore::Layout::SimpleContentProvider::SimpleContentProvider):
1416 (WebCore::Layout::SimpleContentProvider::current const):
1417 (WebCore::Layout::SimpleContentProvider::reset):
1418 (WebCore::Layout::SimpleContentProvider::findNextRun):
1419 (WebCore::Layout::SimpleContentProvider::moveToNextBreakablePosition):
1420 (WebCore::Layout::SimpleContentProvider::moveToNextNonWhitespacePosition):
1421 (WebCore::Layout::SimpleContentProvider::isAtLineBreak const):
1422 (WebCore::Layout::SimpleContentProvider::isAtSoftLineBreak const):
1423 * layout/inlineformatting/textlayout/simple/SimpleContentProvider.h: Added.
1424 (WebCore::Layout::SimpleContentProvider::Iterator::reset):
1425 (WebCore::Layout::SimpleContentProvider::Position::operator== const):
1426 (WebCore::Layout::SimpleContentProvider::Position::operator< const):
1427 (WebCore::Layout::SimpleContentProvider::Position::operator ContentPosition const):
1428 (WebCore::Layout::SimpleContentProvider::Position::resetItemPosition):
1429 (WebCore::Layout::SimpleContentProvider::Position::contentPosition const):
1430 (WebCore::Layout::SimpleContentProvider::Position::itemPosition const):
1431 (WebCore::Layout::SimpleContentProvider::Iterator<T>::Iterator):
1432 (WebCore::Layout::SimpleContentProvider::Iterator<T>::current const):
1433 (WebCore::Layout::SimpleContentProvider::Iterator<T>::operator):
1434 (WebCore::Layout::SimpleContentProvider::Position::operator++):
1435 (WebCore::Layout::SimpleContentProvider::Position::operator+=):
1436 * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp: Added.
1437 (WebCore::Layout::SimpleLineBreaker::TextRunList::TextRunList):
1438 (WebCore::Layout::SimpleLineBreaker::Line::Line):
1439 (WebCore::Layout::adjustedEndPosition):
1440 (WebCore::Layout::SimpleLineBreaker::Line::append):
1441 (WebCore::Layout::SimpleLineBreaker::Line::collapseTrailingWhitespace):
1442 (WebCore::Layout::SimpleLineBreaker::Line::reset):
1443 (WebCore::Layout::SimpleLineBreaker::Style::Style):
1444 (WebCore::Layout::SimpleLineBreaker::SimpleLineBreaker):
1445 (WebCore::Layout::SimpleLineBreaker::runs):
1446 (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
1447 (WebCore::Layout::SimpleLineBreaker::handleOverflownRun):
1448 (WebCore::Layout::SimpleLineBreaker::collapseLeadingWhitespace):
1449 (WebCore::Layout::SimpleLineBreaker::collapseTrailingWhitespace):
1450 (WebCore::Layout::SimpleLineBreaker::splitTextRun):
1451 (WebCore::Layout::SimpleLineBreaker::split const):
1452 (WebCore::Layout::SimpleLineBreaker::availableWidth const):
1453 (WebCore::Layout::SimpleLineBreaker::verticalPosition const):
1454 * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h: Added.
1455 (WebCore::Layout::SimpleLineBreaker::TextRunList::overrideCurrent):
1456 (WebCore::Layout::SimpleLineBreaker::TextRunList::isCurrentOverridden const):
1457 (WebCore::Layout::SimpleLineBreaker::Line::availableWidth const):
1458 (WebCore::Layout::SimpleLineBreaker::Line::hasContent const):
1459 (WebCore::Layout::SimpleLineBreaker::Line::setAvailableWidth):
1460 (WebCore::Layout::SimpleLineBreaker::Line::hasTrailingWhitespace const):
1461 (WebCore::Layout::SimpleLineBreaker::Line::isWhitespaceOnly const):
1462 (WebCore::Layout::SimpleLineBreaker::wrapContentOnOverflow const):
1463 (WebCore::Layout::SimpleLineBreaker::TextRunList::current const):
1464 (WebCore::Layout::SimpleLineBreaker::TextRunList::operator++):
1466 2018-07-19 Keith Rollin <krollin@apple.com>
1468 Remove duplicate compilation of WebKitNSImageExtras.mm
1469 https://bugs.webkit.org/show_bug.cgi?id=187782
1471 Reviewed by Alex Christensen.
1473 WebKitNSImageExtras.mm gets compiled twice, once because it's in
1474 WebCore.xcodeproj/project.pbxproj and once because it's in
1475 Webcore/SourcesCocoa.txt. This can lead to duplicate definition
1476 errors, particularly when building with LTO enabled. Fix this by
1477 removing the entry from the Xcode project.
1479 No new tests -- no change in WebKit functionality.
1481 * WebCore.xcodeproj/project.pbxproj:
1483 2018-07-19 Youenn Fablet <youenn@apple.com>
1485 FetchResponse should close its stream when loading finishes
1486 https://bugs.webkit.org/show_bug.cgi?id=187790
1488 Reviewed by Chris Dumez.
1490 It simplifies for a FetchResponse to push all its data into its stream if already created at end of load time.
1491 Did some refactoring in FetchBodyOwner to have a cleaner relationship with the stream source.
1492 Did a minor refactoring to expose the error description when loading fails as part of the rejected promise.
1493 This is consistent to errors sent back through callbacks.
1495 Covered by existing tests.
1497 * Modules/fetch/FetchBodyOwner.cpp:
1498 (WebCore::FetchBodyOwner::~FetchBodyOwner):
1499 * Modules/fetch/FetchBodyOwner.h:
1500 * Modules/fetch/FetchBodySource.cpp:
1501 (WebCore::FetchBodySource::FetchBodySource):
1502 (WebCore::FetchBodySource::setActive):
1503 (WebCore::FetchBodySource::setInactive):
1504 (WebCore::FetchBodySource::doStart):
1505 (WebCore::FetchBodySource::doPull):
1506 (WebCore::FetchBodySource::doCancel):
1507 (WebCore::FetchBodySource::cleanBodyOwner):
1508 * Modules/fetch/FetchBodySource.h:
1509 * Modules/fetch/FetchResponse.cpp:
1510 (WebCore::FetchResponse::BodyLoader::didSucceed):
1511 (WebCore::FetchResponse::BodyLoader::didFail):
1513 2018-07-19 Jon Lee <jonlee@apple.com>
1515 Update iOS fullscreen alert text again
1516 https://bugs.webkit.org/show_bug.cgi?id=187797
1517 rdar://problem/42373783
1519 Reviewed by Jer Noble.
1521 * English.lproj/Localizable.strings:
1523 2018-07-19 Keith Rollin <krollin@apple.com>
1525 Adjust WEBCORE_EXPORT annotations for LTO
1526 https://bugs.webkit.org/show_bug.cgi?id=187781
1527 <rdar://problem/42351124>
1529 Reviewed by Alex Christensen.
1531 Continuation of Bug 186944. This bug addresses issues not caught
1532 during the first pass of adjustments. The initial work focussed on
1533 macOS; this one addresses issues found when building for iOS. From
1536 Adjust a number of places that result in WebKit's
1537 'check-for-weak-vtables-and-externals' script reporting weak external
1540 ERROR: WebCore has a weak external symbol in it (/Volumes/Data/dev/webkit/OpenSource/WebKitBuild/Release/WebCore.framework/Versions/A/WebCore)
1541 ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.
1542 ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
1545 These cases are caused by inline methods being marked with WTF_EXPORT
1546 (or related macro) or with an inline function being in a class marked
1547 as such, and when enabling LTO builds.
1549 For the most part, address these by removing the WEBCORE_EXPORT
1550 annotation from inline methods. In some cases, move the implementation
1551 out-of-line because it's the class that has the WEBCORE_EXPORT on it
1552 and removing the annotation from the class would be too disruptive.
1553 Finally, in other cases, move the implementation out-of-line because
1554 check-for-weak-vtables-and-externals still complains when keeping the
1555 implementation inline and removing the annotation; this seems to
1556 typically (but not always) happen with destructors.
1558 No new tests. There is no changed functionality. Only the annotation
1559 and treatment of inline methods are altered.
1561 * platform/graphics/FourCC.h:
1562 (WebCore::FourCC::FourCC):
1563 * platform/graphics/IntPoint.h:
1564 (WebCore::IntPoint::IntPoint):
1565 * platform/mediastream/RealtimeMediaSource.cpp:
1566 (WebCore::RealtimeMediaSource::Observer::~Observer):
1567 (WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory):
1568 (WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory):
1569 * platform/mediastream/RealtimeMediaSource.h:
1570 * workers/service/ServiceWorkerProvider.cpp:
1571 (WebCore::ServiceWorkerProvider::~ServiceWorkerProvider):
1572 * workers/service/ServiceWorkerProvider.h:
1574 2018-07-19 Charlie Turner <cturner@igalia.com>
1576 [GStreamer] Return a valid time values in unprerolled states
1577 https://bugs.webkit.org/show_bug.cgi?id=187111
1579 Reviewed by Xabier Rodriguez-Calvar.
1581 After r230584 in bug 180253, asserts were added in
1582 PlatformTimeRanges::add to check that both ends of the range were
1583 valid times. In the non-MSE GStreamer player, this assert was
1584 firing on https://www.w3.org/2010/05/video/mediaevents.html due to
1585 seekable being called in nonprerolled states. In this case
1586 MediaPlayerPrivateInterface::seekable was calling GStreamer's
1587 maxTimeSeekable, which calls in durationMediaTime. The guard
1588 against calling gst_element_query_duration when not prerolled was
1589 returning a different time value than when the duration query
1590 itself failed. Hence the assert firing.
1592 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1593 (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
1595 2018-07-19 Antoine Quint <graouts@apple.com>
1597 Hitting RELEASE_ASSERT(!m_activeDOMObjectAdditionForbidden) under HTMLMediaElement::resume()
1598 https://bugs.webkit.org/show_bug.cgi?id=187793
1599 <rdar://problem/42308469>
1601 Reviewed by Chris Dumez.
1603 Ensure we do not call JS under resume(), which would happen as a result of calling configureMediaControls() in prepareForLoad().
1605 * html/HTMLMediaElement.cpp:
1606 (WebCore::HTMLMediaElement::~HTMLMediaElement):
1607 (WebCore::HTMLMediaElement::contextDestroyed):
1608 (WebCore::HTMLMediaElement::stop):
1609 (WebCore::HTMLMediaElement::suspend):
1610 (WebCore::HTMLMediaElement::resume):
1611 * html/HTMLMediaElement.h:
1613 2018-07-19 Philippe Normand <pnormand@igalia.com>
1615 [GStreamer][MSE] imported/w3c/web-platform-tests/media-source/mediasource-is-type-supported.html crashes
1616 https://bugs.webkit.org/show_bug.cgi?id=187469
1618 Reviewed by Žan Doberšek.
1620 * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1621 (webKitMediaSrcFreeStream): Fix critical warning. The appsrc
1622 element is created only when a valid sourcebuffer is in use.
1624 2018-07-19 Frederic Wang <fwang@igalia.com>
1626 Fix message of NotSupportedError exception thrown during custom element creation
1627 https://bugs.webkit.org/show_bug.cgi?id=187757
1629 Reviewed by Yusuke Suzuki.
1631 In bug 161528, some new exceptions were introduced for custom element creation [1] but the
1632 actual text has some issues. This patch fixes one typo and one wrong message.
1634 [1] https://dom.spec.whatwg.org/#concept-create-element
1636 Test: fast/custom-elements/exceptions-for-synchronous-custom-element-creation.html
1638 * bindings/js/JSCustomElementInterface.cpp:
1639 (WebCore::constructCustomElementSynchronously):
1641 2018-07-18 Jer Noble <jer.noble@apple.com>
1643 Unreviewed API Test fix; restored a line inadventantly removed in r233926.
1645 * platform/mac/VideoFullscreenInterfaceMac.mm:
1646 (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
1648 2018-07-18 Antoine Quint <graouts@apple.com>
1650 [Web Animations] Interpolation between font-styles with a keyword value should be discrete
1651 https://bugs.webkit.org/show_bug.cgi?id=187722
1653 Reviewed by Myles Maxfield.
1655 Animating between "font-style: normal" or "font-style: oblique" and any another value should yield a discrete
1656 interpolation where the from-value is used from 0 and up to (but excluding) 0.5, and the to-value from 0.5 to 1.
1658 In order to be able to detect the "normal" value, we make the "slope" of a FontSelectionRequest an optional type
1659 where the std::nullopt value indicates "normal" and other values an "oblique" value. Since we also need to
1660 distinguish the "italic" value from an "oblique" value, we implement a custom PropertyWrapper for the "font-style"
1661 property where we ensure the fontStyleAxis property of the font description matches the value we're blending to.
1662 Indeed, in the case where we may animate from "normal" to "italic", the fontStyleAxis on the blended style would
1663 remain "slnt" since it is the base value for "normal".
1665 * accessibility/AccessibilityRenderObject.cpp:
1666 (WebCore::AccessibilityRenderObject::hasPlainText const):
1667 * css/CSSComputedStyleDeclaration.cpp:
1668 (WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
1669 * css/CSSComputedStyleDeclaration.h:
1670 * css/CSSFontFace.cpp:
1671 (WebCore::calculateItalicRange):
1672 * css/CSSFontFaceSet.cpp:
1673 (WebCore::computeFontSelectionRequest):
1674 * css/FontSelectionValueInlines.h:
1675 (WebCore::fontStyleKeyword):
1676 (WebCore::fontStyleValue): Deleted.
1677 * css/StyleBuilderConverter.h:
1678 (WebCore::StyleBuilderConverter::convertFontStyleFromValue):
1679 * page/animation/CSSPropertyAnimation.cpp:
1680 (WebCore::blendFunc):
1681 (WebCore::PropertyWrapperFontStyle::PropertyWrapperFontStyle):
1682 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1683 * platform/graphics/FontCache.h:
1684 (WebCore::FontDescriptionKey::computeHash const):
1685 * platform/graphics/FontCascade.h:
1686 (WebCore::FontCascade::italic const):
1687 * platform/graphics/FontDescription.h:
1688 (WebCore::FontDescription::italic const):
1689 (WebCore::FontDescription::setItalic):
1690 (WebCore::FontDescription::setIsItalic):
1691 (WebCore::FontCascadeDescription::initialItalic):
1692 * platform/graphics/FontSelectionAlgorithm.cpp:
1693 (WebCore::FontSelectionAlgorithm::styleDistance const):
1694 * platform/graphics/FontSelectionAlgorithm.h:
1695 (WebCore::isItalic):
1696 (WebCore::FontSelectionRequest::tied const):
1697 (WebCore::operator<<): Implement the required stream operator.
1698 (WebCore::operator==): Mark this function as inline instead of constexpr since tied() is no longer constexpr
1699 due to taking an std::optional<>.
1700 (WebCore::operator!=):
1701 * platform/graphics/cocoa/FontCacheCoreText.cpp:
1702 (WebCore::preparePlatformFont):
1703 * platform/graphics/win/FontCacheWin.cpp:
1704 (WebCore::FontCache::createFontPlatformData):
1705 * rendering/style/RenderStyle.cpp:
1706 (WebCore::RenderStyle::setFontItalic):
1707 * rendering/style/RenderStyle.h:
1708 (WebCore::RenderStyle::fontItalic const):
1710 2018-07-18 Jer Noble <jer.noble@apple.com>
1712 Unreviewed build fix after r233926; BOOL !== bool.
1714 * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1715 (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
1717 2018-07-18 Jer Noble <jer.noble@apple.com>
1719 PiP from Element Fullscreen should match AVKit's behavior
1720 https://bugs.webkit.org/show_bug.cgi?id=187623
1722 Reviewed by Jon Lee.
1724 PiP behavior should be defined at the WebKit2 level, and not in HTMLMediaElement:
1726 * html/HTMLMediaElement.cpp:
1727 (WebCore::HTMLMediaElement::enterFullscreen):
1729 Add an accessor for pictureInPictureWasStartedWhenEnteringBackground():
1731 * platform/cocoa/VideoFullscreenModelVideoElement.mm:
1732 (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
1734 Add VideoFullscreenModelClient virutal methods for PiP change notifications:
1736 * platform/cocoa/VideoFullscreenModel.h:
1737 (WebCore::VideoFullscreenModelClient::hasVideoChanged):
1738 (WebCore::VideoFullscreenModelClient::videoDimensionsChanged):
1739 (WebCore::VideoFullscreenModelClient::willEnterPictureInPicture):
1740 (WebCore::VideoFullscreenModelClient::didEnterPictureInPicture):
1741 (WebCore::VideoFullscreenModelClient::failedToEnterPictureInPicture):
1742 (WebCore::VideoFullscreenModelClient::willExitPictureInPicture):
1743 (WebCore::VideoFullscreenModelClient::didExitPictureInPicture):
1744 (WebCore::VideoFullscreenModelClient::failedToExitPictureInPicture):
1745 * platform/cocoa/VideoFullscreenModelVideoElement.h:
1746 * platform/cocoa/VideoFullscreenModelVideoElement.mm:
1747 (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
1748 (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
1749 (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
1750 (VideoFullscreenModelVideoElement::willExitPictureInPicture):
1751 (VideoFullscreenModelVideoElement::didExitPictureInPicture):
1752 (VideoFullscreenModelVideoElement::failedToExitPictureInPicture):
1753 * platform/ios/VideoFullscreenInterfaceAVKit.h:
1754 * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1755 (-[WebAVPlayerLayer layoutSublayers]):
1756 (-[WebAVPlayerLayer resolveBounds]):
1757 (-[WebAVPlayerLayer setVideoGravity:]):
1758 (VideoFullscreenInterfaceAVKit::setupFullscreen):
1759 (VideoFullscreenInterfaceAVKit::presentingViewController):
1760 (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
1761 (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
1762 (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
1763 (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
1764 (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
1765 (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1766 (VideoFullscreenInterfaceAVKit::doSetup):
1767 * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1768 (VideoFullscreenControllerContext::willEnterPictureInPicture):
1769 (VideoFullscreenControllerContext::didEnterPictureInPicture):
1770 (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
1771 (VideoFullscreenControllerContext::willExitPictureInPicture):
1772 (VideoFullscreenControllerContext::didExitPictureInPicture):
1773 (VideoFullscreenControllerContext::failedToExitPictureInPicture):
1774 * platform/mac/VideoFullscreenInterfaceMac.h:
1775 (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
1776 * platform/mac/VideoFullscreenInterfaceMac.mm:
1777 (-[WebVideoFullscreenInterfaceMacObjC invalidateFullscreenState]):
1778 (-[WebVideoFullscreenInterfaceMacObjC exitPIP]):
1779 (-[WebVideoFullscreenInterfaceMacObjC exitPIPAnimatingToRect:inWindow:]):
1780 (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
1781 (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
1782 (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
1783 (WebCore::VideoFullscreenInterfaceMac::exitFullscreen):
1784 (WebCore::VideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
1785 (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen):
1787 2018-07-18 Basuke Suzuki <Basuke.Suzuki@sony.com>
1789 [Curl] Disable CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST specified by setAllowsAnyHTTPSCertificate.
1790 https://bugs.webkit.org/show_bug.cgi?id=187611
1792 Reviewed by Fujii Hironori.
1794 Current interface for TLS certificate validation for Curl port are as follows:
1796 - WEBCORE_EXPORT void setHostAllowsAnyHTTPSCertificate(const String&);
1797 - bool isAllowedHTTPSCertificateHost(const String&);
1798 - bool canIgnoredHTTPSCertificate(const String&, const Vector<CertificateInfo::Certificate>&);
1800 First one registers a host to be ignored for any certificate check. Once it is registered, no
1801 further certificate validation check is executed.
1802 Second one checks the host is registered in the list above.
1803 Third one is weird. The method signature implies it checks the certificate for the host and detect
1804 whether we can ignore this certificate for the host, but actually it just check only the host and
1805 register the certificate into the vector. Then in the next request for the host, the certificate
1806 will be checked with the previously stored certificate.
1808 It's hard to understand, but in short,
1809 - We can register a host as an exception for any TLS certificate validation.
1810 - But only certificate arrived first is ignored, not any certificates for the host
1811 (which is rare, but possible for mis configured web cluster).
1813 This behavior is incomplete. To ignore any certificates of the host, these two methods are enough:
1815 - void allowAnyHTTPSCertificatesForHost(const String&)
1816 - bool canIgnoreAnyHTTPSCertificatesForHost(const String&)
1818 No new tests. Covered by existing tests.
1820 * platform/network/curl/CertificateInfo.h:
1821 * platform/network/curl/CurlContext.cpp:
1822 (WebCore::CurlHandle::enableSSLForHost): Ignore TLS verification for registered host.
1823 * platform/network/curl/CurlSSLHandle.cpp:
1824 (WebCore::CurlSSLHandle::allowAnyHTTPSCertificatesForHost): Added.
1825 (WebCore::CurlSSLHandle::canIgnoreAnyHTTPSCertificatesForHost const): Ditto.
1826 (WebCore::CurlSSLHandle::setClientCertificateInfo): Separate lock.
1827 (WebCore::CurlSSLHandle::getSSLClientCertificate const): Ditto and add const.
1828 (WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate): Deleted.
1829 (WebCore::CurlSSLHandle::isAllowedHTTPSCertificateHost): Deleted.
1830 (WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate): Deleted.
1831 (WebCore::CurlSSLHandle::getSSLClientCertificate): Deleted.
1832 * platform/network/curl/CurlSSLHandle.h:
1833 * platform/network/curl/CurlSSLVerifier.cpp:
1834 (WebCore::CurlSSLVerifier::CurlSSLVerifier):
1835 (WebCore::CurlSSLVerifier::collectInfo): Renamed from verify.
1836 (WebCore::CurlSSLVerifier::verifyCallback):
1837 (WebCore::CurlSSLVerifier::verify): Renamed to collectInfo.
1838 * platform/network/curl/CurlSSLVerifier.h:
1839 * platform/network/curl/ResourceHandleCurl.cpp:
1840 (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Rename calling method.
1842 2018-07-18 Myles C. Maxfield <mmaxfield@apple.com>
1844 Rename WordBreak::Break to WordBreak::BreakWord
1845 https://bugs.webkit.org/show_bug.cgi?id=187767
1847 Reviewed by Simon Fraser.
1849 These breaking properties are very confusing. There are:
1851 1. word-break: break-all, a standard value that allows breaking after every
1853 2. word-break: break-word, a non-standard value which allows for breaking after
1854 every character, but only if the word is too long for the available width (otherwise
1855 it works the same as word-break: normal). This affects the min-content-size of the
1856 text (and makes it equal to what it would be if word-break: break-all was
1858 3. word-wrap: break-word, which is the same as word-break: break-word, but doesn't
1859 affect the min-content-size of the text.
1860 4. overflow-wrap: break-word, which is the same as word-wrap: break-word.
1862 Because this is so confusing it's valuable for our internal enums to match the names
1863 of the official CSS properties/values.
1865 No new tests because there is no behavior change.
1867 * css/CSSPrimitiveValueMappings.h:
1868 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1869 (WebCore::CSSPrimitiveValue::operator WordBreak const):
1870 * rendering/RenderText.cpp:
1871 (WebCore::RenderText::computePreferredLogicalWidths):
1872 * rendering/style/RenderStyle.h:
1873 (WebCore::RenderStyle::breakWords const):
1874 * rendering/style/RenderStyleConstants.h:
1876 2018-07-18 Wenson Hsieh <wenson_hsieh@apple.com>
1878 Add SPI to defer running async script until after document load
1879 https://bugs.webkit.org/show_bug.cgi?id=187748
1880 <rdar://problem/42317378>
1882 Reviewed by Ryosuke Niwa and Tim Horton.
1884 On watchOS, we currently observe that time-consuming async scripts can block the first paint of Reader, leaving
1885 the user with a blank screen for tens of seconds. One way to mitigate this is to defer async script execution
1886 until after document load (i.e. the same timing as DOMContentLoaded).
1888 This patch introduces an SPI configuration allowing internal clients to defer execution of asynchronous script
1889 until after document load; this, in combination with the parser yielding token introduced in r233891, allows
1890 Safari on watchOS to avoid being blocked on slow script execution before the first paint of the Reader page on
1891 most article-like pages. See below for more details.
1893 Test: RunScriptAfterDocumentLoad.ExecutionOrderOfScriptsInDocument
1896 (WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
1897 (WebCore::Document::finishedParsing):
1899 Notify ScriptRunner when the Document has finished parsing, and is about to fire DOMContentLoaded.
1902 * dom/ScriptRunner.cpp:
1903 (WebCore::ScriptRunner::documentFinishedParsing):
1905 When the document is finished parsing, kick off the script execution timer if needed to run any async script
1906 that has been deferred.
1908 (WebCore::ScriptRunner::notifyFinished):
1909 (WebCore::ScriptRunner::timerFired):
1911 Instead of always taking from the list of async scripts to execute, check our document to see whether we should
1912 defer this until after document load. If so, ignore `m_scriptsToExecuteSoon`.
1914 * dom/ScriptRunner.h:
1915 * page/Settings.yaml:
1917 Add a WebCore setting for this behavior.
1919 2018-07-18 Zan Dobersek <zdobersek@igalia.com>
1921 [Nicosia] Add debug border, repaint counter state tracking to Nicosia::CompositionLayer
1922 https://bugs.webkit.org/show_bug.cgi?id=187749
1924 Reviewed by Carlos Garcia Campos.
1926 Add the RepaintCounter and DebugBorder structs to
1927 Nicosia::CompositionLayer::LayerState, tracking visibility as well as
1928 repaint count or debug color and width.
1930 Instances of RepaintCounter and DebugBorder types are kept in each
1931 CoordinatedGraphicsLayer object, updating the relevant data as it is
1932 changed (since the GraphicsLayer object isn't tracking these values on
1933 its own). During layer flush these values (if changed) are then copied
1934 over into the CompositionLayer state.
1936 * platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
1937 Also fix the year in the license header.
1938 * platform/graphics/nicosia/NicosiaPlatformLayer.h:
1939 Also fix the year in the license header.
1940 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1941 (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
1942 (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
1943 (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
1944 (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
1945 (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
1946 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1948 2018-07-18 Zan Dobersek <zdobersek@igalia.com>
1950 [CoordGraphics] Start tracking Nicosia layers in CoordinatedGraphicsState
1951 https://bugs.webkit.org/show_bug.cgi?id=187751
1953 Reviewed by Carlos Garcia Campos.
1955 Start including the Nicosia::CompositionLayer objects in the
1956 CoordinatedGraphicsState struct, under a separate NicosiaState struct.
1957 References to all the layers in a given scene are kept in a HashSet,
1958 and a separate reference to the root layer kept in a separate member
1961 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1962 (WebCore::CoordinatedGraphicsLayer::compositionLayer const):
1963 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1964 Add the getter method that returns internal Nicosia::CompositionLayer
1965 object. This can't be defined in the class definition because of
1966 WEBCORE_EXPORT used on the CoordinatedGraphicsLayer class.
1967 * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
1969 2018-07-18 Simon Fraser <simon.fraser@apple.com>
1971 Shrink CompositeAnimation and AnimationBase
1972 https://bugs.webkit.org/show_bug.cgi?id=187683
1974 Reviewed by Daniel Bates.
1976 Reduce the size of CompositeAnimation and AnimationBase.
1978 * page/animation/AnimationBase.h:
1979 * page/animation/CompositeAnimation.h:
1981 2018-07-17 Antoine Quint <graouts@apple.com>
1983 Ensure timingFunctionForKeyframeAtIndex() can be used from setAnimatedPropertiesInStyle().
1984 https://bugs.webkit.org/show_bug.cgi?id=187637
1985 <rdar://problem/42157915>
1987 Reviewed by Dean Jackson.
1989 Test: webanimations/empty-keyframes-crash.html
1991 Unlike what we assumed, it is possible to have a non-declarative animation without any parsed keyframes.
1992 This can happen as a result of calling `Element.animate({}, …)`. In this case, we want to return a null
1993 value in timingFunctionForKeyframeAtIndex() so we update the call site in setAnimatedPropertiesInStyle()
1994 which is the only place where we didn't check for a null value and didn't know for sure that there would
1995 be parsed keyframes to rely on in the case of a WebAnimation instance.
1997 * animation/KeyframeEffectReadOnly.cpp:
1998 (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
1999 (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
2001 2018-07-15 Jiewen Tan <jiewen_tan@apple.com>
2003 [WebCrypto] Crypto operations should copy their parameters before hoping to another thread
2004 https://bugs.webkit.org/show_bug.cgi?id=187501
2005 <rdar://problem/41438160>
2007 Reviewed by Youenn Fablet.
2009 This patch aims at making all captured variables in all crypto lambdas that need to be passed
2010 to a worker thread thread safe, which includes:
2011 1) changing ref counted objects to thread safe ref counted object.
2012 2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().
2014 In addition to above changes, this patch also does the following things:
2015 1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
2016 to make it clear that lambdas will be passed to a secondary thread.
2017 2) make CryptoAlgorithmParameters as const parameters for all methods.
2018 3) add null checks on BufferSource.length() and .data().
2020 Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
2021 http/wpt/crypto/aes-cbc-crash.any.html
2022 http/wpt/crypto/aes-cbc-crash.any.worker.html
2023 http/wpt/crypto/aes-ctr-crash.any.html
2024 http/wpt/crypto/aes-ctr-crash.any.worker.html
2025 http/wpt/crypto/aes-gcm-crash.any.html
2026 http/wpt/crypto/aes-gcm-crash.any.worker.html
2027 http/wpt/crypto/derive-hmac-key-crash.any.html
2028 http/wpt/crypto/derive-hmac-key-crash.any.worker.html
2029 http/wpt/crypto/ecdsa-crash.any.html
2030 http/wpt/crypto/ecdsa-crash.any.worker.html
2031 http/wpt/crypto/hkdf-crash.any.html
2032 http/wpt/crypto/hkdf-crash.any.worker.html
2033 http/wpt/crypto/pbkdf2-crash.any.html
2034 http/wpt/crypto/pbkdf2-crash.any.worker.html
2035 http/wpt/crypto/rsa-oaep-crash.any.html
2036 http/wpt/crypto/rsa-oaep-crash.any.worker.html
2037 http/wpt/crypto/rsa-pss-crash.any.html
2038 http/wpt/crypto/rsa-pss-crash.any.worker.html
2039 http/wpt/crypto/unwrap-ec-key-crash.any.html
2040 http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
2041 http/wpt/crypto/unwrap-rsa-key-crash.any.html
2042 http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html
2044 * bindings/js/BufferSource.h:
2045 (WebCore::BufferSource::data const):
2046 (WebCore::BufferSource::length const):
2047 * crypto/CryptoAlgorithm.cpp:
2048 (WebCore::CryptoAlgorithm::encrypt):
2049 (WebCore::CryptoAlgorithm::decrypt):
2050 (WebCore::CryptoAlgorithm::sign):
2051 (WebCore::CryptoAlgorithm::verify):
2052 (WebCore::CryptoAlgorithm::deriveBits):
2053 (WebCore::CryptoAlgorithm::importKey):
2054 (WebCore::dispatchAlgorithmOperation):
2055 (WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
2056 (WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
2057 * crypto/CryptoAlgorithm.h:
2058 * crypto/SubtleCrypto.cpp:
2059 (WebCore::crossThreadCopyImportParams):
2060 (WebCore::SubtleCrypto::encrypt):
2061 (WebCore::SubtleCrypto::decrypt):
2062 (WebCore::SubtleCrypto::sign):
2063 (WebCore::SubtleCrypto::verify):
2064 (WebCore::SubtleCrypto::deriveKey):
2065 (WebCore::SubtleCrypto::deriveBits):
2066 (WebCore::SubtleCrypto::importKey):
2067 (WebCore::SubtleCrypto::wrapKey):
2068 (WebCore::SubtleCrypto::unwrapKey):
2069 * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2070 (WebCore::CryptoAlgorithmAES_CBC::encrypt):
2071 (WebCore::CryptoAlgorithmAES_CBC::decrypt):
2072 (WebCore::CryptoAlgorithmAES_CBC::importKey):
2073 * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2074 * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2075 (WebCore::CryptoAlgorithmAES_CFB::encrypt):
2076 (WebCore::CryptoAlgorithmAES_CFB::decrypt):
2077 (WebCore::CryptoAlgorithmAES_CFB::importKey):
2078 * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
2079 * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2080 (WebCore::parametersAreValid):
2081 (WebCore::CryptoAlgorithmAES_CTR::encrypt):
2082 (WebCore::CryptoAlgorithmAES_CTR::decrypt):
2083 (WebCore::CryptoAlgorithmAES_CTR::importKey):
2084 * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
2085 * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2086 (WebCore::CryptoAlgorithmAES_GCM::encrypt):
2087 (WebCore::CryptoAlgorithmAES_GCM::decrypt):
2088 (WebCore::CryptoAlgorithmAES_GCM::importKey):
2089 * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
2090 * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2091 (WebCore::CryptoAlgorithmAES_KW::importKey):
2092 * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2093 * crypto/algorithms/CryptoAlgorithmECDH.cpp:
2094 (WebCore::CryptoAlgorithmECDH::deriveBits):
2095 (WebCore::CryptoAlgorithmECDH::importKey):
2096 * crypto/algorithms/CryptoAlgorithmECDH.h:
2097 * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
2098 (WebCore::CryptoAlgorithmECDSA::sign):
2099 (WebCore::CryptoAlgorithmECDSA::verify):
2100 (WebCore::CryptoAlgorithmECDSA::importKey):
2101 * crypto/algorithms/CryptoAlgorithmECDSA.h:
2102 * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
2103 (WebCore::CryptoAlgorithmHKDF::deriveBits):
2104 (WebCore::CryptoAlgorithmHKDF::importKey):
2105 * crypto/algorithms/CryptoAlgorithmHKDF.h:
2106 * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2107 (WebCore::CryptoAlgorithmHMAC::sign):
2108 (WebCore::CryptoAlgorithmHMAC::verify):
2109 (WebCore::CryptoAlgorithmHMAC::importKey):
2110 * crypto/algorithms/CryptoAlgorithmHMAC.h:
2111 * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
2112 (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
2113 (WebCore::CryptoAlgorithmPBKDF2::importKey):
2114 * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
2115 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2116 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
2117 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
2118 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
2119 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2120 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2121 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
2122 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
2123 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
2124 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2125 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2126 (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
2127 (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
2128 (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
2129 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2130 * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
2131 (WebCore::CryptoAlgorithmRSA_PSS::sign):
2132 (WebCore::CryptoAlgorithmRSA_PSS::verify):
2133 (WebCore::CryptoAlgorithmRSA_PSS::importKey):
2134 * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
2135 * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
2136 (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2137 (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2138 * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
2139 (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2140 (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2141 * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
2142 (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2143 (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2144 * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
2145 (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2146 (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2147 * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
2148 (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2149 * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
2150 (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2151 * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
2152 (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2153 (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2154 * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
2155 (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2156 (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2157 * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2158 (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2159 (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2160 * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
2161 (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2162 (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2163 * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
2164 (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2165 (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2166 * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
2167 (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2168 (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2169 * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
2170 (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2171 * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
2172 (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2173 * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
2174 (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2175 (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2176 * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
2177 (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2178 (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2179 * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
2180 * crypto/parameters/CryptoAlgorithmAesCtrParams.h:
2181 * crypto/parameters/CryptoAlgorithmAesGcmParams.h:
2182 * crypto/parameters/CryptoAlgorithmEcKeyParams.h:
2183 * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
2184 * crypto/parameters/CryptoAlgorithmHkdfParams.h:
2185 * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
2186 * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
2187 * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
2188 * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
2189 * crypto/parameters/CryptoAlgorithmRsaPssParams.h:
2191 2018-07-17 Antoine Quint <graouts@apple.com>
2193 [Web Animations] Interpolation between lengths with an "auto" value should be discrete
2194 https://bugs.webkit.org/show_bug.cgi?id=187721
2196 Reviewed by Dean Jackson.
2198 When interpolating between two Length values, if one is "auto", we should use the from-value
2199 from 0 and up to (but excluding) 0.5, and use the to-value from 0.5 to 1.
2201 This change caused a regression in the legacy animation engine since it would create a CSS
2202 transition even when the underlying and target values were non-interpolable. As such, the
2203 underlying value would be used until the transition's mid-point and the tests at
2204 legacy-animation-engine/imported/blink/transitions/transition-not-interpolable.html and
2205 legacy-animation-engine/fast/animation/height-auto-transition-computed-value.html would fail
2206 expecting the target value to be used immediately. We now ensure that no transition is actually
2207 started if two values for a given property cannot be interpolated.
2209 * page/animation/CompositeAnimation.cpp:
2210 (WebCore::CompositeAnimation::updateTransitions):
2211 * platform/Length.cpp:
2214 2018-07-17 Wenson Hsieh <wenson_hsieh@apple.com>
2216 Add an SPI hook to allow clients to yield document parsing and script execution
2217 https://bugs.webkit.org/show_bug.cgi?id=187682
2218 <rdar://problem/42207453>
2220 Reviewed by Ryosuke Niwa.
2222 Using a single web process for both the Reader page and original web page on watchOS has multiple benefits,
2223 including: (1) allowing the user to bail out of Reader and view the original web page without having to load it
2224 again, and (2) improving the bringup time of the Reader page, since subresources are already cached in process
2225 and we don't eat the additional cost of a web process launch if prewarming fails.
2227 However, this has some drawbacks as well, one of which is that main thread work being done on behalf of the
2228 original page may contend with work being done to load and render the Reader page. This is especially bad when
2229 the page is in the middle of executing heavy script after Safari has already detected that the Reader version of
2230 the page is available, but before it has finished loading the Reader page. The result is that script on the
2231 original page may block the first paint of the Reader page (on New York Times articles, this often leads to an
2232 apparent page load time of 25-35 seconds before the user sees anything besides a blank screen).
2234 To mitigate this, we introduce a way for injected bundle clients to yield parsing and async script execution on
2235 a document. This capability is surfaced in the form of an opaque token which clients may request from a
2236 WKDOMDocument. Construction of the token causes the document to begin yielding and defer execution of previously
2237 scheduled scripts, only if there were no active tokens on the document already. Similarly, destruction of all
2238 active tokens on the document causes it to stop yielding and resume execution of scripts if needed.
2240 Tests: ParserYieldTokenTests.PreventDocumentLoadByTakingParserYieldToken
2241 ParserYieldTokenTests.TakeMultipleParserYieldTokens
2242 ParserYieldTokenTests.DeferredScriptExecutesBeforeDocumentLoadWhenTakingParserYieldToken
2243 ParserYieldTokenTests.AsyncScriptRunsWhenFetched
2246 (WebCore::Document::implicitOpen):
2248 If the parser yield token was taken before the document's parser was created, tell the parser's scheduler to
2249 start yielding immediately after creation.
2251 (WebCore::DocumentParserYieldToken::DocumentParserYieldToken):
2252 (WebCore::DocumentParserYieldToken::~DocumentParserYieldToken):
2255 Introduce a parser yield count to Document; as long as this count is greater than 0, we consider the Document to
2256 have active yield tokens. When constructing or destroying a ParserYieldToken, we increment and decrement the
2257 parser yield count (respectively).
2259 (WebCore::Document::createParserYieldToken):
2260 (WebCore::Document::hasActiveParserYieldToken const):
2261 * dom/DocumentParser.h:
2262 (WebCore::DocumentParser::didBeginYieldingParser):
2263 (WebCore::DocumentParser::didEndYieldingParser):
2265 Hooks for Document to tell its parser that we've started or finished yielding. This updates a flag on the
2266 parser's scheduler which is consulted when we determine whether to yield before a pumping token or executing
2269 * dom/ScriptRunner.cpp:
2270 (WebCore::ScriptRunner::resume):
2271 (WebCore::ScriptRunner::notifyFinished):
2272 * dom/ScriptRunner.h:
2273 (WebCore::ScriptRunner::didBeginYieldingParser):
2274 (WebCore::ScriptRunner::didEndYieldingParser):
2276 Hooks for Document to tell its ScriptRunner that we've started or finished yielding. These wrap calls to suspend
2279 * html/parser/HTMLDocumentParser.cpp:
2280 (WebCore::HTMLDocumentParser::didBeginYieldingParser):
2281 (WebCore::HTMLDocumentParser::didEndYieldingParser):
2283 Plumb to didBegin/didEnd calls to the HTMLParserScheduler.
2285 * html/parser/HTMLDocumentParser.h:
2286 * html/parser/HTMLParserScheduler.cpp:
2287 (WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
2288 * html/parser/HTMLParserScheduler.h:
2289 (WebCore::HTMLParserScheduler::shouldYieldBeforeToken):
2291 Consult a flag when determining whether to yield. This flag is set to true only while the document has an active
2294 (WebCore::HTMLParserScheduler::isScheduledForResume const):
2296 Consider the parser scheduler to be scheduled for resume if there are active tokens. Without this change, we
2297 incorrectly consider the document to be finished loading when we have yield tokens, since it appears that the
2298 parser is no longer scheduled to pump its tokenizer.
2300 (WebCore::HTMLParserScheduler::didBeginYieldingParser):
2301 (WebCore::HTMLParserScheduler::didEndYieldingParser):
2303 When the Document begins yielding due to the documet having active tokens or ends yielding after the document
2304 loses all of its yield tokens, update a flag on the parser scheduler. After we finish yielding, additionally
2305 reschedule the parser if needed to ensure that we continue parsing the document; without this additional change
2306 to resume, we'll never get the document load or load events after relinquishing the yield token.
2308 2018-07-17 Dirk Schulze <krit@webkit.org>
2310 [clip-path] Implement support for margin-box as reference box and box shape
2311 https://bugs.webkit.org/show_bug.cgi?id=127984
2313 Reviewed by Simon Fraser.
2315 Compute the margin-box rectangle as needed for clip-path based on the actual
2316 computed values for the margin-top, *-left, *-bottom, *-right properties.
2318 Test: css3/masking/clip-path-margin-box.html
2320 * rendering/RenderBox.h:
2321 (WebCore::RenderBox::marginBoxRect const):
2322 * rendering/RenderBoxModelObject.h:
2323 * rendering/RenderLayer.cpp:
2324 (WebCore::computeReferenceBox):
2326 2018-07-17 Javier Fernandez <jfernandez@igalia.com>
2328 Delete content of a single cell table should not delete the whole table
2329 https://bugs.webkit.org/show_bug.cgi?id=173117
2331 Reviewed by Ryosuke Niwa.
2333 We should not extend selection looking for special elements if the
2334 delete operation has been triggered by a caret based selection.
2336 This change is based on a recent [1] resolution of the Editing TF,
2337 which acknowledges that behavior of single-cell tables must be the
2338 same that multi-cell tables and even if the last character is
2339 deleted, we should not delete the whole table structure.
2341 A different case would be when the user actively selects the whole
2342 content of a table; in this case, as we do in multi-cell tables,
2343 the structure of single-cell tables should be deleted together
2346 [1] https://github.com/w3c/editing/issues/163
2348 Tests: editing/deleting/backspace-delete-last-char-in-table.html
2349 editing/deleting/forward-delete-last-char-in-table.html
2350 editing/deleting/select-and-delete-last-char-in-table.html
2352 * editing/TypingCommand.cpp:
2353 (WebCore::TypingCommand::deleteKeyPressed):
2354 (WebCore::TypingCommand::forwardDeleteKeyPressed):
2356 2018-07-16 Megan Gardner <megan_gardner@apple.com>
2358 Correctly adjust scroll offsets when a page is zoomed
2359 https://bugs.webkit.org/show_bug.cgi?id=187673
2360 <rdar://problem/41712829>
2362 Reviewed by Wenson Hsieh.
2364 Will add test later.
2366 Make sure that distance is scaled by the pageScaleFactor, to
2367 make sure that we scroll correctly when we are zoomed in.
2369 * page/ios/EventHandlerIOS.mm:
2370 (WebCore::autoscrollAdjustmentFactorForScreenBoundaries):
2372 2018-07-16 Simon Fraser <simon.fraser@apple.com>
2374 Roll out r233873 and r233875 since they caused 8 new layout test crashes.
2376 * crypto/CryptoAlgorithm.cpp:
2377 (WebCore::CryptoAlgorithm::encrypt):
2378 (WebCore::CryptoAlgorithm::decrypt):
2379 (WebCore::CryptoAlgorithm::sign):
2380 (WebCore::CryptoAlgorithm::verify):
2381 (WebCore::CryptoAlgorithm::deriveBits):
2382 (WebCore::CryptoAlgorithm::importKey):
2383 (WebCore::dispatchAlgorithmOperation):
2384 (WebCore::CryptoAlgorithm::dispatchOperation):
2385 (WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue): Deleted.
2386 * crypto/CryptoAlgorithm.h:
2387 * crypto/SubtleCrypto.cpp:
2388 (WebCore::SubtleCrypto::encrypt):
2389 (WebCore::SubtleCrypto::decrypt):
2390 (WebCore::SubtleCrypto::sign):
2391 (WebCore::SubtleCrypto::verify):
2392 (WebCore::SubtleCrypto::deriveKey):
2393 (WebCore::SubtleCrypto::deriveBits):
2394 (WebCore::SubtleCrypto::importKey):
2395 (WebCore::SubtleCrypto::wrapKey):
2396 (WebCore::SubtleCrypto::unwrapKey):
2397 (WebCore::crossThreadCopyImportParams): Deleted.
2398 * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2399 (WebCore::CryptoAlgorithmAES_CBC::encrypt):
2400 (WebCore::CryptoAlgorithmAES_CBC::decrypt):
2401 (WebCore::CryptoAlgorithmAES_CBC::importKey):
2402 * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2403 * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2404 (WebCore::CryptoAlgorithmAES_CFB::encrypt):
2405 (WebCore::CryptoAlgorithmAES_CFB::decrypt):
2406 (WebCore::CryptoAlgorithmAES_CFB::importKey):
2407 * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
2408 * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2409 (WebCore::parametersAreValid):
2410 (WebCore::CryptoAlgorithmAES_CTR::encrypt):
2411 (WebCore::CryptoAlgorithmAES_CTR::decrypt):
2412 (WebCore::CryptoAlgorithmAES_CTR::importKey):
2413 * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
2414 * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2415 (WebCore::CryptoAlgorithmAES_GCM::encrypt):
2416 (WebCore::CryptoAlgorithmAES_GCM::decrypt):
2417 (WebCore::CryptoAlgorithmAES_GCM::importKey):
2418 * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
2419 * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2420 (WebCore::CryptoAlgorithmAES_KW::importKey):
2421 * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2422 * crypto/algorithms/CryptoAlgorithmECDH.cpp:
2423 (WebCore::CryptoAlgorithmECDH::deriveBits):
2424 (WebCore::CryptoAlgorithmECDH::importKey):
2425 * crypto/algorithms/CryptoAlgorithmECDH.h:
2426 * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
2427 (WebCore::CryptoAlgorithmECDSA::sign):
2428 (WebCore::CryptoAlgorithmECDSA::verify):
2429 (WebCore::CryptoAlgorithmECDSA::importKey):
2430 * crypto/algorithms/CryptoAlgorithmECDSA.h:
2431 * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
2432 (WebCore::CryptoAlgorithmHKDF::deriveBits):
2433 (WebCore::CryptoAlgorithmHKDF::importKey):
2434 * crypto/algorithms/CryptoAlgorithmHKDF.h:
2435 * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2436 (WebCore::CryptoAlgorithmHMAC::sign):
2437 (WebCore::CryptoAlgorithmHMAC::verify):
2438 (WebCore::CryptoAlgorithmHMAC::importKey):
2439 * crypto/algorithms/CryptoAlgorithmHMAC.h:
2440 * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
2441 (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
2442 (WebCore::CryptoAlgorithmPBKDF2::importKey):
2443 * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
2444 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2445 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
2446 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
2447 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
2448 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2449 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2450 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
2451 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
2452 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
2453 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2454 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2455 (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
2456 (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
2457 (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
2458 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2459 * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
2460 (WebCore::CryptoAlgorithmRSA_PSS::sign):
2461 (WebCore::CryptoAlgorithmRSA_PSS::verify):
2462 (WebCore::CryptoAlgorithmRSA_PSS::importKey):
2463 * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
2464 * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
2465 (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2466 (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2467 * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
2468 (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2469 (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2470 * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
2471 (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2472 (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2473 * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
2474 (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2475 (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2476 * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
2477 (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2478 * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
2479 (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2480 * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
2481 (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2482 (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2483 * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
2484 (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2485 (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2486 * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2487 (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2488 (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2489 * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
2490 (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2491 (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2492 * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
2493 (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2494 (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2495 * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
2496 (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2497 (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2498 * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
2499 (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2500 * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
2501 (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2502 * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
2503 (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2504 (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2505 * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
2506 (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2507 (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2508 * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
2509 * crypto/parameters/CryptoAlgorithmAesCtrParams.h:
2510 * crypto/parameters/CryptoAlgorithmAesGcmParams.h:
2511 * crypto/parameters/CryptoAlgorithmEcKeyParams.h:
2512 * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
2513 * crypto/parameters/CryptoAlgorithmHkdfParams.h:
2514 * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
2515 * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
2516 * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
2517 * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
2518 * crypto/parameters/CryptoAlgorithmRsaPssParams.h:
2520 2018-07-16 Ryosuke Niwa <rniwa@webkit.org>
2522 Release assert in ~TimerBase is getting hit in WK1 apps which uses JSC API directly
2523 https://bugs.webkit.org/show_bug.cgi?id=187713
2524 <rdar://problem/41759548>
2526 Reviewed by Simon Fraser.
2528 Turn this into a debug assertion in WebKit1 on iOS since JSC API doesn't grab the web thread lock,
2529 which means that Timer can get destroyed without the web thread lock in the main thread.
2531 * platform/Timer.cpp:
2532 (WebCore::TimerBase::~TimerBase):
2533 (WebCore::TimerBase::setNextFireTime):
2535 2018-07-16 Simon Fraser <simon.fraser@apple.com>
2537 Add color filter for transforming colors in Dark Mode
2538 https://bugs.webkit.org/show_bug.cgi?id=187717
2539 rdar://problem/41146650
2541 Reviewed by Dean Jackson.
2543 Add a new filter function for use in -apple-color-filter for transforming colors
2544 when in Dark Mode. The filter is called apple-invert-lightness(), and takes no parameters.
2545 It's based on a lightness invert in HSL space, with some adjustments to improve the contrast
2546 of some colors on dark backgrounds, so does a much better job that using invert() with hue-rotate().
2548 Test: css3/color-filters/color-filter-apple-invert-lightness.html
2550 * css/CSSComputedStyleDeclaration.cpp:
2551 (WebCore::ComputedStyleExtractor::valueForFilter):
2552 * css/CSSValueKeywords.in:
2553 * css/StyleResolver.cpp:
2554 (WebCore::filterOperationForType):
2555 (WebCore::StyleResolver::createFilterOperations):
2556 * css/parser/CSSPropertyParser.cpp:
2557 (WebCore::CSSPropertyParser::parseSingleValue):
2558 * css/parser/CSSPropertyParserHelpers.cpp:
2559 (WebCore::CSSPropertyParserHelpers::consumeFilterImage):
2560 (WebCore::CSSPropertyParserHelpers::isPixelFilterFunction):
2561 (WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
2562 (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
2563 (WebCore::CSSPropertyParserHelpers::consumeFilter):
2564 (WebCore::CSSPropertyParserHelpers::isValidPrimitiveFilterFunction): Deleted.
2565 * css/parser/CSSPropertyParserHelpers.h:
2566 * page/FrameView.cpp:
2567 (WebCore::FrameView::paintContents):
2568 * platform/graphics/Color.cpp:
2569 * platform/graphics/ColorUtilities.cpp:
2570 (WebCore::sRGBToLinearComponents):
2571 (WebCore::linearToSRGBComponents):
2572 (WebCore::sRGBToLinearColorComponentForLuminance):
2573 (WebCore::luminance):
2574 (WebCore::sRGBToHSL):
2576 (WebCore::HSLToSRGB):
2577 (WebCore::ColorMatrix::ColorMatrix):
2578 * platform/graphics/ColorUtilities.h:
2579 * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
2580 (PlatformCAFilters::filterValueForOperation):
2581 (PlatformCAFilters::colorMatrixValueForFilter):
2582 * platform/graphics/filters/FEColorMatrix.cpp:
2583 * platform/graphics/filters/FilterOperation.cpp:
2584 (WebCore::InvertLightnessFilterOperation::operator== const):
2585 (WebCore::InvertLightnessFilterOperation::blend):
2586 (WebCore::InvertLightnessFilterOperation::transformColor const):
2587 (WebCore::operator<<):
2588 * platform/graphics/filters/FilterOperation.h:
2589 * rendering/FilterEffectRenderer.cpp:
2590 (WebCore::FilterEffectRenderer::build):
2592 2018-07-16 Jiewen Tan <jiewen_tan@apple.com>
2594 Unreviewed, build fix for r233873.
2596 * crypto/SubtleCrypto.cpp:
2597 (WebCore::crossThreadCopyImportParams):
2599 2018-07-15 Jiewen Tan <jiewen_tan@apple.com>
2601 [WebCrypto] Crypto operations should copy their parameters before hoping to another thread
2602 https://bugs.webkit.org/show_bug.cgi?id=187501
2603 <rdar://problem/41438160>
2605 Reviewed by Youenn Fablet.
2607 This patch aims at making all captured variables in all crypto lambdas that need to be passed
2608 to a worker thread thread safe, which includes:
2609 1) changing ref counted objects to thread safe ref counted object.
2610 2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().
2612 In addition to above changes, this patch also does the following things:
2613 1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
2614 to make it clear that lambdas will be passed to a secondary thread.
2615 2) make CryptoAlgorithmParameters as const parameters for all methods.
2617 Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
2618 http/wpt/crypto/aes-cbc-crash.any.html
2619 http/wpt/crypto/aes-cbc-crash.any.worker.html
2620 http/wpt/crypto/aes-ctr-crash.any.html
2621 http/wpt/crypto/aes-ctr-crash.any.worker.html
2622 http/wpt/crypto/aes-gcm-crash.any.html
2623 http/wpt/crypto/aes-gcm-crash.any.worker.html
2624 http/wpt/crypto/derive-hmac-key-crash.any.html
2625 http/wpt/crypto/derive-hmac-key-crash.any.worker.html
2626 http/wpt/crypto/ecdsa-crash.any.html
2627 http/wpt/crypto/ecdsa-crash.any.worker.html
2628 http/wpt/crypto/hkdf-crash.any.html
2629 http/wpt/crypto/hkdf-crash.any.worker.html
2630 http/wpt/crypto/pbkdf2-crash.any.html
2631 http/wpt/crypto/pbkdf2-crash.any.worker.html
2632 http/wpt/crypto/rsa-oaep-crash.any.html
2633 http/wpt/crypto/rsa-oaep-crash.any.worker.html
2634 http/wpt/crypto/rsa-pss-crash.any.html
2635 http/wpt/crypto/rsa-pss-crash.any.worker.html
2636 http/wpt/crypto/unwrap-ec-key-crash.any.html
2637 http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
2638 http/wpt/crypto/unwrap-rsa-key-crash.any.html
2639 http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html
2641 * crypto/CryptoAlgorithm.cpp:
2642 (WebCore::CryptoAlgorithm::encrypt):
2643 (WebCore::CryptoAlgorithm::decrypt):
2644 (WebCore::CryptoAlgorithm::sign):
2645 (WebCore::CryptoAlgorithm::verify):
2646 (WebCore::CryptoAlgorithm::deriveBits):
2647 (WebCore::CryptoAlgorithm::importKey):
2648 (WebCore::dispatchAlgorithmOperation):
2649 (WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
2650 (WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
2651 * crypto/CryptoAlgorithm.h:
2652 * crypto/SubtleCrypto.cpp:
2653 (WebCore::crossThreadCopyImportParams):
2654 (WebCore::SubtleCrypto::encrypt):
2655 (WebCore::SubtleCrypto::decrypt):
2656 (WebCore::SubtleCrypto::sign):
2657 (WebCore::SubtleCrypto::verify):
2658 (WebCore::SubtleCrypto::deriveKey):
2659 (WebCore::SubtleCrypto::deriveBits):
2660 (WebCore::SubtleCrypto::importKey):
2661 (WebCore::SubtleCrypto::wrapKey):
2662 (WebCore::SubtleCrypto::unwrapKey):
2663 * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2664 (WebCore::CryptoAlgorithmAES_CBC::encrypt):
2665 (WebCore::CryptoAlgorithmAES_CBC::decrypt):
2666 (WebCore::CryptoAlgorithmAES_CBC::importKey):
2667 * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2668 * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2669 (WebCore::CryptoAlgorithmAES_CFB::encrypt):
2670 (WebCore::CryptoAlgorithmAES_CFB::decrypt):
2671 (WebCore::CryptoAlgorithmAES_CFB::importKey):
2672 * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
2673 * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2674 (WebCore::parametersAreValid):
2675 (WebCore::CryptoAlgorithmAES_CTR::encrypt):
2676 (WebCore::CryptoAlgorithmAES_CTR::decrypt):
2677 (WebCore::CryptoAlgorithmAES_CTR::importKey):
2678 * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
2679 * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2680 (WebCore::CryptoAlgorithmAES_GCM::encrypt):
2681 (WebCore::CryptoAlgorithmAES_GCM::decrypt):
2682 (WebCore::CryptoAlgorithmAES_GCM::importKey):
2683 * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
2684 * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2685 (WebCore::CryptoAlgorithmAES_KW::importKey):
2686 * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2687 * crypto/algorithms/CryptoAlgorithmECDH.cpp:
2688 (WebCore::CryptoAlgorithmECDH::deriveBits):
2689 (WebCore::CryptoAlgorithmECDH::importKey):
2690 * crypto/algorithms/CryptoAlgorithmECDH.h:
2691 * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
2692 (WebCore::CryptoAlgorithmECDSA::sign):
2693 (WebCore::CryptoAlgorithmECDSA::verify):
2694 (WebCore::CryptoAlgorithmECDSA::importKey):
2695 * crypto/algorithms/CryptoAlgorithmECDSA.h:
2696 * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
2697 (WebCore::CryptoAlgorithmHKDF::deriveBits):
2698 (WebCore::CryptoAlgorithmHKDF::importKey):
2699 * crypto/algorithms/CryptoAlgorithmHKDF.h:
2700 * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2701 (WebCore::CryptoAlgorithmHMAC::sign):
2702 (WebCore::CryptoAlgorithmHMAC::verify):
2703 (WebCore::CryptoAlgorithmHMAC::importKey):
2704 * crypto/algorithms/CryptoAlgorithmHMAC.h:
2705 * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
2706 (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
2707 (WebCore::CryptoAlgorithmPBKDF2::importKey):
2708 * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
2709 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2710 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
2711 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
2712 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
2713 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2714 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2715 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
2716 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
2717 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
2718 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2719 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2720 (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
2721 (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
2722 (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
2723 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2724 * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
2725 (WebCore::CryptoAlgorithmRSA_PSS::sign):
2726 (WebCore::CryptoAlgorithmRSA_PSS::verify):
2727 (WebCore::CryptoAlgorithmRSA_PSS::importKey):
2728 * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
2729 * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
2730 (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2731 (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2732 * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
2733 (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2734 (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2735 * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
2736 (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2737 (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2738 * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
2739 (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2740 (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2741 * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
2742 (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2743 * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
2744 (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2745 * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
2746 (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2747 (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2748 * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
2749 (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2750 (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2751 * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2752 (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2753 (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2754 * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
2755 (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2756 (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2757 * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
2758 (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2759 (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2760 * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
2761 (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2762 (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2763 * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
2764 (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2765 * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
2766 (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2767 * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
2768 (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2769 (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2770 * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
2771 (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2772 (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2773 * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
2774 * crypto/parameters/CryptoAlgorithmAesCtrParams.h:
2775 * crypto/parameters/CryptoAlgorithmAesGcmParams.h:
2776 * crypto/parameters/CryptoAlgorithmEcKeyParams.h:
2777 * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
2778 * crypto/parameters/CryptoAlgorithmHkdfParams.h:
2779 * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
2780 * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
2781 * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
2782 * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
2783 * crypto/parameters/CryptoAlgorithmRsaPssParams.h:
2785 2018-07-16 Said Abou-Hallawa <sabouhallawa@apple.com>
2787 [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the flush immediate transaction
2788 https://bugs.webkit.org/show_bug.cgi?id=187375
2790 Reviewed by Simon Fraser.
2792 An immediate-paint transaction should force all the images which are pending
2793 decoding to be repainted.
2795 To do that, FrameView::paintControlTints() will be re-factored to a new
2796 generic function such that it takes PaintInvalidationReasons. The new function
2797 which is named 'traverseForPaintInvalidation' will traverse the render tree
2798 for a specific PaintInvalidationReasons.
2800 invalidateImagesWithAsyncDecodes() will stop the asynchronous decoding for
2801 the underlying image and repaint all the clients which are waiting for the
2804 * loader/cache/CachedImage.cpp:
2805 (WebCore::CachedImage::didRemoveClient):
2806 (WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
2807 (WebCore::CachedImage::addClientWaitingForAsyncDecoding):
2808 (WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
2809 (WebCore::CachedImage::allClientsRemoved):
2810 (WebCore::CachedImage::clear):
2811 (WebCore::CachedImage::createImage):
2812 (WebCore::CachedImage::imageFrameAvailable):
2813 (WebCore::CachedImage::addPendingImageDrawingClient): Deleted.
2814 * loader/cache/CachedImage.h:
2815 * page/FrameView.cpp:
2816 (WebCore::FrameView::paintScrollCorner):
2817 (WebCore::FrameView::updateControlTints):
2818 (WebCore::FrameView::traverseForPaintInvalidation):
2819 (WebCore::FrameView::adjustPageHeightDeprecated):
2820 (WebCore::FrameView::paintControlTints): Deleted.
2822 * platform/ScrollView.cpp:
2823 (WebCore::ScrollView::paint):
2824 * platform/Scrollbar.cpp:
2825 (WebCore::Scrollbar::paint):
2826 * platform/graphics/BitmapImage.h:
2827 * platform/graphics/GraphicsContext.cpp:
2828 (WebCore::GraphicsContext::GraphicsContext):
2829 * platform/graphics/GraphicsContext.h:
2830 (WebCore::GraphicsContext::performingPaintInvalidation const):
2831 (WebCore::GraphicsContext::invalidatingControlTints const):
2832 (WebCore::GraphicsContext::invalidatingImagesWithAsyncDecodes const):
2833 (WebCore::GraphicsContext::updatingControlTints const): Deleted.
2834 * rendering/RenderBoxModelObject.cpp:
2835 (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2836 * rendering/RenderImage.cpp:
2837 (WebCore::RenderImage::paintReplaced):
2838 (WebCore::RenderImage::paintAreaElementFocusRing):
2839 (WebCore::RenderImage::paintIntoRect):
2840 * rendering/RenderLayer.cpp:
2841 (WebCore::RenderLayer::paintScrollCorner):
2842 (WebCore::RenderLayer::paintResizer):
2843 (WebCore::RenderLayer::paintLayer):
2844 * rendering/RenderScrollbar.cpp:
2845 (WebCore::RenderScrollbar::paint):
2846 * rendering/RenderTheme.cpp:
2847 (WebCore::RenderTheme::paint):
2848 * testing/Internals.cpp:
2849 (WebCore::Internals::invalidateControlTints):
2850 (WebCore::Internals::paintControlTints): Deleted.
2851 * testing/Internals.h:
2852 * testing/Internals.idl:
2854 2018-07-16 Ryan Haddad <ryanhaddad@apple.com>
2856 Unreviewed attempt to fix the build.
2858 * rendering/RenderThemeMac.mm:
2860 2018-07-11 Dean Jackson <dino@apple.com>
2862 Allow removal of white backgrounds
2863 https://bugs.webkit.org/show_bug.cgi?id=187574
2864 <rdar://problem/41146792>
2866 Reviewed by Simon Fraser.
2868 Add a drawing mode that turns white backgrounds into transparent
2869 regions, such that a hosting app can see through to its window.
2871 Test: css3/color-filters/punch-out-white-backgrounds.html
2873 * page/Settings.yaml: New Setting.
2875 * rendering/InlineFlowBox.cpp: Draw with a destination out blend mode
2876 if the background is white and we are punching out backgrounds, which means
2877 that it will erase the destination.
2878 (WebCore::InlineFlowBox::paintBoxDecorations):
2879 * rendering/RenderBox.cpp:
2880 (WebCore::RenderBox::paintBackground): Ditto.
2881 * rendering/RenderTableCell.cpp:
2882 (WebCore::RenderTableCell::paintBackgroundsBehindCell): Ditto.
2884 * rendering/RenderBoxModelObject.cpp:
2885 (WebCore::RenderBoxModelObject::paintFillLayerExtended): Save and restore
2886 the composition mode if necessary.
2888 2018-07-16 David Fenton <david_fenton@apple.com>
2890 Unreviewed, rolling out r233867.
2892 caused build failures on High Sierra, Sierra and iOS
2896 "[WebCrypto] Crypto operations should copy their parameters
2897 before hoping to another thread"
2898 https://bugs.webkit.org/show_bug.cgi?id=187501
2899 https://trac.webkit.org/changeset/233867
2901 2018-07-15 Jiewen Tan <jiewen_tan@apple.com>
2903 [WebCrypto] Crypto operations should copy their parameters before hoping to another thread
2904 https://bugs.webkit.org/show_bug.cgi?id=187501
2905 <rdar://problem/41438160>
2907 Reviewed by Youenn Fablet.
2909 This patch aims at making all captured variables in all crypto lambdas that need to be passed
2910 to a worker thread thread safe, which includes:
2911 1) changing ref counted objects to thread safe ref counted object.
2912 2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().
2914 In addition to above changes, this patch also does the following things:
2915 1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
2916 to make it clear that lambdas will be passed to a secondary thread.
2917 2) make CryptoAlgorithmParameters as const parameters for all methods.
2919 Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
2920 http/wpt/crypto/aes-cbc-crash.any.html
2921 http/wpt/crypto/aes-cbc-crash.any.worker.html
2922 http/wpt/crypto/aes-ctr-crash.any.html
2923 http/wpt/crypto/aes-ctr-crash.any.worker.html
2924 http/wpt/crypto/aes-gcm-crash.any.html
2925 http/wpt/crypto/aes-gcm-crash.any.worker.html
2926 http/wpt/crypto/derive-hmac-key-crash.any.html
2927 http/wpt/crypto/derive-hmac-key-crash.any.worker.html
2928 http/wpt/crypto/ecdsa-crash.any.html
2929 http/wpt/crypto/ecdsa-crash.any.worker.html
2930 http/wpt/crypto/hkdf-crash.any.html
2931 http/wpt/crypto/hkdf-crash.any.worker.html
2932 http/wpt/crypto/pbkdf2-crash.any.html
2933 http/wpt/crypto/pbkdf2-crash.any.worker.html
2934 http/wpt/crypto/rsa-oaep-crash.any.html
2935 http/wpt/crypto/rsa-oaep-crash.any.worker.html
2936 http/wpt/crypto/rsa-pss-crash.any.html
2937 http/wpt/crypto/rsa-pss-crash.any.worker.html
2938 http/wpt/crypto/unwrap-ec-key-crash.any.html
2939 http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
2940 http/wpt/crypto/unwrap-rsa-key-crash.any.html
2941 http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html
2943 * crypto/CryptoAlgorithm.cpp:
2944 (WebCore::CryptoAlgorithm::encrypt):
2945 (WebCore::CryptoAlgorithm::decrypt):
2946 (WebCore::CryptoAlgorithm::sign):
2947 (WebCore::CryptoAlgorithm::verify):
2948 (WebCore::CryptoAlgorithm::deriveBits):
2949 (WebCore::CryptoAlgorithm::importKey):
2950 (WebCore::dispatchAlgorithmOperation):
2951 (WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
2952 (WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
2953 * crypto/CryptoAlgorithm.h:
2954 * crypto/SubtleCrypto.cpp:
2955 (WebCore::crossThreadCopyImportParams):
2956 (WebCore::SubtleCrypto::encrypt):
2957 (WebCore::SubtleCrypto::decrypt):
2958 (WebCore::SubtleCrypto::sign):
2959 (WebCore::SubtleCrypto::verify):
2960 (WebCore::SubtleCrypto::deriveKey):
2961 (WebCore::SubtleCrypto::deriveBits):
2962 (WebCore::SubtleCrypto::importKey):
2963 (WebCore::SubtleCrypto::wrapKey):
2964 (WebCore::SubtleCrypto::unwrapKey):
2965 * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2966 (WebCore::CryptoAlgorithmAES_CBC::encrypt):
2967 (WebCore::CryptoAlgorithmAES_CBC::decrypt):
2968 (WebCore::CryptoAlgorithmAES_CBC::importKey):
2969 * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2970 * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2971 (WebCore::CryptoAlgorithmAES_CFB::encrypt):
2972 (WebCore::CryptoAlgorithmAES_CFB::decrypt):
2973 (WebCore::CryptoAlgorithmAES_CFB::importKey):
2974 * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
2975 * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2976 (WebCore::parametersAreValid):
2977 (WebCore::CryptoAlgorithmAES_CTR::encrypt):
2978 (WebCore::CryptoAlgorithmAES_CTR::decrypt):
2979 (WebCore::CryptoAlgorithmAES_CTR::importKey):
2980 * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
2981 * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2982 (WebCore::CryptoAlgorithmAES_GCM::encrypt):
2983 (WebCore::CryptoAlgorithmAES_GCM::decrypt):
2984 (WebCore::CryptoAlgorithmAES_GCM::importKey):
2985 * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
2986 * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2987 (WebCore::CryptoAlgorithmAES_KW::importKey):
2988 * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2989 * crypto/algorithms/CryptoAlgorithmECDH.cpp:
2990 (WebCore::CryptoAlgorithmECDH::deriveBits):
2991 (WebCore::CryptoAlgorithmECDH::importKey):
2992 * crypto/algorithms/CryptoAlgorithmECDH.h:
2993 * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
2994 (WebCore::CryptoAlgorithmECDSA::sign):
2995 (WebCore::CryptoAlgorithmECDSA::verify):
2996 (WebCore::CryptoAlgorithmECDSA::importKey):
2997 * crypto/algorithms/CryptoAlgorithmECDSA.h:
2998 * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
2999 (WebCore::CryptoAlgorithmHKDF::deriveBits):
3000 (WebCore::CryptoAlgorithmHKDF::importKey):
3001 * crypto/algorithms/CryptoAlgorithmHKDF.h:
3002 * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
3003 (WebCore::CryptoAlgorithmHMAC::sign):
3004 (WebCore::CryptoAlgorithmHMAC::verify):
3005 (WebCore::CryptoAlgorithmHMAC::importKey):
3006 * crypto/algorithms/CryptoAlgorithmHMAC.h:
3007 * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
3008 (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
3009 (WebCore::CryptoAlgorithmPBKDF2::importKey):
3010 * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
3011 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
3012 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
3013 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
3014 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
3015 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
3016 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
3017 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
3018 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
3019 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
3020 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
3021 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
3022 (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
3023 (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
3024 (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
3025 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
3026 * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
3027 (WebCore::CryptoAlgorithmRSA_PSS::sign):
3028 (WebCore::CryptoAlgorithmRSA_PSS::verify):
3029 (WebCore::CryptoAlgorithmRSA_PSS::importKey):
3030 * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
3031 * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
3032 (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
3033 (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
3034 * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
3035 (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
3036 (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
3037 * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
3038 (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
3039 (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
3040 * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
3041 (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
3042 (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
3043 * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
3044 (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
3045 * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
3046 (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
3047 * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
3048 (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
3049 (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
3050 * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
3051 (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
3052 (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
3053 * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
3054 (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
3055 (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
3056 * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
3057 (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
3058 (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
3059 * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
3060 (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
3061 (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
3062 * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
3063 (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
3064 (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
3065 * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
3066 (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
3067 * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
3068 (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
3069 * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
3070 (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
3071 (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
3072 * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
3073 (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
3074 (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
3075 * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
3076 * crypto/parameters/CryptoAlgorithmAesCtrParams.h:
3077 * crypto/parameters/CryptoAlgorithmAesGcmParams.h:
3078 * crypto/parameters/CryptoAlgorithmEcKeyParams.h:
3079 * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
3080 * crypto/parameters/CryptoAlgorithmHkdfParams.h:
3081 * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
3082 * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
3083 * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
3084 * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
3085 * crypto/parameters/CryptoAlgorithmRsaPssParams.h:
3087 2018-07-16 Aditya Keerthi <akeerthi@apple.com>
3089 [Datalist][macOS] Add suggestions UI for TextFieldInputTypes
3090 https://bugs.webkit.org/show_bug.cgi?id=186531
3092 Reviewed by Tim Horton.
3094 Tests: fast/forms/datalist/datalist-show-hide.html
3095 fast/forms/datalist/datalist-textinput-keydown.html
3097 * html/TextFieldInputType.cpp:
3098 (WebCore::TextFieldInputType::handleKeydownEvent):
3099 (WebCore::TextFieldInputType::handleKeydownEventForSpinButton): The suggestions view takes precedence when handling arrow key events.
3101 2018-07-16 Jeremy Jones <jeremyj@apple.com>
3103 Fullscreen requires active document.
3104 https://bugs.webkit.org/show_bug.cgi?id=186226
3105 rdar://problem/36187413
3107 Reviewed by Jer Noble.
3109 Test: media/no-fullscreen-when-hidden.html
3111 This change guarantees the document to be visible for both element fullscreen and video fullscreen.
3113 User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
3114 because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
3117 Document::hidden() can't be relied upon because it won't update while JavaScript spins.
3119 This change adds a sync call to the UI process to get the current UI visibility state.
3122 (WebCore::Document::requestFullScreenForElement):
3123 * html/HTMLMediaElement.cpp:
3124 (WebCore::HTMLMediaElement::enterFullscreen):
3125 * page/ChromeClient.h:
3127 2018-07-16 Alex Christensen <achristensen@webkit.org>
3129 Reduce size of NetworkLoadMetrics and therefore ResourceResponse
3130 https://bugs.webkit.org/show_bug.cgi?id=187671
3132 Reviewed by Darin Adler.
3134 * inspector/agents/InspectorNetworkAgent.cpp:
3135 (WebCore::toProtocol):
3136 (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
3137 * platform/network/NetworkLoadMetrics.h:
3138 (WebCore::NetworkLoadMetrics::isolatedCopy const):
3139 (WebCore::NetworkLoadMetrics::reset):
3140 (WebCore::NetworkLoadMetrics::clearNonTimingData):
3142 2018-07-16 Chris Dumez <cdumez@apple.com>
3144 Make sure LibWebRTCMediaEndpoint is always destroyed on the main thread
3145 https://bugs.webkit.org/show_bug.cgi?id=187702
3147 Reviewed by Youenn Fablet.
3149 Make sure LibWebRTCMediaEndpoint is always constructed and destructed on the main thread since
3150 it has a Timer data member and it would not be safe otherwise. LibWebRTCMediaEndpoint is
3151 ThreadSafeRefCounted and frequently passed to other threads.
3153 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3154 (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
3155 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3157 2018-07-16 Sihui Liu <sihui_liu@apple.com>
3159 IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins
3160 https://bugs.webkit.org/show_bug.cgi?id=187631
3161 <rdar://problem/42164227>
3163 Reviewed by Brady Eidson.
3165 When asked to delete database for an origin, we deleted the databases whose mainFrameOrigin
3166 is that origin. Given that the origin may create IndexedDB from subframes, we should delete
3167 databases whose openingOrigin is that origin too.
3169 Covered by modified API test: WebKit.WebsiteDataStoreCustomPaths.
3171 * Modules/indexeddb/server/IDBServer.cpp:
3172 (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
3174 2018-07-16 Simon Fraser <simon.fraser@apple.com>
3176 Shrink some font-related classes and enums
3177 https://bugs.webkit.org/show_bug.cgi?id=187686
3179 Reviewed by Myles Maxfield.
3181 Use enum class for enums in TextFlags.h and make them one byte big.
3183 Re-order members of Font to shrink it from 360 to 328 bytes.
3185 * css/CSSPrimitiveValueMappings.h:
3186 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3187 (WebCore::CSSPrimitiveValue::operator FontSmoothingMode const):
3188 (WebCore::CSSPrimitiveValue::operator FontSmallCaps const):
3189 (WebCore::CSSPrimitiveValue::operator TextRenderingMode const):
3190 * platform/graphics/Font.cpp:
3191 (WebCore::Font::Font):
3192 (WebCore::Font::verticalRightOrientationFont const):
3193 * platform/graphics/Font.h:
3194 * platform/graphics/FontCascade.cpp:
3195 (WebCore::offsetToMiddleOfGlyph):
3196 * platform/graphics/FontCascade.h:
3197 (WebCore::FontCascade::advancedTextRenderingMode const):
3198 * platform/graphics/FontCascadeFonts.cpp:
3199 (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
3200 (WebCore::FontCascadeFonts::glyphDataForVariant):
3201 (WebCore::glyphPageFromFontRanges):
3202 * platform/graphics/FontDescription.cpp:
3203 (WebCore::FontCascadeDescription::FontCascadeDescription):
3204 * platform/graphics/FontDescription.h:
3205 (WebCore::FontDescription::setTextRenderingMode):
3206 (WebCore::FontDescription::setOrientation):
3207 (WebCore::FontDescription::setWidthVariant):
3208 (WebCore::FontCascadeDescription::setFontSmoothing):
3209 (WebCore::FontCascadeDescription::initialSmallCaps):
3210 (WebCore::FontCascadeDescription::initialFontSmoothing):
3211 (WebCore::FontCascadeDescription::initialTextRenderingMode):
3212 * platform/graphics/FontPlatformData.h:
3213 (WebCore::FontPlatformData::isForTextCombine const):
3214 * platform/graphics/cocoa/FontCacheCoreText.cpp:
3215 (WebCore::preparePlatformFont):
3216 * platform/graphics/cocoa/FontCascadeCocoa.mm:
3217 (WebCore::showLetterpressedGlyphsWithAdvances):
3218 (WebCore::showGlyphsWithAdvances):
3219 (WebCore::FontCascade::drawGlyphs):
3220 (WebCore::FontCascade::fontForCombiningCharacterSequence const):
3221 * platform/graphics/cocoa/FontCocoa.mm:
3222 (WebCore::Font::platformInit):
3223 (WebCore::Font::platformBoundsForGlyph const):
3224 (WebCore::Font::platformWidthForGlyph const):
3225 * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3226 (WebCore::FontPlatformData::hash const):
3227 (WebCore::mapFontWidthVariantToCTFeatureSelector):
3228 (WebCore::FontPlatformData::ctFont const):
3229 (WebCore::FontPlatformData::description const):
3230 * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3231 (WebCore::FontPlatformData::buildScaledFont):
3232 * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
3233 (WebCore::Font::platformInit):
3234 (WebCore::Font::platformWidthForGlyph const):
3235 * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
3236 (WebCore::fontFeatures):
3237 (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3238 * platform/graphics/mac/SimpleFontDataCoreText.cpp:
3239 (WebCore::Font::getCFStringAttributes const):
3240 * platform/graphics/win/FontCGWin.cpp:
3241 (WebCore::FontCascade::drawGlyphs):
3242 * platform/graphics/win/FontCascadeDirect2D.cpp:
3243 (WebCore::FontCascade::drawGlyphs):
3244 * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
3245 (WebCore::GlyphPage::fill):
3246 * platform/graphics/win/SimpleFontDataDirect2D.cpp:
3247 (WebCore::Font::platformInit):
3248 (WebCore::Font::platformBoundsForGlyph const):
3249 (WebCore::Font::platformWidthForGlyph const):
3250 * platform/text/TextFlags.h:
3251 * rendering/RenderCombineText.cpp:
3252 (WebCore::RenderCombineText::combineTextIfNeeded):
3253 * rendering/RenderLayer.cpp:
3254 (WebCore::RenderLayer::calculateClipRects const):
3255 * rendering/TextPainter.cpp:
3256 (WebCore::TextPainter::paintTextWithShadows):
3257 * rendering/TextPainter.h:
3258 * rendering/style/RenderStyle.cpp:
3259 (WebCore::RenderStyle::fontAndGlyphOrientation):
3260 * rendering/svg/RenderSVGInlineText.cpp:
3261 (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
3263 2018-07-16 Sergio Villar Senin <svillar@igalia.com>
3265 [WebVR] Add support for connect/disconnect and mount/unmount device events
3266 https://bugs.webkit.org/show_bug.cgi?id=187343
3268 Reviewed by Žan Doberšek.
3270 WebVR specs define a series of events as part of the Window Interface Extension. We're
3271 adding support for the connect/disconnect and mount/unmount events both at the module level
3272 and the platform level using OpenVR.
3274 In order to do that we need to keep lists of VRPlatformDisplays at platform level and
3275 VRDisplays at bindings level. We then update those lists accordingly to detect potential
3276 additions/removals, and emit the corresponding signals. A new client interface
3277 VRPlatformDisplayClient was also defined so that VRPlatformDisplay implementations could
3278 notify their clients (typically a VRDisplay).
3280 Last but not least, NavigatorWebVR was updated so it supplements Navigator instead of
3283 * Modules/webvr/NavigatorWebVR.cpp: Supplement Navigator not Page.
3284 (WebCore::NavigatorWebVR::getVRDisplays): Keep a list of VRDisplays and update them
3285 conveniently, also emitting the required events under certain conditions (like device
3287 (WebCore::NavigatorWebVR::supplementName): New method.
3288 (WebCore::NavigatorWebVR::from): Ditto.
3289 * Modules/webvr/NavigatorWebVR.h: Supplement Navigator not Page.
3290 * Modules/webvr/VRDisplay.cpp:
3291 (WebCore::VRDisplay::create): Moved suspendIfNeeded() to constructor.
3292 (WebCore::VRDisplay::VRDisplay): Set itself as VRPlatformDisplay client.
3293 (WebCore::VRDisplay::~VRDisplay): Unset as VRPlatformDisplay client.
3294 (WebCore::VRDisplay::VRPlatformDisplayConnected): Dispatch event on DOM window.
3295 (WebCore::VRDisplay::VRPlatformDisplayDisconnected): Ditto.
3296 (WebCore::VRDisplay::VRPlatformDisplayMounted): Ditto.
3297 (WebCore::VRDisplay::VRPlatformDisplayUnmounted): Ditto.
3298 * Modules/webvr/VRDisplay.h: Extend from VRPlatformDisplayClient.
3299 (WebCore::VRDisplay::document):
3300 * Modules/webvr/VRDisplayEvent.cpp: Updated Copyright.
3301 * Modules/webvr/VRDisplayEvent.h: Ditto.
3302 * Sources.txt: Added the two new files.
3303 * WebCore.xcodeproj/project.pbxproj: Ditto.
3304 * platform/vr/VRManager.cpp:
3305 (WebCore::VRManager::getVRDisplays): Keep a list of VRPlatformDisplays and update them conveniently,
3306 also emitting the required events under certain conditions (like device disconnection).
3307 * platform/vr/VRManager.h:
3308 * platform/vr/VRPlatformDisplay.cpp: New file with common implementations for VRPlatformDisplays.
3309 (WebCore::VRPlatformDisplay::setClient):
3310 (WebCore::VRPlatformDisplay::notifyVRPlatformDisplayEvent):
3311 * platform/vr/VRPlatformDisplay.h: Added a generic method to notify about different
3312 events. Added the client pointer.
3313 * platform/vr/VRPlatformDisplayClient.h: New file. VRPlatformDisplay implementations will
3314 call the client methods in the event of some circumstances happening.
3315 (WebCore::VRPlatformDisplayClient::VRPlatformDisplayConnected):
3316 (WebCore::VRPlatformDisplayClient::VRPlatformDisplayDisconnected):
3317 (WebCore::VRPlatformDisplayClient::VRPlatformDisplayMounted):
3318 (WebCore::VRPlatformDisplayClient::VRPlatformDisplayUnmounted):
3319 * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
3320 (WebCore::VRPlatformDisplayOpenVR::updateDisplayInfo): Poll the device for new events to
3321 detect connection/disconnections or device activations/deactivations (HMD
3323 * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
3325 2018-07-16 Zan Dobersek <zdobersek@igalia.com>
3327 [Nicosia] Add Nicosia::PlatformLayer, Nicosia::CompositionLayer classes
3328 https://bugs.webkit.org/show_bug.cgi?id=187693
3330 Reviewed by Carlos Garcia Campos.
3332 Add the Nicosia::PlatformLayer class. This will be the base platform
3333 layer class from which different derivatives will be created, addressing
3334 different use cases. The generic PlatformLayer type alias will point to
3335 this class in the future.