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