[iOS] Don't update AVPlayerViewController currentTime while scrubbing
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
2
3         [iOS] Don't update AVPlayerViewController currentTime while scrubbing
4         https://bugs.webkit.org/show_bug.cgi?id=192438
5         <rdar://problem/42977046>
6
7         Reviewed by Jer Noble.
8
9         No new tests, tested manually.
10
11         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
12         (WebCore::PlaybackSessionInterfaceAVKit::currentTimeChanged): Don't report change during scrubbing.
13
14         * platform/ios/WebAVPlayerController.h:
15         * platform/ios/WebAVPlayerController.mm:
16         (-[WebAVPlayerController beginScrubbing:]): Set _isScrubbing.
17         (-[WebAVPlayerController endScrubbing:]): Ditto.
18         (-[WebAVPlayerController isScrubbing]): Return _isScrubbing.
19
20 2018-12-07  Thibault Saunier  <tsaunier@igalia.com>
21
22         [WPE][GTK] Implement WebAudioSourceProviderGStreamer to allow bridging MediaStream and the WebAudio APIs
23         https://bugs.webkit.org/show_bug.cgi?id=186933
24
25         Reusing the AudioSourceProviderGStreamer itself as it was doing almost everything we needed,
26         just added a constructor to be able to create it from a MediaStreamTrackPrivate and made it a
27         WebAudioSourceProvider which only means it is now a ThreadSafeRefCounted.
28
29         Sensibily refactored GStreamerMediaStreamSource so that we could reuse it to track a single
30         MediaStreamTrack.
31
32         Reviewed by Philippe Normand.
33
34         Enabled all tests depending on that feature.
35
36         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
37         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
38         (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
39         (WebCore::AudioSourceProviderGStreamer::setClient):
40         * platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
41         * platform/mediastream/MediaStreamTrackPrivate.cpp:
42         (WebCore::MediaStreamTrackPrivate::audioSourceProvider):
43         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
44         (WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer):
45         * platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
46         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
47         (WebCore::webkitMediaStreamSrcSetupSrc):
48         (WebCore::webkitMediaStreamSrcSetupAppSrc):
49         (WebCore::webkitMediaStreamSrcAddTrack):
50         (WebCore::webkitMediaStreamSrcSetStream):
51         (WebCore::webkitMediaStreamSrcNew):
52         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.h:
53         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
54         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource):
55         (WebCore::WrappedMockRealtimeAudioSource::start):
56         (WebCore::WrappedMockRealtimeAudioSource::addHum):
57         (WebCore::WrappedMockRealtimeAudioSource::render):
58         (WebCore::WrappedMockRealtimeAudioSource::settingsDidChange):
59         (WebCore::MockGStreamerAudioCaptureSource::startProducingData):
60         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
61         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Handle the case where input buffers
62           are "big" and process all the data we can for each runs of the method.
63
64 2018-12-06  Alexey Proskuryakov  <ap@apple.com>
65
66         Move USE_NEW_THEME out of WebCore's config.h
67         https://bugs.webkit.org/show_bug.cgi?id=192426
68
69         Reviewed by Tim Horton.
70
71         * config.h:
72
73 2018-12-06  Frederic Wang  <fwang@igalia.com>
74
75         Allow control over child order when adding nodes to the scrolling tree
76         https://bugs.webkit.org/show_bug.cgi?id=176914
77
78         Reviewed by Simon Fraser.
79
80         Based on an earlier patch by Simon Fraser.
81
82         Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent,
83         but with no control over sibling order. To allow for correct hit-testing overflow and
84         frame scrolling nodes, we have to build the scrolling tree in z-order.
85
86         This patch adds a 'childIndex' parameter to attachNode() which gives control over
87         sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value
88         for childIndex so the current behavior (appending new nodes at the end of child list) is
89         preserved.
90
91         No new tests, behavior unchanged and already covered by existing tests.
92
93         * page/scrolling/AsyncScrollingCoordinator.cpp:
94         (WebCore::AsyncScrollingCoordinator::attachToStateTree):
95         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
96         * page/scrolling/AsyncScrollingCoordinator.h:
97         * page/scrolling/ScrollingCoordinator.h:
98         (WebCore::ScrollingCoordinator::attachToStateTree):
99         * page/scrolling/ScrollingStateNode.cpp:
100         (WebCore::ScrollingStateNode::insertChild):
101         (WebCore::ScrollingStateNode::indexOfChild const):
102         * page/scrolling/ScrollingStateNode.h:
103         * page/scrolling/ScrollingStateTree.cpp:
104         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
105         (WebCore::ScrollingStateTree::attachNode):
106         * page/scrolling/ScrollingStateTree.h:
107
108 2018-12-06  Yongjun Zhang  <yongjun_zhang@apple.com>
109
110         We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag.
111         https://bugs.webkit.org/show_bug.cgi?id=192377
112         <rdar://problem/46364206>
113
114         Reviewed by Tim Horton.
115
116         If the page specifies width=device-width or initial-scale=1 in the viewport meta tag, we should use the
117         native device width and ignore the minimum effective device width in ViewportConfiguration. The patch
118         also introduces scalableNativeWebpageParameters() which uses the device width as default and also allows the page
119         to shrink-to-fit. If a page doesn't have viewport meta tag, or if the width argument isn't device-width
120         and the initial scale isn't 1, we will use scalableNativeWebpageParameters() as the default configuration.
121
122         Tests: fast/viewport/ios/ignore-minimum-device-width-for-page-with-viewport-device-width.html
123                fast/viewport/ios/use-minimum-device-width-for-page-without-viewport-meta.html
124
125         * page/ViewportConfiguration.cpp:
126         (WebCore::ViewportConfiguration::updateDefaultConfiguration): pick the default configuration based on
127             the page's viewport arguments. Also, we will always fall back to scalableNativeWebpageParameters() if we
128             can ignore scaling constraints.
129         (WebCore::ViewportConfiguration::setViewportArguments): When page sends us new ViewportArguments, pick
130             up the correponsding default configuration before updating the configuration.
131         (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints): When m_canIgnoreScalingConstraints is
132             changed, try to pick up the correponsding default configuration.
133         (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Add a new default set of viewport Parameters
134             this is very close to nativeWebpageParameters() excpet that it allows shrink to fit and its minimum scale
135             is 0.25. We will use this Parameters for pages that doesn't have viewport meta tag; or the width is
136             not device-width and initial scale is not 1.
137         (WebCore::ViewportConfiguration::updateConfiguration): If the page's viewport argument doesn't override
138             the default width, use the m_minimumLayoutSize.width().
139         * page/ViewportConfiguration.h:
140         (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const): A helper method to tell
141             if we should avoid using minimum effective device width.
142         (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): If we are using a default
143             configuration that is neither nativeWebpageParameters() nor scalableNativeWebpageParameters(), don't override
144             it.
145         (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const): Add a helper method to return minimum
146             effective device width based on shouldIgnoreMinimumEffectiveDeviceWidth().
147         (WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor const): Use minimumEffectiveDeviceWidth().
148
149 2018-12-06  Adrian Perez de Castro  <aperez@igalia.com>
150
151         Content Extensions: Misc fixes to debugging / perf testing code
152         https://bugs.webkit.org/show_bug.cgi?id=192474
153
154         Reviewed by Mark Lam.
155
156         This make it possible to build the content extensions support with the
157         debugging features enabled. In particular, building with
158         CONTENT_EXTENSIONS_PERFORMANCE_REPORTING enabled was broken.
159
160         No new tests needed.
161
162         * contentextensions/ContentExtensionCompiler.cpp:
163         (WebCore::ContentExtensions::compileRuleList): Remove usage of removed
164         variables machinesWihthoutConditionsCount,
165         totalBytecodeSizeForMachinesWithoutConditions,
166         machinesWithConditionsCount, and
167         totalBytecodeSizeForMachinesWithConditions.
168         * contentextensions/DFA.cpp:
169         (WebCore::ContentExtensions::DFA::debugPrintDot const):
170         Use "%" PRIu64 instead of "%llu" to format uint64_t values.
171         * contentextensions/NFA.cpp:
172         (WebCore::ContentExtensions::NFA::debugPrintDot const):
173         Use "%" PRIu64 instead of "%llu" to format uint64_t values.
174
175 2018-12-06  Alex Christensen  <achristensen@webkit.org>
176
177         Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code
178         https://bugs.webkit.org/show_bug.cgi?id=192452
179
180         Reviewed by Anders Carlsson.
181
182         * loader/LoaderStrategy.h:
183         * loader/ResourceLoader.cpp:
184         (WebCore::ResourceLoader::didRetrieveDerivedDataFromCache): Deleted.
185         * loader/ResourceLoader.h:
186         * loader/ResourceLoaderOptions.h:
187         * loader/SubresourceLoader.cpp:
188         (WebCore::SubresourceLoader::didRetrieveDerivedDataFromCache): Deleted.
189         * loader/SubresourceLoader.h:
190         * loader/ThreadableLoader.cpp:
191         (WebCore::ThreadableLoaderOptions::isolatedCopy const):
192         * loader/cache/CachedResource.h:
193         (WebCore::CachedResource::didRetrieveDerivedDataFromCache): Deleted.
194
195 2018-12-06  Zalan Bujtas  <zalan@apple.com>
196
197         [LFC][BFC][MarginCollapsing] HeightAndMargin::margin is always the non-collapsed margin value.
198         https://bugs.webkit.org/show_bug.cgi?id=192345
199
200         Reviewed by Antti Koivisto.
201
202         Rename HeightAndMargin::margin to HeightAndMargin::nonCollapsedMargin.
203
204         * layout/FormattingContext.cpp:
205         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
206         * layout/LayoutUnits.h:
207         (WebCore::Layout::HeightAndMargin::usedMarginValues const):
208         * layout/blockformatting/BlockFormattingContext.cpp:
209         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
210         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
211         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
212         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
213         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
214         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
215         * layout/inlineformatting/InlineFormattingContext.cpp:
216         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
217
218 2018-12-06  Zalan Bujtas  <zalan@apple.com>
219
220         [LFC][BFC][MarginCollapsing] Add MarginCollapse::establishesBlockFormattingContext
221         https://bugs.webkit.org/show_bug.cgi?id=192297
222
223         Reviewed by Antti Koivisto.
224
225         WebKit treats the document element renderer as a block formatting context root.
226
227         * layout/blockformatting/BlockMarginCollapse.cpp:
228         (WebCore::Layout::establishesBlockFormattingContext):
229         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent):
230         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
231
232 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
233
234         [GStreamer] -DENABLE_VIDEO=ON -DENABLE_OPENGL=OFF still tries to build GstreamerGL
235         https://bugs.webkit.org/show_bug.cgi?id=191998
236
237         Reviewed by Philippe Normand.
238
239         Fix compilation with -DENABLE_VIDEO=ON and -DENABLE_OPENGL=OFF due to GStreamerGL.
240
241         No new tests required. Only fixing the build with certain flags.
242
243         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
244         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): add required #if ENABLE(WEBGL).
245
246 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
247
248         REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds
249         https://bugs.webkit.org/show_bug.cgi?id=191997
250
251         Reviewed by Philippe Normand.
252
253         Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF.
254
255         No new tests required. Only fixing build.
256
257         * platform/gtk/PlatformWheelEventGtk.cpp:
258         (WebCore::PlatformWheelEvent::PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING)
259
260 2018-12-05  Don Olmstead  <don.olmstead@sony.com>
261
262         [PlayStation] Enable WebCore
263         https://bugs.webkit.org/show_bug.cgi?id=192384
264
265         Reviewed by Brent Fulgham.
266
267         Implements WebCore for the PlayStation platform.
268
269         * PlatformPlayStation.cmake: Added.
270         * loader/cache/CachedResourceLoader.cpp:
271         * platform/generic/KeyedDecoderGeneric.cpp: Added.
272         (WebCore::KeyedDecoder::decoder):
273         (WebCore::KeyedDecoderGeneric::KeyedDecoderGeneric):
274         (WebCore::KeyedDecoderGeneric::~KeyedDecoderGeneric):
275         (WebCore::KeyedDecoderGeneric::decodeBytes):
276         (WebCore::KeyedDecoderGeneric::decodeBool):
277         (WebCore::KeyedDecoderGeneric::decodeUInt32):
278         (WebCore::KeyedDecoderGeneric::decodeUInt64):
279         (WebCore::KeyedDecoderGeneric::decodeInt32):
280         (WebCore::KeyedDecoderGeneric::decodeInt64):
281         (WebCore::KeyedDecoderGeneric::decodeFloat):
282         (WebCore::KeyedDecoderGeneric::decodeDouble):
283         (WebCore::KeyedDecoderGeneric::decodeString):
284         (WebCore::KeyedDecoderGeneric::beginObject):
285         (WebCore::KeyedDecoderGeneric::endObject):
286         (WebCore::KeyedDecoderGeneric::beginArray):
287         (WebCore::KeyedDecoderGeneric::beginArrayElement):
288         (WebCore::KeyedDecoderGeneric::endArrayElement):
289         (WebCore::KeyedDecoderGeneric::endArray):
290         * platform/generic/KeyedDecoderGeneric.h: Added.
291         * platform/generic/KeyedEncoderGeneric.cpp: Added.
292         (WebCore::KeyedEncoder::encoder):
293         (WebCore::KeyedEncoderGeneric::KeyedEncoderGeneric):
294         (WebCore::KeyedEncoderGeneric::~KeyedEncoderGeneric):
295         (WebCore::KeyedEncoderGeneric::encodeBytes):
296         (WebCore::KeyedEncoderGeneric::encodeBool):
297         (WebCore::KeyedEncoderGeneric::encodeUInt32):
298         (WebCore::KeyedEncoderGeneric::encodeUInt64):
299         (WebCore::KeyedEncoderGeneric::encodeInt32):
300         (WebCore::KeyedEncoderGeneric::encodeInt64):
301         (WebCore::KeyedEncoderGeneric::encodeFloat):
302         (WebCore::KeyedEncoderGeneric::encodeDouble):
303         (WebCore::KeyedEncoderGeneric::encodeString):
304         (WebCore::KeyedEncoderGeneric::beginObject):
305         (WebCore::KeyedEncoderGeneric::endObject):
306         (WebCore::KeyedEncoderGeneric::beginArray):
307         (WebCore::KeyedEncoderGeneric::beginArrayElement):
308         (WebCore::KeyedEncoderGeneric::endArrayElement):
309         (WebCore::KeyedEncoderGeneric::endArray):
310         (WebCore::KeyedEncoderGeneric::finishEncoding):
311         * platform/generic/KeyedEncoderGeneric.h: Added.
312         * platform/network/curl/NetworkStorageSessionCurl.cpp:
313         (WebCore::defaultCookieJarPath):
314         * platform/network/playstation/CurlSSLHandlePlayStation.cpp: Added.
315         (WebCore::getCACertPathEnv):
316         (WebCore::CurlSSLHandle::platformInitialize):
317         * platform/network/playstation/NetworkStateNotifierPlayStation.cpp: Added.
318         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
319         (WebCore::NetworkStateNotifier::startObserving):
320         * platform/playstation/EventLoopPlayStation.cpp: Added.
321         (WebCore::EventLoop::cycle):
322         * platform/playstation/MIMETypeRegistryPlayStation.cpp: Added.
323         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
324         (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
325         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
326         * platform/playstation/PlatformScreenPlayStation.cpp: Added.
327         (WebCore::screenDepth):
328         (WebCore::screenDepthPerComponent):
329         (WebCore::screenIsMonochrome):
330         (WebCore::screenHasInvertedColors):
331         (WebCore::screenRect):
332         (WebCore::screenAvailableRect):
333         (WebCore::screenSupportsExtendedColor):
334         * platform/playstation/ScrollbarThemePlayStation.cpp: Added.
335         (WebCore::ScrollbarTheme::nativeTheme):
336         (WebCore::ScrollbarThemePlayStation::scrollbarThickness):
337         (WebCore::ScrollbarThemePlayStation::hasButtons):
338         (WebCore::ScrollbarThemePlayStation::hasThumb):
339         (WebCore::ScrollbarThemePlayStation::backButtonRect):
340         (WebCore::ScrollbarThemePlayStation::forwardButtonRect):
341         (WebCore::ScrollbarThemePlayStation::trackRect):
342         (WebCore::ScrollbarThemePlayStation::paintTrackBackground):
343         (WebCore::ScrollbarThemePlayStation::paintThumb):
344         * platform/playstation/ScrollbarThemePlayStation.h: Added.
345         * platform/playstation/UserAgentPlayStation.cpp: Added.
346         (WebCore::standardUserAgent):
347         (WebCore::standardUserAgentForURL):
348         * rendering/RenderThemePlayStation.cpp: Added.
349         (WebCore::RenderTheme::singleton):
350         (WebCore::RenderThemePlayStation::updateCachedSystemFontDescription const):
351         * rendering/RenderThemePlayStation.h: Added.
352
353 2018-12-05  Ryosuke Niwa  <rniwa@webkit.org>
354
355         Null pointer crash in DocumentOrderedMap::getElementById via FormAssociatedElement::findAssociatedForm
356         https://bugs.webkit.org/show_bug.cgi?id=192392
357
358         Reviewed by Dean Jackson.
359
360         The crash was caused by FormAssociatedElement::findAssociatedForm invoking DocumentOrderedMap::getElementById
361         and de-referencing nullptr Attribute* via IdTargetObserver before Element::attributeChanged had updated
362         ElementData::m_idForStyleResolution.
363
364         Fixed it by updating m_idForStyleResolution before invoking IdTargetObservers.
365
366         Test: fast/dom/remove-id-form-associated-elemet-id-observer-crash.html
367
368         * dom/Element.cpp:
369         (WebCore::Element::attributeChanged): Fixed the bug.
370
371 2018-12-05  Youenn Fablet  <youenn@apple.com>
372
373         Enable the possibility to do video capture in UIProcess
374         https://bugs.webkit.org/show_bug.cgi?id=192394
375
376         Reviewed by Eric Carlson.
377
378         Create IOSurface-backed sample buffers so that we can easily send them through IPC.
379         Manually tested.
380
381         * platform/mediastream/mac/AVVideoCaptureSource.mm:
382         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
383
384 2018-12-05  Youenn Fablet  <youenn@apple.com>
385
386         Update ServiceWorkerContainer::getRegistration lambdas
387         https://bugs.webkit.org/show_bug.cgi?id=192376
388
389         Reviewed by Chris Dumez.
390
391         There is no need to pass 'this' in lambdas as the last lambda
392         takes a ScriptExecutionContext&.
393         No change of behavior.
394
395         * workers/service/ServiceWorkerContainer.cpp:
396         (WebCore::ServiceWorkerContainer::getRegistration):
397         (WebCore::ServiceWorkerContainer::getRegistrations):
398
399 2018-12-05  Chris Dumez  <cdumez@apple.com>
400
401         Crash under WebCore::cachedDocumentWrapper()
402         https://bugs.webkit.org/show_bug.cgi?id=192421
403         <rdar://problem/37114163>
404
405         Reviewed by Alex Christensen.
406
407         Fix potential null defererence of the value returned by toJSDOMWindow(). For example,
408         if the window is frameless, it would return null.
409
410         * bindings/js/JSDocumentCustom.cpp:
411         (WebCore::cachedDocumentWrapper):
412
413 2018-12-05  Eric Carlson  <eric.carlson@apple.com>
414
415         [MediaStream] Cleanup up Mac screen capture class
416         https://bugs.webkit.org/show_bug.cgi?id=192379
417         <rdar://problem/46465458>
418
419         Reviewed by Youenn Fablet.
420
421         No new tests, tested manually.
422
423         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
424         (WebCore::DisplayCaptureManagerCocoa::captureDevices): Initialize Screen devices first so
425         they are first in the list of devices.
426
427         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
428         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
429         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Cleanup. Always capture at the
430         native screen size to work around a bug.
431         (WebCore::ScreenDisplayCaptureSourceMac::settingsDidChange): Deleted.
432
433 2018-12-05  Commit Queue  <commit-queue@webkit.org>
434
435         Unreviewed, rolling out r238844, r238846, and r238874.
436         https://bugs.webkit.org/show_bug.cgi?id=192414
437
438         The layout tests added with this change are flaky. (Requested
439         by ryanhaddad on #webkit).
440
441         Reverted changesets:
442
443         "Implement non-timeslice mode encoding for MediaRecorder"
444         https://bugs.webkit.org/show_bug.cgi?id=192069
445         https://trac.webkit.org/changeset/238844
446
447         "Fix the build"
448         https://trac.webkit.org/changeset/238846
449
450         "Fix MediaRecorder flaky tests"
451         https://bugs.webkit.org/show_bug.cgi?id=192371
452         https://trac.webkit.org/changeset/238874
453
454 2018-12-05  Frederic Wang  <fwang@igalia.com>
455
456         Minor refactoring of the scrolling code
457         https://bugs.webkit.org/show_bug.cgi?id=192398
458
459         Reviewed by Simon Fraser.
460
461         Based on an earlier patch by Simon Fraser.
462
463         This patch performs some minor refactoring of the scrolling code:
464         - Rename ScrollingCoordinator::uniqueScrollLayerID() to uniqueScrollingNodeID() since it
465           is really a node id.
466         - Inline ScrollingStateTree::setRootStateNode() so we only need to forward declare
467           ScrollingStateFrameScrollingNode in headers.
468         - Pass argument to ScrollingStateTree::addNode() as a reference rather than a pointer.
469         - Initialize ScrollingStateTree::m_changedProperties and ScrollingStateTree::m_parent in
470           the header file.
471         - Remove obsolete comment about ScrollingCoordinatorMac.
472
473         No new tests, behavior unchanged.
474
475         * page/scrolling/ScrollingCoordinator.cpp:
476         (WebCore::ScrollingCoordinator::uniqueScrollingNodeID):
477         (WebCore::ScrollingCoordinator::uniqueScrollLayerID): Deleted.
478         * page/scrolling/ScrollingCoordinator.h:
479         * page/scrolling/ScrollingStateNode.cpp:
480         (WebCore::ScrollingStateNode::ScrollingStateNode):
481         * page/scrolling/ScrollingStateNode.h:
482         * page/scrolling/ScrollingStateTree.cpp:
483         (WebCore::ScrollingStateTree::attachNode):
484         (WebCore::ScrollingStateTree::setRootStateNode):
485         (WebCore::ScrollingStateTree::addNode):
486         * page/scrolling/ScrollingStateTree.h:
487         (WebCore::ScrollingStateTree::setRootStateNode): Deleted.
488         * page/scrolling/ScrollingTree.cpp:
489         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
490         * rendering/RenderLayerCompositor.cpp:
491         (WebCore::RenderLayerCompositor::attachScrollingNode):
492
493 2018-12-05  Wenson Hsieh  <wenson_hsieh@apple.com>
494
495         Turn WritingDirection into an enum class
496         https://bugs.webkit.org/show_bug.cgi?id=192401
497         Work towards <rdar://problem/42075638>
498
499         Reviewed by Dan Bernstein.
500
501         Change WritingDirection from an enum to an enum class. No change in behavior.
502
503         * editing/ApplyStyleCommand.cpp:
504         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
505         (WebCore::ApplyStyleCommand::applyInlineStyle):
506         * editing/EditingStyle.cpp:
507         (WebCore::EditingStyle::textDirection const):
508         (WebCore::EditingStyle::textDirectionForSelection):
509         * editing/Editor.cpp:
510         (WebCore::Editor::setBaseWritingDirection):
511         (WebCore::Editor::baseWritingDirectionForSelectionStart const):
512         * editing/EditorCommand.cpp:
513         (WebCore::stateTextWritingDirectionLeftToRight):
514         (WebCore::stateTextWritingDirectionNatural):
515         (WebCore::stateTextWritingDirectionRightToLeft):
516         * editing/WritingDirection.h:
517
518         Additionally wrap this enum in `namespace WebCore`, and update the copyright year.
519
520         * editing/ios/EditorIOS.mm:
521         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
522         * page/ContextMenuController.cpp:
523         (WebCore::ContextMenuController::contextMenuItemSelected):
524         * testing/Internals.cpp:
525         (WebCore::Internals::setBaseWritingDirection):
526
527 2018-12-05  Alicia Boya García  <aboya@igalia.com>
528
529         [MSE][GStreamer] Remove the AppendPipeline state machine
530         https://bugs.webkit.org/show_bug.cgi?id=192204
531
532         Reviewed by Xabier Rodriguez-Calvar.
533
534         This patch tries to reduce the complexity of the AppendPipeline by
535         removing the appendState state machine and cleaning all the
536         conditional code around it that is not necessary anymore.
537
538         For the most part the behavior is the same, but some edge cases have
539         been improved in the process:
540
541         Demuxing errors now result in the append being flagged as
542         ParsingFailed and the error being propagated to the application. This
543         fixes media/media-source/media-source-error-crash.html (or at least
544         gets it up to date with cross platform expectations).
545
546         AbortableTaskQueue now allows the task handler to perform an abort
547         safely. This is used in the GstBus error message sync handler, since
548         it needs to ask the MainThread to raise a parse error, which will in
549         turn abort. An API test has been added for this new functionality.
550         Also, code has been added to the API tests to ensure the correct
551         destruction of the response object, especially in this case.
552
553         The code handling invalid track codecs has been made clearer by also
554         explicitly raising a parse error, but it should not expose behavior
555         differences for the application. A test has been added for this
556         behavior: web-platform-tests/media-source/mediasource-invalid-codec.html
557
558         The reporting of EOS events have been made more rigorous. EOS is only
559         expected after a demuxing error, otherwise it's a g_critical.
560
561         AppendPipeline::abort() has been renamed to
562         AppendPipeline::resetParserState() to honor the fact that it's not
563         only called when the user calls abort() and match better the names
564         used in the spec.
565
566         Test: imported/w3c/web-platform-tests/media-source/mediasource-invalid-codec.html
567
568         * platform/AbortableTaskQueue.h:
569         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
570         (WebCore::assertedElementSetState):
571         (WebCore::AppendPipeline::AppendPipeline):
572         (WebCore::AppendPipeline::~AppendPipeline):
573         (WebCore::AppendPipeline::handleErrorSyncMessage):
574         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
575         (WebCore::AppendPipeline::handleNeedContextSyncMessage):
576         (WebCore::AppendPipeline::appsinkCapsChanged):
577         (WebCore::AppendPipeline::handleEndOfAppend):
578         (WebCore::AppendPipeline::appsinkNewSample):
579         (WebCore::AppendPipeline::didReceiveInitializationSegment):
580         (WebCore::AppendPipeline::resetParserState):
581         (WebCore::AppendPipeline::pushNewBuffer):
582         (WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread):
583         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromStreamingThread):
584         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
585         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
586         (WebCore::AppendPipeline::dumpAppendState): Deleted.
587         (WebCore::AppendPipeline::demuxerNoMorePads): Deleted.
588         (WebCore::AppendPipeline::setAppendState): Deleted.
589         (WebCore::AppendPipeline::appsinkEOS): Deleted.
590         (WebCore::AppendPipeline::resetPipeline): Deleted.
591         (WebCore::AppendPipeline::abort): Deleted.
592         * platform/graphics/gstreamer/mse/AppendPipeline.h:
593         (WebCore::AppendPipeline::appendState): Deleted.
594         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
595         (WebCore::MediaSourceClientGStreamerMSE::abort):
596         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
597         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
598         (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed):
599         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
600
601 2018-12-05  Rob Buis  <rbuis@igalia.com>
602
603         [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
604         https://bugs.webkit.org/show_bug.cgi?id=114965
605
606         Reviewed by Frédéric Wang.
607
608         HEAD requests should not be changed to GET after 303 redirects, see [1].
609         This was fixed earlier for GTK [2].
610
611         Behavior matches Firefox and Chrome.
612
613         [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4
614         [2] https://bugs.webkit.org/show_bug.cgi?id=110127
615
616         Tests: web-platform-tests/fetch/api/redirect/redirect-method.html
617                web-platform-tests/fetch/api/redirect/redirect-method-worker.html
618                http/tests/xmlhttprequest/head-redirection.html
619
620         * platform/network/mac/ResourceHandleMac.mm:
621         (WebCore::ResourceHandle::willSendRequest):
622
623 2018-12-05  Rob Buis  <rbuis@igalia.com>
624
625         Align with Fetch on data: URLs
626         https://bugs.webkit.org/show_bug.cgi?id=182325
627
628         Reviewed by Alex Christensen.
629
630         Do not accept data URLs that do not contain a comma
631         character, as specified in the relevant specs [1, 2].
632
633         Behavior matches Firefox and Chrome.
634
635         Test: web-platform-tests/fetch/api/basic/scheme-data.any.html
636
637         [1] https://tools.ietf.org/html/rfc2397
638         [2] https://fetch.spec.whatwg.org/#data-url-processor
639
640         * platform/network/DataURLDecoder.cpp:
641         (WebCore::DataURLDecoder::parseMediaType):
642         (WebCore::DataURLDecoder::DecodeTask::DecodeTask):
643         (WebCore::DataURLDecoder::DecodeTask::process):
644         (WebCore::DataURLDecoder::createDecodeTask):
645         (WebCore::DataURLDecoder::decode):
646
647 2018-12-05  Frederic Wang  <fwang@igalia.com>
648
649         Unreviewed build fix.
650
651         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Add missing header.
652
653 2018-12-05  Javier Fernandez  <jfernandez@igalia.com>
654
655         [css-grid] Crash on debug changing the style of a positioned element
656         https://bugs.webkit.org/show_bug.cgi?id=191473
657
658         Reviewed by Dean Jackson and Zalan Bujtas.
659
660         When an box becomes {out-of,in}-flow, it may be re-parented and it may become a grid
661         item. In that case, we must mark the RenderGrid as dirty, so that the grid items
662         placement logic is executed again.
663
664         Test: fast/css-grid-layout/grid-crash-out-of-flow-positioned-element.html
665
666         * rendering/updating/RenderTreeBuilder.cpp:
667         (WebCore::childFlowStateChangesAndAffectsParentBlock): Consider the case of a box's new parent being a grid container.
668
669 2018-12-04  Frederic Wang  <fwang@igalia.com>
670
671         Always pass scrollingGeometry to update*ScrollingNode functions
672         https://bugs.webkit.org/show_bug.cgi?id=192358
673
674         Reviewed by Simon Fraser.
675
676         Currently, the scrollingGeometry parameter of updateOverflowScrollingNode is always used
677         while the one of updateFrameScrollingNode is never used. Both of them are passed as possibly
678         null pointers. This commit makes things more consistent by making the parameter a reference
679         and explicitly setting the scrollingGeometry of updateFrameScrollingNode. This will help
680         other efforts (such as support for macOS/iOS asynchronous scrolling of overflow nodes /
681         subframes or for CSS overscroll-behavior) for which new data members have to be passed to the
682         scrolling nodes.
683
684         No new tests, no behavior changes.
685
686         * page/scrolling/AsyncScrollingCoordinator.cpp:
687         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
688         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
689         * page/scrolling/AsyncScrollingCoordinator.h:
690         * page/scrolling/ScrollingCoordinator.h:
691         (WebCore::ScrollingCoordinator::updateFrameScrollingNode):
692         (WebCore::ScrollingCoordinator::updateOverflowScrollingNode):
693         * rendering/RenderLayerCompositor.cpp:
694         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
695         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
696
697 2018-12-04  Ryosuke Niwa  <rniwa@webkit.org>
698
699         Crash in HTMLCollection::updateNamedElementCache
700         https://bugs.webkit.org/show_bug.cgi?id=192347
701
702         Reviewed by Darin Adler.
703
704         The bug was caused by CollectionIndexCache's nodeAt caching the length of 1
705         when there are no matching elements in the subtree when the index is non-zero.
706
707         A related bug was fixed in r182125 but we were not considering the possibility
708         that the index given to this function might be non-zero even when there were
709         no matching elements.
710
711         Test: fast/dom/options-collection-zero-length-crash.html
712
713         * dom/CollectionIndexCache.h:
714         (WebCore::CollectionIndexCache<Collection, Iterator>::nodeAt):
715
716 2018-11-30  Jiewen Tan  <jiewen_tan@apple.com>
717
718         Don't report resource timing to parent frame for history items
719         https://bugs.webkit.org/show_bug.cgi?id=192273
720         <rdar://problem/45163764>
721
722         Reviewed by Youenn Fablet.
723
724         We should not report history items to its parent frame as those are less
725         interested to its parent and might not be the first navigation in the iframes.
726
727         This change aligns the behavior when a cached document is not available for the
728         history item with the available case as we don't report resource timing for any
729         cached main document.
730
731         Test: http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html
732
733         * loader/FrameLoader.cpp:
734         (WebCore::FrameLoader::loadDifferentDocumentItem):
735
736 2018-12-04  Simon Fraser  <simon.fraser@apple.com>
737
738         REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed
739         https://bugs.webkit.org/show_bug.cgi?id=192320
740         <rdar://problem/46429833>
741
742         Reviewed by Zalan Bujtas.
743         
744         Re-land r238840 with a more reliable test.
745         
746         When we fall into slow scrolling mode (for example, because of background-attachment: fixed),
747         RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers
748         for viewport-constrained objects so we update them.
749         
750         This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already
751         does enough dirtying that fixed layers nested inside scrollers get updated.
752
753         Test: compositing/fixed-with-main-thread-scrolling.html
754
755         * rendering/RenderLayerCompositor.cpp:
756         (WebCore::RenderLayerCompositor::updateCompositingLayers):
757
758 2018-12-04  Youenn Fablet  <youenn@apple.com>
759
760         Fix MediaRecorder flaky tests
761         https://bugs.webkit.org/show_bug.cgi?id=192371
762
763         Reviewed by Eric Carlson.
764
765         No change of behavior.
766
767         * testing/Internals.cpp:
768         (WebCore::Internals::resetToConsistentState):
769         Reset to use real MediaRecorder by default.
770
771 2018-12-04  Justin Michaud  <justin_michaud@apple.com>
772
773         CSS Painting API should allow image values in inputProperties
774         https://bugs.webkit.org/show_bug.cgi?id=192200
775
776         Reviewed by Dean Jackson.
777
778         Adds new TypedOMCSSImageValue wrapper. We rename all the existing ones so that the naming is consistent (CSSImageValue is already a thing).
779         Finally, we let CanvasRenderingContext2DBase render these.
780
781         Tests: fast/css-custom-paint/arguments.html
782                fast/css-custom-paint/image.html
783
784         * CMakeLists.txt:
785         * DerivedSources.make:
786         * Sources.txt:
787         * WebCore.xcodeproj/project.pbxproj:
788         * bindings/js/CallTracerTypes.h:
789         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp.
790         (WebCore::toJSNewlyCreated):
791         (WebCore::toJS):
792         * bindings/js/WebCoreBuiltinNames.h:
793         * css/CSSComputedStyleDeclaration.cpp:
794         (WebCore::ComputedStyleExtractor::customPropertyValue):
795         * css/CSSCustomPropertyValue.cpp:
796         (WebCore::CSSCustomPropertyValue::equals const):
797         (WebCore::CSSCustomPropertyValue::customCSSText const):
798         (WebCore::CSSCustomPropertyValue::tokens const):
799         * css/CSSCustomPropertyValue.h:
800         * css/CSSPaintImageValue.cpp:
801         (WebCore::CSSPaintImageValue::image):
802         * css/typedom/StylePropertyMapReadOnly.h:
803         (WebCore::StylePropertyMapReadOnly::create):
804         (WebCore::StylePropertyMapReadOnly::get const):
805         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly):
806         * css/typedom/StylePropertyMapReadOnly.idl:
807         * css/typedom/TypedOMCSSImageValue.h: Copied from Source/WebCore/css/typedom/CSSUnitValue.h.
808         * css/typedom/TypedOMCSSImageValue.idl: Copied from Source/WebCore/css/typedom/CSSStyleValue.idl.
809         * css/typedom/TypedOMCSSNumericValue.h: Renamed from Source/WebCore/css/typedom/CSSNumericValue.h.
810         * css/typedom/TypedOMCSSNumericValue.idl: Renamed from Source/WebCore/css/typedom/CSSNumericValue.idl.
811         * css/typedom/TypedOMCSSStyleValue.h: Renamed from Source/WebCore/css/typedom/CSSStyleValue.h.
812         (WebCore::TypedOMCSSStyleValue::isImageValue):
813         * css/typedom/TypedOMCSSStyleValue.idl: Renamed from Source/WebCore/css/typedom/CSSStyleValue.idl.
814         * css/typedom/TypedOMCSSUnitValue.h: Renamed from Source/WebCore/css/typedom/CSSUnitValue.h.
815         * css/typedom/TypedOMCSSUnitValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnitValue.idl.
816         * css/typedom/TypedOMCSSUnparsedValue.h: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.h.
817         * css/typedom/TypedOMCSSUnparsedValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.idl.
818         * html/ImageBitmap.cpp:
819         (WebCore::ImageBitmap::createPromise):
820         * html/ImageBitmap.h:
821         * html/canvas/CanvasDrawImage.idl:
822         * html/canvas/CanvasFillStrokeStyles.idl:
823         * html/canvas/CanvasRenderingContext.cpp:
824         (WebCore::CanvasRenderingContext::checkOrigin):
825         * html/canvas/CanvasRenderingContext.h:
826         * html/canvas/CanvasRenderingContext2DBase.cpp:
827         (WebCore::size):
828         (WebCore::CanvasRenderingContext2DBase::drawImage):
829         (WebCore::CanvasRenderingContext2DBase::createPattern):
830         * html/canvas/CanvasRenderingContext2DBase.h:
831         * inspector/InspectorCanvas.cpp:
832         (WebCore::InspectorCanvas::buildAction):
833         * page/WindowOrWorkerGlobalScope.idl:
834         * platform/graphics/CustomPaintImage.cpp:
835         (WebCore::CustomPaintImage::doCustomPaint):
836
837 2018-12-04  Chris Dumez  <cdumez@apple.com>
838
839         Regression(r238817) PSON Page Cache API tests are failing
840         https://bugs.webkit.org/show_bug.cgi?id=192348
841
842         Reviewed by Alex Christensen.
843
844         * page/MemoryRelease.cpp:
845         (WebCore::releaseCriticalMemory):
846         (WebCore::releaseMemory):
847         * page/MemoryRelease.h:
848
849 2018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
850
851         Unreviewed, rolling out r238838.
852
853         The layout test added with this change is failing on iOS.
854
855         Reverted changeset:
856
857         "Thick overlines and line-throughs grow in the wrong
858         direction"
859         https://bugs.webkit.org/show_bug.cgi?id=192264
860         https://trac.webkit.org/changeset/238838
861
862 2018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
863
864         Unreviewed, rolling out r238840.
865
866         The layout test added with this change is frequently failing.
867
868         Reverted changeset:
869
870         "REGRESSION (r238090): position:fixed sidebar on
871         https://www.w3.org/TR/SVG2/coords.html does not stay fixed"
872         https://bugs.webkit.org/show_bug.cgi?id=192320
873         https://trac.webkit.org/changeset/238840
874
875 2018-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
876
877         [SOUP] Move URLSoup back to WebCore after r238771
878         https://bugs.webkit.org/show_bug.cgi?id=192306
879
880         Reviewed by Michael Catanzaro.
881
882         Add soupURIToURL() and urlToSoupURI() to replace the URL contructor taking a Soup URI and
883         URL::createSoupURI(). Fix several build failures that showed up after removing the soup includes from URL
884         header.
885
886         * platform/Cookie.h:
887         * platform/SharedBuffer.h:
888         * platform/SourcesSoup.txt:
889         * platform/network/soup/CookieSoup.cpp:
890         * platform/network/soup/GUniquePtrSoup.h: Renamed from Source/WTF/wtf/glib/GUniquePtrSoup.h.
891         * platform/network/soup/NetworkStorageSessionSoup.cpp:
892         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
893         (WebCore::NetworkStorageSession::deleteCookie const):
894         (WebCore::NetworkStorageSession::getCookies):
895         (WebCore::NetworkStorageSession::getRawCookies const):
896         (WebCore::cookiesForSession):
897         * platform/network/soup/ResourceErrorSoup.cpp:
898         (WebCore::failingURI):
899         * platform/network/soup/ResourceHandleSoup.cpp:
900         * platform/network/soup/ResourceRequest.h:
901         (WebCore::ResourceRequest::ResourceRequest):
902         * platform/network/soup/ResourceRequestSoup.cpp:
903         (WebCore::ResourceRequest::updateSoupMessageMembers const):
904         (WebCore::ResourceRequest::updateFromSoupMessage):
905         (WebCore::ResourceRequest::createSoupURI const):
906         * platform/network/soup/ResourceResponseSoup.cpp:
907         (WebCore::ResourceResponse::updateFromSoupMessage):
908         * platform/network/soup/SocketStreamHandleImpl.h:
909         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
910         (WebCore::SocketStreamHandleImpl::create):
911         * platform/network/soup/SoupNetworkSession.cpp:
912         * platform/network/soup/URLSoup.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp.
913         (WebCore::soupURIToURL):
914         (WebCore::urlToSoupURI):
915         * platform/network/soup/URLSoup.h: Renamed from Source/WTF/wtf/glib/URLSoup.cpp.
916
917 2018-12-04  Devin Rousso  <drousso@apple.com>
918
919         Web Inspector: Audit: tests should support async operations
920         https://bugs.webkit.org/show_bug.cgi?id=192171
921         <rdar://problem/46423562>
922
923         Reviewed by Joseph Pecoraro.
924
925         * page/Settings.yaml:
926         * dom/ScriptExecutionContext.cpp:
927         (ScriptExecutionContext::reportUnhandledPromiseRejection):
928         Add setting for muting the "Unhandled Promise Rejection" console message.
929
930 2018-12-03  Tim Horton  <timothy_horton@apple.com>
931
932         Fix the build
933
934         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
935         Unified sources, of course.
936
937 2018-12-03  Youenn Fablet  <youenn@apple.com>
938
939         A sender created through addTransceiver and populated using addTrack should have its source set
940         https://bugs.webkit.org/show_bug.cgi?id=192136
941
942         Reviewed by Eric Carlson.
943
944         In case libwebrtc backend is already created, we need to make sure to
945         set the track source to the libwebrtc sender backend that is actually
946         tied to the sender.
947
948         Covered by updated test.
949
950         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
951         (WebCore::LibWebRTCPeerConnectionBackend::removeTrack):
952         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
953         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
954         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
955
956 2018-12-03  YUHAN WU  <yuhan_wu@apple.com>
957
958         Implement non-timeslice mode encoding for MediaRecorder
959         https://bugs.webkit.org/show_bug.cgi?id=192069
960
961         Reviewed by Youenn Fablet.
962
963         Implement the encoding for non-timeslice mode of MediaRecorder.
964         It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods.
965         Add a API in internals to allow testings to turn on the mock source.
966
967         Tests: http/wpt/mediarecorder/MediaRecorder-AV-audio-only-dataavailable.html
968                http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html
969                http/wpt/mediarecorder/MediaRecorder-AV-video-only-dataavailable.html
970
971         * Modules/mediarecorder/MediaRecorder.cpp:
972         (WebCore::MediaRecorder::create):
973         (WebCore::MediaRecorder::setCustomPrivateRecorderCreator):
974         (WebCore::MediaRecorder::getPrivateImpl):
975         (WebCore::MediaRecorder::MediaRecorder):
976         (WebCore::MediaRecorder::stopRecording):
977         (WebCore::MediaRecorder::stopRecordingInternal):
978         (WebCore::MediaRecorder::createRecordingDataBlob):
979         (WebCore::MediaRecorder::scheduleDeferredTask):
980         * Modules/mediarecorder/MediaRecorder.h:
981         * Modules/mediarecorder/MediaRecorder.idl:
982         * SourcesCocoa.txt:
983         * WebCore.xcodeproj/project.pbxproj:
984         * platform/mediarecorder/MediaRecorderPrivate.h:
985         (WebCore::MediaRecorderPrivate::stopRecording):
986         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added.
987         (WebCore::MediaRecorderPrivateAVFImpl::create):
988         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVImpl):
989         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
990         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
991         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
992         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
993         (WebCore::MediaRecorderPrivateAVFImpl::mimeType):
994         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added.
995         * platform/mediarecorder/MediaRecorderPrivateMock.cpp:
996         (WebCore::MediaRecorderPrivateMock::fetchData):
997         (WebCore::MediaRecorderPrivateMock::mimeType):
998         * platform/mediarecorder/MediaRecorderPrivateMock.h:
999         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: Added.
1000         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added.
1001         (WebCore::MediaRecorderPrivateWriter::setupWriter):
1002         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
1003         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
1004         (WebCore::copySampleBufferWithCurrentTimeStamp):
1005         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
1006         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
1007         (WebCore::MediaRecorderPrivateWriter::stopRecording):
1008         (WebCore::MediaRecorderPrivateWriter::fetchData):
1009         * testing/Internals.cpp:
1010         (WebCore::createRecorderMockSource):
1011         (WebCore::Internals::setCustomPrivateRecorderCreator):
1012         * testing/Internals.h:
1013         * testing/Internals.idl:
1014
1015 2018-12-03  Simon Fraser  <simon.fraser@apple.com>
1016
1017         REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed
1018         https://bugs.webkit.org/show_bug.cgi?id=192320
1019         <rdar://problem/46429833>
1020
1021         Reviewed by Zalan Bujtas.
1022         
1023         When we fall into slow scrolling mode (for example, because of background-attachment: fixed),
1024         RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers
1025         for viewport-constrained objects so we update them.
1026         
1027         This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already
1028         does enough dirtying that fixed layers nested inside scrollers get updated.
1029
1030         Test: compositing/fixed-with-main-thread-scrolling.html
1031
1032         * rendering/RenderLayerCompositor.cpp:
1033         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1034
1035 2018-12-03  Justin Michaud  <justin_michaud@apple.com>
1036
1037         CSS Painting API should scale display list when drawing
1038         https://bugs.webkit.org/show_bug.cgi?id=192217
1039
1040         Reviewed by Simon Fraser.
1041
1042         When we replay the display list, fix the scaling. The separate buffer is needed to make sure that globalCompositeOperation functions correctly.
1043
1044         * html/CustomPaintCanvas.cpp:
1045         (WebCore::CustomPaintCanvas::replayDisplayList const):
1046         * html/CustomPaintCanvas.h:
1047         * platform/graphics/CustomPaintImage.cpp:
1048         (WebCore::CustomPaintImage::doCustomPaint):
1049
1050 2018-12-03  Myles C. Maxfield  <mmaxfield@apple.com>
1051
1052         Thick overlines and line-throughs grow in the wrong direction
1053         https://bugs.webkit.org/show_bug.cgi?id=192264
1054
1055         Reviewed by Dean Jackson.
1056
1057         Overlines should grow upward, and line-throughs should stay centered.
1058
1059         Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
1060
1061         * rendering/TextDecorationPainter.cpp:
1062         (WebCore::TextDecorationPainter::paintTextDecoration):
1063         * style/InlineTextBoxStyle.cpp:
1064         (WebCore::visualOverflowForDecorations):
1065
1066 2018-12-03  Simon Fraser  <simon.fraser@apple.com>
1067
1068         Viewport-constrained renderers are always RenderLayerModelObjects
1069         https://bugs.webkit.org/show_bug.cgi?id=192342
1070
1071         Reviewed by Myles C. Maxfield.
1072
1073         addViewportConstrainedObject/removeViewportConstrainedObject can take RenderLayerModelObjects,
1074         since all viewport-constrained renderers have layers.
1075
1076         * page/FrameView.cpp:
1077         (WebCore::FrameView::addViewportConstrainedObject):
1078         (WebCore::FrameView::removeViewportConstrainedObject):
1079         * page/FrameView.h:
1080         * rendering/RenderLayerModelObject.cpp:
1081         (WebCore::RenderLayerModelObject::styleDidChange): The 0 argument is actually a nullptr RenderGeometryMap,
1082         which has a default value, and the comment was obsolete.
1083
1084 2018-12-03  Don Olmstead  <don.olmstead@sony.com>
1085
1086         Fix some unused parameter warnings
1087         https://bugs.webkit.org/show_bug.cgi?id=192336
1088
1089         Reviewed by Fujii Hironori.
1090
1091         * Modules/indexeddb/server/IDBSerialization.cpp:
1092         (WebCore::isLegacySerializedIDBKeyData):
1093         * platform/FileSystem.cpp:
1094         (WebCore::FileSystem::openAndLockFile):
1095         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1096         (WebCore::GraphicsContext3D::bindVertexArray):
1097         * platform/network/curl/CertificateInfo.h:
1098         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
1099         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
1100
1101 2018-12-03  Keith Rollin  <krollin@apple.com>
1102
1103         Add .xcfilelist files
1104         https://bugs.webkit.org/show_bug.cgi?id=192082
1105         <rdar://problem/46312533>
1106
1107         Reviewed by Brent Fulgham.
1108
1109         Add .xcfilelist files for Generate Derived Sources and Generate
1110         Unified Sources build phases in Xcode. These are just being staged for
1111         now; they'll be added to the Xcode projects later.
1112
1113         No new tests -- no changed functionality.
1114
1115         * DerivedSources-input.xcfilelist: Added.
1116         * DerivedSources-output.xcfilelist: Added.
1117         * UnifiedSources-input.xcfilelist: Added.
1118         * UnifiedSources-output.xcfilelist: Added.
1119
1120 2018-12-03  Alex Christensen  <achristensen@webkit.org>
1121
1122         Add WKWebProcessPlugInLoadDelegate SPI willStartProvisionalLoadForFrame with a completion handler
1123         https://bugs.webkit.org/show_bug.cgi?id=192272
1124
1125         Reviewed by Brady Eidson.
1126
1127         This is needed for rdar://problem/45910057
1128         Covered by an API test.
1129
1130         * loader/EmptyFrameLoaderClient.h:
1131         * loader/FrameLoader.cpp:
1132         (WebCore::FrameLoader::prepareForLoadStart):
1133         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1134         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
1135         * loader/FrameLoader.h:
1136         * loader/FrameLoaderClient.h:
1137
1138 2018-12-03  Zalan Bujtas  <zalan@apple.com>
1139
1140         [iOS] Unreviewed build fix.
1141
1142         * page/DOMTimer.cpp:
1143         (WebCore::DOMTimer::fired):
1144
1145 2018-12-03  Jer Noble  <jer.noble@apple.com>
1146
1147         Get rid of old, dead Mac video fullscreen code.
1148         https://bugs.webkit.org/show_bug.cgi?id=192315
1149
1150         Reviewed by Eric Carlson.
1151
1152         * PlatformMac.cmake:
1153         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1154         (WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const):
1155
1156 2018-12-03  Ryosuke Niwa  <rniwa@webkit.org>
1157
1158         title attribute on style & link elements should be ignored inside a shadow tree
1159         https://bugs.webkit.org/show_bug.cgi?id=191297
1160
1161         Reviewed by Antti Koivisto.
1162
1163         Fixed the by not setting the stylesheet's title even when the title content attribute is present
1164         or set on SVG/HTML style and link elements inside a shadow tree.
1165
1166         Test: fast/shadow-dom/stylesheet-title-in-shadow-tree.html
1167
1168         * dom/InlineStyleSheetOwner.cpp:
1169         (WebCore::InlineStyleSheetOwner::createSheet):
1170         * html/HTMLLinkElement.cpp:
1171         (WebCore::HTMLLinkElement::parseAttribute):
1172         (WebCore::HTMLLinkElement::initializeStyleSheet):
1173         * html/HTMLStyleElement.cpp:
1174         (WebCore::HTMLStyleElement::parseAttribute):
1175         * style/StyleScope.cpp:
1176         (WebCore::Style::Scope::collectActiveStyleSheets):
1177         * svg/SVGStyleElement.cpp:
1178         (WebCore::SVGStyleElement::parseAttribute):
1179
1180 2018-12-03  Zalan Bujtas  <zalan@apple.com>
1181
1182         [iOS] Add logging channel for hover related content observation
1183         https://bugs.webkit.org/show_bug.cgi?id=192312
1184
1185         Reviewed by Simon Fraser.
1186
1187         * dom/Document.cpp:
1188         (WebCore::Document::scheduleStyleRecalc):
1189         (WebCore::Document::updateStyleIfNeeded):
1190         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
1191         * page/DOMTimer.cpp:
1192         (WebCore::DOMTimer::install):
1193         (WebCore::DOMTimer::fired):
1194         * page/DOMWindow.cpp:
1195         (WebCore::DOMWindow::clearTimeout):
1196         * page/Frame.cpp:
1197         (WebCore::Frame::willDetachPage):
1198         * platform/Logging.h:
1199
1200 2018-12-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1201
1202         [SOUP] Use SoupSession instead of SoupSessionAsync
1203         https://bugs.webkit.org/show_bug.cgi?id=107451
1204
1205         Reviewed by Carlos Garcia Campos.
1206
1207         With glib-networking 2.57.1, WebKit is no longer able to load TLS error pages. The problem
1208         is a network process deadlock caused by a change in how glib-networking performs certificate
1209         verification. Previously it verified certificates *after* the TLS handshake had completed,
1210         which was weirdly late, but previously not problematic. But now that TLS 1.3 exists,
1211         application data can be sent before certificate verification occurs, which is no good. So I
1212         moved verification to occur during the handshake. I needed to do this regardless because I
1213         need to add a new callback in GnuTLS for another feature. This introduced a deadlock in
1214         WebKit:
1215
1216          - glib-networking detects an unacceptable certificate, emits accept-certificate signal
1217          - NetworkDataTaskSoup::tlsConnectionAcceptCertificate calls
1218            NetworkDataTaskSoup::invalidateAndCancel calls NetworkDataTaskSoup::clearRequest
1219          - NetworkDataTaskSoup::clearRequest calls soup_session_cancel_message
1220
1221         The problem is that, in the deprecated SoupSessionAsync used by WebKit, cancellation is
1222         always *synchronous* despite the name of the class. So soup_session_cancel_message winds up
1223         doing its thing to close everything out, and that eventually ends up in a synchronous call
1224         to g_tls_connection_gnutls_close. The close operation can't proceed until the TLS handshake
1225         is finished, and the handshake is blocked waiting for WebKit to return from its
1226         accept-certificate handler. So the close operation winds up polling forever waiting for the
1227         handshake to finish. Deadlock.
1228
1229         The only changes required in WebKit to use the modern SoupSession are adjustments for the
1230         new default property values. Most of the properties we used to set explicitly are now
1231         defaults and should be removed. Additionally, SoupSession has default timeouts, which we
1232         want to override to allow NetworkDataTaskSoup to implement its own timeouts.
1233
1234         No new tests because this is covered by TestSSL (which would be failing if run with the
1235         newer glib-networking).
1236
1237         * platform/network/soup/SoupNetworkSession.cpp:
1238         (WebCore::SoupNetworkSession::SoupNetworkSession):
1239
1240 2018-12-03  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1241
1242         Use WallTime for file time
1243         https://bugs.webkit.org/show_bug.cgi?id=192287
1244
1245         Reviewed by Darin Adler.
1246
1247         This patch changes a type of file time from double to WallTime to use strongly typed file time.
1248
1249         No behavior change.
1250
1251         * Modules/webdatabase/Database.cpp:
1252         (WebCore::Database::details const):
1253         * Modules/webdatabase/DatabaseDetails.h:
1254         (WebCore::DatabaseDetails::DatabaseDetails):
1255         (WebCore::DatabaseDetails::creationTime const):
1256         (WebCore::DatabaseDetails::modificationTime const):
1257         * Modules/webdatabase/DatabaseManager.cpp:
1258         (WebCore::DatabaseManager::ProposedDatabase::ProposedDatabase):
1259         * Modules/webdatabase/DatabaseTracker.cpp:
1260         (WebCore::DatabaseTracker::detailsForNameAndOrigin):
1261         * fileapi/AsyncFileStream.cpp:
1262         (WebCore::AsyncFileStream::getSize):
1263         * fileapi/AsyncFileStream.h:
1264         * fileapi/File.cpp:
1265         (WebCore::File::lastModified const):
1266         * page/Page.cpp:
1267         (WebCore::Page::userStyleSheetLocationChanged):
1268         (WebCore::Page::userStyleSheet const):
1269         * page/Page.h:
1270         * platform/FileMetadata.h:
1271         * platform/FileStream.cpp:
1272         (WebCore::FileStream::getSize):
1273         * platform/FileStream.h:
1274         * platform/FileSystem.cpp:
1275         (WebCore::FileSystem::getFileModificationTime): Deleted.
1276         * platform/FileSystem.h:
1277         (WebCore::FileSystem::invalidFileTime): Deleted.
1278         (WebCore::FileSystem::isValidFileTime): Deleted.
1279         * platform/glib/FileSystemGlib.cpp:
1280         (WebCore::FileSystem::getFileCreationTime):
1281         (WebCore::FileSystem::getFileModificationTime):
1282         (WebCore::FileSystem::fileMetadataUsingFunction):
1283         * platform/network/BlobDataFileReference.cpp:
1284         (WebCore::BlobDataFileReference::BlobDataFileReference):
1285         (WebCore::BlobDataFileReference::expectedModificationTime):
1286         * platform/network/BlobDataFileReference.h:
1287         * platform/network/FormData.cpp:
1288         (WebCore::FormData::appendFile):
1289         (WebCore::FormData::appendFileRange):
1290         * platform/network/FormData.h:
1291         (WebCore::FormDataElement::FormDataElement):
1292         (WebCore::FormDataElement::EncodedFileData::decode):
1293         * platform/network/cf/FormDataStreamCFNet.cpp:
1294         (WebCore::advanceCurrentStream):
1295         * platform/network/soup/ResourceRequestSoup.cpp:
1296         (WebCore::appendEncodedBlobItemToSoupMessageBody):
1297         * platform/posix/FileSystemPOSIX.cpp:
1298         (WebCore::FileSystem::getFileCreationTime):
1299         (WebCore::FileSystem::getFileModificationTime):
1300         * platform/sql/SQLiteFileSystem.cpp:
1301         (WebCore::SQLiteFileSystem::databaseCreationTime):
1302         (WebCore::SQLiteFileSystem::databaseModificationTime):
1303         * platform/sql/SQLiteFileSystem.h:
1304         * platform/win/FileSystemWin.cpp:
1305         (WebCore::FileSystem::getFileModificationTime):
1306         (WebCore::FileSystem::getFileCreationTime):
1307         (WebCore::FileSystem::findDataToFileMetadata):
1308
1309 2018-12-03  Dean Jackson  <dino@apple.com>
1310
1311         Fix iOS Simulator Release test crashes.
1312
1313         * platform/network/ios/WebCoreURLResponseIOS.mm:
1314         (WebCore::adjustMIMETypeIfNecessary): Check for null before using the
1315         new MIME type.
1316
1317 2018-12-03  Eric Carlson  <eric.carlson@apple.com>
1318
1319         [MediaStream] 'devicechange' event when more capture device information are revealed.
1320         https://bugs.webkit.org/show_bug.cgi?id=192268
1321
1322         Reviewed by Youenn Fablet.
1323
1324         Test: fast/mediastream/enumerate-devices-change-event.html
1325
1326         * Modules/mediastream/MediaDevicesRequest.cpp:
1327         (WebCore::MediaDevicesRequest::start): Remove code to modify device based on access, that is
1328         now done in the UI process.
1329         (WebCore::MediaDevicesRequest::filterDeviceList): Deleted.
1330         * Modules/mediastream/MediaDevicesRequest.h:
1331         * platform/mediastream/RealtimeMediaSourceCenter.h:
1332
1333 2018-12-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1334
1335         [iOSMac] Unable to upload non-image files using drag and drop in WKWebView
1336         https://bugs.webkit.org/show_bug.cgi?id=192283
1337         <rdar://problem/46399461>
1338
1339         Reviewed by Ryosuke Niwa.
1340
1341         Currently on iOS, file URLs aren't generally written to the pasteboard during drag and drop unless the
1342         application providing the data explicitly registers "public.file-url" to item providers. As such, our current
1343         logic on iOS for handling drops does not attempt to prevent "public.file-url" from being advertised as the
1344         "text/uri-list" MIME type in DataTransfer, though we do currently succeed in suppressing access to the file URL.
1345
1346         However, on iOSMac, the scenario in which file URLs are registered to item providers becomes pertinent when
1347         uploading files from other macOS apps (e.g. Finder) into a WKWebView running in iOSMac. Furthermore, the
1348         `preferredPresentationStyle` flag on `NSItemProvider` is unavailable in iOSMac; currently, this flag is our
1349         primary cue on iOS that an item should be treated as an attachment rather than inline data. In order to support
1350         file uploads in iOSMac, we make several adjustments to drop handling logic in iOS to handle the case where the
1351         "public.file-url" type is registered. See below for more details.
1352
1353         Tests:  DragAndDropTests.DataTransferExposePlainTextWithFileURLAsFile
1354                 DragAndDropTests.DataTransferGetDataWhenDroppingImageWithFileURL
1355
1356         * platform/PasteboardItemInfo.h:
1357         (WebCore::PasteboardItemInfo::encode const):
1358         (WebCore::PasteboardItemInfo::decode):
1359
1360         Add a new flag that is set if and only if the item provider contains the "public.file-url" type, and also
1361         contains some non-URL data type that conforms to one of the file types supported for file uploads (i.e.
1362         "public.content", zip archives, and folders).
1363
1364         * platform/cocoa/PasteboardCocoa.mm:
1365         (WebCore::Pasteboard::fileContentState):
1366
1367         Consider the pasteboard to contain files in the case where one or more of the items contains a file URL, along
1368         with some other pasteboard data that can be represented as a file upload.
1369
1370         * platform/ios/PlatformPasteboardIOS.mm:
1371         (WebCore::PlatformPasteboard::informationForItemAtIndex):
1372         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
1373
1374         If the pasteboard contains "public.file-url", don't consider "text/uri-list" to be one of the data types that's
1375         safe to expose to the page. Our current behavior in this case is that we will advertise "text/uri-list" as a
1376         pasteboard type in the DataTransfer, but if the page attempts to request this information, we simply return the
1377         empty string. Instead, we shouldn't expose "text/uri-list" as a type in the first place.
1378
1379         * platform/ios/WebItemProviderPasteboard.h:
1380         * platform/ios/WebItemProviderPasteboard.mm:
1381
1382         Add a few more `__bridge`-ing casts where appropriate.
1383
1384         (typeConformsToTypes):
1385
1386         Move this further up the file so that it can be used in `NSItemProvider (WebCoreExtras)`.
1387
1388         (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
1389
1390         Add a helper method on NSItemProvider to determine whether an item provider has a file URL, as well as a content
1391         type suitable for file uploads.
1392
1393         (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
1394
1395         This currently always returns `NO` in iOSMac; instead, return `YES` on both iOS and iOSMac in the case where the
1396         item provider contains a file URL and content which may be uploaded.
1397
1398         (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]):
1399         (-[WebItemProviderPasteboard typeIdentifiersToLoad:]):
1400
1401         Refactor this to take an `NSItemProvider` instead of a list of type identifiers, and bail out of loading data
1402         for "public.url" if the item provider contains a file URL.
1403
1404         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
1405         (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentifiers:]): Deleted.
1406
1407 2018-12-02  Zalan Bujtas  <zalan@apple.com>
1408
1409         Add a runtime feature flag for LayoutFormattingContext.
1410         https://bugs.webkit.org/show_bug.cgi?id=192280
1411
1412         Reviewed by Simon Fraser.
1413
1414         * Configurations/FeatureDefines.xcconfig:
1415         * page/FrameViewLayoutContext.cpp:
1416         (WebCore::layoutUsingFormattingContext):
1417         * page/RuntimeEnabledFeatures.h:
1418         (WebCore::RuntimeEnabledFeatures::setLayoutFormattingContextEnabled):
1419         (WebCore::RuntimeEnabledFeatures::layoutFormattingContextEnabled const):
1420
1421 2018-12-01  Brent Fulgham  <bfulgham@apple.com>
1422
1423         Lifetime of HTMLMediaElement is not properly handled in asynchronous actions
1424         https://bugs.webkit.org/show_bug.cgi?id=192087
1425         <rdar://problem/45975230>
1426
1427         Reviewed by Dean Jackson.
1428
1429         The HTMLMediaElement performs operations that allow arbitrary JavaScript to run. We need to make
1430         sure the active media element is protected until those calls complete.
1431
1432         * html/HTMLMediaElement.cpp:
1433         (WebCore::HTMLMediaElement::didFinishInsertingNode):
1434         (WebCore::HTMLMediaElement::exitFullscreen):
1435         (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured):
1436         (WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
1437         (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
1438         (WebCore::HTMLMediaElement::scheduleUpdatePlayState):
1439         (WebCore::HTMLMediaElement::scheduleUpdateMediaState):
1440
1441 2018-12-01  Chris Dumez  <cdumez@apple.com>
1442
1443         [PSON] process-swapping may occur even though opener has handle to openee
1444         https://bugs.webkit.org/show_bug.cgi?id=192277
1445
1446         Reviewed by Antti Koivisto.
1447
1448         Process-swapping may occur even though opener has handle to openee, which is not Web-compatible. The reason
1449         is that we rely on the window not having an opener to process-swap. However, the opener can be disowned,
1450         which does not mean that the opener doesn't still have a handle to its openee.
1451
1452         To address the issue:
1453         - Renamed openedViaWindowOpenWithOpener flag to openedByDOMWithOpener
1454         - Make sure this flag gets set if an opener have ever been set for the browsing context
1455         - Do not process-swap if this flag is set
1456         - Drop opener from NavigationAction since it does not provide meaningful information to decide whether
1457           to process-swap or not.
1458
1459         * loader/FrameLoader.cpp:
1460         (WebCore::FrameLoader::setOpener):
1461         * loader/NavigationAction.h:
1462         (WebCore::NavigationAction::openedByDOMWithOpener const):
1463         (WebCore::NavigationAction::setOpenedByDOMWithOpener):
1464         (WebCore::NavigationAction::setOpener): Deleted.
1465         (WebCore::NavigationAction::opener const): Deleted.
1466         (WebCore::NavigationAction::openedViaWindowOpenWithOpener const): Deleted.
1467         (WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener): Deleted.
1468         * loader/PolicyChecker.cpp:
1469         (WebCore::PolicyChecker::checkNavigationPolicy):
1470         * page/DOMWindow.cpp:
1471         (WebCore::DOMWindow::createWindow):
1472         * page/Page.h:
1473         (WebCore::Page::openedByDOMWithOpener const):
1474         (WebCore::Page::setOpenedByDOMWithOpener):
1475         (WebCore::Page::openedViaWindowOpenWithOpener const): Deleted.
1476         (WebCore::Page::setOpenedViaWindowOpenWithOpener): Deleted.
1477
1478 2018-12-01  Christopher Reid  <chris.reid@sony.com>
1479
1480         Add generic implementations to FileSystemPOSIX.cpp
1481         https://bugs.webkit.org/show_bug.cgi?id=192263
1482
1483         Reviewed by Yusuke Suzuki.
1484
1485         No new tests, no change in behavior.
1486
1487         Add generic FileSystemPOSIX implementations for:
1488             - stringFromFileSystemRepresentation
1489             - fileSystemRepresentation
1490             - moveFile
1491             - getVolumeFreeSpace
1492
1493         Also removing an unneeded PLATFORM(GTK) check since GTK is only using FileSystemGlib
1494
1495         * platform/posix/FileSystemPOSIX.cpp:
1496
1497 2018-12-01  Zalan Bujtas  <zalan@apple.com>
1498
1499         [LFC][BFC] Call instrinsicWidthConstraints on the correct formatting state.
1500         https://bugs.webkit.org/show_bug.cgi?id=192274
1501
1502         Reviewed by Antti Koivisto.
1503
1504         When we call intrinsic width on a formatting context root, we need to use the formatting state
1505         that this root constructs and not the one it lives in.
1506
1507         * layout/blockformatting/BlockFormattingContext.cpp:
1508         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
1509         * layout/inlineformatting/InlineFormattingContext.cpp:
1510         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): it's the caller's responsiblitiy to store the intrinsic values.
1511
1512 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1513
1514         Fix Windows build.
1515
1516         * platform/network/curl/CookieJarCurl.cpp:
1517         * platform/network/curl/PublicSuffixCurl.cpp:
1518
1519 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1520
1521         Fix Windows build.
1522
1523         * platform/network/curl/CookieJarCurl.h:
1524
1525 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1526
1527         Move URL from WebCore to WTF
1528         https://bugs.webkit.org/show_bug.cgi?id=190234
1529
1530         Reviewed by Keith Miller.
1531
1532         A URL is a low-level concept that does not depend on other classes in WebCore.
1533         We are starting to use URLs in JavaScriptCore for modules.
1534         I need URL and URLParser in a place with fewer dependencies for rdar://problem/44119696
1535
1536         * Modules/applepay/ApplePaySession.h:
1537         * Modules/applepay/ApplePayValidateMerchantEvent.h:
1538         * Modules/applepay/PaymentCoordinator.cpp:
1539         * Modules/applepay/PaymentCoordinator.h:
1540         * Modules/applepay/PaymentCoordinatorClient.h:
1541         * Modules/applepay/PaymentSession.h:
1542         * Modules/applicationmanifest/ApplicationManifest.h:
1543         * Modules/beacon/NavigatorBeacon.cpp:
1544         * Modules/cache/DOMCache.cpp:
1545         * Modules/fetch/FetchLoader.h:
1546         * Modules/mediasession/MediaSessionMetadata.h:
1547         * Modules/mediasource/MediaSourceRegistry.cpp:
1548         * Modules/mediasource/MediaSourceRegistry.h:
1549         * Modules/mediastream/MediaStream.cpp:
1550         * Modules/mediastream/MediaStreamRegistry.cpp:
1551         * Modules/mediastream/MediaStreamRegistry.h:
1552         * Modules/navigatorcontentutils/NavigatorContentUtilsClient.h:
1553         * Modules/notifications/Notification.h:
1554         * Modules/paymentrequest/MerchantValidationEvent.h:
1555         * Modules/paymentrequest/PaymentRequest.h:
1556         * Modules/plugins/PluginReplacement.h:
1557         * Modules/webaudio/AudioContext.h:
1558         * Modules/websockets/ThreadableWebSocketChannel.h:
1559         * Modules/websockets/WebSocket.h:
1560         * Modules/websockets/WebSocketHandshake.cpp:
1561         * Modules/websockets/WebSocketHandshake.h:
1562         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
1563         * PlatformMac.cmake:
1564         * PlatformWin.cmake:
1565         * Sources.txt:
1566         * SourcesCocoa.txt:
1567         * WebCore.xcodeproj/project.pbxproj:
1568         * bindings/js/CachedModuleScriptLoader.h:
1569         * bindings/js/CachedScriptFetcher.h:
1570         * bindings/js/ScriptController.cpp:
1571         (WebCore::ScriptController::executeIfJavaScriptURL):
1572         * bindings/js/ScriptController.h:
1573         * bindings/js/ScriptModuleLoader.h:
1574         * bindings/js/ScriptSourceCode.h:
1575         * bindings/scripts/CodeGeneratorJS.pm:
1576         (GenerateImplementation):
1577         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1578         * bindings/scripts/test/JS/JSMapLike.cpp:
1579         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1580         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1581         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1582         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1583         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1584         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1585         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1586         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1587         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1588         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1589         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1590         * bindings/scripts/test/JS/JSTestException.cpp:
1591         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1592         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1593         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1594         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1595         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1596         * bindings/scripts/test/JS/JSTestInterface.cpp:
1597         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1598         * bindings/scripts/test/JS/JSTestIterable.cpp:
1599         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1600         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1601         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1602         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1603         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1604         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1605         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1606         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1607         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1608         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1609         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1610         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1611         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1612         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1613         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1614         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1615         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1616         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1617         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1618         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1619         * bindings/scripts/test/JS/JSTestNode.cpp:
1620         * bindings/scripts/test/JS/JSTestObj.cpp:
1621         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1622         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1623         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1624         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1625         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1626         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1627         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1628         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1629         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1630         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1631         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1632         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1633         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1634         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1635         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1636         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1637         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1638         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1639         * contentextensions/ContentExtensionsBackend.cpp:
1640         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1641         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):
1642         (WebCore::ContentExtensions::applyBlockedStatusToRequest):
1643         * contentextensions/ContentExtensionsBackend.h:
1644         * css/CSSValue.h:
1645         * css/StyleProperties.h:
1646         * css/StyleResolver.h:
1647         * css/StyleSheet.h:
1648         * css/StyleSheetContents.h:
1649         * css/parser/CSSParserContext.h:
1650         (WebCore::CSSParserContextHash::hash):
1651         (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
1652         * css/parser/CSSParserIdioms.h:
1653         * dom/DataTransfer.cpp:
1654         (WebCore::DataTransfer::setDataFromItemList):
1655         * dom/Document.cpp:
1656         (WebCore::Document::setURL):
1657         (WebCore::Document::processHttpEquiv):
1658         (WebCore::Document::completeURL const):
1659         (WebCore::Document::ensureTemplateDocument):
1660         * dom/Document.h:
1661         (WebCore::Document::urlForBindings const):
1662         * dom/Element.cpp:
1663         (WebCore::Element::isJavaScriptURLAttribute const):
1664         * dom/InlineStyleSheetOwner.cpp:
1665         (WebCore::parserContextForElement):
1666         * dom/Node.cpp:
1667         (WebCore::Node::baseURI const):
1668         * dom/Node.h:
1669         * dom/ScriptElement.h:
1670         * dom/ScriptExecutionContext.h:
1671         * dom/SecurityContext.h:
1672         * editing/Editor.cpp:
1673         (WebCore::Editor::pasteboardWriterURL):
1674         * editing/Editor.h:
1675         * editing/MarkupAccumulator.cpp:
1676         (WebCore::MarkupAccumulator::appendQuotedURLAttributeValue):
1677         * editing/cocoa/DataDetection.h:
1678         * editing/cocoa/EditorCocoa.mm:
1679         (WebCore::Editor::userVisibleString):
1680         * editing/cocoa/WebContentReaderCocoa.mm:
1681         (WebCore::replaceRichContentWithAttachments):
1682         (WebCore::WebContentReader::readWebArchive):
1683         * editing/mac/EditorMac.mm:
1684         (WebCore::Editor::plainTextFromPasteboard):
1685         (WebCore::Editor::writeImageToPasteboard):
1686         * editing/markup.cpp:
1687         (WebCore::removeSubresourceURLAttributes):
1688         (WebCore::createFragmentFromMarkup):
1689         * editing/markup.h:
1690         * fileapi/AsyncFileStream.cpp:
1691         * fileapi/AsyncFileStream.h:
1692         * fileapi/Blob.h:
1693         * fileapi/BlobURL.cpp:
1694         * fileapi/BlobURL.h:
1695         * fileapi/File.h:
1696         * fileapi/FileReaderLoader.h:
1697         * fileapi/ThreadableBlobRegistry.h:
1698         * history/CachedFrame.h:
1699         * history/HistoryItem.h:
1700         * html/DOMURL.cpp:
1701         (WebCore::DOMURL::create):
1702         * html/DOMURL.h:
1703         * html/HTMLAttachmentElement.cpp:
1704         (WebCore::HTMLAttachmentElement::archiveResourceURL):
1705         * html/HTMLFrameElementBase.cpp:
1706         (WebCore::HTMLFrameElementBase::isURLAllowed const):
1707         (WebCore::HTMLFrameElementBase::openURL):
1708         (WebCore::HTMLFrameElementBase::setLocation):
1709         * html/HTMLInputElement.h:
1710         * html/HTMLLinkElement.h:
1711         * html/HTMLMediaElement.cpp:
1712         (WTF::LogArgument<URL>::toString):
1713         (WTF::LogArgument<WebCore::URL>::toString): Deleted.
1714         * html/HTMLPlugInImageElement.cpp:
1715         (WebCore::HTMLPlugInImageElement::allowedToLoadFrameURL):
1716         * html/ImageBitmap.h:
1717         * html/MediaFragmentURIParser.h:
1718         * html/PublicURLManager.cpp:
1719         * html/PublicURLManager.h:
1720         * html/URLInputType.cpp:
1721         * html/URLRegistry.h:
1722         * html/URLSearchParams.cpp:
1723         (WebCore::URLSearchParams::URLSearchParams):
1724         (WebCore::URLSearchParams::toString const):
1725         (WebCore::URLSearchParams::updateURL):
1726         (WebCore::URLSearchParams::updateFromAssociatedURL):
1727         * html/URLUtils.h:
1728         (WebCore::URLUtils<T>::setHost):
1729         (WebCore::URLUtils<T>::setPort):
1730         * html/canvas/CanvasRenderingContext.cpp:
1731         * html/canvas/CanvasRenderingContext.h:
1732         * html/parser/HTMLParserIdioms.cpp:
1733         * html/parser/XSSAuditor.cpp:
1734         (WebCore::semicolonSeparatedValueContainsJavaScriptURL):
1735         (WebCore::XSSAuditor::filterScriptToken):
1736         (WebCore::XSSAuditor::filterObjectToken):
1737         (WebCore::XSSAuditor::filterParamToken):
1738         (WebCore::XSSAuditor::filterEmbedToken):
1739         (WebCore::XSSAuditor::filterFormToken):
1740         (WebCore::XSSAuditor::filterInputToken):
1741         (WebCore::XSSAuditor::filterButtonToken):
1742         (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
1743         (WebCore::XSSAuditor::isLikelySafeResource):
1744         * html/parser/XSSAuditor.h:
1745         * html/parser/XSSAuditorDelegate.h:
1746         * inspector/InspectorFrontendHost.cpp:
1747         (WebCore::InspectorFrontendHost::openInNewTab):
1748         * inspector/InspectorInstrumentation.h:
1749         * inspector/agents/InspectorNetworkAgent.cpp:
1750         * inspector/agents/InspectorNetworkAgent.h:
1751         * inspector/agents/InspectorPageAgent.h:
1752         * inspector/agents/InspectorWorkerAgent.h:
1753         * loader/ApplicationManifestLoader.h:
1754         * loader/CookieJar.h:
1755         * loader/CrossOriginAccessControl.h:
1756         * loader/CrossOriginPreflightResultCache.h:
1757         * loader/DocumentLoader.cpp:
1758         (WebCore::DocumentLoader::willSendRequest):
1759         (WebCore::DocumentLoader::maybeLoadEmpty):
1760         * loader/DocumentLoader.h:
1761         (WebCore::DocumentLoader::serverRedirectSourceForHistory const):
1762         * loader/DocumentWriter.h:
1763         * loader/FormSubmission.h:
1764         * loader/FrameLoader.cpp:
1765         (WebCore::FrameLoader::submitForm):
1766         (WebCore::FrameLoader::receivedFirstData):
1767         (WebCore::FrameLoader::loadWithDocumentLoader):
1768         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1769         (WebCore::createWindow):
1770         * loader/FrameLoaderClient.h:
1771         * loader/HistoryController.cpp:
1772         (WebCore::HistoryController::currentItemShouldBeReplaced const):
1773         (WebCore::HistoryController::initializeItem):
1774         * loader/LinkLoader.h:
1775         * loader/LoadTiming.h:
1776         * loader/LoaderStrategy.h:
1777         * loader/MixedContentChecker.cpp:
1778         (WebCore::MixedContentChecker::checkFormForMixedContent const):
1779         * loader/MixedContentChecker.h:
1780         * loader/NavigationScheduler.cpp:
1781         (WebCore::NavigationScheduler::shouldScheduleNavigation const):
1782         * loader/NavigationScheduler.h:
1783         * loader/PingLoader.h:
1784         * loader/PolicyChecker.cpp:
1785         (WebCore::PolicyChecker::checkNavigationPolicy):
1786         * loader/ResourceLoadInfo.h:
1787         * loader/ResourceLoadObserver.cpp:
1788         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
1789         * loader/ResourceLoadObserver.h:
1790         * loader/ResourceLoadStatistics.h:
1791         * loader/ResourceLoader.h:
1792         * loader/ResourceTiming.h:
1793         * loader/SubframeLoader.cpp:
1794         (WebCore::SubframeLoader::requestFrame):
1795         * loader/SubframeLoader.h:
1796         * loader/SubstituteData.h:
1797         * loader/appcache/ApplicationCache.h:
1798         * loader/appcache/ApplicationCacheGroup.h:
1799         * loader/appcache/ApplicationCacheHost.h:
1800         * loader/appcache/ApplicationCacheStorage.cpp:
1801         * loader/appcache/ApplicationCacheStorage.h:
1802         * loader/appcache/ManifestParser.cpp:
1803         * loader/appcache/ManifestParser.h:
1804         * loader/archive/ArchiveResourceCollection.h:
1805         * loader/archive/cf/LegacyWebArchive.cpp:
1806         (WebCore::LegacyWebArchive::createFromSelection):
1807         * loader/cache/CachedResource.cpp:
1808         * loader/cache/CachedResourceLoader.h:
1809         * loader/cache/CachedStyleSheetClient.h:
1810         * loader/cache/MemoryCache.h:
1811         * loader/icon/IconLoader.h:
1812         * loader/mac/LoaderNSURLExtras.mm:
1813         * page/CaptionUserPreferencesMediaAF.cpp:
1814         * page/ChromeClient.h:
1815         * page/ClientOrigin.h:
1816         * page/ContextMenuClient.h:
1817         * page/ContextMenuController.cpp:
1818         (WebCore::ContextMenuController::checkOrEnableIfNeeded const):
1819         * page/DOMWindow.cpp:
1820         (WebCore::DOMWindow::isInsecureScriptAccess):
1821         * page/DragController.cpp:
1822         (WebCore::DragController::startDrag):
1823         * page/DragController.h:
1824         * page/EventSource.h:
1825         * page/Frame.h:
1826         * page/FrameView.h:
1827         * page/History.h:
1828         * page/Location.cpp:
1829         (WebCore::Location::url const):
1830         (WebCore::Location::reload):
1831         * page/Location.h:
1832         * page/Page.h:
1833         * page/PageSerializer.h:
1834         * page/Performance.h:
1835         * page/PerformanceResourceTiming.cpp:
1836         * page/SecurityOrigin.cpp:
1837         (WebCore::SecurityOrigin::SecurityOrigin):
1838         (WebCore::SecurityOrigin::create):
1839         * page/SecurityOrigin.h:
1840         * page/SecurityOriginData.h:
1841         * page/SecurityOriginHash.h:
1842         * page/SecurityPolicy.cpp:
1843         (WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner):
1844         * page/SecurityPolicy.h:
1845         * page/SettingsBase.h:
1846         * page/ShareData.h:
1847         * page/SocketProvider.h:
1848         * page/UserContentProvider.h:
1849         * page/UserContentURLPattern.cpp:
1850         * page/UserContentURLPattern.h:
1851         * page/UserScript.h:
1852         * page/UserStyleSheet.h:
1853         * page/VisitedLinkStore.h:
1854         * page/csp/ContentSecurityPolicy.h:
1855         * page/csp/ContentSecurityPolicyClient.h:
1856         * page/csp/ContentSecurityPolicyDirectiveList.h:
1857         * page/csp/ContentSecurityPolicySource.cpp:
1858         (WebCore::ContentSecurityPolicySource::portMatches const):
1859         * page/csp/ContentSecurityPolicySource.h:
1860         * page/csp/ContentSecurityPolicySourceList.cpp:
1861         * page/csp/ContentSecurityPolicySourceList.h:
1862         * page/csp/ContentSecurityPolicySourceListDirective.cpp:
1863         * platform/ContentFilterUnblockHandler.h:
1864         * platform/ContextMenuItem.h:
1865         * platform/Cookie.h:
1866         * platform/CookiesStrategy.h:
1867         * platform/DragData.h:
1868         * platform/DragImage.h:
1869         * platform/FileStream.h:
1870         * platform/LinkIcon.h:
1871         * platform/Pasteboard.cpp:
1872         (WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles):
1873         * platform/Pasteboard.h:
1874         * platform/PasteboardStrategy.h:
1875         * platform/PasteboardWriterData.cpp:
1876         (WebCore::PasteboardWriterData::setURLData):
1877         (WebCore::PasteboardWriterData::setURL): Deleted.
1878         * platform/PasteboardWriterData.h:
1879         * platform/PlatformPasteboard.h:
1880         * platform/PromisedAttachmentInfo.h:
1881         * platform/SSLKeyGenerator.h:
1882         * platform/SchemeRegistry.cpp:
1883         (WebCore::SchemeRegistry::isBuiltinScheme):
1884         * platform/SharedBuffer.h:
1885         * platform/SharedStringHash.cpp:
1886         * platform/SharedStringHash.h:
1887         * platform/SourcesSoup.txt:
1888         * platform/UserAgent.h:
1889         * platform/UserAgentQuirks.cpp:
1890         * platform/UserAgentQuirks.h:
1891         * platform/cocoa/NetworkExtensionContentFilter.h:
1892         * platform/cocoa/NetworkExtensionContentFilter.mm:
1893         (WebCore::NetworkExtensionContentFilter::willSendRequest):
1894         * platform/glib/SSLKeyGeneratorGLib.cpp: Copied from Source/WebCore/page/ShareData.h.
1895         (WebCore::getSupportedKeySizes):
1896         (WebCore::signedPublicKeyAndChallengeString):
1897         * platform/glib/UserAgentGLib.cpp:
1898         * platform/graphics/GraphicsContext.h:
1899         * platform/graphics/Image.cpp:
1900         * platform/graphics/Image.h:
1901         * platform/graphics/ImageObserver.h:
1902         * platform/graphics/ImageSource.cpp:
1903         * platform/graphics/ImageSource.h:
1904         * platform/graphics/MediaPlayer.h:
1905         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1906         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1907         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1908         * platform/graphics/cg/GraphicsContextCG.cpp:
1909         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1910         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1911         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1912         (webKitMediaSrcSetUri):
1913         * platform/graphics/iso/ISOVTTCue.cpp:
1914         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1915         * platform/gtk/DragImageGtk.cpp:
1916         * platform/gtk/PasteboardGtk.cpp:
1917         * platform/gtk/PlatformPasteboardGtk.cpp:
1918         * platform/gtk/SelectionData.h:
1919         * platform/ios/PasteboardIOS.mm:
1920         * platform/ios/PlatformPasteboardIOS.mm:
1921         (WebCore::PlatformPasteboard::write):
1922         * platform/ios/QuickLook.h:
1923         * platform/mac/DragDataMac.mm:
1924         (WebCore::DragData::asPlainText const):
1925         * platform/mac/DragImageMac.mm:
1926         * platform/mac/FileSystemMac.mm:
1927         (WebCore::FileSystem::setMetadataURL):
1928         * platform/mac/PasteboardMac.mm:
1929         * platform/mac/PasteboardWriter.mm:
1930         (WebCore::createPasteboardWriter):
1931         * platform/mac/PlatformPasteboardMac.mm:
1932         * platform/mac/PublicSuffixMac.mm:
1933         (WebCore::decodeHostName):
1934         * platform/mac/SSLKeyGeneratorMac.mm:
1935         * platform/mac/WebCoreNSURLExtras.h:
1936         * platform/mac/WebCoreNSURLExtras.mm:
1937         (WebCore::isArmenianLookalikeCharacter): Deleted.
1938         (WebCore::isArmenianScriptCharacter): Deleted.
1939         (WebCore::isASCIIDigitOrValidHostCharacter): Deleted.
1940         (WebCore::isLookalikeCharacter): Deleted.
1941         (WebCore::whiteListIDNScript): Deleted.
1942         (WebCore::readIDNScriptWhiteListFile): Deleted.
1943         (WebCore::allCharactersInIDNScriptWhiteList): Deleted.
1944         (WebCore::isSecondLevelDomainNameAllowedByTLDRules): Deleted.
1945         (WebCore::isRussianDomainNameCharacter): Deleted.
1946         (WebCore::allCharactersAllowedByTLDRules): Deleted.
1947         (WebCore::mapHostNameWithRange): Deleted.
1948         (WebCore::hostNameNeedsDecodingWithRange): Deleted.
1949         (WebCore::hostNameNeedsEncodingWithRange): Deleted.
1950         (WebCore::decodeHostNameWithRange): Deleted.
1951         (WebCore::encodeHostNameWithRange): Deleted.
1952         (WebCore::decodeHostName): Deleted.
1953         (WebCore::encodeHostName): Deleted.
1954         (WebCore::collectRangesThatNeedMapping): Deleted.
1955         (WebCore::collectRangesThatNeedEncoding): Deleted.
1956         (WebCore::collectRangesThatNeedDecoding): Deleted.
1957         (WebCore::applyHostNameFunctionToMailToURLString): Deleted.
1958         (WebCore::applyHostNameFunctionToURLString): Deleted.
1959         (WebCore::mapHostNames): Deleted.
1960         (WebCore::stringByTrimmingWhitespace): Deleted.
1961         (WebCore::URLByTruncatingOneCharacterBeforeComponent): Deleted.
1962         (WebCore::URLByRemovingResourceSpecifier): Deleted.
1963         (WebCore::URLWithData): Deleted.
1964         (WebCore::dataWithUserTypedString): Deleted.
1965         (WebCore::URLWithUserTypedString): Deleted.
1966         (WebCore::URLWithUserTypedStringDeprecated): Deleted.
1967         (WebCore::hasQuestionMarkOnlyQueryString): Deleted.
1968         (WebCore::dataForURLComponentType): Deleted.
1969         (WebCore::URLByRemovingComponentAndSubsequentCharacter): Deleted.
1970         (WebCore::URLByRemovingUserInfo): Deleted.
1971         (WebCore::originalURLData): Deleted.
1972         (WebCore::createStringWithEscapedUnsafeCharacters): Deleted.
1973         (WebCore::userVisibleString): Deleted.
1974         (WebCore::isUserVisibleURL): Deleted.
1975         (WebCore::rangeOfURLScheme): Deleted.
1976         (WebCore::looksLikeAbsoluteURL): Deleted.
1977         * platform/mediastream/MediaEndpointConfiguration.h:
1978         * platform/network/BlobPart.h:
1979         * platform/network/BlobRegistry.h:
1980         * platform/network/BlobRegistryImpl.h:
1981         * platform/network/BlobResourceHandle.cpp:
1982         * platform/network/CookieRequestHeaderFieldProxy.h:
1983         * platform/network/CredentialStorage.cpp:
1984         * platform/network/CredentialStorage.h:
1985         * platform/network/DataURLDecoder.cpp:
1986         * platform/network/DataURLDecoder.h:
1987         * platform/network/FormData.h:
1988         * platform/network/ProxyServer.h:
1989         * platform/network/ResourceErrorBase.h:
1990         * platform/network/ResourceHandle.cpp:
1991         (WebCore::ResourceHandle::didReceiveResponse):
1992         * platform/network/ResourceHandle.h:
1993         * platform/network/ResourceHandleClient.h:
1994         * platform/network/ResourceRequestBase.cpp:
1995         (WebCore::ResourceRequestBase::redirectedRequest const):
1996         * platform/network/ResourceRequestBase.h:
1997         * platform/network/ResourceResponseBase.h:
1998         * platform/network/SocketStreamHandle.h:
1999         * platform/network/cf/DNSResolveQueueCFNet.cpp:
2000         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2001         * platform/network/cf/ProxyServerCFNet.cpp:
2002         * platform/network/cf/ResourceErrorCF.cpp:
2003         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2004         * platform/network/curl/CookieJarCurlDatabase.cpp: Added.
2005         (WebCore::cookiesForSession):
2006         (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const):
2007         (WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const):
2008         (WebCore::CookieJarCurlDatabase::cookiesForDOM const):
2009         (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
2010         (WebCore::CookieJarCurlDatabase::cookiesEnabled const):
2011         (WebCore::CookieJarCurlDatabase::getRawCookies const):
2012         (WebCore::CookieJarCurlDatabase::deleteCookie const):
2013         (WebCore::CookieJarCurlDatabase::getHostnamesWithCookies const):
2014         (WebCore::CookieJarCurlDatabase::deleteCookiesForHostnames const):
2015         (WebCore::CookieJarCurlDatabase::deleteAllCookies const):
2016         (WebCore::CookieJarCurlDatabase::deleteAllCookiesModifiedSince const):
2017         * platform/network/curl/CookieJarDB.cpp:
2018         * platform/network/curl/CookieUtil.h:
2019         * platform/network/curl/CurlContext.h:
2020         * platform/network/curl/CurlProxySettings.h:
2021         * platform/network/curl/CurlResponse.h:
2022         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2023         * platform/network/curl/ProxyServerCurl.cpp:
2024         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
2025         * platform/network/mac/ResourceErrorMac.mm:
2026         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2027         * platform/network/soup/ProxyServerSoup.cpp:
2028         * platform/network/soup/ResourceHandleSoup.cpp:
2029         * platform/network/soup/ResourceRequest.h:
2030         * platform/network/soup/ResourceRequestSoup.cpp:
2031         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2032         * platform/network/soup/SoupNetworkSession.cpp:
2033         * platform/network/soup/SoupNetworkSession.h:
2034         * platform/text/TextEncoding.h:
2035         * platform/win/BString.cpp:
2036         * platform/win/BString.h:
2037         * platform/win/ClipboardUtilitiesWin.cpp:
2038         (WebCore::markupToCFHTML):
2039         * platform/win/ClipboardUtilitiesWin.h:
2040         * platform/win/DragImageWin.cpp:
2041         * platform/win/PasteboardWin.cpp:
2042         * plugins/PluginData.h:
2043         * rendering/HitTestResult.h:
2044         * rendering/RenderAttachment.cpp:
2045         * svg/SVGImageLoader.cpp:
2046         (WebCore::SVGImageLoader::sourceURI const):
2047         * svg/SVGURIReference.cpp:
2048         * svg/graphics/SVGImage.h:
2049         * svg/graphics/SVGImageCache.h:
2050         * svg/graphics/SVGImageForContainer.h:
2051         * testing/Internals.cpp:
2052         (WebCore::Internals::resetToConsistentState):
2053         * testing/Internals.mm:
2054         (WebCore::Internals::userVisibleString):
2055         * testing/MockContentFilter.cpp:
2056         (WebCore::MockContentFilter::willSendRequest):
2057         * testing/MockPaymentCoordinator.cpp:
2058         * testing/js/WebCoreTestSupport.cpp:
2059         * workers/AbstractWorker.h:
2060         * workers/WorkerGlobalScope.h:
2061         * workers/WorkerGlobalScopeProxy.h:
2062         * workers/WorkerInspectorProxy.h:
2063         * workers/WorkerLocation.h:
2064         * workers/WorkerScriptLoader.h:
2065         * workers/WorkerThread.cpp:
2066         * workers/WorkerThread.h:
2067         * workers/service/ServiceWorker.h:
2068         * workers/service/ServiceWorkerClientData.h:
2069         * workers/service/ServiceWorkerContainer.cpp:
2070         * workers/service/ServiceWorkerContextData.h:
2071         * workers/service/ServiceWorkerData.h:
2072         * workers/service/ServiceWorkerJobData.h:
2073         * workers/service/ServiceWorkerRegistrationKey.cpp:
2074         * workers/service/ServiceWorkerRegistrationKey.h:
2075         (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue):
2076         * worklets/WorkletGlobalScope.h:
2077         * xml/XMLHttpRequest.h:
2078
2079 2018-11-30  Chris Dumez  <cdumez@apple.com>
2080
2081         Drop unused Cross-Origin-Window-Policy from HTTPHeaderNames.in
2082         https://bugs.webkit.org/show_bug.cgi?id=192253
2083
2084         Reviewed by Geoffrey Garen.
2085
2086         * platform/network/HTTPHeaderNames.in:
2087
2088 2018-11-30  Justin Fan  <justin_fan@apple.com>
2089
2090         [WebGPU] WebGPUQueue::submit and WebGPURenderingContext::present() implementation
2091         https://bugs.webkit.org/show_bug.cgi?id=192254
2092
2093         Reviewed by Dean Jackson.
2094
2095         Final plumbing to render onto an HTMLCanvasElement with WebGPU. Also added ref-test that draws 
2096         a green square onto a canvas using WebGPU; reference uses 2D canvas.
2097
2098         Test: webgpu/simple-triangle-strip.html
2099
2100         * Modules/webgpu/WebGPUCommandBuffer.h:
2101         * Modules/webgpu/WebGPUSwapChain.h: Needs to override platformLayer() for CanvasBasedRenderingContext.
2102         * platform/graphics/gpu/GPUQueue.h:
2103         * platform/graphics/gpu/GPUSwapChain.h:
2104         (WebCore::GPUSwapChain::metalLayer const): Renamed from platformLayer. 
2105         (WebCore::GPUSwapChain::platformLayer const): Deleted.
2106         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2107         (WebCore::GPUQueue::submit):
2108         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2109         (WebCore::GPUSwapChain::getNextTexture): Returns the texture of the swap layer's next drawable. 
2110         (WebCore::GPUSwapChain::present): Presents the last-returned drawable from getNextTexture, and frees it.
2111         (WebCore::GPUSwapChain::platformLayer const):
2112
2113 2018-11-30  Zalan Bujtas  <zalan@apple.com>
2114
2115         Can’t use RalphLauren.com on iPad because hover menus don’t stay up
2116         https://bugs.webkit.org/show_bug.cgi?id=192236
2117         <rdar://problem/45792118>
2118
2119         Reviewed by Geoffrey Garen.
2120
2121         This patch introduces asynchronous content change observation.
2122         1. Start observing synchronous content change and timer install as the result of dispatching mouseMoved event.
2123         2. Start observing synchronous content change and style recalc schedule as the result of a timer callback (installed at #1).
2124         3. Start observing synchronous content change as the result of a style recalc (scheduled at #2).
2125
2126         This patch also extends the timeout value from 100ms to 250ms. Certain content prefer longer timeouts (see http://briancherne.github.io/jquery-hoverIntent/ for details).  
2127
2128         Test: fast/events/touch/ios/hover-when-style-change-is-async.html
2129
2130         * dom/Document.cpp:
2131         (WebCore::Document::scheduleStyleRecalc):
2132         (WebCore::Document::updateStyleIfNeeded):
2133         * page/DOMTimer.cpp:
2134         (WebCore::DOMTimer::install):
2135         (WebCore::DOMTimer::fired):
2136         * platform/ios/wak/WKContentObservation.cpp:
2137         (WKStartObservingStyleRecalcScheduling):
2138         (WKStopObservingStyleRecalcScheduling):
2139         (WKIsObservingStyleRecalcScheduling):
2140         (WKSetShouldObserveNextStyleRecalc):
2141         (WKShouldObserveNextStyleRecalc):
2142         (WKSetObservedContentChange):
2143         * platform/ios/wak/WKContentObservation.h:
2144
2145 2018-11-30  Ryosuke Niwa  <rniwa@webkit.org>
2146
2147         ShadowRoot should have styleSheets property
2148         https://bugs.webkit.org/show_bug.cgi?id=191311
2149
2150         Reviewed by Antti Koivisto.
2151
2152         Added the support for ShadowRoot.prototype.styleSheets by making StyleSheetList refer to either
2153         a document or a shadow root. We don't support the named getter in shadow root since that's not
2154         a standard feature: https://drafts.csswg.org/cssom/#the-stylesheetlist-interface
2155
2156         Tests: fast/shadow-dom/shadowroot-stylesheets-wrapper-gc.html
2157                imported/w3c/web-platform-tests/shadow-dom/ShadowRoot-interface.html
2158
2159         * css/StyleSheetList.cpp:
2160         (WebCore::StyleSheetList::StyleSheetList): Added a variant which takes ShadowRoot.
2161         (WebCore::StyleSheetList::styleSheets const):
2162         (WebCore::StyleSheetList::ownerNode): Added. The replacement for document() since now the opaque
2163         root could be either a Document or a ShadowRoot.
2164         (WebCore::StyleSheetList::detach): Renamed from detachFromDocument.
2165         (WebCore::StyleSheetList::namedItem const): Added a comment that the named getter is only supported
2166         for Document since it's not in the standard.
2167         * css/StyleSheetList.h:
2168         (WebCore::StyleSheetList::create): Added a variant which takes ShadowRoot.
2169         (WebCore::StyleSheetList::document): Deleted. Replaced by StyleSheetList::ownerNode in .cpp file.
2170         * css/StyleSheetList.idl:
2171         * dom/Document.cpp:
2172         (WebCore::Document::~Document):
2173         (WebCore::Document::styleSheets):
2174         * dom/Document.idl:
2175         * dom/DocumentOrShadowRoot.idl: Moved the declaration of styleSheets here from Document.idl.
2176         * dom/ShadowRoot.cpp:
2177         (WebCore::ShadowRoot::~ShadowRoot): Call detach.
2178         (WebCore::ShadowRoot::styleSheets):
2179         * dom/ShadowRoot.h:
2180
2181 2018-11-30  Chris Dumez  <cdumez@apple.com>
2182
2183         [PSON] We are sometimes swapping processes even though there is an opened window with an opener link to us
2184         https://bugs.webkit.org/show_bug.cgi?id=192242
2185
2186         Reviewed by Geoffrey Garen.
2187
2188         Move the setting of the openedViaWindowOpenWithOpener & hasOpenedFrames flags on the
2189         NavigationAction from FrameLoader::loadURL(), to PolicyChecker::checkNavigationPolicy()
2190         to make sure those are always accurate and so that the UIProcess can make correct process
2191         swapping decisions.
2192
2193         NavigationAction objects are created in other places than FrameLoader::loadURL() as well.
2194         Even PolicyChecker::checkNavigationPolicy() will create a NavigationAction object if
2195         there is not already one.
2196
2197         * loader/FrameLoader.cpp:
2198         (WebCore::FrameLoader::loadURL):
2199         * loader/FrameLoader.h:
2200         (WebCore::FrameLoader::hasOpenedFrames const):
2201         * loader/PolicyChecker.cpp:
2202         (WebCore::PolicyChecker::checkNavigationPolicy):
2203
2204 2018-11-30  Don Olmstead  <don.olmstead@sony.com>
2205
2206         Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO
2207         https://bugs.webkit.org/show_bug.cgi?id=192197
2208
2209         Reviewed by Jiewen Tan.
2210
2211         No new tests. No change in behavior.
2212
2213         * Configurations/FeatureDefines.xcconfig:
2214         * bindings/js/SerializedScriptValue.cpp:
2215         (WebCore::CloneSerializer::dumpIfTerminal):
2216         (WebCore::CloneDeserializer::readTerminal):
2217         * crypto/CommonCryptoUtilities.cpp:
2218         * crypto/CommonCryptoUtilities.h:
2219         * crypto/CryptoAlgorithm.cpp:
2220         * crypto/CryptoAlgorithm.h:
2221         * crypto/CryptoAlgorithmIdentifier.h:
2222         * crypto/CryptoAlgorithmParameters.h:
2223         * crypto/CryptoAlgorithmParameters.idl:
2224         * crypto/CryptoAlgorithmRegistry.cpp:
2225         * crypto/CryptoAlgorithmRegistry.h:
2226         * crypto/CryptoKey.cpp:
2227         * crypto/CryptoKey.h:
2228         * crypto/CryptoKey.idl:
2229         * crypto/CryptoKeyFormat.h:
2230         * crypto/CryptoKeyPair.h:
2231         * crypto/CryptoKeyPair.idl:
2232         * crypto/CryptoKeyType.h:
2233         * crypto/CryptoKeyUsage.h:
2234         * crypto/CryptoKeyUsage.idl:
2235         * crypto/JsonWebKey.h:
2236         * crypto/JsonWebKey.idl:
2237         * crypto/RsaOtherPrimesInfo.h:
2238         * crypto/RsaOtherPrimesInfo.idl:
2239         * crypto/SerializedCryptoKeyWrap.h:
2240         * crypto/SubtleCrypto.cpp:
2241         * crypto/SubtleCrypto.h:
2242         * crypto/SubtleCrypto.idl:
2243         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2244         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2245         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2246         * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
2247         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2248         * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
2249         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2250         * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
2251         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2252         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2253         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
2254         * crypto/algorithms/CryptoAlgorithmECDH.h:
2255         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
2256         * crypto/algorithms/CryptoAlgorithmECDSA.h:
2257         * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
2258         * crypto/algorithms/CryptoAlgorithmHKDF.h:
2259         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2260         * crypto/algorithms/CryptoAlgorithmHMAC.h:
2261         * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
2262         * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
2263         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2264         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2265         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2266         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2267         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2268         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2269         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
2270         * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
2271         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
2272         * crypto/algorithms/CryptoAlgorithmSHA1.h:
2273         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
2274         * crypto/algorithms/CryptoAlgorithmSHA224.h:
2275         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
2276         * crypto/algorithms/CryptoAlgorithmSHA256.h:
2277         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
2278         * crypto/algorithms/CryptoAlgorithmSHA384.h:
2279         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
2280         * crypto/algorithms/CryptoAlgorithmSHA512.h:
2281         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
2282         * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
2283         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
2284         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
2285         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
2286         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
2287         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
2288         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
2289         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
2290         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
2291         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
2292         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
2293         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
2294         * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
2295         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
2296         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
2297         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
2298         * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
2299         * crypto/keys/CryptoAesKeyAlgorithm.idl:
2300         * crypto/keys/CryptoEcKeyAlgorithm.idl:
2301         * crypto/keys/CryptoHmacKeyAlgorithm.idl:
2302         * crypto/keys/CryptoKeyAES.cpp:
2303         * crypto/keys/CryptoKeyAES.h:
2304         * crypto/keys/CryptoKeyAlgorithm.idl:
2305         * crypto/keys/CryptoKeyEC.cpp:
2306         * crypto/keys/CryptoKeyEC.h:
2307         * crypto/keys/CryptoKeyHMAC.cpp:
2308         * crypto/keys/CryptoKeyHMAC.h:
2309         * crypto/keys/CryptoKeyRSA.cpp:
2310         * crypto/keys/CryptoKeyRSA.h:
2311         * crypto/keys/CryptoKeyRSAComponents.cpp:
2312         * crypto/keys/CryptoKeyRSAComponents.h:
2313         * crypto/keys/CryptoKeyRaw.cpp:
2314         * crypto/keys/CryptoKeyRaw.h:
2315         * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl:
2316         * crypto/keys/CryptoRsaKeyAlgorithm.idl:
2317         * crypto/mac/CommonCryptoDERUtilities.cpp:
2318         * crypto/mac/CommonCryptoDERUtilities.h:
2319         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2320         * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
2321         * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
2322         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
2323         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
2324         * crypto/mac/CryptoAlgorithmECDHMac.cpp:
2325         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
2326         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
2327         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
2328         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
2329         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
2330         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
2331         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
2332         * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
2333         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
2334         * crypto/mac/CryptoDigestAlgorithm.h:
2335         * crypto/mac/CryptoKeyECMac.cpp:
2336         * crypto/mac/CryptoKeyMac.cpp:
2337         * crypto/mac/CryptoKeyRSAMac.cpp:
2338         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
2339         * crypto/parameters/AesCbcCfbParams.idl:
2340         * crypto/parameters/AesCtrParams.idl:
2341         * crypto/parameters/AesGcmParams.idl:
2342         * crypto/parameters/AesKeyParams.idl:
2343         * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
2344         * crypto/parameters/CryptoAlgorithmAesCtrParams.h:
2345         * crypto/parameters/CryptoAlgorithmAesGcmParams.h:
2346         * crypto/parameters/CryptoAlgorithmAesKeyParams.h:
2347         * crypto/parameters/CryptoAlgorithmEcKeyParams.h:
2348         * crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h:
2349         * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
2350         * crypto/parameters/CryptoAlgorithmHkdfParams.h:
2351         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
2352         * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
2353         * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
2354         * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h:
2355         * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
2356         * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
2357         * crypto/parameters/CryptoAlgorithmRsaPssParams.h:
2358         * crypto/parameters/EcKeyParams.idl:
2359         * crypto/parameters/EcdhKeyDeriveParams.idl:
2360         * crypto/parameters/EcdsaParams.idl:
2361         * crypto/parameters/HkdfParams.idl:
2362         * crypto/parameters/HmacKeyParams.idl:
2363         * crypto/parameters/Pbkdf2Params.idl:
2364         * crypto/parameters/RsaHashedImportParams.idl:
2365         * crypto/parameters/RsaHashedKeyGenParams.idl:
2366         * crypto/parameters/RsaKeyGenParams.idl:
2367         * crypto/parameters/RsaOaepParams.idl:
2368         * crypto/parameters/RsaPssParams.idl:
2369         * dom/Document.cpp:
2370         * dom/Document.h:
2371         * dom/ScriptExecutionContext.h:
2372         * page/ChromeClient.h:
2373         * page/Crypto.cpp:
2374         (WebCore::Crypto::Crypto):
2375         * page/Crypto.h:
2376         * page/Crypto.idl:
2377         * platform/GCrypt.cmake:
2378         * platform/LocalizedStrings.cpp:
2379         * platform/LocalizedStrings.h:
2380         * workers/WorkerGlobalScope.cpp:
2381         * workers/WorkerGlobalScope.h:
2382         * worklets/WorkletGlobalScope.h:
2383
2384 2018-11-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2385
2386         Replace "auto fill" with "AutoFill" in some localizable strings
2387         https://bugs.webkit.org/show_bug.cgi?id=192233
2388         <rdar://problem/46311614>
2389
2390         Reviewed by Chris Fleizach.
2391
2392         Replace "autofill" with "AutoFill".
2393
2394         * en.lproj/Localizable.strings:
2395         * platform/LocalizedStrings.cpp:
2396         (WebCore::AXAutoFillCredentialsLabel):
2397         (WebCore::AXAutoFillContactsLabel):
2398         (WebCore::AXAutoFillStrongPasswordLabel):
2399         (WebCore::AXAutoFillCreditCardLabel):
2400
2401 2018-11-29  Ryosuke Niwa  <rniwa@webkit.org>
2402
2403         Add CEReactions=NotNeeded on all the relevant IDL files
2404         https://bugs.webkit.org/show_bug.cgi?id=188368
2405         <rdar://problem/42987753>
2406
2407         Rubber-stamped by Antti Koivisto.
2408
2409         Based on a patch written by Frederic Wang. Added CEReactions=NotNeeded to all the places
2410         we don't need CEReactions because we don't implement customized builtins but are marked with
2411         CEReactions in the HTML specification.
2412
2413         * html/HTMLAnchorElement.idl:
2414         * html/HTMLAreaElement.idl:
2415         * html/HTMLBRElement.idl:
2416         * html/HTMLBaseElement.idl:
2417         * html/HTMLBodyElement.idl:
2418         * html/HTMLButtonElement.idl:
2419         * html/HTMLCanvasElement.idl:
2420         * html/HTMLDListElement.idl:
2421         * html/HTMLDataElement.idl:
2422         * html/HTMLDetailsElement.idl:
2423         * html/HTMLDirectoryElement.idl:
2424         * html/HTMLDivElement.idl:
2425         * html/HTMLEmbedElement.idl:
2426         * html/HTMLFieldSetElement.idl:
2427         * html/HTMLFontElement.idl:
2428         * html/HTMLFormElement.idl:
2429         * html/HTMLFrameElement.idl:
2430         * html/HTMLFrameSetElement.idl:
2431         * html/HTMLHRElement.idl:
2432         * html/HTMLHeadingElement.idl:
2433         * html/HTMLHtmlElement.idl:
2434         * html/HTMLHyperlinkElementUtils.idl:
2435         * html/HTMLImageElement.idl:
2436         * html/HTMLInputElement.idl:
2437         * html/HTMLLIElement.idl:
2438         * html/HTMLLabelElement.idl:
2439         * html/HTMLLegendElement.idl:
2440         * html/HTMLLinkElement.idl:
2441         * html/HTMLMapElement.idl:
2442         * html/HTMLMarqueeElement.idl:
2443         * html/HTMLMediaElement.idl:
2444         * html/HTMLMenuElement.idl:
2445         * html/HTMLMetaElement.idl:
2446         * html/HTMLMeterElement.idl:
2447         * html/HTMLModElement.idl:
2448         * html/HTMLOListElement.idl:
2449         * html/HTMLObjectElement.idl:
2450         * html/HTMLOptGroupElement.idl:
2451         * html/HTMLOptionElement.idl:
2452         * html/HTMLOutputElement.idl:
2453         * html/HTMLParagraphElement.idl:
2454         * html/HTMLParamElement.idl:
2455         * html/HTMLPreElement.idl:
2456         * html/HTMLProgressElement.idl:
2457         * html/HTMLQuoteElement.idl:
2458         * html/HTMLScriptElement.idl:
2459         * html/HTMLSlotElement.idl:
2460         * html/HTMLSourceElement.idl:
2461         * html/HTMLStyleElement.idl:
2462         * html/HTMLTableCaptionElement.idl:
2463         * html/HTMLTableCellElement.idl:
2464         * html/HTMLTableColElement.idl:
2465         * html/HTMLTableElement.idl:
2466         * html/HTMLTableRowElement.idl:
2467         * html/HTMLTableSectionElement.idl:
2468         * html/HTMLTextAreaElement.idl:
2469         * html/HTMLTimeElement.idl:
2470         * html/HTMLTrackElement.idl:
2471         * html/HTMLUListElement.idl:
2472         * html/HTMLVideoElement.idl:
2473
2474 2018-11-30  Alexey Proskuryakov  <ap@apple.com>
2475
2476         Move USE_CFNETWORK_IGNORE_HSTS to its proper place
2477         https://bugs.webkit.org/show_bug.cgi?id=192173
2478
2479         Reviewed by Tim Horton.
2480
2481         * platform/network/mac/WebCoreURLResponse.mm:
2482         (WebCore::schemeWasUpgradedDueToDynamicHSTS):
2483
2484 2018-11-30  Basuke Suzuki  <basuke.suzuki@sony.com>
2485
2486         [Curl] Add API for ProtectionSpace.
2487         https://bugs.webkit.org/show_bug.cgi?id=191648
2488
2489         Reviewed by Alex Christensen.
2490
2491         Create a platform dependent header and implementation files for ProtectionSpace.
2492
2493         No new tests because there's no behavior change.
2494
2495         * platform/Curl.cmake:
2496         * platform/network/ProtectionSpace.h:
2497         * platform/network/curl/ProtectionSpaceCurl.cpp: Added.
2498         (WebCore::ProtectionSpace::certificateInfo const):
2499         * platform/network/curl/ProtectionSpaceCurl.h: Added.
2500         (WebCore::ProtectionSpace::ProtectionSpace):
2501         (WebCore::ProtectionSpace::encodingRequiresPlatformData const):
2502         (WebCore::ProtectionSpace::platformCompare):
2503
2504 2018-11-30  Justin Fan  <justin_fan@apple.com>
2505
2506         [WebGPU] Flesh out WebGPURenderPassDescriptor to match the WebGPU IDL
2507         https://bugs.webkit.org/show_bug.cgi?id=192213
2508
2509         Reviewed by Dean Jackson.
2510
2511         WebGPU prototype now uses WebGPURenderPassColorAttachmentDescriptor in WebGPURenderPassDescriptor to match the WebGPU Sketch.
2512         WebGPU developer can now also set the clearColor in WebGPURenderPassDescriptor.
2513
2514         No new tests. Older WebGPURenderPass* tests updated. 
2515
2516         * CMakeLists.txt:
2517         * DerivedSources.make:
2518         * Modules/webgpu/WebGPUColor.h: Added. Typedef'd to GPUColor.h.
2519         * Modules/webgpu/WebGPUColor.idl: Added.
2520         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2521         (WebCore::WebGPUCommandBuffer::beginRenderPass): Updated to error check and support the new structure of WebGPURenderPassDescriptor.
2522         * Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.h: Added.
2523         * Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.idl: Added.
2524         * Modules/webgpu/WebGPURenderPassDescriptor.h: 
2525         * Modules/webgpu/WebGPURenderPassDescriptor.idl: Updated to match the sketch IDL.
2526         * Sources.txt:
2527         * WebCore.xcodeproj/project.pbxproj:
2528         * platform/graphics/gpu/GPUColor.h: Added.
2529         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Added. Backing struct for WebGPU__.
2530         * platform/graphics/gpu/GPURenderPassDescriptor.h: Updated to match new WebGPURenderPassDescriptor.
2531         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2532         (WebCore::GPURenderPassEncoder::create): Now also uses clearColor set by developer.
2533
2534 2018-11-30  Andy Estes  <aestes@apple.com>
2535
2536         [Cocoa] Add some WKA extension points
2537         https://bugs.webkit.org/show_bug.cgi?id=192131
2538         <rdar://problem/46330293>
2539
2540         Reviewed by Tim Horton.
2541
2542         * DerivedSources.make: Added an extension point for derived sources.
2543         * Modules/applepay/PaymentCoordinatorClient.h: Added an extension point for
2544         PaymentCoordinatorClient.
2545         * SourcesCocoa.txt: Added WebCoreAdditions.mm as a non-unified source.
2546         * WebCore.xcodeproj/project.pbxproj: Added WebCoreAdditions.mm.
2547         * bindings/js/WebCoreBuiltinNames.h: Added an extension point for built-in names.
2548         * page/SettingsBase.h: Added an extension point for settings.
2549         * platform/cocoa/WebCoreAdditions.mm: Added.
2550
2551 2018-11-30  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2552
2553         [GStreamer][EME] CDMInstance should be shipped as a GstContext to the decryptors
2554         https://bugs.webkit.org/show_bug.cgi?id=192075
2555
2556         Reviewed by Philippe Normand.
2557
2558         So far, we were shipping the CDMInstance in an event to the
2559         decryptors and they were requesting it with bus messages when it
2560         was not found. Now we ship it with a GstContext that is set to the
2561         pipeline and read from the decryptors, which is now always
2562         available.
2563
2564         As a consequence of changing this flow, the attemptToDecrypt one
2565         was affected as well because it was tied to CDMInstance
2566         shipment. A workaround was added: when the decryptors send the
2567         waitingForKey, an attemptToDecrypt will be performed. A FIXME was
2568         added for this. A subconsequence is that
2569         attemptToDecryptWithInstance is reworked to rely always in
2570         attemptToDecryptWithLocal instance, the former becomes final and
2571         the latter virtual.
2572
2573         This is a rework, no new tests needed.
2574
2575         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2576         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2577         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2578         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
2579         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
2580         (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
2581         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance): Deleted.
2582         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2583         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2584         (webkit_media_common_encryption_decrypt_class_init):
2585         (webkitMediaCommonEncryptionDecryptTransformInPlace):
2586         (webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable):
2587         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
2588         (webKitMediaCommonEncryptionDecryptorSetContext):
2589         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2590         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance):
2591         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance): Deleted.
2592         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2593
2594 2018-11-30  Zalan Bujtas  <zalan@apple.com>
2595
2596         [LFC][BFC] Compute min/maxHeight margins only when they are needed.
2597         https://bugs.webkit.org/show_bug.cgi?id=192223
2598
2599         Reviewed by Antti Koivisto.
2600
2601         Test: fast/block/block-only/collapsed-margin-with-min-height.html
2602
2603         * layout/blockformatting/BlockFormattingContext.cpp:
2604         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2605
2606 2018-11-30  Zalan Bujtas  <zalan@apple.com>
2607
2608         [LFC][BFC] Geometry::inFlowNonReplacedHeightAndMargin should check for empty inline formatting context.
2609         https://bugs.webkit.org/show_bug.cgi?id=192215
2610
2611         Reviewed by Antti Koivisto.
2612
2613         Check if the inline formatting context actually has any lines.
2614
2615         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2616         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2617
2618 2018-11-30  Zalan Bujtas  <zalan@apple.com>
2619
2620         [LFC][BFC][MarginCollapsing] Do not use computed display box values for border and padding
2621         https://bugs.webkit.org/show_bug.cgi?id=192214
2622
2623         Reviewed by Antti Koivisto.
2624
2625         Border and padding values are not necessarily computed yet when we try to estimate the margin top value. Estimating margin top is required
2626         to be able to place floats (vertically) sooner than we would compute the final vertical position for a regular block box.
2627
2628         <body><div style="float: left"></div><div><div style="margin: 10px;"></div></div>
2629
2630         In the above example, to estimate a final vertical position of the floating box, we need to know whether the nested div's margin is collapsed
2631         all the way up to the body. However in order to find it out we need to check for borders and paddings (they stop margin collapsing).
2632         At the time when the floating box is being laied out, those <div> block boxes are still far down in the layout queue.
2633
2634         * layout/blockformatting/BlockFormattingContext.h:
2635         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2636         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2637         * layout/blockformatting/BlockMarginCollapse.cpp:
2638         (WebCore::Layout::hasBorder):
2639         (WebCore::Layout::hasPadding):
2640         (WebCore::Layout::hasBorderBefore):
2641         (WebCore::Layout::hasBorderAfter):
2642         (WebCore::Layout::hasPaddingBefore):
2643         (WebCore::Layout::hasPaddingAfter):
2644         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent):
2645         (WebCore::Layout::isMarginBottomCollapsedThrough):
2646         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
2647         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
2648         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
2649         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
2650
2651 2018-11-29  Frederic Wang  <fwang@igalia.com>
2652
2653         Separate paint and scroll offsets for RenderLayerBacking::m_scrollingContentsLayer
2654         https://bugs.webkit.org/show_bug.cgi?id=183040
2655
2656         Currently, scroll offset of RenderLayerBacking::m_scrollingContentsLayer is stored in the
2657         GraphicsLayer::m_offsetFromRenderer member used for paint offset. This patch separates these
2658         two concept by introducing a new GraphicsLayer::m_scrollOffset for the scroll offset. This
2659         makes the API a little bit cleaner, the code easier to understand and might avoid unnecessary
2660         repaints in composited scroll.
2661
2662         Reviewed by Simon Fraser.
2663
2664         No new tests, already covered by existing tests.
2665
2666         * platform/graphics/GraphicsLayer.cpp:
2667         (WebCore::GraphicsLayer::setScrollOffset): Setter function to update the scroll offset
2668         of the content layer inside its scrolling parent layer. Ask a repaint if it has changed and
2669         is requested by the caller.
2670         (WebCore::GraphicsLayer::paintGraphicsLayerContents): Take into account the scroll offset
2671         when painting.
2672         (WebCore::GraphicsLayer::dumpProperties const): Dump the scroll offset property.
2673         * platform/graphics/GraphicsLayer.h: Include ScrollableArea for the ScrollOffset typedef.
2674         Add member for the scroll offset of the content layer inside its scrolling parent layer.
2675         (WebCore::GraphicsLayer::scrollOffset const): Getter function.
2676         * rendering/RenderLayerBacking.cpp:
2677         (WebCore::RenderLayerBacking::updateGeometry): Do not include the scroll offset in the
2678         paint offset of m_scrollingContentsLayer since it is now taken into account in
2679         paintGraphicsLayerContents. Update the scroll offset of m_scrollingContentsLayer separately.
2680         Leave the paint offset of m_foregroundLayer unchanged.
2681         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): Take into account the scroll
2682         offset of m_scrollingContentsLayer when calculating the dirty rect.
2683
2684 2018-11-29  Simon Fraser  <simon.fraser@apple.com>
2685
2686         Overflow scrolling layers need to be self-painting
2687         https://bugs.webkit.org/show_bug.cgi?id=192201
2688
2689         Reviewed by Dean Jackson.
2690         
2691         Overflow scrolling layers paint their contents, so need to be self-painting in the RenderLayer sense.
2692         
2693         Without this change, the overflow in the testcase doesn't get any compositing layers.
2694
2695         Test: compositing/scrolling/overflow-scrolling-layers-are-self-painting.html
2696
2697         * rendering/RenderLayer.cpp:
2698         (WebCore::RenderLayer::calculateClipRects const):
2699
2700 2018-11-29  Christopher Reid  <chris.reid@sony.com>
2701
2702         [Win] listDirectory in FileSystemWin.cpp should not skip all directories
2703         https://bugs.webkit.org/show_bug.cgi?id=192042
2704
2705         Reviewed by Fujii Hironori.
2706
2707         Covered by existing tests.
2708
2709         listDirectory is not returning any child directories which is causing
2710         ASSERT(diskUsage >= databaseFileSize) in SQLiteIDBBackingStore.cpp to fail.
2711
2712         Change listDirectory in FileSystemWin to match FileSystemPOSIX's behavior.
2713         listDirectory should only skip the current and previous directories.
2714
2715         * platform/win/FileSystemWin.cpp:
2716
2717 2018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
2718
2719         Unreviewed, rolling out r238713.
2720
2721         Breaks internal builds.
2722
2723         Reverted changeset:
2724
2725         "[Cocoa] Add some WKA extension points"
2726         https://bugs.webkit.org/show_bug.cgi?id=192131
2727         https://trac.webkit.org/changeset/238713
2728
2729 2018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
2730
2731         Unreviewed, rolling out r238680.
2732
2733         Caused existing webrtc layout tests to fail an assertion.
2734
2735         Reverted changeset:
2736
2737         "A sender created through addTransceiver and populated using
2738         addTrack should have its source set"
2739         https://bugs.webkit.org/show_bug.cgi?id=192136
2740         https://trac.webkit.org/changeset/238680
2741
2742 2018-11-29  Justin Fan  <justin_fan@apple.com>
2743
2744         Remove dangling WebGPU file references from WebCore project
2745         https://bugs.webkit.org/show_bug.cgi?id=192185
2746
2747         Unreviewed project file gardening.
2748
2749         No new tests.
2750
2751         * WebCore.xcodeproj/project.pbxproj:
2752
2753 2018-11-29  Keith Rollin  <krollin@apple.com>
2754
2755         Unreviewed build fix.
2756
2757         r238637 introduced some DerivedSources.make changes that could produce
2758         some invalid .idl files, leading to IDLParser.pm error messages.
2759
2760         * DerivedSources.make:
2761
2762 2018-11-29  Simon Fraser  <simon.fraser@apple.com>
2763
2764         Add an internal feature flag to enable async overflow scrolling
2765         https://bugs.webkit.org/show_bug.cgi?id=192184
2766
2767         Reviewed by Tim Horton.
2768
2769         Add a new internal feature flag that will enable async overflow-scrolling for
2770         most overflow:scroll elements. Defaults to off.
2771         
2772         Make the "UseAcceleratedTouchScrolling" terminology in RenderLayer etc be more generic,
2773         and refer to async overflow scrolling.
2774
2775         * page/Settings.yaml:
2776         * rendering/RenderLayer.cpp:
2777         (WebCore::canCreateStackingContext): Remove a line which is not necessary, since -webkit-overflow-scrolling: touch
2778         already triggers non-auto z-index via code in StyleResolver::adjustRenderStyle().
2779         (WebCore::RenderLayer::canUseCompositedScrolling const):
2780         (WebCore::RenderLayer::hasCompositedScrollableOverflow const):
2781         (WebCore::RenderLayer::handleTouchEvent):
2782         (WebCore::RenderLayer::usesAsyncScrolling const):
2783         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
2784         (WebCore::RenderLayer::showsOverflowControls const):
2785         (WebCore::RenderLayer::calculateClipRects const):
2786         (WebCore::RenderLayer::canUseAcceleratedTouchScrolling const): Deleted.
2787         (WebCore::RenderLayer::hasTouchScrollableOverflow const): Deleted.
2788         * rendering/RenderLayer.h:
2789         * rendering/RenderLayerBacking.cpp:
2790         (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
2791         (WebCore::RenderLayerBacking::updateConfiguration):
2792         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
2793         * rendering/RenderLayerCompositor.cpp:
2794         (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
2795         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
2796         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
2797
2798 2018-11-29  Andy Estes  <aestes@apple.com>
2799
2800         [Cocoa] Add some WKA extension points
2801         https://bugs.webkit.org/show_bug.cgi?id=192131
2802         <rdar://problem/46330293>
2803
2804         Reviewed by Tim Horton.
2805
2806         * DerivedSources.make: Added an extension point for derived sources.
2807         * Modules/applepay/PaymentCoordinatorClient.h: Added an extension point for
2808         PaymentCoordinatorClient.
2809         * SourcesCocoa.txt: Added WebCoreAdditions.mm as a non-unified source.
2810         * WebCore.xcodeproj/project.pbxproj: Added WebCoreAdditions.mm.
2811         * bindings/js/WebCoreBuiltinNames.h: Added an extension point for built-in names.
2812         * page/SettingsBase.h: Added an extension point for settings.
2813         * platform/cocoa/WebCoreAdditions.mm: Added.
2814
2815 2018-11-29  Tim Horton  <timothy_horton@apple.com>
2816
2817         Make drawing tools available when an editable image is focused
2818         https://bugs.webkit.org/show_bug.cgi?id=192172
2819         <rdar://problem/30337960>
2820
2821         Reviewed by Dean Jackson.
2822
2823         * editing/Editor.cpp:
2824         (WebCore::Editor::insertEditableImage):
2825         * editing/Editor.h:
2826         * editing/InsertEditableImageCommand.cpp:
2827         (WebCore::InsertEditableImageCommand::insertEditableImage):
2828         (WebCore::InsertEditableImageCommand::doApply):
2829         * editing/InsertEditableImageCommand.h:
2830         Add InsertEditableImageCommand::insertEditableImage, which returns the
2831         inserted image element.
2832
2833         * html/HTMLImageElement.h:
2834         Make HTMLImageElement focusable if it is editable.
2835
2836 2018-11-29  Zalan Bujtas  <zalan@apple.com>
2837
2838         [LFC][BFC][Quirk] Body and html height stretching.
2839         https://bugs.webkit.org/show_bug.cgi?id=192154
2840
2841         Reviewed by Antti Koivisto.
2842
2843         This patch takes the document box's margin/border/padding into account when stretching html/body to the height of the initial containing block.
2844
2845         Tests: fast/block/block-only/body-height-with-auto-html-height-quirk.html
2846                fast/block/block-only/body-height-with-auto-html-height-quirk2.html
2847                fast/block/block-only/body-height-with-non-auto-html-height-quirk.html
2848                fast/block/block-only/body-height-with-non-auto-html-height-quirk2.html
2849
2850         * layout/blockformatting/BlockFormattingContext.h:
2851         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2852         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom):
2853         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2854         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
2855
2856 2018-11-29  Justin Fan  <justin_fan@apple.com>
2857
2858         [WebGPU] Replace forward declare of WebGPUCommandBuffer with include
2859         https://bugs.webkit.org/show_bug.cgi?id=192179
2860
2861         Unreviewed build fix.
2862
2863         No new tests. No behavior change.
2864
2865         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
2866         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
2867
2868 2018-11-29  Zalan Bujtas  <zalan@apple.com>
2869
2870         [ContentObservation] Make WKSetObservedContentChange logic more explicit.
2871         https://bugs.webkit.org/show_bug.cgi?id=192183
2872
2873         Reviewed by Simon Fraser.
2874
2875         * platform/ios/wak/WKContentObservation.cpp:
2876         (WKSetObservedContentChange):
2877         (WebThreadRemoveObservedDOMTimer):
2878
2879 2018-11-29  Youenn Fablet  <youenn@apple.com>
2880
2881         CSS subresource loads should not be observable from resource timing if the stylesheet is opaque
2882         https://bugs.webkit.org/show_bug.cgi?id=192132
2883
2884         Reviewed by Ryosuke Niwa.
2885
2886         Introduce a new ResourceLoaderOptions to determine whether a load is made from a resource that is opaque.
2887         Make use of that option to disable exposing such loads to the web page through resource timing.
2888         The same option might later be used to bypass service workers.
2889
2890         Make use of this option for CSS subresource loads.
2891         When the CSS stylesheet is opaque for the page, set this option.
2892
2893         Test: http/tests/security/clean-origin-exposed-resource-timing.html
2894               http/tests/security/cross-origin-resource-timing.html
2895
2896         * css/CSSCursorImageValue.cpp:
2897         (WebCore::CSSCursorImageValue::CSSCursorImageValue):
2898         (WebCore::CSSCursorImageValue::loadImage):
2899         * css/CSSCursorImageValue.h:
2900         * css/CSSFontFaceSrcValue.cpp:
2901         (WebCore::CSSFontFaceSrcValue::cachedFont):
2902         * css/CSSFontFaceSrcValue.h:
2903         * css/CSSImageSetValue.cpp:
2904         (WebCore::CSSImageSetValue::CSSImageSetValue):
2905         (WebCore::CSSImageSetValue::loadBestFitImage):
2906         * css/CSSImageSetValue.h:
2907         * css/CSSImageValue.cpp:
2908         (WebCore::CSSImageValue::CSSImageValue):
2909         (WebCore::CSSImageValue::loadImage):
2910         * css/CSSImageValue.h:
2911         * css/CSSStyleSheet.h:
2912         * css/StyleRuleImport.cpp:
2913         (WebCore::StyleRuleImport::setCSSStyleSheet):
2914         (WebCore::StyleRuleImport::requestStyleSheet):
2915         * css/StyleSheetContents.h:
2916         * css/parser/CSSParserContext.h:
2917         * css/parser/CSSPropertyParser.cpp:
2918         (WebCore::consumeCursor):
2919         (WebCore::consumeFontFaceSrcURI):
2920         * css/parser/CSSPropertyParserHelpers.cpp:
2921         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
2922         (WebCore::CSSPropertyParserHelpers::consumeImage):
2923         * html/HTMLBodyElement.cpp:
2924         (WebCore::HTMLBodyElement::collectStyleForPresentationAttribute):
2925         * html/HTMLLinkElement.cpp:
2926         (WebCore::HTMLLinkElement::initializeStyleSheet):
2927         (WebCore::HTMLLinkElement::setCSSStyleSheet):
2928         * html/HTMLTableElement.cpp:
2929         (WebCore::HTMLTableElement::collectStyleForPresentationAttribute):
2930         * html/HTMLTablePartElement.cpp:
2931         (WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute):
2932         * loader/ResourceLoaderOptions.h:
2933         * loader/ResourceTimingInformation.cpp:
2934         (WebCore::ResourceTimingInformation::shouldAddResourceTiming):
2935         * svg/SVGFontFaceUriElement.cpp:
2936         (WebCore::SVGFontFaceUriElement::srcValue const):
2937
2938 2018-11-29  Megan Gardner  <megan_gardner@apple.com>
2939
2940         Move Lookup Code for better cross platform usage
2941         https://bugs.webkit.org/show_bug.cgi?id=191732
2942
2943         Reviewed by Alex Christensen.
2944
2945         Not currenlty testable
2946
2947         DictionaryLookup uses Reveal now, which is slated to be cross-platform.
2948         That patch gates the parts of DictionaryLookup that currently do not have
2949         an available implementation on iOS. Once Reveal is ready, this code will be
2950         replaced or expanded upon, as appropriate.
2951
2952         * editing/mac/DictionaryLookup.h:
2953         * editing/mac/DictionaryLookup.mm:
2954         (WebCore::showPopupOrCreateAnimationController):
2955         (WebCore::DictionaryLookup::showPopup):
2956         (WebCore::DictionaryLookup::hidePopup):
2957         (WebCore::DictionaryLookup::animationControllerForPopup):
2958
2959 2018-11-29  Joseph Pecoraro  <pecoraro@apple.com>
2960
2961         [Cocoa] Move ServerTimingParser.* into a better group in the Xcode project
2962         https://bugs.webkit.org/show_bug.cgi?id=192180
2963
2964         Reviewed by Simon Fraser.
2965
2966         * WebCore.xcodeproj/project.pbxproj:
2967
2968 2018-11-29  Zalan Bujtas  <zalan@apple.com>
2969
2970         [ContentObservation] DOMTimer::install should explicitly check if timer observation is on
2971         https://bugs.webkit.org/show_bug.cgi?id=192181
2972
2973         Reviewed by Simon Fraser.
2974
2975         * page/DOMTimer.cpp:
2976         (WebCore::DOMTimer::install):
2977         * platform/ios/wak/WKContentObservation.cpp:
2978         (WKIsObservingDOMTimerScheduling):
2979         * platform/ios/wak/WKContentObservation.h:
2980
2981 2018-11-29  Ryosuke Niwa  <rniwa@webkit.org>
2982
2983         Executing "insertunorderedlist" while selecting a contenteditable element inside a shadow dom hangs the browser
2984         https://bugs.webkit.org/show_bug.cgi?id=184049
2985         <rdar://problem/38931033>
2986
2987         Reviewed by Antti Koivisto.
2988
2989         The primary hung was caused by TextIterator::advance traversing the next node in the tree order using
2990         NodeTraversal::next which doesn't take the composed tree into account. Fixed the bug by traversing
2991         the composed tree while sharing code with StylizedMarkupAccumulator.
2992
2993         This revealed a second hang in InsertListCommand::doApply() caused by endingSelection() being null,
2994         which was caused by CompositeEditCommand::moveParagraphs failing to restore the ending selection properly
2995         because it was computing the text indices difference from the beginning of the document until the destination.
2996
2997         Fixed this second bug by computing the indices against the beginning of the root editable element.
2998         Note that editability never crosses a shadow boundary.
2999
3000         Test: editing/execCommand/insert-unordered-list-in-shadow-tree.html
3001
3002         * dom/ComposedTreeIterator.h:
3003         (WebCore::nextSkippingChildrenInComposedTreeIgnoringUserAgentShadow): Extracted out of nextSkippingChildren
3004         in markup.cpp.
3005         (WebCore::nextInComposedTreeIgnoringUserAgentShadow): Added.
3006         * editing/CompositeEditCommand.cpp:
3007         (WebCore::CompositeEditCommand::moveParagraphs): Compute the index from the beginning of the root editable
3008         element as opposed to the beginning of the document.
3009         * editing/TextIterator.cpp:
3010         (WebCore::nextNode): Added.
3011         (WebCore::isDescendantOf): Added.
3012         (WebCore::TextIterator::advance): Use the newly added functions to traverse the composed tree when the options
3013         contains TextIteratorTraversesFlatTree.
3014         * editing/markup.cpp:
3015
3016 2018-11-29  Zalan Bujtas  <zalan@apple.com>
3017
3018         [ContentObservation] Decouple content change and DOM timer scheduling observation
3019         https://bugs.webkit.org/show_bug.cgi?id=192170
3020
3021         Reviewed by Simon Fraser.
3022
3023         This is in preparation for adding style recalc scheduling observation (the main goal here is to simplify the indeterminate change logic).
3024
3025         * page/DOMTimer.cpp:
3026         (WebCore::DOMTimer::fired):
3027         * page/ios/EventHandlerIOS.mm:
3028         (WebCore::EventHandler::mouseMoved):
3029         * platform/ios/wak/WKContentObservation.cpp:
3030         (WKStartObservingContentChanges):
3031         (WKStopObservingContentChanges):
3032         (WKStartObservingDOMTimerSchedules):
3033         (WKStopObservingDOMTimerSchedules):
3034         (WKSetObservedContentChange):
3035         (WebThreadAddObservedDOMTimer):
3036         (WKBeginObservingContentChanges): Deleted.
3037         * platform/ios/wak/WKContentObservation.h:
3038
3039 2018-11-29  Frederic Wang  <fwang@igalia.com>
3040
3041         Make reconcileViewportConstrainedLayerPositions start from a specified scrolling node
3042         https://bugs.webkit.org/show_bug.cgi?id=180002
3043
3044         Reviewed by Simon Fraser.
3045
3046         For non-programmatic scrolling of frames, AsyncScrollingCoordinator::reconcileScrollingState
3047         currently always call reconcileViewportConstrainedLayerPositions for the main frame
3048         since async subframe scrolling is not supported yet (bug 171667 and bug 149264). This
3049         function in turn calls reconcileLayerPositionForViewportRect on the whole scrolling tree to
3050         readjust position of fixed/sticky descendants. This patch refactors a bit the code so that
3051         the operation is actually only applied to the descendants of the frame's scrolling node,
3052         which would mean a small optimization when subframe are asynchronously scrollable. The code
3053         is already covered by reconcile-layer-position-recursive.html.
3054
3055         No new tests, behavior unchanged and already covered by existing tests.
3056
3057         * page/scrolling/AsyncScrollingCoordinator.cpp:
3058         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState): Pass the frame's scrolling
3059         node id.
3060         (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Start
3061         reconciliation from the specified scrolling node and log its ID.
3062         * page/scrolling/AsyncScrollingCoordinator.h: Add ScrollingNodeID parameter.
3063         * page/scrolling/ScrollingCoordinator.h:
3064         (WebCore::ScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Ditto.
3065
3066 2018-11-29  Zalan Bujtas  <zalan@apple.com>
3067
3068         Rename *ObservedContentModifier(s) to *ObservedDOMTimer(s)
3069         https://bugs.webkit.org/show_bug.cgi?id=192168
3070
3071         Reviewed by Simon Fraser.
3072
3073         * dom/Document.cpp:
3074         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
3075         * page/DOMTimer.cpp:
3076         (WebCore::DOMTimer::install):
3077         (WebCore::DOMTimer::fired):
3078         * page/DOMWindow.cpp:
3079         (WebCore::DOMWindow::clearTimeout):
3080         * page/Frame.cpp:
3081         (WebCore::Frame::willDetachPage):
3082         * platform/ios/wak/WKContentObservation.cpp:
3083         (WKBeginObservingContentChanges):
3084         (WKSetObservedContentChange):
3085         (WebThreadGetObservedDOMTimers):
3086         (WebThreadCountOfObservedDOMTimers):
3087         (WebThreadClearObservedDOMTimers):
3088         (WebThreadContainsObservedDOMTimer):
3089         (WebThreadAddObservedDOMTimer):
3090         (WebThreadRemoveObservedDOMTimer):
3091         (WebThreadCountOfObservedContentModifiers): Deleted.
3092         (WebThreadClearObservedContentModifiers): Deleted.
3093         (WebThreadContainsObservedContentModifier): Deleted.
3094         (WebThreadAddObservedContentModifier): Deleted.
3095         (WebThreadRemoveObservedContentModifier): Deleted.
3096         * platform/ios/wak/WKContentObservation.h:
3097         * platform/ios/wak/WKContentObservationInternal.h:
3098
3099 2018-11-29  Justin Fan  <justin_fan@apple.com>
3100
3101         [WebGPU] WebGPURenderPassEncoder::setPipeline, draw, and endPass prototypes
3102         https://bugs.webkit.org/show_bug.cgi?id=192134
3103
3104         Reviewed by Dean Jackson.
3105
3106         Wrap up prototype features for WebGPURenderPassEncoder. 
3107
3108         Test: webgpu/render-command-encoding.html
3109
3110         * Modules/webgpu/WebGPUCommandBuffer.cpp: 
3111         (WebCore::WebGPUCommandBuffer::beginRenderPass):
3112         * Modules/webgpu/WebGPUDevice.cpp:
3113         (WebCore::WebGPUDevice::createRenderPipeline const):
3114         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
3115         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
3116         (WebCore::WebGPUProgrammablePassEncoder::endPass): Returns a reference to the WebGPUCommandBuffer that created this encoder.
3117         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
3118         * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Updated to support endPass and setPipeline.
3119         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
3120         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
3121         (WebCore::WebGPURenderPassEncoder::create): Must be provided with the WebGPUCommandBuffer.
3122         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
3123         (WebCore::WebGPURenderPassEncoder::draw):
3124         * Modules/webgpu/WebGPURenderPassEncoder.h: Updated to cache a reference to the WebGPUCommandBuffer, and for draw.
3125         * Modules/webgpu/WebGPURenderPassEncoder.idl:
3126         * Modules/webgpu/WebGPURenderPipeline.cpp:
3127         (WebCore::WebGPURenderPipeline::create):
3128         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
3129         * Modules/webgpu/WebGPURenderPipeline.h:
3130         (WebCore::WebGPURenderPipeline::renderPipeline):
3131         * Modules/webgpu/WebGPUTexture.cpp:
3132         * Modules/webgpu/WebGPUTexture.h: Replaced include with forward declaration.
3133         * platform/graphics/gpu/GPUProgrammablePassEncoder.h: Updated to support new WebGPU_PassEncoder functionality.
3134         * platform/graphics/gpu/GPURenderPassEncoder.h:
3135         (WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): Now ends encoding on the MTLCommandEncoder, if not already ended, before freeing it.
3136         * platform/graphics/gpu/GPURenderPipeline.h: Now remembers the GPUPrimitiveTopology that it was created with.
3137         (WebCore::GPURenderPipeline::primitiveTopology const): 
3138         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
3139         (WebCore::GPUProgrammablePassEncoder::endPass): Calls endEncoding on the backing MTLCommandEncoder, if not already ended.
3140         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3141         (WebCore::GPURenderPassEncoder::platformPassEncoder const):
3142         (WebCore::GPURenderPassEncoder::setPipeline): Added.
3143         (WebCore::primitiveTypeForGPUPrimitiveTopology): Added. Helper function to convert GPUPrimitiveTopology to MTLPrimitiveType.
3144         (WebCore::GPURenderPassEncoder::draw): Added. Draws using primitive topology specified during pipeline creation. 
3145         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3146         (WebCore::setFunctionsForPipelineDescriptor):
3147         (WebCore::GPURenderPipeline::create):
3148         (WebCore::GPURenderPipeline::GPURenderPipeline): Now must store the GPURenderPipelineDescriptor for later reference. 
3149
3150 2018-11-29  Justin Michaud  <justin_michaud@apple.com>
3151
3152         CSS Painting API should pass 'this' correctly to paint callback, and repaint when properties change.
3153         https://bugs.webkit.org/show_bug.cgi?id=191443
3154
3155         Reviewed by Dean Jackson.
3156
3157         Instantiate a new instance of the paint class, and pass it as 'this' object when the paint callback is called. 
3158         Also, this patch makes sure that custom paint elements get repainted when properties that they care about get changed.
3159         Finally, we fix two reference cycles that caused WorkletGlobalScope to never be destroyed.
3160
3161         Tests: fast/css-custom-paint/animate-repaint.html
3162                fast/css-custom-paint/animate.html
3163
3164         * bindings/js/JSDOMWrapper.cpp:
3165         * bindings/js/JSPaintWorkletGlobalScopeCustom.cpp:
3166         (WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren):
3167         * bindings/js/JSWorkletGlobalScopeBase.cpp:
3168         (WebCore::toJS):
3169         * bindings/js/ScriptState.cpp:
3170         (WebCore::execStateFromWorkletGlobalScope):
3171         * css/CSSPaintCallback.h:
3172         * css/CSSPaintCallback.idl:
3173         * css/CSSPaintImageValue.h:
3174         * css/StyleResolver.cpp:
3175         (WebCore::StyleResolver::applyProperty):
3176         * dom/Document.cpp:
3177         (WebCore::Document::prepareForDestruction):
3178         * dom/ScriptExecutionContext.cpp:
3179         (WebCore::ScriptExecutionContext::vm):
3180         * platform/graphics/CustomPaintImage.cpp:
3181         (WebCore::CustomPaintImage::CustomPaintImage):
3182         (WebCore::CustomPaintImage::doCustomPaint):
3183         * platform/graphics/CustomPaintImage.h:
3184         * rendering/style/RenderStyle.cpp:
3185         (WebCore::RenderStyle::addCustomPaintWatchProperty):
3186         (WebCore::RenderStyle::changeRequiresRepaint const):
3187         * rendering/style/RenderStyle.h:
3188         * rendering/style/StyleRareNonInheritedData.cpp:
3189         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3190         (WebCore::StyleRareNonInheritedData::operator== const):
3191         * rendering/style/StyleRareNonInheritedData.h:
3192         * testing/Internals.cpp:
3193         (WebCore::Internals::isAnyWorkletGlobalScopeAlive const):
3194         * testing/Internals.h:
3195         * testing/Internals.idl:
3196         * worklets/PaintWorkletGlobalScope.cpp:
3197         (WebCore::PaintWorkletGlobalScope::devicePixelRatio const):
3198         (WebCore::PaintWorkletGlobalScope::PaintDefinition::PaintDefinition):
3199         (WebCore::PaintWorkletGlobalScope::registerPaint):
3200         * worklets/PaintWorkletGlobalScope.h:
3201         (WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope):
3202         * worklets/WorkletGlobalScope.cpp:
3203         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
3204         (WebCore::WorkletGlobalScope::~WorkletGlobalScope):
3205         (WebCore::WorkletGlobalScope::prepareForDestruction):
3206         (WebCore::WorkletGlobalScope::allWorkletGlobalScopesSet):
3207         (WebCore::WorkletGlobalScope::isJSExecutionForbidden const):
3208         (WebCore::WorkletGlobalScope::logExceptionToConsole):
3209         (WebCore::WorkletGlobalScope::addConsoleMessage):
3210         (WebCore::WorkletGlobalScope::addMessage):
3211         * worklets/WorkletGlobalScope.h:
3212         (WebCore::WorkletGlobalScope::script):
3213         (WebCore::WorkletGlobalScope::responsibleDocument):
3214         (WebCore::WorkletGlobalScope::responsibleDocument const):
3215         (WebCore::WorkletGlobalScope::identifier const): Deleted.
3216         (WebCore::WorkletGlobalScope::responsableDocument): Deleted.
3217         (WebCore::WorkletGlobalScope::responsableDocument const): Deleted.
3218         * worklets/WorkletScriptController.cpp:
3219         (WebCore::WorkletScriptController::~WorkletScriptController):
3220         (WebCore::WorkletScriptController::disableEval):
3221         (WebCore::WorkletScriptController::disableWebAssembly):
3222         (WebCore::WorkletScriptController::initScript):
3223
3224 2018-11-29  Alexey Proskuryakov  <ap@apple.com>
3225
3226         Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
3227         https://bugs.webkit.org/show_bug.cgi?id=192041
3228
3229         Reviewed by Tim Horton.
3230
3231         * loader/ResourceLoaderOptions.h: Added a FIXME for poor naming of loader options.
3232         There is a lot of code that needs to be cleaned up here.
3233
3234         * platform/network/mac/ResourceHandleMac.mm:
3235         (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
3236
3237 2018-11-29  Youenn Fablet  <youenn@apple.com>
3238
3239         Updating a service worker during a navigation load sometimes makes the load fail
3240         https://bugs.webkit.org/show_bug.cgi?id=191986
3241         <rdar://problem/46259790>
3242
3243         Reviewed by Chris Dumez.
3244
3245         Previously, we were registering a document as service worker client at creation of the document.
3246         According the service worker spec, this should be done when handling the fetch event of the corresponding navigation load.
3247         This ensures that the service worker will have a client and will not get updated in the middle of the navigation load.
3248
3249         At navigation load start, we do not have a document yet since it is created when receiving the first bytes.
3250         Instead, we register a temporary document when starting the navigation load and unregister it when the real document is registered.
3251
3252         Test: imported/w3c/web-platform-tests/service-workers/service-worker/update-on-navigation.https.html
3253
3254         * loader/DocumentLoader.cpp:
3255         (WebCore::DocumentLoader::commitData):
3256         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
3257         (WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient):
3258         (WebCore::DocumentLoader::loadMainResource):
3259         (WebCore::DocumentLoader::clearMainResource):
3260         * loader/DocumentLoader.h:
3261
3262 2018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
3263
3264         Unreviewed, rolling out r238678.
3265
3266         Breaks internal builds.
3267
3268         Reverted changeset:
3269
3270         "Move Lookup Code for better cross platform usage"
3271         https://bugs.webkit.org/show_bug.cgi?id=191732
3272         https://trac.webkit.org/changeset/238678
3273
3274 2018-11-29  Youenn Fablet  <youenn@apple.com>
3275
3276         A sender created through addTransceiver and populated using addTrack should have its source set
3277         https://bugs.webkit.org/show_bug.cgi?id=192136
3278
3279         Reviewed by Eric Carlson.
3280
3281         In case libwebrtc backend is already created, we need to make sure to
3282         set the track source to the libwebrtc sender backend that is actually
3283         tied to the sender.
3284
3285         Covered by updated test.
3286
3287         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3288         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
3289         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
3290
3291 2018-11-29  Megan Gardner  <megan_gardner@apple.com>
3292
3293         Move Lookup Code for better cross platform usage
3294         https://bugs.webkit.org/show_bug.cgi?id=191732
3295
3296         Reviewed by Alex Christensen.
3297
3298         Not currenlty testable
3299
3300         DictionaryLookup uses Reveal now, which is slated to be cross-platform.
3301         That patch gates the parts of DictionaryLookup that currently do not have
3302         an available implementation on iOS. Once Reveal is ready, this code will be
3303         replaced or expanded upon, as appropriate.
3304
3305         * editing/mac/DictionaryLookup.h:
3306         * editing/mac/DictionaryLookup.mm:
3307         (WebCore::showPopupOrCreateAnimationController):
3308         (WebCore::DictionaryLookup::showPopup):
3309         (WebCore::DictionaryLookup::hidePopup):
3310         (WebCore::DictionaryLookup::animationControllerForPopup):
3311
3312 2018-11-29  Sihui Liu  <sihui_liu@apple.com>
3313
3314         IndexedDB: breaks if binary data (Uint8Array) and autoIncrement key in store
3315         https://bugs.webkit.org/show_bug.cgi?id=185869
3316         <rdar://problem/40453623>
3317
3318         Reviewed by Geoffrey Garen.
3319
3320         lexicalGlobalObject is casted to JSDOMGlobalObject in CloneSerializer::dumpArrayBufferView, 
3321         so we should use JSDOMGlobalObject instead of JSGlobalObject in IDB database thread.
3322
3323         Covered by modified test: storage/indexeddb/objectstore-autoincrement.html
3324
3325         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3326         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
3327         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
3328         * bindings/js/JSDOMGlobalObject.cpp:
3329         (WebCore::JSDOMGlobalObject::create):
3330         * bindings/js/JSDOMGlobalObject.h:
3331         * bindings/js/JSDOMWrapper.cpp:
3332         (WebCore::JSDOMObject::JSDOMObject):
3333
3334 2018-11-29  Sihui Liu  <sihui_liu@apple.com>
3335
3336         Unexpected constructor / instanceof  behavior when retrieving indexedDB data in an iframe
3337         https://bugs.webkit.org/show_bug.cgi?id=185906
3338         <rdar://problem/40583100>
3339
3340         Reviewed by Geoffrey Garen.
3341
3342         ScriptExecutionContext::execState() returned state of main frame, so deserialization of 
3343         IDBValue in iframe used constructors of main frame, which is wrong.
3344
3345         Test: storage/indexeddb/instanceof-iframe.html
3346
3347         * dom/ScriptExecutionContext.cpp:
3348         (WebCore::ScriptExecutionContext::execState):
3349
3350 2018-11-29  Don Olmstead  <don.olmstead@sony.com>
3351
3352         Make generic ScrollAnimator
3353         https://bugs.webkit.org/show_bug.cgi?id=192128
3354
3355         Reviewed by Michael Catanzaro.
3356
3357         No new tests. No change in behavior.
3358
3359         Moves ScrollAnimatorGtk into ScrollAnimatorGeneric where it can be used
3360         by other implementations. Fixed some compilation issues around using
3361         this as a default implementation.
3362
3363         Removing ScrollAnimatorSmooth since it is dead code and doesn't even
3364         compile at this time.
3365
3366         Fixing a compilation issue within LowPowerModeNotifierGLib
3367         implementation that appeared due to unified sources changes.
3368
3369         * PlatformGTK.cmake:
3370         * SourcesGTK.txt:
3371         * platform/LowPowerModeNotifier.h:
3372         * platform/PlatformWheelEvent.h:
3373         (WebCore::PlatformWheelEvent::swipeVelocity const):
3374         * platform/ScrollAnimatorSmooth.cpp: Removed.
3375         * platform/ScrollAnimatorSmooth.h: Removed.
3376         * platform/generic/ScrollAnimatorGeneric.cpp: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp.
3377         (WebCore::ScrollAnimator::create):
3378         (WebCore::ScrollAnimatorGeneric::ScrollAnimatorGeneric):
3379         (WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation):
3380         (WebCore::ScrollAnimatorGeneric::scroll):
3381         (WebCore::ScrollAnimatorGeneric::scrollToOffsetWithoutAnimation):
3382         (WebCore::ScrollAnimatorGeneric::computeVelocity):
3383         (WebCore::ScrollAnimatorGeneric::handleWheelEvent):
3384         (WebCore::ScrollAnimatorGeneric::willEndLiveResize):
3385         (WebCore::ScrollAnimatorGeneric::updatePosition):
3386         (WebCore::ScrollAnimatorGeneric::didAddVerticalScrollbar):
3387         (WebCore::ScrollAnimatorGeneric::didAddHorizontalScrollbar):
3388         (WebCore::ScrollAnimatorGeneric::willRemoveVerticalScrollbar):
3389         (WebCore::ScrollAnimatorGeneric::willRemoveHorizontalScrollbar):
3390         (WebCore::ScrollAnimatorGeneric::updateOverlayScrollbarsOpacity):
3391         (WebCore::ScrollAnimatorGeneric::overlayScrollbarAnimationTimerFired):
3392         (WebCore::ScrollAnimatorGeneric::showOverlayScrollbars):
3393         (WebCore::ScrollAnimatorGeneric::hideOverlayScrollbars):
3394         (WebCore::ScrollAnimatorGeneric::mouseEnteredContentArea):
3395         (WebCore::ScrollAnimatorGeneric::mouseExitedContentArea):
3396         (WebCore::ScrollAnimatorGeneric::mouseMovedInContentArea):
3397         (WebCore::ScrollAnimatorGeneric::contentAreaDidShow):
3398         (WebCore::ScrollAnimatorGeneric::contentAreaDidHide):
3399         (WebCore::ScrollAnimatorGeneric::notifyContentAreaScrolled):
3400         (WebCore::ScrollAnimatorGeneric::lockOverlayScrollbarStateToHidden):
3401         * platform/generic/ScrollAnimatorGeneric.h: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.h.
3402         * platform/glib/LowPowerModeNotifierGLib.cpp:
3403         * platform/gtk/PlatformWheelEventGtk.cpp:
3404         (WebCore::PlatformWheelEvent::swipeVelocity const): Deleted.
3405
3406 2018-11-28  Dean Jackson  <dino@apple.com>
3407
3408         [ES Modules] Allow .mjs content when loaded from file://
3409         https://bugs.webkit.org/show_bug.cgi?id=192100
3410         <rdar://problem/46320065>
3411
3412         Reviewed by Sam Weinig.
3413
3414         Node JS requires ES Module files to be identified by the file
3415         extension of ".mjs" (no relation to Maciej Stachowiak). This new
3416         extension causes issues because it isn't recognised as a JavaScript
3417         file. When using the script tag, the author is able to force the type
3418         of the referenced file using an attribute, but this isn't possible
3419         for the import() function or import statement.
3420