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