Expose more semantic system colors.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-06-14  Timothy Hatcher  <timothy@apple.com>
2
3         Expose more semantic system colors.
4
5         https://bugs.webkit.org/show_bug.cgi?id=186609
6         rdar://problem/39287277
7
8         Reviewed by Tim Horton.
9
10         Add the following semantic colors:
11          -apple-system-control-accent
12          -apple-system-even-alternating-content-background
13          -apple-system-odd-alternating-content-background
14          -apple-system-selected-content-background
15          -apple-system-unemphasized-selected-content-background
16          -apple-system-selected-text
17          -apple-system-unemphasized-selected-text
18          -apple-system-selected-text-background
19          -apple-system-unemphasized-selected-text-background
20          -apple-system-placeholder-text
21          -apple-system-find-highlight-background
22          -apple-system-separator
23
24         * css/CSSValueKeywords.in:
25         * rendering/RenderThemeMac.mm:
26         (WebCore::RenderThemeMac::systemColor const):
27
28 2018-06-14  Eric Carlson  <eric.carlson@apple.com>
29
30         [iOS] WebAVPlayerController isPlayingOnSecondScreen should be declared read-write
31         https://bugs.webkit.org/show_bug.cgi?id=186621
32         <rdar://problem/40243303>
33
34         Reviewed by Jer Noble.
35
36         * platform/ios/WebAVPlayerController.h:
37
38 2018-06-13  Zalan Bujtas  <zalan@apple.com>
39
40         [LFC] Miscellaneous fixes to be able to layout <div> with fixed width/height
41         https://bugs.webkit.org/show_bug.cgi?id=186616
42
43         Reviewed by Antti Koivisto.
44
45         1. Move box horizontally/vertically when relevant margin is computed.
46         2. Fix isStretchedToViewport() logic and make sure that the width/height is adjusted with the margin when the box is stretchy.
47         3. Fix isPaddingApplicable() and add "GenericElement" for elements that don't need special handling.
48
49         With this patch LFC produces the correct geometry for the following content:
50         <html><body><div style="width: 100px; height: 100px;"></div></body></html>
51
52         * layout/FormattingContext.cpp:
53         (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
54         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
55         * layout/blockformatting/BlockFormattingContext.cpp:
56         (WebCore::Layout::BlockFormattingContext::layout const):
57         (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
58         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
59         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
60         (WebCore::Layout::isStretchedToViewport):
61         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
62         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
63         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
64         * layout/displaytree/DisplayBox.h:
65         (WebCore::Display::Box::moveHorizontally):
66         (WebCore::Display::Box::moveVertically):
67         (WebCore::Display::Box::Rect::setWidth):
68         (WebCore::Display::Box::Rect::setHeight):
69         (WebCore::Display::Box::Rect::moveHorizontally):
70         (WebCore::Display::Box::Rect::moveVertically):
71         * layout/layouttree/LayoutBox.cpp:
72         (WebCore::Layout::Box::isPaddingApplicable const):
73         * layout/layouttree/LayoutBox.h:
74         * layout/layouttree/LayoutTreeBuilder.cpp:
75         (WebCore::Layout::TreeBuilder::createSubTree):
76
77 2018-06-13  Chris Dumez  <cdumez@apple.com>
78
79         Crash under SWServer::unregisterConnection(Connection&)
80         https://bugs.webkit.org/show_bug.cgi?id=186584
81         <rdar://problem/40931680>
82
83         Reviewed by Youenn Fablet.
84
85         The crash was due to SWServer::Connection objects outliving their SWServer, even
86         though SWServer::Connection::m_server is a C++ reference. This was possible because
87         SWServer does not own the connections, StorageToWebProcessConnection does. This
88         started crashing recently, after r232423, because SWServer can get destroyed now.
89         The SWServer might get destroyed before the StorageToWebProcessConnection, in which
90         case the SWServer::Connection objects will get destroyed later. We were crashing
91         because the SWServer::Connection destructor tries to unregister the connection from
92         the SWServer (which is dead).
93
94         To address the issue, the SWServer now owns the connections. StorageToWebProcessConnection
95         merely has weak pointers to the connections.
96
97         * workers/service/server/SWServer.cpp:
98         (WebCore::SWServer::Connection::Connection):
99         (WebCore::SWServer::addConnection):
100         (WebCore::SWServer::removeConnection):
101         (WebCore::SWServer::resolveRegistrationReadyRequests):
102         * workers/service/server/SWServer.h:
103         (WebCore::SWServer::Connection::~Connection):
104         (WebCore::SWServer::Connection::server):
105         (WebCore::SWServer::connection):
106         * workers/service/server/SWServerRegistration.cpp:
107         (WebCore::SWServerRegistration::forEachConnection):
108         (WebCore::SWServerRegistration::notifyClientsOfControllerChange):
109         (WebCore::SWServerRegistration::controlClient):
110
111 2018-06-13  Zalan Bujtas  <zalan@apple.com>
112
113         [Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units
114         https://bugs.webkit.org/show_bug.cgi?id=186585
115         <rdar://problem/30685325>
116
117         Reviewed by Tim Horton.
118
119         Use the existing "override viewport size for viewport units" mechanism to compute the preferred
120         viewport unit values for the Mail Viewer html content. 
121
122         Test: fast/dynamic/mail-autosize-viewport-unit.html
123
124         * page/FrameView.cpp:
125         (WebCore::FrameView::FrameView):
126         (WebCore::FrameView::enableAutoSizeMode):
127         (WebCore::FrameView::clearViewportSizeOverrideForCSSViewportUnits):
128         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
129         (WebCore::FrameView::overrideViewportSizeForCSSViewportUnits):
130         (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
131         * page/FrameView.h:
132
133 2018-06-13  Dean Jackson  <dino@apple.com>
134
135         Disable AR support in WKWebView clients
136         https://bugs.webkit.org/show_bug.cgi?id=186611
137         <rdar://problem/39544684>
138
139         Reviewed by Jon Lee.
140
141         Since it hasn't been adequately tested, System Preview (AR) should
142         be disabled by default for WKWebViews.
143
144         Add a new RuntimeEnabledFeature to control this, and guard for
145         this case everywhere we use system previews.
146
147         * html/HTMLAnchorElement.cpp:
148         (WebCore::HTMLAnchorElement::isSystemPreviewLink const):
149         (WebCore::HTMLAnchorElement::handleClick):
150         * html/HTMLImageElement.cpp:
151         (WebCore::HTMLImageElement::isSystemPreviewImage const):
152         * html/HTMLPictureElement.cpp:
153         (WebCore::HTMLPictureElement::isSystemPreviewImage const):
154         * page/RuntimeEnabledFeatures.h:
155         (WebCore::RuntimeEnabledFeatures::setSystemPreviewEnabled):
156         (WebCore::RuntimeEnabledFeatures::systemPreviewEnabled const):
157         * rendering/RenderImage.cpp:
158         (WebCore::RenderImage::paintIntoRect):
159
160 2018-06-13  Youenn Fablet  <youenn@apple.com>
161
162         Supported plugin check should be based on plugin identifier
163         https://bugs.webkit.org/show_bug.cgi?id=186578
164         <rdar://problem/40523828>
165
166         Reviewed by Darin Adler.
167
168         Rename SupportedPluginName in SupportedPluginIdentifier.
169         Add cross-platform support for plug-in identifier.
170
171         Update built-in PDF plug-in to check its identifier instead of its name.
172         This is stronger as the name may change according localization.
173
174         * loader/EmptyClients.cpp:
175         * plugins/PluginData.cpp:
176         (WebCore::isBuiltInPDFPlugIn):
177         (WebCore::PluginData::initPlugins):
178         * plugins/PluginData.h:
179         (WebCore::operator==):
180         (WebCore::isSupportedPlugin):
181         (WebCore::SupportedPluginIdentifier::decode):
182         (WebCore::SupportedPluginIdentifier::encode const):
183         (WebCore::SupportedPluginName::decode): Deleted.
184         (WebCore::SupportedPluginName::encode const): Deleted.
185         * plugins/PluginInfoProvider.h:
186
187 2018-06-13  Chris Dumez  <cdumez@apple.com>
188
189         PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled
190         https://bugs.webkit.org/show_bug.cgi?id=186545
191
192         Reviewed by Brady Eidson.
193
194         Move frame navigation logging for ITP purposes from the WebProcess to the UIProcess.
195         This information was previously logged in DocumentLoader::willSendRequest() and was getting
196         sync'd to the UIProcess at regular intervals or when the layout tests call testRunner's
197         statisticsNotifyObserver(). We now do the logging directly in the UIProcess, in
198         WebPageProxy::decidePolicyForNavigationAction (which was getting called via IPC from
199         DocumentLoader::willSendRequest()).
200
201         This is more efficient and will also be needed soon due to the way process swap on navigation
202         deals with cross-origin redirects. On cross-origin redirect of the main frame, PSON cancels
203         the load and started a new load to the redirected to URL in the new WebProcess. As a result,
204         the new WebProcess is not aware that the load is a redirect, which is information that ITP
205         requires. By moving the ITP logging to the UIProcess, we still have access to this
206         information. 
207
208         * loader/DocumentLoader.cpp:
209         (WebCore::DocumentLoader::willSendRequest):
210         Stop logging the navigation now that it is logged in the UIProcess.
211
212         * loader/EmptyClients.cpp:
213         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
214         * loader/EmptyFrameLoaderClient.h:
215         * loader/FrameLoader.cpp:
216         (WebCore::FrameLoader::loadURL):
217         (WebCore::FrameLoader::loadWithDocumentLoader):
218         * loader/FrameLoaderClient.h:
219         * loader/PolicyChecker.cpp:
220         (WebCore::PolicyChecker::checkNavigationPolicy):
221         * loader/PolicyChecker.h:
222         We now pass the full redirect request to the decidePolicyForNavigationAction
223         delegate instead of a simple isRedirect boolean, so that we have the redirect
224         response URL in the UIProcess for ITP logging.
225
226         * loader/ResourceLoadObserver.cpp:
227         (WebCore::areDomainsAssociated):
228         (WebCore::ResourceLoadObserver::logSubresourceLoading):
229         (WebCore::ResourceLoadObserver::logWebSocketLoading):
230         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
231         * loader/ResourceLoadObserver.h:
232         * loader/ResourceLoadStatistics.cpp:
233         (WebCore::ResourceLoadStatistics::areDomainsAssociated):
234         (WebCore::ResourceLoadStatistics::reduceTimeResolution):
235         * loader/ResourceLoadStatistics.h:
236         - Remove ResourceLoadObserver::logFrameNavigation() now that it is on the WebResourceLoadStatisticsStore.
237         - Move some code from ResourceLoadObserver to ResourceLoadStatistics so that it can
238           be called from the UIProcess and to avoid code duplication.
239
240 2018-06-13  Mark Lam  <mark.lam@apple.com>
241
242         FloatingPointEnvironment is only needed for ARM CPUs.
243         https://bugs.webkit.org/show_bug.cgi?id=186567
244         <rdar://problem/40929441>
245
246         Reviewed by Michael Saboff.
247
248         No new tests.  This behavior is already covered by existing tests.
249
250         * platform/ios/wak/FloatingPointEnvironment.cpp:
251         * platform/ios/wak/FloatingPointEnvironment.h:
252         (WebCore::FloatingPointEnvironment::enableDenormalSupport):
253         (WebCore::FloatingPointEnvironment::saveMainThreadEnvironment):
254         (WebCore::FloatingPointEnvironment::propagateMainThreadEnvironment):
255         (WebCore::FloatingPointEnvironment::singleton):
256
257 2018-06-13  Timothy Hatcher  <timothy@apple.com>
258
259         Input form controls have a white background in dark mode, when they should not.
260
261         https://bugs.webkit.org/show_bug.cgi?id=186577
262         rdar://problem/39258325
263
264         Reviewed by Tim Horton.
265
266         * DerivedSources.make: Allow WTF_PLATFORM_MAC ifdefs to preprocess in html.css.
267         * css/CSSValueKeywords.in: Added -apple-system-control-background.
268         * css/MediaQueryExpression.cpp:
269         (WebCore::featureWithValidIdent): Allow dark mode media query in user agent stylesheets.
270         (WebCore::isFeatureValidWithoutValue): Ditto.
271         * css/MediaQueryParserContext.cpp:
272         (WebCore::MediaQueryParserContext::MediaQueryParserContext): Transfer the CSSParserMode from CSSParserContext.
273         * css/MediaQueryParserContext.h:
274         * css/html.css: Set color and background-color to semantic colors for input, textarea, and select.
275         Make input background-color transparent in dark mode to match AppKit.
276         * rendering/RenderThemeMac.mm:
277         (WebCore::RenderThemeMac::systemColor const): Added -apple-system-control-background.
278         (WebCore::RenderThemeMac::paintTextField): Adjust the drawing rect to match new artwork in macOS 10.14.
279
280 2018-06-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
281
282         TileFirstPaint strategy for async image decoding should be disabled for non root RenderLayers
283         https://bugs.webkit.org/show_bug.cgi?id=186336
284         <rdar://problem/40808099>
285
286         Reviewed by Simon Fraser.
287
288         When showing a composited RenderLayer for the first time, the images in 
289         this layer have to be decoded synchronously to avoid unwanted flashing.
290
291         To create a layout test for this patch, FrameDecodingDurationForTesting
292         needs to be generalized for large and animated images. The decoding thread
293         now forces the decoding time to be at least equal to 
294         FrameDecodingDurationForTesting.
295
296         Test: fast/images/async-image-composited-show.html
297
298         * platform/graphics/BitmapImage.cpp:
299         (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages const):
300         (WebCore::BitmapImage::internalStartAnimation):
301         (WebCore::BitmapImage::advanceAnimation):
302         * platform/graphics/BitmapImage.h:
303         * platform/graphics/ImageSource.cpp:
304         (WebCore::ImageSource::startAsyncDecodingQueue):
305         * platform/graphics/ImageSource.h:
306         (WebCore::ImageSource::setFrameDecodingDurationForTesting):
307         (WebCore::ImageSource::frameDecodingDurationForTesting const):
308         * rendering/RenderLayer.cpp:
309         (WebCore::RenderLayer::paintLayerContents):
310
311 2018-06-13  Wenson Hsieh  <wenson_hsieh@apple.com>
312
313         CSS "background-color" style no longer affects natively rendered text fields
314         https://bugs.webkit.org/show_bug.cgi?id=186597
315         <rdar://problem/41050528>
316
317         Reviewed by Tim Horton.
318
319         AppKit currently does not support rendering background color to the edges of a text field cell. This means that
320         in WebCore, when natively rendering text inputs with background color, we need to only draw the bezels of a text
321         field, such that the background color we paint behind the text field will be shown. Currently, the way we
322         accomplish this is by intercepting an internal NSTextField method that computes drawing options for CoreUI, and
323         inserting a `"borders only" => true` entry.
324
325         However, in a recent build of macOS Mojave, AppKit tweaked -_coreUIDrawOptionsWithFrame:inView:includeFocus: to
326         add an extra argument (such that it's now -_coreUIDrawOptionsWithFrame:inView:includeFocus:maskOnly:), which
327         negates the above workaround. To fix this in the short term, augment the workaround to apply to the latest macOS
328         Mojave as well. A longer-term fix is already tracked in <rdar://problem/11385461>, which would allow WebKit to
329         simply specify a background color on the text field cell, and have AppKit render it properly to the edges of the
330         bezels.
331
332         Covered by a test that is currently failing on Mojave: fast/forms/hidpi-textfield-background-bleeding.html
333
334         * rendering/RenderThemeMac.mm:
335         (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
336         (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
337         (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:maskOnly:]):
338
339 2018-06-13  Thibault Saunier  <tsaunier@igalia.com>
340
341         [WPE] Build getUserMedia support
342         https://bugs.webkit.org/show_bug.cgi?id=186547
343
344         Reviewed by Alejandro G. Castro.
345
346         Enable mediastream tests.
347
348         * PlatformWPE.cmake: Build MediaStream support.
349         * SourcesGTK.txt: Moved GStreamer related files to GStreamer.cmake.
350         * SourcesWPE.txt: Removed `platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp`
351         which is now in GStreamer.cmake.
352         * platform/GStreamer.cmake: Build more MediaStream/webrtc related files.
353         * platform/graphics/ImageBuffer.cpp: Handle the fact that toBGRAData is
354         now built directly into the Cairo backend and not GTK anymore.
355         * platform/graphics/cairo/ImageBufferCairo.cpp: Implement `toBGRAData`
356         * platform/graphics/gtk/ImageBufferGtk.cpp: Removed `toBGRAData` as it is
357         now implemented in the Cairo backend itself.
358         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Switch an
359         ASSERT to RELEASE_ASSERT when adding the GhostPad to itself. This was making
360         test fail when built in RELEASE mode.
361         (WebCore::webkitMediaStreamSrcChain): Minor variable name change to make it
362         more accurate.
363         (WebCore::webkitMediaStreamSrcAddPad): Now add the ghost pad to the element
364         before setting its chain function, making things clearer.
365         (WebCore::webkitMediaStreamSrcSetupSrc): Remove extra new line.
366
367 2018-06-13  Philippe Normand  <pnormand@igalia.com>
368
369         [GStreamer] fast/canvas/webgl crashes
370         https://bugs.webkit.org/show_bug.cgi?id=186590
371
372         Reviewed by Carlos Alberto Lopez Perez.
373
374         After r232747 the sample managed by the player can be empty,
375         without buffer. So we need to check for this before mapping video
376         frames. Also use the GstVideoFrameHolder in more places to reduce
377         copy-paste churn.
378
379         * platform/graphics/gstreamer/ImageGStreamer.h:
380         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
381         (ImageGStreamer::ImageGStreamer):
382         (ImageGStreamer::~ImageGStreamer):
383         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
384         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
385         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
386         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
387
388 2018-06-13  Philippe Normand  <pnormand@igalia.com>
389
390         Unreviewed GTK build fix for --cmakeargs=-DUSE_GSTREAMER_GL=OFF
391
392         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
393         (WebCore::MediaPlayerPrivateGStreamer::load):
394         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
395         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
396
397 2018-06-12  Philippe Normand  <pnormand@igalia.com>
398
399         [GStreamer] Video freezes when GStreamerGL is not installed
400         https://bugs.webkit.org/show_bug.cgi?id=184925
401
402         Reviewed by Žan Doberšek.
403
404         At runtime when the GStreamer opengl plugin isn't available the
405         player will fallback to the internal WebKit video sink. The
406         VideoFrameHolder was refactored to handle both cases (opengl,
407         non-opengl).
408
409         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
410         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
411         (WebCore::GstVideoFrameHolder::~GstVideoFrameHolder):
412         (WebCore::GstVideoFrameHolder::frame const):
413         (WebCore::GstVideoFrameHolder::updateTexture):
414         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
415         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
416         (WebCore::GstVideoFrameHolder::isValid const): Deleted.
417         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Deleted.
418         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
419
420 2018-06-12  Zalan Bujtas  <zalan@apple.com>
421
422         Complex text handling should opt out of bounded text layout.
423         https://bugs.webkit.org/show_bug.cgi?id=186571
424         <rdar://problem/41060908>
425
426         Reviewed by Tim Horton.
427
428         Test: fast/text/complex-long-text-crash.html
429
430         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
431         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
432
433 2018-06-12  Ryan Haddad  <ryanhaddad@apple.com>
434
435         Unreviewed, rolling out r232774.
436
437         Breaks internal builds.
438
439         Reverted changeset:
440
441         "Complex text handling should opt out of bounded text layout."
442         https://bugs.webkit.org/show_bug.cgi?id=186571
443         https://trac.webkit.org/changeset/232774
444
445 2018-06-12  Ryosuke Niwa  <rniwa@webkit.org>
446
447         iOS WK1: Occasional crash in FrameView::setScrollPosition
448         https://bugs.webkit.org/show_bug.cgi?id=186575
449
450         Reviewed by David Kilzer.
451
452         The bug was caused by ScrollView::platformSetScrollPosition releasing the web thread lock
453         and DumpRenderTree requesting a new page load thereby destroying FrameView.
454
455         Fixed the crash by keeping FrameView alive while scrollToFocusedElementTimerFired is getting called.
456
457         No new tests since the bug is caught by existing layout tests under guard malloc.
458
459         * page/FrameView.cpp:
460         (WebCore::FrameView::scrollToFocusedElementTimerFired):
461
462 2018-06-12  Zalan Bujtas  <zalan@apple.com>
463
464         Complex text handling should opt out of bounded text layout.
465         https://bugs.webkit.org/show_bug.cgi?id=186571
466         <rdar://problem/40801429>
467
468         Reviewed by Tim Horton.
469
470         Test: fast/text/complex-long-text-crash.html
471
472         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
473         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
474
475 2018-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
476
477         Unreviewed, fix the Windows build after r232757
478
479         * editing/ReplaceSelectionCommand.cpp:
480         (WebCore::ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren):
481
482 2018-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
483
484         REGRESSION(r228724): Occasional crash when executing ReplaceSelectionCommand at the end of the document
485         https://bugs.webkit.org/show_bug.cgi?id=186555
486         <rdar://problem/39703004>
487
488         Reviewed by Ryosuke Niwa.
489
490         r228724 removed a null check for m_lastNodeInserted in InsertedNodes::pastLastLeaf(). This null check was
491         guarding against the case where m_firstNodeInserted might exist, but m_lastNodeInserted is null, which may
492         happen when inserting content at the end of the document, since InsertedNodes::willRemoveNodePreservingChildren
493         may cause m_lastNodeInserted to be null. This is because the removed node may be at the very end of the document
494         _and also_ not have any children, which means that both `node->lastChild()` as well as
495         `NodeTraversal::nextSkippingChildren(*node)` will be null.
496
497         After getting into this state, we subsequently crash when attempting to compute InsertedNodes::pastLastLeaf().
498         To fix this, avoid accidentally clearing out m_lastNodeInserted; if the last inserted node has neither a child
499         nor a next node, seek backwards to the previous node in the DOM instead, and clamp to the first inserted node,
500         such that the last inserted node's document position is at or after the first inserted node's position.
501
502         Test: editing/execCommand/insert-apple-style-span-at-document-end.html
503
504         * editing/ReplaceSelectionCommand.cpp:
505         (WebCore::ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren):
506
507 2018-06-12  Jianjun Zhu  <jianjun.zhu@intel.com>
508
509         Hash deviceId and groupId of MediaTrackCapabilities.
510         https://bugs.webkit.org/show_bug.cgi?id=186471
511
512         Reviewed by Eric Carlson.
513
514         This change makes the identifier for the source of the MediaStreamTrack
515         has the same value returned by enumerateDevices(). It also prevents real
516         device ID being leaked.
517
518         (WebCore::MediaStreamTrack::getCapabilities const):
519         * Modules/mediastream/MediaStreamTrack.h:
520         * Modules/mediastream/MediaStreamTrack.idl:
521
522 2018-06-12  Philippe Normand  <pnormand@igalia.com>
523
524         Unreviewed WPE build fix after r232749.
525
526         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
527
528 2018-06-12  Zalan Bujtas  <zalan@apple.com>
529
530         [LFC] Add vertical margin computation for inflow non-replaced box and for the (10.6.6) complicated cases.
531         https://bugs.webkit.org/show_bug.cgi?id=186469
532
533         Reviewed by Antti Koivisto.
534
535         * layout/FormattingContextGeometry.cpp:
536         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
537         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
538         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
539         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
540         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
541
542 2018-06-12  Philippe Normand  <pnormand@igalia.com>
543
544         [GStreamer] Bump required version to 1.8.3
545         https://bugs.webkit.org/show_bug.cgi?id=186558
546
547         Reviewed by Xabier Rodriguez-Calvar.
548
549         * platform/GStreamer.cmake: Remove useless file.
550         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
551         (webKitWebAudioSrcChangeState): Remove useless version check.
552         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
553         Removed. createDecryptor() is dead code since the decryptors moved
554         to the MSE playback pipeline.
555         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
556         (WebCore::GStreamerEMEUtilities::keySystemToUuid):
557
558 2018-06-11  Philippe Normand  <philn@igalia.com>
559
560         [GStreamer] flush video sample upon DRAIN query
561         https://bugs.webkit.org/show_bug.cgi?id=186481
562
563         Reviewed by Xabier Rodriguez-Calvar.
564
565         Use the appsink sink pad pad probe for both event and drain query
566         management. This patch is partially based on
567         https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/d3a336523d123119fe1dd53da5d9006c92cf078c
568         by Enrique Ocaña González <eocanha@igalia.com>.
569
570         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
571         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
572         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
573
574 2018-06-11  Zalan Bujtas  <zalan@apple.com>
575
576         [LFC] Replace HorizontalGeometry::width and margin with WidthAndMargin (Vertical too)
577         https://bugs.webkit.org/show_bug.cgi?id=186556
578
579         Reviewed by Sam Weinig.
580
581         HorizontalGeometry::width and margin -> WidthAndMargin
582         VerticalGeometry::height and margin -> HeightAndMargin
583
584         * layout/FormattingContext.cpp:
585         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
586         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
587         * layout/FormattingContext.h:
588         * layout/FormattingContextGeometry.cpp:
589         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
590         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
591         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
592         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
593         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
594         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
595         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
596
597 2018-06-11  Youenn Fablet  <youenn@apple.com>
598
599         Improve error messages in case FetchEvent.respondWith has a rejected promise
600         https://bugs.webkit.org/show_bug.cgi?id=186368
601
602         Reviewed by Chris Dumez.
603
604         Covered by rebased tests.
605
606         Introduce a new error domain for service worker ResourceError.
607         Used this domain to log in the console any such error.
608
609         Update FetchEvent implementation to get meaningful error messages for respondWith error cases.
610         In particular, convert the rejected promise JS value as a string to populate the error message.
611
612         * loader/SubresourceLoader.cpp:
613         (WebCore::SubresourceLoader::didFail):
614         * platform/network/ResourceErrorBase.cpp:
615         * platform/network/ResourceErrorBase.h:
616         * testing/ServiceWorkerInternals.cpp:
617         (WebCore::ServiceWorkerInternals::waitForFetchEventToFinish):
618         * workers/service/FetchEvent.cpp:
619         (WebCore::FetchEvent::~FetchEvent):
620         (WebCore::FetchEvent::createResponseError):
621         (WebCore::FetchEvent::onResponse):
622         (WebCore::FetchEvent::respondWithError):
623         (WebCore::FetchEvent::processResponse):
624         (WebCore::FetchEvent::promiseIsSettled):
625         * workers/service/FetchEvent.h:
626         * workers/service/context/ServiceWorkerFetch.cpp:
627         (WebCore::ServiceWorkerFetch::processResponse):
628         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
629
630 2018-06-11  Chris Dumez  <cdumez@apple.com>
631
632         http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html times out with PSON enabled
633         https://bugs.webkit.org/show_bug.cgi?id=186546
634
635         Reviewed by Brady Eidson.
636
637         Add a hasOpenedFrames flag to NavigationAction, which we'll use in the UIProcess when deciding
638         to process swap on navigation or not.
639
640         Test: http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html
641
642         * loader/FrameLoader.cpp:
643         (WebCore::FrameLoader::loadURL):
644         * loader/NavigationAction.h:
645         (WebCore::NavigationAction::hasOpenedFrames const):
646         (WebCore::NavigationAction::setHasOpenedFrames):
647
648 2018-06-11  Tim Horton  <timothy_horton@apple.com>
649
650         Link drag image is inconsistently unreadable in dark mode
651         https://bugs.webkit.org/show_bug.cgi?id=186472
652
653         Reviewed by Timothy Hatcher.
654
655         * platform/mac/DragImageMac.mm:
656         (WebCore::createDragImageForLink):
657         Use LocalDefaultSystemAppearance so that NSColors used inside
658         createDragImageForLink are interpreted correctly. This function
659         always follows the system appearance regardless of what the preference
660         is set to, because it's generating UI that isn't part of the page.
661
662         Use controlBackgroundColor to get a consistently contrasting background
663         for the link drag image.
664
665 2018-06-11  Chris Dumez  <cdumez@apple.com>
666
667         http/tests/security/cors-post-redirect-307.html fails with PSON enabled
668         https://bugs.webkit.org/show_bug.cgi?id=186441
669
670         Reviewed by Brady Eidson.
671
672         When we are continuing a load in a new process, we currently bypass the navigation policy
673         check. We now also bypass the adding of headers such as the Origin one since the request
674         was already processed in the previous process. This is important because in the case of
675         a cross-origin redirect, the previous process has removed the Origin header from the
676         request and we do not want the new process to add it again.
677
678         Test: http/tests/security/cors-post-redirect-307-pson.html
679
680         * WebCore.xcodeproj/project.pbxproj:
681         * history/BackForwardController.cpp:
682         (WebCore::BackForwardController::goBackOrForward):
683         (WebCore::BackForwardController::goBack):
684         (WebCore::BackForwardController::goForward):
685         * loader/FrameLoadRequest.h:
686         (WebCore::FrameLoadRequest::setShouldTreatAsContinuingLoad):
687         (WebCore::FrameLoadRequest::shouldTreatAsContinuingLoad const):
688         (WebCore::FrameLoadRequest::setShouldCheckNavigationPolicy): Deleted.
689         (WebCore::FrameLoadRequest::shouldCheckNavigationPolicy const): Deleted.
690         * loader/FrameLoader.cpp:
691         (WebCore::FrameLoader::loadURLIntoChildFrame):
692         (WebCore::FrameLoader::load):
693         (WebCore::FrameLoader::loadWithNavigationAction):
694         (WebCore::FrameLoader::loadWithDocumentLoader):
695         (WebCore::FrameLoader::reloadWithOverrideEncoding):
696         (WebCore::FrameLoader::reload):
697         (WebCore::FrameLoader::addExtraFieldsToRequest):
698         (WebCore::FrameLoader::addHTTPOriginIfNeeded):
699         (WebCore::FrameLoader::loadDifferentDocumentItem):
700         (WebCore::FrameLoader::loadItem):
701         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
702         * loader/FrameLoader.h:
703         * loader/HistoryController.cpp:
704         (WebCore::HistoryController::goToItem):
705         (WebCore::HistoryController::setDefersLoading):
706         (WebCore::HistoryController::recursiveGoToItem):
707         * loader/HistoryController.h:
708         * loader/ShouldTreatAsContinuingLoad.h: Renamed from Source/WebCore/loader/NavigationPolicyCheck.h.
709         * page/Page.cpp:
710         (WebCore::Page::goToItem):
711         * page/Page.h:
712
713 2018-06-11  Youenn Fablet  <youenn@apple.com>
714
715         Accept request header values should be more tightly checked after r232572 in case of CORS load
716         https://bugs.webkit.org/show_bug.cgi?id=186533
717         <rdar://problem/40933880>
718
719         Reviewed by Darin Adler.
720
721         Covered by updated test.
722
723         * platform/network/HTTPParsers.cpp:
724         (WebCore::isValidAcceptHeaderValue): Checking that Accept header value conforms with RFC7370.
725         If not, this will trigger preflighting for CORS cross origin loads.
726         Current checks for Accept-Language and Content-Language are sufficient to ensure values conform with RFC7370.
727
728 2018-06-11  Chris Dumez  <cdumez@apple.com>
729
730         Crash under com.apple.WebKit.Networking at WebCore: WebCore::NetworkStorageSession::hasStorageAccess const
731         https://bugs.webkit.org/show_bug.cgi?id=186433
732         <rdar://problem/40750907>
733
734         Reviewed by Geoffrey Garen.
735
736         Do some hardening in NetworkStorageSession::hasStorageAccess() to make sure
737         we do not try and do a HashMap lookup with a null firstPartyDomain, as this
738         would crash.
739
740         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
741         (WebCore::NetworkStorageSession::hasStorageAccess const):
742
743 2018-06-11  Zalan Bujtas  <zalan@apple.com>
744
745         [LFC] Remove redundant position functions for out-of-flow elements
746         https://bugs.webkit.org/show_bug.cgi?id=186525
747
748         Reviewed by Antti Koivisto.
749
750         Position is computed as part of the Horizontal/Vertical geometry computation.
751         (see outOfFlow(Non)ReplacedHorizontalGeometry/outOfFlow(Non)ReplacedVerticalGeometry functions)
752
753         * layout/FormattingContext.cpp:
754         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
755         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const): Deleted.
756         * layout/FormattingContext.h:
757         * layout/FormattingContextGeometry.cpp:
758         (WebCore::Layout::outOfFlowNonReplacedPosition): Deleted.
759         (WebCore::Layout::outOfFlowReplacedPosition): Deleted.
760         (WebCore::Layout::FormattingContext::Geometry::outOfFlowPosition): Deleted.
761
762 2018-06-11  Zalan Bujtas  <zalan@apple.com>
763
764         [LFC] Merge top, bottom, height and vertical margin computation for out-of-flow replaced elements
765         https://bugs.webkit.org/show_bug.cgi?id=186524
766
767         Reviewed by Antti Koivisto.
768
769         Implement https://www.w3.org/TR/CSS22/visudet.html#abs-replaced-height
770         (10.6.5 Absolutely positioned, replaced elements)
771
772         * layout/FormattingContextGeometry.cpp:
773         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
774
775 2018-06-11  Zalan Bujtas  <zalan@apple.com>
776
777         [LFC] Merge left, right, width and horizontal margin computation for out-of-flow replaced elements
778         https://bugs.webkit.org/show_bug.cgi?id=186475
779
780         Reviewed by Antti Koivisto.
781
782         Implement https://www.w3.org/TR/CSS22/visudet.html#abs-replaced-width
783         (10.3.8 Absolutely positioned, replaced elements)
784
785         * layout/FormattingContext.cpp:
786         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
787         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
788         (WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const): Deleted.
789         * layout/FormattingContext.h:
790         * layout/FormattingContextGeometry.cpp:
791         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
792         (WebCore::Layout::computedValueIfNotAuto):
793         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
794         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
795         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin): Deleted.
796         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin): Deleted.
797         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin): Deleted.
798
799 2018-06-11  Zalan Bujtas  <zalan@apple.com>
800
801         [LFC] Merge left, right, width and horizontal margin computation for out-of-flow non-replaced elements
802         https://bugs.webkit.org/show_bug.cgi?id=186474
803
804         Reviewed by Antti Koivisto.
805
806         Implement https://www.w3.org/TR/CSS22/visudet.html#abs-non-replaced-width 
807         (10.3.7 Absolutely positioned, non-replaced elements)
808
809         * layout/FormattingContext.cpp:
810         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
811         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
812         (WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const): Deleted.
813         * layout/FormattingContext.h:
814         * layout/FormattingContextGeometry.cpp:
815         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
816         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
817         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
818         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin): Deleted.
819         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin): Deleted.
820         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin): Deleted.
821
822 2018-06-10  Zalan Bujtas  <zalan@apple.com>
823
824         [LFC] Merge top, bottom, height and vertical margin computation for out-of-flow non-replaced elements
825         https://bugs.webkit.org/show_bug.cgi?id=186476
826
827         Reviewed by Antti Koivisto.
828
829         Implement https://www.w3.org/TR/CSS22/visudet.html#abs-non-replaced-height
830         (10.6.4 Absolutely positioned, non-replaced elements)
831
832         * layout/FormattingContext.cpp:
833         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
834         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
835         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const): Deleted.
836         * layout/FormattingContext.h:
837         * layout/FormattingContextGeometry.cpp:
838         (WebCore::Layout::computedValueIfNotAuto):
839         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
840         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
841         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
842         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeightAndMargin): Deleted.
843         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeightAndMargin): Deleted.
844         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeightAndMargin): Deleted.
845
846 2018-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
847
848         [GTK][WPE] Add API run run javascript from a WebKitWebView in an isolated world
849         https://bugs.webkit.org/show_bug.cgi?id=186192
850
851         Reviewed by Michael Catanzaro.
852
853         * bindings/js/ScriptController.cpp:
854         (WebCore::ScriptController::executeScriptInWorld): Add ExceptionDetails parameter.
855         * bindings/js/ScriptController.h:
856
857 2018-06-10  Michael Catanzaro  <mcatanzaro@igalia.com>
858
859         [WPE][GTK] paypal.com requires user agent quirk
860         https://bugs.webkit.org/show_bug.cgi?id=186466
861
862         Reviewed by Carlos Garcia Campos.
863
864         * platform/UserAgentQuirks.cpp:
865         (WebCore::urlRequiresMacintoshPlatform):
866
867 2018-06-09  Dan Bernstein  <mitz@apple.com>
868
869         [Xcode] Clean up and modernize some build setting definitions
870         https://bugs.webkit.org/show_bug.cgi?id=186463
871
872         Reviewed by Sam Weinig.
873
874         * Configurations/Base.xcconfig: Removed definition for macOS 10.11.
875         * Configurations/DebugRelease.xcconfig: Ditto.
876         * Configurations/FeatureDefines.xcconfig: Simplified the definitions of ENABLE_APPLE_PAY and
877           ENABLE_VIDEO_PRESENTATION_MODE now macOS 10.12 is the earliest supported version.
878         * Configurations/Version.xcconfig: Removed definition for macOS 10.11.
879         * Configurations/WebCore.xcconfig: Simplified the definition of WK_PRIVATE_FRAMEWORKS_DIR
880           now that WK_XCODE_SUPPORTS_TEXT_BASED_STUBS is true for all supported Xcode versions.
881         * Configurations/WebKitTargetConditionals.xcconfig: Removed definitions for macOS 10.11.
882
883 2018-06-09  Dan Bernstein  <mitz@apple.com>
884
885         Added missing file references to the Configuration group.
886
887         * WebCore.xcodeproj/project.pbxproj:
888
889 2018-06-09  Zalan Bujtas  <zalan@apple.com>
890
891         REGRESSION (r230480): Cannot adjust photo position on LinkedIn's profile page
892         https://bugs.webkit.org/show_bug.cgi?id=186464
893         <rdar://problem/40369448>
894
895         Reviewed by Simon Fraser.
896
897         The optimization logic for skipping image layout when we only need overflow computation should check if the image actually needs
898         simplified layout only. The needsSimplifiedNormalFlowLayout() flag means that the overflow information needs to be updated but
899         it does not mean that overflow is the only property that we need to recompute.
900
901         Test: fast/images/positioned-image-when-transform-is-present.html
902
903         * rendering/RenderImage.cpp:
904         (WebCore::RenderImage::layout):
905         * rendering/RenderObject.h:
906         (WebCore::RenderObject::needsSimplifiedNormalFlowLayoutOnly const):
907
908 2018-06-09  Ryosuke Niwa  <rniwa@webkit.org>
909
910         REGRESSION(macOS Mojave): move-by-word-visually-multi-line.html fails
911         https://bugs.webkit.org/show_bug.cgi?id=186454
912
913         Reviewed by Darin Adler.
914
915         Like r232635, this patch fixes a selection test failure caused by the change in ICU's behavior in macOS Mojave,
916         which caused isWordTextBreak to return true in more cases.
917
918         In this particular failing test case, previousTextOrLineBreakBox and nextTextOrLineBreakBox were failing to find
919         an inline text box when it found an inline box for a BR, which was mentioned by an existing FIXME comment.
920         Consequently, visualWordPosition were erroneously detecting the end of a word followed by a blank line created by
921         a BR as a valid word boundary to move when the Windows editing behavior is enacted.
922
923         Addressed the FIXME comment by finding the next inline text box skipping all inline boxes for BRs. Renamed
924         misleadingly named previousBoxInDifferentBlock and nextBoxInDifferentBlock to previousBoxInDifferentLine and
925         nextBoxInDifferentLine respectively, and set them to true as they're really indicating whether line boxes
926         belong to a distinct line or not; whether an inline box belong to two (render) blocks or not is irrelevant.
927
928         Finally, this patch fixes a bug in visualWordPosition that it was failing to skip blank lines when a word break is
929         found as we traversed past a line break. In those cases, we must skip all line breaks before stopping.
930
931         Tests: editing/selection/move-by-word-visually-mac.html
932                editing/selection/move-by-word-visually-multi-line.htm
933
934         * editing/VisibleUnits.cpp:
935         (WebCore::CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox):
936         (WebCore::CachedLogicallyOrderedLeafBoxes::nextTextOrLineBreakBox):
937         (WebCore::CachedLogicallyOrderedLeafBoxes::boxIndexInLeaves const):
938         (WebCore::logicallyPreviousBox):
939         (WebCore::logicallyNextBox):
940         (WebCore::wordBreakIteratorForMinOffsetBoundary):
941         (WebCore::wordBreakIteratorForMaxOffsetBoundary):
942         (WebCore::visualWordPosition):
943
944 2018-06-09  Zalan Bujtas  <zalan@apple.com>
945
946         [LFC] MarginCollapse functions should be able to resolve non-fixed margin values
947         https://bugs.webkit.org/show_bug.cgi?id=186461
948
949         Reviewed by Antti Koivisto.
950
951         We need the containing block's computed width to resolve vertical and horizontal margins.
952
953         * layout/blockformatting/BlockFormattingContext.h:
954         * layout/blockformatting/BlockMarginCollapse.cpp:
955         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
956         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop):
957         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop):
958         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom):
959         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
960         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
961         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
962         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom):
963         (WebCore::Layout::collapsedMarginTopFromFirstChild): Deleted.
964         (WebCore::Layout::nonCollapsedMarginTop): Deleted.
965
966 2018-06-08  Darin Adler  <darin@apple.com>
967
968         [Cocoa] Remove all uses of NSAutoreleasePool as part of preparation for ARC
969         https://bugs.webkit.org/show_bug.cgi?id=186436
970
971         Reviewed by Anders Carlsson.
972
973         * bridge/objc/objc_class.mm: Use import instead of include.
974
975         * bridge/objc/objc_instance.h: Replaced _pool member to hold an object with
976         m_autoreleasePool member to hold a token from objc_autoreleasePoolPush. Also
977         initialize all data members here in the class definition.
978
979         * bridge/objc/objc_instance.mm:
980         (ObjcInstance::ObjcInstance): Moved most initialization to class definition.
981         (ObjcInstance::virtualBegin): Use objc_autoreleasePoolPush instead of
982         NSAutoreleasePool class.
983         (ObjcInstance::virtualEnd): Use objc_autoreleasePoolPop.
984
985         * bridge/objc/objc_runtime.mm: Use import instead of include.
986         * bridge/objc/objc_utility.mm: Ditto.
987
988         * platform/audio/mac/AudioBusMac.mm:
989         (WebCore::AudioBus::loadPlatformResource): Use @autoreleasepool.
990
991         * platform/ios/wak/WebCoreThread.mm: Re-sorted includes. Removed declaration of
992         autorelease pool SPI and use FoundationSPI.h instead.
993
994         * platform/network/cocoa/ResourceResponseCocoa.mm:
995         (WebCore::ResourceResponse::platformLazyInit): Use @autoreleasepool.
996
997 2018-06-08  Wenson Hsieh  <wenson_hsieh@apple.com>
998
999         [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 1)
1000         https://bugs.webkit.org/show_bug.cgi?id=186442
1001         <rdar://problem/40879364>
1002
1003         Reviewed by Tim Horton.
1004
1005         No change in behavior.
1006
1007         * Configurations/FeatureDefines.xcconfig:
1008         * page/DisabledAdaptations.cpp:
1009         (WebCore::extraZoomModeAdaptationName):
1010
1011 2018-06-08  Per Arne Vollan  <pvollan@apple.com>
1012
1013         Only display refresh monitors having requested display refresh callback should get notified on screen updates.
1014         https://bugs.webkit.org/show_bug.cgi?id=186397
1015         <rdar://problem/40897835>
1016
1017         Reviewed by Brent Fulgham.
1018
1019         Since all display refresh monitors in the WebContent process share a single UI process display link,
1020         we should make sure that only the monitors having requested callback are getting notified on screen
1021         updates. I have not been able to reproduce a case where a monitor is being notified without having
1022         requested updates, but we should safeguard the code for future code changes.
1023
1024         No new tests, since this is a safeguarding measure.
1025
1026         * platform/graphics/DisplayRefreshMonitor.h:
1027         (WebCore::DisplayRefreshMonitor::hasRequestedRefreshCallback const):
1028         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1029         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
1030
1031 2018-06-07  Jer Noble  <jer.noble@apple.com>
1032
1033         REGRESSION:  Cannot listen to audio on Google Translate with side switch set to "vibrate"
1034         https://bugs.webkit.org/show_bug.cgi?id=186415
1035         <rdar://problem/40584651>
1036
1037         Reviewed by Eric Carlson.
1038
1039         Test: platform/mac/media/audio-session-category-audio-autoplay.html
1040
1041         Make sure that the PlatformMediaSession's state has already been set when calling updateSessionStates().
1042
1043         * platform/audio/PlatformMediaSession.cpp:
1044         (WebCore::PlatformMediaSession::setState):
1045         * platform/audio/PlatformMediaSessionManager.cpp:
1046         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
1047         (WebCore::PlatformMediaSessionManager::sessionStateChanged):
1048
1049 2018-06-08  Dean Jackson  <dino@apple.com>
1050
1051         'setRenderPipelineState:' is unavailable: not available on iOS
1052         https://bugs.webkit.org/show_bug.cgi?id=186449
1053         <rdar://problem/40880602>
1054
1055         Reviewed by Simon Fraser.
1056
1057         Be more explicit about the protocol type to avoid
1058         the compiler getting confused by a similar signature.
1059
1060         * platform/graphics/cocoa/GPURenderCommandEncoderMetal.mm:
1061         (WebCore::GPURenderCommandEncoder::setRenderPipelineState):
1062
1063 2018-06-08  Darin Adler  <darin@apple.com>
1064
1065         Fix iOS build.
1066
1067         * platform/ios/QuickLookSoftLink.mm: Removed QLPreviousScheme, which I said I did in the
1068         change log but looks like it didn't happen.
1069
1070 2018-06-08  Darin Adler  <darin@apple.com>
1071
1072         [Cocoa] Make more of our soft linking ARC-compatible
1073         https://bugs.webkit.org/show_bug.cgi?id=186437
1074
1075         Reviewed by Daniel Bates.
1076
1077         * editing/cocoa/DataDetection.mm:
1078         (WebCore::removeResultLinksFromAnchor): Fix comment referring to unused constant DDURLScheme.
1079
1080         * platform/cocoa/DataDetectorsCoreSoftLink.h: Removed unused DDURLScheme.
1081         * platform/cocoa/DataDetectorsCoreSoftLink.mm: Ditto.
1082
1083         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1084         Use SOFT_LINK_CONSTANT_MAY_FAIL for NSString constants instead of using
1085         SOFT_LINK_POINTER_OPTIONAL. Required moving iOS-specific items inside the
1086         #if PLATFORM(IOS) section.
1087         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Use the
1088         canLoad functions instead of checking for null to handle possibly-missing string constants.
1089         (WebCore::metadataType): Ditto.
1090
1091         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Removed unused
1092         AVMediaTypeVideo, AVMediaTypeAudio, and AVMediaTypeText soft linking.
1093
1094         * platform/ios/QuickLook.mm:
1095         (WebCore::isQuickLookPreviewURL): Removed unneeded assertion.
1096
1097         * platform/ios/QuickLookSoftLink.h: Removed unneeded QLPreviousScheme, which was used only
1098         for an assertion, one we can do without.
1099         * platform/ios/QuickLookSoftLink.mm: Ditto.
1100
1101         * platform/mediastream/mac/AVVideoCaptureSource.mm: Removed unused soft linking of
1102         AVCaptureVideoPreviewLayer class and AVCaptureSessionPresetLow string constant. Use
1103         SOFT_LINK_CONSTANT_MAY_FAIL for NSString constants instead of using
1104         SOFT_LINK_POINTER_OPTIONAL.
1105         (WebCore::AVVideoCaptureSource::initializeCapabilities): Use the canLoad functions
1106         instead of checking for null to handle possibly-missing string constants.
1107         (WebCore::sizeForPreset): Ditto.
1108         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions const): Ditto.
1109
1110 2018-06-08  Aditya Keerthi  <akeerthi@apple.com>
1111
1112         [Datalist] Allow TextFieldInputType to show and hide suggestions
1113         https://bugs.webkit.org/show_bug.cgi?id=186151
1114
1115         Reviewed by Tim Horton.
1116
1117         TextFieldInputTypes with a list attribute should be able to display suggestions as the user
1118         interacts with the input field. In order to display suggestions for an input field with a list
1119         attribute, we need provide certain information - including the items to suggest and the location
1120         to present the suggestions. TextFieldInputType can now provide this information by conforming to
1121         the DataListSuggestionsClient interface.
1122
1123         In this initial patch, the suggestions can be shown in two ways. The first is by clicking on the
1124         input field. The other is by typing text in the field. In a later patch, we will add a third way
1125         to display suggestions, using a button. These ways to activate the suggestions are enumerated in
1126         DataListSuggestionInformation.
1127
1128         We hide the suggestions if there are no more to show, or if the input has blurred.
1129
1130         Tests to be added once work has been done in the UIProcess.
1131
1132         * WebCore.xcodeproj/project.pbxproj:
1133         * html/DataListSuggestionInformation.h: Added. Contains the information necessary to display suggestions.
1134         * html/TextFieldInputType.cpp:
1135         (WebCore::TextFieldInputType::~TextFieldInputType):
1136         (WebCore::TextFieldInputType::handleClickEvent): Show suggestions when the element is clicked.
1137         (WebCore::TextFieldInputType::handleKeydownEvent): Allow users to interact with the suggestions using the keyboard.
1138         (WebCore::TextFieldInputType::elementDidBlur): Hide the suggestions.
1139         (WebCore::TextFieldInputType::shouldRespectListAttribute):
1140         (WebCore::TextFieldInputType::didSetValueByUserEdit): Update the suggestions if the text has changed.
1141         (WebCore::TextFieldInputType::elementRectRelativeToRootView const): Provide the location where the suggestions should be shown.
1142         (WebCore::TextFieldInputType::suggestions const): Provide the list of suggestions.
1143         (WebCore::TextFieldInputType::didSelectDataListOption): Update the text once an suggestion has been selected.
1144         (WebCore::TextFieldInputType::didCloseSuggestions):
1145         (WebCore::TextFieldInputType::displaySuggestions):
1146         (WebCore::TextFieldInputType::closeSuggestions):
1147         * html/TextFieldInputType.h:
1148         * loader/EmptyClients.cpp:
1149         (WebCore::EmptyChromeClient::createDataListSuggestionPicker):
1150         * loader/EmptyClients.h:
1151         * page/Chrome.cpp:
1152         (WebCore::Chrome::createDataListSuggestionPicker):
1153         * page/Chrome.h:
1154         * page/ChromeClient.h:
1155         * platform/DataListSuggestionPicker.h: Added.
1156         (WebCore::DataListSuggestionPicker::close):
1157         (WebCore::DataListSuggestionPicker::handleKeydownWithIdentifier):
1158         (WebCore::DataListSuggestionPicker::displayWithActivationType):
1159         * platform/DataListSuggestionsClient.h: Added.
1160
1161 2018-06-07  Ryosuke Niwa  <rniwa@webkit.org>
1162
1163         REGRESSION(macOS Mojave): move-by-word-visually-inline-block-positioned-element.html fails
1164         https://bugs.webkit.org/show_bug.cgi?id=186424
1165
1166         Reviewed by Wenson Hsieh.
1167
1168         The test failure is ultimately caused by the change in ICU's behavior. With the CPU in the latest macOS Mojave,
1169         ubrk_getRuleStatus returns 200 / UBRK_WORD_LETTER at the end of a buffer given to UBreakIterator. This caused
1170         isWordTextBreak to return true instead of false in isLogicalStartOfWord at the end of the buffer.
1171
1172         This ICU behavior shouldn't have caused a problem in theory. However, WebKit had a bug in visualWordPosition which
1173         caused UBreakIterator to not include the succeeding word when traversing words to the left (backwards in LTR text)
1174         at the beginning of the last block element with exactly one line box after an non-statically positioned element.
1175
1176         In this case, visualWordPosition invokes wordBreakIteratorForMaxOffsetBoundary (because adjacentCharacterPosition
1177         is now at the end of the last word in the non-statically positioned element) to setup UBreakIterator. Because
1178         there are no line boxes left in the current line (in the last block element with exactly one line box),
1179         logicallyNextBox enters the while loop and invoke nextRootInlineBoxCandidatePosition to find the next root line box.
1180         However, the visible position given to this function is at the beginning of the first word in the block element.
1181         As a result, nextRootInlineBoxCandidatePosition skips over this entire line and finds no line box after the one
1182         we had in the non-statically positioned element.
1183
1184         Let us consider the following concrete example in which a position: static div is followed by another div, and each
1185         div contains text nodes "hello" and "world" respectively:
1186         - div position: static (1)
1187             - "hello"
1188         - div (2)
1189             - "world"
1190         Suppose we're at the offset 0 of "world", and trying to move to the left. In this case, adjacentCharacterPosition is
1191         at offset 5 of "world". The next line box should be that of "world". However, because we invoke logicallyNextBox via
1192         wordBreakIteratorForMaxOffsetBoundary with the visible position at offset 0 of "world", it skips this line and return
1193         nullptr.
1194
1195         This patch addresses this test failure by fixing visualWordPosition by passing adjacentCharacterPosition (at offset 5
1196         of "hello") as the visible position to find the next text box so that nextRootInlineBoxCandidatePosition invoked in
1197         logicallyNextBox would not skip the line ("world") from which we started the traversal to find the next line box.
1198
1199         Tests: editing/selection/move-by-word-visually-inline-block-positioned-element.html
1200
1201         * editing/VisibleUnits.cpp:
1202         (WebCore::visualWordPosition):
1203
1204 2018-06-08  Brent Fulgham  <bfulgham@apple.com>
1205
1206         REGRESSION (r230930): Link drag image is very blurry
1207         https://bugs.webkit.org/show_bug.cgi?id=186435
1208         <rdar://problem/40797202>
1209
1210         Reviewed by Tim Horton.
1211
1212         Tell NSImage the proper display scale factor it needs when performing a 'lockFocus' by passing
1213         the correct scaling transform as an NSImageHintCTM.
1214
1215         I reviewed the other drag operations (selection, image, and attachment) and confirmed through
1216         manual testing that these operations already properly scale the images. It appears that links
1217         were the only place where we relied on NSImage to determine and use the relevant device scale
1218         factor.
1219
1220         * SourcesCocoa.txt: Add new WebKitNSImageExtras.mm file.
1221         * WebCore.xcodeproj/project.pbxproj: Update for new files.
1222         * platform/graphics/mac/WebKitNSImageExtras.h: Added.
1223         * platform/graphics/mac/WebKitNSImageExtras.mm: Added.
1224         (-[NSImage _web_lockFocusWithTransform:]): Helper method that takes a device scale factor, creates the
1225         relevant scaling NSAffineTransform and passes it to the internal NSImage 'lockFocusWithRect' as the
1226         NSImageHintCTM hint.
1227         * platform/mac/DragImageMac.mm:
1228         (WebCore::createDragImageForLink): Use the new helper function.
1229
1230 2018-06-08  Zalan Bujtas  <zalan@apple.com>
1231
1232         [LFC] Add vertical margin computation for inline, block-level, inline-block and floating replaced elements
1233         https://bugs.webkit.org/show_bug.cgi?id=186432
1234
1235         Reviewed by Antti Koivisto.
1236
1237         * layout/FormattingContext.h:
1238         * layout/FormattingContextGeometry.cpp:
1239         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1240         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Use the computed non-auto values when margin is not auto.
1241         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1242         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1243         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1244
1245 2018-06-07  Yusuke Suzuki  <utatane.tea@gmail.com>
1246
1247         [WTF] Add WorkerPool
1248         https://bugs.webkit.org/show_bug.cgi?id=174569
1249
1250         Reviewed by Carlos Garcia Campos.
1251
1252         We start using WorkerPool for NicosiaPaintingEngineThreaded instead of glib thread pool.
1253         This makes NicosiaPaintingEngineThreaded platform-independent and usable for WinCairo.
1254
1255         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
1256         (Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
1257         (Nicosia::PaintingEngineThreaded::~PaintingEngineThreaded):
1258         (Nicosia::PaintingEngineThreaded::paint):
1259         (Nicosia::s_threadFunc): Deleted.
1260         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
1261
1262 2018-06-08  Miguel Gomez  <magomez@igalia.com>
1263
1264         [GTK][WPE] Wrong result when calling ImageBufferCairo's getImageData()
1265         https://bugs.webkit.org/show_bug.cgi?id=186384
1266
1267         Reviewed by Michael Catanzaro.
1268
1269         Fix calculations so the result is the expected one.
1270
1271         * platform/graphics/cairo/ImageBufferCairo.cpp:
1272         (WebCore::getImageData):
1273
1274 2018-06-07  Fujii Hironori  <Hironori.Fujii@sony.com>
1275
1276         Add base class to get WeakPtrFactory member and avoid some boilerplate code
1277         https://bugs.webkit.org/show_bug.cgi?id=186407
1278         <rdar://problem/40922716>
1279
1280         Unreviewed WinCairo build fix
1281
1282         MediaPlayerPrivateMediaFoundation.cpp(1726): error C2039: 'makeWeakPtr': is not a member of 'WebCore::MediaPlayerPrivateMediaFoundation'
1283
1284         No new tests (No behavior change).
1285
1286         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1287         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
1288
1289 2018-06-07  Chris Dumez  <cdumez@apple.com>
1290
1291         Add base class to get WeakPtrFactory member and avoid some boilerplate code
1292         https://bugs.webkit.org/show_bug.cgi?id=186407
1293
1294         Reviewed by Brent Fulgham.
1295
1296         Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
1297         order to avoid some boilerplate code in every class needing a WeakPtrFactory.
1298         This also gets rid of old-style createWeakPtr() methods in favor of the newer
1299         makeWeakPtr().
1300
1301         * Modules/credentialmanagement/CredentialsMessenger.h:
1302         * Modules/credentialmanagement/NavigatorCredentials.cpp:
1303         (WebCore::NavigatorCredentials::credentials):
1304         * Modules/encryptedmedia/CDM.cpp:
1305         (WebCore::CDM::doSupportedConfigurationStep):
1306         (WebCore::CDM::getConsentStatus):
1307         * Modules/encryptedmedia/CDM.h:
1308         * Modules/encryptedmedia/MediaKeySession.cpp:
1309         (WebCore::MediaKeySession::generateRequest):
1310         (WebCore::MediaKeySession::load):
1311         (WebCore::MediaKeySession::update):
1312         (WebCore::MediaKeySession::close):
1313         (WebCore::MediaKeySession::remove):
1314         * Modules/encryptedmedia/MediaKeySession.h:
1315         * Modules/encryptedmedia/MediaKeys.cpp:
1316         (WebCore::MediaKeys::createSession):
1317         * Modules/encryptedmedia/MediaKeys.h:
1318         * Modules/gamepad/GamepadManager.cpp:
1319         (WebCore::GamepadManager::platformGamepadDisconnected):
1320         (WebCore::GamepadManager::makeGamepadVisible):
1321         * Modules/mediastream/MediaDevices.cpp:
1322         (WebCore::MediaDevices::MediaDevices):
1323         * Modules/mediastream/MediaDevices.h:
1324         * Modules/mediastream/MediaStreamTrack.cpp:
1325         (WebCore::MediaStreamTrack::applyConstraints):
1326         * Modules/mediastream/MediaStreamTrack.h:
1327         * Modules/webauthn/cocoa/LocalAuthenticator.h:
1328         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
1329         (WebCore::LocalAuthenticator::makeCredential):
1330         * accessibility/AccessibilityRenderObject.h:
1331         * accessibility/AccessibilitySVGRoot.cpp:
1332         (WebCore::AccessibilitySVGRoot::setParent):
1333         * crypto/SubtleCrypto.cpp:
1334         (WebCore::SubtleCrypto::encrypt):
1335         (WebCore::SubtleCrypto::decrypt):
1336         (WebCore::SubtleCrypto::sign):
1337         (WebCore::SubtleCrypto::verify):
1338         (WebCore::SubtleCrypto::digest):
1339         (WebCore::SubtleCrypto::generateKey):
1340         (WebCore::SubtleCrypto::deriveKey):
1341         (WebCore::SubtleCrypto::deriveBits):
1342         (WebCore::SubtleCrypto::importKey):
1343         (WebCore::SubtleCrypto::exportKey):
1344         (WebCore::SubtleCrypto::wrapKey):
1345         (WebCore::SubtleCrypto::unwrapKey):
1346         * crypto/SubtleCrypto.h:
1347         * css/CSSFontFace.cpp:
1348         (WebCore::CSSFontFace::CSSFontFace):
1349         (WebCore::CSSFontFace::wrapper):
1350         (WebCore::CSSFontFace::setWrapper):
1351         * css/DeprecatedCSSOMValue.h:
1352         * css/FontFace.cpp:
1353         * css/FontFace.h:
1354         * css/MediaQueryEvaluator.cpp:
1355         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
1356         * css/StyleSheetContents.h:
1357         * css/parser/CSSDeferredParser.cpp:
1358         (WebCore::CSSDeferredParser::CSSDeferredParser):
1359         * dom/DataTransferItemList.cpp:
1360         (WebCore::DataTransferItemList::add):
1361         (WebCore::DataTransferItemList::ensureItems const):
1362         (WebCore::DataTransferItemList::didSetStringData):
1363         * dom/DataTransferItemList.h:
1364         * dom/Document.cpp:
1365         (WebCore::Document::postTask):
1366         (WebCore::Document::hasStorageAccess):
1367         (WebCore::Document::requestStorageAccess):
1368         * dom/Document.h:
1369         (WebCore::Document::setContextDocument):
1370         * dom/MessagePort.h:
1371         * html/HTMLImageElement.cpp:
1372         (WebCore::HTMLImageElement::setPictureElement):
1373         * html/HTMLInputElement.h:
1374         * html/HTMLMediaElement.cpp:
1375         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
1376         * html/HTMLMediaElement.h:
1377         * html/HTMLPictureElement.h:
1378         * html/parser/HTMLResourcePreloader.h:
1379         * layout/layouttree/LayoutBox.h:
1380         (WebCore::Layout::Box::style const):
1381         * loader/FormState.h:
1382         * loader/LinkLoader.cpp:
1383         (WebCore::LinkLoader::preconnectIfNeeded):
1384         * loader/LinkLoader.h:
1385         * loader/LinkPreloadResourceClients.cpp:
1386         (WebCore::LinkPreloadResourceClient::LinkPreloadResourceClient):
1387         * loader/MediaResourceLoader.cpp:
1388         (WebCore::MediaResourceLoader::MediaResourceLoader):
1389         * loader/MediaResourceLoader.h:
1390         * page/DOMWindow.h:
1391         * page/EventHandler.cpp:
1392         (WebCore::widgetForElement):
1393         (WebCore::EventHandler::updateLastScrollbarUnderMouse):
1394         * platform/GenericTaskQueue.cpp:
1395         (WebCore::TaskDispatcher<Timer>::postTask):
1396         * platform/GenericTaskQueue.h:
1397         (WebCore::GenericTaskQueue::enqueueTask):
1398         (WebCore::GenericTaskQueue::cancelAllTasks):
1399         * platform/ScrollView.h:
1400         * platform/ScrollableArea.h:
1401         * platform/Scrollbar.h:
1402         * platform/Widget.cpp:
1403         (WebCore::Widget::setParent):
1404         * platform/Widget.h:
1405         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1406         (WebCore::AudioFileReader::decodeAudioForBusCreation):
1407         * platform/audio/mac/AudioHardwareListenerMac.cpp:
1408         (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac):
1409         * platform/audio/mac/AudioHardwareListenerMac.h:
1410         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1411         (WebCore::CDMInstanceClearKey::requestLicense):
1412         (WebCore::CDMInstanceClearKey::updateLicense):
1413         (WebCore::CDMInstanceClearKey::loadSession):
1414         (WebCore::CDMInstanceClearKey::closeSession):
1415         (WebCore::CDMInstanceClearKey::removeSessionData):
1416         * platform/encryptedmedia/clearkey/CDMClearKey.h:
1417         * platform/graphics/FontCascade.h:
1418         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1419         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
1420         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
1421         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1422         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
1423         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1424         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
1425         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
1426         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1427         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
1428         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
1429         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1430         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1431         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
1432         (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
1433         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
1434         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
1435         (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
1436         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
1437         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1438         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1439         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1440         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
1441         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask):
1442         * platform/graphics/cv/TextureCacheCV.h:
1443         * platform/graphics/cv/TextureCacheCV.mm:
1444         (WebCore::TextureCacheCV::textureFromImage):
1445         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1446         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
1447         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
1448         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1449         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1450         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1451         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1452         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
1453         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1454         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1455         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
1456         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
1457         (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
1458         * platform/graphics/mac/DisplayRefreshMonitorMac.h:
1459         * platform/graphics/texmap/TextureMapperLayer.cpp:
1460         (WebCore::TextureMapperLayer::setMaskLayer):
1461         (WebCore::TextureMapperLayer::setReplicaLayer):
1462         * platform/graphics/texmap/TextureMapperLayer.h:
1463         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1464         (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
1465         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
1466         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
1467         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1468         * platform/ios/RemoteCommandListenerIOS.h:
1469         * platform/ios/RemoteCommandListenerIOS.mm:
1470         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
1471         * platform/mac/RemoteCommandListenerMac.h:
1472         * platform/mac/RemoteCommandListenerMac.mm:
1473         (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):
1474         * platform/mediastream/MediaStreamPrivate.cpp:
1475         (WebCore::MediaStreamPrivate::scheduleDeferredTask):
1476         * platform/mediastream/MediaStreamPrivate.h:
1477         * platform/mediastream/RealtimeMediaSource.cpp:
1478         (WebCore::RealtimeMediaSource::scheduleDeferredTask):
1479         * platform/mediastream/RealtimeMediaSource.h:
1480         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
1481         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1482         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
1483         * platform/vr/VRPlatformDisplay.h:
1484         * platform/vr/openvr/VRPlatformManagerOpenVR.cpp:
1485         (WebCore::VRPlatformManagerOpenVR::getVRDisplays):
1486         * rendering/FloatingObjects.h:
1487         (WebCore::FloatingObject::setOriginatingLine):
1488         * rendering/RenderObject.h:
1489         * rendering/RootInlineBox.cpp:
1490         * rendering/RootInlineBox.h:
1491         * svg/SVGPathElement.h:
1492         * svg/SVGPathSegWithContext.h:
1493         (WebCore::SVGPathSegWithContext::SVGPathSegWithContext):
1494         (WebCore::SVGPathSegWithContext::setContextAndRole):
1495         * svg/SVGTransformList.h:
1496         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1497         (WebCore::SVGAnimatedListPropertyTearOff::baseVal):
1498         (WebCore::SVGAnimatedListPropertyTearOff::animVal):
1499         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
1500         * svg/properties/SVGAnimatedPropertyTearOff.h:
1501         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
1502         * svg/properties/SVGListProperty.h:
1503         (WebCore::SVGListProperty::initializeValuesAndWrappers):
1504         (WebCore::SVGListProperty::getItemValuesAndWrappers):
1505         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
1506         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
1507         (WebCore::SVGListProperty::appendItemValuesAndWrappers):
1508         * svg/properties/SVGMatrixTearOff.h:
1509         * svg/properties/SVGPropertyTearOff.h:
1510         * testing/MockCDMFactory.cpp:
1511         (WebCore::MockCDMFactory::createCDM):
1512         (WebCore::MockCDM::createInstance):
1513         * testing/MockCDMFactory.h:
1514         * workers/service/ExtendableEvent.h:
1515         * workers/service/FetchEvent.cpp:
1516         (WebCore::FetchEvent::respondWith):
1517         * workers/service/server/SWServer.h:
1518         * xml/DOMParser.cpp:
1519         (WebCore::DOMParser::DOMParser):
1520
1521 2018-06-07  Chris Dumez  <cdumez@apple.com>
1522
1523         PopStateEvent should not be cancelable by default
1524         https://bugs.webkit.org/show_bug.cgi?id=186420
1525
1526         Reviewed by Darin Adler.
1527
1528         PopStateEvent should not be cancelable by default:
1529         - https://github.com/web-platform-tests/wpt/pull/11355
1530         - https://html.spec.whatwg.org/#history-traversal
1531
1532         All other browsers agree with the specification.
1533
1534         No new tests, updated existing tests.
1535
1536         * dom/PopStateEvent.cpp:
1537         (WebCore::PopStateEvent::PopStateEvent):
1538
1539 2018-06-07  Simon Fraser  <simon.fraser@apple.com>
1540
1541         Remove a log that was left in by mistake.
1542
1543         * loader/cache/MemoryCache.cpp:
1544         (WebCore::MemoryCache::pruneLiveResourcesToSize):
1545
1546 2018-06-07  Antoine Quint  <graouts@apple.com>
1547
1548         [ASan / StressGC] DumpRenderTree crashed in com.apple.WebCore: WebCore::EventTarget::ref + 16
1549         https://bugs.webkit.org/show_bug.cgi?id=186207
1550         <rdar://problem/40568747>
1551
1552         Reviewed by Dean Jackson.
1553
1554         Ensure that we clear the DOM event queue for declarative animations once an animation is cleared for
1555         an element since the element can be deleted before events get dispatched asynchronouly for this animation.
1556
1557         We also only call AnimationTimeline::removeAnimationsForElement() from RenderTreeUpdater::tearDownRenderers()
1558         in the case where we're tearing down the whole document as otherwise this would yield early clearing of the event
1559         queue in the case where an element would get a "display: none" style.
1560
1561         * animation/AnimationTimeline.cpp:
1562         (WebCore::AnimationTimeline::removeAnimationsForElement):
1563         * animation/DeclarativeAnimation.cpp:
1564         (WebCore::DeclarativeAnimation::~DeclarativeAnimation):
1565         (WebCore::DeclarativeAnimation::prepareAnimationForRemoval):
1566         * animation/DeclarativeAnimation.h:
1567         * animation/WebAnimation.cpp:
1568         (WebCore::WebAnimation::prepareAnimationForRemoval):
1569         * animation/WebAnimation.h:
1570         * rendering/updating/RenderTreeUpdater.cpp:
1571         (WebCore::RenderTreeUpdater::tearDownRenderers):
1572
1573 2018-06-07  Don Olmstead  <don.olmstead@sony.com>
1574
1575         [CoordGraphics] Fix compilation errors around USE(COORDINATED_GRAPHICS)
1576         https://bugs.webkit.org/show_bug.cgi?id=186374
1577
1578         Reviewed by Žan Doberšek.
1579
1580         No new tests. No change in behavior.
1581
1582         * page/scrolling/AsyncScrollingCoordinator.cpp:
1583         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1584         (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
1585         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
1586         * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp:
1587         * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp:
1588         * platform/PlatformWheelEvent.h:
1589         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
1590         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
1591         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1592         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
1593
1594 2018-06-07  Thibault Saunier  <tsaunier@igalia.com> and Alejandro G. Castro  <alex@igalia.com>
1595
1596         [GTK][WPE] Start implementing MediaStream API
1597         https://bugs.webkit.org/show_bug.cgi?id=185787
1598
1599         Reviewed by Philippe Normand.
1600
1601         We are adding all the required classes to make the
1602         MediaStream API work, that means our own RealtimeMediaSourceCenterLibWebRTC
1603         for the platform, the GStreamerCaptureDeviceManager, the audio/video capturers
1604         and their respective audio/video sources as well as a dedicated GStreamer Source
1605         that adds support for using MediaStream stream inside playbin3.
1606         We are using the GstDeviceMonitor to list devices on the devices.
1607
1608         Enable mediastream tests.
1609
1610         * platform/GStreamer.cmake: Added the new files to the compilation.
1611         * platform/audio/AudioStreamDescription.h: Added new GStreamer type.
1612         * platform/audio/PlatformAudioData.h: Added new GStreamer type for
1613         the GStreamerAudioData class.
1614         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1615         (WebCore::simpleBusMessageCallback): This function and the next
1616         one help us to connect a monitoring callback to a pipeline for
1617         debugging.
1618         (WebCore::connectSimpleBusMessageCallback): Ditto.
1619         * platform/graphics/gstreamer/GStreamerCommon.h: Ditto
1620         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1621         (WebCore::MediaPlayerPrivateGStreamer::load): Make use of the loadFull() method.
1622         (WebCore::MediaPlayerPrivateGStreamer::loadFull): Very similar to load()
1623         but allows specifying what pipeline type to use (null to let the function determine
1624         which one should be used). This is required as we force to always use playbin3 for the
1625         mediastream source as it relies on the GstStream API.
1626         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Style fix.
1627         (WebCore::MediaPlayerPrivateGStreamer::naturalSize const): Added, use MediaStream specific information if available.
1628         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Some style fixes.
1629         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Enhance dotfiles names.
1630         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): Minor formatting fix.
1631         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup): Set MediaStream on WebKitMediaStreamSource when setting it up.
1632         (WebCore::MediaPlayerPrivateGStreamer::supportsType): Advertise that we support MediaStream if support is built.
1633         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Make sure playbin3 is forced when loading a MediaStream.
1634         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add a reference to the MediaStream object and declare loadFull and naturalSize override.
1635         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1636         (WebCore::registerWebKitGStreamerElements): Register the new MediaStreamSrc element.
1637         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
1638         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer): Make sure that MediaStream MAIN tracks are selected by default. We have no way to do it in MediaStreamSrc now as the GstStreamCollection is recreated by parsebin.
1639         * platform/mediastream/RealtimeMediaSource.h: Make CaptureFailed a virtual method as in our mocks we require need to make
1640         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1641         (WebCore::RealtimeMediaSourceCenter::singleton): Remove the code
1642         used for compilation for the platform when we do not have a
1643         RealtimeMediaSourceCenterLibWebRTC. Now we return the proper class
1644         for the platform.
1645         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
1646         Added class representing the RealtimeMediaSource for the Audio
1647         with GStreamer.
1648         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
1649         Ditto.
1650         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: Added
1651         this class that represents the GStreamer pipeline that captures
1652         audio from the system devices, it inherits from GStreamerCapturer.
1653         * platform/mediastream/gstreamer/GStreamerAudioCapturer.h: Dito.
1654         * platform/mediastream/gstreamer/GStreamerAudioData.h: Added this
1655         class implementing PlatformAudioData for the GStreamer platform,
1656         used to pass the samples information.
1657         * platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
1658         Added this class implementing AudioStreamDescription to export the
1659         information about the audio stream to libwebrtc.
1660         * platform/mediastream/gstreamer/GStreamerCaptureDevice.h: Added
1661         this base class for the audio and video capturing devices, it
1662         implements general WebKit CaptureDevice class.
1663         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
1664         Added this class that implements the system monitor to get the
1665         list of available devices in the system. It uses GstDeviceMonitor
1666         to handle the operation. It uses two singleton device managers one
1667         for audio and another one for video, as required by the
1668         RealtimeMediaSourceCenter design.
1669         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: Ditto.
1670         * platform/mediastream/gstreamer/GStreamerCapturer.cpp: Added this
1671         base class representing how GStreamer captures the media from the
1672         input devices in the system. Two classes inherit from this one to
1673         capture audio and video. It setups the GStreamer pipeline and adds
1674         functions to control it.
1675         * platform/mediastream/gstreamer/GStreamerCapturer.h: Ditto.
1676         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Added.
1677         Implements a subclass of GstBin as a source element that will contain several
1678         GstAppSrc, basically one per MediaStreamTrackPrivate of the MediaStreamPrivate
1679         passed in parameter. It adds Observers on the MediaStreamTracks and
1680         pushes the data to the sources as required. The element implements the GstURIHandler
1681         interface so it can be used in playbin. The MediaPlayerPrivateGStreamer is responsible
1682         for passing the MediaStreamPrivate object to the source when required.
1683         (WebCore::webkitMediaStreamSrcPadProbeCb): Event probe that fixes stream_start events (setting the ID etc)
1684         and finally add src pads to the pipeline.
1685         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.h: Ditto.
1686         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
1687         Added this RealtimeMediaSource representing the source of the
1688         video data for the GStreamer platform. It handles the settings and
1689         capabilities of the source and creates the capturer used to
1690         control the operation of the stream.
1691         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: Ditto.
1692         * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: Added
1693         this class that inherits from the GStreamerCapturer and controls
1694         the GStreamer pipelines of the video streams of the system.
1695         * platform/mediastream/gstreamer/GStreamerVideoCapturer.h: Ditto.
1696         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: Added. Implementation of a Mock capturer for audio stream.
1697         Subclasses GStreamerAudioCapturer and wraps a MockRealtimeAudioSource so that the behaviour is the same a MockRealtimeAudioSource
1698         but still the GStreamer implementation code paths are tested.
1699         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h: Ditto.
1700         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: Added. Implementation of a Mock capturer for video stream.
1701         Subclasses GStreamerVideoCapturer and wraps a MockRealtimeVideoSource so that the behaviour is the same a MockRealtimeVideoSource
1702         but still the GStreamer implementation code paths are tested.
1703         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h: Ditto.
1704         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
1705         Added this class that implements the key RealtimeMediaSourceCenter
1706         functions to configure the base class for the platform, using the
1707         other GStreamer classes.
1708         * platform/mock/MockRealtimeAudioSource.cpp: Do not build ::create if GStreamer implementation is built
1709         * platform/mock/MockRealtimeVideoSource.cpp: Do not build ::create if GStreamer implementation is built
1710
1711 2018-06-07  Brent Fulgham  <bfulgham@apple.com>
1712
1713         Handle Storage Access API calls in the absence of an attached frame
1714         https://bugs.webkit.org/show_bug.cgi?id=186373
1715         <rdar://problem/40028265>
1716
1717         Reviewed by Daniel Bates.
1718
1719         Tests: http/tests/storageAccess/has-storage-access-crash.html
1720                http/tests/storageAccess/request-storage-access-crash.html
1721
1722         The new frame-specific storage access checks were done without confirming a
1723         frame was present, although the frame state was validated in other parts of
1724         the same method.
1725         
1726         This patch checks for a non-null frame before making frame-specific calls.
1727
1728         * dom/Document.cpp:
1729         (WebCore::Document::hasStorageAccess):
1730         (WebCore::Document::requestStorageAccess):
1731
1732 2018-06-07  Zalan Bujtas  <zalan@apple.com>
1733
1734         [LFC] Merge height and vertical margin computation
1735         https://bugs.webkit.org/show_bug.cgi?id=186394
1736
1737         Reviewed by Antti Koivisto.
1738
1739         To match the spec (and the width/horizontal margin computation). -currently with default values.
1740
1741         * layout/FormattingContext.cpp:
1742         (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
1743         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1744         (WebCore::Layout::FormattingContext::computeFloatingHeight const): Deleted.
1745         * layout/FormattingContext.h:
1746         * layout/FormattingContextGeometry.cpp:
1747         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeightAndMargin):
1748         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeightAndMargin):
1749         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
1750         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
1751         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeightAndMargin):
1752         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
1753         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1754         (WebCore::Layout::outOfFlowNonReplacedHeight): Deleted.
1755         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight): Deleted.
1756         (WebCore::Layout::floatingNonReplacedHeight): Deleted.
1757         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight): Deleted.
1758         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeight): Deleted.
1759         (WebCore::Layout::FormattingContext::Geometry::floatingHeight): Deleted.
1760         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight): Deleted.
1761         * layout/blockformatting/BlockFormattingContext.cpp:
1762         (WebCore::Layout::BlockFormattingContext::layout const):
1763         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1764         (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
1765         (WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
1766         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const): Deleted.
1767         * layout/blockformatting/BlockFormattingContext.h:
1768         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1769         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1770         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1771         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): Deleted.
1772         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeight): Deleted.
1773
1774 2018-06-07  Antti Koivisto  <antti@apple.com>
1775
1776         Don't start service worker fetch when there is substitute data
1777         https://bugs.webkit.org/show_bug.cgi?id=186349
1778         <rdar://problem/38881568>
1779
1780         Reviewed by Youenn Fablet.
1781
1782         Loading content via WKWebView.loadData may also end up starting a main resource service worker fetch.
1783         This breaks DocumentWriter assumptions.
1784
1785         * loader/DocumentLoader.cpp:
1786         (WebCore::DocumentLoader::tryLoadingRequestFromApplicationCache):
1787         (WebCore::DocumentLoader::tryLoadingSubstituteData):
1788
1789         Factor substitute resource loading out from tryLoadingRequestFromApplicationCache.
1790
1791         (WebCore::DocumentLoader::startLoadingMainResource):
1792
1793         If we have substitute data already (typically from WKWebView.loadData), allow service worker registration
1794         but load the main resource using the substitute data.
1795
1796         (WebCore::DocumentLoader::handleSubstituteDataLoadSoon): Deleted.
1797
1798         Merge to tryLoadingSubstituteData.
1799
1800         * loader/DocumentLoader.h:
1801
1802 2018-06-07  Thibault Saunier  <tsaunier@igalia.com>
1803
1804         [GStreamer] Fix the way GstStreamCollection is handled
1805         https://bugs.webkit.org/show_bug.cgi?id=184588
1806
1807         Reviewed by Philippe Normand.
1808
1809         The stream collection message replaces the collection of stream previously
1810         advertised, this means that we should rebuild our set of Track from scratch
1811         and not update previously exposed tracks.
1812
1813         In the end, this simplifies the code as we do not care about what
1814         tracks existed previously, we just need to expose what GStreamer tells
1815         us, deleting any previous state.
1816
1817         Handle the STREAM_COLLECTION message from the sync handler so that tracks
1818         are updated before we mark the pipeline as READY for the live case (everything
1819         happen synchronously with the call to the `load()` method in that case),
1820         the update still always happens on the main thread.
1821
1822         No new tests is added as this is mostly refactoring, it is already tested and it
1823         will fix MediaStream tests that are currently disabled as the support is being
1824         implemented in #185787.
1825
1826         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1827         (WebCore::MediaPlayerPrivateGStreamer::clearTracks): Removes all tracks.
1828         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Updates configured tracks from the new GstStreamColection track.
1829         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Stop handling GST_STREAM_COLLECTION event.
1830         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Handle stream collection event synchronously.
1831         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add handleSyncMessage
1832
1833 2018-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>
1834
1835         Remove unused image encoders
1836         https://bugs.webkit.org/show_bug.cgi?id=186365
1837
1838         Reviewed by Carlos Garcia Campos.
1839
1840         * platform/image-encoders/JPEGImageEncoder.cpp: Removed.
1841         * platform/image-encoders/JPEGImageEncoder.h: Removed.
1842         * platform/image-encoders/PNGImageEncoder.cpp: Removed.
1843         * platform/image-encoders/PNGImageEncoder.h: Removed.
1844
1845 2018-06-06  Youenn Fablet  <youenn@apple.com>
1846
1847         HTTP Header values validation is too strict
1848         https://bugs.webkit.org/show_bug.cgi?id=167112
1849
1850         Reviewed by Alex Christensen.
1851
1852         Moving header values and names from DOMString to ByteString as per spec.
1853         Updating WebCore::isValidHTTPHeaderValue as per https://fetch.spec.whatwg.org/#terminology-headers.
1854
1855         Covered by rebased and updated tests.
1856         Updated test is now also passing in other browsers.
1857
1858         * platform/network/HTTPParsers.cpp:
1859         (WebCore::isValidHTTPHeaderValue):
1860
1861 2018-06-06  Youenn Fablet  <youenn@apple.com>
1862
1863         Add Accept-Encoding: identity to Range requests
1864         https://bugs.webkit.org/show_bug.cgi?id=186335
1865         <rdar://problem/40837190>
1866
1867         Reviewed by Eric Carlson.
1868
1869         Tests: imported/w3c/web-platform-tests/fetch/range/general.any.html
1870                imported/w3c/web-platform-tests/fetch/range/general.any.worker.html
1871
1872         * loader/cache/CachedResourceLoader.cpp:
1873         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
1874         * loader/cache/CachedResourceRequest.cpp:
1875         (WebCore::CachedResourceRequest::updateAcceptEncodingHeader):
1876         * loader/cache/CachedResourceRequest.h:
1877
1878 2018-06-06  Per Arne Vollan  <pvollan@apple.com>
1879
1880         Display links are sometimes not notifying WebCore when fired.
1881         https://bugs.webkit.org/show_bug.cgi?id=186367
1882         <rdar://problem/40439109>
1883
1884         Reviewed by Brent Fulgham.
1885
1886         When the WebContent process is receiving an IPC message notifying about a screen update, all display refresh monitors
1887         are notified by the manager in DisplayRefreshMonitorManager::displayWasUpdated(). The manager checks that the monitor
1888         is scheduled before notifying. This is a problem, since the scheduled flag is always set to false in the
1889         DisplayRefreshMonitor::displayDidRefresh() method, when the monitor is first notified about a screen update. This can
1890         lead to display links running without notifying the monitors, causing extra CPU usage. It can also prevent them from
1891         being deleted, since the monitors are not notified. Instead, we can check that the display refresh monitor is active
1892         before notifying it. This matches the original display link implementation used when the WebContent process has
1893         WindowServer access, where the monitors are always notified.
1894
1895         No new tests, since I have not been able to reproduce this in a test case yet.
1896
1897         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1898         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
1899
1900 2018-06-06  Antoine Quint  <graouts@apple.com>
1901
1902         Rename color-filter to -apple-color-filter and do not expose it to Web content
1903         https://bugs.webkit.org/show_bug.cgi?id=186306
1904         <rdar://problem/39874167>
1905
1906         Reviewed by Simon Fraser.
1907
1908         Rename the color-filter CSS property to -apple-color-filter.
1909
1910         * animation/KeyframeEffectReadOnly.cpp:
1911         (WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
1912         * css/CSSComputedStyleDeclaration.cpp:
1913         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1914         * css/CSSGradientValue.cpp:
1915         (WebCore::CSSGradientValue::image):
1916         (WebCore::CSSGradientValue::computeStops):
1917         (WebCore::CSSGradientValue::knownToBeOpaque const):
1918         * css/CSSProperties.json:
1919         * css/parser/CSSPropertyParser.cpp:
1920         (WebCore::CSSPropertyParser::parseSingleValue):
1921         * page/animation/CSSPropertyAnimation.cpp:
1922         (WebCore::blendFunc):
1923         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1924         * page/animation/ImplicitAnimation.cpp:
1925         (WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
1926         * page/animation/KeyframeAnimation.cpp:
1927         (WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
1928         * rendering/InlineTextBox.cpp:
1929         (WebCore::InlineTextBox::paintMarkedTextForeground):
1930         (WebCore::InlineTextBox::paintMarkedTextDecoration):
1931         * rendering/style/RenderStyle.cpp:
1932         (WebCore::RenderStyle::changeRequiresRepaint const):
1933         (WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
1934         (WebCore::RenderStyle::colorByApplyingColorFilter const):
1935         * rendering/style/RenderStyle.h:
1936         (WebCore::RenderStyle::mutableAppleColorFilter):
1937         (WebCore::RenderStyle::appleColorFilter const):
1938         (WebCore::RenderStyle::hasAppleColorFilter const):
1939         (WebCore::RenderStyle::setAppleColorFilter):
1940         (WebCore::RenderStyle::initialAppleColorFilter):
1941         (WebCore::RenderStyle::mutableColorFilter): Deleted.
1942         (WebCore::RenderStyle::colorFilter const): Deleted.
1943         (WebCore::RenderStyle::hasColorFilter const): Deleted.
1944         (WebCore::RenderStyle::setColorFilter): Deleted.
1945         (WebCore::RenderStyle::initialColorFilter): Deleted.
1946         * rendering/style/StyleRareInheritedData.cpp:
1947         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1948         (WebCore::StyleRareInheritedData::operator== const):
1949         (WebCore::StyleRareInheritedData::hasColorFilters const):
1950         * rendering/style/StyleRareInheritedData.h:
1951
1952 2018-06-06  Jer Noble  <jer.noble@apple.com>
1953
1954         REGRESSION (r231817?): Layout Test media/track/track-delete-during-setup.html is a flaky timeout
1955         https://bugs.webkit.org/show_bug.cgi?id=185889
1956         <rdar://problem/40583180>
1957
1958         Reviewed by Eric Carlson.
1959
1960         Explicitly update the network and ready states when detaching the AVPlayerItem
1961         from the AVPlayer.
1962
1963         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1964         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
1965
1966 2018-06-06  Antoine Quint  <graouts@apple.com>
1967
1968         Use the default label for snapshotted plug-ins if no mime-type is available
1969         https://bugs.webkit.org/show_bug.cgi?id=186348
1970
1971         Reviewed by Jon Lee.
1972
1973         In case the mime-type is not available, use the default labels otherwise we'd crash trying to look up the empty string in the HashMap.
1974
1975         * html/HTMLPlugInImageElement.cpp:
1976         (WebCore::titleText):
1977         (WebCore::subtitleText):
1978
1979 2018-06-06  Timothy Hatcher  <timothy@apple.com>
1980
1981         Wrong NSVisualEffectMaterial used for exit full screen overlay in dark mode.
1982
1983         https://bugs.webkit.org/show_bug.cgi?id=186350
1984         rdar://problem/39135535
1985
1986         Reviewed by Anders Carlsson.
1987
1988         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
1989         (-[WebCoreFullScreenPlaceholderView initWithFrame:]):
1990         Use the NSVisualEffectMaterialFullScreenUI on macOS 10.14 and don't
1991         set an explicit NSAppearance.
1992
1993 2018-06-06  Jer Noble  <jer.noble@apple.com>
1994
1995         Regions outside of the fullscreen window are exposed during zoom operations
1996         https://bugs.webkit.org/show_bug.cgi?id=186330
1997         <rdar://problem/34698009>
1998
1999         Reviewed by Simon Fraser.
2000
2001         Test: fullscreen/full-screen-layer-dump.html
2002
2003         Introduce the concept of "requiresBackgroundLayer" to RenderLayerBacking, for use by
2004         RenderFullScreen. Previously, the backgroundLayer in RenderLayerBacking was only used
2005         by the root renderer with fixed backgrounds. Give the RenderFullScreen a background layer
2006         that's approximately 3x as tall and wide as the renderer itself, so nothing is exposed
2007         during pinch operations.
2008
2009         * rendering/RenderLayerBacking.cpp:
2010         (WebCore::RenderLayerBacking::RenderLayerBacking):
2011         (WebCore::RenderLayerBacking::updateConfiguration):
2012         (WebCore::RenderLayerBacking::updateGeometry):
2013         (WebCore::RenderLayerBacking::updateDrawsContent):
2014         (WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
2015         (WebCore::RenderLayerBacking::updateBackgroundLayer):
2016         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
2017         (WebCore::RenderLayerBacking::paintIntoLayer):
2018         * rendering/RenderLayerBacking.h:
2019
2020 2018-06-06  Jer Noble  <jer.noble@apple.com>
2021
2022         Set the AVAssetResourceLoaderRequest's contentType to AVStreamingKeyDeliveryContentKeyType in the case of a FPS key request.
2023         https://bugs.webkit.org/show_bug.cgi?id=186328
2024         <rdar://problem/40829228>
2025
2026         Reviewed by Eric Carlson.
2027
2028         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2029         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
2030
2031 2018-06-06  Zalan Bujtas  <zalan@apple.com>
2032
2033         [LFC] Add margin computation for floating, replaced elements.
2034         https://bugs.webkit.org/show_bug.cgi?id=186337
2035
2036         Reviewed by Antti Koivisto.
2037
2038         If 'margin-left' or 'margin-right' are computed as 'auto', their used value is '0'.
2039
2040         * layout/FormattingContext.h:
2041         * layout/FormattingContextGeometry.cpp:
2042         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2043         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2044
2045 2018-06-06  Zalan Bujtas  <zalan@apple.com>
2046
2047         [LFC] Add margin computation for floating, no-replaced elements.
2048         https://bugs.webkit.org/show_bug.cgi?id=186334
2049
2050         Reviewed by Antti Koivisto.
2051
2052         If 'margin-left', or 'margin-right' are computed as 'auto', their used value is '0'.
2053
2054         * layout/FormattingContextGeometry.cpp:
2055         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2056
2057 2018-06-06  Antti Koivisto  <antti@apple.com>
2058
2059         Use minimal coverage rect for tiled layers when under memory pressure
2060         https://bugs.webkit.org/show_bug.cgi?id=186185
2061         <rdar://problem/40713608>
2062
2063         Reviewed by Darin Adler.
2064
2065         We do this for the main content layer already.
2066
2067         * platform/graphics/ca/GraphicsLayerCA.cpp:
2068         (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):
2069
2070 2018-06-05  Antoine Quint  <graouts@apple.com>
2071
2072         [Web Animations] Only expose CSSAnimation and CSSTransition if the WebAnimationsCSSIntegration runtime flag is enabled
2073         https://bugs.webkit.org/show_bug.cgi?id=186305
2074
2075         Reviewed by Dean Jackson.
2076
2077         * animation/CSSAnimation.idl:
2078         * animation/CSSTransition.idl:
2079
2080 2018-06-05  Per Arne Vollan  <pvollan@apple.com>
2081
2082         Move OpenGL display mask to screen data struct.
2083         https://bugs.webkit.org/show_bug.cgi?id=186198
2084         <rdar://problem/40724854>
2085
2086         Reviewed by Brent Fulgham.
2087
2088         Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
2089         it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
2090         resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
2091         display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
2092         the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
2093         window is available, the OpenGL display mask of the main display is used.
2094
2095         No new tests, since testing this requires two Web views in the same WebContent process, displayed on
2096         two different monitors.
2097
2098         * html/HTMLCanvasElement.cpp:
2099         (WebCore::HTMLCanvasElement::createImageBuffer const):
2100         * platform/PlatformScreen.h:
2101         * platform/ScreenProperties.h:
2102         (WebCore::ScreenProperties::encode const):
2103         (WebCore::ScreenProperties::decode):
2104         (WebCore::ScreenData::encode const):
2105         (WebCore::ScreenData::decode):
2106         * platform/graphics/GraphicsContext3D.h:
2107         * platform/graphics/ImageBuffer.cpp:
2108         (WebCore::ImageBuffer::create):
2109         * platform/graphics/ImageBuffer.h:
2110         * platform/graphics/cg/ImageBufferCG.cpp:
2111         (WebCore::ImageBuffer::createCompatibleBuffer):
2112         (WebCore::ImageBuffer::ImageBuffer):
2113         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2114         (WebCore::GraphicsContext3D::GraphicsContext3D):
2115         (WebCore::GraphicsContext3D::allowOfflineRenderers const):
2116         (WebCore::GraphicsContext3D::setOpenGLDisplayMask): Deleted.
2117         (WebCore::GraphicsContext3D::getOpenGLDisplayMask): Deleted.
2118         * platform/graphics/cocoa/IOSurface.h:
2119         * platform/graphics/cocoa/IOSurface.mm:
2120         (WebCore::IOSurface::ensurePlatformContext):
2121         * platform/mac/PlatformScreenMac.mm:
2122         (WebCore::screenProperties):
2123         (WebCore::collectScreenProperties):
2124         (WebCore::setScreenProperties):
2125         (WebCore::screenData):
2126         (WebCore::primaryOpenGLDisplayMask):
2127         (WebCore::displayMaskForDisplay):
2128         (WebCore::getScreenProperties):
2129         (WebCore::screenIsMonochrome):
2130         (WebCore::screenHasInvertedColors):
2131         (WebCore::screenDepth):
2132         (WebCore::screenDepthPerComponent):
2133         (WebCore::screenRectForDisplay):
2134         (WebCore::screenRect):
2135         (WebCore::screenAvailableRect):
2136         (WebCore::screenColorSpace):
2137         (WebCore::screenSupportsExtendedColor):
2138
2139 2018-06-05  Jer Noble  <jer.noble@apple.com>
2140
2141         REGRESSION (231817): Videos permanently blank out after switching out of a tab and back in
2142         https://bugs.webkit.org/show_bug.cgi?id=186326
2143         <rdar://problem/40778157>
2144
2145         Reviewed by Eric Carlson.
2146
2147         Check whether the element is visible in the viewport when the web view itself becomes visible, and if so, clear the m_elementIsHiddenUntilVisibleInViewport flag.
2148
2149         * html/MediaElementSession.cpp:
2150         (WebCore::MediaElementSession::visibilityChanged):
2151         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2152
2153 2018-06-05  Zalan Bujtas  <zalan@apple.com>
2154
2155         [LFC] Move inflow, replaced width and margin computation to a dedicated function.
2156         https://bugs.webkit.org/show_bug.cgi?id=186327
2157
2158         Reviewed by Sam Weinig.
2159
2160         I was searching for the function inFlowReplacedWidthAndMargin() and there was none.
2161
2162         * layout/blockformatting/BlockFormattingContext.h:
2163         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2164         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2165         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2166
2167 2018-06-05  Zalan Bujtas  <zalan@apple.com>
2168
2169         [LFC] Add missing margins for inflow, non replaced block and replaced inline elements
2170         https://bugs.webkit.org/show_bug.cgi?id=186332
2171
2172         Reviewed by Darin Adler.
2173
2174         * layout/FormattingContextGeometry.cpp:
2175         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2176         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2177         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2178
2179 2018-06-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2180
2181         [macOS] Spelling errors in the middle of an inserted paragraph are not displayed
2182         https://bugs.webkit.org/show_bug.cgi?id=185584
2183         <rdar://problem/38676081>
2184
2185         Reviewed by Ryosuke Niwa.
2186
2187         Currently when typing, we only consider the range of adjacent words when determining where to place spelling
2188         correction markers, even though we provide NSSpellChecker with the full context of the sentence (and get back
2189         results encompassing the full range). In macOS Mojave, NSSpellChecker may now return spell checking results that
2190         include correctly spelled words that are misused in the context of the sentence. This means that while typing a
2191         sentence, a different part of the sentence may gain or lose spelling markers as a result.
2192
2193         To support this, WebKit needs to mark or unmark spelling corrections in the full range of the sentence whenever
2194         a full word is typed (since the context of other words within the sentence may have changed, resulting in
2195         different platform spellchecking results). In markMisspellingsAfterTypingToWord, we expand the spell checking
2196         range past the adjacent words so that it encompasses the largest subrange of the full sentence that includes the
2197         start of the typed word, and does not include any position that is under an element with `spellcheck=false`.
2198
2199         This guarantees that we don't erroneously place spelling document markers under elements where spellchecking is
2200         disabled, while allowing for sentence retro corrections when spellchecking is enabled. However, this doesn't
2201         handle the case where an element with spellchecking disabled lies between a sentence retro correction range and
2202         the currently typed word. In the future, we could fix this by refactoring SpellCheckRequest to track a list of
2203         non-contiguous spelling correction ranges — see the FIXME in markMisspellingsAfterTypingToWord for more detail.
2204
2205         Covered by 2 new layout tests, as well as an existing spell-checking test that should now be passing.
2206
2207         Tests: editing/spelling/retro-correction-spelling-markers.html
2208                editing/spelling/spelling-markers-after-pasting-sentence.html
2209
2210         * editing/Editor.cpp:
2211         (WebCore::Editor::markMisspellingsAfterTypingToWord):
2212         * testing/Internals.h:
2213         * testing/Internals.idl:
2214
2215         Add an internal testing helper to determine whether retro sentence corrections are enabled.
2216
2217 2018-06-05  Darin Adler  <darin@apple.com>
2218
2219         [Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers
2220         https://bugs.webkit.org/show_bug.cgi?id=186324
2221
2222         Reviewed by Anders Carlsson.
2223
2224         * platform/FileMonitor.h: Use OSObjectPtr instead of DispatchPtr.
2225         * platform/cocoa/FileMonitorCocoa.mm:
2226         (WebCore::FileMonitor::FileMonitor): Ditto.
2227
2228 2018-06-05  Ryan Haddad  <ryanhaddad@apple.com>
2229
2230         Unreviewed, fix the macOS build with recent SDKs.
2231
2232         * page/mac/ServicesOverlayController.mm:
2233         (WebCore::ServicesOverlayController::Highlight::paintContents):
2234
2235 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
2236
2237         Adjust compile and runtime flags to match shippable state of features
2238         https://bugs.webkit.org/show_bug.cgi?id=186319
2239         <rdar://problem/40352045>
2240
2241         Reviewed by Maciej Stachowiak, Jon Lee, and others.
2242
2243         * Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
2244         or ENABLE_INPUT_TYPE_COLOR_POPOVER.
2245
2246 2018-06-05  Timothy Hatcher  <timothy@apple.com>
2247
2248         Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query
2249
2250         https://bugs.webkit.org/show_bug.cgi?id=186323
2251         rdar://problem/38382252
2252
2253         Reviewed by Tim Horton.
2254
2255         * css/MediaFeatureNames.h:
2256         * css/MediaQueryEvaluator.cpp:
2257         (WebCore::prefersDarkInterfaceEvaluate):
2258         (WebCore::defaultAppearanceEvaluate): Deleted.
2259         * css/MediaQueryExpression.cpp:
2260         (WebCore::featureWithValidIdent):
2261         (WebCore::isFeatureValidWithoutValue):
2262         * platform/mac/LocalDefaultSystemAppearance.mm:
2263         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2264
2265 2018-06-05  Darin Adler  <darin@apple.com>
2266
2267         [Cocoa] Improve some soft linking compatibility with ARC
2268         https://bugs.webkit.org/show_bug.cgi?id=186309
2269
2270         Reviewed by Anders Carlsson.
2271
2272         * platform/audio/ios/AudioSessionIOS.mm: Use SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER
2273         for NSString constants.
2274         * platform/audio/ios/MediaSessionManagerIOS.mm: Ditto.
2275         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: Ditto.
2276         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: Ditto.
2277         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: Ditto.
2278         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
2279         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): Use __bridge for
2280         some bridging casts.
2281         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
2282         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto.
2283         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): Ditto.
2284         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Use
2285         SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER for NSString constants.
2286         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Ditto.
2287         * platform/mediastream/mac/AVCaptureDeviceManager.mm: Ditto.
2288         * platform/mediastream/mac/AVMediaCaptureSource.mm: Ditto.
2289         * platform/mediastream/mac/AVVideoCaptureSource.mm: Ditto.
2290
2291 2018-06-05  Youenn Fablet  <youenn@apple.com>
2292
2293         ServiceWorker registration should store any script fetched through importScripts
2294         https://bugs.webkit.org/show_bug.cgi?id=182444
2295         <rdar://problem/37164835>
2296
2297         Reviewed by Chris Dumez.
2298
2299         Covered by added test http/wpt/service-workers/persistent-importScripts.html.
2300
2301         Update importScripts implementation to look for/update the resource map in case of service worker scope.
2302         This resource map is stored persistently and sent when running the service worker.
2303
2304         Add support to persistent storage of this resource map.
2305         This requires updating the schema database.
2306         The schema version is bumped to 2 and we delete any data related to old registrations.
2307
2308         When updating the service worker, the resource map is currently flushed so that all scripts will be retrieved from the network.
2309
2310         Did some limited refactoring to put more loading handling in WorkerScriptLoader.
2311
2312         * workers/WorkerGlobalScope.cpp:
2313         (WebCore::WorkerGlobalScope::importScripts):
2314         * workers/WorkerScriptLoader.cpp:
2315         (WebCore::WorkerScriptLoader::loadSynchronously):
2316         (WebCore::WorkerScriptLoader::script):
2317         * workers/WorkerScriptLoader.h:
2318         * workers/service/ServiceWorkerContextData.cpp:
2319         (WebCore::ServiceWorkerContextData::isolatedCopy const):
2320         * workers/service/ServiceWorkerContextData.h:
2321         (WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy const):
2322         (WebCore::ServiceWorkerContextData::ImportedScript::encode const):
2323         (WebCore::ServiceWorkerContextData::ImportedScript::decode):
2324         (WebCore::ServiceWorkerContextData::encode const):
2325         (WebCore::ServiceWorkerContextData::decode):
2326         * workers/service/ServiceWorkerGlobalScope.cpp:
2327         (WebCore::ServiceWorkerGlobalScope::scriptResource const):
2328         (WebCore::ServiceWorkerGlobalScope::setScriptResource):
2329         * workers/service/ServiceWorkerGlobalScope.h:
2330         * workers/service/context/SWContextManager.h:
2331         * workers/service/server/RegistrationDatabase.cpp:
2332         (WebCore::v1RecordsTableSchema):
2333         (WebCore::RegistrationDatabase::doPushChanges):
2334         (WebCore::RegistrationDatabase::importRecords):
2335         * workers/service/server/SWServer.cpp:
2336         (WebCore::SWServer::addRegistrationFromStore):
2337         (WebCore::SWServer::updateWorker):
2338         (WebCore::SWServer::installContextData):
2339         * workers/service/server/SWServer.h:
2340         * workers/service/server/SWServerJobQueue.cpp:
2341         (WebCore::SWServerJobQueue::scriptFetchFinished):
2342         * workers/service/server/SWServerToContextConnection.cpp:
2343         (WebCore::SWServerToContextConnection::setScriptResource):
2344         * workers/service/server/SWServerToContextConnection.h:
2345         * workers/service/server/SWServerWorker.cpp:
2346         (WebCore::SWServerWorker::SWServerWorker):
2347         (WebCore::m_scriptResourceMap):
2348         (WebCore::SWServerWorker::contextData const):
2349         (WebCore::SWServerWorker::setScriptResource):
2350         * workers/service/server/SWServerWorker.h:
2351
2352 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
2353
2354         Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
2355         https://bugs.webkit.org/show_bug.cgi?id=186286
2356         <rdar://problem/40782992>
2357
2358         Reviewed by Dan Bernstein.
2359
2360         Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
2361         to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
2362         change this flag when preparing for a production release.
2363
2364         * Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
2365         whether experimental features should be enabled, and use it to properly define the
2366         feature flag.
2367
2368 2018-06-05  Brent Fulgham  <bfulgham@apple.com>
2369
2370         Unreviewed build fix after r232511.
2371         https://bugs.webkit.org/show_bug.cgi?id=186304
2372
2373         * platform/ios/WebItemProviderPasteboard.mm: Add missing include.
2374
2375 2018-06-05  Antoine Quint  <graouts@apple.com>
2376
2377         Fix the iOS build after r232496
2378         https://bugs.webkit.org/show_bug.cgi?id=186304
2379
2380         Reviewed by Brent Fulgham.
2381
2382         The changes in r232496 changed the InputType::element() signature from HTMLInputElement&
2383         to HTMLInputElement* and some call sites did not expect that.
2384
2385         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2386         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
2387         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
2388         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue):
2389         (WebCore::BaseChooserOnlyDateAndTimeInputType::didChooseValue):
2390         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
2391         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
2392         (WebCore::BaseChooserOnlyDateAndTimeInputType::accessKeyAction):
2393         (WebCore::BaseChooserOnlyDateAndTimeInputType::isMouseFocusable const):
2394         * html/BaseDateAndTimeInputType.cpp:
2395         (WebCore::BaseDateAndTimeInputType::setValueAsDate const):
2396         (WebCore::BaseDateAndTimeInputType::valueAsDouble const):
2397         (WebCore::BaseDateAndTimeInputType::setValueAsDecimal const):
2398         (WebCore::BaseDateAndTimeInputType::typeMismatch const):
2399         (WebCore::BaseDateAndTimeInputType::serializeWithComponents const):
2400         (WebCore::BaseDateAndTimeInputType::localizeValue const):
2401         (WebCore::BaseDateAndTimeInputType::visibleValue const):
2402         (WebCore::BaseDateAndTimeInputType::valueMissing const):
2403         (WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const):
2404         * html/DateInputType.cpp:
2405         (WebCore::DateInputType::createStepRange const):
2406         * html/DateTimeLocalInputType.cpp:
2407         (WebCore::DateTimeLocalInputType::createStepRange const):
2408         * html/MonthInputType.cpp:
2409         (WebCore::MonthInputType::valueAsDate const):
2410         (WebCore::MonthInputType::createStepRange const):
2411         * html/TimeInputType.cpp:
2412         (WebCore::TimeInputType::createStepRange const):
2413         * html/WeekInputType.cpp:
2414         (WebCore::WeekInputType::createStepRange const):
2415
2416 2018-06-03  Darin Adler  <darin@apple.com>
2417
2418         Simplify and remove some unused video element code (helpful for ARC-compatibility)
2419         https://bugs.webkit.org/show_bug.cgi?id=186258
2420
2421         Reviewed by Daniel Bates.
2422
2423         My main mission was to remove the PlatformMedia struct, which had a union
2424         of Objective-C object pointers in it, which doesn't work in ARC. However, I
2425         found some other unused code to remove and simple mistakes to fix.
2426
2427         * Modules/mediasource/VideoPlaybackQuality.cpp:
2428         (WebCore::VideoPlaybackQuality::create): Use unsigned instead of unsigned long,
2429         since IDL "unsigned long" really means unsigned.
2430         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality): Ditto.
2431         * Modules/mediasource/VideoPlaybackQuality.h: Updated for the above.
2432
2433         * html/HTMLMediaElement.cpp:
2434         (WebCore::HTMLMediaElement::platformMedia const): Deleted.
2435         * html/HTMLMediaElement.h: Updated for the above.
2436
2437         * platform/graphics/MediaPlayer.cpp:
2438         (WebCore::MediaPlayer::MediaPlayer): Moved initialization of many data members
2439         to the class definition.
2440         (WebCore::MediaPlayer::load): Use nullptr instead of 0.
2441         (WebCore::MediaPlayer::platformMedia const): Deleted.
2442         (WebCore::MediaPlayer::videoPlaybackQualityMetrics): Updated name of return type.
2443         (WebCore::MediaPlayer::objCAVFoundationAVPlayer const): Added. Replaces
2444         platformMedia for the one case where it was being used.
2445         * platform/graphics/MediaPlayer.h: Removed unneeded includes. Re-sorted things.
2446         Updated for the above. Removed PlatformMedia struct and NoPlatformMedia constant.
2447         Removed explicit constructor in MediaEngineSupportParameters. Renamed
2448         PlatformVideoPlaybackQualityMetrics struct to VideoPlaybackQualityMetrics,
2449         removed its constructor, and changed types from unsigned long to unsigned.
2450         Un-nested #if statements. Removed some Chromium-specific comments.
2451
2452         * platform/graphics/MediaPlayerPrivate.h: Removed unneeded includes and
2453         forward declarations. Removed platformMedia. Updated return type for
2454         videoPlaybackQualityMetrics. Added objCAVFoundationAVPlayer.
2455
2456         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2457         Removed platformMedia.
2458
2459         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2460         (WebCore::MediaPlayerPrivateAVFoundation::platformMedia const): Deleted.
2461         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2462         Updated for the above.
2463
2464         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2465         Added override of objCAVFoundationAVPlayer. Removed platformMedia.
2466         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2467         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const): Deleted.
2468
2469         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2470         Removed platformMedia. Updated return type for videoPlaybackQualityMetrics.
2471         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2472         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformMedia const): Deleted.
2473         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
2474         Updated return type, changed to use aggregate initialization instead of
2475         calling a constructor, and added casts to unsigned.
2476
2477         * platform/graphics/cocoa/WebCoreDecompressionSession.h: Switched from
2478         unsigned long to unsigned for frame counts and from long to int for
2479         quality of service tier.
2480
2481         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2482         (WebCore::MediaPlayerPrivateGStreamerBase::platformMedia): Deleted.
2483         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2484         Updated for the above.
2485
2486         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2487         Removed videoPlaybackQualityMetrics since it was overriding a derived function
2488         without changing its behavior, and the type has changed.
2489
2490         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2491         (WebCore::MockMediaPlayerMediaSource::load): Pass two references.
2492         (WebCore::MockMediaPlayerMediaSource::videoPlaybackQualityMetrics):
2493         Updated return type.
2494         * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Updated for the above.
2495
2496         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
2497         (WebCore::MockMediaSourcePrivate::create): Return a Ref, take references.
2498         (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Moved most data
2499         member initialization into the class definition. Take references.
2500         (WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate): Use a modern for loop.
2501         (WebCore::MockMediaSourcePrivate::durationChanged): Update since m_player is a
2502         reference.
2503         (WebCore::MockMediaSourcePrivate::markEndOfStream): Ditto.
2504         (WebCore::MockMediaSourcePrivate::readyState): Ditto.
2505         (WebCore::MockMediaSourcePrivate::setReadyState): Ditto.
2506         (WebCore::MockMediaSourcePrivate::waitForSeekCompleted): Ditto.
2507         (WebCore::MockMediaSourcePrivate::seekCompleted): Ditto.
2508         (WebCore::MockMediaSourcePrivate::removeSourceBuffer): Use Vector::removeFirst
2509         instead of find/remove pairs.
2510         (WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState): Ditto.
2511         (WebCore::MockMediaSourcePrivate::seekToTime): Use modern for loop.
2512         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics): Updated return
2513         type, changed to use aggregate initialization instead of calling a constructor.
2514         * platform/mock/mediasource/MockMediaSourcePrivate.h: Updated for the above.
2515
2516         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2517         (WebCore::MockSourceBufferPrivate::readyState): Updated since player is now
2518         a reference.
2519         (WebCore::MockSourceBufferPrivate::setReadyState): Ditto.
2520
2521 2018-06-04  Darin Adler  <darin@apple.com>
2522
2523         [Cocoa] Improve smart pointer support for ARC (OSObjectPtr/DispatchPtr)
2524         https://bugs.webkit.org/show_bug.cgi?id=186300
2525
2526         Reviewed by Daniel Bates.
2527
2528         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: Removed unnecessary
2529         include of OSObjectPtr.h.
2530         * platform/ios/WebItemProviderPasteboard.mm: Ditto.
2531
2532 2018-06-05  Joanmarie Diggs  <jdiggs@igalia.com>
2533
2534         AX: Implement support for new blockquote, caption, and paragraph ARIA roles
2535         https://bugs.webkit.org/show_bug.cgi?id=186274
2536
2537         Reviewed by Chris Fleizach.
2538
2539         Add the three new ARIA roles to the internal rolemap so that they are treated in
2540         the same fashion as their HTML element counterparts. Also ensure that an element
2541         with an explicit caption role does not get pruned from the macOS accessibility tree.
2542
2543         No new tests. Instead add the roles to the existing role-exposure tests.
2544
2545         * accessibility/AccessibilityObject.cpp:
2546         (WebCore::initializeRoleMap):
2547         * accessibility/mac/AccessibilityObjectMac.mm:
2548         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
2549         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2550         (createAccessibilityRoleMap):
2551
2552 2018-06-05  Zalan Bujtas  <zalan@apple.com>
2553
2554         [LFC] Merge width and margin computation for block-level, replaced elements in normal flow
2555         https://bugs.webkit.org/show_bug.cgi?id=186270
2556
2557         Reviewed by Sam Weinig.
2558
2559         https://www.w3.org/TR/CSS22/visudet.html#block-replaced-width
2560         10.3.4 Block-level, replaced elements in normal flow
2561
2562         The used value of 'width' is determined as for inline replaced elements.
2563         Then the rules for non-replaced block-level elements are applied to determine the margins.
2564
2565         * layout/blockformatting/BlockFormattingContext.h:
2566         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2567         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2568         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2569
2570 2018-06-04  Enrique Ocaña González  <eocanha@igalia.com>
2571
2572         [GStreamer][MSE] MediaPlayerPrivateGStreamerMSE.h includes and forward declares PlaybackPipeline
2573         https://bugs.webkit.org/show_bug.cgi?id=186190
2574
2575         Reviewed by Xabier Rodriguez-Calvar.
2576
2577         This is just a compilation improvement.
2578
2579         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2580         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2581         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2582
2583 2018-06-03  Darin Adler  <darin@apple.com>
2584
2585         [Cocoa] Update more code to be more ARC-compatible to prepare for future ARC adoption
2586         https://bugs.webkit.org/show_bug.cgi?id=186245
2587
2588         Reviewed by Daniel Bates.
2589
2590         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2591         (convertToNSArray): Explicitly cast to WebAccessibilityObjectWrapperBase so we don't
2592         make method calls on WebAccessibilityObjectWrapper, a forward-declared class.
2593         (-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]): Use CFAutorelease
2594         for the CGPathRef return value instead of Objective-C autorelease. Another option
2595         would be to use RetainPtr for the return type instead.
2596
2597         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2598         (AXObjectIsTextMarker): Use __bridge for bridging typecast.
2599         (AXObjectIsTextMarkerRange): Ditto.
2600         (AXTextMarkerRange): Ditto.
2601         (AXTextMarkerRangeStart): Ditto.
2602         (AXTextMarkerRangeEnd): Ditto.
2603         (isTextMarkerIgnored): Ditto.
2604         (accessibilityObjectForTextMarker): Ditto.
2605         (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]): Ditto.
2606         (-[WebAccessibilityObjectWrapper visiblePositionForTextMarker:]): Ditto.
2607         (visiblePositionForStartOfTextMarkerRange): Ditto.
2608         (visiblePositionForEndOfTextMarkerRange): Ditto.
2609         (AXAttributeStringSetFont): Ditto. Also use @{} syntax to make NSDictionary
2610         and @() to make NSNumber.
2611         (AXAttributeStringSetColor): Use __bridge for bridging typecast, rearranging
2612         code so that the typecasts are on function arguments, not local variables,
2613         which makes lifetimes clearer.
2614         (AXAttributeStringSetElement): Use __bridge for bridging typecast.
2615         (WebTransformCGPathToNSBezierPath):
2616         (-[WebAccessibilityObjectWrapper bezierPathFromPath:]): Added a bridging
2617         typecast when passing an NSBezierPath through as a void* context argument;
2618         silent conversion to void* is not compatible with ARC.
2619         (createAccessibilityRoleMap): Use __unsafe_unretained for a table of
2620         NSString constants.
2621
2622         * bindings/js/ScriptControllerMac.mm:
2623         (WebCore::ScriptController::createScriptInstanceForWidget): Use __bridge
2624         for bridging typecast.
2625
2626         * bridge/objc/objc_class.mm:
2627         (JSC::Bindings::ObjcClass::classForIsA): Added bridging typecasts
2628         to convert a Class into a CFTypeRef.
2629         (JSC::Bindings::ObjcClass::methodNamed const): Use __bridge for bridging
2630         typecast.
2631         (JSC::Bindings::ObjcClass::fieldNamed const): Ditto.
2632         * bridge/objc/objc_instance.mm:
2633         (ObjcInstance::invokeObjcMethod): Ditto.
2634         * bridge/objc/objc_runtime.mm:
2635         (JSC::Bindings::ObjcField::valueFromInstance const): Ditto.
2636         (JSC::Bindings::ObjcField::setValueToInstance const): Ditto.
2637         * bridge/objc/objc_utility.mm:
2638         (JSC::Bindings::convertObjcValueToValue): Ditto. Also add a missing const
2639         to make it clearer to the compiler that the code is correct.
2640         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
2641         (WebCore::createAndStoreMasterKey): Ditto.
2642         (WebCore::findMasterKey): Ditto.
2643         * editing/cocoa/DataDetection.mm:
2644         (WebCore::detectItemAtPositionWithRange): Ditto.
2645         * editing/cocoa/EditorCocoa.mm:
2646         (WebCore::Editor::fontAttributesForSelectionStart const): Ditto.
2647         * editing/cocoa/HTMLConverter.mm:
2648         (_font): Ditto.
2649         (fileWrapperForElement): Ditto.
2650         * fileapi/FileCocoa.mm:
2651         (WebCore::File::shouldReplaceFile): Ditto.
2652         * loader/archive/cf/LegacyWebArchiveMac.mm:
2653         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Ditto.
2654         * page/mac/TextIndicatorWindow.mm:
2655         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Ditto.
2656         (createContentCrossfadeAnimation): Ditto.
2657         * platform/cocoa/LocalizedStringsCocoa.mm:
2658         (WebCore::localizedString): Ditto.
2659         * platform/cocoa/SharedBufferCocoa.mm:
2660         (WebCore::SharedBuffer::create): Ditto.
2661         (WebCore::SharedBuffer::append): Ditto.
2662         * platform/graphics/FontPlatformData.h:
2663         (WebCore::toCTFont): Ditto.
2664         (WebCore::toNSFont): Ditto.
2665         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
2666         (WebCore::assetTrackMeetsHardwareDecodeRequirements): Ditto.
2667         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2668         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Ditto.
2669         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2670         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage): Ditto.
2671         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2672         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage): Ditto.
2673         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2674         (WebCore::MediaDescriptionAVFObjC::MediaDescriptionAVFObjC): Ditto.
2675         (WebCore::bufferWasConsumedCallback): Ditto.
2676         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
2677         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
2678         (WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage): Ditto.
2679         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer): Ditto.
2680         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2681         (PlatformCALayerCocoa::create): Ditto.
2682         (PlatformCALayer::platformCALayer): Ditto.
2683         (PlatformCALayerCocoa::superlayer const): Ditto.
2684         (PlatformCALayerCocoa::contents const): Ditto.
2685         (PlatformCALayerCocoa::setContents): Ditto.
2686         * platform/graphics/cocoa/IOSurface.h: Ditto.
2687         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
2688         (TextTrackRepresentationCocoa::update): Ditto.
2689         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2690         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample): Ditto.
2691         (WebCore::WebCoreDecompressionSession::resetQosTier): Ditto.
2692         * platform/graphics/cocoa/WebGLLayer.mm:
2693         (-[WebGLLayer display]): Ditto.
2694         * platform/graphics/mac/ImageMac.mm:
2695         (WebCore::BitmapImage::nsImage): Ditto.
2696         (WebCore::BitmapImage::snapshotNSImage): Ditto.
2697         * platform/graphics/mac/WebLayer.mm:
2698         (-[WebLayer drawInContext:]): Ditto.
2699         (-[WebSimpleLayer setNeedsDisplay]): Ditto.
2700         (-[WebSimpleLayer setNeedsDisplayInRect:]): Ditto.
2701         (-[WebSimpleLayer display]): Ditto.
2702         (-[WebSimpleLayer drawInContext:]): Ditto.
2703
2704         * platform/mac/CursorMac.mm:
2705         (WebCore::cursor): Mark pointer __strong to match the globals it points to.
2706
2707         * platform/mac/FileSystemMac.mm:
2708         (WebCore::FileSystem::setMetadataURL): Use RetainPtr instead of autorelease.
2709
2710         * platform/mac/PlatformPasteboardMac.mm:
2711         (WebCore::PlatformPasteboard::bufferForType): Use __bridge for bridging
2712         typecast.
2713         * platform/mac/PlatformSpeechSynthesizerMac.mm:
2714         (WebCore::speechSynthesisGetVoiceIdentifiers): Ditto.
2715         (WebCore::speechSynthesisGetDefaultVoiceIdentifierForLocale): Ditto.
2716
2717         * platform/mac/PluginBlacklist.h: Use RetainPtr instead of explicit retain
2718         and release for NSDictionary and NSSet.
2719         * platform/mac/PluginBlacklist.mm:
2720         (WebCore::PluginBlacklist::create): Use __bridge for bridging typecast.
2721         (WebCore::PluginBlacklist::~PluginBlacklist): Remove explicit CFRelease calls.
2722         (WebCore::PluginBlacklist::PluginBlacklist): Add adoptNS calls and remove
2723         explciit CFRetain/release pairs.
2724
2725         * platform/mac/PublicSuffixMac.mm:
2726         (WebCore::isPublicSuffix): Use __bridge for bridging typecast.
2727         * platform/mac/RemoteCommandListenerMac.mm:
2728         (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Ditto.
2729         * platform/mac/SerializedPlatformRepresentationMac.mm:
2730         (WebCore::jsValueWithDictionaryInContext): Ditto.
2731         * platform/mac/URLMac.mm:
2732         (WebCore::URL::URL): Ditto.
2733         (WebCore::URL::createCFURL const): Ditto.
2734
2735         * platform/mac/WebCoreNSURLExtras.mm:
2736         (WebCore::collectRangesThatNeedMapping): Mark pointer __strong to match the
2737         local variable it eventually points to.
2738         (WebCore::stringByTrimmingWhitespace): Use __bridge for bridging typecast.
2739         (WebCore::URLByTruncatingOneCharacterBeforeComponent): Use
2740         CFBridgingRelease instead of autorelease, reducing typecasts.
2741         (WebCore::URLByRemovingComponentAndSubsequentCharacter): Ditto.
2742         (WebCore::userVisibleString): Use __bridge for bridging typecast.
2743         (WebCore::isUserVisibleURL): Ditto.
2744
2745         * platform/mac/WebGLBlacklist.mm:
2746         (WebCore::WebGLBlacklist::create): Use __bridge for bridging typecast.
2747         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2748         (WebCore::AVVideoCaptureSource::setPreset): Ditto.
2749         (WebCore::AVVideoCaptureSource::setupCaptureSession): Ditto. Also use @()
2750         instead of NSNumber.
2751         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2752         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Ditto.
2753         * platform/network/cocoa/ResourceRequestCocoa.mm:
2754         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody): Ditto.
2755
2756         * platform/network/cocoa/ResourceResponseCocoa.mm: Use CFStringRef and
2757         CFSTR for constant string array commonHeaderFields rather than using
2758         NSString * and then relying on implicit bridging conversion.
2759
2760         * platform/network/mac/CertificateInfoMac.mm:
2761         (WebCore::CertificateInfo::dump const): Use __bridge for bridging typecast.
2762         * platform/network/mac/FormDataStreamMac.mm:
2763         (WebCore::createHTTPBodyNSInputStream): Ditto.
2764         (WebCore::httpBodyFromStream): Ditto.
2765         * platform/network/mac/ResourceErrorMac.mm:
2766         (WebCore::ResourceError::ResourceError): Ditto.
2767         (WebCore::ResourceError::cfError const): Ditto.
2768
2769         * rendering/RenderThemeMac.mm:
2770         (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
2771         Use CFSTR("") instead of @"" for a string that is passed to CFDIctionaryRef.
2772         (WebCore::AttachmentLayout::layOutTitle): Use __bridge for bridging typecast.
2773         (WebCore::AttachmentLayout::layOutSubtitle): Ditto.
2774
2775         * testing/cocoa/WebArchiveDumpSupport.mm:
2776         (WebCoreTestSupport::createCFURLResponseFromResponseData): Use __bridge for
2777         bridging typecast.
2778         (WebCoreTestSupport::supportedNonImageMIMETypes): Deleted.
2779         (WebCoreTestSupport::convertWebResourceDataToString): Use the
2780         MIMETypeRegistry::isSupportedNonImageMIMEType function directly instead of
2781         building a CFArray out of MIMETypeRegistry::getSupportedNonImageMIMETypes
2782         and using CFArrayContainsValue. This is both much more direct and much more
2783         efficient as well.
2784
2785 2018-06-04  Timothy Hatcher  <timothy@apple.com>
2786
2787         [Win] REGRESSION(r232486) 'WebCore::RenderTheme::activeListBoxSelectionBackgroundColor': function does not take 0 arguments
2788         https://bugs.webkit.org/show_bug.cgi?id=186296
2789
2790         Unreviewed build fix.
2791
2792         * platform/win/PopupMenuWin.cpp:
2793         (WebCore::PopupMenuWin::paint):
2794         * rendering/RenderThemeWin.cpp:
2795         (WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
2796
2797 2018-06-04  Chris Dumez  <cdumez@apple.com>
2798
2799         Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
2800         https://bugs.webkit.org/show_bug.cgi?id=186287
2801         <rdar://problem/40783352>
2802
2803         Reviewed by Youenn Fablet.
2804
2805         Tests: http/wpt/cross-origin-window-policy/allow-postmessage-from-deny.html
2806                http/wpt/cross-origin-window-policy/allow-postmessage.html
2807                http/wpt/cross-origin-window-policy/cross-origin-window-policy-header.html
2808                http/wpt/cross-origin-window-policy/navigation-from-opener-via-open-target.html
2809                http/wpt/cross-origin-window-policy/navigation-from-subframe-via-anchor-target.html
2810
2811         * bindings/js/JSDOMBindingSecurity.cpp:
2812         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginWindowPolicy):
2813         * bindings/js/JSDOMBindingSecurity.h:
2814         * bindings/js/JSDOMWindowCustom.cpp:
2815         (WebCore::effectiveCrossOriginWindowPolicyForAccess):
2816         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2817         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2818         (WebCore::addCrossOriginWindowPropertyNames):
2819         (WebCore::addScopedChildrenIndexes):
2820         * bindings/scripts/CodeGeneratorJS.pm:
2821         (GenerateAttributeGetterBodyDefinition):
2822         (GetCrossOriginsOptionsFromExtendedAttributeValue):
2823         (GenerateAttributeSetterBodyDefinition):
2824         (GenerateOperationBodyDefinition):
2825         * bindings/scripts/IDLAttributes.json:
2826         * dom/Document.cpp:
2827         (WebCore::Document::canNavigate):
2828         * loader/FrameLoader.cpp:
2829         (WebCore::FrameLoader::didBeginDocument):
2830         * page/AbstractDOMWindow.cpp:
2831         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
2832         * page/AbstractDOMWindow.h:
2833         (WebCore::AbstractDOMWindow::crossOriginWindowPolicy):
2834         (WebCore::AbstractDOMWindow::setCrossOriginWindowPolicy):
2835         * page/DOMWindow.idl:
2836         * page/Settings.yaml:
2837         * platform/network/HTTPHeaderNames.in:
2838         * platform/network/HTTPParsers.cpp:
2839         (WebCore::parseCrossOriginWindowPolicyHeader):
2840         * platform/network/HTTPParsers.h:
2841
2842 2018-06-04  Brent Fulgham  <bfulgham@apple.com>
2843
2844         REGRESSION(r231291): InputType should hold a WeakPtr to its HTMLInputElement
2845         https://bugs.webkit.org/show_bug.cgi?id=186096
2846         <rdar://problem/40651015>
2847
2848         Reviewed by Ryosuke Niwa.
2849
2850         Now that the InputType may be kept alive as part of in-flight form submissions, we
2851         shouldn't assume that the referenced HTMLInputElement is still valid before using it.
2852
2853         The only time we should be lacking a referencing element is in cases where the InputType
2854         is changing, either through a change in the HTMLInputElement's type attribute. In those
2855         cases we should check for a valid HTMLInputElement. In other cases, we should ASSERT.
2856
2857         * html/BaseButtonInputType.cpp:
2858         (WebCore::BaseButtonInputType::createInputRenderer):
2859         (WebCore::BaseButtonInputType::setValue):
2860         * html/BaseCheckableInputType.cpp:
2861         (WebCore::BaseCheckableInputType::saveFormControlState const):
2862         (WebCore::BaseCheckableInputType::restoreFormControlState):
2863         (WebCore::BaseCheckableInputType::appendFormData const):
2864         (WebCore::BaseCheckableInputType::handleKeydownEvent):
2865         (WebCore::BaseCheckableInputType::accessKeyAction):
2866         (WebCore::BaseCheckableInputType::setValue):
2867         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2868         (WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Add a nullptr check
2869         here, since this is called directly by code that causes the old InputType to be removed,
2870         which could leave us with a nullptr element().
2871         * html/BaseClickableWithKeyInputType.cpp:
2872         (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
2873         (WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
2874         (WebCore::BaseClickableWithKeyInputType::accessKeyAction):
2875         * html/BaseDateAndTimeInputType.cpp:
2876         (WebCore::BaseDateAndTimeInputType::attributeChanged): Add a nullptr check
2877         here, since this is called directly by code that causes the old InputType to be removed,
2878         which could leave us with a nullptr element().
2879         * html/BaseTextInputType.cpp:
2880         (WebCore::BaseTextInputType::patternMismatch const):
2881         * html/CheckboxInputType.cpp:
2882         (WebCore::CheckboxInputType::valueMissing const):
2883         (WebCore::CheckboxInputType::willDispatchClick):
2884         (WebCore::CheckboxInputType::didDispatchClick):
2885         (WebCore::CheckboxInputType::shouldAppearIndeterminate const):
2886         * html/ColorInputType.cpp:
2887         (WebCore::ColorInputType::valueAsColor const):
2888         (WebCore::ColorInputType::createShadowSubtree):
2889         (WebCore::ColorInputType::handleDOMActivateEvent):
2890         (WebCore::ColorInputType::didChooseColor):
2891         (WebCore::ColorInputType::updateColorSwatch):
2892         (WebCore::ColorInputType::shadowColorSwatch const):
2893         (WebCore::ColorInputType::elementRectRelativeToRootView const):
2894         (WebCore::ColorInputType::shouldShowSuggestions const):
2895         (WebCore::ColorInputType::suggestions const):
2896         * html/EmailInputType.cpp:
2897         (WebCore::EmailInputType::typeMismatchFor const):
2898         (WebCore::EmailInputType::typeMismatch const):
2899         (WebCore::EmailInputType::typeMismatchText const):
2900         (WebCore::EmailInputType::sanitizeValue const):
2901         * html/FileInputType.cpp:
2902         (WebCore::FileInputType::appendFormData const):
2903         (WebCore::FileInputType::attributeChanged): Add a nullptr check here, since
2904         this is called directly by code that causes the old InputType to be removed,
2905         which could leave us with a nullptr element().
2906         (WebCore::FileInputType::valueMissing const):
2907         (WebCore::FileInputType::valueMissingText const):
2908         (WebCore::FileInputType::handleDOMActivateEvent):
2909         (WebCore::FileInputType::createInputRenderer):
2910         (WebCore::FileInputType::setValue):
2911         (WebCore::FileInputType::createShadowSubtree):
2912         (WebCore::FileInputType::disabledAttributeChanged):
2913         (WebCore::FileInputType::multipleAttributeChanged):
2914         (WebCore::FileInputType::allowsDirectories const):
2915         (WebCore::FileInputType::setFiles):
2916         (WebCore::FileInputType::iconLoaded):
2917         (WebCore::FileInputType::receiveDroppedFiles):
2918         (WebCore::FileInputType::defaultToolTip const):
2919         * html/HTMLInputElement.h:
2920         (WebCore::HTMLInputElement::weakPtrFactory const):
2921         * html/HiddenInputType.cpp:
2922         (WebCore::HiddenInputType::saveFormControlState const):
2923         (WebCore::HiddenInputType::restoreFormControlState):
2924         (WebCore::HiddenInputType::setValue):
2925         (WebCore::HiddenInputType::appendFormData const):
2926         * html/ImageInputType.cpp:
2927         (WebCore::ImageInputType::appendFormData const):
2928         (WebCore::ImageInputType::handleDOMActivateEvent):
2929         (WebCore::ImageInputType::createInputRenderer):
2930         (WebCore::ImageInputType::altAttributeChanged):
2931         (WebCore::ImageInputType::srcAttributeChanged):
2932         (WebCore::ImageInputType::attach):
2933         (WebCore::ImageInputType::height const):
2934         (WebCore::ImageInputType::width const):
2935         * html/InputType.cpp:
2936         (WebCore::InputType::saveFormControlState const):
2937         (WebCore::InputType::restoreFormControlState):
2938         (WebCore::InputType::isFormDataAppendable const):
2939         (WebCore::InputType::appendFormData const):
2940         (WebCore::InputType::sizeShouldIncludeDecoration const):
2941         (WebCore::InputType::validationMessage const):
2942         (WebCore::InputType::createInputRenderer):
2943         (WebCore::InputType::blur):
2944         (WebCore::InputType::destroyShadowSubtree):
2945         (WebCore::InputType::dispatchSimulatedClickIfActive const):
2946         (WebCore::InputType::chrome const):
2947         (WebCore::InputType::isKeyboardFocusable const):
2948         (WebCore::InputType::isMouseFocusable const):
2949         (WebCore::InputType::accessKeyAction):
2950         (WebCore::InputType::setValue):
2951         (WebCore::InputType::visibleValue const):
2952         (WebCore::InputType::applyStep):
2953         (WebCore::InputType::stepUpFromRenderer):
2954         * html/InputType.h:
2955         (WebCore::InputType::InputType):
2956         (WebCore::InputType::element const):
2957         * html/NumberInputType.cpp:
2958         (WebCore::NumberInputType::attributeChanged): Add a nullptr check here, since
2959         this is called directly by code that causes the old InputType to be removed,
2960         which could leave us with a nullptr element().
2961         (WebCore::NumberInputType::setValue):
2962         (WebCore::NumberInputType::valueAsDouble const):
2963         (WebCore::NumberInputType::setValueAsDouble const):
2964         (WebCore::NumberInputType::setValueAsDecimal const):
2965         (WebCore::NumberInputType::typeMismatch const):
2966         (WebCore::NumberInputType::createStepRange const):
2967         (WebCore::NumberInputType::sizeShouldIncludeDecoration const):
2968         (WebCore::NumberInputType::decorationWidth const):
2969         (WebCore::NumberInputType::localizeValue const):
2970         (WebCore::NumberInputType::visibleValue const):
2971         (WebCore::NumberInputType::convertFromVisibleValue const):
2972         (WebCore::NumberInputType::hasBadInput const):
2973         (WebCore::NumberInputType::minOrMaxAttributeChanged):
2974         (WebCore::NumberInputType::stepAttributeChanged):
2975         * html/RadioInputType.cpp:
2976         (WebCore::RadioInputType::valueMissing const):
2977         (WebCore::RadioInputType::handleKeydownEvent):
2978         (WebCore::RadioInputType::handleKeyupEvent):
2979         (WebCore::RadioInputType::isKeyboardFocusable const):
2980         (WebCore::RadioInputType::shouldSendChangeEventAfterCheckedChanged):
2981         (WebCore::RadioInputType::willDispatchClick):
2982         (WebCore::RadioInputType::didDispatchClick):
2983         (WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
2984         * html/RangeInputType.cpp:
2985         (WebCore::RangeInputType::attributeChanged): Add a nullptr check here, since
2986         this is called directly by code that causes the old InputType to be removed,
2987         which could leave us with a nullptr element().
2988         (WebCore::RangeInputType::valueAsDouble const):
2989         (WebCore::RangeInputType::setValueAsDecimal const):
2990         (WebCore::RangeInputType::createStepRange const):
2991         (WebCore::RangeInputType::handleMouseDownEvent):
2992         (WebCore::RangeInputType::handleTouchEvent):
2993         (WebCore::RangeInputType::handleKeydownEvent):
2994         (WebCore::RangeInputType::createShadowSubtree):
2995         (WebCore::RangeInputType::sliderTrackElement const):
2996         (WebCore::RangeInputType::createInputRenderer):
2997         (WebCore::RangeInputType::accessKeyAction):
2998         (WebCore::RangeInputType::minOrMaxAttributeChanged):
2999         (WebCore::RangeInputType::setValue):
3000         (WebCore::RangeInputType::updateTickMarkValues):
3001         * html/ResetInputType.cpp:
3002         (WebCore::ResetInputType::handleDOMActivateEvent):
3003         * html/SearchInputType.cpp:
3004         (WebCore::SearchInputType::addSearchResult):
3005         (WebCore::SearchInputType::maxResultsAttributeChanged):
3006         (WebCore::SearchInputType::createInputRenderer):
3007         (WebCore::SearchInputType::createShadowSubtree):
3008         (WebCore::SearchInputType::handleKeydownEvent):
3009         (WebCore::SearchInputType::startSearchEventTimer):
3010         (WebCore::SearchInputType::searchEventTimerFired):
3011         (WebCore::SearchInputType::searchEventsShouldBeDispatched const):
3012         (WebCore::SearchInputType::didSetValueByUserEdit):
3013         (WebCore::SearchInputType::sizeShouldIncludeDecoration const):
3014         * html/SubmitInputType.cpp:
3015         (WebCore::SubmitInputType::appendFormData const):
3016         (WebCore::SubmitInputType::handleDOMActivateEvent):
3017         * html/TextFieldInputType.cpp:
3018         (WebCore::TextFieldInputType::attributeChanged): Add a nullptr check here, since
3019         this is called directly by code that causes the old InputType to be removed,
3020         which could leave us with a nullptr element().
3021         (WebCore::TextFieldInputType::isKeyboardFocusable const):
3022         (WebCore::TextFieldInputType::isMouseFocusable const):
3023         (WebCore::TextFieldInputType::valueMissing const):
3024         (WebCore::TextFieldInputType::setValue):
3025         (WebCore::TextFieldInputType::handleKeydownEvent):
3026         (WebCore::TextFieldInputType::handleKeydownEventForSpinButton):
3027         (WebCore::TextFieldInputType::forwardEvent):
3028         (WebCore::TextFieldInputType::elementDidBlur):
3029         (WebCore::TextFieldInputType::handleFocusEvent):
3030         (WebCore::TextFieldInputType::handleBlurEvent):
3031         (WebCore::TextFieldInputType::createInputRenderer):
3032         (WebCore::TextFieldInputType::shouldHaveSpinButton const):
3033         (WebCore::TextFieldInputType::shouldHaveCapsLockIndicator const):
3034         (WebCore::TextFieldInputType::createShadowSubtree):
3035         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
3036         (WebCore::TextFieldInputType::updatePlaceholderText):
3037         (WebCore::TextFieldInputType::appendFormData const):
3038         (WebCore::TextFieldInputType::subtreeHasChanged):
3039         (WebCore::TextFieldInputType::didSetValueByUserEdit):
3040         (WebCore::TextFieldInputType::updateInnerTextValue):
3041         (WebCore::TextFieldInputType::focusAndSelectSpinButtonOwner):
3042         (WebCore::TextFieldInputType::shouldSpinButtonRespondToMouseEvents):
3043         (WebCore::TextFieldInputType::shouldSpinButtonRespondToWheelEvents):
3044         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
3045         (WebCore::TextFieldInputType::shouldDrawAutoFillButton const):
3046         (WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
3047         (WebCore::TextFieldInputType::createContainer):
3048         (WebCore::TextFieldInputType::createAutoFillButton):
3049         (WebCore::TextFieldInputType::updateAutoFillButton):
3050         * html/URLInputType.cpp:
3051         (WebCore::URLInputType::typeMismatch const):
3052
3053 2018-06-04  Chris Dumez  <cdumez@apple.com>
3054
3055         Unreviewed iOS build fix with recent SDKs.
3056
3057         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3058         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3059
3060 2018-06-04  Dean Jackson  <dino@apple.com>
3061
3062         AR Badging on transparent thumbnail images makes the glyph look really dark
3063         https://bugs.webkit.org/show_bug.cgi?id=186289
3064         <rdar://problem/40627111>
3065
3066         Reviewed by Anders Carlsson.
3067
3068         Clip out the shape for the drop shadow, so that it isn't visible if
3069         there is transparent pixel data on top of it.
3070
3071         * rendering/RenderThemeIOS.mm:
3072         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
3073
3074 2018-06-04  Timothy Hatcher  <timothy@apple.com>
3075
3076         Selection color is dark when using Safari in dark mode.
3077
3078         https://bugs.webkit.org/show_bug.cgi?id=186288
3079         rdar://problem/38438625
3080
3081         Reviewed by Simon Fraser.
3082
3083         Pass StyleColor::Options to all of the selection color functions.
3084         Removed supportsSelectionForegroundColors() from RenderThemeMac,
3085         to get the default of true, since the forground colors in dark mode
3086         can be different now. Use new semantic color methods on NSColor.
3087
3088         * rendering/RenderElement.cpp:
3089         (WebCore::RenderElement::selectionColor const):
3090         (WebCore::RenderElement::selectionBackgroundColor const):
3091         * rendering/RenderListBox.cpp:
3092         (WebCore::RenderListBox::paintItemForeground):
3093         (WebCore::RenderListBox::paintItemBackground):
3094         * rendering/RenderTheme.cpp:
3095         (WebCore::RenderTheme::activeSelectionBackgroundColor const):
3096         (WebCore::RenderTheme::inactiveSelectionBackgroundColor const):
3097         (WebCore::RenderTheme::activeSelectionForegroundColor const):
3098         (WebCore::RenderTheme::inactiveSelectionForegroundColor const):
3099         (WebCore::RenderTheme::activeListBoxSelectionBackgroundColor const):
3100         (WebCore::RenderTheme::activeListBoxSelectionForegroundColor const):
3101         (WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor const):
3102         (WebCore::RenderTheme::platformActiveSelectionBackgroundColor const):
3103         (WebCore::RenderTheme::platformActiveSelectionForegroundColor const):
3104         (WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const):
3105         (WebCore::RenderTheme::platformInactiveSelectionForegroundColor const):
3106         (WebCore::RenderTheme::platformActiveListBoxSelectionBackgroundColor const):
3107         (WebCore::RenderTheme::platformActiveListBoxSelectionForegroundColor const):
3108         (WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const):
3109         (WebCore::RenderTheme::platformInactiveListBoxSelectionForegroundColor const):
3110         * rendering/RenderTheme.h:
3111         * rendering/RenderThemeGtk.cpp:
3112         (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor const):
3113         (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor const):
3114         (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor const):
3115         (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor const):
3116         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor const):
3117         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor const):
3118         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor const):
3119         * rendering/RenderThemeGtk.h:
3120         * rendering/RenderThemeIOS.h:
3121         * rendering/RenderThemeIOS.mm:
3122         (WebCore::RenderThemeIOS::platformActiveSelectionBackgroundColor const):
3123         (WebCore::RenderThemeIOS::platformInactiveSelectionBackgroundColor const):
3124         * rendering/RenderThemeMac.h:
3125         * rendering/RenderThemeMac.mm:
3126         (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const):
3127         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
3128         (WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
3129         (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
3130         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
3131         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
3132         (WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const):
3133         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
3134         * rendering/RenderThemeWin.cpp:
3135         (WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const):
3136         (WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const):
3137         (WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const):
3138         (WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
3139         * rendering/RenderThemeWin.h:
3140
3141 2018-06-04  Chris Dumez  <cdumez@apple.com>
3142
3143         Update Fetch code to provide more useful exception messages
3144         https://bugs.webkit.org/show_bug.cgi?id=186156
3145
3146         Reviewed by Youenn Fablet.
3147
3148         Provide more useful error messages in our Loading / Fetch code.
3149
3150         * Modules/fetch/FetchBodyOwner.cpp:
3151         (WebCore::FetchBodyOwner::arrayBuffer):
3152         (WebCore::FetchBodyOwner::blob):
3153         (WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
3154         (WebCore::FetchBodyOwner::formData):
3155         (WebCore::FetchBodyOwner::json):
3156         (WebCore::FetchBodyOwner::text):
3157         * Modules/fetch/FetchHeaders.cpp:
3158         (WebCore::canWriteHeader):
3159         (WebCore::FetchHeaders::get const):
3160         (WebCore::FetchHeaders::has const):
3161         * Modules/fetch/FetchRequest.cpp:
3162         (WebCore::FetchRequest::setBody):
3163         (WebCore::FetchRequest::clone):
3164         * Modules/fetch/FetchResponse.cpp:
3165         (WebCore::FetchResponse::redirect):
3166         (WebCore::FetchResponse::clone):
3167         * workers/service/context/ServiceWorkerFetch.cpp:
3168         (WebCore::ServiceWorkerFetch::processResponse):
3169         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
3170         * workers/service/context/ServiceWorkerFetch.h:
3171
3172 2018-06-04  Daniel Bates  <dabates@apple.com>
3173
3174         Update Strong Password appearance
3175         https://bugs.webkit.org/show_bug.cgi?id=186239
3176         <rdar://problem/38183795>
3177
3178         Reviewed by Brent Fulgham.
3179
3180         Fix up the gradient mask to start half-way through the visible text and size it to the
3181         width of the visible text. Also change the color of the Strong Password label to 80% black.
3182
3183         We achieve sizing of the gradient to the width of the visible text by changing the CSS display
3184         of the inner text element to be an inline-block and specifying "max-width: 100%" so that
3185         its maximum width is less than or equal to the width of its containing block. Additionally,
3186         only apply strong password-specific inner text element styles when the field is not disabled
3187         or read-only and has a strong password appearance. Otherwise these styles, specifically the
3188         display type, will adversely effect rendering of the text when the field is disabled or readonly.
3189
3190         * css/html.css:
3191         (input::-webkit-strong-password-auto-fill-button):
3192         * html/HTMLInputElement.cpp:
3193         (WebCore::autoFillStrongPasswordMaskImage):
3194         (WebCore::HTMLInputElement::createInnerTextStyle):
3195
3196 2018-06-04  Wenson Hsieh  <wenson_hsieh@apple.com>
3197
3198         [WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag
3199         https://bugs.webkit.org/show_bug.cgi?id=186279
3200
3201         Reviewed by Tim Horton.
3202
3203         Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS). No change in behavior.
3204
3205         * Modules/mediacontrols/MediaControlsHost.cpp:
3206         (WebCore::MediaControlsHost::compactMode const):
3207         * html/HTMLMediaElement.cpp:
3208         (WebCore::HTMLMediaElement::updatePlayState):
3209         * page/Page.cpp:
3210         (WebCore::relevantViewRect):
3211         * page/SettingsBase.cpp:
3212         (WebCore::SettingsBase::defaultMinimumZoomFontSize):
3213         (WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
3214         * page/ViewportConfiguration.cpp:
3215         (WebCore::platformDeviceWidthOverride):
3216         (WebCore::shouldOverrideShrinkToFitArgument):
3217         (WebCore::needsUpdateAfterChangingDisabledAdaptations):
3218         * platform/LocalizedStrings.cpp:
3219         * platform/LocalizedStrings.h:
3220         * platform/audio/ios/MediaSessionManagerIOS.mm:
3221         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
3222         (-[WebMediaSessionHelper dealloc]):
3223         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
3224         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3225         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
3226         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
3227         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
3228         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
3229         (WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):
3230         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3231         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
3232         (-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
3233         (-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
3234         (-[WebAVPlayerViewController MY_NO_RETURN]):
3235         (-[WebAVPlayerViewController isPictureInPicturePossible]):
3236         (-[WebAVPlayerViewController isPictureInPictureActive]):
3237         (-[WebAVPlayerViewController pictureInPictureActive]):
3238         (-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
3239         (-[WebAVPlayerViewController showsPlaybackControls]):
3240         (-[WebAVPlayerViewController setShowsPlaybackControls:]):
3241         (-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
3242         (-[WebAVPlayerViewController setDelegate:]):
3243         (VideoFullscreenInterfaceAVKit::setupFullscreen):
3244         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
3245         (VideoFullscreenInterfaceAVKit::doSetup):
3246         (WebCore::supportsPictureInPicture):
3247         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3248         (VideoFullscreenControllerContext::willExitFullscreen):
3249         * rendering/RenderThemeIOS.h:
3250         * rendering/RenderThemeIOS.mm:
3251
3252 2018-06-04  Youenn Fablet  <youenn@apple.com>
3253
3254         [WK1] Add an option to restrict communication to localhost sockets
3255         https://bugs.webkit.org/show_bug.cgi?id=186249
3256
3257         Reviewed by Eric Carlson.
3258
3259         Covered by existing tests.
3260         Set explicitly webrtc socket IP address to 127.0.0.1 in testing mode.
3261         For that purpose, we need WK1 to create a wrapper around a socket factory,
3262         this wrapper being responsible of setting or not the IP address to 127.0.0.1.
3263
3264         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3265         (WebCore::prepareSocketAddress):
3266         (WebCore::BasicPacketSocketFactory::BasicPacketSocketFactory):
3267         (WebCore::BasicPacketSocketFactory::setDisableNonLocalhostConnections):
3268         (WebCore::BasicPacketSocketFactory::CreateClientTcpSocket):
3269         (WebCore::LibWebRTCProvider::createPeerConnection):
3270         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3271
3272 2018-06-04  Zalan Bujtas  <zalan@apple.com>
3273
3274         [LFC] Merge width and margin computation for block-level, non-replaced and inline,replaced element in normal flow
3275         https://bugs.webkit.org/show_bug.cgi?id=186225
3276
3277         Reviewed by Antti Koivisto.
3278
3279         This patch merges the width and horizontal margin computation for
3280         https://www.w3.org/TR/CSS22/visudet.html#inline-replaced-width and https://www.w3.org/TR/CSS22/visudet.html#blockwidth
3281
3282         * layout/FormattingContextGeometry.cpp:
3283         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3284         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3285         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3286
3287 2018-06-01  Zalan Bujtas  <zalan@apple.com>
3288
3289         [LFC] Merge width and horizontal margin computation
3290         https://bugs.webkit.org/show_bug.cgi?id=186217
3291
3292         Reviewed by Antti Koivisto.
3293
3294         We could certainly compute width and maring separately, but to match each steps defined
3295         at https://www.w3.org/TR/CSS22/visudet.html, we should just merge width and horizontal margin computations
3296         (followed by height and vertical margins).
3297         Use 0 computed marings for now.
3298
3299         * layout/FormattingContext.cpp:
3300         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
3301         (WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const):
3302         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
3303         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
3304         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const): Deleted.
3305         (WebCore::Layout::FormattingContext::computeFloatingWidth const): Deleted.
3306         * layout/FormattingContext.h:
3307         * layout/FormattingContextGeometry.cpp:
3308         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin):
3309         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin):
3310         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3311         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
3312         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin):
3313         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
3314         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3315         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
3316         (WebCore::Layout::outOfFlowNonReplacedWidth): Deleted.
3317         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth): Deleted.
3318         (WebCore::Layout::floatingNonReplacedWidth): Deleted.
3319         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth): Deleted.
3320         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidth): Deleted.
3321         (WebCore::Layout::FormattingContext::Geometry::floatingWidth): Deleted.
3322         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth): Deleted.
3323         * layout/LayoutContext.cpp:
3324         (WebCore::Layout::LayoutContext::initializeRoot):
3325         * layout/blockformatting/BlockFormattingContext.cpp:
3326         (WebCore::Layout::BlockFormattingContext::layout const):
3327         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3328         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
3329         (WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
3330         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const): Deleted.
3331         (WebCore::Layout::BlockFormattingContext::computeMargin const): Deleted.
3332         * layout/blockformatting/BlockFormattingContext.h:
3333         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3334         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3335         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
3336         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth): Deleted.
3337         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidth): Deleted.
3338         (WebCore::Layout::BlockFormattingContext::Geometry::computedMargin): Deleted.
3339         * layout/displaytree/DisplayBox.cpp:
3340         (WebCore::Display::Box::marginBox const):
3341         * layout/displaytree/DisplayBox.h:
3342         (WebCore::Display::Box::setHasValidVerticalMargin):
3343         (WebCore::Display::Box::setHasValidHorizontalMargin):
3344         (WebCore::Display::Box::invalidateMargin):
3345         (WebCore::Display::Box::setHorizontalMargin):
3346         (WebCore::Display::Box::setVerticalMargin):
3347         (WebCore::Display::Box::marginTop const):
3348         (WebCore::Display::Box::marginLeft const):
3349         (WebCore::Display::Box::marginBottom const):
3350         (WebCore::Display::Box::marginRight const):
3351         (WebCore::Display::Box::Edges::Edges): Deleted.
3352         (WebCore::Display::Box::setHasValidMargin): Deleted.
3353         (WebCore::Display::Box::setMargin): Deleted.
3354
3355 2018-06-03  Michael Catanzaro  <mcatanzaro@igalia.com>
3356
3357         REGRESSION(r232338): [GTK] Broke a few layout tests
3358         https://bugs.webkit.org/show_bug.cgi?id=186244
3359
3360 &nbs