43d3e4f4337bd8672d38247687b3ea464995d194
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-01-09  Dan Bernstein  <mitz@apple.com>
2
3         Removed some empty directories that were left behind
4
5         * Modules/indieui: Removed.
6         * Modules/vibration: Removed.
7         * platform/graphics/ca/mac: Removed.
8         * platform/mediastream/gstreamer: Removed.
9
10 2018-01-09  Antoine Quint  <graouts@apple.com>
11
12         Refactor timing function solving code
13         https://bugs.webkit.org/show_bug.cgi?id=181428
14
15         Reviewed by Dean Jackson.
16
17         We have duplicated code to solve "cubic" and "steps" timing functions in AnimationBase and TextureMapperAnimation,
18         and we will soon need similar code to deal with timing functions in Web Animations. We move this code into TimingFunction
19         with a single transformTime() function that can be called directly on the timing function rather than having callers
20         figure out what type timing functions are to solve them.
21
22         No test as there shouldn't be any behavior change.
23
24         * page/animation/AnimationBase.cpp:
25         (WebCore::AnimationBase::progress const):
26         (WebCore::solveEpsilon): Deleted.
27         (WebCore::solveCubicBezierFunction): Deleted.
28         (WebCore::solveStepsFunction): Deleted.
29         (WebCore::solveSpringFunction): Deleted.
30         * platform/animation/TimingFunction.cpp:
31         (WebCore::TimingFunction::transformTime const):
32         * platform/animation/TimingFunction.h:
33         * platform/graphics/texmap/TextureMapperAnimation.cpp:
34         (WebCore::TextureMapperAnimation::apply):
35         (WebCore::solveEpsilon): Deleted.
36         (WebCore::solveCubicBezierFunction): Deleted.
37         (WebCore::solveStepsFunction): Deleted.
38         (WebCore::applyTimingFunction): Deleted.
39
40 2018-01-09  Michael Catanzaro  <mcatanzaro@igalia.com>
41
42         Unreviewed, silence -Wunused-parameter warning
43
44         * testing/js/WebCoreTestSupport.cpp:
45         (WebCoreTestSupport::setupNewlyCreatedServiceWorker):
46
47 2018-01-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
48
49         Check Image::m_image is not null in ImageLoader::decode()
50         https://bugs.webkit.org/show_bug.cgi?id=180386
51         <rdar://problem/34634483>
52
53         Reviewed by Tim Horton.
54
55         Ensure ImageLoader::m_image is not null before referencing it.
56
57         * loader/ImageLoader.cpp:
58         (WebCore::ImageLoader::decode):
59
60 2018-01-09  Yusuke Suzuki  <utatane.tea@gmail.com>
61
62         [FreeType] Use FastMalloc for FreeType
63         https://bugs.webkit.org/show_bug.cgi?id=181387
64
65         Reviewed by Michael Catanzaro.
66
67         Add custom memory allocator for FreeType to use FastMalloc.
68
69         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
70         (WebCore::initializeFreeTypeLibrary):
71         (WebCore::createFontCustomPlatformData):
72
73 2018-01-09  Zalan Bujtas  <zalan@apple.com>
74
75         [RenderTreeBuilder] Move RenderTable* addChild mutation logic to RenderTreeBuilder
76         https://bugs.webkit.org/show_bug.cgi?id=181424
77         <rdar://problem/36368628>
78
79         Reviewed by Antti Koivisto.
80
81         This is about moving code, no cleanup and/or normalization (unfortunately it also means
82         some temporary changes).  
83
84         Covered by existing tests.
85
86         * rendering/RenderTable.cpp:
87         (WebCore::RenderTable::addChild):
88         * rendering/RenderTableRow.cpp:
89         (WebCore::RenderTableRow::addChild):
90         * rendering/RenderTableSection.cpp:
91         (WebCore::RenderTableSection::addChild):
92         * rendering/updating/RenderTreeBuilder.cpp:
93         (WebCore::RenderTreeBuilder::insertChildToRenderTable):
94         (WebCore::RenderTreeBuilder::insertChildToRenderTableSection):
95         (WebCore::RenderTreeBuilder::insertChildToRenderTableRow):
96         * rendering/updating/RenderTreeBuilder.h:
97         * rendering/updating/RenderTreeBuilderTable.cpp:
98         (WebCore::RenderTreeBuilder::Table::insertChild):
99         * rendering/updating/RenderTreeBuilderTable.h:
100
101 2018-01-09  Zalan Bujtas  <zalan@apple.com>
102
103         [RenderTreeBuilder] Transition Render*::addChild() calls to RenderTreeBuilder::insertChildToRender*()
104         https://bugs.webkit.org/show_bug.cgi?id=181407
105         <rdar://problem/36361176>
106
107         Reviewed by Antti Koivisto.
108
109         Eventually all mutation will be going through the RenderTreeBuilder.
110
111         No change in functionality.
112
113         * rendering/RenderGrid.cpp:
114         (WebCore::RenderGrid::addChild):
115         * rendering/RenderMultiColumnFlow.cpp:
116         (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
117         * rendering/RenderRubyRun.cpp:
118         (WebCore::RenderRubyRun::rubyBaseSafe):
119         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
120         (WebCore::RenderTreeBuilder::BlockFlow::insertChild):
121         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
122         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
123         * rendering/updating/RenderTreeBuilderRuby.cpp:
124         (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
125
126 2018-01-09  Philippe Normand  <pnormand@igalia.com>
127
128         [GStreamer] Ensure SleepDisabler is not held by pages in page cache
129         https://bugs.webkit.org/show_bug.cgi?id=180197
130
131         Reviewed by Eric Carlson.
132
133         The sleep disabler is now checked again whenever the media player
134         playback state or other characteristic has changed in the media
135         engine.
136
137         * html/HTMLMediaElement.cpp:
138         (WebCore::HTMLMediaElement::mediaPlayerPlaybackStateChanged):
139         Check if the sleep disabler state needs to be updated or not.
140         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
141         (WebCore::HTMLMediaElement::shouldDisableSleep const): Enable
142         sleep disabler for GTK and WPE ports.
143
144 2018-01-09  Philippe Normand  <pnormand@igalia.com>
145
146         [GStreamer] Missing notifications to player client
147         https://bugs.webkit.org/show_bug.cgi?id=181432
148
149         Reviewed by Carlos Garcia Campos.
150
151         We now properly emit playback state changes and characteristic
152         updates to the client when the pipeline state changes and when
153         audio/video tracks changes are detected.
154
155         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
156         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
157         This debug message appears too often in logs. Demote.
158         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const): Ditto.
159         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Emit
160         charasteristicChanged notification.
161         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
162         (WebCore::MediaPlayerPrivateGStreamer::updateStates): Keep track
163         of old and current pipeline state.
164         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
165
166
167 2018-01-09  Youenn Fablet  <youenn@apple.com>
168
169         Add CSP support to service workers
170         https://bugs.webkit.org/show_bug.cgi?id=181385
171
172         Reviewed by Chris Dumez.
173
174         Covered by rebased tests.
175
176         Added recovery of CSP information from WorkerScriptLoader.
177         Added plumbing to pass the CSP information to Service Workers.
178         Did not add persistency support for the CSP information as this requires changing the SQL database schema.
179         This will be done in a follow-up.
180
181         * workers/WorkerScriptLoader.cpp:
182         (WebCore::WorkerScriptLoader::loadAsynchronously):
183         (WebCore::WorkerScriptLoader::didReceiveResponse):
184         * workers/WorkerScriptLoader.h:
185         (WebCore::WorkerScriptLoader::contentSecurityPolicy const):
186         * workers/service/SWClientConnection.cpp:
187         (WebCore::SWClientConnection::finishedFetchingScript):
188         (WebCore::SWClientConnection::failedFetchingScript):
189         * workers/service/SWClientConnection.h:
190         * workers/service/ServiceWorkerContainer.cpp:
191         (WebCore::ServiceWorkerContainer::addRegistration):
192         (WebCore::ServiceWorkerContainer::jobFailedWithException):
193         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
194         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
195         * workers/service/ServiceWorkerContainer.h:
196         * workers/service/ServiceWorkerContextData.cpp:
197         (WebCore::ServiceWorkerContextData::isolatedCopy const):
198         * workers/service/ServiceWorkerContextData.h:
199         (WebCore::ServiceWorkerContextData::encode const):
200         (WebCore::ServiceWorkerContextData::decode):
201         * workers/service/ServiceWorkerFetchResult.h:
202         (WebCore::ServiceWorkerFetchResult::encode const):
203         (WebCore::ServiceWorkerFetchResult::decode):
204         * workers/service/ServiceWorkerGlobalScope.cpp:
205         (WebCore::ServiceWorkerGlobalScope::create):
206         * workers/service/ServiceWorkerGlobalScope.h:
207         * workers/service/ServiceWorkerJob.cpp:
208         (WebCore::ServiceWorkerJob::notifyFinished):
209         * workers/service/ServiceWorkerJobClient.h:
210         * workers/service/context/ServiceWorkerThread.cpp:
211         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
212         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
213         * workers/service/server/RegistrationDatabase.cpp:
214         (WebCore::v1RecordsTableSchema):
215         (WebCore::RegistrationDatabase::importRecords):
216         * workers/service/server/SWServer.cpp:
217         (WebCore::SWServer::updateWorker):
218         (WebCore::SWServer::installContextData):
219         * workers/service/server/SWServer.h:
220         * workers/service/server/SWServerJobQueue.cpp:
221         (WebCore::SWServerJobQueue::scriptFetchFinished):
222         * workers/service/server/SWServerWorker.cpp:
223         (WebCore::SWServerWorker::SWServerWorker):
224         (WebCore::m_contentSecurityPolicy):
225         (WebCore::SWServerWorker::contextData const):
226         * workers/service/server/SWServerWorker.h:
227
228 2018-01-09  Antoine Quint  <graouts@apple.com>
229
230         Provide a method to obtain a CSS value from a RenderStyle by CSSPropertyID
231         https://bugs.webkit.org/show_bug.cgi?id=181429
232
233         Reviewed by Antti Koivisto.
234
235         The KeyframeEffect.getKeyframes() method from Web Animations requires that we return all styles applied at a given
236         animation effect keyframe. When we parse keyframes, we create RenderStyle objects that are stored in a KeyframeList,
237         as well as a list of CSSPropertyIDs that are animated. In order to provide the list of animated properties and their
238         values when calling getKeyframes(), we need to be able to read back from the RenderStyle we create. As a first step
239         towards this goal, we factor some code in ComputedStyleExtractor::propertyValue() out into a new method
240         ComputedStyleExtractor::valueForPropertyinStyle() which takes in an explicit RenderStyle.
241
242         No test as this is simply refactoring that doesn't change or add behavior.
243
244         * css/CSSComputedStyleDeclaration.cpp:
245         (WebCore::ComputedStyleExtractor::propertyValue):
246         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
247         * css/CSSComputedStyleDeclaration.h:
248
249 2018-01-09  Youenn Fablet  <youenn@apple.com>
250
251         SWClientConnection should not keep references to service worker jobs
252         https://bugs.webkit.org/show_bug.cgi?id=181381
253
254         Reviewed by Chris Dumez.
255
256         Difficult to test determiniscally but corresponding crash log should no longer happen in debug builds.
257
258         Stopped passing ServiceWorkerJob references from ServiceWorkerContainer (potentially in service worker thread) to SWClientConnection (main thread).
259         Instead pass job identifiers and related data to the main thread.
260
261         Minor refactoring to use ServiceWorkerJobIdentifier instead of ServiceWorkerJobDataIdentifier which contains more data than needed.
262
263         * workers/service/SWClientConnection.cpp:
264         (WebCore::SWClientConnection::scheduleJob):
265         (WebCore::SWClientConnection::failedFetchingScript):
266         (WebCore::SWClientConnection::postTaskForJob):
267         (WebCore::SWClientConnection::jobRejectedInServer):
268         (WebCore::SWClientConnection::registrationJobResolvedInServer):
269         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
270         (WebCore::SWClientConnection::startScriptFetchForServer):
271         (WebCore::SWClientConnection::clearPendingJobs):
272         (WebCore::SWClientConnection::finishedFetchingScript): Deleted.
273         * workers/service/SWClientConnection.h:
274         * workers/service/ServiceWorkerContainer.cpp:
275         (WebCore::ServiceWorkerContainer::scheduleJob):
276         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
277         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
278         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
279         * workers/service/ServiceWorkerContainer.h:
280         * workers/service/server/SWServer.cpp:
281         (WebCore::SWServer::rejectJob):
282         (WebCore::SWServer::resolveRegistrationJob):
283         (WebCore::SWServer::resolveUnregistrationJob):
284         (WebCore::SWServer::startScriptFetch):
285         * workers/service/server/SWServer.h:
286
287 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
288
289         REGRESSION(r224460): Text fields sometimes get "messed up"
290         https://bugs.webkit.org/show_bug.cgi?id=181115
291
292         Reviewed by Zalan Bujtas.
293
294         Add the scroll position to paint offset before computing the clip rectangle. Before r224460, scroll position was
295         substracted after the clip rectangle was computed.
296
297         * rendering/LayoutState.cpp:
298         (WebCore::LayoutState::computeClipRect):
299
300 2018-01-09  Ali Juma  <ajuma@chromium.org>
301
302         Implement VisualViewport API events
303         https://bugs.webkit.org/show_bug.cgi?id=179386
304
305         Reviewed by Frédéric Wang.
306
307         Implement the events (resize and scroll) defined by the Visual Viewport API
308         (https://wicg.github.io/visual-viewport/#events).
309
310         This is behind the VisualViewportAPI experimental feature flag.
311
312         In order to detect when events need to be fired, change the computation of
313         Visual Viewport attributes to happen whenever the layout viewport is updated
314         rather than only on-demand.
315
316         Tests: fast/visual-viewport/resize-event-fired-window-resized.html
317                fast/visual-viewport/resize-event-fired.html
318                fast/visual-viewport/scroll-event-fired.html
319
320         * dom/Document.cpp:
321         (WebCore::Document::addListenerTypeIfNeeded):
322         Add support for tracking resize event listeners.
323         * dom/Document.h:
324         * dom/DocumentEventQueue.cpp:
325         (WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
326         (WebCore::DocumentEventQueue::enqueueScrollEvent):
327         Factored out of enqueueOrDispatchScrollEvent so that this logic can be reused
328         for Visual Viewport scroll events.
329         (WebCore::DocumentEventQueue::enqueueResizeEvent):
330         (WebCore::DocumentEventQueue::pendingEventTimerFired):
331         * dom/DocumentEventQueue.h:
332         * page/FrameView.cpp:
333         (WebCore::FrameView::updateLayoutViewport):
334         * page/VisualViewport.cpp:
335         (WebCore::VisualViewport::addEventListener):
336         (WebCore::layoutIfNonNull):
337         (WebCore::VisualViewport::offsetLeft const):
338         Remove attribute computation logic since this now happens during update().
339         (WebCore::VisualViewport::offsetTop const): Ditto.
340         (WebCore::VisualViewport::pageLeft const): Ditto.
341         (WebCore::VisualViewport::pageTop const): Ditto.
342         (WebCore::VisualViewport::width const): Ditto.
343         (WebCore::VisualViewport::height const): Ditto.
344         (WebCore::VisualViewport::scale const):
345         (WebCore::VisualViewport::update):
346         Added. Computes all of the Visual Viewport attributes and determines
347         whether events need to be fired.
348         (WebCore::VisualViewport::enqueueResizeEvent):
349         (WebCore::VisualViewport::enqueueScrollEvent):
350         (WebCore::getFrameViewAndLayoutIfNonNull): Deleted.
351         * page/VisualViewport.h:
352
353 2018-01-09  Yacine Bandou  <yacine.bandou_ext@softathome.com>
354
355         [EME] Add the CENC initData support in ClearKey CDM
356         https://bugs.webkit.org/show_bug.cgi?id=180081
357
358         Reviewed by Xabier Rodriguez-Calvar.
359
360         Add the "cenc" initDataType support in ClearKey CDM.
361         Parse the CENC initData and extract the KIDs by following the W3C spec
362         https://www.w3.org/TR/eme-initdata-cenc/#common-system
363
364         Tests: media/encrypted-media/clearKey/clearKey-message-cenc-event.html
365                media/encrypted-media/clearKey/clearKey-message-cenc-event-mse.html
366
367         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
368         (WebCore::extractKeyidsLocationFromCencInitData):
369         (WebCore::isCencInitData):
370         (WebCore::extractKeyidsFromCencInitData):
371         (WebCore::CDMPrivateClearKey::supportsInitDataType const):
372         (WebCore::CDMPrivateClearKey::supportsInitData const):
373         (WebCore::CDMInstanceClearKey::requestLicense):
374
375 2018-01-09  Zan Dobersek  <zdobersek@igalia.com>
376
377         [Cairo] Pass state values directly to Cairo operations
378         https://bugs.webkit.org/show_bug.cgi?id=181389
379
380         Reviewed by Carlos Garcia Campos.
381
382         Instead of passing reference to the GraphicsContextState object to
383         various Cairo operations, only pass the required state values. This
384         makes it explicit what state values are used in these operations, at the
385         expense of some long parameter lists, but this will be better addressed
386         by future refactoring of this code into more concise functions.
387
388         No new tests -- no change in functionality.
389
390         * platform/graphics/cairo/CairoOperations.cpp:
391         (WebCore::Cairo::drawGlyphsShadow):
392         (WebCore::Cairo::dashedLineCornerWidthForStrokeWidth):
393         (WebCore::Cairo::dashedLinePatternWidthForStrokeWidth):
394         (WebCore::Cairo::drawGlyphs):
395         (WebCore::Cairo::drawRect):
396         (WebCore::Cairo::drawLine):
397         (WebCore::Cairo::drawEllipse):
398         * platform/graphics/cairo/CairoOperations.h:
399         * platform/graphics/cairo/FontCairo.cpp:
400         (WebCore::FontCascade::drawGlyphs):
401         * platform/graphics/cairo/GraphicsContextCairo.cpp:
402         (WebCore::GraphicsContext::drawRect):
403         (WebCore::GraphicsContext::drawLine):
404         (WebCore::GraphicsContext::drawEllipse):
405
406 2018-01-09  Ryosuke Niwa  <rniwa@webkit.org>
407
408         Release assert in addResourceTiming when a cache resource is requested during style recalc
409         https://bugs.webkit.org/show_bug.cgi?id=181137
410         <rdar://problem/35666574>
411
412         Reviewed by Simon Fraser.
413
414         Make the dispatching of resourcetimingbufferfull event asynchronous to avoid dispatching it
415         synchronously during a style resolution when CachedResourceLoader::requestImage requests
416         a previously loaded image.
417
418         We now schedule a timer when the resource timing buffer becomes full, and dispatch the event
419         when the timer fires. Meanwhile, we have a backup buffer to which additional resource timing
420         entries would be added. Once the event is dispatched, we refill the buffer exposed to author
421         scripts. When refilling the buffer results in it becoming full again, we keep repeating the
422         process of firing resourcetimingbufferfull and re-filling the buffer until either we stop
423         making progress (i.e. the script didn't increase the number of empty entires in the buffer)
424         or the backup buffer (at the time we started this process) becomes empty.
425
426         Also fixed a bug that we were firing resourcetimingbufferfull event when the last entry that
427         fits within the buffer size was added instead of when an entry is being added to an already
428         full buffer. To make this work, the patch introduces m_resourceTimingBufferFullFlag,
429         representing the concept "resource timing buffer full" flag in the resource timing specification.
430
431         Test: http/tests/performance/performance-resource-timing-resourcetimingbufferfull-crash.html
432
433         * page/Performance.cpp:
434         (WebCore::Performance::Performance):
435         (WebCore::Performance::clearResourceTimings):
436         (WebCore::Performance::setResourceTimingBufferSize):
437         (WebCore::Performance::addResourceTiming):
438         (WebCore::Performance::resourceTimingBufferFullTimerFired):
439         * page/Performance.h:
440
441 2018-01-08  Chris Nardi  <csnardi1@gmail.com>
442
443         ::first-letter incorrectly selects grapheme pairs
444         https://bugs.webkit.org/show_bug.cgi?id=181315
445
446         Reviewed by Darin Adler.
447
448         Grapheme pairs were incorrectly selected by ::first-letter. This
449         change fixes their selection.
450
451         Tests: Updated fast/css/first-letter-punctuation.html and imported
452         LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo-4/first-letter-004.html
453
454         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
455         (WebCore::isPunctuationForFirstLetter):
456         (WebCore::shouldSkipForFirstLetter):
457         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
458
459 2018-01-08  Darin Adler  <darin@apple.com>
460
461         Special list-item counter starts from an incorrect number for ::before and ::after
462         https://bugs.webkit.org/show_bug.cgi?id=181084
463
464         Reviewed by Zalan Bujtas.
465
466         Test: fast/css/counters/counter-list-item.html
467
468         * Sources.txt: Removed CounterDirectives.cpp.
469         * WebCore.xcodeproj/project.pbxproj: Ditto.
470
471         * css/CSSComputedStyleDeclaration.cpp:
472         (WebCore::counterToCSSValue): Updated for changes to the CounterDirectives struct.
473         * css/StyleBuilderCustom.h:
474         (WebCore::StyleBuilderCustom::applyInheritCounter): Ditto.
475         (WebCore::StyleBuilderCustom::applyValueCounter): Ditto.
476
477         * html/HTMLLIElement.cpp:
478         (WebCore::HTMLLIElement::parseValue): Call setExplicitValue(std::nullopt) instead
479         of clearExplicitValue since we are using std::optional now.
480
481         * rendering/RenderCounter.cpp:
482         (WebCore::listItemCounterDirectives): Added. Computes the counter directives that
483         express the effects on the list-item counter from list item and list elements.
484         Used something as close to what the CSS 3 draft says as possible. This uses a
485         negative increment when creating a list to counteract the positive increment done
486         by a list element, except in the case of an unordered list. This is where the bug
487         fix actually lies. Also fixed handling of reversed ordered lists at the same time.
488         (WebCore::planCounter): Refactored to use the function above. Also changed the
489         code to pay attention to both the counter directives and the implicit ones from
490         list item and list elements, getting as close as possible to what the specification
491         seems to call for.
492
493         * rendering/RenderListItem.cpp:
494         (WebCore::RenderListItem::RenderListItem): Since we are using std::optional and no
495         longer using bit fields, simplified the constructor for each list item.
496         (WebCore::RenderListItem::calcValue const): Deleted.
497         (WebCore::RenderListItem::updateValueNow const): Merged in all the code from the
498         old calcValue function, but it is also simpler now since m_value is std::optional.
499         (WebCore::RenderListItem::updateValue): Updated to use std::optional.
500         (WebCore::RenderListItem::setExplicitValue): Ditto.
501         (WebCore::RenderListItem::clearExplicitValue): Deleted.
502         (WebCore::RenderListItem::updateListMarkerNumbers): Updated to use std::optional.
503         (WebCore::RenderListItem::isInReversedOrderedList const): Added. This is used by
504         the counter code so it can decrement instead of incrementing.
505
506         * rendering/RenderListItem.h: Updated to use std::optional. Also marked functions
507         final instead of override and initialized m_notInList after making it not be a
508         bitfield any more.
509
510         * rendering/style/CounterDirectives.cpp: Removed.
511         * rendering/style/CounterDirectives.h: Removed most of the CounterDirectives
512         class and replaced it with a struct with two std::optional. Added an addClamped
513         function so the counter code can share it with the addIncrementValue function.
514         If we want to make a faster version that doesn't use double, we can come back
515         and do that. Also moved the == function to the header since the implementation
516         is so trivial.
517
518         * rendering/style/StyleAllInOne.cpp: Removed CounterDirectives.cpp.
519
520         * rendering/style/StyleRareNonInheritedData.cpp:
521         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Updated to
522         use std::make_unique directly instead of using a clone function.
523
524 2018-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
525
526         [Attachment Support] Expose HTMLAttachmentElement.uniqueIdentifier to bindings
527         https://bugs.webkit.org/show_bug.cgi?id=181420
528         <rdar://problem/36365827>
529
530         Reviewed by Alex Christensen.
531
532         Add a new IDL definition for uniqueIdentifier on HTMLAttachmentElement. This allows clients to relate attachment
533         elements in the DOM to _WKAttachments delivered via Objective-C SPI.
534
535         Adjusted existing tests in WKAttachmentTests.
536
537         * html/HTMLAttachmentElement.idl:
538
539 2018-01-08  Don Olmstead  <don.olmstead@sony.com>
540
541         AccessibilityARIAGrid does not compile when accessibility is disabled
542         https://bugs.webkit.org/show_bug.cgi?id=181418
543         <rdar://problem/36365398>
544
545         Reviewed by Chris Fleizach.
546
547         No new tests. No change in behavior.
548
549         * accessibility/AccessibilityARIAGrid.cpp:
550
551 2018-01-08  Commit Queue  <commit-queue@webkit.org>
552
553         Unreviewed, rolling out r226532 and r226540.
554         https://bugs.webkit.org/show_bug.cgi?id=181422
555
556         jessie says basic browsing does not seem to work (Requested by
557         alexchristensen on #webkit).
558
559         Reverted changesets:
560
561         "Add CSP support to service workers"
562         https://bugs.webkit.org/show_bug.cgi?id=181385
563         https://trac.webkit.org/changeset/226532
564
565         "SWClientConnection should not keep references to service
566         worker jobs"
567         https://bugs.webkit.org/show_bug.cgi?id=181381
568         https://trac.webkit.org/changeset/226540
569
570 2018-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
571
572         [Attachment Support] Expose file name and content type of WKAttachment
573         https://bugs.webkit.org/show_bug.cgi?id=181390
574         <rdar://problem/36336837>
575
576         Reviewed by Tim Horton.
577
578         Add new structs in AttachmentTypes.h and refactor HTMLAttachmentElement::requestData to requestInfo. See below
579         for more details. Augmented existing API tests in WKAttachmentTests.
580
581         * html/AttachmentTypes.h:
582
583         Add a struct to represent a snapshot of information about an attachment element.
584
585         * html/HTMLAttachmentElement.cpp:
586         (WebCore::HTMLAttachmentElement::requestInfo):
587         (WebCore::HTMLAttachmentElement::requestData): Deleted.
588         * html/HTMLAttachmentElement.h:
589
590         Change requestData to requestInfo. Instead of fetching and delivering data via callback, requestInfo returns an
591         AttachmentInfo.
592
593         * rendering/RenderThemeIOS.mm:
594         (WebCore::RenderAttachmentInfo::addLine):
595         (WebCore::RenderAttachmentInfo::buildWrappedLines):
596         (WebCore::RenderAttachmentInfo::buildSingleLine):
597         (WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
598         (WebCore::RenderThemeIOS::attachmentBaseline const):
599         (WebCore::paintAttachmentIcon):
600         (WebCore::paintAttachmentText):
601         (WebCore::paintAttachmentProgress):
602         (WebCore::attachmentBorderPath):
603         (WebCore::RenderThemeIOS::paintAttachment):
604         (WebCore::AttachmentInfo::addLine): Deleted.
605         (WebCore::AttachmentInfo::buildWrappedLines): Deleted.
606         (WebCore::AttachmentInfo::buildSingleLine): Deleted.
607         (WebCore::AttachmentInfo::AttachmentInfo): Deleted.
608
609         Rename AttachmentInfo to RenderAttachmentInfo to resolve a name conflict with the new AttachmentInfo struct.
610
611 2018-01-08  Saam Barati  <sbarati@apple.com>
612
613         Speculative build fix after r226600. We only use clflush on x86 and the `asm volatile` syntax is not available in the Windows build.
614
615         No new tests because this is a build fix.
616
617         * dom/Comment.cpp:
618         (WebCore::Comment::clflushReadLength):
619
620 2018-01-08  Michael Saboff  <msaboff@apple.com>
621
622         Add a DOM gadget for Spectre testing
623         https://bugs.webkit.org/show_bug.cgi?id=181351
624
625         Reviewed by Saam Barati.
626
627         This change is used to test Spectre mitigations.
628
629         Added a side data array to the Comment DOM node to test for Spectre issues in
630         the DOM layer.  This additional functionality is disabled by default and must
631         be enabled through the JSC option "enableSpectreGadgets".
632
633         * dom/Comment.cpp:
634         (WebCore::Comment::Comment):
635         (WebCore::Comment::setReadLength):
636         (WebCore::Comment::charCodeAt):
637         (WebCore::Comment::clflushReadLength):
638         * dom/Comment.h:
639         * dom/Comment.idl:
640         * page/RuntimeEnabledFeatures.cpp:
641         (WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const):
642         * page/RuntimeEnabledFeatures.h:
643
644 2018-01-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
645
646         A canvas should not be tainted if it draws a data URL SVGImage with a <foreignObject>
647         https://bugs.webkit.org/show_bug.cgi?id=180301
648
649         Reviewed by Dean Jackson.
650
651         Don't taint the canvas if it draws a data URL SVGImage with a <foreignObject>.
652         There should not be a cross-origin data leak in this case.
653
654         Tests: svg/as-image/svg-canvas-data-url-svg-with-feimage-not-tainted.html
655                svg/as-image/svg-canvas-data-url-svg-with-foreign-object-not-tainted.html
656                svg/as-image/svg-canvas-data-url-svg-with-image-not-tainted.html
657
658         * html/ImageBitmap.cpp:
659         (WebCore::taintsOrigin):
660         * html/canvas/CanvasRenderingContext.cpp:
661         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
662
663 2018-01-08  Don Olmstead  <don.olmstead@sony.com>
664
665         Simplify platform checks in Graphics Context
666         https://bugs.webkit.org/show_bug.cgi?id=181344
667
668         Reviewed by Alex Christensen.
669
670         No new tests. No change in behavior.
671
672         * platform/graphics/ANGLEWebKitBridge.h:
673         * platform/graphics/GLContext.h:
674         * platform/graphics/GraphicsContext3D.h:
675         * platform/graphics/OpenGLESShims.h:
676         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
677         (WebCore::GraphicsContext3D::checkVaryingsPacking const):
678
679 2018-01-08  Zalan Bujtas  <zalan@apple.com>
680
681         [RenderTreeBuilder] Move SVG addChild logic to RenderTreeBuilder
682         https://bugs.webkit.org/show_bug.cgi?id=181405
683         <rdar://problem/36360476>
684
685         Reviewed by Antti Koivisto.
686
687         This is about moving the code, no cleanup and/or normalization (unfortunately it also means
688         some temporary changes).  
689
690         No change in functionality.
691
692         * Sources.txt:
693         * WebCore.xcodeproj/project.pbxproj:
694         * rendering/svg/RenderSVGContainer.cpp:
695         (WebCore::RenderSVGContainer::addChild):
696         * rendering/svg/RenderSVGInline.cpp:
697         (WebCore::RenderSVGInline::addChild):
698         * rendering/svg/RenderSVGRoot.cpp:
699         (WebCore::RenderSVGRoot::addChild):
700         * rendering/svg/RenderSVGText.cpp:
701         (WebCore::RenderSVGText::addChild):
702         * rendering/updating/RenderTreeBuilder.cpp:
703         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
704         (WebCore::RenderTreeBuilder::insertChildToSVGContainer):
705         (WebCore::RenderTreeBuilder::insertChildToSVGInline):
706         (WebCore::RenderTreeBuilder::insertChildToSVGRoot):
707         (WebCore::RenderTreeBuilder::insertChildToSVGText):
708         * rendering/updating/RenderTreeBuilder.h:
709         (WebCore::RenderTreeBuilder::SVGBuilder):
710         * rendering/updating/RenderTreeBuilderSVG.cpp: Added.
711         (WebCore::RenderTreeBuilder::SVG::SVG):
712         (WebCore::RenderTreeBuilder::SVG::insertChild):
713         * rendering/updating/RenderTreeBuilderSVG.h: Added.
714
715 2018-01-08  John Wilander  <wilander@apple.com>
716
717         Storage Access API: Remove access for all frames under a page when the page is closed
718         https://bugs.webkit.org/show_bug.cgi?id=181398
719         <rdar://problem/36357879>
720
721         Reviewed by Alex Christensen.
722
723         No new tests. Discussed with Alex Christensen and we concluded that
724         both a layout test and an API test would require a lot of work and
725         we have existing tests for clearing out storage access for frames.
726
727         * platform/network/NetworkStorageSession.h:
728         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
729         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
730
731 2018-01-08  Matt Lewis  <jlewis3@apple.com>
732
733         Unreviewed, rolling out r226385.
734
735         The test introduced with this was a flaky since being added.
736
737         Reverted changeset:
738
739         "AX: when invert colors is on, double-invert certain media
740         elements in UserAgentStyleSheet"
741         https://bugs.webkit.org/show_bug.cgi?id=168447
742         https://trac.webkit.org/changeset/226385
743
744 2018-01-08  Youenn Fablet  <youenn@apple.com>
745
746         SWClientConnection should not keep references to service worker jobs
747         https://bugs.webkit.org/show_bug.cgi?id=181381
748
749         Reviewed by Chris Dumez.
750
751         Difficult to test determiniscally but corresponding crash log should no longer happen in debug builds.
752
753         Stopped passing ServiceWorkerJob references from ServiceWorkerContainer (potentially in service worker thread) to SWClientConnection (main thread).
754         Instead pass job identifiers and related data to the main thread.
755
756         Minor refactoring to use ServiceWorkerJobIdentifier instead of ServiceWorkerJobDataIdentifier which contains more data than needed.
757
758         * workers/service/SWClientConnection.cpp:
759         (WebCore::SWClientConnection::scheduleJob):
760         (WebCore::SWClientConnection::failedFetchingScript):
761         (WebCore::SWClientConnection::postTaskForJob):
762         (WebCore::SWClientConnection::jobRejectedInServer):
763         (WebCore::SWClientConnection::registrationJobResolvedInServer):
764         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
765         (WebCore::SWClientConnection::startScriptFetchForServer):
766         (WebCore::SWClientConnection::clearPendingJobs):
767         (WebCore::SWClientConnection::finishedFetchingScript): Deleted.
768         * workers/service/SWClientConnection.h:
769         * workers/service/ServiceWorkerContainer.cpp:
770         (WebCore::ServiceWorkerContainer::scheduleJob):
771         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
772         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
773         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
774         * workers/service/ServiceWorkerContainer.h:
775         * workers/service/server/SWServer.cpp:
776         (WebCore::SWServer::rejectJob):
777         (WebCore::SWServer::resolveRegistrationJob):
778         (WebCore::SWServer::resolveUnregistrationJob):
779         (WebCore::SWServer::startScriptFetch):
780         * workers/service/server/SWServer.h:
781
782 2018-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
783
784         Copying, pasting, and then deleting an attachment element breaks attachment data requests
785         https://bugs.webkit.org/show_bug.cgi?id=181365
786         <rdar://problem/36340647>
787
788         Reviewed by Tim Horton.
789
790         Currently, copying and pasting an attachment element within the same document and then deleting backwards to
791         remove the pasted attachment element causes the original attachment element to be inaccessible via SPI. This is
792         because there are now two different attachment elements with the same unique identifier, such that Document,
793         which keeps a map of all unique attachment identifiers to attachment elements, will lose track of the original
794         attachment element.
795
796         To fix this, we ensure that attachment elements should always have unique identifiers when they are inserted
797         into the document. We make several small adjustments to accomplish this:
798
799         1.  First, refactor HTMLAttachmentElement's unique identifier so that it no longer depends on the value of the
800             "webkitattachmentid" attribute, and is instead just a member of HTMLAttachmentElement that is not exposed to
801             DOM bindings. This means setting and querying an attachment element's uniqueIdentifier can be done without
802             triggering any side effects, such as layout or mutation events.
803
804         2.  Next, make "webkitattachmentid" a temporary attribute similar to "webkitattachmentpath" and
805             "webkitattachmentbloburl", so that it is added only when generating a markup fragment for editing, and
806             removed upon deserialization.
807
808         3.  Lastly, shift the responsibility of assigning a unique identifier to an attachment away from places where we
809             create attachment elements, and instead have Document enforce this when an attachment element is inserted.
810
811         Tests:  WKAttachmentTests.InsertAndRemoveDuplicateAttachment
812                 WKAttachmentTests.InsertDuplicateAttachmentAndUpdateData
813
814         * dom/Document.cpp:
815         (WebCore::Document::didInsertAttachmentElement):
816
817         Assign the unique identifier of an attachment element that has been inserted. If the identifier already tracks
818         an existing attachment element in the document or is missing, reassign the identifier to a new value.
819
820         * editing/cocoa/WebContentReaderCocoa.mm:
821         (WebCore::createFragmentForImageAttachment):
822         (WebCore::replaceRichContentWithAttachments):
823         (WebCore::WebContentReader::readFilePaths):
824
825         Remove calls to setUniqueIdentifier here, since Document will assign a unique identifier upon insertion.
826
827         * editing/markup.cpp:
828         (WebCore::StyledMarkupAccumulator::appendCustomAttributes):
829         (WebCore::createFragmentFromMarkup):
830
831         Set the attachment's unique identifier to the value of the "webkitattachmentid" attribute. When moving existing
832         attachments around in the DOM without duplication, this ensures that the attachment will be removed and
833         reinserted in the document without triggering removal and insertion client delegate methods.
834
835         When pasting an attachment element that has the same identifier as an existing attachment, we let Document
836         realize that the attachment identifier already exists, and reassign it to a unique value.
837
838         * html/HTMLAttachmentElement.cpp:
839         (WebCore::HTMLAttachmentElement::uniqueIdentifier const): Deleted.
840         (WebCore::HTMLAttachmentElement::setUniqueIdentifier): Deleted.
841         * html/HTMLAttachmentElement.h:
842
843 2018-01-08  Zalan Bujtas  <zalan@apple.com>
844
845         [RenderTreeBuilder] Move RenderBlockFlow addChild logic to RenderTreeBuilder
846         https://bugs.webkit.org/show_bug.cgi?id=181348
847         <rdar://problem/36328117>
848
849         Reviewed by Antti Koivisto.
850
851         This is about moving the code, no cleanup and/or normalization (unfortunately it also means
852         some temporary changes).  
853
854         No change in functionality.
855
856         * Sources.txt:
857         * WebCore.xcodeproj/project.pbxproj:
858         * rendering/RenderBlockFlow.cpp:
859         (WebCore::RenderBlockFlow::addChild):
860         * rendering/updating/RenderTreeBuilder.cpp:
861         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
862         (WebCore::RenderTreeBuilder::insertChildToRenderBlockFlow):
863         * rendering/updating/RenderTreeBuilder.h:
864         (WebCore::RenderTreeBuilder::blockFlowBuilder):
865         * rendering/updating/RenderTreeBuilderBlockFlow.cpp: Added.
866         (WebCore::RenderTreeBuilder::BlockFlow::BlockFlow):
867         (WebCore::RenderTreeBuilder::BlockFlow::insertChild):
868         * rendering/updating/RenderTreeBuilderBlockFlow.h: Added.
869
870 2018-01-08  Youenn Fablet  <youenn@apple.com>
871
872         Add CSP support to service workers
873         https://bugs.webkit.org/show_bug.cgi?id=181385
874
875         Reviewed by Chris Dumez.
876
877         Covered by rebased tests.
878
879         Added recovery of CSP information from WorkerScriptLoader.
880         Added plumbing to pass the CSP information to Service Workers.
881         Added persistency support for the CSP information.
882
883         * workers/WorkerScriptLoader.cpp:
884         (WebCore::WorkerScriptLoader::loadAsynchronously):
885         (WebCore::WorkerScriptLoader::didReceiveResponse):
886         * workers/WorkerScriptLoader.h:
887         (WebCore::WorkerScriptLoader::contentSecurityPolicy const):
888         * workers/service/SWClientConnection.cpp:
889         (WebCore::SWClientConnection::finishedFetchingScript):
890         (WebCore::SWClientConnection::failedFetchingScript):
891         * workers/service/SWClientConnection.h:
892         * workers/service/ServiceWorkerContainer.cpp:
893         (WebCore::ServiceWorkerContainer::addRegistration):
894         (WebCore::ServiceWorkerContainer::jobFailedWithException):
895         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
896         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
897         * workers/service/ServiceWorkerContainer.h:
898         * workers/service/ServiceWorkerContextData.cpp:
899         (WebCore::ServiceWorkerContextData::isolatedCopy const):
900         * workers/service/ServiceWorkerContextData.h:
901         (WebCore::ServiceWorkerContextData::encode const):
902         (WebCore::ServiceWorkerContextData::decode):
903         * workers/service/ServiceWorkerFetchResult.h:
904         (WebCore::ServiceWorkerFetchResult::encode const):
905         (WebCore::ServiceWorkerFetchResult::decode):
906         * workers/service/ServiceWorkerGlobalScope.cpp:
907         (WebCore::ServiceWorkerGlobalScope::create):
908         * workers/service/ServiceWorkerGlobalScope.h:
909         * workers/service/ServiceWorkerJob.cpp:
910         (WebCore::ServiceWorkerJob::notifyFinished):
911         * workers/service/ServiceWorkerJobClient.h:
912         * workers/service/context/ServiceWorkerThread.cpp:
913         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
914         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
915         * workers/service/server/RegistrationDatabase.cpp:
916         (WebCore::v1RecordsTableSchema):
917         (WebCore::RegistrationDatabase::openSQLiteDatabase):
918         (WebCore::RegistrationDatabase::doPushChanges):
919         (WebCore::RegistrationDatabase::importRecords):
920         * workers/service/server/SWServer.cpp:
921         (WebCore::SWServer::updateWorker):
922         (WebCore::SWServer::installContextData):
923         * workers/service/server/SWServer.h:
924         * workers/service/server/SWServerJobQueue.cpp:
925         (WebCore::SWServerJobQueue::scriptFetchFinished):
926         * workers/service/server/SWServerWorker.cpp:
927         (WebCore::SWServerWorker::SWServerWorker):
928         (WebCore::m_contentSecurityPolicy):
929         (WebCore::SWServerWorker::contextData const):
930         * workers/service/server/SWServerWorker.h:
931
932 2018-01-08  Youenn Fablet  <youenn@apple.com>
933
934         Use no-cache fetch mode when loading main documents with location.reload()
935         https://bugs.webkit.org/show_bug.cgi?id=181285
936
937         Reviewed by Alex Christensen.
938
939         Covered by rebased tests.
940
941         Start to translate cache policy used for navigation as FetchOptions::Cache.
942         This allows ensuring service workers receive the right cache mode when intercepting navigation loads.
943         To not change current navigation behavior, ReturnCacheDataElseLoad and ReturnCacheDataDontLoad still trigger default fetch cache mode.
944
945         For Reload and ReloadExpiredOnly frame load types, using no-cache mode is more efficient than reload mode,
946         as a conditional request will be sent if possible. This applies to location.reload which is consistent with other browsers.
947         Keep reload mode for ReloadFromOrigin.
948
949         * loader/DocumentLoader.cpp:
950         (WebCore::toFetchOptionsCache):
951         (WebCore::DocumentLoader::loadMainResource):
952         * loader/FrameLoader.cpp:
953         (WebCore::FrameLoader::loadFrameRequest):
954         (WebCore::FrameLoader::loadURL):
955         (WebCore::FrameLoader::load):
956         (WebCore::FrameLoader::reload):
957         (WebCore::FrameLoader::defaultRequestCachingPolicy):
958         (WebCore::FrameLoader::loadDifferentDocumentItem):
959         * loader/NavigationScheduler.cpp:
960
961 2018-01-08  Youenn Fablet  <youenn@apple.com>
962
963         Stop exposing fetch and extendable events to window
964         https://bugs.webkit.org/show_bug.cgi?id=181325
965
966         Reviewed by Chris Dumez.
967
968         Covered by updated tests.
969
970         Marked FetchEvent and ExtendableEvent as visible in ServiceWorker environments only.
971         Moved related Internals testing routines to ServiceWorkerInternals.
972
973         * testing/Internals.cpp:
974         (WebCore::Internals::waitForFetchEventToFinish): Deleted.
975         (WebCore::Internals::createBeingDispatchedFetchEvent): Deleted.
976         * testing/Internals.h:
977         * testing/Internals.idl:
978         * testing/ServiceWorkerInternals.cpp:
979         (WebCore::ServiceWorkerInternals::waitForFetchEventToFinish):
980         (WebCore::ServiceWorkerInternals::createBeingDispatchedFetchEvent):
981         * testing/ServiceWorkerInternals.h:
982         * testing/ServiceWorkerInternals.idl:
983         * workers/service/ExtendableEvent.idl:
984         * workers/service/FetchEvent.idl:
985
986 2018-01-08  Antti Koivisto  <antti@apple.com>
987
988         REGRESSION (r219145): Toggling layer borders on a static document no longer works immediately
989         https://bugs.webkit.org/show_bug.cgi?id=176260
990         <rdar://problem/34219966>
991
992         Reviewed by Simon Fraser.
993
994         Optimization reveled bugs in debug indicator painting.
995
996         Test: compositing/debug-borders-dynamic.html
997
998         * platform/graphics/ca/GraphicsLayerCA.cpp:
999         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1000         (WebCore::GraphicsLayerCA::updateDebugIndicators):
1001         (WebCore::GraphicsLayerCA::updateDebugBorder): Deleted.
1002
1003         - Rename to indicate this is not just about debug borders.
1004         - Trigger display so repaint counters get painted. This helper is only called when the indicators change.
1005
1006         * platform/graphics/ca/GraphicsLayerCA.h:
1007         * rendering/RenderLayerCompositor.cpp:
1008         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
1009
1010         Ensure we do compositing update on debug border change even when there is no layout.
1011
1012 2018-01-08  Zalan Bujtas <zalan@apple.com>
1013
1014         [RenderTreeBuilder] Move RenderInline addChild logic to RenderTreeBuilder
1015         https://bugs.webkit.org/show_bug.cgi?id=181336
1016         <rdar://problem/36324693>
1017
1018         Reviewed by Antti Koivisto.
1019
1020         This is about moving the code, no cleanup and/or normalization (unfortunately it also means
1021         some temporary changes).  
1022
1023         No change in functionality.
1024
1025         * Sources.txt:
1026         * WebCore.xcodeproj/project.pbxproj:
1027         * rendering/RenderInline.cpp:
1028         (WebCore::RenderInline::addChild):
1029         (WebCore::RenderInline::addChildIgnoringContinuation):
1030         (WebCore::RenderInline::childBecameNonInline):
1031         (WebCore::nextContinuation): Deleted.
1032         (WebCore::RenderInline::continuationBefore): Deleted.
1033         (WebCore::newChildIsInline): Deleted.
1034         (WebCore::RenderInline::cloneAsContinuation const): Deleted.
1035         (WebCore::RenderInline::splitInlines): Deleted.
1036         (WebCore::RenderInline::splitFlow): Deleted.
1037         (WebCore::canUseAsParentForContinuation): Deleted.
1038         (WebCore::RenderInline::addChildToContinuation): Deleted.
1039         * rendering/RenderInline.h:
1040         * rendering/updating/RenderTreeBuilder.cpp:
1041         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
1042         (WebCore::RenderTreeBuilder::insertChildToRenderInline):
1043         (WebCore::RenderTreeBuilder::insertChildToRenderInlineIgnoringContinuation):
1044         (WebCore::RenderTreeBuilder::splitFlow):
1045         * rendering/updating/RenderTreeBuilder.h:
1046         (WebCore::RenderTreeBuilder::inlineBuilder):
1047         * rendering/updating/RenderTreeBuilderInline.cpp: Added.
1048         (WebCore::canUseAsParentForContinuation):
1049         (WebCore::nextContinuation):
1050         (WebCore::continuationBefore):
1051         (WebCore::cloneAsContinuation):
1052         (WebCore::newChildIsInline):
1053         (WebCore::inFlowPositionedInlineAncestor):
1054         (WebCore::RenderTreeBuilder::Inline::Inline):
1055         (WebCore::RenderTreeBuilder::Inline::insertChild):
1056         (WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
1057         (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
1058         (WebCore::RenderTreeBuilder::Inline::splitFlow):
1059         (WebCore::RenderTreeBuilder::Inline::splitInlines):
1060         * rendering/updating/RenderTreeBuilderInline.h: Added.
1061
1062 2018-01-08  Zalan Bujtas  <zalan@apple.com>
1063
1064         [RenderTreeBuilder] Move RenderBlock addChild logic to RenderTreeBuilder
1065         https://bugs.webkit.org/show_bug.cgi?id=181319
1066         <rdar://problem/36313464>
1067
1068         Reviewed by Antti Koivisto.
1069
1070         This is about moving the code, no cleanup and/or normalization (unfortunately it also means
1071         some temporary changes).  
1072
1073         No change in functionality.
1074
1075         * Sources.txt:
1076         * WebCore.xcodeproj/project.pbxproj:
1077         * rendering/RenderBlock.cpp:
1078         (WebCore::RenderBlock::addChild):
1079         (WebCore::RenderBlock::addChildIgnoringContinuation):
1080         (WebCore::RenderBlock::childBecameNonInline):
1081         (WebCore::RenderBlock::continuationBefore): Deleted.
1082         (WebCore::RenderBlock::addChildToContinuation): Deleted.
1083         (WebCore::getInlineRun): Deleted.
1084         (WebCore::RenderBlock::makeChildrenNonInline): Deleted.
1085         * rendering/RenderBlock.h:
1086         * rendering/RenderBox.cpp:
1087         (WebCore::markBoxForRelayoutAfterSplit): Deleted.
1088         (WebCore::RenderBox::splitAnonymousBoxesAroundChild): Deleted.
1089         * rendering/RenderBox.h:
1090         * rendering/RenderRubyBase.cpp:
1091         (WebCore::RenderRubyBase::moveChildren):
1092         (WebCore::RenderRubyBase::moveBlockChildren):
1093         * rendering/RenderTable.cpp:
1094         (WebCore::RenderTable::addChild):
1095         * rendering/RenderTableRow.cpp:
1096         (WebCore::RenderTableRow::addChild):
1097         * rendering/RenderTableSection.cpp:
1098         (WebCore::RenderTableSection::addChild):
1099         * rendering/updating/RenderTreeBuilder.cpp:
1100         (WebCore::markBoxForRelayoutAfterSplit):
1101         (WebCore::getInlineRun):
1102         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
1103         (WebCore::RenderTreeBuilder::insertChildToRenderBlock):
1104         (WebCore::RenderTreeBuilder::insertChildToRenderBlockIgnoringContinuation):
1105         (WebCore::RenderTreeBuilder::makeChildrenNonInline):
1106         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
1107         * rendering/updating/RenderTreeBuilder.h:
1108         (WebCore::RenderTreeBuilder::blockBuilder):
1109         * rendering/updating/RenderTreeBuilderBlock.cpp: Added.
1110         (WebCore::continuationBefore):
1111         (WebCore::RenderTreeBuilder::Block::Block):
1112         (WebCore::RenderTreeBuilder::Block::insertChild):
1113         (WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
1114         (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
1115         * rendering/updating/RenderTreeBuilderBlock.h: Added.
1116         
1117 2018-01-08  Jeremy Jones  <jeremyj@apple.com>
1118
1119         Standard controls sometimes say video is in pip when it isnt.
1120         https://bugs.webkit.org/show_bug.cgi?id=181095
1121         rdar://problem/36182687
1122
1123         Reviewed by Eric Carlson.
1124
1125         * html/HTMLMediaElement.cpp:
1126         (WebCore::HTMLMediaElement::exitFullscreen):
1127
1128 2018-01-08  Jer Noble  <jer.noble@apple.com>
1129
1130         REGRESSION: [iOS] ASSERTION FAILED: !node.isConnected() in WebCore::notifyNodeInsertedIntoDocument
1131         https://bugs.webkit.org/show_bug.cgi?id=181091
1132
1133         Reviewed by Darin Adler.
1134
1135         Move the work previously performed in insertedIntoAncestor() into didFinishInsertingNode().
1136
1137         * html/HTMLMediaElement.cpp:
1138         (WebCore::HTMLMediaElement::prepareForLoad):
1139
1140 2018-01-08  Zan Dobersek  <zdobersek@igalia.com>
1141
1142         [Cairo] Use isolated fill and stroke source containers
1143         https://bugs.webkit.org/show_bug.cgi?id=181386
1144
1145         Reviewed by Carlos Garcia Campos.
1146
1147         Generate fill and stroke source objects upon invocation of various Cairo
1148         operations, initializing necessary data from the GraphicsContextState
1149         object.
1150
1151         Cairo::FillSource and Cairo::StrokeSource structs are introduced, both
1152         being default-constructible as well as providing a constructor that
1153         accepts a GraphicsContextState object from which the appropriate
1154         resources are created.
1155
1156         The FillSource and StrokeSource objects are then passed to
1157         PlatformContextCairo's prepareForFilling() and prepareForStroking()
1158         methods. Here the helper prepareCairoContextSource() function is now
1159         invoked with cairo_pattern_t objects as pattern or gradient sources, or
1160         the source color if neither cairo_pattern_t object is specified.
1161
1162         The FillSource and StrokeSource constructors mimic the previous behavior
1163         of prepareCairoContextSource(). In case the source is a Pattern object,
1164         a cairo_pattern_t object is created from that. In case of FillSource,
1165         we also retrieve pattern size, transform and repetition information. In
1166         case the source os a Gradient object, we create a 'base' cairo_pattern_t
1167         object for a completely opaque alpha channel. Additionally, if the alpha
1168         value on the state is not 1, we create an alpha-adjusted cairo_pattern_t
1169         that is potentially used for any filling or stroking operation that has
1170         to preserve transparency. If neither Pattern or Gradient objects are set
1171         on the GraphicsContextState, we default to the current fill or stroke
1172         color.
1173
1174         Overall, there's no change in behavior, this is simply a refactoring
1175         that enables us to construct Cairo objects for filling and stroking
1176         sources at the time of Cairo operation dispatch, instead of pulling down
1177         GraphicsContextState deeper into the Cairo-specific code.
1178
1179         No new tests -- no change in functionality.
1180
1181         * platform/graphics/cairo/CairoOperations.cpp:
1182         (WebCore::Cairo::drawPathShadow):
1183         (WebCore::Cairo::fillCurrentCairoPath):
1184         (WebCore::Cairo::FillSource::FillSource):
1185         (WebCore::Cairo::StrokeSource::StrokeSource):
1186         (WebCore::Cairo::fillRect):
1187         (WebCore::Cairo::fillRectWithRoundedHole):
1188         (WebCore::Cairo::fillPath):
1189         (WebCore::Cairo::strokeRect):
1190         (WebCore::Cairo::strokePath):
1191         (WebCore::Cairo::drawGlyphs):
1192         * platform/graphics/cairo/CairoOperations.h:
1193         * platform/graphics/cairo/FontCairo.cpp:
1194         (WebCore::FontCascade::drawGlyphs):
1195         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1196         (WebCore::GraphicsContext::fillPath):
1197         (WebCore::GraphicsContext::strokePath):
1198         (WebCore::GraphicsContext::fillRect):
1199         (WebCore::GraphicsContext::strokeRect):
1200         (WebCore::GraphicsContext::fillRectWithRoundedHole):
1201         * platform/graphics/cairo/PlatformContextCairo.cpp:
1202         (WebCore::prepareCairoContextSource):
1203         (WebCore::PlatformContextCairo::prepareForFilling):
1204         (WebCore::PlatformContextCairo::prepareForStroking):
1205         (WebCore::PlatformContextCairo::clipForPatternFilling):
1206         * platform/graphics/cairo/PlatformContextCairo.h:
1207
1208 2018-01-08  Youenn Fablet  <youenn@apple.com>
1209
1210         navigator.onLine does not work inside service workers
1211         https://bugs.webkit.org/show_bug.cgi?id=181079
1212         <rdar://problem/36178606>
1213
1214         Reviewed by Darin Adler.
1215
1216         Test: http/wpt/service-workers/online.https.html
1217
1218         Added support for onLine by reusing a similar implementation as regular workers.
1219         Added ServiceWorkerInternals as an interface for an object exposed as self.internals in WTR.
1220         This object has currently one method to trigger change in the online/offline status.
1221         This allows writing a test for the onLine feature.
1222
1223         Note that self.internals is inserted asynchronously after the script was evaluated.
1224         When writing a worker script using self.internals, one must make sure to use self.internals when initialized.
1225         online-worker.js for instance makes use of self.internals in a postMessage callback.
1226
1227         * CMakeLists.txt:
1228         * DerivedSources.make:
1229         * WebCore.xcodeproj/project.pbxproj:
1230         * bindings/js/WorkerScriptController.h:
1231         * dom/ScriptExecutionContext.h:
1232         * testing/ServiceWorkerInternals.cpp: Added.
1233         (WebCore::ServiceWorkerInternals::ServiceWorkerInternals):
1234         (WebCore::ServiceWorkerInternals::setOnline):
1235         * testing/ServiceWorkerInternals.h: Added.
1236         * testing/ServiceWorkerInternals.idl: Added.
1237         * testing/js/WebCoreTestSupport.cpp:
1238         (WebCoreTestSupport::setupNewlyCreateServiceWorker):
1239         * testing/js/WebCoreTestSupport.h:
1240         * workers/service/context/SWContextManager.cpp:
1241         (WebCore::SWContextManager::registerServiceWorkerThreadForInstall):
1242         (WebCore::SWContextManager::startedServiceWorker):
1243         * workers/service/context/SWContextManager.h:
1244         (WebCore::SWContextManager::setServiceWorkerCreationCallback):
1245         (WebCore::SWContextManager::workerByID):
1246         * workers/service/context/ServiceWorkerThread.cpp:
1247         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1248         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1249         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
1250         (WebCore::ServiceWorkerThreadProxy::~ServiceWorkerThreadProxy):
1251         (WebCore::ServiceWorkerThreadProxy::networkStateChanged):
1252         (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange):
1253         * workers/service/context/ServiceWorkerThreadProxy.h:
1254
1255 2018-01-08  Zan Dobersek  <zdobersek@igalia.com>
1256
1257         [Cairo] Contain shadow blur requirement state in a separate object
1258         https://bugs.webkit.org/show_bug.cgi?id=181380
1259
1260         Reviewed by Carlos Garcia Campos.
1261
1262         Instead of picking up the necessary state parameters from a
1263         GraphicsContextState object, store the necessary parameters in a helper
1264         ShadowBlurUsage struct. Mimicking the mustUseShadowBlur() function that
1265         is being removed, values of the shadow color, shadow blur, and shadow
1266         transform ignorance are stored there. Additionally, the required()
1267         method accepts a PlatformContextCairo object through which it can
1268         retrieve the current CTM and determine whether it's an identity, finally
1269         deciding whether shadow blur can or cannot be ignored.
1270
1271         Goal of this change is to limit usage of GraphicsContextState directly
1272         in operations implemented inside the Cairo namespace. Instead, the
1273         state parameters should be passed directly, or an equivalent but limited
1274         state object should be constructed for invocation of such operations.
1275
1276         This is likely only an intermediate solution. It's possible it will be
1277         replaced by a more complete shadow state struct that would be used for
1278         any operation that is required to draw shadows, if necessary.
1279
1280         No new tests -- no change in functionality.
1281
1282         * platform/graphics/cairo/CairoOperations.cpp:
1283         (WebCore::Cairo::drawGlyphsShadow):
1284         (WebCore::Cairo::ShadowBlurUsage::ShadowBlurUsage):
1285         (WebCore::Cairo::ShadowBlurUsage::required const):
1286         (WebCore::Cairo::fillRectWithRoundedHole):
1287         (WebCore::Cairo::drawGlyphs):
1288         (WebCore::Cairo::mustUseShadowBlur): Deleted.
1289         * platform/graphics/cairo/CairoOperations.h:
1290         * platform/graphics/cairo/FontCairo.cpp:
1291         (WebCore::FontCascade::drawGlyphs):
1292         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1293         (WebCore::GraphicsContext::fillRectWithRoundedHole):
1294
1295 2018-01-08  Philippe Normand  <pnormand@igalia.com>
1296
1297         [GStreamer][Soup] Remove dead getCreateOrReadBuffer code path
1298         https://bugs.webkit.org/show_bug.cgi?id=181376
1299
1300         Reviewed by Carlos Garcia Campos.
1301
1302         This code path is no longer used now that the GStreamer HTTP
1303         source element uses data coming directly from the network process.
1304
1305         * SourcesGTK.txt:
1306         * SourcesWPE.txt:
1307         * loader/MediaResourceLoader.cpp:
1308         (WebCore::MediaResource::getOrCreateReadBuffer): Deleted.
1309         * loader/MediaResourceLoader.h:
1310         * loader/SubresourceLoader.h:
1311         * loader/cache/CachedRawResource.h:
1312         * loader/cache/CachedRawResourceClient.h:
1313         (WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
1314         (WebCore::CachedRawResourceClient::getOrCreateReadBuffer): Deleted.
1315         * loader/cache/CachedResource.h:
1316         (WebCore::CachedResource::getOrCreateReadBuffer): Deleted.
1317         * loader/soup/CachedRawResourceSoup.cpp: Removed.
1318         * loader/soup/SubresourceLoaderSoup.cpp: Removed.
1319         * platform/graphics/PlatformMediaResourceLoader.h:
1320         (WebCore::PlatformMediaResourceClient::loadFinished):
1321         (WebCore::PlatformMediaResourceClient::getOrCreateReadBuffer): Deleted.
1322         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1323         (CachedResourceStreamingClient::getOrCreateReadBuffer): Deleted.
1324         * platform/network/ResourceHandleClient.h:
1325         (WebCore::ResourceHandleClient::getOrCreateReadBuffer): Deleted.
1326         * platform/network/soup/ResourceHandleSoup.cpp:
1327         (WebCore::ResourceHandle::ensureReadBuffer):
1328
1329 2018-01-08  Zan Dobersek  <zdobersek@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
1330
1331         [GStreamer] use FastMalloc-based GstAllocator
1332         https://bugs.webkit.org/show_bug.cgi?id=165793
1333
1334         Reviewed by Philippe Normand.
1335
1336         Add GstAllocatorFastMalloc, a GstAllocator implementation using fast malloc. It's only used when fast malloc is
1337         enabled and can be disabled using an environment variable for debugging purposes.
1338
1339         * platform/GStreamer.cmake:
1340         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1341         (WebCore::initializeGStreamer):
1342         * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp: Added.
1343         (gstMemoryFastMallocNew):
1344         (gstAllocatorFastMallocAlloc):
1345         (gstAllocatorFastMallocFree):
1346         (gstAllocatorFastMallocMemMap):
1347         (gstAllocatorFastMallocMemUnmap):
1348         (gstAllocatorFastMallocMemCopy):
1349         (gstAllocatorFastMallocMemShare):
1350         (gstAllocatorFastMallocMemIsSpan):
1351         (gst_allocator_fast_malloc_class_init):
1352         (gst_allocator_fast_malloc_init):
1353         * platform/graphics/gstreamer/GstAllocatorFastMalloc.h: Added.
1354
1355 2018-01-07  Ms2ger  <Ms2ger@igalia.com>
1356
1357         Implement createImageBitmap(ImageBitmap)
1358         https://bugs.webkit.org/show_bug.cgi?id=181287
1359
1360         Reviewed by Darin Adler.
1361
1362         Tests: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
1363                imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
1364
1365         * html/ImageBitmap.cpp:
1366         (WebCore::ImageBitmap::createPromise):
1367
1368 2018-01-07  Ryosuke Niwa  <rniwa@webkit.org>
1369
1370         Reduce the precision of "high" resolution time to 1ms
1371         https://bugs.webkit.org/show_bug.cgi?id=180910
1372         <rdar://problem/36085943>
1373
1374         Reviewed by Saam Barati.
1375
1376         Reduced the high prevision time's resolution to 1ms, the same precision as Date.now().
1377
1378         Also fixed the bug in fillRTCStats that we weren't reducing the time resolution in RTCStats dictionaries.
1379
1380         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1381         (WebCore::fillRTCStats):
1382         * page/Performance.cpp:
1383         (WebCore::Performance::reduceTimeResolution):
1384
1385 2018-01-06  Simon Fraser  <simon.fraser@apple.com>
1386
1387         Possible crash computing event regions
1388         https://bugs.webkit.org/show_bug.cgi?id=181368
1389         rdar://problem/34847081
1390
1391         Reviewed by Zalan Bujtas.
1392
1393         Don't trigger layout in Element::absoluteEventHandlerBounds(), since this can run arbirary script
1394         which might delete elements or re-enter Document::absoluteRegionForEventTargets().
1395
1396         It's OK to not trigger layout, because if layout is dirty, the next layout will update event regions again.
1397
1398         Add a LayoutDisallowedScope to check that Document::absoluteRegionForEventTargets() doesn't
1399         trigger layout, and move the check for LayoutDisallowedScope::isLayoutAllowed() from Document::updateLayout()
1400         to LayoutContext::layout(), since some layouts don't happen via the former (e.g. the one being removed here).
1401
1402         The test checks that the assertion does not fire. I was not able to get a reliable test for any crash.
1403
1404         Test: fast/events/event-handler-regions-layout.html
1405
1406         * dom/Document.cpp:
1407         (WebCore::Document::updateLayout):
1408         (WebCore::Document::absoluteRegionForEventTargets):
1409         * dom/Element.cpp:
1410         (WebCore::Element::absoluteEventHandlerBounds):
1411         * page/LayoutContext.cpp:
1412         (WebCore::LayoutContext::layout):
1413         * rendering/LayoutDisallowedScope.h: Move the #ifdefs around to avoid defining the enum twice.
1414         (WebCore::LayoutDisallowedScope::LayoutDisallowedScope):
1415         (WebCore::LayoutDisallowedScope::isLayoutAllowed):
1416
1417 2018-01-06  Simon Fraser  <simon.fraser@apple.com>
1418
1419         Crash under RenderLayer::scrollTo() with marquee
1420         https://bugs.webkit.org/show_bug.cgi?id=181349
1421         rdar://problem/36190168
1422
1423         Reviewed by Zalan Bujtas.
1424
1425         Don't call updateWidgetPositions() synchonously during RenderLayer scrolling, because it
1426         can run arbitrary script which may trigger destruction of this RenderLayer.
1427
1428         Instead, queue up updateWidgetPositions() on a zero-delay timer.
1429
1430         Under some circumstances this may allow a paint to occur before the widgets have been
1431         updated (which could be fixed with a more invasive change), but in practice I saw no
1432         painting issues with plug-ins or iframes inside overflow scroll, in WebKit or LegacyWebKit.
1433
1434         Test: fast/scrolling/marquee-scroll-crash.html
1435
1436         * page/FrameView.cpp:
1437         (WebCore::FrameView::FrameView):
1438         (WebCore::FrameView::updateWidgetPositions):
1439         (WebCore::FrameView::scheduleUpdateWidgetPositions):
1440         (WebCore::FrameView::updateWidgetPositionsTimerFired):
1441         * page/FrameView.h:
1442         * rendering/RenderLayer.cpp:
1443         (WebCore::RenderLayer::scrollTo):
1444
1445 2018-01-05  Dean Jackson  <dino@apple.com>
1446
1447         Accurately clip copyTexImage2D and copyTexSubImage2D
1448         https://bugs.webkit.org/show_bug.cgi?id=181356
1449         <rdar://problem/35083877>
1450
1451         Reviewed by Eric Carlson.
1452
1453         The code to make sure copyTexSubImage2D and copyTexImage2D will not try to read
1454         out of bounds had a bad bug introduced here:
1455         https://bugs.webkit.org/show_bug.cgi?id=51421
1456
1457         With appropriate parameters, it would produce a rectangle with
1458         negative dimensions. Most GL drivers just ignored this, but some
1459         are not happy.
1460
1461         Test: fast/canvas/webgl/copy-tex-image-and-sub-image-2d-bad-input.html
1462
1463         * html/canvas/WebGLRenderingContextBase.cpp:
1464         (WebCore::clip2D): Reimplement this in a more sane manner, and use
1465         checked arithmetic while here.
1466         * html/canvas/WebGLRenderingContextBase.h:
1467         (WebCore::clip1D): Deleted.
1468         (WebCore::clip2D): Deleted.
1469
1470 2018-01-06  Antti Koivisto  <antti@apple.com>
1471
1472         Use WeakPtr for RenderTreePosition::m_nextSibling
1473         https://bugs.webkit.org/show_bug.cgi?id=181363
1474
1475         Reviewed by Zalan Bujtas.
1476
1477         For safety. In most cases it is null and won't cause us to instantiate WeakReferences for
1478         many new objects.
1479
1480         * rendering/updating/RenderTreePosition.cpp:
1481         (WebCore::RenderTreePosition::computeNextSibling):
1482         * rendering/updating/RenderTreePosition.h:
1483         (WebCore::RenderTreePosition::RenderTreePosition):
1484         (WebCore::RenderTreePosition::nextSibling const):
1485
1486 2018-01-05  David Kilzer  <ddkilzer@apple.com>
1487
1488         Re-enable -Wcast-qual in WebCore for Apple ports
1489         <https://webkit.org/b/177895>
1490         <rdar://problem/34960830>
1491
1492         Reviewed by Joseph Pecoraro.
1493
1494         * Configurations/Base.xcconfig:
1495         (WARNING_CFLAGS): Remove FIXME and add -Wcast-qual back to
1496         arguments.
1497
1498         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
1499         (WebCore::createAndStoreMasterKey):
1500         - Use checked_cf_cast<SecACLRef>().
1501
1502         * editing/cocoa/DataDetection.mm:
1503         (WebCore::detectItemAtPositionWithRange):
1504         - Manually cast CFTypeRef to DDResultRef until
1505           DDResultGetTypeID() is available as SPI.
1506
1507         * platform/gamepad/mac/HIDGamepad.cpp:
1508         (WebCore::HIDGamepad::initElementsFromArray):
1509         - Use checked_cf_cast<IOHIDElementRef>().
1510
1511         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
1512         (WebCore::MediaSampleAVFObjC::createImageSample):
1513         (WebCore::CMSampleBufferIsRandomAccess):
1514         (WebCore::CMSampleBufferIsNonDisplaying):
1515         (WebCore::MediaSampleAVFObjC::createNonDisplayingCopy const):
1516         - Use checked_cf_cast<CFMutableDictionaryRef>() and
1517           checked_cf_cast<CFDictionaryRef>().
1518
1519         * platform/graphics/cocoa/IOSurface.h:
1520         (WebCore::IOSurface::asLayerContents):
1521         - Use reinterpret_cast<id>() to cast from IOSurfaceRef to id.
1522
1523         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1524         (WebCore::WebCoreDecompressionSession::getFirstVideoFrame):
1525         (WebCore::WebCoreDecompressionSession::automaticDequeue):
1526         (WebCore::WebCoreDecompressionSession::imageForTime):
1527         (WebCore::WebCoreDecompressionSession::getDecodeTime):
1528         (WebCore::WebCoreDecompressionSession::getPresentationTime):
1529         (WebCore::WebCoreDecompressionSession::getDuration):
1530         - Use checked_cf_cast<CMSampleBufferRef>().
1531
1532         * platform/graphics/Font.h:
1533         (WebCore::Font::m_kernedCFStringAttributes):
1534         (WebCore::Font::m_nonKernedCFStringAttributes):
1535         - Change type from RetainPtr<CFDictionaryRef> to
1536           RetainPtr<CFMutableDictionaryRef> since that's what they are.
1537         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1538         (WebCore::Font::getCFStringAttributes const):
1539         - Replace local `mutableAttributes` variable with
1540           `attributesDictionary.get()` since it returns the correct type
1541           now.
1542
1543         * platform/ios/wak/WAKView.mm:
1544         (-[WAKView _initWithViewRef:]):
1545         (_WAKCopyWrapper):
1546         * platform/ios/wak/WKView.mm:
1547         (_WKViewClearSuperview):
1548         (WKViewFirstChild):
1549         (WKViewNextSibling):
1550         - Use static_cast<WKViewRef>(const_cast<void*>()) to convert
1551           const void* variable to WKViewRef.
1552
1553         * platform/mac/PasteboardMac.mm:
1554         (WebCore::flipImageSpec):
1555         (WebCore::setDragImageImpl):
1556         - Use const_cast<> to remove 'const' modifier from
1557           unsigned char pointers.  This regressed while -Wcast-qual was
1558           disabled for WebCore.
1559
1560         * platform/mac/SSLKeyGeneratorMac.mm:
1561         (WebCore::signedPublicKeyAndChallengeString):
1562         - Use checked_cf_cast<SecACLRef>().
1563
1564         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp:
1565         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
1566         - Use checked_cf_cast<CFMutableDictionaryRef>().
1567
1568         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1569         (WebCore::copyCONNECTProxyResponse):
1570         - Use checked_cf_cast<CFHTTPMessageRef>().
1571
1572         * platform/network/cocoa/ResourceResponseCocoa.mm:
1573         (WebCore::ResourceResponse::platformCertificateInfo const):
1574         - Use checked_cf_cast<SecTrustRef>().
1575
1576         * platform/network/mac/CertificateInfoMac.mm:
1577         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate const):
1578         (WebCore::CertificateInfo::dump const):
1579         - Use checked_cf_cast<SecCertificateRef>().
1580
1581         * testing/cocoa/WebArchiveDumpSupport.mm:
1582         (WebCoreTestSupport::createCFURLResponseFromResponseData):
1583         - Use checked_cf_cast<>() for CFMutable* types.
1584
1585 2018-01-05  John Wilander  <wilander@apple.com>
1586
1587         Storage Access API: Refactor to make naming accurate and explicit, simplify access table, and prepare for access removal for page
1588         https://bugs.webkit.org/show_bug.cgi?id=181357
1589         <rdar://problem/36331031>
1590
1591         Reviewed by Alex Christensen.
1592
1593         No new tests. The only changed functionality that isn't covered
1594         by existing tests is cross-origin iframes in the same partition
1595         should be handled as already having access. This cannot be
1596         tested in layout tests since they don't support subdomains.
1597
1598         This change does the following:
1599         - Changes function and message names to reflect how this feature
1600           was eventually implemented, i.e. access per frame.
1601         - Makes it explicit that the UI process is only involved in
1602           granting storage access and not removing storage access.
1603           The latter is done directly by the web process.
1604         - Simplifies the network process' entry map since only needs to
1605           be able to give access to one domain in one frame at a time.
1606           Access goes away on frame navigation so there can only be one
1607           domain at a time per frame. Also, the map now uses pageIDs as
1608           main keys to prepare for efficient access removal for all
1609           frames under a page.
1610         - Fixes a bug in so that a cross-origin iframe with the same
1611           partition as the top frame correctly is handled as already
1612           having access.
1613
1614         * platform/network/NetworkStorageSession.h:
1615         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1616         (WebCore::NetworkStorageSession::cookieStoragePartition const):
1617             The only change here is the changed named of the call to
1618             NetworkStorageSession::hasStorageAccessForFrame().
1619         (WebCore::NetworkStorageSession::hasStorageAccessForFrame const):
1620         (WebCore::NetworkStorageSession::grantStorageAccessForFrame):
1621         (WebCore::NetworkStorageSession::removeStorageAccessForFrame):
1622         (WebCore::NetworkStorageSession::isStorageAccessGranted const): Deleted.
1623         (WebCore::NetworkStorageSession::setStorageAccessGranted): Deleted.
1624         (WebCore::NetworkStorageSession::removeStorageAccess): Deleted.
1625
1626 2018-01-05  Youenn Fablet  <youenn@apple.com>
1627
1628         Implement Cache API partitioning based on ClientOrigin
1629         https://bugs.webkit.org/show_bug.cgi?id=181240
1630
1631         Reviewed by Alex Christensen.
1632
1633         Covered by updated tests.
1634
1635         Previously, cache storage was partitioned according the origin of the client, represented as a String.
1636         We now partition according both client and top origins, represented as a ClientOrigin
1637
1638         Minor refactoring to use more makePendingActivity.
1639         Added support for IPC serialization of ClientOrigin.
1640         Added SecurityOriginData::toString which is used by WebKit2 Cache Storage implementation.
1641
1642         * Modules/cache/CacheStorageConnection.cpp:
1643         (WebCore::CacheStorageConnection::open):
1644         (WebCore::CacheStorageConnection::retrieveCaches):
1645         * Modules/cache/CacheStorageConnection.h:
1646         (WebCore::CacheStorageConnection::clearMemoryRepresentation):
1647         (WebCore::CacheStorageConnection::doOpen):
1648         (WebCore::CacheStorageConnection::doRetrieveCaches):
1649         * Modules/cache/DOMCacheStorage.cpp:
1650         (WebCore::DOMCacheStorage::origin const):
1651         (WebCore::DOMCacheStorage::retrieveCaches):
1652         (WebCore::DOMCacheStorage::open):
1653         (WebCore::DOMCacheStorage::remove):
1654         * Modules/cache/DOMCacheStorage.h:
1655         * Modules/cache/WorkerCacheStorageConnection.cpp:
1656         (WebCore::WorkerCacheStorageConnection::doOpen):
1657         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
1658         * Modules/cache/WorkerCacheStorageConnection.h:
1659         * page/ClientOrigin.h:
1660         (WebCore::ClientOrigin::isolatedCopy const):
1661         (WebCore::ClientOrigin::encode const):
1662         (WebCore::ClientOrigin::decode):
1663         * page/SecurityOriginData.cpp:
1664         (WebCore::SecurityOriginData::toString const):
1665         (WebCore::SecurityOriginData::debugString const): Deleted.
1666         * page/SecurityOriginData.h:
1667         (WebCore::SecurityOriginData::debugString const):
1668         * testing/Internals.cpp:
1669         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
1670
1671 2018-01-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1672
1673         [Attachment Support] Add a way to write blob data to a file URL from the UI process
1674         https://bugs.webkit.org/show_bug.cgi?id=181236
1675
1676         Reviewed by Brady Eidson.
1677
1678         Add support for writing a blob to a designated file path. See comments below for more detail. No new tests, as
1679         there change in behavior yet. See part 2: https://bugs.webkit.org/show_bug.cgi?id=181199.
1680
1681         * page/DragController.cpp:
1682         (WebCore::DragController::dragAttachmentElement):
1683         * platform/PromisedBlobInfo.h:
1684
1685         Remove PromisedBlobData entirely. This was added with the premise of having the web process deliver blob data to
1686         the UI process. However, the new approach I'm taking just has the UI process tell the network process to write
1687         a blob to a given location, so a data structure to deliver blob data over IPC is no longer necessary.
1688
1689         (WebCore::PromisedBlobData::hasData const): Deleted.
1690         (WebCore::PromisedBlobData::hasFile const): Deleted.
1691         (WebCore::PromisedBlobData::operator bool const): Deleted.
1692         (WebCore::PromisedBlobData::fulfills const): Deleted.
1693         * platform/network/BlobRegistryImpl.cpp:
1694         (WebCore::BlobRegistryImpl::populateBlobsForFileWriting):
1695
1696         Introduce a new helper to build a list of blob data for file writing.
1697
1698         (WebCore::writeFilePathsOrDataBuffersToFile):
1699
1700         Introduce a new static helper to write blob data (a list of file paths and data buffers) to a given file handle.
1701         Automatically closes the given file handle upon exit.
1702
1703         (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
1704         (WebCore::BlobRegistryImpl::writeBlobToFilePath):
1705
1706         Pull out common logic in writeBlobsToTemporaryFiles and writeBlobToFilePath into helper methods (see above), and
1707         refactor both methods to use the helpers.
1708
1709         * platform/network/BlobRegistryImpl.h:
1710
1711 2018-01-05  Alex Christensen  <achristensen@webkit.org>
1712
1713         Forbid < and > in URL hosts
1714         https://bugs.webkit.org/show_bug.cgi?id=181308
1715         <rdar://problem/36012757>
1716
1717         Reviewed by Tim Horton.
1718
1719         https://url.spec.whatwg.org/#forbidden-host-code-point does not include these characters yet, but I think it should.
1720         Firefox fails to parse URLs with < or > in the host.  Chrome percent encodes them.  Safari needs to do something.
1721         The web platform tests are unclear on this case, and they will need to be updated with the specification.
1722         They do show a change in behavior, though.
1723
1724         * platform/URLParser.cpp:
1725         Add < and > to the list of forbidden host code points.
1726
1727 2018-01-05  Eric Carlson  <eric.carlson@apple.com>
1728
1729         [MediaStream] Add Mac screen capture source
1730         https://bugs.webkit.org/show_bug.cgi?id=181333
1731         <rdar://problem/36323219>
1732
1733         Reviewed by Dean Jackson.
1734
1735         * SourcesCocoa.txt: Add ScreenDisplayCaptureSourceMac.mm.
1736
1737         * WebCore.xcodeproj/project.pbxproj: Ditto.
1738
1739         * platform/cocoa/CoreVideoSoftLink.cpp: Declare new constants used.
1740         * platform/cocoa/CoreVideoSoftLink.h:
1741
1742         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
1743         (WebCore::displayReconfigurationCallBack): Call refreshCaptureDevices.
1744         (WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa): Unregister for display
1745         reconfiguration callbacks.
1746         (WebCore::DisplayCaptureManagerCocoa::captureDevices): Register for display reconfigrations.
1747         (WebCore::DisplayCaptureManagerCocoa::refreshCaptureDevices): Use CGActiveDisplayList to
1748         get list of active screens.
1749         (WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID): Validate screen
1750         ID, return CaptureDevice.
1751         * platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
1752
1753         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1754         (WebCore::VideoCaptureSourceFactoryMac::createVideoCaptureSource): Deal with screen capture
1755         on macOS.
1756
1757         Implement Mac screen capture with CGDisplayStream.
1758         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: Added.
1759         (WebCore::ScreenDisplayCaptureSourceMac::DisplaySurface::~DisplaySurface):
1760         (WebCore::ScreenDisplayCaptureSourceMac::DisplaySurface::operator=):
1761         (WebCore::ScreenDisplayCaptureSourceMac::DisplaySurface::ioSurface const):
1762         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: Added.
1763         (WebCore::roundUpToMacroblockMultiple):
1764         (WebCore::ScreenDisplayCaptureSourceMac::updateDisplayID):
1765         (WebCore::ScreenDisplayCaptureSourceMac::create):
1766         (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac):
1767         (WebCore::ScreenDisplayCaptureSourceMac::~ScreenDisplayCaptureSourceMac):
1768         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
1769         (WebCore::ScreenDisplayCaptureSourceMac::startProducingData):
1770         (WebCore::ScreenDisplayCaptureSourceMac::stopProducingData):
1771         (WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer):
1772         (WebCore::ScreenDisplayCaptureSourceMac::pixelBufferFromIOSurface):
1773         (WebCore::ScreenDisplayCaptureSourceMac::generateFrame):
1774         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream):
1775         (WebCore::ScreenDisplayCaptureSourceMac::applySize):
1776         (WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate):
1777         (WebCore::ScreenDisplayCaptureSourceMac::commitConfiguration):
1778         (WebCore::ScreenDisplayCaptureSourceMac::displayWasReconfigured):
1779         (WebCore::ScreenDisplayCaptureSourceMac::displayReconfigurationCallBack):
1780         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable):
1781
1782 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
1783
1784         [curl] Can't load file:// URL with a URL fragment identifier
1785         https://bugs.webkit.org/show_bug.cgi?id=181170
1786
1787         Reviewed by Alex Christensen.
1788
1789         No new tests. No change in behavior.
1790
1791         * platform/network/curl/CurlRequest.cpp:
1792         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
1793
1794 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
1795
1796         TextCodec uses std::array but does not include it
1797         https://bugs.webkit.org/show_bug.cgi?id=181340
1798
1799         Reviewed by Alex Christensen.
1800
1801         No new tests. No change in behavior.
1802
1803         * platform/text/TextCodec.h:
1804
1805 2018-01-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
1806
1807         SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded() should do nothing if the property is not animating
1808         https://bugs.webkit.org/show_bug.cgi?id=181316
1809         <rdar://problem/36147545>
1810
1811         Reviewed by Simon Fraser.
1812
1813         This is a speculative change to fix a crash which appeared after r226065.
1814         The crash is very intermittent and sometimes very hard to reproduce. The
1815         basic code analysis did not show how this crash can even happen.
1816
1817         * svg/SVGAnimatedTypeAnimator.h:
1818         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues): For SVG property
1819         with two values, e.g. <SVGAngleValue, SVGMarkerOrientType>,  we need to
1820         detach the wrappers of the animated property if the animated values are
1821         going to change. This is similar to what we did in resetFromBaseValue().
1822
1823         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1824         (WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded):
1825
1826 2018-01-05  Matt Lewis  <jlewis3@apple.com>
1827
1828         Unreviewed, rolling out r226401.
1829
1830         This caused timeouts on multiple platforms.
1831
1832         Reverted changeset:
1833
1834         "Implement Cache API partitioning based on ClientOrigin"
1835         https://bugs.webkit.org/show_bug.cgi?id=181240
1836         https://trac.webkit.org/changeset/226401
1837
1838 2018-01-05  Dan Bernstein  <mitz@apple.com>
1839
1840         Fixed the build following AppKit API deprecations in a recent SDKs
1841
1842         * platform/mac/PasteboardMac.mm:
1843         (WebCore::setDragImageImpl): Suppressed deprecation warnings.
1844         * platform/mac/WidgetMac.mm:
1845         (WebCore::Widget::paint): Ditto.
1846
1847 2018-01-05  Joseph Pecoraro  <pecoraro@apple.com>
1848
1849         ServiceWorkers: Enable UserTiming / ResourceTiming
1850         https://bugs.webkit.org/show_bug.cgi?id=181297
1851         <rdar://problem/36307306>
1852
1853         Reviewed by Youenn Fablet.
1854
1855         Tests: http/tests/workers/service/service-worker-resource-timing.https.html
1856                http/tests/workers/service/service-worker-user-timing.https.html
1857
1858         * loader/ResourceTiming.cpp:
1859         (WebCore::ResourceTiming::ResourceTiming):
1860         We used to clear extra NetworkLoadMetrics data early on. However,
1861         for Workers we want to pass the complete NetworkLoadMetrics to
1862         the Worker so that a Worker inspector has access to it.
1863
1864         * page/PerformanceResourceTiming.cpp:
1865         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
1866         Instead move the clearing of extra data to here, when the NetworkLoadMetrics
1867         have finally settled into being used only for a performance entry.
1868
1869 2018-01-04  Philippe Normand  <pnormand@igalia.com>
1870
1871         [EME][GStreamer] Fix wrong ifdef
1872         https://bugs.webkit.org/show_bug.cgi?id=181289
1873
1874         Reviewed by Alex Christensen.
1875
1876         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1877         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove the
1878         ENCRYPTED_MEDIA ifdef from the VIDEO_TRACK ifdef block. Both have
1879         nothing to do together.
1880
1881 2018-01-05  Fujii Hironori  <Hironori.Fujii@sony.com>
1882
1883         [Cairo] Canvas: Path::clear should clear its transform
1884         https://bugs.webkit.org/show_bug.cgi?id=181320
1885
1886         Reviewed by Carlos Garcia Campos.
1887
1888         Path of Cairo port has its cairo context. Path::clear() didn't
1889         clear the transform matrix of the context.
1890
1891         Test: fast/canvas/reset-scaling-by-height-change.html
1892
1893         * platform/graphics/cairo/PathCairo.cpp:
1894         (WebCore::Path::clear): Reset the transform matrix of Path.
1895
1896 2018-01-04  Devin Rousso  <webkit@devinrousso.com>
1897
1898         Web Inspector: replace HTMLCanvasElement with CanvasRenderingContext for instrumentation logic
1899         https://bugs.webkit.org/show_bug.cgi?id=180770
1900
1901         Reviewed by Joseph Pecoraro.
1902
1903         No change in functionality.
1904
1905         * html/HTMLCanvasElement.h:
1906         * html/HTMLCanvasElement.cpp:
1907         (WebCore::HTMLCanvasElement::createContext2d):
1908         (WebCore::HTMLCanvasElement::createContextWebGL):
1909         (WebCore::HTMLCanvasElement::createContextWebGPU):
1910         (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
1911         (WebCore::HTMLCanvasElement::reset):
1912         (WebCore::HTMLCanvasElement::paint):
1913         (WebCore::HTMLCanvasElement::setImageBuffer const):
1914         (WebCore::HTMLCanvasElement::addObserver): Deleted.
1915         (WebCore::HTMLCanvasElement::removeObserver): Deleted.
1916         (WebCore::HTMLCanvasElement::cssCanvasClients): Deleted.
1917         (WebCore::HTMLCanvasElement::notifyObserversCanvasChanged): Deleted.
1918         * html/OffscreenCanvas.h:
1919         * html/canvas/CanvasRenderingContext.h:
1920         * html/canvas/CanvasRenderingContext.cpp:
1921         * html/canvas/CanvasRenderingContext2D.h:
1922         * html/canvas/CanvasRenderingContext2D.cpp:
1923         (WebCore::CanvasRenderingContext2D::create):
1924         * html/canvas/CanvasRenderingContext2DBase.h:
1925         * html/canvas/ImageBitmapRenderingContext.h:
1926         * html/canvas/ImageBitmapRenderingContext.cpp:
1927         (WebCore::ImageBitmapRenderingContext::create):
1928         * html/canvas/WebGL2RenderingContext.h:
1929         * html/canvas/WebGL2RenderingContext.cpp:
1930         (WebCore::WebGL2RenderingContext::create):
1931         * html/canvas/WebGLRenderingContext.h:
1932         * html/canvas/WebGLRenderingContext.cpp:
1933         (WebCore::WebGLRenderingContext::create):
1934         * html/canvas/WebGLRenderingContextBase.h:
1935         * html/canvas/WebGLRenderingContextBase.cpp:
1936         (WebCore::WebGLRenderingContextBase::create):
1937         * html/canvas/WebGPURenderingContext.cpp:
1938         (WebCore::WebGPURenderingContext::create):
1939         Instead of adding didCreateCanvasRenderingContext calls at the construction sites of each
1940         context, we can make the constructors private and force the usage of static `create` functions.
1941         This way, we have access to the fully constructed object and have a guaranteed path for creation.
1942
1943         * html/CanvasBase.h:
1944         * html/CanvasBase.cpp:
1945         (WebCore::CanvasBase::~CanvasBase):
1946         (WebCore::CanvasBase::renderingContext const):
1947         (WebCore::CanvasBase::addObserver):
1948         (WebCore::CanvasBase::removeObserver):
1949         (WebCore::CanvasBase::notifyObserversCanvasChanged):
1950         (WebCore::CanvasBase::notifyObserversCanvasResized):
1951         (WebCore::CanvasBase::notifyObserversCanvasDestroyed):
1952         (WebCore::CanvasBase::cssCanvasClients const):
1953         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
1954         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
1955         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasDestroyed):
1956         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
1957         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
1958         * css/CSSCanvasValue.h:
1959         Move the CanvasObserver class to CanvasBase so that it can also be used for OffscreenCanvas.
1960
1961         * inspector/InspectorInstrumentation.h:
1962         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
1963         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
1964         (WebCore::InspectorInstrumentation::didChangeCanvasMemory):
1965         (WebCore::InspectorInstrumentation::recordCanvasAction):
1966         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame):
1967         (WebCore::InspectorInstrumentation::didEnableExtension):
1968         (WebCore::InspectorInstrumentation::didCreateProgram):
1969         (WebCore::InspectorInstrumentation::willDeleteProgram):
1970         (WebCore::InspectorInstrumentation::isShaderProgramDisabled):
1971         (WebCore::InspectorInstrumentation::consoleStartRecordingCanvas):
1972         (WebCore::InspectorInstrumentation::didCreateCSSCanvas): Deleted.
1973         * inspector/InspectorInstrumentation.cpp:
1974         (WebCore::InspectorInstrumentation::consoleStartRecordingCanvasImpl):
1975         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
1976         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
1977         (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
1978         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
1979         (WebCore::InspectorInstrumentation::didEnableExtensionImpl):
1980         (WebCore::InspectorInstrumentation::didCreateProgramImpl):
1981         (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl): Deleted.
1982
1983         * inspector/agents/InspectorCanvasAgent.h:
1984         * inspector/agents/InspectorCanvasAgent.cpp:
1985         (WebCore::InspectorCanvasAgent::enable):
1986         (WebCore::InspectorCanvasAgent::requestNode):
1987         (WebCore::InspectorCanvasAgent::requestContent):
1988         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
1989         (WebCore::contextAsScriptValue):
1990         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
1991         (WebCore::InspectorCanvasAgent::startRecording):
1992         (WebCore::InspectorCanvasAgent::stopRecording):
1993         (WebCore::InspectorCanvasAgent::updateShader):
1994         (WebCore::InspectorCanvasAgent::frameNavigated):
1995         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
1996         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
1997         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
1998         (WebCore::InspectorCanvasAgent::recordCanvasAction):
1999         (WebCore::InspectorCanvasAgent::canvasDestroyed):
2000         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
2001         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
2002         (WebCore::InspectorCanvasAgent::didEnableExtension):
2003         (WebCore::InspectorCanvasAgent::didCreateProgram):
2004         (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired):
2005         (WebCore::InspectorCanvasAgent::clearCanvasData):
2006         (WebCore::InspectorCanvasAgent::unbindCanvas):
2007         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
2008         (WebCore::InspectorCanvasAgent::unbindProgram):
2009         (WebCore::InspectorCanvasAgent::didCreateCSSCanvas): Deleted.
2010
2011         * inspector/InspectorCanvas.h:
2012         * inspector/InspectorCanvas.cpp:
2013         (WebCore::InspectorCanvas::create):
2014         (WebCore::InspectorCanvas::InspectorCanvas):
2015         (WebCore::InspectorCanvas::canvasElement):
2016         (WebCore::InspectorCanvas::resetRecordingData):
2017         (WebCore::InspectorCanvas::recordAction):
2018         (WebCore::InspectorCanvas::buildObjectForCanvas):
2019         (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
2020         (WebCore::InspectorCanvas::buildInitialState):
2021         (WebCore::InspectorCanvas::~InspectorCanvas): Deleted.
2022
2023         * inspector/InspectorShaderProgram.h:
2024         * inspector/InspectorShaderProgram.cpp:
2025         (WebCore::InspectorShaderProgram::context const):
2026
2027         * page/PageConsoleClient.cpp:
2028         (WebCore::PageConsoleClient::record):
2029         (WebCore::PageConsoleClient::recordEnd):
2030
2031         * dom/Document.h:
2032         * dom/Document.cpp:
2033         (WebCore::Document::getCSSCanvasElement):
2034         (WebCore::Document::nameForCSSCanvasElement const):
2035         We have no reason to save the CSS canvas name for each InspectorCanvas object, so instead we
2036         can just query for the name based on the CanvasRenderingContext's HTMLCanvasElement (assuming
2037         it is not an OffscreenCanvas) when we need it.
2038
2039 2018-01-04  Chris Fleizach  <cfleizach@apple.com>
2040
2041         AX: Implement updated CSS3 Speech for 'speak' and 'speak-as' properties
2042         https://bugs.webkit.org/show_bug.cgi?id=180361
2043
2044         Reviewed by Zalan Bujtas.
2045
2046         Change speak -> speakAs, and allow a combination of properties.
2047
2048         Tests: Updated accessibility/mac/css-speech-speak.html
2049
2050         * accessibility/AccessibilityObject.h:
2051         (WebCore::AccessibilityObject::speakAsProperty const):
2052         (WebCore::AccessibilityObject::speakProperty const): Deleted.
2053         * accessibility/AccessibilityRenderObject.cpp:
2054         (WebCore::AccessibilityRenderObject::speakAsProperty const):
2055         (WebCore::AccessibilityRenderObject::speakProperty const): Deleted.
2056         * accessibility/AccessibilityRenderObject.h:
2057         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2058         (-[WebAccessibilityObjectWrapper accessibilitySpeechHint]):
2059         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2060         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2061         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
2062         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2063         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2064         * css/CSSComputedStyleDeclaration.cpp:
2065         (WebCore::speakAsToCSSValue):
2066         (WebCore::ComputedStyleExtractor::propertyValue):
2067         * css/CSSPrimitiveValueMappings.h:
2068         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2069         (WebCore::CSSPrimitiveValue::operator ESpeakAs const):
2070         (WebCore::CSSPrimitiveValue::operator ESpeak const): Deleted.
2071         * css/CSSProperties.json:
2072         * css/StyleBuilderConverter.h:
2073         (WebCore::StyleBuilderConverter::convertSpeakAs):
2074         * css/parser/CSSParserFastPaths.cpp:
2075         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2076         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2077         * css/parser/CSSPropertyParser.cpp:
2078         (WebCore::consumeSpeakAs):
2079         (WebCore::CSSPropertyParser::parseSingleValue):
2080         * rendering/style/RenderStyle.h:
2081         (WebCore::RenderStyle::speakAs const):
2082         (WebCore::RenderStyle::setSpeakAs):
2083         (WebCore::RenderStyle::initialSpeakAs):
2084         (WebCore::RenderStyle::speak const): Deleted.
2085         (WebCore::RenderStyle::setSpeak): Deleted.
2086         (WebCore::RenderStyle::initialSpeak): Deleted.
2087         * rendering/style/RenderStyleConstants.h:
2088         (WebCore::operator| ):
2089         (WebCore::operator|= ):
2090         * rendering/style/StyleRareInheritedData.cpp:
2091         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2092         (WebCore::StyleRareInheritedData::operator== const):
2093         * rendering/style/StyleRareInheritedData.h:
2094
2095 2018-01-04  Brian Burg  <bburg@apple.com>
2096
2097         Web Inspector: Capture Element Screenshot looks fuzzy
2098         https://bugs.webkit.org/show_bug.cgi?id=175734
2099         <rdar://problem/33803377>
2100
2101         Reviewed by Joseph Pecoraro and Simon Fraser.
2102
2103         Screenshots taken by Web Inspector were being downscaled from the
2104         internal size to the logical size, causing them to be blurry when
2105         later upscaled to the internal size.
2106
2107         Replace ScaleBehavior { Scaled, Unscaled } with PreserveResolution { No, Yes }.
2108         This is a lot less confusing to read both inside ImageBuffer and at its use sites.
2109
2110         Remove unused CoordinateSystem argument for ImageBuffer::toDataURL,
2111         and replace it with PreserveResolution. Plumb PreserveResolution into toCFData
2112         so that PreserveResolution::Yes will preserve the internal size of
2113         the image buffer, just as it does in other methods that take PreserveResolution.
2114
2115         At the use site in InspectorPageAgent, always request PreserveResolution::Yes snapshots
2116         when taking an element screenshot. For now, keep using downscaled (smaller)
2117         snapshots when capturing canvas previews, as the previews are not full-size.
2118
2119         Test: inspector/page/hidpi-snapshot-size.html
2120
2121         * html/HTMLCanvasElement.cpp:
2122         (WebCore::HTMLCanvasElement::makePresentationCopy):
2123         (WebCore::HTMLCanvasElement::copiedImage const):
2124         * html/canvas/CanvasRenderingContext2DBase.cpp:
2125         (WebCore::CanvasRenderingContext2DBase::createPattern):
2126         * inspector/agents/InspectorPageAgent.cpp:
2127         (WebCore::InspectorPageAgent::snapshotNode):
2128         (WebCore::InspectorPageAgent::snapshotRect):
2129         * page/TextIndicator.cpp:
2130         (WebCore::takeSnapshot):
2131         * platform/DragImage.cpp:
2132         (WebCore::createDragImageFromSnapshot):
2133         * platform/graphics/BitmapImage.cpp:
2134         (WebCore::BitmapImage::drawPattern):
2135         * platform/graphics/ImageBuffer.h:
2136         * platform/graphics/cairo/ImageBufferCairo.cpp:
2137         (WebCore::ImageBuffer::sinkIntoImage):
2138         (WebCore::ImageBuffer::copyImage const):
2139         (WebCore::ImageBuffer::toDataURL const):
2140         * platform/graphics/cg/ImageBufferCG.cpp:
2141         (WebCore::createBitmapImageAfterScalingIfNeeded):
2142         (WebCore::ImageBuffer::copyImage const):
2143         (WebCore::ImageBuffer::sinkIntoImage):
2144         (WebCore::ImageBuffer::toDataURL const):
2145         (WebCore::ImageBuffer::toData const):
2146         (WebCore::ImageBuffer::toCFData const):
2147         * platform/graphics/gtk/ImageBufferGtk.cpp:
2148         (WebCore::ImageBuffer::toDataURL const):
2149         * platform/graphics/win/ImageBufferDirect2D.cpp:
2150         (WebCore::ImageBuffer::copyImage const):
2151         (WebCore::ImageBuffer::sinkIntoImage):
2152         (WebCore::ImageBuffer::toDataURL const):
2153         * svg/graphics/SVGImage.cpp:
2154         (WebCore::SVGImage::drawPatternForContainer):
2155
2156 2018-01-04  John Wilander  <wilander@apple.com>
2157
2158         Storage Access API: Turn feature on by default in Settings.yaml
2159         https://bugs.webkit.org/show_bug.cgi?id=181298
2160         <rdar://problem/36302506>
2161
2162         Reviewed by Brent Fulgham.
2163
2164         No new tests. This is just a feature settings change.
2165
2166         * page/Settings.yaml:
2167
2168 2018-01-04  Zalan Bujtas  <zalan@apple.com>
2169
2170         WebContent process crashes while loading https://www.classicspecs.com
2171         https://bugs.webkit.org/show_bug.cgi?id=181290
2172         <rdar://problem/36225906>
2173
2174         Reviewed by Simon Fraser.
2175
2176         Floats can overhang multiple blocks (they are called intruding floats).
2177         Each block keeps track of such intruding floats. When an overhanging float box is destroyed,
2178         we need to deregister it from all those blocks. We do it by walking up the ancestor block chain
2179         and check if the parent (grandparent etc) block still contains this float. Once we find the topmost block, 
2180         we start deregistering it by traversing back on the descendant blocks.
2181         Normally we do it in RenderElement::takeChildInternal right before the box is getting detached.
2182         However in certain cases (like when the float's parent happens to be an anonymous wrapper)
2183         by the time we get to ::takeChildInternal the subtree is already detached and we can't access all the
2184         ancestors.
2185         This patch ensure that the floating box is still attached during de-registration. 
2186
2187         Test: fast/block/float/crash-when-intruding-float-has-anonymous-parent-and-detach.html
2188
2189         * rendering/RenderObject.cpp:
2190         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2191
2192 2018-01-04  Eric Carlson  <eric.carlson@apple.com>
2193
2194         [MediaStream] Add Mock screen capture source
2195         https://bugs.webkit.org/show_bug.cgi?id=181291
2196         <rdar://problem/36298164>
2197
2198         Reviewed by Dean Jackson.
2199
2200         Tests:  http/tests/media/media-stream/get-display-media-prompt.html
2201                 GetDisplayMediaTest.BasicPrompt
2202                 GetDisplayMediaTest.Constraints
2203
2204         * Modules/mediastream/MediaDevices.cpp:
2205         (WebCore::MediaDevices::MediaDevices): Add static_assert to ensure MediaDevices::DisplayCaptureSurfaceType
2206         and RealtimeMediaSourceSettings::DisplaySurfaceType values are equivalent.
2207         (WebCore::MediaDevices::getSupportedConstraints): Remove bogus code.
2208         * Modules/mediastream/MediaDevices.h: Add DisplayCaptureSurfaceType.
2209         * Modules/mediastream/MediaDevices.idl: Ditto.
2210
2211         * Modules/mediastream/MediaStreamTrack.cpp:
2212         (WebCore::MediaStreamTrack::getSettings const): Add a FIXME.
2213         * Modules/mediastream/MediaStreamTrack.h: Add displaySurface and logicalSurface.
2214
2215         * Modules/mediastream/MediaTrackSupportedConstraints.h: Remove displaySurface and logicalSurface.
2216         * Modules/mediastream/MediaTrackSupportedConstraints.idl:
2217
2218         * SourcesCocoa.txt: Add DisplayCaptureManagerCocoa.cpp and DisplayCaptureSourceCocoa.cpp.
2219
2220         * WebCore.xcodeproj/project.pbxproj: Ditto.
2221
2222         * platform/mediastream/CaptureDevice.h:
2223         (WebCore::CaptureDevice::encode const): Add.
2224         (WebCore::CaptureDevice::decode):
2225
2226         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2227         (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices): Include display capture "devices".
2228         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Deal with display capture devices.
2229         (WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID): Ditto.
2230         * platform/mediastream/RealtimeMediaSourceCenter.h:
2231
2232         * platform/mediastream/RealtimeMediaSourceSettings.h:
2233         (WebCore::RealtimeMediaSourceSettings::displaySurface const): Return a DisplaySurfaceType.
2234         (WebCore::RealtimeMediaSourceSettings::setDisplaySurface): Take a DisplaySurfaceType.
2235
2236         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
2237         (WebCore::DisplayCaptureManagerCocoa::singleton):
2238         (WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa):
2239         (WebCore::DisplayCaptureManagerCocoa::captureDevices):
2240         (WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID):
2241         (WebCore::DisplayCaptureManagerCocoa::captureDeviceWithPersistentID):
2242         * platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
2243
2244         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: Added.
2245         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa):
2246         (WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
2247         (WebCore::DisplayCaptureSourceCocoa::capabilities const):
2248         (WebCore::DisplayCaptureSourceCocoa::settings const):
2249         (WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
2250         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
2251         (WebCore::DisplayCaptureSourceCocoa::stopProducingData):
2252         (WebCore::DisplayCaptureSourceCocoa::elapsedTime):
2253         (WebCore::DisplayCaptureSourceCocoa::applyFrameRate):
2254         (WebCore::DisplayCaptureSourceCocoa::emitFrame):
2255         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
2256
2257         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2258         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureDeviceManager): New.
2259         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
2260
2261         * platform/mock/MockRealtimeMediaSource.cpp:
2262         (WebCore::deviceMap): Add screen capture "devices".
2263         (WebCore::MockRealtimeMediaSource::displayDevices): New.
2264         * platform/mock/MockRealtimeMediaSource.h:
2265
2266         * platform/mock/MockRealtimeMediaSourceCenter.cpp: Clean up includes.
2267         * platform/mock/MockRealtimeMediaSourceCenter.h:
2268
2269         * platform/mock/MockRealtimeVideoSource.cpp:
2270         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Mock two screen devices.
2271         (WebCore::MockRealtimeVideoSource::updateSettings): Deal with mock screens.
2272         (WebCore::MockRealtimeVideoSource::initializeCapabilities): Ditto.
2273         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Ditto.
2274         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
2275         (WebCore::MockRealtimeVideoSource::generateFrame): Ditto.
2276         * platform/mock/MockRealtimeVideoSource.h:
2277         (WebCore::MockRealtimeVideoSource::mockCamera const):
2278         (WebCore::MockRealtimeVideoSource::mockScreen const):
2279
2280 2018-01-04  Youenn Fablet  <youenn@apple.com>
2281
2282         FetchResponse should set its internal response text encoding name
2283         https://bugs.webkit.org/show_bug.cgi?id=181284
2284
2285         Reviewed by Alex Christensen.
2286
2287         Covered by rebased test.
2288
2289         * Modules/fetch/FetchResponse.cpp:
2290         (WebCore::FetchResponse::create): Set response text encoding based on content type charset.
2291
2292 2018-01-04  John Wilander  <wilander@apple.com>
2293
2294         Storage Access API: Remove JavaScript confirm() prompt from Document::requestStorageAccess()
2295         https://bugs.webkit.org/show_bug.cgi?id=181276
2296         <rdar://problem/36290463>
2297
2298         Reviewed by Alex Christensen.
2299
2300         No new tests. Existing test expectations updated.
2301
2302         * dom/Document.cpp:
2303         (WebCore::Document::requestStorageAccess):
2304
2305 2018-01-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2306
2307         [GTK] Issues with Ahem's ex / x-height
2308         https://bugs.webkit.org/show_bug.cgi?id=180581
2309
2310         Reviewed by Michael Catanzaro.
2311
2312         Get the x-height value from the TT_OS2 table if available.
2313
2314         Fixes: fast/text/break-word-pre-wrap.html
2315                imported/w3c/web-platform-tests/css/css-shapes-1/shape-outside/values/shape-outside-shape-arguments-000.html
2316
2317         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2318         (WebCore::Font::platformInit):
2319
2320 2018-01-04  Philippe Normand  <pnormand@igalia.com>
2321
2322         Unreviewed, GTK build fix attempt after r226357
2323
2324         * platform/graphics/gstreamer/GStreamerUtilities.h: The
2325         GST_BUFFER_DTS_OR_PTS macro was added in GStreamer 1.8 but old
2326         versions of Debian might not have this release yet.
2327
2328 2018-01-04  Youenn Fablet  <youenn@apple.com>
2329
2330         Implement Cache API partitioning based on ClientOrigin
2331         https://bugs.webkit.org/show_bug.cgi?id=181240
2332
2333         Reviewed by Alex Christensen.
2334
2335         Covered by updated tests.
2336
2337         Previously, cache storage was partitioned according the origin of the client, represented as a String.
2338         We now partition according both client and top origins, represented as a ClientOrigin
2339
2340         Minor refactoring to use more makePendingActivity.
2341         Added support for IPC serialization of ClientOrigin.
2342         Added SecurityOriginData::toString which is used by WebKit2 Cache Storage implementation.
2343
2344         * Modules/cache/CacheStorageConnection.cpp:
2345         (WebCore::CacheStorageConnection::open):
2346         (WebCore::CacheStorageConnection::retrieveCaches):
2347         * Modules/cache/CacheStorageConnection.h:
2348         (WebCore::CacheStorageConnection::clearMemoryRepresentation):
2349         (WebCore::CacheStorageConnection::doOpen):
2350         (WebCore::CacheStorageConnection::doRetrieveCaches):
2351         * Modules/cache/DOMCacheStorage.cpp:
2352         (WebCore::DOMCacheStorage::origin const):
2353         (WebCore::DOMCacheStorage::retrieveCaches):
2354         (WebCore::DOMCacheStorage::open):
2355         (WebCore::DOMCacheStorage::remove):
2356         * Modules/cache/DOMCacheStorage.h:
2357         * Modules/cache/WorkerCacheStorageConnection.cpp:
2358         (WebCore::WorkerCacheStorageConnection::doOpen):
2359         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
2360         * Modules/cache/WorkerCacheStorageConnection.h:
2361         * page/ClientOrigin.h:
2362         (WebCore::ClientOrigin::isolatedCopy const):
2363         (WebCore::ClientOrigin::encode const):
2364         (WebCore::ClientOrigin::decode):
2365         * page/SecurityOriginData.cpp:
2366         (WebCore::SecurityOriginData::toString const):
2367         (WebCore::SecurityOriginData::debugString const): Deleted.
2368         * page/SecurityOriginData.h:
2369         (WebCore::SecurityOriginData::debugString const):
2370         * testing/Internals.cpp:
2371         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
2372
2373 2018-01-04  Youenn Fablet  <youenn@apple.com>
2374
2375         Service Worker should expose redirect mode for navigation loads as manual
2376         https://bugs.webkit.org/show_bug.cgi?id=181067
2377
2378         Reviewed by Alex Christensen.
2379
2380         Covered by rebased tests.
2381
2382         * loader/CrossOriginAccessControl.cpp: Removing ContentType header only if affecting CORS checks.
2383         This allows extending header filtering in service worker to all modes, including Navigate.
2384         * workers/service/context/ServiceWorkerFetch.cpp:
2385         (WebCore::ServiceWorkerFetch::dispatchFetchEvent): Ideally, document loading code should set redirect to manual.
2386         Since it is not the case yet and that would require changes to various places, manual is set before exposing the corresponding fetch event.
2387
2388 2018-01-04  Youenn Fablet  <youenn@apple.com>
2389
2390         ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope should be a no-op if worker is being terminated
2391         https://bugs.webkit.org/show_bug.cgi?id=181245
2392
2393         Reviewed by Alex Christensen.
2394
2395         Stop appending tasks to a terminating worker and returning false in that case.
2396         This mirrors what is done for regular workers.
2397
2398         * workers/service/context/SWContextManager.cpp:
2399         (WebCore::SWContextManager::terminateWorker):
2400         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2401         (WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
2402         * workers/service/context/ServiceWorkerThreadProxy.h:
2403
2404 2018-01-04  Youenn Fablet  <youenn@apple.com>
2405
2406         Cancel pending script loads when service worker is being terminated
2407         https://bugs.webkit.org/show_bug.cgi?id=181250
2408
2409         Reviewed by Alex Christensen.
2410
2411         Covered by service worker tests no longer crashing in ASAN builds.
2412
2413         * workers/WorkerScriptLoader.cpp:
2414         (WebCore::WorkerScriptLoader::notifyFinished): Clearing loader when finished.
2415         (WebCore::WorkerScriptLoader::cancel): Implementing cancel of a script loader by cancelling the underlying threadable loader.
2416         * workers/WorkerScriptLoader.h:
2417         * workers/service/ServiceWorkerContainer.cpp: Canceling loads of all pending jobs.
2418         (WebCore::ServiceWorkerContainer::stop):
2419         * workers/service/ServiceWorkerJob.cpp:
2420         (WebCore::ServiceWorkerJob::cancelPendingLoad):
2421         * workers/service/ServiceWorkerJob.h:
2422
2423 2018-01-04  Youenn Fablet  <youenn@apple.com>
2424
2425         Implement  https://fetch.spec.whatwg.org/#main-fetch default referrer policy setting
2426         https://bugs.webkit.org/show_bug.cgi?id=181239
2427
2428         Reviewed by Alex Christensen.
2429
2430         Covered by updated and rebased test.
2431
2432         Setting the request referrer policy to the Document referrer policy if no one is set.
2433         If Document has no referrer policy, use no-referrer-when-downgrade as per the spec.
2434
2435         * loader/cache/CachedResourceLoader.cpp:
2436         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
2437         (WebCore::CachedResourceLoader::requestResource):
2438         * loader/cache/CachedResourceLoader.h:
2439         * loader/cache/CachedResourceRequest.cpp:
2440         (WebCore::CachedResourceRequest::updateReferrerPolicy):
2441         (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
2442         * loader/cache/CachedResourceRequest.h:
2443
2444 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2445
2446         [Attachment Support] Create attachment elements when dropping files on iOS
2447         https://bugs.webkit.org/show_bug.cgi?id=181192
2448         <rdar://problem/36280945>
2449
2450         Reviewed by Tim Horton.
2451
2452         Implements support for dropping data as attachment elements on iOS. See comments below for more detail.
2453
2454         Tests:  WKAttachmentTests.InsertDroppedRichAndPlainTextFilesAsAttachments
2455                 WKAttachmentTests.InsertDroppedZipArchiveAsAttachment
2456                 WKAttachmentTests.InsertDroppedItemProvidersInOrder
2457
2458         * WebCore.xcodeproj/project.pbxproj:
2459         * editing/WebContentReader.cpp:
2460         (WebCore::WebContentReader::ensureFragment):
2461
2462         Add a new helper to create the WebContentReader's fragment, if it hasn't already been created.
2463
2464         * editing/WebContentReader.h:
2465         * editing/cocoa/WebContentReaderCocoa.mm:
2466         (WebCore::WebContentReader::readFilePaths):
2467
2468         Rename readFilenames to readFilePaths (which better reflects its parameters, which are file paths). Also, move
2469         the implementation of readFilePaths to shared iOS/macOS code in WebContentReaderCocoa, and remove the stub
2470         implementation on iOS.
2471
2472         There's a bit of code here that I kept macOS-only which deals with inserting file paths as plain text in
2473         editable areas, but it's unclear to me why and if WebKit clients currently find this useful, so I left a FIXME
2474         to investigate removing this altogether. Code for handling this plain text insertion of file paths on Mac was
2475         introduced in r67403.
2476
2477         * editing/ios/WebContentReaderIOS.mm:
2478         (WebCore::WebContentReader::readFilenames): Deleted.
2479         * editing/mac/WebContentReaderMac.mm:
2480         (WebCore::WebContentReader::readFilenames): Deleted.
2481         * page/mac/DragControllerMac.mm:
2482         (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const):
2483
2484         Teach DragController to accept all types conforming to "public.item" and "public.content" on iOS, only when
2485         attachment elements are enabled. This allows us to load content from item providers that we otherwise would not
2486         have loaded, since we now have the ability to fall back to attachment element insertion if the type is not have
2487         a default representation using standard web content.
2488
2489         * platform/Pasteboard.h:
2490         * platform/PasteboardItemInfo.h: Added.
2491         (WebCore::PasteboardItemInfo::encode const):
2492         (WebCore::PasteboardItemInfo::decode):
2493
2494         Add PasteboardItemInfo, a struct that describes an item on the pasteboard. Also, implement encoding and decoding
2495         support for PasteboardItemInfo. So far, the item info only describes file information about the pasteboard item,
2496         and flags indicating whether the item prefers attachment or inline presentation.
2497
2498         * platform/PasteboardStrategy.h:
2499
2500         Replace getFilenamesForDataInteraction with informationForItemAtIndex. Instead of returning all of the file
2501         paths associated with any item on the pasteboard, fetch a PasteboardItemInfo at a given item index, which
2502         includes information about the file path as well as some other metadata we'll need when deciding how to read
2503         pasteboard contents as a document fragment.
2504
2505         * platform/PlatformPasteboard.h:
2506         * platform/cocoa/PasteboardCocoa.mm:
2507         (WebCore::Pasteboard::read):
2508         * platform/ios/AbstractPasteboard.h:
2509         * platform/ios/PasteboardIOS.mm:
2510         (WebCore::Pasteboard::read):
2511         (WebCore::Pasteboard::readRespectingUTIFidelities):
2512
2513         Teach the iOS Pasteboard to read web content using attachment elements, if enabled. There are two scenarios in
2514         which we would want to insert an attachment element:
2515         (1) The item provider uses a preferred presentation style of attachment, in which case we bail out of trying to
2516             handle the drop using the default mechanisms, and simply insert it as an attachment. We need this to deal
2517             with the case where we drop text or HTML files from the Files app, so that we don't try and insert the
2518             contents of the text or HTML as inline web content.
2519         (2) The item provider doesn't have a preferred attachment presentation style, but there's nothing WebKit would
2520             otherwise do with the dropped content, so insert an attachment element as a fallback. Examples where this is
2521             relevant are dropping a PDF or ZIP archive without attachment presentation style explicitly set.
2522         We first check if we fall into case (1). If so, we can bail early by inserting an attachment; otherwise, we
2523         proceed normally and see if we can read the contents of the drop as web content. If, at the end of default drop
2524         handling, we don't still have a way to represent the dropped content, enter case (2).
2525
2526         (WebCore::Pasteboard::readFilePaths):
2527         (WebCore::Pasteboard::readFilenames): Deleted.
2528
2529         Rename readFilenames to readFilePaths, and reimplement it using informationForItemAtIndex.
2530
2531         * platform/ios/PlatformPasteboardIOS.mm:
2532         (WebCore::pasteboardItemPresentationStyle):
2533         (WebCore::PlatformPasteboard::informationForItemAtIndex):
2534         (WebCore::PlatformPasteboard::filenamesForDataInteraction): Deleted.
2535
2536         Implement informationForItemAtIndex and remove filenamesForDataInteraction. As before, we ask the pasteboard
2537         (i.e. WebItemProviderPasteboard) for information about dropped file URLs. This time, we limit this to a single
2538         file, so we don't end up creating multiple attachment elements for each representation of a single item
2539         provider. See below for -preferredFileUploadURLAtIndex:fileType: for more detail.
2540
2541         * platform/ios/WebItemProviderPasteboard.h:
2542         * platform/ios/WebItemProviderPasteboard.mm:
2543         (-[WebItemProviderLoadResult initWithItemProvider:typesToLoad:]):
2544         (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
2545
2546         Remove this synthesized instance variable and instead just check the item provider's preferredPresentationStyle.
2547
2548         (-[WebItemProviderLoadResult description]):
2549
2550         Add a verbose -description to the load result object. Useful for debugging what was content was loaded from an
2551         item provider on drop.
2552
2553         (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]):
2554
2555         Return the highest fidelity loaded type identifier for a given item.
2556
2557         (-[WebItemProviderPasteboard allDroppedFileURLs]):
2558         (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]):
2559
2560         Prefer flat RTFD to RTFD. In the case where attachments are enabled and we're accepting all types of content
2561         using attachment elements as a fallback representation, if the source writes attributed strings to the
2562         pasteboard with com.apple.rtfd at a higher fidelity than com.apple.flat-rtfd, we'll end up loading only
2563         com.apple.rtfd and dropping the text as an attachment element because we cannot convert the dropped content to
2564         markup. Instead, if flat RTFD is present in the item provider, always prefer that over RTFD so that dropping as
2565         regular web content isn't overridden when attachment elements are enabled.
2566
2567         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
2568         (-[WebItemProviderPasteboard droppedFileURLs]): Deleted.
2569         * platform/mac/DragDataMac.mm:
2570         (WebCore::DragData::containsCompatibleContent const):
2571
2572         DragData::containsCompatibleContent should be true when attachment elements are enabled, and there are files we
2573         can drop as attachment elements.
2574
2575         * platform/mac/PasteboardMac.mm:
2576         (WebCore::Pasteboard::read):
2577         (WebCore::Pasteboard::readFilePaths):
2578         (WebCore::Pasteboard::readFilenames): Deleted.
2579
2580 2018-01-03  Ting-Wei Lan  <lantw44@gmail.com>
2581
2582         Replace hard-coded paths in shebangs with #!/usr/bin/env
2583         https://bugs.webkit.org/show_bug.cgi?id=181040
2584
2585         Reviewed by Alex Christensen.
2586
2587         * bindings/scripts/InFilesCompiler.pm:
2588         * bindings/scripts/InFilesParser.pm:
2589         * bindings/scripts/generate-bindings-all.pl:
2590         * bindings/scripts/generate-bindings.pl:
2591         * bindings/scripts/preprocess-idls.pl:
2592         * css/make-css-file-arrays.pl:
2593         * css/makeprop.pl:
2594         * css/makevalues.pl:
2595         * dom/make_event_factory.pl:
2596         * dom/make_names.pl:
2597         * extract-localizable-strings.pl:
2598         * make-hash-tools.pl:
2599
2600 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2601
2602         [Attachment Support] Add plumbing for starting a drag with promised blob data
2603         https://bugs.webkit.org/show_bug.cgi?id=181201
2604
2605         Reviewed by Tim Horton.
2606
2607         Adds logic to allow dragging an attachment element as a file by sending promised blob information to the UI
2608         process. See comments below for more detail.
2609
2610         The only change in behavior is that dragging an attachment element will no longer write web content and injected
2611         bundle data to the pasteboard if the attachment element's file attribute is nonnull. This will cause one
2612         existing WK1 layout test to fail, but will otherwise not affect any attachment editing clients. On iOS,
2613         attachment elements in the Mail viewer can be dragged, but each attachment's file is null, so we fall back to
2614         current behavior; on macOS, Mail currently overrides the drag completely, beginning at -mouseDown:, so this
2615         doesn't make a difference to macOS Mail either.
2616
2617         * editing/Editor.h:
2618         * editing/cocoa/EditorCocoa.mm:
2619         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
2620
2621         Add a helper method to retrieve an attachment element as web archive data, for moving attachments within the
2622         same document. Also gives the injected editor bundle a chance to supply custom pasteboard types.
2623
2624         * loader/EmptyClients.cpp:
2625         * page/DragClient.h:
2626         (WebCore::DragClient::prepareToDragPromisedBlob):
2627
2628         Add new DragClient methods to send information about a promised blob to the UI process.
2629
2630         * page/DragController.cpp:
2631         (WebCore::DragController::startDrag):
2632
2633         Call dragAttachmentElement when starting a drag on an attachment element.
2634
2635         (WebCore::DragController::dragAttachmentElement):
2636
2637         Try to begin dragging a given attachment element, propagating promised blob information to the client layers.
2638         Returns true iff the attachment is backed by blob data (i.e. the file is nonnull).
2639
2640         * platform/PromisedBlobInfo.h:
2641
2642         Add a list of additional types and data to PromisedBlobInfo. In addition to the promised blob info, this would
2643         allow injected bundle data and other private types alongside the main attachment data on the pasteboard.
2644
2645 2018-01-03  Simon Fraser  <simon.fraser@apple.com>
2646
2647         Remove the 'resolutionScale' parameter from ImageBufferDataCG get/putBytes
2648         https://bugs.webkit.org/show_bug.cgi?id=181268
2649
2650         Reviewed by Alex Christensen.
2651
2652         These functions were always called with resolutionScale=1.
2653
2654         * platform/graphics/cg/ImageBufferCG.cpp:
2655         (WebCore::ImageBuffer::getUnmultipliedImageData const):
2656         (WebCore::ImageBuffer::getPremultipliedImageData const):
2657         (WebCore::ImageBuffer::putByteArray):
2658         * platform/graphics/cg/ImageBufferDataCG.cpp:
2659         (WebCore::ImageBufferData::getData const):
2660         (WebCore::ImageBufferData::putData):
2661         (WebCore::affineWarpBufferData): Deleted.
2662         * platform/graphics/cg/ImageBufferDataCG.h:
2663
2664 2018-01-03  John Wilander  <wilander@apple.com>
2665
2666         Storage Access API: Refactor XPC for access removal to go straight from the web process to the network process
2667         https://bugs.webkit.org/show_bug.cgi?id=181270
2668         <rdar://problem/36289544>
2669
2670         Reviewed by Alex Christensen.
2671
2672         No new tests. Existing test re-enabled.
2673
2674         This change refactors how the web process tells the network process
2675         to remove storage access. Previously, this was done over the UI process
2676         just like requests for storage access. But since no further reasoning
2677         is needed, the message should go straight from the web process to the
2678         network process for performance reasons and to minimize the risk of a
2679         race.
2680
2681         As a consequence, the XPC code for storage access removal in the UI
2682         process is deleted.
2683
2684         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2685         (WebCore::NetworkStorageSession::cookieStoragePartition const):
2686             Removes the storageAccessAPIEnabled check since the flag
2687             doesn't get propagated when the network process is created.
2688             Figuring this out will take some work which is unnecessary
2689             when we already gate access to the feature in Document.idl.
2690
2691 2018-01-03  James Craig  <jcraig@apple.com>
2692
2693         AX: when invert colors is on, double-invert certain media elements in UserAgentStyleSheet
2694         https://bugs.webkit.org/show_bug.cgi?id=168447
2695         <rdar://problem/30559874>
2696
2697         Reviewed by Simon Fraser.
2698
2699         Double-invert video when platform 'invert colors' setting is enabled. Behavior matches 
2700         current 'Smart Invert' feature of Safari Reader on macOS/iOS and other iOS native apps.
2701
2702         Tests: accessibility/smart-invert-reference.html
2703                accessibility/smart-invert.html
2704
2705         * Modules/modern-media-controls/controls/media-controls.css:
2706         (@media (inverted-colors)):
2707         (:host):
2708         (picture):
2709         * css/html.css:
2710         (@media (inverted-colors)):
2711         (video):
2712
2713 2018-01-03  Youenn Fablet  <youenn@apple.com>
2714
2715         LayoutTest http/tests/media/media-stream/disconnected-frame.html to consistently fail an assertion: !m_adoptionIsRequired
2716         https://bugs.webkit.org/show_bug.cgi?id=181264
2717
2718         Reviewed by Eric Carlson.
2719
2720         Covered by http/tests/media/media-stream/disconnected-frame.html not crashing anymore in Debug builds.
2721         Calling suspendIfNeeded in create method instead of constructor.
2722
2723         * Modules/mediastream/UserMediaRequest.cpp:
2724         (WebCore::UserMediaRequest::create):
2725         (WebCore::UserMediaRequest::UserMediaRequest):
2726
2727 2018-01-03  Antti Koivisto  <antti@apple.com>
2728
2729         Remove DeprecatedCSSOMValue::equals
2730         https://bugs.webkit.org/show_bug.cgi?id=181241
2731
2732         Reviewed by Zalan Bujtas.
2733
2734         This is dead code.
2735
2736         * css/DeprecatedCSSOMValue.cpp:
2737         (WebCore::compareCSSOMValues): Deleted.
2738         (WebCore::DeprecatedCSSOMValue::equals const): Deleted.
2739         * css/DeprecatedCSSOMValue.h:
2740         (WebCore::DeprecatedCSSOMValue::operator== const): Deleted.
2741         (WebCore::DeprecatedCSSOMComplexValue::equals const): Deleted.
2742         * css/DeprecatedCSSOMValueList.cpp:
2743         (WebCore::DeprecatedCSSOMValueList::equals const): Deleted.
2744         * css/DeprecatedCSSOMValueList.h:
2745
2746 2018-01-03  Simon Fraser  <simon.fraser@apple.com>
2747
2748         feLighting is broken with primitiveUnits="objectBoundingBox"
2749         https://bugs.webkit.org/show_bug.cgi?id=181197
2750
2751         Reviewed by Tim Horton.
2752
2753         With <filter primitiveUnits="objectBoundingBox"> we need to convert the coordinates
2754         of fePointLights and feSpotLights into user space coordinates. Following
2755         https://www.w3.org/TR/SVG/filters.html#FilterElementPrimitiveUnitsAttribute
2756         this is done by treating them as fractions of the bounding box on the referencing
2757         element, with treatment for z following https://www.w3.org/TR/SVG/coords.html#Units_viewport_percentage
2758         
2759         To do this, store the bounds of the referencing elemenet on SVGFilterBuilder as
2760         targetBoundingBox, and store the primitiveUnits type. Then do the conversion of lighting
2761         coordinates in SVGFESpecularLightingElement::build() and SVGFEDiffuseLightingElement::build().
2762
2763         Remove SVGFELightElement::findLightSource(), since we need to be able to pass the SVGFilterBuilder
2764         to the lightSource() function so hoist the code up.
2765
2766         Tests: svg/filters/feDiffuseLighting-fePointLight-primitiveUnits-objectBoundingBox-expected.svg
2767                svg/filters/feDiffuseLighting-fePointLight-primitiveUnits-objectBoundingBox.svg
2768                svg/filters/feDiffuseLighting-feSpotLight-primitiveUnits-objectBoundingBox-expected.svg
2769                svg/filters/feDiffuseLighting-feSpotLight-primitiveUnits-objectBoundingBox.svg
2770                svg/filters/feSpecularLighting-fePointLight-primitiveUnits-objectBoundingBox-expected.svg
2771                svg/filters/feSpecularLighting-fePointLight-primitiveUnits-objectBoundingBox.svg
2772
2773         * rendering/svg/RenderSVGResourceFilter.cpp:
2774         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
2775         * svg/SVGFEDiffuseLightingElement.cpp:
2776         (WebCore::SVGFEDiffuseLightingElement::build):
2777         * svg/SVGFEDistantLightElement.cpp:
2778         (WebCore::SVGFEDistantLightElement::lightSource const):
2779         * svg/SVGFEDistantLightElement.h:
2780         * svg/SVGFELightElement.cpp:
2781         (WebCore::SVGFELightElement::findLightSource): Deleted.
2782         * svg/SVGFELightElement.h:
2783         * svg/SVGFEPointLightElement.cpp:
2784         (WebCore::SVGFEPointLightElement::lightSource const):
2785         * svg/SVGFEPointLightElement.h:
2786         * svg/SVGFESpecularLightingElement.cpp:
2787         (WebCore::SVGFESpecularLightingElement::build):
2788         * svg/SVGFESpotLightElement.cpp:
2789         (WebCore::SVGFESpotLightElement::lightSource const):
2790         * svg/SVGFESpotLightElement.h:
2791         * svg/graphics/filters/SVGFilterBuilder.h:
2792         (WebCore::SVGFilterBuilder::setTargetBoundingBox):
2793         (WebCore::SVGFilterBuilder::targetBoundingBox const):
2794         (WebCore::SVGFilterBuilder::primitiveUnits const):
2795         (WebCore::SVGFilterBuilder::setPrimitiveUnits):
2796
2797 2018-01-03  Antti Koivisto  <antti@apple.com>
2798
2799         Crash beneath CSSValue::equals @ csas.cz
2800         https://bugs.webkit.org/show_bug.cgi?id=181243
2801         <rdar://problem/35990826>
2802
2803         Reviewed by Alex Christensen.
2804
2805         Test: fast/text/oblique-degree-equals-crash.html
2806
2807         * css/CSSFontStyleValue.cpp:
2808         (WebCore::CSSFontStyleValue::equals const):
2809
2810         Null check both oblique pointers.
2811
2812 2018-01-03  Joseph Pecoraro  <pecoraro@apple.com>
2813
2814         Web Inspector: Slow open time enumerating system fonts (FontCache::systemFontFamilies)
2815         https://bugs.webkit.org/show_bug.cgi?id=180979
2816         <rdar://problem/36146670>
2817
2818         Reviewed by Matt Baker.
2819
2820         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2821         (fontNameIsSystemFont):
2822         (WebCore::FontCache::systemFontFamilies):
2823         Switch to the original Mac algorithm before r180979 that uses
2824         CTFontManagerCopyAvailableFontFamilyNames. Previously this wasn't
2825         available on iOS but now it is. This is a performance improvement on
2826         both platforms, but significantly so on macOS. It also finds more,
2827         valid, family names.
2828
2829 2018-01-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2830
2831         ASSERTION FAILED: !source || is<Target>(*source) in CoordinatedGraphicsLayer::removeFromParent
2832         https://bugs.webkit.org/show_bug.cgi?id=166568
2833
2834         Reviewed by Simon Fraser.
2835
2836         When a GraphicsLayer has a mask layer, it fails to properly unparent the mask layer before
2837         it is destroyed. This leaves the mask layer with a dangling parent pointer. Fix it, while
2838         taking care not to introduce yet another virtual function call during the execution of the
2839         destructor.
2840
2841         * platform/graphics/GraphicsLayer.cpp:
2842         (WebCore::GraphicsLayer::willBeDestroyed):
2843
2844 2018-01-03  Simon Fraser  <simon.fraser@apple.com>
2845
2846         SVG lighting filter lights are in the wrong coordinate system
2847         https://bugs.webkit.org/show_bug.cgi?id=181147
2848
2849         Reviewed by Zalan Bujtas.
2850
2851         Point and spot light coordinates weren't being converted into buffer-relative
2852         coordinates before being fed into the lighting math, resulting in incorrect light
2853         rendering on Retina devices, and when the filter primitive region was clipped.
2854
2855         Fix by storing absoluteUnclippedSubregion on FilterEffect, which allows us to map
2856         lighting points from user space coordinates into the coordinates of the buffer being
2857         used for rendering. Also scale the light z coordinate by doing a dummy point mapping in x.
2858
2859         Rename members of PointLightSource and SpotLightSource to make it clear which coordinate
2860         system they are in.
2861
2862         Tests include HiDPI tests.
2863
2864         Tests: svg/filters/fePointLight-coordinates-expected.svg
2865                svg/filters/fePointLight-coordinates.svg
2866                svg/filters/feSpotLight-coordinates-expected.svg
2867                svg/filters/feSpotLight-coordinates.svg
2868                svg/filters/hidpi/fePointLight-coordinates-expected.svg
2869                svg/filters/hidpi/fePointLight-coordinates.svg
2870                svg/filters/hidpi/feSpotLight-coordinates-expected.svg
2871                svg/filters/hidpi/feSpotLight-coordinates.svg
2872
2873         * platform/graphics/FloatPoint3D.h: Make it easy to get and set the X and Y coords as a FloatPoint.
2874         (WebCore::FloatPoint3D::xy const):
2875         (WebCore::FloatPoint3D::setXY):
2876         * platform/graphics/GeometryUtilities.cpp:
2877         (WebCore::mapPoint):
2878         (WebCore::mapRect):
2879         * platform/graphics/GeometryUtilities.h: Helper to make a point between rects.
2880         * platform/graphics/filters/DistantLightSource.cpp:
2881         (WebCore::DistantLightSource::initPaintingData):
2882         * platform/graphics/filters/DistantLightSource.h:
2883         * platform/graphics/filters/FELighting.cpp:
2884         (WebCore::FELighting::drawLighting):
2885         * platform/graphics/filters/FilterEffect.cpp:
2886         (WebCore::FilterEffect::mapPointFromUserSpaceToBuffer const):
2887         * platform/graphics/filters/FilterEffect.h:
2888         (WebCore::FilterEffect::setUnclippedAbsoluteSubregion):
2889         * platform/graphics/filters/LightSource.h:
2890         * platform/graphics/filters/PointLightSource.cpp:
2891         (WebCore::PointLightSource::initPaintingData):
2892         (WebCore::PointLightSource::computePixelLightingData const):
2893         (WebCore::PointLightSource::setX):
2894         (WebCore::PointLightSource::setY):
2895         (WebCore::PointLightSource::setZ):
2896         * platform/graphics/filters/PointLightSource.h:
2897         (WebCore::PointLightSource::position const):
2898         (WebCore::PointLightSource::PointLightSource):
2899         * platform/graphics/filters/SpotLightSource.cpp:
2900         (WebCore::SpotLightSource::initPaintingData):
2901         (WebCore::SpotLightSource::computePixelLightingData const):
2902         (WebCore::SpotLightSource::setX):
2903         (WebCore::SpotLightSource::setY):
2904         (WebCore::SpotLightSource::setZ):
2905         (WebCore::SpotLightSource::setPointsAtX):
2906         (WebCore::SpotLightSource::setPointsAtY):
2907         (WebCore::SpotLightSource::setPointsAtZ):
2908         * platform/graphics/filters/SpotLightSource.h:
2909         (WebCore::SpotLightSource::position const):
2910         (WebCore::SpotLightSource::direction const):
2911         (WebCore::SpotLightSource::SpotLightSource):
2912         * rendering/svg/RenderSVGResourceFilter.cpp:
2913         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
2914         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
2915         (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
2916
2917 2018-01-03  Youenn Fablet  <youenn@apple.com>
2918
2919         Select service worker for documents with data/blob URLS
2920         https://bugs.webkit.org/show_bug.cgi?id=181213
2921
2922         Reviewed by Alex Christensen.
2923
2924         Covered by updated test.
2925
2926         Reusing the service worker of the parent for blob/data URL documents.
2927
2928         * loader/DocumentLoader.cpp:
2929         (WebCore::isLocalURL):
2930         (WebCore::DocumentLoader::commitData):
2931
2932 2018-01-03  Ryan Haddad  <ryanhaddad@apple.com>
2933
2934         Unreviewed, rolling out r226352.
2935
2936         Breaks Sierra and El Capitan builds.
2937
2938         Reverted changeset:
2939
2940         "Web Inspector: Slow open time enumerating system fonts
2941         (FontCache::systemFontFamilies)"
2942         https://bugs.webkit.org/show_bug.cgi?id=180979
2943         https://trac.webkit.org/changeset/226352
2944
2945 2018-01-03  Philippe Normand  <pnormand@igalia.com>
2946
2947         [GStreamer] The bus synchronous handler should be in the base player class
2948         https://bugs.webkit.org/show_bug.cgi?id=181237
2949
2950         Reviewed by Carlos Garcia Campos.
2951
2952         Because this is where video rendering is handled.
2953
2954         No new tests, this is only a refactoring.
2955
2956         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2957         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2958         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2959         (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline):
2960
2961 2018-01-03  Philippe Normand  <pnormand@igalia.com>
2962
2963         [GStreamer] move MediaSample implementation out of mse/
2964         https://bugs.webkit.org/show_bug.cgi?id=179165
2965
2966         Reviewed by Carlos Garcia Campos.
2967
2968         This module isn't specific to MSE and can potentially be reused
2969         elsewhere, for WebRTC for instance. Additionally the
2970         ::platformSample() method was implemented and the code was cleaned up.
2971
2972         * platform/GStreamer.cmake:
2973         * platform/MediaSample.h:
2974         * platform/graphics/gstreamer/GStreamerMediaSample.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp.
2975         (WebCore::GStreamerMediaSample::platformSample):
2976         * platform/graphics/gstreamer/GStreamerMediaSample.h: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaSample.h.
2977         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2978         (WebCore::PlaybackPipeline::enqueueSample):
2979
2980 2018-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2981
2982         Unreviewed. Fix resource load stats tests on GLib based ports after r226355.
2983
2984         The monitor can be created in the work queue thread too.
2985
2986         * platform/glib/FileMonitorGLib.cpp:
2987         (WebCore::FileMonitor::FileMonitor):
2988
2989 2018-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2990
2991         [GTK] Crash destroying WebCore::FileMonitor
2992         https://bugs.webkit.org/show_bug.cgi?id=181138
2993
2994         Reviewed by Michael Catanzaro.
2995
2996         Ensure that platform file monitor is always created and destroyed in the work queue thread synchronously.
2997
2998         * platform/FileMonitor.h:
2999         * platform/glib/FileMonitorGLib.cpp:
3000         (WebCore::FileMonitor::FileMonitor):
3001         (WebCore::FileMonitor::~FileMonitor):
3002         (WebCore::FileMonitor::didChange):
3003
3004 2018-01-02  Joseph Pecoraro  <pecoraro@apple.com>
3005
3006         Web Inspector: Slow open time enumerating system fonts (FontCache::systemFontFamilies)
3007         https://bugs.webkit.org/show_bug.cgi?id=180979
3008         <rdar://problem/36146670>
3009
3010         Reviewed by Matt Baker.
3011
3012         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3013         (WebCore::FontCache::systemFontFamilies):
3014         Switch to the original Mac algorithm before r180979 that uses
3015         CTFontManagerCopyAvailableFontFamilyNames. Previously this wasn't
3016         available on iOS but now it is. This is a performance improvement on
3017         both platforms, but significantly so on macOS. It also finds more,
3018         valid, family names.
3019
3020 2018-01-02  Yusuke Suzuki  <utatane.tea@gmail.com>
3021
3022         Unreviewed, fix GCC warning by using #include
3023         https://bugs.webkit.org/show_bug.cgi?id=181189
3024
3025         This file is included in C++ files. Use #include instead of #import to suppress warning in GCC.
3026
3027         * platform/PromisedBlobInfo.h:
3028
3029 2017-12-28  Yusuke Suzuki  <utatane.tea@gmail.com>
3030
3031         Remove std::chrono completely
3032         https://bugs.webkit.org/show_bug.cgi?id=181186
3033
3034         Reviewed by Alex Christensen.
3035
3036         Use MonotonicTime, WallTime, and Seconds instead.
3037         Changes are mechanical ones. But persistent network cache data is changed.
3038         So we bump the version number of the cache storage.
3039
3040         * Modules/indexeddb/server/IDBServer.cpp:
3041         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
3042         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
3043         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
3044         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
3045         * Modules/indexeddb/server/IDBServer.h:
3046         * Modules/webdatabase/DatabaseTracker.cpp:
3047         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
3048         * Modules/webdatabase/DatabaseTracker.h:
3049         * dom/Document.cpp:
3050         (WebCore::Document::lastModified):
3051         * html/HTMLMediaElement.cpp:
3052         (WebCore::HTMLMediaElement::clearMediaCache):
3053         * html/HTMLMediaElement.h:
3054         (WebCore::HTMLMediaElement::clearMediaCache):
3055         * loader/CrossOriginPreflightResultCache.cpp:
3056         (WebCore::parseAccessControlMaxAge):
3057         (WebCore::CrossOriginPreflightResultCacheItem::parse):
3058         (WebCore::CrossOriginPreflightResultCacheItem::allowsRequest const):
3059         * loader/CrossOriginPreflightResultCache.h:
3060         * loader/cache/CachedResource.cpp:
3061         (WebCore::CachedResource::CachedResource):
3062         (WebCore::CachedResource::freshnessLifetime const):
3063         (WebCore::CachedResource::responseReceived):
3064         (WebCore::CachedResource::updateResponseAfterRevalidation):
3065         * loader/cache/CachedResource.h:
3066         * platform/FileSystem.cpp:
3067         (WebCore::FileSystem::getFileModificationTime):
3068         * platform/FileSystem.h:
3069         * platform/SearchPopupMenu.h:
3070         * platform/cocoa/SearchPopupMenuCocoa.h:
3071         * platform/cocoa/SearchPopupMenuCocoa.mm:
3072         (WebCore::toSystemClockTime):
3073         (WebCore::toNSDateFromSystemClock):
3074         (WebCore::removeRecentlyModifiedRecentSearches):
3075         * platform/graphics/MediaPlayer.cpp:
3076         (WebCore::MediaPlayer::clearMediaCache):
3077         * platform/graphics/MediaPlayer.h:
3078         * platform/graphics/MediaPlayerPrivate.h:
3079         (WebCore::MediaPlayerPrivateInterface::clearMediaCache):
3080         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3081         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3082         (WebCore::toSystemClockTime):
3083         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
3084         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3085         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3086         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
3087         * platform/network/CacheValidation.cpp:
3088         (WebCore::computeCurrentAge):
3089         (WebCore::computeFreshnessLifetimeForHTTPFamily):
3090         (WebCore::updateRedirectChainStatus):
3091         (WebCore::redirectChainAllowsReuse):
3092         (WebCore::parseCacheControlDirectives):
3093         * platform/network/CacheValidation.h:
3094         (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
3095         * platform/network/HTTPParsers.cpp:
3096         (WebCore::parseHTTPDate):
3097         * platform/network/HTTPParsers.h:
3098         * platform/network/PlatformCookieJar.h:
3099         * platform/network/ResourceResponseBase.cpp:
3100         (WebCore::ResourceResponseBase::cacheControlMaxAge const):
3101         (WebCore::parseDateValueInHeader):
3102         (WebCore::ResourceResponseBase::date const):
3103         (WebCore::ResourceResponseBase::age const):
3104         (WebCore::ResourceResponseBase::expires const):
3105         (WebCore::ResourceResponseBase::lastModified const):
3106         * platform/network/ResourceResponseBase.h:
3107         * platform/network/cf/CookieJarCFNet.cpp:
3108         (WebCore::deleteAllCookiesModifiedSince):
3109         * platform/network/curl/CookieJarCurl.cpp:
3110         (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince):
3111         (WebCore::deleteAllCookiesModifiedSince):
3112         * platform/network/curl/CookieJarCurl.h:
3113         * platform/network/curl/CurlCacheEntry.cpp:
3114         (WebCore::CurlCacheEntry::CurlCacheEntry):
3115         (WebCore::CurlCacheEntry::isCached):
3116         (WebCore::CurlCacheEntry::parseResponseHeaders):
3117         * platform/network/curl/CurlCacheEntry.h:
3118         * platform/network/mac/CookieJarMac.mm:
3119         (WebCore::deleteAllCookiesModifiedSince):
3120         * platform/network/soup/CookieJarSoup.cpp:
3121         (WebCore::deleteAllCookiesModifiedSince):
3122         * platform/win/SearchPopupMenuWin.cpp:
3123         (WebCore::SearchPopupMenuWin::loadRecentSearches):
3124         * rendering/RenderSearchField.cpp:
3125         (WebCore::RenderSearchField::addSearchResult):
3126
3127 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
3128
3129         [Attachment Support] Introduce data structures and IPC support for writing promised blobs
3130         https://bugs.webkit.org/show_bug.cgi?id=181189
3131
3132         Reviewed by Tim Horton.
3133
3134         Introduces a new header containing structs to be used for writing blob data when dragging. PromisedBlobInfo
3135         represents information needed to declare data on the pasteboard that will eventually be provided via a Blob.
3136         This includes the type and filename of the Blob-backed content. PromisedBlobData represents information needed
3137         to actually deliver the Blob's content to the platform, and is sent some time after its corresponding
3138         PromisedBlobInfo. The content may either be in the form of a file path (as is the case using the previous
3139         declareAndWriteAttachment codepath) or a data buffer (which we would use if the Blob is not already backed by a
3140         file on disk).
3141
3142         No new tests, since there is no observable change in functionality yet.
3143
3144         * WebCore.xcodeproj/project.pbxproj:
3145         * platform/PromisedBlobInfo.h: Added.
3146         (WebCore::PromisedBlobInfo::operator bool const):
3147         (WebCore::PromisedBlobData::hasData const):
3148         (WebCore::PromisedBlobData::hasFile const):
3149         (WebCore::PromisedBlobData::operator bool const):
3150         (WebCore::PromisedBlobData::fulfills const):
3151
3152 2018-01-02  Brady Eidson  <beidson@apple.com>
3153
3154         Make MessagePortChannel::takeAllMessagesFromRemote asynchronous.
3155         https://bugs.webkit.org/show_bug.cgi?id=181205
3156
3157         Reviewed by Alex Christensen.
3158
3159         No new tests (No behavior change)
3160
3161         This is needed for the ongoing WK2 MessagePort work.
3162
3163         For WK1 in-process MessagePorts it is still synchronous; no behavior change.
3164
3165         * dom/InProcessMessagePortChannel.cpp:
3166         (WebCore::InProcessMessagePortChannel::takeAllMessagesFromRemote):
3167         * dom/InProcessMessagePortChannel.h:
3168
3169         * dom/MessagePort.cpp:
3170         (WebCore::MessagePort::dispatchMessages):
3171         * dom/MessagePortChannel.h:
3172
3173 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
3174
3175         Add a WebAuthentication runtime feature flag
3176         https://bugs.webkit.org/show_bug.cgi?id=181220
3177         <rdar://problem/36055305>
3178
3179         Reviewed by Brent Fulgham.
3180
3181         This patch basically renames the CredentialManagement runtime feature flag into
3182         WebAuthentication runtime feature flag.
3183
3184         No tests.
3185
3186         * Modules/credentialmanagement/BasicCredential.idl:
3187         * Modules/credentialmanagement/CredentialsContainer.idl:
3188         * Modules/credentialmanagement/NavigatorCredentials.idl:
3189         * Modules/webauthn/PublicKeyCredential.idl:
3190         * page/RuntimeEnabledFeatures.h:
3191         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationEnabled):
3192         (WebCore::RuntimeEnabledFeatures::webAuthenticationEnabled const):
3193         (WebCore::RuntimeEnabledFeatures::setCredentialManagementEnabled): Deleted.
3194         (WebCore::RuntimeEnabledFeatures::credentialManagementEnabled const): Deleted.
3195
3196 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
3197
3198         [Attachment Support] Don't Blob-convert images and attachments with https:, http: or data: urls
3199         https://bugs.webkit.org/show_bug.cgi?id=181143
3200         <rdar://problem/36200381>
3201
3202         Reviewed by Tim Horton.
3203
3204         Clients such as Mail would expect pasting or dropping an image with src="https://..." to result in the source
3205         URL being preserved (i.e. staying as remote images) instead of creating image attachments out of them. This
3206         patch hooks into the shouldConvertToBlob() check added in r226272 so that it applies to attachment element
3207         replacement as well.
3208
3209         Test: WKAttachmentTests.DoNotInsertDataURLImagesAsAttachments
3210
3211         * editing/cocoa/WebContentReaderCocoa.mm:
3212         (WebCore::shouldConvertToBlob):
3213         (WebCore::replaceRichContentWithAttachments):
3214
3215 2018-01-02  Brady Eidson  <beidson@apple.com>
3216
3217         Identify MessagePorts by a globally unique MessagePortIdentifier.
3218         https://bugs.webkit.org/show_bug.cgi?id=181172
3219
3220         Reviewed by Alex Christensen.
3221
3222         No new tests (Behavior change covered by all existing tests).
3223
3224         This cleans up the abstract MessagePortChannel interface to be in terms of identifiers
3225         instead of actual MessagePort objects.
3226         
3227         The identifiers are compounded with the current ProcessIdentifier meaning they are global
3228         across all processes for the running UI process, enabling easy cross-process communication.
3229         
3230         (Actual cross-process communication comes in a followup)
3231         
3232         * WebCore.xcodeproj/project.pbxproj:
3233         
3234         * dom/InProcessMessagePortChannel.cpp:
3235         (WebCore::InProcessMessagePortChannel::createChannelBetweenPorts):
3236         (WebCore::InProcessMessagePortChannel::isConnectedTo):
3237         (WebCore::InProcessMessagePortChannel::entangleWithRemoteIfOpen):
3238         (WebCore::InProcessMessagePortChannel::entangleIfOpen): Deleted.
3239         * dom/InProcessMessagePortChannel.h:
3240         
3241         * dom/MessageChannel.cpp:
3242         (WebCore::MessageChannel::MessageChannel):
3243         (WebCore::m_port2):
3244         
3245         * dom/MessagePort.cpp:
3246         (WebCore::allMessagePortsLock):
3247         (WebCore::MessagePort::ref const):
3248         (WebCore::MessagePort::deref const):
3249         (WebCore::MessagePort::existingMessagePortForIdentifier):
3250         (WebCore::MessagePort::MessagePort):
3251         (WebCore::MessagePort::~MessagePort):
3252         (WebCore::MessagePort::postMessage):
3253         (WebCore::MessagePort::entangleWithRemote):
3254         (WebCore::MessagePort::entanglePorts):
3255         (WebCore::MessagePort::entangle): Deleted.
3256         * dom/MessagePort.h:
3257         
3258         * dom/MessagePortChannel.h:
3259         
3260         * dom/MessagePortIdentifier.h: Added.
3261         (WebCore::operator==):
3262         (WebCore::MessagePortIdentifier::encode const):
3263         (WebCore::MessagePortIdentifier::decode):
3264         (WebCore::MessagePortIdentifier::hash const):
3265         (WTF::MessagePortIdentifierHash::hash):
3266         (WTF::MessagePortIdentifierHash::equal):
3267         (WTF::HashTraits<WebCore::MessagePortIdentifier>::emptyValue):
3268         (WTF::HashTraits<WebCore::MessagePortIdentifier>::constructDeletedValue):
3269         (WTF::HashTraits<WebCore::MessagePortIdentifier>::isDeletedValue):
3270
3271 2018-01-02  Youenn Fablet  <youenn@apple.com>
3272
3273         Memory cache should not reuse resources with different credential fetch option
3274         https://bugs.webkit.org/show_bug.cgi?id=181212
3275
3276         Reviewed by Alex Christensen.
3277
3278         Covered by rebased test.
3279
3280         * loader/cache/CachedResourceLoader.cpp:
3281         (WebCore::CachedResourceLoader::determineRevalidationPolicy const):
3282
3283 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
3284
3285         Update Credential Management API for WebAuthentication
3286         https://bugs.webkit.org/show_bug.cgi?id=181082
3287         <rdar://problem/36055239>
3288
3289         Reviewed by Brent Fulgham.
3290
3291         Part 2/2
3292
3293         This patch implements Core API from Credential Management API: https://www.w3.org/TR/credential-management-1/#core.
3294         which is required by WebAuthN. It also sets the CredentialManagement runtime flag to enable testing. Note that it
3295         introduces a dummy PublicKeyCredential interface for testing functionalities of the Credential interface, which
3296         cannot be instantiated.
3297
3298         Tests: http/wpt/credential-management/credentialscontainer-create-basics.https.html
3299                http/wpt/credential-management/credentialscontainer-get-basics.https.html
3300                http/wpt/credential-management/credentialscontainer-preventSilentAccess-basics.https.html
3301                http/wpt/credential-management/idl.https.html
3302
3303         * CMakeLists.txt:
3304         * DerivedSources.make:
3305         * Modules/credentialmanagement/BasicCredential.cpp:
3306         (WebCore::BasicCredential::BasicCredential):
3307         (WebCore::BasicCredential::type const):
3308         * Modules/credentialmanagement/BasicCredential.h:
3309         (WebCore::BasicCredential::discovery const):
3310         * Modules/credentialmanagement/BasicCredential.idl:
3311         * Modules/credentialmanagement/CredentialCreationOptions.h:
3312         * Modules/credentialmanagement/CredentialCreationOptions.idl:
3313         * Modules/credentialmanagement/CredentialRequestOptions.h:
3314         * Modules/credentialmanagement/CredentialRequestOptions.idl:
3315         * Modules/credentialmanagement/CredentialsContainer.cpp:
3316         (WebCore::CredentialsContainer::CredentialsContainer):
3317         (WebCore::CredentialsContainer::isSameOriginWithItsAncestors):
3318         (WebCore::CredentialsContainer::dispatchTask):
3319         (WebCore::CredentialsContainer::get):
3320         (WebCore::CredentialsContainer::store):
3321         (WebCore::CredentialsContainer::isCreate):
3322         (WebCore::CredentialsContainer::preventSilentAccess):
3323         * Modules/credentialmanagement/CredentialsContainer.h:
3324         (WebCore::CredentialsContainer::create):
3325         (WebCore::CredentialsContainer::CredentialsContainer): Deleted.
3326         * Modules/credentialmanagement/CredentialsContainer.idl:
3327         * Modules/credentialmanagement/NavigatorCredentials.cpp:
3328         (WebCore::NavigatorCredentials::credentials):
3329         * Modules/credentialmanagement/NavigatorCredentials.h:
3330         * Modules/credentialmanagement/NavigatorCredentials.idl:
3331         * Modules/webauthn/PublicKeyCredential.cpp: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
3332         (WebCore::PublicKeyCredential::PublicKeyCredential):
3333         (WebCore::PublicKeyCredential::collectFromCredentialStore):
3334         (WebCore::PublicKeyCredential::discoverFromExternalSource):
3335         (WebCore::PublicKeyCredential::store):
3336         (WebCore::PublicKeyCredential::create):
3337         * Modules/webauthn/PublicKeyCredential.h: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
3338         * Modules/webauthn/PublicKeyCredential.idl: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.idl.
3339         * Sources.txt:
3340         * WebCore.xcodeproj/project.pbxproj:
3341         * bindings/js/WebCoreBuiltinNames.h:
3342         * page/RuntimeEnabledFeatures.h:
3343
3344 2018-01-02  Oleksandr Skachkov  <gskachkov@gmail.com>
3345
3346         WebAssembly: sending module to iframe fails
3347         https://bugs.webkit.org/show_bug.cgi?id=179263
3348
3349         Reviewed by JF Bastien.
3350
3351         Allow use WebAssembly.Module as input parameters for postMessage 
3352         in window and iframe object. To prevent sending message to iframe
3353         that is not ready, in iframe-* test we are waiting message from
3354         iframe only after that we send message to it.   
3355
3356         Tests: wasm/iframe-parent-postmessage.html
3357                wasm/iframe-postmessage.html
3358                wasm/window-postmessage.html
3359
3360         * bindings/js/SerializedScriptValue.cpp:
3361         (WebCore::CloneSerializer::dumpIfTerminal):
3362         * bindings/js/SerializedScriptValue.h:
3363         * page/DOMWindow.cpp:
3364         (WebCore::DOMWindow::postMessage):
3365
3366 == Rolled over to ChangeLog-2018-01-01 ==