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