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