Add and remove cookie partition accordingly in intermediary redirect requests
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-17  John Wilander  <wilander@apple.com>
2
3         Add and remove cookie partition accordingly in intermediary redirect requests
4         https://bugs.webkit.org/show_bug.cgi?id=178369
5         <rdar://problem/34467603>
6
7         Reviewed by Brent Fulgham.
8
9         Tests: http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html
10                http/tests/resourceLoadStatistics/remove-partitioning-from-redirect.html
11
12         * loader/ResourceLoadObserver.h:
13             Now exposes notifyObserver() so that it can be triggered
14             by the TestRunner.
15             Removed unimplemented ResourceLoadObserver::setShouldThrottleObserverNotifications().
16
17 2017-10-17  Jer Noble  <jer.noble@apple.com>
18
19         Corrupted image after looping movie-backed <img>.
20         https://bugs.webkit.org/show_bug.cgi?id=178398
21
22         Reviewed by Eric Carlson.
23
24         Use the decode-order sample cursor rather than the destination sample cursor when generating
25         the CMSampleBuffer to decode.
26
27         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
28         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
29
30 2017-10-17  Ryan Haddad  <ryanhaddad@apple.com>
31
32         Unreviewed, rolling out r223459.
33
34         This change introduced LayoutTest failures.
35
36         Reverted changeset:
37
38         "WebGL clamps drawingBufferWidth to 4096 pixels on a 5120
39         monitor/canvas"
40         https://bugs.webkit.org/show_bug.cgi?id=178223
41         https://trac.webkit.org/changeset/223459
42
43 2017-10-17  Youenn Fablet  <youenn@apple.com>
44
45         Add preliminary support for fetch event
46         https://bugs.webkit.org/show_bug.cgi?id=178171
47
48         Reviewed by Chris Dumez.
49
50         Test: http/wpt/service-workers/fetchEvent.https.html
51               http/wpt/service-workers/extendableEvent.https.html
52
53         Adding support for ExtendableEvent and FetchEvent as per 
54         https://w3c.github.io/ServiceWorker/v1/#extendableevent-interface and
55         https://w3c.github.io/ServiceWorker/v1/#fetchevent-interface.
56
57         Both events need to handle promises as method parameters.
58         Beefing up DOMPromise for that purpose by exposing status, result and being able to call then.
59         Adding a new DOMPromise create method that would be the base for https://heycam.github.io/webidl/#es-promise
60         which might be implemented in the binding generator as a follow-up.
61
62         This patch makes them exposed on Window for test purposes until they can be fully tested on ServiceWorker environment.
63         It is also adding two internal methods for the same reason. These should be removed once events can be tested in its environment.
64
65         * CMakeLists.txt:
66         * DerivedSources.make:
67         * Modules/fetch/FetchResponse.idl:
68         * WebCore.xcodeproj/project.pbxproj:
69         * bindings/js/JSDOMPromise.cpp: Added.
70         (WebCore::callFunction):
71         (WebCore::DOMPromise::create):
72         (WebCore::DOMPromise::whenSettled):
73         (WebCore::DOMPromise::result const):
74         (WebCore::DOMPromise::status const):
75         * bindings/js/JSDOMPromise.h:
76         * bindings/js/WebCoreBuiltinNames.h:
77         * dom/EventNames.in:
78         * testing/Internals.cpp:
79         (WebCore::Internals::waitFetchEventToFinish):
80         (WebCore::Internals::waitExtendableEventToFinish):
81         * testing/Internals.h:
82         * testing/Internals.idl:
83         * workers/service/ExtendableEvent.cpp: Added.
84         (WebCore::ExtendableEvent::ExtendableEvent):
85         (WebCore::ExtendableEvent::waitUntil):
86         (WebCore::ExtendableEvent::addPendingPromise):
87         * workers/service/ExtendableEvent.h:
88         (WebCore::ExtendableEvent::onFinishedWaiting):
89         (WebCore::ExtendableEvent::promiseSettled):
90         * workers/service/ExtendableEvent.idl: Added.
91         * workers/service/ExtendableEventInit.h: Added.
92         * workers/service/ExtendableEventInit.idl: Added.
93         * workers/service/FetchEvent.cpp: Added.
94         (WebCore::FetchEvent::FetchEvent):
95         (WebCore::FetchEvent::respondWith):
96         (WebCore::FetchEvent::onResponse):
97         (WebCore::FetchEvent::respondWithError):
98         (WebCore::FetchEvent::processResponse):
99         (WebCore::FetchEvent::promiseSettled):
100         * workers/service/FetchEvent.h:
101         * workers/service/FetchEvent.idl:
102
103 2017-10-17  Jer Noble  <jer.noble@apple.com>
104
105         Leak of one AVSampleCursor inside ImageDecoderAVFObjC::createFrameImageAtIndex()
106         https://bugs.webkit.org/show_bug.cgi?id=178397
107
108         Reviewed by Eric Carlson.
109
110         Explicitly wrap the return value of -copy in a RetainPtr.
111
112         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
113         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
114
115 2017-10-17  Youenn Fablet  <youenn@apple.com>
116
117         Cache API implementation should be able to compute storage size for WebKit client applications.
118         https://bugs.webkit.org/show_bug.cgi?id=178350
119
120         Reviewed by Chris Dumez.
121
122         * page/SecurityOriginData.h:
123         (WebCore::SecurityOriginData::equals const):
124
125 2017-10-17  Daniel Bates  <dabates@apple.com>
126
127         ASSERTION FAILED: m_truncation != cFullTruncation in InlineTextBox::clampedOffset()
128         https://bugs.webkit.org/show_bug.cgi?id=178322
129
130         Reviewed by Darin Adler.
131
132         It is acceptable for InlineTextBox::clampedOffset() to be called for a fully truncated box,
133         say a person clicks on the ellipsis in a truncated text run. Restore the behavior prior to
134         r223259 and return the clamped offset.
135
136         Test: fast/text/click-ellipsis-assertion-failure.html
137
138         * rendering/InlineTextBox.cpp:
139         (WebCore::InlineTextBox::clampedOffset const):
140
141 2017-10-17  Daniel Bates  <dabates@apple.com>
142
143         REGRESSION (r222670 and r222732): RTL truncated text may not be drawn
144         https://bugs.webkit.org/show_bug.cgi?id=178278
145         <rdar://problem/34982818>
146
147         Reviewed by Darin Adler.
148
149         Revert r222732 and partially revert r222670. The underlying font rendering machinery implements
150         text truncation by taking a TextRun object that represents all of the text in the line fragment
151         and a subrange of the glyphs to render from this fragment. Only the glyphs in this subrange are
152         drawn and they are drawn in the same position they would be in had the entire line fragment been
153         drawn. Following r222670 InlineTextBox applies the truncation to the TextRun in InlineTextBox::text().
154         Together with r222732, which assumed that the number of glyphs to draw is equal to the length of
155         the TextRun, a truncated text run would be drawn at the wrong position on screen and could give
156         the impression that the text is not drawn. Instead InlineTextBox::text() should always return
157         the text for the entire line fragment without considering truncation and when calling TextPainter::paint()
158         we need to pass the truncated length of the line fragment.
159
160         Test: fast/text/ellipsis-text-rtl.html
161
162         * rendering/InlineTextBox.cpp:
163         (WebCore::InlineTextBox::paint): Compute the truncated length (number of glyphs) and pass this
164         to TextPainter::paint()
165         (WebCore::InlineTextBox::text const): Do not apply truncation to the text run. Truncation is
166         implemented by telling the underlying font rendering machinery to paint the subrange of the
167         text run that represents the non-truncated (visible) text.
168         * rendering/InlineTextBox.h:
169         * rendering/SimpleLineLayoutFunctions.cpp:
170         (WebCore::SimpleLineLayout::paintFlow): Pass the entire length of the text run as we did prior
171         to r222732.
172         * rendering/TextPainter.cpp:
173         (WebCore::TextPainter::paint): Take a length that represents the number of glyphs to draw from
174         the text run as we use to take prior to r222732.
175         * rendering/TextPainter.h:
176
177 2017-10-17  Zalan Bujtas  <zalan@apple.com>
178
179         [FrameView::layout cleanup] Move text auto sizing logic to a separate function
180         https://bugs.webkit.org/show_bug.cgi?id=178391
181         <rdar://problem/35030264>
182
183         Reviewed by Antti Koivisto.
184
185         No change in functionality.
186
187         * page/FrameView.cpp:
188         (WebCore::applyTextSizingIfNeeded):
189         (WebCore::FrameView::layout):
190
191 2017-10-17  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
192
193         [Curl] Forward declaration "class Cookie;" in CookieJarCurl.h should be "struct Cookie;"
194         https://bugs.webkit.org/show_bug.cgi?id=178378
195
196         Reviewed by Per Arne Vollan.
197
198         No new tests. No change in behaviors.
199
200         * platform/network/curl/CookieJarCurl.h:
201
202 2017-10-17  Zalan Bujtas  <zalan@apple.com>
203
204         [FrameView::layout cleanup] Merge InPreLayout blocks
205         https://bugs.webkit.org/show_bug.cgi?id=178373
206
207         Reviewed by Antti Koivisto.
208
209         Remove redundant comment and scoping.
210
211         No change in functionality.
212
213         * page/FrameView.cpp:
214         (WebCore::FrameView::layout):
215
216 2017-10-17  Antti Koivisto  <antti@apple.com>
217
218         Text nodes with display:contents parent should render as if they were wrapped in an unstyled <span>
219         https://bugs.webkit.org/show_bug.cgi?id=178332
220
221         Reviewed by Ryosuke Niwa.
222
223         According to https://github.com/w3c/csswg-drafts/issues/1118
224
225             <div style="display:contents;color:green">text</div>
226
227         must result in green text even though div doesn't generate a box.
228
229         This patch implements the behavior by wrapping text renderers with display:contents parent element
230         in an anonymous inline box that receives its style by inheriting from the parent element.
231
232         * dom/Document.cpp:
233         (WebCore::Document::updateTextRenderer):
234         * rendering/RenderElement.cpp:
235         (WebCore::RenderElement::computeFirstLineStyle const):
236
237             Synthesize the first line style in display:contents parent case.
238
239         * rendering/RenderObject.cpp:
240         (WebCore::findDestroyRootIncludingAnonymous):
241
242             Factor into a function.
243
244         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
245
246             Get rid of the anonymous wrapper if it exists.
247
248         * rendering/RenderText.cpp:
249         (WebCore::inlineWrapperForDisplayContentsMap):
250         (WebCore::RenderText::RenderText):
251         (WebCore::RenderText::willBeDestroyed):
252         (WebCore::RenderText::inlineWrapperForDisplayContents):
253         (WebCore::RenderText::setInlineWrapperForDisplayContents):
254
255             Add a weak member (implemented as a rare data map) for holding the wrapper pointer.
256
257         (WebCore::RenderText::findByDisplayContentsInlineWrapperCandidate):
258
259             Helper to get the text renderer for a wrapper.
260
261         * rendering/RenderText.h:
262         * style/RenderTreeUpdater.cpp:
263         (WebCore::createTextRenderer):
264         (WebCore::RenderTreeUpdater::updateTextRenderer):
265
266             Create the wrapper if needed.
267
268         * style/StyleTreeResolver.cpp:
269         (WebCore::Style::TreeResolver::resolveComposedTree):
270
271             Compute the wrapper style by inheriting from the display:contents parent.
272
273         * style/StyleUpdate.h:
274         (WebCore::Style::TextUpdate::TextUpdate):
275
276 2017-10-17  Alicia Boya García  <aboya@igalia.com>
277
278         [MSE][GStreamer] Insert parser elements in AppendPipeline when demuxing opus or Vorbis
279         https://bugs.webkit.org/show_bug.cgi?id=178076
280
281         Reviewed by Xabier Rodriguez-Calvar.
282
283         YouTube does not include durations in the WebM container for files
284         containing Opus audio, so we need to read them from the contained
285         stream. Fortunately, GStreamer has an element to do that: opusparse.
286
287         The same thing happens with Vorbis contained in WebM files from the
288         W3C tests, which should also be fixed by the GStreamer element
289         vorbisparse.
290
291         This patch adds an opusparse or vorbisparse element to the
292         AppendPipeline at the sinkpad of the demuxer when either is found.
293
294         Tests: updated expectations.
295
296         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
297         (WebCore::AppendPipeline::appsinkNewSample):
298         (WebCore::createOptionalParserForFormat):
299         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
300         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
301         * platform/graphics/gstreamer/mse/AppendPipeline.h:
302         * platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp:
303         (WebCore::GStreamerMediaSample::GStreamerMediaSample):
304         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
305         (WebCore::PlaybackPipeline::attachTrack):
306
307 2017-10-17  Ms2ger  <Ms2ger@igalia.com>
308
309         Add WebGL2 texImage3D overloads.
310         https://bugs.webkit.org/show_bug.cgi?id=178119
311
312         Reviewed by Ryosuke Niwa.
313
314         No new tests: not much point in adding tests now; this method doesn't
315         do anything anyway.
316
317         * html/canvas/WebGL2RenderingContext.cpp:
318         (WebCore::WebGL2RenderingContext::texImage3D):
319         * html/canvas/WebGL2RenderingContext.h:
320         * html/canvas/WebGL2RenderingContext.idl:
321
322 2017-10-17  Antti Koivisto  <antti@apple.com>
323
324         Resolve ::before and ::after pseudo elements during style resolution
325         https://bugs.webkit.org/show_bug.cgi?id=178339
326
327         Reviewed by Ryosuke Niwa.
328
329         They are currently resolved during render tree building which creates problems with display:contents and animations.
330
331         * dom/PseudoElement.cpp:
332         (WebCore::PseudoElement::PseudoElement):
333
334             Call InspectorInstrumentation from constructor.
335
336         * style/RenderTreeUpdater.cpp:
337         (WebCore::RenderTreeUpdater::Parent::Parent):
338         (WebCore::RenderTreeUpdater::updateRenderTree):
339         (WebCore::RenderTreeUpdater::pushParent):
340
341             Push the full update to the parent stack.
342
343         (WebCore::RenderTreeUpdater::popParent):
344         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
345         (WebCore::RenderTreeUpdater::updateAfterDescendants):
346         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
347         * style/RenderTreeUpdater.h:
348         * style/RenderTreeUpdaterGeneratedContent.cpp:
349         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
350
351             No need to resolve pseudo style, we have it already.
352
353         (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
354         (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement): Deleted.
355         (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement): Deleted.
356         * style/RenderTreeUpdaterGeneratedContent.h:
357         * style/StyleTreeResolver.cpp:
358         (WebCore::Style::TreeResolver::resolveElement):
359         (WebCore::Style::TreeResolver::resolvePseudoStyle):
360
361             Resolve pseudos.
362
363         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
364
365             Make a private member function.
366
367         (WebCore::Style::TreeResolver::resolveComposedTree):
368         * style/StyleTreeResolver.h:
369         * style/StyleUpdate.cpp:
370         (WebCore::Style::Update::elementUpdates const):
371         (WebCore::Style::Update::elementUpdates):
372
373             Bundle the style update for an element and the associated before/after pseudos.
374
375         (WebCore::Style::Update::elementStyle const):
376         (WebCore::Style::Update::elementStyle):
377         (WebCore::Style::Update::addElement):
378         (WebCore::Style::Update::elementUpdate const): Deleted.
379         (WebCore::Style::Update::elementUpdate): Deleted.
380         * style/StyleUpdate.h:
381
382 2017-10-17  Keith Miller  <keith_miller@apple.com>
383
384         Change WebCore sources to work with unified source builds
385         https://bugs.webkit.org/show_bug.cgi?id=178229
386
387         Rubber stamped by Tim Horton.
388
389         This patch does the following:
390
391         1) Move all “using namespace <name>;” into the WebCore namespace
392         (They used to go in the global namespace) and change to "using
393         WebCore::<name>;” in .mm files.
394
395         2) Move a bunch of the soft linking library/framework macros out
396         of the .mm files since those caused name collision problems.
397
398         3) Fix minor other naming collisions.
399
400         The problem with 1 in a unified source world is generic names
401         often collide with system header names. For example, WebCore has a
402         Rect class and that collided with a system header type elsewhere.
403
404         This patch shouldn't change behavior so no new tests.
405
406         * Configurations/FeatureDefines.xcconfig:
407         * Modules/cache/CacheStorageConnection.cpp:
408         * Modules/cache/DOMCache.cpp:
409         * Modules/cache/DOMCacheStorage.cpp:
410         * Modules/cache/WorkerCacheStorageConnection.cpp:
411         * Modules/encryptedmedia/InitDataRegistry.cpp:
412         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
413         * Modules/indexeddb/IDBCursor.cpp:
414         * Modules/indexeddb/IDBFactory.cpp:
415         * Modules/indexeddb/IDBIndex.cpp:
416         * Modules/indexeddb/IDBKeyRange.cpp:
417         * Modules/indexeddb/IDBObjectStore.cpp:
418         * Modules/indexeddb/IDBRequest.cpp:
419         * Modules/indexeddb/IDBTransaction.cpp:
420         * Modules/indexeddb/server/MemoryObjectStore.cpp:
421         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
422         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
423         * Modules/mediasource/MediaSource.cpp:
424         (WebCore::MediaSource::setReadyState):
425         (WebCore::toString): Deleted.
426         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
427         * Modules/plugins/QuickTimePluginReplacement.mm:
428         (WebCore::jsValueWithAVMetadataItemInContext):
429         * Modules/webdriver/NavigatorWebDriver.cpp:
430         * PlatformAppleWin.cmake:
431         * PlatformMac.cmake:
432         * WebCore.xcodeproj/project.pbxproj:
433         * accessibility/ios/AccessibilityObjectIOS.mm:
434         (-[WAKView accessibilityIsIgnored]): Deleted.
435         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
436         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
437         (-[WAKView accessibilityIsIgnored]):
438         * accessibility/win/AXObjectCacheWin.cpp:
439         * bindings/js/CommonVM.cpp:
440         * bindings/js/DOMWrapperWorld.cpp:
441         * bindings/js/GCController.cpp:
442         * bindings/js/IDBBindingUtilities.cpp:
443         * bindings/js/JSAudioTrackCustom.cpp:
444         * bindings/js/JSAudioTrackListCustom.cpp:
445         * bindings/js/JSBlobCustom.cpp:
446         * bindings/js/JSCSSRuleCustom.cpp:
447         * bindings/js/JSCSSRuleListCustom.cpp:
448         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
449         * bindings/js/JSCallbackData.cpp:
450         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
451         * bindings/js/JSCustomElementInterface.cpp:
452         * bindings/js/JSCustomElementRegistryCustom.cpp:
453         * bindings/js/JSCustomEventCustom.cpp:
454         * bindings/js/JSDOMBindingSecurity.cpp:
455         * bindings/js/JSDOMBuiltinConstructorBase.cpp:
456         * bindings/js/JSDOMConstructorBase.cpp:
457         * bindings/js/JSDOMConstructorWithDocument.cpp:
458         * bindings/js/JSDOMConvertDate.cpp:
459         * bindings/js/JSDOMConvertNumbers.cpp:
460         * bindings/js/JSDOMConvertStrings.cpp:
461         * bindings/js/JSDOMConvertWebGL.cpp:
462         * bindings/js/JSDOMExceptionHandling.cpp:
463         * bindings/js/JSDOMGlobalObject.cpp:
464         * bindings/js/JSDOMGlobalObjectTask.cpp:
465         * bindings/js/JSDOMGuardedObject.cpp:
466         * bindings/js/JSDOMPromiseDeferred.cpp:
467         * bindings/js/JSDOMQuadCustom.cpp:
468         * bindings/js/JSDOMWindowBase.cpp:
469         * bindings/js/JSDOMWindowCustom.cpp:
470         * bindings/js/JSDOMWindowProxy.cpp:
471         * bindings/js/JSDOMWrapper.cpp:
472         * bindings/js/JSDOMWrapperCache.cpp:
473         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
474         * bindings/js/JSDocumentCustom.cpp:
475         * bindings/js/JSDocumentFragmentCustom.cpp:
476         * bindings/js/JSElementCustom.cpp:
477         * bindings/js/JSErrorHandler.cpp:
478         * bindings/js/JSEventCustom.cpp:
479         * bindings/js/JSEventListener.cpp:
480         * bindings/js/JSEventTargetCustom.cpp:
481         * bindings/js/JSFileSystemEntryCustom.cpp:
482         * bindings/js/JSHTMLCollectionCustom.cpp:
483         * bindings/js/JSHTMLDocumentCustom.cpp:
484         * bindings/js/JSHTMLTemplateElementCustom.cpp:
485         * bindings/js/JSHistoryCustom.cpp:
486         * bindings/js/JSIDBCursorCustom.cpp:
487         * bindings/js/JSIDBCursorWithValueCustom.cpp:
488         * bindings/js/JSIDBIndexCustom.cpp:
489         * bindings/js/JSIDBObjectStoreCustom.cpp:
490         * bindings/js/JSIDBTransactionCustom.cpp:
491         * bindings/js/JSImageDataCustom.cpp:
492         * bindings/js/JSLazyEventListener.cpp:
493         * bindings/js/JSLocationCustom.cpp:
494         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
495         * bindings/js/JSMessageEventCustom.cpp:
496         * bindings/js/JSMessagePortCustom.cpp:
497         * bindings/js/JSMutationObserverCustom.cpp:
498         * bindings/js/JSNodeCustom.cpp:
499         * bindings/js/JSNodeListCustom.cpp:
500         * bindings/js/JSPerformanceEntryCustom.cpp:
501         * bindings/js/JSPluginElementFunctions.cpp:
502         * bindings/js/JSPopStateEventCustom.cpp:
503         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
504         * bindings/js/JSReadableStreamSourceCustom.cpp:
505         * bindings/js/JSSVGPathSegCustom.cpp:
506         * bindings/js/JSTextTrackCueCustom.cpp:
507         * bindings/js/JSTextTrackCustom.cpp:
508         * bindings/js/JSTextTrackListCustom.cpp:
509         * bindings/js/JSTrackCustom.cpp:
510         * bindings/js/JSVideoTrackCustom.cpp:
511         * bindings/js/JSVideoTrackListCustom.cpp:
512         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
513         * bindings/js/JSWebGLRenderingContextCustom.cpp:
514         * bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp:
515         * bindings/js/JSWebGPURenderingContextCustom.cpp:
516         * bindings/js/JSWorkerGlobalScopeBase.cpp:
517         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
518         * bindings/js/JSXMLHttpRequestCustom.cpp:
519         * bindings/js/JSXPathNSResolverCustom.cpp:
520         * bindings/js/ReadableStream.cpp:
521         (WebCore::ReadableStream::pipeTo):
522         (WebCore::ReadableStream::tee):
523         (WebCore::checkReadableStream):
524         (WebCore::callFunction): Deleted.
525         * bindings/js/ScheduledAction.cpp:
526         * bindings/js/ScriptCachedFrameData.cpp:
527         * bindings/js/ScriptController.cpp:
528         * bindings/js/SerializedScriptValue.cpp:
529         * bindings/js/StructuredClone.cpp:
530         * bindings/js/WebCoreJSClientData.cpp:
531         * bindings/js/WorkerScriptController.cpp:
532         * bindings/scripts/CodeGeneratorJS.pm:
533         (GenerateEnumerationImplementation):
534         (GenerateImplementation):
535         (GenerateDictionaryImplementation):
536         (GenerateCallbackFunctionImplementation):
537         (GenerateCallbackInterfaceImplementation):
538         * bindings/scripts/test/JS/JSInterfaceName.cpp:
539         * bindings/scripts/test/JS/JSMapLike.cpp:
540         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
541         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
542         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
543         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
544         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
545         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
546         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
547         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
548         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
549         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
550         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
551         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
552         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
553         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
554         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
555         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
556         * bindings/scripts/test/JS/JSTestException.cpp:
557         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
558         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
559         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
560         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
561         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
562         * bindings/scripts/test/JS/JSTestInterface.cpp:
563         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
564         * bindings/scripts/test/JS/JSTestIterable.cpp:
565         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
566         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
567         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
568         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
569         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
570         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
571         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
572         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
573         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
574         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
575         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
576         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
577         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
578         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
579         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
580         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
581         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
582         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
583         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
584         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
585         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
586         * bindings/scripts/test/JS/JSTestNode.cpp:
587         * bindings/scripts/test/JS/JSTestObj.cpp:
588         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
589         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
590         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
591         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
592         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
593         * bindings/scripts/test/JS/JSTestSerialization.cpp:
594         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
595         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
596         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
597         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
598         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
599         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
600         * bindings/scripts/test/JS/JSTestStringifier.cpp:
601         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
602         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
603         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
604         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
605         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
606         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
607         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
608         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
609         * bridge/IdentifierRep.cpp:
610         * bridge/NP_jsobject.cpp:
611         (ObjectMap::get): Deleted.
612         (ObjectMap::add): Deleted.
613         (ObjectMap::remove): Deleted.
614         (objectMap): Deleted.
615         (ObjectMap::RootObjectInvalidationCallback::operator()): Deleted.
616         (getListFromVariantArgs): Deleted.
617         (jsAllocate): Deleted.
618         (jsDeallocate): Deleted.
619         (_NPN_CreateNoScriptObject): Deleted.
620         (_NPN_InvokeDefault): Deleted.
621         (_NPN_Invoke): Deleted.
622         (_NPN_Evaluate): Deleted.
623         (_NPN_GetProperty): Deleted.
624         (_NPN_SetProperty): Deleted.
625         (_NPN_RemoveProperty): Deleted.
626         (_NPN_HasProperty): Deleted.
627         (_NPN_HasMethod): Deleted.
628         (_NPN_SetException): Deleted.
629         (_NPN_Enumerate): Deleted.
630         (_NPN_Construct): Deleted.
631         * bridge/NP_jsobject.h:
632         * contentextensions/ContentExtensionParser.cpp:
633         * crypto/SubtleCrypto.cpp:
634         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
635         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
636         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
637         (WebCore::CryptoAlgorithmAES_CBC::importKey):
638         (WebCore::CryptoAlgorithmAES_CBC::exportKey):
639         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
640         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
641         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
642         (WebCore::CryptoAlgorithmAES_CFB::importKey):
643         (WebCore::CryptoAlgorithmAES_CFB::exportKey):
644         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
645         (WebCore::parametersAreValid):
646         (WebCore::CryptoAlgorithmAES_CTR::importKey):
647         (WebCore::CryptoAlgorithmAES_CTR::exportKey):
648         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
649         (WebCore::tagLengthIsValid):
650         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
651         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
652         (WebCore::CryptoAlgorithmAES_GCM::importKey):
653         (WebCore::CryptoAlgorithmAES_GCM::exportKey):
654         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
655         (WebCore::CryptoAlgorithmAES_KW::importKey):
656         (WebCore::CryptoAlgorithmAES_KW::exportKey):
657         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
658         (WebCore::CryptoAlgorithmHMAC::importKey):
659         (WebCore::CryptoAlgorithmHMAC::exportKey):
660         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
661         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
662         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
663         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
664         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
665         (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
666         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
667         (WebCore::CryptoAlgorithmRSA_PSS::importKey):
668         (WebCore::CryptoAlgorithmRSA_PSS::exportKey):
669         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
670         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
671         (WebCore::commonCryptoHMACAlgorithm): Deleted.
672         * css/CSSBasicShapes.cpp:
673         * css/CSSPrimitiveValue.cpp:
674         * css/parser/CSSParser.cpp:
675         * css/parser/CSSPropertyParser.cpp:
676         * css/parser/CSSPropertyParserHelpers.cpp:
677         (WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues):
678         (WebCore::CSSPropertyParserHelpers::consumePosition):
679         (WebCore::CSSPropertyParserHelpers::createPrimitiveValuePair): Deleted.
680         * dom/DOMQuad.cpp:
681         * dom/Document.cpp:
682         * dom/ErrorEvent.cpp:
683         * dom/EventListenerMap.cpp:
684         * dom/EventTarget.cpp:
685         * dom/PromiseRejectionEvent.cpp:
686         * dom/RejectedPromiseTracker.cpp:
687         * dom/ScriptExecutionContext.cpp:
688         * domjit/JSDocumentDOMJIT.cpp:
689         * domjit/JSDocumentFragmentDOMJIT.cpp:
690         * domjit/JSElementDOMJIT.cpp:
691         * domjit/JSEventDOMJIT.cpp:
692         * domjit/JSNodeDOMJIT.cpp:
693         * editing/TextIterator.cpp:
694         * editing/cocoa/HTMLConverter.mm:
695         * history/CachedPage.cpp:
696         * html/HTMLCanvasElement.cpp:
697         * html/HTMLFontElement.cpp:
698         * html/HTMLMediaElement.cpp:
699         * html/HTMLSelectElement.cpp:
700         * html/TypeAhead.cpp:
701         * html/parser/HTMLSrcsetParser.cpp:
702         (WebCore::tokenizeDescriptors):
703         * html/parser/HTMLTokenizer.cpp:
704         * html/parser/ParsingUtilities.h:
705         (WebCore::isNotASCIISpace):
706         * html/parser/XSSAuditorDelegate.cpp:
707         * html/track/DataCue.cpp:
708         * inspector/CommandLineAPIHost.cpp:
709         * inspector/CommandLineAPIModule.cpp:
710         * inspector/InspectorApplicationCacheAgent.cpp:
711         * inspector/InspectorCSSAgent.cpp:
712         * inspector/InspectorCanvas.cpp:
713         * inspector/InspectorCanvasAgent.cpp:
714         * inspector/InspectorClient.cpp:
715         * inspector/InspectorController.cpp:
716         * inspector/InspectorDOMAgent.cpp:
717         * inspector/InspectorDOMDebuggerAgent.cpp:
718         * inspector/InspectorDOMStorageAgent.cpp:
719         * inspector/InspectorDatabaseAgent.cpp:
720         * inspector/InspectorDatabaseResource.cpp:
721         * inspector/InspectorFrontendClientLocal.cpp:
722         * inspector/InspectorFrontendHost.cpp:
723         * inspector/InspectorIndexedDBAgent.cpp:
724         * inspector/InspectorInstrumentation.cpp:
725         * inspector/InspectorLayerTreeAgent.cpp:
726         * inspector/InspectorMemoryAgent.cpp:
727         * inspector/InspectorNetworkAgent.cpp:
728         * inspector/InspectorOverlay.cpp:
729         * inspector/InspectorPageAgent.cpp:
730         * inspector/InspectorShaderProgram.cpp:
731         * inspector/InspectorStyleSheet.cpp:
732         * inspector/InspectorTimelineAgent.cpp:
733         * inspector/InspectorWorkerAgent.cpp:
734         * inspector/InstrumentingAgents.cpp:
735         * inspector/NetworkResourcesData.cpp:
736         * inspector/PageConsoleAgent.cpp:
737         * inspector/PageDebuggerAgent.cpp:
738         * inspector/PageHeapAgent.cpp:
739         * inspector/PageRuntimeAgent.cpp:
740         * inspector/PageScriptDebugServer.cpp:
741         * inspector/TimelineRecordFactory.cpp:
742         * inspector/WebConsoleAgent.cpp:
743         * inspector/WebDebuggerAgent.cpp:
744         * inspector/WebHeapAgent.cpp:
745         * inspector/WebInjectedScriptHost.cpp:
746         * inspector/WebInjectedScriptManager.cpp:
747         * inspector/WorkerConsoleAgent.cpp:
748         * inspector/WorkerDebuggerAgent.cpp:
749         * inspector/WorkerInspectorController.cpp:
750         * inspector/WorkerRuntimeAgent.cpp:
751         * inspector/WorkerScriptDebugServer.cpp:
752         * loader/FTPDirectoryParser.cpp:
753         * loader/TextResourceDecoder.cpp:
754         * loader/cache/CachedResource.cpp:
755         * loader/cache/CachedResourceLoader.cpp:
756         * page/ContextMenuController.cpp:
757         * page/DOMWindow.cpp:
758         * page/Navigator.cpp:
759         * page/PageConsoleClient.cpp:
760         * page/PageDebuggable.cpp:
761         * page/cocoa/ResourceUsageOverlayCocoa.mm:
762         * page/csp/ContentSecurityPolicy.cpp:
763         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
764         (WebCore::isNotASCIISpace): Deleted.
765         * page/csp/ContentSecurityPolicyMediaListDirective.cpp:
766         (WebCore::isNotASCIISpace): Deleted.
767         * page/scrolling/ios/ScrollingTreeIOS.cpp:
768         * page/scrolling/ios/ScrollingTreeIOS.h:
769         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
770         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
771         (WebCore::operator*): Deleted.
772         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
773         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
774         (WebCore::operator*): Deleted.
775         * platform/Length.cpp:
776         * platform/URL.cpp:
777         (WebCore::isSchemeFirstChar):
778         (WebCore::isSchemeChar):
779         (WebCore::isBadChar):
780         (WebCore::isTabNewline):
781         * platform/audio/WebAudioBufferList.cpp:
782         (WebCore::WebAudioBufferList::WebAudioBufferList):
783         * platform/audio/mac/AudioSampleDataSource.mm:
784         (WebCore::AudioSampleDataSource::pushSamples):
785         * platform/cf/CoreMediaSoftLink.cpp: Removed.
786         * platform/cf/CoreMediaSoftLink.h: Removed.
787         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
788         * platform/graphics/FloatPolygon.cpp:
789         (WebCore::areCollinearPoints):
790         (WebCore::FloatPolygon::FloatPolygon):
791         (WebCore::VertexPair::intersection const):
792         (WebCore::determinant): Deleted.
793         * platform/graphics/FontCache.cpp:
794         * platform/graphics/FontCascade.cpp:
795         * platform/graphics/GraphicsContext3DPrivate.cpp:
796         * platform/graphics/WidthIterator.cpp:
797         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
798         (WebCore::AudioSourceProviderAVFObjC::process):
799         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
800         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
801         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
802         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
803         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
804         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
805         (WebCore::assetTrackMeetsHardwareDecodeRequirements):
806         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
807         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
808         (WebCore::ImageDecoderAVFObjC::readSampleMetadata):
809         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
810         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
811         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
812         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
813         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
814         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
815         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
816         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
817         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
818         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
819         * platform/graphics/cairo/GraphicsContextCairo.cpp:
820         * platform/graphics/cairo/ImageBufferCairo.cpp:
821         * platform/graphics/cg/ImageBufferCG.cpp:
822         (WebCore::ImageBuffer::ImageBuffer):
823         (WebCore::releaseImageData): Deleted.
824         * platform/graphics/cg/ImageBufferDataCG.h:
825         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
826         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
827         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
828         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
829         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
830         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
831         * platform/graphics/opentype/OpenTypeMathData.cpp:
832         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
833         * platform/graphics/transforms/MatrixTransformOperation.cpp:
834         (WebCore::MatrixTransformOperation::blend):
835         (WebCore::createOperation): Deleted.
836         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
837         * platform/graphics/win/FontWin.cpp:
838         * platform/graphics/win/GraphicsContextCGWin.cpp:
839         * platform/graphics/win/GraphicsContextCairoWin.cpp:
840         * platform/graphics/win/GraphicsContextDirect2D.cpp:
841         * platform/graphics/win/GraphicsContextWin.cpp:
842         * platform/graphics/win/UniscribeController.cpp:
843         * platform/image-decoders/ScalableImageDecoder.cpp:
844         (): Deleted.
845         * platform/ios/LegacyTileLayer.mm:
846         (-[LegacyTileHostLayer renderInContext:]):
847         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
848         * platform/ios/ScrollAnimatorIOS.mm:
849         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
850         * platform/ios/WebAVPlayerController.mm:
851         (-[WebAVPlayerController skipBackwardThirtySeconds:]):
852         (-[WebAVPlayerController gotoEndOfSeekableRanges:]):
853         (-[WebAVPlayerController canSeekToBeginning]):
854         (-[WebAVPlayerController canSeekToEnd]):
855         (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
856         (-[WebAVPlayerController updateMinMaxTiming]):
857         * platform/ios/WebEvent.mm:
858         * platform/ios/WebItemProviderPasteboard.mm:
859         * platform/ios/wak/WKContentObservation.cpp:
860         * platform/mac/KeyEventMac.mm:
861         * platform/mac/PlaybackSessionInterfaceMac.mm:
862         (WebCore::timeRangesToArray):
863         * platform/mac/ScrollAnimatorMac.mm:
864         (macScrollbarTheme): Deleted.
865         (scrollerImpForScrollbar): Deleted.
866         * platform/mac/ScrollbarThemeMac.mm:
867         (WebCore::scrollbarMap):
868         * platform/mac/VideoFullscreenInterfaceMac.mm:
869         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
870         * platform/mac/WebCoreNSURLExtras.mm:
871         (WebCore::dataForURLComponentType):
872         * platform/mac/WebPlaybackControlsManager.mm:
873         * platform/mac/WebVideoFullscreenController.mm:
874         (SOFT_LINK_CLASS): Deleted.
875         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
876         * platform/mac/WebWindowAnimation.mm:
877         (WebWindowAnimationDurationFromDuration): Deleted.
878         (scaledRect): Deleted.
879         (squaredDistance): Deleted.
880         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
881         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
882         * platform/mediastream/mac/AVMediaCaptureSource.mm:
883         * platform/mediastream/mac/AVVideoCaptureSource.mm:
884         (WebCore::AVVideoCaptureSource::applyFrameRate):
885         (WebCore::AVVideoCaptureSource::processNewFrame):
886         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
887         * platform/mediastream/mac/CoreAudioCaptureDevice.cpp:
888         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
889         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
890         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
891         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
892         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
893         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
894         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp:
895         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
896         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
897         * platform/network/HTTPParsers.cpp:
898         * platform/text/LocaleICU.cpp:
899         * platform/text/TextCodecLatin1.cpp:
900         * platform/text/TextCodecUTF8.cpp:
901         * platform/text/TextEncodingRegistry.cpp:
902         * platform/text/win/LocaleWin.cpp:
903         * platform/win/BString.cpp:
904         * platform/win/KeyEventWin.cpp:
905         * platform/win/ScrollbarThemeWin.cpp:
906         * rendering/BidiRun.cpp:
907         * rendering/FloatingObjects.cpp:
908         * rendering/RenderBlock.cpp:
909         * rendering/RenderListMarker.cpp:
910         * rendering/RenderQuote.cpp:
911         * rendering/RenderText.cpp:
912         * rendering/RenderThemeWin.cpp:
913         * testing/Internals.cpp:
914         * testing/js/WebCoreTestSupport.cpp:
915         * workers/WorkerConsoleClient.cpp:
916         * workers/WorkerGlobalScope.cpp:
917         * workers/WorkerInspectorProxy.cpp:
918         * xml/SoftLinkLibxslt.cpp: Added.
919         * xml/SoftLinkLibxslt.h: Added.
920         * xml/XPathGrammar.cpp:
921         * xml/XPathParser.cpp:
922         * xml/XSLStyleSheetLibxslt.cpp:
923         * xml/XSLTExtensions.cpp:
924         * xml/XSLTProcessorLibxslt.cpp:
925         * xml/XSLTUnicodeSort.cpp:
926         (xsltTransformErrorTrampoline):
927         (WebCore::xsltUnicodeSortFunction):
928         * xml/parser/XMLDocumentParser.cpp:
929         (WebCore::XMLDocumentParser::updateLeafTextNode):
930         (WebCore::toString): Deleted.
931
932 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
933
934         Allow reading data and blob URLs via DataTransfer when the pasteboard contains files
935         https://bugs.webkit.org/show_bug.cgi?id=178377
936
937         Reviewed by Ryosuke Niwa.
938
939         Adds data and blob URLs, alongside http(s), as URL protocols safe to expose to bindings.
940
941         Test: editing/pasteboard/drag-drop-href-as-url.html
942
943         * platform/Pasteboard.cpp:
944         (WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles):
945
946 2017-10-16  Ryosuke Niwa  <rniwa@webkit.org>
947
948         Strip away event handlers and JavaScript URLs when copying
949         https://bugs.webkit.org/show_bug.cgi?id=178375
950
951         Reviewed by Wenson Hsieh.
952
953         Don't serialize event handlers and URLs with javascript protocol when serializing HTML
954         since they're not safe to be pasted elsewhere.
955
956         Test: editing/pasteboard/copying-html-strips-javascript-url-and-event-handler.html
957
958         * dom/Element.cpp:
959         (WebCore::Element::isEventHandlerAttribute const):
960         (WebCore::isEventHandlerAttribute): Deleted.
961         * dom/Element.h:
962         * editing/markup.cpp:
963         (WebCore::StyledMarkupAccumulator::appendElement):
964
965 2017-10-16  Dean Jackson  <dino@apple.com>
966
967         WebGL clamps drawingBufferWidth to 4096 pixels on a 5120 monitor/canvas
968         https://bugs.webkit.org/show_bug.cgi?id=178223
969         <rdar://problem/34597567>
970
971         Reviewed by Antoine Quint.
972
973         Remove the limit of 4k on the width/height of the renderbuffer.
974
975         Test: fast/canvas/webgl/large-drawing-buffer-resize.html
976
977         * html/canvas/WebGLRenderingContextBase.cpp:
978         (WebCore::WebGLRenderingContextBase::reshape):
979
980 2017-10-16  Ryosuke Niwa  <rniwa@webkit.org>
981
982         Assert that Node::insertedInto doesn't fire an event
983         https://bugs.webkit.org/show_bug.cgi?id=178376
984         <rdar://problem/35022857>
985
986         Reviewed by Daniel Bates.
987
988         Fixed the assertion in notifyChildNodeInserted since this function MUST NOT dispatch an event,
989         and moved a bunch of event-dispatching code from Node::insertedInto into Node::finishedInsertingSubtree.
990
991         No new tests since the existing tests cover the behavioral change.
992
993         * dom/ContainerNodeAlgorithms.cpp:
994         (WebCore::notifyChildNodeInserted): Fixed the assertion.
995         * dom/ProcessingInstruction.cpp:
996         (WebCore::ProcessingInstruction::insertedInto):
997         (WebCore::ProcessingInstruction::finishedInsertingSubtree): Extracted from insertedInto since
998         checkStyleSheet can dispatch an event.
999         * dom/ProcessingInstruction.h:
1000         * html/HTMLBodyElement.cpp:
1001         (WebCore::HTMLBodyElement::insertedInto):
1002         (WebCore::HTMLBodyElement::finishedInsertingSubtree): Extracted from insertedInto since
1003         setIntegralAttribute could dispatch DOMAttrModified synchronously.
1004         * html/HTMLBodyElement.h:
1005
1006 2017-10-16  Chris Dumez  <cdumez@apple.com>
1007
1008         ServiceWorkerRegistration should subclass RefCounted<>
1009         https://bugs.webkit.org/show_bug.cgi?id=178374
1010
1011         Reviewed by Ryosuke Niwa.
1012
1013         ServiceWorkerRegistration should subclass RefCounted<> or we end up with an infinite recursion
1014         when constructing such object. This is because ServiceWorkerRegistration subclasses
1015         EventTargetWithInlineData which implements ref() / deref() by calling refEventTarget() /
1016         derefEventTarget(). refEventTarget() / derefEventTarget() are implemented in
1017         ServiceWorkerRegistration so that they call ref() / deref() (which ends up being EventTarget's
1018         methods).
1019
1020         * workers/service/ServiceWorkerRegistration.h:
1021
1022 2017-10-16  Jer Noble  <jer.noble@apple.com>
1023
1024         ImageDecoderAVFObjC fails to create more CMSampleBuffers after creating about 32MB worth.
1025         https://bugs.webkit.org/show_bug.cgi?id=178360
1026
1027         Reviewed by Eric Carlson.
1028
1029         AVSampleBufferGenerator has a constrained memory pool of about 32MB in size. Once
1030         CMSampleBuffers representing about 32MB of memory are allocated, no more can be created
1031         until previously created ones are released. So rather than (only) creating the sample
1032         buffers up front in readSampleMetadata(), also create them dynamically, if missing, in
1033         createFrameImageAtIndex(...) and release them in storeSampleBuffer(...) after they have been
1034         decoded.
1035
1036         Drive-by fix: the expected content length was never actually set by the owner of ImageDecoderAVFObjC.
1037         Now that the expected content length is available, we don't have to wait until the data is complete
1038         to respond to requests.
1039
1040         * platform/graphics/ImageSource.cpp:
1041         (WebCore::ImageSource::ensureDecoderAvailable):
1042         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
1043         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1044         (SOFT_LINK_POINTER_OPTIONAL):
1045         (-[WebCoreSharedBufferResourceLoaderDelegate canFulfillRequest:]):
1046         (-[WebCoreSharedBufferResourceLoaderDelegate fulfillRequest:]):
1047         (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
1048         (WebCore::imageDecoderAssetOptions):
1049         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
1050         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
1051         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
1052         (WebCore::ImageDecoderAVFObjC::setExpectedContentSize):
1053
1054 2017-10-12  Matt Rajca  <mrajca@apple.com>
1055
1056         Add API support for quirk that lets an arbitrary click allow auto-play.
1057         https://bugs.webkit.org/show_bug.cgi?id=178227
1058
1059         Reviewed by Alex Christensen.
1060
1061         Added API test.
1062         
1063         Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets
1064         an arbitrary click allow auto-play via website policies.
1065
1066         * html/MediaElementSession.cpp:
1067         (WebCore::needsArbitraryUserGestureAutoplayQuirk):
1068         * loader/DocumentLoader.h:
1069
1070 2017-10-16  Chris Dumez  <cdumez@apple.com>
1071
1072         DOMQuad.p1 / p2 / p3 / p4 should behave as [SameObject]
1073         https://bugs.webkit.org/show_bug.cgi?id=178366
1074
1075         Reviewed by Youenn Fablet.
1076
1077         DOMQuad.p1 / p2 / p3 / p4 should behave as [SameObject]. We attempted to do so using JSDOMQuad::visitAdditionalChildren()
1078         but the code did not work because we failed to generate a "isReachableFromOpaqueRoots()" function for JSDOMPoint.
1079
1080         Test: fast/css/DOMQuad-points-SameObject.html
1081
1082         * dom/DOMPoint.idl:
1083
1084 2017-10-16  Andy Estes  <aestes@apple.com>
1085
1086         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
1087         https://bugs.webkit.org/show_bug.cgi?id=178191
1088         <rdar://problem/34906367>
1089
1090         Reviewed by Tim Horton.
1091
1092         Added test cases to http/tests/ssl/applepay/ApplePaySession.html.
1093
1094         * Modules/applepay/ApplePayError.idl:
1095         * Modules/applepay/ApplePayPaymentContact.h:
1096         * Modules/applepay/ApplePayPaymentContact.idl:
1097         * Modules/applepay/ApplePaySessionPaymentRequest.h:
1098         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1099         (WebCore::subLocality):
1100         (WebCore::setSubLocality):
1101         (WebCore::subAdministrativeArea):
1102         (WebCore::setSubAdministrativeArea):
1103         (WebCore::convert):
1104
1105 2017-10-16  Alex Christensen  <achristensen@webkit.org>
1106
1107         Allow modern decoding of URLs
1108         https://bugs.webkit.org/show_bug.cgi?id=178265
1109
1110         Reviewed by Chris Dumez.
1111
1112         * platform/URL.h:
1113         (WebCore::URL::decode):
1114
1115 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
1116
1117         Unreviewed, rolling out r223425.
1118
1119         This change broke internal builds.
1120
1121         Reverted changeset:
1122
1123         "Remove unnecessary include from Document.h"
1124         https://bugs.webkit.org/show_bug.cgi?id=178247
1125         https://trac.webkit.org/changeset/223425
1126
1127 2017-10-16  Maureen Daum  <mdaum@apple.com>
1128
1129         If an origin doesn't have databases in the Databases table we should still remove its information from disk in DatabaseTracker::deleteOrigin()
1130         https://bugs.webkit.org/show_bug.cgi?id=178281
1131         <rdar://problem/34576132>
1132
1133         Reviewed by Brent Fulgham.
1134
1135         New test:
1136         DatabaseTracker.DeleteOriginWithMissingEntryInDatabasesTable
1137
1138         * Modules/webdatabase/DatabaseTracker.cpp:
1139         (WebCore::DatabaseTracker::deleteOrigin):
1140         If databaseNames is empty, don't bail early. Instead, delete everything in the directory
1141         containing the databases for this origin. This condition indicates that we previously
1142         tried to remove the origin but didn't get all of the way through the deletion process.
1143         Because we have lost track of the databases for this origin, we can assume that no
1144         other process is accessing them. This means it should be safe to delete them outright.
1145
1146 2017-10-16  Youenn Fablet  <youenn@apple.com>
1147
1148         [FETCH] Remove Request.type getter
1149         https://bugs.webkit.org/show_bug.cgi?id=177798
1150
1151         Reviewed by Chris Dumez.
1152
1153         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-type-attribute-historical.html
1154                imported/w3c/web-platform-tests/fetch/api/request/url-encoding.html
1155
1156         Removing FetchRequest type getter.
1157         Merging Type and Destination as per https://fetch.spec.whatwg.org/#concept-request-destination.
1158         Setting destination of request within CachedResourceLoader as this will be useful to Service Workers.
1159
1160         * Modules/fetch/FetchRequest.h:
1161         * Modules/fetch/FetchRequest.idl:
1162         * loader/FetchOptions.h:
1163         (WebCore::FetchOptions::isolatedCopy const):
1164         (WebCore::FetchOptions::FetchOptions):
1165         (WebCore::FetchOptions::encode const):
1166         (WebCore::FetchOptions::decode):
1167         * loader/ThreadableLoader.cpp:
1168         (WebCore::ThreadableLoaderOptions::isolatedCopy const):
1169         * loader/cache/CachedResourceLoader.cpp:
1170         (WebCore::CachedResourceLoader::requestImage):
1171         (WebCore::CachedResourceLoader::requestFont):
1172         (WebCore::CachedResourceLoader::requestTextTrack):
1173         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
1174         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
1175         (WebCore::CachedResourceLoader::requestScript):
1176         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
1177         (WebCore::CachedResourceLoader::requestMedia):
1178         (WebCore::CachedResourceLoader::requestIcon):
1179         (WebCore::CachedResourceLoader::requestRawResource):
1180         (WebCore::CachedResourceLoader::requestBeaconResource):
1181         (WebCore::CachedResourceLoader::requestMainResource):
1182         * loader/cache/CachedResourceRequest.cpp:
1183         (WebCore::CachedResourceRequest::setDestinationIfNotSet):
1184         * loader/cache/CachedResourceRequest.h:
1185
1186 2017-10-15  Ryosuke Niwa  <rniwa@webkit.org>
1187
1188         Cannot access images included in the content pasted from Microsoft Word
1189         https://bugs.webkit.org/show_bug.cgi?id=124391
1190         <rdar://problem/26862741>
1191
1192         Reviewed by Antti Koivisto.
1193
1194         The bug is caused by the fact Microsoft Word generates HTML content which references an image using file URL.
1195         Because the websites don't have access to arbtirary file URLs, this prevents editors such as TinyMCE to save
1196         those images.
1197
1198         This patch fixes the problem by converting file URLs for images and all other subresources in the web archive
1199         generated by Microsoft Word by blob URLs like r222839 for RTF/RTFD and r222119 for images.
1200
1201         To avoid revealing privacy sensitive information such as the absolute local file path to the user's home directory
1202         Microsoft Word and other applications in the system includes in the web archive placed in the system pasteboard,
1203         this patch also introduces the mechanism to sanitize when the HTML content is read by DataTransfer's getData.
1204
1205         This patch also introduces the sanitization for when writing HTML into the pasteboard since other applications
1206         in the syste which is capable to processing web archives are not necessarily equipped to pretect itself and the
1207         rest of the system from potentially dangerous JavaScript included in the web archive placed in the system pasteboard.
1208
1209         Finally, this patch expands the list of clipboard types that are exposed as "text/html" to the Web platform by
1210         adding the capability to convert RTF, RTFD, and web archive into HTML markup by introducing WebContentMarkupReader,
1211         a new subclass of PasteboardWebContentReader which creates a HTML markup instead of a document fragment. Most of
1212         the sanitization process happens in this new class, and will be expanded to WebContentReader to make pasting safer.
1213
1214         Tests: editing/pasteboard/data-transfer-get-data-on-pasting-html-uses-blob-url.html
1215                editing/pasteboard/data-transfer-set-data-sanitizes-html-when-copying-in-null-origin.html
1216                editing/pasteboard/data-transfer-set-data-sanitizes-html-when-copying.html
1217                editing/pasteboard/data-transfer-set-data-sanitlize-html-when-dragging-in-null-origin.html
1218                http/tests/security/clipboard/copy-paste-html-across-origin-sanitizes-html.html
1219                CopyHTML.Sanitizes
1220                DataInteractionTests.DataTransferSanitizeHTML
1221                PasteRTF.ExposesHTMLTypeInDataTransfer
1222                PasteRTFD.ExposesHTMLTypeInDataTransfer
1223                PasteRTFD.ImageElementUsesBlobURLInHTML
1224                PasteWebArchive.ExposesHTMLTypeInDataTransfer
1225
1226         * dom/DataTransfer.cpp:
1227         (WebCore::originIdentifierForDocument): Moved to Document::originIdentifierForPasteboard.
1228         (WebCore::DataTransfer::createForCopyAndPaste):
1229         (WebCore::DataTransfer::getDataForItem const): Use WebContentMarkupReader read HTMl content so that we can read
1230         web arhive, RTF, and RTFD as text/html.
1231         (WebCore::DataTransfer::getData const):
1232         (WebCore::DataTransfer::setData):
1233         (WebCore::DataTransfer::setDataFromItemList): Sanitize the HTML before placing into the system pasteboard.
1234         (WebCore::DataTransfer::createForDragStartEvent):
1235         (WebCore::DataTransfer::createForDrop):
1236         (WebCore::DataTransfer::createForUpdatingDropTarget):
1237         * dom/DataTransfer.h:
1238         * dom/DataTransfer.idl:
1239         * dom/DataTransferItem.cpp:
1240         (WebCore::DataTransferItem::getAsString const):
1241         * dom/Document.cpp:
1242         (WebCore::Document::originIdentifierForPasteboard): Renamed from uniqueIdentifier. Moved the code to use the origin
1243         string and then falling back to the UUID here from originIdentifierForDocument in DataTransfer.cpp.
1244         * dom/Document.h:
1245         * editing/WebContentReader.cpp:
1246         (WebCore::WebContentMarkupReader::shouldSanitize const): Added.
1247         * editing/WebContentReader.h:
1248         (WebCore::WebContentMarkupReader): Added.
1249         (WebCore::WebContentMarkupReader::WebContentMarkupReader):
1250         * editing/cocoa/WebContentReaderCocoa.mm:
1251         (WebCore::createFragmentFromWebArchive): Extracted out of WebContentReader::readWebArchive to share code.
1252         (WebCore::WebContentReader::readWebArchive):
1253         (WebCore::WebContentMarkupReader::readWebArchive): Added. Reads the web archive, replace all subresource URLs by
1254         blob URLs, and re-generate the markup using our copy & paste code. The last step is requied to strip away any privacy
1255         sensitive information as well as potentially dangerous JavaScript code.
1256         (WebCore::stripMicrosoftPrefix): Extracted out of WebContentReader::readHTML to share code.
1257         (WebCore::WebContentReader::readHTML):
1258         (WebCore::WebContentMarkupReader::readHTML): Added. Only sanitize the markup when it comes from a different origin.
1259         (WebCore::WebContentReader::readRTFD): Added a nullity check for frame.document().
1260         (WebCore::WebContentMarkupReader::readRTFD): Added.
1261         (WebCore::WebContentMarkupReader::readRTF): Added.
1262         * editing/markup.h:
1263         * editing/markup.cpp:
1264         (WebCore::createPageForSanitizingWebContent): Added.
1265         (WebCore::sanitizeMarkup): Added. This function "pastes" the markup into a new isolated document then reserializes
1266         using our serialization code for copy. It strips away all invisible information such as comments, and strips away
1267         event handlers and script elements to remove potentially dangerous scripts.
1268         * platform/Pasteboard.h:
1269         * platform/ios/PasteboardIOS.mm:
1270         (WebCore::Pasteboard::readPasteboardWebContentDataForType): Now that this code can be called by DataTransfer, added
1271         the checks for the change count to make sure we stop letting web content read if the pasteboard had been changed by
1272         some other applications. To do this, turned this function into a member of Pasteboard. Also changed the return type
1273         to an enum with tri-state to exist the loop early in the call sites.
1274         (WebCore::Pasteboard::read):
1275         (WebCore::Pasteboard::readRespectingUTIFidelities):
1276         * platform/ios/PlatformPasteboardIOS.mm:
1277         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Treat RTF, RTFD, and web archive as HTML.
1278         * platform/mac/PasteboardMac.mm:
1279         (WebCore::Pasteboard::read): Add the change count checks now that this code can be called by DataTransfer.
1280         * platform/mac/PlatformPasteboardMac.mm:
1281         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Treat RTF, RTFD, and web archive as HTML.
1282
1283 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
1284
1285         Unreviewed attempt to fix the Windows debug build.
1286
1287         * Modules/webdatabase/DatabaseTracker.cpp:
1288         (WebCore::DatabaseTracker::deleteOrigin):
1289
1290 2017-10-16  Chris Dumez  <cdumez@apple.com>
1291
1292         Log using differential privacy domains where the WebContent process crashes
1293         https://bugs.webkit.org/show_bug.cgi?id=178346
1294         <rdar://problem/33293830>
1295
1296         Reviewed by Alex Christensen.
1297
1298         Add new diagnostic logging key for domain causing crashes.
1299
1300         * page/DiagnosticLoggingKeys.cpp:
1301         (WebCore::DiagnosticLoggingKeys::domainCausingCrashKey):
1302         * page/DiagnosticLoggingKeys.h:
1303
1304 2017-10-16  Sam Weinig  <sam@webkit.org>
1305
1306         [Settings] Remove all custom code from Settings.h/cpp
1307         https://bugs.webkit.org/show_bug.cgi?id=178330
1308
1309         Reviewed by Simon Fraser.
1310
1311         Removes the two remaining functions out of Settings paving the way
1312         for the file to be generated.
1313         
1314         - pageDestroyed was moved down into SettingsBase.
1315         - effectiveFrameFlattening was moved to FrameView (to reduce the need
1316           for additional includes, the FrameFlattening enum was converted to
1317           an enum class to allow it to be forward declared).
1318           
1319         Also moves default values into SettingsDefaultValues.h
1320
1321         * WebCore.xcodeproj/project.pbxproj:
1322         
1323             Add new files.
1324         
1325         * page/FrameView.cpp:
1326         * page/FrameView.h:
1327
1328             Move effectiveFrameFlattening function here from Settings.
1329
1330         * page/Settings.cpp:
1331         * page/Settings.h:
1332
1333             Move effectiveFrameFlattening, pageDestroyed and default values out.
1334
1335         * page/Settings.in:
1336         
1337             Update for turning FrameFlattening into an enum class.
1338         
1339         * page/SettingsBase.h:
1340
1341             Turn FrameFlattening into an enum class and move pageDestroyed here.
1342
1343         * page/SettingsDefaultValues.h: Added.
1344
1345             Move all the default values from Settings here.
1346
1347         * rendering/RenderFrameSet.cpp:
1348         * rendering/RenderIFrame.cpp:
1349         * rendering/RenderView.cpp:
1350
1351             Get effectiveFrameFlattening from the FrameView.
1352
1353         * testing/InternalSettings.cpp:
1354         * testing/InternalSettings.h:
1355         
1356             Update now that FrameFlattening is an enum class.
1357
1358 2017-10-16  Maureen Daum  <mdaum@apple.com>
1359
1360         If we fail to delete any database file, don't remove its information from the tracker database
1361         <rdar://problem/34576132> and https://bugs.webkit.org/show_bug.cgi?id=178251
1362
1363         Reviewed by Brady Eidson.
1364
1365         New tests:
1366         DatabaseTracker.DeleteDatabase
1367         DatabaseTracker.DeleteDatabaseWhenDatabaseDoesNotExist
1368         DatabaseTracker.DeleteOrigin
1369         DatabaseTracker.DeleteOriginWhenDeletingADatabaseFails
1370         DatabaseTracker.DeleteOriginWhenDatabaseDoesNotExist
1371
1372         * Modules/webdatabase/DatabaseTracker.cpp:
1373         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
1374         If the database doesn't exist, we previously deleted it but failed to remove the
1375         information from the tracker database. We still want to delete all of the information
1376         associated with this database from the tracker database, so add it to databaseNamesToDelete.
1377         (WebCore::DatabaseTracker::deleteOrigin):
1378         If a database doesn't exist, don't try to delete it. We don't need to, but more
1379         importantly, deleteDatabaseFile() will fail if the database doesn't exist, which
1380         will cause us to incorrectly think we failed to remove database information from disk.
1381         If we actually fail to delete any database file, return before we remove the origin
1382         information from the tracker database so we don't lose track of the database.
1383         (WebCore::DatabaseTracker::deleteDatabase):
1384         If a database doesn't exist, don't try to delete it. We don't need to, but also it
1385         will cause us to incorrectly think that we were unable to delete a database, so we
1386         would bail before we remove the database information from the tracker database. We
1387         want to remove the database information from the tracker database because the database
1388         doesn't exist.
1389         * Modules/webdatabase/DatabaseTracker.h:
1390         Expose fullPathForDatabase() for use by tests.
1391         * platform/Logging.h:
1392         Add a logging channel.
1393
1394 2017-10-16  Alex Christensen  <achristensen@webkit.org>
1395
1396         Remove unnecessary include from Document.h
1397         https://bugs.webkit.org/show_bug.cgi?id=178247
1398
1399         Reviewed by Darin Adler.
1400
1401         * dom/Document.cpp:
1402         (WebCore::Document::hasTouchEventHandlers const):
1403         (WebCore::Document::touchEventTargetsContain const):
1404         * dom/Document.h:
1405         (WebCore::Document::hasTouchEventHandlers const): Deleted.
1406         (WebCore::Document::touchEventTargetsContain const): Deleted.
1407
1408 2017-10-16  Alex Christensen  <achristensen@webkit.org>
1409
1410         Fix iOS build after r223422
1411         https://bugs.webkit.org/show_bug.cgi?id=178251
1412
1413         * Modules/webdatabase/DatabaseManager.h:
1414
1415 2017-10-16  Maureen Daum  <mdaum@apple.com>
1416
1417         We should wrap the removal of information from the tracker database in a transaction in DatabaseTracker::deleteOrigin()
1418         https://bugs.webkit.org/show_bug.cgi?id=178274
1419         <rdar://problem/34576132>
1420
1421         Reviewed by Tim Horton.
1422
1423         * Modules/webdatabase/DatabaseTracker.cpp:
1424         (WebCore::DatabaseTracker::deleteOrigin):
1425         Wrap the removal of information from the tracker database in a transaction so that
1426         we don't end up in a case where only one of the tables contains information about
1427         an origin.
1428         If anything goes wrong when we're modifying the tracker database, rollback the transaction
1429         before bailing.
1430
1431 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
1432
1433         Unreviewed, rolling out r223419.
1434
1435         This change broke the Windows build.
1436
1437         Reverted changeset:
1438
1439         "If we fail to delete any database file, don't remove its
1440         information from the tracker database"
1441         https://bugs.webkit.org/show_bug.cgi?id=178251
1442         https://trac.webkit.org/changeset/223419
1443
1444 2017-10-16  Maureen Daum  <mdaum@apple.com>
1445
1446         If we fail to delete any database file, don't remove its information from the tracker database
1447         <rdar://problem/34576132> and https://bugs.webkit.org/show_bug.cgi?id=178251
1448
1449         Reviewed by Brady Eidson.
1450
1451         New tests:
1452         DatabaseTracker.DeleteDatabase
1453         DatabaseTracker.DeleteDatabaseWhenDatabaseDoesNotExist
1454         DatabaseTracker.DeleteOrigin
1455         DatabaseTracker.DeleteOriginWhenDeletingADatabaseFails
1456         DatabaseTracker.DeleteOriginWhenDatabaseDoesNotExist
1457
1458         * Modules/webdatabase/DatabaseTracker.cpp:
1459         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
1460         If the database doesn't exist, we previously deleted it but failed to remove the
1461         information from the tracker database. We still want to delete all of the information
1462         associated with this database from the tracker database, so add it to databaseNamesToDelete.
1463         (WebCore::DatabaseTracker::deleteOrigin):
1464         If a database doesn't exist, don't try to delete it. We don't need to, but more
1465         importantly, deleteDatabaseFile() will fail if the database doesn't exist, which
1466         will cause us to incorrectly think we failed to remove database information from disk.
1467         If we actually fail to delete any database file, return before we remove the origin
1468         information from the tracker database so we don't lose track of the database.
1469         (WebCore::DatabaseTracker::deleteDatabase):
1470         If a database doesn't exist, don't try to delete it. We don't need to, but also it
1471         will cause us to incorrectly think that we were unable to delete a database, so we
1472         would bail before we remove the database information from the tracker database. We
1473         want to remove the database information from the tracker database because the database
1474         doesn't exist.
1475         * Modules/webdatabase/DatabaseTracker.h:
1476         Expose fullPathForDatabase() for use by tests.
1477         * platform/Logging.h:
1478         Add a logging channel.
1479
1480 2017-10-16  Brent Fulgham  <bfulgham@apple.com>
1481
1482         REGRESSION(223307): ASSERTION in WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution
1483         https://bugs.webkit.org/show_bug.cgi?id=178342
1484         <rdar://problem/35008505>
1485
1486         Reviewed by Chris Dumez.
1487
1488         In r223307 I mistakenly used 'topDocument->topDocument()' because of a copy/paste error. I should have just used
1489         'topDocument'.
1490
1491         Tests: CommandBackForwardTestWKWebView in TestWebKitAPI.
1492
1493         * loader/ResourceLoadObserver.cpp:
1494         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): We might enter this routine at a time
1495         where there is no page. If so, we should return early and not log credit.
1496         * page/EventHandler.cpp:
1497         (WebCore::EventHandler::keyEvent): Correct the argument passed to the log function.
1498
1499 2017-10-15  Filip Pizlo  <fpizlo@apple.com>
1500
1501         Make some asserts into release asserts
1502         https://bugs.webkit.org/show_bug.cgi?id=178324
1503
1504         Reviewed by Saam Barati.
1505
1506         No new tests because no change in behavior.
1507         
1508         This introduces some release asserts. Perf testing shows that it's neutral. So, we get some extra
1509         safety without losing any perf.
1510
1511         * dom/ContainerNodeAlgorithms.cpp:
1512         (WebCore::notifyChildNodeInserted):
1513         * dom/Document.cpp:
1514         (WebCore::Document::adoptNode):
1515         (WebCore::Document::frameDestroyed):
1516         (WebCore::Document::attachToCachedFrame):
1517         (WebCore::Document::detachFromCachedFrame):
1518         (WebCore::Document::prepareForDestruction):
1519         (WebCore::Document::dispatchWindowEvent):
1520         (WebCore::Document::dispatchWindowLoadEvent):
1521         (WebCore::Document::applyQuickLookSandbox):
1522         * dom/DocumentOrderedMap.cpp:
1523         (WebCore::DocumentOrderedMap::add):
1524         (WebCore::DocumentOrderedMap::remove):
1525         (WebCore::DocumentOrderedMap::get const):
1526         (WebCore:: const):
1527         * dom/Node.cpp:
1528         (WebCore::Node::~Node):
1529         (WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope):
1530         (WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall):
1531         (WebCore::moveNodeToNewDocument):
1532         (WebCore::moveShadowTreeToNewDocument):
1533         (WebCore::Node::moveTreeToNewScope):
1534         (WebCore::Node::didMoveToNewDocument):
1535         (WebCore::Node::dispatchSubtreeModifiedEvent):
1536         (WebCore::Node::dispatchDOMActivateEvent):
1537
1538 2017-10-16  Alejandro G. Castro  <alex@igalia.com>
1539
1540         Make RealtimeIncomingAudioSources and RealtimeOutgoingAudioSources port agnostic
1541         https://bugs.webkit.org/show_bug.cgi?id=177928
1542
1543         Reviewed by Youenn Fablet.
1544
1545         Refactor the RealtimeIncomingAudioSource and RealtimeOutgoingAudioSource classes,
1546         move the mac specific code to a different class. This way we can use them from
1547         other ports.
1548
1549         No new tests, we are not adding new functionality just refactoring.
1550
1551         * CMakeLists.txt:
1552         * WebCore.xcodeproj/project.pbxproj:
1553         * platform/mediastream/RealtimeIncomingAudioSource.cpp: Copied from Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.h. Just the port agnostic parts.
1554         * platform/mediastream/RealtimeIncomingAudioSource.h: Copied from Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.h. Ditto.
1555         * platform/mediastream/RealtimeOutgoingAudioSource.cpp: Copied from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp. Ditto.
1556         * platform/mediastream/RealtimeOutgoingAudioSource.h: Copied from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.h. Ditto.
1557         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp: Added, it adds Cocoa code parts from original Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.cpp.
1558         (WebCore::RealtimeIncomingAudioSource::create): Moved this function from the RealtimeOutgoingAudioSource.cpp file to avoid including the Cocoa file there.
1559         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h: Added Cocoa code from original Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.h.
1560         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp: Added Cocoa code from original Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp.
1561         (WebCore::RealtimeOutgoingAudioSource::create): Moved this function from the RealtimeOutgoingAudioSource.cpp file to avoid including the Cocoa file there.
1562         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h: Added Cocoa code from the original Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.h.
1563
1564 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
1565
1566         Unreviewed, fix the tvOS build after r223340.
1567
1568         Add a new #define in PlatformPasteboardIOS.mm for item provider support, and guard usages of
1569         WebItemProviderPasteboard using it.
1570
1571         * platform/ios/PlatformPasteboardIOS.mm:
1572         (WebCore::pasteboardMayContainFilePaths):
1573         (WebCore::PlatformPasteboard::readURL):
1574
1575 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
1576
1577         Unreviewed, rolling out r223271.
1578
1579         This change introduced LayoutTest failures on WK1.
1580
1581         Reverted changeset:
1582
1583         "Use asynchronous ResourceHandleClient calls for WebKit1"
1584         https://bugs.webkit.org/show_bug.cgi?id=160677
1585         https://trac.webkit.org/changeset/223271
1586
1587 2017-10-16  Alejandro G. Castro  <alex@igalia.com>
1588
1589         Make RealtimeIncomingVideoSources and RealtimeOutgoingVideoSources port agnostic
1590         https://bugs.webkit.org/show_bug.cgi?id=177869
1591
1592         Reviewed by Youenn Fablet.
1593
1594         Refactor the RealtimeIncomingVideoSource and RealtimeOutgoingVideoSource classes,
1595         move the cocoa specific code to a different class. This way we can use them from
1596         other ports.
1597
1598         No new functionality, just a refactor.
1599
1600         * CMakeLists.txt:
1601         * WebCore.xcodeproj/project.pbxproj:
1602         * platform/mediastream/RealtimeIncomingVideoSource.cpp: Moved from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h. Just the port agnostic parts.
1603         * platform/mediastream/RealtimeIncomingVideoSource.h: Moved from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h. DItto
1604         * platform/mediastream/RealtimeOutgoingVideoSource.cpp: Moved from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp. Ditto
1605         * platform/mediastream/RealtimeOutgoingVideoSource.h: Moved from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.h. Ditto
1606         * platform/mediastream/mac/RealtimeIncomingVideoSourceMac.cpp: Added, it adds the Cocoa specific parts from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.cpp.
1607         (WebCore::RealtimeIncomingVideoSource::create): Moved this function from the base class, it allows avoiding the include.
1608         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h: Added, cocoa dependent code from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h.
1609         (WebCore::RealtimeOutgoingVideoSource::create): Moved this funtion from the base class, now we can use the Cocoa create without including it in the base class.
1610         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: Added, cocoa dependent code.
1611         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h: Added, cocoa dependent code.
1612
1613 2017-10-16  Manuel Rego Casasnovas  <rego@igalia.com>
1614
1615         Don't use intrinsic width if our container's width is zero
1616         https://bugs.webkit.org/show_bug.cgi?id=178073
1617
1618         Reviewed by Sergio Villar Senin.
1619
1620         Based on Blink r173212 by <robhogan@gmail.com>.
1621         https://chromium.googlesource.com/chromium/src/+/1592e8a1e8e56dfa6e5d709c50b129ae659c2fad
1622
1623         Since at least r798 we use a replaced element's intrinsic width
1624         if its containing block has a width of zero. As a result our rendering
1625         of width100percent-image.html has disagreed with all other browsers
1626         and we display replaced elements when they should be invisible.
1627
1628         Test: fast/replaced/container-width-zero.html
1629
1630         * rendering/RenderBox.cpp:
1631         (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
1632         If our container has zero width then let our width be zero too.
1633
1634 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
1635
1636         On ToT, event.dataTransfer.getData("text/uri-list") returns an empty string when dragging an image
1637         https://bugs.webkit.org/show_bug.cgi?id=178301
1638         <rdar://problem/34990050>
1639
1640         Reviewed by Darin Adler.
1641
1642         After r222656, we consider images on the pasteboard to be files. This causes DataTransfer.getData to return the
1643         empty string for all types, which brings back https://bugs.webkit.org/show_bug.cgi?id=170637. To allow pages to
1644         access the URL part of a dragged image, we exempt "text/uri-list" from our heurstics to hide pasteboard data
1645         which may contain files, and return the URL as long as its protocol is either HTTP or HTTPS.
1646
1647         Tweaked an existing layout test to cover this scenario, as well as the scenario in which the dragged image links
1648         to a file URL (in which case we should avoid exposing the data).
1649
1650         Test: editing/pasteboard/drag-drop-href-as-url.html
1651               DataInteractionTests.DataTransferGetDataWhenDroppingImageWithHTTPURL
1652
1653         * dom/DataTransfer.cpp:
1654         (WebCore::DataTransfer::getDataForItem const):
1655
1656         When the pasteboard contains files, allow data for "text/uri-list" to be returned, as long as the URL string has
1657         a white-listed protocol (currently, this is just http and https).
1658
1659         (WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
1660         (WebCore::DataTransfer::setData):
1661         (WebCore::DataTransfer::types const):
1662
1663         When the pasteboard contains files, allow "text/uri-list" to be added, alongside the "Files" type, if it would
1664         have been exposed in the list of safe DOM types.
1665
1666         * dom/DataTransfer.h:
1667         * platform/Pasteboard.cpp:
1668         (WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles):
1669
1670         Add a new helper method to determine whether it is safe to expose an URL string as "text/uri-list" to bindings,
1671         if the pasteboard contains files. While this currently checks whether or not the URL is in the HTTP family, we
1672         may want to consider tweaking this to blacklist the "file" protocol instead, and allow all other valid URLs by
1673         default.
1674
1675         * platform/Pasteboard.h:
1676         * platform/PlatformPasteboard.h:
1677         * platform/ios/PlatformPasteboardIOS.mm:
1678         (WebCore::pasteboardMayContainFilePaths):
1679         (WebCore::PlatformPasteboard::stringForType const):
1680
1681         Mark stringForType as const, and also teach stringForType to return the null string for the platform URL type if
1682         the pasteboard might contain file paths.
1683
1684         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
1685
1686         Before coercing a platform type to "text/uri-list" when building the list of DOM-safe types, check that the
1687         stringForType is not the empty string, in which case we don't expose the type to the DOM at all. This ensures
1688         that in cases where the URL might reveal a file path, we don't advertise "text/uri-list" as a type. We adopt a
1689         similar strategy on iOS.
1690
1691         (WebCore::PlatformPasteboard::stringForType): Deleted.
1692         * platform/mac/PlatformPasteboardMac.mm:
1693         (WebCore::pasteboardMayContainFilePaths):
1694         (WebCore::PlatformPasteboard::stringForType const):
1695         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
1696         (WebCore::PlatformPasteboard::stringForType): Deleted.
1697
1698 2017-10-16  Frederic Wang  <fwang@igalia.com>
1699
1700         Use auto/nullptr in scrolling code
1701         https://bugs.webkit.org/show_bug.cgi?id=178306
1702
1703         Reviewed by Carlos Garcia Campos.
1704
1705         This patch modifies the scrolling code to use the auto keyword when
1706         possible. It also replaces '0' with 'nullptr' for the return value of
1707         ScrollingStateTree::stateNodeForID.
1708
1709         No new tests, behavior unchanged.
1710
1711         * page/scrolling/AsyncScrollingCoordinator.cpp:
1712         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1713         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
1714         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
1715         (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
1716         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
1717         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1718         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
1719         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
1720         (WebCore::AsyncScrollingCoordinator::updateNodeLayer):
1721         (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints):
1722         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
1723         (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition):
1724         (WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
1725         * page/scrolling/ScrollingCoordinator.cpp:
1726         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView const):
1727         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
1728         (WebCore::ScrollingCoordinator::scrollLayerForFrameView):
1729         (WebCore::ScrollingCoordinator::headerLayerForFrameView):
1730         (WebCore::ScrollingCoordinator::footerLayerForFrameView):
1731         (WebCore::ScrollingCoordinator::counterScrollingLayerForFrameView):
1732         (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
1733         (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
1734         (WebCore::ScrollingCoordinator::rootContentLayerForFrameView):
1735         (WebCore::ScrollingCoordinator::handleWheelEventPhase):
1736         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects const):
1737         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasonsForAllFrames):
1738         (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText const):
1739         * page/scrolling/ScrollingStateFixedNode.cpp:
1740         (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
1741         * page/scrolling/ScrollingStateStickyNode.cpp:
1742         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
1743         * page/scrolling/ScrollingStateTree.cpp:
1744         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
1745         (WebCore::ScrollingStateTree::attachNode):
1746         (WebCore::ScrollingStateTree::detachNode):
1747         (WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
1748         (WebCore::ScrollingStateTree::stateNodeForID const):
1749         * page/scrolling/ScrollingTree.cpp:
1750         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
1751         (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
1752         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
1753         (WebCore::ScrollingTree::commitTreeState):
1754         (WebCore::ScrollingTree::updateTreeFromStateNode):
1755         * page/scrolling/ScrollingTreeNode.cpp:
1756         (WebCore::ScrollingTreeNode::enclosingFrameNode const):
1757         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
1758         (WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree):
1759         (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeLayer):
1760         (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints):
1761         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange):
1762         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
1763
1764 2017-10-16  Fujii Hironori  <Hironori.Fujii@sony.com>
1765
1766         A lot of "Can't stat WebCore/animation: No such file or directory" since r223328
1767         https://bugs.webkit.org/show_bug.cgi?id=178326
1768
1769         Unreviewed build fix
1770
1771         The directory WebCore/animation was removed in r223328.
1772
1773         No new tests because there is no behavior change.
1774
1775         * CMakeLists.txt: Removed animation from
1776         WebCore_INCLUDE_DIRECTORIES and WebCore_IDL_INCLUDES.
1777         * DerivedSources.make: Removed animation from VPATH and IDL_INCLUDES
1778
1779 2017-10-16  Frederic Wang  <fwang@igalia.com>
1780
1781         Replace some ScrollingTreeNode::nodeType() calls with is*Node()
1782         https://bugs.webkit.org/show_bug.cgi?id=178259
1783
1784         Reviewed by Darin Adler.
1785
1786         No new tests, behavior unchanged.
1787
1788         * page/scrolling/AsyncScrollingCoordinator.cpp:
1789         (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
1790         * page/scrolling/ScrollingStateNode.h:
1791         (WebCore::ScrollingStateNode::isScrollingNode const):
1792         * page/scrolling/ScrollingTree.cpp:
1793         (WebCore::ScrollingTree::updateTreeFromStateNode):
1794         * page/scrolling/ScrollingTreeNode.cpp:
1795         (WebCore::ScrollingTreeNode::enclosingFrameNode const):
1796         * page/scrolling/ScrollingTreeNode.h:
1797         (WebCore::ScrollingTreeNode::isScrollingNode const):
1798
1799 2017-10-16  Tomas Popela  <tpopela@redhat.com>
1800
1801         DataTransfer.cpp triggers -Wunused-but-set-variable
1802         https://bugs.webkit.org/show_bug.cgi?id=178209
1803
1804         Reviewed by Wenson Hsieh.
1805
1806         Use the ASSERT_UNUSED to silence it.
1807
1808         * dom/DataTransfer.cpp:
1809         (WebCore::DataTransfer::filesFromPasteboardAndItemList const):
1810
1811 2017-10-15  Sam Weinig  <sam@webkit.org>
1812
1813         [Settings] Split non-macro generated parts of Settings into SettingsBase base class
1814         https://bugs.webkit.org/show_bug.cgi?id=178321
1815
1816         Reviewed by Darin Adler.
1817
1818         Working towards getting generated Settings working again, but in smaller patches, split
1819         non-generated part off into SettingsBase as a first step.
1820         
1821         One function, effectiveFrameFlattening(), needs to remain in Settings for now, as it directly
1822         references a macro generated function, frameFlattening().
1823
1824         * CMakeLists.txt:
1825         * WebCore.xcodeproj/project.pbxproj:
1826         * page/Page.h:
1827         * page/Settings.cpp:
1828         * page/Settings.h:
1829         * page/SettingsBase.h: Copied from Source/WebCore/page/Settings.h.
1830         * page/cocoa/SettingsBaseCocoa.mm: Copied from Source/WebCore/page/cocoa/SettingsCocoa.mm.
1831         * page/cocoa/SettingsCocoa.mm: Removed.
1832
1833 2017-10-15  Yusuke Suzuki  <utatane.tea@gmail.com>
1834
1835         [JSC] Perform module specifier validation at parsing time
1836         https://bugs.webkit.org/show_bug.cgi?id=178256
1837
1838         Reviewed by Darin Adler.
1839
1840         No behavior change in the current implementation.
1841
1842         * bindings/js/JSDOMWindowBase.cpp:
1843         (WebCore::JSDOMWindowBase::moduleLoaderResolve):
1844         * bindings/js/JSDOMWindowBase.h:
1845         * bindings/js/ScriptModuleLoader.cpp:
1846         (WebCore::ScriptModuleLoader::resolve):
1847         * bindings/js/ScriptModuleLoader.h:
1848
1849 2017-10-15  Chris Dumez  <cdumez@apple.com>
1850
1851         DOMTokenList shouldn't add empty attributes
1852         https://bugs.webkit.org/show_bug.cgi?id=178280
1853         <rdar://problem/34987431>
1854
1855         Reviewed by Ryosuke Niwa.
1856
1857         Follow-up to r223306, reverse the check conditions to avoid attribute
1858         lookup when possible. Also use m_tokens instead of tokens() to avoid
1859         unnecessary branch.
1860
1861         * html/DOMTokenList.cpp:
1862         (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
1863
1864 2017-10-15  Darin Adler  <darin@apple.com>
1865
1866         UTF-8 decoding produces one replacement character per byte; Encoding standard requires one replacement character per illegal sequence instead
1867         https://bugs.webkit.org/show_bug.cgi?id=178207
1868
1869         Reviewed by Sam Weinig.
1870
1871         * platform/text/TextCodecUTF8.cpp:
1872         (WebCore::TextCodecUTF8::create): Deleted. Use a lambda instead.
1873         (WebCore::TextCodecUTF8::registerCodecs): Use a lambda.
1874         (WebCore::nonASCIISequenceLength): Changed to return 0 instead of 2 for the range 80-C1 since
1875         none of those are valid sequence leading characters.
1876         (WebCore::decodeNonASCIISequence): Changed the length argument to be in/out so the caller
1877         knows how much of the sequence we decoded for failure cases. Simplified the length 2 section.
1878         (WebCore::TextCodecUTF8::handleError): Deleted.
1879         (WebCore::TextCodecUTF8::handlePartialSequence): Changed this into a pair of plain functions
1880         rather than two template function specializations since the two functions are rather different.
1881         For the one-byte version, got rid of the unused arguments. For the two-byte version, got rid
1882         of the ignored return value, stopped using the handleError function since each error case
1883         needs to be handled differently. In each error case consume the entire incorrect sequence
1884         instead of just one byte.
1885         (WebCore::TextCodecUTF8::decode): Updated for the above change, and changed the non-partial
1886         incorrect sequence to consume the entire incorrect sequence instead of just one byte. Also
1887         use WTF prefixes explicitly so we don't  have to do "using namespace".
1888         (WebCore::TextCodecUTF8::encode): Got rid of unneeded type punning, and added some inline
1889         capacity to save one memory allocation when encoding shorter strings.
1890
1891         * platform/text/TextCodecUTF8.h: Use pragma once. Intialize m_partialSequenceSize where it
1892         is defined and let the compiler generate the constructor. Updated for the changes above.
1893
1894         * platform/text/TextEncoding.h: Export a constructor now used by a unit test.
1895         * platform/text/TextEncodingRegistry.h: Export newTextCodec, now used by a unit test.
1896
1897 2017-10-14  Antoine Quint  <graouts@apple.com>
1898
1899         Remove all Web Animations code
1900         https://bugs.webkit.org/show_bug.cgi?id=178273
1901
1902         Reviewed by Sam Weinig.
1903
1904         We remove all existing code related to Web Animations which does not include any functionality,
1905         only stubs. This leaves the build and runtime flags, we'll start a complete implementation from
1906         scratch.
1907
1908         * CMakeLists.txt:
1909         * DerivedSources.make:
1910         * WebCore.xcodeproj/project.pbxproj:
1911         * animation/Animatable.idl: Removed.
1912         * animation/AnimationEffect.cpp: Removed.
1913         * animation/AnimationEffect.h: Removed.
1914         * animation/AnimationEffect.idl: Removed.
1915         * animation/AnimationTimeline.cpp: Removed.
1916         * animation/AnimationTimeline.h: Removed.
1917         * animation/AnimationTimeline.idl: Removed.
1918         * animation/DocumentAnimation.cpp: Removed.
1919         * animation/DocumentAnimation.h: Removed.
1920         * animation/DocumentAnimation.idl: Removed.
1921         * animation/DocumentTimeline.cpp: Removed.
1922         * animation/DocumentTimeline.h: Removed.
1923         * animation/DocumentTimeline.idl: Removed.
1924         * animation/KeyframeEffect.cpp: Removed.
1925         * animation/KeyframeEffect.h: Removed.
1926         * animation/KeyframeEffect.idl: Removed.
1927         * animation/WebAnimation.cpp: Removed.
1928         * animation/WebAnimation.h: Removed.
1929         * animation/WebAnimation.idl: Removed.
1930         * bindings/js/JSAnimationTimelineCustom.cpp: Removed.
1931         * bindings/js/JSBindingsAllInOne.cpp:
1932         * bindings/js/WebCoreBuiltinNames.h:
1933         * dom/Element.cpp:
1934         (WebCore::Element::getAnimations): Deleted.
1935         * dom/Element.h:
1936         * dom/Element.idl:
1937
1938 2017-10-14  Devin Rousso  <webkit@devinrousso.com>
1939
1940         Web Inspector: provide a way to enable/disable event listeners
1941         https://bugs.webkit.org/show_bug.cgi?id=177451
1942
1943         Reviewed by Joseph Pecoraro.
1944
1945         Test: inspector/dom/setEventListenerDisabled.html
1946
1947         * dom/EventTarget.cpp:
1948         (WebCore::EventTarget::fireEventListeners):
1949         Add InspectorInstrumentation call to isEventListenerDisabled. If true, the event listener's
1950         callback will not be called.
1951
1952         * inspector/InspectorDOMAgent.h:
1953         * inspector/InspectorDOMAgent.cpp:
1954         (WebCore::InspectorDOMAgent::discardBindings):
1955         (WebCore::InspectorDOMAgent::getEventListenersForNode):
1956         (WebCore::InspectorDOMAgent::setEventListenerDisabled):
1957         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1958         (WebCore::InspectorDOMAgent::willRemoveEventListener):
1959         (WebCore::InspectorDOMAgent::isEventListenerDisabled):
1960         Introduce a mapping of `EventListener*` to `InspectorEventListener`, a struct for uniquely
1961         identifying event listeners so they can be referenced from the frontend. We only add items
1962         to this mapping when `getEventListenersForNode` is called, as that is when EventListener
1963         data is sent to the frontend. This allows us to defer creating an Inspector "mirror" object
1964         for each EventListener until it is needed. Items are removed whenever an event listener is
1965         removed or when the document changes.
1966
1967         * inspector/InspectorInstrumentation.h:
1968         (WebCore::InspectorInstrumentation::isEventListenerDisabled):
1969         * inspector/InspectorInstrumentation.cpp:
1970         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
1971         (WebCore::InspectorInstrumentation::isEventListenerDisabledImpl):
1972         Pass additional parameters to InspectorDOMAgent so it can determine if the event listener
1973         actually exists. If not, don't dispatch an event to the frontend as nothing will change.
1974
1975 2017-10-14  Sam Weinig  <sam@webkit.org>
1976
1977         Remove HashCountedSet's copyToVector functions
1978         https://bugs.webkit.org/show_bug.cgi?id=178215
1979
1980         Reviewed by Daniel Bates.
1981
1982         * page/DeviceController.cpp:
1983         (WebCore::DeviceController::dispatchDeviceEvent):
1984         (WebCore::DeviceController::fireDeviceEvent):
1985         
1986             Replace use of HashCountedSet's copyToVector functions with copyToVector(hashCountedSet.values()).
1987
1988 2017-10-13  Jer Noble  <jer.noble@apple.com>
1989
1990         Performance: Skip texture upload if source image and destination texture haven't changed
1991         https://bugs.webkit.org/show_bug.cgi?id=178254
1992         <rdar://problem/34968181>
1993
1994         Reviewed by Dean Jackson.
1995
1996         Update GraphicsContext3D to track which texture is bound to which texture unit, and also to
1997         track when those bound textures have their backing stores modified. This new "seed" value
1998         will be used to determine whether a given texture which has previously had image data
1999         uploaded to it needs to be re-updated.
2000
2001         In VideoTextureCopierCV, track whether the texture's seed changed, whether the IOSurface is
2002         the same,  whether the IOSurface's seed has changed, and whether the "flipY" parameter
2003         changed since the last time the copier was asked to upload to the texture.
2004
2005         * platform/graphics/GraphicsContext3D.h:
2006         (WebCore::GraphicsContext3D::textureSeed):
2007         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture):
2008         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture):
2009         (WebCore::GraphicsContext3D::GraphicsContext3DState::setBoundTexture):
2010         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2011         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
2012         * platform/graphics/cv/VideoTextureCopierCV.h:
2013         (WebCore::VideoTextureCopierCV::lastTextureSeed):
2014         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2015         (WebCore::GraphicsContext3D::prepareTexture):
2016         (WebCore::GraphicsContext3D::bindTexture):
2017         (WebCore::GraphicsContext3D::texStorage2D):
2018         (WebCore::GraphicsContext3D::texStorage3D):
2019         (WebCore::GraphicsContext3D::framebufferTexture2D):
2020         (WebCore::GraphicsContext3D::texSubImage2D):
2021         (WebCore::GraphicsContext3D::compressedTexImage2D):
2022         (WebCore::GraphicsContext3D::compressedTexSubImage2D):
2023         (WebCore::GraphicsContext3D::createTexture):
2024         (WebCore::GraphicsContext3D::deleteTexture):
2025         (WebCore::GraphicsContext3D::texImage2DDirect):
2026
2027 2017-10-13  Per Arne Vollan  <pvollan@apple.com>
2028
2029         [Win] When built with VS2017, MiniBrowser crashes on startup.
2030         https://bugs.webkit.org/show_bug.cgi?id=175209
2031
2032         Reviewed by Daniel Bates.
2033
2034         Generated StaticStringImpl objects are not initialized compile-time with VS2017.
2035         When compiling with VS2017, the global, static, StaticStringImpl objects needs to
2036         be defined with the constexpr specifier, in order for the objects to be initialized
2037         at compile time. Since the StaticStringImpl objects will be const then, we need to
2038         be able to create an AtomicString object from a const StaticStringImpl object. 
2039         This constructor has been added to the AtomicString class.
2040
2041         No new tests, covered by existing tests. 
2042
2043         * bindings/scripts/StaticString.pm:
2044         (GenerateStrings):
2045         (GenerateStringAsserts):
2046         * dom/QualifiedName.cpp:
2047         (WebCore::createQualifiedName):
2048         * dom/QualifiedName.h:
2049         * dom/make_names.pl:
2050         (printDefinitions):
2051
2052 2017-10-13  Brent Fulgham  <bfulgham@apple.com>
2053
2054         Protect FrameView during style calculations
2055         https://bugs.webkit.org/show_bug.cgi?id=178300
2056         <rdar://problem/34869329>
2057
2058         Reviewed by Ryosuke Niwa.
2059
2060         Protect the FrameView during layout and style updates in case arbitrary script
2061         is run that might clear it.
2062
2063         Test: fast/html/marquee-reparent-check.html
2064
2065         * page/FrameView.cpp:
2066         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
2067
2068 2017-10-13  Per Arne Vollan  <pvollan@apple.com>
2069
2070         Crash under ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData
2071         https://bugs.webkit.org/show_bug.cgi?id=178279
2072
2073         Reviewed by Alex Christensen.
2074
2075         Check if the connection is valid before calling ResourceHandleClient::didSendData.
2076
2077         No new tests, covered by existing tests.
2078
2079         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2080         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
2081
2082 2017-10-13  Brent Fulgham  <bfulgham@apple.com>
2083
2084         CMD+R / CMD+Q keyboard shortcuts are treated as user interaction with page
2085         https://bugs.webkit.org/show_bug.cgi?id=178183
2086         <rdar://problem/33327730>
2087
2088         Reviewed by Ryosuke Niwa.
2089
2090         Key events are granted user interaction credit (in terms of updating the last time of user
2091         interaction), even if the key event was not handled. Instead, we should defer granting
2092         access until the key event has been handled.
2093         
2094         Add a new default constructor argument to UserGestureIndicator to be used when handling key
2095         events, so we can delay a decision about whether to grant ResourceLoadStatistics
2096         'hasHadUserInteraction' until we confirm that the event was handled by the page.
2097
2098         This change does not affect other aspects of user interaction.
2099
2100         Tests: fast/events
2101                http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html
2102                http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown.html
2103
2104         * dom/UserGestureIndicator.cpp:
2105         (WebCore::UserGestureIndicator::UserGestureIndicator): Add check based on constructor argument.
2106         Also: Drive by fix to avoid calling 'currentToken' when not on the main thread.
2107         * dom/UserGestureIndicator.h:
2108         * page/EventHandler.cpp:
2109         (WebCore::EventHandler::keyEvent): If the key event was handled, grant user interaction credit
2110         for ResourceLoadStatistics processing.
2111         (WebCore::EventHandler::internalKeyEvent): Use the new UserGestureIndicator constructor argument.
2112
2113 2017-10-13  Chris Dumez  <cdumez@apple.com>
2114
2115         DOMTokenList shouldn't add empty attributes
2116         https://bugs.webkit.org/show_bug.cgi?id=178280
2117
2118         Reviewed by Ryosuke Niwa.
2119
2120         DOMTokenList shouldn't add empty attributes after:
2121         - https://github.com/whatwg/dom/pull/488
2122
2123         Firefox and Chrome follow the latest spec.
2124
2125         No new tests, updating existing test.
2126
2127         * html/DOMTokenList.cpp:
2128         (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
2129         Implement the first step of https://dom.spec.whatwg.org/#concept-dtl-update
2130
2131 2017-10-13  Jer Noble  <jer.noble@apple.com>
2132
2133         Unreviewed build fix; wrap more functions in USE(IOSURFACE) so that
2134         they do not generate "unused function" errors.
2135
2136         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2137
2138 2017-10-13  Jer Noble  <jer.noble@apple.com>
2139
2140         One last unreviewed build fix; since the IOSurface APIs don't exist at
2141         all on the simulator, just wrap the entirety of the implementation of
2142         copyImageToPlatformTexture() in a #if USE(IOSURFACE) check.
2143
2144         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2145         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
2146
2147 2017-10-13  Jer Noble  <jer.noble@apple.com>
2148
2149         Unreviewed build fix for the previous build fix; use the right PAL path for IOSurfaceSPI.h.
2150
2151         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2152
2153 2017-10-13  Jer Noble  <jer.noble@apple.com>
2154
2155         Unreviewed build fix; add definitions for IOSurface methods missing on some platforms.
2156
2157         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2158
2159 2017-10-13  Alex Christensen  <achristensen@webkit.org>
2160
2161         Remove Editor::simplifyMarkup
2162         https://bugs.webkit.org/show_bug.cgi?id=178271
2163
2164         Reviewed by Wenson Hsieh.
2165
2166         An API test became flaky, and it turns out this isn't used anywhere, so let's remove it!
2167         It was used in Mountain Lion, Mavericks, and Yosemite, but not since then.
2168         See <rdar://problem/10726177>
2169
2170         * editing/Editor.cpp:
2171         (WebCore::Editor::simplifyMarkup): Deleted.
2172         * editing/Editor.h:
2173
2174 2017-10-13  Jer Noble  <jer.noble@apple.com>
2175
2176         Unreviewed build fix; forward declare the type of IOSurfaceRef.
2177
2178         * platform/cocoa/CoreVideoSoftLink.cpp:
2179         * platform/cocoa/CoreVideoSoftLink.h:
2180
2181 2017-10-13  Jer Noble  <jer.noble@apple.com>
2182
2183         Unreviewed build fix; add soft link macros for newly called CoreVideo methods.
2184
2185         * platform/cocoa/CoreVideoSoftLink.cpp:
2186         * platform/cocoa/CoreVideoSoftLink.h:
2187
2188 2017-10-13  Jer Noble  <jer.noble@apple.com>
2189
2190         Unreviewed build fix; add UNUSED_PARAM macros.
2191
2192         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2193         (WebCore::GraphicsContext3D::texImageIOSurface2D):
2194
2195 2017-10-13  Jer Noble  <jer.noble@apple.com>
2196
2197         Performance: do pixel conformance and texturing in a single step.
2198         https://bugs.webkit.org/show_bug.cgi?id=178219
2199         <rdar://problem/34937237>
2200
2201         Reviewed by Dean Jackson.
2202
2203         No new tests; performance improvements should have no behavior change.
2204
2205         Rather than asking the VTDecompressionSession to conform the output CVPixelBuffer into a
2206         pixel format compatible with OpenGL (& ES), don't constrain the output at all, and only do a
2207         conformance step if the output is not already compatible with OpenGL. This eliminates one
2208         copy (in hardware) operation.
2209
2210         Move the TextureCacheCV object into VideoTextureCopierCV; it will be conditionally used to
2211         create the texture if the pixel buffer is compatible.
2212
2213         Refactor copyVideoTextureToPlatformTexture(CVOpenGLTextureRef) in VideoTextureCopierCV. The
2214         new entry point, copyImageToPlatformTexture(), will attempt to use the texture cache first,
2215         and call a new common copyVideoTextureToPlatformTexture(Platform3DObject) with the result.
2216
2217         The new copyImageToPlatformTexture() will pull planar YUV frames into two textures, and combine
2218         the two with a color transfer function when drawing to the output texture.
2219
2220         * platform/graphics/GraphicsContext3D.h:
2221         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2222         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture):
2223         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2224         (WebCore::GraphicsContext3D::texImageIOSurface2D):
2225         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2226         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
2227         * platform/graphics/cv/TextureCacheCV.h:
2228         * platform/graphics/cv/TextureCacheCV.mm:
2229         (WebCore::TextureCacheCV::textureFromImage):
2230         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2231         (WebCore::pixelRangeFromPixelFormat):
2232         (WebCore::transferFunctionFromString):
2233         (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
2234         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV):
2235         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
2236         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
2237         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
2238         * platform/graphics/cv/VideoTextureCopierCV.h:
2239
2240 2017-10-13  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2241
2242         [Readable Streams API] Align queue with spec for ReadableStreamDefaultController
2243         https://bugs.webkit.org/show_bug.cgi?id=178082
2244
2245         Reviewed by Xabier Rodriguez-Calvar.
2246
2247         Implemented new queue behavior for dequeueValue (used by ReadableStreamDefaultController),
2248         which fixes rounding errors (as described in https://github.com/whatwg/streams/pull/661).
2249         Also aligned ReadableByteStreamController queue so that both queues are implemented in
2250         the same way.
2251
2252         No new tests (covered by existing tests, especially WPT tests that now pass).
2253
2254         * Modules/streams/ReadableByteStreamInternals.js:
2255         (privateInitializeReadableByteStreamController): Aligned queue with RSDC.
2256         (readableByteStreamControllerCancel): Aligned queue with RSDC.
2257         (readableByteStreamControllerError): Aligned queue with RSDC.
2258         (readableByteStreamControllerClose): Aligned queue with RSDC.
2259         (readableByteStreamControllerHandleQueueDrain): Aligned queue with RSDC.
2260         (readableByteStreamControllerPull): Aligned queue with RSDC.
2261         (readableByteStreamControllerEnqueue): Aligned queue with RSDC.
2262         (readableByteStreamControllerEnqueueChunk): Aligned queue with RSDC.
2263         (readableByteStreamControllerProcessPullDescriptors): Aligned queue with RSDC.
2264         (readableByteStreamControllerFillDescriptorFromQueue): Aligned queue with RSDC.
2265         (readableByteStreamControllerPullInto): Aligned queue with RSDC.
2266         * Modules/streams/StreamInternals.js:
2267         (dequeueValue): Updated to match spec.
2268         * bindings/js/WebCoreBuiltinNames.h: Removed now useless "totalQueuedBytes".
2269
2270 2017-10-13  Wenson Hsieh  <wenson_hsieh@apple.com>
2271
2272         "text/html" data is not exposed when dragging and dropping across origins
2273         https://bugs.webkit.org/show_bug.cgi?id=178253
2274         <rdar://problem/34971203>
2275
2276         Reviewed by Ryosuke Niwa.
2277
2278         Minor tweak to DataTransfer::setDataFromItemList to allow "text/html" written from bindings to transfer across
2279         origins without requiring a sanitized representation. Currently, sanitizedData is null, which limits "text/html"
2280         to being treated as custom data, inaccessible across origins. We should instead treat markup supplied via
2281         bindings the same way as we do "text/plain" supplied via bindings.
2282
2283         Modified Tests: editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin.html
2284                         editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin.html
2285
2286         * dom/DataTransfer.cpp:
2287         (WebCore::DataTransfer::setDataFromItemList):
2288
2289 2017-10-12  Brady Eidson  <beidson@apple.com>
2290
2291         SW "Hello world".
2292         https://bugs.webkit.org/show_bug.cgi?id=178187
2293
2294         Reviewed by Andy Estes.
2295
2296         No new tests (Covered by changes to existing tests).
2297
2298         With this patch, SW scripts are actually compiled and run inside a ServiceWorkerGlobalScope environment
2299         in the SW context process.
2300
2301         * WebCore.xcodeproj/project.pbxproj:
2302
2303         * bindings/js/WorkerScriptController.cpp:
2304         (WebCore::WorkerScriptController::initScript):
2305
2306         * dom/EventTargetFactory.in:
2307
2308         * workers/WorkerGlobalScope.h:
2309         (WebCore::WorkerGlobalScope::isServiceWorkerGlobalScope const):
2310
2311         * workers/service/ServiceWorkerContextData.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
2312         (WebCore::ServiceWorkerContextData::isolatedCopy const):
2313         * workers/service/ServiceWorkerContextData.h:
2314         (WebCore::ServiceWorkerContextData::encode const):
2315         (WebCore::ServiceWorkerContextData::decode):
2316
2317         * workers/service/ServiceWorkerGlobalScope.cpp:
2318         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
2319         (WebCore::ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope):
2320         (WebCore::ServiceWorkerGlobalScope::registration):
2321         (WebCore::ServiceWorkerGlobalScope::eventTargetInterface const):
2322         * workers/service/ServiceWorkerGlobalScope.h:
2323         (WebCore::ServiceWorkerGlobalScope::create):
2324         (WebCore::ServiceWorkerGlobalScope::serverConnectionIdentifier const):
2325
2326         * workers/service/context/SWContextManager.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
2327         (WebCore::SWContextManager::singleton):
2328         (WebCore::SWContextManager::SWContextManager):
2329         (WebCore::SWContextManager::startServiceWorkerContext):
2330         * workers/service/context/SWContextManager.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
2331
2332         * workers/service/context/ServiceWorkerThread.cpp: Added.
2333         (WebCore::ServiceWorkerThreadProxy::sharedDummyProxy):
2334         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
2335         (WebCore::m_workerObjectProxy):
2336         (WebCore::ServiceWorkerThread::~ServiceWorkerThread):
2337         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
2338         (WebCore::ServiceWorkerThread::runEventLoop):
2339         * workers/service/context/ServiceWorkerThread.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
2340         (WebCore::ServiceWorkerThread::create):
2341         (WebCore::ServiceWorkerThread::workerObjectProxy const):
2342
2343         * workers/service/server/SWServer.cpp:
2344         (WebCore::SWServer::createWorker):
2345
2346 2017-10-12  Alex Christensen  <achristensen@webkit.org>
2347
2348         Use asynchronous ResourceHandleClient calls for WebKit1
2349         https://bugs.webkit.org/show_bug.cgi?id=160677
2350
2351         Reviewed by Brady Eidson.
2352
2353         Covered by existing tests.
2354
2355         * PlatformAppleWin.cmake:
2356         * PlatformMac.cmake:
2357         * WebCore.xcodeproj/project.pbxproj:
2358         * loader/ResourceLoader.cpp:
2359         (WebCore::ResourceLoader::willSendRequestAsync):
2360         (WebCore::ResourceLoader::didReceiveResponseAsync):
2361         (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
2362         * loader/ResourceLoader.h:
2363         * loader/appcache/ApplicationCacheGroup.cpp:
2364         (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
2365         (WebCore::ApplicationCacheGroup::willSendRequestAsync):
2366         (WebCore::ApplicationCacheGroup::canAuthenticateAgainstProtectionSpaceAsync):
2367         (WebCore::ApplicationCacheGroup::didReceiveResponse): Deleted.
2368         * loader/appcache/ApplicationCacheGroup.h:
2369         * platform/network/BlobResourceHandle.cpp:
2370         (WebCore::BlobResourceHandle::continueDidReceiveResponse):
2371         (WebCore::BlobResourceHandle::getSizeForNext):
2372         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
2373         (WebCore::BlobResourceHandle::notifyResponseOnError):
2374         * platform/network/PingHandle.h:
2375         * platform/network/ResourceHandle.cpp:
2376         (WebCore::ResourceHandle::didReceiveResponse):
2377         (WebCore::ResourceHandle::usesAsyncCallbacks): Deleted.
2378         * platform/network/ResourceHandle.h:
2379         * platform/network/ResourceHandleClient.cpp:
2380         (WebCore::ResourceHandleClient::~ResourceHandleClient):
2381         (WebCore::ResourceHandleClient::willSendRequest): Deleted.
2382         (WebCore::ResourceHandleClient::willSendRequestAsync): Deleted.
2383         (WebCore::ResourceHandleClient::didReceiveResponseAsync): Deleted.
2384         (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
2385         * platform/network/ResourceHandleClient.h:
2386         (WebCore::ResourceHandleClient::didReceiveAuthenticationChallenge):
2387         (WebCore::ResourceHandleClient::didReceiveResponse): Deleted.
2388         (WebCore::ResourceHandleClient::usesAsyncCallbacks): Deleted.
2389         (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpace): Deleted.
2390         * platform/network/ResourceHandleInternal.h:
2391         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2392         * platform/network/SynchronousLoaderClient.cpp:
2393         (WebCore::SynchronousLoaderClient::willSendRequestAsync):
2394         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
2395         (WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
2396         (WebCore::SynchronousLoaderClient::didFinishLoading):
2397         (WebCore::SynchronousLoaderClient::didFail):
2398         (WebCore::SynchronousLoaderClient::willSendRequest): Deleted.
2399         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace): Deleted.
2400         (WebCore::SynchronousLoaderClient::didReceiveResponse): Deleted.
2401         * platform/network/SynchronousLoaderClient.h:
2402         * platform/network/cf/ResourceHandleCFNet.cpp:
2403         (WebCore::ResourceHandle::createCFURLConnection):
2404         (WebCore::ResourceHandle::start):
2405         (WebCore::ResourceHandle::willSendRequest):
2406         (WebCore::ResourceHandle::shouldUseCredentialStorage):
2407         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
2408         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
2409         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2410         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::ResourceHandleCFURLConnectionDelegateWithOperationQueue):
2411         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):
2412         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
2413         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
2414         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
2415         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
2416         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
2417         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
2418         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
2419         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
2420         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::shouldUseCredentialStorage):
2421         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
2422         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueCanAuthenticateAgainstProtectionSpace):
2423         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
2424         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Removed.
2425         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: Removed.
2426         * platform/network/mac/ResourceHandleMac.mm:
2427         (WebCore::ResourceHandle::start):
2428         (WebCore::ResourceHandle::schedule):
2429         (WebCore::ResourceHandle::makeDelegate):
2430         (WebCore::ResourceHandle::delegate):
2431         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
2432         (WebCore::ResourceHandle::willSendRequest):
2433         (WebCore::ResourceHandle::continueWillSendRequest):
2434         (WebCore::ResourceHandle::continueDidReceiveResponse):
2435         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
2436         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace):
2437         (WebCore::ResourceHandle::continueWillCacheResponse):
2438         (WebCore::ResourceHandle::shouldUseCredentialStorage): Deleted.
2439         * platform/network/mac/WebCoreResourceHandleAsDelegate.h: Removed.
2440         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Removed.
2441         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
2442         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2443         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
2444         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
2445         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
2446         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
2447         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
2448         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
2449         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
2450         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
2451
2452 2017-10-12  Chris Dumez  <cdumez@apple.com>
2453
2454         [Mac] Add support for MouseEvent.buttons
2455         https://bugs.webkit.org/show_bug.cgi?id=178214
2456
2457         Reviewed by Ryosuke Niwa.
2458
2459         Add support for MouseEvent.buttons on Mac as per:
2460         - https://www.w3.org/TR/uievents/#ref-for-dom-mouseevent-buttons-1
2461
2462         This is supported by Firefox and Chrome already.
2463
2464         No new tests, rebaselined existing test.
2465
2466         * dom/Element.cpp:
2467         (WebCore::Element::dispatchMouseEvent):
2468         * dom/MouseEvent.cpp:
2469         (WebCore::MouseEvent::create):
2470         (WebCore::MouseEvent::MouseEvent):
2471         * dom/MouseEvent.h:
2472         (WebCore::MouseEvent::buttons const):
2473         * dom/MouseEvent.idl:
2474         * dom/MouseEventInit.h:
2475         * dom/MouseEventInit.idl:
2476         * dom/SimulatedClick.cpp:
2477         * dom/WheelEvent.cpp:
2478         * page/EventHandler.cpp:
2479         (WebCore::EventHandler::dispatchDragEvent):
2480         * platform/PlatformMouseEvent.h:
2481         (WebCore::PlatformMouseEvent::buttons const):
2482         * platform/mac/PlatformEventFactoryMac.mm:
2483         (WebCore::currentlyPressedMouseButtons):
2484         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
2485
2486 2017-10-12  David Kilzer  <ddkilzer@apple.com>
2487
2488         [iOS] Fix -Wunused-lambda-capture warnings in WebCore/WebKit with new clang compiler
2489         <https://webkit.org/b/178226>
2490
2491         Reviewed by Chris Fleizach.
2492
2493         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2494         (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
2495         - Remove unused lambda variable 'self'.
2496
2497 2017-10-12  Daniel Bates  <dabates@apple.com>
2498
2499         Mark more InlineBox member functions as const
2500         https://bugs.webkit.org/show_bug.cgi?id=178217
2501
2502         Reviewed by Andy Estes.
2503
2504         * rendering/InlineBox.cpp:
2505         (WebCore::InlineBox::locationIncludingFlipping const): Mark as const. Also fix some style
2506         nits while I am here.
2507         (WebCore::InlineBox::flipForWritingMode const): Mark as const.
2508         (WebCore::InlineBox::locationIncludingFlipping): Deleted.
2509         (WebCore::InlineBox::flipForWritingMode): Deleted.
2510         * rendering/InlineBox.h:
2511
2512 2017-10-12  Daniel Bates  <dabates@apple.com>
2513
2514         Teach InlineTextBox::clampOffset() about combined text and hyphenation
2515         https://bugs.webkit.org/show_bug.cgi?id=178032
2516
2517         Reviewed by Zalan Bujtas.
2518
2519         Treat combined text and the last character of a word halve plus hyphen as single units.
2520
2521         With regards to combined text, ideally we would allow arbitrary selection inside combined
2522         text. Currently we do not support selection of combined text. To simplify the process of
2523         adding support for selecting combined text we treat combined text as a single unit. Once
2524         we are confident that we correctly implemented such support we can re-evaluate allowing
2525         arbitrary selection of combined text.
2526
2527         With regards to treating the last character of a word halve plus hyphen as a single unit.
2528         This patch extends the targeted fix made for document markers in r223013 to all code that
2529         makes use of clamped offsets as a result the selection rect for inline boxes more accurately
2530         reflect the rectangle(s) that make up the painted selection. This is a step towards reconciling
2531         the difference between the computation of the rectangle that represents an arbitrary
2532         selection and the code that paints the active selection as part of <https://bugs.webkit.org/show_bug.cgi?id=138913>.
2533
2534         * rendering/InlineTextBox.cpp:
2535         (WebCore::InlineTextBox::localSelectionRect const): Compute text run, including combined text
2536         or hyphens due to line wrapping now that specified start and end positions are clamped with
2537         respect to combined text and hyphens (computed earlier in this function). Only measure the
2538         text represented by the selection if the start position > 0 or the end position is not equal
2539         to the length of the run.
2540         (WebCore::InlineTextBox::paint): Remove unnecessary code to fix up the selection start and
2541         end positions based on the truncation offset as this is done by clampedOffset(), called by
2542         selectionStartEnd().
2543         (WebCore::InlineTextBox::clampedOffset const): Modified to adjust the clamped offset with
2544         respect to truncation as well as treat combined text or a trailing word halve plus hyphen
2545         as single units. Assert that we are not fully truncated because it does not make sense to
2546         be computing the clamped offset in such a situation since nothing should be painted.
2547         (WebCore::InlineTextBox::selectionStartEnd const): Modified to compute the end of an inside
2548         selection using clampedOffset() to account for truncation, combined text or a hyphen. We
2549         already are using clampedOffset() when computing the start and end position for all other
2550         selection states.
2551         (WebCore::InlineTextBox::paintSelection): Compute text run, including combined text
2552         or hyphens due to line wrapping now that specified start and end positions are clamped with
2553         respect to combined text and hyphens (computed earlier in this function). Remove unnecessary
2554         code to adjust selection end point with respect to truncation, combined text, or an added
2555         hyphen now that selectionStartEnd() takes care of this (via clampedOffset()).
2556         (WebCore::InlineTextBox::paintTextSubrangeBackground): Compute text run, including combined
2557         text or hyphens due to line wrapping now that specified start and end positions are clamped
2558         with respect to combined text and hyphens (computed earlier in this function).
2559         (WebCore::InlineTextBox::paintDocumentMarker): Compute text run, including combined text now
2560         that specified start and end positions are clamped with respect to combined text (computed earlier in this function).
2561         Also remove unnecessary code to adjust end offset of the marker with respect to truncation
2562         and length of the text run as clampedOffset() now does this for us.
2563
2564 2017-10-11  Simon Fraser  <simon.fraser@apple.com>
2565
2566         Don't assert if mix-blend-mode is set to a non-separable blend mode on a composited layer
2567         https://bugs.webkit.org/show_bug.cgi?id=178196
2568         rdar://problem/34942337
2569
2570         Reviewed by Dan Bates.
2571
2572         Core Animation doesn't support non-separable blend modes (hue, saturation, color, luminosity)
2573         on layers, but don't assert if we try to use them.
2574
2575         Test: compositing/filters/blend-mode-saturation.html
2576
2577         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
2578         (PlatformCAFilters::setBlendingFiltersOnLayer):
2579
2580 2017-10-12  John Wilander  <wilander@apple.com>
2581
2582         ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
2583         https://bugs.webkit.org/show_bug.cgi?id=175257
2584         <rdar://problem/33359866>
2585
2586         Reviewed by Brent Fulgham.
2587
2588         This patch was joint work between Michael Specter and John Wilander.
2589
2590         Tests: http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
2591                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
2592                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
2593                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
2594                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
2595                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
2596                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
2597                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
2598                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
2599                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
2600                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
2601                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
2602
2603         * loader/DocumentLoader.cpp:
2604         (WebCore::DocumentLoader::willSendRequest):
2605             Now sends redirectResponse.url() to WebCore::ResourceLoadObserver::logFrameNavigation().
2606         * loader/ResourceLoadObserver.cpp:
2607         (WebCore::ResourceLoadObserver::logFrameNavigation):
2608             Now receives the redirect response URL from WebCore::DocumentLoader().
2609         (WebCore::ResourceLoadObserver::nonNullOwnerURL const):
2610             New function to traverse the frame chain upward and find the first non-null URL.
2611         * loader/ResourceLoadObserver.h:
2612
2613 2017-10-12  Frederic Wang  <fwang@igalia.com>
2614
2615         Use less specific cast in ScrollingTree::scrollPositionChangedViaDelegatedScrolling
2616         https://bugs.webkit.org/show_bug.cgi?id=178211
2617
2618         Reviewed by Simon Fraser.
2619
2620         No new tests, behavior is not changed.
2621
2622         ScrollingTree::scrollPositionChangedViaDelegatedScrolling is a generic function that applies
2623         to scrolling nodes. Casting to more specific ScrollingTreeOverflowScrollingNodes is however
2624         not necessary to implement it. This patch moves to the least specific cast necessary so that
2625         this function will be usable for async scrolling of non-main frames in the future. Note that
2626         the function is currently only called from ScrollingTreeScrollingNodeDelegateIOS which in
2627         turn is only used by the ScrollingTreeScrollingOverflowNodeIOS class and so code behavior is
2628         not changed.
2629
2630         * page/scrolling/ScrollingTree.cpp:
2631         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Only cast the node to
2632         ScrollingTreeScrollingNode.
2633
2634 2017-10-11  Sam Weinig  <sam@webkit.org>
2635
2636         Remove out-parameter variants of copyToVector
2637         https://bugs.webkit.org/show_bug.cgi?id=178155
2638
2639         Reviewed by Tim Horton.
2640
2641         * Modules/geolocation/Geolocation.cpp:
2642         (WebCore::Geolocation::stopTimersForOneShots):
2643         (WebCore::Geolocation::cancelAllRequests):
2644         (WebCore::Geolocation::handleError):
2645         (WebCore::Geolocation::makeSuccessCallbacks):
2646         * Modules/indexeddb/IDBDatabase.cpp:
2647         (WebCore::IDBDatabase::transaction):
2648         * Modules/indexeddb/IDBGetAllResult.cpp:
2649         (WebCore::IDBGetAllResult::allBlobFilePaths const):
2650         * Modules/indexeddb/server/MemoryIndex.cpp:
2651         (WebCore::IDBServer::MemoryIndex::notifyCursorsOfValueChange):
2652         (WebCore::IDBServer::MemoryIndex::notifyCursorsOfAllRecordsChanged):
2653         * css/CSSFontSelector.cpp:
2654         (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
2655         * dom/Document.cpp:
2656         (WebCore::Document::moveNodeIteratorsToNewDocument):
2657         (WebCore::Document::resume):
2658         (WebCore::Document::didAssociateFormControlsTimerFired):
2659         * dom/IdTargetObserverRegistry.cpp:
2660         (WebCore::IdTargetObserverRegistry::notifyObserversInternal):
2661         * dom/MutationObserver.cpp:
2662         (WebCore::MutationObserver::notifyMutationObservers):
2663         * dom/Node.cpp:
2664         (WebCore::Document::invalidateNodeListAndCollectionCaches):
2665         * dom/RadioButtonGroups.cpp:
2666         * dom/ScriptExecutionContext.cpp:
2667         (WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
2668         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
2669         * loader/appcache/ApplicationCacheGroup.cpp:
2670         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
2671         (WebCore::ApplicationCacheGroup::deliverDelayedMainResources):
2672         * loader/cache/MemoryCache.cpp:
2673         (WebCore::MemoryCache::forEachResource):
2674         (WebCore::MemoryCache::pruneDeadResourcesToSize):
2675         * page/DOMWindow.cpp:
2676         (WebCore::DOMWindow::willDestroyCachedFrame):
2677         (WebCore::DOMWindow::willDestroyDocumentInFrame):
2678         (WebCore::DOMWindow::willDetachDocumentFromFrame):
2679         (WebCore::DOMWindow::disconnectDOMWindowProperties):
2680         (WebCore::DOMWindow::reconnectDOMWindowProperties):
2681         * page/FrameView.cpp:
2682         (WebCore::collectAndProtectWidgets):
2683         * page/MemoryRelease.cpp:
2684         (WebCore::releaseCriticalMemory):
2685         * page/Performance.cpp:
2686         (WebCore::Performance::queueEntry):
2687         * platform/cocoa/PasteboardCocoa.mm:
2688         (WebCore::Pasteboard::typesForLegacyUnsafeBindings):
2689         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2690         (WebCore::FontCache::systemFontFamilies):
2691         * platform/ios/PlatformPasteboardIOS.mm:
2692         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
2693         * platform/ios/WebCoreMotionManager.mm:
2694         (-[WebCoreMotionManager sendAccelerometerData:]):
2695         (-[WebCoreMotionManager sendMotionData:withHeading:]):
2696         * platform/mac/PlatformPasteboardMac.mm:
2697         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
2698         * platform/network/cocoa/WebCoreNSURLSession.mm:
2699         (-[WebCoreNSURLSession invalidateAndCancel]):
2700         * rendering/RenderBlock.cpp:
2701         (WebCore::RenderBlock::endAndCommitUpdateScrollInfoAfterLayoutTransaction):
2702         * rendering/RenderBlockLineLayout.cpp:
2703         (WebCore::setLogicalWidthForTextRun):
2704         * rendering/RenderDeprecatedFlexibleBox.cpp:
2705         (WebCore::FlexBoxIterator::next):
2706         * rendering/RenderTableSection.cpp:
2707         (WebCore::RenderTableSection::paintObject):
2708
2709             Replace out-parameter based copyToVector, with one that returns a Vector.
2710
2711 2017-10-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2712
2713         Support integrity="" on module scripts
2714         https://bugs.webkit.org/show_bug.cgi?id=177959
2715
2716         Reviewed by Sam Weinig.
2717
2718         This patch extends module hooks to accept fetching parameters.
2719         When starting fetching modules, WebCore creates ModuleFetchParameters.
2720         And this parameters is propagated to the fetch hook. Then, fetch
2721         hook can use this parameters to fetch modules.
2722
2723         This parameters only contains `integrity` field. This "integrity" is
2724         used to perform subresource integrity check in module loader pipeline.
2725         And this error is just proparaged as errors in module pipeline, which
2726         is the same to the other types of errors in module pipeline.
2727
2728         Test: http/tests/subresource-integrity/sri-module.html
2729
2730         * ForwardingHeaders/runtime/JSScriptFetchParameters.h: Added.
2731         * ForwardingHeaders/runtime/ScriptFetchParameters.h: Added.
2732         * WebCore.xcodeproj/project.pbxproj:
2733         * bindings/js/CachedModuleScriptLoader.cpp:
2734         (WebCore::CachedModuleScriptLoader::create):
2735         (WebCore::CachedModuleScriptLoader::CachedModuleScriptLoader):
2736         Take parameters, which includes "integrity".
2737
2738         * bindings/js/CachedModuleScriptLoader.h:
2739         * bindings/js/JSDOMWindowBase.cpp:
2740         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
2741         (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
2742         import and fetch hooks take parameters.
2743
2744         * bindings/js/JSDOMWindowBase.h:
2745         * bindings/js/JSMainThreadExecState.h:
2746         (WebCore::JSMainThreadExecState::loadModule):
2747         * bindings/js/ScriptController.cpp:
2748         (WebCore::ScriptController::loadModuleScriptInWorld):
2749         (WebCore::ScriptController::loadModuleScript):
2750         Pass parameters to the entry point of the module pipeline.
2751
2752         * bindings/js/ScriptController.h:
2753         * bindings/js/ScriptModuleLoader.cpp:
2754         (WebCore::ScriptModuleLoader::fetch):
2755         If parameters are passed, we set them to CachedModuleScriptLoader.
2756
2757         (WebCore::ScriptModuleLoader::importModule):
2758         Pass parameters to the entry point of dynamic import.
2759
2760         (WebCore::ScriptModuleLoader::notifyFinished):
2761         If script loader has parameters, we perform subresource integrity check here.
2762
2763         * bindings/js/ScriptModuleLoader.h:
2764         * dom/LoadableModuleScript.cpp:
2765         (WebCore::LoadableModuleScript::create):
2766         (WebCore::LoadableModuleScript::LoadableModuleScript):
2767         (WebCore::LoadableModuleScript::load):
2768         Create ModuleFetchParameters with "integrity" value.
2769
2770         * dom/LoadableModuleScript.h:
2771         * dom/ModuleFetchParameters.h: Copied from Source/WebCore/bindings/js/CachedModuleScriptLoader.h.
2772         (WebCore::ModuleFetchParameters::create):
2773         (WebCore::ModuleFetchParameters::integrity const):
2774         (WebCore::ModuleFetchParameters::ModuleFetchParameters):
2775         * dom/ScriptElement.cpp:
2776         (WebCore::ScriptElement::requestModuleScript):
2777         Pass "integrity" value to the module script.
2778
2779 2017-10-12  Tomas Popela  <tpopela@redhat.com>
2780
2781         Unreviewed, fix compilation warning
2782
2783         warning: extra tokens at end of #endif directive [-Wendif-labels]
2784
2785         * rendering/RenderMediaControls.h:
2786
2787 2017-10-11  Brent Fulgham  <bfulgham@apple.com>
2788
2789         Correct nullptr deref in selection handling.
2790         https://bugs.webkit.org/show_bug.cgi?id=178189
2791         <rdar://problem/33833012>
2792
2793         Reviewed by Ryosuke Niwa.
2794
2795         The VisibleSelection::toNormalizedRange returns nullptr for certain conditions (e.g., 'isNone'
2796         and 'isOrphaned' cases). It's possible to crash the WebProcess by executing a code path with
2797         an orphaned selection range.
2798
2799         The return value of 'toNormalizedRange' is checked for nullptr in many places, but not everywhere.
2800         This patch adds those missing nullptr checks.
2801
2802         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2803         (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]):
2804         * editing/DeleteSelectionCommand.cpp:
2805         (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
2806         * editing/EditingStyle.cpp:
2807         (WebCore::EditingStyle::styleAtSelectionStart):
2808         * editing/Editor.cpp:
2809         (WebCore::Editor::misspelledWordAtCaretOrRange const):
2810         * page/DOMSelection.cpp:
2811         (WebCore::DOMSelection::containsNode const):
2812         * page/DragController.cpp:
2813         (WebCore::DragController::concludeEditDrag):
2814
2815 2017-10-11  Ryan Haddad  <ryanhaddad@apple.com>
2816
2817         Unreviewed, rolling out r223215.
2818
2819         This change broke the Sierra build.
2820
2821         Reverted changeset:
2822
2823         "[Apple Pay] Add subLocality and subAdministrativeArea to
2824         ApplePayPaymentContact"
2825         https://bugs.webkit.org/show_bug.cgi?id=178191
2826         https://trac.webkit.org/changeset/223215
2827
2828 2017-10-11  Chris Dumez  <cdumez@apple.com>
2829
2830         XMLHttpRequest: do not sniff text/html, and do not sniff XML when responseType is set to "text"
2831         https://bugs.webkit.org/show_bug.cgi?id=168724
2832
2833         Reviewed by Ryosuke Niwa.
2834
2835         WebKit enabled HTML / XML charset detection for HTML-ish / XML-ish
2836         responses even when response type is text, which does not match the
2837         specification.
2838
2839         This patch is based on the following Blink patch by Yutaka Hirano <yhirano@chromium.org>:
2840         - https://chromium.googlesource.com/chromium/src.git/+/47e4fc53e6d68c0a788fcc26de598b9e3848033f
2841
2842         Tests:
2843         imported/w3c/web-platform-tests/XMLHttpRequest/responsetext-decoding.htm
2844         imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm
2845
2846         * xml/XMLHttpRequest.cpp:
2847         (WebCore::XMLHttpRequest::createDecoder const):
2848         (WebCore::XMLHttpRequest::didReceiveData):
2849         * xml/XMLHttpRequest.h:
2850
2851 2017-10-11  Andy Estes  <aestes@apple.com>
2852
2853         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact
2854         https://bugs.webkit.org/show_bug.cgi?id=178191
2855         <rdar://problem/34906367>
2856
2857         Reviewed by Tim Horton.
2858
2859         Added test cases to http/tests/ssl/applepay/ApplePaySession.html.
2860
2861         * Modules/applepay/ApplePayPaymentContact.h:
2862         * Modules/applepay/ApplePayPaymentContact.idl:
2863         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2864         (WebCore::convert):
2865
2866 2017-10-11  Youenn Fablet  <youenn@apple.com>
2867
2868         Add API to clean CacheStorage data
2869         https://bugs.webkit.org/show_bug.cgi?id=178034
2870
2871         Reviewed by Chris Dumez.
2872
2873         Test: http/tests/cache-storage/cache-clearing.https.html
2874
2875         * platform/FileSystem.h:
2876
2877 2017-10-11  David Kilzer  <ddkilzer@apple.com>
2878
2879         Part 2: Fix -Wcast-qual and -Wunused-lambda-capture warnings in WebCore with new clang compiler
2880         <https://webkit.org/b/178036>
2881         <rdar://problem/33667497>
2882
2883         Reviewed by Chris Dumez.
2884
2885         * Modules/cache/WorkerCacheStorageConnection.cpp:
2886         (WebCore::WorkerCacheStorageConnection::doRemove):
2887         - Change ASSERT() to ASSERT_UNUSED() to suppress warnings about
2888           unused lambda capture for 'cacheIdentifier' in Release builds.
2889         * bridge/objc/objc_class.mm:
2890         (JSC::Bindings::ObjcClass::classForIsA): Change C-style cast
2891         into reinterpret_cast and const_cast to go from CFTypeRef to
2892         ObjcClass*.
2893         * crypto/mac/CryptoKeyRSAMac.cpp:
2894         (WebCore::castDataArgumentToCCRSACryptorCreateFromDataIfNeeded):
2895         Add.  Introduce method to add a required const_cast for older
2896         OSes since the signature of CCRSACryptorCreateFromData() changed
2897         in iOS 11 & High Sierra.
2898         (WebCore::CryptoKeyRSA::create): Use
2899         castDataArgumentToCCRSACryptorCreateFromDataIfNeeded().
2900         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2901         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
2902         Remove unused lambda capture for 'status'.
2903
2904 2017-10-11  Chris Dumez  <cdumez@apple.com>
2905
2906         [Geolocation] Expose Coordinates.floorLevel
2907         https://bugs.webkit.org/show_bug.cgi?id=178173
2908         <rdar://problem/34918936>
2909
2910         Reviewed by Ryosuke Niwa.
2911
2912         Expose Coordinates.floorLevel via the Geolocation API. This is currently
2913         a WebKit-specific extension and it is only populated on iOS / WKTR / DRT.
2914         It is null on other platforms.
2915
2916         Test: fast/dom/Geolocation/floorLevel.html
2917
2918         * Modules/geolocation/Coordinates.h:
2919         (WebCore::Coordinates::floorLevel const):
2920         * Modules/geolocation/Coordinates.idl:
2921         * Modules/geolocation/GeolocationPosition.h:
2922         (WebCore::GeolocationPosition::encode const):
2923         (WebCore::GeolocationPosition::decode):
2924         * Modules/geolocation/ios/GeolocationPositionIOS.mm:
2925         (WebCore::GeolocationPosition::GeolocationPosition):
2926         * page/Settings.in:
2927
2928 2017-10-11  Simon Fraser  <simon.fraser@apple.com>
2929
2930         Avoid triggering layout from style change
2931         https://bugs.webkit.org/show_bug.cgi?id=178184
2932         rdar://problem/34699113
2933
2934         Reviewed by Zalan Bujtas.
2935
2936         It's bad for RenderBox::styleDidChange() to scroll RenderLayers, because that
2937         can trigger layout via FrameView::updateWidgetPositions() and ScrollingCoordinator::absoluteEventTrackingRegions().
2938         So postpone the scrolling until after layout.
2939
2940         Test: fast/scrolling/adjust-scroll-offset-on-zoom.html
2941
2942         * rendering/RenderBox.cpp:
2943         (WebCore::RenderBox::styleDidChange):
2944         * rendering/RenderLayer.cpp:
2945         (WebCore::RenderLayer::updateLayerPositions):
2946         (WebCore::RenderLayer::setPostLayoutScrollPosition):
2947         (WebCore::RenderLayer::applyPostLayoutScrollPositionIfNeeded):
2948         * rendering/RenderLayer.h:
2949
2950 2017-10-11  Youenn Fablet  <youenn@apple.com>
2951
2952         Bump default cache storage quota to 20MB
2953         https://bugs.webkit.org/show_bug.cgi?id=178132
2954
2955         Reviewed by Alex Christensen.
2956
2957         Covered by http/wpt/cache-storage/cache-quota.any.html.
2958
2959         * platform/network/NetworkStorageSession.h:
2960         (WebCore::NetworkStorageSession::cacheStoragePerOriginQuota const):
2961         (WebCore::NetworkStorageSession::setCacheStoragePerOriginQuota):
2962
2963 2017-10-11  Myles C. Maxfield  <mmaxfield@apple.com>
2964
2965         Allow PAL to log messages
2966         https://bugs.webkit.org/show_bug.cgi?id=171523
2967
2968         Reviewed by Alex Christensen.
2969
2970         Make the model of WebCore/PAL match the model of WebKit/WebCore. This is because PAL will
2971         need to log things (because existing files in WebCore/platform need to log things).
2972
2973         No new tests because there is no behavior change.
2974
2975         * WebCore.xcodeproj/project.pbxproj:
2976         * page/mac/PageMac.mm:
2977         (WebCore::Page::platformInitialize):
2978         * platform/Logging.cpp:
2979         (WebCore::registerNotifyCallback): Deleted.
2980         * platform/Logging.h:
2981         * rendering/SimpleLineLayout.cpp:
2982         (WebCore::SimpleLineLayout::canUseForWithReason):
2983
2984 2017-10-11  Chris Dumez  <cdumez@apple.com>
2985
2986         Unreviewed, fix build with some SDKs.
2987
2988         Stop capturing |this| unnecessarily in lambda.
2989
2990         * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
2991         (WebCore::FileSystemDirectoryEntry::getEntry):
2992
2993 2017-10-11  Chris Dumez  <cdumez@apple.com>
2994
2995         Unreviewed, fix build with some SDKs.
2996
2997         Stop capturing |this| unnecessarily in lambda.
2998
2999         * Modules/entriesapi/DOMFileSystem.cpp:
3000         (WebCore::DOMFileSystem::getFile):
3001
3002 2017-10-11  Daniel Bates  <dabates@apple.com>
3003
3004         Extract logic to paint composition underlines to its own function
3005         https://bugs.webkit.org/show_bug.cgi?id=178038
3006
3007         Reviewed by Zalan Bujtas.
3008
3009         No functionality changed. So, no new tests.
3010
3011         * rendering/InlineTextBox.cpp:
3012         (WebCore::InlineTextBox::paint): Modified to call paintCompositionUnderlines().
3013         (WebCore::InlineTextBox::paintCompositionUnderlines const): Added; extract code
3014         from InlineTextBox::paint() and modernized it.
3015         (WebCore::InlineTextBox::paintCompositionUnderline const): Added.
3016         (WebCore::InlineTextBox::paintCompositionUnderline): Deleted; made const.
3017         * rendering/InlineTextBox.h:
3018
3019 2017-10-11  Daniel Bates  <dabates@apple.com>
3020
3021         InlineTextBox::isSelected() should only return true for a non-empty selection
3022         and remove incorrect FIXME from InlineTextBox::localSelectionRect()
3023         https://bugs.webkit.org/show_bug.cgi?id=160786
3024
3025         Reviewed by Zalan Bujtas.
3026
3027         Partial revert of r204400 in InlineTextBox::{isSelected, localSelectionRect}().
3028
3029         The function InlineTextBox::isSelected() should only return true for a non-empty selection.
3030         Also remove an incorrect FIXME added to InlineTextBox::localSelectionRect() that questioned
3031         whether it was correct for it to return an empty rectangle. It is correct for it to return
3032         such a rectangle because this function is used to implement Element.getClientRects(). And
3033         Element.getClientRects() can return a rectangle with zero width or zero height by step 3
3034         of algorithm getClientRects() of section Extensions to the Element interface of the
3035         CSSOM View Module spec., <https://drafts.csswg.org/cssom-view/> (Editor's Draft, 15 September 2017).
3036
3037         * rendering/InlineTextBox.cpp:
3038         (WebCore::InlineTextBox::isSelected const): Only return true for a non-empty selection
3039         and remove unnecessary FIXME. Also rename variables to improve readability.
3040         (WebCore::InlineTextBox::localSelectionRect const): Remove inaccurate FIXME comment.
3041         * rendering/InlineTextBox.h:
3042
3043 2017-10-11  Ryosuke Niwa  <rniwa@webkit.org>
3044
3045         Sanitize URL in pasteboard for other applications and cross origin content
3046         https://bugs.webkit.org/show_bug.cgi?id=178060
3047         <rdar://problem/34874518>
3048
3049         Reviewed by Wenson Hsieh.
3050
3051         This patch introduces the sanitization of URL when written from a web content to prevent web content from
3052         exploiting the URL parser of other applications in the system particularly of those that actively monitor
3053         system pasteboard (a.k.a. clipboard on non-Cocoa platforms) and decode or otherwise process URLs.
3054
3055         Because the Web compatibility requires that DataTransfer exposes the original URL to any document in the
3056         same origin as the one which wrote the URL into the pasteboard, we store a string which uniquely identifies
3057         the origin of an originating document into our custom pasteboard data. Note that we expose any URL which
3058         didn't come from WebKit since we don't expect URLs to reveal privacy sensitive information. We use UUID for
3059         the origin identifier of a null origin document.
3060
3061         An alternative approach is to store the pasteboard data from the same origin into the document and invalidate
3062         it when the system pasteboard changes. However, Pasteboard object cannot know about Document (as Pasteboard
3063         is a platform object and Document is a WebCore object), this turns out be quite tricky as there are multiple
3064         places where we create Pasteboard objects, and they all need to be aware of this special same origin
3065         Pasteboard object that hangs off of Document. Also, this approach would result in the same origin code paths
3066         to diverge between null origin and non-null origin documents.
3067
3068         Tests: editing/pasteboard/data-transfer-get-data-on-copying-pasting-malformed-url-in-same-document.html
3069                editing/pasteboard/data-transfer-set-data-ignore-copied-walformed-url-in-null-origin.html
3070                editing/pasteboard/data-transfer-set-data-sanitlize-url-when-copying-in-null-origin.html
3071                editing/pasteboard/data-transfer-set-data-sanitlize-url-when-dragging-in-null-origin.html
3072                http/tests/security/clipboard/copy-paste-url-across-origin-sanitizes-url.html
3073                CopyURL.ValidURL
3074                CopyURL.UnescapedURL
3075                CopyURL.MalformedURL
3076                DataInteractionTests.DataTransferSetDataValidURL
3077                DataInteractionTests.DataTransferSetDataUnescapedURL
3078                DataInteractionTests.DataTransferSetDataInvalidURL
3079
3080         * dom/DataTransfer.cpp:
3081         (WebCore::originForDocument): Extracted from createForCopyAndPaste.
3082         (WebCore::DataTransfer::createForCopyAndPaste):
3083         (WebCore::DataTransfer::getDataForItem const): Read the URL from the custom data when the originating content
3084         is of the same origin. When the originating content is cross origin, or there is no custom data (e.g. written
3085         by another native application; or sanitization didn't result in any difference), then callback to native value.
3086         (WebCore::DataTransfer::setDataFromItemList): Sanitize the URL before writing it to the native pasteboard.
3087         Store the original value if the sanitization resulted in any difference.
3088         (WebCore::DataTransfer::types const):
3089         (WebCore::DataTransfer::commitToPasteboard): Moved the code to write custom data to Pasteboard since we need
3090         to write the origin string with it.
3091         (WebCore::DataTransfer::createForDragStartEvent): Added Document as an argument to compute the origin string.
3092         (WebCore::DataTransfer::createForDrop): Ditto.
3093         (WebCore::DataTransfer::createForUpdatingDropTarget):
3094         (WebCore::DataTransfer::moveDragState):
3095         * dom/DataTransfer.h:
3096         * dom/Document.cpp:
3097         (WebCore::Document::uniqueIdentifier): Added. See above.
3098         * dom/Document.h:
3099         * editing/Editor.cpp:
3100         (WebCore::createDataTransferForClipboardEvent):
3101         (WebCore::dispatchClipboardEvent):
3102         * page/DragController.cpp:
3103         (WebCore::DragController::dispatchTextInputEventFor):
3104         * page/EventHandler.cpp:
3105         (WebCore::EventHandler::performDragAndDrop):
3106         (WebCore::EventHandler::handleDrag):
3107         * platform/Pasteboard.h:
3108         * platform/PasteboardStrategy.h:
3109         * platform/PlatformPasteboard.h:
3110         * platform/StaticPasteboard.cpp:
3111         (WebCore::StaticPasteboard::takeCustomData): Moved the logic to write to native pasteboard to DataTransfer.
3112         * platform/StaticPasteboard.h:
3113         * platform/cocoa/PasteboardCocoa.mm:
3114         (WebCore::Pasteboard::typesSafeForBindings):
3115         (WebCore::Pasteboard::readStringInCustomData): Rewritten using readCustomData. See below.
3116         (WebCore::Pasteboard::readOrigin): Added.
3117         (WebCore::Pasteboard::readCustomData): Added. Populates the cache. Because a single Pasteboard object is never
3118         allowed to read values once its content is updated by other applications, we can permanently cache the result.
3119         * platform/gtk/PasteboardGtk.cpp:
3120         (WebCore::Pasteboard::typesSafeForBindings): Now takes the unused origin string.
3121         (WebCore::Pasteboard::readOrigin): Added.
3122         * platform/gtk/PlatformPasteboardGtk.cpp:
3123         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Now takes the unused origin string.
3124         * platform/ios/PlatformPasteboardIOS.mm:
3125         (WebCore::originKeyKeyForTeamData): Added.
3126         (WebCore::customTypesKeyForTeamData): Added. Replaces the use of PasteboardCustomData::cocoaType() in the team
3127         data for clarity since the team data key isn't same as the pasteboard type. We don't have to worry about the
3128         backwards compatibility since drag & drop session doesn't persist across iOS upgrades, and there is no publicly
3129         released iOS with this team data support.
3130         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Read the origin string and the custom data
3131         off the team data. Don't expose custom types that are written by cross origin documents.
3132         (WebCore::PlatformPasteboard::write): Add the orign string with custom pasteboard types in the team data.
3133         (WebCore::PlatformPasteboard::readURL): Fixed a bug that this function was not reading NSURL when UIPasteboard
3134         serializes NSURL as a plist. This code is exercised by CopyURL.ValidURL.
3135         * platform/mac/PlatformPasteboardMac.mm:
3136         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Don't add custom pasteboard types that are
3137         added by cross origin documents.
3138         * platform/win/PasteboardWin.cpp:
3139         (WebCore::Pasteboard::typesSafeForBindings): Now takes the unused origin string.
3140         (WebCore::Pasteboard::readOrigin): Added.
3141         * platform/wpe/PasteboardWPE.cpp:
3142         (WebCore::Pasteboard::typesSafeForBindings): Now takes the unused origin string.
3143         (WebCore::Pasteboard::readOrigin): Added.
3144         * platform/wpe/PlatformPasteboardWPE.cpp:
3145         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Now takes the unused origin string.
3146
3147 2017-10-11  Antti Koivisto  <antti@apple.com>
3148
3149         Remove some obsolete layout assertions
3150         https://bugs.webkit.org/show_bug.cgi?id=178170
3151
3152         Reviewed by Zalan Bujtas.
3153
3154         We have strong assertions against render tree mutation functions being called in layout. These are unnecessary.
3155
3156         * rendering/RenderBoxModelObject.cpp:
3157         (WebCore::RenderBoxModelObject::moveChildTo):
3158         * rendering/RenderElement.cpp:
3159         (WebCore::RenderElement::takeChildInternal):
3160         * rendering/RenderElement.h:
3161         * rendering/RenderListItem.cpp:
3162         (WebCore::RenderListItem::layout):
3163         * rendering/RenderListItem.h:
3164
3165 2017-10-11  Andy Estes  <aestes@apple.com>
3166
3167         [Payment Request] Implement Apple Pay merchant validation
3168         https://bugs.webkit.org/show_bug.cgi?id=178159
3169
3170         Reviewed by Brady Eidson.
3171
3172         When ApplePayPaymentHandler::validateMerchant() is called, dispatch the
3173         applepayvalidatemerchant event to the PaymentRequest object.
3174
3175         The event object is an ApplePayMerchantValidationEvent, on which the client calls complete()
3176         with a merchant session.
3177
3178         Test: http/tests/ssl/applepay/ApplePayMerchantValidationEvent.https.html
3179
3180         * DerivedSources.make:
3181         * Modules/applepay/ApplePayValidateMerchantEvent.h:
3182         * Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.cpp: Added.
3183         (WebCore::ApplePayMerchantValidationEvent::create):
3184         (WebCore::ApplePayMerchantValidationEvent::ApplePayMerchantValidationEvent):
3185         (WebCore::ApplePayMerchantValidationEvent::complete):
3186         (WebCore::ApplePayMerchantValidationEvent::eventInterface const):
3187         * Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.h: Added.
3188         * Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.idl: Added.
3189         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3190         (WebCore::ApplePayPaymentHandler::validateMerchant):
3191         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
3192         * Modules/paymentrequest/PaymentRequest.idl:
3193         * WebCore.xcodeproj/project.pbxproj:
3194         * dom/EventNames.h:
3195         * dom/EventNames.in:
3196         * testing/Internals.cpp:
3197         (WebCore::Internals::Internals):
3198         * testing/MockPaymentCoordinator.cpp:
3199         (WebCore::MockPaymentCoordinator::MockPaymentCoordinator):
3200         (WebCore::MockPaymentCoordinator::showPaymentUI):
3201         * testing/MockPaymentCoordinator.h:
3202
3203 2017-10-11  Chris Dumez  <cdumez@apple.com>
3204
3205         Modernize Geolocation code
3206         https://bugs.webkit.org/show_bug.cgi?id=178148
3207
3208         Reviewed by Ryosuke Niwa.
3209
3210         Modernize Geolocation code:
3211         - Use std::optional<> instead of separate boolean members
3212         - Make GeolocationPosition a simple struct that can be passed via IPC
3213         - Replace WebGeolocationPosition::Data with GeolocationPosition
3214         - Move logic to construct a GeolocationPosition from a CLLocation on iOS
3215           in one place to avoid code duplication.
3216
3217         * Modules/geolocation/Coordinates.cpp:
3218         (WebCore::Coordinates::Coordinates):
3219         * Modules/geolocation/Coordinates.h:
3220         (WebCore::Coordinates::create):
3221         (WebCore::Coordinates::isolatedCopy const):
3222         (WebCore::Coordinates::latitude const):
3223         (WebCore::Coordinates::longitude const):
3224         (WebCore::Coordinates::altitude const):
3225         (WebCore::Coordinates::accuracy const):
3226         (WebCore::Coordinates::altitudeAccuracy const):
3227         (WebCore::Coordinates::heading const):
3228         (WebCore::Coordinates::speed const):
3229         * Modules/geolocation/Geolocation.cpp:
3230         (WebCore::createGeoposition):
3231         (WebCore::Geolocation::lastPosition):
3232         * Modules/geolocation/GeolocationClient.h:
3233         * Modules/geolocation/GeolocationController.cpp:
3234         (WebCore::GeolocationController::positionChanged):
3235         (WebCore::GeolocationController::lastPosition):
3236         * Modules/geolocation/GeolocationController.h:
3237         * Modules/geolocation/GeolocationPosition.h:
3238         (WebCore::GeolocationPosition::GeolocationPosition):
3239         The default constructor is only needed by our IPC decoding code.
3240
3241         (WebCore::GeolocationPosition::encode const):
3242         (WebCore::GeolocationPosition::decode):
3243         * Modules/geolocation/ios/GeolocationPositionIOS.mm: Copied from Source/WebCore/Modules/geolocation/Coordinates.cpp.
3244         (WebCore::GeolocationPosition::GeolocationPosition):
3245         * WebCore.xcodeproj/project.pbxproj:
3246         * platform/mock/GeolocationClientMock.cpp:
3247         (WebCore::GeolocationClientMock::lastPosition):
3248         (WebCore::GeolocationClientMock::controllerTimerFired):
3249         * platform/mock/GeolocationClientMock.h:
3250
3251 2017-10-11  Brady Eidson  <beidson@apple.com>
3252
3253         Add a SW context process (where SW scripts will actually execute).
3254         https://bugs.webkit.org/show_bug.cgi?id=178156
3255         
3256         Reviewed by Andy Estes.
3257
3258         No new tests (Covered by changes to existing tests).
3259
3260         This patch adds an auxiliary "ServiceWorker context" WebProcess to a WebProcessPool.
3261
3262         This process is where ServiceWorker scripts will execute, separate from the client WebProcess
3263         hosting the page(s) they are serving.
3264
3265         This patch also adds all of the plumbing to pass along a fetched service worker script to this
3266         context WebProcess, as well as message back failure to actually start the script so we can test.
3267
3268         Touches lots of code sites but is basically just a lot of plumbing.
3269
3270         * WebCore.xcodeproj/project.pbxproj:
3271
3272         * workers/service/ServiceWorkerContextData.h: Copied from Source/WebCore/workers/service/server/SWServerWorker.h.
3273         (WebCore::ServiceWorkerContextData::encode const):
3274         (WebCore::ServiceWorkerContextData::decode):
3275
3276         * workers/service/server/SWServer.cpp:
3277         (WebCore::SWServer::Connection::finishFetchingScriptInServer):
3278         (WebCore::SWServer::Connection::scriptContextFailedToStart):
3279         (WebCore::SWServer::scriptFetchFinished):
3280         (WebCore::SWServer::scriptContextFailedToStart):
3281         (WebCore::SWServer::createWorker):
3282         * workers/service/server/SWServer.h:
3283
3284         * workers/service/server/SWServerRegistration.cpp:
3285         (WebCore::SWServerRegistration::scriptFetchFinished):
3286         (WebCore::SWServerRegistration::scriptContextFailedToStart):
3287         * workers/service/server/SWServerRegistration.h:
3288
3289         * workers/service/server/SWServerWorker.cpp:
3290         (WebCore::SWServerWorker::SWServerWorker):
3291         (WebCore::SWServerWorker::~SWServerWorker):
3292         * workers/service/server/SWServerWorker.h:
3293         (WebCore::SWServerWorker::create):
3294         (WebCore::SWServerWorker::scriptURL const):
3295         (WebCore::SWServerWorker::script const):
3296         (WebCore::SWServerWorker::type const):
3297         (WebCore::SWServerWorker::workerID const):
3298
3299 2017-10-11  Joanmarie Diggs  <jdiggs@igalia.com>
3300
3301         [ATK] Expose value of aria-keyshortcuts as object attribute
3302         https://bugs.webkit.org/show_bug.cgi?id=171175
3303
3304         Reviewed by Chris Fleizach.
3305
3306         Expose the author-provided string through the "keyshortcuts" object attribute.
3307
3308         Test: accessibility/gtk/aria-keyshortcuts.html
3309
3310         * accessibility/AccessibilityObject.cpp:
3311         (WebCore::AccessibilityObject::ariaKeyShortcutsValue const):
3312         * accessibility/AccessibilityObject.h:
3313         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3314         (webkitAccessibleGetAttributes):
3315         * html/HTMLAttributeNames.in:
3316
3317 2017-10-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3318
3319         [JSC] Drop Instantiate hook in ES6 module loader
3320         https://bugs.webkit.org/show_bug.cgi?id=178162
3321
3322         Reviewed by Sam Weinig.
3323
3324         Drop instantiate hooks.
3325         No behavior change.
3326
3327         * bindings/js/JSDOMWindowBase.cpp:
3328         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3329
3330 2017-10-11  Alicia Boya García  <aboya@igalia.com>
3331
3332         [MSE][GStreamer] Add dump of append pipeline
3333         https://bugs.webkit.org/show_bug.cgi?id=178074
3334
3335         Reviewed by Xabier Rodriguez-Calvar.
3336
3337         Enable dump of AppendPipeline.
3338
3339         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3340         (WebCore::appendPipelineStateChangeMessageCallback):
3341         (WebCore::AppendPipeline::AppendPipeline):
3342         (WebCore::AppendPipeline::handleStateChangeMessage):
3343         * platform/graphics/gstreamer/mse/AppendPipeline.h:
3344
3345 2017-09-27  Frederic Wang  <fwang@igalia.com>
3346
3347         [iOS] Do not flatten frames when async frame scrolling is enabled
3348         https://bugs.webkit.org/show_bug.cgi?id=173704
3349
3350         Reviewed by Simon Fraser.
3351
3352         This patch disables frame flattening when async frame scrolling is enabled on iOS, as
3353         otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
3354         developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
3355         in the "Experimental WebKit Features" menu of Safari iOS.
3356
3357         Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
3358
3359         * page/FrameView.cpp:
3360         (WebCore::FrameView::frameFlatteningEnabled): Use effectiveFrameFlattening()
3361         * page/Settings.cpp:
3362         (WebCore::Settings::effectiveFrameFlattening): New function to return frameFlattening() or do
3363         some exceptions on iOS.
3364         * page/Settings.h: Declare effectiveFrameFlattening.
3365         * rendering/RenderFrameSet.cpp:
3366         (WebCore::RenderFrameSet::flattenFrameSet): Use effectiveFrameFlattening()
3367         * rendering/RenderIFrame.cpp:
3368         (WebCore::RenderIFrame::flattenFrame): Ditto.
3369         * rendering/RenderView.cpp:
3370         (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Ditto.
3371
3372 2017-10-10  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3373
3374         [GStreamer] Fix double seek requested by downloadbuffer GStreamer element in webkibwebsrc
3375         https://bugs.webkit.org/show_bug.cgi?id=178079
3376
3377         Reviewed by Žan Doberšek.
3378
3379         When the downloadbuffer GStreamer element requests two seeks too
3380         close to each other there's some rare race condition where our
3381         source answers that it is not seekable and ends up with
3382         downloadbuffer element to seek beyond the file size, which causes