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