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