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