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