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