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