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