f6b98c461257fdccd9ce4759f9fad1569c3d91e9
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-02-01  Chris Dumez  <cdumez@apple.com>
2
3         Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>()
4         https://bugs.webkit.org/show_bug.cgi?id=182392
5         <rdar://problem/37119215>
6
7         Reviewed by Geoffrey Garen.
8
9         Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>(),
10         given that getting the property from the object can throw an exception.
11
12         No new tests, rebaselined existing test.
13
14         * bindings/scripts/CodeGeneratorJS.pm:
15         (GenerateDictionaryImplementationContent):
16         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
17         (WebCore::convertDictionary<TestCallbackInterface::Dictionary>):
18         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
19         (WebCore::convertDictionary<TestEventConstructor::Init>):
20         * bindings/scripts/test/JS/JSTestObj.cpp:
21         (WebCore::convertDictionary<TestObj::Dictionary>):
22         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
23         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
24         (WebCore::convertDictionary<AlternateDictionaryName>):
25         (WebCore::convertDictionary<TestObj::ParentDictionary>):
26         (WebCore::convertDictionary<TestObj::ChildDictionary>):
27         (WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
28         (WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
29         (WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
30         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
31         (WebCore::convertDictionary<TestPromiseRejectionEvent::Init>):
32         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
33         (WebCore::convertDictionary<DictionaryImplName>):
34
35 2018-02-01  Ryosuke Niwa  <rniwa@webkit.org>
36
37         Some test cases in accessibility/mac/selection-notification-focus-change.html fail
38         https://bugs.webkit.org/show_bug.cgi?id=182212
39         <rdar://problem/36937147>
40
41         Reviewed by Antti Koivisto and Wenson Hsieh.
42
43         The failure was caused by the async update of the selection appearance not preserving selection reveal intent.
44         Fixed the bug by storing the intent in a member variable and using it later.
45
46         * dom/Element.cpp:
47         (WebCore::Element::focus): Removed an unnecessary synchronous layout update.
48         * editing/FrameSelection.cpp:
49         (WebCore::FrameSelection::setNeedsSelectionUpdate): Use the default intent to preserve the old behavior.
50         (WebCore::FrameSelection::respondToNodeModification): Ditto.
51         (WebCore::FrameSelection::setSelection): Save the selection reveal intent.
52         (WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange): Use the saved intent.
53         * editing/FrameSelection.h:
54         * page/FocusController.cpp:
55         (WebCore::FocusController::advanceFocusDirectionally): Always update the layout before invoking
56         nodeRectInAbsoluteCoordinates.
57
58 2018-02-01  Zalan Bujtas  <zalan@apple.com>
59
60         [RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
61         https://bugs.webkit.org/show_bug.cgi?id=182306
62         <rdar://problem/37041440>
63
64         Reviewed by Darin Adler.
65
66         Addressing post-review comment.
67
68         * rendering/updating/RenderTreeBuilderRuby.cpp:
69         (WebCore::RenderTreeBuilder::Ruby::insertChild):
70         (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
71         * rendering/updating/RenderTreeBuilderRuby.h:
72
73 2018-02-01  Zalan Bujtas  <zalan@apple.com>
74
75         [RenderTreeBuilder] Introduce RenderTreeBuilder to takeChild()
76         https://bugs.webkit.org/show_bug.cgi?id=182373
77         <rdar://problem/37101484>
78
79         Reviewed by Antti Koivisto.
80         
81         This is in preparation for moving mutation code out of takeChild. 
82
83         No change in functionality.
84
85         * rendering/RenderBlock.cpp:
86         (WebCore::RenderBlock::takeChild):
87         * rendering/RenderBlock.h:
88         * rendering/RenderBlockFlow.cpp:
89         (WebCore::RenderBlockFlow::takeChild):
90         * rendering/RenderBlockFlow.h:
91         * rendering/RenderButton.cpp:
92         (WebCore::RenderButton::takeChild):
93         * rendering/RenderButton.h:
94         * rendering/RenderElement.cpp:
95         (WebCore::RenderElement::takeChild):
96         (WebCore::RenderElement::removeAndDestroyChild):
97         (WebCore::RenderElement::destroyLeftoverChildren):
98         * rendering/RenderElement.h:
99         * rendering/RenderFullScreen.cpp:
100         (WebCore::RenderFullScreen::wrapExistingRenderer):
101         (WebCore::RenderFullScreen::unwrapRenderer):
102         * rendering/RenderGrid.cpp:
103         (WebCore::RenderGrid::takeChild):
104         * rendering/RenderGrid.h:
105         * rendering/RenderMenuList.cpp:
106         (RenderMenuList::takeChild):
107         * rendering/RenderMenuList.h:
108         * rendering/RenderMultiColumnFlow.cpp:
109         (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
110         * rendering/RenderObject.cpp:
111         (WebCore::RenderObject::removeFromParentAndDestroy):
112         * rendering/RenderRuby.cpp:
113         (WebCore::RenderRubyAsInline::takeChild):
114         (WebCore::RenderRubyAsBlock::takeChild):
115         * rendering/RenderRuby.h:
116         * rendering/RenderRubyRun.cpp:
117         (WebCore::RenderRubyRun::takeChild):
118         * rendering/RenderRubyRun.h:
119         * rendering/RenderTableRow.cpp:
120         (WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): Deleted.
121         * rendering/RenderTableRow.h:
122         * rendering/svg/RenderSVGContainer.cpp:
123         (WebCore::RenderSVGContainer::takeChild):
124         * rendering/svg/RenderSVGContainer.h:
125         * rendering/svg/RenderSVGInline.cpp:
126         (WebCore::RenderSVGInline::takeChild):
127         * rendering/svg/RenderSVGInline.h:
128         * rendering/svg/RenderSVGRoot.cpp:
129         (WebCore::RenderSVGRoot::takeChild):
130         * rendering/svg/RenderSVGRoot.h:
131         * rendering/svg/RenderSVGText.cpp:
132         (WebCore::RenderSVGText::takeChild):
133         * rendering/svg/RenderSVGText.h:
134         * rendering/updating/RenderTreeBuilder.cpp:
135         (WebCore::RenderTreeBuilder::collapseAndDestroyAnonymousSiblingRows):
136         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
137         * rendering/updating/RenderTreeBuilder.h:
138         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
139         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
140         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
141         * rendering/updating/RenderTreeBuilderList.cpp:
142         (WebCore::RenderTreeBuilder::List::updateItemMarker):
143         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
144         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
145         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
146         * rendering/updating/RenderTreeBuilderRuby.cpp:
147         (WebCore::RenderTreeBuilder::Ruby::insertChild):
148
149 2018-02-01  Dean Jackson  <dino@apple.com>
150
151         REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body
152         https://bugs.webkit.org/show_bug.cgi?id=182394
153         <rdar://problem/34840816>
154
155         Reviewed by Simon Fraser.
156
157         If a scale < 1 is applied to the page, then the visual viewport will be bigger
158         than the layout viewport. Our hit testing code would then ignore any hits
159         that were outside the layout viewport.
160
161         The fix is to only apply a hit testing clip if the page is scaling up, not down.
162
163         Update the existing fast/dom/elementFromPoint-scaled-scrolled.html test.
164
165         * page/FrameView.cpp:
166         (WebCore::FrameView::layoutViewportToAbsoluteRect const): Deleted. This helper is
167         no longer used, and it would have probably been more confusing to have it accept
168         a flag to ignore the scale if it is less than 1.
169         * page/FrameView.h:
170         * rendering/RenderLayer.cpp:
171         (WebCore::RenderLayer::hitTest): No need to take the layout rect, remove the origin,
172         and pass it to a helper that added the origin back. The only thing the helper was
173         doing for us was applying a scale factor, which we only want to do if it was
174         scaling up.
175
176 2018-02-01  Yusuke Suzuki  <utatane.tea@gmail.com>
177
178         Structured cloning a Symbol should throw
179         https://bugs.webkit.org/show_bug.cgi?id=182380
180
181         Reviewed by Darin Adler.
182
183         Test: js/dom/post-message-symbol.html
184
185         * bindings/js/SerializedScriptValue.cpp:
186         (WebCore::CloneSerializer::dumpIfTerminal):
187         Structured cloning should throw "DataCloneError" DOMException if it finds Symbol.
188         Remove unused `isNumber()` case. It is done in dumpImmediate.
189         (WebCore::CloneSerializer::serializeUndefined): Deleted.
190         (WebCore::CloneSerializer::serializeBoolean): Deleted.
191         (WebCore::CloneSerializer::serializeNumber): Deleted.
192         Remove unused functions.
193
194 2018-02-01  Chris Dumez  <cdumez@apple.com>
195
196         We no longer need to queue service worker jobs until the connection to the service worker process has been established
197         https://bugs.webkit.org/show_bug.cgi?id=182375
198
199         Reviewed by Youenn Fablet.
200
201         We no longer need to queue service worker jobs until the connection to the service worker process
202         has been established. We initially did this to work around the fact that registrations restored
203         from disk would not have an active worker until the service worker process had been established. 
204         However, this issue has been fixed in r227696.
205
206         This is basically a revert of r227220, which is no longer needed after r227696.
207
208         No new tests, initial fix was covered by an API test that still passes.
209
210         * workers/service/server/SWServer.cpp:
211         (WebCore::SWServer::clearAll):
212         (WebCore::SWServer::clear):
213         (WebCore::SWServer::scheduleJob):
214         (WebCore::SWServer::serverToContextConnectionCreated):
215         * workers/service/server/SWServer.h:
216
217 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
218
219         [GTK] Shift + mouse scroll should scroll horizontally
220         https://bugs.webkit.org/show_bug.cgi?id=181629
221
222         Reviewed by Michael Catanzaro.
223
224         We currently turn vertical scroll into horizontal when scrolling over the horizontal scrollbar. When Shift key is
225         pressed, we still want to scroll in the scrollbar direction when scrolling over a scrollbar, so we need to swap
226         directions in both scrollbars depending on whther the Shift key is pressed or not.
227
228         * page/EventHandler.cpp:
229         (WebCore::EventHandler::shouldSwapScrollDirection const): Renamed.
230         (WebCore::EventHandler::handleWheelEvent): Use the new name.
231         (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.
232         * page/EventHandler.h:
233         * platform/PlatformWheelEvent.h:
234         (WebCore::PlatformWheelEvent::copySwappingDirection const): Swap the direction of the event.
235         (WebCore::PlatformWheelEvent::copyTurningVerticalTicksIntoHorizontalTicks const): Deleted.
236         * platform/glib/EventHandlerGLib.cpp:
237         (WebCore::EventHandler::shouldSwapScrollDirection const): Take into account whether the Shift key is present.
238         (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.
239
240 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
241
242         [GTK] Problem with Washington Post images
243         https://bugs.webkit.org/show_bug.cgi?id=181421
244
245         Reviewed by Carlos Alberto Lopez Perez.
246
247         This is because Washington Post is using the user agent to decide the image formats it serves. In the case of
248         chromium the images are served as webp, for firefox jpeg is used and in our case it's assuming we are safari and
249         it's providing jp2 images that we don't support. Add a user agent quirk to pretend to be chromium for
250         washingtonpost.com.
251
252         * platform/UserAgentQuirks.cpp:
253         (WebCore::urlRequiresChromeBrowser):
254
255 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
256
257         [SOUP] Ensure domain is valid when converting a WebCore Cookie to Soup
258         https://bugs.webkit.org/show_bug.cgi?id=182328
259
260         Reviewed by Michael Catanzaro.
261
262         soup_cookie_parse() adds the initial '.' to the domain if missing before creating the SoupCookie, but
263         soup_cookie_new() allows for domain to be a hostname that needs to match exactly. When converting a WebCore
264         Cookie into a SoupCookie we always want the domain to be considered as such and not as a hostname, so we need to
265         prepend the '.' if missing.
266
267         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
268
269         * platform/network/soup/CookieSoup.cpp:
270         (WebCore::Cookie::toSoupCookie const):
271
272 2018-02-01  Zalan Bujtas  <zalan@apple.com>
273
274         [RenderTreeBuilder] Move RenderTableRow::collapseAndDestroyAnonymousSiblingRows to RenderTreeBuilder
275         https://bugs.webkit.org/show_bug.cgi?id=182374
276         <rdar://problem/37102005>
277
278         Reviewed by Antti Koivisto.
279
280         It's only called from RenderTreeBuilder.
281
282         No change in functionality.
283
284         * rendering/RenderTableRow.cpp:
285         (WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): Deleted.
286         * rendering/RenderTableRow.h:
287         * rendering/updating/RenderTreeBuilder.cpp:
288         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
289         * rendering/updating/RenderTreeBuilderTable.cpp:
290         (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
291         * rendering/updating/RenderTreeBuilderTable.h:
292
293 2018-02-01  Chris Dumez  <cdumez@apple.com>
294
295         Queue a microtask when a waitUntil() promise is settled
296         https://bugs.webkit.org/show_bug.cgi?id=182372
297         <rdar://problem/37101019>
298
299         Reviewed by Mark Lam.
300
301         Queue a microtask when a waitUntil() promise is settled, as per:
302         - https://w3c.github.io/ServiceWorker/#dom-extendableevent-waituntil (step 5)
303
304         Otherwise, we decrement m_pendingPromiseCount too quickly and it may cause
305         following calls to waitUntil() to throw when they shouldn't.
306
307         No new tests, rebaselined existing test.
308
309         * workers/service/ExtendableEvent.cpp:
310         (WebCore::ExtendableEvent::addExtendLifetimePromise):
311
312 2018-02-01  Antti Koivisto  <antti@apple.com>
313
314         Invalidate style for sibling combinators accurately on class change
315         https://bugs.webkit.org/show_bug.cgi?id=182336
316
317         Reviewed by Zalan Bujtas.
318
319         Use Style::Invalidator to invalidate only those elements that may be affected by a class
320         change for sibling combinators and nth pseudo classes.
321
322         * css/RuleFeature.cpp:
323
324         Add new AllSiblings MatchElement to use for nth pseudo classes with subselectors.
325
326         (WebCore::isSiblingOrSubject):
327
328         Add a helper.
329
330         (WebCore::RuleFeatureSet::computeNextMatchElement):
331         (WebCore::RuleFeatureSet::computeSubSelectorMatchElement):
332
333         Compute and propage MatchElement::AllSiblings.
334
335         * css/RuleFeature.h:
336         * dom/Node.cpp:
337         (WebCore::Node::updateAncestorsForStyleRecalc):
338
339         Don't need to test for childrenAffectedByPropertyBasedBackwardPositionalRules anymore (an oddly named bit for nth pseudo classes).
340
341         * style/StyleInvalidator.cpp:
342         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
343
344         Invalidate only the potentially affected elements.
345         The old code would just unconditionally invalidate the current element. This would propagate to descedants of siblings via
346         affectedByPreviousSibling bits. That mechanism can be removed when everything has been switched to accurate invalidation.
347
348 2018-01-31  Simon Fraser  <simon.fraser@apple.com>
349
350         Use different debug red colors for different contexts
351         https://bugs.webkit.org/show_bug.cgi?id=182362
352
353         Reviewed by Tim Horton.
354
355         Pure red is used elsehwere in the system as a debug color indicator, so use different
356         shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
357         so they are identifiable.
358
359         * page/FrameView.cpp:
360         (WebCore::FrameView::paintContents):
361
362 2018-01-31  Don Olmstead  <don.olmstead@sony.com>
363
364         [CMake] Make JavaScriptCore headers copies
365         https://bugs.webkit.org/show_bug.cgi?id=182303
366
367         Reviewed by Alex Christensen.
368
369         No new tests. No change in behavior.
370
371         * CMakeLists.txt:
372         * PlatformMac.cmake:
373         * PlatformWPE.cmake:
374         * PlatformWin.cmake:
375         * PlatformWinCairo.cmake:
376
377 2018-01-31  Per Arne Vollan  <pvollan@apple.com>
378
379         Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
380         https://bugs.webkit.org/show_bug.cgi?id=181204
381         <rdar://problem/36256274>
382
383         Reviewed by Ryosuke Niwa.
384
385         When a frame element is moved in the DOM tree during the execution of a beforeunload handler,
386         the frame will be detached when removed from its previous position in the DOM tree. When being
387         detached, an attempt will also be made to stop the load by calling FrameLoader::stopAllLoaders().
388         However, this method will return early when executed in a beforeunload handler, since navigation
389         is not allowed then. The end result is a detached frame which will continue to load, and hitting
390         asserts in DocumentLoader::dataReceived(), and DocumentLoader::notifyFinished(). It should be
391         possible to stop a frame load, even when executing a beforeunload handler.
392
393         No new tests. Covered by the existing test fast/events/beforeunload-dom-manipulation-crash.html.
394
395         * history/PageCache.cpp:
396         (WebCore::PageCache::addIfCacheable): Fix a failing API test by allowing scripts to be executed
397         under the PageCache::prune method.
398         * loader/FrameLoader.cpp:
399         (WebCore::FrameLoader::isStopLoadingAllowed const):
400         (WebCore::FrameLoader::stopAllLoaders):
401         * loader/FrameLoader.h:
402         * svg/graphics/SVGImage.cpp:
403         (WebCore::SVGImage::~SVGImage): Disable scripts disallowed assertions in this scope, since it is
404         safe in this context.
405
406 2018-01-31  Javier Fernandez  <jfernandez@igalia.com>
407
408         inline-block baseline not computed correctly for vertical-lr
409         https://bugs.webkit.org/show_bug.cgi?id=170176
410
411         Reviewed by Manuel Rego Casasnovas.
412
413         When computing the baseline position of inline-block elements we use the
414         InlineFlow logicalTop and the FontMetrics ascent. The issue comes from
415         the fact that these units are incompatible. The logicalTop of a
416         vertical-lr element is offset to the left edge, while the ascent is the
417         distance from the right edge.
418
419         We need to either use logical value for the FontMetrics ascent so we can
420         compute the correctly the baselines of vertical-lr elements, or just using
421         the logicalBottom for these cases.
422
423         The approach based on a logicalAscent API for FontMetrics would require
424         a lot of work because inline-block logic assumes everything is vertical-rl
425         and at some point, flips the elements along the block-axis in case of
426         vertical-lr mode.
427
428         While it'd be desirable to get rid of this flipping logic, this patch tries
429         first the simpler approach of using logicalBottom, which aligns with the
430         currently implemented logic.
431
432         Tests: fast/inline-block/baseline-vertical-01.html
433                fast/inline-block/baseline-vertical-02.html
434                fast/inline-block/baseline-vertical-03.html
435                fast/inline-block/baseline-vertical-04.html
436                fast/inline-block/baseline-vertical-05.html
437                fast/inline-block/baseline-vertical-06.html
438                fast/inline-block/baseline-vertical-07.html
439                fast/inline-block/baseline-vertical-08.html
440
441         * rendering/InlineFlowBox.cpp:
442         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
443         * rendering/RenderBlockFlow.cpp:
444         (WebCore::RenderBlockFlow::inlineBlockBaseline const):
445
446 2018-01-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
447
448         BitmapImage::drawPattern() may not draw a complete frame even after all the data is received
449         https://bugs.webkit.org/show_bug.cgi?id=182277
450
451         Reviewed by Simon Fraser.
452
453         BitmapImage::drawPattern() needs to destroy the incomplete decoded frame
454         before trying to draw it as a pattern.
455
456         Test: http/tests/images/draw-pattern-slow-load-large-image.html
457
458         * loader/cache/CachedImage.cpp:
459         (WebCore::CachedImage::updateBufferInternal): We need to disable CachedImage
460         data buffering for testing. This simulates slow network where intervals
461         between data chunks can last for seconds.
462         * loader/cache/CachedImage.h:
463         * platform/graphics/BitmapImage.cpp:
464         (WebCore::BitmapImage::drawPattern): Destroy the incomplete decoded frame
465         before drawing this frame as a pattern. We do not destroy incomplete decoded
466         frame once new data is received because it may be drawn by async image
467         drawing while waiting for the newer frame to finish decoding.
468         * testing/Internals.cpp:
469         (WebCore::Internals::setForceUpdateImageDataEnabledForTesting):
470         * testing/Internals.h:
471         * testing/Internals.idl:
472
473 2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>
474
475         Add a release assertion to ensure timers are deleted in the right thread
476         https://bugs.webkit.org/show_bug.cgi?id=182351
477
478         Reviewed by David Kilzer.
479
480         Added a relese assertion in ~TimerBase that the current thread is the one in which the timer was created.
481
482         We use canAccessThreadLocalDataForThread for this purpose since the condition is more complicated
483         when WebThread is being used.
484
485         * platform/Timer.cpp:
486         (WebCore::TimerBase::~TimerBase): Added the assertion.
487         * platform/Timer.h:
488         (WebCore::TimerBase::m_thread): Always store the current thread in a timer.
489
490 2018-01-31  Youenn Fablet  <youenn@apple.com>
491
492         Change SWServer::claim to set the iterator value as soon as possible
493         https://bugs.webkit.org/show_bug.cgi?id=182337
494
495         Reviewed by Chris Dumez.
496
497         No change of behavior, this is a "let's go safe way" fix.
498
499         * workers/service/server/SWServer.cpp:
500         (WebCore::SWServer::claim):
501
502 2018-01-31  Zalan Bujtas  <zalan@apple.com>
503
504         [RenderTreeBuilder] Move RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers to RenderTreeBuilder.
505         https://bugs.webkit.org/show_bug.cgi?id=182348
506         <rdar://problem/37082837>
507
508         Reviewed by Antti Koivisto.
509
510         All the callsites are in the RenderTreeUpdater by now.
511
512         No change in functionality.
513
514         * rendering/RenderObject.cpp:
515         (WebCore::isAnonymousAndSafeToDelete): Deleted.
516         (WebCore::findDestroyRootIncludingAnonymous): Deleted.
517         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
518         * rendering/RenderObject.h:
519         * rendering/updating/RenderTreeBuilder.cpp:
520         (WebCore::isAnonymousAndSafeToDelete):
521         (WebCore::findDestroyRootIncludingAnonymous):
522         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
523         * rendering/updating/RenderTreeBuilder.h:
524         * rendering/updating/RenderTreeUpdater.cpp:
525         (WebCore::RenderTreeUpdater::tearDownRenderers):
526         (WebCore::RenderTreeUpdater::tearDownTextRenderer):
527
528 2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>
529
530         Release assertion in Performance::resourceTimingBufferFullTimerFired when the resource timing buffer is shrunk
531         https://bugs.webkit.org/show_bug.cgi?id=182319
532         <rdar://problem/36904312>
533
534         Reviewed by Chris Dumez.
535
536         The crash was caused by a wrong release assertion. Handle author scripts shrinking the resource timing buffer
537         while resourcetimingbufferfull event is being dispatched.
538
539         Also fixed a bug that a superflous resourcetimingbufferfull event will be fired when new resource timing entries
540         are queued while resourcetimingbufferfull event is being dispatched.
541
542         Test: http/tests/performance/performance-resource-timing-resourcetimingbufferfull-queue-resource-entry.html
543               http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html
544
545         * page/Performance.cpp:
546         (WebCore::Performance::resourceTimingBufferFullTimerFired): 
547
548 2018-01-31  Youenn Fablet  <youenn@apple.com>
549
550         com.apple.WebKit.Storage crashing at com.apple.WebCore: WebCore::SWServerRegistration::removeClientUsingRegistration
551         https://bugs.webkit.org/show_bug.cgi?id=182316
552         <rdar://problem/37025976>
553
554         Reviewed by Chris Dumez.
555
556         SWServer.m_clientToControllingWorker and SWServerRegistration.m_clientsUsingRegistration might currently get out of sync.
557         This is a defensive fix to ensure storage process will not crash in Release.
558         We keep the ASSERT as this probably means there is an abnormal situation that other patches might fix.
559
560         * workers/service/server/SWServerRegistration.cpp:
561         (WebCore::SWServerRegistration::removeClientUsingRegistration):
562
563 2018-01-31  Antoine Quint  <graouts@apple.com>
564
565         [Modern Media Controls] Turn media/modern-media-controls/start-support tests back on
566         https://bugs.webkit.org/show_bug.cgi?id=182297
567
568         Reviewed by Jon Lee and Eric Carlson.
569
570         We identified one cause of flakiness when turning those tests back on and fix it in this patch. There would be
571         cases where the play/pause button would never actually become visible because we would first set it as one of
572         the buttons in the left container in the bottom controls bar before we would identify that we should show the
573         prominent play/pause button, and then once we did, we would add it as a child to the InlineMediaControls. But,
574         because the actual layout of the ButtonsContainer would happen in a rAF due to being a layout() method, we would
575         remove the play/pause button from the InlineMediaControls and set it as a child of the left container even
576         though it wasn't visible.
577
578         Performing the layout of a ButtonsContainer should really happen immediately when we set the buttons, so in this
579         patch we remove the "buttons" property and clients of ButtonsContainer can simply add or remove children which
580         will be laid out in a row. To support this, we've added two notification methods to LayoutNode, one that indicates
581         when children have changed, didChangeChildren(), which we override in ButtonsContainer to perform a synchronous
582         layout. The other method is willRemoveChild() which we also override in ButtonsContainer, this time to reset
583         the "x" and "visible" properties which we set while performing layout.
584         
585         This fixes flakiness for media/modern-media-controls/start-support/start-support-click-to-start.html, and maybe
586         other modern-media-controls tests that could have been affected by this unexpected behavior.
587
588         * Modules/modern-media-controls/controls/buttons-container.js:
589         (ButtonsContainer.prototype.willRemoveChild):
590         (ButtonsContainer.prototype.didChangeChildren):
591         (ButtonsContainer.prototype.layout):
592         (ButtonsContainer.prototype.get buttons): Deleted.
593         (ButtonsContainer.prototype.set buttons): Deleted.
594         * Modules/modern-media-controls/controls/inline-media-controls.js:
595         (InlineMediaControls.prototype.layout):
596         (InlineMediaControls.prototype._updateBottomControlsBarLabel):
597         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
598         (InlineMediaControls):
599         * Modules/modern-media-controls/controls/layout-node.js:
600         (LayoutNode.prototype.set children):
601         (LayoutNode.prototype.addChild):
602         (LayoutNode.prototype.removeChild):
603         (LayoutNode.prototype.willRemoveChild):
604         (LayoutNode.prototype.didChangeChildren):
605         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
606         (MacOSFullscreenMediaControls.prototype.layout):
607         * Modules/modern-media-controls/media/media-controller.js: Drive-by fix to correctly set the value passed as
608         data-auto-hide-delay on a <video> element.
609
610 2018-01-31  Zalan Bujtas  <zalan@apple.com>
611
612         [RenderTreeBuilder] Move RenderMultiColumnFlow::resolveMovedChild to RenderTreeBuilder.
613         https://bugs.webkit.org/show_bug.cgi?id=182315
614         <rdar://problem/37048160>
615
616         Reviewed by Antti Koivisto.
617
618         resolveMovedChild() is only called from RenderTreeBuilder.
619
620         No change in functionality.
621
622         * rendering/RenderFragmentedFlow.h:
623         * rendering/RenderMultiColumnFlow.cpp:
624         (WebCore::RenderMultiColumnFlow::resolveMovedChild const): Deleted.
625         * rendering/RenderMultiColumnFlow.h:
626         * rendering/updating/RenderTreeBuilder.cpp:
627         (WebCore::RenderTreeBuilder::resolveMovedChildForMultiColumnFlow):
628         * rendering/updating/RenderTreeBuilder.h:
629         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
630         (WebCore::RenderTreeBuilder::BlockFlow::insertChild):
631         * rendering/updating/RenderTreeBuilderInline.cpp:
632         (WebCore::RenderTreeBuilder::Inline::insertChild):
633         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
634         (WebCore::RenderTreeBuilder::MultiColumn::resolveMovedChild):
635         * rendering/updating/RenderTreeBuilderMultiColumn.h:
636
637 2018-01-31  Philippe Normand  <pnormand@igalia.com>
638
639         [GStreamer] Silent WebAudio buffers support
640         https://bugs.webkit.org/show_bug.cgi?id=143869
641
642         Reviewed by Carlos Garcia Campos.
643
644         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
645         (webKitWebAudioSrcLoop): Flag silent buffers as GAP buffers. This
646         enables downstream elements to optimize the buffer processing.
647
648 2018-01-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
649
650         [EME] Fix NavigatorEME::tryNextSupportedConfiguration typo
651         https://bugs.webkit.org/show_bug.cgi?id=182324
652
653         Reviewed by Žan Doberšek.
654
655         * Modules/encryptedmedia/NavigatorEME.cpp:
656         (WebCore::tryNextSupportedConfiguration): Fix
657         candidateCofiguration typo.
658
659 2018-01-30  Fujii Hironori  <Hironori.Fujii@sony.com>
660
661         [WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as double strike in HiDPI
662         https://bugs.webkit.org/show_bug.cgi?id=182093
663
664         Reviewed by Alex Christensen.
665
666         WebKit draws texts doubly by shifting 1px for fonts without bold
667         fonts but bold font is desired. This synthetic bold method draws
668         fonts with embedded bitmap fonts look like double strike in HiDPI.
669
670         No new tests (Covered by the existing tests).
671
672         * platform/graphics/win/FontCacheWin.cpp:
673         (WebCore::createGDIFont): Overwrite lfWeight if the desired weight
674         is bold and matched font weight is't bold and in WinCairo port.
675         Fix wrong indentation.
676
677 2018-01-30  Youenn Fablet  <youenn@apple.com> and Oleksandr Skachkov  <gskachkov@gmail.com>
678
679         FetchResponse should support ConsumeData callback on chunk data is received
680         https://bugs.webkit.org/show_bug.cgi?id=181600
681         <rdar://problem/36932547>
682
683         Reviewed by Alex Christensen.
684
685         Test: imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-body-loaded-in-chunk.https.html
686
687         Apply same read-by-chunk strategy for body coming from network as for body coming from ReadableStream.
688         Refactor to have one consumeBodyReceivedByChunk method for both cases.
689         This allows streaming data from a service worker to WebProcess as would be done by NetworkProcess.
690
691         * Modules/cache/DOMCache.cpp:
692         (WebCore::DOMCache::addAll):
693         (WebCore::DOMCache::put):
694         * Modules/fetch/FetchResponse.cpp:
695         (WebCore::FetchResponse::BodyLoader::didSucceed):
696         (WebCore::FetchResponse::BodyLoader::didReceiveData):
697         (WebCore::FetchResponse::BodyLoader::consumeDataByChunk):
698         (WebCore::FetchResponse::consumeBody):
699         (WebCore::FetchResponse::consumeBodyReceivedByChunk):
700         * Modules/fetch/FetchResponse.h:
701         * workers/service/context/ServiceWorkerFetch.cpp:
702         (WebCore::ServiceWorkerFetch::processResponse):
703
704 2018-01-30  Don Olmstead  <don.olmstead@sony.com>
705
706         JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
707         https://bugs.webkit.org/show_bug.cgi?id=182312
708
709         Reviewed by Michael Catanzaro.
710
711         No new tests. No change in behavior.
712
713         * config.h:
714
715 2018-01-30  Chris Nardi  <cnardi@chromium.org>
716
717         Use double-quotes when serializing font-feature-settings
718         https://bugs.webkit.org/show_bug.cgi?id=182201
719
720         According to the CSSOM spec, all strings should be serialized with double-quotes. The feature
721         tag value was previously serialized with single-quotes; change this to double-quotes to match
722         the spec and non-WebKit browsers.
723
724         Reviewed by Myles C. Maxfield.
725
726         Updated css3/font-feature-settings-parsing.html, fast/css/inherited-properties-rare-text.html,
727         and fast/text/font-face-javascript.html.
728
729         * css/CSSFontFeatureValue.cpp:
730         (WebCore::CSSFontFeatureValue::customCSSText const):
731
732 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
733
734         Add telemetry to track storage access API adoption
735         https://bugs.webkit.org/show_bug.cgi?id=182197
736         <rdar://problem/35803309>
737
738         Reviewed by Chris Dumez.
739
740         Part 2: Add telemetry for the Storage Access API case
741
742         Adds a new convenience method to identify origin/page/frame combinations that
743         have been granted access to the Storage Access API. This is used for debug
744         logging in the NetworkProcess. It is not used in production builds.
745
746         * platform/network/NetworkStorageSession.h:
747         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
748         (WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Added.
749
750 2018-01-30  Ryosuke Niwa  <rniwa@webkit.org>
751
752         Release assert in updateLayout() via AXObjectCache::childrenChanged
753         https://bugs.webkit.org/show_bug.cgi?id=182279
754         <rdar://problem/36994456>
755
756         Reviewed by Antti Koivisto.
757
758         Disable the assertion in Document::updateLayout and Document::updateStyle* in this particular circumstance as fixing it
759         would require a large architectural refactoring of the accessibility code.
760
761         Test: accessibility/accessibility-object-update-during-style-resolution-crash.html
762
763         * accessibility/AXObjectCache.cpp:
764         (WebCore::AXObjectCache::childrenChanged): Disabled the release assertion here.
765         * dom/Document.cpp:
766         (WebCore::Document::isSafeToUpdateStyleOrLayout const): Check LayoutAssertionDisableScope::shouldDisable.
767         * dom/ScriptDisallowedScope.h:
768         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Added.
769         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::LayoutAssertionDisableScope): Added.
770         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::~LayoutAssertionDisableScope): Added.
771         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::shouldDisable): Added.
772         * page/LayoutContext.cpp:
773         (WebCore::LayoutContext::layout): Check LayoutAssertionDisableScope::shouldDisable.
774
775 2018-01-30  Zalan Bujtas  <zalan@apple.com>
776
777         [RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
778         https://bugs.webkit.org/show_bug.cgi?id=182306
779         <rdar://problem/37041440>
780
781         Reviewed by Antti Koivisto.
782
783         With all the ruby mutation code moving, only RenderTreeBuilder calls RenderRubyRun::rubyBaseSafe.
784
785         No change in functionality.
786
787         * rendering/RenderRubyRun.cpp:
788         (WebCore::RenderRubyRun::rubyText const):
789         (WebCore::RenderRubyRun::rubyBase const):
790         (WebCore::RenderRubyRun::firstLineBlock const):
791         (WebCore::RenderRubyRun::takeChild):
792         (WebCore::RenderRubyRun::rubyBaseSafe): Deleted.
793         * rendering/RenderRubyRun.h:
794         * rendering/updating/RenderTreeBuilderRuby.cpp:
795         (WebCore::RenderTreeBuilder::Ruby::insertChild):
796         (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
797         * rendering/updating/RenderTreeBuilderRuby.h:
798
799 2018-01-30  Fujii Hironori  <Hironori.Fujii@sony.com>
800
801         Unified sources for FEMorphology.cpp seems to break the windows build.
802         https://bugs.webkit.org/show_bug.cgi?id=178847
803
804         Reviewed by Yusuke Suzuki.
805
806         Fix a compilation error.
807         platform/graphics/filters/SpotLightSource.cpp(45): error C2027: use of undefined type 'WebCore::FilterEffect'
808
809         No new tests (No behavior change)
810
811         * Sources.txt: Removed @no-unify for FEMorphology.cpp.
812         * platform/graphics/filters/SpotLightSource.cpp: Added #include "FilterEffect.h".
813
814 2018-01-30  Myles C. Maxfield  <mmaxfield@apple.com>
815
816         Test fix after r227776
817         https://bugs.webkit.org/show_bug.cgi?id=180951
818
819         Unreviewed.
820
821         * platform/graphics/cocoa/FontCacheCoreText.cpp:
822         (WebCore::mandatoryAttributesForUserInstalledFonts):
823
824 2018-01-30  Dean Jackson  <dino@apple.com>
825
826         CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
827         https://bugs.webkit.org/show_bug.cgi?id=182299
828         <rdar://problem/36853088>
829
830         Removing a misleading comment based on Zalan Bujtas's feedback.
831
832         * rendering/RenderElement.cpp:
833         (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
834
835 2018-01-30  Dean Jackson  <dino@apple.com>
836
837         CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
838         https://bugs.webkit.org/show_bug.cgi?id=182299
839         <rdar://problem/36853088>
840
841         Reviewed by Simon Fraser.
842
843         Mostly speculative fix for the case where a scrollTo moves an
844         animated SVG image into view, causing its animation to restart during
845         a paint operation. This was causing a release ASSERT, so we now defer
846         the resumption of the animation into a timer.
847
848         Test: svg/animated-svgImage-scroll.html
849
850         * rendering/RenderElement.cpp:
851         (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Enqueue the
852         animation if it is an SVGImage.
853         * svg/graphics/SVGImage.cpp: Add a timer to enqueue animation starts.
854         (WebCore::SVGImage::SVGImage):
855         (WebCore::SVGImage::startAnimationTimerFired):
856         (WebCore::SVGImage::enqueueStartAnimation):
857         (WebCore::SVGImage::stopAnimation):
858         * svg/graphics/SVGImage.h:
859
860 2018-01-30  Chris Dumez  <cdumez@apple.com>
861
862         Service worker registration soft updates happen too frequently
863         https://bugs.webkit.org/show_bug.cgi?id=182296
864         <rdar://problem/37031862>
865
866         Reviewed by Youenn Fablet.
867
868         Move code that updates the registration's last update check time from after
869         the script bytecheck to before, as per:
870         - https://w3c.github.io/ServiceWorker/#update (step 7.19)
871
872         This way, the last update check time gets updated even if the newly fetched
873         script is identical to the previous one, which is the common case.
874
875         * workers/service/server/SWServer.cpp:
876         (WebCore::SWServer::updateWorker):
877         * workers/service/server/SWServerJobQueue.cpp:
878         (WebCore::SWServerJobQueue::scriptFetchFinished):
879
880 2018-01-30  Zalan Bujtas  <zalan@apple.com>
881
882         [RenderTreeBuilder] Move childBecameNonInline to RenderTreeBuilder
883         https://bugs.webkit.org/show_bug.cgi?id=182265
884         <rdar://problem/37004459>
885
886         Reviewed by Antti Koivisto.
887
888         Move the mutation code that wraps/unwraps a child element when its flow state changes
889         from(to) in-flow to(from) floating/out-of-flow.
890
891         No change in functionality.
892
893         * rendering/RenderBlock.cpp:
894         (WebCore::RenderBlock::childBecameNonInline): Deleted.
895         * rendering/RenderBlock.h:
896         * rendering/RenderBoxModelObject.h:
897         (WebCore::RenderBoxModelObject::childBecameNonInline): Deleted.
898         * rendering/RenderElement.cpp:
899         (WebCore::RenderElement::styleDidChange):
900         (WebCore::RenderElement::handleDynamicFloatPositionChange): Deleted.
901         * rendering/RenderInline.cpp:
902         (WebCore::RenderInline::childBecameNonInline): Deleted.
903         * rendering/RenderInline.h:
904         * rendering/updating/RenderTreeBuilder.cpp:
905         (WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
906         (WebCore::RenderTreeBuilder::splitFlow): Deleted.
907         * rendering/updating/RenderTreeBuilder.h:
908         * rendering/updating/RenderTreeBuilderBlock.cpp:
909         (WebCore::RenderTreeBuilder::Block::childBecameNonInline):
910         * rendering/updating/RenderTreeBuilderBlock.h:
911         * rendering/updating/RenderTreeBuilderInline.cpp:
912         (WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
913         * rendering/updating/RenderTreeBuilderInline.h:
914
915 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
916
917         Add telemetry to track storage access API adoption
918         https://bugs.webkit.org/show_bug.cgi?id=182197
919         <rdar://problem/35803309>
920
921         Reviewed by Chris Dumez.
922         
923         Partial roll-out of r227755.
924
925         The original patch assumed the WebContent process kept track of user interaction. This is
926         only tracked in the UIProcess, so we can get rid of some of the logging code adding in
927         r227755.
928
929         * loader/ResourceLoadObserver.cpp:
930         (WebCore::ResourceLoadObserver::logFrameNavigation):
931         (WebCore::ResourceLoadObserver::logSubresourceLoading):
932         (WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Deleted.
933         (WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Deleted.
934         * loader/ResourceLoadObserver.h:
935
936 2018-01-30  Chris Dumez  <cdumez@apple.com>
937
938         Make sure we never create a WebSWClientConnection with an invalid sessionID
939         https://bugs.webkit.org/show_bug.cgi?id=182276
940         <rdar://problem/36582633>
941
942         Reviewed by Alex Christensen.
943
944         Make sure we never create a WebSWClientConnection with an invalid sessionID as this
945         could corrupt our hash tables.
946
947         * dom/Document.cpp:
948         (WebCore::Document::privateBrowsingStateDidChange):
949         * workers/service/ServiceWorker.cpp:
950         (WebCore::ServiceWorker::postMessage):
951         * workers/service/ServiceWorkerContainer.cpp:
952         (WebCore::ServiceWorkerContainer::ready):
953         (WebCore::ServiceWorkerContainer::getRegistration):
954         (WebCore::ServiceWorkerContainer::didFinishGetRegistrationRequest):
955         (WebCore::ServiceWorkerContainer::getRegistrations):
956         (WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
957         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
958         (WebCore::ServiceWorkerContainer::ensureSWClientConnection):
959
960 2018-01-30  Antti Koivisto  <antti@apple.com>
961
962         Avoid traversing too much when doing class change invalidation
963         https://bugs.webkit.org/show_bug.cgi?id=181604
964
965         Reviewed by Zalan Bujtas.
966
967         We are now collecting information about which part of the tree a change in class can potentially affect.
968         Use the information to traverse only the required elements in Style::Invalidator.
969
970         The same mechanism can be later used for attribute and id change invalidation.
971
972         * css/DocumentRuleSets.cpp:
973         (WebCore::DocumentRuleSets::collectFeatures const):
974         (WebCore::DocumentRuleSets::classInvalidationRuleSets const):
975         (WebCore::DocumentRuleSets::subjectClassRules const): Deleted.
976         (WebCore::DocumentRuleSets::ancestorClassRules const): Deleted.
977
978             Remove separate subject and ancestor invalidation RuleSets. Instead collect all invalidation rulesets
979             to a vector along with their MatchElements.
980
981         * css/DocumentRuleSets.h:
982         * css/RuleFeature.cpp:
983         (WebCore::RuleFeatureSet::computeNextMatchElement):
984         (WebCore::RuleFeatureSet::computeSubSelectorMatchElement):
985         (WebCore::RuleFeatureSet::collectFeatures):
986
987             Similarly collect all class invalidation RuleFeatures to a general HashMap along with the MatchElement.
988
989         (WebCore::RuleFeatureSet::add):
990         (WebCore::RuleFeatureSet::clear):
991         (WebCore::RuleFeatureSet::shrinkToFit):
992         * css/RuleFeature.h:
993         (WebCore::RuleFeature::RuleFeature):
994         * style/ClassChangeInvalidation.cpp:
995         (WebCore::Style::ClassChangeInvalidation::computeInvalidation):
996
997             Find out InvalidationRuleSets to use.
998
999         (WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
1000
1001             Pass them to Style::Invalidator.
1002
1003         * style/ClassChangeInvalidation.h:
1004         * style/StyleInvalidator.cpp:
1005         (WebCore::Style::Invalidator::invalidateStyleForTree):
1006         (WebCore::Style::Invalidator::invalidateStyleForDescendants):
1007         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
1008
1009             Traverse only the part of the tree needed by the given MatchElement.
1010
1011         * style/StyleInvalidator.h:
1012         * style/StyleSharingResolver.cpp:
1013         (WebCore::Style::SharingResolver::classNamesAffectedByRules const):
1014
1015 2018-01-30  Javier Fernandez  <jfernandez@igalia.com>
1016
1017         [css-align] The 'baseline' value must be invalid for the 'justify-content' property
1018         https://bugs.webkit.org/show_bug.cgi?id=181794
1019
1020         Reviewed by Antti Koivisto.
1021
1022         The CSS WG has resolved that it doesn't make sense to define Baseline
1023         Content-Alignment in the inline/main axis.
1024
1025         https://github.com/w3c/csswg-drafts/issues/1184
1026
1027         The spec has been updated so that <baseline-postion> is not valid for
1028         the 'justify-content' property's syntax. This CL updates our parsing
1029         logic to match the new spec, including the parsing logic of the
1030         place-content shorthand.
1031
1032         Additionally, this CL updates the computed value of the
1033         <baseline-position> values to match other browsers.
1034
1035         We don't implement support for <baseline-position> values in the
1036         Content Distribution properties (align-content and justify-content),
1037         so I don't expect this change to break content of sites using the CSS
1038         Box Alignment feature.
1039
1040         No new tests, just adapt the Web Platform Tests we already have to the new CSS syntax.
1041
1042         * css/parser/CSSPropertyParser.cpp:
1043         (WebCore::getBaselineKeyword):
1044         (WebCore::consumeBaselineKeyword):
1045         (WebCore::consumeContentDistributionOverflowPosition):
1046         (WebCore::consumeSelfPositionOverflowPosition):
1047         (WebCore::CSSPropertyParser::parseSingleValue):
1048         (WebCore::consumeSimplifiedContentPosition):
1049         (WebCore::CSSPropertyParser::consumePlaceContentShorthand):
1050         (WebCore::consumeSimplifiedItemPosition):
1051
1052 2018-01-30  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1053
1054         [WinCairo] Fix forwarding header conflict of WebKit on WinCairo
1055         https://bugs.webkit.org/show_bug.cgi?id=177202
1056
1057         Reviewed by Alex Christensen.
1058
1059         * PlatformWin.cmake:
1060
1061 2018-01-30  Myles C. Maxfield  <mmaxfield@apple.com>
1062
1063         A disallowed user-installed font may be used if its PostScript name is specified
1064         https://bugs.webkit.org/show_bug.cgi?id=180951
1065
1066         Reviewed by Brent Fulgham.
1067
1068         This patch adds a new CoreText font attribute, kCTFontFallbackOptionAttribute, to the
1069         fonts which WebKit creates. It also adds this attribute to web fonts, so that font
1070         fallback will happen according to our rules about user-installed fonts. It also marks
1071         these font attributes as "mandatory" so CoreText will be guaranteed to follow the
1072         policy.
1073
1074         Test: fast/text/user-installed-fonts/disable.html
1075
1076         * platform/graphics/FontCache.h:
1077         (WebCore::FontDescriptionKey::makeFlagsKey):
1078         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1079         (WebCore::FontDatabase::collectionForFamily):
1080         (WebCore::FontDatabase::fontForPostScriptName):
1081         (WebCore::addAttributesForUserInstalledFonts):
1082         (WebCore::mandatoryAttributesForUserInstalledFonts):
1083         * platform/graphics/mac/FontCustomPlatformData.cpp:
1084         (WebCore::FontCustomPlatformData::fontPlatformData):
1085
1086 2018-01-29  Youenn Fablet  <youenn@apple.com>
1087
1088         Cache API should make sure to resolve caches.open promises in the same order as called
1089         https://bugs.webkit.org/show_bug.cgi?id=182193
1090         <rdar://problem/36930363>
1091
1092         Reviewed by Chris Dumez.
1093
1094         Covered by LayoutTests/http/wpt/cache-storage/cache-open-delete-in-parallel.https.html.
1095
1096         * Modules/cache/DOMCacheStorage.cpp:
1097         (WebCore::DOMCacheStorage::doRemove): Removed optimization consisting in removing the cache from DOMCacheStorage object synchronously.
1098         This optimization prevents going to the network process to try deleting the cache.
1099
1100 2018-01-29  Jiewen Tan  <jiewen_tan@apple.com>
1101
1102         [WebAuthN] Add a compile-time feature flag
1103         https://bugs.webkit.org/show_bug.cgi?id=182211
1104         <rdar://problem/36936365>
1105
1106         Reviewed by Brent Fulgham.
1107
1108         Add a compile-time feature flag for WebAuthN as most of the functionality is platform
1109         dependent.
1110
1111         No tests.
1112
1113         * Configurations/FeatureDefines.xcconfig:
1114         * Modules/credentialmanagement/BasicCredential.cpp:
1115         * Modules/credentialmanagement/BasicCredential.h:
1116         * Modules/credentialmanagement/BasicCredential.idl:
1117         * Modules/credentialmanagement/CredentialCreationOptions.h:
1118         * Modules/credentialmanagement/CredentialCreationOptions.idl:
1119         * Modules/credentialmanagement/CredentialRequestOptions.h:
1120         * Modules/credentialmanagement/CredentialRequestOptions.idl:
1121         * Modules/credentialmanagement/CredentialsContainer.cpp:
1122         * Modules/credentialmanagement/CredentialsContainer.h:
1123         * Modules/credentialmanagement/CredentialsContainer.idl:
1124         * Modules/credentialmanagement/NavigatorCredentials.cpp:
1125         * Modules/credentialmanagement/NavigatorCredentials.h:
1126         * Modules/credentialmanagement/NavigatorCredentials.idl:
1127         * Modules/webauthn/Authenticator.cpp:
1128         * Modules/webauthn/Authenticator.h:
1129         * Modules/webauthn/AuthenticatorAssertionResponse.cpp:
1130         * Modules/webauthn/AuthenticatorAssertionResponse.h:
1131         * Modules/webauthn/AuthenticatorAssertionResponse.idl:
1132         * Modules/webauthn/AuthenticatorAttestationResponse.cpp:
1133         * Modules/webauthn/AuthenticatorAttestationResponse.h:
1134         * Modules/webauthn/AuthenticatorAttestationResponse.idl:
1135         * Modules/webauthn/AuthenticatorResponse.cpp:
1136         * Modules/webauthn/AuthenticatorResponse.h:
1137         * Modules/webauthn/AuthenticatorResponse.idl:
1138         * Modules/webauthn/PublicKeyCredential.cpp:
1139         * Modules/webauthn/PublicKeyCredential.h:
1140         * Modules/webauthn/PublicKeyCredential.idl:
1141         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1142         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
1143         * Modules/webauthn/PublicKeyCredentialDescriptor.h:
1144         * Modules/webauthn/PublicKeyCredentialDescriptor.idl:
1145         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
1146         * Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
1147         * Modules/webauthn/PublicKeyCredentialType.h:
1148         * Modules/webauthn/PublicKeyCredentialType.idl:
1149         * bindings/js/JSAuthenticatorResponseCustom.cpp:
1150         * bindings/js/JSBasicCredentialCustom.cpp:
1151
1152 2018-01-29  John Wilander  <wilander@apple.com>
1153
1154         Resource Load Statistics: Introduce debug mode as experimental feature
1155         https://bugs.webkit.org/show_bug.cgi?id=182199
1156         <rdar://problem/36930364>
1157
1158         Reviewed by Alex Christensen.
1159
1160         No new tests. This adds an experimental feature.
1161
1162         The only changes to default behavior are:
1163         - Increased resolution on timestamps which is needed to be able to set shorter
1164           timeouts in debug mode.
1165         - Only update partitioning and blocking table when needed. This is an optimization
1166           which pays off in less XPC with shorter timeouts.
1167
1168         * loader/ResourceLoadObserver.cpp:
1169         (WebCore::reduceTimeResolution):
1170         (WebCore::ResourceLoadObserver::logFrameNavigation):
1171         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1172         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1173         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1174         (WebCore::reduceToHourlyTimeResolution): Deleted.
1175         * page/RuntimeEnabledFeatures.h:
1176         (WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode):
1177         (WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const):
1178         * page/Settings.yaml:
1179
1180 2018-01-29  Oleksandr Skachkov  <gskachkov@gmail.com>
1181
1182         FetchResponse should support ConsumeData callback on chunk data is received: handling ReadableStream bodies
1183         https://bugs.webkit.org/show_bug.cgi?id=182008
1184
1185         Reviewed by Youenn Fablet.
1186
1187         Modify FetchResponse to support ConsumeData callback with 
1188         handling of ReadableStream by chunks
1189
1190         * Modules/cache/DOMCache.cpp:
1191         (WebCore::DOMCache::put):
1192         * Modules/fetch/FetchBodyConsumer.cpp:
1193         (WebCore::FetchBodyConsumer::resolve):
1194         * Modules/fetch/FetchResponse.cpp:
1195         (WebCore::FetchResponse::consumeBodyFromReadableStream):
1196         * Modules/fetch/FetchResponse.h:
1197         * Modules/streams/ReadableStreamChunk.h: Added.
1198         * Modules/streams/ReadableStreamSink.cpp:
1199         (WebCore::ReadableStreamToSharedBufferSink::enqueue):
1200         (WebCore::ReadableStreamToSharedBufferSink::close):
1201         * Modules/streams/ReadableStreamSink.h:
1202         * WebCore.xcodeproj/project.pbxproj:
1203         * workers/service/context/ServiceWorkerFetch.cpp:
1204         (WebCore::ServiceWorkerFetch::processResponse):
1205
1206 2018-01-29  Andy Estes  <aestes@apple.com>
1207
1208         [iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
1209         https://bugs.webkit.org/show_bug.cgi?id=182252
1210         <rdar://problem/21555881>
1211
1212         Reviewed by Tim Horton.
1213
1214         Test: http/tests/events/touch/ios/cross-frame-single-tap-same-origin.https.html
1215
1216         * dom/Document.h:
1217         (WebCore::Document::handlingTouchEvent const):
1218         * page/EventHandler.h:
1219         (WebCore::EventHandler::touchEventTargetSubframe const):
1220         (WebCore::EventHandler::touches const):
1221
1222         Exposed some information needed by WebPage::updatePotentialTapSecurityOrigin().
1223
1224         * page/Frame.h:
1225         * page/ios/FrameIOS.mm:
1226         (WebCore::Frame::betterApproximateNode):
1227         (WebCore::Frame::qualifyingNodeAtViewportLocation):
1228
1229         Changed NodeQualifier from a function pointer to a WTF::Function.
1230
1231         (WebCore::Frame::nodeRespondingToClickEvents):
1232
1233         Turned ancestorRespondingToClickEvents() into a lambda that captures originRestriction. In
1234         the lambda, if there is an origin restriction, return nullptr if the hit test result's inner
1235         Node is not in the restricted origin.
1236
1237         (WebCore::Frame::nodeRespondingToScrollWheelEvents):
1238
1239         Turned ancestorRespondingToScrollWheelEvents() into a lambda.
1240
1241         (WebCore::ancestorRespondingToScrollWheelEvents):
1242
1243         Moved to lambda in nodeRespondingToScrollWheelEvents().
1244
1245         (WebCore::ancestorRespondingToClickEvents):
1246
1247         Moved to lambda in nodeRespondingToClickEvents().
1248
1249 2018-01-29  Emilio Cobos Álvarez  <emilio@crisal.io>
1250
1251         Trivially cleanup std::optional usage in RenderBlockFlow.
1252         https://bugs.webkit.org/show_bug.cgi?id=182142
1253
1254         Reviewed by Antti Koivisto.
1255
1256         No new tests, no behavior change.
1257
1258         * rendering/RenderBlockFlow.cpp:
1259         (WebCore::RenderBlockFlow::firstLineBaseline const):
1260         (WebCore::RenderBlockFlow::inlineBlockBaseline const):
1261
1262 2018-01-29  Brent Fulgham  <bfulgham@apple.com>
1263
1264         Add telemetry to track storage access API adoption
1265         https://bugs.webkit.org/show_bug.cgi?id=182197
1266         <rdar://problem/35803309>
1267
1268         Reviewed by Chris Dumez.
1269         
1270         Part 1: Add telemetry for the user interaction case
1271         
1272         This patch adds telemetry to track how frequently third-party cookies are
1273         used in a first party context due to user interaction. This will help
1274         understand cases where the new Storage Access API can help, and to help
1275         us understand if we have considered relevant use cases in its design.
1276
1277         * loader/ResourceLoadObserver.cpp:
1278         (WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Let the observer
1279         know the first party interaction duration.
1280         (WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Added.
1281         (WebCore::ResourceLoadObserver::logFrameNavigation): Note when a third party 
1282         resource is accessed as a first party due to user interaction. 
1283         (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
1284         * loader/ResourceLoadObserver.h:
1285         * loader/ResourceLoadStatistics.cpp:
1286         (WebCore::ResourceLoadStatistics::encode const): Handle new fields.
1287         (WebCore::ResourceLoadStatistics::decode): Ditto.
1288         * loader/ResourceLoadStatistics.h:
1289
1290 2018-01-29  Antti Koivisto  <antti@apple.com>
1291
1292         CalcExpressionBlendLength::evaluate hits stack limit
1293         https://bugs.webkit.org/show_bug.cgi?id=182243
1294
1295         Reviewed by Zalan Bujtas.
1296
1297         Speculative fix to prevent nesting of CalcExpressionBlendLength.
1298
1299         No test, don't know how to make one.
1300
1301         * platform/CalculationValue.cpp:
1302         (WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
1303
1304         CalcExpressionBlendLength is only used in Length values of animated style. Normally such styles are not used
1305         as input for further blending but there are some paths where this could in principle happen. Repeated
1306         application (for each animation frame) could construct CalcExpressionBlendLength expression that blows
1307         the stack when evaluated.
1308
1309         Speculatively fix by flattening any nesting.
1310
1311         * platform/CalculationValue.h:
1312         (WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength): Deleted.
1313
1314 2018-01-29  Chris Dumez  <cdumez@apple.com>
1315
1316         Drop unnecessary "ServiceWorker Task Thread" in SWServer
1317         https://bugs.webkit.org/show_bug.cgi?id=182253
1318
1319         Reviewed by Youenn Fablet.
1320
1321         Drop unnecessary "ServiceWorker Task Thread" in SWServer. We're spinning a thread for
1322         each SWServer that is never used.
1323
1324         * workers/service/server/SWServer.cpp:
1325         (WebCore::SWServer::~SWServer):
1326         (WebCore::SWServer::SWServer):
1327         (WebCore::SWServer::taskThreadEntryPoint): Deleted.
1328         (WebCore::SWServer::postTask): Deleted.
1329         (WebCore::SWServer::postTaskReply): Deleted.
1330         (WebCore::SWServer::handleTaskRepliesOnMainThread): Deleted.
1331         * workers/service/server/SWServer.h:
1332
1333 2018-01-29  Matt Lewis  <jlewis3@apple.com>
1334
1335         Unreviewed, rolling out r227731.
1336
1337         This caused and assertion failure in API tests.
1338
1339         Reverted changeset:
1340
1341         "Layout Test fast/events/beforeunload-dom-manipulation-
1342         crash.html is crashing"
1343         https://bugs.webkit.org/show_bug.cgi?id=181204
1344         https://trac.webkit.org/changeset/227731
1345
1346 2018-01-29  Brady Eidson  <beidson@apple.com>
1347
1348         Make it possible for apps that use both WK1 and WK2 to use MessagePorts.
1349         https://bugs.webkit.org/show_bug.cgi?id=182229
1350
1351         Reviewed by Chris Dumez.
1352
1353         Covered by existing LayoutTests and a new API test.
1354
1355         * dom/messageports/MessagePortChannel.cpp:
1356         (WebCore::MessagePortChannel::checkRemotePortForActivity): Don't use the global singleton
1357           provider. Instead use the provider that belongs to the owning registry.
1358
1359         * dom/messageports/MessagePortChannelProviderImpl.cpp:
1360         (WebCore::MessagePortChannelProviderImpl::MessagePortChannelProviderImpl): Pass a reference
1361           to *this to the Registry.
1362         * dom/messageports/MessagePortChannelProviderImpl.h:
1363
1364         * dom/messageports/MessagePortChannelRegistry.cpp:
1365         (WebCore::MessagePortChannelRegistry::MessagePortChannelRegistry): Keep a Provider member so
1366           MessagePortChannels can get to it instead of relying on the global singleton provider.
1367         * dom/messageports/MessagePortChannelRegistry.h:
1368         (WebCore::MessagePortChannelRegistry::provider):
1369
1370 2018-01-29  Per Arne Vollan  <pvollan@apple.com>
1371
1372         Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
1373         https://bugs.webkit.org/show_bug.cgi?id=181204
1374         <rdar://problem/36256274>
1375
1376         Reviewed by Ryosuke Niwa.
1377
1378         When a frame element is moved in the DOM tree during the execution of a beforeunload handler,
1379         the frame will be detached when removed from its previous position in the DOM tree. When being
1380         detached, an attempt will also be made to stop the load by calling FrameLoader::stopAllLoaders().
1381         However, this method will return early when executed in a beforeunload handler, since navigation
1382         is not allowed then. The end result is a detached frame which will continue to load, and hitting
1383         asserts in DocumentLoader::dataReceived(), and DocumentLoader::notifyFinished(). It should be
1384         possible to stop a frame load, even when executing a beforeunload handler.
1385
1386         No new tests. Covered by the existing test fast/events/beforeunload-dom-manipulation-crash.html.
1387
1388         * loader/FrameLoader.cpp:
1389         (WebCore::FrameLoader::isStopLoadingAllowed const):
1390         (WebCore::FrameLoader::stopAllLoaders):
1391         * loader/FrameLoader.h:
1392
1393 2018-01-29  Miguel Gomez  <magomez@igalia.com>
1394
1395         [CoordnatedGraphics] A child layer of a semitransparent layer isn't clipped properly
1396         https://bugs.webkit.org/show_bug.cgi?id=181080
1397
1398         Reviewed by Žan Doberšek.
1399
1400         Check whether the applied clipping area is empty before drawing the children of a TextureMapperLayer. If
1401         the area is empty no children will be drawn, so we can avoid drawing them.
1402
1403         No new tests -- no change in behavior.
1404
1405         * platform/graphics/texmap/TextureMapperLayer.cpp:
1406         (WebCore::TextureMapperLayer::paintSelfAndChildren):
1407
1408 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
1409
1410         [Cairo] Add GraphicsContextImplCairo::createFactory() helpers
1411         https://bugs.webkit.org/show_bug.cgi?id=182238
1412
1413         Reviewed by Carlos Garcia Campos.
1414
1415         Instead of duplicating lambdas that return a newly-created
1416         GraphicsContextImplCairo object, provide static createFactory() helpers
1417         on that class that produce GraphicsContextImplFactory wrappers which are
1418         then invoked in the GraphicsContext constructor. The static functions
1419         accept either the PlatformContextCairo reference or the cairo_t pointer,
1420         invoking the proper GraphicsContextImplCairo constructor in the returned
1421         lambda wrapper.
1422
1423         No new tests -- no change in functionality.
1424
1425         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
1426         (WebCore::GraphicsContextImplCairo::createFactory):
1427         * platform/graphics/cairo/GraphicsContextImplCairo.h:
1428         * platform/graphics/cairo/ImageBufferCairo.cpp:
1429         (WebCore::ImageBuffer::ImageBuffer):
1430         * platform/graphics/cairo/PathCairo.cpp:
1431         (WebCore::Path::strokeBoundingRect const):
1432         (WebCore::Path::strokeContains const):
1433         * platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp:
1434         (Nicosia::PaintingContextCairo::PaintingContextCairo):
1435         * platform/graphics/win/ImageCairoWin.cpp:
1436         (WebCore::BitmapImage::getHBITMAPOfSize):
1437
1438 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
1439
1440         Construct GraphicsContext with NonPaintingReasons::NoReason in FrameView::adjustPageHeightDeprecated()
1441         https://bugs.webkit.org/show_bug.cgi?id=182235
1442
1443         Reviewed by Carlos Garcia Campos.
1444
1445         Pass the NonPaintingReasons::NoReason value to the GraphicsContext
1446         constructor in FrameView::adjustPageHeightDeprecated(). This has the
1447         same effect as when passing a null PlatformGraphicsContext to the
1448         constructor, which effectively disables any painting through that
1449         GraphicsContext, but doesn't have a platform-specific connotation.
1450
1451         No new tests -- no change in functionality.
1452
1453         * page/FrameView.cpp:
1454         (WebCore::FrameView::adjustPageHeightDeprecated):
1455
1456 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
1457
1458         [Cairo] Remove the GraphicsContext(cairo_t*) constructor
1459         https://bugs.webkit.org/show_bug.cgi?id=182234
1460
1461         Reviewed by Carlos Garcia Campos.
1462
1463         Instead of using the GraphicsContext(cairo_t*) constructor, leverage the
1464         GraphicsContextImplCairo class and work with an existing Cairo context
1465         through that GraphicsContextImpl implementation.
1466
1467         A new GraphicsContextImplCairo constructor is added, expecting pointer
1468         to the cairo_t object. With that, a PlatformContextCairo object is
1469         created, with ownership of that object now being handled by the
1470         GraphicsContextImplCairo class.
1471
1472         Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to
1473         instead provide a factory function that returns a fresh
1474         GraphicsContextImplCairo object, passing that cairo_t object to its
1475         constructor.
1476
1477         No new tests -- no change in behavior.
1478
1479         * platform/graphics/GraphicsContext.h:
1480         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1481         (WebCore::GraphicsContext::GraphicsContext): Deleted.
1482         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
1483         (WebCore::GraphicsContextImplCairo::GraphicsContextImplCairo):
1484         (WebCore::m_private):
1485         * platform/graphics/cairo/GraphicsContextImplCairo.h:
1486         * platform/graphics/cairo/PathCairo.cpp:
1487         (WebCore::Path::strokeBoundingRect const):
1488         (WebCore::Path::strokeContains const):
1489         * platform/graphics/win/ImageCairoWin.cpp:
1490         (WebCore::BitmapImage::getHBITMAPOfSize):
1491
1492 2018-01-28  Minsheng Liu  <lambda@liu.ms>
1493
1494         Overflow of formulas is hidden for display mathematics
1495         https://bugs.webkit.org/show_bug.cgi?id=160547
1496
1497         Reviewed by Frédéric Wang.
1498
1499         Previously, <math> with display="block" uses its container's logical width as logical width.
1500         However, that behavior will truncate overflowed contents. The patch fixes it by setting
1501         the logical width as its content width rather than its container's logical width
1502         if the former is wider than the latter.
1503
1504         Test: mathml/presentation/display-math-horizontal-overflow.html
1505
1506         * rendering/mathml/RenderMathMLRow.cpp:
1507         (WebCore::RenderMathMLRow::layoutBlock):
1508
1509 2018-01-26  Antoine Quint  <graouts@apple.com>
1510
1511         [Web Animations] Distinguish between an omitted and a null timeline argument to the Animation constructor
1512         https://bugs.webkit.org/show_bug.cgi?id=179065
1513         <rdar://problem/36869046>
1514
1515         Reviewed by Dean Jackson.
1516
1517         The Web Animations specification requires that a missing or undefined "timeline" parameter means that the
1518         document's timeline should be used, but a null value should be supported. To support this, we need to provide
1519         a custom Animation constructor where we can check on the ExecState whether the second argument passed is
1520         undefined, which is true if an explicit "undefined" value is passed or if the argument does not exist.
1521
1522         * Sources.txt: Add the new JSWebAnimationCustom.cpp file.
1523         * WebCore.xcodeproj/project.pbxproj: Add the new JSWebAnimationCustom.cpp file.
1524         * animation/WebAnimation.cpp:
1525         (WebCore::WebAnimation::create): Add a create() variant that doesn't provide an AnimationTimeline parameter
1526         to clearly indicate that the provided Document's timeline should be used.
1527         * animation/WebAnimation.h:
1528         * animation/WebAnimation.idl:
1529         * bindings/js/JSWebAnimationCustom.cpp: Added.
1530         (WebCore::constructJSWebAnimation): Provide a custom Animation constructor where we check whether the second
1531         argument, the timeline, is undefined.
1532         * dom/Element.cpp:
1533         (WebCore::Element::animate): Use the new create() variant since passing "nullptr" now means a null timeline.
1534
1535 2018-01-26  Ricky Mondello  <rmondello@apple.com>
1536
1537         Use the standard -webkit-autofill color on iOS
1538         https://bugs.webkit.org/show_bug.cgi?id=182182
1539
1540         Reviewed by Tim Horton.
1541
1542         * css/html.css:
1543         (input:-webkit-autofill, input:-webkit-autofill-strong-password):
1544
1545 2018-01-26  Dean Jackson  <dino@apple.com>
1546
1547         REGRESSION (r222961): Clear function not clearing whole screen when antialias is set to false
1548         https://bugs.webkit.org/show_bug.cgi?id=179368
1549         <rdar://problem/36111549>
1550
1551         Reviewed by Sam Weinig.
1552
1553         When we changed from using a CAOpenGLLayer to a regular CALayer, we should
1554         have also swapped the "opaque" property to "contentsOpaque".
1555
1556         Covered by the existing test: fast/canvas/webgl/context-attributes-alpha.html
1557         (when run on some hardware!)
1558
1559         * platform/graphics/cocoa/WebGLLayer.mm:
1560         (-[WebGLLayer initWithGraphicsContext3D:]):
1561
1562 2018-01-26  Mark Lam  <mark.lam@apple.com>
1563
1564         Add infrastructure for pointer preparation.
1565         https://bugs.webkit.org/show_bug.cgi?id=182191
1566         <rdar://problem/36889194>
1567
1568         Reviewed by JF Bastien.
1569
1570         No new tests because this patch does not introduce any behavior change.
1571
1572         * bindings/scripts/CodeGeneratorJS.pm:
1573         (GenerateImplementation):
1574         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1575         (WebCore::toJSNewlyCreated):
1576         * bindings/scripts/test/JS/JSMapLike.cpp:
1577         (WebCore::toJSNewlyCreated):
1578         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1579         (WebCore::toJSNewlyCreated):
1580         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1581         (WebCore::toJSNewlyCreated):
1582         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1583         (WebCore::toJSNewlyCreated):
1584         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1585         (WebCore::toJSNewlyCreated):
1586         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1587         (WebCore::toJSNewlyCreated):
1588         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1589         (WebCore::toJSNewlyCreated):
1590         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1591         (WebCore::toJSNewlyCreated):
1592         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1593         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1594         (WebCore::toJSNewlyCreated):
1595         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1596         (WebCore::toJSNewlyCreated):
1597         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1598         (WebCore::toJSNewlyCreated):
1599         * bindings/scripts/test/JS/JSTestException.cpp:
1600         (WebCore::toJSNewlyCreated):
1601         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1602         (WebCore::toJSNewlyCreated):
1603         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1604         (WebCore::toJSNewlyCreated):
1605         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1606         (WebCore::toJSNewlyCreated):
1607         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1608         (WebCore::toJSNewlyCreated):
1609         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1610         (WebCore::toJSNewlyCreated):
1611         * bindings/scripts/test/JS/JSTestInterface.cpp:
1612         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1613         * bindings/scripts/test/JS/JSTestIterable.cpp:
1614         (WebCore::toJSNewlyCreated):
1615         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1616         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1617         (WebCore::toJSNewlyCreated):
1618         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1619         (WebCore::toJSNewlyCreated):
1620         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1621         (WebCore::toJSNewlyCreated):
1622         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1623         (WebCore::toJSNewlyCreated):
1624         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1625         (WebCore::toJSNewlyCreated):
1626         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1627         (WebCore::toJSNewlyCreated):
1628         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1629         (WebCore::toJSNewlyCreated):
1630         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1631         (WebCore::toJSNewlyCreated):
1632         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1633         (WebCore::toJSNewlyCreated):
1634         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1635         (WebCore::toJSNewlyCreated):
1636         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1637         (WebCore::toJSNewlyCreated):
1638         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1639         (WebCore::toJSNewlyCreated):
1640         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1641         (WebCore::toJSNewlyCreated):
1642         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1643         (WebCore::toJSNewlyCreated):
1644         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1645         (WebCore::toJSNewlyCreated):
1646         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1647         (WebCore::toJSNewlyCreated):
1648         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1649         (WebCore::toJSNewlyCreated):
1650         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1651         (WebCore::toJSNewlyCreated):
1652         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1653         (WebCore::toJSNewlyCreated):
1654         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1655         (WebCore::toJSNewlyCreated):
1656         * bindings/scripts/test/JS/JSTestNode.cpp:
1657         (WebCore::toJSNewlyCreated):
1658         * bindings/scripts/test/JS/JSTestObj.cpp:
1659         (WebCore::toJSNewlyCreated):
1660         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1661         (WebCore::toJSNewlyCreated):
1662         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1663         (WebCore::toJSNewlyCreated):
1664         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1665         (WebCore::toJSNewlyCreated):
1666         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1667         (WebCore::toJSNewlyCreated):
1668         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1669         (WebCore::toJSNewlyCreated):
1670         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1671         (WebCore::toJSNewlyCreated):
1672         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1673         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1674         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1675         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1676         (WebCore::toJSNewlyCreated):
1677         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1678         (WebCore::toJSNewlyCreated):
1679         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1680         (WebCore::toJSNewlyCreated):
1681         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1682         (WebCore::toJSNewlyCreated):
1683         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1684         (WebCore::toJSNewlyCreated):
1685         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1686         (WebCore::toJSNewlyCreated):
1687         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1688         (WebCore::toJSNewlyCreated):
1689         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1690         (WebCore::toJSNewlyCreated):
1691         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1692         (WebCore::toJSNewlyCreated):
1693
1694 2018-01-26  Simon Fraser  <simon.fraser@apple.com>
1695
1696         REGRESSiON (r226492): Crash under Element::absoluteEventBounds() on a SVGPathElement which has not been laid out yet
1697         https://bugs.webkit.org/show_bug.cgi?id=182185
1698         rdar://problem/36836262
1699
1700         Reviewed by Zalan Bujtas.
1701
1702         Document::absoluteRegionForEventTargets() can fire when layout is dirty, and SVGPathElement's path() can be null if it
1703         hasn't been laid out yet. So protect against a null path in getBBox().
1704
1705         Not easily testable because internals.nonFastScrollableRects() forces layout, and the crash depends on the timing of
1706         absoluteRegionForEventTargets().
1707
1708         * svg/SVGPathElement.cpp:
1709         (WebCore::SVGPathElement::getBBox):
1710
1711 2018-01-26  Chris Dumez  <cdumez@apple.com>
1712
1713         Offlined content does not work for apps on home screen
1714         https://bugs.webkit.org/show_bug.cgi?id=182070
1715         <rdar://problem/36843906>
1716
1717         Reviewed by Youenn Fablet.
1718
1719         Already registered service workers were unable to intercept the very first
1720         load because registration matching was happening after the registration
1721         was loaded from disk, but *before* its active worker was populated.
1722
1723         We now initialize the registrations' active worker as soon as we load
1724         them from disk. We do not necessarily have a SW Context process connection
1725         identifier yet at this point so I made it optional on the SWServerWorker.
1726         This identifier gets set on the SWServerWorker when the worker is actually
1727         launched and gets cleared when the SWServerWorker gets terminated.
1728
1729         Covered by new API test.
1730
1731         * workers/service/server/SWServer.cpp:
1732         (WebCore::SWServer::addRegistrationFromStore):
1733         (WebCore::SWServer::installContextData):
1734         (WebCore::SWServer::terminateWorkerInternal):
1735         (WebCore::SWServer::workerContextTerminated):
1736         (WebCore::SWServer::fireInstallEvent):
1737         (WebCore::SWServer::fireActivateEvent):
1738         * workers/service/server/SWServerWorker.cpp:
1739         (WebCore::SWServerWorker::SWServerWorker):
1740         * workers/service/server/SWServerWorker.h:
1741         (WebCore::SWServerWorker::contextConnectionIdentifier const):
1742         (WebCore::SWServerWorker::setContextConnectionIdentifier):
1743
1744 2018-01-26  Chris Nardi  <cnardi@chromium.org>
1745
1746         Addressing post-review comments after r226614
1747         https://bugs.webkit.org/show_bug.cgi?id=182151
1748
1749         Reviewed by Myles C. Maxfield.
1750
1751         * html/HTMLTextAreaElement.cpp:
1752         (WebCore::HTMLTextAreaElement::sanitizeUserInputValue):
1753         * html/TextFieldInputType.cpp:
1754         (WebCore::limitLength):
1755         * platform/LocalizedStrings.cpp:
1756         (WebCore::truncatedStringForLookupMenuItem):
1757         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
1758         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
1759
1760 2018-01-26  Antoine Quint  <graouts@apple.com>
1761
1762         [iOS] prefers-reduced-motion media query is not working
1763         https://bugs.webkit.org/show_bug.cgi?id=182169
1764         <rdar://problem/36801631>
1765
1766         Reviewed by Dean Jackson.
1767
1768         The code that would eventually query UIKit for the system setting was not run since USE(NEW_THEME) is off on iOS.
1769         Adding a PLATFORM(IOS) flag here allows the code to run.
1770
1771         * css/MediaQueryEvaluator.cpp:
1772         (WebCore::prefersReducedMotionEvaluate):
1773
1774 2018-01-26  Youenn Fablet  <youenn@apple.com>
1775
1776         CSP post checks should be done for service worker responses
1777         https://bugs.webkit.org/show_bug.cgi?id=182160
1778
1779         Reviewed by Daniel Bates.
1780
1781         Covered by updated test.
1782
1783         Add security checks when receiving a service worker response.
1784
1785         * loader/SubresourceLoader.cpp:
1786         (WebCore::SubresourceLoader::didReceiveResponse):
1787         * loader/cache/CachedResourceLoader.h:
1788
1789 2018-01-26  Manuel Rego Casasnovas  <rego@igalia.com>
1790
1791         [css-multicol] Support percentages in column-gap
1792         https://bugs.webkit.org/show_bug.cgi?id=182004
1793
1794         Reviewed by Javier Fernandez.
1795
1796         This patch adds percentage support to column-gap property.
1797
1798         Most of the changes are related to the parsing logic,
1799         the column-gap property now accepts both length and percentages,
1800         on top of the "normal" initial value.
1801         A new utility class GapLength has been added, as it'll be useful
1802         to implement row-gap in the future.
1803
1804         Apart from that the muticolumn layout code has been modified
1805         to resolve the percentage gaps (treating them as zero while computing
1806         preferred widths) and resolving them during layout.
1807         This doesn't follow the current text on the spec, but there is an
1808         ongoing discussion that might cause the text is changed:
1809         https://github.com/w3c/csswg-drafts/issues/509#issuecomment-355242101
1810         We could update the implementation once we have a definitive answer
1811         from the CSS WG.
1812
1813         Test: web-platform-tests/css/css-multicol/multicol-gap-percentage-001.html
1814
1815         * Sources.txt:
1816         * WebCore.xcodeproj/project.pbxproj:
1817         * css/CSSComputedStyleDeclaration.cpp:
1818         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1819         * css/CSSProperties.json:
1820         * css/StyleBuilderConverter.h:
1821         (WebCore::StyleBuilderConverter::convertGapLength):
1822         * css/StyleBuilderCustom.h:
1823         (WebCore::forwardInheritedValue):
1824         * css/parser/CSSPropertyParser.cpp:
1825         (WebCore::consumeGapLength):
1826         (WebCore::CSSPropertyParser::parseSingleValue):
1827         * page/FrameView.cpp:
1828         (WebCore::FrameView::applyPaginationToViewport):
1829         * page/animation/CSSPropertyAnimation.cpp:
1830         (WebCore::blendFunc):
1831         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1832         * rendering/RenderBlockFlow.cpp:
1833         (WebCore::RenderBlockFlow::columnGap const):
1834         * rendering/RenderMultiColumnSet.cpp:
1835         (WebCore::RenderMultiColumnSet::columnGap const):
1836         * rendering/style/GapLength.cpp: Added.
1837         (WebCore::operator<<):
1838         * rendering/style/GapLength.h: Added.
1839         (WebCore::GapLength::GapLength):
1840         (WebCore::GapLength::isNormal const):
1841         (WebCore::GapLength::length const):
1842         (WebCore::GapLength::operator== const):
1843         * rendering/style/RenderStyle.h:
1844         (WebCore::RenderStyle::columnGap const):
1845         (WebCore::RenderStyle::setColumnGap):
1846         (WebCore::RenderStyle::initialColumnGap):
1847         * rendering/style/StyleMultiColData.cpp:
1848         (WebCore::StyleMultiColData::StyleMultiColData):
1849         (WebCore::StyleMultiColData::operator== const):
1850         * rendering/style/StyleMultiColData.h:
1851         * style/StyleResolveForDocument.cpp:
1852         (WebCore::Style::resolveForDocument):
1853
1854 2018-01-26  Emilio Cobos Álvarez  <emilio@crisal.io>
1855
1856         Remove unused RenderFragmentedFlow::createFragmentedFlowStyle.
1857         https://bugs.webkit.org/show_bug.cgi?id=182138
1858
1859         Reviewed by Manuel Rego Casasnovas.
1860
1861         Has no callers.
1862
1863         No new tests, just removes unused code so no behavior change.
1864
1865         * rendering/RenderFragmentedFlow.cpp:
1866         * rendering/RenderFragmentedFlow.h:
1867
1868 2018-01-26  Emilio Cobos Álvarez  <emilio@crisal.io>
1869
1870         Remove useless RenderBlockFlow overrides.
1871         https://bugs.webkit.org/show_bug.cgi?id=182139
1872
1873         Reviewed by Manuel Rego Casasnovas.
1874
1875         I think these are leftovers from the CSS regions removal, looking at
1876         blame.
1877
1878         No new tests, no behavior change.
1879
1880         * rendering/RenderBlockFlow.cpp:
1881         * rendering/RenderBlockFlow.h:
1882
1883 2018-01-25  Joseph Pecoraro  <pecoraro@apple.com>
1884
1885         Web Inspector: Add InspectorShaderProgram to Unified Sources build
1886         https://bugs.webkit.org/show_bug.cgi?id=182084
1887
1888         Reviewed by Dan Bernstein.
1889
1890         * CMakeLists.txt:
1891         * WebCore.xcodeproj/project.pbxproj:
1892         * Sources.txt:
1893         Move to Sources.txt always.
1894
1895         * inspector/InspectorShaderProgram.cpp:
1896         Add ENABLE(WEBGL) guard to contents.
1897
1898 2018-01-25  Ryosuke Niwa  <rniwa@webkit.org>
1899
1900         Make scrolling to the focused element async
1901         https://bugs.webkit.org/show_bug.cgi?id=181575
1902         <rdar://problem/36459767>
1903
1904         Reviewed by Simon Fraser.
1905
1906         Made the revealing of the focused element asynchronous in Element::focus. Like selection, schedule a timer when
1907         a new element is focused, and only scroll to the focused element when the timer fires. If any other scrolling
1908         happens meanwhile, we cancel this timer.
1909
1910         There are two Web exposed behavioral changes:
1911         1. The scrolling position doesn't change immediately when calling Element::focus.
1912         2. Only the last focused element will be revealed.
1913
1914         Both behavioral changes pose its own compatibility risks but we're making a conscious decision here since
1915         the scrolling asynchronous has a clear performance benefit.
1916
1917         There is one edge case to cosnider: when the history controller restores the scrolling position, canceling the
1918         timer results in a focused element in an overflow: hidden element to be never revealed. Expediate revealing of
1919         the focused element in this one case instead of canceling.
1920
1921         Tests: fast/scrolling/scroll-to-focused-element-asynchronously.html
1922                fast/scrolling/scroll-to-focused-element-canceled-by-fragment-navigation.html
1923
1924         * dom/Element.cpp:
1925         (WebCore::Element::focus): Call updateFocusAppearance on focusAppearanceUpdateTarget to handle HTMLAreaElement
1926         which delegates the focus appearance update to its image element.
1927         (WebCore::Element::focusAppearanceUpdateTarget): Extracted. Returns "this" element for all but HTMLAreaElement.
1928         (WebCore::Element::updateFocusAppearance): Schedule the revealing of the focused element in FrameView instead of
1929         synchronously scrolling to the focused element.
1930         * dom/Element.h:
1931         (WebCore::Element::defaultFocusTextStateChangeIntent):
1932         * html/HTMLAreaElement.cpp:
1933         (WebCore::HTMLAreaElement::focusAppearanceUpdateTarget): Extracted from updateFocusAppearance.
1934         (WebCore::HTMLAreaElement::updateFocusAppearance): Deleted.
1935         * html/HTMLAreaElement.h:
1936         * loader/HistoryController.cpp:
1937         (WebCore::HistoryController::restoreScrollPositionAndViewState): Reveal the focused element
1938         prior to restoring the scrolling location of the fragment navigation. This is needed to reveal a focused element
1939         inside overflow: hidden element which got focused.
1940         * page/FrameView.cpp:
1941         (WebCore::FrameView::FrameView): Added a boolean flag and a timer for scrolling to the focused element.
1942         (WebCore::FrameView::reset): Stop the timer and clear the flag.
1943         (WebCore::FrameView::maintainScrollPositionAtAnchor): Ditto when scrolling to an anchor.
1944         (WebCore::FrameView::setScrollPosition): Ditto when some other programatic scroll or the user scrolls the view.
1945         (WebCore::FrameView::scheduleScrollToFocusedElement): Added.
1946         (WebCore::FrameView::scrollToFocusedElementImmediatelyIfNeeded): Added.
1947         (WebCore::FrameView::scrollToFocusedElementTimerFired): Added.
1948         (WebCore::FrameView::scrollToAnchor): Stop the timer and clear the flag when scrolling to an achor.
1949         (WebCore::FrameView::setWasScrolledByUser): Ditto when the user scrolls.
1950         * page/FrameView.h:
1951
1952 2018-01-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
1953
1954         REGRESSION(r217236): [iOS] PDFDocumentImage does not update its cached ImageBuffer if it has a sub-rectangle of the image
1955         https://bugs.webkit.org/show_bug.cgi?id=182083
1956
1957         Reviewed by Simon Fraser.
1958
1959         Test: fast/images/pdf-as-image-dest-rect-change.html
1960
1961         Revert the change r217236 back. Fix the issue of throwing out the cached
1962         ImageBuffer of the PDF document image when moving its rectangle.
1963
1964         * platform/graphics/cg/PDFDocumentImage.cpp:
1965         (WebCore::PDFDocumentImage::cacheParametersMatch): Return the if-statement
1966         which was deleted in r217236 back but intersect it with dstRect. The context
1967         clipping rectangle can be more than the dstRect.
1968         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
1969         -- Remove a wrong optimization which used to work for Mac only if the context
1970            interpolation quality is not set to low or none quality. This optimization
1971            does not consider the case when srcRect or destRect change after caching
1972            the ImageBuffer. Or even if m_cachedImageRect does not include the
1973            whole clipping rectangle.
1974         -- Move back the call to cacheParametersMatch() before changing the
1975            m_cachedImageRect.
1976         -- Always intersect the clipping rectangle with the dstRect to ensure we
1977            only look at the dirty rectangle inside the image boundary.
1978         -- If cacheParametersMatch() returns true, set m_cachedDestinationRect to
1979            dstRect and move m_cachedImageRect by the difference between the new
1980            and the old dstRects since no re-caching will happen.
1981         * platform/graphics/cg/PDFDocumentImage.h:
1982         * testing/Internals.cpp:
1983         (WebCore::pdfDocumentImageFromImageElement):
1984         (WebCore::Internals::pdfDocumentCachingCount):
1985         * testing/Internals.h:
1986         * testing/Internals.idl:
1987         Add an internal API which returns the number of drawing the PDF into an
1988         ImageBuffer.
1989
1990 2018-01-25  Joseph Pecoraro  <pecoraro@apple.com>
1991
1992         Web Inspector: Remove unnecessary developerExtrasEnabled checks
1993         https://bugs.webkit.org/show_bug.cgi?id=182156
1994
1995         Reviewed by Matt Baker.
1996
1997         * inspector/InspectorInstrumentation.cpp:
1998         (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl):
1999         (WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
2000         (WebCore::InspectorInstrumentation::didCreateWebSocketImpl):
2001         These checks should not be needed. The step above bails if there is
2002         no inspector frontend, and there can be no inspector frontend unless
2003         developer extras enabled are enabled.
2004
2005 2018-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2006
2007         Add localizable strings for extra-zoomed form controls
2008         https://bugs.webkit.org/show_bug.cgi?id=182080
2009
2010         Reviewed by Tim Horton.
2011
2012         Add new localizable strings. Additionally, run `update-webkit-localizable-strings` to re-sort
2013         Localizable.strings.
2014
2015         * English.lproj/Localizable.strings:
2016         * platform/LocalizedStrings.cpp:
2017         (WebCore::formControlCancelButtonTitle):
2018         (WebCore::formControlHideButtonTitle):
2019         (WebCore::formControlGoButtonTitle):
2020         (WebCore::formControlSearchButtonTitle):
2021         (WebCore::textInputModeWriteButton):
2022         (WebCore::textInputModeSpeechButton):
2023         * platform/LocalizedStrings.h:
2024
2025 2018-01-25  Chris Dumez  <cdumez@apple.com>
2026
2027         Access to service workers / Cache API should be disabled in sandboxed frames without allow-same-origin flag
2028         https://bugs.webkit.org/show_bug.cgi?id=182140
2029         <rdar://problem/36879952>
2030
2031         Reviewed by Youenn Fablet.
2032
2033         Throw a SecurityError when accessing navigator.serviceWorker or window.caches inside a sandboxed iframe
2034         without the allow-same-origin flag. This behavior is consistent with Chrome. Firefox, however, seems
2035         to return these objects but have their API reject promises with a SecurityError instead.
2036
2037         No new tests, rebaselined existing tests.
2038
2039         * Modules/cache/DOMWindowCaches.cpp:
2040         (WebCore::DOMWindowCaches::caches): Deleted.
2041         * Modules/cache/DOMWindowCaches.h:
2042         * Modules/cache/DOMWindowCaches.idl:
2043         * page/NavigatorBase.cpp:
2044         * page/NavigatorBase.h:
2045         * page/NavigatorServiceWorker.idl:
2046
2047 2018-01-25  Chris Dumez  <cdumez@apple.com>
2048
2049         Clients.get(id) should only returns clients in the service worker's origin
2050         https://bugs.webkit.org/show_bug.cgi?id=182149
2051         <rdar://problem/36882310>
2052
2053         Reviewed by Youenn Fablet.
2054
2055         When looking for SW clients with a given identifier, only look in the list of
2056         clients that have the same origin as the service worker.
2057
2058         No new tests, rebaselined existing test.
2059
2060         * workers/service/server/SWServer.cpp:
2061         (WebCore::SWServer::serviceWorkerClientWithOriginByID const):
2062         (WebCore::SWServer::serviceWorkerClientByID const): Deleted.
2063         * workers/service/server/SWServer.h:
2064         * workers/service/server/SWServerWorker.cpp:
2065         (WebCore::SWServerWorker::findClientByIdentifier const):
2066         * workers/service/server/SWServerWorker.h:
2067
2068 2018-01-25  Youenn Fablet  <youenn@apple.com>
2069
2070         WebPluginInfoProvider should handle null host queries
2071         https://bugs.webkit.org/show_bug.cgi?id=182112
2072
2073         Reviewed by Chris Dumez.
2074
2075         No change of behavior.
2076
2077         Removed assertion that is not always true, as shown by API tests.
2078
2079         * loader/DocumentLoader.cpp:
2080         (WebCore::DocumentLoader::responseReceived):
2081
2082 2018-01-25  Youenn Fablet  <youenn@apple.com>
2083
2084         ShapeOutside should use same origin credentials mode
2085         https://bugs.webkit.org/show_bug.cgi?id=182141
2086
2087         Reviewed by Chris Dumez.
2088
2089         Covered by updated test.
2090         As per https://drafts.csswg.org/css-shapes/#shape-outside-property, ShapeOutside images
2091         should be fetched with anonymous cors mode, meaning credentials should be set to same-origin.
2092
2093         * style/StylePendingResources.cpp:
2094         (WebCore::Style::loadPendingImage):
2095
2096 2018-01-25  John Wilander  <wilander@apple.com>
2097
2098         Make sure we have a frame as we iterate in ResourceLoadObserver::nonNullOwnerURL()
2099         https://bugs.webkit.org/show_bug.cgi?id=182116
2100         <rdar://problem/36210134>
2101
2102         Reviewed by Alex Christensen.
2103
2104         No new tests. No known repro case, just crash logs.
2105
2106         * loader/ResourceLoadObserver.cpp:
2107         (WebCore::ResourceLoadObserver::nonNullOwnerURL const):
2108
2109 2018-01-25  Jer Noble  <jer.noble@apple.com>
2110
2111         Move ImageDecoderAVFObjC from using AVSampleBufferGenerator to AVAssetReaderOutput for parsing
2112         https://bugs.webkit.org/show_bug.cgi?id=182091
2113
2114         Reviewed by Eric Carlson.
2115
2116         No new tests; should be covered by existing tests.
2117
2118         AVSampleBufferGenerator is not available on iOS, so in order to enable ImageDecoderAVFObjC there,
2119         we must adopt a similar API which is available both on iOS and macOS: AVAssetReaderOutput. Unlike
2120         the generator, AVAssetReaderOutput doesn't necessarily generate samples in decode order, so we'll
2121         repurpose the SampleMap from EME to hold the decoded samples as well as their generated images.
2122
2123         * Modules/mediasource/SampleMap.cpp:
2124         * Modules/mediasource/SampleMap.h:
2125         (WebCore::SampleMap::size const):
2126         * platform/MIMETypeRegistry.cpp:
2127         (WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType):
2128         * platform/MediaSample.h:
2129         (WebCore::MediaSample::hasAlpha const):
2130         * platform/graphics/ImageDecoder.cpp:
2131         (WebCore::ImageDecoder::create):
2132         (WebCore::ImageDecoder::supportsMediaType):
2133         * platform/graphics/avfoundation/MediaSampleAVFObjC.h: Make non-final.
2134         (WebCore::MediaSampleAVFObjC::sampleBuffer const):
2135         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC):
2136         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
2137         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2138         (WebCore::ImageDecoderAVFObjCSample::create):
2139         (WebCore::ImageDecoderAVFObjCSample::sampleBuffer const):
2140         (WebCore::ImageDecoderAVFObjCSample::image const):
2141         (WebCore::ImageDecoderAVFObjCSample::setImage):
2142         (WebCore::ImageDecoderAVFObjCSample::ImageDecoderAVFObjCSample):
2143         (WebCore::ImageDecoderAVFObjCSample::cacheMetadata):
2144         (WebCore::toSample):
2145         (WebCore::ImageDecoderAVFObjC::readSamples):
2146         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
2147         (WebCore::ImageDecoderAVFObjC::advanceCursor):
2148         (WebCore::ImageDecoderAVFObjC::setTrack):
2149         (WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
2150         (WebCore::ImageDecoderAVFObjC::repetitionCount const):
2151         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
2152         (WebCore::ImageDecoderAVFObjC::frameDurationAtIndex const):
2153         (WebCore::ImageDecoderAVFObjC::frameHasAlphaAtIndex const):
2154         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
2155         (WebCore::ImageDecoderAVFObjC::setData):
2156         (WebCore::ImageDecoderAVFObjC::clearFrameBufferCache):
2157         (WebCore::ImageDecoderAVFObjC::sampleAtIndex const):
2158         (WebCore::ImageDecoderAVFObjC::readSampleMetadata): Deleted.
2159
2160 2018-01-25  Youenn Fablet  <youenn@apple.com>
2161
2162         DocumentThreadableLoader should ensure service worker is not reused if redirection comes from the network
2163         https://bugs.webkit.org/show_bug.cgi?id=182137
2164
2165         Reviewed by Chris Dumez.
2166
2167         Covered by rebased test.
2168         In case redirection does not come from memory cache or service worker, disable service worker interception when following the redirection.
2169
2170         * loader/DocumentThreadableLoader.cpp:
2171         (WebCore::DocumentThreadableLoader::redirectReceived):
2172
2173 2018-01-25  Youenn Fablet  <youenn@apple.com>
2174
2175         DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
2176         https://bugs.webkit.org/show_bug.cgi?id=182115
2177
2178         Reviewed by Alex Christensen.
2179
2180         Covered by rebased test.
2181
2182         In case a navigation load is going to the network process,
2183         we need to interrupt it if having a redirection that leads to a new request going to a service worker.
2184
2185         * loader/DocumentLoader.cpp:
2186         (WebCore::DocumentLoader::redirectReceived):
2187
2188 2018-01-25  Chris Dumez  <cdumez@apple.com>
2189
2190         Registering same scope as the script directory without the last slash should fail
2191         https://bugs.webkit.org/show_bug.cgi?id=182122
2192         <rdar://problem/36877167>
2193
2194         Reviewed by Youenn Fablet.
2195
2196         This aligns our behavior with Firefox and Chrome.
2197
2198         No new tests, rebaselined existing test.
2199
2200         * workers/service/ServiceWorkerJob.cpp:
2201         (WebCore::ServiceWorkerJob::didReceiveResponse):
2202
2203 2018-01-25  Antoine Quint  <graouts@apple.com>
2204
2205         [Web Animations] Expose the reverse() method
2206         https://bugs.webkit.org/show_bug.cgi?id=182100
2207         <rdar://problem/36867117>
2208
2209         Reviewed by Dean Jackson.
2210
2211         We expose and implement the reverse() method on Animation as specified.
2212
2213         * animation/WebAnimation.cpp:
2214         (WebCore::WebAnimation::setPlaybackRate):
2215         (WebCore::WebAnimation::reverse):
2216         * animation/WebAnimation.h:
2217         * animation/WebAnimation.idl:
2218
2219 2018-01-25  Antoine Quint  <graouts@apple.com>
2220
2221         [Web Animations] Account for provided easings when computing progress and resolving keyframe effect values
2222         https://bugs.webkit.org/show_bug.cgi?id=182098
2223         <rdar://problem/36866149>
2224
2225         Reviewed by Dean Jackson.
2226
2227         We now account for the timing functions provided through the "easing" propreties on whole animation effects
2228         and individual keyframes. Exposing those exposed shortcomings of our keyframe resolution in general through
2229         WPT tests so we now implement the "effect value of a keyframe effect" procedure from the spec to correctly
2230         resolve keyframes in KeyframeEffect::setAnimatedPropertiesInStyle(). The tests also showed some shortcomings
2231         in our TimingFunction code where our step() function resolution wasn't fully compliant and our cubic-bezier()
2232         resolution not accurate enough. We now have microsecond accuracy when resolving cubic-bezier() timing functions
2233         and identify cubic-bezier(0, 0, 0, 0), cubic-bezier(0, 0, 1, 1) and cubic-bezier(1, 1, 1, 1) as linear timing
2234         functions, as called out by the WPT tests.
2235
2236         * animation/AnimationEffect.cpp:
2237         (WebCore::AnimationEffect::transformedProgress const): Account for the effect-wide timing function when computing
2238         the progress.
2239         (WebCore::AnimationEffect::iterationProgress const): Use the transformed progress now that we support this procedure.
2240         * animation/AnimationEffect.h:
2241         * animation/KeyframeEffect.cpp:
2242         (WebCore::KeyframeEffect::apply): We now use the computed progress from AnimationEffect rather than compute based
2243         on the provided time, which we've dropped as an argument.
2244         (WebCore::KeyframeEffect::getAnimatedStyle):
2245         (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): Implement the "effect value of a keyframe effect" procedure
2246         in full as specified (save for composite operations).
2247         (WebCore::KeyframeEffect::applyAtLocalTime): Deleted.
2248         * animation/KeyframeEffect.h:
2249         * animation/WebAnimation.cpp:
2250         (WebCore::WebAnimation::resolve):
2251         * css/CSSTimingFunctionValue.h: Fix a small error made in a previous patch where we used "int" instead of "unsigned".
2252         * platform/animation/TimingFunction.cpp:
2253         (WebCore::TimingFunction::transformTime const):
2254         * platform/animation/TimingFunction.h:
2255
2256 2018-01-25  Antoine Quint  <graouts@apple.com>
2257
2258         [Web Animations] Avoid querying the current time multiple time when resolving the play state
2259         https://bugs.webkit.org/show_bug.cgi?id=182099
2260
2261         Reviewed by Dean Jackson.
2262
2263         No test change since this shouldn't cause any change in behavior.
2264
2265         * animation/WebAnimation.cpp:
2266         (WebCore::WebAnimation::playState const):
2267
2268 2018-01-25  Youenn Fablet  <youenn@apple.com>
2269
2270         Set integrity fetch options for loading scripts and CSS
2271         https://bugs.webkit.org/show_bug.cgi?id=182077
2272
2273         Reviewed by Chris Dumez.
2274
2275         Covered by updated test.
2276
2277         Set integrity fetch option in script and CSS loading.
2278
2279         * bindings/js/CachedModuleScriptLoader.cpp:
2280         (WebCore::CachedModuleScriptLoader::load):
2281         * bindings/js/CachedScriptFetcher.cpp:
2282         (WebCore::CachedScriptFetcher::requestModuleScript const):
2283         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
2284         * bindings/js/CachedScriptFetcher.h:
2285         * dom/LoadableClassicScript.cpp:
2286         (WebCore::LoadableClassicScript::load):
2287         * dom/ScriptElementCachedScriptFetcher.cpp:
2288         (WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
2289         * dom/ScriptElementCachedScriptFetcher.h:
2290         * html/HTMLLinkElement.cpp:
2291         (WebCore::HTMLLinkElement::process):
2292
2293 2018-01-25  Zan Dobersek  <zdobersek@igalia.com>
2294
2295         [Cairo] Use GraphicsContextImplCairo in Nicosia::PaintingContextCairo
2296         https://bugs.webkit.org/show_bug.cgi?id=182094
2297
2298         Reviewed by Carlos Garcia Campos.
2299
2300         Have Nicosia::PaintingContextCairo create a GraphicsContext object that
2301         utilizes a factory function which returns a freshly-allocated
2302         GraphicsContextImplCairo through which all the painting is then done.
2303         This moves GraphicsLayer painting over to using the GraphicsContextImpl
2304         infrastructure.
2305
2306         No new tests -- no changes in behavior.
2307
2308         * platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp:
2309         (Nicosia::PaintingContextCairo::PaintingContextCairo):
2310
2311 2018-01-24  Frederic Wang  <fwang@igalia.com>
2312
2313         ScrollingStateNode::reconcileLayerPositionForViewportRect is only called on direct children of the root
2314         https://bugs.webkit.org/show_bug.cgi?id=179946
2315
2316         Reviewed by Simon Fraser.
2317
2318         ScrollingStateNode::reconcileLayerPositionForViewportRect is currently only called on the
2319         direct children of root of the scrolling tree. Hence nodes like "position: fixed" will not
2320         update their layers after scrolling when they are deeper in the tree. This is already
2321         possible on iOS with overflow nodes and will happen with subframes when async scrolling is
2322         implemented. This commit fixes that issue by recursively calling the function
2323         ScrollingStateNode::reconcileLayerPositionForViewportRect on the scrolling tree.
2324
2325         Test: fast/scrolling/ios/reconcile-layer-position-recursive.html
2326
2327         * page/scrolling/AsyncScrollingCoordinator.cpp:
2328         (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Just call
2329         reconcileLayerPositionForViewportRect on the root node.
2330         * page/scrolling/ScrollingStateNode.cpp:
2331         (WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect): By default, this
2332         function now recursively calls reconcileLayerPositionForViewportRect on the children.
2333         * page/scrolling/ScrollingStateNode.h:
2334         * page/scrolling/ScrollingStateFixedNode.cpp:
2335         (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect): Call the function
2336         on children.
2337         * page/scrolling/ScrollingStateStickyNode.cpp:
2338         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect): Ditto.
2339
2340 2018-01-24  Zan Dobersek  <zdobersek@igalia.com>
2341
2342         [Cairo] Use GraphicsContextImplCairo for ImageBuffer context
2343         https://bugs.webkit.org/show_bug.cgi?id=181977
2344
2345         Reviewed by Carlos Garcia Campos.
2346
2347         Enhance the GraphicsContextImpl interface to the point of enabling the
2348         Cairo-based implementation to be used for GraphicsContext construction
2349         in ImageBufferCairo.cpp.
2350
2351         In order to enable GraphicsContextImpl implementations to properly
2352         manage PlatformGraphicsContext objects, the hasPlatformContext() and
2353         platformContext() methods are added. Cairo implementation returns true
2354         in the first method, and returns pointer to the PlatformContextCairo
2355         object in the second. The DisplayList::Recorder, due to its recording
2356         nature, doesn't manage such an object, so it returns false and nullptr,
2357         respectively.
2358
2359         GraphicsContextImpl also gains the setCTM(), getCTM(), clipBounds() and
2360         roundToDevicePixels() methods, corresponding to the GraphicsContext
2361         methods that now invoke these new methods on any existing m_impl object.
2362         GraphicsContextImplCairo implementations mimic the existing behavior in
2363         the Cairo-specific GraphicsContext methods, but DisplayList::Recorder
2364         implementations remain no-op, logging the invocation but doing nothing
2365         otherwise.
2366
2367         drawImage() and drawTiledImage() methods on the GraphicsContextImpl
2368         interface are changed to return the ImageDrawResult value, corresponding
2369         to what's been done in the method. In DisplayList::Recorder, the methods
2370         return ImageDrawResult::DidRecord, while in GraphicsContextImplCairo the
2371         methods return the return result of Image::draw() or Image::drawTiled()
2372         call.
2373
2374         To make the protected Image::draw() and Image::drawTiled() methods
2375         accessible, invocations of those are packed into static drawImageImpl()
2376         and drawTiledImageImpl() functions on the GraphicsContextImpl class.
2377         This makes it possible to simply declare GraphicsContextImpl class as a
2378         friend class of Image, and not every specific GraphicsContextImpl
2379         derivation. Implementations of these functions mirror behavior of the
2380         drawImage() and drawTiledImage() methods on the GraphicsContext class,
2381         when an m_impl object isn't present, constructing a scope-tied
2382         InterpolationQualityMaintainer object and invoking the relevant Image
2383         method.
2384
2385         To make immediate use of the new GraphicsContextImplCairo functionality,
2386         the GraphicsContext construction in Cairo-specific ImageBuffer
2387         implementation now uses a factory function that returns a new
2388         GraphicsContextImplCairo object through which the given
2389         PlatformContextCairo is used for painting.
2390
2391         No new tests -- no change in functionality.
2392
2393         * platform/graphics/GraphicsContext.cpp:
2394         (WebCore::GraphicsContext::hasPlatformContext const):
2395         (WebCore::GraphicsContext::drawImage):
2396         (WebCore::GraphicsContext::drawTiledImage):
2397         * platform/graphics/GraphicsContext.h:
2398         (WebCore::GraphicsContext::hasPlatformContext const): Deleted.
2399         * platform/graphics/GraphicsContextImpl.cpp:
2400         (WebCore::GraphicsContextImpl::drawImageImpl):
2401         (WebCore::GraphicsContextImpl::drawTiledImageImpl):
2402         * platform/graphics/GraphicsContextImpl.h:
2403         * platform/graphics/Image.h:
2404         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2405         (WebCore::GraphicsContext::getCTM const):
2406         (WebCore::GraphicsContext::platformContext const):
2407         (WebCore::GraphicsContext::clipBounds const):
2408         (WebCore::GraphicsContext::roundToDevicePixels):
2409         (WebCore::GraphicsContext::setCTM):
2410         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
2411         (WebCore::m_private):
2412         (WebCore::GraphicsContextImplCairo::~GraphicsContextImplCairo):
2413         (WebCore::GraphicsContextImplCairo::hasPlatformContext const):
2414         (WebCore::GraphicsContextImplCairo::platformContext const):
2415         (WebCore::GraphicsContextImplCairo::updateState):
2416         (WebCore::GraphicsContextImplCairo::setLineCap):
2417         (WebCore::GraphicsContextImplCairo::setLineDash):
2418         (WebCore::GraphicsContextImplCairo::setLineJoin):
2419         (WebCore::GraphicsContextImplCairo::setMiterLimit):
2420         (WebCore::GraphicsContextImplCairo::fillRect):
2421         (WebCore::GraphicsContextImplCairo::fillRoundedRect):
2422         (WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole):
2423         (WebCore::GraphicsContextImplCairo::fillPath):
2424         (WebCore::GraphicsContextImplCairo::fillEllipse):
2425         (WebCore::GraphicsContextImplCairo::strokeRect):
2426         (WebCore::GraphicsContextImplCairo::strokePath):
2427         (WebCore::GraphicsContextImplCairo::strokeEllipse):
2428         (WebCore::GraphicsContextImplCairo::clearRect):
2429         (WebCore::GraphicsContextImplCairo::drawGlyphs):
2430         (WebCore::GraphicsContextImplCairo::drawImage):
2431         (WebCore::GraphicsContextImplCairo::drawTiledImage):
2432         (WebCore::GraphicsContextImplCairo::drawNativeImage):
2433         (WebCore::GraphicsContextImplCairo::drawPattern):
2434         (WebCore::GraphicsContextImplCairo::drawRect):
2435         (WebCore::GraphicsContextImplCairo::drawLine):
2436         (WebCore::GraphicsContextImplCairo::drawLinesForText):
2437         (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker):
2438         (WebCore::GraphicsContextImplCairo::drawEllipse):
2439         (WebCore::GraphicsContextImplCairo::drawFocusRing):
2440         (WebCore::GraphicsContextImplCairo::save):
2441         (WebCore::GraphicsContextImplCairo::restore):
2442         (WebCore::GraphicsContextImplCairo::translate):
2443         (WebCore::GraphicsContextImplCairo::rotate):
2444         (WebCore::GraphicsContextImplCairo::scale):
2445         (WebCore::GraphicsContextImplCairo::concatCTM):
2446         (WebCore::GraphicsContextImplCairo::setCTM):
2447         (WebCore::GraphicsContextImplCairo::getCTM):
2448         (WebCore::GraphicsContextImplCairo::beginTransparencyLayer):
2449         (WebCore::GraphicsContextImplCairo::endTransparencyLayer):
2450         (WebCore::GraphicsContextImplCairo::clip):
2451         (WebCore::GraphicsContextImplCairo::clipOut):
2452         (WebCore::GraphicsContextImplCairo::clipPath):
2453         (WebCore::GraphicsContextImplCairo::clipBounds):
2454         (WebCore::GraphicsContextImplCairo::roundToDevicePixels):
2455         (WebCore::m_platformContext): Deleted.
2456         * platform/graphics/cairo/GraphicsContextImplCairo.h:
2457         * platform/graphics/cairo/ImageBufferCairo.cpp:
2458         (WebCore::ImageBuffer::ImageBuffer):
2459         * platform/graphics/cg/GraphicsContextCG.cpp:
2460         (WebCore::GraphicsContext::clipBounds const):
2461         (WebCore::GraphicsContext::setCTM):
2462         (WebCore::GraphicsContext::getCTM const):
2463         (WebCore::GraphicsContext::roundToDevicePixels):
2464         * platform/graphics/displaylists/DisplayListRecorder.cpp:
2465         (WebCore::DisplayList::Recorder::drawImage):
2466         (WebCore::DisplayList::Recorder::drawTiledImage):
2467         (WebCore::DisplayList::Recorder::drawNativeImage):
2468         (WebCore::DisplayList::Recorder::setCTM):
2469         (WebCore::DisplayList::Recorder::getCTM):
2470         (WebCore::DisplayList::Recorder::clipBounds):
2471         (WebCore::DisplayList::Recorder::roundToDevicePixels):
2472         * platform/graphics/displaylists/DisplayListRecorder.h:
2473
2474 2018-01-24  Christopher Reid  <chris.reid@sony.com>
2475
2476         Linker error in ShareableBitmapCairo.cpp  undefined reference to WebCore::Cairo::ShadowState::ShadowState
2477         https://bugs.webkit.org/show_bug.cgi?id=182060
2478
2479         Reviewed by Žan Doberšek.
2480
2481         No new tests, no change in behavior.
2482
2483         Added exports to WebCore::Cairo::ShadowState::ShadowState.
2484
2485         * platform/graphics/cairo/CairoOperations.h:
2486
2487 2018-01-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2488
2489         [Curl] Implement didSendData client callback.
2490         https://bugs.webkit.org/show_bug.cgi?id=182063
2491
2492         Reviewed by Alex Christensen.
2493
2494         No new tests (covered by existing tests).
2495
2496         * platform/network/curl/CurlDownload.h:
2497         * platform/network/curl/CurlRequest.cpp:
2498         (WebCore::CurlRequest::willSendData):
2499         * platform/network/curl/CurlRequestClient.h:
2500         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2501         (WebCore::ResourceHandleCurlDelegate::curlDidSendData):
2502         * platform/network/curl/ResourceHandleCurlDelegate.h:
2503
2504 2018-01-24  Jiewen Tan  <jiewen_tan@apple.com>
2505
2506         [WebAuthN] Implement PublicKeyCredential’s [[DiscoverFromExternalSource]] with a dummy authenticator
2507         https://bugs.webkit.org/show_bug.cgi?id=182032
2508         <rdar://problem/36459922>
2509
2510         Reviewed by Brent Fulgham.
2511
2512         This patch implements PublicKeyCredential's [[DiscoverFromExternalSource]] from
2513         https://www.w3.org/TR/webauthn/#getAssertion as of 5 December 2017. In order to
2514         do testing, a dummy authenticator is implemented to exercise a failure and a
2515         pass path. A number of dependencies need to be resolved later in order to comply
2516         with the spec, which are marked by FIXME in the patch and tracked by proper
2517         bugs. Those dependencies will be addressed once the first prototype is finshed.
2518
2519         Tests: http/tests/webauthn/public-key-credential-get-with-invalid-parameters.https.html
2520                http/wpt/credential-management/credentialscontainer-store-basics.https.html
2521                http/wpt/webauthn/public-key-credential-get-failure.https.html
2522                http/wpt/webauthn/public-key-credential-get-success.https.html
2523
2524         * Modules/credentialmanagement/CredentialsContainer.cpp:
2525         (WebCore::CredentialsContainer::get):
2526         (WebCore::CredentialsContainer::isCreate):
2527         Fixes some minor issues.
2528         * Modules/webauthn/Authenticator.cpp:
2529         (WebCore::Authenticator::getAssertion const):
2530         * Modules/webauthn/Authenticator.h:
2531         (WebCore::Authenticator::AssertionReturnBundle::AssertionReturnBundle):
2532         * Modules/webauthn/PublicKeyCredential.cpp:
2533         (WebCore::PublicKeyCredential::collectFromCredentialStore):
2534         Changed a parameter type.
2535         (WebCore::PublicKeyCredential::discoverFromExternalSource):
2536         (WebCore::PublicKeyCredential::create):
2537         Improved some comments.
2538         * Modules/webauthn/PublicKeyCredential.h:
2539         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
2540         (): Deleted.
2541         * bindings/js/JSAuthenticatorResponseCustom.cpp:
2542         (WebCore::toJSNewlyCreated):
2543
2544 2018-01-24  Dean Jackson  <dino@apple.com>
2545
2546         Move WebGL's colorspace code into IOSurface
2547         https://bugs.webkit.org/show_bug.cgi?id=182076
2548         <rdar://problem/36846863>
2549
2550         Reviewed by Simon Fraser, with assistance from Tim Horton.
2551
2552         Rather than have WebGLLayer talk directly to an IOSurfaceRef,
2553         use a helper function on WebCore::IOSurface.
2554
2555         No behaviour change.
2556
2557         * platform/graphics/cocoa/IOSurface.h:
2558         * platform/graphics/cocoa/IOSurface.mm:
2559         (WebCore::IOSurface::migrateColorSpaceToProperties): Add new helper.
2560         * platform/graphics/cocoa/WebGLLayer.mm:
2561         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): The
2562         newly created IOSurfaces call the helper to set up their colorspace.
2563
2564 2018-01-24  Dean Jackson  <dino@apple.com>
2565
2566         Add a note about not implementing these functions without discussion.
2567         <rdar://problem/36666458>
2568
2569         * html/canvas/WebGL2RenderingContext.cpp:
2570         (WebCore::WebGL2RenderingContext::clientWaitSync):
2571         (WebCore::WebGL2RenderingContext::getSyncParameter):
2572
2573 2018-01-24  Youenn Fablet  <youenn@apple.com>
2574
2575         Opaque being-loaded responses should clone their body
2576         https://bugs.webkit.org/show_bug.cgi?id=182056
2577
2578         Reviewed by Brady Eidson.
2579
2580         Test: http/wpt/service-workers/clone-opaque-being-loaded-response.https.html
2581
2582         When cloning a being-loaded response, make sure we create a ReadableStream.
2583         Before the patch, the readableStream was not created in that case for opaque responses.
2584
2585         * Modules/fetch/FetchBodyOwner.cpp:
2586         (WebCore::FetchBodyOwner::readableStream):
2587         (WebCore::FetchBodyOwner::createReadableStream):
2588         * Modules/fetch/FetchBodyOwner.h:
2589         * Modules/fetch/FetchResponse.cpp:
2590         (WebCore::FetchResponse::clone):
2591
2592 2018-01-24  Chris Dumez  <cdumez@apple.com>
2593
2594         close() operation should not be exposed inside a ServiceWorkerGlobalScope
2595         https://bugs.webkit.org/show_bug.cgi?id=182057
2596
2597         Reviewed by Youenn Fablet.
2598
2599         Move close() from WorkerGlobalScope to DedicatedWorkerGlobalScope as per:
2600         - https://html.spec.whatwg.org/multipage/workers.html#dedicatedworkerglobalscope
2601
2602         This change to the specification was made to avoid exposing this deprecated
2603         features to service workers (which are new).
2604
2605         No new tests, rebaselined existing test.
2606
2607         * workers/DedicatedWorkerGlobalScope.idl:
2608         * workers/WorkerGlobalScope.idl:
2609
2610 2018-01-24  David Hyatt  <hyatt@apple.com>
2611
2612         Implement line clamp for mail.
2613         https://bugs.webkit.org/show_bug.cgi?id=180818
2614
2615         Reviewed by Dean Jackson.
2616
2617         This patch implements a form of clamping that can clamp lines at both the top
2618         and the bottom, and the interior can be replaced with a DOM element (identified
2619         by id) that replaces the middle section.
2620
2621         The implementation derives from the multicolumn classes, but ultimately the
2622         clamp should derive from the fragmentset classes instead (with most of the current
2623         multicolumn code moving into base classes).
2624
2625         The virtualization of many of the multicolumn functions is something that would happen
2626         once we move pages/printing over to this pagination model anyway.
2627
2628         * Sources.txt:
2629         * WebCore.xcodeproj/project.pbxproj:
2630         Add the new clamp classes.
2631
2632         * css/CSSComputedStyleDeclaration.cpp:
2633         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2634         * css/CSSProperties.json:
2635         * css/StyleBuilderCustom.h:
2636         (WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp):
2637         * css/parser/CSSParser.cpp:
2638         (WebCore::CSSParserContext::CSSParserContext):
2639         * css/parser/CSSParserMode.h:
2640         (WebCore::CSSParserContextHash::hash):
2641         * css/parser/CSSPropertyParser.cpp:
2642         (WebCore::consumeLinesClamp):
2643         (WebCore::CSSPropertyParser::parseSingleValue):
2644         Implement the new CSS property, webkit-lines-clamp. This is only exposed if a preference
2645         is set, so it is not exposed to the Web.
2646
2647         * page/Settings.yaml:
2648         Add a new setting to control allowing access to the new CSS property.
2649
2650         * rendering/RenderBlockFlow.cpp:
2651         (WebCore::RenderBlockFlow::willCreateColumns const):
2652         Make sure columns are created when lines clamp is set.
2653
2654         (WebCore::getHeightForLineCount):
2655         (WebCore::RenderBlockFlow::logicalHeightForLineCount):
2656         (WebCore::RenderBlockFlow::logicalHeightExcludingLineCount):
2657         (WebCore::RenderBlockFlow::layoutExcludedChildren):
2658         (WebCore::RenderBlockFlow::heightForLineCount): Deleted.
2659         * rendering/RenderBlockFlow.h:
2660         Re-use the same clamping logic as the old line clamp code, but modernize it to work
2661         with writing modes and to be able to go backwards from the end of the block.
2662
2663         * rendering/RenderDeprecatedFlexibleBox.cpp:
2664         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2665         The line count method got renamed to have the word "logical" in it, since it now
2666         works with vertical writing.
2667
2668         * rendering/RenderFragmentContainer.cpp:
2669         (WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const):
2670         * rendering/RenderFragmentContainer.h:
2671         Since line clamp sets have variable page heights, this new method takes the offset
2672         as an argument so that it can return the appropriate page for the given offset.
2673         This method will eventually be used by printing/page sets as well, since pages
2674         can have variable heights.
2675
2676         * rendering/RenderFragmentedFlow.cpp:
2677         (WebCore::RenderFragmentedFlow::validateFragments):
2678         (WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
2679         (WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
2680         * rendering/RenderFragmentedFlow.h:
2681         Support for variable page heights in a fragment set.
2682
2683         * rendering/RenderLinesClampFlow.cpp: Added.
2684         (WebCore::RenderLinesClampFlow::RenderLinesClampFlow):
2685         (WebCore::RenderLinesClampFlow::renderName const):
2686         (WebCore::RenderLinesClampFlow::layout):
2687         (WebCore::RenderLinesClampFlow::createMultiColumnSet):
2688         (WebCore::RenderLinesClampFlow::isChildAllowedInFragmentedFlow const):
2689         (WebCore::RenderLinesClampFlow::layoutFlowExcludedObjects):
2690         * rendering/RenderLinesClampFlow.h: Added.
2691         * rendering/RenderLinesClampSet.cpp: Added.
2692         (WebCore::RenderLinesClampSet::RenderLinesClampSet):
2693         (WebCore::RenderLinesClampSet::recalculateColumnHeight):
2694         (WebCore::RenderLinesClampSet::computeLogicalHeight const):
2695         (WebCore::RenderLinesClampSet::columnCount const):
2696         (WebCore::RenderLinesClampSet::columnRectAt const):
2697         (WebCore::RenderLinesClampSet::columnIndexAtOffset const):
2698         (WebCore::RenderLinesClampSet::pageLogicalTopForOffset const):
2699         (WebCore::RenderLinesClampSet::pageLogicalHeightForOffset const):
2700         (WebCore::RenderLinesClampSet::fragmentedFlowPortionRectAt const):
2701         (WebCore::RenderLinesClampSet::fragmentedFlowPortionOverflowRect):
2702         (WebCore::RenderLinesClampSet::customBlockProgressionAdjustmentForColumn const):
2703         (WebCore::RenderLinesClampSet::renderName const):
2704         * rendering/RenderLinesClampSet.h: Added.
2705         The new classes. They subclass all the methods necessary to do multi-pass layout,
2706         and to determine the page heights of each section.
2707
2708         * rendering/RenderMultiColumnFlow.cpp:
2709         (WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const):
2710         (WebCore::isValidColumnSpanner):
2711         (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
2712         (WebCore::RenderMultiColumnFlow::createMultiColumnSet):
2713         * rendering/RenderMultiColumnFlow.h:
2714         * rendering/RenderMultiColumnSet.cpp:
2715         (WebCore::RenderMultiColumnSet::collectLayerFragments):
2716         (WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
2717         * rendering/RenderMultiColumnSet.h:
2718         (WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const):
2719         (WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const):
2720         Virtualized methods so that lines clamp can subclass and change behavior.
2721
2722         * rendering/RenderObject.h:
2723         (WebCore::RenderObject::isRenderLinesClampFlow const):
2724         (WebCore::RenderObject::isRenderLinesClampSet const):
2725         Add new functions for type checking.
2726
2727         * rendering/RenderRubyText.cpp:
2728         Include adjustment.
2729
2730         * rendering/style/LineClampValue.h:
2731         (WebCore::LinesClampValue::LinesClampValue):
2732         (WebCore::LinesClampValue::isNone const):
2733         (WebCore::LinesClampValue::operator== const):
2734         (WebCore::LinesClampValue::operator!= const):
2735         (WebCore::LinesClampValue::start const):
2736         (WebCore::LinesClampValue::end const):
2737         (WebCore::LinesClampValue::center const):
2738         * rendering/style/RenderStyle.h:
2739         (WebCore::RenderStyle::linesClamp const):
2740         (WebCore::RenderStyle::hasLinesClamp const):
2741         (WebCore::RenderStyle::setLinesClamp):
2742         (WebCore::RenderStyle::initialLinesClamp):
2743         (WebCore::RenderStyle::hasInlineColumnAxis const):
2744         * rendering/style/StyleRareNonInheritedData.cpp:
2745         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2746         (WebCore::StyleRareNonInheritedData::operator== const):
2747         * rendering/style/StyleRareNonInheritedData.h:
2748         The front end style implementation of the new property.
2749
2750         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2751         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
2752         Make sure to build the correct renderer when lines clamp is set.
2753
2754 2018-01-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2755
2756         [Curl] Allocate CurlSSLVerifier only when it is required.
2757         https://bugs.webkit.org/show_bug.cgi?id=182061
2758
2759         CurlSSLVerifier was a member function of CurlRequest. This patch do
2760         lazy initialization of it only when actually it is required.
2761         Also configuration method is not required by moving those stuff to
2762         constructor of SSLVerifier which makes much safer because there's
2763         no change to change its behavior from outside.
2764
2765         Reviewed by Alex Christensen.
2766
2767         * platform/network/curl/CurlRequest.cpp:
2768         (WebCore::CurlRequest::willSetupSslCtx):
2769         (WebCore::CurlRequest::didCompleteTransfer):
2770         (WebCore::CurlRequest::finalizeTransfer):
2771         * platform/network/curl/CurlRequest.h:
2772         * platform/network/curl/CurlSSLVerifier.cpp:
2773         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
2774         (WebCore::CurlSSLVerifier::setSslCtx): Deleted.
2775         * platform/network/curl/CurlSSLVerifier.h:
2776         (WebCore::CurlSSLVerifier::setCurlHandle): Deleted.
2777         (WebCore::CurlSSLVerifier::setHostName): Deleted.
2778
2779 2018-01-24  Antti Koivisto  <antti@apple.com>
2780
2781         Assertion failure in RenderMultiColumnSet::requiresBalancing() on fast/multicol/spanner-crash-when-adding-summary.html
2782         https://bugs.webkit.org/show_bug.cgi?id=179308
2783         <rdar://problem/34592771>
2784
2785         Reviewed by Zalan Bujtas.
2786
2787         The issue here is that we fail to tear down render tree for a summary element because adding another summary element
2788         takes it out of the composed tree. This leaves behind renderers that break some multicolumn assumptions.
2789
2790         * rendering/updating/RenderTreeUpdater.cpp:
2791         (WebCore::RenderTreeUpdater::tearDownRenderers):
2792         (WebCore::RenderTreeUpdater::tearDownLeftoverShadowHostChildren):
2793
2794         When tearing down renderers go through the real children of the shadow hosts at the end and see if we left any renderers behind.
2795         If so, tear them down too.
2796
2797         * rendering/updating/RenderTreeUpdater.h:
2798
2799 2018-01-24  Daniel Bates  <dabates@apple.com>
2800
2801         [CSP] Check policy for targeted windows when navigating to a JavaScript URL
2802         https://bugs.webkit.org/show_bug.cgi?id=182018
2803         <rdar://problem/36795781>
2804
2805         Reviewed by Brent Fulgham.
2806
2807         Move the CSP check to be earlier in the function.
2808
2809         Test: http/tests/security/contentSecurityPolicy/window-open-javascript-url-with-target-blocked.html
2810
2811         * loader/FrameLoader.cpp:
2812         (WebCore::createWindow):
2813
2814 2018-01-24  Chris Dumez  <cdumez@apple.com>
2815
2816         Add a IPC::SendSyncOption indicating we should not process incoming IPC while waiting for the sync reply
2817         https://bugs.webkit.org/show_bug.cgi?id=182021
2818         <rdar://problem/21629943>
2819
2820         Reviewed by Ryosuke Niwa.
2821
2822         Add layout testing infrastructure for the new flag.
2823
2824         Test: fast/misc/testIncomingSyncIPCMessageWhileWaitingForSyncReply.html
2825
2826         * page/ChromeClient.h:
2827         * testing/Internals.cpp:
2828         (WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
2829         * testing/Internals.h:
2830         * testing/Internals.idl:
2831
2832 2018-01-24  Alex Christensen  <achristensen@webkit.org>
2833
2834         Remove pre-Sierra-OS-specific code in WebCore
2835         https://bugs.webkit.org/show_bug.cgi?id=182026
2836
2837         Reviewed by Tim Horton.
2838
2839         * page/cocoa/UserAgent.mm:
2840         (WebCore::systemMarketingVersionForUserAgentString):
2841         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
2842         (WebCore::ScrollingMomentumCalculatorMac::retargetedScrollOffsetDidChange):
2843         * platform/cocoa/PasteboardCocoa.mm:
2844         (WebCore::bitmapPNGFileType):
2845         * platform/graphics/FontPlatformData.cpp:
2846         * platform/graphics/FontPlatformData.h:
2847         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
2848         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
2849         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2850         (layerContentsFormat):
2851         (PlatformCALayerCocoa::updateContentsFormat):
2852         (PlatformCALayerCocoa::backingStoreBytesPerPixel const):
2853         * platform/graphics/cg/GraphicsContextCG.cpp:
2854         (WebCore::linearRGBColorSpaceRef):
2855         (WebCore::extendedSRGBColorSpaceRef):
2856         * platform/graphics/cg/PDFDocumentImage.cpp:
2857         (WebCore::PDFDocumentImage::drawPDFPage):
2858         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2859         (WebCore::getCSSAttribute):
2860         (WebCore::capabilitiesForFontDescriptor):
2861         (WebCore::findClosestFont):
2862         (WebCore::platformFontLookupWithFamily):
2863         (WebCore::lookupFallbackFont):
2864         (WebCore::fontWeightFromCoreText): Deleted.
2865         * platform/graphics/cocoa/FontCocoa.mm:
2866         (WebCore::Font::variantCapsSupportsCharacterForSynthesis const):
2867         (WebCore::Font::platformWidthForGlyph const):
2868         (WebCore::advanceForColorBitmapFont): Deleted.
2869         (WebCore::canUseFastGlyphAdvanceGetter): Deleted.
2870         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2871         (WebCore::FontPlatformData::FontPlatformData):
2872         (WebCore::FontPlatformData::hash const):
2873         (WebCore::FontPlatformData::platformIsEqual const):
2874         (WebCore::FontPlatformData::ctFont const):
2875         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
2876         (WebCore::linearRGBColorSpaceRef): Deleted.
2877         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2878         (WebCore::WebCoreDecompressionSession::setTimebase):
2879         * platform/graphics/mac/FontCustomPlatformData.cpp:
2880         (WebCore::FontCustomPlatformData::supportsFormat):
2881         * platform/mac/PlatformScreenMac.mm:
2882         (WebCore::screenSupportsExtendedColor):
2883         * platform/mac/ScrollbarThemeMac.mm:
2884         (WebCore::ScrollbarThemeMac::didCreateScrollerImp):
2885         (WebCore::ScrollbarThemeMac::isLayoutDirectionRTL):
2886         * platform/mac/ThemeMac.mm:
2887         (WebCore::ThemeMac::userPrefersReducedMotion const):
2888         * platform/network/cocoa/ResourceRequestCocoa.mm:
2889         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2890         * platform/text/mac/TextBoundaries.mm:
2891         (WebCore::findNextWordFromIndex):
2892         * rendering/RenderLayerModelObject.cpp:
2893         (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const):
2894         * testing/Internals.mm:
2895         (WebCore::Internals::userPrefersReducedMotion const):
2896
2897 2018-01-24  Alex Christensen  <achristensen@webkit.org>
2898
2899         Remove WebProcess authentication code
2900         https://bugs.webkit.org/show_bug.cgi?id=182020
2901
2902         Reviewed by Brady Eidson.
2903
2904         We were keeping it around for pre-NetworkSession media loading, which is gone now.
2905
2906         * html/HTMLMediaElement.cpp:
2907         (WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
2908         * html/HTMLMediaElement.h:
2909         * loader/ResourceLoader.cpp:
2910         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
2911         * loader/ResourceLoader.h:
2912         * platform/graphics/MediaPlayer.cpp:
2913         (WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge): Deleted.
2914         * platform/graphics/MediaPlayer.h:
2915         (WebCore::MediaPlayerClient::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
2916         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2917         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2918         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForResponseToAuthenticationChallenge:]):
2919         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge): Deleted.
2920
2921 2018-01-24  Joanmarie Diggs  <jdiggs@igalia.com>
2922
2923         AX: SVG AAM mapping trumps ARIA role attribute in the case of SVG root
2924         https://bugs.webkit.org/show_bug.cgi?id=181994
2925
2926         Reviewed by Chris Fleizach.
2927
2928         Only return AccessibilityRole::Group if we have no author-provided
2929         ARIA role attribute value.
2930
2931         Test: accessibility/svg-element-with-aria-role.html
2932
2933         * accessibility/AccessibilitySVGRoot.cpp:
2934         (WebCore::AccessibilitySVGRoot::roleValue const):
2935         * accessibility/AccessibilitySVGRoot.h:
2936
2937 2018-01-24  Alex Christensen  <achristensen@webkit.org>
2938
2939         Remove unused QTKit preference
2940         https://bugs.webkit.org/show_bug.cgi?id=181968
2941
2942         Reviewed by Alexey Proskuryakov.
2943
2944         They weren't used and didn't do anything.
2945
2946         * page/DeprecatedGlobalSettings.cpp:
2947         (WebCore::DeprecatedGlobalSettings::setQTKitEnabled): Deleted.
2948         * page/DeprecatedGlobalSettings.h:
2949         (WebCore::DeprecatedGlobalSettings::isQTKitEnabled): Deleted.
2950
2951 2018-01-24  Antoine Quint  <graouts@apple.com>
2952
2953         [Web Animations] Compute the progress and currentIteration properties on getComputedTiming()
2954         https://bugs.webkit.org/show_bug.cgi?id=182039
2955         <rdar://problem/36813568>
2956
2957         Reviewed by Dean Jackson.
2958
2959         Compute the "progress" and "currentIteration" properties on the dictionary returned by getComputedTiming().
2960         To support this we implement several procedures from the specification implemented separately with links
2961         and steps copied from the specification. There is one last procedure we don't implement, which is to obtain
2962         the transformed time following the application of the provided easing, which will be the next patch.
2963
2964         * animation/AnimationEffect.cpp:
2965         (WebCore::AnimationEffect::phase const):
2966         (WebCore::AnimationEffect::activeTime const):
2967         (WebCore::AnimationEffect::overallProgress const):
2968         (WebCore::AnimationEffect::simpleIterationProgress const):
2969         (WebCore::AnimationEffect::currentIteration const):
2970         (WebCore::AnimationEffect::currentDirection const):
2971         (WebCore::AnimationEffect::directedProgress const):
2972         (WebCore::AnimationEffect::iterationProgress const):
2973         (WebCore::AnimationEffect::getComputedTiming):
2974         * animation/AnimationEffect.h:
2975
2976 2018-01-24  Daniel Bates  <dabates@apple.com>
2977
2978         REGRESSION (r226138): Selecting a line that ends with zero-width joiner (ZWJ) may cause text transformation
2979         https://bugs.webkit.org/show_bug.cgi?id=181993
2980         <rdar://problem/36421080>
2981
2982         Reviewed by David Hyatt.
2983
2984         Re-implement paint optimization that was inadvertently removed in r226138. This optimization
2985         works around an issue where selecting the last printable character in a line that is followed
2986         followed by a zero-width joiner transforms the selected character.
2987
2988         We need to fix <https://bugs.webkit.org/show_bug.cgi?id=181964> to improve the interaction
2989         of selection and zero-width joiner characters. For now, re-implement a paint optimization
2990         to perform a single paint operation when the style of the non-selected text is identical
2991         to the style of the selected text.
2992
2993         Test: fast/text/mac/select-character-before-zero-width-joiner.html
2994
2995         * rendering/InlineTextBox.cpp:
2996         (WebCore::InlineTextBox::MarkerSubrangeStyle::areBackgroundMarkerSubrangeStylesEqual):
2997         (WebCore::InlineTextBox::MarkerSubrangeStyle::areForegroundMarkerSubrangeStylesEqual):
2998         (WebCore::InlineTextBox::MarkerSubrangeStyle::areDecorationMarkerSubrangeStylesEqual):
2999         Add helper functions to determine when marker styles are identical. We make use of these
3000         equality functions to coalesce adjacent subranges that have the same visual style and
3001         hence reduce the number of drawing commands to paint all the subranges in a line.
3002  
3003         (WebCore::InlineTextBox::paint): Coalesce subranges before painting.
3004
3005         (WebCore::InlineTextBox::subdivideAndResolveStyle): Split out the logic to coalesce
3006         subranges with the same style into its own function InlineTextBox::coalesceAdjacentSubranges()
3007         and kept this function focused on subdivision and style resolution. Manually compute
3008         the frontmost subranges so that we can resolve style for each subrange with respect to
3009         the correct base style. Formerly we always resolved style with respect the specified
3010         base style. Now we resolve style with respect the previous frontmost subrange to ensure
3011         styles cascade as expected. This change causes no visual difference now. Once we implement
3012         <https://bugs.webkit.org/show_bug.cgi?id=175784> we will be able to test this change
3013         with respect to selection of ::spelling-error/::grammar-error pseudo elements.
3014
3015         (WebCore::InlineTextBox::coalesceAdjacentSubranges): Extracted logic from InlineTextBox::subdivideAndResolveStyle().
3016
3017         (WebCore::InlineTextBox::MarkerSubrangeStyle::operator== const): Deleted.
3018         (WebCore::InlineTextBox::MarkerSubrangeStyle::operator!= const): Deleted.
3019         Comparing MarkerSubrangeStyle objects should be performed using the appropriate
3020         are*MarkerSubrangeStylesEqual() non-member function.
3021
3022         * rendering/InlineTextBox.h:
3023         * rendering/MarkerSubrange.cpp:
3024         (WebCore::subdivide): Remove overlap strategy FrontmostWithLongestEffectiveRange
3025         as this strategy is now implemented by InlineTextBox::subdivideAndResolveStyle() and
3026         InlineTextBox::coalesceAdjacentSubranges() that compute the set of frontmost subranges and
3027         coalesces adjacent subranges with the same style into the longest effective subrange,
3028         respectively. Unlike WebCore::subdivide(), InlineTextBox knows what the base style should
3029         be for the subranges and can more aggressively coalesce adjacent subranges of different
3030         types that have the same visual style.
3031         * rendering/MarkerSubrange.h:
3032
3033 2018-01-24  Youenn Fablet  <youenn@apple.com>
3034
3035         Fetch response should copy its url from the request if null
3036         https://bugs.webkit.org/show_bug.cgi?id=182048
3037
3038         Reviewed by Chris Dumez.
3039
3040         No change of behavior.
3041
3042         * loader/DocumentLoader.cpp:
3043         (WebCore::DocumentLoader::responseReceived): Add assertion to check that the response URL is not null.
3044
3045 2018-01-24  Youenn Fablet  <youenn@apple.com>
3046
3047         Account for memory cache in DocumentThreadableLoader::didReceiveResponse assertion
3048         https://bugs.webkit.org/show_bug.cgi?id=182049
3049
3050         Reviewed by Chris Dumez.
3051
3052         No change of behavior.
3053         A response served from Service Worker may be cached in Memory Cache and reused later on.
3054         Update DTL assertion to handle that case.
3055
3056         * loader/DocumentThreadableLoader.cpp:
3057         (WebCore::DocumentThreadableLoader::didReceiveResponse):
3058
3059 2018-01-24  Eric Carlson  <eric.carlson@apple.com>
3060
3061         REGRESSION(r227457): Release assert in updateLayout while destructing a media element
3062         https://bugs.webkit.org/show_bug.cgi?id=182038
3063         <rdar://problem/36812083>
3064
3065         Reviewed by Jer Noble.
3066
3067         * html/MediaElementSession.cpp:
3068         (WebCore::isMainContentForPurposesOfAutoplay): Early return if element.isSuspended().
3069         * platform/audio/mac/MediaSessionManagerMac.mm:
3070         (WebCore::MediaSessionManagerMac::clientCharacteristicsChanged): Call scheduleUpdateNowPlayingInfo
3071         instead of updateNowPlayingInfo.
3072
3073 2018-01-24  Chris Fleizach  <cfleizach@apple.com>
3074
3075         AX: Provide a way for VoiceOver to uniquely identify a web session
3076         https://bugs.webkit.org/show_bug.cgi?id=181894
3077
3078         Reviewed by Joanmarie Diggs.
3079
3080         Add a way for VoiceOver to uniquely track a web page session.
3081
3082         Test: accessibility/mac/session-id.html
3083
3084         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3085         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
3086         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3087
3088 2018-01-24  Antti Koivisto  <antti@apple.com>
3089
3090         RenderBlockRareData::m_enclosingFragmentedFlow should be WeakPtr
3091         https://bugs.webkit.org/show_bug.cgi?id=182045
3092         <rdar://problem/36334787>
3093
3094         Reviewed by Zalan Bujtas.
3095
3096         For safety.
3097
3098         * rendering/RenderBlock.cpp:
3099         (WebCore::RenderBlock::cachedEnclosingFragmentedFlow const):
3100         (WebCore::RenderBlock::updateCachedEnclosingFragmentedFlow const):
3101         (WebCore::RenderBlock::locateEnclosingFragmentedFlow const):
3102
3103 2018-01-23  Dean Jackson  <dino@apple.com>
3104
3105         REGRESSION (r222961?): sRGB images shown in WebGL are over-saturated on a wide gamut monitor
3106         https://bugs.webkit.org/show_bug.cgi?id=182033
3107         <rdar://problem/36377780>
3108
3109         Reviewed by Antoine Quint.
3110
3111         My fix for YouTube360 changed the way we composite WebGL on macOS. Unfortunately it dropped
3112         a flag telling the compositor the colorspace of the content should be sRGB. Reinstate this
3113         by explicitly setting the colorspace on the IOSurface we use for WebGL back buffers.
3114
3115         This *should* be covered by the test in:
3116         fast/canvas/webgl/match-page-color-space.html
3117         ... however, it shows a problem with our testing infrastructure. As long as it is not
3118         testing on a Wide Gamut display, and explicitly setting the color profile, an automated
3119         test won't pick up this regression. I could add an Internals helper to query the colorspace
3120         of the WebGL content, but that doesn't actually verify the composited result, which is
3121         all that matters.
3122
3123         * platform/graphics/cocoa/WebGLLayer.mm:
3124         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
3125
3126 2018-01-24  Ms2ger  <Ms2ger@igalia.com>
3127
3128         [GTK] Fix some test failures in ATK selection handling.
3129         https://bugs.webkit.org/show_bug.cgi?id=168369
3130         <rdar://problem/30534881>
3131
3132         Reviewed by Joanmarie Diggs.
3133
3134         In r208479, selectionBelongsToObject was changed to return false if the
3135         intersectsNode call returns an exception.
3136
3137         In particular, this caused accessibility/gtk/text-at-offset-textarea.html
3138         to fail. In this test, the selection is situated in the shadow DOM of the
3139         textarea, while the node that is checked for intersection is the textarea
3140         itself. In line with the standard, intersectsNode returns an exception in
3141         this case.
3142
3143         This caused webkitAccessibleText{Word, Line, Sentence}ForBoundary to stop
3144         returning the expected text in the tested case. Removing this check fixes
3145         the test, along with some others.
3146
3147         Tests: accessibility/gtk/text-at-offset-textarea.html
3148                accessibility/gtk/text-at-offset-textinput.html
3149                accessibility/selected-text-range-aria-elements.html
3150                accessibility/textarea-selected-text-range.html
3151
3152         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3153         (getSelectionOffsetsForObject): Remove the selectionBelongsToObject() call.
3154
3155 2018-01-18  Sergio Villar Senin  <svillar@igalia.com>
3156
3157         [WebVR] Add OpenVR to the tree and to the build
3158         https://bugs.webkit.org/show_bug.cgi?id=177298
3159
3160         Reviewed by Žan Doberšek.
3161
3162         Added build dependencies with the OpenVR library.
3163
3164         * CMakeLists.txt:
3165
3166 2018-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3167
3168         Harden against layout passes triggered when iterating through HTMLFormElement::associatedElements
3169         https://bugs.webkit.org/show_bug.cgi?id=182037
3170         <rdar://problem/36747812>
3171
3172         Reviewed by Ryosuke Niwa.
3173
3174         Observe that HTMLFormElement::associatedElements returns a const reference to a Vector of raw
3175         FormAssociatedElement pointers. In various call sites that iterate through these associated elements using this
3176         function, some require synchronous layout updates per iteration, which can lead to a bad time when combined with
3177         the first observation.
3178
3179         To address this, we introduce HTMLFormElement::copyAssociatedElementsVector. This returns a new vector
3180         containing strong Refs to each associated element. From each call site that may trigger synchronous layout and
3181         execute arbitrary script while iterating over associated form elements, we instead use iterate over protected
3182         FormAssociatedElements.
3183
3184         From each call site that currently doesn't (and shouldn't) require a layout update, we use the old version that
3185         returns a list of raw FormAssociatedElement pointers, but add ScriptDisallowedScopes to ensure that we never
3186         execute script there in the future.
3187
3188         Test: fast/forms/form-data-associated-element-iteration.html
3189
3190         * html/DOMFormData.cpp:
3191         (WebCore::DOMFormData::DOMFormData):
3192
3193         Change to use copyAssociatedElementsVector().
3194
3195         * html/FormController.cpp:
3196         (WebCore::recordFormStructure):
3197         (WebCore::FormController::restoreControlStateIn):
3198
3199         Change to use copyAssociatedElementsVector().
3200
3201         * html/HTMLFieldSetElement.cpp:
3202         (WebCore::HTMLFieldSetElement::copyAssociatedElementsVector const):
3203         (WebCore:: const):
3204         (WebCore::HTMLFieldSetElement::length const):
3205
3206         Refactor to use unsafeAssociatedElements().
3207
3208         * html/HTMLFieldSetElement.h:
3209         * html/HTMLFormControlsCollection.cpp:
3210         (WebCore:: const):
3211         (WebCore::HTMLFormControlsCollection::copyFormControlElementsVector const):
3212         (WebCore::HTMLFormControlsCollection::customElementAfter const):
3213         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
3214
3215         Refactor these to use unsafeAssociatedElements().
3216
3217         * html/HTMLFormControlsCollection.h:
3218         * html/HTMLFormElement.cpp:
3219         (WebCore::HTMLFormElement::unsafeAssociatedElements const):
3220         (WebCore::HTMLFormElement::copyAssociatedElementsVector const):
3221         * html/HTMLFormElement.h:
3222         * loader/FormSubmission.cpp:
3223         (WebCore::FormSubmission::create):
3224
3225         Refactor to use copyAssociatedElementsVector().
3226
3227 2018-01-23  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3228
3229         [Curl] Fix wrong redirection with relative url when it happens from
3230         different host than original host.
3231         https://bugs.webkit.org/show_bug.cgi?id=181873
3232
3233         Reviewed by Alex Christensen.
3234
3235         * platform/network/curl/CurlDownload.cpp:
3236         (WebCore::CurlDownload::willSendRequest):
3237         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
3238         (WebCore::ResourceHandleCurlDelegate::willSendRequest):
3239
3240 2018-01-23  Eric Carlson  <eric.carlson@apple.com>
3241
3242         Resign NowPlaying status when no media element is eligible
3243         https://bugs.webkit.org/show_bug.cgi?id=181914
3244         <rdar://problem/35294116>
3245
3246         Reviewed by Jer Noble.
3247
3248         Updated API test.
3249
3250         * html/HTMLMediaElement.cpp:
3251         (WebCore::HTMLMediaElement::removedFromAncestor): Call mediaSession->clientCharacteristicsChanged
3252         so NowPlaying status will be updated.
3253
3254         * html/MediaElementSession.cpp:
3255         (WebCore::MediaElementSession::playbackPermitted const): Return early when the media 
3256         element has been suspended.
3257         (WebCore::MediaElementSession::canShowControlsManager const): Return false when being queried
3258         for NowPlaying status in an inactive document or when element has been suspended.
3259         (WebCore::isMainContentForPurposesOfAutoplay): Return early if it isn't safe to update
3260         style because HitTest can force a layout.
3261         (WebCore::MediaElementSession::updateIsMainContent const): Ditto.
3262
3263         * platform/audio/PlatformMediaSessionManager.cpp:
3264         (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Implement in for all
3265         ports.
3266         * platform/audio/PlatformMediaSessionManager.h:
3267         (WebCore::PlatformMediaSessionManager::registeredAsNowPlayingApplication const):
3268         * platform/audio/ios/MediaSessionManagerIOS.h:
3269         * platform/audio/mac/MediaSessionManagerMac.h:
3270         * platform/audio/mac/MediaSessionManagerMac.mm:
3271         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Call MRMediaRemoteSetCanBeNowPlayingApplication
3272         whenever status changes.
3273         (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Deleted, implemented
3274         in the base class.
3275
3276 2018-01-23  Alex Christensen  <achristensen@webkit.org>
3277
3278         Use CompletionHandlers for ResourceHandleClient::didReceiveResponseAsync
3279         https://bugs.webkit.org/show_bug.cgi?id=181961
3280
3281         Reviewed by Michael Catanzaro.
3282
3283         No change in behavior.
3284
3285         * loader/ResourceLoader.cpp:
3286         (WebCore::ResourceLoader::didReceiveResponseAsync):
3287         * loader/ResourceLoader.h:
3288         * loader/appcache/ApplicationCacheGroup.cpp:
3289         (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
3290         * loader/appcache/ApplicationCacheGroup.h:
3291         * platform/network/BlobResourceHandle.cpp:
3292         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
3293         (WebCore::BlobResourceHandle::notifyResponseOnError):
3294         (WebCore::BlobResourceHandle::continueDidReceiveResponse): Deleted.
3295         * platform/network/BlobResourceHandle.h:
3296         * platform/network/PingHandle.h:
3297         * platform/network/ResourceHandle.cpp:
3298         (WebCore::ResourceHandle::didReceiveResponse):
3299         * platform/network/ResourceHandle.h:
3300         * platform/network/ResourceHandleClient.h:
3301         * platform/network/SynchronousLoaderClient.cpp:
3302         (WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
3303         * platform/network/SynchronousLoaderClient.h:
3304         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3305         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
3306         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueDidReceiveResponse): Deleted.
3307         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
3308         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
3309         (WebCore::ResourceHandleCurlDelegate::handleDataURL):
3310         (WebCore::ResourceHandleCurlDelegate::continueDidReceiveResponse): Deleted.
3311         * platform/network/mac/ResourceHandleMac.mm:
3312         (WebCore::ResourceHandle::continueDidReceiveResponse): Deleted.
3313         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
3314         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3315         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3316         (-[WebCoreResourceHandleAsOperationQueueDelegate continueDidReceiveResponse]): Deleted.
3317         * platform/network/soup/ResourceHandleSoup.cpp:
3318         (WebCore::nextMultipartResponsePartCallback):
3319         (WebCore::sendRequestCallback):
3320         (WebCore::ResourceHandle::continueDidReceiveResponse): Deleted.
3321
3322 2018-01-23  Chris Dumez  <cdumez@apple.com>
3323
3324         Unreviewed, rollout r227216 as it seems to be causing deadlocks
3325         https://bugs.webkit.org/show_bug.cgi?id=182013
3326
3327         * page/ChromeClient.h:
3328         * testing/Internals.cpp:
3329         (WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
3330         * testing/Internals.h:
3331         * testing/Internals.idl:
3332
3333 2018-01-23  Ali Juma  <ajuma@chromium.org>
3334
3335         REGRESSION (r226622): ASSERTION FAILED: !m_frame in WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame()
3336         https://bugs.webkit.org/show_bug.cgi?id=181756
3337
3338         Reviewed by Simon Fraser.
3339
3340         Don't create a VisualViewport for a suspended DOMWindow. When a DOMWindow is suspended
3341         for document suspension, all DOMWindowProperties are disconnected from their frame.
3342         Creating a new VisualViewport while in this state means unexpectedly having a DOMWindowProperty
3343         that's connected to a frame, and this leads to an assertion failure.
3344
3345         Test: http/tests/navigation/https-in-page-cache.html
3346
3347         * page/DOMWindow.cpp:
3348         (WebCore::DOMWindow::visualViewport const):
3349         Don't create a VisualViewport while suspended.
3350         * page/FrameView.cpp:
3351         (WebCore::FrameView::updateLayoutViewport):
3352         Handle null DOMWindow::visualViewport.
3353
3354 2018-01-23  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3355
3356         [Curl] CurlRequest must protect its client from disposal while it's on duty.
3357         https://bugs.webkit.org/show_bug.cgi?id=181875
3358
3359         Reviewed by Alex Christensen.
3360
3361         No new tests. It's covered by existing tests.
3362
3363         * platform/network/curl/CurlDownload.h:
3364         * platform/network/curl/CurlRequest.cpp:
3365         (WebCore::CurlRequest::callClient):
3366         (WebCore::CurlRequest::didReceiveData):
3367         (WebCore::CurlRequest::didReceiveDataFromMultipart):
3368         (WebCore::CurlRequest::didCompleteTransfer):
3369         (WebCore::CurlRequest::invokeDidReceiveResponse):
3370         * platform/network/curl/CurlRequest.h:
3371         * platform/network/curl/CurlRequestClient.h:
3372         * platform/network/curl/ResourceHandleCurlDelegate.h:
3373
3374 2018-01-23  Commit Queue  <commit-queue@webkit.org>
3375
3376         Unreviewed, rolling out r227437.
3377         https://bugs.webkit.org/show_bug.cgi?id=182011
3378
3379         broke build (Requested by alexchristensen on #webkit).
3380
3381         Reverted changeset:
3382
3383         "Remove unused QTKit preference"
3384         https://bugs.webkit.org/show_bug.cgi?id=181968
3385         https://trac.webkit.org/changeset/227437
3386
3387 2018-01-23  Antoine Quint  <graouts@apple.com>
3388
3389         [Web Animations] Expose getKeyframes() and parsing of remaining keyframe properties
3390         https://bugs.webkit.org/show_bug.cgi?id=181978
3391
3392         Not reviewed.
3393
3394         Fix failures for http/wpt/web-animations/interfaces/AnimationEffectTiming/easing.html introduced in the previous patch.
3395         Those keyword values are not expected.
3396
3397         * platform/animation/TimingFunction.cpp:
3398         (WebCore::TimingFunction::cssText const):
3399
3400 2018-01-23  Simon Fraser  <simon.fraser@apple.com>
3401
3402         feMorphology stops applying if either x or y radius is 0 but should not.
3403         https://bugs.webkit.org/show_bug.cgi?id=181903
3404
3405         Reviewed by Dean Jackson.
3406         
3407         feMorphology should allow the radius on one axis to be zero but still apply the effect
3408         (it's akin to a blur on just one axis). Also, any negative radius, or zero on both axes
3409         should act like a pass-through, rather than outputting transparent blank (this is a spec
3410         change from SVG 1.1 to SVG 2).
3411
3412         Tests: svg/filters/feMorphology-zero-radius-one-axis-expected.svg
3413                svg/filters/feMorphology-zero-radius-one-axis.svg
3414
3415         * platform/graphics/filters/FEMorphology.cpp:
3416         (WebCore::FEMorphology::platformApplyDegenerate):
3417         * platform/graphics/filters/FilterEffect.cpp:
3418         (WebCore::FilterEffect::createImageBufferResult):
3419
3420 2018-01-23  Alex Christensen  <achristensen@webkit.org>
3421
3422         Remove unused MediaPlayerSupportsTypeClient
3423         https://bugs.webkit.org/show_bug.cgi?id=182003
3424
3425         Reviewed by Sam Weinig.
3426
3427         This was used for a QTKit-specific hack I removed in r227372.
3428
3429         * Modules/encryptedmedia/CDM.cpp:
3430         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
3431         * Modules/mediasource/MediaSource.cpp:
3432         (WebCore::MediaSource::isTypeSupported):
3433         * dom/DOMImplementation.cpp:
3434         (WebCore::DOMImplementation::createDocument):
3435         (WebCore::DOMImplementationSupportsTypeClient::DOMImplementationSupportsTypeClient): Deleted.
3436         (): Deleted.
3437         * html/HTMLMediaElement.cpp:
3438         (WebCore::HTMLMediaElement::canPlayType const):
3439         (WebCore::HTMLMediaElement::selectNextSourceChild):
3440         (WebCore::HTMLMediaElement::mediaPlayerNeedsSiteSpecificHacks const): Deleted.
3441         (WebCore::HTMLMediaElement::mediaPlayerDocumentHost const): Deleted.
3442         * html/HTMLMediaElement.h:
3443         * platform/graphics/MediaPlayer.cpp:
3444         (WebCore::MediaPlayer::supportsType):
3445         * platform/graphics/MediaPlayer.h:
3446         (WebCore::MediaPlayerSupportsTypeClient::mediaPlayerNeedsSiteSpecificHacks const): Deleted.
3447         (WebCore::MediaPlayerSupportsTypeClient::mediaPlayerDocumentHost const): Deleted.
3448
3449 2018-01-23  Alex Christensen  <achristensen@webkit.org>
3450
3451         Remove unused QTKit preference
3452         https://bugs.webkit.org/show_bug.cgi?id=181968
3453
3454         Reviewed by Alexey Proskuryakov.
3455
3456         They weren't used and didn't do anything.
3457
3458         * page/DeprecatedGlobalSettings.cpp:
3459         (WebCore::DeprecatedGlobalSettings::setQTKitEnabled): Deleted.
3460         * page/DeprecatedGlobalSettings.h:
3461         (WebCore::DeprecatedGlobalSettings::isQTKitEnabled): Deleted.
3462
3463 2018-01-23  Javier Fernandez  <jfernandez@igalia.com>
3464
3465         [css-align] 'left' and 'right' should parse as invalid in block/cross-axis alignment
3466         https://bugs.webkit.org/show_bug.cgi?id=181792
3467
3468         Reviewed by Antti Koivisto.
3469
3470         The CSS WG resolved to remove the 'left' and 'right' values from the
3471         block/cross axis alignment properties.
3472
3473         https://github.com/w3c/csswg-drafts/issues/1403
3474
3475         This patch changes the CSS parsing logic of all the CSS Box Alignment
3476         properties, both block-axis (align-{self, items, content} and
3477         inline-axis (justify-{self, items, content}).
3478
3479         Additionally, the alignment shorthands (place-{self, items, content})
3480         have been also changed to respect the new syntax.
3481
3482         Despite the number of layout tests changed, I don't think this
3483         change will break any content in current sites. The CSS values
3484         'left' and 'right' were introduced by the new CSS Box Alignment
3485         spec and only implemented by the CSS Grid Layout feature, shipped
3486         last year. Additionally, the removed values have no effect on the
3487         layout result when they are applied to the block/cross-axis CSS
3488         Alignment properties.
3489
3490         Tests: imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-001.html
3491                imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-002.html
3492                imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-003.html
3493                imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-004.html
3494                imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-005.html
3495                imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-001.html
3496                imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-002.html
3497                imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-003.html
3498                imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-004.html
3499                imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-005.html
3500                imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-001.html
3501                imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-002.html
3502                imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-003.html
3503                imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html
3504                imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-005.html
3505                imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-006.html
3506                imported/w3c/web-platform-tests/css/css-align/default-alignment/justify-items-legacy-001.html
3507                imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-001.html
3508                imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-002.html
3509                imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-003.html
3510                imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-004.html
3511                imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-005.html
3512                imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-001.html
3513                imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html
3514                imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-003.html
3515                imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-004.html
3516                imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-005.html
3517                imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-006.html
3518                imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-001.html
3519                imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-002.html
3520                imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-003.html
3521                imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html
3522                imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-005.html
3523                imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-006.html
3524                imported/w3c/web-platform-tests/css/css-align/distribution-values/space-evenly-001.html
3525                imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-001.html
3526                imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-002.html
3527                imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-003.html
3528                imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-004.html
3529                imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-005.html
3530                imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-001.html
3531                imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-002.html
3532                imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-003.html
3533                imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-004.html
3534                imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-005.html
3535                imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-001.html
3536                imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-002.html
3537                imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-003.html
3538                imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-004.html
3539                imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-005.html
3540                imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-006.html
3541
3542         * css/parser/CSSPropertyParser.cpp:
3543         (WebCore::isLeftOrRightKeyword):
3544         (WebCore::isContentPositionKeyword):
3545         (WebCore::isContentPositionOrLeftOrRightKeyword):
3546         (WebCore::consumeContentDistributionOverflowPosition):
3547         (WebCore::isSelfPositionKeyword):
3548         (WebCore::isSelfPositionOrLeftOrRightKeyword):
3549         (WebCore::consumeSelfPositionOverflowPosition):
3550         (WebCore::consumeAlignItems):
3551         (WebCore::consumeJustifyItems):
3552         (WebCore::CSSPropertyParser::parseSingleValue):
3553         (WebCore::consumeSimplifiedContentPosition):
3554         (WebCore::CSSPropertyParser::consumePlaceContentShorthand):
3555         (WebCore::consumeSimplifiedItemPosition):
3556         (WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
3557         (WebCore::CSSPropertyParser::consumePlaceSelfShorthand):
3558
3559 2018-01-23  Simon Fraser  <simon.fraser@apple.com>
3560
3561         Element with position:fixed stops scrolling at the bottom of the page, but is painted in the right place on Chacos.com.
3562         https://bugs.webkit.org/show_bug.cgi?id=181741
3563         rdar://problem/36593581
3564
3565         Reviewed by Tim Horton.
3566
3567         The #ifdef for iOS was wrong; on iOS, visibleSize() is in content coordinates and matches
3568         unscaledDocumentRect, so there's no need to scale it. Doing so computed the wrong unscaledMaximumScrollPosition
3569         which broke hit-testing when the document minimum scale was > 1.
3570
3571         Test: fast/visual-viewport/ios/min-scale-greater-than-one.html
3572
3573         * page/FrameView.cpp:
3574         (WebCore::FrameView::unscaledMaximumScrollPosition const):
3575
3576 2018-01-23  Antoine Quint  <graouts@apple.com>
3577
3578         [Web Animations] Expose getKeyframes() and parsing of remaining keyframe properties
3579         https://bugs.webkit.org/show_bug.cgi?id=181978
3580         <rdar://problem/36772586>
3581
3582         Reviewed by Dean Jackson.
3583
3584         We finish our implementation of multiple keyframes by exposing the getKeyframes() method on KeyframeEffect and
3585         parsing the remaining properties that can be exposed on keyframes: "easing" and "composite". And since we parse
3586         those properties on keyframes, we also parse "easing" on AnimationEffectTiming and "composite" and "iterationComposite"
3587         on KeyframeEffect. 
3588
3589         To support this, we implement a new TimingFunction::createFromCSSText() method which takes in a string that is
3590         a value provided directly via the JS API. As its converse, we expose a TimingFunction::cssText() method which
3591         provides a string that can be sent back to JS to represent a timing function, using keywords when the timing
3592         function matches one and ommitting default values.
3593
3594         We now also keep track of the original "offset" value provided through the JS API since that value is required
3595         when calling getKeyframes() and distinct from the "computedOffset". These original offsets, composite operations
3596         and timing functions are kept as separate Vectors from the KeyframeList since this type does not support exposing
3597         those. We may consider improving that in a future patch.
3598
3599         Finally, we make some adjustments in the keyframe parsing to comply with the specification and correctly parse
3600         all provided timing functions, regardless of the number of keyframes and timing functions provided.
3601
3602         Note that this patch is only about parsing, storing and returning provided easing and composite operations but
3603         that such values will only be used for the resolution of animation effects in future patches.
3604
3605         * animation/AnimationEffect.cpp:
3606         (WebCore::AnimationEffect::getComputedTiming): Set the "easing" property on the getComputedTiming() return value
3607         now that we expose "easing" on AnimationEffectTiming.
3608         * animation/AnimationEffectTiming.cpp:
3609         (WebCore::AnimationEffectTiming::AnimationEffectTiming): Create a linear TimingFunction by default.
3610         (WebCore::AnimationEffectTiming::setEasing): Parse the "easing" value and propagate an exception for invalid values.
3611         * animation/AnimationEffectTiming.h: Expose the new "easing" property and backing TimingFunction.
3612         * animation/AnimationEffectTiming.idl: Expose the new "easing" property.
3613         * animation/KeyframeEffect.cpp:
3614         (WebCore::CSSPropertyIDToIDLAttributeName): Provide a way to convert the name of a CSS property to a string that can
3615         be used to generate a JS property name for use by getKeyframes().
3616         (WebCore::computeMissingKeyframeOffsets): Implement the full steps of the spec.
3617         (WebCore::processIterableKeyframes): Fix a problematic declaration for the easing variable.
3618         (WebCore::processPropertyIndexedKeyframes): Now that ProcessedKeyframe has both an offset and a computedOffset, use
3619         computed offsets. We also fix a couple of loops to fix compliance issues revealed by WPT tests.
3620         (WebCore::KeyframeEffect::create): Parse the provided "easing" property on the KeyframeEffectOptions object.
3621         (WebCore::KeyframeEffect::getKeyframes): Implement the getKeyframes() method as mandated by the spec.
3622         (WebCore::KeyframeEffect::processKeyframes): Keep a list of unused easings so these might be parsed as well, and
3623         potentially throw exceptions, as mandated by the spec. For valid easings, store their matching TimingFunction in
3624         m_timingFunctions, original offset values in m_offsets and CompositeOperation values in m_compositeOperations.
3625         * animation/KeyframeEffect.h: Switch the order in which we specify some of the Variant types so that default values
3626         are correctly used.
3627         * animation/KeyframeEffect.idl: Switch the order in which we specify some of the Variant types so that default values
3628         are correctly used.
3629         * platform/animation/TimingFunction.cpp:
3630         (WebCore::TimingFunction::createFromCSSText):
3631         (WebCore::TimingFunction::cssText const):
3632         * platform/animation/TimingFunction.h:
3633
3634 2018-01-23  Brady Eidson  <beidson@apple.com>
3635
3636         Allow passing MessagePorts across processes (e.g. ServiceWorkers).
3637         https://bugs.webkit.org/show_bug.cgi?id=181178
3638
3639         Reviewed by Andy Estes.
3640
3641         Test: http/tests/workers/service/basic-messageport.html
3642
3643         * dom/MessagePort.cpp:
3644         (WebCore::MessagePort::MessagePort):
3645         (WebCore::MessagePort::~MessagePort):
3646
3647         * dom/messageports/MessagePortChannel.cpp:
3648         (WebCore::MessagePortChannel::entanglePortWithProcess):
3649         * dom/messageports/MessagePortChannel.h:
3650
3651         * workers/service/SWClientConnection.cpp:
3652         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
3653         * workers/service/SWClientConnection.h:
3654
3655         * workers/service/ServiceWorker.cpp:
3656         (WebCore::ServiceWorker::postMessage):
3657
3658         * workers/service/ServiceWorkerClient.cpp:
3659         (WebCore::ServiceWorkerClient::postMessage):
3660
3661         * workers/service/context/SWContextManager.cpp:
3662         (WebCore::SWContextManager::postMessageToServiceWorker):
3663         * workers/service/context/SWContextManager.h:
3664
3665 2018-01-23  Commit Queue  <commit-queue@webkit.org>
3666
3667         Unreviewed, rolling out r227279 and r227373.
3668         https://bugs.webkit.org/show_bug.cgi?id=181988
3669
3670         The LayoutTest crash fix introduced an API test failure.
3671         (Requested by ryanhaddad on #webkit).
3672
3673         Reverted changesets:
3674
3675         "Resign NowPlaying status when no media element is eligible"
3676         https://bugs.webkit.org/show_bug.cgi?id=181914
3677         https://trac.webkit.org/changeset/227279
3678
3679         "Resign NowPlaying status when no media element is eligible"
3680         https://bugs.webkit.org/show_bug.cgi?id=181914
3681         https://trac.webkit.org/changeset/227373
3682
3683 2018-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3684
3685         Unreviewed, fix some format specifiers added in r227190
3686         https://bugs.webkit.org/show_bug.cgi?id=181454
3687
3688         * dom/messageports/MessagePortChannel.cpp:
3689         (WebCore::MessagePortChannel::takeAllMessagesForPort):
3690
3691 2018-01-23  Ting-Wei Lan  <lantw44@gmail.com>
3692
3693         [GTK] Add user agent quirk for Microsoft Outlook Web App
3694         https://bugs.webkit.org/show_bug.cgi?id=181982
3695
3696         Reviewed by Michael Catanzaro.
3697
3698         Microsoft Outlook Web App forces users to switch to the lite version on
3699         the login page with our standard user agent on all non-macOS systems.
3700         Since it is an application that can be installed by different companies,
3701         schools and organizations, it is not possible to fix the issue unless
3702         we keep a big list of host names that are known to run it. We check the
3703         host name instead of the base domain name here because it is not
3704         expected to run all sites under a base domain on this webmail and
3705         calendar application.
3706
3707         https://mail.ntu.edu.tw is a site that is known to run Microsoft Outlook
3708         Web App for several years, and it is not likely to change. When there
3709         are other sites found to run it and having the same user agent problem,
3710         we can expand the list to include them.
3711
3712         * platform/UserAgentQuirks.cpp:
3713         (WebCore::urlRequiresMacintoshPlatform):
3714
3715 2018-01-23  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3716
3717         [EME] Add support of multi keys from different sessions in CDMinstanceClearKey
3718         https://bugs.webkit.org/show_bug.cgi?id=180083
3719
3720         Reviewed by Xabier Rodriguez-Calvar.
3721
3722         Add support of multi keys from different MediaKeySession in CDMInstanceClearKey.
3723
3724         Currently the CDMInstanceClearKey manages two "m_keys", one is a WTF::Vector
3725         where it stores the list of last added keys, an other which is defined in the
3726         ClearKeyState::singleton it is a WTF::HashMap, in this last one, it stores the
3727         keys lists of each created session.
3728
3729         The method "keys()" of CDMInstanceClearKey returns the first "m_keys" which
3730         contains just the list of last keys.
3731
3732         The goal of this commit is to return all keys lists of all sessions, thus
3733         we remove the "m_keys" which is WTF::Vector and we modify the method
3734         "keys()" to return all keys lists, which is stored in "m_keys" WTF::HashMap,
3735         in one Vector instead of return just the list of last keys.
3736
3737         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3738         (WebCore::CDMInstanceClearKey::keys const):
3739         (WebCore::CDMInstanceClearKey::updateLicense):
3740         * platform/encryptedmedia/clearkey/CDMClearKey.h:
3741
3742 2018-01-22  Simon Fraser  <simon.fraser@apple.com>
3743
3744         Optimize building the non-fast scrollable region with multiple iframes
3745         https://bugs.webkit.org/show_bug.cgi?id=181971
3746
3747         Reviewed by Zalan Bujtas.
3748
3749         AsyncScrollingCoordinator::frameViewLayoutUpdated() is called every time a subframe lays out.
3750         We don't need to eagerly update the non-fast scrollable region at this time; we can just mark
3751         it dirty, and rely on the existing scrolling tree commit code to recompute it.
3752
3753         On my machine this makes fast/frames/lots-of-objects.html no longer a timeout.
3754
3755         * page/scrolling/AsyncScrollingCoordinator.cpp:
3756         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3757
3758 2018-01-22  Jiewen Tan  <jiewen_tan@apple.com>
3759
3760         [WebAuthN] Implement PublicKeyCredential's [[Create]] with a dummy authenticator
3761         https://bugs.webkit.org/show_bug.cgi?id=181928
3762         <rdar://problem/36459893>
3763
3764         Reviewed by Brent Fulgham.
3765
3766         This patch implements PublicKeyCredential's [[Create]] from https://www.w3.org/TR/webauthn/#createCredential
3767         as of 5 December 2017. In order to do testing, a dummy authenticator is implemented to exercise a failure
3768         and a pass path. A number of dependencies need to be resolved later in order to comply with the spec.
3769         Also, the current architecture of handling async WebAuthN operations including dispatching, timeout, and aborting
3770         might need a redesign once the underlying authenticator is clear. Since this is our first attempt to implement
3771         a prototype, all those limitations, in my opinion, can be marked as non-blocking to accelerate the whole
3772         process. Those limitations will then be addressed once the first prototype is finshed.
3773
3774         Tests: http/tests/webauthn/public-key-credential-create-with-invalid-parameters.https.html
3775                http/tests/webauthn/public-key-credential-same-origin-with-ancestors-2.https.html
3776                http/tests/webauthn/public-key-credential-same-origin-with-ancestors.https.html
3777                http/wpt/webauthn/idl.https.html
3778                http/wpt/webauthn/public-key-credential-create-failure.https.html
3779                http/wpt/webauthn/public-key-credential-create-success.https.html
3780
3781         * Modules/credentialmanagement/BasicCredential.h:
3782         * Modules/credentialmanagement/BasicCredential.idl:
3783         * Modules/credentialmanagement/CredentialsContainer.cpp:
3784         (WebCore::CredentialsContainer::PendingPromise::PendingPromise):
3785         (WebCore::CredentialsContainer::dispatchTask):
3786         (WebCore::CredentialsContainer::get):
3787         (WebCore::CredentialsContainer::isCreate):
3788         (WebCore::CredentialsContainer::preventSilentAccess const):
3789         (WebCore::CredentialsContainer::preventSilentAccess): Deleted.
3790         * Modules/credentialmanagement/CredentialsContainer.h:
3791         (WebCore::CredentialsContainer::PendingPromise::create):
3792         * Modules/webauthn/Authenticator.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.cpp.
3793         (WebCore::Authenticator::singleton):
3794         (WebCore::Authenticator::makeCredential const):
3795         * Modules/webauthn/Authenticator.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h.
3796         * Modules/webauthn/AuthenticatorAssertionResponse.cpp:
3797         (WebCore::AuthenticatorAssertionResponse::authenticatorData const):
3798         (WebCore::AuthenticatorAssertionResponse::signature const):
3799         (WebCore::AuthenticatorAssertionResponse::userHandle const):
3800         (WebCore::AuthenticatorAssertionResponse::~AuthenticatorAssertionResponse): Deleted.
3801         (WebCore::AuthenticatorAssertionResponse::authenticatorData): Deleted.
3802         (WebCore::AuthenticatorAssertionResponse::signature): Deleted.
3803         (WebCore::AuthenticatorAssertionResponse::userHandle): Deleted.
3804         * Modules/webauthn/AuthenticatorAssertionResponse.h:
3805         (WebCore::AuthenticatorAssertionResponse::create):
3806         * Modules/webauthn/AuthenticatorAttestationResponse.cpp:
3807         (WebCore::AuthenticatorAttestationResponse::attestationObject const):
3808         (WebCore::AuthenticatorAttestationResponse::~AuthenticatorAttestationResponse): Deleted.
3809         (WebCore::AuthenticatorAttestationResponse::attestationObject): Deleted.
3810         * Modules/webauthn/AuthenticatorAttestationResponse.h:
3811         (WebCore::AuthenticatorAttestationResponse::create):
3812         * Modules/webauthn/AuthenticatorResponse.cpp:
3813         (WebCore::AuthenticatorResponse::clientDataJSON const):
3814         (WebCore::AuthenticatorResponse::~AuthenticatorResponse): Deleted.
3815         (WebCore::AuthenticatorResponse::clientDataJSON): Deleted.
3816         * Modules/webauthn/AuthenticatorResponse.h:
3817         * Modules/webauthn/AuthenticatorResponse.idl:
3818         * Modules/webauthn/PublicKeyCredential.cpp:
3819         (WebCore::PublicKeyCredentialInternal::produceClientDataJson):
3820         (WebCore::PublicKeyCredentialInternal::produceClientDataJsonHash):
3821         (WebCore::PublicKeyCredentialInternal::getIdFromAttestationObject):
3822         (WebCore::PublicKeyCredential::PublicKeyCredential):
3823         (WebCore::PublicKeyCredential::discoverFromExternalSource):
3824         (WebCore::PublicKeyCredential::create):
3825         (WebCore::PublicKeyCredential::rawId const):
3826         (WebCore::PublicKeyCredential::response const):
3827         (WebCore::PublicKeyCredential::getClientExtensionResults const):
3828         (WebCore::PublicKeyCredential::rawId): Deleted.
3829         (WebCore::PublicKeyCredential::response): Deleted.
3830         (WebCore::PublicKeyCredential::getClientExtensionResults): Deleted.
3831         * Modules/webauthn/PublicKeyCredential.h:
3832         * Modules/webauthn/PublicKeyCredential.idl:
3833         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
3834         (): Deleted.
3835         * Modules/webauthn/PublicKeyCredentialDescriptor.h:
3836         * Modules/webauthn/PublicKeyCredentialDescriptor.idl:
3837         * Sources.txt:
3838         * WebCore.xcodeproj/project.pbxproj:
3839         * bindings/js/JSAuthenticatorResponseCustom.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorAttestationResponse.cpp.
3840         (WebCore::toJSNewlyCreated):
3841         (WebCore::toJS):
3842         * bindings/js/JSBasicCredentialCustom.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.cpp.
3843         (WebCore::toJSNewlyCreated):
3844         (WebCore::toJS):
3845         * bindings/js/JSBindingsAllInOne.cpp:
3846
3847 2018-01-22  Myles C. Maxfield  <mmaxfield@apple.com>
3848
3849         [Cocoa] Support font collections
3850         https://bugs.webkit.org/show_bug.cgi?id=181826
3851         <rdar://problem/36455137>
3852
3853         Reviewed by Dean Jackson.
3854
3855         Use the CoreText call CTFontManagerCreateFontDescriptorsFromData() to get all the descriptors inside
3856         the collection file. We select which one by using the fragment identifier at the end of the url linking
3857         to the remote font. For example, to select the 4th font inside a TTC file, the @font-face block would
3858         look like:
3859
3860         @font-face {
3861             font-family: "MyFont";
3862             src: url("path/to/font.ttc#4");
3863         }
3864
3865         Note that these numbers are 1-indexed.
3866
3867         The CSS Fonts spec states:
3868         > Fragment identifiers are used to indicate which font to load. If a container format lacks a defined
3869         > fragment identifier scheme, implementations should use a simple 1-based indexing scheme (e.g.
3870         > "font-collection#1" for the first font, "font-collection#2" for the second font).
3871
3872         Not only are TTC font collections supported, but WOFF2 font collections are also supported, which is
3873         increasingly important web standard.
3874
3875         No new tests because I don't have a font collection file with the appropriate license for the
3876         WebKit repository. I tested manually.
3877
3878         * css/CSSFontFaceSource.cpp:
3879         (WebCore::CSSFontFaceSource::load):
3880         * loader/cache/CachedFont.cpp:
3881         (WebCore::CachedFont::calculateIndex const):
3882         (WebCore::CachedFont::ensureCustomFontData):
3883         (WebCore::CachedFont::createCustomFontData):
3884         * loader/cache/CachedFont.h:
3885         * platform/graphics/cairo/FontCustomPlatformData.h:
3886         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
3887         (WebCore::createFontCustomPlatformData):
3888         * platform/graphics/mac/FontCustomPlatformData.cpp:
3889         (WebCore::createFontCustomPlatformData):
3890         * platform/graphics/mac/FontCustomPlatformData.h:
3891         * platform/graphics/win/FontCustomPlatformData.cpp:
3892         (WebCore::createFontCustomPlatformData):
3893         * platform/graphics/win/FontCustomPlatformData.h:
3894         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
3895         (WebCore::createFontCustomPlatformData):
3896
3897 2018-01-22  Simon Fraser  <simon.fraser@apple.com>
3898
3899         REGRESSION (r227011): fast/frames/hidpi-position-iframe-on-device-pixel.html times out
3900         https://bugs.webkit.org/show_bug.cgi?id=181959
3901
3902         Reviewed by Zalan Bujtas.
3903
3904         This test creates 300 iframes, which became slow after r227011 because they all became part
3905         of the non-fast scrollable region, slowing down ScrollingCoordinator::absoluteEventTrackingRegionsForFrame().
3906
3907         Fix by not adding non-scrollable iframes, and making FrameView::isScrollable() more efficient for frames
3908         that have not done layout yet.
3909
3910         * page/FrameView.cpp:
3911         (WebCore::FrameView::isScrollable):
3912         (WebCore::FrameView::addChild):
3913
3914 2018-01-22  Dan Bernstein  <mitz@apple.com>
3915
3916         Fixed building for macOS 10.12 with the macOS 10.13 SDK after r227156.
3917
3918         * Configurations/WebCore.xcconfig:
3919
3920 2018-01-22  Simon Fraser  <simon.fraser@apple.com>
3921
3922         REGRESSION (r226981): ASSERTION FAILED: startY >= 0 && endY <= height && startY < endY in WebCore::FEMorphology::platformApplyGeneric
3923         https://bugs.webkit.org/show_bug.cgi?id=181836
3924
3925         Reviewed by Tim Horton.
3926         
3927         All the filters that use ParallelJobs<> has the same type of bug where very wide but not tall
3928         filter regions could result in computing an optimalThreadNumber that was greater than the
3929         number of rows to process, which resulted in jobs with zero rows to process.
3930
3931         Since we split the work by rows, cap the maximum number of threads to height/8 so that each job
3932         has at least 8 rows of pixels to process. Add some assertions to detect jobs with zero rows.
3933
3934         FEMorphology was also using implicit float -> int conversion to detect integer overflow of radius,
3935         so change that to use explicit clamping.
3936         
3937         Tests: svg/filters/feLighting-parallel-jobs.svg
3938                svg/filters/feTurbulence-parallel-jobs-wide.svg
3939
3940         * platform/graphics/filters/FELighting.cpp:
3941         (WebCore::FELighting::platformApplyGenericPaint):
3942         (WebCore::FELighting::platformApplyGeneric):
3943         * platform/graphics/filters/FEMorphology.cpp:
3944         (WebCore::FEMorphology::platformApplyGeneric):
3945         (WebCore::FEMorphology::platformApply):
3946         (WebCore::FEMorphology::platformApplyDegenerate):
3947         (WebCore::FEMorphology::platformApplySoftware):
3948         * platform/graphics/filters/FETurbulence.cpp:
3949         (WebCore::FETurbulence::fillRegion const):
3950         (WebCore::FETurbulence::platformApplySoftware):
3951
3952 2018-01-22  Eric Carlson  <eric.carlson@apple.com>
3953
3954         Resign NowPlaying status when no media element is eligible
3955         https://bugs.webkit.org/show_bug.cgi?id=181914
3956         <rdar://problem/35294116>
3957
3958         Reviewed by Jer Noble.
3959
3960         No new tests, these changes prevent existing tests from crashing.
3961
3962         * html/HTMLMediaElement.h:
3963         * html/MediaElementSession.cpp:
3964         (WebCore::MediaElementSession::playbackPermitted const): Return early when the media 
3965         element has been suspended.
3966         (WebCore::MediaElementSession::canShowControlsManager const): Return false when the
3967         media element has been suspended.
3968         (WebCore::isMainContentForPurposesOfAutoplay): Return early if it isn't safe to update
3969         style because HitTest can force a layout.
3970         (WebCore::MediaElementSession::updateIsMainContent const): Ditto.
3971
3972 2018-01-22  Alex Christensen  <achristensen@webkit.org>
3973
3974         Begin removing QTKit code
3975         https://bugs.webkit.org/show_bug.cgi?id=181951